main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718
  1. window.common = null;
  2. window.MathLight = null;
  3. window.math = null
  4. g_playAudio = null
  5. g_tourAudio = new Audio
  6. g_tourAudio.loop = !1
  7. g_tourAudio.crossOrigin = "anonymous"
  8. g_tourAudio.addEventListener("ended", function() {
  9. var e = document.createEvent("MouseEvent");
  10. e.initEvent("tourAudioEnded", !0, !0),
  11. window.dispatchEvent(e)
  12. })
  13. g_tourAudio.oncanplaythrough = function() {
  14. g_tourAudio.play();
  15. if(g_bgAudio && !g_bgAudio.paused){
  16. manage.switchBgmState(false);
  17. g_bgAudio.pauseByTour = true
  18. }
  19. g_playAudio = g_tourAudio;
  20. }
  21. var sortByScore = function(list, request, rank) {
  22. var i = common.filterAll(list, request);
  23. return 0 === i.length ? null : i = i.map(function(e) {
  24. return {
  25. item: e,
  26. score: rank.reduce(function(t, i) {
  27. return t + i(e);
  28. }, 0)
  29. };
  30. }).sort(function(e, t) {
  31. return t.score - e.score;
  32. });
  33. };
  34. var convertTool = {
  35. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  36. var camera = camera || player.camera;
  37. var dom = dom || player.domElement;
  38. 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);
  39. var x,y;
  40. x = (pos.x + 1) / 2 * dom.clientWidth;
  41. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  42. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  43. && y <= dom.clientHeight && y >= 0
  44. return {
  45. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  46. vector: pos, //(范围 -1 ~ 1)
  47. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  48. inSight : inSight //在屏幕范围内可见
  49. };
  50. },
  51. ifShelter: function(pos3d, pos2d){//检测某点在视线中是否被mesh遮挡
  52. if(!pos2d) pos2d = this.getPos2d(pos3d);
  53. var player = player;
  54. var ori = new THREE.Vector3(pos2d.x, pos2d.y, -1).unproject(player.camera); //找到视线原点
  55. var dir = pos3d.clone().sub(ori).normalize();
  56. ray.set(ori, dir)//由外向里 因为模型从内侧是可见的所以从外侧
  57. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  58. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  59. }else{ */
  60. var o = ray.intersectObjects(player.model.colliders);
  61. //}
  62. var len = pos3d.distanceTo(ori);
  63. if (o && o.length) {
  64. for(var i=0;i<o.length;i++){
  65. if(o[i].distance < len){ return true; }//有遮挡
  66. }
  67. }
  68. },
  69. /*
  70. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  71. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  72. */
  73. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  74. var A = pos;
  75. var player = player;
  76. var mouse = player.mouse;
  77. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  78. if(info.y != void 0){//地面线的
  79. var y = info.y;
  80. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  81. //intersectPlane和地面平行,无交点
  82. var x = pos.x, z = pos.z;
  83. }else{
  84. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  85. if(O.y == A.y){console.log('一样??');return;}
  86. if(A.y == y){console.log('一样2??');return;}
  87. var r = (O.y-y)/(A.y-y);
  88. var x = (r*A.x-O.x)/(r-1);
  89. var z = (r*A.z-O.z)/(r-1);
  90. }
  91. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  92. var N = info.normalVec;
  93. var P = info.pullPos;
  94. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  95. if(O.z==A.z){console.log('O.z==A.z?');return;}
  96. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  97. //console.log('N.z==0 && N.x == 0?');
  98. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  99. if(c == 0){console.log("分母为0?? return;");return;}
  100. 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
  101. var x = t * (A.x - O.x) + O.x;
  102. var y = t * (A.y - O.y) + O.y;
  103. var z = t * (A.z - O.z) + O.z;
  104. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  105. 求直线L与平面π的交点的坐标。
  106. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  107. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  108. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  109. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  110. 再代入参数方程即得交点的坐标(x,y,z). */
  111. }else if(N.x ==0 ){ //z与pullPos相等
  112. var z = P.z;
  113. if(O.y == A.y){console.log('一样??');return;}
  114. if(A.y == y){console.log('一样2??');return;}
  115. if(A.z == z){console.log('一样3??');return;}
  116. var r = (O.z-z)/(A.z-z);
  117. var x = (r*A.x-O.x)/(r-1);
  118. var y = (r*A.y-O.y)/(r-1);
  119. }else if(N.z == 0){//x与pullPos相等
  120. var x = P.x;
  121. if(O.y == A.y){console.log('一样??');return;}
  122. if(A.y == y){console.log('一样2??');return;}
  123. if(A.x == x){console.log('一样3??');return;}
  124. var r = (O.x-x)/(A.x-x);
  125. var y = (r*A.y-O.y)/(r-1);
  126. var z = (r*A.z-O.z)/(r-1);
  127. }
  128. }
  129. return new THREE.Vector3(x,y,z);
  130. },
  131. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  132. var raycaster = new THREE.Raycaster;
  133. camera.updateMatrixWorld();
  134. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  135. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  136. var dir = end.sub(origin).normalize()
  137. raycaster.set(origin, dir);
  138. var n = raycaster.intersectObjects(meshes);
  139. if (0 === n.length)
  140. return null;
  141. return n[0];
  142. },
  143. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  144. var dir = B.clone().sub(A).normalize();
  145. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  146. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  147. var o = ray.intersectObjects(options.model || player.model.colliders);
  148. if (o && o.length)return o;
  149. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  150. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  151. normal.multiplyScalar(options.throughWidth)
  152. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  153. var A2 = A.clone().add(normalVec3)
  154. ray.set(A2, dir);
  155. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  156. ray.set(A.clone().add(normalVec3.negate()), dir);
  157. if (o2 && o2.length)return o2;
  158. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  159. if (o3 && o3.length)return o3;
  160. }
  161. return null;
  162. },
  163. getPosAtSphere : function(pos3d, toPanoPos){
  164. var dir = pos3d.clone().sub(toPanoPos);
  165. dir.normalize();//然后计算在球中
  166. dir.multiplyScalar(Constants.skyRadius);
  167. dir.add(toPanoPos);
  168. return dir;
  169. }
  170. }
  171. var dom = {
  172. getOffset: function(e, t, i) {
  173. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  174. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  175. left += "left" == e ? t.offsetLeft : t.offsetTop;
  176. return left
  177. }
  178. };
  179. if (function() {
  180. "use strict";
  181. function o(e, t) {
  182. return typeof e === t
  183. }
  184. function a(e, t) {
  185. return e instanceof t
  186. }
  187. function s(e) {
  188. return e && e.nodeType
  189. }
  190. function l(e) {
  191. return s(e) ? e : a(e, y) ? e[0] : void 0
  192. }
  193. function e(e, i, n) {
  194. return y.each(e, function(e, t) {
  195. n = i.call(t, n, e, t)
  196. }),
  197. n
  198. }
  199. function t(e, t, i) {
  200. var n, r, o;
  201. if (e === t)
  202. return !0;
  203. if (!e || !t || e.constructor !== t.constructor)
  204. return !1;
  205. for (n = 0,
  206. r = i.length; n < r; n += 1) {
  207. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  208. return !1;
  209. if (e[o] !== t[o])
  210. return !1
  211. }
  212. return !0
  213. }
  214. function c(e, t, i, n) {
  215. this.left = w(e),
  216. this.top = w(t),
  217. this.width = w(i),
  218. this.height = w(n),
  219. this.right = this.left + this.width,
  220. this.bottom = this.top + this.height
  221. }
  222. function h(e, t, i, n) {
  223. this.visible = e || 0,
  224. this.viewport = t || 0,
  225. this.possible = i || 0,
  226. this.rects = n && I({}, n) || null
  227. }
  228. function r(e, t) {
  229. this.els = e,
  230. this.viewport = t
  231. }
  232. function n(e, t) {
  233. return e.val - t.val
  234. }
  235. function u(e, t) {
  236. return t.val - e.val
  237. }
  238. function d(e) {
  239. var t = c.ofContent(e, !0)
  240. , i = c.ofViewport(e, !0)
  241. , n = t.width - i.width
  242. , r = t.height - i.height;
  243. this.content = t,
  244. this.viewport = i,
  245. this.width = n <= 0 ? null : i.left / n,
  246. this.height = r <= 0 ? null : i.top / r,
  247. this.left = i.left,
  248. this.top = i.top,
  249. this.right = t.right - i.right,
  250. this.bottom = t.bottom - i.bottom
  251. }
  252. function p(e) {
  253. this.el = e || window
  254. }
  255. function f(e, t) {
  256. this.context = e,
  257. this.viewport = t,
  258. this.init()
  259. }
  260. function g(e, t, i, n) {
  261. this.context = new r(e,t),
  262. this.property = i,
  263. this.descending = n,
  264. this.init()
  265. }
  266. function m(e) {
  267. e && e !== window && e !== document ? (this.context = e,
  268. this.$autoTarget = y(e)) : this.context = window,
  269. this.init()
  270. }
  271. 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 = {},
  272. v = 1,
  273. function(e) {
  274. return e ? (i[e] || (i[e] = v,
  275. v += 1),
  276. i[e]) : 0
  277. }
  278. );
  279. I(c.prototype, {
  280. equals: function(e) {
  281. return t(this, e, ["left", "top", "width", "height"])
  282. },
  283. area: function() {
  284. return this.width * this.height
  285. },
  286. relativeTo: function(e) {
  287. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  288. },
  289. intersection: function(e) {
  290. if (!a(e, c))
  291. return null;
  292. var t = _(this.left, e.left)
  293. , i = b(this.right, e.right)
  294. , n = _(this.top, e.top)
  295. , r = i - t
  296. , o = b(this.bottom, e.bottom) - n;
  297. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  298. },
  299. envelope: function(e) {
  300. if (!a(e, c))
  301. return this;
  302. var t = b(this.left, e.left)
  303. , i = _(this.right, e.right)
  304. , n = b(this.top, e.top);
  305. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  306. }
  307. }),
  308. I(c, {
  309. ofContent: function(e, t) {
  310. 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())
  311. },
  312. ofViewport: function(e, t) {
  313. 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())
  314. },
  315. ofElement: function(e) {
  316. var t = y(e);
  317. if (!t.is(":visible"))
  318. return null;
  319. var i = t.offset();
  320. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  321. }
  322. }),
  323. I(h.prototype, {
  324. equals: function(e) {
  325. return this.fracsEqual(e) && this.rectsEqual(e)
  326. },
  327. fracsEqual: function(e) {
  328. return t(this, e, ["visible", "viewport", "possible"])
  329. },
  330. rectsEqual: function(e) {
  331. return t(this.rects, e.rects, ["document", "element", "viewport"])
  332. }
  333. }),
  334. I(h, {
  335. of: function(e, t) {
  336. var i, n, r;
  337. return e = s(e) && c.ofElement(e) || e,
  338. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  339. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  340. r = b(e.width, t.width) * b(e.height, t.height),
  341. new h(n / e.area(),n / t.area(),n / r,{
  342. document: i,
  343. element: i.relativeTo(e),
  344. viewport: i.relativeTo(t)
  345. })) : new h
  346. }
  347. });
  348. var x = ["width", "height", "left", "right", "top", "bottom"]
  349. , S = ["possible", "visible", "viewport"];
  350. I(r.prototype, {
  351. sorted: function(t, e) {
  352. var i = this.viewport;
  353. return y.map(this.els, function(e) {
  354. return {
  355. el: e,
  356. val: function(e, t, i) {
  357. var n;
  358. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  359. n ? n[i] : 0
  360. }(e, i, t)
  361. }
  362. }).sort(e ? u : n)
  363. },
  364. best: function(e, t) {
  365. return this.els.length ? this.sorted(e, t)[0] : null
  366. }
  367. }),
  368. I(d.prototype, {
  369. equals: function(e) {
  370. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  371. }
  372. }),
  373. I(p.prototype, {
  374. equals: function(e) {
  375. return t(this, e, ["el"])
  376. },
  377. scrollState: function() {
  378. return new d(this.el)
  379. },
  380. scrollTo: function(e, t, i) {
  381. var n = y(this.el === window ? "html,body" : this.el);
  382. e = e || 0,
  383. t = t || 0,
  384. i = isNaN(i) ? 1e3 : i,
  385. n.stop(!0).animate({
  386. scrollLeft: e,
  387. scrollTop: t
  388. }, i)
  389. },
  390. scroll: function(e, t, i) {
  391. var n = this.el === window ? A : y(this.el);
  392. e = e || 0,
  393. t = t || 0,
  394. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  395. },
  396. scrollToRect: function(e, t, i, n) {
  397. t = t || 0,
  398. i = i || 0,
  399. this.scrollTo(e.left - t, e.top - i, n)
  400. },
  401. scrollToElement: function(e, t, i, n) {
  402. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  403. this.scrollToRect(r, t, i, n)
  404. }
  405. });
  406. var M = {
  407. init: function() {
  408. this.callbacks = y.Callbacks("memory unique"),
  409. this.currVal = null,
  410. this.prevVal = null,
  411. this.checkProxy = y.proxy(this.check, this),
  412. this.autoCheck()
  413. },
  414. bind: function(e) {
  415. this.callbacks.add(e)
  416. },
  417. unbind: function(e) {
  418. e ? this.callbacks.remove(e) : this.callbacks.empty()
  419. },
  420. trigger: function() {
  421. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  422. },
  423. check: function(e) {
  424. var t = this.updatedValue(e);
  425. return void 0 !== t && (this.prevVal = this.currVal,
  426. this.currVal = t,
  427. this.trigger(),
  428. !0)
  429. },
  430. $autoTarget: A,
  431. autoEvents: "load resize scroll",
  432. autoCheck: function(e) {
  433. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  434. }
  435. };
  436. I(f.prototype, M, {
  437. updatedValue: function() {
  438. var e = h.of(this.context, this.viewport);
  439. return this.currVal && this.currVal.equals(e) ? void 0 : e
  440. }
  441. }),
  442. I(g.prototype, M, {
  443. updatedValue: function() {
  444. var e = this.context.best(this.property, this.descending);
  445. return e && (e = 0 < e.val ? e.el : null,
  446. this.currVal !== e) ? e : void 0
  447. }
  448. }),
  449. I(m.prototype, M, {
  450. updatedValue: function() {
  451. var e = new d(this.context);
  452. return this.currVal && this.currVal.equals(e) ? void 0 : e
  453. }
  454. });
  455. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  456. function H(e, t, i, n) {
  457. return i = N(i) ? i.apply(e, t) : i,
  458. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  459. }
  460. R = U,
  461. P = {
  462. statics: {
  463. version: "0.15.0",
  464. Rect: c,
  465. Fractions: h,
  466. Group: r,
  467. ScrollState: d,
  468. Viewport: p,
  469. FracsCallbacks: f,
  470. GroupCallbacks: g,
  471. ScrollStateCallbacks: m,
  472. fracs: function(e, t) {
  473. return h.of(e, t)
  474. }
  475. },
  476. methods: {
  477. content: function(e) {
  478. return this.length ? c.ofContent(this[0], e) : null
  479. },
  480. envelope: function() {
  481. return e(this, function(e) {
  482. var t = c.ofElement(this);
  483. return e ? e.envelope(t) : t
  484. })
  485. },
  486. fracs: function(e, i, n) {
  487. o(e, "string") || (n = i,
  488. i = e,
  489. e = null),
  490. E(i) || (n = i,
  491. i = null),
  492. n = l(n);
  493. var r = U + ".fracs." + T(n);
  494. return "unbind" === e ? this.each(function() {
  495. var e = y(this).data(r);
  496. e && e.unbind(i)
  497. }) : "check" === e ? this.each(function() {
  498. var e = y(this).data(r);
  499. e && e.check()
  500. }) : E(i) ? this.each(function() {
  501. var e = y(this)
  502. , t = e.data(r);
  503. t || (t = new f(this,n),
  504. e.data(r, t)),
  505. t.bind(i)
  506. }) : this.length ? h.of(this[0], n) : null
  507. },
  508. intersection: function() {
  509. return e(this, function(e) {
  510. var t = c.ofElement(this);
  511. return e ? e.intersection(t) : t
  512. })
  513. },
  514. max: function(e, t, i) {
  515. return E(t) || (i = t,
  516. t = null),
  517. i = l(i),
  518. t ? (new g(this,i,e,!0).bind(t),
  519. this) : this.pushStack(new r(this,i).best(e, !0).el)
  520. },
  521. min: function(e, t, i) {
  522. return E(t) || (i = t,
  523. t = null),
  524. i = l(i),
  525. t ? (new g(this,i,e).bind(t),
  526. this) : this.pushStack(new r(this,i).best(e).el)
  527. },
  528. rect: function() {
  529. return this.length ? c.ofElement(this[0]) : null
  530. },
  531. scrollState: function(e, i) {
  532. var n = U + ".scrollState";
  533. return o(e, "string") || (i = e,
  534. e = null),
  535. "unbind" === e ? this.each(function() {
  536. var e = y(this).data(n);
  537. e && e.unbind(i)
  538. }) : "check" === e ? this.each(function() {
  539. var e = y(this).data(n);
  540. e && e.check()
  541. }) : E(i) ? this.each(function() {
  542. var e = y(this)
  543. , t = e.data(n);
  544. t || (t = new m(this),
  545. e.data(n, t)),
  546. t.bind(i)
  547. }) : this.length ? new d(this[0]) : null
  548. },
  549. scroll: function(e, t, i) {
  550. return this.each(function() {
  551. new p(this).scroll(e, t, i)
  552. })
  553. },
  554. scrollTo: function(e, t, i, n) {
  555. return y.isNumeric(e) && (n = i,
  556. i = t,
  557. t = e,
  558. e = null),
  559. e = l(e),
  560. this.each(function() {
  561. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  562. })
  563. },
  564. scrollToThis: function(e, t, i, n) {
  565. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  566. this
  567. },
  568. softLink: function(t, i, n, r) {
  569. return r = new p(l(r)),
  570. this.filter("a[href^=#]").each(function() {
  571. var e = y(this);
  572. e.on("click", function() {
  573. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  574. })
  575. })
  576. },
  577. sort: function(e, t, i) {
  578. return o(t, "boolean") || (i = t,
  579. t = null),
  580. i = l(i),
  581. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  582. return e.el
  583. }))
  584. },
  585. viewport: function(e) {
  586. return this.length ? c.ofViewport(this[0], e) : null
  587. }
  588. },
  589. defaultStatic: "fracs",
  590. defaultMethod: "fracs"
  591. },
  592. O = [].slice,
  593. L = jQuery,
  594. D = L.extend,
  595. N = L.isFunction,
  596. F = D({}, P),
  597. B = function() {
  598. return H(this, O.call(arguments), F.defaultStatic, B)
  599. }
  600. ,
  601. V = function(e) {
  602. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  603. }
  604. ,
  605. (k = function(e) {
  606. e && (D(B, e.statics),
  607. D(V, e.methods)),
  608. B.modplug = k
  609. }
  610. ).prev = {
  611. statics: L[R],
  612. methods: L.fn[R]
  613. },
  614. k(P),
  615. L[R] = B,
  616. L.fn[R] = V
  617. }(),
  618. "undefined" == typeof jQuery)
  619. throw new Error("Bootstrap's JavaScript requires jQuery");
  620. !function(m) {
  621. "use strict";
  622. function r(e, t) {
  623. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  624. this.init("tooltip", e, t)
  625. }
  626. r.VERSION = "3.2.0",
  627. r.DEFAULTS = {
  628. animation: !0,
  629. placement: "top",
  630. selector: !1,
  631. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  632. trigger: "hover focus",
  633. title: "",
  634. delay: 0,
  635. html: !1,
  636. container: !1,
  637. viewport: {
  638. selector: "body",
  639. padding: 0
  640. }
  641. },
  642. r.prototype.init = function(e, t, i) {
  643. this.enabled = !0,
  644. this.type = e,
  645. this.$element = m(t),
  646. this.options = this.getOptions(i),
  647. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  648. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  649. var o = n[r];
  650. if ("click" == o)
  651. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  652. else if ("manual" != o) {
  653. var a = "hover" == o ? "mouseenter" : "focusin"
  654. , s = "hover" == o ? "mouseleave" : "focusout";
  655. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  656. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  657. }
  658. }
  659. this.options.selector ? this._options = m.extend({}, this.options, {
  660. trigger: "manual",
  661. selector: ""
  662. }) : this.fixTitle()
  663. }
  664. ,
  665. r.prototype.getDefaults = function() {
  666. return r.DEFAULTS
  667. }
  668. ,
  669. r.prototype.getOptions = function(e) {
  670. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  671. show: e.delay,
  672. hide: e.delay
  673. }),
  674. e
  675. }
  676. ,
  677. r.prototype.getDelegateOptions = function() {
  678. var i = {}
  679. , n = this.getDefaults();
  680. return this._options && m.each(this._options, function(e, t) {
  681. n[e] != t && (i[e] = t)
  682. }),
  683. i
  684. }
  685. ,
  686. r.prototype.enter = function(e) {
  687. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  688. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  689. m(e.currentTarget).data("bs." + this.type, t)),
  690. clearTimeout(t.timeout),
  691. t.hoverState = "in",
  692. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  693. }
  694. ,
  695. r.prototype.leave = function(e) {
  696. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  697. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  698. m(e.currentTarget).data("bs." + this.type, t)),
  699. clearTimeout(t.timeout),
  700. t.hoverState = "out",
  701. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  702. "out" == t.hoverState && t.hide()
  703. }, t.options.delay.hide)) : t.hide()
  704. }
  705. ,
  706. r.prototype.show = function() {
  707. var e = m.Event("show.bs." + this.type);
  708. if (this.hasContent() && this.enabled) {
  709. this.$element.trigger(e);
  710. var t = m.contains(document.documentElement, this.$element[0]);
  711. if (e.isDefaultPrevented() || !t)
  712. return;
  713. var i = this
  714. , n = this.tip()
  715. , r = this.getUID(this.type);
  716. this.setContent(),
  717. n.attr("id", r),
  718. this.$element.attr("aria-describedby", r),
  719. this.options.animation && n.addClass("fade");
  720. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  721. , a = /\s?auto?\s?/i
  722. , s = a.test(o);
  723. s && (o = o.replace(a, "") || "top"),
  724. n.detach().css({
  725. top: 0,
  726. left: 0,
  727. display: "block"
  728. }).addClass(o).data("bs." + this.type, this),
  729. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  730. var l = this.getPosition()
  731. , c = n[0].offsetWidth
  732. , h = n[0].offsetHeight;
  733. if (s) {
  734. var u = o
  735. , d = this.$element.parent()
  736. , p = this.getPosition(d);
  737. 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,
  738. n.removeClass(u).addClass(o)
  739. }
  740. var f = this.getCalculatedOffset(o, l, c, h);
  741. this.applyPlacement(f, o);
  742. var g = function() {
  743. i.$element.trigger("shown.bs." + i.type),
  744. i.hoverState = null
  745. };
  746. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  747. }
  748. }
  749. ,
  750. r.prototype.applyPlacement = function(e, t) {
  751. var i = this.tip()
  752. , n = i[0].offsetWidth
  753. , r = i[0].offsetHeight
  754. , o = parseInt(i.css("margin-top"), 10)
  755. , a = parseInt(i.css("margin-left"), 10);
  756. isNaN(o) && (o = 0),
  757. isNaN(a) && (a = 0),
  758. e.top = e.top + o,
  759. e.left = e.left + a,
  760. m.offset.setOffset(i[0], m.extend({
  761. using: function(e) {
  762. i.css({
  763. top: Math.round(e.top),
  764. left: Math.round(e.left)
  765. })
  766. }
  767. }, e), 0),
  768. i.addClass("in");
  769. var s = i[0].offsetWidth
  770. , l = i[0].offsetHeight;
  771. "top" == t && l != r && (e.top = e.top + r - l);
  772. var c = this.getViewportAdjustedDelta(t, e, s, l);
  773. c.left ? e.left += c.left : e.top += c.top;
  774. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  775. , u = c.left ? "left" : "top"
  776. , d = c.left ? "offsetWidth" : "offsetHeight";
  777. i.offset(e),
  778. this.replaceArrow(h, i[0][d], u)
  779. }
  780. ,
  781. r.prototype.replaceArrow = function(e, t, i) {
  782. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  783. }
  784. ,
  785. r.prototype.setContent = function() {
  786. var e = this.tip()
  787. , t = this.getTitle();
  788. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  789. e.removeClass("fade in top bottom left right")
  790. }
  791. ,
  792. r.prototype.hide = function() {
  793. function e() {
  794. "in" != t.hoverState && i.detach(),
  795. t.$element.trigger("hidden.bs." + t.type)
  796. }
  797. var t = this
  798. , i = this.tip()
  799. , n = m.Event("hide.bs." + this.type);
  800. if (this.$element.removeAttr("aria-describedby"),
  801. this.$element.trigger(n),
  802. !n.isDefaultPrevented())
  803. return i.removeClass("in"),
  804. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  805. this.hoverState = null,
  806. this
  807. }
  808. ,
  809. r.prototype.fixTitle = function() {
  810. var e = this.$element;
  811. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  812. }
  813. ,
  814. r.prototype.hasContent = function() {
  815. return this.getTitle()
  816. }
  817. ,
  818. r.prototype.getPosition = function(e) {
  819. var t = (e = e || this.$element)[0]
  820. , i = "BODY" == t.tagName;
  821. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  822. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  823. width: i ? m(window).width() : e.outerWidth(),
  824. height: i ? m(window).height() : e.outerHeight()
  825. }, i ? {
  826. top: 0,
  827. left: 0
  828. } : e.offset())
  829. }
  830. ,
  831. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  832. return "bottom" == e ? {
  833. top: t.top + t.height,
  834. left: t.left + t.width / 2 - i / 2
  835. } : "top" == e ? {
  836. top: t.top - n,
  837. left: t.left + t.width / 2 - i / 2
  838. } : "left" == e ? {
  839. top: t.top + t.height / 2 - n / 2,
  840. left: t.left - i
  841. } : {
  842. top: t.top + t.height / 2 - n / 2,
  843. left: t.left + t.width
  844. }
  845. }
  846. ,
  847. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  848. var r = {
  849. top: 0,
  850. left: 0
  851. };
  852. if (!this.$viewport)
  853. return r;
  854. var o = this.options.viewport && this.options.viewport.padding || 0
  855. , a = this.getPosition(this.$viewport);
  856. if (/right|left/.test(e)) {
  857. var s = t.top - o - a.scroll
  858. , l = t.top + o - a.scroll + n;
  859. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  860. } else {
  861. var c = t.left - o
  862. , h = t.left + o + i;
  863. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  864. }
  865. return r
  866. }
  867. ,
  868. r.prototype.getTitle = function() {
  869. var e = this.$element
  870. , t = this.options;
  871. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  872. }
  873. ,
  874. r.prototype.getUID = function(e) {
  875. for (; e += ~~(1e6 * Math.random()),
  876. document.getElementById(e); )
  877. ;
  878. return e
  879. }
  880. ,
  881. r.prototype.tip = function() {
  882. return this.$tip = this.$tip || m(this.options.template)
  883. }
  884. ,
  885. r.prototype.arrow = function() {
  886. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  887. }
  888. ,
  889. r.prototype.validate = function() {
  890. this.$element[0].parentNode || (this.hide(),
  891. this.$element = null,
  892. this.options = null)
  893. }
  894. ,
  895. r.prototype.enable = function() {
  896. this.enabled = !0
  897. }
  898. ,
  899. r.prototype.disable = function() {
  900. this.enabled = !1
  901. }
  902. ,
  903. r.prototype.toggleEnabled = function() {
  904. this.enabled = !this.enabled
  905. }
  906. ,
  907. r.prototype.toggle = function(e) {
  908. var t = this;
  909. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  910. m(e.currentTarget).data("bs." + this.type, t))),
  911. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  912. }
  913. ,
  914. r.prototype.destroy = function() {
  915. clearTimeout(this.timeout),
  916. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  917. }
  918. ;
  919. var e = m.fn.tooltip;
  920. m.fn.tooltip = function(n) {
  921. return this.each(function() {
  922. var e = m(this)
  923. , t = e.data("bs.tooltip")
  924. , i = "object" == typeof n && n;
  925. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  926. "string" == typeof n && t[n]())
  927. })
  928. }
  929. ,
  930. m.fn.tooltip.Constructor = r,
  931. m.fn.tooltip.noConflict = function() {
  932. return m.fn.tooltip = e,
  933. this
  934. }
  935. }(jQuery),
  936. function(e, t, i) {
  937. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  938. }(0, this, function() {
  939. "use strict";
  940. function Keen() {
  941. return _init.apply(this, arguments)
  942. }
  943. function _init(e) {
  944. if (_isUndefined(e))
  945. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  946. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  947. throw new Error("Please provide a projectId");
  948. this.configure(e)
  949. }
  950. function _extend(e) {
  951. for (var t = 1; t < arguments.length; t++)
  952. for (var i in arguments[t])
  953. e[i] = arguments[t][i];
  954. return e
  955. }
  956. function _isUndefined(e) {
  957. return void 0 === e
  958. }
  959. function _type(e) {
  960. var t = e && e.constructor ? e.constructor.toString() : void 0;
  961. return t ? t.match(/function (.*)\(/)[1] : "Null"
  962. }
  963. function _each(e, t, i) {
  964. var n;
  965. if (!e)
  966. return 0;
  967. if (i = i || e,
  968. "array" === _type(e)) {
  969. for (n = 0; n < e.length; n++)
  970. if (!1 === t.call(i, e[n], n, e))
  971. return 0
  972. } else
  973. for (n in e)
  974. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  975. return 0;
  976. return 1
  977. }
  978. function _parse_params(e) {
  979. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  980. return decodeURIComponent(e.replace(n, " "))
  981. }, a = e.split("?")[1]; t = r.exec(a); )
  982. i[o(t[1])] = o(t[2]);
  983. return i
  984. }
  985. function _set_protocol(e) {
  986. switch (e) {
  987. case "http":
  988. return "http";
  989. case "auto":
  990. return location.protocol.replace(/:/g, "");
  991. case "https":
  992. case void 0:
  993. default:
  994. return "https"
  995. }
  996. }
  997. function _set_request_type(e) {
  998. var t = e || "jsonp"
  999. , i = !1;
  1000. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  1001. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  1002. }
  1003. function _build_url(e) {
  1004. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1005. }
  1006. function _uploadEvent(e, t, i, n, r) {
  1007. var o = _build_url.apply(this, ["/events/" + e])
  1008. , a = {};
  1009. for (var s in i = !1 !== i,
  1010. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1011. t)
  1012. t.hasOwnProperty(s) && (a[s] = t[s]);
  1013. switch (this.client.requestType) {
  1014. case "xhr":
  1015. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1016. break;
  1017. case "jsonp":
  1018. var l = JSON.stringify(a)
  1019. , c = Keen.Base64.encode(l);
  1020. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1021. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1022. break;
  1023. case "beacon":
  1024. l = JSON.stringify(a),
  1025. c = Keen.Base64.encode(l);
  1026. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1027. o += "&c=clv1",
  1028. _request.beacon.apply(this, [o, null, n, r])
  1029. }
  1030. }
  1031. Keen.prototype.configure = function(e) {
  1032. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1033. e.protocol = _set_protocol(e.protocol),
  1034. e.requestType = _set_request_type(e.requestType),
  1035. this.client = {
  1036. projectId: e.projectId,
  1037. writeKey: e.writeKey,
  1038. readKey: e.readKey,
  1039. globalProperties: null,
  1040. endpoint: e.protocol + "://" + e.host,
  1041. requestType: e.requestType
  1042. },
  1043. Keen.trigger("client", this, e),
  1044. this.trigger("ready"),
  1045. this
  1046. }
  1047. ;
  1048. var _request = {
  1049. xhr: function(e, t, i, n, r, o, a, s) {
  1050. if (!r)
  1051. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1052. var l = new XMLHttpRequest;
  1053. if (l.onreadystatechange = function() {
  1054. if (4 == l.readyState)
  1055. if (200 <= l.status && l.status < 300) {
  1056. var e;
  1057. try {
  1058. e = JSON.parse(l.responseText)
  1059. } catch (e) {
  1060. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1061. s && s(l, e)
  1062. }
  1063. a && e && a(e)
  1064. } else
  1065. Keen.log("HTTP request failed."),
  1066. s && s(l, null)
  1067. }
  1068. ,
  1069. l.open(e, t, o),
  1070. r && l.setRequestHeader("Authorization", r),
  1071. n && l.setRequestHeader("Content-Type", "application/json"),
  1072. i)
  1073. for (var c in i)
  1074. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1075. var h = n ? JSON.stringify(n) : null;
  1076. l.send(h)
  1077. },
  1078. jsonp: function(e, t, i, n) {
  1079. if (!t)
  1080. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1081. if (t && e.indexOf("api_key") < 0) {
  1082. var r = 0 < e.indexOf("?") ? "&" : "?";
  1083. e = e + r + "api_key=" + t
  1084. }
  1085. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1086. o += "a";
  1087. var a = !1;
  1088. window[o] = function(e) {
  1089. a = !0,
  1090. i && e && i(e),
  1091. window[o] = void 0
  1092. }
  1093. ,
  1094. e = e + "&jsonp=" + o;
  1095. var s = document.createElement("script");
  1096. s.id = "keen-jsonp",
  1097. s.src = e,
  1098. document.getElementsByTagName("head")[0].appendChild(s),
  1099. s.onreadystatechange = function() {
  1100. !1 === a && "loaded" === this.readyState && (a = !0,
  1101. n && n())
  1102. }
  1103. ,
  1104. s.onerror = function() {
  1105. !1 === a && (a = !0,
  1106. n && n())
  1107. }
  1108. },
  1109. beacon: function(e, t, i, n) {
  1110. if (t && e.indexOf("api_key") < 0) {
  1111. var r = 0 < e.indexOf("?") ? "&" : "?";
  1112. e = e + r + "api_key=" + t
  1113. }
  1114. var o = document.createElement("img");
  1115. o.onload = function() {
  1116. if (!0,
  1117. "naturalHeight"in this) {
  1118. if (this.naturalHeight + this.naturalWidth === 0)
  1119. return void this.onerror()
  1120. } else if (this.width + this.height === 0)
  1121. return void this.onerror();
  1122. i && i({
  1123. created: !0
  1124. })
  1125. }
  1126. ,
  1127. o.onerror = function() {
  1128. !0,
  1129. n && n()
  1130. }
  1131. ,
  1132. o.src = e
  1133. }
  1134. }
  1135. , Events = Keen.Events = {
  1136. on: function(e, t) {
  1137. return this.listeners || (this.listeners = {}),
  1138. (this.listeners[e] || (this.listeners[e] = [])).push({
  1139. callback: t
  1140. }),
  1141. this
  1142. },
  1143. off: function(e, t) {
  1144. if (!e && !t)
  1145. return this.listeners = void 0,
  1146. delete this.listeners,
  1147. this;
  1148. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1149. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1150. t && 0 != i.length || (this.listeners[e] = void 0,
  1151. delete this.listeners[e]);
  1152. return this
  1153. },
  1154. trigger: function(e) {
  1155. if (!this.listeners)
  1156. return this;
  1157. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1158. i[n].callback.apply(this, t);
  1159. return this
  1160. }
  1161. };
  1162. _extend(Keen.prototype, Events),
  1163. _extend(Keen, Events),
  1164. Keen.loaded = !0,
  1165. Keen.utils = {
  1166. each: _each,
  1167. extend: _extend,
  1168. parseParams: _parse_params
  1169. },
  1170. Keen.ready = function(e) {
  1171. Keen.loaded ? e() : Keen.on("ready", e)
  1172. }
  1173. ,
  1174. Keen.log = function(e) {
  1175. "object" == typeof console && console.log("[Keen IO]", e)
  1176. }
  1177. ;
  1178. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1179. Keen.prototype.addEvent = function() {
  1180. _uploadEvent.apply(this, arguments)
  1181. }
  1182. ,
  1183. Keen.prototype.addEventSync = function(e, t, i, n) {
  1184. _uploadEvent.apply(this, [e, t, !1, i, n])
  1185. }
  1186. ,
  1187. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1188. var o = e
  1189. , a = o.metaKey
  1190. , s = o.target
  1191. , l = !1
  1192. , c = function() {};
  1193. return void 0 === n && (n = 500),
  1194. "A" === s.nodeName ? c = function() {
  1195. a || l || (l = !0,
  1196. window.location = s.href)
  1197. }
  1198. : "FORM" === s.nodeName && (c = function() {
  1199. l || (l = !0,
  1200. s.submit())
  1201. }
  1202. ),
  1203. r && (c = function() {
  1204. l || (l = !0,
  1205. r())
  1206. }
  1207. ),
  1208. _uploadEvent.call(this, t, i, c, c),
  1209. setTimeout(function() {
  1210. c()
  1211. }, n),
  1212. !!a && void 0
  1213. }
  1214. ,
  1215. Keen.prototype.setGlobalProperties = function(e) {
  1216. if (!this.client)
  1217. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1218. if (!e || "function" != typeof e)
  1219. throw new Error("Invalid value for global properties: " + e);
  1220. this.client.globalProperties = e
  1221. }
  1222. ,
  1223. Keen.Base64 = {
  1224. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1225. encode: function(e) {
  1226. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1227. for (e = this.utf8.encode(e); c < e.length; )
  1228. t = e.charCodeAt(c++),
  1229. i = e.charCodeAt(c++),
  1230. n = e.charCodeAt(c++),
  1231. r = t >> 2,
  1232. o = (3 & t) << 4 | i >> 4,
  1233. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1234. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1235. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1236. return l
  1237. },
  1238. decode: function(e) {
  1239. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1240. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1241. t = c.indexOf(e.charAt(l++)),
  1242. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1243. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1244. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1245. return this.utf8.decode(s)
  1246. },
  1247. utf8: {
  1248. encode: function(e) {
  1249. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1250. 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);
  1251. return i
  1252. },
  1253. decode: function(e) {
  1254. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1255. 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];
  1256. return i
  1257. }
  1258. }
  1259. },
  1260. "object" != typeof JSON && (JSON = {}),
  1261. function() {
  1262. function f(e) {
  1263. return e < 10 ? "0" + e : e
  1264. }
  1265. function quote(e) {
  1266. return escapable.lastIndex = 0,
  1267. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1268. var t = meta[e];
  1269. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1270. }) + '"' : '"' + e + '"'
  1271. }
  1272. function str(e, t) {
  1273. var i, n, r, o, a, s = gap, l = t[e];
  1274. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1275. "function" == typeof rep && (l = rep.call(t, e, l)),
  1276. typeof l) {
  1277. case "string":
  1278. return quote(l);
  1279. case "number":
  1280. return isFinite(l) ? String(l) : "null";
  1281. case "boolean":
  1282. case "null":
  1283. return String(l);
  1284. case "object":
  1285. if (!l)
  1286. return "null";
  1287. if (gap += indent,
  1288. a = [],
  1289. "[object Array]" === Object.prototype.toString.apply(l)) {
  1290. for (o = l.length,
  1291. i = 0; i < o; i += 1)
  1292. a[i] = str(i, l) || "null";
  1293. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1294. gap = s,
  1295. r
  1296. }
  1297. if (rep && "object" == typeof rep)
  1298. for (o = rep.length,
  1299. i = 0; i < o; i += 1)
  1300. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1301. else
  1302. for (n in l)
  1303. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1304. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1305. gap = s,
  1306. r
  1307. }
  1308. }
  1309. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1310. 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
  1311. }
  1312. ,
  1313. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1314. return this.valueOf()
  1315. }
  1316. );
  1317. 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 = {
  1318. "\b": "\\b",
  1319. "\t": "\\t",
  1320. "\n": "\\n",
  1321. "\f": "\\f",
  1322. "\r": "\\r",
  1323. '"': '\\"',
  1324. "\\": "\\\\"
  1325. }, rep;
  1326. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1327. var n;
  1328. if (indent = gap = "",
  1329. "number" == typeof i)
  1330. for (n = 0; n < i; n += 1)
  1331. indent += " ";
  1332. else
  1333. "string" == typeof i && (indent = i);
  1334. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1335. throw new Error("JSON.stringify");
  1336. return str("", {
  1337. "": e
  1338. })
  1339. }
  1340. ),
  1341. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1342. function walk(e, t) {
  1343. var i, n, r = e[t];
  1344. if (r && "object" == typeof r)
  1345. for (i in r)
  1346. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1347. return reviver.call(e, t, r)
  1348. }
  1349. var j;
  1350. if (text = String(text),
  1351. cx.lastIndex = 0,
  1352. cx.test(text) && (text = text.replace(cx, function(e) {
  1353. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1354. })),
  1355. /^[\],:{}\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, "")))
  1356. return j = eval("(" + text + ")"),
  1357. "function" == typeof reviver ? walk({
  1358. "": j
  1359. }, "") : j;
  1360. throw new SyntaxError("JSON.parse")
  1361. }
  1362. )
  1363. }(),
  1364. Hh = Keen.utils,
  1365. Ih = function(i) {
  1366. function e(e) {
  1367. for (u = 1; e = n.shift(); )
  1368. e()
  1369. }
  1370. 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]);
  1371. return r[l] && r[l](s, t = function() {
  1372. r.removeEventListener(s, t, !1),
  1373. e()
  1374. }
  1375. , !1),
  1376. a && r.attachEvent(c, t = function() {
  1377. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1378. e())
  1379. }
  1380. ),
  1381. i = a ? function(t) {
  1382. self != top ? u ? t() : n.push(t) : function() {
  1383. try {
  1384. o.doScroll("left")
  1385. } catch (e) {
  1386. return setTimeout(function() {
  1387. i(t)
  1388. }, 50)
  1389. }
  1390. t()
  1391. }()
  1392. }
  1393. : function(e) {
  1394. u ? e() : n.push(e)
  1395. }
  1396. }
  1397. ,
  1398. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1399. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1400. if (loaded && cached) {
  1401. for (var instance in clients = cached.clients || {},
  1402. ready = cached.ready || [],
  1403. clients)
  1404. if (clients.hasOwnProperty(instance)) {
  1405. var client = clients[instance];
  1406. for (var method in Keen.prototype)
  1407. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1408. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1409. ,
  1410. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1411. ,
  1412. client._config && (client.configure.call(client, client._config),
  1413. delete client._config),
  1414. client._setGlobalProperties) {
  1415. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1416. client.setGlobalProperties.apply(client, globals[i]);
  1417. delete client._setGlobalProperties
  1418. }
  1419. if (client._addEvent) {
  1420. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1421. client.addEvent.apply(client, queue[i]);
  1422. delete client._addEvent
  1423. }
  1424. var callback = client._on || [];
  1425. if (client._on) {
  1426. for (var i = 0; i < callback.length; i++)
  1427. client.on.apply(client, callback[i]);
  1428. client.trigger("ready"),
  1429. delete client._on
  1430. }
  1431. }
  1432. for (var i = 0; i < ready.length; i++) {
  1433. var callback = ready[i];
  1434. Keen.on("ready", function() {
  1435. callback()
  1436. })
  1437. }
  1438. }
  1439. return Keen.loaded && setTimeout(function() {
  1440. Keen.utils.domready(function() {
  1441. Keen.trigger("ready")
  1442. })
  1443. }, 0),
  1444. Keen
  1445. }),
  1446. function() {
  1447. var i = window.analytics = window.analytics || [];
  1448. if (!i.initialize) {
  1449. if (i.invoked)
  1450. return window.console && console.error && console.error("Segment snippet included twice.");
  1451. i.invoked = !0,
  1452. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1453. i.factory = function(t) {
  1454. return function() {
  1455. var e = Array.prototype.slice.call(arguments);
  1456. return e.unshift(t),
  1457. i.push(e),
  1458. i
  1459. }
  1460. }
  1461. ;
  1462. for (var e = 0; e < i.methods.length; e++) {
  1463. var t = i.methods[e];
  1464. i[t] = i.factory(t)
  1465. }
  1466. i.load = function(e) {
  1467. var t = document.createElement("script");
  1468. t.type = "text/javascript",
  1469. t.async = !0,
  1470. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1471. var i = document.getElementsByTagName("script")[0];
  1472. i.parentNode.insertBefore(t, i)
  1473. }
  1474. ,
  1475. i.SNIPPET_VERSION = "4.0.0"
  1476. }
  1477. }(),
  1478. function(i, u) {
  1479. "use strict";
  1480. var d = "function"
  1481. , p = "undefined"
  1482. , f = "object"
  1483. , e = "major"
  1484. , t = "model"
  1485. , n = "name"
  1486. , r = "type"
  1487. , o = "vendor"
  1488. , a = "version"
  1489. , s = "architecture"
  1490. , l = "console"
  1491. , c = "mobile"
  1492. , h = "tablet"
  1493. , g = {
  1494. has: function(e, t) {
  1495. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1496. },
  1497. lowerize: function(e) {
  1498. return e.toLowerCase()
  1499. }
  1500. }
  1501. , m = {
  1502. rgx: function() {
  1503. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1504. var c = l[s]
  1505. , h = l[s + 1];
  1506. if (typeof e == p)
  1507. for (n in e = {},
  1508. h)
  1509. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1510. for (t = i = 0; t < c.length; t++)
  1511. if (o = c[t].exec(this.getUA())) {
  1512. for (n = 0; n < h.length; n++)
  1513. a = o[++i],
  1514. 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;
  1515. break
  1516. }
  1517. if (o)
  1518. break
  1519. }
  1520. return e
  1521. },
  1522. str: function(e, t) {
  1523. for (var i in t)
  1524. if (typeof t[i] == f && 0 < t[i].length) {
  1525. for (var n = 0; n < t[i].length; n++)
  1526. if (g.has(t[i][n], e))
  1527. return "?" === i ? u : i
  1528. } else if (g.has(t[i], e))
  1529. return "?" === i ? u : i;
  1530. return e
  1531. }
  1532. }
  1533. , v = {
  1534. browser: {
  1535. oldsafari: {
  1536. major: {
  1537. 1: ["/8", "/1", "/3"],
  1538. 2: "/4",
  1539. "?": "/"
  1540. },
  1541. version: {
  1542. "1.0": "/8",
  1543. 1.2: "/1",
  1544. 1.3: "/3",
  1545. "2.0": "/412",
  1546. "2.0.2": "/416",
  1547. "2.0.3": "/417",
  1548. "2.0.4": "/419",
  1549. "?": "/"
  1550. }
  1551. }
  1552. },
  1553. device: {
  1554. sprint: {
  1555. model: {
  1556. "Evo Shift 4G": "7373KT"
  1557. },
  1558. vendor: {
  1559. HTC: "APA",
  1560. Sprint: "Sprint"
  1561. }
  1562. }
  1563. },
  1564. os: {
  1565. windows: {
  1566. version: {
  1567. ME: "4.90",
  1568. "NT 3.11": "NT3.51",
  1569. "NT 4.0": "NT4.0",
  1570. 2e3: "NT 5.0",
  1571. XP: ["NT 5.1", "NT 5.2"],
  1572. Vista: "NT 6.0",
  1573. 7: "NT 6.1",
  1574. 8: "NT 6.2",
  1575. 8.1: "NT 6.3",
  1576. RT: "ARM"
  1577. }
  1578. }
  1579. }
  1580. }
  1581. , y = {
  1582. 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]],
  1583. 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]],
  1584. 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]],
  1585. 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]],
  1586. 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]]
  1587. }
  1588. , A = function(e) {
  1589. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1590. return this instanceof A ? (this.getBrowser = function() {
  1591. return m.rgx.apply(this, y.browser)
  1592. }
  1593. ,
  1594. this.getCPU = function() {
  1595. return m.rgx.apply(this, y.cpu)
  1596. }
  1597. ,
  1598. this.getDevice = function() {
  1599. return m.rgx.apply(this, y.device)
  1600. }
  1601. ,
  1602. this.getEngine = function() {
  1603. return m.rgx.apply(this, y.engine)
  1604. }
  1605. ,
  1606. this.getOS = function() {
  1607. return m.rgx.apply(this, y.os)
  1608. }
  1609. ,
  1610. this.getResult = function() {
  1611. return {
  1612. ua: this.getUA(),
  1613. browser: this.getBrowser(),
  1614. engine: this.getEngine(),
  1615. os: this.getOS(),
  1616. device: this.getDevice(),
  1617. cpu: this.getCPU()
  1618. }
  1619. }
  1620. ,
  1621. this.getUA = function() {
  1622. return t
  1623. }
  1624. ,
  1625. this.setUA = function(e) {
  1626. return t = e,
  1627. this
  1628. }
  1629. ,
  1630. void this.setUA(t)) : new A(e).getResult()
  1631. };
  1632. if (typeof exports != p)
  1633. typeof module != p && module.exports && (exports = module.exports = A),
  1634. exports.UAParser = A;
  1635. else if (i.UAParser = A,
  1636. typeof define == d && define.amd && define(function() {
  1637. return A
  1638. }),
  1639. typeof i.jQuery != p) {
  1640. var C = i.jQuery
  1641. , I = new A;
  1642. C.ua = I.getResult(),
  1643. C.ua.get = function() {
  1644. return I.getUA()
  1645. }
  1646. ,
  1647. C.ua.set = function(e) {
  1648. I.setUA(e);
  1649. var t = I.getResult();
  1650. for (var i in t)
  1651. C.ua[i] = t[i]
  1652. }
  1653. }
  1654. }(this),
  1655. window.Modernizr = function(e, t) {
  1656. function i(e, t) {
  1657. return typeof e === t
  1658. }
  1659. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1660. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1661. return t in e && i(e.constructor.prototype[t], "undefined")
  1662. }
  1663. : function(e, t) {
  1664. return p.call(e, t)
  1665. }
  1666. ,
  1667. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1668. var r = this;
  1669. if ("function" != typeof r)
  1670. throw new TypeError;
  1671. var o = d.call(arguments, 1)
  1672. , a = function() {
  1673. if (this instanceof a) {
  1674. function e() {}
  1675. e.prototype = r.prototype;
  1676. var t = new e
  1677. , i = r.apply(t, o.concat(d.call(arguments)));
  1678. return Object(i) === i ? i : t
  1679. }
  1680. return r.apply(n, o.concat(d.call(arguments)))
  1681. };
  1682. return a
  1683. }
  1684. ),
  1685. h.webgl = function() {
  1686. return !!e.WebGLRenderingContext
  1687. }
  1688. ,
  1689. h)
  1690. r(h, f) && (n = f.toLowerCase(),
  1691. a[n] = h[f](),
  1692. u.push((a[n] ? "" : "no-") + n));
  1693. return a.addTest = function(e, t) {
  1694. if ("object" == typeof e)
  1695. for (var i in e)
  1696. r(e, i) && a.addTest(i, e[i]);
  1697. else {
  1698. if (e = e.toLowerCase(),
  1699. void 0 !== a[e])
  1700. return a;
  1701. t = "function" == typeof t ? t() : t,
  1702. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1703. a[e] = t
  1704. }
  1705. return a
  1706. }
  1707. ,
  1708. o = "",
  1709. c.cssText = o,
  1710. l = null,
  1711. a._version = "2.8.2",
  1712. a
  1713. }(this, this.document),
  1714. function(xe, e, Se) {
  1715. "use strict";
  1716. function Me(s, e, n) {
  1717. function a(e) {
  1718. var t = Q.length;
  1719. if (G.old = xe.extend({}, G),
  1720. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1721. Y = W[F.horizontal ? "width" : "height"](),
  1722. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1723. Q.length = 0,
  1724. G.start = 0,
  1725. G.end = nt(z - H, 0),
  1726. le) {
  1727. $.length,
  1728. J = U.children(F.itemSelector),
  1729. $.length = 0;
  1730. 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;
  1731. z = 0,
  1732. J.each(function(e, t) {
  1733. var i = xe(t)
  1734. , n = t.getBoundingClientRect()
  1735. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1736. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1737. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1738. , s = r + o + a
  1739. , l = !o || !a
  1740. , c = {};
  1741. c.el = t,
  1742. c.size = l ? r : s,
  1743. c.half = c.size / 2,
  1744. c.start = z + (l ? o : 0),
  1745. c.center = c.start - it(H / 2 - c.size / 2),
  1746. c.end = c.start - H + c.size,
  1747. e || (z += u),
  1748. z += s,
  1749. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1750. e === g && (c.end += d,
  1751. z += d,
  1752. f = l ? a : 0),
  1753. $.push(c),
  1754. h = c
  1755. }),
  1756. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1757. z -= f,
  1758. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1759. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1760. }
  1761. if (G.center = it(G.end / 2 + G.start / 2),
  1762. v(),
  1763. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1764. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1765. X.end = Y - q,
  1766. _e || c()),
  1767. !V && 0 < H) {
  1768. var n = G.start
  1769. , r = "";
  1770. if (le)
  1771. xe.each($, function(e, t) {
  1772. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1773. Q.push(n),
  1774. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1775. });
  1776. else
  1777. for (; n - H < G.end; )
  1778. Q.push(n),
  1779. n += H;
  1780. if (Z[0] && t !== Q.length) {
  1781. for (var o = 0; o < Q.length; o++)
  1782. r += F.pageBuilder.call(B, o);
  1783. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1784. }
  1785. }
  1786. if (ee.slideeSize = z,
  1787. ee.frameSize = H,
  1788. ee.sbSize = Y,
  1789. ee.handleSize = q,
  1790. le) {
  1791. e && null != F.startAt && (m(F.startAt),
  1792. B[se ? "toCenter" : "toStart"](F.startAt));
  1793. var a = $[ee.activeItem];
  1794. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1795. } else
  1796. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1797. L("load")
  1798. }
  1799. function l(e, t, i) {
  1800. if (le && Ie.released && !i) {
  1801. var n = d(e)
  1802. , r = e > G.start && e < G.end;
  1803. se ? (r && (e = $[n.centerItem].center),
  1804. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1805. }
  1806. 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),
  1807. Ae.start = +new Date,
  1808. Ae.time = 0,
  1809. Ae.from = G.cur,
  1810. Ae.to = e,
  1811. Ae.delta = e - G.cur,
  1812. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1813. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1814. Ie.tweese = 0,
  1815. e !== G.dest && (G.dest = e,
  1816. L("change"),
  1817. _e || o()),
  1818. g(),
  1819. v(),
  1820. p(),
  1821. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1822. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1823. L("activePage", ye.page))
  1824. }
  1825. function o() {
  1826. if (B.initialized) {
  1827. if (!_e)
  1828. return _e = Ge(o),
  1829. void (Ie.released && L("moveStart"));
  1830. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1831. $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),
  1832. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1833. Ae.to === G.cur ? (G.cur = Ae.to,
  1834. Ie.tweese = _e = 0) : _e = Ge(o),
  1835. L("move"),
  1836. 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"),
  1837. !_e && Ie.released && L("moveEnd"),
  1838. c()
  1839. }
  1840. }
  1841. function c() {
  1842. 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,
  1843. X.cur = Fe(it(X.cur), X.start, X.end),
  1844. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1845. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1846. }
  1847. function t() {
  1848. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1849. Te = Ie.init ? Ge(t) : 0,
  1850. Ce.now = +new Date,
  1851. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1852. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1853. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1854. Ce.lastTime = Ce.now
  1855. }
  1856. function i(e, t, i) {
  1857. if ("boolean" === Re(t) && (i = t,
  1858. t = Se),
  1859. t === Se)
  1860. l(G[e], i);
  1861. else {
  1862. if (se && "center" !== e)
  1863. return;
  1864. var n = B.getPos(t);
  1865. n && l(n[e], i, !se)
  1866. }
  1867. }
  1868. function h(e) {
  1869. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1870. }
  1871. function u(e) {
  1872. return h(De(e) && e < 0 ? e + $.length : e)
  1873. }
  1874. function m(e, t) {
  1875. var i = h(e);
  1876. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1877. J.eq(i).addClass(F.activeClass),
  1878. ye.active = ee.activeItem = i,
  1879. p(),
  1880. L("active", i)),
  1881. i)
  1882. }
  1883. function d(e) {
  1884. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1885. var t = {}
  1886. , i = ae ? 0 : H / 2;
  1887. if (!V)
  1888. for (var n = 0, r = Q.length; n < r; n++) {
  1889. if (e >= G.end || n === Q.length - 1) {
  1890. t.activePage = Q.length - 1;
  1891. break
  1892. }
  1893. if (e <= Q[n] + i) {
  1894. t.activePage = n;
  1895. break
  1896. }
  1897. }
  1898. if (le) {
  1899. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1900. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1901. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1902. l === c - 1 || e <= $[l].end + $[l].half) {
  1903. a = l;
  1904. break
  1905. }
  1906. t.firstItem = De(o) ? o : 0,
  1907. t.centerItem = De(s) ? s : t.firstItem,
  1908. t.lastItem = De(a) ? a : t.centerItem
  1909. }
  1910. return t
  1911. }
  1912. function v(e) {
  1913. xe.extend(ee, d(e))
  1914. }
  1915. function p() {
  1916. var e = G.dest <= G.start
  1917. , t = G.dest >= G.end
  1918. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1919. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1920. ge.is("button,input") && ge.prop("disabled", e),
  1921. me.is("button,input") && me.prop("disabled", t),
  1922. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1923. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1924. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1925. de.is("button,input") && de.prop("disabled", e),
  1926. ue.is("button,input") && ue.prop("disabled", t)),
  1927. le && null != ee.activeItem) {
  1928. var n = 0 === ee.activeItem
  1929. , r = ee.activeItem >= $.length - 1
  1930. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1931. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1932. pe.is("button,input") && pe.prop("disabled", n),
  1933. fe.is("button,input") && fe.prop("disabled", r),
  1934. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1935. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1936. }
  1937. }
  1938. function r(e, t, i) {
  1939. if (e = u(e),
  1940. t = u(t),
  1941. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1942. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1943. var n = e < t ? e : i ? t : t - 1
  1944. , r = t < e ? e : i ? t + 1 : t
  1945. , o = t < e;
  1946. 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)),
  1947. a()
  1948. }
  1949. }
  1950. function f(e, t) {
  1951. for (var i = 0, n = ve[e].length; i < n; i++)
  1952. if (ve[e][i] === t)
  1953. return i;
  1954. return -1
  1955. }
  1956. function g() {
  1957. Ie.released && !B.isPaused && B.resume()
  1958. }
  1959. function y(e) {
  1960. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1961. }
  1962. function A() {
  1963. Ie.history[0] = Ie.history[1],
  1964. Ie.history[1] = Ie.history[2],
  1965. Ie.history[2] = Ie.history[3],
  1966. Ie.history[3] = Ie.delta
  1967. }
  1968. function C(e) {
  1969. Ie.released = 0,
  1970. Ie.source = e,
  1971. Ie.slidee = "slidee" === e
  1972. }
  1973. function I(e) {
  1974. var t = "touchstart" === e.type
  1975. , i = e.data.source
  1976. , n = "slidee" === i;
  1977. 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),
  1978. C(i),
  1979. Ie.init = 0,
  1980. Ie.$source = xe(e.target),
  1981. Ie.touch = t,
  1982. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1983. Ie.initX = Ie.pointer.pageX,
  1984. Ie.initY = Ie.pointer.pageY,
  1985. Ie.initPos = n ? G.cur : X.cur,
  1986. Ie.start = +new Date,
  1987. Ie.time = 0,
  1988. Ie.path = 0,
  1989. Ie.delta = 0,
  1990. Ie.locked = 0,
  1991. Ie.history = [0, 0, 0, 0],
  1992. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1993. We.on(t ? qe : Ye, E),
  1994. B.pause(1),
  1995. (n ? U : j).addClass(F.draggedClass),
  1996. L("moveStart"),
  1997. n && (be = setInterval(A, 10)))
  1998. }
  1999. function E(e) {
  2000. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  2001. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  2002. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2003. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2004. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2005. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2006. Ie.released || !(Ie.path < 1)) {
  2007. if (!Ie.init) {
  2008. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2009. return _();
  2010. Ie.init = 1
  2011. }
  2012. Pe(e),
  2013. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2014. Ie.$source.on(Ze, Oe)),
  2015. Ie.released && (_(),
  2016. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2017. Ie.delta += Ie.swing,
  2018. Ie.tweese = 10 < $e(Ie.swing))),
  2019. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2020. }
  2021. }
  2022. function _() {
  2023. clearInterval(be),
  2024. Ie.released = !0,
  2025. We.off(Ie.touch ? qe : Ye, E),
  2026. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2027. setTimeout(function() {
  2028. Ie.$source.off(Ze, Oe)
  2029. }),
  2030. G.cur === G.dest && Ie.init && L("moveEnd"),
  2031. B.resume(1),
  2032. Ie.init = 0
  2033. }
  2034. function b(e) {
  2035. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2036. }
  2037. function w() {
  2038. B.stop(),
  2039. We.off("mouseup", w)
  2040. }
  2041. function T(e) {
  2042. switch (Pe(e),
  2043. this) {
  2044. case ue[0]:
  2045. case de[0]:
  2046. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2047. We.on("mouseup", w);
  2048. break;
  2049. case pe[0]:
  2050. B.prev();
  2051. break;
  2052. case fe[0]:
  2053. B.next();
  2054. break;
  2055. case ge[0]:
  2056. B.prevPage();
  2057. break;
  2058. case me[0]:
  2059. B.nextPage()
  2060. }
  2061. }
  2062. function x(e) {
  2063. e.originalEvent[He] = B;
  2064. var t = +new Date;
  2065. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2066. ot = t;
  2067. else if (F.scrollBy && G.start !== G.end) {
  2068. var i = function(e) {
  2069. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2070. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2071. le ? (Ue = +new Date,
  2072. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2073. Ee.last = Ue,
  2074. Ee.delta += Ee.curDelta,
  2075. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2076. Ee.delta %= 1),
  2077. Ee.finalDelta) : Ee.curDelta
  2078. }(e.originalEvent);
  2079. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2080. B.slideBy(F.scrollBy * i)
  2081. }
  2082. }
  2083. function S(e) {
  2084. F.clickBar && e.target === W[0] && (Pe(e),
  2085. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2086. }
  2087. function M(e) {
  2088. if (F.keyboardNavBy)
  2089. switch (e.which) {
  2090. case F.horizontal ? 37 : 38:
  2091. Pe(e),
  2092. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2093. break;
  2094. case F.horizontal ? 39 : 40:
  2095. Pe(e),
  2096. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2097. }
  2098. }
  2099. function R(e) {
  2100. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2101. }
  2102. function P() {
  2103. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2104. }
  2105. function O(e) {
  2106. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2107. }
  2108. function L(e, t) {
  2109. if (ve[e]) {
  2110. for (N = ve[e].length,
  2111. Je.length = 0,
  2112. D = 0; D < N; D++)
  2113. Je.push(ve[e][D]);
  2114. for (D = 0; D < N; D++)
  2115. Je[D].call(B, e, t)
  2116. }
  2117. }
  2118. 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 = {
  2119. start: 0,
  2120. center: 0,
  2121. end: 0,
  2122. cur: 0,
  2123. dest: 0
  2124. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2125. start: 0,
  2126. end: 0,
  2127. cur: 0
  2128. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2129. firstItem: 0,
  2130. lastItem: 0,
  2131. centerItem: 0,
  2132. activeItem: null,
  2133. activePage: 0
  2134. }, 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 = {
  2135. released: 1
  2136. }, Ee = {
  2137. last: 0,
  2138. delta: 0,
  2139. resetTime: 200
  2140. }, _e = 0, be = 0, we = 0, Te = 0;
  2141. V || (s = k[0]),
  2142. B.initialized = 0,
  2143. B.frame = s,
  2144. B.slidee = U[0],
  2145. B.pos = G,
  2146. B.rel = ee,
  2147. B.items = $,
  2148. B.pages = Q,
  2149. B.isPaused = 0,
  2150. B.options = F,
  2151. B.dragging = Ie,
  2152. B.reload = function() {
  2153. a()
  2154. }
  2155. ,
  2156. B.getPos = function(e) {
  2157. if (le) {
  2158. var t = h(e);
  2159. return -1 !== t && $[t]
  2160. }
  2161. var i = U.find(e).eq(0);
  2162. if (i[0]) {
  2163. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2164. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2165. return {
  2166. start: n,
  2167. center: n - H / 2 + r / 2,
  2168. end: n - H + r,
  2169. size: r
  2170. }
  2171. }
  2172. return !1
  2173. }
  2174. ,
  2175. B.moveBy = function(e) {
  2176. Ce.speed = e,
  2177. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2178. Ce.startPos = G.cur,
  2179. C("button"),
  2180. Ie.init = 1,
  2181. L("moveStart"),
  2182. ze(Te),
  2183. t())
  2184. }
  2185. ,
  2186. B.stop = function() {
  2187. "button" === Ie.source && (Ie.init = 0,
  2188. Ie.released = 1)
  2189. }
  2190. ,
  2191. B.prev = function() {
  2192. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2193. }
  2194. ,
  2195. B.next = function() {
  2196. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2197. }
  2198. ,
  2199. B.prevPage = function() {
  2200. B.activatePage(ee.activePage - 1)
  2201. }
  2202. ,
  2203. B.nextPage = function() {
  2204. B.activatePage(ee.activePage + 1)
  2205. }
  2206. ,
  2207. B.slideBy = function(e, t) {
  2208. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2209. }
  2210. ,
  2211. B.slideTo = function(e, t) {
  2212. l(e, t)
  2213. }
  2214. ,
  2215. B.toStart = function(e, t) {
  2216. i("start", e, t)
  2217. }
  2218. ,
  2219. B.toEnd = function(e, t) {
  2220. i("end", e, t)
  2221. }
  2222. ,
  2223. B.toCenter = function(e, t) {
  2224. i("center", e, t)
  2225. }
  2226. ,
  2227. B.getIndex = h,
  2228. B.activate = function(e, t) {
  2229. var i = m(e);
  2230. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2231. }
  2232. ,
  2233. B.activatePage = function(e, t) {
  2234. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2235. }
  2236. ,
  2237. B.resume = function(e) {
  2238. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2239. we ? we = clearTimeout(we) : L("resume"),
  2240. we = setTimeout(function() {
  2241. switch (L("cycle"),
  2242. F.cycleBy) {
  2243. case "items":
  2244. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2245. break;
  2246. case "pages":
  2247. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2248. }
  2249. }, F.cycleInterval))
  2250. }
  2251. ,
  2252. B.pause = function(e) {
  2253. e < B.isPaused || (B.isPaused = e || 100,
  2254. we && (we = clearTimeout(we),
  2255. L("pause")))
  2256. }
  2257. ,
  2258. B.toggle = function() {
  2259. B[we ? "pause" : "resume"]()
  2260. }
  2261. ,
  2262. B.set = function(e, t) {
  2263. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2264. }
  2265. ,
  2266. B.add = function(e, t) {
  2267. var i = xe(e);
  2268. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2269. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2270. a()
  2271. }
  2272. ,
  2273. B.remove = function(e) {
  2274. if (le) {
  2275. var t = u(e);
  2276. if (-1 < t) {
  2277. J.eq(t).remove();
  2278. var i = t === ee.activeItem;
  2279. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2280. a(),
  2281. i && (ye.active = null,
  2282. B.activate(ee.activeItem))
  2283. }
  2284. } else
  2285. xe(e).remove(),
  2286. a()
  2287. }
  2288. ,
  2289. B.moveAfter = function(e, t) {
  2290. r(e, t, 1)
  2291. }
  2292. ,
  2293. B.moveBefore = function(e, t) {
  2294. r(e, t)
  2295. }
  2296. ,
  2297. B.on = function(e, t) {
  2298. if ("object" === Re(e))
  2299. for (var i in e)
  2300. e.hasOwnProperty(i) && B.on(i, e[i]);
  2301. else if ("function" === Re(t))
  2302. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2303. ve[n[r]] = ve[n[r]] || [],
  2304. -1 === f(n[r], t) && ve[n[r]].push(t);
  2305. else if ("array" === Re(t))
  2306. for (var a = 0, s = t.length; a < s; a++)
  2307. B.on(e, t[a])
  2308. }
  2309. ,
  2310. B.one = function(t, i) {
  2311. B.on(t, function e() {
  2312. i.apply(B, arguments),
  2313. B.off(t, e)
  2314. })
  2315. }
  2316. ,
  2317. B.off = function(e, t) {
  2318. if (t instanceof Array)
  2319. for (var i = 0, n = t.length; i < n; i++)
  2320. B.off(e, t[i]);
  2321. else
  2322. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2323. if (ve[r[o]] = ve[r[o]] || [],
  2324. null == t)
  2325. ve[r[o]].length = 0;
  2326. else {
  2327. var s = f(r[o], t);
  2328. -1 !== s && ve[r[o]].splice(s, 1)
  2329. }
  2330. }
  2331. ,
  2332. B.destroy = function() {
  2333. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2334. We.off("keydown", M),
  2335. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2336. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2337. Z.empty(),
  2338. V || (k.off("." + He),
  2339. te.restore(),
  2340. ie.restore(),
  2341. ne.restore(),
  2342. re.restore(),
  2343. xe.removeData(s, He)),
  2344. $.length = Q.length = 0,
  2345. ye = {},
  2346. B.initialized = 0,
  2347. B
  2348. }
  2349. ,
  2350. B.init = function() {
  2351. if (!B.initialized) {
  2352. B.on(n);
  2353. var e = ["overflow", "position"]
  2354. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2355. te.save.apply(te, e),
  2356. ne.save.apply(ne, e),
  2357. ie.save.apply(ie, t),
  2358. re.save.apply(re, t);
  2359. var i = j;
  2360. return V || (i = i.add(U),
  2361. k.css("overflow", "hidden"),
  2362. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2363. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2364. i.css({
  2365. position: "absolute"
  2366. })),
  2367. F.forward && ue.on(Ke, T),
  2368. F.backward && de.on(Ke, T),
  2369. F.prev && pe.on(Ze, T),
  2370. F.next && fe.on(Ze, T),
  2371. F.prevPage && ge.on(Ze, T),
  2372. F.nextPage && me.on(Ze, T),
  2373. ce.on(Xe, x),
  2374. W[0] && W.on(Ze, S),
  2375. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2376. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2377. he.on(je, {
  2378. source: "slidee"
  2379. }, I),
  2380. j && j.on(je, {
  2381. source: "handle"
  2382. }, I),
  2383. We.on("keydown", M),
  2384. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2385. k.on("scroll." + He, Le)),
  2386. B.initialized = 1,
  2387. a(!0),
  2388. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2389. B
  2390. }
  2391. }
  2392. }
  2393. function Re(e) {
  2394. 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
  2395. }
  2396. function Pe(e, t) {
  2397. e.preventDefault(),
  2398. t && e.stopPropagation()
  2399. }
  2400. function Oe(e) {
  2401. Pe(e, 1),
  2402. xe(this).off(e.type, Oe)
  2403. }
  2404. function Le() {
  2405. this.scrollLeft = 0,
  2406. this.scrollTop = 0
  2407. }
  2408. function De(e) {
  2409. return !isNaN(parseFloat(e)) && isFinite(e)
  2410. }
  2411. function Ne(e, t) {
  2412. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2413. }
  2414. function Fe(e, t, i) {
  2415. return e < t ? t : i < e ? i : e
  2416. }
  2417. function Be(t) {
  2418. var i = {
  2419. style: {},
  2420. save: function() {
  2421. if (t && t.nodeType) {
  2422. for (var e = 0; e < arguments.length; e++)
  2423. i.style[arguments[e]] = t.style[arguments[e]];
  2424. return i
  2425. }
  2426. },
  2427. restore: function() {
  2428. if (t && t.nodeType) {
  2429. for (var e in i.style)
  2430. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2431. return i
  2432. }
  2433. }
  2434. };
  2435. return i
  2436. }
  2437. 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;
  2438. function t(e) {
  2439. for (var t = 0, i = r.length; t < i; t++) {
  2440. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2441. if (null != o.style[n])
  2442. return n
  2443. }
  2444. }
  2445. We.on(Xe, function(e) {
  2446. var t = e.originalEvent[He]
  2447. , i = +new Date;
  2448. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2449. }),
  2450. function(t) {
  2451. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2452. var t = (new Date).getTime()
  2453. , i = Math.max(0, 16 - (t - r))
  2454. , n = setTimeout(e, i);
  2455. return r = t,
  2456. n
  2457. }
  2458. ;
  2459. var r = (new Date).getTime()
  2460. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2461. ze = function(e) {
  2462. i.call(t, e)
  2463. }
  2464. }(window),
  2465. r = ["", "webkit", "moz", "ms", "o"],
  2466. o = document.createElement("div"),
  2467. Ve = t("transform"),
  2468. ke = t("perspective") ? "translateZ(0) " : "",
  2469. e.Sly = Me,
  2470. xe.fn.sly = function(n, r) {
  2471. var o, a;
  2472. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2473. a = Array.prototype.slice.call(arguments, 1)),
  2474. n = {}),
  2475. this.each(function(e, t) {
  2476. var i = xe.data(t, He);
  2477. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2478. })
  2479. }
  2480. ,
  2481. Me.defaults = {
  2482. slidee: null,
  2483. horizontal: !1,
  2484. itemNav: null,
  2485. itemSelector: null,
  2486. smart: !1,
  2487. activateOn: null,
  2488. activateMiddle: !1,
  2489. scrollSource: null,
  2490. scrollBy: 0,
  2491. scrollHijack: 300,
  2492. scrollTrap: !1,
  2493. dragSource: null,
  2494. mouseDragging: !1,
  2495. touchDragging: !1,
  2496. releaseSwing: !1,
  2497. swingSpeed: .2,
  2498. elasticBounds: !1,
  2499. interactive: null,
  2500. scrollBar: null,
  2501. dragHandle: !1,
  2502. dynamicHandle: !1,
  2503. minHandleSize: 50,
  2504. clickBar: !1,
  2505. syncSpeed: .5,
  2506. pagesBar: null,
  2507. activatePageOn: null,
  2508. pageBuilder: function(e) {
  2509. return "<li>" + (e + 1) + "</li>"
  2510. },
  2511. forward: null,
  2512. backward: null,
  2513. prev: null,
  2514. next: null,
  2515. prevPage: null,
  2516. nextPage: null,
  2517. cycleBy: null,
  2518. cycleInterval: 5e3,
  2519. pauseOnHover: !1,
  2520. startPaused: !1,
  2521. moveBy: 300,
  2522. speed: 0,
  2523. easing: "swing",
  2524. startAt: null,
  2525. keyboardNavBy: null,
  2526. draggedClass: "dragged",
  2527. activeClass: "active",
  2528. disabledClass: "disabled"
  2529. }
  2530. }(jQuery, window),
  2531. function o(a, s, l) {
  2532. function c(i, e) {
  2533. if (!s[i]) {
  2534. if (!a[i]) {
  2535. var t = "function" == typeof require && require;
  2536. if (!e && t)
  2537. return t(i, !0);
  2538. if (h)
  2539. return h(i, !0);
  2540. var n = new Error("Cannot find module '" + i + "'");
  2541. throw n.code = "MODULE_NOT_FOUND",
  2542. n
  2543. }
  2544. var r = s[i] = {
  2545. exports: {}
  2546. };
  2547. a[i][0].call(r.exports, function(e) {
  2548. var t = a[i][1][e];
  2549. return c(t || e)
  2550. }, r, r.exports, o, a, s, l)
  2551. }
  2552. return s[i].exports
  2553. }
  2554. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2555. c(l[e]);
  2556. return c
  2557. }({
  2558. 1: [function(p, f, e) {
  2559. (function(e) {
  2560. "use strict";
  2561. function t(e) {
  2562. this.player = null,
  2563. this.director = null,
  2564. this.modelManager = null,
  2565. this.container = null,
  2566. this.tagManager = null,
  2567. this.fadeInSpeed = e,
  2568. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2569. }
  2570. var r = p("three")
  2571. , i = p("./util/logger")
  2572. , n = (p("./util/common"),
  2573. p("./enum/PlayerEvents"))
  2574. , o = p("./enum/DirectorEvents")
  2575. , a = p("./settings")
  2576. , s = p("./enum/Viewmode")
  2577. , l = (p("./enum/WarpStyle"),
  2578. p("./enum/BlackoutStyle"),
  2579. p("./enum/ModelManagerEvents"))
  2580. , c = p("./enum/tagEvents")
  2581. , h = p("./util/transitions")
  2582. , u = p("./util/lerp")
  2583. , d = new i(e);
  2584. window.THREE = r,
  2585. t.prototype.init = function(e, t, i, n, r) {
  2586. (window.app = this).player = t,
  2587. this.director = e,
  2588. this.modelManager = i,
  2589. this.tagManager = n,
  2590. this.container = r,
  2591. this.updateModel(),
  2592. this.bindEvents()
  2593. }
  2594. ,
  2595. t.prototype.bindEvents = function() {
  2596. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2597. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2598. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2599. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2600. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2601. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2602. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2603. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2604. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2605. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2606. }
  2607. ,
  2608. t.prototype.updateModel = function() {
  2609. this.model = this.modelManager.getActiveModel()
  2610. }
  2611. ,
  2612. t.prototype.handleWarpStarted = function() {
  2613. this.hidePlayerReticule()
  2614. }
  2615. ,
  2616. t.prototype.ontagActivated = function() {
  2617. this.hidePlayerReticule()
  2618. }
  2619. ,
  2620. t.prototype.onNavigationTotag = function() {
  2621. this.hidePlayerReticule()
  2622. }
  2623. ,
  2624. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2625. var n = this.modelManager.getActiveModel()
  2626. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2627. n.fadePanoMarkers(r),
  2628. n.setMode(t)
  2629. }
  2630. ,
  2631. t.prototype.handlePlayerModeChanged = function(e, t) {
  2632. var i = this.modelManager.getActiveModel()
  2633. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2634. i.setSide(n),
  2635. i.setMode(t)
  2636. }
  2637. ,
  2638. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2639. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2640. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2641. }
  2642. ,
  2643. t.prototype.handleActionInterruption = function() {}
  2644. ,
  2645. t.prototype.handleStartInside = function(e) {
  2646. var t = a[this.player.mode]
  2647. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2648. this.fadeIn(this.fadeInSpeed),
  2649. this.model.alpha = 0,
  2650. this.model.skybox.material.uniforms.opacity.value = 1,
  2651. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2652. var n = this.player.reticule;
  2653. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2654. }
  2655. ,
  2656. t.prototype.handleStartOutside = function(e) {
  2657. this.fadeIn(e)
  2658. }
  2659. ,
  2660. t.prototype.fadeIn = function(e) {
  2661. null != e || (e = 2e3,
  2662. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2663. $(this.container).fadeIn(e)
  2664. }
  2665. ,
  2666. t.prototype.hidePlayerReticule = function() {
  2667. this.player.reticule.hide()
  2668. }
  2669. ,
  2670. f.exports = t
  2671. }
  2672. ).call(this, "/js/DisplayController.js")
  2673. }
  2674. , {
  2675. "./enum/BlackoutStyle": 18,
  2676. "./enum/DirectorEvents": 23,
  2677. "./enum/tagEvents": 32,
  2678. "./enum/ModelManagerEvents": 33,
  2679. "./enum/PlayerEvents": 40,
  2680. "./enum/Viewmode": 51,
  2681. "./enum/WarpStyle": 52,
  2682. "./settings": 166,
  2683. "./util/common": 185,
  2684. "./util/lerp": 188,
  2685. "./util/logger": 189,
  2686. "./util/transitions": 195,
  2687. three: 217
  2688. }],
  2689. 2: [function(e, t, i) {
  2690. "use strict";
  2691. function n() {
  2692. this.baseStartTime = performance.timing.navigationStart,
  2693. this.loadingStartTime = null,
  2694. this.waitingStartTime = null,
  2695. this.appReadyTime = null
  2696. }
  2697. n.prototype.setBaseStartTime = function(e) {
  2698. this.baseStartTime = e || Date.now()
  2699. }
  2700. ,
  2701. n.prototype.setWaitingStartTime = function(e) {
  2702. this.waitingStartTime = e || Date.now()
  2703. }
  2704. ,
  2705. n.prototype.setLoadingStartTime = function(e) {
  2706. this.loadingStartTime = e || Date.now()
  2707. }
  2708. ,
  2709. n.prototype.setAppReadyTime = function(e) {
  2710. this.appReadyTime = e || Date.now()
  2711. }
  2712. ,
  2713. n.prototype.calcFullLoadingTime = function() {
  2714. var e = this.appReadyTime - this.baseStartTime;
  2715. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2716. e
  2717. }
  2718. ,
  2719. t.exports = n
  2720. }
  2721. , {}],
  2722. 3: [function(i, n, e) {
  2723. (function(e) {
  2724. "use strict";
  2725. function a() {
  2726. return 100 * Math.random()
  2727. }
  2728. var t = i("./util/logger")
  2729. , s = i("./util/browser")
  2730. , l = new t(e)
  2731. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2732. initialized: !1,
  2733. init: function(e, t) {
  2734. if (t = t || {},
  2735. !this.initialized) {
  2736. for (var i in this.initialized = !0,
  2737. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2738. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2739. e) {
  2740. var n = i.match("^sc_tilegen_([0-9]+)$");
  2741. n && (c.tilegen = a() < parseInt(n[1]));
  2742. var r = i.match("^sc_imgopt_([0-9]+)$");
  2743. r && (c.imgopt = a() < parseInt(r[1]))
  2744. }
  2745. for (var o in t)
  2746. c[o] = t[o],
  2747. l.debug("A/B override:", o, c[o])
  2748. }
  2749. },
  2750. changeIfTileGenerating: function(e) {
  2751. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2752. e += ""),
  2753. e
  2754. },
  2755. changeIfImageOptimzing: function(e) {
  2756. if(e.includes("blob:http"))return e;//add
  2757. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2758. e += ""),
  2759. e
  2760. },
  2761. tilegen: !1,
  2762. imgopt: !1
  2763. };
  2764. n.exports = c
  2765. }
  2766. ).call(this, "/js/ab.js")
  2767. }
  2768. , {
  2769. "./util/browser": 182,
  2770. "./util/logger": 189
  2771. }],
  2772. 4: [function(u, d, e) {
  2773. (function(e) {
  2774. "use strict";
  2775. function r(n, e, t, i) {
  2776. function r(e) {
  2777. a[e.sid] = !0;
  2778. var t = e.billboard.media && e.billboard.media.type
  2779. , i = {
  2780. tag_id: e.sid,
  2781. tags_visited: Object.keys(a).length,
  2782. tag_count: Object.keys(n.tags).length,
  2783. tag_view_count: ++d,
  2784. has_media: !!t
  2785. };
  2786. t && (i.media_type = t),
  2787. g("tag_opened", i)
  2788. }
  2789. var o, a = {}, s = Date.now() - P, l = null;
  2790. i && (l = Date.now() - window.navigationStart);
  2791. try {
  2792. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2793. } catch (n) {
  2794. o = !1
  2795. }
  2796. var c, h = n.supportsVR;
  2797. h || (c = "VR disabled at the model/account level",
  2798. 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"))),
  2799. g("model_loaded", {
  2800. duration: s,
  2801. duration_from_navigation_start: l,
  2802. has_hlr: o,
  2803. has_vr: h,
  2804. vr_reason: c
  2805. });
  2806. var u = 0;
  2807. n.panos.forEach(function(e) {
  2808. e.on("enter", function() {
  2809. f("pano_viewed", {
  2810. pano_id: e.id,
  2811. pano_view_count: ++u,
  2812. alignment_type: e.alignmentType,
  2813. interaction_source: R,
  2814. navigation_source: v
  2815. })
  2816. })
  2817. });
  2818. var d = 0;
  2819. for (var p in n.tags)
  2820. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2821. e.on("tour_auto", function(e) {
  2822. v = "tour_" + e
  2823. }),
  2824. e.on("tour_manual", function(e) {
  2825. R = "gui-" + e,
  2826. v = "tour_manual"
  2827. }),
  2828. t.on(C.InteractionKey, function() {
  2829. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2830. }),
  2831. t.on(C.InteractionDirect, function() {
  2832. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2833. }),
  2834. function(t) {
  2835. I.on(T.OPENED, function() {
  2836. f("showcase_share_intent", {
  2837. pano_id: t.currentPano && t.currentPano.id
  2838. })
  2839. }),
  2840. I.on(T.LINK_CLICKED, function(e) {
  2841. f("showcase_share_action", {
  2842. channel: e.channel,
  2843. pano_id: t.currentPano && t.currentPano.id
  2844. })
  2845. }),
  2846. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2847. f("showcase_share_origin_link_clicked")
  2848. })
  2849. }(e),
  2850. function() {
  2851. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2852. gui_action: "click_vr_button"
  2853. })),
  2854. _.on(S.LAUNCH, function(e) {
  2855. f("showcase_gui", {
  2856. gui_action: "launch_vr",
  2857. vr_platform: e.vr_platform,
  2858. vr_app: e.vr_app
  2859. })
  2860. }),
  2861. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2862. gui_action: "vr_modal_prev"
  2863. })),
  2864. _.on(S.NEXT, function(e) {
  2865. f("showcase_gui", {
  2866. gui_action: e.nextAction
  2867. })
  2868. }),
  2869. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2870. gui_action: "vr_modal_close"
  2871. })),
  2872. _.on(S.falseICECHOSEN, function(e) {
  2873. f("showcase_gui", {
  2874. gui_action: e.name + " "
  2875. })
  2876. }),
  2877. _.on(S.STORE, function(e) {
  2878. f("showcase_gui", {
  2879. gui_action: "launch_store",
  2880. store: e
  2881. })
  2882. })
  2883. }()
  2884. }
  2885. function f(e, t) {
  2886. if (t = t || {},
  2887. i)
  2888. try {
  2889. window.analytics.track(e, s.extendObject(t, c), {
  2890. context: {
  2891. app: {
  2892. name: "showcase",
  2893. version: "2.25.6-0-gd87e5b1"
  2894. },
  2895. screen: {
  2896. width: window.screen.width,
  2897. height: window.screen.height,
  2898. density: window.devicePixelRatio
  2899. }
  2900. }
  2901. })
  2902. } catch (t) {
  2903. console.warn("Failed to send data to segment for " + e)
  2904. }
  2905. }
  2906. function g(e, t) {
  2907. f(e, t = t || {})
  2908. }
  2909. function m(e, t) {
  2910. R = e === C.InteractionGui ? "gui-" + t : e,
  2911. v = "self_guided"
  2912. }
  2913. var v, o, a = (u("three"),
  2914. u("./util/ajax"),
  2915. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2916. 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"),
  2917. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2918. d.exports = {
  2919. report: function(e, t, i, n) {
  2920. !function(e, t) {
  2921. if (o)
  2922. try {
  2923. o.addEvent(e, s.extendObject({
  2924. host: window.location.host,
  2925. keen: {
  2926. addons: [{
  2927. name: "keen:ua_parser",
  2928. input: {
  2929. ua_string: "user_agent"
  2930. },
  2931. output: "parsed_user_agent"
  2932. }]
  2933. },
  2934. user_agent: "${keen.user_agent}",
  2935. referrer: {
  2936. url: s.normalizeUrl(document.referrer),
  2937. domain: s.domainFromUrl(document.referrer),
  2938. url_original: document.referrer
  2939. },
  2940. embedded: y.inIframe(),
  2941. is_mobile: y.isMobile(),
  2942. version: "2.25.6-0-gd87e5b1"
  2943. }, t))
  2944. } catch (e) {
  2945. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2946. }
  2947. }("Session starts", {
  2948. model: e,
  2949. status: t,
  2950. loadtime: Date.now() - (P || Date.now()),
  2951. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2952. autoplay: i,
  2953. quickstart: n,
  2954. ab_tilegen: a.tilegen,
  2955. ab_imgopt: a.imgopt
  2956. })
  2957. },
  2958. impression: function(e) {
  2959. g("impression", {
  2960. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2961. url_params: (void 0 !== e.immediate && e.immediate,
  2962. window.location.search.substr(1).split("&"))
  2963. })
  2964. },
  2965. initKeen: function(e) {
  2966. return e.token && e.appId ? void (o = new Keen({
  2967. projectId: e.appId,
  2968. writeKey: e.token,
  2969. readKey: "",
  2970. requestType: "xhr"
  2971. })) : void l.warn("no keen token/appId")
  2972. },
  2973. initSegment: function(e) {
  2974. return e.token ? (i = e.token,
  2975. window.analytics.load(e.token),
  2976. c = {
  2977. model_id: e.model,
  2978. start_source: e.startSource,
  2979. autoplay: e.autoplay,
  2980. quickstart: e.quickstart,
  2981. language_tag: t.languageTag,
  2982. is_mobile: y.isMobile(),
  2983. iframe: y.inIframe(),
  2984. aspect_ratio: y.aspectRatio(),
  2985. session_id: h,
  2986. window: {
  2987. width: $("#player").width(),
  2988. height: $("#player").height()
  2989. },
  2990. platform: {
  2991. browser: {
  2992. name: $.ua.browser.name,
  2993. major: $.ua.browser.major,
  2994. version: $.ua.browser.version
  2995. },
  2996. os: {
  2997. name: $.ua.os.name,
  2998. version: $.ua.os.version
  2999. },
  3000. device: {
  3001. vendor: $.ua.device.vendor,
  3002. model: $.ua.device.model,
  3003. type: $.ua.device.type
  3004. }
  3005. }
  3006. },
  3007. n = Math.random() < t.analytics.sessionTrackingRate,
  3008. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3009. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3010. },
  3011. sessionStart: function(e) {
  3012. l.debug("analytics user_session_start"),
  3013. f("session_started"),
  3014. P = Date.now(),
  3015. window.addEventListener("unload", function() {
  3016. !function(e, t) {
  3017. if (t = t || {},
  3018. navigator.sendBeacon && i)
  3019. try {
  3020. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3021. event: e,
  3022. anonymousId: window.analytics.user().anonymousId(),
  3023. properties: s.extendObject(t, c),
  3024. writeKey: i,
  3025. sentAt: Date.now(),
  3026. type: "track",
  3027. context: {
  3028. userAgent: y.userAgent(),
  3029. library: {
  3030. name: "showcase-beacon",
  3031. version: "2.25.6-0-gd87e5b1"
  3032. },
  3033. app: {
  3034. name: "showcase",
  3035. version: "2.25.6-0-gd87e5b1"
  3036. }
  3037. }
  3038. }))
  3039. } catch (e) {
  3040. console.warn("Failed to send async segment request")
  3041. }
  3042. }("session_ended", {
  3043. duration: Date.now() - P
  3044. })
  3045. })
  3046. },
  3047. modelLoaded: function(e, t, i, n) {
  3048. r(e, t, i, n)
  3049. },
  3050. loadComplete: function(e) {
  3051. f("load_times", {
  3052. time_to_app_start: e
  3053. })
  3054. },
  3055. track: function(e, t) {
  3056. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3057. f(e, t))
  3058. },
  3059. trackAlways: function(e, t) {
  3060. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3061. f(e, t)
  3062. },
  3063. getSessionId: function() {
  3064. return h
  3065. },
  3066. updateInteraction: m
  3067. }
  3068. }
  3069. ).call(this, "/js/analytics.js")
  3070. }
  3071. , {
  3072. "./ab": 3,
  3073. "./enum/ControlEvents": 21,
  3074. "./enum/PlayerEvents": 40,
  3075. "./enum/VROption": 47,
  3076. "./enum/VRPlatforms": 49,
  3077. "./enum/Viewmode": 51,
  3078. "./gui/sharing/ShareEvents": 76,
  3079. "./gui/sharing/modal": 77,
  3080. "./gui/title/TitleEvents": 80,
  3081. "./gui/title/titleBar": 82,
  3082. "./gui/vr/vrEvent": 85,
  3083. "./gui/vr/vrModal": 87,
  3084. "./localization/localize": 108,
  3085. "./tag/Billboard/BillboardEvent": 120,
  3086. "./settings": 166,
  3087. "./util/ajax": 181,
  3088. "./util/browser": 182,
  3089. "./util/common": 185,
  3090. "./util/logger": 189,
  3091. three: 217
  3092. }],
  3093. 5: [function(e, t, i) {
  3094. "use strict";
  3095. function n() {
  3096. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3097. this.controls = null
  3098. }
  3099. var r = e("three")
  3100. , o = e("../constants")
  3101. , a = e("../util/cameraLight");
  3102. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3103. this.aspect = e,
  3104. this.updateProjectionMatrix()
  3105. }
  3106. ,
  3107. t.exports = n
  3108. }
  3109. , {
  3110. "../constants": 8,
  3111. "../util/cameraLight": 184,
  3112. three: 217
  3113. }],
  3114. 6: [function(e, t, i) {
  3115. "use strict";
  3116. function n() {
  3117. var e = $("#player").width() / $("#player").height();
  3118. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3119. this.controls = null,
  3120. this.updateAspect(e)
  3121. }
  3122. var r = e("three")
  3123. , o = e("../constants");
  3124. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3125. this.aspect = e,
  3126. this.top = o.orthoBase / e,
  3127. this.bottom = -o.orthoBase / e,
  3128. this.updateProjectionMatrix()
  3129. }
  3130. ,
  3131. t.exports = n
  3132. }
  3133. , {
  3134. "../constants": 8,
  3135. three: 217
  3136. }],
  3137. 7: [function(e, t, i) {
  3138. "use strict";
  3139. function n() {
  3140. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3141. this.controls = null
  3142. }
  3143. var r = e("three")
  3144. , o = e("../settings")
  3145. , a = e("../util/cameraLight");
  3146. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3147. this.aspect = e,
  3148. this.updateProjectionMatrix()
  3149. }
  3150. ,
  3151. t.exports = n
  3152. }
  3153. , {
  3154. "../settings": 166,
  3155. "../util/cameraLight": 184,
  3156. three: 217
  3157. }],
  3158. 8: [function(e, t, i) {
  3159. "use strict";
  3160. t.exports = {
  3161. signedUrlDefaultExpireTime: 24e4,
  3162. signedUrlCheckInterval: 1e4,
  3163. signedUrlRefreshBuffer: 15e3,
  3164. dollhouseFOV: 70,
  3165. dollhouseNear: .1,//1,
  3166. dollhouseFar: 5e3,
  3167. insideFOV: 70,
  3168. insideFOVMax: 120,
  3169. insideNear: .1,
  3170. insideFar: 5e3,
  3171. insideLookSpeed: .12,
  3172. insideLookLimitUp: 40,
  3173. insideLookLimitDown: -40,
  3174. orthoNear: 1,
  3175. orthoFar: 5e3,
  3176. orthoBase: 10,
  3177. narrowLandscapeHeight: 290,
  3178. reallyNarrowLandscapeHeight: 250,
  3179. visionTilingStartDate: new Date("8/26/2016"),
  3180. visionTilingStartVersion: "1.1.407.13667",
  3181. windowHeightHighQualityThreshold: 900,
  3182. tourStepDelayDefault: 3500,
  3183. tourStepDelaySlideShow: 5e3,
  3184. workshopApsect: 9 / 16,
  3185. highQualityMaxZoom: 2,
  3186. ultraHighQualityMaxZoom: 3
  3187. }
  3188. }
  3189. , {}],
  3190. 9: [function(e, t, i) {
  3191. "use strict";
  3192. function n() {
  3193. this.activeControl = null,
  3194. this.controls = {},
  3195. this.cameras = {}
  3196. }
  3197. var a = e("./PanoramaControls")
  3198. , s = e("./DollhouseControls")
  3199. , l = e("./FloorplanControls")
  3200. , c = e("../cameras/PanoramaCamera")
  3201. , h = e("../cameras/DollhouseCamera")
  3202. , u = e("../cameras/FloorplanCamera")
  3203. , r = e("events").EventEmitter
  3204. , d = e("../enum/ControlEvents")
  3205. , o = e("../enum/ModelManagerEvents")
  3206. , p = e("../enum/Viewmode")
  3207. , f = e("../settings");
  3208. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3209. this.setUpControls(),
  3210. this.bindEvents(e, t)
  3211. }
  3212. ,
  3213. n.prototype.activateControls = function(e) {
  3214. this.activeControl && (this.activeControl.reset(),
  3215. this.activeControl.enabled = !1),
  3216. this.controls[e] && (this.controls[e].enabled = !0),
  3217. this.activeControl = this.controls[e]
  3218. }
  3219. ,
  3220. n.prototype.setUpControls = function() {
  3221. var i = {}
  3222. , n = {}
  3223. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3224. , r = [c, h, u]
  3225. , o = [a, s, l];
  3226. e.forEach(function(e, t) {
  3227. i[e] = new r[t],
  3228. n[e] = new o[t](i[e]),
  3229. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3230. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3231. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3232. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3233. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3234. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3235. }
  3236. .bind(this)),
  3237. this.controls = n,
  3238. this.cameras = i
  3239. }
  3240. ,
  3241. n.prototype.bindEvents = function(e, t) {
  3242. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3243. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3244. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3245. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3246. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3247. passive: !1
  3248. }),
  3249. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3250. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3251. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3252. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3253. e.addEventListener("contextmenu", function(e) {
  3254. e.preventDefault()
  3255. }),
  3256. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3257. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3258. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3259. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3260. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3261. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3262. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3263. t.on(o.ActiveModelChanged, function(e) {
  3264. this.setModelForControls(e.model)
  3265. }
  3266. .bind(this))
  3267. }
  3268. ,
  3269. n.prototype.setModelForControls = function(e) {
  3270. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3271. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3272. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3273. this.controls[e].setBounds(t)
  3274. }
  3275. .bind(this))
  3276. }
  3277. ,
  3278. n.prototype.onMouseDown = function(e) {
  3279. e.preventDefault(),
  3280. this.activeControl && this.activeControl.onMouseDown(e)
  3281. }
  3282. ,
  3283. n.prototype.onMouseMove = function(e) {
  3284. e.preventDefault(),
  3285. this.activeControl && this.activeControl.onMouseMove(e)
  3286. }
  3287. ,
  3288. n.prototype.onMouseUp = function(e) {
  3289. e.preventDefault(),
  3290. this.activeControl && this.activeControl.onMouseUp(e)
  3291. }
  3292. ,
  3293. n.prototype.onMouseOver = function(e) {
  3294. e.preventDefault(),
  3295. this.activeControl && this.activeControl.onMouseOver(e)
  3296. }
  3297. ,
  3298. n.prototype.onMouseWheel = function(e) {
  3299. e.preventDefault(),
  3300. this.activeControl && this.activeControl.onMouseWheel(e)
  3301. }
  3302. ,
  3303. n.prototype.onTouchStart = function(e) {
  3304. e.preventDefault(),
  3305. this.activeControl && this.activeControl.onTouchStart(e),
  3306. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3307. $("#hotListContent ul .active").removeClass("active"),
  3308. $("#hotList")[0].classList.remove("active")
  3309. }
  3310. ,
  3311. n.prototype.onTouchMove = function(e) {
  3312. e.preventDefault(),
  3313. this.activeControl && this.activeControl.onTouchMove(e)
  3314. }
  3315. ,
  3316. n.prototype.onTouchEnd = function(e) {
  3317. e.preventDefault(),
  3318. this.activeControl && this.activeControl.onTouchEnd(e)
  3319. }
  3320. ,
  3321. n.prototype.onPointerDown = function(e) {
  3322. if (e.preventDefault(),
  3323. this.activeControl)
  3324. switch (e.pointerType) {
  3325. case "mouse":
  3326. this.activeControl.onMouseDown(e);
  3327. break;
  3328. default:
  3329. this.activeControl.onPointerDown(e)
  3330. }
  3331. }
  3332. ,
  3333. n.prototype.onPointerMove = function(e) {
  3334. if (e.preventDefault(),
  3335. this.activeControl)
  3336. switch (e.pointerType) {
  3337. case "mouse":
  3338. this.activeControl.onMouseMove(e);
  3339. break;
  3340. default:
  3341. this.activeControl.onPointerMove(e)
  3342. }
  3343. }
  3344. ,
  3345. n.prototype.onPointerUp = function(e) {
  3346. if (e.preventDefault(),
  3347. this.activeControl)
  3348. switch (e.pointerType) {
  3349. case "mouse":
  3350. this.activeControl.onMouseUp(e);
  3351. break;
  3352. default:
  3353. this.activeControl.onPointerUp(e)
  3354. }
  3355. }
  3356. ,
  3357. n.prototype.onPointerCancel = function(e) {
  3358. e.preventDefault(),
  3359. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3360. }
  3361. ,
  3362. n.prototype.onKeyDown = function(e) {
  3363. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3364. this.activeControl && this.activeControl.onKeyDown(e))
  3365. }
  3366. ,
  3367. n.prototype.onKeyUp = function(e) {
  3368. e.preventDefault(),
  3369. this.activeControl && this.activeControl.onKeyUp(e)
  3370. }
  3371. ,
  3372. t.exports = n
  3373. }
  3374. , {
  3375. "../cameras/DollhouseCamera": 5,
  3376. "../cameras/FloorplanCamera": 6,
  3377. "../cameras/PanoramaCamera": 7,
  3378. "../enum/ControlEvents": 21,
  3379. "../enum/ModelManagerEvents": 33,
  3380. "../enum/Viewmode": 51,
  3381. "../settings": 166,
  3382. "./DollhouseControls": 10,
  3383. "./FloorplanControls": 11,
  3384. "./PanoramaControls": 13,
  3385. events: 202
  3386. }],
  3387. 10: [function(e, t, i) {
  3388. "use strict";
  3389. function n(e) {
  3390. a.call(this, e),
  3391. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3392. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3393. this.minDistance = o.dollhouseDefault.minDistance,
  3394. this.maxDistance = o.dollhouseDefault.maxDistance,
  3395. this.adjustedMinDistance = this.minDistance,
  3396. this.adjustedMaxDistance = this.maxDistance
  3397. }
  3398. var r = e("three")
  3399. , o = e("../settings")
  3400. , a = e("./OutsideControls");
  3401. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3402. this.camera.updateMatrix();
  3403. var i = this.camera.position.clone().sub(this.target).length();
  3404. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3405. this.panLeft(2 * e * i / $("#player").height()),
  3406. this.panUp(-2 * t * i / $("#player").height())
  3407. }
  3408. ,
  3409. n.prototype.updateZoom = function() {
  3410. return this.offset.length() * this.scale
  3411. }
  3412. ,
  3413. n.prototype.setZoomBounds = function(e) {
  3414. var t = e.min.distanceTo(e.max);
  3415. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3416. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3417. this.minDistance = this.adjustedMinDistance,
  3418. this.maxDistance = this.adjustedMaxDistance
  3419. }
  3420. ,
  3421. n.prototype.resetRanges = function(e, t) {
  3422. e ? (this.minDistance = Math.min(e, this.minDistance),
  3423. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3424. this.maxDistance = this.adjustedMaxDistance),
  3425. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3426. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3427. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3428. }
  3429. ,
  3430. n.prototype.toJSON = function() {
  3431. return a.prototype.toJSON.call(this)
  3432. }
  3433. ,
  3434. t.exports = n
  3435. }
  3436. , {
  3437. "../settings": 166,
  3438. "./OutsideControls": 12,
  3439. three: 217
  3440. }],
  3441. 11: [function(e, t, i) {
  3442. "use strict";
  3443. function n(e) {
  3444. c.call(this, e),
  3445. this.minDistance = 15,
  3446. this.maxDistance = 50,
  3447. this.noRotateUpDown = !0,
  3448. this.minPolarAngle = 0,
  3449. this.maxPolarAngle = 0,
  3450. this.mouseActions[u.LEFT] = h.PAN,
  3451. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3452. this.mouseActions[u.RIGHT] = h.ROTATE,
  3453. this.touchActions[1] = h.PAN,
  3454. this.touchActions[2] = h.ROTATE_DOLLY,
  3455. this.absoluteScale = 1,
  3456. this.currentScale = 1
  3457. }
  3458. 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");
  3459. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3460. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3461. this.currentScale = this.absoluteScale
  3462. }
  3463. ,
  3464. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3465. var t = Math.max(modelSize.x, modelSize.z)
  3466. , i = Math.min(modelSize.x, modelSize.z)
  3467. , n = Math.max(t, i * this.camera.aspect)
  3468. , r = Math.max(i, t * this.camera.aspect);
  3469. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3470. return absoluteScale
  3471. },
  3472. n.prototype.rotateToView = function(e, t) {
  3473. var i = 0;
  3474. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3475. this.rotateLeft(i),
  3476. this.update(0)
  3477. }
  3478. ,
  3479. n.prototype.pan = function(e, t) {
  3480. this.camera.updateMatrix(),
  3481. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3482. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3483. }
  3484. ,
  3485. n.prototype.updateZoom = function() {
  3486. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3487. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3488. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3489. this.camera.left = -l.orthoBase * this.currentScale,
  3490. this.camera.right = l.orthoBase * this.currentScale,
  3491. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3492. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3493. this.camera.updateProjectionMatrix(),
  3494. this.offset.length()
  3495. }
  3496. ,
  3497. n.prototype.toJSON = (r = new s.Quaternion,
  3498. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3499. a = new s.Quaternion,
  3500. function() {
  3501. var e = c.prototype.toJSON.call(this);
  3502. return r.copy(e.camera_quaternion),
  3503. a.copy(o),
  3504. a.multiply(r),
  3505. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3506. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3507. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3508. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3509. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3510. e
  3511. }
  3512. ),
  3513. t.exports = n
  3514. }
  3515. , {
  3516. "../enum/ControlActions": 20,
  3517. "../enum/MouseButton": 34,
  3518. "../settings": 166,
  3519. "../util/browser": 182,
  3520. "../util/math": 190,
  3521. "./OutsideControls": 12,
  3522. three: 217
  3523. }],
  3524. 12: [function(e, t, i) {
  3525. "use strict";
  3526. function n(e) {
  3527. this.camera = e,
  3528. (this.camera.controls = this).enabled = !1,
  3529. this.target = new a.Vector3,
  3530. this.targetBounds = new a.Box3,
  3531. this.zoomSpeed = 2,//编辑时缩放快一些
  3532. this.minDistance = 0,
  3533. this.maxDistance = 1 / 0,
  3534. this.noRotateUpDown = !1,
  3535. this.rotateSpeed = 1,
  3536. this.keyboardZoomSpeed = 0,
  3537. this.keyPanSpeed = 7,
  3538. this.autoRotate = !1,
  3539. this.autoRotateSpeed = 2,
  3540. this.autoPan = !1,
  3541. this.autoPanPosition = new a.Vector3,
  3542. this.minPolarAngle = a.Math.degToRad(25),
  3543. this.maxPolarAngle = a.Math.degToRad(65),
  3544. this.rotationAcceleration = new a.Vector2,
  3545. this.rotationSpeed = new a.Vector2,
  3546. this.panAcceleration = new a.Vector2,
  3547. this.panSpeed = new a.Vector2,
  3548. this.rotateStart = new a.Vector2,
  3549. this.rotateEnd = new a.Vector2,
  3550. this.rotateDelta = new a.Vector2,
  3551. this.panStart = new a.Vector2,
  3552. this.panEnd = new a.Vector2,
  3553. this.panDelta = new a.Vector2,
  3554. this.panOffset = new a.Vector3,
  3555. this.offset = new a.Vector3,
  3556. this.dollyStart = new a.Vector2,
  3557. this.dollyEnd = new a.Vector2,
  3558. this.dollyDelta = new a.Vector2,
  3559. this.phiDelta = 0,
  3560. this.thetaDelta = 0,
  3561. this.scale = 1,
  3562. this.panVector = new a.Vector3,
  3563. this.lastPosition = new a.Vector3,
  3564. this.state = u.NONE,
  3565. this.mouseActions = {},
  3566. this.mouseActions[d.LEFT] = u.ROTATE,
  3567. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3568. this.mouseActions[d.RIGHT] = u.PAN,
  3569. this.touchActions = {},
  3570. this.touchActions[1] = u.ROTATE,
  3571. this.touchActions[2] = u.PAN_DOLLY,
  3572. this.lastMoveTime = 0,
  3573. this.pointersLimit = 2,
  3574. this.pointers = []
  3575. }
  3576. 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;
  3577. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3578. this.targetBounds = e
  3579. }
  3580. ,
  3581. n.prototype.isEngaged = function() {
  3582. return this.state !== u.NONE
  3583. }
  3584. ,
  3585. n.prototype.rotateLeft = function(e) {
  3586. void 0 === e && (e = this.getAutoRotationAngle()),
  3587. this.thetaDelta -= e
  3588. }
  3589. ,
  3590. n.prototype.rotateUp = function(e) {
  3591. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3592. this.phiDelta -= e)
  3593. }
  3594. ,
  3595. n.prototype.panLeft = function(e) {
  3596. var t = this.camera.matrix.elements;
  3597. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3598. this.panOffset.multiplyScalar(-e),
  3599. this.panVector.add(this.panOffset)
  3600. }
  3601. ,
  3602. n.prototype.panUp = function(e) {
  3603. var t = this.camera.matrix.elements;
  3604. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3605. this.panOffset.multiplyScalar(-e),
  3606. this.panVector.add(this.panOffset)
  3607. }
  3608. ,
  3609. n.prototype.startRotating = function(e, t) {
  3610. e && this.navRotationAcc("x", e),
  3611. t && this.navRotationAcc("y", t)
  3612. }
  3613. ,
  3614. n.prototype.stopRotating = function(e) {
  3615. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3616. this.navRotationAcc("x", 0),
  3617. this.navRotationAcc("y", 0)
  3618. }
  3619. ,
  3620. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3621. o = new a.Vector3,
  3622. function(e, t) {
  3623. r.copy(this.camera.position),
  3624. void 0 === e && null === e || r.setX(e),
  3625. void 0 === t && null === t || r.setZ(t);
  3626. var i = this.camera.position.distanceTo(this.target)
  3627. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3628. this.targetClamped = !1,
  3629. o.copy(r).addScaledVector(n, i),
  3630. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3631. r.copy(o).addScaledVector(n, -i),
  3632. this.targetClamped = !0),
  3633. this.autoPanPosition.x = r.x,
  3634. this.autoPanPosition.z = r.z,
  3635. this.autoPan && this.stopAutoPanning()
  3636. }
  3637. ),
  3638. n.prototype.stopAutoPanning = function() {
  3639. var e = this.autoPan;
  3640. this.autoPan = !1,
  3641. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3642. }
  3643. ,
  3644. n.prototype.dollyIn = function(e) {
  3645. void 0 === e && (e = this.getZoomScale()),
  3646. this.scale /= e
  3647. }
  3648. ,
  3649. n.prototype.dollyOut = function(e) {
  3650. void 0 === e && (e = this.getZoomScale()),
  3651. this.scale *= e
  3652. }
  3653. ,
  3654. n.prototype.updatePan = function(e) {
  3655. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3656. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3657. this.autoPan) {
  3658. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3659. t.setY(0).clampLength(0, 50 * e),
  3660. this.target.add(t),
  3661. this.camera.position.add(t),
  3662. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3663. this.stopAutoPanning())
  3664. }
  3665. }
  3666. ,
  3667. n.prototype.update = function(e) {
  3668. e = e || 1 / 60,
  3669. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3670. this.rotateLeft(-this.rotationSpeed.x),
  3671. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3672. this.updatePan(e);
  3673. var t = this.camera.position;
  3674. this.offset.copy(t).sub(this.target);
  3675. var i = Math.atan2(this.offset.x, this.offset.z)
  3676. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3677. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3678. i += this.thetaDelta,
  3679. n += this.phiDelta,
  3680. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3681. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3682. var r = this.updateZoom();
  3683. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3684. this.target.add(this.panVector),
  3685. this.targetBounds.clampPoint(this.target, this.target),
  3686. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3687. this.offset.y = r * Math.cos(n),
  3688. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3689. t.copy(this.target).add(this.offset),
  3690. this.camera.lookAt(this.target),
  3691. this.thetaDelta = 0,
  3692. this.phiDelta = 0,
  3693. this.scale = 1,
  3694. this.panVector.set(0, 0, 0),
  3695. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3696. }
  3697. ,
  3698. n.prototype.getAutoRotationAngle = function() {
  3699. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3700. }
  3701. ,
  3702. n.prototype.getZoomScale = function() {
  3703. return Math.pow(.95, this.zoomSpeed)
  3704. }
  3705. ,
  3706. n.prototype.onMouseDown = function(e) {
  3707. if (this.enabled) {
  3708. switch (e.preventDefault(),
  3709. this.stopAutoPanning(),
  3710. this.mouseDown = !0,
  3711. this.state = this.mouseActions[e.button],
  3712. this.state) {
  3713. case u.ROTATE:
  3714. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3715. this.rotationSpeed.set(0, 0);
  3716. break;
  3717. case u.DOLLY:
  3718. this.dollyStart.set(e.clientX, e.clientY);
  3719. break;
  3720. case u.PAN:
  3721. this.panStart.set(e.clientX, e.clientY)
  3722. }
  3723. this.emit(f.InputStart, "mouse")
  3724. }
  3725. }
  3726. ,
  3727. n.prototype.onMouseMove = function(e) {
  3728. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3729. switch (e.preventDefault(),
  3730. this.state) {
  3731. case u.ROTATE:
  3732. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3733. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3734. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3735. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3736. this.rotateStart.copy(this.rotateEnd);
  3737. break;
  3738. case u.DOLLY:
  3739. this.dollyEnd.set(e.clientX, e.clientY),
  3740. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3741. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3742. this.dollyStart.copy(this.dollyEnd);
  3743. break;
  3744. case u.PAN:
  3745. this.panEnd.set(e.clientX, e.clientY),
  3746. this.panDelta.subVectors(this.panEnd, this.panStart),
  3747. this.pan(this.panDelta.x, this.panDelta.y),
  3748. this.panStart.copy(this.panEnd)
  3749. }
  3750. this.emit(f.Move, "mouse"),
  3751. this.lastMoveTime = e.timeStamp,
  3752. this.update()
  3753. }
  3754. }
  3755. ,
  3756. n.prototype.onMouseUp = function(e) {
  3757. this.enabled && (this.mouseDown = !1,
  3758. this.state = u.NONE,
  3759. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3760. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3761. this.update(),
  3762. this.rotationAcceleration.set(0, 0),
  3763. this.rotateDelta.set(0, 0)))
  3764. }
  3765. ,
  3766. n.prototype.onMouseOver = function(e) {
  3767. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3768. }
  3769. ,
  3770. n.prototype.onMouseWheel = function(e) {
  3771. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3772. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3773. this.update())
  3774. }
  3775. ,
  3776. n.prototype.onKeyDown = function(e) {
  3777. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3778. this.handleKeyDown(e.which)))
  3779. }
  3780. ,
  3781. n.prototype.navRotationAcc = function(e, t) {
  3782. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3783. }
  3784. ,
  3785. n.prototype.navPanAcc = function(e, t) {
  3786. this.stopAutoPanning(),
  3787. this.panAcceleration[e] = t
  3788. }
  3789. ,
  3790. n.prototype.handleKeyDown = function(e) {
  3791. var t = !0;
  3792. switch (e) {
  3793. case p.UPARROW:
  3794. case p.I:
  3795. this.navRotationAcc("y", 1);
  3796. break;
  3797. case p.DOWNARROW:
  3798. case p.K:
  3799. this.navRotationAcc("y", -1);
  3800. break;
  3801. case p.LEFTARROW:
  3802. case p.J:
  3803. this.navRotationAcc("x", -1);
  3804. break;
  3805. case p.RIGHTARROW:
  3806. case p.L:
  3807. this.navRotationAcc("x", 1);
  3808. break;
  3809. case p.W:
  3810. this.navPanAcc("y", 1);
  3811. break;
  3812. case p.S:
  3813. this.navPanAcc("y", -1);
  3814. break;
  3815. case p.A:
  3816. this.navPanAcc("x", -1);
  3817. break;
  3818. case p.D:
  3819. this.navPanAcc("x", 1);
  3820. break;
  3821. default:
  3822. t = !1
  3823. }
  3824. t && this.emit(f.Move, "key")
  3825. }
  3826. ,
  3827. n.prototype.onKeyUp = function(e) {
  3828. this.enabled && (e.preventDefault(),
  3829. e.stopPropagation(),
  3830. this.handleKeyUp(e.which))
  3831. }
  3832. ,
  3833. n.prototype.handleKeyUp = function(e) {
  3834. switch (e) {
  3835. case p.I:
  3836. case p.K:
  3837. case p.UPARROW:
  3838. case p.DOWNARROW:
  3839. this.keyboardZoomSpeed = 0,
  3840. this.rotationAcceleration.y = 0;
  3841. break;
  3842. case p.J:
  3843. case p.L:
  3844. case p.LEFTARROW:
  3845. case p.RIGHTARROW:
  3846. this.rotationAcceleration.x = 0;
  3847. break;
  3848. case p.S:
  3849. case p.W:
  3850. this.panAcceleration.y = 0;
  3851. break;
  3852. case p.A:
  3853. case p.D:
  3854. this.panAcceleration.x = 0
  3855. }
  3856. }
  3857. ,
  3858. n.prototype.onTouchStart = function(i) {
  3859. if (this.enabled || this.state === u.NONE) {
  3860. i.preventDefault(),
  3861. i.stopPropagation(),
  3862. this.stopAutoPanning();
  3863. var e = function() {
  3864. if (2 === i.touches.length) {
  3865. var e = i.touches[0].pageX - i.touches[1].pageX
  3866. , t = i.touches[0].pageY - i.touches[1].pageY;
  3867. this.dollyStart.set(e, t)
  3868. }
  3869. }
  3870. .bind(this)
  3871. , t = function() {
  3872. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3873. }
  3874. .bind(this)
  3875. , n = function() {
  3876. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3877. }
  3878. .bind(this);
  3879. switch (this.state = this.touchActions[i.touches.length],
  3880. this.state) {
  3881. case u.PAN_DOLLY:
  3882. e();
  3883. case u.PAN:
  3884. t();
  3885. break;
  3886. case u.ROTATE_DOLLY:
  3887. e();
  3888. case u.ROTATE:
  3889. n()
  3890. }
  3891. this.rotationSpeed.set(0, 0),
  3892. this.emit(f.InputStart, "touch")
  3893. }
  3894. }
  3895. ,
  3896. n.prototype.onTouchMove = function(a) {
  3897. if (this.enabled && this.state !== u.NONE) {
  3898. a.preventDefault(),
  3899. a.stopPropagation();
  3900. var s = function() {
  3901. var e = a.touches[0].pageX - a.touches[1].pageX
  3902. , t = a.touches[0].pageY - a.touches[1].pageY;
  3903. this.dollyEnd.set(e, t);
  3904. var i = this.dollyStart.length() - this.dollyEnd.length();
  3905. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3906. this.dollyStart.copy(this.dollyEnd)
  3907. }
  3908. .bind(this)
  3909. , e = function() {
  3910. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3911. this.panDelta.subVectors(this.panEnd, this.panStart),
  3912. this.pan(this.panDelta.x, this.panDelta.y),
  3913. this.panStart.copy(this.panEnd),
  3914. this.rotateDelta.set(0, 0)
  3915. }
  3916. .bind(this)
  3917. , l = function() {
  3918. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3919. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3920. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3921. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3922. this.rotateStart.copy(this.rotateEnd)
  3923. }
  3924. .bind(this)
  3925. , t = function() {
  3926. if (2 === a.touches.length) {
  3927. var e = window.devicePixelRatio || 1
  3928. , t = a.touches[1].pageX - a.touches[0].pageX
  3929. , i = a.touches[1].pageY - a.touches[0].pageY
  3930. , n = Math.sqrt(t * t + i * i);
  3931. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3932. this.state = u.DOLLY,
  3933. s();
  3934. else {
  3935. var r = h.average(a.touches, "pageX")
  3936. , o = h.average(a.touches, "pageY");
  3937. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3938. this.rotateStart.set(r, o),
  3939. l())
  3940. }
  3941. }
  3942. }
  3943. .bind(this);
  3944. switch (this.state) {
  3945. case u.PAN_DOLLY:
  3946. s();
  3947. case u.PAN:
  3948. e();
  3949. break;
  3950. case u.ROTATE_DOLLY:
  3951. t();
  3952. break;
  3953. case u.DOLLY:
  3954. s();
  3955. break;
  3956. case u.ROTATE:
  3957. l();
  3958. break;
  3959. default:
  3960. this.state = u.NONE
  3961. }
  3962. this.lastMoveTime = a.timeStamp,
  3963. this.emit(f.Move, "touch")
  3964. }
  3965. }
  3966. ,
  3967. n.prototype.onTouchEnd = function(e) {
  3968. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3969. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3970. this.state = u.NONE,
  3971. this.update(),
  3972. this.rotationAcceleration.set(0, 0),
  3973. this.rotateDelta.set(0, 0))
  3974. }
  3975. ,
  3976. n.prototype.onPointerDown = function(e) {
  3977. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3978. id: e.pointerId,
  3979. pageX: e.pageX,
  3980. pageY: e.pageY
  3981. }),
  3982. e.touches = this.pointers,
  3983. this.onTouchStart(e)),
  3984. this.emit(f.InputStart, "pointer"))
  3985. }
  3986. ,
  3987. n.prototype.onPointerMove = function(t) {
  3988. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3989. t.pointerId === e.id && (e.pageX = t.pageX,
  3990. e.pageY = t.pageY)
  3991. }),
  3992. t.touches = this.pointers,
  3993. this.onTouchMove(t))
  3994. }
  3995. ,
  3996. n.prototype.onPointerUp = function(i) {
  3997. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3998. i.pointerId === e.id && this.pointers.splice(t, 1)
  3999. }
  4000. .bind(this)),
  4001. i.touches = this.pointers,
  4002. this.onTouchEnd(i))
  4003. }
  4004. ,
  4005. n.prototype.reset = function() {
  4006. this.state = u.NONE,
  4007. this.stopAutoPanning(),
  4008. this.rotationSpeed.set(0, 0),
  4009. this.rotationAcceleration.set(0, 0),
  4010. this.panSpeed.set(0, 0),
  4011. this.panAcceleration.set(0, 0)
  4012. }
  4013. ,
  4014. n.prototype.toJSON = function() {
  4015. return {
  4016. camera_position: {
  4017. x: s.toPrecision(this.camera.position.x, 4),
  4018. y: s.toPrecision(this.camera.position.y, 4),
  4019. z: s.toPrecision(this.camera.position.z, 4)
  4020. },
  4021. camera_quaternion: {
  4022. x: s.toPrecision(this.camera.quaternion.x, 4),
  4023. y: s.toPrecision(this.camera.quaternion.y, 4),
  4024. z: s.toPrecision(this.camera.quaternion.z, 4),
  4025. w: s.toPrecision(this.camera.quaternion.w, 4)
  4026. }
  4027. }
  4028. }
  4029. ,
  4030. t.exports = n
  4031. }
  4032. , {
  4033. "../enum/ControlActions": 20,
  4034. "../enum/ControlEvents": 21,
  4035. "../enum/Keys": 30,
  4036. "../enum/MouseButton": 34,
  4037. "../enum/Vectors": 50,
  4038. "../settings": 166,
  4039. "../util/common": 185,
  4040. "../util/math": 190,
  4041. events: 202,
  4042. three: 217
  4043. }],
  4044. 13: [function(u, d, e) {
  4045. (function(e) {
  4046. "use strict";
  4047. function t(e) {
  4048. this.camera = e,
  4049. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4050. this.lookVector = new s.Vector3,
  4051. this.lookSpeed = .05,
  4052. this.rotationAcc = new s.Vector2,
  4053. this.rotationSpeed = new s.Vector2,
  4054. this.lat = 0,
  4055. this.lon = 0,
  4056. this.phi = 0,
  4057. this.theta = 0,
  4058. this.enabled = !1,
  4059. this.locked = !1,
  4060. this.pointer = new s.Vector2(0,0),
  4061. this.rotationHistory = [],
  4062. this.rotationDifference = new s.Vector2,
  4063. this.pointerDragOn = !1,
  4064. this.pointerDragStart = new s.Vector2(0,0),
  4065. this.pinchDistance = 0,
  4066. this.moveStart = new s.Vector2,
  4067. this.moveTolerance = .01,
  4068. this.pointersLimit = 2,
  4069. this.pointers = []
  4070. }
  4071. var s = u("three")
  4072. , i = u("../util/logger")
  4073. , n = u("../settings")
  4074. , r = u("../util/common")
  4075. , o = u("../util/math")
  4076. , a = (u("../enum/Vectors"),
  4077. u("../enum/MouseButton"))
  4078. , l = u("../enum/Keys")
  4079. , c = u("../enum/ControlEvents")
  4080. , h = u("events").EventEmitter;
  4081. new i(e),
  4082. (t.prototype = Object.create(h.prototype)).usable = function() {
  4083. return this.enabled && !this.locked
  4084. }
  4085. ,
  4086. t.prototype.lookAt = function(e) {
  4087. var t = this.camera.position.clone().sub(e)
  4088. , i = Math.atan(t.z / t.x);
  4089. i += t.x < 0 ? Math.PI : 0,
  4090. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4091. this.lon = s.Math.radToDeg(i) + 180;
  4092. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4093. , r = Math.atan(t.y / n);
  4094. this.lat = -s.Math.radToDeg(r)
  4095. }
  4096. ,
  4097. t.prototype.startRotationFrom = function(e, t) {
  4098. o.convertScreenPositionToNDC(e, t, this.pointer),
  4099. this.pointerDragOn = !0,
  4100. this.pointerDragStart.copy(this.pointer),
  4101. this.moveStart.copy(this.pointer),
  4102. this.rotationHistory = [],
  4103. this.rotationSpeed.set(0, 0)
  4104. }
  4105. ,
  4106. t.prototype.onMouseOver = function(e) {
  4107. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4108. }
  4109. ,
  4110. t.prototype.onTouchStart = function(e) {
  4111. if (this.usable()) {
  4112. switch (e.preventDefault(),
  4113. e.stopPropagation(),
  4114. e.touches.length) {
  4115. case 1:
  4116. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4117. break;
  4118. case 2:
  4119. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4120. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4121. this.pinchDistance = Math.sqrt(t * t + i * i)
  4122. }
  4123. this.emit(c.InputStart, "touch")
  4124. }
  4125. }
  4126. ,
  4127. t.prototype.onPointerDown = function(e) {
  4128. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4129. id: e.pointerId,
  4130. clientX: e.clientX,
  4131. clientY: e.clientY
  4132. }),
  4133. e.touches = this.pointers,
  4134. this.onTouchStart(e),
  4135. this.emit(c.InputStart, "pointer"))
  4136. }
  4137. ,
  4138. t.prototype.onMouseDown = function(e) {
  4139. if (this.usable()) {
  4140. switch (e.preventDefault(),
  4141. e.stopPropagation(),
  4142. e.button) {
  4143. case a.LEFT:
  4144. this.startRotationFrom(e.clientX, e.clientY)
  4145. }
  4146. this.emit(c.InputStart, "mouse")
  4147. }
  4148. }
  4149. ,
  4150. t.prototype.updateRotation = function() {
  4151. if (this.usable() && this.pointerDragOn) {
  4152. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4153. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4154. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4155. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4156. , r = Math.atan2(e.y, i)
  4157. , o = Math.atan2(t.y, n);
  4158. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4159. e.y = 0,
  4160. t.y = 0;
  4161. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4162. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4163. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4164. this.pointerDragStart.copy(this.pointer)
  4165. }
  4166. }
  4167. ,
  4168. t.prototype.onMouseMove = function(e) {
  4169. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4170. 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"))
  4171. }
  4172. ,
  4173. t.prototype.onTouchMove = function(e) {
  4174. if (this.usable())
  4175. switch (this.emit(c.Move, "touch"),
  4176. e.touches.length) {
  4177. case 1:
  4178. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4179. break;
  4180. case 2:
  4181. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4182. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4183. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4184. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4185. this.emit(c.Pinch, n),
  4186. this.pinchDistance -= n)
  4187. }
  4188. }
  4189. ,
  4190. t.prototype.onPointerMove = function(t) {
  4191. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4192. t.pointerId === e.id && (e.clientX = t.clientX,
  4193. e.clientY = t.clientY)
  4194. }),
  4195. t.touches = this.pointers,
  4196. this.onTouchMove(t))
  4197. }
  4198. ,
  4199. t.prototype.endRotation = function() {
  4200. this.pointerDragOn = !1;
  4201. var e = r.averageVectors(this.rotationHistory);
  4202. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4203. }
  4204. ,
  4205. t.prototype.onTouchEnd = function(e) {
  4206. this.usable() && (e.preventDefault(),
  4207. e.stopPropagation(),
  4208. this.endRotation())
  4209. }
  4210. ,
  4211. t.prototype.onMouseUp = function(e) {
  4212. this.usable() && (e.preventDefault(),
  4213. e.stopPropagation(),
  4214. this.endRotation())
  4215. }
  4216. ,
  4217. t.prototype.onPointerUp = function(i) {
  4218. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4219. i.pointerId === e.id && this.pointers.splice(t, 1)
  4220. }
  4221. .bind(this)),
  4222. i.touches = this.pointers,
  4223. this.onTouchEnd(i))
  4224. }
  4225. ,
  4226. t.prototype.update = function(e) {
  4227. for (this.lon,
  4228. this.lat,
  4229. this.updateRotation(),
  4230. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4231. this.rotationHistory.shift();
  4232. this.lon += this.rotationDifference.x,
  4233. this.lat += this.rotationDifference.y,
  4234. this.rotationDifference.set(0, 0),
  4235. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4236. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4237. this.lon += this.rotationSpeed.x * e,
  4238. this.lat += this.rotationSpeed.y * e
  4239. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4240. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4241. 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 );
  4242. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4243. this.phi = s.Math.degToRad(90 - this.lat),
  4244. this.theta = s.Math.degToRad(this.lon),
  4245. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4246. this.lookVector.y = Math.cos(this.phi),
  4247. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4248. this.target.copy(this.lookVector).add(this.camera.position),
  4249. this.camera.lookAt(this.target)
  4250. }
  4251. ,
  4252. t.prototype.onMouseWheel = function(e) {
  4253. if (this.usable()) {
  4254. var t = e.wheelDelta || -e.detail;
  4255. this.emit(c.InteractionDirect),
  4256. this.emit(c.Scroll, t)
  4257. }
  4258. }
  4259. ,
  4260. t.prototype.onKeyDown = function(e) {
  4261. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4262. this.handleKeyDown(e.which)))
  4263. }
  4264. ,
  4265. t.prototype.handleKeyDown = function(e) {
  4266. var t = function(e, t) {
  4267. this.rotationAcc[e] = t
  4268. }
  4269. .bind(this);
  4270. this.emit(c.InteractionKey);
  4271. var i = !0;
  4272. switch (e) {
  4273. case l.LEFTARROW:
  4274. case l.J:
  4275. t("x", -1);
  4276. break;
  4277. case l.RIGHTARROW:
  4278. case l.L:
  4279. t("x", 1);
  4280. break;
  4281. case l.I:
  4282. t("y", 1);
  4283. break;
  4284. case l.K:
  4285. t("y", -1);
  4286. break;
  4287. default:
  4288. i = !1
  4289. }
  4290. i && this.emit(c.Move, "key")
  4291. }
  4292. ,
  4293. t.prototype.onKeyUp = function(e) {
  4294. this.usable() && (e.preventDefault(),
  4295. e.stopPropagation(),
  4296. this.handleKeyUp(e.which))
  4297. }
  4298. ,
  4299. t.prototype.handleKeyUp = function(e) {
  4300. switch (e) {
  4301. case l.LEFTARROW:
  4302. case l.J:
  4303. case l.RIGHTARROW:
  4304. case l.L:
  4305. this.rotationAcc.x = 0;
  4306. break;
  4307. case l.I:
  4308. case l.K:
  4309. this.rotationAcc.y = 0
  4310. }
  4311. }
  4312. ,
  4313. t.prototype.startRotating = function(e, t) {
  4314. e && (this.rotationAcc.x = e),
  4315. t && (this.rotationAcc.y = t)
  4316. }
  4317. ,
  4318. t.prototype.stopRotating = function(e) {
  4319. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4320. this.rotationAcc.set(0, 0)
  4321. }
  4322. ,
  4323. t.prototype.reset = function() {
  4324. this.pointerDragOn = !1,
  4325. this.rotationAcc.set(0, 0),
  4326. this.rotationSpeed.set(0, 0),
  4327. this.pointers = []
  4328. }
  4329. ,
  4330. t.prototype.toJSON = function() {
  4331. return {
  4332. camera_position: {
  4333. x: o.toPrecision(this.camera.position.x, 4),
  4334. y: o.toPrecision(this.camera.position.y, 4),
  4335. z: o.toPrecision(this.camera.position.z, 4)
  4336. },
  4337. camera_quaternion: {
  4338. x: o.toPrecision(this.camera.quaternion.x, 4),
  4339. y: o.toPrecision(this.camera.quaternion.y, 4),
  4340. z: o.toPrecision(this.camera.quaternion.z, 4),
  4341. w: o.toPrecision(this.camera.quaternion.w, 4)
  4342. }
  4343. }
  4344. }
  4345. ,
  4346. t.prototype.setStateFromJSON = function(e) {
  4347. this.camera.position.copy(e.camera_position),
  4348. this.camera.quaternion.copy(e.camera_quaternion)
  4349. }
  4350. ,
  4351. d.exports = t
  4352. }
  4353. ).call(this, "/js/controls/PanoramaControls.js")
  4354. }
  4355. , {
  4356. "../enum/ControlEvents": 21,
  4357. "../enum/Keys": 30,
  4358. "../enum/MouseButton": 34,
  4359. "../enum/Vectors": 50,
  4360. "../settings": 166,
  4361. "../util/common": 185,
  4362. "../util/logger": 189,
  4363. "../util/math": 190,
  4364. events: 202,
  4365. three: 217
  4366. }],
  4367. 14: [function(t, i, e) {
  4368. (function(e) {
  4369. "use strict";
  4370. var c = t("three")
  4371. , h = t("../enum/Viewmode")
  4372. , u = new (t("../util/logger"))(e);
  4373. i.exports = {
  4374. serialize: function(e) {
  4375. return encodeURI(JSON.stringify(e))
  4376. },
  4377. deserialize: function(e) {
  4378. function t(e) {
  4379. return e.reduce(function(e, t) {
  4380. return e && "number" == typeof t && !isNaN(t)
  4381. }, !0)
  4382. }
  4383. try {
  4384. var i = JSON.parse(decodeURI(e))
  4385. , n = {
  4386. mode: h.fromInt(i.camera_mode),
  4387. panoId: i.scan_id,
  4388. position: (new c.Vector3).copy(i.camera_position),
  4389. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4390. zoom: i.ortho_zoom,
  4391. floorVisibility: i.floor_visibility
  4392. }
  4393. , r = n.position;
  4394. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4395. var o = n.quaternion;
  4396. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4397. n
  4398. } catch (i) {
  4399. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4400. try {
  4401. var a = e.split(",")
  4402. , s = {
  4403. x: parseFloat(a[2]),
  4404. y: parseFloat(a[3]),
  4405. z: parseFloat(a[4])
  4406. }
  4407. , l = {
  4408. x: parseFloat(a[5]),
  4409. y: parseFloat(a[6]),
  4410. z: parseFloat(a[7]),
  4411. w: parseFloat(a[8])
  4412. };
  4413. return t([s.x, s.y, s.z]) || (s.x = 0,
  4414. s.y = 0,
  4415. s.z = 0),
  4416. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4417. l.y = 0,
  4418. l.z = 0,
  4419. l.w = 1),
  4420. {
  4421. mode: h.fromInt(a[0]),
  4422. panoId: a[1],
  4423. position: (new c.Vector3).copy(s),
  4424. quaternion: (new c.Quaternion).copy(l)
  4425. }
  4426. } catch (t) {
  4427. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4428. }
  4429. }
  4430. return null
  4431. }
  4432. }
  4433. }
  4434. ).call(this, "/js/controls/serializer.js")
  4435. }
  4436. , {
  4437. "../enum/Viewmode": 51,
  4438. "../util/logger": 189,
  4439. three: 217
  4440. }],
  4441. 15: [function(C, I, e) {
  4442. (function(e) {
  4443. "use strict";
  4444. function t() {
  4445. this.endlessLoop = r.warp.loop,
  4446. this.clock = new i.Clock(!0),
  4447. this.model = null,
  4448. this.player = null,
  4449. this.currentItem = null,
  4450. this.destinationItem = null,
  4451. this.tourIsPlaying = !1,
  4452. this.transitionStage = v.None,
  4453. this.nextFunc = null,
  4454. this.onTheBus = !1,
  4455. this.tourInProgress = !1,
  4456. this.reachSource = null,
  4457. this.interrupted = !1,
  4458. this.nItems = 0,
  4459. this.walkingSectionPaused = !1
  4460. }
  4461. var i = C("three")
  4462. , n = C("./util/logger")
  4463. , r = C("./settings")
  4464. , o = C("./util/transitions")
  4465. , a = C("events").EventEmitter
  4466. , s = C("./enum/Viewmode")
  4467. , l = C("./analytics")
  4468. , c = C("./enum/WarpStyle")
  4469. , h = (o = C("./util/transitions"),
  4470. C("./model/ModelManager"),
  4471. C("./enum/ModelManagerEvents"))
  4472. , u = C("./enum/DirectorEvents")
  4473. , d = C("./enum/PlayerEvents")
  4474. , p = (C("./enum/ControlEvents"),
  4475. C("./enum/BlackoutStyle"))
  4476. , f = C("./enum/PathDiscardMode")
  4477. , g = C("./enum/PathDisplayMode")
  4478. , m = (C("./player"),
  4479. new n(e))
  4480. , v = Object.freeze({
  4481. None: 0,
  4482. Moving: 1,
  4483. Aiming: 2,
  4484. Interlude: 3
  4485. })
  4486. , y = Object.freeze({
  4487. Forward: 1,
  4488. NoChange: 0,
  4489. Backwards: -1
  4490. })
  4491. , A = o.getUniqueId();
  4492. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4493. this.player = e,
  4494. this.modelManager = t,
  4495. this.updateModel(),
  4496. this.resetAll(),
  4497. this.bindEvents()
  4498. }
  4499. ,
  4500. t.prototype.resetAll = function() {
  4501. if (this.currentItem = null,
  4502. this.destinationItem = null,
  4503. this.tourIsPlaying = !1,
  4504. this.bgmReplay(),
  4505. this.transitionStage = v.None,
  4506. this.nextFunc = null,
  4507. this.onTheBus = !1,
  4508. this.reachSource = null,
  4509. this.interrupted = !1,
  4510. this.model) {
  4511. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4512. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4513. } else
  4514. this.defaultWarpStyle = c.BLACK,
  4515. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4516. this.resetSpecialTransition()
  4517. }
  4518. ,
  4519. t.prototype.updateModel = function() {
  4520. this.model = this.modelManager.getActiveModel(),
  4521. this.nItems = this.model.heroLocations.length
  4522. }
  4523. ,
  4524. t.prototype.bindEvents = function() {
  4525. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4526. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4527. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4528. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4529. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4530. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4531. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4532. this.player.once(d.Move, function() {
  4533. o.cancelById(A)
  4534. })
  4535. }
  4536. ,
  4537. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4538. return e === c.WALK && (this.interrupt(p.NONE),
  4539. this.pauseWalkingSection(),
  4540. this.player.fastForwardActivePanoFlight(),
  4541. !0)
  4542. }
  4543. ,
  4544. t.prototype.handlePlayerMove = function(e) {
  4545. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4546. this.emit("update.controls")
  4547. }
  4548. ,
  4549. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4550. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4551. this.emit("update.controls"))
  4552. }
  4553. ,
  4554. t.prototype.handlePlayerModeChanged = function(e, t) {
  4555. this.intermediateState() || e === t || (this.onTheBus = !1,
  4556. this.emit("update.controls"))
  4557. }
  4558. ,
  4559. t.prototype.handlePlayerInputStart = function(e) {
  4560. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4561. }
  4562. ,
  4563. t.prototype.handlePlayerFlyingStarted = function() {
  4564. this.clearWalkingSectionPaused()
  4565. }
  4566. ,
  4567. t.prototype.describe = function() {
  4568. return {
  4569. nItems: this.nItems,
  4570. currentItem: this.currentItem,
  4571. destinationItem: this.destinationItem,
  4572. tourIsPlaying: this.tourIsPlaying,
  4573. onTheBus: this.onTheBus,
  4574. endlessLoop: this.endlessLoop,
  4575. viewMode: this.player.mode,
  4576. inTransition: this._inTransition(),
  4577. transitionStage: this.transitionStage,
  4578. tourInProgress: this.tourInProgress
  4579. }
  4580. }
  4581. ,
  4582. t.prototype._inTransition = function() {
  4583. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4584. }
  4585. ,
  4586. t.prototype.bounceable = function() {
  4587. var e = this.clock.getDelta();
  4588. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4589. }
  4590. ,
  4591. t.prototype.itemCompare = function(item1, item2, type){//add
  4592. if(type == 'equal'){//==
  4593. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4594. }else if(type == 'less'){//<
  4595. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4596. }
  4597. }
  4598. t.prototype.currentMoveDirection = function() {
  4599. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4600. 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
  4601. }
  4602. ,
  4603. t.prototype.clearPath = function() {
  4604. this._inTransition() || this.player.path.discardPathObject()
  4605. }
  4606. ,
  4607. t.prototype.allFloors = function() {
  4608. this.model.toggleAllFloors()
  4609. }
  4610. ,
  4611. t.prototype.actionComplete = function(e) {
  4612. if (this.interrupted = !1,
  4613. this.transitionStage = v.None,
  4614. this.resetSpecialTransition(),
  4615. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4616. this.tourIsPlaying || (this.player.disablePreRendering(),
  4617. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4618. this.emit("update.controls"),
  4619. this.nextFunc) {
  4620. var t = this.nextFunc;
  4621. this.nextFunc = null,
  4622. t()
  4623. }
  4624. }
  4625. ,
  4626. t.prototype.awaitCompletion = function(e, t) {
  4627. this.nextFunc = t,
  4628. e()
  4629. }
  4630. ,
  4631. t.prototype.updateSuccessFunction = function(e) {
  4632. this.nextFunc = e
  4633. }
  4634. ,
  4635. t.prototype.interrupt = function(e, t) {
  4636. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4637. this.tourIsPlaying = !1,
  4638. this.bgmReplay(),
  4639. this.interrupted = !0,
  4640. this.nextFunc = null,
  4641. this.emit(u.ActionInterrupted),
  4642. null != e || (e = p.BEGINNING),
  4643. this.player.interruptAndFastForward(e, t),
  4644. !0)
  4645. }
  4646. ,
  4647. t.prototype.wouldInterrupt = function() {
  4648. return this.transitionStage !== v.None
  4649. }
  4650. ,
  4651. t.prototype.intermediateState = function() {
  4652. return this.transitionStage !== v.None
  4653. }
  4654. ,
  4655. t.prototype.isInterrupted = function() {
  4656. return this.interrupted
  4657. }
  4658. ,
  4659. t.prototype.pauseWalkingSection = function() {
  4660. this.walkingSectionPaused = !0
  4661. }
  4662. ,
  4663. t.prototype.clearWalkingSectionPaused = function() {
  4664. this.walkingSectionPaused = !1
  4665. }
  4666. ,
  4667. t.prototype.autoTour = function() {
  4668. var i = Date.now();
  4669. this.model.auxDataPromise.then(function() {
  4670. i = Date.now() - i;
  4671. var e = r.warp.auto
  4672. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4673. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4674. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4675. done: function() {
  4676. this.playTour()
  4677. }
  4678. .bind(this),
  4679. name: "_atr",
  4680. id: A
  4681. })
  4682. }
  4683. .bind(this))
  4684. }
  4685. ,
  4686. t.prototype.atDestinationPano = function() {
  4687. if (!this.player.currentPano || null === this.destinationItem)
  4688. return !1;
  4689. var e = this.player.currentPano.id;
  4690. if (void 0 === e)
  4691. return !1;
  4692. var t = this.model.heroLocations;
  4693. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4694. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4695. return destination && destination.panoId == e
  4696. }
  4697. ,
  4698. t.prototype.redirectToItem = function(e, t) {
  4699. if (null != e)
  4700. if (this.wouldInterrupt())
  4701. if (this.player.mode !== s.TRANSITIONING) {
  4702. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4703. var i = function() {
  4704. o.setTimeout(function() {
  4705. this.setDestinationItem(e),
  4706. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4707. }
  4708. .bind(this), 0)
  4709. }
  4710. .bind(this);
  4711. this.interrupt(p.END, 0),
  4712. this.updateSuccessFunction(i)
  4713. } else
  4714. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4715. else
  4716. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4717. else
  4718. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4719. }
  4720. ,
  4721. t.prototype.useSpecialTransition = function(e) {
  4722. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4723. this.nextWarpStyle = c.BLACK
  4724. }
  4725. ,
  4726. t.prototype.resetSpecialTransition = function() {
  4727. this.nextWarpStyle = this.defaultWarpStyle
  4728. }
  4729. ,
  4730. t.prototype.arrivedAtDestination = function(e) {
  4731. if (this.player.flying || this.player.isWarping())
  4732. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4733. else {
  4734. this.transitionStage = v.Aiming;
  4735. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4736. this.player.model.fadePanoMarkers(0),
  4737. this.awaitCompletion(function() {
  4738. this.resetSpecialTransition(),
  4739. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4740. }
  4741. .bind(this), t)
  4742. }
  4743. }
  4744. ,
  4745. t.prototype.goToDestination = function(e, t, i, n) {
  4746. //音频
  4747. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4748. if(musicInfo && musicInfo.music){
  4749. var o1 = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4750. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4751. let audioSrc2 = o1.split('/').pop();
  4752. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4753. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4754. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4755. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4756. g_tourAudio.play()
  4757. }
  4758. }else{//很可能是该folder的起始
  4759. g_tourAudio.src = manage.dealURL(o1);
  4760. g_tourAudio.load()
  4761. }
  4762. }
  4763. if (this.onTheBus = !0,
  4764. this.emit("update.controls"),
  4765. this.player.updateLastView(),
  4766. n || !this.atDestinationPano()){
  4767. if (this.player.flying || this.player.isWarping())
  4768. m.warn("Cannot go to new destination while player is flying or warping.");
  4769. else {
  4770. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4771. , s = null
  4772. , l = null;
  4773. if (a.isPano()) {
  4774. o1 = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4775. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4776. s = this.arrivedAtDestination.bind(this, !0)
  4777. //add
  4778. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4779. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4780. }
  4781. } else{
  4782. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4783. s = this.arrivedAtDestination.bind(this, !1);
  4784. }
  4785. this.transitionStage = v.Moving,
  4786. this.model.fadePanoMarkers(0),
  4787. this.awaitCompletion(function() {
  4788. l()
  4789. }
  4790. .bind(this), s),
  4791. this.emit("update.controls")
  4792. }
  4793. }else{
  4794. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4795. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4796. if(a.zoom && a.zoom != this.player.zoomLevel){
  4797. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4798. } */
  4799. this.arrivedAtDestination(!0)
  4800. }
  4801. }
  4802. ,
  4803. t.prototype.tourInterlude = function() {
  4804. if (l.trackAlways("reach_highlight", {
  4805. reach_source: this.reachSource
  4806. }),
  4807. this.model.fadePanoMarkers(0),
  4808. this.emit("update.controls"),
  4809. this.tourIsPlaying)
  4810. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4811. this.stopTour(),
  4812. this.emit(u.TourEnd),
  4813. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4814. this.transitionStage = v.Interlude,
  4815. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4816. }
  4817. .bind(this), this.goNext.bind(this))
  4818. }
  4819. ,
  4820. t.prototype.playTour = function() {
  4821. if (!this.bounceable())
  4822. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4823. this.tourInProgress = !0,
  4824. this.reachSource = "play",
  4825. this.tourIsPlaying = !0,
  4826. this.wasZoomEnabled = this.player.zoomEnabled,
  4827. this.player.zoomEnabled = !1,
  4828. this.resetSpecialTransition(),
  4829. this.emit("update.controls"),
  4830. this.emit(u.TourStart),
  4831. this.player.enablePreRendering(),
  4832. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4833. this.goToDestination()) : this.goNext()))
  4834. }
  4835. ,
  4836. t.prototype.bgmReplay = function() {
  4837. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4838. g_playAudio = g_bgAudio;
  4839. g_tourAudio && g_tourAudio.pause();
  4840. //window.tourAudio && window.tourAudio.pause();
  4841. manage.switchBgmState(true);
  4842. }
  4843. }
  4844. ,
  4845. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4846. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4847. this.tourIsPlaying = !1,
  4848. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4849. this.interrupt(),
  4850. this.clearWalkingSectionPaused(),
  4851. this.resetSpecialTransition(),
  4852. this.emit("update.controls"))
  4853. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4854. {
  4855. g_tourAudio.pause();
  4856. g_tourAudio.src = ""
  4857. }
  4858. }
  4859. ,
  4860. t.prototype.endTourProgress = function() {
  4861. this.tourInProgress = !1,
  4862. this.emit("update.controls"),
  4863. this.emit(u.TourEnd)
  4864. }
  4865. ,
  4866. t.prototype.goToHighlight = function(e) {
  4867. if (this.wouldInterrupt())
  4868. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4869. else {
  4870. if (m.debug("<tour.goto " + e + ">"),
  4871. this.isInterrupted())
  4872. return;
  4873. this.clearWalkingSectionPaused(),
  4874. this.setDestinationItem(e),
  4875. this.useSpecialTransition("Hilight"),
  4876. this.goToDestination(),
  4877. l.trackAlways("reach_highlight", {
  4878. reach_source: "thumb"
  4879. })
  4880. }
  4881. }
  4882. ,
  4883. t.prototype.prevHighlight = function() {
  4884. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4885. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4886. this.reachSource = "prev",
  4887. this.goPrev()))
  4888. }
  4889. ,
  4890. t.prototype.nextHighlight = function() {
  4891. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4892. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4893. this.reachSource = "next",
  4894. this.goNext()))
  4895. }
  4896. ,
  4897. t.prototype.changeMode = function(e) {
  4898. var t = $.Deferred()
  4899. , i = t.resolve.bind(t)
  4900. , n = t.reject.bind(t);
  4901. if (this.emit(u.StartModeChange),
  4902. !function() {
  4903. return this.clearWalkingSectionPaused(),
  4904. !!this.wouldInterrupt() && (this.interrupt(),
  4905. !0)
  4906. }
  4907. .bind(this)()) {
  4908. switch (e) {
  4909. case s.PANORAMA:
  4910. 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);
  4911. break;
  4912. case s.DOLLHOUSE:
  4913. case s.FLOORPLAN:
  4914. this.player.flyToNewMode({
  4915. mode: e
  4916. }).done(i).fail(n);
  4917. break;
  4918. case s.OUTDOOR:
  4919. 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)
  4920. }
  4921. return t.promise()
  4922. }
  4923. }
  4924. ,
  4925. t.prototype.atEndOfTour = function(item) {
  4926. //return this.currentItem >= this.nItems - 1
  4927. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4928. if(end){
  4929. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4930. if(heroLocations){
  4931. end = this.currentItem[1] >= heroLocations.length - 1
  4932. }
  4933. }
  4934. return end;
  4935. }
  4936. ,
  4937. t.prototype.firstDestination = function() {
  4938. //return 0 < this.nItems ? 0 : null
  4939. return 0 < this.nItems ? [0,0]: null
  4940. }
  4941. ,
  4942. t.prototype.finalDestination = function() {
  4943. //return 0 < this.nItems ? this.nItems - 1 : null
  4944. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4945. }
  4946. ,
  4947. t.prototype.goPrev = function() {
  4948. this.tourAdvance(-1)
  4949. }
  4950. ,
  4951. t.prototype.goNext = function() {
  4952. this.tourAdvance(1)
  4953. }
  4954. ,
  4955. t.prototype.setDestinationItem = function(e) {
  4956. this.destinationItem = e,
  4957. this.emit("update.controls")
  4958. }
  4959. ,
  4960. t.prototype.setCurrentItem = function(e) {
  4961. this.currentItem = e,
  4962. this.emit("update.controls")
  4963. }
  4964. ,
  4965. t.prototype.nextItem = function(currentItem) {
  4966. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4967. if(currentItem == void 0)return this.firstDestination()
  4968. var currentLocation = this.model.heroLocations[currentItem[0]];
  4969. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4970. var item;
  4971. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4972. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4973. }else{
  4974. item = [currentItem[0] , currentItem[1]+1]
  4975. }
  4976. if(item[0] >= this.nItems ){
  4977. item = this.firstDestination()
  4978. }
  4979. return item;
  4980. //暂时不理会endlessLoop,默认为false
  4981. }
  4982. ,
  4983. t.prototype.prevItem = function(currentItem) {
  4984. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4985. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4986. var item;
  4987. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4988. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4989. else{
  4990. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4991. if(this.currentItem[1] == 0){//子目录中第一个
  4992. return [currentItem[0] - 1, lastChildNum-1]
  4993. }else{
  4994. return [currentItem[0], currentItem[1]-1]
  4995. }
  4996. }
  4997. }
  4998. ,
  4999. t.prototype.tourAdvance = function(e) {//e是1或-1
  5000. m.debug("tourAdvance(" + e + ")")
  5001. if(null === this.currentItem || void 0 === this.currentItem){
  5002. this.setDestinationItem(this.firstDestination())
  5003. }else{
  5004. var item
  5005. if(e == 1){
  5006. item = this.nextItem(this.currentItem)
  5007. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5008. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5009. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5010. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5011. }else{
  5012. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5013. } */
  5014. }else if(e == -1){
  5015. item = this.prevItem(this.currentItem)
  5016. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5017. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5018. else{
  5019. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5020. if(this.currentItem[1] == 0){//子目录中第一个
  5021. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5022. }else{
  5023. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5024. }
  5025. } */
  5026. }
  5027. //this.setDestinationItem(this.currentItem + e)
  5028. this.setDestinationItem(item)
  5029. }
  5030. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5031. this.useSpecialTransition("reverse-looping to end")
  5032. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5033. this.useSpecialTransition("looping back to start")
  5034. }
  5035. /* if(this.destinationItem[0] < 0 ){
  5036. this.setDestinationItem(this.finalDestination())
  5037. this.useSpecialTransition("reverse-looping to end")
  5038. }else{
  5039. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5040. this.useSpecialTransition("looping back to start"))
  5041. } */
  5042. /* var momentTour = this.getMomentTour(this.destinationItem);
  5043. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5044. var i = this.player.zoomLevel;
  5045. this.player.zoomEnabled = !0;
  5046. var t = function(e, t) {
  5047. this.player.zoomTo((1 - e) * i, !0)
  5048. }
  5049. .bind(this);
  5050. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5051. } */
  5052. this.goToDestination()
  5053. }
  5054. ,
  5055. t.prototype.getMomentTour = function(destinationItem) {//add
  5056. var wholeMomentTour = window.MP_PREFETCHED_MODELDATA.momentTour || "walk"; //最外层
  5057. if(!destinationItem) return wholeMomentTour
  5058. else{
  5059. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5060. if(currentLocation.momentTour)return currentLocation.momentTour;
  5061. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5062. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5063. }
  5064. }
  5065. ,
  5066. I.exports = t
  5067. }
  5068. ).call(this, "/js/director.js")
  5069. }
  5070. , {
  5071. "./analytics": 4,
  5072. "./enum/BlackoutStyle": 18,
  5073. "./enum/ControlEvents": 21,
  5074. "./enum/DirectorEvents": 23,
  5075. "./enum/ModelManagerEvents": 33,
  5076. "./enum/PathDiscardMode": 38,
  5077. "./enum/PathDisplayMode": 39,
  5078. "./enum/PlayerEvents": 40,
  5079. "./enum/Viewmode": 51,
  5080. "./enum/WarpStyle": 52,
  5081. "./model/ModelManager": 140,
  5082. "./player": 155,
  5083. "./settings": 166,
  5084. "./util/logger": 189,
  5085. "./util/transitions": 195,
  5086. events: 202,
  5087. three: 217
  5088. }],
  5089. 16: [function(e, t, i) {
  5090. "use strict";
  5091. var n = e("three")
  5092. , r = e("./enum/Viewmode")
  5093. , o = (e("./settings"),
  5094. e("./util/transitions"))
  5095. , a = e("./enum/PlayerEvents")
  5096. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5097. , l = new n.ShaderPass(n.VerticalBlurShader);
  5098. l.renderToScreen = !0;
  5099. var c = $("#player").width() / $("#player").height();
  5100. isNaN(c) && (c = 1);
  5101. var h = {
  5102. currentBlur: 0,
  5103. aspect: c,
  5104. blurStrength: 1,
  5105. hblurPass: s,
  5106. vblurPass: l,
  5107. bindEvents: function(e) {
  5108. e.on(a.ModeChanged, function(e, t) {
  5109. e === r.PANORAMA && (o.cancel(h.blur),
  5110. o.cancel(h.addBlur),
  5111. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5112. })
  5113. },
  5114. blur: function(e) {
  5115. var t = (h.currentBlur = e) * h.blurStrength;
  5116. l.uniforms.v.value = t / 512 * h.aspect,
  5117. s.uniforms.h.value = t / 512
  5118. },
  5119. addBlur: function(e) {
  5120. e = Math.max(e, h.currentBlur),
  5121. h.blur(e)
  5122. },
  5123. removeBlur: function(e) {
  5124. e = Math.min(1 - e, h.currentBlur),
  5125. h.blur(e)
  5126. }
  5127. };
  5128. h.blur(0),
  5129. t.exports = h
  5130. }
  5131. , {
  5132. "./enum/PlayerEvents": 40,
  5133. "./enum/Viewmode": 51,
  5134. "./settings": 166,
  5135. "./util/transitions": 195,
  5136. three: 217
  5137. }],
  5138. 17: [function(e, t, i) {
  5139. "use strict";
  5140. t.exports = {
  5141. UNKNOWN: 0,
  5142. ALIGNED: 1,
  5143. UNALIGNED: 2,
  5144. PLACED: 3
  5145. }
  5146. }
  5147. , {}],
  5148. 18: [function(e, t, i) {
  5149. "use strict";
  5150. t.exports = {
  5151. NONE: 0,
  5152. MIDDLE: 1,
  5153. END: 2,
  5154. BEGINNING: 3,
  5155. FADEIN: 4
  5156. }
  5157. }
  5158. , {}],
  5159. 19: [function(e, t, i) {
  5160. "use strict";
  5161. var r = e("three");
  5162. t.exports = {
  5163. newBlue: new r.Color(4967932),
  5164. altBlue: new r.Color(47355),
  5165. tagDefault: new r.Color(223357),
  5166. classicBlue: new r.Color(53759),
  5167. mpYellow: new r.Color(16502016),
  5168. mpOrange: new r.Color(16428055),
  5169. mpBlue: new r.Color(12096),
  5170. mpLtGrey: new r.Color(13751252),
  5171. mpDkGrey: new r.Color(10000019),
  5172. mpRed: new r.Color(12525854),
  5173. mpOrangeDesat: new r.Color(16764529),
  5174. mpBlueDesat: new r.Color(4034734),
  5175. mpRedDesat: new r.Color(14705505),
  5176. white: new r.Color(16777215),
  5177. black: new r.Color(0),
  5178. _desat: function(e, t) {
  5179. var i = t || .3
  5180. , n = (new r.Color).copy(e).getHSL();
  5181. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5182. },
  5183. _darken: function(e, t) {
  5184. var i = t || .2
  5185. , n = e.getHSL();
  5186. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5187. }
  5188. }
  5189. }
  5190. , {
  5191. three: 217
  5192. }],
  5193. 20: [function(e, t, i) {
  5194. "use strict";
  5195. t.exports = {
  5196. NONE: -1,
  5197. ROTATE: 0,
  5198. DOLLY: 1,
  5199. PAN: 2,
  5200. ROTATE_DOLLY: 3,
  5201. PAN_DOLLY: 4
  5202. }
  5203. }
  5204. , {}],
  5205. 21: [function(e, t, i) {
  5206. "use strict";
  5207. t.exports = {
  5208. Move: "move",
  5209. InteractionDirect: "interaction.direct",
  5210. InteractionKey: "interaction.key",
  5211. InteractionGui: "interaction.gui",
  5212. FlyInDirection: "fly.direction",
  5213. InputStart: "input.start",
  5214. Pinch: "input.pinch",
  5215. Scroll: "input.scroll",
  5216. AutoPanInterrupt: "autopan.interrupt",
  5217. AutoPanComplete: "autopan.complete",
  5218. AutoPanClamped: "autopan.clamped",
  5219. LongTap: "longtap"
  5220. }
  5221. }
  5222. , {}],
  5223. 22: [function(e, t, i) {
  5224. "use strict";
  5225. t.exports = Object.freeze({
  5226. FORWARD: "FORWARD",
  5227. LEFT: "LEFT",
  5228. RIGHT: "RIGHT",
  5229. BACK: "BACK",
  5230. UP: "UP",
  5231. DOWN: "DOWN"
  5232. })
  5233. }
  5234. , {}],
  5235. 23: [function(e, t, i) {
  5236. "use strict";
  5237. t.exports = {
  5238. ActionInterrupted: "action.interrupted",
  5239. TourStart: "tour.start",
  5240. TourEnd: "tour.end",
  5241. StartModeChange: "mode.startChange"
  5242. }
  5243. }
  5244. , {}],
  5245. 24: [function(e, t, i) {
  5246. "use strict";
  5247. t.exports = Object.freeze({
  5248. None: 0,
  5249. Queued: 1,
  5250. ForceQueued: 2,
  5251. Downloading: 3,
  5252. Downloaded: 4,
  5253. DownloadFailed: 5
  5254. })
  5255. }
  5256. , {}],
  5257. 25: [function(e, t, i) {
  5258. "use strict";
  5259. t.exports = {
  5260. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5261. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5262. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5263. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5264. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5265. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5266. }
  5267. }
  5268. , {}],
  5269. 26: [function(e, t, i) {
  5270. "use strict";
  5271. t.exports = {
  5272. Texture2D: 0,
  5273. TextureCube: 1
  5274. }
  5275. }
  5276. , {}],
  5277. 27: [function(e, t, i) {
  5278. "use strict";
  5279. t.exports = {
  5280. SMALL: "small",
  5281. LARGE: "large"
  5282. }
  5283. }
  5284. , {}],
  5285. 28: [function(e, t, i) {
  5286. "use strict";
  5287. var n = e("./Viewmode")
  5288. , r = {
  5289. LANDING: {},
  5290. NAVIGATION: "navigation",
  5291. MORE_HELP: "moreHelp",
  5292. TOUR_INTERACTION: {}
  5293. };
  5294. r.LANDING[n.PANORAMA] = "panorama.landing",
  5295. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5296. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5297. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5298. r.TOUR_INTERACTION.standard = "standard.tour",
  5299. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5300. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5301. t.exports = r
  5302. }
  5303. , {
  5304. "./Viewmode": 51
  5305. }],
  5306. 29: [function(e, t, i) {
  5307. "use strict";
  5308. var n = {
  5309. UP: 1,
  5310. DOWN: -1,
  5311. LEFT: "L",
  5312. RIGHT: "R",
  5313. FORWARD: "F",
  5314. BACK: "B",
  5315. reverse: {},
  5316. opposite: function(e) {
  5317. return this.reverse[e.toString()]
  5318. }
  5319. };
  5320. n.reverse[n.UP] = n.DOWN,
  5321. n.reverse[n.DOWN] = n.UP,
  5322. n.reverse[n.LEFT] = n.RIGHT,
  5323. n.reverse[n.RIGHT] = n.LEFT,
  5324. n.reverse[n.FORWARD] = n.BACK,
  5325. n.reverse[n.BACK] = n.FORWARD,
  5326. t.exports = n
  5327. }
  5328. , {}],
  5329. 30: [function(e, t, i) {
  5330. "use strict";
  5331. var n = {
  5332. ZERO: 48,
  5333. ONE: 49,
  5334. TWO: 50,
  5335. THREE: 51,
  5336. FOUR: 52,
  5337. FIVE: 53,
  5338. SIX: 54,
  5339. SEVEN: 55,
  5340. EIGHT: 56,
  5341. NINE: 57,
  5342. LEFTARROW: 37,
  5343. UPARROW: 38,
  5344. RIGHTARROW: 39,
  5345. DOWNARROW: 40,
  5346. A: 65,
  5347. B: 66,
  5348. C: 67,
  5349. D: 68,
  5350. E: 69,
  5351. F: 70,
  5352. G: 71,
  5353. H: 72,
  5354. I: 73,
  5355. J: 74,
  5356. K: 75,
  5357. L: 76,
  5358. M: 77,
  5359. N: 78,
  5360. O: 79,
  5361. P: 80,
  5362. Q: 81,
  5363. R: 82,
  5364. S: 83,
  5365. T: 84,
  5366. U: 85,
  5367. V: 86,
  5368. W: 87,
  5369. X: 88,
  5370. Y: 89,
  5371. Z: 90,
  5372. SPACE: 32,
  5373. RETURN: 13,
  5374. SEMICOLON: 186,
  5375. PLUSEQUALS: 187,
  5376. DASHUNDERSCORE: 189,
  5377. OPENBRACKET: 219
  5378. };
  5379. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5380. n.PLUSEQUALS = 61,
  5381. n.DASHUNDERSCORE = 173),
  5382. t.exports = n
  5383. }
  5384. , {
  5385. "../util/browser": 182
  5386. }],
  5387. 31: [function(e, t, i) {
  5388. "use strict";
  5389. t.exports = {
  5390. EN_US: "en-US",
  5391. ES_MX: "es-MX",
  5392. FR_FR: "fr-FR",
  5393. DE_DE: "de-DE",
  5394. RU_RU: "ru-RU",
  5395. CN_CN: "cn-CN",
  5396. JP_JP: "jp-JP"
  5397. }
  5398. }
  5399. , {}],
  5400. 32: [function(e, t, i) {
  5401. "use strict";
  5402. t.exports = {
  5403. TagActivated: "tag.activated",
  5404. TagDismissed: "tag.dismissed",
  5405. TagNavigation: "tag.navigation"
  5406. }
  5407. }
  5408. , {}],
  5409. 33: [function(e, t, i) {
  5410. "use strict";
  5411. t.exports = {
  5412. ModelAdded: "model-added",
  5413. ActiveModelChanged: "active-model-changed"
  5414. }
  5415. }
  5416. , {}],
  5417. 34: [function(e, t, i) {
  5418. "use strict";
  5419. t.exports = {
  5420. LEFT: 0,
  5421. MIDDLE: 1,
  5422. RIGHT: 2
  5423. }
  5424. }
  5425. , {}],
  5426. 35: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. PanoRenderComplete: "panorama.render.complete",
  5430. TileRenderFailure: "panorama.tile.render.failed",
  5431. TileRenderSuccess: "panorama.tile.render.success",
  5432. TileUploadAttempted: "panorama.tile.upload.attempted",
  5433. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5434. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5435. }
  5436. }
  5437. , {}],
  5438. 36: [function(e, t, i) {
  5439. "use strict";
  5440. t.exports = {
  5441. BASE: 1,
  5442. STANDARD: 2,
  5443. HIGH: 3,
  5444. ULTRAHIGH: 4
  5445. }
  5446. }
  5447. , {}],
  5448. 37: [function(e, t, i) {
  5449. "use strict";
  5450. t.exports = {
  5451. LoadComplete: "panorama.load.complete",
  5452. LoadFailed: "panorama.load.failed",
  5453. TileLoaded: "panorama.tile.loaded"
  5454. }
  5455. }
  5456. , {}],
  5457. 38: [function(e, t, i) {
  5458. "use strict";
  5459. t.exports = Object.freeze({
  5460. Standard: 0,
  5461. Slow: 1,
  5462. Retain: 2
  5463. })
  5464. }
  5465. , {}],
  5466. 39: [function(e, t, i) {
  5467. "use strict";
  5468. t.exports = Object.freeze({
  5469. Show: 0,
  5470. Hide: 1,
  5471. Retain: 2
  5472. })
  5473. }
  5474. , {}],
  5475. 40: [function(e, t, i) {
  5476. "use strict";
  5477. t.exports = {
  5478. Move: "move",
  5479. MoveComplete: "move.complete",
  5480. ModeChanged: "mode.changed",
  5481. ModeChanging: "mode.changing",
  5482. PanoChosen: "pano.chosen",
  5483. ClosestPanoChanging: "closest.pano.changing",
  5484. WarpStarted: "warp.started",
  5485. WarpInterrupted: "warp.interrupted",
  5486. WarpEnded: "warp.ended",
  5487. FlyinFinished: "flyin.finished",
  5488. FlyingStarted: "flying.started",
  5489. FlyingInterrupted: "flying.interrupted",
  5490. FlyingEnded: "flying.ended",
  5491. Ready: "ready",
  5492. StartInside: "start.inside",
  5493. StartOutside: "start.outside",
  5494. ViewChanged: "view.changed",
  5495. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5496. InputStart: "input.start"
  5497. }
  5498. }
  5499. , {}],
  5500. 41: [function(e, t, i) {
  5501. "use strict";
  5502. t.exports = Object.freeze({
  5503. DEFAULT: 0,
  5504. PANOMARKERS: 1,
  5505. RETICULE: 2,
  5506. TAG: 3
  5507. })
  5508. }
  5509. , {}],
  5510. 42: [function(e, t, i) {
  5511. "use strict";
  5512. t.exports = {
  5513. visibleFloor: 1,
  5514. ghostFloor: 3,
  5515. boundingSkybox: 1,
  5516. panoMarker: 2,
  5517. reticule: 3,
  5518. tagStem: 4,
  5519. tagDisc: 5,
  5520. ribbon: 100
  5521. }
  5522. }
  5523. , {}],
  5524. 43: [function(e, t, i) {
  5525. "use strict";
  5526. t.exports = {
  5527. ContextCreated: "scene-renderer-context-created",
  5528. AfterRender: "after-render",
  5529. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5530. }
  5531. }
  5532. , {}],
  5533. 44: [function(e, t, i) {
  5534. "use strict";
  5535. t.exports = {
  5536. IDLE: "idle",
  5537. BROWSE: "browse",
  5538. EXAMINE: "examine"
  5539. }
  5540. }
  5541. , {}],
  5542. 45: [function(e, t, i) {
  5543. "use strict";
  5544. t.exports = {
  5545. TileDownloadSuccess: "tiledownloader.download.success",
  5546. TileDownloadFailure: "tiledownloader.download.failure",
  5547. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5548. }
  5549. }
  5550. , {}],
  5551. 46: [function(e, t, i) {
  5552. "use strict";
  5553. t.exports = {
  5554. CardboardAndroid: "googlevr",
  5555. GearVR: "gearvr",
  5556. CardboardIOS: "googlevrios",
  5557. Cardboard: "googlevr"
  5558. }
  5559. }
  5560. , {}],
  5561. 47: [function(e, t, i) {
  5562. "use strict";
  5563. t.exports = {
  5564. NONE: 0,
  5565. CONTEXTUAL: 1,
  5566. ANDROID: 2
  5567. }
  5568. }
  5569. , {}],
  5570. 48: [function(e, t, i) {
  5571. "use strict";
  5572. var n = {
  5573. Title: 0,
  5574. Cardboard: 1
  5575. }
  5576. , r = {
  5577. Title: 0,
  5578. Cardboard: 1,
  5579. Gear: 2
  5580. };
  5581. [n, r].forEach(function(e) {
  5582. e.pageCount = Object.keys(e).length
  5583. }),
  5584. t.exports.ios = n,
  5585. t.exports.standard = r
  5586. }
  5587. , {}],
  5588. 49: [function(e, t, i) {
  5589. "use strict";
  5590. t.exports = {
  5591. Android: "android",
  5592. IOS: "ios",
  5593. Desktop: "desktop",
  5594. UnsupportedAndroid: "android-unsupported"
  5595. }
  5596. }
  5597. , {}],
  5598. 50: [function(e, t, i) {
  5599. "use strict";
  5600. var n = e("three");
  5601. t.exports = {
  5602. UP: new n.Vector3(0,1,0),
  5603. DOWN: new n.Vector3(0,-1,0),
  5604. LEFT: new n.Vector3(-1,0,0),
  5605. RIGHT: new n.Vector3(1,0,0),
  5606. FORWARD: new n.Vector3(0,0,-1),
  5607. BACK: new n.Vector3(0,0,1)
  5608. }
  5609. }
  5610. , {
  5611. three: 217
  5612. }],
  5613. 51: [function(e, t, i) {
  5614. "use strict";
  5615. var n = e("../exception/ViewmodeConvertException")
  5616. , r = e("./coreViewmodes")
  5617. , o = {
  5618. MESH: "mesh",
  5619. OUTDOOR: "outdoor",
  5620. TRANSITIONING: "transitioning",
  5621. toInt: function(e) {
  5622. switch (e) {
  5623. case this.PANORAMA:
  5624. return 1;
  5625. case this.DOLLHOUSE:
  5626. return 2;
  5627. case this.FLOORPLAN:
  5628. return 3;
  5629. case this.OUTDOOR:
  5630. return 4;
  5631. case this.TRANSITIONING:
  5632. return -1
  5633. }
  5634. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5635. },
  5636. fromInt: function(e) {
  5637. switch (e) {
  5638. case "1":
  5639. case 1:
  5640. return this.PANORAMA;
  5641. case "2":
  5642. case 2:
  5643. return this.DOLLHOUSE;
  5644. case "3":
  5645. case 3:
  5646. return this.FLOORPLAN;
  5647. case "4":
  5648. case 4:
  5649. return this.OUTDOOR
  5650. }
  5651. throw new n("No known conversion for int to viewmode for int: " + e)
  5652. },
  5653. convertWorkshopModeInt: function(e) {
  5654. switch (e) {
  5655. case "0":
  5656. case 0:
  5657. case void 0:
  5658. return this.PANORAMA;
  5659. case "1":
  5660. case 1:
  5661. return this.FLOORPLAN;
  5662. case "2":
  5663. case 2:
  5664. return this.DOLLHOUSE;
  5665. case "3":
  5666. case 3:
  5667. return this.MESH
  5668. }
  5669. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5670. }
  5671. };
  5672. e("../util/common").extendObject(o, r),
  5673. t.exports = o
  5674. }
  5675. , {
  5676. "../exception/ViewmodeConvertException": 58,
  5677. "../util/common": 185,
  5678. "./coreViewmodes": 54
  5679. }],
  5680. 52: [function(e, t, i) {
  5681. "use strict";
  5682. t.exports = {
  5683. BLACK: "black",
  5684. STD: "std",
  5685. WALK: "walk"
  5686. }
  5687. }
  5688. , {}],
  5689. 53: [function(e, t, i) {
  5690. "use strict";
  5691. t.exports = {
  5692. ZoomIn: "zoom.in",
  5693. ZoomOut: "zoom.out",
  5694. ZoomMax: "zoom.max",
  5695. ZoomMin: "zoom.min"
  5696. }
  5697. }
  5698. , {}],
  5699. 54: [function(e, t, i) {
  5700. "use strict";
  5701. t.exports = {
  5702. PANORAMA: "panorama",
  5703. DOLLHOUSE: "dollhouse",
  5704. FLOORPLAN: "floorplan"
  5705. }
  5706. }
  5707. , {}],
  5708. 55: [function(e, t, i) {
  5709. "use strict";
  5710. t.exports = function(e) {
  5711. this.message = e
  5712. }
  5713. }
  5714. , {}],
  5715. 56: [function(e, t, i) {
  5716. "use strict";
  5717. function n(e) {
  5718. r.call(this, e)
  5719. }
  5720. var r = e("./BasicException");
  5721. n.prototype = Object.create(r.prototype),
  5722. t.exports = n
  5723. }
  5724. , {
  5725. "./BasicException": 55
  5726. }],
  5727. 57: [function(e, t, i) {
  5728. "use strict";
  5729. function n(e) {
  5730. r.call(this, e)
  5731. }
  5732. var r = e("./BasicException");
  5733. n.prototype = Object.create(r.prototype),
  5734. t.exports = n
  5735. }
  5736. , {
  5737. "./BasicException": 55
  5738. }],
  5739. 58: [function(e, t, i) {
  5740. "use strict";
  5741. function n(e) {
  5742. r.call(this, e)
  5743. }
  5744. var r = e("./BasicException");
  5745. n.prototype = Object.create(r.prototype),
  5746. t.exports = n
  5747. }
  5748. , {
  5749. "./BasicException": 55
  5750. }],
  5751. 59: [function(a, s, e) {
  5752. (function(e) {
  5753. "use strict";
  5754. var i = a("./util/ajax")
  5755. , n = a("./util/showcase")
  5756. , t = a("./util/logger")
  5757. , r = new t(e)
  5758. , o = {};
  5759. s.exports = {
  5760. loadFeatureFlags: function(e) {
  5761. var t = $.Deferred();
  5762. return i.get(e.urlBase + "", {
  5763. responseType: "json",
  5764. prefetchFrom: "user",
  5765. auth: n.getAuthorizationHeader()
  5766. }).done(function(e) {
  5767. (o = function(e) {
  5768. var t = {};
  5769. if (e) {
  5770. var i = e.flags;
  5771. if (i)
  5772. for (var n in i)
  5773. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5774. return t
  5775. }
  5776. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5777. null
  5778. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5779. }).fail(function() {
  5780. r.debug("Retrieval of feature flags failed."),
  5781. t.reject("loading-failed")
  5782. }),
  5783. t.promise()
  5784. },
  5785. getFlags: function() {
  5786. return o
  5787. },
  5788. updateDependentSettings: function(e, t) {
  5789. (e = e || o).labels && (t.labels.enabled = !0),
  5790. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5791. e.showcase_sdk && (t.sdkInit = !0),
  5792. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5793. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5794. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5795. e.hide_sc_sharing && (t.share.enabled = !1)
  5796. }
  5797. }
  5798. }
  5799. ).call(this, "/js/featureflags.js")
  5800. }
  5801. , {
  5802. "./util/ajax": 181,
  5803. "./util/logger": 189,
  5804. "./util/showcase": 193
  5805. }],
  5806. 60: [function(e, t, i) {
  5807. "use strict";
  5808. var n = (e("../util/common"),
  5809. {
  5810. status: 0,
  5811. set: function(e) {
  5812. if (isNaN(e))
  5813. return !1;
  5814. var t = $(".progressbar");
  5815. e < 0 && (e = 0),
  5816. 100 < e && (e = 100);
  5817. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5818. , n = Math.round(e)
  5819. , r = parseInt(i) - 15;
  5820. t.find(".bar").css("width", i),
  5821. t.find(".label").css("left", r),
  5822. t.find(".perc").text(n + "%"),
  5823. this.status = e
  5824. },
  5825. done: function(e) {
  5826. return e || this.status ? (this.status = null,
  5827. this.set(100)) : this
  5828. }
  5829. });
  5830. t.exports.circleLoader = n
  5831. }
  5832. , {
  5833. "../util/common": 185
  5834. }],
  5835. 61: [function(e, t, i) {
  5836. "use strict";
  5837. t.exports = Object.freeze({
  5838. CLOSE: "modal.closer.close"
  5839. })
  5840. }
  5841. , {}],
  5842. 62: [function(e, t, i) {
  5843. "use strict";
  5844. function n(t, e) {
  5845. function i() {
  5846. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5847. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5848. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5849. c.classList.remove("closeByFooter")))
  5850. }
  5851. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5852. }
  5853. var r = e("../../settings")
  5854. , o = (e("../../tag/Media/MediaEvent"),
  5855. e("../../util/browser"))
  5856. , a = e("../../util/common")
  5857. , s = e("./ModalCloserEvent")
  5858. , l = e("events").EventEmitter
  5859. , c = document.getElementsByClassName("footer")[0]
  5860. , h = c.querySelectorAll(".close")[0]
  5861. , u = null
  5862. , d = null
  5863. , p = null
  5864. , f = (o.isMobile(),
  5865. {
  5866. open: function(e) {
  5867. e && (n(e),
  5868. u && h.removeEventListener("click", u, !0),
  5869. u = function(e, t) {
  5870. t && (t.stopPropagation(),
  5871. t.preventDefault()),
  5872. e && this.emit(s.CLOSE, e),
  5873. f.reset()
  5874. }
  5875. .bind(this, e.id),
  5876. h.addEventListener("click", u, !0),
  5877. d && window.removeEventListener("resize", d, !0),
  5878. d = n.bind(this, e),
  5879. window.addEventListener("resize", d, !0))
  5880. },
  5881. reset: function() {
  5882. c.classList.remove("closeByFooter"),
  5883. h.removeEventListener("click", u, !0),
  5884. window.removeEventListener("resize", d, !0),
  5885. u = d = p = null
  5886. }
  5887. });
  5888. a.extendObject(f, l.prototype),
  5889. t.exports = f
  5890. }
  5891. , {
  5892. "../../tag/Media/MediaEvent": 131,
  5893. "../../settings": 166,
  5894. "../../util/browser": 182,
  5895. "../../util/common": 185,
  5896. "./ModalCloserEvent": 61,
  5897. events: 202
  5898. }],
  5899. 63: [function(e, t, i) {
  5900. "use strict";
  5901. var A = e("../lib/dat.gui")
  5902. , C = e("three")
  5903. , I = e("../util/easing")
  5904. , E = e("../enum/Viewmode")
  5905. , _ = e("../enum/Colors")
  5906. , b = e("../enum/WarpStyle")
  5907. , w = e("../settings");
  5908. e("../tag/tag"),
  5909. A.GUI.prototype.removeFolder = function(e) {
  5910. var t = this.__folders[e];
  5911. t && (t.close(),
  5912. this.__ul.removeChild(t.domElement.parentNode),
  5913. delete this.__folders[e],
  5914. this.onResize())
  5915. }
  5916. ,
  5917. t.exports.toggle = function(t, e, i) {
  5918. var n = new A.GUI({
  5919. width: 400
  5920. })
  5921. , r = n.addFolder("Flydown from Dollhouse");
  5922. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5923. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5924. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5925. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5926. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5927. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5928. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5929. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5930. var o = n.addFolder("Transition between panos");
  5931. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5932. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5933. w.transition.flyTime = 0,
  5934. o.__controllers.forEach(function(e) {
  5935. e.updateDisplay()
  5936. })
  5937. }),
  5938. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5939. w.transition.flySpeed = 0,
  5940. o.__controllers.forEach(function(e) {
  5941. e.updateDisplay()
  5942. })
  5943. }),
  5944. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5945. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5946. o.add(w.transition, "movementEasing", Object.keys(I));
  5947. var a = n.addFolder("Path Display");
  5948. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5949. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5950. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5951. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5952. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5953. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5954. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5955. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5956. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5957. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5958. w.path.color = _[w.path.color],
  5959. w.path.colorUp = _._desat(w.path.color),
  5960. w.path.colorDown = _.darken(w.path.color)
  5961. }),
  5962. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5963. w.reticuleColor = _[w.reticuleColor]
  5964. });
  5965. var s = n.addFolder("Warping")
  5966. , l = s.addFolder("Warp/Teleport");
  5967. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5968. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5969. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5970. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5971. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5972. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5973. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5974. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5975. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5976. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5977. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5978. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5979. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5980. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5981. w.path.typ = b[w.path.typ]
  5982. }),
  5983. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5984. e.endlessLoop = w.warp.loop
  5985. }),
  5986. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5987. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5988. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5989. var c = s.addFolder("Long Warp Only");
  5990. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5991. w.warp.flySpeed = 0,
  5992. c.__controllers.forEach(function(e) {
  5993. e.updateDisplay()
  5994. })
  5995. }),
  5996. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5997. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5998. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5999. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6000. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6001. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6002. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6003. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6004. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6005. var h = n.addFolder("Warp Esoterica");
  6006. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6007. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6008. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6009. w.warp.minWarpTime = 0,
  6010. h.__controllers.forEach(function(e) {
  6011. e.updateDisplay()
  6012. })
  6013. }),
  6014. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6015. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6016. h.add(w.warp, "movementEasing", Object.keys(I));
  6017. var u = n.addFolder("Misc");
  6018. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6019. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6020. }),
  6021. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6022. i.cameras[E.PANORAMA].fov = w.insideFOV
  6023. }),
  6024. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6025. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6026. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6027. var d = n.addFolder("Navigation");
  6028. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6029. w.navigation.panoScores || t.panos.forEach(function(e) {
  6030. e.floor.remove(e.text3d),
  6031. e.text3d = null
  6032. })
  6033. }),
  6034. d.add(w.navigation, "mouseDirection"),
  6035. d.add(w.navigation, "filterStrictness", 0, 1),
  6036. d.add(w.navigation, "angleFactor", -60, 0),
  6037. d.add(w.navigation, "directionFactor", 1, 20),
  6038. d.add(w.navigation, "distanceFactor", -5, 5),
  6039. d.add(w.navigation, "optionalityFactor", .1, 10);
  6040. var p = n.addFolder("tags")
  6041. , f = p.addFolder("Tag Creation");
  6042. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6043. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6044. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6045. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6046. var g = p.addFolder("Visibility");
  6047. g.add(w.tags.visibility, "anyDistance"),
  6048. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6049. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6050. g.add(w.tags.visibility, "hideViaFloor"),
  6051. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6052. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6053. var m = p.addFolder("Disc Parameters");
  6054. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6055. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6056. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6057. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6058. }),
  6059. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6060. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6061. }),
  6062. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6063. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6064. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6065. var v = p.addFolder("Navigate");
  6066. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6067. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6068. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6069. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6070. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6071. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6072. var y = n.addFolder("Debug");
  6073. y.add(w, "wireframe").onFinishChange(function() {
  6074. t.chunks.forEach(function(e) {
  6075. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6076. e.wireframeTwin.material.depthWrite = !1,
  6077. e.wireframeTwin.material.depthTest = !1,
  6078. e.wireframeTwin.material.opacity = .5,
  6079. e.wireframeTwin.material.transparent = !0),
  6080. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6081. })
  6082. }),
  6083. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6084. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6085. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6086. t.skybox.wireframe = null)
  6087. }),
  6088. y.add(w, "showSweeps").onFinishChange(function() {
  6089. t.setSweepVisibility(w.showSweeps)
  6090. }),
  6091. y.add(w, "showMesh").onFinishChange(function() {
  6092. t.chunks.forEach(function(e) {
  6093. e.visible = w.showMesh
  6094. })
  6095. }),
  6096. y.add(w, "showFloors").onFinishChange(function() {
  6097. t.floors.forEach(function(e) {
  6098. e.collider.children.forEach(function(e) {
  6099. e.material.visible = w.showFloors
  6100. })
  6101. })
  6102. }),
  6103. y.add(w, "showSkyboxes").onFinishChange(function() {
  6104. t.panos.forEach(function(e) {
  6105. e.skyboxMesh.visible = w.showSkyboxes
  6106. })
  6107. }),
  6108. y.add(w, "showNeighbors").onChange(function() {}),
  6109. y.add(t, "alpha", 0, 1)
  6110. }
  6111. }
  6112. , {
  6113. "../enum/Colors": 19,
  6114. "../enum/Viewmode": 51,
  6115. "../enum/WarpStyle": 52,
  6116. "../lib/dat.gui": 93,
  6117. "../tag/tag": 123,
  6118. "../settings": 166,
  6119. "../util/easing": 186,
  6120. three: 217
  6121. }],
  6122. 64: [function(c, h, e) {
  6123. (function(e) {
  6124. "use strict";
  6125. function i(e, t, i, n) {
  6126. $(".gui-error .error-problem-text").text(e),
  6127. $(".gui-error .error-solution-text").text(t),
  6128. $(".gui-error .error-explanation").text(i),
  6129. $(".gui-error .error-actions").html(n),
  6130. $(window).resize(),
  6131. $(".gui-error").fadeIn(),
  6132. $("#bottom-logo").fadeIn()
  6133. }
  6134. function n(e) {
  6135. 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("");
  6136. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6137. r.isMobile() || $("[rel=tiletip]").tooltip({
  6138. placement: "bottom",
  6139. delay: {
  6140. show: 50,
  6141. hide: 0
  6142. },
  6143. trigger: "hover",
  6144. viewport: {
  6145. selector: "body",
  6146. padding: 10
  6147. }
  6148. })
  6149. }
  6150. function t() {
  6151. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6152. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6153. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6154. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6155. e.preventDefault(),
  6156. e.stopPropagation(),
  6157. n(" ")
  6158. })
  6159. }
  6160. var r = c("./../util/browser")
  6161. , o = c("./../analytics")
  6162. , a = c("./../settings")
  6163. , s = c("../localization/localize")
  6164. , l = new (c("./../util/logger"))(e);
  6165. h.exports.error = function(e) {
  6166. if ($("head title").text(a.pageTitle),
  6167. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6168. $("#gui-loading").fadeOut(250),
  6169. $("#quick-blackout").hide(),
  6170. o.track("showcase_error", {
  6171. error_key: e
  6172. }),
  6173. s.locale || s.init(),
  6174. "webgl-unsupported" === e)
  6175. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6176. else if ("webgl-ios" === e)
  6177. 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>.");
  6178. else if ("webgl-safari" === e)
  6179. 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>.");
  6180. else if ("webgl-generic" === e)
  6181. t();
  6182. else if ("missing-urls" === e)
  6183. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6184. else if ("loading-failed" === e)
  6185. 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>.");
  6186. else {
  6187. if ("loading-failed-maintenance" !== e)
  6188. return void l.error("Unhandled error: " + e);
  6189. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6190. }
  6191. }
  6192. }
  6193. ).call(this, "/js/gui/error.js")
  6194. }
  6195. , {
  6196. "../localization/localize": 108,
  6197. "./../analytics": 4,
  6198. "./../settings": 166,
  6199. "./../util/browser": 182,
  6200. "./../util/logger": 189
  6201. }],
  6202. 65: [function(Oe, Le, e) {
  6203. (function(e) {
  6204. "use strict";
  6205. function c() {
  6206. for (var e in Ce)
  6207. if (Ce.hasOwnProperty(e)) {
  6208. var t = Ce[e];
  6209. if (!t.visible)
  6210. for (var i = 0; i < t.elements.length; i++)
  6211. $(t.elements[i]).hide()
  6212. }
  6213. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6214. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6215. ge = [],
  6216. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6217. ge.push(".hideTarget", ".pinTop.right")
  6218. }
  6219. function v(e, t) {
  6220. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6221. $("#gui-zoomin").toggle(i),
  6222. $("#gui-zoomout").toggle(i)
  6223. }
  6224. function l() {
  6225. n(),
  6226. $(".pinBottom").toggleClass("open"),
  6227. $("#drawer").toggleClass("open"),
  6228. $(".footer").toggleClass("open"),
  6229. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6230. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6231. O.resetDrawer()),
  6232. setTimeout(function() {
  6233. $("#pullTab").toggleClass("opened")
  6234. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6235. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6236. }
  6237. function t(e) {
  6238. var t;
  6239. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6240. t = e.position().top + e.outerHeight(),
  6241. e.attr("style", "display: none")),
  6242. $("#player").outerHeight() - 130 < t + 25
  6243. }
  6244. function y(e) {
  6245. "touchstart" === e.type && e.preventDefault(),
  6246. e.stopPropagation()
  6247. }
  6248. function n() {
  6249. w && (w.reload(),
  6250. w.init())
  6251. }
  6252. function r() {
  6253. $("#gui-spinner").stop(!0, !0),
  6254. $("#gui-spinner").fadeOut(1e3),
  6255. !(Ae = !0)
  6256. }
  6257. function A(e, t) {
  6258. var i = e.mode
  6259. , n = t || e.currentPano;
  6260. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6261. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6262. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6263. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6264. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6265. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6266. $("#gui-modes-outside").removeClass("desktop-only")),
  6267. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6268. pe = i,
  6269. $("#gui-modes-outside").addClass("hidden"),
  6270. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6271. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6272. }
  6273. function C(t, i) {
  6274. function e() {
  6275. document.getElementById("vr").classList.remove("hidden"),
  6276. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6277. S.supportsFullscreen() ? function(e) {
  6278. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6279. Q.init(t.data, i, e, x),
  6280. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6281. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6282. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6283. $(".improper-embed").toggleClass("hidden", !1),
  6284. n())
  6285. }, function(e) {
  6286. n()
  6287. }) : n()
  6288. }
  6289. function n() {
  6290. var e;
  6291. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6292. X.init(t.data, x),
  6293. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6294. function() {
  6295. _e("vr"),
  6296. V.open(e)
  6297. }
  6298. )),
  6299. X.on(Z.CLOSED, V.reset)
  6300. }
  6301. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6302. switch (M.vr.option) {
  6303. case le.CONTEXTUAL:
  6304. e();
  6305. break;
  6306. case le.ANDROID:
  6307. S.detectAndroid() && e();
  6308. break;
  6309. case le.NONE:
  6310. }
  6311. }
  6312. function h(e, i) {
  6313. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6314. if ("372" !== getQueryVariable("m")) {
  6315. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6316. $(".gui-floor").find(".container").prepend(r)
  6317. }
  6318. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6319. n.on("click", function(e) {
  6320. y(e),
  6321. _e("floor"),
  6322. n.toggleClass("open")
  6323. }),
  6324. $(".floorChoice").on("click", function(e) {
  6325. y(e);
  6326. var t = $(this).data("index");
  6327. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6328. i.player.gotoFloor(t),
  6329. R.track("showcase_gui", {
  6330. gui_action: "click_floor_select_button",
  6331. interaction_source: "gui"
  6332. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6333. _e("move"),
  6334. i.allFloors(),
  6335. R.track("showcase_gui", {
  6336. gui_action: "click_toggle_all_floors_button",
  6337. interaction_source: "gui"
  6338. })),
  6339. n.removeClass("open")
  6340. })
  6341. }
  6342. function I(e, t) {
  6343. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6344. $(".gui-floor-icon").hide(),
  6345. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6346. $(".gui-floor-icon").show(),
  6347. $(".gui-floor-title").hide()),
  6348. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6349. $(".gui-floor-number").text(se.FLOOR_ALL),
  6350. $(".floorChoice").removeClass("active"),
  6351. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6352. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6353. $(".floorChoice").removeClass("active"),
  6354. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6355. }
  6356. function E() {
  6357. var e = $("#player").width() - 20
  6358. , t = $("#scroller")
  6359. , i = $("#drawer")
  6360. , n = $(".pinBottom");
  6361. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6362. i.addClass("noScroll"),
  6363. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6364. i.toggleClass("noScroll"),
  6365. n.toggleClass("noScroll"))
  6366. }
  6367. function _(e) {
  6368. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6369. e = e || 0,
  6370. Ae = !1,
  6371. window.setTimeout(function() {
  6372. Ae || (!0,
  6373. $("#gui-spinner").stop(!0, !0).show())
  6374. }
  6375. .bind(this), e)
  6376. }(M.modelComponentLoadSpinnerDelay)
  6377. }
  6378. function b(e, t) {
  6379. for (var i = []; e; )
  6380. i.push(e),
  6381. e = e.parentNode;
  6382. for (; t && -1 === i.indexOf(t); )
  6383. t = t.parentNode;
  6384. return t
  6385. }
  6386. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6387. Oe("../util/ajax"),
  6388. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6389. Oe("../util/camera"),
  6390. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6391. 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"),
  6392. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6393. Oe("../enum/PathDisplayMode"),
  6394. Oe("../enum/DirectorEvents"),
  6395. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6396. Oe("../enum/WarpStyle"),
  6397. Oe("../enum/AlignmentType"),
  6398. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6399. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6400. coBrand: {
  6401. visible: !0,
  6402. elements: [".co-brand", "#loaderCoBrand"]
  6403. },
  6404. help: {
  6405. visible: !0,
  6406. elements: [".nav-help", "#nav-help"]
  6407. },
  6408. tourControls: {
  6409. visible: !0,
  6410. elements: [".next", ".previous", "#play"]
  6411. },
  6412. highlight: {
  6413. visible: !0,
  6414. elements: ["#drawer", "#pullTab"]
  6415. },
  6416. share: {
  6417. visible: !0,
  6418. elements: [".socialButton", "#share"]
  6419. },
  6420. fullScreen: {
  6421. visible: !0,
  6422. elements: ["#gui-fullscreen"]
  6423. },
  6424. floors: {
  6425. visible: !0,
  6426. elements: [".gui-floor"]
  6427. }
  6428. }, Ie = (g = document.getElementById("drawer"),
  6429. function() {
  6430. $("#player").height() < 400 && g.classList.contains("open") && l()
  6431. }
  6432. ), Ee = (f = document.getElementById("meta-info"),
  6433. function() {
  6434. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6435. }
  6436. ), _e = (i = document.getElementById("meta-info"),
  6437. s = document.getElementById("interaction-modal"),
  6438. u = $("#drawer").eq(0),
  6439. d = $(".gui-floor").eq(0),
  6440. p = $(".vr-popup").eq(0),
  6441. function(e) {
  6442. switch (e) {
  6443. case "info":
  6444. we(),
  6445. Te(),
  6446. Ie(),
  6447. Me(),
  6448. Re(),
  6449. xe(),
  6450. Pe();
  6451. break;
  6452. case "terms":
  6453. be(),
  6454. Te(),
  6455. Se(),
  6456. Me(),
  6457. Re(),
  6458. xe(),
  6459. Pe();
  6460. break;
  6461. case "help":
  6462. be(),
  6463. we(),
  6464. Me(),
  6465. Re(),
  6466. xe(),
  6467. Pe();
  6468. break;
  6469. case "vr":
  6470. be(),
  6471. we(),
  6472. Me(),
  6473. Re(),
  6474. Te(),
  6475. Pe(),
  6476. t(p) && Se();
  6477. break;
  6478. case "highlights":
  6479. Ee(),
  6480. we(),
  6481. Me(),
  6482. Re();
  6483. break;
  6484. case "share":
  6485. be(),
  6486. we(),
  6487. Te(),
  6488. Re(),
  6489. xe(),
  6490. Pe();
  6491. break;
  6492. case "floor":
  6493. we(),
  6494. Me(),
  6495. xe();
  6496. break;
  6497. case "view":
  6498. Re(),
  6499. Me(),
  6500. we(),
  6501. xe();
  6502. break;
  6503. case "tour":
  6504. case "move":
  6505. we(),
  6506. Me(),
  6507. Re(),
  6508. xe();
  6509. break;
  6510. case "resize":
  6511. be(),
  6512. Ie(),
  6513. Re();
  6514. break;
  6515. case "tag":
  6516. we(),
  6517. Te(),
  6518. Me(),
  6519. Re(),
  6520. xe()
  6521. }
  6522. }
  6523. );
  6524. function be() {
  6525. i.classList.contains("expand") && z.toggleMeta(!0)
  6526. }
  6527. function we() {
  6528. W.hide()
  6529. }
  6530. function Te() {
  6531. U.close()
  6532. }
  6533. function xe() {
  6534. X.dismiss()
  6535. }
  6536. function Se() {
  6537. u.hasClass("open") && l()
  6538. }
  6539. function Me() {
  6540. K.hide()
  6541. }
  6542. function Re() {
  6543. d.hasClass("open") && d.removeClass("open")
  6544. }
  6545. function Pe() {
  6546. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6547. }
  6548. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6549. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6550. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6551. setTimeout(function() {
  6552. $(".icon:visible").hide().show(0)
  6553. }, 100)
  6554. }),
  6555. $("#gui-fullscreen").find("a").on("click", function(e) {
  6556. y(e),
  6557. S.requestFullscreen($("body")[0]),
  6558. R.track("showcase_gui", {
  6559. gui_action: "click_enter_fullscreen",
  6560. interaction_source: "gui"
  6561. })
  6562. }),
  6563. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6564. y(e),
  6565. S.exitFullscreen(),
  6566. R.track("showcase_gui", {
  6567. gui_action: "click_exit_fullscreen",
  6568. interaction_source: "gui"
  6569. })
  6570. }),
  6571. $(window).on("resize", function(e) {
  6572. var t = e.target.innerHeight
  6573. , i = e.target.innerWidth;
  6574. t === o && i === a || (Ce.highlight.visible && E(),
  6575. _e("resize"),
  6576. $(".pinTop.right").removeClass("hideUnderMeta"),
  6577. n(),
  6578. o = t,
  6579. a = i)
  6580. }).resize(),
  6581. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6582. $("#pullTab").on("click", function(e) {
  6583. y(e),
  6584. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6585. gui_action: "hide_highlight_reel"
  6586. }),
  6587. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6588. gui_action: "show_highlight_reel"
  6589. }),
  6590. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6591. l()
  6592. }),
  6593. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6594. $("#hotList").on("click", function(e) {
  6595. y(e);
  6596. var t = $("#hotListWrap")[0];
  6597. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6598. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6599. this.classList.add("active"))
  6600. }),
  6601. $("#hotListContent ul").on("mouseover", function(e) {
  6602. y(e);
  6603. var t = e.target
  6604. , i = document.getElementById("hotListWrap");
  6605. if ("SPAN" === t.tagName) {
  6606. var n = t.parentElement.parentElement;
  6607. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6608. } else if ("LI" === t.tagName) {
  6609. n = t.parentElement;
  6610. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6611. } else
  6612. i.style.width = ""
  6613. }),
  6614. $("#hotListContent ul").on("click", function(e) {
  6615. y(e),
  6616. this.preElem && this.preElem.classList.remove("active"),
  6617. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6618. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6619. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6620. e.target.hot && e.target.hot.examine(window.player, !0),
  6621. this.preElem = e.target)
  6622. }),
  6623. $("#hotListClose").on("click", function(e) {
  6624. y(e),
  6625. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6626. $("#hotListContent ul .active").removeClass("active"),
  6627. $("#hotList")[0].classList.remove("active")
  6628. })),
  6629. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6630. $("#more-menu-button").on("click", function(e) {
  6631. y(e),
  6632. $("#more-menu").toggleClass("open")
  6633. }),
  6634. Le.exports.init = function(s, l, c, e, t, i, n) {
  6635. var r;
  6636. x = n,
  6637. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6638. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6639. F.init(),
  6640. D.init(s, i),
  6641. ce.init(s, l, e),
  6642. $(".icon").on("mouseover", function() {
  6643. l.player && l.player.reticule.hide()
  6644. }),
  6645. function(e, t) {
  6646. var i = t.player;
  6647. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6648. y(e),
  6649. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6650. R.track("USER", {
  6651. event_type: "showcase_gui",
  6652. gui_action: "click_inside_mode_button"
  6653. }),
  6654. t.changeMode(ie.PANORAMA)
  6655. }),
  6656. $("#gui-modes-outside").find("a").on("click", function(e) {
  6657. y(e),
  6658. R.track("showcase_gui", {
  6659. gui_action: "click_outside_mode_button"
  6660. }),
  6661. t.changeMode(pe)
  6662. }),
  6663. $("#gui-modes-floorplan").on("click", function(e) {
  6664. y(e),
  6665. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6666. gui_action: "click_floorplan_mode_button"
  6667. }),
  6668. t.changeMode(ie.FLOORPLAN))
  6669. }),
  6670. $("#gui-modes-dollhouse").on("click", function(e) {
  6671. y(e),
  6672. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6673. gui_action: "click_dollhouse_mode_button"
  6674. }),
  6675. t.changeMode(ie.DOLLHOUSE))
  6676. })
  6677. }(0, l),
  6678. function(e, t) {
  6679. $("#play").on("mousedown touchstart", function(e) {
  6680. y(e),
  6681. _e("tour"),
  6682. q.play(),
  6683. R.trackAlways("showcase_gui", {
  6684. gui_action: "play_highlights"
  6685. })
  6686. }),
  6687. window.startAndPlay = function(e) {
  6688. _e("tour"),
  6689. q.play(),
  6690. R.trackAlways("showcase_gui", {
  6691. gui_action: "play_highlights"
  6692. })
  6693. }
  6694. ,
  6695. $("#pause").on("mousedown touchstart", function(e) {
  6696. y(e),
  6697. q.pause(),
  6698. R.trackAlways("showcase_gui", {
  6699. gui_action: "pause_highlights"
  6700. })
  6701. }),
  6702. $("#gui-zoomin").find("a").on("click", function(e) {
  6703. y(e),
  6704. t.player.zoomInIncrementally()
  6705. }),
  6706. $("#gui-zoomout").find("a").on("click", function(e) {
  6707. y(e),
  6708. t.player.zoomOutIncrementally()
  6709. })
  6710. }(0, l),
  6711. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6712. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6713. function() {
  6714. _e("share"),
  6715. V.open(r)
  6716. }
  6717. )),
  6718. K.on(ae.CLOSED, V.reset)),
  6719. 0 < s.heroLocations.length ? function(e, i, t) {
  6720. var n = 100 / (fe = e.heroLocations.length) + "%"
  6721. , r = $("#thumb-container")
  6722. , o = $("#progressBar");
  6723. $("#status").find(".totalSteps").text(fe);
  6724. for (var a = 0; a < fe; a++) {
  6725. var s = e.heroLocations[a]
  6726. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6727. if(s.heroLocations){//有子项,选第一张截图
  6728. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6729. }else{
  6730. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6731. }
  6732. if (l.attr("data-index", a),
  6733. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6734. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6735. s.name) {
  6736. var c = $('<div class="overlay"></div>').text(s.name);
  6737. l.prepend(c)
  6738. }
  6739. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6740. var h = e.panos.get(s.panoId)
  6741. , 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>';
  6742. l.prepend(u)
  6743. }
  6744. r.append(l),
  6745. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6746. }
  6747. T = 144 * fe,
  6748. 111 * fe,
  6749. $(".thumbImg").on("mouseover", function() {
  6750. !function(e) {
  6751. return e.describe().inTransition
  6752. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6753. }),
  6754. $(".thumbImg").on("mouseout", function() {
  6755. i.clearPath()
  6756. }),
  6757. $(".thumbImg").on("click", function(e) {
  6758. y(e);
  6759. var t = $(this);
  6760. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6761. R.trackAlways("showcase_gui", {
  6762. gui_action: "click_highlight"
  6763. }),
  6764. i.goToHighlight([t.data("index"),0])//改
  6765. }),
  6766. $(".previous").find("a").on("click", function(e) {
  6767. y(e),
  6768. R.trackAlways("showcase_gui", {
  6769. gui_action: "prev_highlight"
  6770. }),
  6771. i.prevHighlight()
  6772. }),
  6773. $(".next").find("a").on("click", function(e) {
  6774. y(e),
  6775. R.trackAlways("showcase_gui", {
  6776. gui_action: "next_highlight"
  6777. }),
  6778. i.nextHighlight()
  6779. }),
  6780. $("#drawer").on("mouseleave", function(t) {
  6781. var i;
  6782. y(t);
  6783. try {
  6784. i = new MouseEvent("mouseup",{
  6785. clientX: t.clientX,
  6786. clientY: t.clientY,
  6787. screenX: t.screenX,
  6788. screenY: t.screenY
  6789. })
  6790. } catch (e) {
  6791. (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)
  6792. }
  6793. document.dispatchEvent(i)
  6794. }),
  6795. (w = new Sly($("#scrollFrame"),{
  6796. horizontal: !0,
  6797. itemNav: "centered",
  6798. smart: !0,
  6799. scrollTrap: !0,
  6800. scrollBy: 1,
  6801. mouseDragging: !0,
  6802. touchDragging: !0,
  6803. speed: 300,
  6804. dragHandle: !0,
  6805. dynamicHandle: !0,
  6806. clickBar: !0,
  6807. scrollBar: $("#scroller"),
  6808. activateOn: null
  6809. }).init()).on("active", function(e, t) {
  6810. t,
  6811. _e("tour"),
  6812. $(".step").removeClass("active"),
  6813. $("#status").find(".curIdx").text(t + 1);
  6814. for (var i = 0; i <= t; i++)
  6815. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6816. }),
  6817. E()
  6818. }(s, l, c) : (Ce.highlight.visible = !1,
  6819. Ce.tourControls.visible = !1),
  6820. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6821. function() {
  6822. var n;
  6823. document.body.addEventListener("mousedown", function(e) {
  6824. n = 0 === e.button || 1 === e.which ? e.target : null
  6825. }, !0),
  6826. document.body.addEventListener("mouseup", function(t) {
  6827. n !== t.target && (n = b(n, t.target));
  6828. var e = document.getElementById("gui-parent");
  6829. if (b(e, n) !== e && (n = null),
  6830. n) {
  6831. var i;
  6832. try {
  6833. i = new MouseEvent("click",t)
  6834. } catch (e) {
  6835. (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)
  6836. }
  6837. i.syntheticClick = !0,
  6838. n.dispatchEvent(i),
  6839. n = null
  6840. }
  6841. }, !0),
  6842. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6843. e.syntheticClick || (e.stopPropagation(),
  6844. "A" === e.target.nodeName && e.preventDefault())
  6845. }, !0)
  6846. }(),
  6847. A(c),
  6848. C(s, t),
  6849. s.on("floor.changed", I),
  6850. s.on("waiting", function(e) {
  6851. _(e)
  6852. }
  6853. .bind(this, s)),
  6854. s.on("waiting-done", function(e) {
  6855. _(e)
  6856. }
  6857. .bind(this, s)),
  6858. c.on(re.ModeChanged, function(e, t) {
  6859. A(c),
  6860. v(l, c),
  6861. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6862. U.updateMode(t)
  6863. }),
  6864. e.on(oe.Move, _e.bind(this, "move")),
  6865. c.on(re.Ready, function() {
  6866. O.init(e, c, c.tagManager, l),
  6867. c.on(re.ModeChanged, function(e, t) {
  6868. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6869. })
  6870. }),
  6871. c.on(re.PanoChosen, function(e, t) {
  6872. A(c, t),
  6873. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6874. }),
  6875. V.on(k.CLOSE, function(e) {
  6876. switch (e) {
  6877. case "vr-modal":
  6878. X.dismiss();
  6879. break;
  6880. case "share-modal":
  6881. K.hide();
  6882. break;
  6883. case "terms-modal":
  6884. W.hide()
  6885. }
  6886. });
  6887. 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();
  6888. l.on("update.controls", function() {
  6889. var e, t, i, n = l.describe();
  6890. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6891. u.show()),
  6892. n.tourInProgress && (d.forEach(function(e) {
  6893. e.classList.add("playing")
  6894. }),
  6895. p.addClass("playing"),
  6896. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6897. u.hide()),
  6898. n.tourInProgress || (q.stopTour(),
  6899. d.forEach(function(e) {
  6900. e.classList.remove("playing")
  6901. }),
  6902. p.removeClass("playing"),
  6903. f.removeClass("playing"))),
  6904. null !== n.currentItem) {
  6905. var r, o;
  6906. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6907. n.onTheBus ? (r = "active",
  6908. o = "recent") : (o = "active",
  6909. r = "recent");
  6910. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6911. for (e = 0; e < s.heroLocations.length; e += 1)
  6912. i = g.eq(e),
  6913. t = m.eq(e),
  6914. i.removeClass(o),
  6915. t.removeClass(o),
  6916. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6917. t.addClass(r),
  6918. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6919. t.addClass(r)) : (i.removeClass(r),
  6920. t.removeClass(r))
  6921. } else
  6922. for (e = 0; e < s.heroLocations.length; e += 1)
  6923. i = g.eq(e),
  6924. t = m.eq(e),
  6925. i.removeClass("active recent"),
  6926. t.removeClass("active recent");
  6927. v(l, c)
  6928. }),
  6929. document.addEventListener("keydown", function(e) {
  6930. switch (R.updateInteraction(oe.InteractionKey),
  6931. e.which) {
  6932. case te.ZERO:
  6933. M.debug && s.toggleAlpha();
  6934. break;
  6935. case te.NINE:
  6936. M.debug && B.toggle();
  6937. break;
  6938. case te.ONE:
  6939. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6940. break;
  6941. case te.TWO:
  6942. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6943. break;
  6944. case te.THREE:
  6945. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6946. break;
  6947. case te.FOUR:
  6948. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6949. break;
  6950. case te.SPACE:
  6951. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6952. break;
  6953. case te.RETURN:
  6954. M.debug && s.toggleExplodeUp();
  6955. break;
  6956. case te.P:
  6957. !function(e) {
  6958. me.gui || (me.gui = function(e) {
  6959. var t = new he.GUI;
  6960. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6961. e.setSweepVisibility(M.showSweeps)
  6962. }),
  6963. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6964. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6965. M.transition.flySpeed = 0,
  6966. t.__controllers.forEach(function(e) {
  6967. e.updateDisplay()
  6968. })
  6969. }),
  6970. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6971. $(t.__closeButton).hide(),
  6972. t
  6973. }(me.model)),
  6974. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6975. }(!me.visible);
  6976. break;
  6977. case te.U:
  6978. !function(e) {
  6979. ve.gui || (ve.gui = function(t, i) {
  6980. function e() {
  6981. var e = i.toJSON();
  6982. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6983. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6984. }
  6985. var n = {}
  6986. , r = new he.GUI({
  6987. autoPlace: !0,
  6988. width: "60%"
  6989. });
  6990. return e(),
  6991. i.on(re.ViewChanged, e),
  6992. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6993. r.domElement.id = "datLinks",
  6994. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6995. if (!S.detectSafari()) {
  6996. var t = document.createElement("button");
  6997. t.classList.add("btn-deep-link"),
  6998. t.innerText = se.MENU_COPY,
  6999. e.nextSibling.appendChild(t);
  7000. var n = function() {
  7001. alert(se.LINK_ALERT_COPY),
  7002. t.hide()
  7003. };
  7004. t.addEventListener("click", function(e) {
  7005. try {
  7006. var t = e.target.parentNode.childNodes[0];
  7007. t.select();
  7008. var i = document.execCommand("copy");
  7009. t.blur(),
  7010. i || n()
  7011. } catch (e) {
  7012. n()
  7013. }
  7014. })
  7015. }
  7016. }),
  7017. $(r.__closeButton).hide(),
  7018. r
  7019. }(ve.model, ve.player)),
  7020. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7021. }(!ve.visible);
  7022. break;
  7023. case te.X:
  7024. M.debug && s.toggleExplode();
  7025. break;
  7026. case te.PLUSEQUALS:
  7027. l.player.activatePersistentZooming(!0),
  7028. O.hideUi();
  7029. break;
  7030. case te.DASHUNDERSCORE:
  7031. l.player.activatePersistentZooming(!1),
  7032. O.hideUi();
  7033. break;
  7034. case te.SEVEN:
  7035. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7036. break;
  7037. case te.EIGHT:
  7038. l.player.decreaseZoomSpeed();
  7039. break;
  7040. case te.NINE:
  7041. l.player.increaseZoomSpeed()
  7042. }
  7043. return c && c.reticule.hide(),
  7044. !0
  7045. }
  7046. .bind(this)),
  7047. document.addEventListener("keyup", function(e) {
  7048. switch (e.which) {
  7049. case te.PLUSEQUALS:
  7050. l.player.deactivatePersistentZooming();
  7051. break;
  7052. case te.DASHUNDERSCORE:
  7053. l.player.deactivatePersistentZooming()
  7054. }
  7055. }
  7056. .bind(this)),
  7057. function(e) {
  7058. me = {
  7059. gui: null,
  7060. visible: !1,
  7061. model: e
  7062. }
  7063. }(s),
  7064. function(e, t) {
  7065. ve = {
  7066. gui: null,
  7067. visible: !1,
  7068. model: e,
  7069. player: t
  7070. }
  7071. }(s, l.player),
  7072. function(e) {
  7073. function t(e, i) {
  7074. $(e).find("a").each(function(e, t) {
  7075. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7076. t.style.pointerEvents = i ? "auto" : "none"
  7077. })
  7078. }
  7079. e.on(de.ZoomMax, function() {
  7080. t("#gui-zoomin", !1),
  7081. t("#gui-zoomout", !0)
  7082. }),
  7083. e.on(de.ZoomMin, function() {
  7084. t("#gui-zoomin", !0),
  7085. t("#gui-zoomout", !1)
  7086. }),
  7087. e.on(de.ZoomIn, function() {
  7088. t("#gui-zoomout", !0)
  7089. }),
  7090. e.on(de.ZoomOut, function() {
  7091. t("#gui-zoomin", !0)
  7092. }),
  7093. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7094. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7095. }(c),
  7096. P.setAutoPlay(s.heroCount()),
  7097. U.init(c, i.mode),
  7098. U.on(H.OPENED, _e.bind(this, "help")),
  7099. W.init(),
  7100. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7101. function() {
  7102. _e("terms"),
  7103. V.open(o)
  7104. }
  7105. )),
  7106. W.on(j.CLOSED, V.reset),
  7107. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7108. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7109. M.profiling.enabled && B.show(),
  7110. q.init(l)
  7111. }
  7112. ,
  7113. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7114. function a() {
  7115. o.setLoadingStartTime(),
  7116. function() {
  7117. function e(e) {
  7118. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7119. }
  7120. $("body").css("touch-action", "none"),
  7121. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7122. var t = document.getElementById("terms-text")
  7123. , i = document.getElementById("more-help-wrapper")
  7124. , n = (document.getElementById("navigation-help-wrapper"),
  7125. document.getElementById("help-dialog"),
  7126. document.getElementById("tag-billboards"));
  7127. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7128. passive: !1
  7129. }),
  7130. document.body.addEventListener("DOMMouseScroll", e)),
  7131. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7132. e.stopPropagation()
  7133. })
  7134. }(),
  7135. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7136. l()) : function(e) {
  7137. L.show(e),
  7138. c()
  7139. }(l)
  7140. }
  7141. var s = $.Deferred()
  7142. , l = s.resolve.bind(s);
  7143. ye = !0,
  7144. _(e);
  7145. e.data.player_options && function(e) {
  7146. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7147. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7148. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7149. }(e.data.player_options),
  7150. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7151. se.localizeGUI();
  7152. !function(i) {
  7153. function e(e, t) {
  7154. return !!i.player_options[e] && i[t || e]
  7155. }
  7156. $(".model-title").text(i.name);
  7157. var t = M.pageTitle;
  7158. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7159. document.title = t,
  7160. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7161. delay: {
  7162. show: 50,
  7163. hide: 0
  7164. },
  7165. trigger: "hover",
  7166. html: !1,
  7167. viewport: {
  7168. selector: "body",
  7169. padding: 10
  7170. }
  7171. }),
  7172. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7173. z.populate({
  7174. name: e("model_name", "name"),
  7175. coBrand: e("presented_by"),
  7176. description: e("model_summary", "summary") || "暂无内容",
  7177. contactName: e("contact_name"),
  7178. address: e("address"),
  7179. phone: e("contact_phone"),
  7180. formattedPhone: i.formatted_contact_phone,
  7181. email: e("contact_email"),
  7182. url: e("external_url"),
  7183. socialSharing: i.enable_social_sharing && i.is_public
  7184. })
  7185. }(e.data);
  7186. r || $(".quick").addClass("hidden");
  7187. n ? (R.impression(),
  7188. a()) : (o.setWaitingStartTime(),
  7189. N.show(r, a))
  7190. return s
  7191. }
  7192. ,
  7193. Le.exports.endLoading = function(e, t, i) {
  7194. var n = t.player;
  7195. function r() {
  7196. i.dismissExaminedTag(),
  7197. i.disableHovering()
  7198. }
  7199. $("#gui-thumb").fadeOut(2500),
  7200. L.hide(function() {
  7201. ye = !1
  7202. }),
  7203. Y.init(e, i),
  7204. z.finishSetup(Object.keys(e.tags).length),
  7205. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7206. X.on(Z.OPENED, r),
  7207. K.on(ae.OPENED, r),
  7208. U.on(H.OPENED, r),
  7209. W.on(j.OPENED, r);
  7210. var o = i.enableHovering.bind(i);
  7211. if (X.on(Z.CLOSED, o),
  7212. K.on(ae.CLOSED, o),
  7213. U.on(H.CLOSED, o),
  7214. W.on(j.CLOSED, o),
  7215. M.labels.enabled && Object.keys(e.labels).length,
  7216. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7217. I(e.currentFloor, n.mode)),
  7218. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7219. h(e, t)),
  7220. c(),
  7221. v(t, t.player),
  7222. $("#gui").fadeIn(1500),
  7223. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7224. l(),
  7225. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7226. }, 2e3),
  7227. !S.isMobile())
  7228. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7229. $(a[s]).addClass("hasHover");
  7230. _(e),
  7231. z.setupToggling(),
  7232. window.editHotPanel && editHotPanel(),
  7233. function() {
  7234. var i = $("#pullTab")
  7235. , e = {
  7236. bottom: {
  7237. "border-bottom-left-radius": "10px",
  7238. "border-bottom-right-radius": "10px"
  7239. },
  7240. top: {
  7241. "border-top-left-radius": "10px",
  7242. "border-top-right-radius": "10px"
  7243. }
  7244. }
  7245. , t = {
  7246. bottom: {
  7247. "border-top-right-radius": "10px",
  7248. "border-bottom-right-radius": "10px"
  7249. },
  7250. top: {
  7251. "border-bottom-left-radius": "10px",
  7252. "border-top-left-radius": "10px"
  7253. }
  7254. };
  7255. function n(e, t) {
  7256. $("#gui-modes-map > div:visible:last").css(e),
  7257. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7258. }
  7259. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7260. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  7261. }(),
  7262. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  7263. }
  7264. ,
  7265. Le.exports.onProgress = function(e) {
  7266. L.progress(e)
  7267. }
  7268. }
  7269. ).call(this, "/js/gui/gui.js")
  7270. }
  7271. , {
  7272. "../analytics": 4,
  7273. "../controls/serializer": 14,
  7274. "../enum/AlignmentType": 17,
  7275. "../enum/BlackoutStyle": 18,
  7276. "../enum/ControlEvents": 21,
  7277. "../enum/DirectorEvents": 23,
  7278. "../enum/Keys": 30,
  7279. "../enum/PathDiscardMode": 38,
  7280. "../enum/PathDisplayMode": 39,
  7281. "../enum/PlayerEvents": 40,
  7282. "../enum/VROption": 47,
  7283. "../enum/Vectors": 50,
  7284. "../enum/Viewmode": 51,
  7285. "../enum/WarpStyle": 52,
  7286. "../enum/ZoomEvents": 53,
  7287. "../lib/dat.gui": 93,
  7288. "../localization/localize": 108,
  7289. "../tag/Media/MediaEvent": 131,
  7290. "../objects/Snapshot": 153,
  7291. "../settings": 166,
  7292. "../util/ajax": 181,
  7293. "../util/browser": 182,
  7294. "../util/camera": 183,
  7295. "../util/logger": 189,
  7296. "../util/showcase": 193,
  7297. "../util/transitions": 195,
  7298. "./closer/ModalCloserEvent": 61,
  7299. "./closer/modalCloser": 62,
  7300. "./help/HelpEvent": 66,
  7301. "./help/help": 67,
  7302. "./helpManager": 68,
  7303. "./immersiveMode": 69,
  7304. "./konami": 70,
  7305. "./landingScreen": 71,
  7306. "./loadingScreen": 72,
  7307. "./memoryUsage": 73,
  7308. "./playButton": 74,
  7309. "./populateModal": 75,
  7310. "./sharing/ShareEvents": 76,
  7311. "./sharing/modal": 77,
  7312. "./terms/TermsEvent": 78,
  7313. "./terms/terms": 79,
  7314. "./title/TitleEvents": 80,
  7315. "./title/tagToggle": 81,
  7316. "./title/titleBar": 82,
  7317. "./tourInteraction": 84,
  7318. "./vr/vrEvent": 85,
  7319. "./vr/vrModal": 87,
  7320. "./webvr/WebVrEvent": 88,
  7321. "./webvr/webVRgui": 89,
  7322. three: 217
  7323. }],
  7324. 66: [function(e, t, i) {
  7325. "use strict";
  7326. t.exports = Object.freeze({
  7327. OPENED: "help.opened",
  7328. CLOSED: "help.closed"
  7329. })
  7330. }
  7331. , {}],
  7332. 67: [function(e, t, i) {
  7333. "use strict";
  7334. function n() {
  7335. p.on("click", function(e) {
  7336. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7337. setTimeout(function() {
  7338. x = !1
  7339. }, h.help.modalStayDuration),
  7340. S.emit(l.OPENED),
  7341. f.addClass("open " + T),
  7342. p.addClass("open"),
  7343. o(),
  7344. r(),
  7345. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7346. v.classList.add("fadeIn")))
  7347. }),
  7348. E.on("click", function(e) {
  7349. S.close()
  7350. }),
  7351. C.on("click", function(e) {
  7352. T && T !== a.TRANSITIONING && (o(),
  7353. r())
  7354. }),
  7355. I.on("click", function(e) {
  7356. o(),
  7357. I.addClass("underline-tab"),
  7358. c.fill(b, s.MORE_HELP),
  7359. f.addClass("more-help")
  7360. })
  7361. }
  7362. function r() {
  7363. C.addClass("underline-tab"),
  7364. c.fill(_, s.NAVIGATION, T),
  7365. f.addClass(T)
  7366. }
  7367. function o() {
  7368. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7369. A.forEach(function(e) {
  7370. e.classList.remove("underline-tab")
  7371. })
  7372. }
  7373. var a = e("../../enum/Viewmode")
  7374. , s = e("../../enum/HelpModalType")
  7375. , l = e("./HelpEvent")
  7376. , c = (e("../helpManager"),
  7377. e("./../populateModal"))
  7378. , h = e("../../settings")
  7379. , u = e("../../util/common")
  7380. , d = e("events").EventEmitter
  7381. , p = $(".footer-help").eq(0)
  7382. , f = $("#help-dialog").eq(0)
  7383. , g = document.querySelector("#quick-logo")
  7384. , m = document.querySelector("#loaderCoBrand")
  7385. , v = document.querySelector("#help-dialog")
  7386. , y = document.querySelector(".footer")
  7387. , A = $(".help-tabs").children().toArray()
  7388. , C = $(".navigation-tab").eq(0)
  7389. , I = $(".more-help-tab").eq(0)
  7390. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7391. f.find(".close").eq(0))
  7392. , _ = f.find(".interactions").toArray()
  7393. , b = f.find(".ui-instructions").toArray()
  7394. , w = a.PANORAMA
  7395. , T = a.PANORAMA
  7396. , x = !1
  7397. , S = {
  7398. init: function(e, t) {
  7399. w = T = t,
  7400. [v, m, g, y].forEach(function(e) {
  7401. e.classList.add(c.deviceType)
  7402. }),
  7403. n()
  7404. },
  7405. close: function() {
  7406. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7407. p.removeClass("open"),
  7408. f.removeClass("open"),
  7409. v.classList.contains("fadeIn"))) {
  7410. v.classList.remove("fadeIn");
  7411. var e = T === a.TRANSITIONING ? w : T;
  7412. c.clear(_, s.NAVIGATION, e)
  7413. }
  7414. },
  7415. updateMode: function(e) {
  7416. w = T,
  7417. T = e
  7418. }
  7419. };
  7420. u.extendObject(S, d.prototype),
  7421. t.exports = S
  7422. }
  7423. , {
  7424. "../../enum/HelpModalType": 28,
  7425. "../../enum/Viewmode": 51,
  7426. "../../settings": 166,
  7427. "../../util/common": 185,
  7428. "../helpManager": 68,
  7429. "./../populateModal": 75,
  7430. "./HelpEvent": 66,
  7431. events: 202
  7432. }],
  7433. 68: [function(s, l, e) {
  7434. (function(e) {
  7435. "use strict";
  7436. var t = s("../util/browser")
  7437. , i = s("./../util/logger")
  7438. , n = s("./../settings")
  7439. , r = new i(e)
  7440. , o = function() {
  7441. var t;
  7442. try {
  7443. return t = window.localStorage.getItem("visitCount") || "0",
  7444. t = (parseFloat(t) + 1).toString(),
  7445. window.localStorage.setItem("visitCount", t),
  7446. r.debug("visitCount = " + t),
  7447. t
  7448. } catch (e) {
  7449. t = "1",
  7450. r.debug("couldn't set local storage")
  7451. }
  7452. }()
  7453. , a = !1;
  7454. l.exports = {
  7455. isHelpDisabled: function() {
  7456. return "0" === t.valueFromHash("help", null) || a
  7457. },
  7458. isLargeHelpEnabled: function() {
  7459. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7460. },
  7461. isSmallHelpEnabled: function() {
  7462. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7463. },
  7464. isHelpEnabled: function() {
  7465. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7466. },
  7467. setAutoPlay: function(e) {
  7468. a = 0 <= n.warp.auto && 1 < e
  7469. }
  7470. }
  7471. }
  7472. ).call(this, "/js/gui/helpManager.js")
  7473. }
  7474. , {
  7475. "../util/browser": 182,
  7476. "./../settings": 166,
  7477. "./../util/logger": 189
  7478. }],
  7479. 69: [function(e, t, i) {
  7480. "use strict";
  7481. function r(e) {
  7482. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7483. T = !0,
  7484. h.close(),
  7485. function(e) {
  7486. !n(e) && S ? v.forEach(function(e) {
  7487. e.classList.remove("drawerOpen"),
  7488. e.classList.add("duringTour")
  7489. }) : C.hasClass("open") ? v.forEach(function(e) {
  7490. e.classList.remove("duringTour"),
  7491. e.classList.add("drawerOpen")
  7492. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7493. e.classList.add("fadeOut")
  7494. })
  7495. }(e),
  7496. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7497. C.hasClass("playing") || (y.forEach(function(e) {
  7498. e.classList.add("detectHover")
  7499. }),
  7500. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7501. }
  7502. function o() {
  7503. C.hasClass("playing") || (clearTimeout(x),
  7504. x = setTimeout(a, c.immersive.timeToShowAgain))
  7505. }
  7506. function a() {
  7507. clearTimeout(x),
  7508. T = !1,
  7509. m.forEach(function(e) {
  7510. e.classList.remove("drawerOpen")
  7511. }),
  7512. S || v.forEach(function(e) {
  7513. e.classList.remove("duringTour")
  7514. }),
  7515. y.forEach(function(e) {
  7516. e.classList.remove("detectHover")
  7517. })
  7518. }
  7519. function s() {
  7520. T ? a() : r(),
  7521. M = !0,
  7522. setTimeout(function() {
  7523. M = !1
  7524. }, c.immersive.uiStayDuration)
  7525. }
  7526. function n(e) {
  7527. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7528. }
  7529. var l = e("../util/browser")
  7530. , c = e("../settings")
  7531. , h = e("./help/help")
  7532. , u = e("../enum/tagEvents")
  7533. , d = e("../enum/ControlEvents")
  7534. , p = e("../enum/PlayerEvents")
  7535. , f = e("../enum/DirectorEvents")
  7536. , g = (p = e("../enum/PlayerEvents"),
  7537. e("../enum/Viewmode"))
  7538. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7539. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7540. , y = $("#hover-bottom, #hover-top").toArray()
  7541. , A = ($("#pullTab").eq(0),
  7542. $("#playHead").eq(0),
  7543. $(".pinBottom-container").eq(0))
  7544. , C = $("#drawer").eq(0)
  7545. , I = $("#drawer-container").eq(0)
  7546. , E = $("#meta-info").eq(0)
  7547. , _ = $(".pinTop.left").eq(0)
  7548. , b = $("#player").eq(0)
  7549. , w = document.getElementById("pullTab")
  7550. , T = !1
  7551. , x = null
  7552. , S = !1
  7553. , M = !1
  7554. , R = null
  7555. , P = !1;
  7556. t.exports.init = function(e, t, i, n) {
  7557. (function(t, i, e, n) {
  7558. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7559. t.controls[e].on(d.Move, r),
  7560. t.controls[e].on(d.LongTap, s)
  7561. }),
  7562. b.on("mousewheel DOMMouseScroll", r),
  7563. e.on(u.TagActivated, r),
  7564. e.on(u.TagNavigation, r),
  7565. i.on(p.FlyingEnded, o),
  7566. i.on(p.ModeChanging, function(e, t) {
  7567. P = t !== g.PANORAMA && e !== g.PANORAMA
  7568. }),
  7569. i.on(p.ModeChanged, function(e, t) {
  7570. R = i.mode,
  7571. t !== g.TRANSITIONING ? a() : r("modeChange")
  7572. }),
  7573. n.on(f.TourStart, function() {
  7574. S = !0,
  7575. r()
  7576. }),
  7577. n.on(f.TourEnd, function() {
  7578. S = !1,
  7579. a()
  7580. }),
  7581. n.on(f.ActionInterrupted, function() {
  7582. S = !1
  7583. }),
  7584. w.addEventListener("touchend", function() {
  7585. $("#pullTab").hasClass("opened") && !S && a()
  7586. }, !0)
  7587. }
  7588. )(e, t, i, n),
  7589. l.isMobile() ? (y.forEach(function(e) {
  7590. e.classList.add("mobile")
  7591. }),
  7592. A.click(a)) : (y.forEach(function(e) {
  7593. e.addEventListener("mouseleave", function() {
  7594. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7595. }, !0)
  7596. }),
  7597. b.mouseleave(function() {
  7598. y[0].classList.contains("detectHover") && a()
  7599. })),
  7600. R = t.mode
  7601. }
  7602. ,
  7603. t.exports.hideUi = r,
  7604. t.exports.resetDrawer = function() {
  7605. I.hasClass("duringTour") || (S = !1,
  7606. r("gui"),
  7607. a())
  7608. }
  7609. }
  7610. , {
  7611. "../enum/ControlEvents": 21,
  7612. "../enum/DirectorEvents": 23,
  7613. "../enum/tagEvents": 32,
  7614. "../enum/PlayerEvents": 40,
  7615. "../enum/Viewmode": 51,
  7616. "../settings": 166,
  7617. "../util/browser": 182,
  7618. "./help/help": 67
  7619. }],
  7620. 70: [function(i, n, e) {
  7621. (function(e) {
  7622. "use strict";
  7623. var t = i("./../util/logger")
  7624. , o = i("./../settings")
  7625. , a = i("./debug")
  7626. , s = i("./../util/common")
  7627. , l = (i("./gui"),
  7628. new t(e));
  7629. o.console && $("body").append('<div id="debug-console"></div>'),
  7630. n.exports.init = function(i, n, r) {
  7631. l.debug("konami has the modelInstance");
  7632. var t = [];
  7633. $(window).on("keydown", function(e) {
  7634. t.push(e.which),
  7635. t.length > o.secretPanelWord.length && t.shift(),
  7636. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7637. o.debug = !0)
  7638. }),
  7639. $(window).on("keydown", function e(t) {
  7640. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7641. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7642. })
  7643. }
  7644. }
  7645. ).call(this, "/js/gui/konami.js")
  7646. }
  7647. , {
  7648. "./../settings": 166,
  7649. "./../util/common": 185,
  7650. "./../util/logger": 189,
  7651. "./debug": 63,
  7652. "./gui": 65
  7653. }],
  7654. 71: [function(e, t, i) {
  7655. "use strict";
  7656. function r() {
  7657. s.clear(m, l.LANDING[v]),
  7658. g.removeClass("fadeIn")
  7659. }
  7660. var o = e("../settings")
  7661. , a = (e("./help/help"),
  7662. e("./helpManager"))
  7663. , s = e("./populateModal")
  7664. , l = e("../enum/HelpModalType")
  7665. , n = e("../enum/Viewmode")
  7666. , c = e("../enum/DirectorEvents")
  7667. , h = e("../enum/PlayerEvents")
  7668. , u = $("#quick-blackout").eq(0)
  7669. , d = $("#quick-logo").eq(0)
  7670. , p = $(".quick-brand").toArray()
  7671. , f = $("#loaderCoBrand").eq(0)
  7672. , g = $("#interaction-modal").eq(0)
  7673. , m = g.find(".interaction").toArray()
  7674. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7675. "");
  7676. t.exports.delayLanding = function(e) {
  7677. var t = $.Deferred();
  7678. e || t.resolve();
  7679. var i = o.startupFlyinDelay;
  7680. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7681. setTimeout(t.resolve.bind(t), i),
  7682. t
  7683. }
  7684. ,
  7685. t.exports.showMessage = function(e, t, i) {
  7686. var n = 0;
  7687. o.quickstart.enabled && (function(e) {
  7688. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7689. d.before(f),
  7690. p = $(".quick-brand").toArray()), */
  7691. u.addClass("fadeOut")
  7692. /* setTimeout(function() {
  7693. p.forEach(function(e) {
  7694. e.classList.add("fadeIn")
  7695. })
  7696. }, o.quickstart.showTextDelay),
  7697. setTimeout(function() {
  7698. p.forEach(function(e) {
  7699. e.classList.add("fadeOut")
  7700. })
  7701. }, o.quickstart.fadeOutDelay) */
  7702. }(i),
  7703. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7704. function(e, t) {
  7705. setTimeout(function() {
  7706. if (a.isHelpEnabled()) {
  7707. if (t(),
  7708. s.init(),
  7709. g.addClass("fadeIn landing " + s.deviceType),
  7710. a.isSmallHelpEnabled())
  7711. return void g.addClass("small");
  7712. s.fill(m, l.LANDING[v]),
  7713. g.addClass(v)
  7714. }
  7715. }, e);
  7716. var i = {
  7717. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7718. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7719. }
  7720. , n = $(".nav-icon .icon");
  7721. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7722. function r(e) {
  7723. e.on("click", function() {
  7724. var e = null;
  7725. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7726. i.length < e || e < 1)
  7727. return !1;
  7728. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7729. "data-page": e,
  7730. src: i.mobile[e - 1]
  7731. }) : n.attr({
  7732. "data-page": e,
  7733. src: i.pc[e - 1]
  7734. })
  7735. })
  7736. }
  7737. r($(".next-button")),
  7738. r($(".prev-button"))
  7739. }(n, function() {
  7740. e.once(h.Move, r),
  7741. t.once(c.TourStart, r)
  7742. })
  7743. }
  7744. ,
  7745. t.exports.init = function(e, t) {
  7746. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7747. }
  7748. ,
  7749. t.exports.dismissModal = r
  7750. }
  7751. , {
  7752. "../enum/DirectorEvents": 23,
  7753. "../enum/HelpModalType": 28,
  7754. "../enum/PlayerEvents": 40,
  7755. "../enum/Viewmode": 51,
  7756. "../settings": 166,
  7757. "./help/help": 67,
  7758. "./helpManager": 68,
  7759. "./populateModal": 75
  7760. }],
  7761. 72: [function(e, t, i) {
  7762. "use strict";
  7763. var n = e("./circleLoader").circleLoader;
  7764. t.exports = {
  7765. element: $("#gui-loading"),
  7766. hide: function(e) {
  7767. n.done(),
  7768. this.element.fadeOut(1500, e)
  7769. },
  7770. show: function(e) {
  7771. this.element.fadeIn(500, function() {
  7772. this.element.css("display", "table"),
  7773. e && e()
  7774. }
  7775. .bind(this))
  7776. },
  7777. progress: function(e) {
  7778. n.set(e)
  7779. }
  7780. }
  7781. }
  7782. , {
  7783. "./circleLoader": 60
  7784. }],
  7785. 73: [function(e, t, i) {
  7786. "use strict";
  7787. var n = e("../settings")
  7788. , r = $("#memory-info")
  7789. , o = r.find("#memory-gpu")
  7790. , a = !1;
  7791. t.exports = {
  7792. show: function() {
  7793. n.profiling.enabled && (r.show(),
  7794. a = !0)
  7795. },
  7796. hide: function() {
  7797. r.hide(),
  7798. a = !1
  7799. },
  7800. toggle: function() {
  7801. a ? this.hide() : this.show()
  7802. },
  7803. update: function(e) {
  7804. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7805. }
  7806. }
  7807. }
  7808. , {
  7809. "../settings": 166
  7810. }],
  7811. 74: [function(e, t, i) {
  7812. "use strict";
  7813. e("../util/browser"),
  7814. e("../analytics");
  7815. e("../settings"),
  7816. t.exports = {
  7817. show: function(e, t) {
  7818. $("#gui-message").fadeOut(500, function() {
  7819. t()
  7820. })
  7821. }
  7822. }
  7823. }
  7824. , {
  7825. "../analytics": 4,
  7826. "../settings": 166,
  7827. "../util/browser": 182
  7828. }],
  7829. 75: [function(e, t, i) {
  7830. "use strict";
  7831. function n(e, t, i, n) {
  7832. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7833. }
  7834. var r = e("../util/browser")
  7835. , o = e("../localization/localize")
  7836. , a = e("../enum/HelpModalType")
  7837. , s = (e("../enum/HelpModalSize"),
  7838. e("../enum/Viewmode"));
  7839. t.exports = {
  7840. init: function() {
  7841. if (!this.hasInitialized) {
  7842. this.hasInitialized = !0,
  7843. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7844. this.assets = {},
  7845. this.assets[a.LANDING[s.PANORAMA]] = {
  7846. desktop: {
  7847. left: {
  7848. "top-info": o.ROTATE,
  7849. "big-image": "images/nav_help_mouse_drag_left.png",
  7850. keyboard: "images/nav_help_keyboard_left_right.png"
  7851. },
  7852. middle: {
  7853. "top-info": o.MOVE,
  7854. "big-image": "images/nav_help_mouse_click.png",
  7855. keyboard: "images/nav_help_keyboard_up_down.png"
  7856. },
  7857. right: {
  7858. "top-info": o.ZOOM,
  7859. "big-image": "images/nav_help_mouse_zoom.png",
  7860. keyboard: "images/nav_help_zoom_keys.png"
  7861. }
  7862. },
  7863. mobile: {
  7864. left: {
  7865. "top-info": o.ROTATE,
  7866. "big-image": "images/nav_help_gesture_drag.png"
  7867. },
  7868. middle: {
  7869. "top-info": o.MOVE,
  7870. "big-image": "images/nav_help_gesture_tap.png"
  7871. },
  7872. right: {
  7873. "top-info": o.ZOOM,
  7874. "big-image": "images/nav_help_gesture_pinch.png"
  7875. }
  7876. }
  7877. },
  7878. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7879. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7880. desktop: {
  7881. left: {
  7882. "top-info": o.ROTATE,
  7883. "big-image": "images/nav_help_mouse_drag_left.png",
  7884. keyboard: "images/nav_help_keyboard_left_right.png"
  7885. },
  7886. middle: {
  7887. "top-info": o.MOVE,
  7888. "big-image": "images/nav_help_mouse_position_right.png"
  7889. }
  7890. },
  7891. mobile: {
  7892. left: {
  7893. "top-info": o.ROTATE,
  7894. "big-image": "images/nav_help_gesture_drag.png"
  7895. },
  7896. middle: {
  7897. "top-info": o.MOVE,
  7898. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7899. }
  7900. }
  7901. },
  7902. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7903. desktop: {
  7904. left: {
  7905. "top-info": o.MOVE,
  7906. "big-image": "images/nav_help_mouse_position_left.png"
  7907. },
  7908. middle: {
  7909. "top-info": o.ROTATE,
  7910. "big-image": "images/nav_help_mouse_drag_right.png",
  7911. keyboard: "images/nav_help_keyboard_left_right.png"
  7912. }
  7913. },
  7914. mobile: {
  7915. left: {
  7916. "top-info": o.MOVE,
  7917. "big-image": "images/nav_help_gesture_position.png"
  7918. },
  7919. middle: {
  7920. "top-info": o.ROTATE,
  7921. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7922. }
  7923. }
  7924. };
  7925. var e = {
  7926. "top-info": o.INSIDE,
  7927. "big-image": "images/nav_help_click_inside.png",
  7928. keyboard: "images/nav_help_inside_key.png"
  7929. };
  7930. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7931. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7932. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7933. var t = {
  7934. "top-info": o.INSIDE,
  7935. "big-image": "images/nav_help_tap_inside.png"
  7936. };
  7937. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7938. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7939. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7940. this.assets[a.NAVIGATION] = {},
  7941. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7942. desktop: {
  7943. left: {
  7944. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7945. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7946. "big-image": "images/nav_help_mouse_drag_left.png",
  7947. keyboard: "images/nav_help_keyboard_left_right.png"
  7948. },
  7949. middle: {
  7950. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7951. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7952. "big-image": "images/nav_help_mouse_click.png",
  7953. keyboard: "images/nav_help_keyboard_up_down.png"
  7954. },
  7955. right: {
  7956. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7957. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7958. "big-image": "images/nav_help_mouse_zoom.png",
  7959. keyboard: "images/nav_help_zoom_keys.png"
  7960. }
  7961. },
  7962. mobile: {
  7963. left: {
  7964. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7965. "big-image": "images/nav_help_gesture_drag.png"
  7966. },
  7967. middle: {
  7968. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7969. "big-image": "images/nav_help_gesture_tap.png"
  7970. },
  7971. right: {
  7972. "top-info": o.HELP_MOBILE_3,
  7973. "big-image": "images/nav_help_gesture_pinch.png"
  7974. }
  7975. }
  7976. },
  7977. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7978. desktop: {
  7979. left: {
  7980. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7981. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7982. "big-image": "images/nav_help_mouse_drag_left.png",
  7983. keyboard: "images/nav_help_keyboard_all.png"
  7984. },
  7985. middle: {
  7986. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7987. "big-image": "images/nav_help_mouse_position_right.png"
  7988. },
  7989. right: {
  7990. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7991. "big-image": "images/nav_help_mouse_zoom.png"
  7992. }
  7993. },
  7994. mobile: {
  7995. left: {
  7996. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7997. "big-image": "images/nav_help_gesture_drag.png"
  7998. },
  7999. middle: {
  8000. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8001. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8002. },
  8003. right: {
  8004. "top-info": o.HELP_MOBILE_3,
  8005. "big-image": "images/nav_help_gesture_pinch.png"
  8006. }
  8007. }
  8008. },
  8009. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8010. desktop: {
  8011. left: {
  8012. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8013. "big-image": "images/nav_help_mouse_position_left.png"
  8014. },
  8015. middle: {
  8016. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8017. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8018. "big-image": "images/nav_help_mouse_drag_right.png",
  8019. keyboard: "images/nav_help_keyboard_left_right.png"
  8020. },
  8021. right: {
  8022. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8023. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8024. "big-image": "images/nav_help_mouse_zoom.png",
  8025. keyboard: "images/nav_help_keyboard_up_down.png"
  8026. }
  8027. },
  8028. mobile: {
  8029. left: {
  8030. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8031. "big-image": "images/nav_help_gesture_position.png"
  8032. },
  8033. middle: {
  8034. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8035. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8036. },
  8037. right: {
  8038. "top-info": o.HELP_MOBILE_3,
  8039. "big-image": "images/nav_help_gesture_pinch.png"
  8040. }
  8041. }
  8042. },
  8043. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8044. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8045. "top-info": o.HELP_DESKTOP_360_2A,
  8046. "bottom-info": o.HELP_DESKTOP_360_2B,
  8047. "big-image": "images/nav_help_click_inside.png",
  8048. keyboard: "images/nav_help_inside_key.png"
  8049. },
  8050. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8051. "top-info": o.HELP_MOBILE_360_2,
  8052. "big-image": "images/nav_help_tap_inside.png"
  8053. },
  8054. this.assets[a.MORE_HELP] = {
  8055. desktop: {
  8056. "more-help-hlr": {
  8057. "top-info": o.HELP_MORE_HLR_A,
  8058. "big-image": "images/nav_help_expand.svg",
  8059. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8060. },
  8061. "more-help-dollhouse": {
  8062. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8063. "big-image": "images/nav_help_dollhouse.svg",
  8064. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8065. },
  8066. "more-help-floors": {
  8067. "top-info": o.HELP_MORE_FLOORS_A,
  8068. "big-image": "images/nav_help_floor picker.svg",
  8069. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8070. },
  8071. "more-help-tag": {
  8072. "top-info": o.HELP_MORE_TAG_A,
  8073. "big-image": "images/nav_help_tag.svg",
  8074. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8075. },
  8076. "more-help-zoom": {
  8077. "top-info": o.HELP_MORE_ZOOM_A,
  8078. "big-image": "images/nav_help_zoom.svg",
  8079. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8080. },
  8081. "more-help-tour": {
  8082. "top-info": o.HELP_MORE_TOUR_A,
  8083. "big-image": "images/nav_help_play.png",
  8084. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8085. },
  8086. "more-help-inside": {
  8087. "top-info": o.HELP_MORE_INSIDE_A,
  8088. "big-image": "images/nav_help_inside.svg",
  8089. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8090. },
  8091. "more-help-vr": {
  8092. "top-info": o.HELP_MORE_VR_A,
  8093. "big-image": "images/nav_help_vr.svg",
  8094. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8095. },
  8096. "more-help-360": {
  8097. "top-info": o.HELP_MORE_360_A,
  8098. "big-image": "images/nav_help_360.svg",
  8099. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8100. },
  8101. "more-help-fullscreen": {
  8102. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8103. "big-image": "images/nav_help_fullscreen.svg",
  8104. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8105. }
  8106. },
  8107. mobile: {
  8108. "more-help-hlr": {
  8109. "top-info": o.HELP_MORE_HLR_A,
  8110. "big-image": "images/nav_help_expand.svg",
  8111. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8112. },
  8113. "more-help-dollhouse": {
  8114. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8115. "big-image": "images/nav_help_dollhouse.svg",
  8116. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8117. },
  8118. "more-help-floors": {
  8119. "top-info": o.HELP_MORE_FLOORS_A,
  8120. "big-image": "images/nav_help_floor picker.svg",
  8121. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8122. },
  8123. "more-help-tag": {
  8124. "top-info": o.HELP_MORE_TAG_A,
  8125. "big-image": "images/nav_help_tag.svg",
  8126. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8127. },
  8128. "more-help-tour": {
  8129. "top-info": o.HELP_MORE_TOUR_A,
  8130. "big-image": "images/nav_help_play.png",
  8131. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8132. },
  8133. "more-help-inside": {
  8134. "top-info": o.HELP_MORE_INSIDE_A,
  8135. "big-image": "images/nav_help_inside.svg",
  8136. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8137. },
  8138. "more-help-vr": {
  8139. "top-info": o.HELP_MORE_VR_A,
  8140. "big-image": "images/webvr.svg",
  8141. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8142. },
  8143. "more-help-360": {
  8144. "top-info": o.HELP_MORE_360_A,
  8145. "big-image": "images/nav_help_360.svg",
  8146. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8147. }
  8148. }
  8149. },
  8150. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8151. desktop: {
  8152. left: {
  8153. "top-info": o.ROTATE,
  8154. "big-image": "images/nav_help_mouse_drag_left.png",
  8155. keyboard: "images/nav_help_keyboard_left_right.png"
  8156. },
  8157. middle: {
  8158. "top-info": o.MOVE,
  8159. "big-image": "images/nav_help_mouse_click.png",
  8160. keyboard: "images/nav_help_keyboard_up_down.png"
  8161. },
  8162. right: {
  8163. "top-info": o.PLAY,
  8164. "big-image": "images/Desktop-help-play-button.svg",
  8165. keyboard: "images/Desktop-help-spacebar-2.svg"
  8166. }
  8167. },
  8168. mobile: {
  8169. left: {
  8170. "top-info": o.ROTATE,
  8171. "big-image": "images/nav_help_gesture_drag.png"
  8172. },
  8173. middle: {
  8174. "top-info": o.MOVE,
  8175. "big-image": "images/nav_help_gesture_tap.png"
  8176. },
  8177. right: {
  8178. "top-info": o.PLAY,
  8179. "big-image": "images/mobile-help-play-button.svg"
  8180. }
  8181. }
  8182. },
  8183. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8184. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8185. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8186. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8187. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8188. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8189. }
  8190. },
  8191. fill: function(e, t, i) {
  8192. n.call(this, e, t, i, !0)
  8193. },
  8194. clear: function(e, t, i) {
  8195. n.call(this, e, t, i, !1)
  8196. }
  8197. }
  8198. }
  8199. , {
  8200. "../enum/HelpModalSize": 27,
  8201. "../enum/HelpModalType": 28,
  8202. "../enum/Viewmode": 51,
  8203. "../localization/localize": 108,
  8204. "../util/browser": 182
  8205. }],
  8206. 76: [function(e, t, i) {
  8207. "use strict";
  8208. t.exports = Object.freeze({
  8209. OPENED: "share.open",
  8210. CLOSED: "share.closed",
  8211. LINK_CLICKED: "share.linked"
  8212. })
  8213. }
  8214. , {}],
  8215. 77: [function(e, t, i) {
  8216. "use strict";
  8217. function n(n) {
  8218. function e(e, t) {
  8219. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8220. I.emit(l.LINK_CLICKED, {
  8221. channel: n
  8222. }),
  8223. window.open(C[n], "shareWindow", i)
  8224. }
  8225. switch (n) {
  8226. case A.FACEBOOK:
  8227. e(580, 420);
  8228. break;
  8229. case A.TWITTER:
  8230. e(550, 440);
  8231. break;
  8232. case A.MAIL:
  8233. I.emit(l.LINK_CLICKED, {
  8234. channel: "email"
  8235. }),
  8236. window.open(C[n], "_blank");
  8237. break;
  8238. case A.LINKEDIN:
  8239. }
  8240. }
  8241. function r(e) {
  8242. I.emit(l.LINK_CLICKED, {
  8243. channel: "copylink"
  8244. });
  8245. var t = document.createRange();
  8246. t.selectNodeContents(v);
  8247. var i = window.getSelection();
  8248. i.removeAllRanges(),
  8249. i.addRange(t),
  8250. document.execCommand("copy"),
  8251. y.classList.remove("hidden"),
  8252. v.classList.add("highlighted")
  8253. }
  8254. function o(e) {
  8255. e && (e.stopPropagation(),
  8256. e.target === v) || (window.getSelection().removeAllRanges(),
  8257. v.classList.remove("highlighted"),
  8258. y.classList.add("hidden"))
  8259. }
  8260. var a = e("../../util/browser")
  8261. , s = e("../../localization/localize")
  8262. , l = e("./ShareEvents")
  8263. , c = e("../../util/common")
  8264. , h = e("events").EventEmitter
  8265. , u = document.getElementById("sharing")
  8266. , d = document.getElementById("share-modal")
  8267. , p = document.getElementById("share-close")
  8268. , f = document.getElementById("facebook-share")
  8269. , g = document.getElementById("twitter-share")
  8270. , m = document.getElementById("mail-share")
  8271. , v = document.getElementById("share-url-text")
  8272. , y = document.getElementById("copy-success")
  8273. , A = Object.freeze({
  8274. FACEBOOK: "facebook",
  8275. TWITTER: "twitter",
  8276. MAIL: "mail",
  8277. LINKEDIN: "linkedin"
  8278. })
  8279. , C = {};
  8280. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8281. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8282. C[A.MAIL] = "mailto:?subject=";
  8283. var I = {
  8284. init: function(e) {
  8285. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8286. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8287. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8288. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8289. u.addEventListener("click", this.toggle.bind(this)),
  8290. p.addEventListener("click", this.hide.bind(this)),
  8291. v.addEventListener("click", r),
  8292. d.addEventListener("click", o),
  8293. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8294. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8295. m.addEventListener("click", n.bind(this, A.MAIL)),
  8296. v.textContent = window.location.href + "&utm_source=4",
  8297. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8298. u.classList.remove("hidden")
  8299. },
  8300. show: function() {
  8301. this.emit(l.OPENED),
  8302. d.classList.add("fadeIn")
  8303. },
  8304. hide: function() {
  8305. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8306. document.selection && document.selection.empty(),
  8307. window.getSelection().removeAllRanges(),
  8308. o(),
  8309. d.classList.remove("fadeIn"))
  8310. },
  8311. toggle: function() {
  8312. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8313. }
  8314. };
  8315. c.extendObject(I, h.prototype),
  8316. t.exports = I
  8317. }
  8318. , {
  8319. "../../localization/localize": 108,
  8320. "../../util/browser": 182,
  8321. "../../util/common": 185,
  8322. "./ShareEvents": 76,
  8323. events: 202
  8324. }],
  8325. 78: [function(e, t, i) {
  8326. "use strict";
  8327. t.exports = Object.freeze({
  8328. OPENED: "terms.opened",
  8329. CLOSED: "terms.closed"
  8330. })
  8331. }
  8332. , {}],
  8333. 79: [function(e, t, i) {
  8334. "use strict";
  8335. var n = e("./TermsEvent")
  8336. , r = e("../../localization/localize")
  8337. , o = e("../../analytics")
  8338. , a = e("../../util/ajax")
  8339. , s = e("../../util/common")
  8340. , l = e("events").EventEmitter
  8341. , c = document.getElementById("terms-modal")
  8342. , h = {
  8343. init: function() {
  8344. $(".footer-terms").on("click", function(e) {
  8345. e.preventDefault(),
  8346. this.show()
  8347. }
  8348. .bind(this)),
  8349. $("#terms-modal .close").on("click", this.hide.bind(this))
  8350. },
  8351. show: function() {
  8352. this.emit(n.OPENED),
  8353. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8354. var t = $("#terms-text").html(e);
  8355. o.track("showcase_gui", {
  8356. gui_action: "click_terms_button",
  8357. interaction_source: "gui"
  8358. }),
  8359. t.find("a").attr("target", "_blank")
  8360. }).fail(function() {
  8361. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8362. }),
  8363. c.classList.add("fadeIn")
  8364. },
  8365. hide: function(e) {
  8366. e && e.preventDefault(),
  8367. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8368. c.classList.remove("fadeIn")
  8369. }
  8370. };
  8371. s.extendObject(h, l.prototype),
  8372. t.exports = h
  8373. }
  8374. , {
  8375. "../../analytics": 4,
  8376. "../../localization/localize": 108,
  8377. "../../util/ajax": 181,
  8378. "../../util/common": 185,
  8379. "./TermsEvent": 78,
  8380. events: 202
  8381. }],
  8382. 80: [function(e, t, i) {
  8383. "use strict";
  8384. t.exports = Object.freeze({
  8385. OPEN_INFO: "title.open.info",
  8386. CLOSE_INFO: "title.close.info",
  8387. SHOW_INFO: "title.show.info",
  8388. HIDE_INFO: "title.hide.info",
  8389. LINK_CLICKED: "title.link.click",
  8390. CONTACT_LINK_CLICKED: "title.contact.click",
  8391. ORIGIN_LINK_CLICKED: "title.origin.click"
  8392. })
  8393. }
  8394. , {}],
  8395. 81: [function(e, t, i) {
  8396. "use strict";
  8397. var o = e("../../settings");
  8398. t.exports.init = function(e, t) {
  8399. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8400. function e(e) {
  8401. t.shouldShowtags = "show" === this.value,
  8402. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8403. }
  8404. document.getElementById("tag-toggles").classList.remove("hidden"),
  8405. document.getElementById("radio-tag-show").checked = !0;
  8406. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8407. n[r].addEventListener("change", e)
  8408. }(e, t)
  8409. }
  8410. }
  8411. , {
  8412. "../../settings": 166
  8413. }],
  8414. 82: [function(S, M, e) {
  8415. (function(e) {
  8416. "use strict";
  8417. function i(e) {
  8418. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8419. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8420. _.appendChild(function(e) {
  8421. var t = document.createElement("a");
  8422. return t.id = "url",
  8423. t.target = "_blank",
  8424. t.href = e,
  8425. t.innerText = e,
  8426. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8427. t
  8428. }(e)),
  8429. b.forEach(function(e) {
  8430. e.classList.add("share-link")
  8431. }),
  8432. 0))
  8433. }
  8434. function s(e, t) {
  8435. var i = e
  8436. , n = t;
  8437. return function(e, t) {
  8438. i.push(t || n, e)
  8439. }
  8440. }
  8441. var l = S("../../util/browser")
  8442. , t = S("../../util/common")
  8443. , n = S("../../util/logger")
  8444. , r = S("../../localization/localize")
  8445. , o = S("./titleBarSettings")
  8446. , c = S("../../settings")
  8447. , a = S("./TitleEvents")
  8448. , h = S("events").EventEmitter
  8449. , u = new n(e)
  8450. , d = document.querySelector(".pinTop.left")
  8451. , p = document.getElementsByClassName("title-container")[0]
  8452. , f = document.getElementById("title-toggle").querySelector("i")
  8453. , g = document.getElementById("meta-info-wrapper")
  8454. , m = document.getElementById("meta-info")
  8455. , v = document.getElementById("meta-description")
  8456. , y = document.getElementsByClassName("contact-info")[0]
  8457. , A = document.getElementById("contact-data")
  8458. , C = document.getElementById("addressTxt")
  8459. , I = document.getElementById("tag-toggles")
  8460. , E = document.getElementById("share-origin")
  8461. , _ = document.getElementById("share-link-wrapper")
  8462. , b = [m, g, p]
  8463. , w = !1
  8464. , T = !1
  8465. , x = {
  8466. populate: function(e) {
  8467. if (function(e, t) {
  8468. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8469. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8470. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8471. document.getElementById("gui-name").classList.add("noCoBrand"),
  8472. document.getElementById("cobrandTitle").classList.add("hidden")),
  8473. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8474. !1)
  8475. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8476. if (function(e) {
  8477. e ? (w = !0,
  8478. v.innerHTML = e) : v.classList.add("hidden")
  8479. }(e.description),
  8480. function(e, t, i, n) {
  8481. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8482. w = !0;
  8483. var r = []
  8484. , o = s(r, "<br>");
  8485. if (e && o('<span id="contactName">' + e + "</span>"),
  8486. t) {
  8487. var a = n || t;
  8488. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8489. }
  8490. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8491. r[0] = "",
  8492. A.innerHTML = r.join("")
  8493. } else
  8494. y.classList.add("hidden")
  8495. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8496. function(e) {
  8497. if ("string" == typeof e)
  8498. try {
  8499. e = JSON.parse(e)
  8500. } catch (e) {
  8501. return u.warn("Unable to parse address data"),
  8502. C.parentElement.classList.add("hidden")
  8503. }
  8504. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8505. w = !0;
  8506. var t = []
  8507. , i = s(t, " ");
  8508. e.address_1 && i(e.address_1),
  8509. e.address_2 && i(e.address_2),
  8510. e.city && i(e.city, ", "),
  8511. e.state && i(e.state, ", "),
  8512. e.zip && i(e.zip, e.state ? " " : ", "),
  8513. t[0] = "",
  8514. C.innerText = t.join("")
  8515. } else
  8516. C.parentElement.classList.add("hidden")
  8517. }(e.address),
  8518. w) {
  8519. var t = document.createElement("br");
  8520. I.insertBefore(t, I.firstElementChild)
  8521. }
  8522. e.socialSharing && c.share.enabled && (T = i(e.url))
  8523. }
  8524. },
  8525. finishSetup: function(e) {
  8526. w = w || !!e,
  8527. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8528. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8529. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8530. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8531. }),
  8532. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8533. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8534. contact_type: e.getAttribute("id")
  8535. }))
  8536. }),
  8537. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8538. },
  8539. toggleMeta: function(e, t) {
  8540. var i = document.getElementById("model-title");
  8541. t && t.preventDefault();
  8542. var n = m.classList.contains("expand");
  8543. e && !n || (n ? (b.forEach(function(e) {
  8544. e.classList.remove("expand")
  8545. }),
  8546. this.emit(a.CLOSE_INFO),
  8547. i.classList.remove("expand")) : (b.forEach(function(e) {
  8548. e.classList.add("expand")
  8549. }),
  8550. i.classList.add("expand"),
  8551. this.emit(a.OPEN_INFO)))
  8552. },
  8553. setupToggling: function() {
  8554. g.style.height = m.offsetHeight + "px",
  8555. m.addEventListener("transitionend", function() {
  8556. g.style.height = m.offsetHeight + "px"
  8557. })
  8558. },
  8559. toggleTitle: function(e) {
  8560. e && e.preventDefault(),
  8561. d.classList.contains("closed") ? (d.classList.add("open"),
  8562. f.classList.remove("icon-dpad-right"),
  8563. f.classList.add("icon-dpad-left"),
  8564. this.emit(a.SHOW_INFO),
  8565. setTimeout(function() {
  8566. d.classList.remove("closed"),
  8567. d.classList.remove("open")
  8568. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8569. f.classList.remove("icon-dpad-left"),
  8570. f.classList.add("icon-dpad-right"),
  8571. this.emit(a.HIDE_INFO))
  8572. }
  8573. };
  8574. t.extendObject(x, h.prototype),
  8575. M.exports = x
  8576. }
  8577. ).call(this, "/js/gui/title/titleBar.js")
  8578. }
  8579. , {
  8580. "../../localization/localize": 108,
  8581. "../../settings": 166,
  8582. "../../util/browser": 182,
  8583. "../../util/common": 185,
  8584. "../../util/logger": 189,
  8585. "./TitleEvents": 80,
  8586. "./titleBarSettings": 83,
  8587. events: 202
  8588. }],
  8589. 83: [function(e, t, i) {
  8590. "use strict";
  8591. t.exports = Object.freeze({
  8592. minTooltipCharacters: 19,
  8593. removeAnimationClasses: 500
  8594. })
  8595. }
  8596. , {}],
  8597. 84: [function(e, t, i) {
  8598. "use strict";
  8599. function n() {
  8600. v.playTour(),
  8601. y && clearTimeout(y),
  8602. c(),
  8603. E.removeClass("fadeIn")
  8604. }
  8605. function r() {
  8606. A.classList.contains("playing") && (v.stopTour(),
  8607. E.addClass("fadeIn"),
  8608. setTimeout(function() {
  8609. E.removeClass("fadeIn")
  8610. }, h.tourInteraction.showPauseButton),
  8611. M || (clearTimeout(y),
  8612. y = setTimeout(s, h.tourInteraction.showModal)),
  8613. setTimeout(function() {
  8614. A.classList.remove("playing")
  8615. }, h.tourInteraction.allowNextClick))
  8616. }
  8617. function o() {
  8618. v.tourInProgress && (v.stopTour(),
  8619. v.endTourProgress(),
  8620. A.classList.remove("playing"))
  8621. }
  8622. function a() {
  8623. _.is(":visible") ? n() : r()
  8624. }
  8625. function s() {//去掉导览结束时的提示
  8626. /* if (!h.tourInteraction.disabled) {
  8627. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8628. T.addClass("fadeIn tour " + p.deviceType);
  8629. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8630. if (!h.tourInteraction.smallModal)
  8631. 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,
  8632. p.fill(x, g.TOUR_INTERACTION[e]),
  8633. T.addClass(e);
  8634. T.addClass(t)
  8635. } */
  8636. }
  8637. function l(e, t) {
  8638. if (t) {
  8639. var i = "keydown" === t.type
  8640. , n = t.which === u.SPACE || v.tourIsPlaying;
  8641. i && n || e || (M = !0),
  8642. v.atEndOfTour() && c(),
  8643. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8644. c(),
  8645. t.which !== u.SPACE && o()),
  8646. i && n && a()
  8647. }
  8648. }
  8649. function c() {
  8650. T.removeClass("fadeIn")
  8651. }
  8652. var h = (e("../util/browser"),
  8653. e("../settings"))
  8654. , u = e("../enum/Keys")
  8655. , d = e("../enum/Viewmode")
  8656. , p = (e("./helpManager"),
  8657. e("./populateModal"))
  8658. , f = e("../enum/DirectorEvents")
  8659. , g = e("../enum/HelpModalType")
  8660. , m = e("../enum/HelpModalSize")
  8661. , v = null
  8662. , y = null
  8663. , A = document.getElementById("pause-overlay")
  8664. , C = document.getElementById("player")
  8665. , I = document.getElementById("gui")
  8666. , E = $("#pause-icon").eq(0)
  8667. , _ = $("#play").eq(0)
  8668. , b = $("#playHead").eq(0)
  8669. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8670. , T = $("#interaction-modal").eq(0)
  8671. , x = $("#interaction-modal .interaction").toArray()
  8672. , S = ["touchstart", "mousedown", "pointerdown"]
  8673. , M = !1;
  8674. t.exports.init = function(e) {
  8675. v = e,
  8676. S.forEach(function(t) {
  8677. C.addEventListener(t, l.bind(this, !1), !0),
  8678. I.addEventListener(t, l.bind(this, !0), !0),
  8679. A.addEventListener(t, r, !0),
  8680. w.forEach(function(e) {
  8681. e.addEventListener(t, o, !0)
  8682. }),
  8683. $("#drawer img").on(t, o)
  8684. }),
  8685. document.addEventListener("keydown", l.bind(this, !1), !0),
  8686. v.on(f.TourStart, function() {
  8687. A.classList.add("playing")
  8688. })
  8689. }
  8690. ,
  8691. t.exports.play = n,
  8692. t.exports.pause = r,
  8693. t.exports.pauseWithoutCTA = o,
  8694. t.exports.togglePlay = a,
  8695. t.exports.stopTour = function() {
  8696. b.hasClass("playing") && (clearTimeout(y),
  8697. v.atEndOfTour() ? (A.classList.remove("playing"),
  8698. s()) : E.removeClass("fadeIn"))
  8699. }
  8700. ,
  8701. t.exports.dismissModal = c
  8702. }
  8703. , {
  8704. "../enum/DirectorEvents": 23,
  8705. "../enum/HelpModalSize": 27,
  8706. "../enum/HelpModalType": 28,
  8707. "../enum/Keys": 30,
  8708. "../enum/Viewmode": 51,
  8709. "../settings": 166,
  8710. "../util/browser": 182,
  8711. "./helpManager": 68,
  8712. "./populateModal": 75
  8713. }],
  8714. 85: [function(e, t, i) {
  8715. "use strict";
  8716. t.exports = Object.freeze({
  8717. OPENED: "vr.modal.opened",
  8718. LAUNCH: "vr.modal.launch",
  8719. CLOSED: "vr.modal.closed",
  8720. NEXT: "vr.modal.next",
  8721. PREV: "vr.modal.prev",
  8722. STORE: "vr.modal.store",
  8723. falseICECHOSEN: "vr.modal.device"
  8724. })
  8725. }
  8726. , {}],
  8727. 86: [function(e, t, i) {
  8728. "use strict";
  8729. var h = e("../../util/browser")
  8730. , u = e("../../enum/VRApps")
  8731. , n = e("../../enum/VRPlatforms")
  8732. , d = e("../../util/ajax")
  8733. , p = e("../../settings")
  8734. , r = {};
  8735. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8736. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8737. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8738. u) {
  8739. var a = u[o];
  8740. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8741. }
  8742. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8743. "https://" + s);
  8744. t.exports.init = function(e, t, o) {
  8745. function a(e, t, i, n) {
  8746. function r() {
  8747. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8748. }
  8749. 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()
  8750. }
  8751. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8752. , l = g + "/vr/dlist/?ret=" + s
  8753. , c = g + "/vr/show/?ret=" + s;
  8754. switch (e) {
  8755. case n.IOS:
  8756. !function(t, e, i, n) {
  8757. var r = a(t, e, i, n)
  8758. , o = {
  8759. responseType: "json",
  8760. data: {
  8761. branch_key: p.appConfig.branch_key,
  8762. data: {
  8763. m: e,
  8764. full_url: r,
  8765. $desktop_url: "",
  8766. $og_app_id: "331853976762864119",
  8767. $og_title: i,
  8768. $og_description: n,
  8769. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8770. $canonical_url: window.location.href
  8771. }
  8772. }
  8773. };
  8774. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8775. f[t] = e.url
  8776. }).fail(function(e) {
  8777. f[t] = e
  8778. }
  8779. .bind(this, r))
  8780. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8781. break;
  8782. default:
  8783. !function(e, t, i) {
  8784. for (var n in u) {
  8785. var r = u[n]
  8786. , o = a(r, e, t, i);
  8787. f[r] = o
  8788. }
  8789. }(t.sid, t.name, t.summary)
  8790. }
  8791. }
  8792. ,
  8793. t.exports.launch = function(e) {
  8794. var t = f[e];
  8795. window.open(t, "_blank")
  8796. }
  8797. ,
  8798. t.exports.launchStore = function(e) {
  8799. var t = r[e];
  8800. window.open(t, "_blank")
  8801. }
  8802. }
  8803. , {
  8804. "../../enum/VRApps": 46,
  8805. "../../enum/VRPlatforms": 49,
  8806. "../../settings": 166,
  8807. "../../util/ajax": 181,
  8808. "../../util/browser": 182
  8809. }],
  8810. 87: [function(e, t, i) {
  8811. "use strict";
  8812. function c(e) {
  8813. var t;
  8814. switch (e) {
  8815. case y.IOS:
  8816. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8817. case y.Android:
  8818. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8819. }
  8820. return !1
  8821. }
  8822. function h(e) {
  8823. switch (e) {
  8824. case y.Android:
  8825. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8826. x.filter(".gearvr").off().on("click", q.gear),
  8827. n(k, U, "logo-button", "same-line");
  8828. break;
  8829. case y.UnsupportedAndroid:
  8830. n("", H, "", "");
  8831. break;
  8832. case y.IOS:
  8833. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8834. n(k, "", "logo-button", "");
  8835. break;
  8836. case y.Desktop:
  8837. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8838. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8839. n(k, U, "logo-button", "same-line"),
  8840. Q.cardboard()
  8841. }
  8842. }
  8843. function u(e) {
  8844. $(".p1, .p2, .p3").hide(),
  8845. l.insertAfter(T),
  8846. w.removeClass("front-page"),
  8847. w.removeClass("details-page"),
  8848. w.removeClass("lastPage"),
  8849. x.removeClass("logo-button"),
  8850. x.removeClass("same-line"),
  8851. T.removeClass("headsetOptions"),
  8852. S.attr("src", ""),
  8853. S.filter(".second").removeClass("gear"),
  8854. S.css("display", "inline-block"),
  8855. S.off(),
  8856. M.filter(".second").css("display", ""),
  8857. O.css("display", "none"),
  8858. $(".p" + (e + 1) + _).show(),
  8859. S.filter(".third").insertBefore(M.filter(".third"))
  8860. }
  8861. function n(e, t, i, n) {
  8862. w.addClass("front-page"),
  8863. S.filter(".first").attr("src", e),
  8864. S.filter(".second").attr("src", t),
  8865. x.filter(".first").addClass(i),
  8866. x.filter(".second").addClass(i),
  8867. x.addClass(n),
  8868. ".show-desktop" === _ && T.insertAfter(l)
  8869. }
  8870. function r(e, t, i) {
  8871. T.addClass("headsetOptions"),
  8872. x.off(),
  8873. S.filter(".second").attr("src", t),
  8874. O.css("display", "block"),
  8875. M.filter(".second").css("display", "none"),
  8876. O.on("click", function() {
  8877. u(b.Title),
  8878. h(y.Desktop)
  8879. }),
  8880. e && (X.emit(C.falseICECHOSEN, {
  8881. name: v.GearVR
  8882. }),
  8883. S.filter(".first").attr("src", e),
  8884. S.filter(".second").addClass("gear"),
  8885. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8886. Q.gearvr()),
  8887. i && (X.emit(C.falseICECHOSEN, {
  8888. name: v.Cardboard
  8889. }),
  8890. S.filter(".third").attr("src", i),
  8891. S.filter(".third").show(),
  8892. S.filter(".third").insertAfter(S.filter(".second")),
  8893. S.filter(".third").addClass("link"),
  8894. S.filter(".second").addClass("link"),
  8895. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8896. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8897. Q.cardboard())
  8898. }
  8899. function d(e, t) {
  8900. switch (t) {
  8901. case y.IOS:
  8902. j = W,
  8903. Y = G;
  8904. break;
  8905. case y.Desktop:
  8906. e === b.Cardboard ? (j = N,
  8907. Y = B,
  8908. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8909. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8910. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8911. Y = "");
  8912. break;
  8913. default:
  8914. Y = e === b.Cardboard ? (j = H,
  8915. G) : (j = V,
  8916. z)
  8917. }
  8918. }
  8919. function p(e, t, i) {
  8920. w.find(".inner").addClass("details-page"),
  8921. w.addClass("details-page"),
  8922. S.filter(".first").attr("src", e),
  8923. S.filter(".second").attr("src", t),
  8924. S.filter(".third").attr("src", i)
  8925. }
  8926. function f() {
  8927. var e = 1 < g.aspectRatio() && g.isMobile();
  8928. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8929. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8930. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8931. }
  8932. var g = e("../../util/browser")
  8933. , m = e("./vrLink")
  8934. , v = e("../../enum/VRApps")
  8935. , y = e("../../enum/VRPlatforms")
  8936. , A = e("../../enum/VRPages")
  8937. , C = e("./vrEvent")
  8938. , o = (e("../../settings"),
  8939. e("../../constants"))
  8940. , I = e("../../localization/localize")
  8941. , a = e("../../util/common")
  8942. , s = e("events").EventEmitter
  8943. , E = 0
  8944. , _ = null
  8945. , b = A.standard
  8946. , w = $(".vr-popup")
  8947. , l = w.find(".vr-popup-body")
  8948. , T = w.find(".vr-images")
  8949. , x = w.find(".img-container")
  8950. , S = w.find(".vr-sm-image")
  8951. , M = x.find(".vr-img-caption")
  8952. , R = $(".vr-buttons").find(".prev-button")
  8953. , P = $(".vr-buttons").find(".next-button")
  8954. , O = T.find(".front-close")
  8955. , L = $(".vr-page")
  8956. , D = w.find("img")
  8957. , N = "images/apple-store.png"
  8958. , F = "images/badge-oculus.png"
  8959. , B = "images/badge-cardboard.png"
  8960. , V = "images/logo-samsung.png"
  8961. , k = "images/headset-cardboard.png"
  8962. , U = "images/headset-gearvr.png"
  8963. , H = "images/ico-android-robot.png"
  8964. , z = "images/ico-gearvr.png"
  8965. , G = "images/ico-vr.png"
  8966. , W = "images/apple-logo-white.svg"
  8967. , j = null
  8968. , Y = null
  8969. , q = {}
  8970. , X = {
  8971. init: function(e, t) {
  8972. function i(e) {
  8973. X.emit(C.STORE, {
  8974. type: e
  8975. }),
  8976. m.launchStore(e)
  8977. }
  8978. function n(e) {
  8979. switch (e !== b.pageCount && (u(e),
  8980. L.text(e + 1 + " / " + b.pageCount)),
  8981. e) {
  8982. case b.Title:
  8983. R.css("display", "none"),
  8984. P.text(a[e]),
  8985. h(r);
  8986. break;
  8987. case b.Cardboard:
  8988. R.css("display", "block"),
  8989. P.text(a[e]),
  8990. x.filter(".cardboard").off(),
  8991. x.filter(".gearvr").off(),
  8992. d(e, r),
  8993. p(k, j, Y);
  8994. break;
  8995. case b.Gear:
  8996. P.text(a[e]),
  8997. d(e, r),
  8998. w.addClass("lastPage"),
  8999. p(U, j, Y);
  9000. break;
  9001. case b.pageCount:
  9002. w.removeClass("fadeIn"),
  9003. X.emit(C.CLOSED)
  9004. }
  9005. D.filter("[src='']").hide()
  9006. }
  9007. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9008. _ = ".show-supported",
  9009. y.Android) : (w.addClass("unsupported"),
  9010. _ = ".show-unsupported",
  9011. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9012. _ = ".show-ios",
  9013. b = A.ios,
  9014. y.IOS) : (w.addClass("desktop"),
  9015. _ = ".show-desktop",
  9016. y.Desktop);
  9017. function o(e) {
  9018. X.emit(C.LAUNCH, {
  9019. vr_platform: r,
  9020. vr_app: e
  9021. }),
  9022. m.launch(e)
  9023. }
  9024. m.init(r, e, t),
  9025. r !== y.Desktop && w.addClass("mobile"),
  9026. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9027. q.gear = o.bind(this, v.GearVR),
  9028. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9029. f(),
  9030. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9031. $(_).show();
  9032. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9033. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9034. r === y.IOS && (a.splice(1, 1),
  9035. s.splice(1, 1)),
  9036. $("#vr").on("click", function(e) {
  9037. e.preventDefault(),
  9038. window.vrEnabled || (window.vrEnabled = !0,
  9039. this.classList.add("active"),
  9040. $("#gui div").not("#vrOff").addClass("vrHide"),
  9041. $("#vrOffImg").css({
  9042. display: "inline-block"
  9043. }))
  9044. }),
  9045. $("#vrOff").on("click", function() {
  9046. window.vrEnabled = !1,
  9047. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9048. $("#vrOffImg").css({
  9049. display: "none"
  9050. }),
  9051. $("#player canvas").css({
  9052. width: "",
  9053. height: ""
  9054. }),
  9055. $("#vr").removeClass("active")
  9056. });
  9057. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9058. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9059. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9060. $("span.modelLink").text(l),
  9061. R.on("click", function(e) {
  9062. X.emit(C.PREV),
  9063. n(--E)
  9064. }),
  9065. P.on("click", function(e) {
  9066. P.text(),
  9067. X.emit(C.NEXT, {
  9068. nextAction: s[E]
  9069. }),
  9070. n(++E)
  9071. }),
  9072. w.find(".close").on("click", X.dismiss)
  9073. },
  9074. dismiss: function() {
  9075. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9076. X.emit(C.CLOSED))
  9077. },
  9078. isDeviceSupported: c
  9079. };
  9080. a.extendObject(X, s.prototype),
  9081. $(window).resize(f);
  9082. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9083. K = M.filter(".first").find(".gearvr"),
  9084. {
  9085. cardboard: function() {
  9086. K.addClass("hidden"),
  9087. Z.removeClass("hidden")
  9088. },
  9089. gearvr: function() {
  9090. Z.addClass("hidden"),
  9091. K.removeClass("hidden")
  9092. }
  9093. });
  9094. t.exports = X
  9095. }
  9096. , {
  9097. "../../constants": 8,
  9098. "../../enum/VRApps": 46,
  9099. "../../enum/VRPages": 48,
  9100. "../../enum/VRPlatforms": 49,
  9101. "../../localization/localize": 108,
  9102. "../../settings": 166,
  9103. "../../util/browser": 182,
  9104. "../../util/common": 185,
  9105. "./vrEvent": 85,
  9106. "./vrLink": 86,
  9107. events: 202
  9108. }],
  9109. 88: [function(e, t, i) {
  9110. "use strict";
  9111. t.exports = Object.freeze({
  9112. OPENED: "webvr.modal.opened",
  9113. SHOW_TERMS: "webvr.footer.show.terms"
  9114. })
  9115. }
  9116. , {}],
  9117. 89: [function(B, V, e) {
  9118. (function(e) {
  9119. "use strict";
  9120. function a() {
  9121. function t() {
  9122. p.isPresenting || (r.info("exiting webVR"),
  9123. c("webvr_exit_app"),
  9124. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9125. window.removeEventListener("vrdisplaypresentchange", t))
  9126. }
  9127. r.info("Headset mounted"),
  9128. u.suspend();
  9129. var e = document.createElement("canvas");
  9130. for (e.getContext("webgl"),
  9131. e.className = "webvr-canvas",
  9132. document.bgColor = "#000",
  9133. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9134. document.body.removeChild(document.body.firstChild);
  9135. document.body.appendChild(e),
  9136. c("webvr_enter_app"),
  9137. p.requestPresent([{
  9138. source: e,
  9139. predistorted: !0
  9140. }]).catch(function(e) {
  9141. r.error("Failed to present: " + e),
  9142. c("webvr_exit_calibrate"),
  9143. t()
  9144. }),
  9145. d.then(function() {
  9146. window.dispatchEvent(new Event("vrapp-start"))
  9147. }),
  9148. window.addEventListener("vrdisplaypresentchange", t)
  9149. }
  9150. function s() {
  9151. c("webvr_modal_close"),
  9152. _.find(".enter-button").off("click", a),
  9153. E.fadeOut(g.guiAnimationSpeed, function() {
  9154. _.toggleClass("hidden", !1),
  9155. b.toggleClass("hidden", !0),
  9156. f.exitFullscreen()
  9157. }),
  9158. I.fadeIn(g.guiAnimationSpeed)
  9159. }
  9160. function t() {
  9161. M.toggleClass("hidden", !0),
  9162. S.toggleClass("hidden", !1)
  9163. }
  9164. function l() {
  9165. _.toggleClass("hidden"),
  9166. b.toggleClass("hidden")
  9167. }
  9168. function c(e) {
  9169. var t = f.isLandscape() ? "landscape" : "portrait";
  9170. i.trackAlways("showcase_gui", {
  9171. gui_action: e,
  9172. orientation: t
  9173. })
  9174. }
  9175. function h() {
  9176. var e = f.isLandscape();
  9177. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9178. }
  9179. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9180. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9181. 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 = {
  9182. init: function(e, t, i, n) {
  9183. function r(e) {
  9184. e.preventDefault(),
  9185. o(e.currentTarget.id)
  9186. }
  9187. function o(i) {
  9188. F[i](),
  9189. Object.keys(F).map(function(e, t) {
  9190. $("#" + e).toggleClass("tabs-underlined", e === i)
  9191. })
  9192. }
  9193. p = i,
  9194. u = t,
  9195. y.init(m.Android, e, n),
  9196. h(),
  9197. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9198. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9199. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9200. w.filter(".device-headset-side").attr("src", R),
  9201. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9202. $("#vr").on("click", function(e) {
  9203. e.preventDefault(),
  9204. c("click_webvr_button"),
  9205. E.is(":hidden") && (N.emit(A.OPENED),
  9206. I.fadeOut(g.guiAnimationSpeed),
  9207. E.fadeIn(g.guiAnimationSpeed),
  9208. function() {
  9209. if (!d) {
  9210. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9211. d = new Promise(function(e, t) {
  9212. var i = document.createElement("script");
  9213. i.type = "text/javascript",
  9214. i.src = n,
  9215. i.onload = e,
  9216. document.head.appendChild(i)
  9217. }
  9218. )
  9219. }
  9220. _.find(".enter-button").on("click", a)
  9221. }())
  9222. }),
  9223. $(".webvr-popup .close").on("click", function(e) {
  9224. e.preventDefault(),
  9225. _.hasClass("hidden") ? (c("webvr_help_close"),
  9226. l()) : s()
  9227. }),
  9228. $("#tabcardboard").on("click", r),
  9229. $("#tabdaydream").on("click", r),
  9230. $("#tabnative").on("click", r),
  9231. $(".webvr-popup .open-with-app").on("click", function(e) {
  9232. e.preventDefault(),
  9233. c("webvr_learn_more"),
  9234. o("tabnative"),
  9235. l()
  9236. }),
  9237. $(".webvr-popup .help").on("click", function(e) {
  9238. e.preventDefault(),
  9239. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9240. l()
  9241. }),
  9242. $(".webvr-popup .terms").on("click", function(e) {
  9243. e.preventDefault(),
  9244. c("webvr_click_terms"),
  9245. s(),
  9246. N.emit(A.SHOW_TERMS)
  9247. }),
  9248. T.on("click", function(e) {
  9249. e.preventDefault(),
  9250. c(D),
  9251. window.open(L, "_blank")
  9252. }),
  9253. x.on("click", function(e) {
  9254. e.preventDefault(),
  9255. c("webvr_phone_link"),
  9256. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9257. }),
  9258. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9259. e.preventDefault(),
  9260. c("webvr_cardboard_link"),
  9261. y.launch(v.CardboardAndroid)
  9262. }),
  9263. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9264. e.preventDefault(),
  9265. c("webvr_oculus_link"),
  9266. y.launch(v.GearVR)
  9267. })
  9268. }
  9269. }, F = {
  9270. tabcardboard: function() {
  9271. w.filter(".device-headset").attr("src", R),
  9272. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9273. L = "https://vr.google.com/cardboard/get-cardboard/",
  9274. D = "webvr_cardboard_link",
  9275. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9276. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9277. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9278. t()
  9279. },
  9280. tabdaydream: function() {
  9281. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9282. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9283. L = P,
  9284. D = O,
  9285. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9286. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9287. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9288. t()
  9289. },
  9290. tabnative: function() {
  9291. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9292. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9293. M.toggleClass("hidden", !1),
  9294. S.toggleClass("hidden", !0)
  9295. }
  9296. };
  9297. n.extendObject(N, o.prototype),
  9298. $(window).resize(h),
  9299. V.exports = N
  9300. }
  9301. ).call(this, "/js/gui/webvr/webVRgui.js")
  9302. }
  9303. , {
  9304. "../../analytics": 4,
  9305. "../../constants": 8,
  9306. "../../enum/VRApps": 46,
  9307. "../../enum/VRPlatforms": 49,
  9308. "../../localization/localize": 108,
  9309. "../../settings": 166,
  9310. "../../util/browser": 182,
  9311. "../../util/common": 185,
  9312. "../../util/logger": 189,
  9313. "./../gui": 65,
  9314. "./../vr/vrLink": 86,
  9315. "./WebVrEvent": 88,
  9316. events: 202
  9317. }],
  9318. 90: [function(e, t, i) {
  9319. "use strict";
  9320. function n(e, t, i, n, r) {
  9321. this.floorId = n || 0 === n ? n : -1,
  9322. this.roomId = r || "",
  9323. this.labelId = e,
  9324. this.position = (new o.Vector3).copy(t),
  9325. this.text = i
  9326. }
  9327. var o = e("three")
  9328. , r = e("../util/browser");
  9329. n.prototype.build = function() {
  9330. var e = window.document.createElement("div");
  9331. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9332. var t = window.document.createElement("div");
  9333. t.setAttribute("class", "gui-floorplan-label-text");
  9334. var i = window.document.createTextNode(this.text);
  9335. t.appendChild(i),
  9336. e.appendChild(t),
  9337. window.document.body.appendChild(e),
  9338. this.labelGui = e,
  9339. this.textBlock = t,
  9340. $(this.labelGui).hide();
  9341. var n = window.getComputedStyle(this.labelGui);
  9342. this.initialTransform = n.transform || n.webkitTransform
  9343. }
  9344. ,
  9345. t.exports = n
  9346. }
  9347. , {
  9348. "../util/browser": 182,
  9349. three: 217
  9350. }],
  9351. 91: [function(e, t, i) {
  9352. "use strict";
  9353. function n() {
  9354. this.player = null,
  9355. this.modelManager = null,
  9356. this.container = null
  9357. }
  9358. var c, o, r = e("three"), a = (e("../util/common"),
  9359. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9360. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9361. e("../util/transitions"),
  9362. e("../util/lerp"),
  9363. e("../util/browser"));
  9364. n.prototype.init = function(e, t, i) {
  9365. this.player = e,
  9366. this.modelManager = t,
  9367. this.container = i,
  9368. this.updateModel(),
  9369. this.bindEvents()
  9370. }
  9371. ,
  9372. n.prototype.bindEvents = function() {
  9373. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9374. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9375. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9376. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9377. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9378. }
  9379. ,
  9380. n.prototype.updateModel = function() {
  9381. this.model = this.modelManager.getActiveModel()
  9382. }
  9383. ,
  9384. n.prototype.handlePlayerViewChanged = function() {
  9385. this.updateLabelVisibility(),
  9386. this.updateLabelDisplay()
  9387. }
  9388. ,
  9389. n.prototype.getLabelsForFloor = function(t, i) {
  9390. return (i = i || []).length = 0,
  9391. this.model.labels.forEach(function(e) {
  9392. this.labelVisibleForFloor(e, t) && i.push(e)
  9393. }
  9394. .bind(this)),
  9395. i
  9396. }
  9397. ,
  9398. n.prototype.getLabelsForCurrentFloor = function(e) {
  9399. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9400. }
  9401. ,
  9402. n.prototype.labelVisibleForFloor = function(e, t) {
  9403. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9404. if (!this.model.showingLabels || !e.labelGui || !i)
  9405. return !1;
  9406. var n = e.floorId === this.model.floors.size() - 1;
  9407. return this.model.allFloorsVisible ? n : e.floorId === t
  9408. }
  9409. ,
  9410. n.prototype.updateLabelVisibility = function(e) {
  9411. this.model.labels.forEach(function(e) {
  9412. 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)
  9413. }
  9414. .bind(this))
  9415. }
  9416. ,
  9417. n.prototype.showAllLabels = function(t, i) {
  9418. this.model.labels.forEach(function(e) {
  9419. this.showLabel(e, t, i)
  9420. }
  9421. .bind(this))
  9422. }
  9423. ,
  9424. n.prototype.hideAllLabels = function(t, i) {
  9425. this.model.labels.forEach(function(e) {
  9426. this.hideLabel(e, t, i)
  9427. }
  9428. .bind(this))
  9429. }
  9430. ,
  9431. n.prototype.showLabel = function(e, t, i) {
  9432. this.model.showingLabels && (e.visible || (e.visible = !0,
  9433. e.labelGui.style.display = "block",
  9434. e.labelGui.style.opacity = 0,
  9435. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9436. }
  9437. ,
  9438. n.prototype.hideLabel = function(e, t, i) {
  9439. e.visible && (e.visible = !1,
  9440. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9441. }
  9442. ,
  9443. n.prototype.supportedMode = function() {
  9444. return this.player.mode === h.FLOORPLAN
  9445. }
  9446. ,
  9447. n.prototype.updateLabelDisplay = (new r.Vector3,
  9448. new r.Vector3,
  9449. o = [],
  9450. function() {
  9451. var e = this.player.getLabelScaleFactor()
  9452. , t = 1.2 * (1 - e) + .6
  9453. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9454. this.getLabelsForCurrentFloor(o);
  9455. for (var n = 0; n < o.length; n++) {
  9456. var r = o[n];
  9457. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9458. 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)
  9459. }
  9460. }
  9461. ),
  9462. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9463. new r.Vector3,
  9464. function(e, t, i, n, r) {
  9465. t.style.fontSize = 100 * r + "%";
  9466. var o = .5 * $("#player").width()
  9467. , a = .5 * $("#player").height();
  9468. c.copy(i),
  9469. c.project(this.player.camera);
  9470. var s = c.x * o + o
  9471. , l = -c.y * a + a;
  9472. s -= e.offsetWidth / 2,
  9473. l -= e.offsetHeight / 2,
  9474. e.style.left = s + "px",
  9475. e.style.top = l + "px"
  9476. }
  9477. ),
  9478. n.prototype.handleStartInside = function(e) {
  9479. this.updateLabelVisibility()
  9480. }
  9481. ,
  9482. n.prototype.handleStartOutside = function() {
  9483. this.updateLabelVisibility()
  9484. }
  9485. ,
  9486. t.exports = n
  9487. }
  9488. , {
  9489. "../enum/DirectorEvents": 23,
  9490. "../enum/ModelManagerEvents": 33,
  9491. "../enum/PlayerEvents": 40,
  9492. "../enum/Viewmode": 51,
  9493. "../enum/WarpStyle": 52,
  9494. "../settings": 166,
  9495. "../util/browser": 182,
  9496. "../util/common": 185,
  9497. "../util/lerp": 188,
  9498. "../util/transitions": 195,
  9499. three: 217
  9500. }],
  9501. 92: [function(e, t, i) {
  9502. "use strict";
  9503. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9504. if (null == this)
  9505. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9506. if ("function" != typeof e)
  9507. throw new TypeError("predicate must be a function");
  9508. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9509. if (t = i[o],
  9510. e.call(r, t, o, i))
  9511. return o;
  9512. return -1
  9513. }
  9514. ),
  9515. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9516. value: function(e) {
  9517. if (null == this)
  9518. throw new TypeError('"this" is null or not defined');
  9519. var t = Object(this)
  9520. , i = t.length >>> 0;
  9521. if ("function" != typeof e)
  9522. throw new TypeError("predicate must be a function");
  9523. for (var n = arguments[1], r = 0; r < i; ) {
  9524. var o = t[r];
  9525. if (e.call(n, o, r, t))
  9526. return o;
  9527. r++
  9528. }
  9529. }
  9530. })
  9531. }
  9532. , {}],
  9533. 93: [function(e, t, i) {
  9534. "use strict";
  9535. 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 || {};
  9536. function te() {
  9537. this.backgroundElement = document.createElement("div"),
  9538. r.extend(this.backgroundElement.style, {
  9539. backgroundColor: "rgba(0,0,0,0.8)",
  9540. top: 0,
  9541. left: 0,
  9542. display: "none",
  9543. zIndex: "1000",
  9544. opacity: 0,
  9545. WebkitTransition: "opacity 0.2s linear"
  9546. }),
  9547. n.makeFullscreen(this.backgroundElement),
  9548. this.backgroundElement.style.position = "fixed",
  9549. this.domElement = document.createElement("div"),
  9550. r.extend(this.domElement.style, {
  9551. position: "fixed",
  9552. display: "none",
  9553. zIndex: "1001",
  9554. opacity: 0,
  9555. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9556. }),
  9557. document.body.appendChild(this.backgroundElement),
  9558. document.body.appendChild(this.domElement);
  9559. var e = this;
  9560. n.bind(this.backgroundElement, "click", function() {
  9561. e.hide()
  9562. })
  9563. }
  9564. function ie(e, t, i) {
  9565. Object.defineProperty(e, t, {
  9566. get: function() {
  9567. return "RGB" === this.__state.space || re(this, t, i),
  9568. this.__state[t]
  9569. },
  9570. set: function(e) {
  9571. "RGB" !== this.__state.space && (re(this, t, i),
  9572. this.__state.space = "RGB"),
  9573. this.__state[t] = e
  9574. }
  9575. })
  9576. }
  9577. function ne(e, t) {
  9578. Object.defineProperty(e, t, {
  9579. get: function() {
  9580. return "HSV" === this.__state.space || oe(this),
  9581. this.__state[t]
  9582. },
  9583. set: function(e) {
  9584. "HSV" !== this.__state.space && (oe(this),
  9585. this.__state.space = "HSV"),
  9586. this.__state[t] = e
  9587. }
  9588. })
  9589. }
  9590. function re(e, t, i) {
  9591. if ("HEX" === e.__state.space)
  9592. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9593. else {
  9594. if ("HSV" !== e.__state.space)
  9595. throw "Corrupted color state";
  9596. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9597. }
  9598. }
  9599. function oe(e) {
  9600. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9601. l.extend(e.__state, {
  9602. s: t.s,
  9603. v: t.v
  9604. }),
  9605. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9606. }
  9607. function ae() {
  9608. if (this.__state = o.apply(this, arguments),
  9609. !1 === this.__state)
  9610. throw "Failed to interpret color arguments";
  9611. this.__state.a = this.__state.a || 1
  9612. }
  9613. function se(e) {
  9614. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9615. }
  9616. function le(e, t) {
  9617. this.initialValue = e[t],
  9618. this.domElement = document.createElement("div"),
  9619. this.object = e,
  9620. this.property = t,
  9621. this.__onChange = void 0,
  9622. this.__onFinishChange = void 0
  9623. }
  9624. (t.exports = ee).gui = ee.gui || {},
  9625. ee.utils = ee.utils || {},
  9626. ee.controllers = ee.controllers || {},
  9627. ee.dom = ee.dom || {},
  9628. ee.color = ee.color || {},
  9629. ee.utils.css = {
  9630. load: function(e, t) {
  9631. var i = (t = t || document).createElement("link");
  9632. i.type = "text/css",
  9633. i.rel = "stylesheet",
  9634. i.href = e,
  9635. t.getElementsByTagName("head")[0].appendChild(i)
  9636. },
  9637. inject: function(e, t) {
  9638. t = t || document;
  9639. var i = document.createElement("style");
  9640. i.type = "text/css",
  9641. i.innerHTML = e,
  9642. t.getElementsByTagName("head")[0].appendChild(i)
  9643. }
  9644. },
  9645. ee.utils.common = (Q = Array.prototype.forEach,
  9646. J = Array.prototype.slice,
  9647. {
  9648. BREAK: {},
  9649. extend: function(i) {
  9650. return this.each(J.call(arguments, 1), function(e) {
  9651. for (var t in e)
  9652. this.isUndefined(e[t]) || (i[t] = e[t])
  9653. }, this),
  9654. i
  9655. },
  9656. defaults: function(i) {
  9657. return this.each(J.call(arguments, 1), function(e) {
  9658. for (var t in e)
  9659. this.isUndefined(i[t]) && (i[t] = e[t])
  9660. }, this),
  9661. i
  9662. },
  9663. compose: function() {
  9664. var i = J.call(arguments);
  9665. return function() {
  9666. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9667. e = [i[t].apply(this, e)];
  9668. return e[0]
  9669. }
  9670. },
  9671. each: function(e, t, i) {
  9672. if (e)
  9673. if (Q && e.forEach && e.forEach === Q)
  9674. e.forEach(t, i);
  9675. else if (e.length === e.length + 0) {
  9676. for (var n = 0, r = e.length; n < r; n++)
  9677. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9678. return
  9679. } else
  9680. for (var n in e)
  9681. if (t.call(i, e[n], n) === this.BREAK)
  9682. return
  9683. },
  9684. defer: function(e) {
  9685. setTimeout(e, 0)
  9686. },
  9687. toArray: function(e) {
  9688. return e.toArray ? e.toArray() : J.call(e)
  9689. },
  9690. isUndefined: function(e) {
  9691. return void 0 === e
  9692. },
  9693. isNull: function(e) {
  9694. return null === e
  9695. },
  9696. isNaN: function(e) {
  9697. return e != e
  9698. },
  9699. isArray: Array.isArray || function(e) {
  9700. return e.constructor === Array
  9701. }
  9702. ,
  9703. isObject: function(e) {
  9704. return e === Object(e)
  9705. },
  9706. isNumber: function(e) {
  9707. return e === e + 0
  9708. },
  9709. isString: function(e) {
  9710. return e === e + ""
  9711. },
  9712. isBoolean: function(e) {
  9713. return !1 === e || !0 === e
  9714. },
  9715. isFunction: function(e) {
  9716. return "[object Function]" === Object.prototype.toString.call(e)
  9717. }
  9718. }),
  9719. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9720. onChange: function(e) {
  9721. return this.__onChange = e,
  9722. this
  9723. },
  9724. onFinishChange: function(e) {
  9725. return this.__onFinishChange = e,
  9726. this
  9727. },
  9728. setValue: function(e) {
  9729. return this.object[this.property] = e,
  9730. this.__onChange && this.__onChange.call(this, e),
  9731. this.updateDisplay(),
  9732. this
  9733. },
  9734. getValue: function() {
  9735. return this.object[this.property]
  9736. },
  9737. updateDisplay: function() {
  9738. return this
  9739. },
  9740. isModified: function() {
  9741. return this.initialValue !== this.getValue()
  9742. }
  9743. }),
  9744. le),
  9745. ee.dom.dom = function(c) {
  9746. function i(e) {
  9747. if ("0" === e || c.isUndefined(e))
  9748. return 0;
  9749. var t = e.match(n);
  9750. return c.isNull(t) ? 0 : parseFloat(t[1])
  9751. }
  9752. var h = {};
  9753. c.each({
  9754. HTMLEvents: ["change"],
  9755. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9756. KeyboardEvents: ["keydown"]
  9757. }, function(e, t) {
  9758. c.each(e, function(e) {
  9759. h[e] = t
  9760. })
  9761. });
  9762. var n = /(\d+(\.\d+)?)px/
  9763. , r = {
  9764. makeSelectable: function(e, t) {
  9765. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9766. return !1
  9767. }
  9768. : function() {}
  9769. ,
  9770. e.style.MozUserSelect = t ? "auto" : "none",
  9771. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9772. e.unselectable = t ? "on" : "off")
  9773. },
  9774. makeFullscreen: function(e, t, i) {
  9775. c.isUndefined(t) && (t = !0),
  9776. c.isUndefined(i) && (i = !0),
  9777. e.style.position = "absolute",
  9778. t && (e.style.left = 0,
  9779. e.style.right = 0),
  9780. i && (e.style.top = 0,
  9781. e.style.bottom = 0)
  9782. },
  9783. fakeEvent: function(e, t, i, n) {
  9784. i = i || {};
  9785. var r = h[t];
  9786. if (!r)
  9787. throw new Error("Event type " + t + " not supported.");
  9788. var o = document.createEvent(r);
  9789. switch (r) {
  9790. case "MouseEvents":
  9791. var a = i.x || i.clientX || 0
  9792. , s = i.y || i.clientY || 0;
  9793. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9794. break;
  9795. case "KeyboardEvents":
  9796. var l = o.initKeyboardEvent || o.initKeyEvent;
  9797. c.defaults(i, {
  9798. cancelable: !0,
  9799. ctrlKey: !1,
  9800. altKey: !1,
  9801. shiftKey: !1,
  9802. metaKey: !1,
  9803. keyCode: void 0,
  9804. charCode: void 0
  9805. }),
  9806. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9807. break;
  9808. default:
  9809. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9810. }
  9811. c.defaults(o, n),
  9812. e.dispatchEvent(o)
  9813. },
  9814. bind: function(e, t, i, n) {
  9815. return n = n || !1,
  9816. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9817. r
  9818. },
  9819. unbind: function(e, t, i, n) {
  9820. return n = n || !1,
  9821. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9822. r
  9823. },
  9824. addClass: function(e, t) {
  9825. if (void 0 === e.className)
  9826. e.className = t;
  9827. else if (e.className !== t) {
  9828. var i = e.className.split(/ +/);
  9829. -1 == i.indexOf(t) && (i.push(t),
  9830. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9831. }
  9832. return r
  9833. },
  9834. removeClass: function(e, t) {
  9835. if (t)
  9836. if (void 0 === e.className)
  9837. ;
  9838. else if (e.className === t)
  9839. e.removeAttribute("class");
  9840. else {
  9841. var i = e.className.split(/ +/)
  9842. , n = i.indexOf(t);
  9843. -1 != n && (i.splice(n, 1),
  9844. e.className = i.join(" "))
  9845. }
  9846. else
  9847. e.className = void 0;
  9848. return r
  9849. },
  9850. hasClass: function(e, t) {
  9851. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9852. },
  9853. getWidth: function(e) {
  9854. var t = getComputedStyle(e);
  9855. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9856. },
  9857. getHeight: function(e) {
  9858. var t = getComputedStyle(e);
  9859. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9860. },
  9861. getOffset: function(e) {
  9862. var t = {
  9863. left: 0,
  9864. top: 0
  9865. };
  9866. if (e.offsetParent)
  9867. for (; t.left += e.offsetLeft,
  9868. t.top += e.offsetTop,
  9869. e = e.offsetParent; )
  9870. ;
  9871. return t
  9872. },
  9873. isActive: function(e) {
  9874. return e === document.activeElement && (e.type || e.href)
  9875. }
  9876. };
  9877. return r
  9878. }(ee.utils.common),
  9879. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9880. X = ee.dom.dom,
  9881. Z = ee.utils.common,
  9882. (K = function(e, t, i) {
  9883. K.superclass.call(this, e, t);
  9884. var n = this;
  9885. if (this.__select = document.createElement("select"),
  9886. Z.isArray(i)) {
  9887. var r = {};
  9888. Z.each(i, function(e) {
  9889. r[e] = e
  9890. }),
  9891. i = r
  9892. }
  9893. Z.each(i, function(e, t) {
  9894. var i = document.createElement("option");
  9895. i.innerHTML = t,
  9896. i.setAttribute("value", e),
  9897. n.__select.appendChild(i)
  9898. }),
  9899. this.updateDisplay(),
  9900. X.bind(this.__select, "change", function() {
  9901. var e = this.options[this.selectedIndex].value;
  9902. n.setValue(e)
  9903. }),
  9904. this.domElement.appendChild(this.__select)
  9905. }
  9906. ).superclass = q,
  9907. Z.extend(K.prototype, q.prototype, {
  9908. setValue: function(e) {
  9909. var t = K.superclass.prototype.setValue.call(this, e);
  9910. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9911. t
  9912. },
  9913. updateDisplay: function() {
  9914. return this.__select.value = this.getValue(),
  9915. K.superclass.prototype.updateDisplay.call(this)
  9916. }
  9917. }),
  9918. K),
  9919. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9920. j = ee.utils.common,
  9921. (Y = function(e, t, i) {
  9922. Y.superclass.call(this, e, t),
  9923. i = i || {},
  9924. this.__min = i.min,
  9925. this.__max = i.max,
  9926. this.__step = i.step,
  9927. 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,
  9928. this.__precision = se(this.__impliedStep)
  9929. }
  9930. ).superclass = W,
  9931. j.extend(Y.prototype, W.prototype, {
  9932. setValue: function(e) {
  9933. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9934. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9935. Y.superclass.prototype.setValue.call(this, e)
  9936. },
  9937. min: function(e) {
  9938. return this.__min = e,
  9939. this
  9940. },
  9941. max: function(e) {
  9942. return this.__max = e,
  9943. this
  9944. },
  9945. step: function(e) {
  9946. return this.__step = e,
  9947. this.__impliedStep = e,
  9948. this.__precision = se(e),
  9949. this
  9950. }
  9951. }),
  9952. Y),
  9953. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9954. H = ee.dom.dom,
  9955. z = ee.utils.common,
  9956. (G = function(e, t, i) {
  9957. function n() {
  9958. var e = parseFloat(s.__input.value);
  9959. z.isNaN(e) || s.setValue(e)
  9960. }
  9961. function r(e) {
  9962. var t = a - e.clientY;
  9963. s.setValue(s.getValue() + t * s.__impliedStep),
  9964. a = e.clientY
  9965. }
  9966. function o() {
  9967. H.unbind(window, "mousemove", r),
  9968. H.unbind(window, "mouseup", o)
  9969. }
  9970. this.__truncationSuspended = !1,
  9971. G.superclass.call(this, e, t, i);
  9972. var a, s = this;
  9973. this.__input = document.createElement("input"),
  9974. this.__input.setAttribute("type", "text"),
  9975. H.bind(this.__input, "change", n),
  9976. H.bind(this.__input, "blur", function() {
  9977. n(),
  9978. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9979. }),
  9980. H.bind(this.__input, "mousedown", function(e) {
  9981. H.bind(window, "mousemove", r),
  9982. H.bind(window, "mouseup", o),
  9983. a = e.clientY
  9984. }),
  9985. H.bind(this.__input, "keydown", function(e) {
  9986. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9987. this.blur(),
  9988. s.__truncationSuspended = !1)
  9989. }),
  9990. this.updateDisplay(),
  9991. this.domElement.appendChild(this.__input)
  9992. }
  9993. ).superclass = U,
  9994. z.extend(G.prototype, U.prototype, {
  9995. updateDisplay: function() {
  9996. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9997. var i = Math.pow(10, t);
  9998. return Math.round(e * i) / i
  9999. }(this.getValue(), this.__precision),
  10000. G.superclass.prototype.updateDisplay.call(this)
  10001. }
  10002. }),
  10003. G),
  10004. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  10005. F = ee.dom.dom,
  10006. B = ee.utils.css,
  10007. V = ee.utils.common,
  10008. (k = function(e, t, i, n, r) {
  10009. function o(e) {
  10010. e.preventDefault();
  10011. var t = F.getOffset(s.__background)
  10012. , i = F.getWidth(s.__background);
  10013. return s.setValue(function(e, t, i, n, r) {
  10014. return n + (e - t) / (i - t) * (r - n)
  10015. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10016. !1
  10017. }
  10018. function a() {
  10019. F.unbind(window, "mousemove", o),
  10020. F.unbind(window, "mouseup", a),
  10021. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10022. }
  10023. k.superclass.call(this, e, t, {
  10024. min: i,
  10025. max: n,
  10026. step: r
  10027. });
  10028. var s = this;
  10029. this.__background = document.createElement("div"),
  10030. this.__foreground = document.createElement("div"),
  10031. F.bind(this.__background, "mousedown", function(e) {
  10032. F.bind(window, "mousemove", o),
  10033. F.bind(window, "mouseup", a),
  10034. o(e)
  10035. }),
  10036. F.addClass(this.__background, "slider"),
  10037. F.addClass(this.__foreground, "slider-fg"),
  10038. this.updateDisplay(),
  10039. this.__background.appendChild(this.__foreground),
  10040. this.domElement.appendChild(this.__background)
  10041. }
  10042. ).superclass = N,
  10043. k.useDefaultStyles = function() {
  10044. 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}")
  10045. }
  10046. ,
  10047. V.extend(k.prototype, N.prototype, {
  10048. updateDisplay: function() {
  10049. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10050. return this.__foreground.style.width = 100 * e + "%",
  10051. k.superclass.prototype.updateDisplay.call(this)
  10052. }
  10053. }),
  10054. k),
  10055. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10056. O = ee.dom.dom,
  10057. L = ee.utils.common,
  10058. (D = function(e, t, i) {
  10059. D.superclass.call(this, e, t);
  10060. var n = this;
  10061. this.__button = document.createElement("div"),
  10062. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10063. O.bind(this.__button, "click", function(e) {
  10064. return e.preventDefault(),
  10065. n.fire(),
  10066. !1
  10067. }),
  10068. O.addClass(this.__button, "button"),
  10069. this.domElement.appendChild(this.__button)
  10070. }
  10071. ).superclass = P,
  10072. L.extend(D.prototype, P.prototype, {
  10073. fire: function() {
  10074. this.__onChange && this.__onChange.call(this),
  10075. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10076. this.getValue().call(this.object)
  10077. }
  10078. }),
  10079. D),
  10080. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10081. S = ee.dom.dom,
  10082. M = ee.utils.common,
  10083. (R = function(e, t) {
  10084. R.superclass.call(this, e, t);
  10085. var i = this;
  10086. this.__prev = this.getValue(),
  10087. this.__checkbox = document.createElement("input"),
  10088. this.__checkbox.setAttribute("type", "checkbox"),
  10089. S.bind(this.__checkbox, "change", function() {
  10090. i.setValue(!i.__prev)
  10091. }, !1),
  10092. this.domElement.appendChild(this.__checkbox),
  10093. this.updateDisplay()
  10094. }
  10095. ).superclass = x,
  10096. M.extend(R.prototype, x.prototype, {
  10097. setValue: function(e) {
  10098. var t = R.superclass.prototype.setValue.call(this, e);
  10099. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10100. this.__prev = this.getValue(),
  10101. t
  10102. },
  10103. updateDisplay: function() {
  10104. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10105. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10106. R.superclass.prototype.updateDisplay.call(this)
  10107. }
  10108. }),
  10109. R),
  10110. ee.color.toString = (T = ee.utils.common,
  10111. function(e) {
  10112. if (1 == e.a || T.isUndefined(e.a)) {
  10113. for (var t = e.hex.toString(16); t.length < 6; )
  10114. t = "0" + t;
  10115. return "#" + t
  10116. }
  10117. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10118. }
  10119. ),
  10120. ee.color.interpret = (I = ee.color.toString,
  10121. E = ee.utils.common,
  10122. w = [{
  10123. litmus: E.isString,
  10124. conversions: {
  10125. THREE_CHAR_HEX: {
  10126. read: function(e) {
  10127. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10128. return null !== t && {
  10129. space: "HEX",
  10130. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10131. }
  10132. },
  10133. write: I
  10134. },
  10135. SIX_CHAR_HEX: {
  10136. read: function(e) {
  10137. var t = e.match(/^#([A-F0-9]{6})$/i);
  10138. return null !== t && {
  10139. space: "HEX",
  10140. hex: parseInt("0x" + t[1].toString())
  10141. }
  10142. },
  10143. write: I
  10144. },
  10145. CSS_RGB: {
  10146. read: function(e) {
  10147. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10148. return null !== t && {
  10149. space: "RGB",
  10150. r: parseFloat(t[1]),
  10151. g: parseFloat(t[2]),
  10152. b: parseFloat(t[3])
  10153. }
  10154. },
  10155. write: I
  10156. },
  10157. CSS_RGBA: {
  10158. read: function(e) {
  10159. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10160. return null !== t && {
  10161. space: "RGB",
  10162. r: parseFloat(t[1]),
  10163. g: parseFloat(t[2]),
  10164. b: parseFloat(t[3]),
  10165. a: parseFloat(t[4])
  10166. }
  10167. },
  10168. write: I
  10169. }
  10170. }
  10171. }, {
  10172. litmus: E.isNumber,
  10173. conversions: {
  10174. HEX: {
  10175. read: function(e) {
  10176. return {
  10177. space: "HEX",
  10178. hex: e,
  10179. conversionName: "HEX"
  10180. }
  10181. },
  10182. write: function(e) {
  10183. return e.hex
  10184. }
  10185. }
  10186. }
  10187. }, {
  10188. litmus: E.isArray,
  10189. conversions: {
  10190. RGB_ARRAY: {
  10191. read: function(e) {
  10192. return 3 == e.length && {
  10193. space: "RGB",
  10194. r: e[0],
  10195. g: e[1],
  10196. b: e[2]
  10197. }
  10198. },
  10199. write: function(e) {
  10200. return [e.r, e.g, e.b]
  10201. }
  10202. },
  10203. RGBA_ARRAY: {
  10204. read: function(e) {
  10205. return 4 == e.length && {
  10206. space: "RGB",
  10207. r: e[0],
  10208. g: e[1],
  10209. b: e[2],
  10210. a: e[3]
  10211. }
  10212. },
  10213. write: function(e) {
  10214. return [e.r, e.g, e.b, e.a]
  10215. }
  10216. }
  10217. }
  10218. }, {
  10219. litmus: E.isObject,
  10220. conversions: {
  10221. RGBA_OBJ: {
  10222. read: function(e) {
  10223. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10224. space: "RGB",
  10225. r: e.r,
  10226. g: e.g,
  10227. b: e.b,
  10228. a: e.a
  10229. }
  10230. },
  10231. write: function(e) {
  10232. return {
  10233. r: e.r,
  10234. g: e.g,
  10235. b: e.b,
  10236. a: e.a
  10237. }
  10238. }
  10239. },
  10240. RGB_OBJ: {
  10241. read: function(e) {
  10242. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10243. space: "RGB",
  10244. r: e.r,
  10245. g: e.g,
  10246. b: e.b
  10247. }
  10248. },
  10249. write: function(e) {
  10250. return {
  10251. r: e.r,
  10252. g: e.g,
  10253. b: e.b
  10254. }
  10255. }
  10256. },
  10257. HSVA_OBJ: {
  10258. read: function(e) {
  10259. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10260. space: "HSV",
  10261. h: e.h,
  10262. s: e.s,
  10263. v: e.v,
  10264. a: e.a
  10265. }
  10266. },
  10267. write: function(e) {
  10268. return {
  10269. h: e.h,
  10270. s: e.s,
  10271. v: e.v,
  10272. a: e.a
  10273. }
  10274. }
  10275. },
  10276. HSV_OBJ: {
  10277. read: function(e) {
  10278. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10279. space: "HSV",
  10280. h: e.h,
  10281. s: e.s,
  10282. v: e.v
  10283. }
  10284. },
  10285. write: function(e) {
  10286. return {
  10287. h: e.h,
  10288. s: e.s,
  10289. v: e.v
  10290. }
  10291. }
  10292. }
  10293. }
  10294. }],
  10295. function() {
  10296. b = !1;
  10297. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10298. return E.each(w, function(e) {
  10299. if (e.litmus(i))
  10300. return E.each(e.conversions, function(e, t) {
  10301. if (_ = e.read(i),
  10302. !1 === b && !1 !== _)
  10303. return (b = _).conversionName = t,
  10304. _.conversion = e,
  10305. E.BREAK
  10306. }),
  10307. E.BREAK
  10308. }),
  10309. b
  10310. }
  10311. ),
  10312. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10313. function y(e, t, i, n) {
  10314. if (void 0 === t[i])
  10315. throw new Error("Object " + t + ' has no property "' + i + '"');
  10316. var r;
  10317. if (n.color)
  10318. r = new g(t,i);
  10319. else {
  10320. var o = [t, i].concat(n.factoryArgs);
  10321. r = c.apply(e, o)
  10322. }
  10323. n.before instanceof h && (n.before = n.before.__li),
  10324. C(e, r),
  10325. m.addClass(r.domElement, "c");
  10326. var a = document.createElement("span");
  10327. m.addClass(a, "property-name"),
  10328. a.innerHTML = r.property;
  10329. var s = document.createElement("div");
  10330. s.appendChild(a),
  10331. s.appendChild(r.domElement);
  10332. var l = A(e, s, n.before);
  10333. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10334. m.addClass(l, typeof r.getValue()),
  10335. function(t, i, n) {
  10336. if (n.__li = i,
  10337. n.__gui = t,
  10338. v.extend(n, {
  10339. options: function(e) {
  10340. return 1 < arguments.length ? (n.remove(),
  10341. y(t, n.object, n.property, {
  10342. before: n.__li.nextElementSibling,
  10343. factoryArgs: [v.toArray(arguments)]
  10344. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10345. y(t, n.object, n.property, {
  10346. before: n.__li.nextElementSibling,
  10347. factoryArgs: [e]
  10348. })) : void 0
  10349. },
  10350. name: function(e) {
  10351. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10352. n
  10353. },
  10354. listen: function() {
  10355. return n.__gui.listen(n),
  10356. n
  10357. },
  10358. remove: function() {
  10359. return n.__gui.remove(n),
  10360. n
  10361. }
  10362. }),
  10363. n instanceof f) {
  10364. var r = new p(n.object,n.property,{
  10365. min: n.__min,
  10366. max: n.__max,
  10367. step: n.__step
  10368. });
  10369. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10370. var t = n[e]
  10371. , i = r[e];
  10372. n[e] = r[e] = function() {
  10373. var e = Array.prototype.slice.call(arguments);
  10374. return t.apply(n, e),
  10375. i.apply(r, e)
  10376. }
  10377. }),
  10378. m.addClass(i, "has-slider"),
  10379. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10380. } else if (n instanceof p) {
  10381. var e = function(e) {
  10382. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10383. y(t, n.object, n.property, {
  10384. before: n.__li.nextElementSibling,
  10385. factoryArgs: [n.__min, n.__max, n.__step]
  10386. })) : e
  10387. };
  10388. n.min = v.compose(e, n.min),
  10389. n.max = v.compose(e, n.max)
  10390. } else
  10391. n instanceof u ? (m.bind(i, "click", function() {
  10392. m.fakeEvent(n.__checkbox, "click")
  10393. }),
  10394. m.bind(n.__checkbox, "click", function(e) {
  10395. e.stopPropagation()
  10396. })) : n instanceof d ? (m.bind(i, "click", function() {
  10397. m.fakeEvent(n.__button, "click")
  10398. }),
  10399. m.bind(i, "mouseover", function() {
  10400. m.addClass(n.__button, "hover")
  10401. }),
  10402. m.bind(i, "mouseout", function() {
  10403. m.removeClass(n.__button, "hover")
  10404. })) : n instanceof g && (m.addClass(i, "color"),
  10405. n.updateDisplay = v.compose(function(e) {
  10406. return i.style.borderLeftColor = n.__color.toString(),
  10407. e
  10408. }, n.updateDisplay),
  10409. n.updateDisplay());
  10410. n.setValue = v.compose(function(e) {
  10411. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10412. e
  10413. }, n.setValue)
  10414. }(e, l, r),
  10415. e.__controllers.push(r),
  10416. r
  10417. }
  10418. function A(e, t, i) {
  10419. var n = document.createElement("li");
  10420. return t && n.appendChild(t),
  10421. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10422. e.onResize(),
  10423. n
  10424. }
  10425. function C(e, t) {
  10426. var i = e.getRoot()
  10427. , n = i.__rememberedObjects.indexOf(t.object);
  10428. if (-1 != n) {
  10429. var r = i.__rememberedObjectIndecesToControllers[n];
  10430. if (void 0 === r && (r = {},
  10431. i.__rememberedObjectIndecesToControllers[n] = r),
  10432. r[t.property] = t,
  10433. i.load && i.load.remembered) {
  10434. var o, a = i.load.remembered;
  10435. if (a[e.preset])
  10436. o = a[e.preset];
  10437. else {
  10438. if (!a[T])
  10439. return;
  10440. o = a[T]
  10441. }
  10442. if (o[n] && void 0 !== o[n][t.property]) {
  10443. var s = o[n][t.property];
  10444. t.initialValue = s,
  10445. t.setValue(s)
  10446. }
  10447. }
  10448. }
  10449. }
  10450. function I(e, t) {
  10451. return document.location.href + "." + t
  10452. }
  10453. function l(e, t) {
  10454. e.domElement.style.width = t + "px",
  10455. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10456. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10457. }
  10458. function a(r, o) {
  10459. var a = {};
  10460. return v.each(r.__rememberedObjects, function(e, t) {
  10461. var i = {}
  10462. , n = r.__rememberedObjectIndecesToControllers[t];
  10463. v.each(n, function(e, t) {
  10464. i[t] = o ? e.initialValue : e.getValue()
  10465. }),
  10466. a[t] = i
  10467. }),
  10468. a
  10469. }
  10470. function E(e, t, i) {
  10471. var n = document.createElement("option");
  10472. n.innerHTML = t,
  10473. n.value = t,
  10474. e.__preset_select.appendChild(n),
  10475. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10476. }
  10477. function _(e, t) {
  10478. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10479. i.innerHTML = t ? i.value + "*" : i.value
  10480. }
  10481. 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");
  10482. var b, w, T = "Default", x = function() {
  10483. try {
  10484. return "localStorage"in window && null !== window.localStorage
  10485. } catch (e) {
  10486. return !1
  10487. }
  10488. }(), S = !0, s = !1, M = [], R = function(t) {
  10489. var i = this;
  10490. this.domElement = document.createElement("div"),
  10491. this.__ul = document.createElement("ul"),
  10492. this.domElement.appendChild(this.__ul),
  10493. m.addClass(this.domElement, "dg"),
  10494. this.__folders = {},
  10495. this.__controllers = [],
  10496. this.__rememberedObjects = [],
  10497. this.__rememberedObjectIndecesToControllers = [],
  10498. this.__listening = [],
  10499. t = t || {},
  10500. t = v.defaults(t, {
  10501. autoPlace: !0,
  10502. width: R.DEFAULT_WIDTH
  10503. }),
  10504. t = v.defaults(t, {
  10505. resizable: t.autoPlace,
  10506. hideable: t.autoPlace
  10507. }),
  10508. v.isUndefined(t.load) ? t.load = {
  10509. preset: T
  10510. } : t.preset && (t.load.preset = t.preset),
  10511. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10512. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10513. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10514. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10515. if (Object.defineProperties(this, {
  10516. parent: {
  10517. get: function() {
  10518. return t.parent
  10519. }
  10520. },
  10521. scrollable: {
  10522. get: function() {
  10523. return t.scrollable
  10524. }
  10525. },
  10526. autoPlace: {
  10527. get: function() {
  10528. return t.autoPlace
  10529. }
  10530. },
  10531. preset: {
  10532. get: function() {
  10533. return i.parent ? i.getRoot().preset : t.load.preset
  10534. },
  10535. set: function(e) {
  10536. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10537. function(e) {
  10538. for (var t = 0; t < e.__preset_select.length; t++)
  10539. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10540. }(this),
  10541. i.revert()
  10542. }
  10543. },
  10544. width: {
  10545. get: function() {
  10546. return t.width
  10547. },
  10548. set: function(e) {
  10549. t.width = e,
  10550. l(i, e)
  10551. }
  10552. },
  10553. name: {
  10554. get: function() {
  10555. return t.name
  10556. },
  10557. set: function(e) {
  10558. t.name = e,
  10559. a && (a.innerHTML = t.name)
  10560. }
  10561. },
  10562. closed: {
  10563. get: function() {
  10564. return t.closed
  10565. },
  10566. set: function(e) {
  10567. t.closed = e,
  10568. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10569. this.onResize(),
  10570. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10571. }
  10572. },
  10573. load: {
  10574. get: function() {
  10575. return t.load
  10576. }
  10577. },
  10578. useLocalStorage: {
  10579. get: function() {
  10580. return r
  10581. },
  10582. set: function(e) {
  10583. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10584. localStorage.setItem(I(0, "isLocal"), e))
  10585. }
  10586. }
  10587. }),
  10588. v.isUndefined(t.parent)) {
  10589. if (t.closed = !1,
  10590. m.addClass(this.domElement, R.CLASS_MAIN),
  10591. m.makeSelectable(this.domElement, !1),
  10592. x && r) {
  10593. i.useLocalStorage = !0;
  10594. var o = localStorage.getItem(I(0, "gui"));
  10595. o && (t.load = JSON.parse(o))
  10596. }
  10597. this.__closeButton = document.createElement("div"),
  10598. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10599. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10600. this.domElement.appendChild(this.__closeButton),
  10601. m.bind(this.__closeButton, "click", function() {
  10602. i.closed = !i.closed
  10603. })
  10604. } else {
  10605. void 0 === t.closed && (t.closed = !0);
  10606. var a = document.createTextNode(t.name);
  10607. m.addClass(a, "controller-name");
  10608. var s = A(i, a);
  10609. m.addClass(this.__ul, R.CLASS_CLOSED),
  10610. m.addClass(s, "title"),
  10611. m.bind(s, "click", function(e) {
  10612. return e.preventDefault(),
  10613. i.closed = !i.closed,
  10614. !1
  10615. }),
  10616. t.closed || (this.closed = !1)
  10617. }
  10618. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10619. m.addClass(w, "dg"),
  10620. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10621. document.body.appendChild(w),
  10622. S = !1),
  10623. w.appendChild(this.domElement),
  10624. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10625. this.parent || l(i, t.width)),
  10626. m.bind(window, "resize", function() {
  10627. i.onResize()
  10628. }),
  10629. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10630. i.onResize()
  10631. }),
  10632. m.bind(this.__ul, "transitionend", function() {
  10633. i.onResize()
  10634. }),
  10635. m.bind(this.__ul, "oTransitionEnd", function() {
  10636. i.onResize()
  10637. }),
  10638. this.onResize(),
  10639. t.resizable && function(t) {
  10640. function e(e) {
  10641. return e.preventDefault(),
  10642. r = e.clientX,
  10643. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10644. m.bind(window, "mousemove", i),
  10645. m.bind(window, "mouseup", n),
  10646. !1
  10647. }
  10648. function i(e) {
  10649. return e.preventDefault(),
  10650. t.width += r - e.clientX,
  10651. t.onResize(),
  10652. r = e.clientX,
  10653. !1
  10654. }
  10655. function n() {
  10656. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10657. m.unbind(window, "mousemove", i),
  10658. m.unbind(window, "mouseup", n)
  10659. }
  10660. var r;
  10661. t.__resize_handle = document.createElement("div"),
  10662. v.extend(t.__resize_handle.style, {
  10663. width: "6px",
  10664. marginLeft: "-3px",
  10665. height: "200px",
  10666. cursor: "ew-resize",
  10667. position: "absolute"
  10668. }),
  10669. m.bind(t.__resize_handle, "mousedown", e),
  10670. m.bind(t.__closeButton, "mousedown", e),
  10671. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10672. }(this),
  10673. n = function() {
  10674. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10675. }
  10676. ,
  10677. this.saveToLocalStorageIfPossible = n,
  10678. i.getRoot(),
  10679. t.parent || ((e = i.getRoot()).width += 1,
  10680. v.defer(function() {
  10681. e.width -= 1
  10682. }))
  10683. };
  10684. return R.toggleHide = function() {
  10685. s = !s,
  10686. v.each(M, function(e) {
  10687. e.domElement.style.zIndex = s ? -999 : 999,
  10688. e.domElement.style.opacity = s ? 0 : 1
  10689. })
  10690. }
  10691. ,
  10692. R.CLASS_AUTO_PLACE = "a",
  10693. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10694. R.CLASS_MAIN = "main",
  10695. R.CLASS_CONTROLLER_ROW = "cr",
  10696. R.CLASS_TOO_TALL = "taller-than-window",
  10697. R.CLASS_CLOSED = "closed",
  10698. R.CLASS_CLOSE_BUTTON = "close-button",
  10699. R.CLASS_DRAG = "drag",
  10700. R.DEFAULT_WIDTH = 245,
  10701. R.TEXT_CLOSED = "Close Controls",
  10702. R.TEXT_OPEN = "Open Controls",
  10703. m.bind(window, "keydown", function(e) {
  10704. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10705. }, !1),
  10706. v.extend(R.prototype, {
  10707. add: function(e, t) {
  10708. return y(this, e, t, {
  10709. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10710. })
  10711. },
  10712. addColor: function(e, t) {
  10713. return y(this, e, t, {
  10714. color: !0
  10715. })
  10716. },
  10717. remove: function(e) {
  10718. this.__ul.removeChild(e.__li),
  10719. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10720. var t = this;
  10721. v.defer(function() {
  10722. t.onResize()
  10723. })
  10724. },
  10725. destroy: function() {
  10726. this.autoPlace && w.removeChild(this.domElement)
  10727. },
  10728. addFolder: function(e) {
  10729. if (void 0 !== this.__folders[e])
  10730. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10731. var t = {
  10732. name: e,
  10733. parent: this
  10734. };
  10735. t.autoPlace = this.autoPlace,
  10736. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10737. t.load = this.load.folders[e]);
  10738. var i = new R(t);
  10739. this.__folders[e] = i;
  10740. var n = A(this, i.domElement);
  10741. return m.addClass(n, "folder"),
  10742. i
  10743. },
  10744. open: function() {
  10745. this.closed = !1
  10746. },
  10747. close: function() {
  10748. this.closed = !0
  10749. },
  10750. onResize: function() {
  10751. var t = this.getRoot();
  10752. if (t.scrollable) {
  10753. var e = m.getOffset(t.__ul).top
  10754. , i = 0;
  10755. v.each(t.__ul.childNodes, function(e) {
  10756. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10757. }),
  10758. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10759. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10760. t.__ul.style.height = "auto")
  10761. }
  10762. t.__resize_handle && v.defer(function() {
  10763. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10764. }),
  10765. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10766. },
  10767. remember: function() {
  10768. 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>'),
  10769. this.parent)
  10770. throw new Error("You can only call remember on a top level GUI.");
  10771. var t = this;
  10772. v.each(Array.prototype.slice.call(arguments), function(e) {
  10773. 0 == t.__rememberedObjects.length && function(i) {
  10774. var e = i.__save_row = document.createElement("li");
  10775. m.addClass(i.domElement, "has-save"),
  10776. i.__ul.insertBefore(e, i.__ul.firstChild),
  10777. m.addClass(e, "save-row");
  10778. var t = document.createElement("span");
  10779. t.innerHTML = "&nbsp;",
  10780. m.addClass(t, "button gears");
  10781. var n = document.createElement("span");
  10782. n.innerHTML = "Save",
  10783. m.addClass(n, "button"),
  10784. m.addClass(n, "save");
  10785. var r = document.createElement("span");
  10786. r.innerHTML = "New",
  10787. m.addClass(r, "button"),
  10788. m.addClass(r, "save-as");
  10789. var o = document.createElement("span");
  10790. o.innerHTML = "Revert",
  10791. m.addClass(o, "button"),
  10792. m.addClass(o, "revert");
  10793. var a = i.__preset_select = document.createElement("select");
  10794. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10795. E(i, t, t == i.preset)
  10796. }) : E(i, T, !1),
  10797. m.bind(a, "change", function() {
  10798. for (var e = 0; e < i.__preset_select.length; e++)
  10799. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10800. i.preset = this.value
  10801. }),
  10802. e.appendChild(a),
  10803. e.appendChild(t),
  10804. e.appendChild(n),
  10805. e.appendChild(r),
  10806. e.appendChild(o),
  10807. x) {
  10808. var s = document.getElementById("dg-save-locally")
  10809. , l = document.getElementById("dg-local-explain");
  10810. s.style.display = "block";
  10811. var c = document.getElementById("dg-local-storage");
  10812. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10813. var h = function() {
  10814. l.style.display = i.useLocalStorage ? "block" : "none"
  10815. };
  10816. h(),
  10817. m.bind(c, "change", function() {
  10818. i.useLocalStorage = !i.useLocalStorage,
  10819. h()
  10820. })
  10821. }
  10822. var u = document.getElementById("dg-new-constructor");
  10823. m.bind(u, "keydown", function(e) {
  10824. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10825. }),
  10826. m.bind(t, "click", function() {
  10827. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10828. b.show(),
  10829. u.focus(),
  10830. u.select()
  10831. }),
  10832. m.bind(n, "click", function() {
  10833. i.save()
  10834. }),
  10835. m.bind(r, "click", function() {
  10836. var e = prompt("Enter a new preset name.");
  10837. e && i.saveAs(e)
  10838. }),
  10839. m.bind(o, "click", function() {
  10840. i.revert()
  10841. })
  10842. }(t),
  10843. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10844. }),
  10845. this.autoPlace && l(this, this.width)
  10846. },
  10847. getRoot: function() {
  10848. for (var e = this; e.parent; )
  10849. e = e.parent;
  10850. return e
  10851. },
  10852. getSaveObject: function() {
  10853. var i = this.load;
  10854. return i.closed = this.closed,
  10855. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10856. i.remembered || (i.remembered = {}),
  10857. i.remembered[this.preset] = a(this)),
  10858. i.folders = {},
  10859. v.each(this.__folders, function(e, t) {
  10860. i.folders[t] = e.getSaveObject()
  10861. }),
  10862. i
  10863. },
  10864. save: function() {
  10865. this.load.remembered || (this.load.remembered = {}),
  10866. this.load.remembered[this.preset] = a(this),
  10867. _(this, !1),
  10868. this.saveToLocalStorageIfPossible()
  10869. },
  10870. saveAs: function(e) {
  10871. this.load.remembered || (this.load.remembered = {},
  10872. this.load.remembered[T] = a(this, !0)),
  10873. this.load.remembered[e] = a(this),
  10874. this.preset = e,
  10875. E(this, e, !0),
  10876. this.saveToLocalStorageIfPossible()
  10877. },
  10878. revert: function(t) {
  10879. v.each(this.__controllers, function(e) {
  10880. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10881. }, this),
  10882. v.each(this.__folders, function(e) {
  10883. e.revert(e)
  10884. }),
  10885. t || _(this.getRoot(), !1)
  10886. },
  10887. listen: function(e) {
  10888. var t = 0 == this.__listening.length;
  10889. this.__listening.push(e),
  10890. t && function e(t) {
  10891. 0 != t.length && r(function() {
  10892. e(t)
  10893. }),
  10894. v.each(t, function(e) {
  10895. e.updateDisplay()
  10896. })
  10897. }(this.__listening)
  10898. }
  10899. }),
  10900. R
  10901. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10902. u = ee.controllers.NumberControllerBox,
  10903. d = ee.controllers.NumberControllerSlider,
  10904. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10905. y = ee.dom.dom,
  10906. A = ee.utils.common,
  10907. (C = function(e, t) {
  10908. function i() {
  10909. n.setValue(n.__input.value)
  10910. }
  10911. C.superclass.call(this, e, t);
  10912. var n = this;
  10913. this.__input = document.createElement("input"),
  10914. this.__input.setAttribute("type", "text"),
  10915. y.bind(this.__input, "keyup", i),
  10916. y.bind(this.__input, "change", i),
  10917. y.bind(this.__input, "blur", function() {
  10918. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10919. }),
  10920. y.bind(this.__input, "keydown", function(e) {
  10921. 13 === e.keyCode && this.blur()
  10922. }),
  10923. this.updateDisplay(),
  10924. this.domElement.appendChild(this.__input)
  10925. }
  10926. ).superclass = v,
  10927. A.extend(C.prototype, v.prototype, {
  10928. updateDisplay: function() {
  10929. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10930. C.superclass.prototype.updateDisplay.call(this)
  10931. }
  10932. }),
  10933. C),
  10934. f = ee.controllers.FunctionController,
  10935. g = ee.controllers.BooleanController,
  10936. m = ee.utils.common,
  10937. function(e, t) {
  10938. var i = e[t];
  10939. 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,{
  10940. min: arguments[2],
  10941. max: arguments[3]
  10942. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10943. }
  10944. ), 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) {
  10945. function f(t, i, n, r) {
  10946. t.style.background = "",
  10947. p.each(o, function(e) {
  10948. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10949. })
  10950. }
  10951. var g = function(e, t) {
  10952. function i(e) {
  10953. a(e),
  10954. h.bind(window, "mousemove", a),
  10955. h.bind(window, "mouseup", n)
  10956. }
  10957. function n() {
  10958. h.unbind(window, "mousemove", a),
  10959. h.unbind(window, "mouseup", n)
  10960. }
  10961. function r() {
  10962. var e = d(this.value);
  10963. !1 !== e ? (l.__color.__state = e,
  10964. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10965. }
  10966. function o() {
  10967. h.unbind(window, "mousemove", s),
  10968. h.unbind(window, "mouseup", o)
  10969. }
  10970. function a(e) {
  10971. e.preventDefault();
  10972. var t = h.getWidth(l.__saturation_field)
  10973. , i = h.getOffset(l.__saturation_field)
  10974. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10975. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10976. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10977. 1 < n ? n = 1 : n < 0 && (n = 0),
  10978. l.__color.v = r,
  10979. l.__color.s = n,
  10980. l.setValue(l.__color.toOriginal()),
  10981. !1
  10982. }
  10983. function s(e) {
  10984. e.preventDefault();
  10985. var t = h.getHeight(l.__hue_field)
  10986. , i = h.getOffset(l.__hue_field)
  10987. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10988. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10989. l.__color.h = 360 * n,
  10990. l.setValue(l.__color.toOriginal()),
  10991. !1
  10992. }
  10993. g.superclass.call(this, e, t),
  10994. this.__color = new u(this.getValue()),
  10995. this.__temp = new u(0);
  10996. var l = this;
  10997. this.domElement = document.createElement("div"),
  10998. h.makeSelectable(this.domElement, !1),
  10999. this.__selector = document.createElement("div"),
  11000. this.__selector.className = "selector",
  11001. this.__saturation_field = document.createElement("div"),
  11002. this.__saturation_field.className = "saturation-field",
  11003. this.__field_knob = document.createElement("div"),
  11004. this.__field_knob.className = "field-knob",
  11005. this.__field_knob_border = "2px solid ",
  11006. this.__hue_knob = document.createElement("div"),
  11007. this.__hue_knob.className = "hue-knob",
  11008. this.__hue_field = document.createElement("div"),
  11009. this.__hue_field.className = "hue-field",
  11010. this.__input = document.createElement("input"),
  11011. this.__input.type = "text",
  11012. this.__input_textShadow = "0 1px 1px ",
  11013. h.bind(this.__input, "keydown", function(e) {
  11014. 13 === e.keyCode && r.call(this)
  11015. }),
  11016. h.bind(this.__input, "blur", r),
  11017. h.bind(this.__selector, "mousedown", function(e) {
  11018. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11019. h.removeClass(l.__selector, "drag")
  11020. })
  11021. });
  11022. var c = document.createElement("div");
  11023. p.extend(this.__selector.style, {
  11024. width: "122px",
  11025. height: "102px",
  11026. padding: "3px",
  11027. backgroundColor: "#222",
  11028. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11029. }),
  11030. p.extend(this.__field_knob.style, {
  11031. position: "absolute",
  11032. width: "12px",
  11033. height: "12px",
  11034. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11035. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11036. borderRadius: "12px",
  11037. zIndex: 1
  11038. }),
  11039. p.extend(this.__hue_knob.style, {
  11040. position: "absolute",
  11041. width: "15px",
  11042. height: "2px",
  11043. borderRight: "4px solid #fff",
  11044. zIndex: 1
  11045. }),
  11046. p.extend(this.__saturation_field.style, {
  11047. width: "100px",
  11048. height: "100px",
  11049. border: "1px solid #555",
  11050. marginRight: "3px",
  11051. display: "inline-block",
  11052. cursor: "pointer"
  11053. }),
  11054. p.extend(c.style, {
  11055. width: "100%",
  11056. height: "100%",
  11057. background: "none"
  11058. }),
  11059. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11060. p.extend(this.__hue_field.style, {
  11061. width: "15px",
  11062. height: "100px",
  11063. display: "inline-block",
  11064. border: "1px solid #555",
  11065. cursor: "ns-resize"
  11066. }),
  11067. function(e) {
  11068. e.style.background = "",
  11069. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11070. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11071. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11072. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11073. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11074. }(this.__hue_field),
  11075. p.extend(this.__input.style, {
  11076. outline: "none",
  11077. textAlign: "center",
  11078. color: "#fff",
  11079. border: 0,
  11080. fontWeight: "bold",
  11081. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11082. }),
  11083. h.bind(this.__saturation_field, "mousedown", i),
  11084. h.bind(this.__field_knob, "mousedown", i),
  11085. h.bind(this.__hue_field, "mousedown", function(e) {
  11086. s(e),
  11087. h.bind(window, "mousemove", s),
  11088. h.bind(window, "mouseup", o)
  11089. }),
  11090. this.__saturation_field.appendChild(c),
  11091. this.__selector.appendChild(this.__field_knob),
  11092. this.__selector.appendChild(this.__saturation_field),
  11093. this.__selector.appendChild(this.__hue_field),
  11094. this.__hue_field.appendChild(this.__hue_knob),
  11095. this.domElement.appendChild(this.__input),
  11096. this.domElement.appendChild(this.__selector),
  11097. this.updateDisplay()
  11098. };
  11099. g.superclass = e,
  11100. p.extend(g.prototype, e.prototype, {
  11101. updateDisplay: function() {
  11102. var t = d(this.getValue());
  11103. if (!1 !== t) {
  11104. var i = !1;
  11105. p.each(u.COMPONENTS, function(e) {
  11106. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11107. return i = !0,
  11108. {}
  11109. }, this),
  11110. i && p.extend(this.__color.__state, t)
  11111. }
  11112. p.extend(this.__temp.__state, this.__color.__state),
  11113. this.__temp.a = 1;
  11114. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11115. , n = 255 - e;
  11116. p.extend(this.__field_knob.style, {
  11117. marginLeft: 100 * this.__color.s - 7 + "px",
  11118. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11119. backgroundColor: this.__temp.toString(),
  11120. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11121. }),
  11122. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11123. this.__temp.s = 1,
  11124. this.__temp.v = 1,
  11125. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11126. p.extend(this.__input.style, {
  11127. backgroundColor: this.__input.value = this.__color.toString(),
  11128. color: "rgb(" + e + "," + e + "," + e + ")",
  11129. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11130. })
  11131. }
  11132. });
  11133. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11134. return g
  11135. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11136. a = ee.color.math = {
  11137. hsv_to_rgb: function(e, t, i) {
  11138. var n = Math.floor(e / 60) % 6
  11139. , r = e / 60 - Math.floor(e / 60)
  11140. , o = i * (1 - t)
  11141. , a = i * (1 - r * t)
  11142. , s = i * (1 - (1 - r) * t)
  11143. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11144. return {
  11145. r: 255 * l[0],
  11146. g: 255 * l[1],
  11147. b: 255 * l[2]
  11148. }
  11149. },
  11150. rgb_to_hsv: function(e, t, i) {
  11151. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11152. return 0 == o ? {
  11153. h: NaN,
  11154. s: 0,
  11155. v: 0
  11156. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11157. (n /= 6) < 0 && (n += 1),
  11158. {
  11159. h: 360 * n,
  11160. s: a / o,
  11161. v: o / 255
  11162. })
  11163. },
  11164. rgb_to_hex: function(e, t, i) {
  11165. var n = this.hex_with_component(0, 2, e);
  11166. return n = this.hex_with_component(n, 1, t),
  11167. this.hex_with_component(n, 0, i)
  11168. },
  11169. component_from_hex: function(e, t) {
  11170. return e >> 8 * t & 255
  11171. },
  11172. hex_with_component: function(e, t, i) {
  11173. return i << (c = 8 * t) | e & ~(255 << c)
  11174. }
  11175. },
  11176. s = ee.color.toString,
  11177. l = ee.utils.common,
  11178. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11179. l.extend(ae.prototype, {
  11180. toString: function() {
  11181. return s(this)
  11182. },
  11183. toOriginal: function() {
  11184. return this.__state.conversion.write(this)
  11185. }
  11186. }),
  11187. ie(ae.prototype, "r", 2),
  11188. ie(ae.prototype, "g", 1),
  11189. ie(ae.prototype, "b", 0),
  11190. ne(ae.prototype, "h"),
  11191. ne(ae.prototype, "s"),
  11192. ne(ae.prototype, "v"),
  11193. Object.defineProperty(ae.prototype, "a", {
  11194. get: function() {
  11195. return this.__state.a
  11196. },
  11197. set: function(e) {
  11198. this.__state.a = e
  11199. }
  11200. }),
  11201. Object.defineProperty(ae.prototype, "hex", {
  11202. get: function() {
  11203. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11204. this.__state.hex
  11205. },
  11206. set: function(e) {
  11207. this.__state.space = "HEX",
  11208. this.__state.hex = e
  11209. }
  11210. }),
  11211. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11212. window.setTimeout(e, 1e3 / 60)
  11213. }
  11214. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11215. r = ee.utils.common,
  11216. te.prototype.show = function() {
  11217. var e = this;
  11218. this.backgroundElement.style.display = "block",
  11219. this.domElement.style.display = "block",
  11220. this.domElement.style.opacity = 0,
  11221. this.domElement.style.webkitTransform = "scale(1.1)",
  11222. this.layout(),
  11223. r.defer(function() {
  11224. e.backgroundElement.style.opacity = 1,
  11225. e.domElement.style.opacity = 1,
  11226. e.domElement.style.webkitTransform = "scale(1)"
  11227. })
  11228. }
  11229. ,
  11230. te.prototype.hide = function() {
  11231. var e = this
  11232. , t = function() {
  11233. e.domElement.style.display = "none",
  11234. e.backgroundElement.style.display = "none",
  11235. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11236. n.unbind(e.domElement, "transitionend", t),
  11237. n.unbind(e.domElement, "oTransitionEnd", t)
  11238. };
  11239. n.bind(this.domElement, "webkitTransitionEnd", t),
  11240. n.bind(this.domElement, "transitionend", t),
  11241. n.bind(this.domElement, "oTransitionEnd", t),
  11242. this.backgroundElement.style.opacity = 0,
  11243. this.domElement.style.opacity = 0,
  11244. this.domElement.style.webkitTransform = "scale(1.1)"
  11245. }
  11246. ,
  11247. te.prototype.layout = function() {
  11248. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11249. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11250. }
  11251. ,
  11252. te), ee.dom.dom, ee.utils.common)
  11253. }
  11254. , {}],
  11255. 94: [function(e, t, i) {
  11256. (function(J) {
  11257. "use strict";
  11258. function i(e) {
  11259. function t(e, t) {
  11260. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11261. for (var a = 1; a <= e[o]; a++)
  11262. r[t[n]] = [],
  11263. r[t[n]][0] = i,
  11264. r[t[n]][1] = o,
  11265. n++,
  11266. i++;
  11267. i *= 2
  11268. }
  11269. return r
  11270. }
  11271. function _(e) {
  11272. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11273. t & 1 << i && (B |= 1 << V),
  11274. i--,
  11275. --V < 0 && (255 == B ? (b(255),
  11276. b(0)) : b(B),
  11277. V = 7,
  11278. B = 0)
  11279. }
  11280. function b(e) {
  11281. F.push(e)
  11282. }
  11283. function w(e) {
  11284. b(e >> 8 & 255),
  11285. b(255 & e)
  11286. }
  11287. function T(e, t, i, n, r) {
  11288. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11289. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11290. for (h = 0; h < 8; ++h) {
  11291. i = e[d],
  11292. n = e[d + 1],
  11293. r = e[d + 2],
  11294. o = e[d + 3],
  11295. a = e[d + 4],
  11296. s = e[d + 5],
  11297. l = e[d + 6];
  11298. var p = i + (c = e[d + 7])
  11299. , f = i - c
  11300. , g = n + l
  11301. , m = n - l
  11302. , v = r + s
  11303. , y = r - s
  11304. , A = o + a
  11305. , C = o - a
  11306. , I = p + A
  11307. , E = p - A
  11308. , _ = g + v
  11309. , b = g - v;
  11310. e[d] = I + _,
  11311. e[d + 4] = I - _;
  11312. var w = .707106781 * (b + E);
  11313. e[d + 2] = E + w,
  11314. e[d + 6] = E - w;
  11315. var T = .382683433 * ((I = C + y) - (b = m + f))
  11316. , x = .5411961 * I + T
  11317. , S = 1.306562965 * b + T
  11318. , M = .707106781 * (_ = y + m)
  11319. , R = f + M
  11320. , P = f - M;
  11321. e[d + 5] = P + x,
  11322. e[d + 3] = P - x,
  11323. e[d + 1] = R + S,
  11324. e[d + 7] = R - S,
  11325. d += 8
  11326. }
  11327. for (h = d = 0; h < 8; ++h) {
  11328. i = e[d],
  11329. n = e[d + 8],
  11330. r = e[d + 16],
  11331. o = e[d + 24],
  11332. a = e[d + 32],
  11333. s = e[d + 40],
  11334. l = e[d + 48];
  11335. var O = i + (c = e[d + 56])
  11336. , L = i - c
  11337. , D = n + l
  11338. , N = n - l
  11339. , F = r + s
  11340. , B = r - s
  11341. , V = o + a
  11342. , k = o - a
  11343. , U = O + V
  11344. , H = O - V
  11345. , z = D + F
  11346. , G = D - F;
  11347. e[d] = U + z,
  11348. e[d + 32] = U - z;
  11349. var W = .707106781 * (G + H);
  11350. e[d + 16] = H + W,
  11351. e[d + 48] = H - W;
  11352. var j = .382683433 * ((U = k + B) - (G = N + L))
  11353. , Y = .5411961 * U + j
  11354. , q = 1.306562965 * G + j
  11355. , X = .707106781 * (z = B + N)
  11356. , Z = L + X
  11357. , K = L - X;
  11358. e[d + 40] = K + Y,
  11359. e[d + 24] = K - Y,
  11360. e[d + 8] = Z + q,
  11361. e[d + 56] = Z - q,
  11362. d++
  11363. }
  11364. for (h = 0; h < 64; ++h)
  11365. u = e[h] * t[h],
  11366. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11367. return Q
  11368. }(e, t), c = 0; c < 64; ++c)
  11369. A[C[c]] = l[c];
  11370. var h = A[0] - i;
  11371. i = A[0],
  11372. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11373. _(v[o]));
  11374. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11375. ;
  11376. if (0 == u)
  11377. return _(a),
  11378. i;
  11379. for (var d, p = 1; p <= u; ) {
  11380. for (var f = p; 0 == A[p] && p <= u; ++p)
  11381. ;
  11382. var g = p - f;
  11383. if (16 <= g) {
  11384. d = g >> 4;
  11385. for (var m = 1; m <= d; ++m)
  11386. _(s);
  11387. g &= 15
  11388. }
  11389. o = 32767 + A[p],
  11390. _(r[(g << 4) + y[o]]),
  11391. _(v[o]),
  11392. p++
  11393. }
  11394. return 63 != u && _(a),
  11395. i
  11396. }
  11397. function x(e) {
  11398. if (e <= 0 && (e = 1),
  11399. 100 < e && (e = 100),
  11400. i != e) {
  11401. (function(e) {
  11402. 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++) {
  11403. var n = u((t[i] * e + 50) / 100);
  11404. n < 1 ? n = 1 : 255 < n && (n = 255),
  11405. O[C[i]] = n
  11406. }
  11407. 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++) {
  11408. var a = u((r[o] * e + 50) / 100);
  11409. a < 1 ? a = 1 : 255 < a && (a = 255),
  11410. L[C[o]] = a
  11411. }
  11412. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11413. for (var h = 0; h < 8; h++)
  11414. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11415. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11416. l++
  11417. }
  11418. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11419. i = e
  11420. }
  11421. }
  11422. var S, M, R, P, i, u = (Math.round,
  11423. 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];
  11424. this.encode = function(e, t) {
  11425. var i = ((new Date).getTime(),
  11426. t.quality);
  11427. i && x(i),
  11428. F = new Array,
  11429. B = 0,
  11430. V = 7,
  11431. w(65496),
  11432. w(65504),
  11433. w(16),
  11434. b(74),
  11435. b(70),
  11436. b(73),
  11437. b(70),
  11438. b(0),
  11439. b(1),
  11440. b(1),
  11441. b(0),
  11442. w(1),
  11443. w(1),
  11444. b(0),
  11445. b(0),
  11446. function() {
  11447. w(65499),
  11448. w(132),
  11449. b(0);
  11450. for (var e = 0; e < 64; e++)
  11451. b(O[e]);
  11452. b(1);
  11453. for (var t = 0; t < 64; t++)
  11454. b(L[t])
  11455. }(),
  11456. function(e, t) {
  11457. w(65472),
  11458. w(17),
  11459. b(8),
  11460. w(t),
  11461. w(e),
  11462. b(3),
  11463. b(1),
  11464. b(17),
  11465. b(0),
  11466. b(2),
  11467. b(17),
  11468. b(1),
  11469. b(3),
  11470. b(17),
  11471. b(1)
  11472. }(e.width, e.height),
  11473. function() {
  11474. w(65476),
  11475. w(418),
  11476. b(0);
  11477. for (var e = 0; e < 16; e++)
  11478. b(G[e + 1]);
  11479. for (var t = 0; t <= 11; t++)
  11480. b(W[t]);
  11481. b(16);
  11482. for (var i = 0; i < 16; i++)
  11483. b(j[i + 1]);
  11484. for (var n = 0; n <= 161; n++)
  11485. b(Y[n]);
  11486. b(1);
  11487. for (var r = 0; r < 16; r++)
  11488. b(q[r + 1]);
  11489. for (var o = 0; o <= 11; o++)
  11490. b(X[o]);
  11491. b(17);
  11492. for (var a = 0; a < 16; a++)
  11493. b(Z[a + 1]);
  11494. for (var s = 0; s <= 161; s++)
  11495. b(K[s])
  11496. }(),
  11497. w(65498),
  11498. w(12),
  11499. b(3),
  11500. b(1),
  11501. b(0),
  11502. b(2),
  11503. b(17),
  11504. b(3),
  11505. b(17),
  11506. b(0),
  11507. b(63),
  11508. b(0);
  11509. var n = 0
  11510. , r = 0
  11511. , o = 0;
  11512. B = 0,
  11513. V = 7,
  11514. this.encode.displayName = "_encode_";
  11515. 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; ) {
  11516. for (a = 0; a < A; ) {
  11517. for (u = h = A * C + a,
  11518. d = -1,
  11519. f = p = 0; f < 64; f++)
  11520. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11521. v <= C + p && (u -= A * (C + 1 + p - v)),
  11522. A <= a + d && (u -= a + d - A + 4),
  11523. s = g[u++],
  11524. l = g[u++],
  11525. c = g[u++],
  11526. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11527. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11528. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11529. n = T(k, D, n, S, R),
  11530. r = T(U, N, r, M, P),
  11531. o = T(H, N, o, M, P),
  11532. a += 32
  11533. }
  11534. C += I
  11535. }
  11536. if (0 <= V) {
  11537. var E = [];
  11538. E[1] = V + 1,
  11539. E[0] = (1 << V + 1) - 1,
  11540. _(E)
  11541. }
  11542. return w(65497),
  11543. new J(F)
  11544. }
  11545. ,
  11546. (new Date).getTime(),
  11547. e = e || 50,
  11548. function() {
  11549. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11550. n[t] = e(t)
  11551. }(),
  11552. S = t(G, W),
  11553. M = t(q, X),
  11554. R = t(j, Y),
  11555. P = t(Z, K),
  11556. function() {
  11557. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11558. for (var n = e; n < t; n++)
  11559. y[32767 + n] = i,
  11560. v[32767 + n] = [],
  11561. v[32767 + n][1] = i,
  11562. v[32767 + n][0] = n;
  11563. for (var r = -(t - 1); r <= -e; r++)
  11564. y[32767 + r] = i,
  11565. v[32767 + r] = [],
  11566. v[32767 + r][1] = i,
  11567. v[32767 + r][0] = t - 1 + r;
  11568. e <<= 1,
  11569. t <<= 1
  11570. }
  11571. }(),
  11572. function() {
  11573. for (var e = 0; e < 256; e++)
  11574. z[e] = 19595 * e,
  11575. z[e + 256 >> 0] = 38470 * e,
  11576. z[e + 512 >> 0] = 7471 * e + 32768,
  11577. z[e + 768 >> 0] = -11059 * e,
  11578. z[e + 1024 >> 0] = -21709 * e,
  11579. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11580. z[e + 1536 >> 0] = -27439 * e,
  11581. z[e + 1792 >> 0] = -5329 * e
  11582. }(),
  11583. x(e),
  11584. (new Date).getTime()
  11585. }
  11586. t.exports.encode = function(e, t) {
  11587. return (t = t || {}).quality = t.quality || 50,
  11588. {
  11589. data: new i(t.quality).encode(e, t),
  11590. width: e.width,
  11591. height: e.height
  11592. }
  11593. }
  11594. }
  11595. ).call(this, e("buffer").Buffer)
  11596. }
  11597. , {
  11598. buffer: 198
  11599. }],
  11600. 95: [function(e, t, i) {
  11601. "use strict";
  11602. !function() {
  11603. if ("performance"in window == 0 && (window.performance = {}),
  11604. Date.now = Date.now || function() {
  11605. return (new Date).getTime()
  11606. }
  11607. ,
  11608. "now"in window.performance == 0) {
  11609. var e = Date.now();
  11610. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11611. window.performance.now = function() {
  11612. return Date.now() - e
  11613. }
  11614. }
  11615. }()
  11616. }
  11617. , {}],
  11618. 96: [function(e, t, i) {
  11619. "use strict";
  11620. var a = e("three");
  11621. a.EffectComposer = function(e, t) {
  11622. if (this.renderer = e,
  11623. void 0 === t) {
  11624. var i = {
  11625. minFilter: a.LinearFilter,
  11626. magFilter: a.LinearFilter,
  11627. format: a.RGBAFormat,
  11628. stencilBuffer: !1
  11629. }
  11630. , n = e.getSize();
  11631. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11632. }
  11633. this.renderTarget1 = t,
  11634. this.renderTarget2 = t.clone(),
  11635. this.writeBuffer = this.renderTarget1,
  11636. this.readBuffer = this.renderTarget2,
  11637. this.passes = [],
  11638. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11639. this.copyPass = new a.ShaderPass(a.CopyShader)
  11640. }
  11641. ,
  11642. a.EffectComposer.prototype = {
  11643. swapBuffers: function() {
  11644. var e = this.readBuffer;
  11645. this.readBuffer = this.writeBuffer,
  11646. this.writeBuffer = e
  11647. },
  11648. addPass: function(e) {
  11649. this.passes.push(e)
  11650. },
  11651. insertPass: function(e, t) {
  11652. this.passes.splice(t, 0, e)
  11653. },
  11654. render: function(e) {
  11655. this.writeBuffer = this.renderTarget1,
  11656. this.readBuffer = this.renderTarget2;
  11657. var t, i, n = !1, r = this.passes.length;
  11658. for (i = 0; i < r; i++)
  11659. if ((t = this.passes[i]).enabled) {
  11660. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11661. t.needsSwap) {
  11662. if (n) {
  11663. var o = this.renderer.context;
  11664. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11665. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11666. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11667. }
  11668. this.swapBuffers()
  11669. }
  11670. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11671. }
  11672. },
  11673. reset: function(e) {
  11674. if (void 0 === e) {
  11675. var t = this.renderer.getSize();
  11676. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11677. }
  11678. this.renderTarget1.dispose(),
  11679. this.renderTarget2.dispose(),
  11680. this.renderTarget1 = e,
  11681. this.renderTarget2 = e.clone(),
  11682. this.writeBuffer = this.renderTarget1,
  11683. this.readBuffer = this.renderTarget2
  11684. },
  11685. setSize: function(e, t) {
  11686. this.renderTarget1.setSize(e, t),
  11687. this.renderTarget2.setSize(e, t)
  11688. }
  11689. }
  11690. }
  11691. , {
  11692. three: 217
  11693. }],
  11694. 97: [function(e, t, i) {
  11695. "use strict";
  11696. var n = e("three");
  11697. n.MaskPass = function(e, t) {
  11698. this.scene = e,
  11699. this.camera = t,
  11700. this.enabled = !0,
  11701. this.clear = !0,
  11702. this.needsSwap = !1,
  11703. this.inverse = !1
  11704. }
  11705. ,
  11706. n.MaskPass.prototype = {
  11707. render: function(e, t, i, n) {
  11708. var r, o, a = e.context;
  11709. a.colorMask(!1, !1, !1, !1),
  11710. a.depthMask(!1),
  11711. o = this.inverse ? (r = 0,
  11712. 1) : (r = 1,
  11713. 0),
  11714. a.enable(a.STENCIL_TEST),
  11715. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11716. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11717. a.clearStencil(o),
  11718. e.render(this.scene, this.camera, i, this.clear),
  11719. e.render(this.scene, this.camera, t, this.clear),
  11720. a.colorMask(!0, !0, !0, !0),
  11721. a.depthMask(!0),
  11722. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11723. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11724. }
  11725. },
  11726. n.ClearMaskPass = function() {
  11727. this.enabled = !0
  11728. }
  11729. ,
  11730. n.ClearMaskPass.prototype = {
  11731. render: function(e, t, i, n) {
  11732. var r = e.context;
  11733. r.disable(r.STENCIL_TEST)
  11734. }
  11735. }
  11736. }
  11737. , {
  11738. three: 217
  11739. }],
  11740. 98: [function(e, t, i) {
  11741. "use strict";
  11742. var o = e("three");
  11743. o.RenderPass = function(e, t, i, n, r) {
  11744. this.scene = e,
  11745. this.camera = t,
  11746. this.overrideMaterial = i,
  11747. this.clearColor = n,
  11748. this.clearAlpha = void 0 !== r ? r : 1,
  11749. this.oldClearColor = new o.Color,
  11750. this.oldClearAlpha = 1,
  11751. this.enabled = !0,
  11752. this.clear = !0,
  11753. this.needsSwap = !1
  11754. }
  11755. ,
  11756. o.RenderPass.prototype = {
  11757. render: function(e, t, i, n) {
  11758. this.scene.overrideMaterial = this.overrideMaterial,
  11759. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11760. this.oldClearAlpha = e.getClearAlpha(),
  11761. e.setClearColor(this.clearColor, this.clearAlpha)),
  11762. e.render(this.scene, this.camera, i, this.clear),
  11763. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11764. this.scene.overrideMaterial = null
  11765. }
  11766. }
  11767. }
  11768. , {
  11769. three: 217
  11770. }],
  11771. 99: [function(e, t, i) {
  11772. "use strict";
  11773. var n = e("three");
  11774. n.ShaderPass = function(e, t) {
  11775. this.textureID = void 0 !== t ? t : "tDiffuse",
  11776. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11777. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11778. this.material = new n.ShaderMaterial({
  11779. defines: e.defines || {},
  11780. uniforms: this.uniforms,
  11781. vertexShader: e.vertexShader,
  11782. fragmentShader: e.fragmentShader
  11783. })),
  11784. this.renderToScreen = !1,
  11785. this.enabled = !0,
  11786. this.needsSwap = !0,
  11787. this.clear = !1,
  11788. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11789. this.scene = new n.Scene,
  11790. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11791. this.scene.add(this.quad)
  11792. }
  11793. ,
  11794. n.ShaderPass.prototype = {
  11795. render: function(e, t, i, n) {
  11796. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11797. this.quad.material = this.material,
  11798. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11799. }
  11800. }
  11801. }
  11802. , {
  11803. three: 217
  11804. }],
  11805. 100: [function(e, t, i) {
  11806. "use strict";
  11807. e("three").CopyShader = {
  11808. uniforms: {
  11809. tDiffuse: {
  11810. type: "t",
  11811. value: null
  11812. },
  11813. opacity: {
  11814. type: "f",
  11815. value: 1
  11816. }
  11817. },
  11818. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11819. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11820. }
  11821. }
  11822. , {
  11823. three: 217
  11824. }],
  11825. 101: [function(e, t, i) {
  11826. "use strict";
  11827. e("three").HorizontalBlurShader = {
  11828. uniforms: {
  11829. tDiffuse: {
  11830. type: "t",
  11831. value: null
  11832. },
  11833. h: {
  11834. type: "f",
  11835. value: 1 / 512
  11836. }
  11837. },
  11838. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11839. 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")
  11840. }
  11841. }
  11842. , {
  11843. three: 217
  11844. }],
  11845. 102: [function(e, t, i) {
  11846. "use strict";
  11847. e("three").VerticalBlurShader = {
  11848. uniforms: {
  11849. tDiffuse: {
  11850. type: "t",
  11851. value: null
  11852. },
  11853. v: {
  11854. type: "f",
  11855. value: 1 / 512
  11856. }
  11857. },
  11858. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11859. 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")
  11860. }
  11861. }
  11862. , {
  11863. three: 217
  11864. }],
  11865. 103: [function(e, t, i) {
  11866. "use strict";
  11867. var z = e("three");
  11868. !function() {
  11869. if ("performance"in window == 0 && (window.performance = {}),
  11870. "now"in window.performance == 0) {
  11871. var e = Date.now();
  11872. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11873. window.performance.now = function() {
  11874. return Date.now() - e
  11875. }
  11876. }
  11877. }(),
  11878. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11879. var t, i = this.extensions, n = this.context;
  11880. if (e === z.RepeatWrapping)
  11881. return n.REPEAT;
  11882. if (e === z.ClampToEdgeWrapping)
  11883. return n.CLAMP_TO_EDGE;
  11884. if (e === z.MirroredRepeatWrapping)
  11885. return n.MIRRORED_REPEAT;
  11886. if (e === z.NearestFilter)
  11887. return n.NEAREST;
  11888. if (e === z.NearestMipMapNearestFilter)
  11889. return n.NEAREST_MIPMAP_NEAREST;
  11890. if (e === z.NearestMipMapLinearFilter)
  11891. return n.NEAREST_MIPMAP_LINEAR;
  11892. if (e === z.LinearFilter)
  11893. return n.LINEAR;
  11894. if (e === z.LinearMipMapNearestFilter)
  11895. return n.LINEAR_MIPMAP_NEAREST;
  11896. if (e === z.LinearMipMapLinearFilter)
  11897. return n.LINEAR_MIPMAP_LINEAR;
  11898. if (e === z.UnsignedByteType)
  11899. return n.UNSIGNED_BYTE;
  11900. if (e === z.UnsignedShort4444Type)
  11901. return n.UNSIGNED_SHORT_4_4_4_4;
  11902. if (e === z.UnsignedShort5551Type)
  11903. return n.UNSIGNED_SHORT_5_5_5_1;
  11904. if (e === z.UnsignedShort565Type)
  11905. return n.UNSIGNED_SHORT_5_6_5;
  11906. if (e === z.ByteType)
  11907. return n.BYTE;
  11908. if (e === z.ShortType)
  11909. return n.SHORT;
  11910. if (e === z.UnsignedShortType)
  11911. return n.UNSIGNED_SHORT;
  11912. if (e === z.IntType)
  11913. return n.INT;
  11914. if (e === z.UnsignedIntType)
  11915. return n.UNSIGNED_INT;
  11916. if (e === z.FloatType)
  11917. return n.FLOAT;
  11918. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11919. return t.HALF_FLOAT_OES;
  11920. if (e === z.AlphaFormat)
  11921. return n.ALPHA;
  11922. if (e === z.RGBFormat)
  11923. return n.RGB;
  11924. if (e === z.RGBAFormat)
  11925. return n.RGBA;
  11926. if (e === z.LuminanceFormat)
  11927. return n.LUMINANCE;
  11928. if (e === z.LuminanceAlphaFormat)
  11929. return n.LUMINANCE_ALPHA;
  11930. if (e === z.AddEquation)
  11931. return n.FUNC_ADD;
  11932. if (e === z.SubtractEquation)
  11933. return n.FUNC_SUBTRACT;
  11934. if (e === z.ReverseSubtractEquation)
  11935. return n.FUNC_REVERSE_SUBTRACT;
  11936. if (e === z.ZeroFactor)
  11937. return n.ZERO;
  11938. if (e === z.OneFactor)
  11939. return n.ONE;
  11940. if (e === z.SrcColorFactor)
  11941. return n.SRC_COLOR;
  11942. if (e === z.OneMinusSrcColorFactor)
  11943. return n.ONE_MINUS_SRC_COLOR;
  11944. if (e === z.SrcAlphaFactor)
  11945. return n.SRC_ALPHA;
  11946. if (e === z.OneMinusSrcAlphaFactor)
  11947. return n.ONE_MINUS_SRC_ALPHA;
  11948. if (e === z.DstAlphaFactor)
  11949. return n.DST_ALPHA;
  11950. if (e === z.OneMinusDstAlphaFactor)
  11951. return n.ONE_MINUS_DST_ALPHA;
  11952. if (e === z.DstColorFactor)
  11953. return n.DST_COLOR;
  11954. if (e === z.OneMinusDstColorFactor)
  11955. return n.ONE_MINUS_DST_COLOR;
  11956. if (e === z.SrcAlphaSaturateFactor)
  11957. return n.SRC_ALPHA_SATURATE;
  11958. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11959. if (e === z.RGB_S3TC_DXT1_Format)
  11960. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11961. if (e === z.RGBA_S3TC_DXT1_Format)
  11962. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11963. if (e === z.RGBA_S3TC_DXT3_Format)
  11964. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11965. if (e === z.RGBA_S3TC_DXT5_Format)
  11966. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11967. }
  11968. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11969. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11970. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11971. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11972. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11973. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11974. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11975. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11976. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11977. }
  11978. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11979. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11980. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11981. if (e === z.MinEquation)
  11982. return t.MIN_EXT;
  11983. if (e === z.MaxEquation)
  11984. return t.MAX_EXT
  11985. }
  11986. return 0
  11987. }
  11988. ,
  11989. z.WebGLState = function(l, i, c) {
  11990. var n = this
  11991. , r = new z.Vector4
  11992. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11993. , o = new Uint8Array(e)
  11994. , a = new Uint8Array(e)
  11995. , s = new Uint8Array(e)
  11996. , t = {}
  11997. , h = null
  11998. , u = null
  11999. , d = null
  12000. , p = null
  12001. , f = null
  12002. , g = null
  12003. , m = null
  12004. , v = null
  12005. , y = !1
  12006. , A = null
  12007. , C = null
  12008. , I = null
  12009. , E = null
  12010. , _ = null
  12011. , b = null
  12012. , w = null
  12013. , T = null
  12014. , x = null
  12015. , S = null
  12016. , M = null
  12017. , R = null
  12018. , P = null
  12019. , O = null
  12020. , L = null
  12021. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12022. , N = void 0
  12023. , F = {}
  12024. , B = new z.Vector4
  12025. , V = null
  12026. , k = null
  12027. , U = new z.Vector4
  12028. , H = new z.Vector4;
  12029. this.init = function() {
  12030. this.clearColor(0, 0, 0, 1),
  12031. this.clearDepth(1),
  12032. this.clearStencil(0),
  12033. this.enable(l.DEPTH_TEST),
  12034. l.depthFunc(l.LEQUAL),
  12035. l.frontFace(l.CCW),
  12036. l.cullFace(l.BACK),
  12037. this.enable(l.CULL_FACE),
  12038. this.enable(l.BLEND),
  12039. l.blendEquation(l.FUNC_ADD),
  12040. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12041. }
  12042. ,
  12043. this.initAttributes = function() {
  12044. for (var e = 0, t = o.length; e < t; e++)
  12045. o[e] = 0
  12046. }
  12047. ,
  12048. this.enableAttribute = function(e) {
  12049. o[e] = 1,
  12050. 0 === a[e] && (l.enableVertexAttribArray(e),
  12051. a[e] = 1),
  12052. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12053. s[e] = 0)
  12054. }
  12055. ,
  12056. this.enableAttributeAndDivisor = function(e, t, i) {
  12057. o[e] = 1,
  12058. 0 === a[e] && (l.enableVertexAttribArray(e),
  12059. a[e] = 1),
  12060. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12061. s[e] = t)
  12062. }
  12063. ,
  12064. this.disableUnusedAttributes = function() {
  12065. for (var e = 0, t = a.length; e < t; e++)
  12066. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12067. a[e] = 0)
  12068. }
  12069. ,
  12070. this.enable = function(e) {
  12071. !0 !== t[e] && (l.enable(e),
  12072. t[e] = !0)
  12073. }
  12074. ,
  12075. this.disable = function(e) {
  12076. !1 !== t[e] && (l.disable(e),
  12077. t[e] = !1)
  12078. }
  12079. ,
  12080. this.getCompressedTextureFormats = function() {
  12081. if (null === h && (h = [],
  12082. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12083. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12084. h.push(e[t]);
  12085. return h
  12086. }
  12087. ,
  12088. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12089. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12090. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12091. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12092. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12093. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12094. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12095. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12096. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12097. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12098. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12099. u = e,
  12100. y = s),
  12101. e === z.CustomBlending ? (r = r || t,
  12102. o = o || i,
  12103. a = a || n,
  12104. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12105. d = t,
  12106. g = r),
  12107. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12108. p = i,
  12109. f = n,
  12110. m = o,
  12111. v = a)) : v = m = g = f = p = d = null
  12112. }
  12113. ,
  12114. this.setDepthFunc = function(e) {
  12115. if (A !== e) {
  12116. if (e)
  12117. switch (e) {
  12118. case z.NeverDepth:
  12119. l.depthFunc(l.NEVER);
  12120. break;
  12121. case z.AlwaysDepth:
  12122. l.depthFunc(l.ALWAYS);
  12123. break;
  12124. case z.LessDepth:
  12125. l.depthFunc(l.LESS);
  12126. break;
  12127. case z.LessEqualDepth:
  12128. l.depthFunc(l.LEQUAL);
  12129. break;
  12130. case z.EqualDepth:
  12131. l.depthFunc(l.EQUAL);
  12132. break;
  12133. case z.GreaterEqualDepth:
  12134. l.depthFunc(l.GEQUAL);
  12135. break;
  12136. case z.GreaterDepth:
  12137. l.depthFunc(l.GREATER);
  12138. break;
  12139. case z.NotEqualDepth:
  12140. l.depthFunc(l.NOTEQUAL);
  12141. break;
  12142. default:
  12143. l.depthFunc(l.LEQUAL)
  12144. }
  12145. else
  12146. l.depthFunc(l.LEQUAL);
  12147. A = e
  12148. }
  12149. }
  12150. ,
  12151. this.setDepthTest = function(e) {
  12152. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12153. }
  12154. ,
  12155. this.setDepthWrite = function(e) {
  12156. C !== e && (l.depthMask(e),
  12157. C = e)
  12158. }
  12159. ,
  12160. this.setColorWrite = function(e) {
  12161. I !== e && (l.colorMask(e, e, e, e),
  12162. I = e)
  12163. }
  12164. ,
  12165. this.setStencilFunc = function(e, t, i) {
  12166. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12167. _ = e,
  12168. b = t,
  12169. w = i)
  12170. }
  12171. ,
  12172. this.setStencilOp = function(e, t, i) {
  12173. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12174. T = e,
  12175. x = t,
  12176. S = i)
  12177. }
  12178. ,
  12179. this.setStencilTest = function(e) {
  12180. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12181. }
  12182. ,
  12183. this.setStencilWrite = function(e) {
  12184. E !== e && (l.stencilMask(e),
  12185. E = e)
  12186. }
  12187. ,
  12188. this.setFlipSided = function(e) {
  12189. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12190. M = e)
  12191. }
  12192. ,
  12193. this.setLineWidth = function(e) {
  12194. e !== R && (l.lineWidth(e),
  12195. R = e)
  12196. }
  12197. ,
  12198. this.setPolygonOffset = function(e, t, i) {
  12199. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12200. !e || P === t && O === i || (l.polygonOffset(t, i),
  12201. P = t,
  12202. O = i)
  12203. }
  12204. ,
  12205. this.getScissorTest = function() {
  12206. return L
  12207. }
  12208. ,
  12209. this.setScissorTest = function(e) {
  12210. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12211. }
  12212. ,
  12213. this.activeTexture = function(e) {
  12214. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12215. N !== e && (l.activeTexture(e),
  12216. N = e)
  12217. }
  12218. ,
  12219. this.bindTexture = function(e, t) {
  12220. void 0 === N && n.activeTexture();
  12221. var i = F[N];
  12222. void 0 === i && (i = {
  12223. type: void 0,
  12224. texture: void 0
  12225. },
  12226. F[N] = i),
  12227. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12228. i.type = e,
  12229. i.texture = t)
  12230. }
  12231. ,
  12232. this.compressedTexImage2D = function() {
  12233. try {
  12234. l.compressedTexImage2D.apply(l, arguments)
  12235. } catch (e) {
  12236. console.error(e)
  12237. }
  12238. }
  12239. ,
  12240. this.texImage2D = function() {
  12241. try {
  12242. l.texImage2D.apply(l, arguments)
  12243. } catch (e) {
  12244. console.error(e)
  12245. }
  12246. }
  12247. ,
  12248. this.clearColor = function(e, t, i, n) {
  12249. r.set(e, t, i, n),
  12250. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12251. B.copy(r))
  12252. }
  12253. ,
  12254. this.clearDepth = function(e) {
  12255. V !== e && (l.clearDepth(e),
  12256. V = e)
  12257. }
  12258. ,
  12259. this.clearStencil = function(e) {
  12260. k !== e && (l.clearStencil(e),
  12261. k = e)
  12262. }
  12263. ,
  12264. this.scissor = function(e) {
  12265. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12266. U.copy(e))
  12267. }
  12268. ,
  12269. this.viewport = function(e) {
  12270. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12271. H.copy(e))
  12272. }
  12273. ,
  12274. this.reset = function() {
  12275. for (var e = 0; e < a.length; e++)
  12276. 1 === a[e] && (l.disableVertexAttribArray(e),
  12277. a[e] = 0);
  12278. t = {},
  12279. N = void 0,
  12280. F = {},
  12281. M = E = C = I = u = h = null
  12282. }
  12283. }
  12284. }
  12285. , {
  12286. three: 217
  12287. }],
  12288. 104: [function(a, h, e) {
  12289. (function(i, e) {
  12290. "use strict";
  12291. function t(e) {
  12292. this.urls = e;
  12293. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12294. this.builder = n.loadProto(t),
  12295. this.decoder = this.builder.build("binary_mesh")
  12296. }
  12297. var s = a("three")
  12298. , n = a("protobufjs")
  12299. , r = a("../util/logger")
  12300. , o = (a("../util/common"),
  12301. a("../util/ajax"))
  12302. , l = a("../objects/Chunk")
  12303. , c = new r(e);
  12304. t.prototype = {
  12305. constructor: t,
  12306. load: function(t, i, n, r) {
  12307. return c.time("download"),
  12308. o.get(t, {
  12309. responseType: "arraybuffer"
  12310. }).done(function(e) {
  12311. c.timeEnd("download"),
  12312. this.parse(e, t, i, n, r)
  12313. }
  12314. .bind(this)).fail(r)
  12315. },
  12316. parse: function(e, t, i, n, r) {
  12317. var o = this.readProtobuf(e);
  12318. if (!o)
  12319. return r();
  12320. try {
  12321. c.time("convert to webgl"),
  12322. this.convertProtobufToSceneObject(o, t, i, n, r),
  12323. c.timeEnd("convert to webgl")
  12324. } catch (e) {
  12325. return c.error("failed parsing .dam"),
  12326. c.error(e.message),
  12327. r()
  12328. }
  12329. },
  12330. readProtobuf: function(e) {
  12331. var t;
  12332. try {
  12333. c.time("parse proto"),
  12334. t = this.decoder.decode(e),
  12335. c.timeEnd("parse proto")
  12336. } catch (e) {
  12337. return c.error("failed parsing proto for .dam"),
  12338. c.error(e.message),
  12339. null
  12340. }
  12341. return t
  12342. },
  12343. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12344. if (0 === e.chunk.length)
  12345. return c.warn("No chunks in damfile..."),
  12346. t([]);
  12347. var o = new s.Matrix4;
  12348. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12349. var a = e.chunk.map(function(e) {
  12350. var t = new s.BufferGeometry;
  12351. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12352. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12353. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12354. t.applyMatrix(o),
  12355. t.computeBoundingBox(),
  12356. new l({
  12357. geometry: t,
  12358. textureName: e.material_name,
  12359. name: e.chunk_name,
  12360. meshUrl: i
  12361. })
  12362. });
  12363. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12364. r())
  12365. }
  12366. },
  12367. h.exports = t
  12368. }
  12369. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12370. }
  12371. , {
  12372. "../objects/Chunk": 144,
  12373. "../util/ajax": 181,
  12374. "../util/common": 185,
  12375. "../util/logger": 189,
  12376. buffer: 198,
  12377. protobufjs: 214,
  12378. three: 217
  12379. }],
  12380. 105: [function(n, r, e) {
  12381. (function(e) {
  12382. "use strict";
  12383. var t = (n("three"),
  12384. n("../settings"),
  12385. n("../util/browser"),
  12386. n("./DamLoader"))
  12387. , i = n("../util/logger")
  12388. , u = (n("../ab"),
  12389. new i(e));
  12390. r.exports = {
  12391. getLoaders: function() {
  12392. return [["_50k", ".dam", t], ["", ".dam", t]]
  12393. },
  12394. load: function(e, t, i, n, r, o) {
  12395. var a = this.getLoaders()[o = o || 0];
  12396. if (a) {
  12397. var s = a[0]
  12398. , l = a[1]
  12399. , c = new a[2](t)
  12400. , h = t.get(e + s + l);
  12401. h ? (u.debug("Trying " + s + l),
  12402. c.load(h, i, n, function() {
  12403. this.load(e, t, i, n, r, ++o)
  12404. }
  12405. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12406. this.load(e, t, i, n, r, ++o))
  12407. } else
  12408. r && r("No suitable model file found...")
  12409. }
  12410. }
  12411. }
  12412. ).call(this, "/js/loaders/ModelLoader.js")
  12413. }
  12414. , {
  12415. "../ab": 3,
  12416. "../settings": 166,
  12417. "../util/browser": 182,
  12418. "../util/logger": 189,
  12419. "./DamLoader": 104,
  12420. three: 217
  12421. }],
  12422. 106: [function(i, n, e) {
  12423. (function(e) {
  12424. "use strict";
  12425. var l = i("../util/common")
  12426. , c = i("../util/texture")
  12427. , h = i("../util/browser")
  12428. , t = i("../util/logger")
  12429. , u = i("../settings")
  12430. , d = new t(e);
  12431. n.exports = {
  12432. load: function(i, n) {
  12433. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12434. return $.when();
  12435. var r = l.countUnique(i.chunks.map(function(e) {
  12436. return e.textureName
  12437. }))
  12438. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12439. , t = "_50k" == e ? "high" : "low";
  12440. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12441. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12442. t = "low"));
  12443. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12444. , a = $.Deferred()
  12445. , s = 0;
  12446. return i.chunks.forEach(function(e) {
  12447. if (!e.material.map && e.textureName) {
  12448. var t = i.urls.get(o + e.textureName);
  12449. e.setTextureMap(c.load(t, function(e, t) {
  12450. e || (n.push(t),
  12451. s++,
  12452. a.notify(s, r),
  12453. s === r && a.resolve())
  12454. }
  12455. .bind(this, c.isLoaded(t))))
  12456. }
  12457. }),
  12458. a.promise()
  12459. }
  12460. }
  12461. }
  12462. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12463. }
  12464. , {
  12465. "../settings": 166,
  12466. "../util/browser": 182,
  12467. "../util/common": 185,
  12468. "../util/logger": 189,
  12469. "../util/texture": 194
  12470. }],
  12471. 107: [function(s, l, e) {
  12472. (function(n, e) {
  12473. "use strict";
  12474. function t(e) {
  12475. this.model = e,
  12476. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12477. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12478. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12479. , i = r.loadProto(t);
  12480. this.decoder = i.build("VisionModeldata")
  12481. }
  12482. var r = s("protobufjs")
  12483. , i = s("../util/ajax")
  12484. , o = (s("../util/common"),
  12485. s("../util/math"))
  12486. , a = new (s("../util/logger"))(e);
  12487. t.prototype.load = function() {
  12488. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12489. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12490. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12491. $.when([]))
  12492. }
  12493. ,
  12494. t.prototype.loadVisionModelData = function() {
  12495. return i.get(this.modelDataPath, {
  12496. responseType: "arraybuffer"
  12497. }).then(function(e) {
  12498. var t;
  12499. try {
  12500. t = this.decoder.decode(e)
  12501. } catch (e) {
  12502. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12503. this.loadSweepLocationsCSV()
  12504. }
  12505. var i = t.sweepLocations.map(function(e) {
  12506. return {
  12507. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12508. position: {
  12509. x: e.pose.translation.x,
  12510. y: e.pose.translation.y,
  12511. z: e.pose.translation.z
  12512. },
  12513. quaternion: {
  12514. x: e.pose.rotation.x,
  12515. y: e.pose.rotation.y,
  12516. z: e.pose.rotation.z,
  12517. w: e.pose.rotation.w
  12518. },
  12519. puck: {
  12520. x: e.puck.x,
  12521. y: e.puck.y,
  12522. z: e.puck.z
  12523. },
  12524. floor: e.group,
  12525. neighbours: e.visibles,
  12526. alignmentType: e.alignment_type
  12527. }
  12528. }).map(function(e) {
  12529. return e.position = o.convertVisionVector(e.position),
  12530. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12531. e.puck = o.convertVisionVector(e.puck),
  12532. e
  12533. });
  12534. return i.forEach(function(e) {
  12535. e.neighbours = e.neighbours.map(function(e) {
  12536. return i[e].uuid
  12537. })
  12538. }),
  12539. i
  12540. }
  12541. .bind(this), function() {
  12542. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12543. this.loadSweepLocationsCSV()
  12544. }
  12545. .bind(this))
  12546. }
  12547. ,
  12548. t.prototype.loadSweepLocationsCSV = function() {
  12549. return i.get(this.sweepLocationsPath).then(function(e) {
  12550. return e.split("\n").map(function(e) {
  12551. return e.split(", ")
  12552. }).filter(function(e) {
  12553. return 1 < e.length
  12554. }).map(function(e) {
  12555. return {
  12556. uuid: e[0],
  12557. position: {
  12558. x: parseFloat(e[1]),
  12559. y: parseFloat(e[2]),
  12560. z: parseFloat(e[3])
  12561. },
  12562. quaternion: {
  12563. x: parseFloat(e[4]),
  12564. y: parseFloat(e[5]),
  12565. z: parseFloat(e[6]),
  12566. w: parseFloat(e[7])
  12567. }
  12568. }
  12569. }).map(function(e) {
  12570. return e.position = o.convertVisionVector(e.position),
  12571. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12572. e
  12573. })
  12574. }).fail(function() {
  12575. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12576. })
  12577. }
  12578. ,
  12579. l.exports = t
  12580. }
  12581. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12582. }
  12583. , {
  12584. "../util/ajax": 181,
  12585. "../util/common": 185,
  12586. "../util/logger": 189,
  12587. "../util/math": 190,
  12588. buffer: 198,
  12589. protobufjs: 214
  12590. }],
  12591. 108: [function(s, l, e) {
  12592. (function(e) {
  12593. "use strict";
  12594. function t() {
  12595. this.locale = null
  12596. }
  12597. var i = s("../settings")
  12598. , n = s("../util/common")
  12599. , r = s("../util/logger")
  12600. , o = s("../enum/Locale")
  12601. , a = new r(e);
  12602. t.prototype.init = function() {
  12603. var e;
  12604. switch (i.languageTag) {
  12605. case null:
  12606. case "en":
  12607. case o.EN_US:
  12608. this.locale = o.EN_US,
  12609. e = s("./strings-en-US");
  12610. break;
  12611. case "es":
  12612. case o.ES_MX:
  12613. this.locale = o.ES_MX,
  12614. e = s("./strings-es-MX");
  12615. break;
  12616. case "fr":
  12617. case o.FR_FR:
  12618. this.locale = o.FR_FR,
  12619. e = s("./strings-fr-FR");
  12620. break;
  12621. case "de":
  12622. case o.DE_DE:
  12623. this.locale = o.DE_DE,
  12624. e = s("./strings-de-DE");
  12625. break;
  12626. case "ru":
  12627. case o.RU_RU:
  12628. this.locale = o.RU_RU,
  12629. e = s("./strings-ru-RU");
  12630. break;
  12631. case "cn":
  12632. case o.CN_CN:
  12633. this.locale = o.CN_CN,
  12634. e = s("./strings-cn-CN");
  12635. break;
  12636. case "jp":
  12637. case o.JP_JP:
  12638. this.locale = o.JP_JP,
  12639. e = s("./strings-jp-JP");
  12640. break;
  12641. default:
  12642. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12643. this.locale = o.EN_US,
  12644. e = s("./strings-en-US")
  12645. }
  12646. a.info("Using locale '" + this.locale + "'"),
  12647. n.extendObject(this, e)
  12648. }
  12649. ,
  12650. t.prototype.localizeGUI = function() {
  12651. var e = document.querySelector("#gui-parent");
  12652. this.localizeTree(e),
  12653. this.localizeLoadingText()
  12654. }
  12655. ,
  12656. t.prototype.localizeLoadingText = function() {
  12657. document.querySelector("#help-dialog").classList.add(this.locale),
  12658. document.querySelector("#interaction-modal").classList.add(this.locale),
  12659. document.querySelector("#gui").classList.add(this.locale)
  12660. }
  12661. ,
  12662. t.prototype.localizeTree = function(e) {
  12663. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12664. if (e.nodeType === Node.TEXT_NODE)
  12665. (t = e.data.match(n)) && (i = t[1],
  12666. e.data = this.localizeText(i) || i);
  12667. else if (e.nodeType === Node.ELEMENT_NODE) {
  12668. var r = e.getAttribute("title");
  12669. r && ((t = r.match(n)) && (i = t[1],
  12670. e.setAttribute("title", this.localizeText(i) || i)))
  12671. }
  12672. for (e = e.firstChild; e; )
  12673. this.localizeTree(e),
  12674. e = e.nextSibling
  12675. }
  12676. ,
  12677. t.prototype.localizeText = function(e) {
  12678. var t = this[e];
  12679. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12680. t = s("./strings-en-US")[e]),
  12681. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12682. t
  12683. }
  12684. ,
  12685. l.exports = new t
  12686. }
  12687. ).call(this, "/js/localization/localize.js")
  12688. }
  12689. , {
  12690. "../enum/Locale": 31,
  12691. "../settings": 166,
  12692. "../util/common": 185,
  12693. "../util/logger": 189,
  12694. "./strings-cn-CN": 109,
  12695. "./strings-de-DE": 110,
  12696. "./strings-en-US": 111,
  12697. "./strings-es-MX": 112,
  12698. "./strings-fr-FR": 113,
  12699. "./strings-jp-JP": 114,
  12700. "./strings-ru-RU": 115
  12701. }],
  12702. 109: [function(e, t, i) {
  12703. "use strict";
  12704. t.exports = {
  12705. PAGE_TITLE: "",
  12706. LOADING: "正在加载",
  12707. PRESENTED_BY_CAPS: "呈现者:",
  12708. POWERED_BY: "技术支持:",
  12709. POWERED_BY_CAPS: "技术支持:",
  12710. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12711. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12712. PRESENTED_BY: "呈现者:",
  12713. MORE: "更多 ",
  12714. LESS: "更少 ",
  12715. TAG_CONTENT: "tag™ 内容",
  12716. SHOW: "显示",
  12717. HIDE: "隐藏",
  12718. DOLLHOUSE: "场景屋",
  12719. FLOOR_PLAN: "楼层平面图",
  12720. OPEN_HIGHLIGHTS: "打开精彩片段",
  12721. CLOSE_HIGHLIGHTS: "关闭",
  12722. PREVIOUS: "上一个",
  12723. PLAY: "播放",
  12724. PAUSE: "暂停",
  12725. NEXT: "下一个",
  12726. EXPLORE_3D_SPACE: "探索 3D 空间",
  12727. VIEW_DOLLHOUSE: "观看场景屋",
  12728. SOCIAL_SHARING: "分享这个空间",
  12729. VIEW_IN_VR: "以 VR 观看",
  12730. VIEW_FULLSCREEN: "全屏观看",
  12731. EXIT_FULLSCREEN: " 退出全屏",
  12732. ZOOM_IN: "放大",
  12733. ZOOM_OUT: "缩小",
  12734. FLOOR_NAME: "楼层",
  12735. FLOOR_ALL: "ALL",
  12736. FLOOR_Lang: ["Floor", ""],
  12737. TERMS: "条款",
  12738. PORT_TERMS: "port 条款",
  12739. TERMS_OF_USE: "使用条款",
  12740. CLOSE_TERMS: "关闭",
  12741. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12742. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12743. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12744. WEBVR_ENTER_WEBVR: "进入 VR",
  12745. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12746. WEBVR_LEARN_MORE: "了解更多",
  12747. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12748. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12749. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12750. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12751. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12752. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12753. VR_LEARN_MORE_CAPS: "了解更多",
  12754. VR_PREVIOUS_CAPS: "上一个’,",
  12755. VR_NEXT_CAPS: "下一个",
  12756. VR_GOT_IT_CAPS: "明白了",
  12757. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12758. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12759. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12760. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12761. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12762. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12763. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12764. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12765. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12766. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12767. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12768. VR_APP: "port VR 应用程序",
  12769. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12770. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12771. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12772. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12773. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12774. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12775. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12776. VR_ANDROID_DVICES: "Android 设备",
  12777. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12778. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12779. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12780. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12781. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12782. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12783. VR_DOWNLOAD_HERE: "在此下载",
  12784. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12785. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12786. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12787. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12788. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12789. SHARE_TO: "分享到",
  12790. SHARE_LINK: "直接链接",
  12791. SHARE_EXPLORE: "探索",
  12792. SHARE_AT: "在",
  12793. SHARE_WITH: "使用",
  12794. SHARE_3D: "以 3D",
  12795. SHARE_COPIED: "已复制!",
  12796. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12797. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12798. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12799. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12800. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12801. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12802. ERROR_GENERIC_ACTIONS_3: " 或",
  12803. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12804. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12805. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12806. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12807. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12808. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12809. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12810. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12811. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12812. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12813. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12814. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12815. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12816. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12817. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12818. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12819. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12820. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12821. LINK_TO_LOCATION: "地点链接",
  12822. MENU_COPY: "复制",
  12823. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12824. ROTATE: "旋转",
  12825. MOVE: "移动",
  12826. INSIDE: "内部",
  12827. ZOOM: "缩放",
  12828. HELP: "小帮手",
  12829. HELP_NAVIGATION_TAB: "导航",
  12830. HELP_MORE_HELP_TAB: "更多帮助",
  12831. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12832. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12833. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12834. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12835. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12836. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12837. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12838. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12839. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12840. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12841. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12842. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12843. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12844. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12845. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12846. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12847. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12848. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12849. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12850. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12851. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12852. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12853. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12854. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12855. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12856. HELP_MORE_HLR_A: "精彩片段集锦",
  12857. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12858. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12859. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12860. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12861. HELP_MORE_FLOORS_A: "楼层选择器",
  12862. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12863. HELP_MORE_TAG_A: "tag™ 贴文",
  12864. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12865. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12866. HELP_MORE_ZOOM_A: "缩放控件",
  12867. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12868. HELP_MORE_TOUR_A: "导览控件",
  12869. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12870. HELP_MORE_INSIDE_A: "内部视图",
  12871. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12872. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12873. HELP_MORE_VR_A: "VR 模式",
  12874. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12875. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12876. HELP_MORE_360_A: "360° 视图",
  12877. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12878. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12879. HELP_MORE_FULLSCREEN_A: "全屏",
  12880. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12881. CLOSE: "关闭"
  12882. }
  12883. }
  12884. , {}],
  12885. 110: [function(e, t, i) {
  12886. "use strict";
  12887. t.exports = {
  12888. PAGE_TITLE: "",
  12889. LOADING: "Lädt",
  12890. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12891. POWERED_BY: "Angetrieben von",
  12892. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12893. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12894. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12895. PRESENTED_BY: "Präsentiert von ",
  12896. MORE: "Mehr ",
  12897. LESS: "Weniger ",
  12898. TAG_CONTENT: "tag™ Inhalt",
  12899. SHOW: "Anzeigen",
  12900. HIDE: "Verbergen",
  12901. DOLLHOUSE: "Puppenhaus",
  12902. FLOOR_PLAN: "Grundriss",
  12903. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12904. CLOSE_HIGHLIGHTS: "Schließen",
  12905. PREVIOUS: "Vorheriges",
  12906. PLAY: "Abspielen",
  12907. PAUSE: "Pausieren",
  12908. NEXT: "Nächstes",
  12909. EXPLORE_3D_SPACE: "Innenraum betreten",
  12910. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12911. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12912. VIEW_IN_VR: "In VR ansehen",
  12913. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12914. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12915. ZOOM_IN: "Vergrößern",
  12916. ZOOM_OUT: "Verkleinern",
  12917. FLOOR_NAME: "Etage ",
  12918. FLOOR_ALL: "Alle",
  12919. TERMS: "Bedingungen",
  12920. PORT_TERMS: "port Bedingungen",
  12921. TERMS_OF_USE: "Nutzungsbedingungen",
  12922. TERMS_TEXT_FILE: "terms-de-DE.html",
  12923. CLOSE_TERMS: "Schließen",
  12924. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12925. HELP: "Hilfe",
  12926. HELP_NAVIGATION_TAB: "Navigation",
  12927. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12928. CLOSE: "Schließen",
  12929. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12930. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12931. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12932. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12933. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12934. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12935. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12936. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12937. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12938. 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.",
  12939. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12940. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12941. 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.",
  12942. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12943. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12944. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12945. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12946. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12947. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12948. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12949. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12950. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12951. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12952. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12953. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12954. HELP_MORE_HLR_A: "Liste das Highlight",
  12955. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12956. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12957. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12958. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12959. HELP_MORE_FLOORS_A: "Etage auswählen",
  12960. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12961. HELP_MORE_TAG_A: "tag™ Posts",
  12962. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12963. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12964. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12965. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12966. HELP_MORE_TOUR_A: "Tour Steuerung",
  12967. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12968. HELP_MORE_INSIDE_A: "Innenansicht",
  12969. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12970. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12971. HELP_MORE_VR_A: "VR Modus",
  12972. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12973. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12974. HELP_MORE_360_A: "360° Views Ansicht ",
  12975. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12976. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12977. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12978. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12979. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12980. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12981. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12982. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12983. WEBVR_LEARN_MORE: "Mehr Infos",
  12984. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12985. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12986. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12987. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12988. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12989. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12990. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12991. VR_APP: "port VR App",
  12992. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12993. 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",
  12994. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12995. VR_APP_FOR_ANDROID: "port VR app für Android",
  12996. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12997. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12998. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12999. VR_PREVIOUS_CAPS: "ZURÜCK",
  13000. VR_NEXT_CAPS: "WEITER",
  13001. VR_GOT_IT_CAPS: "VERSTANDEN",
  13002. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13003. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13004. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13005. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13006. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13007. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13008. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13009. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13010. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13011. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13012. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13013. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13014. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13015. VR_ANDROID_DVICES: "Android Geräte",
  13016. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13017. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13018. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13019. VR_DOWNLOAD_HERE: "Hier runterladen",
  13020. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13021. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13022. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13023. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13024. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13025. SHARE_TO: "Teilen auf",
  13026. SHARE_LINK: "Direkter Link",
  13027. SHARE_EXPLORE: "Umsehen",
  13028. SHARE_AT: "auf",
  13029. SHARE_WITH: "mit",
  13030. SHARE_3D: "in 3D",
  13031. SHARE_COPIED: "Kopiert!",
  13032. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13033. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13034. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13035. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13036. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13037. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13038. ERROR_GENERIC_ACTIONS_3: " oder ",
  13039. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13040. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13041. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13042. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13043. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13044. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13045. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13046. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13047. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13048. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13049. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13050. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13051. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13052. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13053. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13054. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13055. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13056. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13057. LINK_TO_LOCATION: "Link zu",
  13058. MENU_COPY: "Kopieren",
  13059. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13060. ROTATE: "Drehen",
  13061. INSIDE: "Drinnen",
  13062. MOVE: "Bewegen",
  13063. ZOOM: "Vergrößern"
  13064. }
  13065. }
  13066. , {}],
  13067. 111: [function(e, t, i) {
  13068. "use strict";
  13069. t.exports = {
  13070. PAGE_TITLE: "",
  13071. LOADING: "Loading",
  13072. PRESENTED_BY_CAPS: "PRESENTED BY",
  13073. POWERED_BY: "powered by ",
  13074. POWERED_BY_CAPS: "POWERED BY",
  13075. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13076. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13077. PRESENTED_BY: "Presented by ",
  13078. MORE: "More ",
  13079. LESS: "Less ",
  13080. TAG_CONTENT: "tag™ Content",
  13081. SHOW: "Show",
  13082. HIDE: "Hide",
  13083. DOLLHOUSE: "Dollhouse",
  13084. FLOOR_PLAN: "Floor plan",
  13085. OPEN_HIGHLIGHTS: "Open Highlights",
  13086. CLOSE_HIGHLIGHTS: "Close",
  13087. PREVIOUS: "Previous",
  13088. PLAY: "Play",
  13089. PAUSE: "Pause",
  13090. NEXT: "Next",
  13091. EXPLORE_3D_SPACE: "Explore 3D Space",
  13092. VIEW_DOLLHOUSE: "View dollhouse",
  13093. SOCIAL_SHARING: "Share this Space",
  13094. VIEW_IN_VR: "View in VR",
  13095. VIEW_FULLSCREEN: "全屏",
  13096. EXIT_FULLSCREEN: "退出全屏",
  13097. ZOOM_IN: "Zoom in",
  13098. ZOOM_OUT: "Zoom out",
  13099. FLOOR_NAME: "Floor ",
  13100. FLOOR_ALL: "全部",
  13101. TERMS: "Terms",
  13102. PORT_TERMS: "port terms",
  13103. TERMS_OF_USE: "Terms of Use",
  13104. TERMS_TEXT_FILE: "terms-en-US.html",
  13105. CLOSE_TERMS: "Close",
  13106. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13107. HELP: "Help",
  13108. HELP_NAVIGATION_TAB: "Navigation",
  13109. HELP_MORE_HELP_TAB: "More Help",
  13110. CLOSE: "Close",
  13111. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13112. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13113. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13114. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13115. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13116. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13117. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13118. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13119. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13120. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13121. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13122. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13123. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13124. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13125. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13126. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13127. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13128. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13129. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13130. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13131. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13132. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13133. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13134. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13135. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13136. HELP_MORE_HLR_A: "Highlight Reel",
  13137. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13138. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13139. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13140. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13141. HELP_MORE_FLOORS_A: "Floor Selector",
  13142. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13143. HELP_MORE_TAG_A: "tag™ Posts",
  13144. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13145. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13146. HELP_MORE_ZOOM_A: "Zoom Controls",
  13147. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13148. HELP_MORE_TOUR_A: "Tour Controls",
  13149. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13150. HELP_MORE_INSIDE_A: "Inside View",
  13151. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13152. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13153. HELP_MORE_VR_A: "VR Mode",
  13154. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13155. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13156. HELP_MORE_360_A: "360° Views",
  13157. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13158. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13159. HELP_MORE_FULLSCREEN_A: "Full screen",
  13160. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13161. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13162. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13163. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13164. WEBVR_ENTER_WEBVR: "ENTER VR",
  13165. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13166. WEBVR_LEARN_MORE: "Learn more",
  13167. WEBVR_VIEW_SPACE: "View Space in VR",
  13168. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13169. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13170. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13171. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13172. VR_PREVIOUS_CAPS: "PREVIOUS",
  13173. VR_NEXT_CAPS: "NEXT",
  13174. VR_GOT_IT_CAPS: "GOT IT",
  13175. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13176. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13177. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13178. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13179. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13180. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13181. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13182. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13183. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13184. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13185. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13186. VR_APP: "port VR App",
  13187. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13188. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13189. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13190. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13191. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13192. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13193. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13194. VR_ANDROID_DVICES: "Android Devices",
  13195. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13196. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13197. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13198. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13199. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13200. VR_APP_OPEN: "Open with the port VR app instead",
  13201. VR_DOWNLOAD_HERE: "Download here",
  13202. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13203. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13204. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13205. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13206. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13207. SHARE_TO: "Share to",
  13208. SHARE_LINK: "Direct Link",
  13209. SHARE_EXPLORE: "Explore ",
  13210. SHARE_AT: "at",
  13211. SHARE_WITH: "with",
  13212. SHARE_3D: " in 3D",
  13213. SHARE_COPIED: "Copied!",
  13214. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13215. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13216. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13217. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13218. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13219. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13220. ERROR_GENERIC_ACTIONS_3: " or ",
  13221. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13222. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13223. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13224. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13225. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13226. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13227. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13228. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13229. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13230. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13231. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13232. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13233. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13234. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13235. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13236. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13237. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13238. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13239. LINK_TO_LOCATION: "Link to location",
  13240. MENU_COPY: "Copy",
  13241. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13242. ROTATE: "Rotate",
  13243. INSIDE: "Inside",
  13244. MOVE: "Move",
  13245. ZOOM: "Zoom"
  13246. }
  13247. }
  13248. , {}],
  13249. 112: [function(e, t, i) {
  13250. "use strict";
  13251. t.exports = {
  13252. PAGE_TITLE: "",
  13253. LOADING: "Cargando",
  13254. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13255. POWERED_BY: "potenciando por ",
  13256. POWERED_BY_CAPS: "POTENCIADO POR ",
  13257. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13258. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13259. PRESENTED_BY: "Presentado por ",
  13260. MORE: "Más ",
  13261. LESS: "Menos ",
  13262. TAG_CONTENT: "Contenido de tag™",
  13263. SHOW: "Mostrar",
  13264. HIDE: "Ocultar",
  13265. DOLLHOUSE: "Dollhouse",
  13266. FLOOR_PLAN: "Planos",
  13267. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13268. CLOSE_HIGHLIGHTS: "Cerrar",
  13269. PREVIOUS: "Anterior",
  13270. PLAY: "Play",
  13271. PAUSE: "Pausa",
  13272. NEXT: "Siguiente",
  13273. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13274. VIEW_DOLLHOUSE: "Ver dollhouse",
  13275. SOCIAL_SHARING: "Compartir este espacio",
  13276. VIEW_IN_VR: "Ver en realidad virtual",
  13277. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13278. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13279. ZOOM_IN: "Acercar",
  13280. ZOOM_OUT: "Alejar",
  13281. FLOOR_NAME: "Piso ",
  13282. FLOOR_ALL: "Todas",
  13283. TERMS: "Condiciones",
  13284. PORT_TERMS: "port términos de uso",
  13285. TERMS_OF_USE: "Términos de uso",
  13286. TERMS_TEXT_FILE: "terms-es-MX.html",
  13287. CLOSE_TERMS: "Cerrar",
  13288. 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.",
  13289. HELP: "Ayuda",
  13290. HELP_NAVIGATION_TAB: "Navegación",
  13291. HELP_MORE_HELP_TAB: "Más Ayuda",
  13292. CLOSE: "Cerrar",
  13293. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13294. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13295. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13296. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13297. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13298. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13299. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13300. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13301. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13302. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13303. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13304. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13305. 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.",
  13306. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13307. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13308. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13309. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13310. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13311. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13312. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13313. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13314. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13315. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13316. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13317. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13318. HELP_MORE_HLR_A: "Galería destacada",
  13319. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13320. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13321. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13322. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13323. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13324. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13325. HELP_MORE_TAG_A: "tag™ Posts",
  13326. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13327. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13328. HELP_MORE_ZOOM_A: "Controles de zoom",
  13329. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13330. HELP_MORE_TOUR_A: "Controles de recorrido",
  13331. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13332. HELP_MORE_INSIDE_A: "Vista interior",
  13333. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13334. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13335. HELP_MORE_VR_A: "Modo de realidad virtual",
  13336. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13337. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13338. HELP_MORE_360_A: "360° Views",
  13339. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13340. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13341. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13342. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13343. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13344. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13345. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13346. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13347. WEBVR_LEARN_MORE: "Más información",
  13348. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13349. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13350. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13351. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13352. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13353. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13354. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13355. VR_APP: "port VR App",
  13356. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13357. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13358. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13359. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13360. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13361. VR_PREVIOUS_CAPS: "ANTERIOR",
  13362. VR_NEXT_CAPS: "SIGUIENTE",
  13363. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13364. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13365. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13366. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13367. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13368. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13369. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13370. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13371. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13372. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13373. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13374. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13375. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13376. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13377. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13378. VR_ANDROID_DVICES: "Dispositivos Android",
  13379. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13380. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13381. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13382. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13383. VR_DOWNLOAD_HERE: "Descargar aquí",
  13384. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13385. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13386. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13387. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13388. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13389. SHARE_TO: "Compartir en",
  13390. SHARE_LINK: "Enlace directo",
  13391. SHARE_EXPLORE: "Explorar ",
  13392. SHARE_AT: "en",
  13393. SHARE_WITH: "con",
  13394. SHARE_3D: " en 3D",
  13395. SHARE_COPIED: "¡Copiado!",
  13396. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13397. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13398. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13399. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13400. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13401. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13402. ERROR_GENERIC_ACTIONS_3: " o ",
  13403. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13404. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13405. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13406. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13407. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13408. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13409. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13410. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13411. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13412. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13413. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13414. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13415. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13416. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13417. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13418. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13419. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13420. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13421. LINK_TO_LOCATION: "Enlace a la ubicación",
  13422. MENU_COPY: "Copiar",
  13423. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13424. ROTATE: "Girar",
  13425. INSIDE: "Interior",
  13426. MOVE: "Moverse",
  13427. ZOOM: "Acercar o alejar"
  13428. }
  13429. }
  13430. , {}],
  13431. 113: [function(e, t, i) {
  13432. "use strict";
  13433. t.exports = {
  13434. PAGE_TITLE: "",
  13435. LOADING: "Chargement",
  13436. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13437. POWERED_BY: "alimenté par ",
  13438. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13439. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13440. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13441. PRESENTED_BY: "Présenté par ",
  13442. MORE: "Plus ",
  13443. LESS: "Moins ",
  13444. TAG_CONTENT: "Contenu tag™",
  13445. SHOW: "Montrer",
  13446. HIDE: "Cacher",
  13447. DOLLHOUSE: "Dollhouse",
  13448. FLOOR_PLAN: "Plan de sol",
  13449. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13450. CLOSE_HIGHLIGHTS: "Fermer",
  13451. PREVIOUS: "Précédent",
  13452. PLAY: "Lecture",
  13453. PAUSE: "Pause",
  13454. NEXT: "Suivant",
  13455. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13456. VIEW_DOLLHOUSE: "Voir dollhouse",
  13457. SOCIAL_SHARING: "Partager cet espace",
  13458. VIEW_IN_VR: "Voir en VR",
  13459. VIEW_FULLSCREEN: "Plein écran",
  13460. EXIT_FULLSCREEN: "Fermer plein écran",
  13461. ZOOM_IN: "Zoom avant",
  13462. ZOOM_OUT: "Zoom arrière",
  13463. FLOOR_NAME: "Étage ",
  13464. FLOOR_ALL: "Tous",
  13465. TERMS: "Mentions légales",
  13466. PORT_TERMS: "port mentions légales",
  13467. TERMS_OF_USE: "Conditions d'utilisation",
  13468. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13469. CLOSE_TERMS: "Fermer",
  13470. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13471. HELP: "Aide",
  13472. HELP_NAVIGATION_TAB: "Navigation",
  13473. HELP_MORE_HELP_TAB: "Aide",
  13474. CLOSE: "Fermer",
  13475. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13476. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13477. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13478. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13479. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13480. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13481. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13482. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13483. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13484. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13485. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13486. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13487. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13488. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13489. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13490. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13491. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13492. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13493. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13494. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13495. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13496. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13497. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13498. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13499. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13500. HELP_MORE_HLR_A: "Carrousel",
  13501. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13502. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13503. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13504. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13505. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13506. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13507. HELP_MORE_TAG_A: "tag™ Posts",
  13508. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13509. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13510. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13511. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13512. HELP_MORE_TOUR_A: "Commandes de la visite",
  13513. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13514. HELP_MORE_INSIDE_A: "Vue intérieure",
  13515. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13516. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13517. HELP_MORE_VR_A: "Mode RV",
  13518. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13519. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13520. HELP_MORE_360_A: "Vues 360°",
  13521. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13522. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13523. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13524. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13525. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13526. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13527. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13528. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13529. WEBVR_LEARN_MORE: "En savoir plus",
  13530. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13531. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13532. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13533. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13534. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13535. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13536. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13537. VR_NEXT_CAPS: "SUIVANT",
  13538. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13539. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13540. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13541. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13542. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13543. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13544. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13545. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13546. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13547. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13548. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13549. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13550. VR_APP: "port VR App",
  13551. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13552. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13553. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13554. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13555. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13556. 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",
  13557. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13558. VR_ANDROID_DVICES: "Appareils Android",
  13559. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13560. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13561. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13562. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13563. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13564. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13565. VR_DOWNLOAD_HERE: "Télécharger ici",
  13566. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13567. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13568. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13569. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13570. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13571. SHARE_TO: "Partager sur",
  13572. SHARE_LINK: "Lien direct",
  13573. SHARE_EXPLORE: "Explorer ",
  13574. SHARE_AT: "à",
  13575. SHARE_WITH: "avec",
  13576. SHARE_3D: " en 3D",
  13577. SHARE_COPIED: "Copié!",
  13578. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13579. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13580. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13581. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13582. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13583. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13584. ERROR_GENERIC_ACTIONS_3: " ou ",
  13585. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13586. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13587. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13588. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13589. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13590. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13591. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13592. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13593. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13594. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13595. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13596. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13597. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13598. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13599. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13600. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13601. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13602. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13603. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13604. MENU_COPY: "Copie",
  13605. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13606. ROTATE: "Faire pivoter",
  13607. INSIDE: "Intérieure",
  13608. MOVE: "Se déplacer",
  13609. ZOOM: "Zoom"
  13610. }
  13611. }
  13612. , {}],
  13613. 114: [function(e, t, i) {
  13614. "use strict";
  13615. t.exports = {
  13616. PAGE_TITLE: "",
  13617. LOADING: "読み込み中",
  13618. PRESENTED_BY_CAPS: "PRESENTED BY",
  13619. POWERED_BY: "powered by",
  13620. POWERED_BY_CAPS: "POWERED BY",
  13621. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13622. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13623. PRESENTED_BY: "Presented by ",
  13624. MORE: "全て表示 ",
  13625. LESS: "閉じる ",
  13626. TAG_CONTENT: "tag™コンテンツ ",
  13627. SHOW: "表示",
  13628. HIDE: "非表示",
  13629. DOLLHOUSE: "ドールハウス",
  13630. FLOOR_PLAN: "フロアプラン",
  13631. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13632. CLOSE_HIGHLIGHTS: "閉じる",
  13633. PREVIOUS: "前へ",
  13634. PLAY: "再生",
  13635. PAUSE: "一時停止",
  13636. NEXT: "次へ",
  13637. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13638. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13639. SOCIAL_SHARING: "このSpaceを共有する",
  13640. VIEW_IN_VR: "VRで表示",
  13641. VIEW_FULLSCREEN: "フルスクリーン表示",
  13642. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13643. ZOOM_IN: "ズームイン",
  13644. ZOOM_OUT: "ズームアウト",
  13645. FLOOR_NAME: "フロア ",
  13646. FLOOR_ALL: "すべて",
  13647. TERMS: "規約",
  13648. PORT_TERMS: "port規約",
  13649. TERMS_OF_USE: "利用規約",
  13650. CLOSE_TERMS: "閉じる",
  13651. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13652. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13653. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13654. WEBVR_ENTER_WEBVR: "VRに入る",
  13655. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13656. WEBVR_LEARN_MORE: "もっと詳しく",
  13657. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13658. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13659. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13660. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13661. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13662. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13663. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13664. VR_PREVIOUS_CAPS: "前へ",
  13665. VR_NEXT_CAPS: "次へ",
  13666. VR_GOT_IT_CAPS: "了解",
  13667. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13668. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13669. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13670. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13671. VR_WHAT_YOU_NEED: "必要なもの",
  13672. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13673. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13674. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13675. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13676. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13677. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13678. VR_APP: "port VRアプリ",
  13679. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13680. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13681. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13682. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13683. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13684. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13685. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13686. VR_ANDROID_DVICES: "Androidデバイス",
  13687. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13688. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13689. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13690. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13691. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13692. VR_APP_OPEN: "port VRアプリで開く",
  13693. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13694. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13695. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13696. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13697. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13698. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13699. SHARE_TO: "共有先",
  13700. SHARE_LINK: "ダイレクトリンク",
  13701. SHARE_EXPLORE: "探索",
  13702. SHARE_AT: "場所",
  13703. SHARE_WITH: "使用アプリ",
  13704. SHARE_3D: "3Dで",
  13705. SHARE_COPIED: "コピーされました!",
  13706. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13707. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13708. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13709. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13710. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13711. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13712. ERROR_GENERIC_ACTIONS_3: "または",
  13713. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13714. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13715. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13716. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13717. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13718. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13719. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13720. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13721. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13722. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13723. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13724. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13725. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13726. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13727. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13728. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13729. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13730. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13731. LINK_TO_LOCATION: "ロケーションへのリンク",
  13732. MENU_COPY: "コピー",
  13733. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13734. ROTATE: "回転",
  13735. MOVE: "移動",
  13736. INSIDE: "内側",
  13737. ZOOM: "ズーム",
  13738. HELP: "ヘルプ",
  13739. HELP_NAVIGATION_TAB: "ナビゲーション",
  13740. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13741. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13742. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13743. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13744. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13745. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13746. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13747. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13748. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13749. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13750. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13751. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13752. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13753. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13754. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13755. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13756. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13757. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13758. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13759. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13760. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13761. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13762. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13763. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13764. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13765. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13766. HELP_MORE_HLR_A: "ハイライト",
  13767. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13768. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13769. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13770. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13771. HELP_MORE_FLOORS_A: "フロアセレクター",
  13772. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13773. HELP_MORE_TAG_A: "tag™ Posts",
  13774. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13775. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13776. HELP_MORE_ZOOM_A: "ズームコントロール",
  13777. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13778. HELP_MORE_TOUR_A: "ツアーコントロール",
  13779. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13780. HELP_MORE_INSIDE_A: "内側ビュー",
  13781. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13782. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13783. HELP_MORE_VR_A: "VRモード",
  13784. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13785. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13786. HELP_MORE_360_A: "360° Views",
  13787. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13788. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13789. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13790. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13791. CLOSE: "閉じる"
  13792. }
  13793. }
  13794. , {}],
  13795. 115: [function(e, t, i) {
  13796. "use strict";
  13797. t.exports = {
  13798. PAGE_TITLE: "",
  13799. LOADING: "Загрузка",
  13800. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13801. POWERED_BY: "разработано на платформе ",
  13802. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13803. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13804. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13805. PRESENTED_BY: "Представлено ",
  13806. MORE: "Больше ",
  13807. LESS: "Меньше ",
  13808. TAG_CONTENT: "tag™ Контент",
  13809. SHOW: "Показать",
  13810. HIDE: "Скрыть",
  13811. DOLLHOUSE: "Dollhouse",
  13812. FLOOR_PLAN: "Планировка",
  13813. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13814. CLOSE_HIGHLIGHTS: "Закрыть",
  13815. PREVIOUS: "Предыдущий",
  13816. PLAY: "Воспроизвести",
  13817. PAUSE: "Пауза",
  13818. NEXT: "Следующий",
  13819. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13820. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13821. SOCIAL_SHARING: "Поделиться этой моделью",
  13822. VIEW_IN_VR: "Посмотреть в VR",
  13823. VIEW_FULLSCREEN: "Полный экран",
  13824. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13825. ZOOM_IN: "Увеличить",
  13826. ZOOM_OUT: "Уменьшить",
  13827. FLOOR_NAME: "Этаж ",
  13828. FLOOR_ALL: "Все",
  13829. TERMS: "Условия",
  13830. PORT_TERMS: "Правила пользования",
  13831. TERMS_OF_USE: "Условия использования",
  13832. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13833. CLOSE_TERMS: "Закрыть",
  13834. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13835. HELP: "Помощь",
  13836. HELP_NAVIGATION_TAB: "Навигация",
  13837. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13838. CLOSE: "Закрыть",
  13839. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13840. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13841. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13842. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13843. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13844. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13845. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13846. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13847. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13848. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13849. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13850. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13851. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13852. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13853. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13854. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13855. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13856. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13857. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13858. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13859. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13860. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13861. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13862. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13863. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13864. HELP_MORE_HLR_A: "Фотоколлаж",
  13865. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13866. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13867. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13868. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13869. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13870. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13871. HELP_MORE_TAG_A: "tag™ Posts",
  13872. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13873. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13874. HELP_MORE_ZOOM_A: "Масштаб",
  13875. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13876. HELP_MORE_TOUR_A: "Управление Туром",
  13877. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13878. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13879. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13880. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13881. HELP_MORE_VR_A: "Режим VR",
  13882. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13883. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13884. HELP_MORE_360_A: "360° Views",
  13885. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13886. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13887. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13888. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13889. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13890. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13891. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13892. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13893. WEBVR_LEARN_MORE: "Узнать больше",
  13894. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13895. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13896. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13897. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13898. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13899. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13900. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13901. VR_APP: "port VR App",
  13902. VR_APP_OPEN: "Или открыть через приложение port VR",
  13903. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13904. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13905. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13906. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13907. VR_VIEW_SPACE: "Запустить модель в VR",
  13908. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13909. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13910. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13911. VR_GOT_IT_CAPS: "ЯСНО",
  13912. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13913. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13914. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13915. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13916. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13917. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13918. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13919. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13920. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13921. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13922. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13923. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13924. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13925. VR_ANDROID_DVICES: "Android устройства",
  13926. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13927. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13928. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13929. VR_DOWNLOAD_HERE: "Скачать здесь",
  13930. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13931. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13932. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13933. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13934. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13935. SHARE_TO: "Поделиться",
  13936. SHARE_LINK: "Прямая ссылка",
  13937. SHARE_EXPLORE: "просмотреть",
  13938. SHARE_AT: "на",
  13939. SHARE_WITH: "с",
  13940. SHARE_3D: "в 3D",
  13941. SHARE_COPIED: "Скопировано!",
  13942. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13943. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13944. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13945. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13946. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13947. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13948. ERROR_GENERIC_ACTIONS_3: " или ",
  13949. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13950. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13951. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13952. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13953. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13954. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13955. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13956. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13957. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13958. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13959. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13960. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13961. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13962. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13963. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13964. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13965. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13966. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13967. LINK_TO_LOCATION: "Ссылка на местоположение",
  13968. MENU_COPY: "Копировать",
  13969. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13970. ROTATE: "Вращать",
  13971. MOVE: "Передвигаться",
  13972. INSIDE: "Вид изнутри",
  13973. ZOOM: "Масштаб"
  13974. }
  13975. }
  13976. , {}],
  13977. 116: [function(r, e, t) {
  13978. (function(i) {
  13979. "use strict";
  13980. function re(e) {
  13981. console.log("e1:" + e),
  13982. e = Math.round(.4 * e * 100),
  13983. console.log("e2:" + e);
  13984. var t = $(".progressbar");
  13985. t.find(".bar").css("width", e + "%"),
  13986. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13987. t.find(".perc").text(e + "%")
  13988. }
  13989. $("#gui-loading").fadeIn(200),
  13990. re(.1);
  13991. var e = g_version ? "modeldata.js" : "someData.json";
  13992. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13993. dataType: "json"
  13994. }).done(function(e) {
  13995. var t = matcher(e);
  13996. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13997. t.user = {
  13998. is_authenticated: !1,
  13999. 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"]
  14000. }
  14001. /* t.model.images = [
  14002. {
  14003. "metadata": "{\"camera_position\":{\"x\":0.8559,\"y\":-0.1097,\"z\":0.6656},\"camera_quaternion\":{\"x\":-0.1975,\"y\":-0.0952,\"z\":-0.0193,\"w\":0.9755},\"scan_id\":\"11\",\"zoom\":1}",
  14004. "name": "1",
  14005. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  14006. "sid": "20201210_175837426"
  14007. },
  14008. {
  14009. "metadata": "{\"camera_position\":{\"x\":1.1559,\"y\":-0.1083,\"z\":1.9191},\"camera_quaternion\":{\"x\":-0.0396,\"y\":0.1251,\"z\":0.005,\"w\":0.9913},\"scan_id\":\"12\",\"zoom\":1}",
  14010. "name": "2",
  14011. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  14012. "sid": "20201210_175835333"
  14013. },
  14014. {
  14015. "name": "区域1 hasmusic",
  14016. "momentTour": "black",
  14017. "musicInfo": {
  14018. "name": "一段音乐.mp3",
  14019. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  14020. "time": 7818
  14021. },
  14022. "locations": [
  14023. {
  14024. "metadata": "{\"camera_position\":{\"x\":-2.4032,\"y\":-0.1215,\"z\":-0.882},\"camera_quaternion\":{\"x\":-0.0898,\"y\":0.9081,\"z\":0.2552,\"w\":0.3196},\"scan_id\":\"5\",\"zoom\":1}",
  14025. "sid": "20210425_152818526",
  14026. "name": "20210425_152818526",
  14027. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  14028. }
  14029. ]
  14030. },
  14031. {
  14032. "name": "区域2",
  14033. "momentTour": "black",
  14034. "locations": [
  14035. {
  14036. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":0.0326,\"y\":0.9667,\"z\":0.1605,\"w\":-0.1966},\"scan_id\":\"2\",\"zoom\":1}",
  14037. "sid": "20210425_152857293",
  14038. "name": "20210425_152857293",
  14039. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  14040. },
  14041. {
  14042. "metadata": "{\"camera_position\":{\"x\":-0.2906,\"y\":-0.1122,\"z\":-0.2226},\"camera_quaternion\":{\"x\":-0.258,\"y\":-0.3481,\"z\":-0.1003,\"w\":0.8956},\"scan_id\":\"1\",\"zoom\":1}",
  14043. "sid": "20210425_152900502",
  14044. "name": "20210425_152900502",
  14045. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  14046. }
  14047. ]
  14048. },
  14049. {
  14050. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":-0.0023,\"y\":-0.8326,\"z\":-0.0034,\"w\":0.5539},\"scan_id\":\"2\",\"zoom\":1}",
  14051. "sid": "20210425_152929593",
  14052. "name": "5",
  14053. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  14054. }
  14055. ] */
  14056. try{//处理一下导览数据
  14057. t.model.images = t.model.images.filter(e=>{
  14058. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14059. if(e.locations)e.locations = e.locations.filter(e=>e)
  14060. if(e.locations && e.locations.length == 0)return;
  14061. return e
  14062. })
  14063. }catch(e){console.log(e) }
  14064. window.MP_PREFETCHED_MODELDATA = t
  14065. t.model.summary = t.summary
  14066. t.model.name = t.name
  14067. for(let i in t){
  14068. t[i] == "false" && (t[i] = false)
  14069. }
  14070. re(.7),
  14071. function() {
  14072. function y(e) {
  14073. t.update(e)
  14074. }
  14075. function A(e, t) {
  14076. ne.error(t),
  14077. n.error(t),
  14078. N.report(e, "error-" + t)
  14079. }
  14080. function C(e, t, i) {
  14081. try {
  14082. e.start(t)
  14083. } catch (e) {
  14084. throw ne.warn(e.message),
  14085. function(e) {
  14086. var t = O.details();
  14087. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14088. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14089. N.report(e, "error-webgl-generic"))
  14090. }(i.sid),
  14091. e
  14092. }
  14093. }
  14094. function I(e) {
  14095. e.stopPropagation(),
  14096. e.preventDefault()
  14097. }
  14098. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  14099. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14100. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14101. });
  14102. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  14103. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  14104. */
  14105. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14106. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  14107. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic
  14108. $("#volume").show();
  14109. }else if (g_version === "one"){
  14110. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14111. //g_bgAudio.src = manage.dealURL(src) ;
  14112. }
  14113. //隐藏公司logo
  14114. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  14115. r("./lib/three75-shim"),
  14116. r("./lib/array-polyfill"),
  14117. r("./lib/performance-polyfill"),
  14118. r("./lib/shaders/CopyShader.js"),
  14119. r("./lib/shaders/HorizontalBlurShader.js"),
  14120. r("./lib/shaders/VerticalBlurShader.js"),
  14121. r("./lib/postprocessing/EffectComposer.js"),
  14122. r("./lib/postprocessing/RenderPass.js"),
  14123. r("./lib/postprocessing/MaskPass.js"),
  14124. r("./lib/postprocessing/ShaderPass.js"),
  14125. window.Promise || (window.Promise = r("promise-polyfill"));
  14126. var E = r("three")
  14127. , _ = r("three")
  14128. , b = (r("./util/sentry"),
  14129. r("./player"))
  14130. , w = r("./director")
  14131. , T = r("./controls/CameraControls")
  14132. , x = r("./model/ModelManager")
  14133. , S = r("./DisplayController")
  14134. , M = r("./label/LabelDisplayController")
  14135. , R = r("./enum/Viewmode")
  14136. , e = r("./util/logger")
  14137. , P = r("./showcase")
  14138. , O = r("./util/browser")
  14139. , L = r("./settings")
  14140. , D = r("./gui/gui")
  14141. , n = r("./gui/error")
  14142. , N = r("./analytics")
  14143. , F = r("./util/transitions")
  14144. , B = r("./effects")
  14145. , V = r("./objects/Skybox")
  14146. , k = (r("./util/common"),
  14147. r("./util/PanoramaCollection"),
  14148. r("./util/math"),
  14149. r("./util/showcase"))
  14150. , U = r("./util/camera")
  14151. , H = (r("./objects/Panorama"),
  14152. r("./cameras/PanoramaCamera"),
  14153. r("./preloaders"))
  14154. , z = r("events").EventEmitter
  14155. , G = r("./featureflags")
  14156. , W = (r("./util/lerp"),
  14157. r("./util/ajax"),
  14158. r("./ab"))
  14159. , j = r("./sdk/automation.js")
  14160. , Y = r("./scene/SceneRenderer")
  14161. , q = r("./scene/QuickstartManager")
  14162. , X = r("./tile/QualityManager.js")
  14163. , Z = r("./localization/localize")
  14164. , K = r("./tag/tagManager")
  14165. , Q = r("./tile/TileDownloader")
  14166. , J = r("./tile/PanoRenderer")
  14167. , ee = (r("./enum/PanoSizeClass"),
  14168. r("./enum/PanoramaEvents"),
  14169. r("./enum/SceneRendererEvents"))
  14170. , t = r("./gui/memoryUsage")
  14171. , te = r("./enum/RenderLayers")
  14172. , ie = r("./TimingData")
  14173. , ne = new e(i);
  14174. e.level = L.logLevel,
  14175. e.consoleEnabled = L.console,
  14176. function() {
  14177. var e = k.getModelIDFromQueryString();
  14178. if (!e)
  14179. return A(null, "loading-failed");
  14180. var t = k.parseSidUrl(e)
  14181. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14182. , n = {
  14183. panoElementsToLoad: 6,
  14184. modelElementsToLoad: 0,
  14185. totalElementsLoaded: 0,
  14186. totalElementsToLoad: 0,
  14187. totalPercentageLoaded: 0,
  14188. progressCallback: null
  14189. }
  14190. , r = document.getElementById("player")
  14191. , o = L.quickstart.enabled
  14192. , a = null
  14193. , s = null
  14194. , l = null
  14195. , c = null
  14196. , h = null
  14197. , u = null
  14198. , d = null
  14199. , p = null
  14200. , f = null
  14201. , g = null
  14202. , m = null
  14203. , v = new ie;
  14204. !function(e) {
  14205. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14206. z.defaultMaxListeners = 1e3,
  14207. function(e) {
  14208. e.addEventListener("dragenter", I, !1),
  14209. e.addEventListener("dragover", I, !1)
  14210. }(e),
  14211. O.valueFromHash("title", !0) || $(document).ready(function() {
  14212. $(".model-title").hide()
  14213. })
  14214. }(r),
  14215. function(e) {
  14216. return G.loadFeatureFlags(e).done(function(e) {
  14217. G.updateDependentSettings(e, L)
  14218. })
  14219. }({
  14220. urlBase: t.urlBase
  14221. }).then(function() {
  14222. return Z.init(),
  14223. function(e, t) {
  14224. var i = P.getModel({
  14225. url: t,
  14226. floors: O.valueFromHash("f", !0),
  14227. autoload: !1
  14228. });
  14229. return $.when(i, y).then(null, function(e) {
  14230. return this
  14231. })
  14232. }(0, e)
  14233. }).then(function(e) {
  14234. return re(.9),
  14235. function(e, t, i, n, r) {
  14236. ne.info("Model data loaded"),
  14237. ne.debug("UUID: " + e.data.job.uuid),
  14238. W.init(G.getFlags()),
  14239. i && N.initKeen({
  14240. token: i,
  14241. appId: n
  14242. }),
  14243. N.initSegment({
  14244. model: e.sid,
  14245. version: "2.25.6-0-gd87e5b1",
  14246. startSource: r.startSource,
  14247. token: t,
  14248. autoplay: r.autoplay,
  14249. quickstart: r.quickstart
  14250. })
  14251. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14252. startSource: i,
  14253. autoplay: L.autoplay,
  14254. quickstart: o
  14255. }),
  14256. g.urls.init()
  14257. }).then(function() {
  14258. return g.loadPanos()
  14259. }).then(function() {
  14260. s = U.getStartCameraOptions(g, g.panos);
  14261. //初始画面
  14262. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  14263. $("<img/>").attr("src", e).on("load", function() {
  14264. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14265. $(this).remove()
  14266. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14267. })
  14268. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  14269. d = function(e) {
  14270. var t = new E.PerspectiveCamera;
  14271. t.layers.enable(te.PANOMARKERS),
  14272. t.layers.enable(te.RETICULE),
  14273. t.layers.enable(te.TAG);
  14274. var o = new E.Scene
  14275. , i = new E.AmbientLight(16777215);
  14276. return o.add(i),
  14277. o.skybox = new V,
  14278. o.add(o.skybox),
  14279. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14280. side: E.DoubleSide
  14281. })),
  14282. o.plane.position.y = 0,
  14283. o.plane.rotateX(-Math.PI / 2),
  14284. o.plane.material.visible = !1,
  14285. o.add(o.plane),
  14286. o.updateMatrixWorld(),
  14287. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14288. if (e.metadata && e.metadata.camera_position) {
  14289. var t = e.metadata.camera_position
  14290. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14291. i.position = t.clone(),
  14292. o.add(i);
  14293. var n = e.metadata.camera_quaternion
  14294. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14295. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14296. }
  14297. }),
  14298. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14299. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14300. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14301. new Y(o,t,B)
  14302. }(g),
  14303. m = function(e, t) {
  14304. var i = e ? 1 : 1e3
  14305. , n = W.tilegen || W.imgopt ? 6 : 2;
  14306. n = O.valueFromHash("tileconc", n);
  14307. var r = new X
  14308. , o = new Q({
  14309. concurrentDownloads: n
  14310. })
  14311. , a = new J
  14312. , s = new x
  14313. , l = new w
  14314. , c = new b(t)
  14315. , h = new T
  14316. , u = new S(i)
  14317. , d = new M
  14318. , p = new K;
  14319. return {
  14320. qualityManager: r,
  14321. panoRenderer: a,
  14322. tileDownloader: o,
  14323. player: c,
  14324. director: l,
  14325. modelManager: s,
  14326. tagManager: p,
  14327. displayController: u,
  14328. labelDisplayController: d,
  14329. controls: h
  14330. }
  14331. }(o, s.mode),
  14332. l = m.controls,
  14333. c = m.player,
  14334. h = m.director,
  14335. u = m.tagManager,
  14336. p = m.tileDownloader,
  14337. f = m.qualityManager,
  14338. m.panoRenderer,
  14339. function(e, t, i, n) {
  14340. var r = i.controls
  14341. , o = i.qualityManager
  14342. , a = i.panoRenderer
  14343. , s = i.tileDownloader
  14344. , l = i.modelManager;
  14345. r.init(n, l),
  14346. j.init(i.director, r, i.player, l, t),
  14347. o.init(l),
  14348. s.init(o),
  14349. a.init(t, s, o),
  14350. l.init(s, a, o),
  14351. l.addModel(e),
  14352. t.addComponent(F)
  14353. }(g, d, m, r),
  14354. c.director = h,
  14355. g.supportsTiles && p.start(),
  14356. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14357. o = !1);
  14358. var e = null;
  14359. if (o) {
  14360. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14361. var t = l.controls[R.PANORAMA];
  14362. a = new q(f,d.scene,d.camera,t,r),
  14363. C(d, r, g),
  14364. e = a.load(s).then(function() {
  14365. d.addComponent(a),
  14366. d.once(ee.AfterRender, function() {
  14367. ne.warn("First render after quickstart load finished.")
  14368. })
  14369. })
  14370. }
  14371. return window.flyToFirst = function() {
  14372. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14373. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14374. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14375. c.flyToPano({
  14376. pano: e,
  14377. lookAtPoint: i
  14378. })
  14379. }
  14380. ,
  14381. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14382. }).then(function() {
  14383. return function(e, t, i, n, r) {
  14384. return r.progressCallback = t,
  14385. N.sessionStart(),
  14386. e.load(n).progress(function(e, t) {
  14387. e.modelElementsToLoad = t[1],
  14388. function(e) {
  14389. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14390. }(e),
  14391. function(e) {
  14392. e.totalElementsLoaded++,
  14393. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14394. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14395. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14396. console.log("pro:" + e.totalPercentageLoaded),
  14397. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14398. }(e)
  14399. }
  14400. .bind(this, r))
  14401. }(g, D.onProgress, 0, !o, n)
  14402. }).then(function() {
  14403. s.quickstart = o,
  14404. function(e, t, i, n) {
  14405. var r = i.qualityManager
  14406. , o = i.panoRenderer
  14407. , a = i.tileDownloader
  14408. , s = i.modelManager
  14409. , l = i.player
  14410. , c = i.director
  14411. , h = i.tagManager
  14412. , u = i.displayController
  14413. , d = i.labelDisplayController
  14414. , p = i.controls;
  14415. t.scene.add(e),
  14416. t.qualityManager = r;
  14417. var f = {
  14418. camera: t.camera,
  14419. director: c,
  14420. modelManager: s,
  14421. tileDownloader: a,
  14422. panoRenderer: o,
  14423. qualityManager: r,
  14424. tagManager: h,
  14425. container: n,
  14426. controls: p
  14427. };
  14428. l.init(f),
  14429. l.setScene(t.scene),
  14430. h.init(s, l),
  14431. c.init(l, s),
  14432. u.init(c, l, s, h, n),
  14433. d.init(l, s, n),
  14434. B.bindEvents(l),
  14435. t.addComponent(h),
  14436. t.addComponent(l),
  14437. t.addComponent(o),
  14438. l.sceneRenderer = t
  14439. }(g, d, m, r),
  14440. d.started || C(d, r, g),
  14441. N.modelLoaded(g, c, l, L.autoplay),
  14442. function(e, t, i, n) {
  14443. return ne.info("Starting player in " + i.mode),
  14444. N.report(t.sid, "started-playing", n, i.quickstart),
  14445. e.start(i)
  14446. }(c, g, s, L.autoplay).done(function() {
  14447. h.autoTour()
  14448. }),
  14449. g.supportsTiles || new H(g,c).start();
  14450. o && (d.removeComponent(a),
  14451. a.destroy(),
  14452. s.pano.enter()),
  14453. D.init(g, h, c, l, d, s, N.getSessionId()),
  14454. D.endLoading(g, h, u),
  14455. d.once(ee.AfterRender, function() {
  14456. v.setAppReadyTime();
  14457. var e = v.calcFullLoadingTime();
  14458. ne.warn("Total load time: " + e / 1e3),
  14459. N.loadComplete(e),
  14460. ne.warn("First render after model load finished.")
  14461. }),
  14462. d.on(ee.MemoryUsageUpdated, y)
  14463. }).fail(A.bind(this, e))
  14464. }()
  14465. }()
  14466. })
  14467. }
  14468. ).call(this, "/js/main.js")
  14469. }
  14470. , {
  14471. "./DisplayController": 1,
  14472. "./TimingData": 2,
  14473. "./ab": 3,
  14474. "./analytics": 4,
  14475. "./cameras/PanoramaCamera": 7,
  14476. "./controls/CameraControls": 9,
  14477. "./director": 15,
  14478. "./effects": 16,
  14479. "./enum/PanoSizeClass": 36,
  14480. "./enum/PanoramaEvents": 37,
  14481. "./enum/RenderLayers": 41,
  14482. "./enum/SceneRendererEvents": 43,
  14483. "./enum/Viewmode": 51,
  14484. "./featureflags": 59,
  14485. "./gui/error": 64,
  14486. "./gui/gui": 65,
  14487. "./gui/memoryUsage": 73,
  14488. "./label/LabelDisplayController": 91,
  14489. "./lib/array-polyfill": 92,
  14490. "./lib/performance-polyfill": 95,
  14491. "./lib/postprocessing/EffectComposer.js": 96,
  14492. "./lib/postprocessing/MaskPass.js": 97,
  14493. "./lib/postprocessing/RenderPass.js": 98,
  14494. "./lib/postprocessing/ShaderPass.js": 99,
  14495. "./lib/shaders/CopyShader.js": 100,
  14496. "./lib/shaders/HorizontalBlurShader.js": 101,
  14497. "./lib/shaders/VerticalBlurShader.js": 102,
  14498. "./lib/three75-shim": 103,
  14499. "./localization/localize": 108,
  14500. "./tag/tagManager": 124,
  14501. "./model/ModelManager": 140,
  14502. "./objects/Panorama": 148,
  14503. "./objects/Skybox": 152,
  14504. "./player": 155,
  14505. "./preloaders": 156,
  14506. "./scene/QuickstartManager": 157,
  14507. "./scene/SceneRenderer": 158,
  14508. "./sdk/automation.js": 164,
  14509. "./settings": 166,
  14510. "./showcase": 168,
  14511. "./tile/PanoRenderer": 169,
  14512. "./tile/QualityManager.js": 170,
  14513. "./tile/TileDownloader": 171,
  14514. "./util/PanoramaCollection": 178,
  14515. "./util/ajax": 181,
  14516. "./util/browser": 182,
  14517. "./util/camera": 183,
  14518. "./util/common": 185,
  14519. "./util/lerp": 188,
  14520. "./util/logger": 189,
  14521. "./util/math": 190,
  14522. "./util/sentry": 192,
  14523. "./util/showcase": 193,
  14524. "./util/transitions": 195,
  14525. events: 202,
  14526. "promise-polyfill": 213,
  14527. three: 217
  14528. }],
  14529. 117: [function(e, t, i) {
  14530. "use strict";
  14531. function n(e) {
  14532. e = e || {},
  14533. r.RawShaderMaterial.call(this, a.extendObject({
  14534. fragmentShader: o.cube.fragmentShader,
  14535. vertexShader: o.cube.vertexShader,
  14536. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14537. name: "CubemapMaterial"
  14538. }, e))
  14539. }
  14540. var r = e("three")
  14541. , o = e("../shaders")
  14542. , a = e("../util/common");
  14543. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14544. t.exports = n
  14545. }
  14546. , {
  14547. "../shaders": 167,
  14548. "../util/common": 185,
  14549. three: 217
  14550. }],
  14551. 118: [function(e, t, i) {
  14552. "use strict";
  14553. function n(e) {
  14554. e = e || {},
  14555. r.RawShaderMaterial.call(this, a.extendObject({
  14556. fragmentShader: o.model.fragmentShader,
  14557. vertexShader: o.model.vertexShader,
  14558. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14559. name: "ModelTextureMaterial"
  14560. }, e))
  14561. }
  14562. var r = e("three")
  14563. , o = e("../shaders")
  14564. , a = e("../util/common");
  14565. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14566. i && (this.uniforms.progress.value = 0),
  14567. e.ensureSkyboxReadyForRender(),
  14568. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14569. this.uniforms.pano0Position.value.copy(e.position),
  14570. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14571. t.ensureSkyboxReadyForRender(),
  14572. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14573. this.uniforms.pano1Position.value.copy(t.position),
  14574. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14575. }
  14576. ,
  14577. t.exports = n
  14578. }
  14579. , {
  14580. "../shaders": 167,
  14581. "../util/common": 185,
  14582. three: 217
  14583. }],
  14584. 119: [function(m, v, e) {
  14585. (function(e) {
  14586. "use strict";
  14587. function t(e, t, i, n) {
  14588. this.div = null,
  14589. this.body = null,
  14590. this.label = e,
  14591. this.description = t,
  14592. this.parsedDescription = [],
  14593. this.media = i || {
  14594. type: null
  14595. },
  14596. this.loadingSpinner = null,
  14597. this.parser = new r({
  14598. supportLinks: !c.valueFromHash("mls"),
  14599. keepLinkLabels: !0
  14600. }),
  14601. this.state = g.CLOSED,
  14602. this.orientation = "",
  14603. this.initialTransform = "",
  14604. this.hovering = !1,
  14605. this.openTransition = null,
  14606. this.closeTransition = null,
  14607. this.openPromise = null,
  14608. this.closePromise = null,
  14609. this.animationTransition = null,
  14610. this.animationScale = 0
  14611. }
  14612. var r = m("../Parser/DescriptionParser")
  14613. , i = m("../Media/Link")
  14614. , n = m("../Media/Image")
  14615. , o = m("../Media/EmbedlyPlayer")
  14616. , a = m("../Media/EmbedlyEmbed")
  14617. , s = m("../../util/transitions")
  14618. , l = m("../../util/lerp")
  14619. , c = m("../../util/browser")
  14620. , b = m("./BillboardEvent")
  14621. , w = m("../Media/MediaEvent")
  14622. , h = m("../Parser/DescriptionChunkType")
  14623. , u = m("events").EventEmitter
  14624. , d = m("./billboardSettings")
  14625. , T = m("./overlaySettings")
  14626. , p = new (m("../../util/logger"))(e)
  14627. , f = document.getElementById("tag-billboards");
  14628. f.addEventListener("touchend", function(e) {
  14629. f.style.pointerEvents = "none"
  14630. }),
  14631. f.addEventListener("touchcancel", function(e) {
  14632. f.style.pointerEvents = "none"
  14633. });
  14634. var g = {
  14635. CLOSED: "closed",
  14636. OPENING: "opening",
  14637. OPEN: "open",
  14638. CLOSING: "closing",
  14639. ACTIVE: "active"
  14640. };
  14641. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14642. this.parsedDescription = this.parser.parse(this.description);
  14643. var t = document.createElement("div");
  14644. t.className = "tag-container has-hotzone",
  14645. this.div = t,
  14646. this.body = document.createElement("div"),
  14647. this.body.className = "tag-body";
  14648. var i = document.createElement("div");
  14649. i.classList.add("tag-content");
  14650. var n = document.createElement("div");
  14651. n.classList.add("tag-text-content");
  14652. var r = document.createElement("div");
  14653. r.className = "tag-label",
  14654. r.textContent = this.label,
  14655. n.appendChild(r);
  14656. var o = document.createElement("div");
  14657. o.className = "tag-desc",
  14658. n.appendChild(o),
  14659. i.appendChild(n),
  14660. this.body.appendChild(i),
  14661. this.appendDescriptionElements(this.parsedDescription, o),
  14662. this.appendMedia(),
  14663. t.appendChild(this.body),
  14664. f.appendChild(t),
  14665. this.bindEvents(t, this.body)
  14666. }
  14667. ,
  14668. t.prototype.bindEvents = function(i, e) {
  14669. function t(n) {
  14670. return function(e) {
  14671. if (!this.div.classList.contains("overlay")) {
  14672. var t, i = document.getElementById("player");
  14673. try {
  14674. t = new MouseEvent(n,e)
  14675. } catch (i) {
  14676. (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)
  14677. }
  14678. i.dispatchEvent(t)
  14679. }
  14680. }
  14681. }
  14682. e.addEventListener("mousedown", function(e) {
  14683. e.stopPropagation()
  14684. }),
  14685. e.addEventListener("mouseup", function(e) {
  14686. e.stopPropagation()
  14687. }),
  14688. i.addEventListener("touchstart", function(e) {
  14689. f.style.pointerEvents = "auto"
  14690. }),
  14691. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14692. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14693. e.addEventListener("mouseover", function(e) {
  14694. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14695. }
  14696. .bind(this)),
  14697. i.addEventListener("mouseenter", function(e) {
  14698. this.state !== g.CLOSING && (this.hovering = !0,
  14699. this.emit(b.ENTER))
  14700. }
  14701. .bind(this)),
  14702. i.addEventListener("mouseleave", function(e) {
  14703. this.hovering = !1,
  14704. this.emit(b.LEAVE)
  14705. }
  14706. .bind(this)),
  14707. i.addEventListener("gesturestart", function(e) {
  14708. e.preventDefault()
  14709. });
  14710. var n = i.querySelector(".tag-text-content")
  14711. , r = 0;
  14712. n.addEventListener("touchstart", function(e) {
  14713. r = e.changedTouches[0].clientY
  14714. }),
  14715. n.addEventListener("touchmove", function(t) {
  14716. function e(e) {
  14717. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14718. }
  14719. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14720. }),
  14721. i.addEventListener("touchmove", function(e) {
  14722. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14723. })
  14724. }
  14725. ,
  14726. t.prototype.appendDescriptionElements = function(e, i) {
  14727. 0 < e.length && this.div.classList.add("has-text"),
  14728. e.forEach(function(e, t) {
  14729. switch (e.type) {
  14730. case h.TEXT:
  14731. i.appendChild(this.createTextElement(e.text));
  14732. break;
  14733. case h.LINK:
  14734. i.appendChild(this.createLinkElement(e.link))
  14735. }
  14736. }
  14737. .bind(this))
  14738. }
  14739. ,
  14740. t.prototype.appendLoadingSpinner = function() {
  14741. this.loadingSpinner = document.createElement("div"),
  14742. this.loadingSpinner.classList.add("loading-spinner");
  14743. var e = document.createElement("div");
  14744. e.classList.add("gui-spinner-icon"),
  14745. this.loadingSpinner.appendChild(e),
  14746. this.body.appendChild(this.loadingSpinner)
  14747. }
  14748. ,
  14749. t.prototype.onMediaLoadFinished = function() {
  14750. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14751. this.applyOrientation(this.orientation),
  14752. this.loadingSpinner = null)
  14753. }
  14754. ,
  14755. t.prototype.appendMedia = function() {
  14756. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14757. this.appendLoadingSpinner();
  14758. var e = document.createElement("div");
  14759. e.classList.add("tag-media-content");
  14760. var t = document.createElement("i");
  14761. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14762. t.classList.add(e)
  14763. }),
  14764. this.body.appendChild(t),
  14765. this.body.appendChild(e),
  14766. this.media.type) {
  14767. case h.IMAGE:
  14768. e.appendChild(this.createImageElement(this.media, this.body));
  14769. break;
  14770. case h.VIDEO:
  14771. e.appendChild(this.createVideoElement(this.media, this.body));
  14772. break;
  14773. case h.RICH:
  14774. e.appendChild(this.createEmbedElement(this.media, this.body))
  14775. }
  14776. }
  14777. }
  14778. ,
  14779. t.prototype.createTextElement = function(e) {
  14780. var t = document.createElement("span");
  14781. return t.textContent = e,
  14782. t
  14783. }
  14784. ,
  14785. t.prototype.createLinkElement = function(e) {
  14786. var t = new i(e);
  14787. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14788. t.createDomElement()
  14789. }
  14790. ,
  14791. t.prototype.createImageElement = function(t, C) {
  14792. function e() {
  14793. function e() {
  14794. p || (E.classList.remove("view-image"),
  14795. a.classList.add("overlay"),
  14796. t(),
  14797. window.addEventListener("resize", A),
  14798. a.addEventListener("click", i),
  14799. c.addEventListener("click", r),
  14800. o.addEventListener("click", n),
  14801. p = !0,
  14802. _.emit(w.IMAGE_OPENED))
  14803. }
  14804. function t() {
  14805. C.classList.add("show-info"),
  14806. s.classList.remove("collapsible"),
  14807. s.style.height = "";
  14808. var e = parseFloat(getComputedStyle(v).lineHeight)
  14809. , t = g + e
  14810. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14811. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14812. , r = n
  14813. , o = r * I.aspect;
  14814. i < o && (r = (o = i) / I.aspect),
  14815. n < r && (o = (r = n) * I.aspect),
  14816. o += m,
  14817. r += m + t,
  14818. C.style.width = o + "px",
  14819. C.style.height = r + "px",
  14820. l.style.paddingTop = e + m + "px",
  14821. 0 < _.description.length && (s.classList.add("collapsible"),
  14822. s.style.height = s.clientHeight + 12 + "px",
  14823. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14824. }
  14825. function i(e) {
  14826. e.target === a && n()
  14827. }
  14828. function n() {
  14829. p && (p = !1,
  14830. E.classList.add("view-image"),
  14831. a.classList.remove("overlay"),
  14832. s.style.height = "",
  14833. l.style.paddingTop = "",
  14834. C.style.width = "",
  14835. C.style.height = "",
  14836. window.removeEventListener("resize", A),
  14837. a.removeEventListener("click", i),
  14838. c.removeEventListener("click", r),
  14839. o.removeEventListener("click", n),
  14840. _.emit(w.IMAGE_CLOSED),
  14841. _.close(!0))
  14842. }
  14843. function r(e) {
  14844. C.classList.toggle("show-info")
  14845. }
  14846. var a = _.div
  14847. , s = a.getElementsByClassName("tag-content")[0]
  14848. , l = a.getElementsByClassName("tag-media-content")[0]
  14849. , o = C.getElementsByClassName("close")[0]
  14850. , c = s.getElementsByClassName("tag-label")[0];
  14851. a.classList.add("has-image"),
  14852. E.classList.add("view-image"),
  14853. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14854. _.applyOrientation(_.orientation);
  14855. 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,
  14856. function() {
  14857. clearInterval(h),
  14858. clearTimeout(u),
  14859. h = setInterval(function() {
  14860. var e = a.clientHeight;
  14861. d !== e && (t(),
  14862. d = e)
  14863. }, 100),
  14864. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14865. }
  14866. );
  14867. I.on(w.IMAGE_OPENING, e),
  14868. _.on(b.ACTIVATE, e),
  14869. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14870. _.on(b.CLOSING, n)
  14871. }
  14872. var I = new n
  14873. , E = I.createDomElement();
  14874. this.once(b.OPENED, function() {
  14875. I.load(t.src).then(e).catch(function(e) {
  14876. p.warn("Failed to load image:", t.src),
  14877. p.warn("with error:", e)
  14878. }).then(this.onMediaLoadFinished.bind(this))
  14879. });
  14880. var _ = this;
  14881. return E
  14882. }
  14883. ,
  14884. t.prototype.createVideoElement = function(t, e) {
  14885. var i = new o({
  14886. autoPlay: !0,
  14887. autoResume: !0,
  14888. startMuted: !1,
  14889. loop: !1
  14890. })
  14891. , n = i.createDomElement();
  14892. return this.once(b.OPENED, function() {
  14893. i.load(t.src).then(function() {
  14894. this.div.classList.add("has-video"),
  14895. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14896. i.play()),
  14897. this.on(b.OPENING, i.show.bind(i)),
  14898. this.on(b.OPENED, i.play.bind(i)),
  14899. this.on(b.CLOSING, i.pause.bind(i)),
  14900. this.on(b.CLOSED, i.hide.bind(i))
  14901. }
  14902. .bind(this)).catch(function(e) {
  14903. p.warn("Failed to embed video:", t.src),
  14904. p.warn("with error:", e)
  14905. }).then(this.onMediaLoadFinished.bind(this))
  14906. }
  14907. .bind(this)),
  14908. n
  14909. }
  14910. ,
  14911. t.prototype.createEmbedElement = function(t, e) {
  14912. var i = new a
  14913. , n = i.createDomElement();
  14914. return this.once(b.OPENED, function() {
  14915. i.load(t.src).then(function() {
  14916. this.div.classList.add("has-embed"),
  14917. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14918. this.applyOrientation(this.orientation),
  14919. this.on(b.OPENING, i.show.bind(i)),
  14920. this.on(b.CLOSED, i.hide.bind(i))
  14921. }
  14922. .bind(this)).catch(function(e) {
  14923. p.warn("Failed to embed:", t.src),
  14924. p.warn("with error:", e)
  14925. }).then(this.onMediaLoadFinished.bind(this))
  14926. }
  14927. .bind(this)),
  14928. n
  14929. }
  14930. ,
  14931. t.prototype.open = function(e) {
  14932. return this.openPromise = $.Deferred(),
  14933. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14934. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14935. this.state !== g.OPEN && (this.emit(b.OPENING),
  14936. e && this.emit(b.ACTIVATING),
  14937. this.state = g.OPENING,
  14938. this.animateOpen(function() {
  14939. e && this.setActiveState(),
  14940. this.openPromise.resolve()
  14941. }
  14942. .bind(this)))
  14943. }
  14944. .bind(this), d.animation.openDelay),
  14945. s.cancel(this.closeTransition),
  14946. this.closePromise && this.closePromise.reject(),
  14947. this.closeTransition = void 0,
  14948. this.openPromise.promise())
  14949. }
  14950. ,
  14951. t.prototype.close = function(e) {
  14952. return this.closePromise = $.Deferred(),
  14953. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14954. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14955. this.state = g.CLOSING,
  14956. this.animateClose())
  14957. }
  14958. .bind(this), d.animation.closeDelay)),
  14959. s.cancel(this.openTransition),
  14960. this.openPromise && this.openPromise.reject(),
  14961. this.openTransition = void 0,
  14962. this.closePromise.resolve(),
  14963. this.closePromise.promise())
  14964. }
  14965. ,
  14966. t.prototype.setActiveState = function() {
  14967. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14968. this.emit(b.ACTIVATE),
  14969. this.div.classList.remove("has-hotzone"))
  14970. }
  14971. ,
  14972. t.prototype.animateOpen = function(e) {
  14973. if (this.state === g.OPENING) {
  14974. if (s.cancel(this.animationTransition),
  14975. c.detectSamsungNative())
  14976. return this.boardOrientation = null,
  14977. this.div.style.visibility = "visible",
  14978. this.emit(b.OPENED),
  14979. this.state = g.OPEN,
  14980. void (e && e());
  14981. this.div.style.webkitTransform = "scale(0)",
  14982. this.div.style.transform = "scale(0)",
  14983. this.div.style.visibility = "visible",
  14984. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14985. this.emit(b.OPENED),
  14986. this.state = g.OPEN,
  14987. e && e()
  14988. }
  14989. .bind(this))
  14990. }
  14991. }
  14992. ,
  14993. t.prototype.animateClose = function(e) {
  14994. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14995. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14996. this.emit(b.CLOSED),
  14997. this.state = g.CLOSED,
  14998. this.div.style.visibility = "hidden",
  14999. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15000. e && e()
  15001. }
  15002. .bind(this)))
  15003. }
  15004. ,
  15005. t.prototype.needsUpdate = function() {
  15006. return this.state !== g.CLOSED
  15007. }
  15008. ,
  15009. t.prototype.update = function(e, t) {
  15010. if (this.needsUpdate()) {
  15011. var i = (this.updateOrientation(e),
  15012. this.calcScale(t))
  15013. , n = {
  15014. x: (e.x + 1) * $("#player").width() / 2,
  15015. y: (e.y + 1) * $("#player").height() / 2
  15016. };
  15017. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15018. this.div.style.webkitTransform = this.div.screenTransform,
  15019. this.div.style.transform = this.div.screenTransform
  15020. }
  15021. }
  15022. ,
  15023. t.prototype.getDimensions = function() {
  15024. return this.div.getBoundingClientRect()
  15025. }
  15026. ,
  15027. t.prototype.calcScale = function(e) {
  15028. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15029. }
  15030. ,
  15031. t.prototype.updateOrientation = function(e) {
  15032. if (this.state !== g.ACTIVE) {
  15033. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  15034. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  15035. , n = "";
  15036. n += 0 == i ? "right" : 2 == i ? "left" : "",
  15037. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  15038. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  15039. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15040. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  15041. }
  15042. }
  15043. ,
  15044. t.prototype.applyOrientation = function(e) {
  15045. this.div.style.transform = this.div.style.webkitTransform = "",
  15046. this.div.classList.remove("tag-container-" + this.orientation),
  15047. this.div.classList.add("tag-container-" + e);
  15048. var t = window.getComputedStyle(this.div);
  15049. this.initialTransform = t.transform || t.webkitTransform,
  15050. "none" === this.initialTransform && (this.initialTransform = "");
  15051. var i = t.transform.slice(7, -1).split(",")
  15052. , n = -i[4]
  15053. , r = -i[5];
  15054. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15055. this.div.style.transformOrigin = n + "px " + r + "px",
  15056. this.orientation = e
  15057. }
  15058. ,
  15059. v.exports = t
  15060. }
  15061. ).call(this, "/js/tag/Billboard/Billboard.js")
  15062. }
  15063. , {
  15064. "../../util/browser": 182,
  15065. "../../util/lerp": 188,
  15066. "../../util/logger": 189,
  15067. "../../util/transitions": 195,
  15068. "../Media/EmbedlyEmbed": 125,
  15069. "../Media/EmbedlyPlayer": 126,
  15070. "../Media/Image": 128,
  15071. "../Media/Link": 129,
  15072. "../Media/MediaEvent": 131,
  15073. "../Parser/DescriptionChunkType": 133,
  15074. "../Parser/DescriptionParser": 134,
  15075. "./BillboardEvent": 120,
  15076. "./billboardSettings": 121,
  15077. "./overlaySettings": 122,
  15078. events: 202
  15079. }],
  15080. 120: [function(e, t, i) {
  15081. "use strict";
  15082. t.exports = Object.freeze({
  15083. ENTER: "billboard.enter",
  15084. LEAVE: "billboard.leave",
  15085. OPENING: "billboard.opening",
  15086. OPENED: "billboard.open",
  15087. CLOSING: "billboard.closing",
  15088. CLOSED: "billboard.closed",
  15089. ACTIVATING: "billboard.activating",
  15090. ACTIVATE: "billboard.activate"
  15091. })
  15092. }
  15093. , {}],
  15094. 121: [function(e, t, i) {
  15095. "use strict";
  15096. t.exports = Object.freeze({
  15097. animation: Object.freeze({
  15098. hoverOnClosing: !1,
  15099. openDelay: 100,
  15100. closeDelay: 50,
  15101. openDuration: 200,
  15102. closeDuration: 100
  15103. }),
  15104. boardToDiscRatio: 1.2
  15105. })
  15106. }
  15107. , {}],
  15108. 122: [function(e, t, i) {
  15109. "use strict";
  15110. t.exports = Object.freeze({
  15111. boundaryWidth: 30,
  15112. boundaryHeight: 0
  15113. })
  15114. }
  15115. , {}],
  15116. hot: [function(e, t, i) {
  15117. "use strict";
  15118. function n(e, t, i) {
  15119. this.sid = e,
  15120. this.position = this.convertValue(t.position, g.Vector3)
  15121. if(t.quaternion){
  15122. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  15123. }else{
  15124. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  15125. }
  15126. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15127. this.isSprite = t.isSprite
  15128. this.noAction = t.noAction
  15129. this.linkType = t.linkType || "common"
  15130. this.link = t.link,
  15131. this.model = i,
  15132. this.size = t.size;
  15133. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15134. this.build()
  15135. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  15136. this.changeTex()
  15137. this.setVisiblePanos(t.visiblePanos);
  15138. this.infoAttribute = t.infoAttribute;
  15139. }
  15140. var g = e("three")
  15141. , r = e("../shaders")
  15142. , m = e("../settings")
  15143. , v = e("../enum/Viewmode")
  15144. , d = e("../objects/Panorama")
  15145. , o = e("../util/texture")
  15146. , math = e("../util/math")
  15147. , p = new g.Raycaster
  15148. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  15149. var defaultTex1 = o.load(g_HotImage.point);
  15150. var defaultTex2 = o.load(g_HotImage.point2)
  15151. n.prototype.changeTex = function(){
  15152. var u = this.mesh.material.uniforms
  15153. if(this.styleTex.length){
  15154. u.texture1.value = o.load(this.styleTex[0].src);
  15155. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  15156. }else{
  15157. u.texture1.value = defaultTex1;
  15158. u.texture2.value = defaultTex2;
  15159. }
  15160. }
  15161. n.prototype.initStyleImg = function(t){
  15162. this.styleTex = []
  15163. t.styleImg = t.styleImg || [];
  15164. t.styleImg.forEach((src)=>{
  15165. this.styleTex.push({src:manage.dealURL(src)})
  15166. })
  15167. this.changeTex()
  15168. }
  15169. n.prototype.update = function(camera) {
  15170. if(this.isSprite){
  15171. this.mesh.quaternion.copy(camera.quaternion)
  15172. }
  15173. }
  15174. n.prototype.setVisiblePanos = function(visibleData){
  15175. if(visibleData == "get"){
  15176. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15177. }else if(visibleData){
  15178. this.visiblePanos = visibleData;
  15179. }
  15180. }
  15181. n.prototype.build = function() {
  15182. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15183. var e = new g.Mesh(a, new g.ShaderMaterial({
  15184. uniforms: t,
  15185. vertexShader: r.hot.vertexShader,
  15186. fragmentShader: r.hot.fragmentShader,
  15187. transparent: !0
  15188. }))
  15189. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15190. e.dynamic = !0,
  15191. e.position.copy(this.position);
  15192. e.quaternion.copy(this.quaternion)
  15193. t && e.scale.set(t, t, t),
  15194. e.name = this.sid,
  15195. e.type = "hotSprite",
  15196. (e.belongHot = this).link && (e.hotLink = this.link),
  15197. this.mesh = e,
  15198. this.model.add(e),
  15199. g_HotMeshes.push(e);
  15200. }
  15201. n.prototype.createTitleElem = function(title){
  15202. var root = $("#hot");
  15203. var elem = $(`<div> ${title}</div>`)
  15204. root.append(elem);
  15205. this.titleElem = elem;
  15206. }
  15207. n.prototype.showTitle = function(){
  15208. if(!this.titleElem)return;
  15209. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15210. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15211. this.titleElem.css("display","block");
  15212. }
  15213. n.prototype.hideTitle = function(){
  15214. if(!this.titleElem)return;
  15215. this.titleElem.css("display","none");
  15216. }
  15217. ,
  15218. n.prototype.closestPanoTowardTag = function(e, t) {
  15219. var i = []
  15220. , n = []
  15221. , r = this.mesh.position;
  15222. if (e === v.PANORAMA) {
  15223. var o = t.position.clone().sub(r).normalize();
  15224. n.push(d.scoreFunctions.direction(r, o))
  15225. }
  15226. var a = new g.Vector3;
  15227. i.push(function(e) {
  15228. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15229. }, function(e) {
  15230. a.copy(r).sub(e.position);
  15231. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15232. , i = m.tags.navigate.tiltTolerance;
  15233. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15234. },
  15235. (pano)=>{ // add
  15236. player.checkHasNeighbor(pano)
  15237. }
  15238. ),
  15239. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15240. var s = t.model.panos.sortByScore(i, n);
  15241. if (s && m.tags.navigate.lineOfSight) {
  15242. for (var l = 0; l < s.length; l++) {
  15243. var c = s[l].pano
  15244. , h = c.position.distanceTo(r);
  15245. p.set(c.position, r.clone().sub(c.position).normalize());
  15246. var u = p.intersectObjects(t.model.colliders);
  15247. if (0 === u.length || u[0].distance > h)
  15248. return console.log(l),
  15249. c
  15250. }
  15251. return null
  15252. }
  15253. return s && 0 < s.length && s[0].pano
  15254. }
  15255. var getLink = function(link){
  15256. var src = '';
  15257. var r = link.substring(link.indexOf("html") + 4)
  15258. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15259. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15260. return src
  15261. }
  15262. n.prototype.examine = function(e, options) {
  15263. options = options || {}
  15264. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15265. var src = getLink(this.infoAttribute.iframe[0]);
  15266. if(this.linkType=="jumpLink"){
  15267. var newPage = window.open(src, "_blank" );
  15268. newPage.focus();
  15269. }else if(this.linkType=="iframeDiv"){
  15270. var div = document.createElement("div");
  15271. $("body").append(div);
  15272. div.style.position = 'fixed';
  15273. div.style.width = div.style.height = "100%";
  15274. div.style.left = div.style.top = '0';
  15275. div.style["z-index"] = "999"
  15276. var exit = document.createElement("div");
  15277. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15278. exit.style.position = 'absolute';
  15279. exit.style.width = exit.style.height = "50px";
  15280. exit.style.left = '17px'; exit.style.top = "20px"
  15281. exit.style.cursor = "pointer";
  15282. exit.style["background-repeat"] = "no-repeat";
  15283. exit.style["background-size"] = "25%";
  15284. exit.style["background-position"] = "center center";
  15285. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15286. exit.style["border-radius"] = "50%";
  15287. exit.style["z-index"] = "3"
  15288. exit.onclick = ()=>{
  15289. $(div).remove()
  15290. if(g_bgAudio && g_bgAudio.pauseByHot){
  15291. manage.switchBgmState(true)
  15292. }
  15293. }
  15294. var myElement = document.createElement("iframe");
  15295. myElement.style.position = 'absolute';
  15296. myElement.style.width = myElement.style.height = "100%";
  15297. myElement.style.left = myElement.style.top = '0';
  15298. myElement.src = src
  15299. div.appendChild(exit);
  15300. div.appendChild(myElement)
  15301. if(g_bgAudio && !g_bgAudio.paused){
  15302. manage.switchBgmState(false);
  15303. g_bgAudio.pauseByHot = true
  15304. }
  15305. if(g_tourAudio)g_tourAudio.pause()
  15306. }
  15307. return;
  15308. }
  15309. if(!player.currentPano)return;
  15310. var i = document.getElementById("popup");
  15311. if (this.link && !options.dontOpen) {
  15312. g_currentHot = this,
  15313. i.style.display = "block",
  15314. i.classList.add("wait");
  15315. var n = document.createElement("iframe");
  15316. if(g_bgAudio && !g_bgAudio.paused){
  15317. manage.switchBgmState(false);
  15318. g_bgAudio.pauseByHot = true
  15319. }
  15320. if(g_tourAudio)g_tourAudio.pause()
  15321. var src = getLink(this.link )
  15322. n.src = src;
  15323. n.id = "id1",
  15324. n.allowTransparency = "true";
  15325. var a = document.getElementById("id1");
  15326. if (void 0 === a || null == a) {
  15327. document.querySelector(".popup-content").appendChild(n);
  15328. var s = !1;
  15329. window.loaddingSuccess = function() {
  15330. s = !0
  15331. }
  15332. ,
  15333. setTimeout(function e() {
  15334. if (s) {
  15335. var t = document.querySelector("#id1").contentWindow.document;
  15336. t.querySelector("video") && (t.querySelector("video").play(),
  15337. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15338. t.querySelector("audio") && t.querySelector("audio").play()
  15339. } else
  15340. setTimeout(e, 300)
  15341. }, 800)
  15342. }
  15343. }
  15344. var l = e.mode
  15345. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15346. , h = this.mesh.position;
  15347. e.flyingToTag = !0;
  15348. var u = function() {
  15349. e.flyingToTag = !1;
  15350. options.dontOpen || this.link && i.classList.remove("wait")
  15351. }
  15352. .bind(this);
  15353. if (l === v.PANORAMA) {
  15354. var d = {
  15355. pano: c,
  15356. lookAtPoint: h,
  15357. duration: null,
  15358. maxDistanceOverride: null,
  15359. skipWarpingCheck: !1
  15360. };
  15361. e.flyToPano(d, u)
  15362. } else {
  15363. var p = {
  15364. pano: c
  15365. };
  15366. if (h) {
  15367. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15368. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15369. }
  15370. p.callback = u,
  15371. p.duration = 1500,
  15372. p.mode = v.PANORAMA,
  15373. e.flyToNewMode(p)
  15374. }
  15375. }
  15376. ,
  15377. n.prototype.dispose = function(){
  15378. this.mesh.parent.remove(this.mesh);
  15379. var index = g_HotMeshes.indexOf(this.mesh);
  15380. g_HotMeshes.splice(index,1)
  15381. }
  15382. /* n.prototype.conversionArray = function(e) {
  15383. if ("[object Array]" == Object.prototype.toString.call(e))
  15384. return e;
  15385. var t = [];
  15386. for (var i in e)
  15387. t.push(parseFloat(e[i]));
  15388. return t
  15389. } */
  15390. n.prototype.convertValue = function(v ,Type){
  15391. var value;
  15392. if(v instanceof Array){
  15393. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15394. value = new Type().fromArray(v);
  15395. }else{
  15396. for(let i in v){v[i] = parseFloat(v[i])}
  15397. value = new Type().copy(v);
  15398. }
  15399. return value
  15400. }
  15401. ,
  15402. t.exports = n
  15403. }
  15404. , {
  15405. three: 217,
  15406. "../shaders": 167,
  15407. "../enum/Viewmode": 51,
  15408. "../objects/Panorama": 148,
  15409. "../util/texture": 194,
  15410. "../settings": 166,
  15411. "../util/math": 190,
  15412. }],
  15413. 123: [function(M, R, e) {
  15414. (function(e) {
  15415. "use strict";
  15416. function d(e, t, i) {
  15417. var n = i.version || "0";
  15418. "0" !== n && w.info("tag defined using version " + n),
  15419. this.model = e,
  15420. this.sid = t,
  15421. this.color = (new f.Color).set(i.color || o.tagDefault),
  15422. this.hoverColor = o._darken(this.color, .2),
  15423. this.floor = null,
  15424. this.floorIndex = i.floor,
  15425. this.mode = m.PANORAMA,
  15426. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15427. this.obj3d = null,
  15428. this.disc = null,
  15429. this.materials = {
  15430. disc: null,
  15431. pole: null
  15432. },
  15433. this.position = (new f.Vector3).copy(i.position),
  15434. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15435. this.discWorldPosition = null,
  15436. this.discScale = .05,
  15437. this.poleEnabled = i.stem.enabled,
  15438. this.billboard = new r(i.label,i.description,i.media,this),
  15439. this.visibleTransition = null,
  15440. this.hoveringDisc = !1
  15441. }
  15442. 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"),
  15443. 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);
  15444. d.prototype = Object.create(b.prototype),
  15445. d.raycaster = new f.Raycaster,
  15446. d.prototype.bindEvents = function() {
  15447. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15448. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15449. }
  15450. ,
  15451. d.prototype.build = function() {
  15452. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15453. this.floor && (this.billboard.build(this.model.sid),
  15454. this.obj3d = this.buildObject3D(),
  15455. this.floor.add(this.obj3d)),
  15456. this
  15457. }
  15458. ,
  15459. d.prototype.buildObject3D = function() {
  15460. var e = new f.Object3D;
  15461. e.position.copy(this.position);
  15462. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15463. t.bg.value = x,
  15464. t.mask.value = T,
  15465. t.color.value.copy(this.color),
  15466. this.materials.disc = new f.RawShaderMaterial({
  15467. transparent: !0,
  15468. vertexShader: A.tagDisc.vertexShader,
  15469. fragmentShader: A.tagDisc.fragmentShader,
  15470. uniforms: t
  15471. }),
  15472. this.disc = new f.Mesh(S,this.materials.disc),
  15473. this.disc.layers.set(a.TAG),
  15474. this.disc.position.copy(this.discPosition),
  15475. this.disc.renderOrder = s.tagDisc;
  15476. var i = (this.disc.tag = this).buildPole();
  15477. return i.layers.set(a.TAG),
  15478. i.renderOrder = s.tagStem,
  15479. e.add(i),
  15480. e.layers.set(a.TAG),
  15481. e.add(this.disc)
  15482. }
  15483. ,
  15484. d.prototype.buildPole = function() {
  15485. var e = new f.BufferGeometry
  15486. , t = new Float32Array(6);
  15487. return t[0] = t[1] = t[2] = 0,
  15488. t[3] = this.discPosition.x,
  15489. t[4] = this.discPosition.y,
  15490. t[5] = this.discPosition.z,
  15491. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15492. this.materials.pole = new f.LineBasicMaterial({
  15493. linewidth: g.tags.pole.width,
  15494. color: g.tags.pole.color,
  15495. opacity: 0,
  15496. visible: this.poleEnabled,
  15497. transparent: !0,
  15498. depthWrite: !1
  15499. }),
  15500. new f.Line(e,this.materials.pole)
  15501. }
  15502. ,
  15503. d.prototype.setFreeState = function(e) {
  15504. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15505. this.materials.disc.uniforms.color.value = this.color
  15506. }
  15507. .bind(this))
  15508. }
  15509. ,
  15510. d.prototype.setHoverState = function(e) {
  15511. this.billboard.open(e),
  15512. this.materials.disc.uniforms.color.value = this.hoverColor
  15513. }
  15514. ,
  15515. d.prototype.hide = function(e, t) {
  15516. var i = $.Deferred();
  15517. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15518. return i.resolve().promise();
  15519. e = e || 0,
  15520. t = t || 0,
  15521. C.cancel(this.visibleTransition);
  15522. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15523. return this.visibleTransition = C.start((n = this,
  15524. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15525. o = I.property(n.materials.pole, "opacity", 0),
  15526. function(e) {
  15527. r(e),
  15528. n.materials.pole && o(e)
  15529. }
  15530. ), s * a, function() {
  15531. i.resolve()
  15532. }, l, E[g.warp.blendEasing]),
  15533. i.promise()
  15534. }
  15535. ,
  15536. d.prototype.show = function(e, t) {
  15537. var i = $.Deferred();
  15538. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15539. return i.resolve().promise();
  15540. e = e || 0,
  15541. t = t || 0,
  15542. C.cancel(this.visibleTransition);
  15543. 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;
  15544. return this.visibleTransition = C.start((n = this,
  15545. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15546. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15547. function(e) {
  15548. r(e),
  15549. n.materials.pole && o(e)
  15550. }
  15551. ), s * a, function() {
  15552. i.resolve()
  15553. }, l, E[g.warp.blendEasing]),
  15554. i.promise()
  15555. }
  15556. ,
  15557. d.prototype.closestPanoTowardTag = function(e, t) {
  15558. var i = []
  15559. , n = []
  15560. , r = this.disc.getWorldPosition();
  15561. if (e === m.PANORAMA) {
  15562. var o = t.position.clone().sub(r).normalize();
  15563. i.push(y.filters.isPanoAligned()),
  15564. i.push(y.filters.inPanoDirection(r, o, .5)),
  15565. i.push(y.filters.isNeighbourPanoTo(t)),
  15566. n.push(y.scoreFunctions.direction(r, o))
  15567. }
  15568. var a = new f.Vector3;
  15569. i.push(function(e) {
  15570. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15571. }, function(e) {
  15572. a.copy(r).sub(e.position);
  15573. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15574. , i = g.tags.navigate.tiltTolerance;
  15575. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15576. }),
  15577. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15578. var s = this.model.panos.sortByScore(i, n);
  15579. if (g.tags.navigate.lineOfSight) {
  15580. for (var l = 0; l < s.length; l++) {
  15581. var c = s[l].pano
  15582. , h = c.position.distanceTo(r);
  15583. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15584. return null;
  15585. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15586. var u = d.raycaster.intersectObjects(this.model.colliders);
  15587. if (0 === u.length || u[0].distance > h)
  15588. return c
  15589. }
  15590. return null
  15591. }
  15592. return 0 < s.length && s[0].pano
  15593. }
  15594. ,
  15595. d.prototype.examine = function(i) {
  15596. if(!player.currentPano)return;
  15597. var e = i.mode
  15598. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15599. , t = this.disc.getWorldPosition();
  15600. this.billboard.setActiveState();
  15601. var r = function() {
  15602. var e = this.billboard.getDimensions()
  15603. , t = new f.Vector3;
  15604. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15605. t.unproject(i.camera),
  15606. i.flyToPano({
  15607. pano: n,
  15608. lookAtPoint: t
  15609. })
  15610. }
  15611. .bind(this);
  15612. if (e === m.PANORAMA)
  15613. if (n !== i.currentPano) {
  15614. var o = {
  15615. pano: n,
  15616. lookAtPoint: t,
  15617. duration: null,
  15618. maxDistanceOverride: null,
  15619. skipWarpingCheck: !1
  15620. };
  15621. i.flyToPano(o, r)
  15622. } else
  15623. setTimeout(function() {
  15624. this.billboard.open().then(function() {
  15625. r()
  15626. })
  15627. }
  15628. .bind(this), 0);
  15629. else {
  15630. var a = {
  15631. pano: n
  15632. };
  15633. if (t) {
  15634. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15635. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15636. }
  15637. a.callback = r,
  15638. a.duration = 1500,
  15639. a.mode = m.PANORAMA,
  15640. i.flyToNewMode(a)
  15641. }
  15642. }
  15643. ,
  15644. d.prototype.update = (n = new f.Vector3,
  15645. function(e, t) {
  15646. this.discWorldPosition = this.disc.getWorldPosition(),
  15647. this.updateDisc(e, t),
  15648. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15649. n.z < 1 && (n.y *= -1,
  15650. this.billboard.update(n, this.getDiscRadius(n, t))))
  15651. }
  15652. ),
  15653. d.prototype.updateDisc = (l = new f.Vector3,
  15654. c = new f.Vector3,
  15655. h = new f.Vector3,
  15656. u = new f.Vector3,
  15657. p = new f.Vector3,
  15658. function(e, t) {
  15659. var i = g.tags.visibility
  15660. , n = g.tags.disc.scale
  15661. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15662. 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)),
  15663. this.obj3d.visible) {
  15664. this.disc.quaternion.copy(t.quaternion);
  15665. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15666. l.copy(this.discWorldPosition).project(t),
  15667. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15668. h.set(o / 2, 0, 0).add(c),
  15669. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15670. p.copy(u).unproject(t);
  15671. var a = p.distanceTo(this.discWorldPosition)
  15672. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15673. this.discScale = a * s,
  15674. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15675. }
  15676. }
  15677. ),
  15678. d.prototype.getDiscRadius = (i = new f.Vector3,
  15679. function(e, t) {
  15680. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15681. Math.abs(e.x - i.x) * $("#player").width()
  15682. }
  15683. ),
  15684. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15685. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15686. }
  15687. ,
  15688. d.prototype.offScreen = function(e, t) {
  15689. var i = e.getWorldPosition().project(t);
  15690. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15691. }
  15692. ,
  15693. d.viewportScale = function() {
  15694. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15695. d.viewportHeight = $("#player").height(),
  15696. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15697. d.currentViewportScale
  15698. }
  15699. ,
  15700. R.exports = d
  15701. }
  15702. ).call(this, "/js/tag/tag.js")
  15703. }
  15704. , {
  15705. "../enum/Colors": 19,
  15706. "../enum/RenderLayers": 41,
  15707. "../enum/RenderOrder": 42,
  15708. "../enum/Viewmode": 51,
  15709. "../objects/Panorama": 148,
  15710. "../settings": 166,
  15711. "../shaders": 167,
  15712. "../util/common": 185,
  15713. "../util/easing": 186,
  15714. "../util/lerp": 188,
  15715. "../util/logger": 189,
  15716. "../util/math": 190,
  15717. "../util/texture": 194,
  15718. "../util/transitions": 195,
  15719. "./Billboard/Billboard": 119,
  15720. "./Billboard/BillboardEvent": 120,
  15721. events: 202,
  15722. three: 217
  15723. }],
  15724. 124: [function(M, R, e) {
  15725. (function(e) {
  15726. "use strict";
  15727. function t() {
  15728. this.tagState = T.IDLE,
  15729. this.intersectTag = null,
  15730. this.hoveredTag = null,
  15731. this.activeTag = null,
  15732. this.tagDiscs = [],
  15733. this.raycaster = new i.Raycaster,
  15734. this.modelManager = null,
  15735. this.player = null,
  15736. this.totaltags = 0,
  15737. this.navigatingViaTag = !1,
  15738. this.enabled = !1
  15739. }
  15740. 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"),
  15741. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15742. r.extend(t, x),
  15743. t.prototype.init = function(e, t) {
  15744. this.modelManager = e,
  15745. this.player = t,
  15746. this.updateModel(),
  15747. this.bindEvents()
  15748. }
  15749. ,
  15750. t.prototype.update = function(e) {
  15751. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15752. }
  15753. ,
  15754. t.prototype.updateTags = function(e, t, i, n) {
  15755. for (var r in this.model.tags)
  15756. this.model.tags[r].update(e, t, i, n)
  15757. }
  15758. ,
  15759. t.prototype.updateModel = function() {
  15760. this.model = this.modelManager.getActiveModel(),
  15761. this.gettagsFromModel(),
  15762. this.totaltags = Object.keys(this.model.tags).length
  15763. }
  15764. ,
  15765. t.prototype.gettagsFromModel = function() {
  15766. for (var e in this.tagDiscs = [],
  15767. this.model.tags) {
  15768. var t = this.model.tags[e].disc;
  15769. t && this.tagDiscs.push(t)
  15770. }
  15771. }
  15772. ,
  15773. t.prototype.bindEvents = function() {
  15774. function e() {
  15775. Object.keys(this.model.tags).forEach(function(e) {
  15776. var t = this.model.tags[e];
  15777. t.bindEvents(),
  15778. t.billboard.on(y.LINK_CLICK, function(e) {
  15779. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15780. }
  15781. .bind(this)),
  15782. t.billboard.on(y.IMAGE_OPENED, function() {
  15783. this.tagState = T.EXAMINE,
  15784. this.emit(y.IMAGE_OPENED)
  15785. }
  15786. .bind(this)),
  15787. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15788. }
  15789. .bind(this))
  15790. }
  15791. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15792. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15793. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15794. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15795. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15796. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15797. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15798. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15799. e.call(this)
  15800. }
  15801. ,
  15802. t.prototype.navigateViaLink = function(e) {
  15803. var t = a.deserialize(e);
  15804. if (t)
  15805. if (t.mode === C.PANORAMA) {
  15806. try {
  15807. this.player.model.panos.get(t.panoId)
  15808. } catch (e) {
  15809. return void S.warn("Unable to find panorama location", t.panoId)
  15810. }
  15811. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15812. } else {
  15813. var i = {
  15814. cameraMode: t.mode,
  15815. position: t.position,
  15816. quaternion: t.quaternion,
  15817. scanId: t.panoId,
  15818. orthoZoom: t.zoom,
  15819. floorVisibility: t.floorVisibility,
  15820. thumbUrl: null,
  15821. name: null
  15822. };
  15823. this.player.flyToNewMode({
  15824. mode: t.mode,
  15825. duration: m.warp.outsideTime,
  15826. warpDest: new g(i),
  15827. force: !0
  15828. })
  15829. }
  15830. }
  15831. ,
  15832. t.prototype.handleWarpStart = function(e, t, i, n) {
  15833. this.dismissExaminedTag(),
  15834. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15835. e && (i = E.END),
  15836. this.hideShowTagsForBlackoutStyle(i, n))
  15837. }
  15838. ,
  15839. t.prototype.handleWarpInterruption = function(e, t, i) {
  15840. null != i || (i = m.warp.teleportTime),
  15841. this.hideShowTagsForBlackoutStyle(t, i)
  15842. }
  15843. ,
  15844. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15845. var i = 0
  15846. , n = 0
  15847. , r = t / 2;
  15848. switch (null != e || (e = E.MIDDLE),
  15849. e) {
  15850. case E.END:
  15851. this.hideAlltags(r);
  15852. break;
  15853. case E.BEGINNING:
  15854. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15855. break;
  15856. case E.NONE:
  15857. break;
  15858. case E.MIDDLE:
  15859. n = i = r,
  15860. this.hideAlltags(n),
  15861. setTimeout(function() {
  15862. this.showAlltags(i)
  15863. }
  15864. .bind(this), n);
  15865. break;
  15866. case E.FADEIN:
  15867. setTimeout(function() {
  15868. this.showAlltags(r)
  15869. }
  15870. .bind(this), r)
  15871. }
  15872. }
  15873. ,
  15874. t.prototype.onPlayerModeChanging = function(e, t) {
  15875. t !== C.PANORAMA && this.dismissExaminedTag(),
  15876. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15877. var i = t !== C.OUTDOOR;
  15878. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15879. }
  15880. ,
  15881. t.prototype.onPanoChange = function(e, t) {
  15882. var i = this.navigatingViaTag;
  15883. if (this.navigatingViaTag = !1,
  15884. !i) {
  15885. this.dismissExaminedTag();
  15886. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15887. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15888. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15889. }
  15890. }
  15891. ,
  15892. t.prototype.onPlayerReady = function(e, t, i) {
  15893. this.startAlltags(e, t ? i : null)
  15894. }
  15895. ,
  15896. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15897. this.updateClosestTags(e)
  15898. }
  15899. ,
  15900. t.prototype.dismissExaminedTag = function() {
  15901. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15902. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15903. this.hoveredTag = null)
  15904. }
  15905. ,
  15906. t.prototype.startAlltags = function(e, t) {
  15907. this.model.shouldShowtags = m.tags.enabled,
  15908. this.enabled = !0,
  15909. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15910. t && setTimeout(function() {
  15911. this.activateTag(this.model.getTagBySid(t))
  15912. }
  15913. .bind(this), m.tags.startup.fadeInDuration / 2))
  15914. }
  15915. ,
  15916. t.prototype.showAlltags = function(e, t, i) {
  15917. function n() {
  15918. ++o === this.totaltags && (this.model.tagsShown = !0,
  15919. r.resolve())
  15920. }
  15921. var r = $.Deferred();
  15922. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15923. return r.resolve().promise();
  15924. var o = 0;
  15925. for (var a in this.model.tags) {
  15926. this.model.tags[a].show(e, t).done(n.bind(this))
  15927. }
  15928. return r.promise()
  15929. }
  15930. ,
  15931. t.prototype.hideAlltags = function(e, t) {
  15932. function i() {
  15933. ++r === this.totaltags && (this.model.tagsShown = !1,
  15934. n.resolve())
  15935. }
  15936. var n = $.Deferred()
  15937. , r = 0;
  15938. for (var o in this.model.tags) {
  15939. var a = this.model.tags[o];
  15940. a.hide(e, t).done(i.bind(this)),
  15941. a === this.activeTag && this.dismissActiveTag()
  15942. }
  15943. return n.promise()
  15944. }
  15945. ,
  15946. t.prototype.enableHovering = function() {
  15947. this.enabled = !0
  15948. }
  15949. ,
  15950. t.prototype.disableHovering = function() {
  15951. this.enabled = !1
  15952. }
  15953. ,
  15954. t.prototype.activateTag = function(e, t) {
  15955. t = t || T.EXAMINE,
  15956. this.activeTag = e,
  15957. this.activeTag.hoveringDisc = !0,
  15958. this.activeTag.setHoverState(t === T.EXAMINE),
  15959. this.tagState = t,
  15960. this.emit(b.TagActivated, e)
  15961. }
  15962. ,
  15963. t.prototype.dismissActiveTag = function() {
  15964. this.activeTag.hoveringDisc = !1,
  15965. this.activeTag.setFreeState(!0);
  15966. var e = this.activeTag;
  15967. this.activeTag = null,
  15968. this.tagState = T.IDLE,
  15969. this.emit(b.TagDismissed, e)
  15970. }
  15971. ,
  15972. t.prototype.clickedOnTag = function(e) {
  15973. var t = function() {
  15974. this.navigatingViaTag = !0,
  15975. this.activeTag.examine(this.player),
  15976. this.emit(b.TagNavigation, this.activeTag)
  15977. }
  15978. .bind(this);
  15979. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15980. this.activeTag = this.intersectTag,
  15981. t(),
  15982. !0) : (this.dismissActiveTag(),
  15983. !1)
  15984. }
  15985. ,
  15986. t.prototype.intersecttag = (s = new i.Vector3,
  15987. l = new i.Vector3,
  15988. c = new i.Vector3,
  15989. function(e, t, i) {
  15990. if (!this.enabled)
  15991. return null;
  15992. var n = null
  15993. , r = this.tagDiscs.filter(function(e) {
  15994. return e.parent.visible
  15995. });
  15996. if (0 < r.length) {
  15997. var o = this.model.floors.reduce(function(e, t) {
  15998. return t.hidden ? e : e.concat(t.collider.children)
  15999. }, r);
  16000. s.set(e.x, e.y, -1).unproject(i),
  16001. l.set(e.x, e.y, 1).unproject(i),
  16002. c.copy(l).sub(s).normalize(),
  16003. this.raycaster.set(s, c);
  16004. var a = this.raycaster.intersectObjects(o);
  16005. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  16006. }
  16007. return this.intersectTag = n,
  16008. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  16009. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  16010. this.hoveredTag = n
  16011. }
  16012. .bind(this)),
  16013. n.billboard.on(v.LEAVE, function() {
  16014. this.hoveredTag = null
  16015. }
  16016. .bind(this))),
  16017. this.activateTag(n, T.BROWSE))),
  16018. n
  16019. }
  16020. ),
  16021. t.prototype.rankedtagInDirection = (h = [],
  16022. u = [],
  16023. d = new i.Vector3,
  16024. p = new i.Vector3,
  16025. f = new i.Vector3,
  16026. function(e, t, i, n) {
  16027. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  16028. var a = this.closesttags[o];
  16029. p.copy(a.position),
  16030. p.add(a.discPosition),
  16031. d.copy(t),
  16032. d.sub(p).negate(),
  16033. d.normalize();
  16034. var s = d.dot(n);
  16035. if (0 <= s && (f.copy(p),
  16036. f.project(i),
  16037. this.intersecttag(f, !1, i))) {
  16038. if (r >= h.length)
  16039. for (var l = 0; l < 64; l++)
  16040. h.push({
  16041. tag: a,
  16042. dot: s
  16043. });
  16044. var c = h[r];
  16045. c.tag = a,
  16046. c.dot = s,
  16047. c.position = math.projectPositionToCanvas(p, i),
  16048. u.push(c),
  16049. r++
  16050. }
  16051. }
  16052. return u.sort(function(e, t) {
  16053. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16054. }),
  16055. e < u.length ? u[e].tag : null
  16056. }
  16057. ),
  16058. t.prototype.updateClosestTags = (o = new i.Vector3,
  16059. function(e) {
  16060. this.closesttags || (this.closesttags = []),
  16061. this.closesttags.length = 0;
  16062. var t = this.model.tags;
  16063. if (t)
  16064. for (var i in t)
  16065. if (t.hasOwnProperty(i)) {
  16066. var n = t[i]
  16067. , r = n.position;
  16068. o.copy(e),
  16069. o.sub(r).negate(),
  16070. o.lengthSq() < 30 && this.closesttags.push(n)
  16071. }
  16072. }
  16073. ),
  16074. R.exports = t
  16075. }
  16076. ).call(this, "/js/tag/tagManager.js")
  16077. }
  16078. , {
  16079. "../controls/serializer": 14,
  16080. "../enum/BlackoutStyle": 18,
  16081. "../enum/tagEvents": 32,
  16082. "../enum/ModelManagerEvents": 33,
  16083. "../enum/PlayerEvents": 40,
  16084. "../enum/TagStates": 44,
  16085. "../enum/Viewmode": 51,
  16086. "../enum/WarpStyle": 52,
  16087. "../objects/Snapshot": 153,
  16088. "../settings": 166,
  16089. "../util/common": 185,
  16090. "../util/lerp": 188,
  16091. "../util/logger": 189,
  16092. "./Billboard/BillboardEvent": 120,
  16093. "./Media/LinkType": 130,
  16094. "./Media/MediaEvent": 131,
  16095. events: 202,
  16096. three: 217
  16097. }],
  16098. 125: [function(r, o, e) {
  16099. (function(e) {
  16100. "use strict";
  16101. function t() {
  16102. this.embedWrapper = null,
  16103. this.embedElement = null
  16104. }
  16105. var i = r("../../util/ajax")
  16106. , a = r("./mediaSettings")
  16107. , n = r("../../settings")
  16108. , s = new (r("../../util/logger"))(e);
  16109. t.prototype.createDomElement = function() {
  16110. return this.embedWrapper = document.createElement("div"),
  16111. this.embedWrapper.classList.add("tag-embed"),
  16112. this.embedWrapper.classList.add("hidden"),
  16113. this.embedWrapper
  16114. }
  16115. ,
  16116. t.prototype.load = function(e) {
  16117. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  16118. return new Promise(function(r, o) {
  16119. i.get(t).then(function(e) {
  16120. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  16121. this.embedWrapper.innerHTML = e.html;
  16122. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  16123. if (this.embedWrapper.style.width = t + "px",
  16124. e.height) {
  16125. var i = e.height / e.width;
  16126. this.embedWrapper.style.height = t * i + "px"
  16127. }
  16128. this.embedElement = this.embedWrapper.firstChild;
  16129. var n = [];
  16130. try {
  16131. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  16132. } catch (e) {
  16133. s.debug("Error getting `a` elements for embed; was it an iframe?")
  16134. }
  16135. n.forEach(function(e) {
  16136. e.setAttribute("target", "_blank")
  16137. }),
  16138. this.embedElement.classList.add("hidden"),
  16139. this.embedWrapper.classList.remove("hidden"),
  16140. r()
  16141. } else
  16142. o("Not a valid embed")
  16143. }
  16144. .bind(this), function(e) {
  16145. o(e.response)
  16146. })
  16147. }
  16148. .bind(this))
  16149. }
  16150. ,
  16151. t.prototype.show = function() {
  16152. this.embedElement && this.embedElement.classList.remove("hidden")
  16153. }
  16154. ,
  16155. t.prototype.hide = function() {
  16156. this.embedElement && this.embedElement.classList.add("hidden")
  16157. }
  16158. ,
  16159. o.exports = t
  16160. }
  16161. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16162. }
  16163. , {
  16164. "../../settings": 166,
  16165. "../../util/ajax": 181,
  16166. "../../util/logger": 189,
  16167. "./mediaSettings": 132
  16168. }],
  16169. 126: [function(a, s, e) {
  16170. (function(e) {
  16171. "use strict";
  16172. function t(e) {
  16173. r.call(this),
  16174. this.options = e,
  16175. this.playerControls = null,
  16176. this.state = o.NOT_READY
  16177. }
  16178. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16179. Object.freeze({
  16180. NOT_READY: "player.not.ready",
  16181. CUED: "player.cued",
  16182. PLAYING: "player.playing",
  16183. PAUSED: "player.paused"
  16184. }));
  16185. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16186. return this.embedWrapper = document.createElement("div"),
  16187. this.embedWrapper.classList.add("tag-video"),
  16188. this.embedWrapper.classList.add("hidden"),
  16189. this.embedWrapper
  16190. }
  16191. ,
  16192. t.prototype.load = function(e) {
  16193. var t = function() {
  16194. function e(e) {
  16195. this.playerState = e
  16196. }
  16197. this.playerControls = new playerjs.Player(this.embedElement),
  16198. this.playerControls.on("ready", function(e) {
  16199. this.playerState = o.CUED,
  16200. this.options.startMuted && this.playerControls.mute()
  16201. }
  16202. .bind(this)),
  16203. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16204. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16205. this.playerControls.on("ended", function(e) {
  16206. this.playerControls.setCurrentTime(0),
  16207. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16208. }
  16209. .bind(this))
  16210. }
  16211. .bind(this);
  16212. return r.prototype.load.call(this, e).then(t.bind(this))
  16213. }
  16214. ,
  16215. t.prototype.play = (i = n.isMobile(),
  16216. function() {
  16217. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16218. }
  16219. ),
  16220. t.prototype.pause = function() {
  16221. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16222. }
  16223. ,
  16224. s.exports = t
  16225. }
  16226. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16227. }
  16228. , {
  16229. "../../util/browser": 182,
  16230. "../../util/logger": 189,
  16231. "./EmbedlyEmbed": 125
  16232. }],
  16233. 127: [function(t, i, e) {
  16234. (function(e) {
  16235. "use strict";
  16236. var r = t("../../util/ajax")
  16237. , o = new (t("./mediaSettings"),
  16238. t("../../util/logger"))(e)
  16239. , a = Promise.resolve();
  16240. i.exports.enqueue = function(i) {
  16241. function n() {}
  16242. return a = new Promise(function(e, t) {
  16243. a.catch(n).then(function() {
  16244. (o.debug("requesting file from embedly:", i.href),
  16245. r.get(i.href, {
  16246. responseType: i.responseType
  16247. }).then(function(e) {
  16248. return o.debug("requesting file finished:", i.href),
  16249. e
  16250. })).then(e, t)
  16251. })
  16252. }
  16253. )
  16254. }
  16255. }
  16256. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16257. }
  16258. , {
  16259. "../../util/ajax": 181,
  16260. "../../util/logger": 189,
  16261. "./mediaSettings": 132
  16262. }],
  16263. 128: [function(s, l, e) {
  16264. (function(e) {
  16265. "use strict";
  16266. function t() {
  16267. this.imageWrapper = null,
  16268. this.width = 0,
  16269. this.height = 0,
  16270. this.aspect = 1
  16271. }
  16272. var i = s("./MediaEvent")
  16273. , n = s("./EmbedlyQueue")
  16274. , r = s("events").EventEmitter
  16275. , o = s("../../util/logger")
  16276. , a = s("../../settings");
  16277. new o(e),
  16278. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16279. return this.imageWrapper = document.createElement("div"),
  16280. this.imageWrapper.classList.add("tag-image"),
  16281. this.imageWrapper.classList.add("hidden"),
  16282. this.imageWrapper.addEventListener("click", function(e) {
  16283. e.stopPropagation(),
  16284. this.emit(i.IMAGE_OPENING),
  16285. this.imageWrapper.style.pointerEvents = "none"
  16286. }
  16287. .bind(this)),
  16288. this.imageWrapper
  16289. }
  16290. ,
  16291. t.prototype.onClosed = function() {
  16292. this.imageWrapper.style.pointerEvents = "auto"
  16293. }
  16294. ,
  16295. t.prototype.load = function(e) {
  16296. var t = Math.max(window.screen.height, window.screen.width)
  16297. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16298. return new Promise(function(o, e) {
  16299. n.enqueue({
  16300. href: i,
  16301. responseType: "arraybuffer"
  16302. }).then(function(e) {
  16303. var t = new Uint8Array(e)
  16304. , i = new Blob([t])
  16305. , n = new window.Image;
  16306. n.addEventListener("load", function(e) {
  16307. var t = e.target;
  16308. this.width = t.naturalWidth,
  16309. this.height = t.naturalHeight,
  16310. this.aspect = this.width / this.height;
  16311. var i = e.target.src;
  16312. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16313. this.imageWrapper.style.width = this.width + "px",
  16314. this.imageWrapper.style.height = this.height + "px",
  16315. this.imageWrapper.classList.remove("hidden"),
  16316. o()
  16317. }
  16318. .bind(this));
  16319. var r = URL.createObjectURL(i);
  16320. n.src = r
  16321. }
  16322. .bind(this), e)
  16323. }
  16324. .bind(this))
  16325. }
  16326. ,
  16327. l.exports = t
  16328. }
  16329. ).call(this, "/js/tag/Media/Image.js")
  16330. }
  16331. , {
  16332. "../../settings": 166,
  16333. "../../util/logger": 189,
  16334. "./EmbedlyQueue": 127,
  16335. "./MediaEvent": 131,
  16336. events: 202
  16337. }],
  16338. 129: [function(e, t, i) {
  16339. "use strict";
  16340. function n(e) {
  16341. this.label = e.label,
  16342. this.href = e.url,
  16343. this.type = this.updateLinkForType(),
  16344. this.domElement = null,
  16345. this.id = c++
  16346. }
  16347. var r = e("./LinkType")
  16348. , o = e("./MediaEvent")
  16349. , a = e("../../util/browser")
  16350. , s = e("../../analytics")
  16351. , l = e("events").EventEmitter
  16352. , c = 0;
  16353. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16354. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16355. 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,
  16356. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16357. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16358. r.MODEL) : r.EXT_LINK
  16359. }
  16360. ;
  16361. var h = {};
  16362. n.prototype.createDomElement = function() {
  16363. if (this.domElement = document.createElement("a"),
  16364. this.domElement.classList.add("tag-link"),
  16365. this.domElement.textContent = this.label,
  16366. this.type === r.EXT_LINK) {
  16367. this.domElement.textContent += " ";
  16368. var e = document.createElement("i");
  16369. e.classList.add("icon-ext-link"),
  16370. e.title = "Link to external web site",
  16371. this.domElement.appendChild(e)
  16372. }
  16373. return this.domElement.addEventListener("click", function(e) {
  16374. switch (e.stopPropagation(),
  16375. h[this.id] = !0,
  16376. s.trackAlways("click_tag_link", {
  16377. link_type: this.type,
  16378. link_count: c,
  16379. links_clicked: Object.keys(h).length
  16380. }),
  16381. this.type) {
  16382. case r.MODEL:
  16383. window.location.replace(this.href);
  16384. break;
  16385. case r.EXT_LINK:
  16386. window.open(this.href, "_blank")
  16387. }
  16388. this.emit(o.LINK_CLICK, {
  16389. type: this.type,
  16390. url: this.href
  16391. })
  16392. }
  16393. .bind(this)),
  16394. this.domElement
  16395. }
  16396. ,
  16397. t.exports = n
  16398. }
  16399. , {
  16400. "../../analytics": 4,
  16401. "../../util/browser": 182,
  16402. "./LinkType": 130,
  16403. "./MediaEvent": 131,
  16404. events: 202
  16405. }],
  16406. 130: [function(e, t, i) {
  16407. "use strict";
  16408. t.exports = {
  16409. NAVIGATION: "navigation",
  16410. MODEL: "model",
  16411. EXT_LINK: "ext-link"
  16412. }
  16413. }
  16414. , {}],
  16415. 131: [function(e, t, i) {
  16416. "use strict";
  16417. t.exports = Object.freeze({
  16418. LINK_CLICK: "mtmedia.link",
  16419. IMAGE_LOADED: "mtmedia.image.loaded",
  16420. IMAGE_OPENING: "mtmedia.image.opening",
  16421. IMAGE_OPENED: "mtmedia.image.opened",
  16422. IMAGE_CLOSING: "mtmedia.image.closing",
  16423. IMAGE_CLOSED: "mtmedia.image.closed",
  16424. VIDEO_START: "mtmedia.video.start",
  16425. VIDEO_PAUSE: "mtmedia.video.pause",
  16426. VIDEO_ENDED: "mtmedia.video.end"
  16427. })
  16428. }
  16429. , {}],
  16430. 132: [function(e, t, i) {
  16431. "use strict";
  16432. t.exports = Object.freeze({
  16433. maxEmbedWidth: 350,
  16434. defaultAspectRatio: .75
  16435. })
  16436. }
  16437. , {}],
  16438. 133: [function(e, t, i) {
  16439. "use strict";
  16440. t.exports = Object.freeze({
  16441. TEXT: "text",
  16442. LINK: "link",
  16443. IMAGE: "photo",
  16444. VIDEO: "video",
  16445. RICH: "rich"
  16446. })
  16447. }
  16448. , {}],
  16449. 134: [function(e, t, i) {
  16450. "use strict";
  16451. function n(e) {
  16452. this.capabilities = {
  16453. links: {
  16454. enable: e.supportLinks,
  16455. keepLabels: e.keepLinkLabels
  16456. }
  16457. }
  16458. }
  16459. var r = e("./DescriptionChunkType");
  16460. n.prototype.parse = function(e, i) {
  16461. var n = [];
  16462. return e.split("[").map(function(e, t) {
  16463. return 0 === t ? e : "[" + e
  16464. }).forEach(function(e) {
  16465. var t = this.findMarkdown(e);
  16466. if (t) {
  16467. if (-1 !== t.url.indexOf("javascript:"))
  16468. return;
  16469. this.addLinkChunk(n, t, i),
  16470. this.addTextChunk(n, e.slice(t.markdown.length))
  16471. } else
  16472. this.addTextChunk(n, e)
  16473. }
  16474. .bind(this)),
  16475. n
  16476. }
  16477. ,
  16478. n.prototype.findMarkdown = function(e) {
  16479. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16480. if (t) {
  16481. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16482. 0 !== n); )
  16483. r++;
  16484. var o = i.length - r;
  16485. return {
  16486. markdown: t[0].substring(0, t[0].length - o),
  16487. label: t[1],
  16488. url: t[2].substring(0, r)
  16489. }
  16490. }
  16491. }
  16492. ,
  16493. n.prototype.addTextChunk = function(e, t) {
  16494. 0 !== t.length && e.push({
  16495. type: r.TEXT,
  16496. text: t
  16497. })
  16498. }
  16499. ,
  16500. n.prototype.addLinkChunk = function(e, t) {
  16501. if (this.capabilities.links.enable) {
  16502. var i = {
  16503. label: t.label,
  16504. url: t.url
  16505. };
  16506. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16507. e.push({
  16508. type: r.LINK,
  16509. link: i
  16510. })
  16511. } else
  16512. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16513. }
  16514. ,
  16515. t.exports = n
  16516. }
  16517. , {
  16518. "./DescriptionChunkType": 133
  16519. }],
  16520. 135: [function(t, r, e) {
  16521. (function(e) {
  16522. "use strict";
  16523. var i = new (t("../util/logger"))(e)
  16524. , n = {
  16525. parseIdsFromChunkName: function(e, t) {
  16526. t.floorId = n.parseFloor(e),
  16527. t.roomId = n.parseRoom(e)
  16528. },
  16529. parseFloor: function(e) {
  16530. var t = e.match(/_group([0-9]+)/);
  16531. if (!t)
  16532. return 0;
  16533. try {
  16534. return parseInt(t[1], 10)
  16535. } catch (e) {
  16536. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16537. 0
  16538. }
  16539. },
  16540. parseRoom: function(e) {
  16541. var t = e.match(/_sub([0-9]+)/);
  16542. if (!t)
  16543. return -1;
  16544. try {
  16545. return parseInt(t[1], 10)
  16546. } catch (e) {
  16547. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16548. 0
  16549. }
  16550. }
  16551. };
  16552. r.exports = n
  16553. }
  16554. ).call(this, "/js/model/Chunks.js")
  16555. }
  16556. , {
  16557. "../util/logger": 189
  16558. }],
  16559. 136: [function(a, c, e) {
  16560. (function(e) {
  16561. "use strict";
  16562. function t(e) {
  16563. r.call(this),
  16564. this.model = e,
  16565. this.exploded = !1
  16566. }
  16567. var i = a("../objects/Floor")
  16568. , n = (a("../settings"),
  16569. a("../util/logger"))
  16570. , s = a("../util/transitions")
  16571. , r = a("../util/IndexedCollection")
  16572. , o = a("../util/common")
  16573. , l = a("../util/easing");
  16574. new n(e),
  16575. o.inherit(t, r),
  16576. t.prototype.add = function(e) {
  16577. r.prototype.add.call(this, e),
  16578. this.model.add(e)
  16579. }
  16580. ,
  16581. t.prototype.getIndex = function(e) {
  16582. return e.floorIndex
  16583. }
  16584. ,
  16585. t.prototype.build = function() {
  16586. this.list.forEach(function(e) {
  16587. e.build()
  16588. })
  16589. }
  16590. ,
  16591. t.prototype.size = function() {
  16592. return this.length
  16593. }
  16594. ,
  16595. t.prototype.sort = function() {
  16596. r.prototype.sort.call(this, function(e, t) {
  16597. return e.floorIndex - t.floorIndex
  16598. })
  16599. }
  16600. ,
  16601. t.prototype.nextFloor = function(e, t) {
  16602. return this.index[e.floorIndex + t] || null
  16603. }
  16604. ,
  16605. t.prototype.getFloorAtPoint = function(e) {
  16606. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16607. var r = this.list[n]
  16608. , o = r.distanceToPoint(e);
  16609. (!t || o < i) && (i = o,
  16610. t = r)
  16611. }
  16612. return t
  16613. }
  16614. ,
  16615. t.prototype.getOrMakeFloor = function(e) {
  16616. var t = this.index[e];
  16617. return t || (t = new i(this.model,e),
  16618. this.add(t)),
  16619. t
  16620. }
  16621. ,
  16622. t.prototype.hide = function() {
  16623. this.list.forEach(function(e) {
  16624. e.hide()
  16625. })
  16626. }
  16627. ,
  16628. t.prototype.show = function() {
  16629. this.list.forEach(function(e) {
  16630. e.show()
  16631. })
  16632. }
  16633. ,
  16634. t.prototype.names = function() {
  16635. return this.list.reduce(function(e, t) {
  16636. return e.concat(t.name)
  16637. }, [])
  16638. }
  16639. ,
  16640. t.prototype.toggleExplodeHorizontal = function() {
  16641. function i(e, t) {
  16642. a.copy(e.position),
  16643. e.position.x = r[e.floorIndex] * t,
  16644. e.position.y = 1 * e.floorIndex * t,
  16645. a.sub(e.position).multiplyScalar(-1),
  16646. e.panos.forEach(function(e) {
  16647. e.translate(a)
  16648. })
  16649. }
  16650. var n, r = [], o = 0;
  16651. this.list.forEach(function(e, t, i) {
  16652. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16653. o += n,
  16654. r[t] = o
  16655. }),
  16656. r = r.map(function(e) {
  16657. return e - o / 2
  16658. });
  16659. var a = this.list[0].position.clone();
  16660. this.exploded ? this.list.forEach(function(t) {
  16661. s.start(function(e) {
  16662. i(t, 1 - e)
  16663. }, 1500, null, 0, l.easeOutExpo)
  16664. }) : this.list.forEach(function(t) {
  16665. s.start(function(e) {
  16666. i(t, e)
  16667. }, 1500, null, 0, l.easeOutExpo)
  16668. }),
  16669. this.exploded = !this.exploded
  16670. }
  16671. ,
  16672. t.prototype.toggleExplodeVertical = function() {
  16673. function i(e, t) {
  16674. var i = i.copy(e.position);
  16675. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16676. i.sub(e.position).multiplyScalar(-1),
  16677. e.panos.forEach(function(e) {
  16678. e.translate(i)
  16679. })
  16680. }
  16681. var n = this.model.size;
  16682. this.list[0].position.clone(),
  16683. this.exploded ? this.list.forEach(function(t) {
  16684. s.start(function(e) {
  16685. i(t, 1 - e)
  16686. }, 1500, null, 0, l.easeOutExpo)
  16687. }) : this.list.forEach(function(t) {
  16688. s.start(function(e) {
  16689. i(t, e)
  16690. }, 1500, null, 0, l.easeOutExpo)
  16691. }),
  16692. this.exploded = !this.exploded
  16693. }
  16694. ,
  16695. c.exports = t
  16696. }
  16697. ).call(this, "/js/model/FloorCollection.js")
  16698. }
  16699. , {
  16700. "../objects/Floor": 146,
  16701. "../settings": 166,
  16702. "../util/IndexedCollection": 175,
  16703. "../util/common": 185,
  16704. "../util/easing": 186,
  16705. "../util/logger": 189,
  16706. "../util/transitions": 195
  16707. }],
  16708. 137: [function(r, o, e) {
  16709. (function(e) {
  16710. "use strict";
  16711. function h() {
  16712. n.call(this)
  16713. }
  16714. var u = r("../settings")
  16715. , t = r("../util/logger")
  16716. , d = r("../enum/Viewmode")
  16717. , p = r("../objects/Snapshot")
  16718. , i = (r("../util/math"),
  16719. r("../util/common"))
  16720. , n = r("../util/IndexedCollection")
  16721. , l = new t(e);
  16722. i.inherit(h, n),
  16723. h.prototype.getImage = function(e) {
  16724. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16725. }
  16726. ,
  16727. h.prototype.filterByModesAndReel = function(e, t) {
  16728. for (var i = [], n = 0; n < t.length; n += 1) {
  16729. var r = t[n]
  16730. , o = this.index[r.sid];
  16731. o && i.push(o)
  16732. }
  16733. var a = e[d.DOLLHOUSE]
  16734. , s = e[d.FLOORPLAN];
  16735. (i = i.filter(function(e) {
  16736. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16737. return !0;
  16738. var t;
  16739. try {
  16740. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16741. } catch (e) {
  16742. return l.debug(e.message),
  16743. !1
  16744. }
  16745. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16746. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16747. this.list = i,
  16748. this.reIndex()
  16749. }
  16750. ,
  16751. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16752. if (0 === this.list.length)
  16753. return [];
  16754. var locations = [];
  16755. var deal = (n, container)=>{
  16756. var r = n.thumbnail_signed_src,
  16757. o = n.name || "";
  16758. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16759. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16760. var a = panos.get(n.metadata.scan_id);
  16761. if (a && !a.isAligned()) return
  16762. }
  16763. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16764. if (s === d.MESH) return
  16765. if(window.isLocal)var src = manage.dealURL(r)
  16766. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16767. var l = {
  16768. cameraMode: s,
  16769. position: n.metadata.camera_position,
  16770. quaternion: n.metadata.camera_quaternion,
  16771. zoom: n.metadata.zoom,
  16772. panoId: n.metadata.scan_id,
  16773. orthoZoom: n.metadata.ortho_zoom,
  16774. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16775. thumbUrl: src,
  16776. name: h.filterImageName(o),
  16777. sid: n.sid
  16778. }
  16779. var item = new p(l);
  16780. item.momentTour = n.momentTour
  16781. container.push(item)
  16782. return item
  16783. }
  16784. }
  16785. this.list.forEach(image=>{
  16786. if(image.images){
  16787. var folder = $.extend({}, image )
  16788. folder.heroLocations = [];
  16789. image.images.list.forEach(child=>{
  16790. deal(child, folder.heroLocations);
  16791. })
  16792. folder.musicInfo = folder.musicInfo || {}
  16793. locations.push(folder)
  16794. delete folder.images;
  16795. delete folder.locations;
  16796. }else{
  16797. var item = deal(image, locations);
  16798. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16799. }
  16800. })
  16801. return locations
  16802. }
  16803. ,
  16804. h.prototype.getIndex = function(e) {
  16805. return e.sid
  16806. }
  16807. ,
  16808. h.filterImageName = function(e) {
  16809. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16810. }
  16811. ,
  16812. o.exports = h
  16813. }
  16814. ).call(this, "/js/model/ImageCollection.js")
  16815. }
  16816. , {
  16817. "../enum/Viewmode": 51,
  16818. "../objects/Snapshot": 153,
  16819. "../settings": 166,
  16820. "../util/IndexedCollection": 175,
  16821. "../util/common": 185,
  16822. "../util/logger": 189,
  16823. "../util/math": 190
  16824. }],
  16825. 138: [function(h, u, e) {
  16826. (function(e) {
  16827. "use strict";
  16828. function n() {
  16829. c.call(this)
  16830. }
  16831. var r = h("../label/Label")
  16832. , i = h("../settings")
  16833. , t = h("../util/logger")
  16834. , o = h("../util/math")
  16835. , a = h("../util/ajax")
  16836. , s = h("./RoomCollection")
  16837. , l = h("../util/common")
  16838. , c = h("../util/IndexedCollection");
  16839. new t(e),
  16840. l.inherit(n, c),
  16841. n.prototype.getIndex = function(e) {
  16842. return e.labelId
  16843. }
  16844. ,
  16845. n.prototype.associateWithRooms = function(e) {
  16846. this.forEach(function(t) {
  16847. e.forEach(function(e) {
  16848. e.roomId === t.roomId && (t.room = e)
  16849. })
  16850. })
  16851. }
  16852. ,
  16853. n.prototype.createFromLabelData = function(e) {
  16854. e.forEach(function(e) {
  16855. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16856. t = s.generateRoomId(e.floorId, t);
  16857. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16858. i.position = o.convertWorkshopVector(i.position),
  16859. this.add(i),
  16860. i.build()
  16861. }
  16862. .bind(this))
  16863. }
  16864. ,
  16865. n.prototype.load = function(e, t) {
  16866. return a.get(e, {
  16867. responseType: "json",
  16868. auth: t ? i.authorizationHeader : null
  16869. }).done(function(e) {
  16870. var t = [];
  16871. for (var i in e) {
  16872. var n = e[i];
  16873. t.push(n)
  16874. }
  16875. this.createFromLabelData(t)
  16876. }
  16877. .bind(this))
  16878. }
  16879. ,
  16880. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16881. var t = -1;
  16882. if (e) {
  16883. var i = e.split("_");
  16884. t = parseInt(i[0])
  16885. }
  16886. return t
  16887. }
  16888. ,
  16889. u.exports = n
  16890. }
  16891. ).call(this, "/js/model/LabelCollection.js")
  16892. }
  16893. , {
  16894. "../label/Label": 90,
  16895. "../settings": 166,
  16896. "../util/IndexedCollection": 175,
  16897. "../util/ajax": 181,
  16898. "../util/common": 185,
  16899. "../util/logger": 189,
  16900. "../util/math": 190,
  16901. "./RoomCollection": 141
  16902. }],
  16903. 139: [function(P, O, e) {
  16904. (function(e) {
  16905. "use strict";
  16906. function t(e, t) {
  16907. o.Object3D.call(this),
  16908. this.sid = window.number;//t.sid,
  16909. this.data = t,
  16910. this.options = e,
  16911. this.urls = new i(e.urlFiles),
  16912. this.isPublic = void 0 !== t.is_public && t.is_public,
  16913. //创建heroLocations
  16914. this.images = new E(this),
  16915. this.images.extend(t.images),
  16916. this.images.forEach((info)=>{
  16917. if(info.locations){
  16918. info.images = new E(this);
  16919. info.images.extend(info.locations)
  16920. }
  16921. })
  16922. this.heroLocations = []
  16923. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16924. this.outdoorPanoLocations = [],
  16925. this.floors = new c(this),
  16926. this.floorsEnabled = void 0 === e.floors || e.floors,
  16927. this.changingFloor = !1,
  16928. this.chunks = [],
  16929. this.panos = new g,
  16930. this.colliders = [],
  16931. this.loadPanosPromise = null,
  16932. this.loadMeshTexturesPromise = null,
  16933. this.auxDataPromise = null,
  16934. this.meshTexturesLoaded = !1,
  16935. this.meshTextures = [],
  16936. this.tags = {},
  16937. this.tagsShown = !1,
  16938. this.shouldShowtags = !1,
  16939. this.has360Views = !1,
  16940. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16941. this.supportedModes = {},
  16942. this.supportedModes[s.PANORAMA] = !0,
  16943. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16944. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16945. this.supportedModes[s.TRANSITIONING] = !0,
  16946. this.supportsTiles = this.configureTiling(),
  16947. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16948. this.mode = s.DOLLHOUSE,
  16949. this.size = null,
  16950. this.center = null,
  16951. this.boundingBox = new o.Box3,
  16952. this.currentFloor = null,
  16953. this.allFloorsVisible = !0,
  16954. this.projectedPano0 = null,
  16955. this.projectedPano1 = null,
  16956. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16957. this.addFloor(new r(this,t,e.trim()))
  16958. }
  16959. .bind(this)),
  16960. this.waitQueue = [],
  16961. this.on("load", function(e) {
  16962. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16963. return !e.isLoadedCallback()
  16964. }),
  16965. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16966. }
  16967. .bind(this)),
  16968. this.setupCustomProperties(),
  16969. this.hots = {}
  16970. }
  16971. var o = P("three")
  16972. , a = P("../util/ajax")
  16973. , i = P("../util/ModelUrls")
  16974. , n = P("../objects/BoundingTextureSkybox")
  16975. , s = P("../enum/Viewmode")
  16976. , l = P("../enum/RenderOrder")
  16977. , r = (P("../enum/AlignmentType"),
  16978. P("../objects/Floor"))
  16979. , c = P("./FloorCollection")
  16980. , h = P("../objects/Chunk")
  16981. , u = (P("../objects/Room"),
  16982. P("../objects/Snapshot"),
  16983. P("../label/Label"),
  16984. P("../util/math"),
  16985. P("../settings"))
  16986. , d = P("../shaders")
  16987. , p = P("../util/logger")
  16988. , f = (P("../tag/tag"),
  16989. P("../tag/tagManager"),
  16990. P("../objects/Panorama"))
  16991. , g = P("../util/PanoramaCollection")
  16992. , m = P("../loaders/ModelLoader")
  16993. , v = P("../loaders/ModelTextureLoader")
  16994. , y = P("../loaders/SweepDataLoader")
  16995. , A = P("../util/transitions")
  16996. , C = (P("../util/easing"),
  16997. P("../util/lerp"),
  16998. P("../util/common"))
  16999. , I = (P("../util/texture"),
  17000. P("./../util/browser"))
  17001. , E = P("./ImageCollection")
  17002. , _ = P("./RoomCollection")
  17003. , b = P("./LabelCollection")
  17004. , w = P("./Chunks")
  17005. , T = P("./../util/showcase")
  17006. , x = P("../exception/BasicException")
  17007. , S = (P("../constants"),
  17008. P("events").EventEmitter)
  17009. , M = P("hot")
  17010. , R = new p(e);
  17011. t.prototype = Object.create(o.Object3D.prototype),
  17012. C.extend(t, S),
  17013. t.prototype.setupCustomProperties = function() {
  17014. var t = u.modelAlpha;
  17015. Object.defineProperty(this, "alpha", {
  17016. get: function() {
  17017. return t
  17018. },
  17019. set: function(e) {
  17020. t = e,
  17021. this.chunks.forEach(function(e) {
  17022. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  17023. })
  17024. }
  17025. })
  17026. }
  17027. ,
  17028. t.prototype.configureTiling = function() {
  17029. var e = function() {
  17030. try {
  17031. var e = document.createElement("canvas")
  17032. , t = e.getContext("webgl");
  17033. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17034. } catch (e) {
  17035. return 0
  17036. }
  17037. }();
  17038. if (e < 2048)
  17039. return !1;
  17040. R.warn("Max cube texture size: " + e);
  17041. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  17042. var i = u.tiling.tilingFlagNames[t];
  17043. if ("1" === I.valueFromHash(i, null))
  17044. return !0;
  17045. if ("0" === I.valueFromHash(i, null))
  17046. return !1
  17047. }
  17048. return !!T.modelDataPromisesTiles(this.data)
  17049. }
  17050. ,
  17051. t.prototype.toggleAlpha = function() {
  17052. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17053. }
  17054. ,
  17055. t.prototype.load = function(e) {
  17056. var t = this.urls.init().then(function() {
  17057. return $.when(this.loadPanos(), this.loadMesh())
  17058. }
  17059. .bind(this));
  17060. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  17061. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  17062. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  17063. }
  17064. ,
  17065. t.prototype.loadMesh = function() {
  17066. var n = $.Deferred()
  17067. , r = this;
  17068. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  17069. if (0 === e.length) {
  17070. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17071. r.supportedModes[s.DOLLHOUSE] = !1,
  17072. r.supportedModes[s.FLOORPLAN] = !1;
  17073. var i = new h({
  17074. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17075. });
  17076. i.material.visible = !1,
  17077. i.rotateX(-Math.PI / 2),
  17078. i.geometry.computeBoundingBox(),
  17079. e = [i]
  17080. }
  17081. e.forEach(function(e) {
  17082. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  17083. r.addChunk(t, e)
  17084. }),
  17085. r.floors.sort(),
  17086. n.resolve(r)
  17087. }, function(e, t) {
  17088. n.notify(e, t)
  17089. }, function(e) {
  17090. R.error(e),
  17091. n.reject("loading-failed")
  17092. }),
  17093. n.promise()
  17094. }
  17095. ,
  17096. t.prototype.loadMeshTextures = function() {
  17097. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  17098. this.meshTexturesLoaded = !0
  17099. }
  17100. .bind(this))),
  17101. this.loadTexturesPromise
  17102. }
  17103. ,
  17104. t.prototype.shineHots = function() {
  17105. A.trigger({
  17106. func: function(e) {
  17107. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17108. for(var i in this.hots){
  17109. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17110. }
  17111. }
  17112. .bind(this),
  17113. cycling: !0,
  17114. duration: 3e3,
  17115. name: "hotShine"
  17116. })
  17117. }
  17118. ,
  17119. t.prototype.createHotItem = function(e, t) {
  17120. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  17121. var o = document.createElement("li")
  17122. , a = document.createElement("span");
  17123. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  17124. o.hot = t[n[r]],
  17125. o.appendChild(a),
  17126. i.appendChild(o)
  17127. }
  17128. document.querySelector("#hotListContent ul").appendChild(i),
  17129. console.log(i)
  17130. }
  17131. ,
  17132. t.prototype.loadOverlays = function(overlays){
  17133. var overlays = window.data2 && window.data2.overlays
  17134. overlays && overlays.forEach((info)=>{
  17135. new Overlay(info)
  17136. })
  17137. Overlay.load()
  17138. }
  17139. ,
  17140. t.prototype.loadhots = function() {
  17141. var r = $.Deferred()
  17142. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  17143. return a.get(e, {
  17144. responseType: "json",
  17145. auth: this.isPublic ? null : u.authorizationHeader
  17146. }).done(function(e) {
  17147. window.data2 = e;
  17148. if(!e){
  17149. console.error("data2 is null")
  17150. }else{
  17151. g_data2 = hotMatcher(e)
  17152. this.hotsCount = 0;
  17153. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17154. window.hotData = {}
  17155. if(e.hots){
  17156. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17157. sids.forEach((sid)=>{
  17158. this.hotsCount++,
  17159. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17160. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17161. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17162. window.hotData[sid] = e.hots[sid];
  17163. })
  17164. }
  17165. this.createHotItem(window.hotData, this.hots);
  17166. g_index = I.valueFromHash("m")
  17167. /* e.tourAudio && (g_tourAudio = new Audio,
  17168. g_tourAudio.loop = !1,
  17169. g_tourAudio.addEventListener("ended", function() {
  17170. var e = document.createEvent("MouseEvent");
  17171. e.initEvent("tourAudioEnded", !0, !0),
  17172. window.dispatchEvent(e)
  17173. })); */
  17174. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17175. //window.wx && manage.weixinShare(),
  17176. }
  17177. /* var i = $.Deferred()
  17178. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  17179. a.get(n, {
  17180. responseType: "json",
  17181. auth: this.isPublic ? null : u.authorizationHeader
  17182. }).done(function(e) {
  17183. window.hotData = e,
  17184. this.createHotItem(e, this.hots);
  17185. for(let i in this.hots){
  17186. e[i] && this.hots[i].initStyleImg(e[i]);
  17187. }
  17188. i.resolve()
  17189. }
  17190. .bind(this)).fail(function() {
  17191. console.log("Data.js is empty");
  17192. i.resolve()
  17193. }),
  17194. */
  17195. r.resolve()
  17196. }
  17197. .bind(this)).fail(function() {
  17198. console.log("没有热点"),
  17199. //window.wx && manage.weixinShare(),
  17200. r.resolve()
  17201. }),
  17202. r
  17203. }
  17204. ,
  17205. t.prototype.loadPanos = function() {
  17206. if (this.loadPanosPromise)
  17207. return this.loadPanosPromise;
  17208. var e = new y(this);
  17209. return this.loadPanosPromise = e.load().then(function(e) {
  17210. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17211. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17212. else console.log(e.uuid)
  17213. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17214. }
  17215. .bind(this))),
  17216. this.panos.extend(e.map(function(e) {
  17217. return new f(this,e.uuid,e,this.supportsTiles)
  17218. }
  17219. .bind(this))),
  17220. this.panos.forEach(function(i) {
  17221. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17222. var t = this.panos.get(e);
  17223. t && this.panos.setNeighbour(i, t, !0)
  17224. }
  17225. .bind(this)),
  17226. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17227. }
  17228. .bind(this)),
  17229. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17230. this.supportedModes[s.PANORAMA] = !1),
  17231. $.when(this)
  17232. }
  17233. .bind(this)),
  17234. this.loadPanosPromise
  17235. }
  17236. ,
  17237. t.prototype.loadHighlightReel = function() {
  17238. var t = $.Deferred()
  17239. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17240. return a.get(e, {
  17241. responseType: "json",
  17242. auth: this.isPublic ? null : u.authorizationHeader
  17243. }).done(function(e) {
  17244. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17245. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17246. t.resolve()
  17247. }
  17248. .bind(this)).fail(function() {
  17249. R.warn("Getting highlight reel failed, no highlights available"),
  17250. t.resolve()
  17251. }),
  17252. t
  17253. }
  17254. ,
  17255. t.prototype.waitForLoad = function(e, t) {
  17256. t() || (this.waitQueue.push({
  17257. object: e,
  17258. isLoadedCallback: t
  17259. }),
  17260. 1 === this.waitQueue.length && this.emit("waiting"))
  17261. }
  17262. ,
  17263. t.prototype.hide = function() {
  17264. this.floors.hide()
  17265. }
  17266. ,
  17267. t.prototype.show = function() {
  17268. this.floors.show()
  17269. }
  17270. ,
  17271. t.prototype.floorNames = function() {
  17272. return this.floors.names()
  17273. }
  17274. ,
  17275. t.prototype.warpDestFloors = function(e, t) {
  17276. if (e && this.floors.length === e.length) {
  17277. var i = e.findIndex(function(e) {
  17278. return e
  17279. }
  17280. .bind(this));
  17281. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17282. } else
  17283. this.toggleAllFloors(!0)
  17284. }
  17285. ,
  17286. t.prototype.setFloor = function(e, t, i) {
  17287. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17288. this.allFloorsVisible = !1,
  17289. this._setFloor(e, t, i)
  17290. }
  17291. ,
  17292. t.prototype.toggleAllFloors = function(e) {
  17293. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17294. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17295. this._setFloor(this.currentFloor)
  17296. }
  17297. ,
  17298. t.prototype._setFloor = function(e, t, i) {
  17299. var n;
  17300. if (t = t || this.mode,
  17301. this.emit("floor.changed", e, t, this.currentFloor),
  17302. this.currentFloor = e,
  17303. t === s.PANORAMA) {
  17304. if (this.show(),
  17305. this.shouldShowtags && this.tagsShown)
  17306. for (n in this.tags)
  17307. this.tags[n].show(u.showFloorDuration)
  17308. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17309. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17310. }
  17311. .bind(this)),
  17312. this.shouldShowtags && this.tagsShown))
  17313. for (n in this.tags) {
  17314. var r = this.tags[n];
  17315. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17316. }
  17317. var o = this
  17318. , a = e;
  17319. A.start(function() {}, u.showFloorDelay, function() {
  17320. o.floors.forEach(function(t) {
  17321. t.chunks.forEach(function(e) {
  17322. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17323. })
  17324. })
  17325. }
  17326. .bind(this))
  17327. }
  17328. ,
  17329. t.prototype.toggleExplode = function() {
  17330. this.floors.toggleExplodeHorizontal()
  17331. }
  17332. ,
  17333. t.prototype.toggleExplodeUp = function() {
  17334. this.floors.toggleExplodeVertical()
  17335. }
  17336. ,
  17337. t.prototype.nextFloor = function(e) {
  17338. return this.floors.nextFloor(this.currentFloor, e)
  17339. }
  17340. ,
  17341. t.prototype.addFloor = function(e) {
  17342. this.floors.add(e)
  17343. }
  17344. ,
  17345. t.prototype.getFloorAtPoint = function(e) {
  17346. return this.floors.getFloorAtPoint(e)
  17347. }
  17348. ,
  17349. t.prototype.getTagBySid = function(e) {
  17350. return this.tags[e]
  17351. }
  17352. ,
  17353. t.prototype.addChunk = function(e, t) {
  17354. this.floors.getOrMakeFloor(e).addChunk(t),
  17355. this.chunks.push(t)
  17356. }
  17357. ,
  17358. t.prototype.setMode = function(t) {
  17359. if (!this.supportedModes[t])
  17360. throw new x("Mode not supported for this model: " + t);
  17361. this.mode = t
  17362. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17363. this.chunks.forEach(function(e) {
  17364. e.setMode(t)
  17365. })
  17366. }
  17367. ,
  17368. t.prototype.build = function() {
  17369. this.heroLocations = this.images.getHeroLocations(this.panos);
  17370. var e = function() {
  17371. 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()
  17372. }
  17373. .bind(this)();
  17374. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17375. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17376. }
  17377. .bind(this)) || e,
  17378. null === this.heroImage && R.warn("No hero image defined."),
  17379. this.currentFloor = this.floors.last(),
  17380. this.floors.build(),
  17381. this.colliders = this.floors.reduce(function(e, t) {
  17382. return e.concat(t.collider.children)
  17383. }, []),
  17384. this.panos.forEach(function(e) {
  17385. e.build1(),
  17386. e.on("enter", function() {
  17387. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17388. }
  17389. .bind(this))
  17390. }
  17391. .bind(this)),
  17392. this.panos.forEach(function(e) {
  17393. e.build2()
  17394. }),
  17395. this.floors.forEach(function(e) {
  17396. this.boundingBox.union(e.boundingBox)
  17397. }
  17398. .bind(this)),
  17399. this.size = this.boundingBox.size(),
  17400. this.center = this.boundingBox.center(),
  17401. this.floors.forEach(function(e) {
  17402. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17403. }
  17404. .bind(this)),
  17405. this.panos.populate_path_graph(),
  17406. this.skybox = new n(this.boundingBox),
  17407. this.skybox.matrixWorldNeedsUpdate = !0,
  17408. this.add(this.skybox),
  17409. setTimeout(function() {
  17410. this.hotsCount && this.shineHots()
  17411. }
  17412. .bind(this), 1300),
  17413. this.tags)
  17414. this.tags[t].build();
  17415. return R.debug("Done building model"),
  17416. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17417. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17418. this.buildRooms(),
  17419. this.labels.associateWithRooms(this.rooms),
  17420. $.when(this)
  17421. }
  17422. ,
  17423. t.prototype.loadLabels = function() {
  17424. this.labels = new b(this);
  17425. var e = $.Deferred();
  17426. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17427. !this.showingLabels) */
  17428. return e.resolve();
  17429. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17430. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17431. R.warn("Getting labels failed, not displaying labels."),
  17432. e.resolve()
  17433. }),
  17434. e
  17435. }
  17436. ,
  17437. t.prototype.buildRooms = function() {
  17438. this.rooms = new _(this),
  17439. this.rooms.createFromChunks(this.chunks),
  17440. this.rooms.calcRoomBoundaries()
  17441. }
  17442. ,
  17443. t.prototype.updateProjectedPanos = function() {
  17444. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17445. }
  17446. ,
  17447. t.prototype.setProjectedPanos = function(t, i, n) {
  17448. null != n || (n = !0),
  17449. n = !!n,
  17450. this.projectedPano0 = t,
  17451. this.projectedPano1 = i,
  17452. this.skybox.material.setProjectedPanos(t, i, n),
  17453. this.chunks.forEach(function(e) {
  17454. e.materialInside.setProjectedPanos(t, i, n)
  17455. })
  17456. }
  17457. ,
  17458. t.prototype.setSide = function(t) {
  17459. this.floors.forEach(function(e) {
  17460. e.collider.material.side = t
  17461. })
  17462. }
  17463. ,
  17464. t.prototype.heroCount = function() {
  17465. return this.heroLocations ? this.heroLocations.length : 0
  17466. }
  17467. ,
  17468. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17469. if (e[0] < 0)
  17470. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17471. null;
  17472. if (this.heroCount() < 1)
  17473. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17474. null;
  17475. var t = this.heroLocations[e[0]];
  17476. if(t.heroLocations && e[1]!=void 0){
  17477. t = t.heroLocations[e[1]];
  17478. }
  17479. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17480. null) : t
  17481. }
  17482. ,
  17483. t.prototype.findPanoramicHero = function() {
  17484. for (var e in this.heroLocations)
  17485. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17486. return this.heroLocations[e];
  17487. return null
  17488. }
  17489. ,
  17490. t.prototype.listImagePanos = function() {
  17491. var i = []
  17492. , n = this;
  17493. return this.images.forEach(function(e) {
  17494. if (e.metadata && e.metadata.scan_id) {
  17495. var t = n.panos.get(e.metadata.scan_id);
  17496. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17497. }
  17498. }),
  17499. i
  17500. }
  17501. ,
  17502. t.prototype.fadePanoMarkers = function(e, t) {
  17503. this.panos.fadeMarkerOpacity(e, t)
  17504. }
  17505. ,
  17506. t.prototype.setSweepVisibility = function(t) {
  17507. this.panos.forEach(function(e) {
  17508. e.marker && (e.marker.visible = t)
  17509. })
  17510. }
  17511. ,
  17512. t.prototype.outsideAllowed = function() {
  17513. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17514. }
  17515. ,
  17516. O.exports = t
  17517. }
  17518. ).call(this, "/js/model/Model.js")
  17519. }
  17520. , {
  17521. "../constants": 8,
  17522. "../enum/AlignmentType": 17,
  17523. "../enum/RenderOrder": 42,
  17524. "../enum/Viewmode": 51,
  17525. "../exception/BasicException": 55,
  17526. "../label/Label": 90,
  17527. "../loaders/ModelLoader": 105,
  17528. "../loaders/ModelTextureLoader": 106,
  17529. "../loaders/SweepDataLoader": 107,
  17530. "../tag/tag": 123,
  17531. "../tag/tagManager": 124,
  17532. "../objects/BoundingTextureSkybox": 143,
  17533. "../objects/Chunk": 144,
  17534. "../objects/Floor": 146,
  17535. "../objects/Panorama": 148,
  17536. "../objects/Room": 150,
  17537. "../objects/Snapshot": 153,
  17538. "../settings": 166,
  17539. "../shaders": 167,
  17540. "../util/ModelUrls": 177,
  17541. "../util/PanoramaCollection": 178,
  17542. "../util/ajax": 181,
  17543. "../util/common": 185,
  17544. "../util/easing": 186,
  17545. "../util/lerp": 188,
  17546. "../util/logger": 189,
  17547. "../util/math": 190,
  17548. "../util/texture": 194,
  17549. "../util/transitions": 195,
  17550. "./../util/browser": 182,
  17551. "./../util/showcase": 193,
  17552. "./Chunks": 135,
  17553. "./FloorCollection": 136,
  17554. "./ImageCollection": 137,
  17555. "./LabelCollection": 138,
  17556. "./RoomCollection": 141,
  17557. events: 202,
  17558. three: 217,
  17559. hot: "hot"
  17560. }],
  17561. 140: [function(e, t, i) {
  17562. "use strict";
  17563. function n() {
  17564. this.modelMap = {},
  17565. this.activeModel = null,
  17566. this.modelCount = 0,
  17567. this.tileDownloader = null,
  17568. this.panoRenderer = null
  17569. }
  17570. var r = (e("three"),
  17571. e("../util/common"))
  17572. , o = e("../exception/BasicException")
  17573. , a = e("../enum/ModelManagerEvents")
  17574. , s = e("../enum/PanoRendererEvents")
  17575. , l = e("events").EventEmitter;
  17576. n.prototype.init = function(e, t, i) {
  17577. this.tileDownloader = e,
  17578. this.panoRenderer = t,
  17579. this.qualityManager = i,
  17580. this.bindEvents()
  17581. }
  17582. ,
  17583. n.prototype.bindEvents = function() {
  17584. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17585. }
  17586. ,
  17587. n.prototype.onTileRendered = function(e, t, i, n) {}
  17588. ,
  17589. n.prototype.addModel = function(e) {
  17590. this.modelMap[e.sid] = e,
  17591. 0 === this.modelCount && this.activateModel(e.sid),
  17592. this.modelCount++,
  17593. this.emit(a.ModelAdded)
  17594. }
  17595. ,
  17596. n.prototype.getModel = function(e) {
  17597. return this.modelMap[e]
  17598. }
  17599. ,
  17600. n.prototype.activateModel = function(e) {
  17601. var t = this.modelMap[e];
  17602. if (!t)
  17603. throw new o("Tried to activate invalid model!");
  17604. var i = this.activeModel;
  17605. this.activeModel = t,
  17606. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17607. this.tileDownloader.setUrls(t.urls),
  17608. t.panos.forEach(function(e) {
  17609. e.attachToPanoRenderer(this.panoRenderer),
  17610. e.tileDownloader = this.tileDownloader,
  17611. e.qualityManager = this.qualityManager
  17612. }
  17613. .bind(this)),
  17614. this.emit(a.ActiveModelChanged, {
  17615. oldModel: i,
  17616. model: t
  17617. })
  17618. }
  17619. ,
  17620. n.prototype.getActiveModel = function() {
  17621. return this.activeModel
  17622. }
  17623. ,
  17624. r.extend(n, l),
  17625. t.exports = n
  17626. }
  17627. , {
  17628. "../enum/ModelManagerEvents": 33,
  17629. "../enum/PanoRendererEvents": 35,
  17630. "../exception/BasicException": 55,
  17631. "../util/common": 185,
  17632. events: 202,
  17633. three: 217
  17634. }],
  17635. 141: [function(r, l, e) {
  17636. (function(e) {
  17637. "use strict";
  17638. function o() {
  17639. n.call(this)
  17640. }
  17641. var a = r("../objects/Room")
  17642. , t = (r("../settings"),
  17643. r("../util/logger"))
  17644. , i = (r("../util/transitions"),
  17645. r("../util/easing"),
  17646. r("../util/common"))
  17647. , n = r("../util/IndexedCollection")
  17648. , s = r("./Chunks");
  17649. new t(e),
  17650. i.inherit(o, n),
  17651. o.prototype.getIndex = function(e) {
  17652. return e.roomId
  17653. }
  17654. ,
  17655. o.prototype.calcRoomBoundaries = function() {
  17656. this.forEach(function(e) {
  17657. e.calcBoundaries()
  17658. })
  17659. }
  17660. ,
  17661. o.prototype.createFromChunks = function(e) {
  17662. var n = {
  17663. floorId: -1,
  17664. roomId: -1
  17665. }
  17666. , r = {};
  17667. e.forEach(function(e) {
  17668. s.parseIdsFromChunkName(e.name, n);
  17669. var t = r[n.roomId];
  17670. if (!t) {
  17671. var i = o.generateRoomId(n.floorId, n.roomId);
  17672. t = new a(n.floorId,i),
  17673. this.add(t),
  17674. r[n.roomId] = t
  17675. }
  17676. t.addChunk(e)
  17677. }
  17678. .bind(this)),
  17679. this.calcRoomBoundaries()
  17680. }
  17681. ,
  17682. o.generateRoomId = function(e, t) {
  17683. return e + "_" + t
  17684. }
  17685. ,
  17686. l.exports = o
  17687. }
  17688. ).call(this, "/js/model/RoomCollection.js")
  17689. }
  17690. , {
  17691. "../objects/Room": 150,
  17692. "../settings": 166,
  17693. "../util/IndexedCollection": 175,
  17694. "../util/common": 185,
  17695. "../util/easing": 186,
  17696. "../util/logger": 189,
  17697. "../util/transitions": 195,
  17698. "./Chunks": 135
  17699. }],
  17700. 142: [function(e, t, i) {
  17701. "use strict";
  17702. function n(e, t, i) {
  17703. var n = (e = e.clone().expandByScalar(0.01)).size()
  17704. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17705. r.boundingBox = e,
  17706. o.Mesh.call(this, r, t),
  17707. this.position.copy(e.center()),
  17708. this.frustumCulled = !1,
  17709. i && this.add(new o.WireframeHelper(this))
  17710. }
  17711. var o = e("three");
  17712. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17713. t.exports = n
  17714. }
  17715. , {
  17716. three: 217
  17717. }],
  17718. 143: [function(l, c, e) {
  17719. (function(e) {
  17720. "use strict";
  17721. function t(e) {
  17722. s.time("Computing a nice bounding cubemap");
  17723. var t = new r({
  17724. side: i.BackSide,
  17725. transparent: !0
  17726. });
  17727. t.uniforms.modelAlpha.value = 0,
  17728. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17729. this.renderOrder = a.boundingSkybox,
  17730. n.call(this, e, t),
  17731. s.timeEnd("Computing a nice bounding cubemap")
  17732. }
  17733. var i = l("three")
  17734. , n = (l("../enum/Viewmode"),
  17735. l("../shaders"),
  17736. l("./BoundingMesh"))
  17737. , r = l("../materials/ModelTextureMaterial")
  17738. , o = l("../settings")
  17739. , a = l("../enum/RenderOrder")
  17740. , s = new (l("../util/logger"))(e);
  17741. (t.prototype = Object.create(n.prototype)).constructor = t,
  17742. c.exports = t
  17743. }
  17744. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17745. }
  17746. , {
  17747. "../enum/RenderOrder": 42,
  17748. "../enum/Viewmode": 51,
  17749. "../materials/ModelTextureMaterial": 118,
  17750. "../settings": 166,
  17751. "../shaders": 167,
  17752. "../util/logger": 189,
  17753. "./BoundingMesh": 142,
  17754. three: 217
  17755. }],
  17756. 144: [function(e, t, i) {
  17757. "use strict";
  17758. function n(e) {
  17759. this.materialInside = new s({
  17760. side: r.DoubleSide
  17761. });
  17762. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17763. this.materialOutside = new r.RawShaderMaterial({
  17764. fragmentShader: o.modelOutside.fragmentShader,
  17765. vertexShader: o.modelOutside.vertexShader,
  17766. uniforms: t,
  17767. side: r.FrontSide,
  17768. name: "chunkOut"
  17769. }),
  17770. r.Mesh.call(this, e.geometry, this.materialInside),
  17771. this.name = e.name || "",
  17772. this.textureName = e.textureName,
  17773. this.meshUrl = e.meshUrl
  17774. }
  17775. var r = e("three")
  17776. , o = e("../shaders")
  17777. , a = e("../enum/Viewmode")
  17778. , s = e("../materials/ModelTextureMaterial");
  17779. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17780. this.materialInside.uniforms.map.value = e,
  17781. this.materialOutside.uniforms.map.value = e
  17782. }
  17783. ,
  17784. n.prototype.setMode = function(e) {
  17785. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17786. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17787. t.transparent = this.material.transparent,
  17788. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17789. this.material = t
  17790. }
  17791. ,
  17792. t.exports = n
  17793. }
  17794. , {
  17795. "../enum/Viewmode": 51,
  17796. "../materials/ModelTextureMaterial": 118,
  17797. "../shaders": 167,
  17798. three: 217
  17799. }],
  17800. 145: [function(e, t, i) {
  17801. "use strict";
  17802. function n(e) {
  17803. this.chunksize = e || 10,
  17804. this.chunks = {},
  17805. this.boundingBoxes = {},
  17806. this.children = [],
  17807. this.offset = new m.Vector3(0,.5,0),
  17808. this.material = new m.MeshBasicMaterial({
  17809. color: 16777215 * Math.random(),
  17810. side: m.DoubleSide
  17811. })
  17812. }
  17813. var m = e("three");
  17814. e("../enum/Viewmode"),
  17815. n.prototype.add = function(e) {
  17816. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17817. u ? (t = u.position.array,
  17818. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17819. e.faces);
  17820. var d = new m.Vector3;
  17821. if (i)
  17822. for (n = 0,
  17823. r = i.length; n < r; n += 3) {
  17824. var p = 3 * i[n]
  17825. , f = 3 * i[n + 1]
  17826. , g = 3 * i[n + 2];
  17827. o = (t[p] + t[f] + t[g]) / 3,
  17828. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17829. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17830. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17831. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17832. this.boundingBoxes[l] = new m.Box3),
  17833. 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]),
  17834. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17835. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17836. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17837. }
  17838. else
  17839. for (n = 0,
  17840. r = t.length; n < r; n += 9)
  17841. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17842. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17843. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17844. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17845. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17846. this.boundingBoxes[l] = new m.Box3),
  17847. 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]),
  17848. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17849. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17850. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17851. }
  17852. ,
  17853. n.prototype.build = function() {
  17854. var e = new m.Object3D;
  17855. for (var t in e.material = this.material,
  17856. this.chunks) {
  17857. var i = this.chunks[t]
  17858. , n = new m.BufferGeometry;
  17859. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17860. n.boundingBox = this.boundingBoxes[t];
  17861. var r = new m.Mesh(n,this.material);
  17862. r.material.visible = !1,
  17863. e.add(r),
  17864. this.chunks[t] = []
  17865. }
  17866. return e
  17867. }
  17868. ,
  17869. t.exports = n
  17870. }
  17871. , {
  17872. "../enum/Viewmode": 51,
  17873. three: 217
  17874. }],
  17875. 146: [function(e, t, i) {
  17876. "use strict";
  17877. var n = e("three")
  17878. , r = e("../settings")
  17879. , o = e("../util/common")
  17880. , a = e("../util/lerp")
  17881. , s = e("./ChunkedCollider")
  17882. , l = e("../util/transitions")
  17883. , c = e("../util/easing")
  17884. , h = (e("../objects/Panorama"),
  17885. e("../enum/RenderOrder"));
  17886. e("../localization/localize");
  17887. function u(e, t, i) {
  17888. n.Object3D.call(this),
  17889. this.model = e,
  17890. this.floorIndex = t,
  17891. this.lang = r.languageTag,
  17892. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17893. this.panos = [],
  17894. this.chunks = [],
  17895. this.colliderBuilder = new s(3),
  17896. this.collider = null,
  17897. this.center = null,
  17898. this.boundingBox = new n.Box3,
  17899. this.size = null,
  17900. this.hidden = !1,
  17901. this.conservativeBoundingBox = new n.Box3,
  17902. this.debugColor = 16777215 * Math.random(),
  17903. this.transition = null
  17904. }
  17905. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17906. this.model.setFloor(this, e)
  17907. }
  17908. ,
  17909. u.prototype.hide = function(e) {
  17910. if (!this.hidden || this.transition) {
  17911. this.chunks.forEach(function(e) {
  17912. e.material.transparent = !0
  17913. }),
  17914. l.cancel(this.transition);
  17915. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17916. , i = e ? 0 : r.hideFloorDelay / t;
  17917. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17918. this.hidden = !0
  17919. }
  17920. .bind(this), i, c.easeInOutQuad)
  17921. }
  17922. }
  17923. ,
  17924. u.prototype.show = function(e) {
  17925. if (this.hidden || this.transition) {
  17926. this.hidden = !1,
  17927. l.cancel(this.transition);
  17928. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17929. , i = e ? 0 : r.showFloorDelay / t;
  17930. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17931. this.hidden || this.chunks.forEach(function(e) {
  17932. e.material.transparent = !1
  17933. })
  17934. }
  17935. .bind(this), i, c.easeInOutQuad)
  17936. }
  17937. }
  17938. ,
  17939. u.prototype.toggle = function(e, t) {
  17940. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17941. }
  17942. ,
  17943. u.prototype.containsPoint = function(t) {
  17944. return this.collider.children.some(function(e) {
  17945. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17946. e.geometry.boundingBox.containsPoint(t)
  17947. })
  17948. }
  17949. ,
  17950. u.prototype.distanceToPoint = function(i) {
  17951. var n = null
  17952. , r = 1 / 0;
  17953. return this.collider.children.forEach(function(e) {
  17954. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17955. var t = e.geometry.boundingBox.distanceToPoint(i);
  17956. (!n || t < r) && (r = t,
  17957. n = e)
  17958. }),
  17959. r
  17960. }
  17961. ,
  17962. u.prototype.addChunk = function(e) {
  17963. e.renderOrder = h.ghostFloor,
  17964. this.add(e),
  17965. this.chunks.push(e),
  17966. this.boundingBox.union(e.geometry.boundingBox),
  17967. this.size = this.boundingBox.size(),
  17968. this.colliderBuilder.add(e.geometry)
  17969. }
  17970. ,
  17971. u.prototype.addPano = function(e) {
  17972. this.panos.push(e),
  17973. this.add(e.skyboxMesh),
  17974. e.marker && this.add(e.marker);
  17975. var t = new n.Vector3(1,1,1)
  17976. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17977. this.boundingBox.union(i)
  17978. }
  17979. ,
  17980. u.prototype.build = function() {
  17981. this.collider = this.colliderBuilder.build(!0),
  17982. this.add(this.collider),
  17983. this.center = this.boundingBox.center(),
  17984. this.conservativeBoundingBox.copy(this.boundingBox),
  17985. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17986. return e.geometry.boundingBox.min.y
  17987. }), 5),
  17988. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17989. return e.geometry.boundingBox.max.y
  17990. }), 5),
  17991. this.colliderBuilder = null
  17992. }
  17993. ,
  17994. u.prototype.toShortString = function() {
  17995. return o.nth(this.floorIndex + 1)
  17996. }
  17997. ,
  17998. u.prototype.toString = function() {
  17999. return this.name
  18000. }
  18001. ,
  18002. t.exports = u
  18003. }
  18004. , {
  18005. "../enum/RenderOrder": 42,
  18006. "../localization/localize": 108,
  18007. "./strings-cn-CN": 109,
  18008. "../objects/Panorama": 148,
  18009. "../settings": 166,
  18010. "../util/common": 185,
  18011. "../util/easing": 186,
  18012. "../util/lerp": 188,
  18013. "../util/transitions": 195,
  18014. "./ChunkedCollider": 145,
  18015. three: 217
  18016. }],
  18017. 147: [function(e, t, i) {
  18018. "use strict";
  18019. function n(e) {
  18020. this.player = e,
  18021. this.obj3d = null,
  18022. this.UP = new u.Vector3(0,1,0)
  18023. }
  18024. var u = e("three")
  18025. , d = e("../settings");
  18026. n.prototype.prefs = {
  18027. linewidth: 3,
  18028. height: .07,
  18029. opacity: .45,
  18030. endScale: .05
  18031. },
  18032. n.prototype.discard = function() {
  18033. if (this.obj3d) {
  18034. var e = this.obj3d.parent;
  18035. e && e.remove(this.obj3d)
  18036. }
  18037. this.obj3d = null
  18038. }
  18039. ,
  18040. n.prototype.draw = function() {
  18041. if (this.discard(),
  18042. d.showNeighbors) {
  18043. var e = this.player.currentPano.floor;
  18044. this.obj3d = new u.Object3D;
  18045. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18046. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18047. i.y += this.prefs.height;
  18048. var n = .1525
  18049. , r = new u.Matrix4;
  18050. for (var o in t)
  18051. if (t[o]) {
  18052. var a = this.player.model.panos.get(o)
  18053. , s = (a.position.clone().sub(this.player.model.position),
  18054. a.position.clone().sub(a.floorPosition))
  18055. , l = a.floorPosition.clone().sub(this.player.model.position);
  18056. l.y += this.prefs.height;
  18057. var c = new u.Geometry;
  18058. 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)),
  18059. 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)),
  18060. r.identity().setPosition(s),
  18061. c.applyMatrix(r),
  18062. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  18063. 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)),
  18064. r.lookAt(l, i, this.UP).setPosition(l),
  18065. c.applyMatrix(r),
  18066. c.vertices.push(l, i);
  18067. var h = new u.Line(c,new u.LineBasicMaterial({
  18068. color: a.debugColor.getHex(),
  18069. transparent: !0,
  18070. opacity: this.prefs.opacity,
  18071. depthWrite: !1,
  18072. name: "sLine" + o,
  18073. linewidth: this.prefs.linewidth
  18074. }));
  18075. this.obj3d.add(h)
  18076. }
  18077. e.add(this.obj3d)
  18078. }
  18079. }
  18080. ,
  18081. n.prototype.update = function() {
  18082. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18083. }
  18084. ,
  18085. t.exports = n
  18086. }
  18087. , {
  18088. "../settings": 166,
  18089. three: 217
  18090. }],
  18091. 148: [function(S, M, e) {
  18092. (function(e) {
  18093. "use strict";
  18094. function r(e, t, i, n) {
  18095. this.model = e,
  18096. this.id = t,
  18097. this.alignmentType = i.alignmentType || c.ALIGNED,
  18098. this.neighbourUUIDs = i.neighbours,
  18099. this.neighbourPanos = null,
  18100. this.floor = null,
  18101. this.floorIndex = i.floor,
  18102. this.failedLoadingAt = 0,
  18103. this.maxLoadRetries = 4,
  18104. this.origin = i.position.clone(),
  18105. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  18106. this.quaternion = i.quaternion.clone(),
  18107. this.skyboxMesh = new s.Mesh(E),
  18108. this.skyboxMesh.position.copy(this.position),
  18109. this.skyboxMesh.quaternion.copy(this.quaternion),
  18110. this.skyboxMesh.name = "skybox",
  18111. this.skyboxMesh.visible = !1,
  18112. this.skyboxMesh.updateMatrix(),
  18113. this.skyboxMesh.updateMatrixWorld(),
  18114. this.marker = null,
  18115. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  18116. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  18117. map: b,
  18118. side: s.DoubleSide,
  18119. opacity: 0,
  18120. transparent: !0,
  18121. depthWrite: !1
  18122. })),
  18123. this.marker.visible = this.showFloorMarker,
  18124. this.marker.renderOrder = l.panoMarker,
  18125. this.marker.name = "marker",
  18126. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  18127. this.marker.updateMatrixWorld(),
  18128. a.colorMarkerOnLoad && this.on("load", function() {
  18129. this.marker.material.color.set(65280)
  18130. })),
  18131. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18132. this.floorPosition = i.puck ? i.puck.clone() : null,
  18133. this.tiled = n,
  18134. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  18135. this.solidSkybox.flipY = !1,
  18136. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  18137. this.solidSkybox.magFilter = s.LinearFilter,
  18138. this.solidSkybox.generateMipmaps = !1)),
  18139. this.zoomed = !1,
  18140. this.panoRenderer = null,
  18141. this.qualityManager = null,
  18142. this.tileDownloader = null,
  18143. this.tiledPanoRenderTarget = null,
  18144. this.minimumTiledPanoLoaded = !1,
  18145. this.highestPartialTileRenderOpCompleted = 0,
  18146. this.highestFullTileRenderOpCompleted = 0,
  18147. this.shouldRedrawOnBaseLoaded = !1,
  18148. this.lockUntilRenderingComplete = !1,
  18149. a.colorMarkerOnLoad && this.on("load", function() {
  18150. this.marker.material.color.set(65280)
  18151. }),
  18152. (e = new s.TextureLoader).setCrossOrigin(!0);
  18153. var r = e.load("images/texture.jpg");
  18154. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  18155. color: 16777215,
  18156. transparent: !0,
  18157. opacity: .75,
  18158. map: r
  18159. })),
  18160. this.vrMarker.boluoType = "vr",
  18161. this.vrMarker.position.z = 1,
  18162. this.vrMarker.enabled = !0,
  18163. this.vrMarker.visible = !1,
  18164. window.vrMarkers = window.vrMarkers || [],
  18165. window.vrMarkers.push(this.vrMarker),
  18166. this.marker && this.marker.add(this.vrMarker),
  18167. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18168. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18169. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18170. this.adjustAngleEnable) {
  18171. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18172. this.skyboxMesh.quaternion.multiply(i);
  18173. var o = new s.Quaternion;
  18174. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18175. this.skyboxMesh.quaternion.multiply(o),
  18176. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18177. this.skyboxMesh.quaternion.multiply(n),
  18178. this.skyboxMesh.updateMatrix(),
  18179. this.skyboxMesh.updateMatrixWorld(),
  18180. this.model.updateProjectedPanos()
  18181. }
  18182. }
  18183. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18184. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18185. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18186. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18187. S("../enum/GLCubeFaces"),
  18188. 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");
  18189. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18190. function() {
  18191. this.setZoomed(!1),
  18192. this.emit("enter", {
  18193. oldPano: t,
  18194. newPano: this
  18195. }),
  18196. t = this
  18197. }
  18198. ),
  18199. r.prototype.exit = function() {
  18200. this.tiled ? (this.clearWaitDeferreds(),
  18201. this.minimumTiledPanoLoaded = !1,
  18202. this.tiledPanoRenderTarget = null,
  18203. this.setZoomed(!1),
  18204. this.panoRenderer.deactivateTiledPano(this),
  18205. this.highestPartialTileRenderOpCompleted = 0,
  18206. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18207. this.solidSkybox.loaded = !1,
  18208. this.solidSkybox.version = 0),
  18209. this.emit("exit")
  18210. }
  18211. ,
  18212. r.prototype.hoverOn = function(e) {
  18213. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18214. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18215. }
  18216. ,
  18217. r.prototype.hoverOff = function(e) {
  18218. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18219. }
  18220. ,
  18221. r.prototype.build1 = function() {
  18222. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18223. this.floor.addPano(this),
  18224. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18225. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18226. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18227. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18228. }
  18229. ,
  18230. r.prototype.build2 = function() {
  18231. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18232. this.height = this.position.distanceTo(this.floorPosition),
  18233. this.placeMarker()
  18234. }
  18235. ,
  18236. r.prototype.interpolateFloorPosition = function() {
  18237. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18238. return !!e.floorPosition
  18239. }).sort(function(e, t) {
  18240. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18241. }
  18242. .bind(this))
  18243. , t = this.position.clone();
  18244. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18245. t
  18246. }
  18247. ,
  18248. r.prototype.raycastFloorPosition = function() {
  18249. I.warn("Performance warning: Raycasting to find floor position");
  18250. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18251. return e.length ? e[0].point : null
  18252. }
  18253. ,
  18254. 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)],
  18255. function() {
  18256. I.warn("Performance warning: Raycasting to find floor index");
  18257. for (var e = 0; e < i.length; e++) {
  18258. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18259. if (t.length)
  18260. return t[0].object.parent.parent
  18261. }
  18262. return null
  18263. }
  18264. ),
  18265. r.prototype.placeMarker = function() {
  18266. this.marker && (this.marker.position.copy(this.floorPosition),
  18267. this.marker.position.y += .05,
  18268. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18269. }
  18270. ,
  18271. r.prototype.translate = function(e) {
  18272. this.position.add(e),
  18273. this.floorPosition.add(e)
  18274. }
  18275. ,
  18276. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18277. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18278. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18279. }
  18280. ,
  18281. r.prototype.attachToPanoRenderer = function(e) {
  18282. this.panoRenderer = e,
  18283. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18284. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18285. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18286. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18287. }
  18288. ;
  18289. var w, T, x = {};
  18290. r.prototype.getWaitDeferred = function(e) {
  18291. var t = x[this.id];
  18292. t || (t = {},
  18293. x[this.id] = t);
  18294. var i = t[e];
  18295. return i || (i = {
  18296. deferred: $.Deferred(),
  18297. active: !1
  18298. },
  18299. t[e] = i),
  18300. i
  18301. }
  18302. ,
  18303. r.prototype.resetWaitDeferred = function(e) {
  18304. var t = this.getWaitDeferred(e);
  18305. t.active = !1,
  18306. t.deferred = $.Deferred()
  18307. }
  18308. ,
  18309. r.prototype.clearWaitDeferreds = function() {
  18310. var e = x[this.id];
  18311. for (var t in e || (e = {},
  18312. x[this.id] = e),
  18313. e)
  18314. if (e.hasOwnProperty(t)) {
  18315. var i = e[t];
  18316. i.active = !1,
  18317. i.deferred = $.Deferred()
  18318. }
  18319. }
  18320. ,
  18321. r.prototype.loadTiledPano = (new s.Vector3,
  18322. w = [],
  18323. T = [],
  18324. function(e, t, i, n, r, o) {
  18325. null != n || (n = !0),
  18326. null != r || (r = !0);
  18327. var a = this.getWaitDeferred(e)
  18328. , s = a.deferred
  18329. , l = null
  18330. , c = null;
  18331. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18332. c = i.vFov)),
  18333. !this.isLoaded(e)) {
  18334. if (!a.active) {
  18335. if (a.active = !0,
  18336. i) {
  18337. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18338. w[this.id + ":" + e] = {
  18339. tileCount: 0,
  18340. targetTileCount: h
  18341. },
  18342. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18343. }
  18344. T[this.id] || (T[this.id] = !0,
  18345. this.on(f.LoadComplete, function(e, t) {
  18346. var i = this.getWaitDeferred(e).deferred;
  18347. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18348. this.resetWaitDeferred(e))
  18349. }
  18350. .bind(this)),
  18351. this.on(f.LoadFailed, function(e) {
  18352. var t = this.getWaitDeferred(e).deferred;
  18353. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18354. this.resetWaitDeferred(e))
  18355. }
  18356. .bind(this)),
  18357. this.on(f.TileLoaded, function(e, t, i) {
  18358. var n = this.getWaitDeferred(e).deferred;
  18359. if (n && "pending" === n.state()) {
  18360. n.notify(e, t, i);
  18361. var r = w[this.id + ":" + e];
  18362. r && (r.tileCount++,
  18363. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18364. n.resolve(e, i),
  18365. this.resetWaitDeferred(e)))
  18366. }
  18367. }
  18368. .bind(this)))
  18369. }
  18370. this.tileDownloader.clearForceQueue(),
  18371. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18372. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18373. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18374. }
  18375. return s.promise()
  18376. }
  18377. ),
  18378. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18379. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18380. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18381. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18382. }
  18383. ,
  18384. r.prototype.onTileRendered = function(e, t, i, n) {
  18385. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18386. }
  18387. ,
  18388. r.prototype.onPanoRendered = function(e, t, i, n) {
  18389. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18390. this.updateSkyboxForZoomLevel(),
  18391. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18392. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18393. this.emit("load", t),
  18394. this.model.emit("load", this),
  18395. this.emit(f.LoadComplete, t, i))
  18396. }
  18397. ,
  18398. r.prototype.setZoomed = function(e) {
  18399. this.zoomed = e,
  18400. this.updateSkyboxForZoomLevel()
  18401. }
  18402. ,
  18403. r.prototype.ensureSkyboxReadyForRender = function() {
  18404. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18405. this.solidSkybox.loaded = !0)
  18406. }
  18407. ,
  18408. r.prototype.updateSkyboxForZoomLevel = function() {
  18409. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18410. }
  18411. ,
  18412. r.prototype.getSkyboxTexture = function() {
  18413. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18414. }
  18415. ,
  18416. r.prototype.onTileRenderFail = function(e, t, i) {
  18417. e === this.id && this.emit(f.LoadFailed, t)
  18418. }
  18419. ,
  18420. r.prototype.isLoaded = function(e) {
  18421. if (this.tiled) {
  18422. if (e && "string" == typeof e)
  18423. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18424. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18425. }
  18426. if (e && "number" == typeof e)
  18427. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18428. return !!this.solidSkybox.high || e in this.solidSkybox
  18429. }
  18430. ,
  18431. r.prototype.loadCube = function(a) {
  18432. if (this.isLoaded(a))
  18433. return I.info("Skipping load of pano, already loaded"),
  18434. $.when();
  18435. this.emit("loading", a),
  18436. this.model.emit("loading", this);
  18437. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18438. , e = n.filter(function(e) {
  18439. return !e
  18440. });
  18441. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18442. a = "high",
  18443. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18444. var t = 0
  18445. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18446. return u.getImage(n[t])
  18447. }
  18448. .bind(this));
  18449. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18450. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18451. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18452. this.solidSkybox.low = null),
  18453. this.solidSkybox.needsUpdate = !0,
  18454. this.emit("load", a),
  18455. this.model.emit("load", this),
  18456. this
  18457. }
  18458. .bind(this), function() {
  18459. I.error("Downloading cubemap for pano", this.id, "failed"),
  18460. this.failedLoadingAt = Date.now()
  18461. }
  18462. .bind(this), function() {
  18463. return $.when(++t, 6)
  18464. })
  18465. }
  18466. ,
  18467. r.raycastsSkipped = 0,
  18468. r.raycastsDone = 0,
  18469. r.prototype.findNeighourPanos = function() {
  18470. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18471. this.model.panos.forEach(function(e) {
  18472. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18473. var t = this.position.distanceTo(e.position);
  18474. if (t > a.panoramaNeighbourMaxDistance)
  18475. return this.model.panos.setNeighbour(this, e, !1),
  18476. void r.raycastsSkipped++;
  18477. var i = e.position.clone().sub(this.position).normalize()
  18478. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18479. r.raycastsDone++,
  18480. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18481. 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)))
  18482. }
  18483. }
  18484. .bind(this)),
  18485. this.model.panos.neighbourMap[this.id]
  18486. }
  18487. ,
  18488. r.prototype.worldPosition = function() {
  18489. return this.position
  18490. }
  18491. ,
  18492. r.prototype.addTextSprite = function(e, t) {
  18493. this.removeTextSprite();
  18494. var ratio = 16;
  18495. var i = document.createElement("canvas")
  18496. , n = i.getContext("2d");
  18497. i.width = 1024,
  18498. i.height = i.width / ratio;
  18499. n.font = " 30px Arial",
  18500. n.fillStyle = "white";
  18501. var r = n.measureText(e).width;
  18502. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18503. var o = new s.Texture(i);
  18504. o.needsUpdate = !0;
  18505. var a = new s.SpriteMaterial({
  18506. map: o,
  18507. color: t || 16428055
  18508. });
  18509. this.text3d = new s.Sprite(a),
  18510. this.text3d.position.copy(this.skyboxMesh.position),
  18511. this.floor.add(this.text3d)
  18512. var scale = 3
  18513. this.text3d.scale.y = scale/ratio
  18514. this.text3d.scale.x = scale
  18515. }
  18516. ,
  18517. r.prototype.removeTextSprite = function() {
  18518. this.text3d && (this.floor.remove(this.text3d),
  18519. this.text3d = null)
  18520. }
  18521. ,
  18522. r.prototype.isAligned = function() {
  18523. return this.alignmentType === c.ALIGNED
  18524. }
  18525. ,
  18526. r.filters = {
  18527. inDirection: function(t, i, n) {
  18528. return function(e) {
  18529. return e.position.clone().sub(t).normalize().dot(i) > n
  18530. }
  18531. },
  18532. inFloorDirection: function(t, i, n) {
  18533. return function(e) {
  18534. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18535. }
  18536. },
  18537. inPanoDirection: function(n, r, o) {
  18538. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18539. function(e) {
  18540. var t = e.floorPosition.clone().sub(n).normalize()
  18541. , i = e.position.clone().sub(n).normalize();
  18542. return t.dot(r) > o || i.dot(r) > o
  18543. }
  18544. },
  18545. atFloor: function(t) {
  18546. return function(e) {
  18547. return !t || e.floor === t
  18548. }
  18549. },
  18550. not: function(t) {
  18551. return function(e) {
  18552. return e !== t
  18553. }
  18554. },
  18555. notIn: function(t) {
  18556. return function(e) {
  18557. return -1 === t.indexOf(e)
  18558. }
  18559. },
  18560. isLoaded: function() {
  18561. return function(e) {
  18562. return e.isLoaded()
  18563. }
  18564. },
  18565. isNotLoaded: function() {
  18566. return function(e) {
  18567. return !e.isLoaded()
  18568. }
  18569. },
  18570. isCloseEnoughTo: function(t, i) {
  18571. return function(e) {
  18572. return t.distanceTo(e.floorPosition) < i
  18573. }
  18574. },
  18575. hasMinimumHeightDifferenceTo: function(t, i) {
  18576. return function(e) {
  18577. return Math.abs(e.position.y - t.y) > i
  18578. }
  18579. },
  18580. isNotBehindNormal: function(t, i) {
  18581. var n = new s.Vector3;
  18582. return i = i.clone(),
  18583. function(e) {
  18584. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18585. }
  18586. },
  18587. isNeighbourPanoTo: function(t) {
  18588. return function(e) {
  18589. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18590. }
  18591. },
  18592. isNeighbourOfNeighbourTo: function(n) {
  18593. return function(i) {
  18594. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18595. var t = n.model.panos.get(e);
  18596. return !!t && t.neighbourPanos[i.id]
  18597. })
  18598. }
  18599. },
  18600. isNotRecentlyFailed: function(t) {
  18601. return function(e) {
  18602. return Date.now() - e.failedLoadingAt > t
  18603. }
  18604. },
  18605. isOnVisibleFloor: function() {
  18606. return function(e) {
  18607. return !e.floor.hidden
  18608. }
  18609. },
  18610. isPanoAligned: function() {
  18611. return function(e) {
  18612. return e.isAligned()
  18613. }
  18614. }
  18615. },
  18616. r.sortFunctions = {
  18617. distanceToPoint: function(i) {
  18618. return function(e, t) {
  18619. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18620. }
  18621. },
  18622. floorDistanceToPoint: function(i) {
  18623. return function(e, t) {
  18624. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18625. }
  18626. },
  18627. choose: function(i) {
  18628. return function(e, t) {
  18629. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18630. }
  18631. }
  18632. },
  18633. r.scoreFunctions = {
  18634. distance: function(t, i) {
  18635. return i = i || a.navigation.distanceFactor,
  18636. function(e) {
  18637. return t ? t.position.distanceTo(e.position) * i : 0
  18638. }
  18639. },
  18640. distanceSquared: function(t, i) {
  18641. return i = i || a.navigation.distanceFactor,
  18642. function(e) {
  18643. return t ? t.position.distanceToSquared(e.position) * i : 0
  18644. }
  18645. },
  18646. direction: function(t, i) {
  18647. return function(e) {
  18648. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18649. }
  18650. },
  18651. angle: function(t, i) {
  18652. return function(e) {
  18653. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18654. }
  18655. },
  18656. inFieldOfView: function(t, i) {
  18657. return function(e) {
  18658. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18659. }
  18660. },
  18661. optionality: function(t) {
  18662. return function(e) {
  18663. return e.neighbourUUIDs.filter(function(e) {
  18664. return !(e in t.neighbourUUIDs) && e !== t.id
  18665. }).length * a.navigation.optionalityFactor
  18666. }
  18667. },
  18668. penalizeHeightDifferenceUnder: function(t, i) {
  18669. return function(e) {
  18670. return t.y - e.position.y < i ? -20 : 0
  18671. }
  18672. }
  18673. },
  18674. M.exports = r
  18675. }
  18676. ).call(this, "/js/objects/Panorama.js")
  18677. }
  18678. , {
  18679. "../enum/AlignmentType": 17,
  18680. "../enum/GLCubeFaces": 25,
  18681. "../enum/PanoRendererEvents": 35,
  18682. "../enum/PanoSizeClass": 36,
  18683. "../enum/PanoramaEvents": 37,
  18684. "../enum/RenderLayers": 41,
  18685. "../enum/RenderOrder": 42,
  18686. "../enum/TileDownloaderEvents": 45,
  18687. "../enum/Viewmode": 51,
  18688. "../exception/BasicException": 55,
  18689. "../scene/SceneRenderer": 158,
  18690. "../settings": 166,
  18691. "../tile/TileUtils": 174,
  18692. "../util/ajax": 181,
  18693. "../util/common": 185,
  18694. "../util/lerp": 188,
  18695. "../util/logger": 189,
  18696. "../util/panorama": 191,
  18697. "../util/texture": 194,
  18698. "../util/transitions": 195,
  18699. events: 202,
  18700. three: 217
  18701. }],
  18702. 149: [function(e, t, i) {
  18703. "use strict";
  18704. function n(e) {
  18705. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18706. t.map.value = d,
  18707. t.opacity.value = 0,
  18708. t.color.value.set(o.reticuleColor),
  18709. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18710. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18711. side: r.DoubleSide,
  18712. depthWrite: !1,
  18713. depthTest: !1,
  18714. transparent: !0,
  18715. vertexShader: c.waypoint.vertexShader,
  18716. fragmentShader: c.waypoint.fragmentShader,
  18717. uniforms: t,
  18718. name: "waypoint",
  18719. opacity: 0,
  18720. visible: t.showMouseMarker
  18721. })),
  18722. this.layers.set(h.RETICULE),
  18723. this.renderOrder = u.reticule,
  18724. this.player = e,
  18725. this.direction = new r.Vector3,
  18726. this.hidden = !0,
  18727. this.mouseLastMoveTime = Date.now()
  18728. }
  18729. var r = e("three")
  18730. , o = e("../settings")
  18731. , a = e("../util/transitions")
  18732. , s = e("../util/texture")
  18733. , l = e("../util/lerp")
  18734. , c = e("../shaders")
  18735. , h = e("../enum/RenderLayers")
  18736. , u = e("../enum/RenderOrder")
  18737. , d = s.load("images/reticule-256x256.png");
  18738. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18739. this.hidden = i,
  18740. this.mouseLastMoveTime = Date.now()
  18741. }
  18742. ,
  18743. n.prototype.hide = function() {
  18744. this.hidden || (this.hidden = !0,
  18745. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18746. }
  18747. ,
  18748. n.prototype.show = function() {
  18749. this.hidden = !1,
  18750. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18751. }
  18752. ,
  18753. n.prototype.update = function() {
  18754. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18755. }
  18756. ,
  18757. n.prototype.updatePosition = function(e, t) {
  18758. if (!this.hidden) {
  18759. if (!t)
  18760. return this.hide();
  18761. var i = t.point
  18762. , n = e.distanceTo(i)
  18763. , r = 1 + .01 * n;
  18764. n < 1 && (r -= 1 - n),
  18765. this.show(),
  18766. this.scale.set(r, r, r),
  18767. this.direction = this.direction.multiplyScalar(.8),
  18768. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18769. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18770. this.lookAt(this.position.clone().add(this.direction))
  18771. }
  18772. }
  18773. ,
  18774. n.prototype.writeAstag = function() {
  18775. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18776. , t = new Date;
  18777. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18778. var i = {
  18779. enabled: !0,
  18780. version: "0",
  18781. created: t.toISOString(),
  18782. created_by: "APITest",
  18783. position: this.position.clone(),
  18784. stem: {
  18785. enabled: o.tags.pole.enabled,
  18786. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18787. },
  18788. label: "tag " + this.tagCount,
  18789. description: "Description " + e,
  18790. floor: function(e) {
  18791. if (e.currentFloor) {
  18792. var t = e.floors.indexOf(e.currentFloor);
  18793. return -1 < t ? t : void 0
  18794. }
  18795. }(this.player.model),
  18796. type: "info",
  18797. metadata: {
  18798. preferred_camera: {
  18799. mode: this.player.mode
  18800. }
  18801. }
  18802. };
  18803. console.log("--------------------------"),
  18804. console.log(JSON.stringify(i));
  18805. var n = this.player.model.addtag(e, i).build();
  18806. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18807. n.visible || n.show(o.tags.startup.fadeInDuration))
  18808. }
  18809. ,
  18810. t.exports = n
  18811. }
  18812. , {
  18813. "../enum/RenderLayers": 41,
  18814. "../enum/RenderOrder": 42,
  18815. "../settings": 166,
  18816. "../shaders": 167,
  18817. "../util/lerp": 188,
  18818. "../util/texture": 194,
  18819. "../util/transitions": 195,
  18820. three: 217
  18821. }],
  18822. 150: [function(e, t, i) {
  18823. "use strict";
  18824. function n(e, t) {
  18825. this.chunks = [],
  18826. this.floorId = e,
  18827. this.roomId = t,
  18828. this.position = new l.Vector3
  18829. }
  18830. var l = e("three");
  18831. n.prototype.addChunk = function(e) {
  18832. this.chunks.push(e)
  18833. }
  18834. ,
  18835. n.prototype.calcBoundaries = function() {
  18836. 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++) {
  18837. var a = this.chunks[o].geometry.attributes.position;
  18838. if (a)
  18839. for (var s = 0; s < a.array.length; s += 3)
  18840. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18841. t.add(e),
  18842. 0 === s ? (i.copy(e),
  18843. n.copy(e)) : (i.max(e),
  18844. n.min(e)),
  18845. r++
  18846. }
  18847. 0 < r ? (t.multiplyScalar(1 / r),
  18848. this.average = t) : this.average = null,
  18849. this.boundsMax = i,
  18850. this.boundsMin = n,
  18851. this.center = new l.Vector3,
  18852. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18853. }
  18854. ,
  18855. t.exports = n
  18856. }
  18857. , {
  18858. three: 217
  18859. }],
  18860. 151: [function(o, v, e) {
  18861. (function(e) {
  18862. "use strict";
  18863. function t(e, t, i) {
  18864. this.obj3d = null,
  18865. this.nodes = [],
  18866. this.colorHull = [],
  18867. this.shortPaths = {},
  18868. this.floorHull = null,
  18869. this.cameraHull = null,
  18870. this.floorPathDistance = 0,
  18871. this.floorCurvePoints = null,
  18872. this.floorCurveColors = null,
  18873. this.camCurvePoints = null,
  18874. this.warpDestHeroLoc = null,
  18875. this.warpDestPano = null,
  18876. this.warpPathPoints = null,
  18877. this.warpPathLengths = [0],
  18878. this.warpLength = 0,
  18879. this.closeWarpDistance = 4,
  18880. this.UP = U.UP.clone(),
  18881. this.longestStep = 0,
  18882. this.upcomingTransType = null,
  18883. this.burnsDir = 1,
  18884. this.prevNextDist = 0,
  18885. this.nextI = 0,
  18886. this.activeTransType = null,
  18887. this.lastTransType = null,
  18888. this.bunnyObj = null,
  18889. this.director = e,
  18890. this.player = t,
  18891. this.playerControls = i,
  18892. this.modelManager = t.modelManager,
  18893. this.updateModel(),
  18894. this.updateDefaultsFromModelData(),
  18895. this.bindEvents(),
  18896. this.warping = !1,
  18897. this.waitingToWarp = !1,
  18898. this.warpInterrupted = !1,
  18899. this.warpInterruptionBlackoutStyle = null,
  18900. this.warpInterruptionTravelTime = null
  18901. }
  18902. 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"),
  18903. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18904. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18905. 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"),
  18906. pathEnd: n.load("images/End.png"),
  18907. 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==")
  18908. };
  18909. t.prototype.setScene = function(e) {
  18910. this.createCpm(e),
  18911. this.createBunnyObj(e)
  18912. }
  18913. ,
  18914. t.prototype.updateModel = function() {
  18915. this.model = this.modelManager.getActiveModel()
  18916. }
  18917. ,
  18918. t.prototype.bindEvents = function() {
  18919. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18920. }
  18921. ,
  18922. t.prototype.updateDefaultsFromModelData = function() {
  18923. this.model.data
  18924. }
  18925. ,
  18926. t.prototype.pointPathDistance = function(e) {
  18927. for (var t = 0, i = 1; i < e.length; i += 1)
  18928. t += e[i - 1].distanceTo(e[i]);
  18929. return t
  18930. }
  18931. ,
  18932. t.prototype.pointPathLengths = function(e) {
  18933. for (var t = [0], i = 1; i < e.length; i += 1)
  18934. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18935. return t
  18936. }
  18937. ,
  18938. t.prototype.interpAlongPath = function(e, t, i) {
  18939. var n, r = new P.Vector3, o = t[t.length - 1];
  18940. if (i < 1) {
  18941. n = i * o;
  18942. for (var a = 1; a < t.length; a += 1)
  18943. if (t[a] > n) {
  18944. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18945. return r.copy(e[a]),
  18946. r.sub(e[a - 1]),
  18947. r.multiplyScalar(s),
  18948. r.add(e[a - 1]),
  18949. r
  18950. }
  18951. } else
  18952. r.copy(e[e.length - 1]);
  18953. return r
  18954. }
  18955. ,
  18956. t.prototype.pathHeight = function() {
  18957. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18958. }
  18959. ,
  18960. t.prototype.createBunnyObj = function(e) {
  18961. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18962. this.bunnyObj.visible = D.warp.showBunny),
  18963. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18964. e.add(this.bunnyObj)
  18965. }
  18966. ,
  18967. t.prototype.createCpm = function(e) {
  18968. if (!this.currentPanoMarker) {
  18969. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18970. t.material.uniforms.opacity.value = 0,
  18971. this.currentPanoMarker = {
  18972. mesh: t,
  18973. placed: !1
  18974. }
  18975. }
  18976. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18977. this.placeCpm(),
  18978. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18979. }
  18980. ,
  18981. t.prototype.placeCpm = function() {
  18982. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18983. var e = this.player.currentPano.floor;
  18984. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18985. e.add(this.currentPanoMarker.mesh)),
  18986. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18987. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18988. this.currentPanoMarker.placed = !0
  18989. } else
  18990. this.popOutCpm()
  18991. }
  18992. ,
  18993. t.prototype.fadeInCpm = function(e) {
  18994. 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)
  18995. }
  18996. ,
  18997. t.prototype.fadeOutCpm = function(e) {
  18998. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18999. }
  19000. ,
  19001. t.prototype.popInCpm = function() {
  19002. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19003. }
  19004. ,
  19005. t.prototype.popOutCpm = function() {
  19006. this.fadeOutCpm(2)
  19007. }
  19008. ,
  19009. t.prototype.brushPrefs = {
  19010. linewidth: 7,
  19011. strokeWidth: 15,
  19012. cvSegments: 48,
  19013. paveStep: .1,
  19014. paveWidth: .2,
  19015. lookBlendDist: 3,
  19016. maxTurn: P.Math.degToRad(2)
  19017. },
  19018. t.prototype.panoPathDistance = function(e) {
  19019. var t = this.model.panos;
  19020. if (!e || e.length < 2)
  19021. return 0;
  19022. for (var i = [], n = 0; n < e.length; n += 1)
  19023. i.push(t.get(e[n]).floorPosition);
  19024. return this.pointPathDistance(i)
  19025. }
  19026. ,
  19027. t.prototype.loadTileTexture = function(t) {
  19028. var e = n.load(t, function(e) {
  19029. e.wrapS = P.RepeatWrapping,
  19030. e.wrapT = P.RepeatWrapping,
  19031. e.needsUpdate = !0,
  19032. H.debug('path texture "' + t + '" is ready')
  19033. }, function() {
  19034. H.error('path texture "' + t + '" failed')
  19035. });
  19036. return e.mapping = P.UVMapping,
  19037. e
  19038. }
  19039. ,
  19040. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19041. return new l({
  19042. cameraMode: n,
  19043. position: e,
  19044. quaternion: t,
  19045. panoId: i,
  19046. orthoZoom: o,
  19047. floorVisibility: r,
  19048. thumbUrl: null,
  19049. name: null
  19050. })
  19051. }
  19052. ,
  19053. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19054. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19055. }
  19056. ,
  19057. t.prototype.setWarpDestination = function(e) {
  19058. this.warpDestHeroLoc = e
  19059. }
  19060. ,
  19061. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  19062. var t = this.getHeroDescriptorByHeroIndex(e);
  19063. return null !== t && (this.setWarpDestination(t),
  19064. !0)
  19065. }
  19066. ,
  19067. t.prototype.setWarpDestinationByPano = function(e, t) {
  19068. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  19069. }
  19070. ,
  19071. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  19072. var i = this.model.panos.get(e);
  19073. if (i) {
  19074. t = t || new P.Quaternion;
  19075. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19076. return this.setWarpDestination(n),
  19077. !0
  19078. }
  19079. return !1
  19080. }
  19081. ,
  19082. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19083. var t = this.model.heroCount();
  19084. if (null !== this.warpDestHeroLoc && t < 1)
  19085. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19086. this.model.getHeroDescriptorByIndex(0);
  19087. var i = this.model.getHeroDescriptorByIndex(e);
  19088. if (i) {
  19089. var n = i.isPano() ? i.panoId : i.cameraMode;
  19090. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19091. }
  19092. return i
  19093. }
  19094. ,
  19095. t.prototype.getHeroDescriptorByPano = function(e) {
  19096. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  19097. }
  19098. ,
  19099. t.prototype.getHeroDescriptorByPanoId = function(e) {
  19100. var t = this.getHeroIndexFromPanoId(e);
  19101. return this.getHeroDescriptorByHeroIndex(t)
  19102. }
  19103. ,
  19104. t.prototype.getHeroIndexFromPanoId = function(e) {
  19105. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19106. var i = this.model.heroLocations[t]
  19107. , n = this.getHeroId(i);
  19108. if (n && n === e)
  19109. return t
  19110. }
  19111. return -1
  19112. }
  19113. ,
  19114. t.prototype.getHeroPano = function(e) {
  19115. if (null === e)
  19116. return H.warn("getHeroPano(): no destination"),
  19117. null;
  19118. var t = this.getHeroId(e)
  19119. , i = this.model.panos.get(t);
  19120. return void 0 === i && (i = null,
  19121. "" !== t && H.debug('unable to find pano "' + t + '"')),
  19122. i
  19123. }
  19124. ,
  19125. t.prototype.getHeroId = function(e) {
  19126. return e.panoId
  19127. }
  19128. ,
  19129. t.prototype.setWarpDestPano = function() {
  19130. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19131. this.warpDestPano
  19132. }
  19133. ,
  19134. t.prototype.brushToWarpPano = function(e, t) {
  19135. if (this.discardPathObject(),
  19136. !this.setWarpDestPano())
  19137. return !1;
  19138. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  19139. !this.warpDestPano)
  19140. return H.info("No brush"),
  19141. !1;
  19142. if (!this.player.currentPano)
  19143. return H.debug("No current pano, visibility undefined"),
  19144. !1;
  19145. if (!this.warpDestPano)
  19146. return H.info("No wPano, visibility undefined"),
  19147. !1;
  19148. if (!this.warpDestPano.isAligned())
  19149. return H.debug("Cannot brush to unaligned pano"),
  19150. !1;
  19151. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  19152. , n = !0;
  19153. if (this.player.currentPano.id === this.warpDestPano.id)
  19154. H.debug("Already at destination pano");
  19155. else {
  19156. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19157. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19158. this.obj3d = new P.Object3D,
  19159. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19160. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  19161. e = t) : (this.setPathHulls(this.nodes),
  19162. this.setFloorCurves(),
  19163. 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)))),
  19164. this.player.currentPano.floor.add(this.obj3d);
  19165. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  19166. , o = e === L.STD;
  19167. if (!n && (i || o)) {
  19168. if (r) {
  19169. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19170. this.obj3d.add(a)
  19171. }
  19172. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19173. this.obj3d.add(s)
  19174. }
  19175. this.appearSlow()
  19176. }
  19177. return this.upcomingTransType = e,
  19178. !n
  19179. }
  19180. ,
  19181. t.prototype.findShortestPath = function(e, t) {
  19182. if (!e || !t)
  19183. return null;
  19184. var i = D.warp.walkExtraPanosDistance
  19185. , n = e.id + ":" + t.id + ":" + i;
  19186. if (this.shortPaths.hasOwnProperty(n))
  19187. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19188. var r = t.id + ":" + e.id + ":" + i;
  19189. if (this.shortPaths.hasOwnProperty(r))
  19190. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19191. var o = this.model.panos.aStarSearch(e, t);
  19192. return this.model.panos.includeNodesNearPath(o, i),
  19193. this.shortPaths[n] = o ? o.slice() : null,
  19194. o
  19195. }
  19196. ,
  19197. t.prototype.makePathHulls = function(e) {
  19198. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19199. r = (t = h.get(e[0])).floor.floorIndex;
  19200. for (var u = 0; u < e.length; u += 1)
  19201. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19202. s.push(i),
  19203. l.push(t.position.clone()),
  19204. n = t.floor.floorIndex,
  19205. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19206. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19207. return a > this.longestStep && (this.longestStep = a,
  19208. H.debug("path contains " + a + " meter segment")),
  19209. {
  19210. floor: s,
  19211. camera: l,
  19212. color: c
  19213. }
  19214. }
  19215. ,
  19216. t.prototype.makeFloorCurves = function(e, t, i) {
  19217. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19218. , r = this.pointPathDistance(e) - 2 * n
  19219. , o = e.slice(0)
  19220. , a = o[1].clone().sub(o[0]);
  19221. a.y = 0,
  19222. a.normalize().multiplyScalar(n),
  19223. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19224. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19225. a.normalize().multiplyScalar(n),
  19226. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19227. var s = new P.CatmullRomCurve3(o)
  19228. , l = Math.floor(r / i);
  19229. l = 4 * Math.floor(l / 4),
  19230. l = Math.max(4, l);
  19231. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19232. h = 0,
  19233. c = u[f].distanceTo(e[0]);
  19234. for (var g = 1; g < e.length; g += 1)
  19235. p.copy(u[f]).sub(e[g]),
  19236. p.y *= 4,
  19237. p.length() < c && (h = g);
  19238. d.push(t[h])
  19239. }
  19240. return {
  19241. distance: r,
  19242. points: u,
  19243. colors: d
  19244. }
  19245. }
  19246. ,
  19247. t.prototype.makeCameraCurvePoints = function(e, t) {
  19248. var i = this.pointPathDistance(e);
  19249. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19250. }
  19251. ,
  19252. t.prototype.makeCameraCurveTangents = function(e, t) {
  19253. var i = this.pointPathDistance(e)
  19254. , n = new P.CatmullRomCurve3(e)
  19255. , r = Math.max(2, Math.floor(i / t));
  19256. r = r || 5;
  19257. for (var o = [], a = 0; a <= r; a++)
  19258. o.push(n.getTangentAt(a / r));
  19259. return o
  19260. }
  19261. ,
  19262. t.prototype.setPathHulls = function(e) {
  19263. var t = this.makePathHulls(e);
  19264. this.floorHull = t.floor,
  19265. this.cameraHull = t.camera,
  19266. this.colorHull = t.color
  19267. }
  19268. ,
  19269. t.prototype.setFloorCurves = function() {
  19270. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19271. this.floorPathDistance = e.distance,
  19272. this.floorCurvePoints = e.points,
  19273. this.floorCurveColors = e.colors
  19274. }
  19275. ,
  19276. t.prototype.setCameraCurvePoints = function() {
  19277. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19278. }
  19279. ,
  19280. t.prototype.chooseWarpPath = function(e) {
  19281. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19282. if (this.player.currentPano === this.warpDestPano || !e)
  19283. return this.warpPathPoints = null,
  19284. this.warpLength = 0,
  19285. !1;
  19286. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19287. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19288. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19289. t.multiplyScalar(.15).add(r.position),
  19290. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19291. t.y = r.position.y,
  19292. i.y = this.warpDestPano.position.y,
  19293. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19294. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19295. this.setCameraCurvePoints(),
  19296. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19297. this.warpLength = 0,
  19298. this.warpPathLengths = [0];
  19299. 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) {
  19300. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19301. var h = o.length();
  19302. o.y *= D.warp.climbEffort;
  19303. var u = o.length() / h;
  19304. if (1 < c) {
  19305. o.setY(0).normalize(),
  19306. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19307. var d = Math.min(1, o.dot(a))
  19308. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19309. u = Math.max(p, u)
  19310. }
  19311. this.warpLength += h * u,
  19312. this.warpPathLengths[c] = this.warpLength
  19313. }
  19314. return !0
  19315. }
  19316. ,
  19317. t.prototype.drawPathRibbon = function(e, t) {
  19318. this.bunnyObj.visible = D.warp.showBunny;
  19319. 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) {
  19320. a.copy(e[s]),
  19321. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19322. a.normalize(),
  19323. n.crossVectors(a, U.UP),
  19324. n.multiplyScalar(i);
  19325. var l = (new P.Vector3).copy(e[s]).add(r);
  19326. l.sub(n),
  19327. o.vertices.push(l),
  19328. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19329. o.vertices.push(l)
  19330. }
  19331. var c, h, u, d = 0;
  19332. for (s = 0; s < e.length - 1; s += 1) {
  19333. var p = 2 * s
  19334. , f = d
  19335. , g = d += e[s + 1].distanceTo(e[s])
  19336. , m = t[s]
  19337. , v = t[s + 1];
  19338. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19339. o.faces.push(c),
  19340. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19341. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19342. o.faces.push(c),
  19343. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19344. }
  19345. o.computeFaceNormals(),
  19346. o.computeVertexNormals(),
  19347. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19348. u.opacity.value = 0,
  19349. u.color.value.set(D.path.color),
  19350. new P.RawShaderMaterial({
  19351. side: P.DoubleSide,
  19352. depthWrite: !1,
  19353. transparent: !0,
  19354. vertexShader: C.ribbon.vertexShader,
  19355. fragmentShader: C.ribbon.fragmentShader,
  19356. uniforms: u,
  19357. name: "ribbonT",
  19358. opacity: 0
  19359. })) : new P.MeshBasicMaterial({
  19360. color: 16777215,
  19361. side: P.DoubleSide,
  19362. name: "ribbonOut",
  19363. vertexColors: P.VertexColors
  19364. });
  19365. var y = new P.Mesh(o,h);
  19366. return y.name = "ribbon",
  19367. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19368. y
  19369. }
  19370. ,
  19371. t.prototype.drawPathPavement = function(e) {
  19372. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19373. r.copy(e[o]),
  19374. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19375. r.normalize(),
  19376. i.crossVectors(r, U.UP),
  19377. i.multiplyScalar(this.brushPrefs.paveWidth),
  19378. (t = (new P.Vector3).copy(e[o])).sub(i),
  19379. n.vertices.push(t),
  19380. n.vertices.push((new P.Vector3).copy(e[o])),
  19381. (t = (new P.Vector3).copy(e[o])).add(i),
  19382. n.vertices.push(t);
  19383. var a, s, l;
  19384. for (o = 0; o < e.length - 1; o += 1)
  19385. a = 3 * o + 1,
  19386. l = .25 + (s = .25 * o),
  19387. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19388. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19389. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19390. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19391. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19392. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19393. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19394. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19395. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19396. color: D.path.color,
  19397. side: P.DoubleSide,
  19398. transparent: !0,
  19399. depthWrite: !1,
  19400. opacity: 0,
  19401. name: "paveT",
  19402. map: I.path
  19403. }) : new P.MeshBasicMaterial({
  19404. color: D.path.color,
  19405. side: P.DoubleSide,
  19406. transparent: !0,
  19407. depthWrite: !1,
  19408. opacity: 1,
  19409. name: "paveO",
  19410. map: I.path
  19411. });
  19412. return new P.Mesh(n,c)
  19413. }
  19414. ,
  19415. t.prototype.hintPrefs = {
  19416. rad: .18,
  19417. width: .0125,
  19418. depth: .0625,
  19419. setBack: -.04,
  19420. markRad: .25,
  19421. markInnerRad: .16
  19422. },
  19423. t.prototype.makeWaypointObj = function(e, t) {
  19424. var i = new P.Geometry
  19425. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19426. , r = this.pathHeight();
  19427. 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)),
  19428. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19429. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19430. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19431. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19432. o.map.value = e,
  19433. o.opacity.value = 0,
  19434. o.color.value.set(D.path.color);
  19435. var a = {
  19436. side: P.DoubleSide,
  19437. depthWrite: !1,
  19438. transparent: !0,
  19439. vertexShader: C.waypoint.vertexShader,
  19440. fragmentShader: C.waypoint.fragmentShader,
  19441. uniforms: o,
  19442. name: "waypoint",
  19443. opacity: 0
  19444. };
  19445. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19446. a.name = "wayPtOut");
  19447. var s = new P.RawShaderMaterial(a)
  19448. , l = new P.Mesh(i,s);
  19449. return l.name = t,
  19450. l
  19451. }
  19452. ,
  19453. t.prototype.makeStartMarker = function(e, t) {
  19454. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19455. i.y = 0,
  19456. i.normalize();
  19457. var n = Math.acos(i.x)
  19458. , r = this.makeWaypointObj(I.pathStart, "Start");
  19459. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19460. r.position.copy(e),
  19461. r
  19462. }
  19463. ,
  19464. t.prototype.makeEndMarker = function(e) {
  19465. var t = this.makeWaypointObj(I.pathEnd, "End")
  19466. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19467. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19468. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19469. t.position.copy(e),
  19470. t
  19471. }
  19472. ,
  19473. t.prototype.pathClean = function(e) {
  19474. if (e) {
  19475. for (var t in e.children)
  19476. this.pathClean(e.children[t]);
  19477. e.geometry && e.geometry.dispose(),
  19478. e.material && e.material.dispose()
  19479. }
  19480. }
  19481. ,
  19482. t.prototype.discardPathObject = function() {
  19483. if (this.obj3d) {
  19484. var e = this.obj3d.parent;
  19485. e && e.remove(this.obj3d),
  19486. this.pathClean(this.obj3d)
  19487. }
  19488. this.obj3d = null,
  19489. this.popInCpm()
  19490. }
  19491. ,
  19492. t.prototype.discardSlow = function() {
  19493. if (this.obj3d) {
  19494. if (this.player.mode !== O.PANORAMA)
  19495. return void this.discardPathObject();
  19496. for (var e, t = 0, i = function() {
  19497. this.discardPathObject()
  19498. }
  19499. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19500. 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]),
  19501. t += 1,
  19502. i = null);
  19503. 0 === t && this.discardPathObject(),
  19504. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19505. }
  19506. }
  19507. ,
  19508. t.prototype.appearSlow = function() {
  19509. var e;
  19510. this.fadeOutCpm(D.path.fadeInTime);
  19511. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19512. 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]))
  19513. }
  19514. ,
  19515. t.prototype.update = function() {
  19516. this.obj3d && this.obj3d.updateMatrixWorld()
  19517. }
  19518. ,
  19519. t.prototype.calcBurnsAmount = function(e) {
  19520. var n = P.Math.degToRad(D.warp.burnsAngle);
  19521. if (this.player.mode !== O.PANORAMA)
  19522. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19523. var t = this.burnsDir * n;
  19524. if (this.upcomingTransType === L.BLACK)
  19525. return t;
  19526. var i = e;
  19527. if (null === i)
  19528. return H.warn("Transition request for non-highlight"),
  19529. t;
  19530. var r = this.getHeroDescriptorByHeroIndex(i);
  19531. if (null === r)
  19532. return t;
  19533. if (!r.isPano())
  19534. return t;
  19535. function o(e) {
  19536. var t = Math.acos(Math.min(1, e.dot(l)))
  19537. , i = (new P.Vector3).crossVectors(l, e);
  19538. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19539. }
  19540. var a = this.getHeroPano(r)
  19541. , s = this.playerControls.cameras[O.PANORAMA]
  19542. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19543. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19544. if (a === this.player.currentPano)
  19545. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19546. var h = this.findShortestPath(this.player.currentPano, a);
  19547. if (null == h || h.length < 1)
  19548. return H.debug("Empty path ahead..."),
  19549. t;
  19550. var u = this.makePathHulls(h)
  19551. , d = new P.CatmullRomCurve3(u.camera)
  19552. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19553. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19554. }
  19555. ,
  19556. t.prototype.waitNextStep = function(e, t, i) {
  19557. var o = null == i ? D.warp.tourStepDelay : i;
  19558. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19559. var a = new P.Euler
  19560. , s = new P.Vector3;
  19561. H.debug("Starting wait: " + (void 0 !== t));
  19562. var l = this.calcBurnsAmount(e)
  19563. , c = function() {
  19564. this.endWarpState(),
  19565. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19566. t && t()
  19567. }
  19568. .bind(this)
  19569. , n = function(e, t) {
  19570. if (this.warpInterrupted)
  19571. return c(),
  19572. !0;
  19573. var i = t || 1e3 / 60;
  19574. if (D.warp.doBurns)
  19575. if (this.player.mode === O.PANORAMA) {
  19576. var n = this.playerControls.cameras[O.PANORAMA];
  19577. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19578. var r = i * l / o;
  19579. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19580. a.y += r,
  19581. s.set(0, 0, -1),
  19582. s.applyEuler(a),
  19583. s.add(n.position),
  19584. n.controls.lookAt(s),
  19585. n.controls.lookVector.copy(s),
  19586. n.lookAt(s)
  19587. } else
  19588. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19589. }
  19590. .bind(this);
  19591. this.startWarpState(),
  19592. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19593. }
  19594. ,
  19595. t.prototype.warpToNonPano = function(e) {
  19596. if (this.discardPathObject(),
  19597. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19598. var t = function() {
  19599. e && e()
  19600. }
  19601. .bind(this);
  19602. this.player.flyToNewMode({
  19603. mode: this.warpDestHeroLoc.cameraMode,
  19604. duration: D.warp.outsideTime,
  19605. warpDest: this.warpDestHeroLoc,
  19606. callback: t,
  19607. force: !0
  19608. })
  19609. } else
  19610. H.warn("no warp destination!!!"),
  19611. e && e()
  19612. }
  19613. ,
  19614. t.prototype._resetWarpShaderParams = function(e) {
  19615. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19616. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19617. }
  19618. ,
  19619. t.prototype._clearWarpShading = function() {
  19620. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19621. this._resetWarpShaderParams(e[t]),
  19622. e[t].visible = !0;
  19623. this._resetWarpShaderParams(this.model.skybox)
  19624. }
  19625. ,
  19626. t.prototype._warpStopFlying = function() {
  19627. this.activeTransType = null,
  19628. this.placeCpm()
  19629. }
  19630. ,
  19631. t.prototype._wrapupTravelOnlyBits = function() {
  19632. this._warpStopFlying(),
  19633. this.warpPathPoints && (this.player.currentPano.exit(),
  19634. this.warpDestPano.enter(),
  19635. this.player.currentPano = this.warpDestPano),
  19636. this.player.spider.draw(),
  19637. this.placeCpm()
  19638. }
  19639. ,
  19640. t.prototype._wrapupTravel = function(e) {
  19641. this._wrapupTravelOnlyBits(),
  19642. this.warpCameraAim(e)
  19643. }
  19644. ,
  19645. t.prototype._wrapupWarpShading = function(e) {
  19646. this._clearWarpShading(),
  19647. this._wrapupTravel(e)
  19648. }
  19649. ,
  19650. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19651. t !== z.END && this._clearWarpShading(),
  19652. this._wrapupTravelOnlyBits(),
  19653. this.upcomingTransType = null,
  19654. e && e()
  19655. }
  19656. ,
  19657. t.prototype._warpCameraAim = function(e, t) {
  19658. var i = this.warpDestHeroLoc.quaternion
  19659. , n = this.playerControls.cameras[O.PANORAMA]
  19660. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19661. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19662. , a = P.Math.radToDeg(Math.acos(o))
  19663. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19664. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19665. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19666. c.y = N.constrainedTurn(c.y),
  19667. this.burnsDir = Math.sign(c.y);
  19668. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19669. , u = new P.Vector3
  19670. , d = function(e, t) {
  19671. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19672. h.y = l.y + e * c.y,
  19673. h.z = l.z + e * c.z,
  19674. u.set(0, 0, -1),
  19675. u.applyEuler(h),
  19676. u.add(n.position),
  19677. n.controls.lookAt(u),
  19678. n.controls.lookVector.copy(u),
  19679. void n.lookAt(u))
  19680. }
  19681. .bind(this);
  19682. return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19683. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19684. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19685. )
  19686. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19687. void (t && t()))
  19688. }
  19689. ,
  19690. t.prototype._warpBendAim = function(e, t, i, n) {
  19691. var r = n || 0
  19692. , o = this.playerControls.cameras[O.PANORAMA]
  19693. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19694. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19695. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19696. l.y = N.constrainedTurn(l.y);
  19697. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19698. l.x = c * Math.sign(l.x),
  19699. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19700. this.burnsDir = Math.sign(l.y),
  19701. c *= Math.sign(l.y),
  19702. l.y = c;
  19703. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19704. , u = new P.Vector3
  19705. , d = function(e, t) {
  19706. if (e < .5)
  19707. h.x = s.x + e * l.x,
  19708. h.y = s.y + e * l.y,
  19709. h.z = s.z + e * l.z;
  19710. else {
  19711. var i = (1 - e) * D.warp.softBendEnd;
  19712. h.x = a.x - i * l.x,
  19713. h.y = a.y - i * l.y,
  19714. h.z = a.z - i * l.z
  19715. }
  19716. u.set(0, 0, -1),
  19717. u.applyEuler(h),
  19718. u.add(o.position),
  19719. o.controls.lookAt(u),
  19720. o.controls.lookVector.copy(u),
  19721. o.lookAt(u)
  19722. }
  19723. .bind(this);
  19724. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19725. }
  19726. ,
  19727. t.prototype._warpStepCameraAim = function(e, t, i) {
  19728. var n = this.playerControls.cameras[O.PANORAMA]
  19729. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19730. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19731. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19732. a.y = N.constrainedTurn(a.y),
  19733. this.burnsDir = Math.sign(a.y);
  19734. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19735. , l = new P.Vector3
  19736. , c = function(e, t) {
  19737. e < .5 ? s.copy(o) : s.copy(r),
  19738. l.set(0, 0, -1),
  19739. l.applyEuler(s),
  19740. l.add(n.position),
  19741. n.controls.lookAt(l),
  19742. n.controls.lookVector.copy(l),
  19743. n.lookAt(l)
  19744. }
  19745. .bind(this);
  19746. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19747. }
  19748. ,
  19749. t.prototype.setBurnsDir = function() {
  19750. var e = this.playerControls.cameras[O.PANORAMA]
  19751. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19752. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19753. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19754. n.y = N.constrainedTurn(n.y),
  19755. this.burnsDir = Math.sign(n.y)
  19756. }
  19757. ,
  19758. t.prototype.stepWarpPath = function(e, t) {
  19759. var i = this.playerControls.cameras[O.PANORAMA];
  19760. if (!this.warpPathPoints)
  19761. return i.position.copy(this.warpDestPano.position),
  19762. !0;
  19763. var n = this.warpPathPoints[0]
  19764. , r = this.warpDestPano.position;
  19765. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19766. var o = new P.Vector3;
  19767. 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),
  19768. i.position.copy(o)
  19769. } else
  19770. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19771. }
  19772. ,
  19773. t.prototype.interruptAndFastForward = function(e, t) {
  19774. this.warping && (this.warpInterrupted = !0,
  19775. this.warpInterruptionBlackoutStyle = e,
  19776. this.warpInterruptionTravelTime = t,
  19777. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19778. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19779. }
  19780. ,
  19781. t.prototype.warpCameraAim = function(e) {
  19782. var t = D.warp.minWarpTime;
  19783. if (this.upcomingTransType === L.BLACK)
  19784. t = D.warp.teleportTime;
  19785. else {
  19786. var i = this.playerControls.cameras[O.PANORAMA]
  19787. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19788. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19789. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19790. o.y = N.constrainedTurn(o.y);
  19791. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19792. t = Math.max(t, a)
  19793. }
  19794. var s = function() {
  19795. this._warpStopFlying(),
  19796. this.discardSlow(),
  19797. e && e()
  19798. }
  19799. .bind(this);
  19800. this._warpCameraAim(t, s)
  19801. }
  19802. ,
  19803. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19804. this.model.skybox.material.uniforms.blackout.value = n;
  19805. var r = F.uniform(this.model.skybox, "progress", 1)
  19806. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19807. , a = !1
  19808. , s = function() {
  19809. if (this.warpInterrupted)
  19810. return a = !0
  19811. }
  19812. .bind(this)
  19813. , l = function(e, t) {
  19814. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19815. }
  19816. .bind(this)
  19817. , c = function(e, t) {
  19818. return i && a ? (o(0),
  19819. !0) : void o(e, t)
  19820. }
  19821. .bind(this);
  19822. V.start(s, e, null, t, null, "safeHaltWatch"),
  19823. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19824. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19825. }
  19826. ,
  19827. t.prototype.warpTravel_STD = function(e) {
  19828. 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),
  19829. 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;
  19830. t += this.warpLength * D.warp.timePerMeter,
  19831. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19832. function n(e) {
  19833. var t = i;
  19834. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19835. }
  19836. var y = !1
  19837. , r = this.warpDestHeroLoc.quaternion
  19838. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19839. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19840. , a = A.dot(o)
  19841. , C = P.Math.radToDeg(Math.acos(a))
  19842. , s = function() {
  19843. return m.lookAt(g, l, U.UP),
  19844. u.setFromRotationMatrix(m, D.warp.eOrder),
  19845. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19846. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19847. N.constrainedTurn(v.y)
  19848. }
  19849. .bind(this)
  19850. , I = function(e, t) {
  19851. if (this.warpInterrupted)
  19852. return y = !0
  19853. }
  19854. .bind(this)
  19855. , E = function(e, t) {
  19856. return y || !this.warpPathPoints ? (k.blur(0),
  19857. !0) : void k.blur(e)
  19858. }
  19859. .bind(this)
  19860. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19861. , b = function(e, t) {
  19862. return y || !this.warpPathPoints ? (_(0),
  19863. !0) : void _(e, t)
  19864. }
  19865. .bind(this)
  19866. , w = function(e, t) {
  19867. if (!this.warpPathPoints)
  19868. return h.position.copy(this.warpDestPano.position),
  19869. !0;
  19870. if (y)
  19871. return !0;
  19872. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19873. h.position.copy(i),
  19874. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19875. }
  19876. .bind(this)
  19877. , T = function(e, t) {
  19878. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19879. !0)
  19880. }
  19881. .bind(this)
  19882. , x = function(e, t) {
  19883. if (y)
  19884. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19885. !0;
  19886. if (!this.warpPathPoints)
  19887. return !0;
  19888. var i = this.warpLength * e
  19889. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19890. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19891. D.warp.matchCam && (n *= 1 - r),
  19892. m.lookAt(g, l, U.UP),
  19893. u.setFromRotationMatrix(m, D.warp.eOrder),
  19894. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19895. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19896. v.y = N.constrainedTurn(v.y),
  19897. u.x = p.x + n * v.x,
  19898. u.y = p.y + n * v.y,
  19899. u.z = p.z + n * v.z,
  19900. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19901. v.y = N.constrainedTurn(v.y);
  19902. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19903. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19904. f.x = f.x + v.x * D.warp.turnFriction,
  19905. f.y = f.y + v.y * D.warp.turnFriction,
  19906. f.z = f.z + v.z * D.warp.turnFriction,
  19907. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19908. var a = l.clone().sub(g).normalize();
  19909. if (C < D.warp.maxAimRotation && 0 < r) {
  19910. var s = 1 - r;
  19911. a.x = a.x * s + r * A.x,
  19912. a.y = a.y * s + r * A.y,
  19913. a.z = a.z * s + r * A.z,
  19914. a.normalize()
  19915. }
  19916. this.bunnyObj.position.copy(h.position).add(a),
  19917. d.set(0, 0, -1).applyEuler(f).normalize(),
  19918. d.multiplyScalar(8),
  19919. d.add(h.position),
  19920. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19921. h.controls.lookVector.copy(d),
  19922. h.lookAt(d))
  19923. }
  19924. .bind(this)
  19925. , S = function() {
  19926. y ? (this.discardSlow(),
  19927. this.upcomingTransType = L.BLACK,
  19928. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19929. }
  19930. .bind(this);
  19931. T(0);
  19932. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19933. , R = M / (t += M);
  19934. this.warpCommonParameters(t, R, !0, z.NONE),
  19935. V.start(I, t, null, 0, null, "_haltWatcher"),
  19936. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19937. V.start(E, t, null, R, n, "blurring")),
  19938. V.start(b, t, null, R, n, "modelAlpha"),
  19939. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19940. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19941. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19942. }
  19943. ,
  19944. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19945. var r = e || 0;
  19946. null != t || (t = D.warp.teleportTime),
  19947. this.warpCommonParameters(t, r, !1, i),
  19948. this.model.chunks.forEach(function(e) {
  19949. e.material.uniforms.blackout.value = i
  19950. }),
  19951. this._warpBendAim(null, t, null, r);
  19952. var o = function() {
  19953. this.wrapupWarpShadingOnly(n, i)
  19954. }
  19955. .bind(this);
  19956. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19957. }
  19958. ,
  19959. t.prototype.flightStepWalk = (a = new P.Vector3,
  19960. s = new P.Vector3,
  19961. function(e, t, i) {
  19962. if (this.warpInterrupted)
  19963. i && i();
  19964. else if (this.activeTransType !== L.WALK)
  19965. this._clearWarpShading(),
  19966. this._warpStopFlying(),
  19967. this.player.spider.draw(),
  19968. this.placeCpm(),
  19969. i && i();
  19970. else if (this.player.currentPano !== e) {
  19971. var n = {
  19972. pano: e,
  19973. lookAtPoint: t,
  19974. duration: null,
  19975. maxDistanceOverride: D.warp.walkMaxDist,
  19976. skipWarpingCheck: !1,
  19977. constantMoveSpeed: !0
  19978. };
  19979. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19980. n.zoomLevel = this.warpDestHeroLoc.zoom
  19981. }
  19982. n.duration = function(e, t) {
  19983. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19984. s.copy(U.FORWARD),
  19985. this.player.getDirection(s),
  19986. a.copy(t).sub(e.position).normalize();
  19987. var n = a.dot(s)
  19988. , r = Math.acos(n)
  19989. , o = r / i;
  19990. return .001 < o && (i *= o / .001,
  19991. r < 1 && (i *= 1.2)),
  19992. i
  19993. }
  19994. .call(this, e, t),
  19995. this.player.nonInterruptingFlyToPano(n, i)
  19996. } else
  19997. i && i()
  19998. }
  19999. ),
  20000. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  20001. return this.flightStepWalk.bind(this, e, t, i)
  20002. }
  20003. ,
  20004. t.prototype.warpTravel_WALK = (f = [],
  20005. function(e) {
  20006. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  20007. var o = this.nodes[r]
  20008. , a = t.get(o);
  20009. this.nodes.length,
  20010. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  20011. i && n || (f.push(o),
  20012. i = a)
  20013. }
  20014. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  20015. var s = f.length
  20016. , l = t.get(f[s - 1])
  20017. , c = new Array(s + 1);
  20018. c[c.length - 1] = function() {
  20019. e && e()
  20020. }
  20021. .bind(this);
  20022. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  20023. var d = f[h];
  20024. l = t.get(d);
  20025. var p = new P.Vector3;
  20026. this.getLookAtForWalkingTourNode(f, h, p),
  20027. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  20028. h--
  20029. }
  20030. c[0]()
  20031. }
  20032. ),
  20033. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  20034. h = new P.Vector3,
  20035. u = new P.Vector3,
  20036. d = new P.Vector3,
  20037. p = new P.Vector3,
  20038. function(e, t, i) {
  20039. var n = e.length;
  20040. if (n <= t)
  20041. return !1;
  20042. var r = 1
  20043. , o = 1;
  20044. h.set(0, 0, 0),
  20045. p.set(0, 0, 0);
  20046. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  20047. if (a = this.player.model.panos.get(e[s]),
  20048. this.getOrientationForWalkingTourNode(e, s, u),
  20049. s === t && c.copy(u),
  20050. d.copy(u),
  20051. t < s) {
  20052. var l = d.dot(c) < .65;
  20053. r *= l ? .2 : .75,
  20054. o *= l ? .2 : .4
  20055. }
  20056. u.multiplyScalar(r),
  20057. h.add(u),
  20058. p.lerp(a.position, o)
  20059. }
  20060. return h.normalize(),
  20061. i.copy(p),
  20062. i.add(h),
  20063. !0
  20064. }
  20065. ),
  20066. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20067. var n = e.length;
  20068. if (n <= t)
  20069. return !1;
  20070. if (t === n - 1)
  20071. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20072. else {
  20073. var r = this.player.model.panos.get(e[t])
  20074. , o = this.player.model.panos.get(e[t + 1]);
  20075. i.copy(o.position).sub(r.position)
  20076. }
  20077. return i.normalize(),
  20078. !0
  20079. }
  20080. ,
  20081. t.prototype.warpCameraTravel = function(e, t, i, n) {
  20082. if (this.activeTransType = this.upcomingTransType,
  20083. this.lastTransType = this.activeTransType,
  20084. this.upcomingTransType = null,
  20085. e)
  20086. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  20087. this._clearWarpShading(),
  20088. this._warpStopFlying(),
  20089. this.player.spider.draw(),
  20090. this.placeCpm(),
  20091. n && n()
  20092. }
  20093. .bind(this)) : this.warpTravel_STD(n);
  20094. else {
  20095. var r = function() {
  20096. this._wrapupTravel(n)
  20097. }
  20098. .bind(this)
  20099. , o = {
  20100. pano: this.warpDestPano,
  20101. lookAtPoint: null,
  20102. duration: null,
  20103. maxDistanceOverride: null,
  20104. skipWarpingCheck: !1
  20105. };
  20106. this.player.flyToPano(o, r)
  20107. }
  20108. }
  20109. ,
  20110. t.prototype.startWarpState = function() {
  20111. this.warping = !0,
  20112. this.warpInterrupted = !1,
  20113. this.warpInterruptionBlackoutStyle = null,
  20114. this.warpInterruptionTravelTime = null
  20115. }
  20116. ,
  20117. t.prototype.endWarpState = function() {
  20118. this.warping = !1
  20119. }
  20120. ,
  20121. t.prototype.warpToPano = function(e, t, i, n) {
  20122. if (this.warping)
  20123. H.warn("Cannot warp when already warping");
  20124. else {
  20125. if (this.upcomingTransType = e,
  20126. this.activeTransType = null,
  20127. !this.setWarpDestPano())
  20128. return this.upcomingTransType = null,
  20129. void this.warpToNonPano(n);
  20130. if (this.player.mode !== O.PANORAMA)
  20131. return this.upcomingTransType = null,
  20132. this.discardSlow(),
  20133. void this.player.flyToNewMode({
  20134. mode: O.PANORAMA,
  20135. pano: this.warpDestPano,
  20136. duration: D.warp.outsideTime,
  20137. warpDest: this.warpDestHeroLoc,
  20138. callback: n,
  20139. force: !0
  20140. });
  20141. if (!this.warpDestPano)
  20142. return H.warn("no warp destination, callback dropped"),
  20143. void (this.upcomingTransType = null);
  20144. 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)
  20145. , o = this.chooseWarpPath(r);
  20146. if (o && this.upcomingTransType !== L.WALK) {
  20147. var a = function() {
  20148. this.waitingToWarp = !1,
  20149. this.warpToPano(e, t, i, n)
  20150. }
  20151. .bind(this);
  20152. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  20153. return void (this.waitingToWarp = !0)
  20154. }
  20155. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  20156. this.player.currentPano = this.warpDestPano,
  20157. this.placeCpm(),
  20158. this.fadeOutCpm(D.path.fadeOutTime),
  20159. this.player.spider.draw()),
  20160. H.debug("Warping to pano ", this.warpDestPano.position),
  20161. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20162. this.startWarpState();
  20163. var s = function() {
  20164. this.endWarpState(),
  20165. n && n()
  20166. }
  20167. .bind(this);
  20168. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20169. }
  20170. }
  20171. ,
  20172. v.exports = t
  20173. }
  20174. ).call(this, "/js/objects/ShowPath.js")
  20175. }
  20176. , {
  20177. "../constants": 8,
  20178. "../effects": 16,
  20179. "../enum/BlackoutStyle": 18,
  20180. "../enum/ModelManagerEvents": 33,
  20181. "../enum/PlayerEvents": 40,
  20182. "../enum/RenderOrder": 42,
  20183. "../enum/Vectors": 50,
  20184. "../enum/Viewmode": 51,
  20185. "../enum/WarpStyle": 52,
  20186. "../gui/gui": 65,
  20187. "../model/ModelManager": 140,
  20188. "../objects/Snapshot": 153,
  20189. "../settings": 166,
  20190. "../shaders": 167,
  20191. "../util/easing": 186,
  20192. "../util/lerp": 188,
  20193. "../util/logger": 189,
  20194. "../util/math": 190,
  20195. "../util/texture": 194,
  20196. "../util/transitions": 195,
  20197. three: 217
  20198. }],
  20199. 152: [function(e, t, i) {
  20200. "use strict";
  20201. function n() {
  20202. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20203. , t = new r.RawShaderMaterial({
  20204. fragmentShader: o.skysphere.fragmentShader,
  20205. vertexShader: o.skysphere.vertexShader,
  20206. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20207. side: r.BackSide,
  20208. name: "skysphere"
  20209. });
  20210. t.uniforms.radius.value = e.parameters.radius,
  20211. r.Mesh.call(this, e, t)
  20212. }
  20213. var r = e("three")
  20214. , o = e("../shaders")
  20215. , a = e("../settings");
  20216. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20217. t.exports = n
  20218. }
  20219. , {
  20220. "../settings": 166,
  20221. "../shaders": 167,
  20222. three: 217
  20223. }],
  20224. 153: [function(r, o, e) {
  20225. (function(e) {
  20226. "use strict";
  20227. function t(e) {
  20228. n.call(this, e),
  20229. this.sid = e.sid,
  20230. this.panoId = e.panoId,
  20231. this.orthoZoom = e.orthoZoom,
  20232. this.floorVisibility = e.floorVisibility,
  20233. this.thumbUrl = e.thumbUrl,
  20234. this.name = e.name,
  20235. this.zoom = e.zoom
  20236. }
  20237. var i = (r("three"),
  20238. r("../util/logger"))
  20239. , n = (r("../settings"),
  20240. r("../enum/Viewmode"),
  20241. r("../util/common"),
  20242. r("../util/transitions"),
  20243. r("../util/lerp"),
  20244. r("../util/ajax"),
  20245. r("../util/texture"),
  20246. r("./View"));
  20247. r("events").EventEmitter,
  20248. new i(e),
  20249. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20250. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20251. }
  20252. ,
  20253. o.exports = t
  20254. }
  20255. ).call(this, "/js/objects/Snapshot.js")
  20256. }
  20257. , {
  20258. "../enum/Viewmode": 51,
  20259. "../settings": 166,
  20260. "../util/ajax": 181,
  20261. "../util/common": 185,
  20262. "../util/lerp": 188,
  20263. "../util/logger": 189,
  20264. "../util/texture": 194,
  20265. "../util/transitions": 195,
  20266. "./View": 154,
  20267. events: 202,
  20268. three: 217
  20269. }],
  20270. 154: [function(o, a, e) {
  20271. (function(e) {
  20272. "use strict";
  20273. function t(e) {
  20274. e = e || {},
  20275. this.position = new i.Vector3,
  20276. this.quaternion = new i.Quaternion,
  20277. this.update(e)
  20278. }
  20279. var i = o("three")
  20280. , n = o("../util/logger")
  20281. , r = (o("../settings"),
  20282. o("../enum/Viewmode"),
  20283. o("../util/common"),
  20284. o("../util/transitions"),
  20285. o("../util/lerp"),
  20286. o("../util/ajax"),
  20287. o("../util/texture"),
  20288. o("events").EventEmitter);
  20289. new n(e),
  20290. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20291. return !!this.cameraMode
  20292. }
  20293. ,
  20294. t.prototype.update = function(e) {
  20295. return this.cameraMode = e.cameraMode || this.cameraMode,
  20296. this.pano = e.pano || this.pano,
  20297. e.position && this.position.copy(e.position),
  20298. e.quaternion && this.quaternion.copy(e.quaternion),
  20299. this
  20300. }
  20301. ,
  20302. a.exports = t
  20303. }
  20304. ).call(this, "/js/objects/View.js")
  20305. }
  20306. , {
  20307. "../enum/Viewmode": 51,
  20308. "../settings": 166,
  20309. "../util/ajax": 181,
  20310. "../util/common": 185,
  20311. "../util/lerp": 188,
  20312. "../util/logger": 189,
  20313. "../util/texture": 194,
  20314. "../util/transitions": 195,
  20315. events: 202,
  20316. three: 217
  20317. }],
  20318. 155: [function(J, ee, e) {
  20319. (function(e) {
  20320. "use strict";
  20321. function t(e) {
  20322. this.currentPano = null,
  20323. this.nextPano = null,
  20324. this.camera = null,
  20325. this.paused = !1,
  20326. this.flying = !1,
  20327. this.sceneIntersectionPlane = null,
  20328. this.target = new B.Vector3,
  20329. this.mouse = new B.Vector3(1.1,1.1,.5),
  20330. this.mouseAtMouseDown = new B.Vector2,
  20331. this.mouseCouldBeClickToMove = !1,
  20332. this.mouseLastMoveTime = Date.now(),
  20333. this.mouseDown = !1,
  20334. this.mouseDownTimer = null,
  20335. this.couldBeLongTap = !1,
  20336. this.containsMouse = !0,
  20337. this.isTouchEvent = !1,
  20338. this.isPanoHover = !1,
  20339. this.reticule = new n(this),
  20340. this.panoMarkers = [],
  20341. this.spider = new s(this),
  20342. this.quaternion = new B.Quaternion,
  20343. this.position = new B.Vector3(15,10,15),
  20344. this.previousState = null,
  20345. this.lastInsideView = new o,
  20346. this.last360View = new o,
  20347. this.raycaster = new B.Raycaster,
  20348. this.intersect = null,
  20349. this.lastChangeTime = Date.now(),
  20350. this.history = new h,
  20351. this.cameraControls = null,
  20352. this.path = null,
  20353. this.model = null,
  20354. this.domElement = null,
  20355. this.cachedPanoCandidates = null,
  20356. this.basePanoSize = 0,
  20357. this.standardPanoSize = 0,
  20358. this.highPanoSize = 0,
  20359. this.ultraHighPanoSize = 0,
  20360. this.zoomLevel = 1,
  20361. this.zooming = 0,
  20362. this.zoomSpeed = .5,
  20363. this.scrollZoomSpeed = .06,
  20364. this.zoomSpeedAdjust = .05,
  20365. this.defaultZoomIncrement = .2,
  20366. this.baseFov = k.insideFOV,
  20367. this.zoomFov = this.baseFov,
  20368. this.zoomEnabled = !0,
  20369. this.preRenderingEnabled = !1,
  20370. this.setupCustomProperties(e),
  20371. this.zoomStats = new v,
  20372. this.modeTran = 'dollhouse-panorama'
  20373. this.currentCursor = '';
  20374. }
  20375. var B = J("three")
  20376. , i = J("./util/logger")
  20377. , n = J("./objects/Reticule")
  20378. , a = J("./objects/Panorama")
  20379. , r = J("./objects/ShowPath")
  20380. , o = J("./objects/View")
  20381. , s = (J("./objects/Snapshot"),
  20382. J("./objects/NSpider"))
  20383. , V = J("./enum/Viewmode")
  20384. , T = (J("./enum/TagStates"),
  20385. J("./enum/Vectors"))
  20386. , l = J("./enum/Keys")
  20387. , k = (J("./enum/AlignmentType"),
  20388. J("./settings"))
  20389. , x = J("./util/common")
  20390. , U = (J("./util/browser"),
  20391. J("./util/math"))
  20392. , H = J("./util/lerp")
  20393. , z = J("./util/easing")
  20394. , G = J("./util/transitions")
  20395. , c = J("events").EventEmitter
  20396. , h = (J("./shaders"),
  20397. J("./util/history"))
  20398. , S = (J("./util/camera"),
  20399. J("./model/ModelManager"),
  20400. J("./enum/PathDiscardMode"))
  20401. , M = J("./enum/PathDisplayMode")
  20402. , W = J("./enum/PlayerEvents")
  20403. , u = J("./enum/ControlEvents")
  20404. , d = J("./enum/ModelManagerEvents")
  20405. , R = J("./enum/WarpStyle")
  20406. , P = J("./enum/BlackoutStyle")
  20407. , p = J("./exception/BasicException")
  20408. , f = J("./enum/PanoSizeClass")
  20409. , g = (J("./tile/TileDownloader"),
  20410. J("./tile/TilePrioritizer"))
  20411. , m = (J("./enum/PanoramaEvents"),
  20412. J("./enum/ZoomEvents"))
  20413. , v = J("./util/ZoomStats")
  20414. , y = J("./constants")
  20415. , j = J("./util/common")
  20416. , A = J("./util/cameraLight")
  20417. , C = J("hot")
  20418. , Y = new i(e)
  20419. , q = Object.freeze({
  20420. FlyToPano: G.getUniqueId(),
  20421. FlyToNewMode: G.getUniqueId(),
  20422. FlyToSameMode: G.getUniqueId(),
  20423. FlyToViewFloor: G.getUniqueId(),
  20424. LookTransition: G.getUniqueId(),
  20425. ZoomTransition: G.getUniqueId()
  20426. });
  20427. function I(e) {
  20428. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20429. o[r] = n.charCodeAt(r);
  20430. return new Blob([o],{
  20431. type: i
  20432. })
  20433. }
  20434. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20435. (window.player = this).modelManager = e.modelManager,
  20436. this.tileDownloader = e.tileDownloader,
  20437. this.panoRenderer = e.panoRenderer,
  20438. this.qualityManager = e.qualityManager,
  20439. this.domElement = e.container,
  20440. this.camera = e.camera,
  20441. this.tagManager = e.tagManager,
  20442. this.cameraControls = e.controls,
  20443. this.path = new r(e.director,this,e.controls),
  20444. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20445. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20446. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20447. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20448. this.tileDownloader.processPriorityQueue = !1,
  20449. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20450. this.bindEvents(e.container),
  20451. this.updateModel()
  20452. }
  20453. ,
  20454. t.prototype.screenShot = function(i) {
  20455. if (!this.flying && !this.flyingToTag) {
  20456. var n = this.sceneRenderer;
  20457. for (var e in n.updateScreenSize(i),
  20458. this.model.panos.index)
  20459. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20460. this.model.panos.index[e].marker.visible = !1);
  20461. for (var e in this.model.hots)
  20462. this.model.hots[e].mesh.visible = !1;
  20463. this.reticule.visible = !1,
  20464. this.reticule.forceUnvisible = !0,
  20465. this.path.currentPanoMarker.mesh.visible = !1,
  20466. setTimeout(function() {
  20467. n.renderer.clear(!0, !0, !0),
  20468. n.renderer.render(n.scene, n.camera);
  20469. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20470. for (var t in i.f && i.f(e),
  20471. n.updateScreenSize({
  20472. resize: !0
  20473. }),
  20474. this.reticule.visible = !0,
  20475. this.model.hots)
  20476. this.model.hots[t].mesh.visible = !0;
  20477. for (var t in this.model.panos.index)
  20478. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20479. this.path.currentPanoMarker.mesh.visible = !0,
  20480. n.renderer.render(n.scene, n.camera)
  20481. }
  20482. .bind(this), 30)
  20483. }
  20484. }
  20485. ;
  20486. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20487. t.prototype.getWrapShot = function() {
  20488. var i = this.getSnapAngleInfo()
  20489. , n = ",{\r\t" + i
  20490. , r = arguments[0];
  20491. this.screenShot({
  20492. width: g_snapShotWidth,
  20493. height: g_snapShotHeight,
  20494. type: "image/jpeg",
  20495. f: function(e) {
  20496. if (r && r.__callback)
  20497. return r.__callback(e, i);
  20498. var t = new Image;
  20499. t.src = e,
  20500. t.onload = function() {
  20501. var e = function(r, i) {
  20502. function n(e, t) {
  20503. var i = o || r
  20504. , n = document.createElement("canvas");
  20505. n.width = i.width,
  20506. n.height = i.height,
  20507. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20508. o = Q(e, n, t)
  20509. }
  20510. function e() {
  20511. var e = o || r
  20512. , t = I(e.src);
  20513. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20514. t = I(e.src)),
  20515. (o = o || new Image).base64Src = e.src,
  20516. o.src = window.URL.createObjectURL(t)
  20517. }
  20518. var o, t = Math.max(r.width, r.height);
  20519. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20520. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20521. e())),
  20522. o || r
  20523. }(this, {
  20524. maxSize: g_snapShotWidth,
  20525. oldType: "jpeg"
  20526. });
  20527. e.src.replace(function(e) {
  20528. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20529. }("image/jpeg"), "image/octet-stream");
  20530. var t = "snap" + (new Date).getTime();
  20531. !function(e, t) {
  20532. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20533. i.href = e,
  20534. i.download = t;
  20535. var n = document.createEvent("MouseEvents");
  20536. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20537. i.dispatchEvent(n)
  20538. }(e.src, t + ".jpg"),
  20539. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20540. n += '\r\t"sid":"' + t + '",',
  20541. n += '\r\t"name":"' + t + '"\r}',
  20542. logData(n)
  20543. }
  20544. }
  20545. })
  20546. }
  20547. /* ,
  20548. t.prototype.getSnapAngleInfo = function() {
  20549. var e = {}
  20550. , t = '"metadata":{'
  20551. , i = this.camera.quaternion.clone();
  20552. switch (this.mode) {
  20553. case "panorama":
  20554. e.scan_id = this.currentPano.id,
  20555. t += '"scan_id":"' + this.currentPano.id + '",';
  20556. break;
  20557. case "floorplan":
  20558. e.camera_mode = 1,
  20559. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20560. t += '"camera_mode":1,',
  20561. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20562. break;
  20563. case "dollhouse":
  20564. e.camera_mode = 2,
  20565. t += '"camera_mode":2,'
  20566. }
  20567. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20568. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20569. n.x *= -1,
  20570. n.w *= -1,
  20571. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20572. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20573. e.zoom = this.zoomLevel,
  20574. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20575. }
  20576. , */
  20577. t.prototype.getSnapAngleInfo = function(){
  20578. var info = {};
  20579. var str = '"metadata":{';
  20580. var q = this.camera.quaternion.clone();
  20581. switch (this.mode) {
  20582. case "panorama":
  20583. info.scan_id = this.currentPano.id;
  20584. str += ('"scan_id":"'+this.currentPano.id+'",');
  20585. break;
  20586. case "floorplan":
  20587. info.camera_mode = 1;
  20588. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20589. q.multiply(this.camera.quaternion);
  20590. str += ('"camera_mode":1,');
  20591. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20592. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20593. break;
  20594. case "dollhouse":
  20595. info.camera_mode = 2;
  20596. str += ('"camera_mode":2,');
  20597. break;
  20598. }
  20599. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20600. //console.log(info.camera_position)
  20601. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20602. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20603. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20604. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20605. out.x *= -1;
  20606. out.w *= -1;
  20607. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20608. }else{
  20609. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20610. } */
  20611. info.zoom = this.zoomLevel;
  20612. //console.log(info.camera_quaternion)
  20613. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20614. // fyz 扩展编辑页面, 加上导览点缩放值
  20615. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20616. console.log(str)
  20617. return str;
  20618. }
  20619. //------end
  20620. t.prototype.closePopup = function() {
  20621. if (g_currentHot) {
  20622. g_currentHot = null,
  20623. document.getElementById("popup").style.display = "none",
  20624. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20625. $("#popup iframe:last").remove();
  20626. document.getElementById("bgaudio");
  20627. if(g_bgAudio && g_bgAudio.pauseByHot){
  20628. manage.switchBgmState(true)
  20629. }
  20630. return false
  20631. }
  20632. }
  20633. ,
  20634. t.prototype.setupCustomProperties = function(e) {
  20635. var i = e || V.PANORAMA;
  20636. Object.defineProperty(this, "mode", {
  20637. get: function() {
  20638. return i
  20639. },
  20640. set: function(e) {
  20641. var t = i;
  20642. i = e,
  20643. this.onModeUpdated(t, i)
  20644. }
  20645. })
  20646. }
  20647. ,
  20648. t.prototype.isInMode = function() {
  20649. for (var e = 0; e < arguments.length; e++)
  20650. if (this.mode === arguments[e])
  20651. return !0;
  20652. return !1
  20653. }
  20654. ,
  20655. t.prototype.isOutsideMode = function(e) {
  20656. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20657. }
  20658. ,
  20659. t.prototype.is360View = function(e, t) {
  20660. return e === V.PANORAMA && t && !t.isAligned()
  20661. }
  20662. ,
  20663. t.prototype.setScene = function(e) {
  20664. this.sceneIntersectionPlane = e.plane,
  20665. this.path.setScene(e),
  20666. this.moveReticuleToScene(e)
  20667. }
  20668. ,
  20669. t.prototype.moveReticuleToScene = function(e) {
  20670. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20671. e.add(this.reticule)
  20672. }
  20673. ,
  20674. t.prototype.updateModel = function() {
  20675. function n(e) {
  20676. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20677. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20678. , n = t.position.y + (e - i.target.y)
  20679. , r = k.showFloorDuration + k.showFloorDelay;
  20680. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20681. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20682. }
  20683. this.model = this.modelManager.getActiveModel(),
  20684. this.model.on("floor.changed", function(e, t, i) {
  20685. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20686. }
  20687. .bind(this)),
  20688. this.model.on("allfloors.toggled", function(e, t) {
  20689. if (this.mode === V.DOLLHOUSE) {
  20690. var i = e ? this.model.center.y : i = t.center.y;
  20691. n.call(this, i)
  20692. }
  20693. }
  20694. .bind(this)),
  20695. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20696. var t = this;
  20697. this.model.panos.list.forEach(function(e) {
  20698. e.vrMarker.addEventListener("click", function() {
  20699. t.flyToPano({
  20700. pano: e
  20701. })
  20702. })
  20703. })
  20704. }
  20705. ,
  20706. t.prototype.updateModelDependentData = function() {
  20707. this.cameraControls.setModelForControls(this.model),
  20708. this.getPanoMarkersFromModel(this.model)
  20709. }
  20710. ,
  20711. t.prototype.onModelChanged = function() {
  20712. this.updateModel(),
  20713. this.updateModelDependentData()
  20714. }
  20715. ,
  20716. t.prototype.getPanoMarkersFromModel = function(e) {
  20717. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20718. return t.marker ? e.concat(t.marker) : e
  20719. }, [])
  20720. }
  20721. ,
  20722. t.prototype.handleControlMove = function(e) {
  20723. this.emit(W.Move, e)
  20724. }
  20725. ,
  20726. t.prototype.handleControlInputStart = function(e) {
  20727. this.emit(W.InputStart, e)
  20728. }
  20729. ,
  20730. t.prototype.onModeUpdated = function(e, t) {
  20731. this.cameraControls.activateControls(t),
  20732. this.emit(W.ModeChanged, e, t)
  20733. }
  20734. ,
  20735. t.prototype.isWarping = function() {
  20736. return this.path.warping
  20737. }
  20738. ,
  20739. t.prototype.isWaitingToWarp = function() {
  20740. return this.path.waitingToWarp
  20741. }
  20742. ,
  20743. t.prototype.getLabelScaleFactor = function() {
  20744. if (this.isOutsideMode()) {
  20745. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20746. }
  20747. return .5
  20748. }
  20749. ,
  20750. t.prototype.changeMusic = function() {
  20751. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20752. }
  20753. ,
  20754. t.prototype.bindEvents = function(e) {
  20755. e !== document && e.setAttribute("tabindex", -1),
  20756. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20757. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20758. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20759. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20760. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20761. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20762. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20763. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20764. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20765. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20766. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20767. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20768. document.addEventListener("pointerup", ()=>{//add
  20769. window.transformControls && transformControls.onPointerUp()
  20770. }),
  20771. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20772. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20773. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20774. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20775. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20776. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20777. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20778. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20779. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20780. window.getSeft && getSeft(this),
  20781. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20782. }
  20783. ,
  20784. t.prototype.onMouseDown = function(e) {
  20785. e.currentTarget !== document && e.currentTarget.focus(),
  20786. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20787. this.updateIntersect())
  20788. }
  20789. ,
  20790. t.prototype.onMouseMove = function(e) {
  20791. this.isTouchEvent = !1,
  20792. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20793. }
  20794. ,
  20795. t.prototype.onMouseOver = function(e) {
  20796. this.containsMouse = !0,
  20797. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20798. }
  20799. ,
  20800. t.prototype.onMouseOut = function(e) {
  20801. this.containsMouse = !1
  20802. }
  20803. ,
  20804. t.prototype.onMouseUp = function(e) {
  20805. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20806. }
  20807. ,
  20808. t.prototype.onTouchStart = function(e) {
  20809. if (e.currentTarget !== document && e.currentTarget.focus(),
  20810. !this.mouseDown) {
  20811. this.couldBeLongTap = !0;
  20812. var t = x.average(e.changedTouches, "clientX")
  20813. , i = x.average(e.changedTouches, "clientY");
  20814. this.handleInputStart.call(this, t, i, !0),
  20815. this.mouseDownTimer = setTimeout(function() {
  20816. this.updateIntersect(),
  20817. this.handleInputEnd.call(this, t, i, !0)
  20818. }
  20819. .bind(this), k.input.longTapThreshold)
  20820. }
  20821. }
  20822. ,
  20823. t.prototype.onTouchMove = function(e) {
  20824. var t = x.average(e.changedTouches, "clientX")
  20825. , i = x.average(e.changedTouches, "clientY");
  20826. this.handleInputMove.call(this, t, i, !0)
  20827. }
  20828. ,
  20829. t.prototype.onTouchEnd = function(e) {
  20830. if (clearTimeout(this.mouseDownTimer),
  20831. this.mouseDown) {
  20832. this.couldBeLongTap = !1,
  20833. this.updateIntersect();
  20834. var t = x.average(e.changedTouches, "clientX")
  20835. , i = x.average(e.changedTouches, "clientY");
  20836. this.handleInputEnd.call(this, t, i, !0)
  20837. }
  20838. }
  20839. ,
  20840. t.prototype.onPointerDown = function(e) {
  20841. return e.currentTarget !== document && e.currentTarget.focus(),
  20842. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20843. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20844. void (this.mouseDownTimer = setTimeout(function() {
  20845. this.updateIntersect(),
  20846. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20847. }
  20848. .bind(this), k.input.longTapThreshold)))
  20849. }
  20850. ,
  20851. t.prototype.onPointerMove = function(e) {
  20852. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20853. }
  20854. ,
  20855. t.prototype.onPointerUp = function(e) {
  20856. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20857. this.couldBeLongTap = !1,
  20858. this.updateIntersect(),
  20859. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20860. }
  20861. ,
  20862. t.prototype.onPointerOut = function(e) {
  20863. this.mouseDown = !1
  20864. }
  20865. ,
  20866. t.prototype.onPointerCancel = function(e) {
  20867. this.mouseDown = !1
  20868. }
  20869. ,
  20870. t.prototype.onKeyDown = function(e) {
  20871. var t = function() {
  20872. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20873. }
  20874. .bind(this)
  20875. , i = e.which;
  20876. switch (i) {
  20877. case l.F:
  20878. t(),
  20879. this.changeFloor(-1);
  20880. break;
  20881. case l.R:
  20882. t(),
  20883. this.changeFloor(1)
  20884. }
  20885. if (this.mode === V.PANORAMA)
  20886. switch (i) {
  20887. case l.UPARROW:
  20888. case l.W:
  20889. this.flyLocalDirection(T.FORWARD.clone());
  20890. break;
  20891. case l.DOWNARROW:
  20892. case l.S:
  20893. this.flyLocalDirection(T.BACK.clone());
  20894. break;
  20895. case l.A:
  20896. this.flyLocalDirection(T.LEFT.clone());
  20897. break;
  20898. case l.D:
  20899. this.flyLocalDirection(T.RIGHT.clone())
  20900. }
  20901. }
  20902. ,
  20903. t.prototype.handleScrollPinchZoom = function(e) {
  20904. var t = e
  20905. , i = this.zoomLevel;
  20906. this.zoomBy(t),
  20907. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20908. }
  20909. ,
  20910. t.prototype.handleControlPinch = function(e) {
  20911. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20912. }
  20913. ,
  20914. t.prototype.handleControlScroll = function(e) {
  20915. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20916. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20917. }
  20918. ,
  20919. t.prototype.handleInputStart = function(e, t, i) {
  20920. var n = this.handelPadding(e, t);
  20921. e = n.x,
  20922. t = n.y,
  20923. this.isTouchEvent = i,
  20924. U.convertScreenPositionToNDC(e, t, this.mouse),
  20925. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20926. this.mouseCouldBeClickToMove = !0,
  20927. this.mouseDown = !0,
  20928. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20929. window.transformControls && transformControls.onPointerDown()
  20930. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20931. try{
  20932. this.overlayGroup.children.forEach((overlay)=>{
  20933. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20934. })
  20935. }catch(e){}
  20936. this.overlayInitedPlay = true
  20937. }
  20938. }
  20939. ,
  20940. t.prototype.handelPadding = function(e, t) {
  20941. return this.pad || (this.pad = {
  20942. x: dom.getOffset("left", $("#player")[0]),
  20943. y: dom.getOffset("top", $("#player")[0])
  20944. }),
  20945. {
  20946. x: e - this.pad.x,
  20947. y: t - this.pad.y
  20948. }
  20949. }
  20950. ,
  20951. t.prototype.handleInputMove = function(e, t, i) {
  20952. var n = this.handelPadding(e, t);
  20953. e = n.x,
  20954. t = n.y,
  20955. this.isTouchEvent = i,
  20956. U.convertScreenPositionToNDC(e, t, this.mouse);
  20957. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20958. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20959. this.couldBeLongTap = !1,
  20960. clearTimeout(this.mouseDownTimer)),
  20961. this.mouseLastMoveTime = Date.now(),
  20962. this.reticule.move(e, t, i)
  20963. window.transformControls && transformControls.onPointerMove()
  20964. }
  20965. ,
  20966. t.prototype.handleInputEnd = function(e, t, i) {
  20967. if (this.isTouchEvent = i,
  20968. this.mouseDown = !1,
  20969. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20970. !i && this.couldBeLongTap)
  20971. return !0;
  20972. if (this.handleLongTap())
  20973. return !0;
  20974. window.transformControls && transformControls.onPointerUp()
  20975. if (this.mouseCouldBeClickToMove) {
  20976. if (this.flying)
  20977. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20978. !0;
  20979. //add----
  20980. if (this.checkHotClick())
  20981. return !0;
  20982. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20983. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20984. return;
  20985. }
  20986. if (window.VisiSet && VisiSet.setTagVisible ) {
  20987. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20988. return;
  20989. }
  20990. if(this.hoveringPlane){
  20991. this.clickOverlay(this.hoveringPlane)
  20992. return;
  20993. }
  20994. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20995. return EditOverlay.addPlane({intersect:this.intersect});
  20996. }
  20997. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20998. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20999. else if(objects.mainDesign.editType == "addOverlay")return !0;
  21000. } */
  21001. //----------
  21002. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  21003. this.history.invalidate(),
  21004. this.intersect)
  21005. return this.flyToPanoClosestToMouse();
  21006. if (this.mode === V.PANORAMA) {
  21007. var n = this.closestPanoInDirection(this.getMouseDirection());
  21008. return n ? this.flyToPano({
  21009. pano: n
  21010. }) : this.bump(this.getMouseDirection())
  21011. }
  21012. }
  21013. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21014. }
  21015. ,
  21016. t.prototype.handleLongTap = function() {
  21017. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  21018. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  21019. !0
  21020. }
  21021. ,
  21022. t.prototype.checktagClick = function() {
  21023. if (this.tagManager.intersectTag) {
  21024. var e = this.isTouchEvent
  21025. , t = this.tagManager.clickedOnTag(e, this);
  21026. return e || t || G.cancelById(q.LookTransition),
  21027. !0
  21028. }
  21029. if (this.tagManager.activeTag)
  21030. return this.tagManager.dismissActiveTag(),
  21031. !1
  21032. }
  21033. ,
  21034. t.prototype.rankedtagInDirection = function(e, t) {
  21035. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21036. }
  21037. ,
  21038. t.prototype.start = function(e) {
  21039. $(".toolLeft").removeClass("unable");
  21040. $(".toolTop").removeClass("unable");
  21041. //-------------------
  21042. window.initTransformCtl(B)
  21043. window.initOverlay(B)
  21044. this.model.loadOverlays()
  21045. window.EditOverlay && window.EditOverlay.init(B);
  21046. window.VisiSet && VisiSet.init()
  21047. //-------------------
  21048. var t = e.mode
  21049. , i = e.pano
  21050. , n = e.position
  21051. , r = e.quaternion
  21052. , o = e.tag
  21053. , a = e.quickstart
  21054. , s = $.Deferred();
  21055. this.updateModelDependentData(),
  21056. this.updateFromControls(),
  21057. this.findDefaultViews();
  21058. var l = this.is360View(t, i);
  21059. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21060. s.done(function(e) {
  21061. this.emit(W.Ready, l, e, o)
  21062. }
  21063. .bind(this)),
  21064. s.promise()
  21065. }
  21066. ,
  21067. t.prototype.startOutside = function(e, t) {
  21068. var i = e.mode
  21069. , n = e.pano
  21070. , r = e.position
  21071. , o = e.quaternion
  21072. , a = e.zoom
  21073. , s = e.floorVisibility
  21074. , l = e.tag;
  21075. this.emit(W.StartOutside, k[i].transitionTime),
  21076. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21077. G.cancelById(q.FlyToViewFloor),
  21078. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21079. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21080. }
  21081. ,
  21082. t.prototype.startInside = function(e, t, i, n, r) {
  21083. r = r || $.Deferred();
  21084. var o = (this.currentPano = e) && !e.isAligned();
  21085. if (t = o ? e.position : t || e.position,
  21086. i = i || e.quaternion,
  21087. e) {
  21088. var a = this.startInside.bind(this, e, t, i, n, r);
  21089. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21090. return
  21091. }
  21092. //add
  21093. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21094. return this.mode = V.PANORAMA,
  21095. e.floor.enter(this.mode),
  21096. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  21097. this.switchCameraMode(this.mode, i),
  21098. this.emit(W.StartInside, o),
  21099. r.resolve(!0),
  21100. r
  21101. }
  21102. ,
  21103. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  21104. if (r = r || $.Deferred(),
  21105. this.dollhouseMode(),
  21106. !i)
  21107. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21108. r.resolve(!1),
  21109. r;
  21110. e = e || i.position;
  21111. var o = n || this.cameraControls.activeControl.camera.quaternion
  21112. , a = i.position;
  21113. return this.fitDollhouse(a, e, o),
  21114. setTimeout(function(e) {
  21115. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  21116. var t = {
  21117. mode: V.PANORAMA,
  21118. pano: i,
  21119. quaternion: n,
  21120. callback: function() {
  21121. this.emit(W.FlyinFinished),
  21122. r.resolve(!0)
  21123. }
  21124. .bind(this)
  21125. };
  21126. this.flyToNewMode(t)
  21127. }
  21128. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  21129. r
  21130. }
  21131. ,
  21132. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  21133. K = {},
  21134. function(t, e, i, n, r, o, a, s, l, c) {
  21135. if (function() {
  21136. for (var e in Z)
  21137. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  21138. return !0;
  21139. return !1
  21140. }())
  21141. return !0;
  21142. var h = function(e, t, i) {
  21143. j.delayOneFrame(function() {
  21144. Z[e] = !1,
  21145. r && r(t, i)
  21146. }
  21147. .bind(this))
  21148. }
  21149. .bind(this, t.id)
  21150. , u = function(e, t) {
  21151. j.delayOneFrame(function() {
  21152. Z[e] = !1,
  21153. o && o(t)
  21154. }
  21155. .bind(this))
  21156. }
  21157. .bind(this, t.id);
  21158. try {
  21159. return null != s || (s = !0),
  21160. 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),
  21161. Z[t.id] && (K[t.id] = performance.now()),
  21162. Z[t.id]
  21163. } catch (e) {
  21164. throw Z[t.id] = !1,
  21165. K[t.id] = performance.now() - 5e3,
  21166. e
  21167. }
  21168. }
  21169. ),
  21170. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21171. if (!e)
  21172. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21173. return r && this.model.waitForLoad(e, function() {
  21174. return e.isLoaded(i)
  21175. }),
  21176. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21177. !0)
  21178. }
  21179. ,
  21180. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21181. function(e, t, i, n, r, o, a, s) {
  21182. if (!e)
  21183. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21184. return X.copy(T.FORWARD),
  21185. this.getDirection(X),
  21186. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21187. return e.isLoaded(t)
  21188. }),
  21189. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21190. i && i(e, t)
  21191. }
  21192. .bind(this)).fail(function(e) {
  21193. n && n(e)
  21194. }
  21195. .bind(this)).progress(function(e, t, i) {
  21196. r && r(e, t, i)
  21197. }
  21198. .bind(this)),
  21199. !0)
  21200. }
  21201. ),
  21202. t.prototype.switchCameraMode = function(e, t) {
  21203. var i = this.cameraControls.controls[e]
  21204. , n = i.camera;
  21205. switch (e) {
  21206. case V.PANORAMA:
  21207. n.position.copy(this.currentPano.position);
  21208. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21209. i.lookAt(r.add(n.position));
  21210. break;
  21211. case V.DOLLHOUSE:
  21212. /* var o = this.position.clone();
  21213. 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),
  21214. n.position.copy(o),
  21215. i.target.copy(this.target.clone().setY(this.model.center.y));
  21216. break; */
  21217. //for多楼层 且 让模型刚好适应屏幕
  21218. var box = this.model.boundingBox.clone();
  21219. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21220. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21221. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21222. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21223. console.log(boxSize.x,distance, boxSize.length() / 2)
  21224. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21225. if(this.mode === V.PANORAMA){
  21226. i.target.copy(this.model.center);
  21227. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21228. }else{
  21229. i.target.copy(this.target.clone().setY(this.model.center.y))
  21230. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21231. }
  21232. vec.multiplyScalar(distance )
  21233. n.position.copy(i.target.clone().add(vec))
  21234. break
  21235. case V.FLOORPLAN:
  21236. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21237. i.target.copy(this.model.center).setY(0),
  21238. i.zoomToContain(this.model.size),
  21239. i.rotateToView(this.model.size, this.getDirection())
  21240. }
  21241. i.update(0)
  21242. }
  21243. ,
  21244. t.prototype.update = (new B.Vector3,
  21245. N = {},
  21246. F = [],
  21247. function(e) {
  21248. this.updatePersistentZooming(e),
  21249. this.updateFromControls(e),
  21250. this.getCurrentNodePanos(F)
  21251. if(this.hasChanged(N)){
  21252. this.lastChangeTime = Date.now(),
  21253. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21254. this.emit(W.ViewChanged)
  21255. //add:
  21256. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  21257. this.intersectHot && this.intersectHot.showTitle()
  21258. for(var i in this.model.hots){
  21259. this.model.hots[i].update(this.camera)
  21260. }
  21261. }
  21262. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21263. this.model.supportsTiles && (this.updateTileDownloader(F),
  21264. this.updatePanoRenderer(F)),
  21265. this.updatePreRendering(F),
  21266. this.reticule.update(),
  21267. this.path.update(),
  21268. this.spider.update(),
  21269. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21270. this.updateControlLocks(),
  21271. this.model.supportsTiles && this.updateZoomPano()
  21272. }
  21273. ),
  21274. t.prototype.updatePersistentZooming = function(e) {
  21275. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21276. }
  21277. ,
  21278. t.prototype.updateControlLocks = function() {
  21279. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21280. }
  21281. ,
  21282. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21283. function(e) {
  21284. var t = this.nextPano || this.currentPano;
  21285. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21286. this.getDirection(D),
  21287. this.panoRenderer.updateDirection(D))
  21288. }
  21289. ),
  21290. t.prototype.cleanupInactivePanos = (O = [],
  21291. L = [],
  21292. function() {
  21293. O.length = 0,
  21294. O.push(this.currentPano),
  21295. this.nextPano && O.push(this.nextPano);
  21296. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21297. L.push(this.panoRenderer.activePanos[e]);
  21298. for (var t = 0; t < L.length; t++) {
  21299. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21300. i.id === O[r].id && (n = !1);
  21301. n && i.exit()
  21302. }
  21303. }
  21304. ),
  21305. t.prototype.updatePreRendering = (w = {},
  21306. function(e) {
  21307. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21308. var t = this.nextPano || this.currentPano;
  21309. if (t && e && 1 < e.length) {
  21310. var i = e.findIndex(function(e) {
  21311. if (e.id === t.id)
  21312. return !0
  21313. });
  21314. if (0 <= i && i + 1 < e.length) {
  21315. var n = e[i + 1];
  21316. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21317. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21318. window.setTimeout(function(e) {
  21319. w[e.id] = !1
  21320. }
  21321. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21322. }
  21323. .bind(this, n), k.tiling.panoPreRenderDelay),
  21324. w[n.id] = !0)
  21325. }
  21326. }
  21327. }
  21328. }
  21329. ),
  21330. t.prototype.enablePreRendering = function() {
  21331. this.preRenderingEnabled = !0
  21332. }
  21333. ,
  21334. t.prototype.disablePreRendering = function() {
  21335. this.preRenderingEnabled = !1,
  21336. this.cleanupInactivePanos()
  21337. }
  21338. ,
  21339. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21340. function(e) {
  21341. var t = this.nextPano || this.currentPano;
  21342. t && (b.copy(T.FORWARD),
  21343. this.getDirection(b),
  21344. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21345. this.tileDownloader.processPriorityQueue = !0)
  21346. }
  21347. ),
  21348. t.prototype.updateFromControls = function(e) {
  21349. null != e || (e = 0),
  21350. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21351. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21352. this.position.copy(this.cameraControls.activeControl.camera.position),
  21353. this.target.copy(this.cameraControls.activeControl.target),
  21354. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21355. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21356. this.camera.position.copy(this.position),
  21357. this.camera.quaternion.copy(this.quaternion),
  21358. this.camera.updateMatrix(),
  21359. this.camera.updateMatrixWorld()
  21360. }
  21361. ,
  21362. t.prototype.hasChanged = function(e) {
  21363. if (!this.previousState)
  21364. return this.previousState = {
  21365. allFloorsVisible: this.model.allFloorsVisible,
  21366. position: this.position.clone(),
  21367. quaternion: this.quaternion.clone(),
  21368. mouse: this.mouse.clone(),
  21369. labelScaleFactor: this.getLabelScaleFactor(),
  21370. currentFloor: this.model.currentFloor,
  21371. projectionMatrix: this.camera.projectionMatrix.clone(),
  21372. worldMatrix: this.camera.matrixWorld.clone(),
  21373. mode: this.mode,
  21374. modelPosition: this.model.position.clone(),
  21375. modelCenter: this.model.center.clone(),
  21376. zoomLevel: this.zoomLevel
  21377. },
  21378. !0;
  21379. 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;
  21380. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21381. e.moved = !this.position.equals(this.previousState.position),
  21382. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21383. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21384. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21385. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21386. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21387. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21388. e.modeChanged = this.mode !== this.previousState.mode,
  21389. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21390. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21391. e.nextPanoActive = null !== this.nextPano,
  21392. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21393. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21394. this.previousState.position.copy(this.position),
  21395. this.previousState.quaternion.copy(this.quaternion),
  21396. this.previousState.mouse.copy(this.mouse),
  21397. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21398. this.previousState.currentFloor = this.model.currentFloor,
  21399. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21400. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21401. this.previousState.mode = this.mode,
  21402. this.previousState.modelPosition.copy(this.model.position),
  21403. this.previousState.modelCenter.copy(this.model.center),
  21404. this.previousState.zoomLevel = this.zoomLevel,
  21405. !t
  21406. }
  21407. ,
  21408. t.prototype.updateIntersect = function() {
  21409. var e = this.flying || this.isWarping()
  21410. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21411. , i = G.getById(q.LookTransition);
  21412. e || t || this.isTouchEvent || i.length && i[0].running;
  21413. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21414. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21415. if (this.intersect && this.intersect.object.visible )
  21416. $("#player").css("cursor", "pointer");
  21417. else
  21418. $("#player").css("cursor", "")
  21419. return;
  21420. }
  21421. this.intersect = this.getMouseIntersect(),
  21422. this.intersect && this.updateClosestPano(this.intersect),
  21423. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21424. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21425. }
  21426. ,
  21427. t.prototype.checkHotClick = function() {
  21428. if (this.intersectHot){
  21429. if (window.VisiSet && VisiSet.setTagVisible ) {
  21430. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21431. return;
  21432. }
  21433. this.intersectHot.noAction || this.intersectHot.examine(this)
  21434. return !0
  21435. }
  21436. }
  21437. ,
  21438. t.prototype.getMouseDirection = function(e) {
  21439. e = e || this.mouse;
  21440. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21441. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21442. }
  21443. ,
  21444. t.prototype.hoverOverlay = function(mesh){
  21445. if(!mesh){
  21446. this.hoveringPlane = null;
  21447. $("#player").css("cursor",this.currentCursor || "" );
  21448. }else{
  21449. var overlay = mesh.parent;
  21450. $("#player").css("cursor","pointer");
  21451. this.hoveringPlane = overlay;
  21452. return true;
  21453. }
  21454. },
  21455. t.prototype.clickOverlay = function(overlay){
  21456. if(this.openOverlay && !overlay)return;
  21457. var plane = overlay.plane;
  21458. if(overlay.overlayType == "video"){
  21459. if(plane.material.map.image.paused)plane.material.map.image.play()
  21460. else plane.material.map.image.pause();
  21461. }
  21462. if(window.EditOverlay &&EditOverlay.editing){
  21463. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21464. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21465. EditOverlay.endAddPlane();
  21466. EditOverlay.updateOverlayPanel(overlay)
  21467. transformControls.attach(overlay)
  21468. return;
  21469. }
  21470. },
  21471. t.prototype.getMouseIntersect = function(e, t1) {
  21472. e = e || this.mouse.clone()
  21473. var t = t1 || this.model.floors.reduce(function(e, t) {
  21474. return t.hidden ? e : e.concat(t.collider.children)
  21475. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21476. t = t.slice(0)
  21477. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21478. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21479. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21480. this.raycaster.set(i, this.getMouseDirection(e));
  21481. var n = this.raycaster.intersectObjects(t, true);//add true
  21482. if ("add" == g_HotStatus) {
  21483. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21484. //console.log(r[0]),
  21485. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21486. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21487. window.hotIntersect = !1)
  21488. return;
  21489. }
  21490. this.intersectHot && this.intersectHot.hideTitle()
  21491. if (0 === n.length)
  21492. return this.intersectHot = null,
  21493. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21494. null;
  21495. var o = n[0];
  21496. if ("hotSprite" == o.object.type){
  21497. this.intersectHot = o.object.belongHot
  21498. this.intersectHot.showTitle()
  21499. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21500. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21501. return;
  21502. }
  21503. $(".toolRight .spotList ul li").removeClass("active")
  21504. this.intersectHot = null;
  21505. /* if(window.EditOverlay && n && n.length){
  21506. if(n[0].object.parent.parent == this.overlayGroup){
  21507. this.hoverOverlay(n[0].object);
  21508. }else()
  21509. } */
  21510. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21511. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21512. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21513. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21514. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21515. o.horizontal = .8 < o.normal.y);
  21516. return o
  21517. }
  21518. ,
  21519. t.prototype.updateClosestPano = function(e) {
  21520. var t = [a.filters.isPanoAligned()];
  21521. if (this.mode === V.PANORAMA) {
  21522. if (!this.currentPano)
  21523. return;
  21524. t.push(a.filters.not(this.currentPano)),
  21525. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21526. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21527. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21528. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21529. } else{
  21530. t.push((pano)=>{ // add
  21531. return this.checkHasNeighbor(pano)
  21532. })
  21533. t.push(a.filters.isOnVisibleFloor()),
  21534. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21535. }
  21536. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21537. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21538. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21539. this.closestPano = i) : this.isPanoHover = !1
  21540. }
  21541. ,
  21542. t.prototype.dollhouseMode = function(e, t) {
  21543. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21544. this.mode = V.DOLLHOUSE,
  21545. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21546. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21547. , n = new B.Vector3(15,10,15);
  21548. if (e && t) {
  21549. var r = T.FORWARD.clone().applyQuaternion(t)
  21550. , o = this.model.center.clone().sub(e).dot(r);
  21551. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21552. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21553. }
  21554. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21555. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21556. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21557. this.updateFromControls(),
  21558. this.model.alpha = 1,
  21559. this.model.skybox.material.uniforms.opacity.value = 0
  21560. }
  21561. ,
  21562. t.prototype.insideMode = function(e, t) {
  21563. var i = $.Deferred()
  21564. , n = t || null;
  21565. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21566. var r = [a.filters.isPanoAligned()];
  21567. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21568. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21569. this.flyToNewMode({
  21570. mode: V.PANORAMA,
  21571. pano: e,
  21572. callback: n
  21573. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21574. } else {
  21575. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21576. i.reject(o)
  21577. }
  21578. return i.promise()
  21579. }
  21580. ,
  21581. t.prototype.fitDollhouse = function(e, t, i) {
  21582. var maxY = this.model.boundingBox.max.y;//add
  21583. var n = T.FORWARD.clone().applyQuaternion(i);
  21584. i = n.clone().add(e);
  21585. this.cameraControls.activeControl.target.copy(i),
  21586. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21587. }
  21588. ,
  21589. t.prototype.floorplanMode = function(e, t, i) {
  21590. this.mode = V.FLOORPLAN;
  21591. var n = this.cameraControls.controls[V.FLOORPLAN];
  21592. n.reset();
  21593. var r = e || this.model.center;
  21594. if (n.target.copy(r).setY(0),
  21595. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21596. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21597. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21598. t) {
  21599. var o = T.LEFT.clone().applyQuaternion(t);
  21600. n.rotateLeft(-Math.atan2(o.x, o.z))
  21601. } else
  21602. n.rotateToView(this.model.size, this.getDirection());
  21603. n.update(0)
  21604. }
  21605. ,
  21606. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21607. return e.skipWarpingCheck = !0,
  21608. this.flyToPano(e, t)
  21609. }
  21610. ,
  21611. t.prototype.updateMarkerVisi = function() {//加
  21612. if(this.mode != "panorama")return;
  21613. this.model.panos.list.forEach((pano)=>{
  21614. if(!pano.marker)return;
  21615. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21616. })
  21617. }
  21618. ,
  21619. t.prototype.updateHotVisible = function(pano){
  21620. if (window.VisiSet && (VisiSet.setPanoVisible ))return
  21621. var hots = this.model.hots;
  21622. pano = pano || this.currentPano;
  21623. for (var index in hots){
  21624. var visible;
  21625. if(this.mode != "panorama"){
  21626. visible = true;
  21627. }else{
  21628. //hots[index].mesh.material.depthTest = false;
  21629. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21630. }
  21631. hots[index].mesh.visible = visible;
  21632. }
  21633. }
  21634. t.prototype.flyToPano = function(e, t) {
  21635. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21636. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21637. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21638. if (aim){
  21639. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21640. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21641. }
  21642. else aimQua = aimQua
  21643. var zoomLevel = e.zoomLevel || 1 //add
  21644. if(this.flying) return t && t(e)
  21645. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21646. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21647. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21648. t && t(),
  21649. !1;
  21650. this.updateLastView()
  21651. if (this.mode !== V.PANORAMA)
  21652. return void this.flyToNewMode({
  21653. mode: V.PANORAMA,
  21654. pano: n,
  21655. duration: o,
  21656. quaternion: aimQua,
  21657. callback: t
  21658. });
  21659. if (!n || (h = x.deepExtend(e), u = function() {
  21660. j.delayOneFrame(function() {
  21661. this.flyToPano(h, t)
  21662. }.bind(this))
  21663. }.bind(this),
  21664. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21665. var d = function(e) {
  21666. t && t(e)
  21667. }
  21668. .bind(this);
  21669. this.currentPano || (this.currentPano = n,
  21670. this.path.placeCpm(),
  21671. this.path.fadeOutCpm(k.path.fadeOutTime),
  21672. this.spider.draw());
  21673. var p = o;
  21674. if ("number" != typeof o) {
  21675. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21676. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21677. }
  21678. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21679. zoomLevel !== this.zoomLevel)
  21680. switch (k.zoom.transitionStyle) {
  21681. case 1:
  21682. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21683. break;
  21684. case 2:
  21685. return h = x.deepExtend(e),
  21686. u = this.flyToPano.bind(this, h, t),
  21687. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21688. }
  21689. if (aimQua) {
  21690. G.cancelById(q.LookTransition),
  21691. p *= k.transition.aimSlowFactor;
  21692. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21693. , y = g.clone()
  21694. , A = new B.Vector3;
  21695. if (n === this.currentPano) {
  21696. var C = T.FORWARD.clone().applyQuaternion(g)
  21697. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21698. , E = C.angleTo(I);
  21699. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21700. void G.start(function(e) {
  21701. y.copy(g),
  21702. H.quaternion(y, aimQua)(e),
  21703. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21704. this.cameraControls.activeControl.lookAt(A)
  21705. }
  21706. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21707. }
  21708. }
  21709. if (n === this.currentPano )
  21710. return void d();
  21711. this.flying = !0;
  21712. var _ = this.position.clone()
  21713. , b = this.currentPano;
  21714. Y.debug("Flying to pano ", n.position);
  21715. this.emit(W.PanoChosen, this.currentPano, n);
  21716. this.emit(W.FlyingStarted, n.position, _, n, b);
  21717. this.updateHotVisible(n); //更新热点显示
  21718. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21719. Overlay.updateVisibles([this.currentPano, n])
  21720. aimQua && G.start(function(e) {
  21721. y.copy(g),
  21722. H.quaternion(y, aimQua)(e),
  21723. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21724. this.cameraControls.activeControl.lookAt(A)
  21725. }
  21726. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21727. var w = c ? null : z[k.transition.movementEasing];
  21728. this.nextPano = n;
  21729. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21730. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21731. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21732. this.flying = !1,
  21733. this.currentPano !== n && this.currentPano.exit(),
  21734. n.enter(),
  21735. this.currentPano = n,
  21736. this.nextPano = null,
  21737. this.path.placeCpm(),
  21738. this.path.fadeOutCpm(k.path.fadeOutTime),
  21739. this.spider.draw(),
  21740. this.emit(W.FlyingEnded, n.position, _, n, b),
  21741. this.updateMarkerVisi();//add
  21742. d(e)
  21743. if(this.mode == "panorama" && EditOverlay.editing){
  21744. EditOverlay.updatePano(this.currentPano)
  21745. Overlay.updateVisibles([this.currentPano])
  21746. }
  21747. }
  21748. .bind(this), 0, w, "camFly", q.FlyToPano)
  21749. }
  21750. }
  21751. ,
  21752. window._transitionPosId = 9999
  21753. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21754. G.cancelById(_transitionPosId)
  21755. var begin = function(object, pos, qua, scale){
  21756. if(pos){
  21757. if(!same(object.position, pos, 0.01)){
  21758. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21759. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21760. }
  21761. if(!same(object.quaternion, qua, 1e-6)){
  21762. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21763. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21764. }
  21765. if(!same(object.scale, scale, 0.001)){
  21766. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21767. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21768. }
  21769. }
  21770. }
  21771. var same = function(vec1, vec2, diff){
  21772. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21773. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21774. return s
  21775. }
  21776. this.overlayGroup.children.forEach(overlay=>{
  21777. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21778. var useCustom = o.type == "beforeFlyOut" || !panoData
  21779. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21780. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21781. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21782. overlay.getScaleBySize(panoData.width , panoData.height)
  21783. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21784. begin(overlay, pos, qua, scale )
  21785. })
  21786. }
  21787. window._tranOutsideFocus = 4399
  21788. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21789. console.log("focusPoint")
  21790. if(this.mode == "floorplan"){
  21791. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21792. var control = player.cameraControls.controls.floorplan;
  21793. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21794. var currentScale = control.absoluteScale;
  21795. var currentTarget = control.target.clone()
  21796. G.cancelById(window._tranOutsideFocus, true);
  21797. G.start(function(progress){
  21798. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21799. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21800. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21801. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21802. }else if(player.mode == "dollhouse"){
  21803. var control = player.cameraControls.controls.dollhouse;
  21804. var radius = o.radius || 8;
  21805. var currentTarget = control.target.clone()
  21806. var dir = control.offset.clone().normalize()
  21807. var currentRadius = control.offset.length();
  21808. G.cancelById(window._tranOutsideFocus, true);
  21809. G.start(function(progress){
  21810. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21811. let radius_ = radius*progress+currentRadius*(1-progress)
  21812. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21813. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21814. }else if(this.mode == 'panorama'){
  21815. this.flyToPano({
  21816. lookAtPoint: o.aim.clone() ,
  21817. pano: this.currentPano,
  21818. aimDuration: o.dur || 600
  21819. })
  21820. }
  21821. }
  21822. t.prototype.fastForwardActivePanoFlight = function(e) {
  21823. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21824. G.adjustSpeed(q.FlyToPano, e),
  21825. G.adjustSpeed(q.LookTransition, e)
  21826. }
  21827. ,
  21828. t.prototype.flyToPanoClosestToMouse = function() {
  21829. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21830. this.intersect && this.updateClosestPano(this.intersect)),
  21831. this.closestPano)
  21832. return this.flyToPano({
  21833. pano: this.closestPano
  21834. });
  21835. var e = this.getMouseDirection();
  21836. this.flyDirection(e) || this.flyToPano({
  21837. pano: this.currentPano
  21838. })
  21839. }
  21840. ,
  21841. t.prototype.flyLocalDirection = function(e) {
  21842. var t = this.getDirection(e)
  21843. , i = 1 === e.z ? .4 : .75
  21844. , n = 1 === Math.abs(e.x);
  21845. return this.flyDirection(t, i, n)
  21846. }
  21847. ,
  21848. t.prototype.flyDirection = function(e, t, i) {
  21849. this.closePopup();
  21850. var n = $.Deferred();
  21851. this.history.invalidate();
  21852. var r = this.closestPanoInDirection(e, t, i);
  21853. return r ? this.flyToPano({
  21854. pano: r
  21855. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21856. n.resolve(!1)),
  21857. n.promise()
  21858. }
  21859. ,
  21860. t.prototype.closestPanoInDirection = function(e, t, i) {
  21861. return this.rankedPanoInDirection(0, e, t, i)
  21862. }
  21863. ,
  21864. t.prototype.rankedPanoInDirection = (_ = {
  21865. pano: null,
  21866. candidates: []
  21867. },
  21868. function(e, t, i, n) {
  21869. e = e || 0,
  21870. i = void 0 !== i ? i : .75;
  21871. var r = n ? "angle" : "direction";
  21872. 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)], _),
  21873. this.cachedPanoCandidates = _.candidates,
  21874. _.pano
  21875. }
  21876. ),
  21877. t.prototype.bump = function(e) {
  21878. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21879. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21880. if (.5 < Math.abs(a))
  21881. t = function() {
  21882. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21883. }
  21884. .bind(this),
  21885. i = function() {
  21886. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21887. }
  21888. .bind(this);
  21889. else {
  21890. var s = this.camera.position.clone()
  21891. , l = e.clone();
  21892. this.raycaster.set(s, l);
  21893. var c = this.model.floors.reduce(function(e, t) {
  21894. return e.concat(t.collider.children)
  21895. }, [])
  21896. , h = this.raycaster.intersectObjects(c)
  21897. , u = 0 < h.length ? h[0].distance / 25 : .04
  21898. , d = s.clone().add(l.multiplyScalar(u));
  21899. t = function() {
  21900. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21901. }
  21902. .bind(this),
  21903. i = function() {
  21904. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21905. }
  21906. .bind(this)
  21907. }
  21908. n = function() {
  21909. this.flying = !1
  21910. }
  21911. .bind(this),
  21912. this.flying = !0,
  21913. t()
  21914. }
  21915. }
  21916. ,
  21917. t.prototype.changeFloor = function(e) {
  21918. if (!this.is360View(this.mode, this.currentPano))
  21919. if (this.mode === V.PANORAMA) {
  21920. var t = this.history.reversePano(e);
  21921. t && t.isAligned() ? this.flyToPano({
  21922. pano: t
  21923. }) : this.changeFloorByScore(e)
  21924. } else
  21925. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21926. }
  21927. ,
  21928. t.prototype.changeFloorByScore = (E = {
  21929. pano: null,
  21930. candidates: []
  21931. },
  21932. function(e) {
  21933. var t = this.model.nextFloor(e);
  21934. 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),
  21935. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21936. this.history.push(e, this.currentPano),
  21937. this.flyToPano({
  21938. pano: E.pano
  21939. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21940. }
  21941. ),
  21942. t.prototype.gotoFloor = function(e) {
  21943. var t = e - this.model.currentFloor.floorIndex;
  21944. this.changeFloor(t)
  21945. }
  21946. ,
  21947. t.prototype.getDirection = function(e) {
  21948. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21949. }
  21950. ,
  21951. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21952. if (r = r || $.Deferred(),
  21953. this.mode === V.TRANSITIONING)
  21954. return Y.warn("should not be transitioning here"),
  21955. n && n(!1),
  21956. r.reject().promise();
  21957. var o = i || !1
  21958. , a = i ? i.position : this.position
  21959. , s = this.position.clone()
  21960. , l = this.currentPano;
  21961. if (Y.debug("New pose in mode " + this.mode),
  21962. !e || (retryCallback = function() {
  21963. j.delayOneFrame(function() {
  21964. this.flyToSameMode(e, t, i, n, r)
  21965. }
  21966. .bind(this))
  21967. }
  21968. .bind(this),
  21969. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21970. var c = function() {
  21971. this.emit(W.FlyingEnded, a, s, e, l),
  21972. n && n(!0)
  21973. }
  21974. .bind(this)
  21975. , h = k[this.mode]
  21976. , u = void 0 !== t ? t : h.transitionTime
  21977. , d = new B.Vector3
  21978. , p = new B.Vector3;
  21979. if (this.emit(W.FlyingStarted, a, s, e, l),
  21980. this.mode === V.PANORAMA)
  21981. Y.warn("we should not be here for panorama views");
  21982. else if (this.mode === V.DOLLHOUSE)
  21983. if (o) {
  21984. var f = new B.Vector3(0,1,0);
  21985. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21986. this.model.warpDestFloors(i.floorVisibility),
  21987. p.copy(i.position);
  21988. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21989. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21990. , v = 3;
  21991. m.length ? (d.copy(m[0].point),
  21992. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21993. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21994. var y = (new B.Matrix4).lookAt(p, d, f)
  21995. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21996. , C = d.distanceTo(p)
  21997. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21998. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21999. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  22000. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  22001. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  22002. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  22003. this.path.burnsDir = Math.sign(b.y);
  22004. var w = new B.Euler(0,0,0,k.warp.eOrder)
  22005. , T = new B.Vector3;
  22006. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22007. G.start(function(e, t) {
  22008. w.x = E.x + e * b.x,
  22009. w.y = E.y + e * b.y,
  22010. w.z = E.z + e * b.z;
  22011. var i = _ + e * (C - _);
  22012. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  22013. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  22014. }
  22015. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22016. G.start(function(e, t) {
  22017. this.cameraControls.controls[V.DOLLHOUSE].update(),
  22018. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  22019. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  22020. }
  22021. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22022. } else
  22023. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22024. else if (this.path.placeCpm(),
  22025. this.path.fadeInCpm(k.path.fadeInTime),
  22026. i) {
  22027. this.model.warpDestFloors(i.floorVisibility);
  22028. var x = this.cameraControls.cameras[V.FLOORPLAN]
  22029. , S = this.cameraControls.controls[V.FLOORPLAN]
  22030. , M = S.target.clone()
  22031. , R = i.position.clone().sub(M)
  22032. , P = x.position.clone().sub(S.target).length()
  22033. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22034. , L = Math.atan2(S.offset.x, S.offset.z)
  22035. , D = Math.atan2(O.x, O.z)
  22036. , N = S.absoluteScale
  22037. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  22038. G.start(function(e, t) {
  22039. S.target.copy(R).multiplyScalar(e).add(M);
  22040. var i = L + (D - L) * e;
  22041. S.offset.x = P * Math.sin(i),
  22042. S.offset.z = P * Math.cos(i),
  22043. x.position.copy(S.target).add(S.offset),
  22044. S.absoluteScale = N + e * (F - N),
  22045. S.update(),
  22046. this.quaternion.copy(x.quaternion),
  22047. this.position.copy(x.position),
  22048. this.target.copy(S.target),
  22049. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22050. }
  22051. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22052. } else
  22053. Y.info("flyToSameMode() funny floorplan view? skipping");
  22054. return G.setTimeout(function(e) {
  22055. this.mode = e,
  22056. c(),
  22057. r.resolve(!0)
  22058. }
  22059. .bind(this, this.mode), u, q.FlyToSameMode),
  22060. this.mode = V.TRANSITIONING,
  22061. r.promise()
  22062. }
  22063. }
  22064. ,
  22065. t.prototype.flyToNewMode = function(e, t) {
  22066. var i = (e = e || {}).mode
  22067. , n = e.pano
  22068. , r = e.duration
  22069. , o = e.warpDest
  22070. , a = e.callback
  22071. , s = e.force
  22072. , l = e.quaternion;
  22073. if (t = t || $.Deferred(),
  22074. this.isWarping())
  22075. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22076. a && a(!1),
  22077. t.reject("Cannot change mode during tour transition").promise();
  22078. if (this.mode === V.TRANSITIONING)
  22079. return a && a(!1),
  22080. t.reject("Cannot change mode during mode transition").promise();
  22081. if (i === this.mode)
  22082. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22083. t.promise()) : (a && a(!1),
  22084. t.reject("Already in " + i + " mode").promise());
  22085. var c = o || !1;
  22086. Y.debug("Switching mode to " + i);
  22087. var h = function() {
  22088. j.delayOneFrame(function() {
  22089. this.flyToNewMode(e, t)
  22090. }
  22091. .bind(this))
  22092. }
  22093. .bind(this);
  22094. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22095. return t.promise();
  22096. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22097. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22098. this.model.waitForLoad(this.model, function() {
  22099. return this.model.meshTexturesLoaded
  22100. }
  22101. .bind(this)),
  22102. this.model.loadMeshTextures().done(h),
  22103. t.promise();
  22104. this.history.invalidate(),
  22105. this.updateLastView();
  22106. var u = this.mode
  22107. , d = this.cameraControls.cameras[i];
  22108. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22109. var p = void 0 !== r ? r : e.transitionTime;
  22110. this.emit(W.ModeChanging, u, i, n),
  22111. n && (this.currentPano = n),
  22112. this.switchCameraMode(i, l),
  22113. G.cancelById(q.LookTransition);
  22114. var f = (new B.Vector3).copy(this.position);
  22115. this.modeTran = this.mode + "-" + i;
  22116. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  22117. VisiSet.finishSetPanoVisible()
  22118. VisiSet.finishSetTagVisible()
  22119. }
  22120. if(editTool.atPanel == "screen"){
  22121. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22122. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22123. }
  22124. if(i == "panorama"){
  22125. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22126. }else{
  22127. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22128. }
  22129. if (i === V.PANORAMA)
  22130. this.emit(W.PanoChosen, n, n),
  22131. setTimeout(function() {
  22132. n.floor.enter(i)
  22133. }
  22134. .bind(this), p / 2),
  22135. this.path.fadeOutCpm(k.path.fadeOutTime);
  22136. else if (i === V.DOLLHOUSE) {
  22137. if (c && (this.model.stayPut = !0),
  22138. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22139. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22140. this.path.placeCpm(),
  22141. this.path.fadeInCpm(k.path.fadeInTime),
  22142. c) {
  22143. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22144. f.set(15, 10, 15);
  22145. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22146. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22147. v.length ? (g.copy(v[0].point),
  22148. f.copy(o.position),
  22149. 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),
  22150. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22151. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22152. f.add(this.model.position),
  22153. d.position.copy(f),
  22154. this.cameraControls.controls[V.DOLLHOUSE].update()
  22155. }
  22156. } else if (this.path.placeCpm(),
  22157. this.path.fadeInCpm(k.path.fadeInTime),
  22158. o) {
  22159. this.model.warpDestFloors(o.floorVisibility);
  22160. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22161. , A = this.cameraControls.controls[V.FLOORPLAN]
  22162. , C = y.position.clone().sub(A.target)
  22163. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22164. , E = Math.atan2(I.x, I.z);
  22165. A.target.copy(o.position);
  22166. var _ = C.length();
  22167. A.offset.x = _ * Math.sin(E),
  22168. A.offset.y = 0,
  22169. A.offset.z = _ * Math.cos(E),
  22170. y.position.copy(A.target).add(A.offset),
  22171. A.target.clone().sub(d.position),
  22172. d.quaternion.copy(o.quaternion),
  22173. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22174. A.absoluteScale = A.currentScale,
  22175. A.update()
  22176. } else
  22177. this.model.currentFloor.enter(i);
  22178. var b = this.currentPano
  22179. , w = this.position.clone();
  22180. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22181. this.flying = !0,
  22182. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22183. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22184. d.controls.update()),
  22185. e.blackoutStyle = P.FADEIN,
  22186. p = k.show360Views.transitionTime,
  22187. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22188. this.mode = i,
  22189. this.path && this.path.popOutCpm(),
  22190. e.blackoutStyle = P.END,
  22191. p = k.show360Views.transitionTime,
  22192. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22193. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22194. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22195. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22196. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22197. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22198. G.setTimeout(function() {
  22199. this.flying = !1,
  22200. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22201. this.currentPano.enter(),
  22202. this.path.placeCpm(),
  22203. this.path.fadeOutCpm(k.path.fadeOutTime),
  22204. this.spider.draw()),
  22205. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22206. this.mode = i,
  22207. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22208. if (this.afterCModeFuc) {
  22209. //手动加的函数
  22210. var cf = this.afterCModeFuc;
  22211. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22212. cf();
  22213. }
  22214. this.updateMarkerVisi();//add
  22215. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  22216. if(this.mode == "panorama" && EditOverlay.editing){
  22217. EditOverlay.updatePano(this.currentPano)
  22218. }
  22219. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22220. if(this.mode == V.PANORAMA){
  22221. Overlay.updateVisibles([this.currentPano])
  22222. }else{
  22223. Overlay.updateVisibles(true)
  22224. }
  22225. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22226. t.resolve())
  22227. }
  22228. .bind(this), p, q.FlyToNewMode),
  22229. this.mode = V.TRANSITIONING,
  22230. t.promise()
  22231. }
  22232. ,
  22233. t.prototype.fade360View = function(e, t, i) {
  22234. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22235. $(this.domElement).fadeOut(.5 * e, function() {
  22236. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22237. this.model.alpha = i.modelAlpha,
  22238. this.position.copy(t.position),
  22239. this.quaternion.copy(t.quaternion),
  22240. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22241. $(this.domElement).fadeIn(.5 * e)
  22242. }
  22243. .bind(this))
  22244. }
  22245. ,
  22246. t.prototype.findDefaultViews = function() {
  22247. this.findDefaultView(this.lastInsideView, !0),
  22248. this.findDefaultView(this.last360View, !1)
  22249. }
  22250. ,
  22251. t.prototype.findDefaultView = function(e, i) {
  22252. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22253. if (e.cameraMode !== V.PANORAMA)
  22254. return !1;
  22255. var t = r.get(e.panoId);
  22256. return t && t.isAligned() === i
  22257. });
  22258. 0 <= o ? (t = r.get(n[o].panoId),
  22259. e.update({
  22260. cameraMode: V.PANORAMA,
  22261. pano: t,
  22262. position: n[o].position,
  22263. quaternion: n[o].quaternion
  22264. })) : 0 <= (o = r.list.findIndex(function(e) {
  22265. return e.isAligned() === i
  22266. })) ? (t = r.list[o],
  22267. e.update({
  22268. cameraMode: V.PANORAMA,
  22269. pano: t,
  22270. position: t.position
  22271. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22272. }
  22273. ,
  22274. t.prototype.updateLastView = function() {
  22275. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22276. pano: this.currentPano,
  22277. position: this.position,
  22278. quaternion: this.quaternion
  22279. })
  22280. }
  22281. ,
  22282. t.prototype.goToLastView = function(e, t) {
  22283. var i = $.Deferred()
  22284. , n = i.resolve.bind(i)
  22285. , r = i.reject.bind(i)
  22286. , o = e ? this.lastInsideView : this.last360View;
  22287. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22288. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22289. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22290. mode: o.cameraMode,
  22291. pano: o.pano,
  22292. quaternion: o.quaternion,
  22293. callback: t
  22294. }).done(n).fail(r),
  22295. i.promise()
  22296. }
  22297. ,
  22298. t.prototype.fadeToView = function(e, t, i, n) {
  22299. var r = $.Deferred()
  22300. , o = r.resolve.bind(r)
  22301. , a = r.reject.bind(r);
  22302. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22303. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22304. a("Cannot go to illegal view"),
  22305. r.promise();
  22306. var s = (k[t.cameraMode],
  22307. function() {
  22308. $(this.domElement).fadeIn(.5 * i),
  22309. n && n(),
  22310. o()
  22311. }
  22312. .bind(this))
  22313. , l = e ? P.FADEIN : P.END;
  22314. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22315. $(this.domElement).fadeOut(.5 * i, function() {
  22316. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22317. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22318. pano: t.pano,
  22319. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22320. duration: 0
  22321. }, s) : this.flyToNewMode({
  22322. mode: t.cameraMode,
  22323. quaternion: t.quaternion,
  22324. duration: 0,
  22325. callback: s
  22326. })
  22327. }
  22328. .bind(this)),
  22329. r.promise()
  22330. }
  22331. ,
  22332. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22333. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22334. this.flying)
  22335. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22336. o && o(),
  22337. !1;
  22338. null != e || (e = M.Show),
  22339. this.history.invalidate(),
  22340. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22341. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22342. return this.emit(W.WarpStarted, a, i, n, r),
  22343. n = n || P.MIDDLE,
  22344. this.path.warpToPano(i, n, r, function() {
  22345. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22346. this.emit(W.WarpEnded, i),
  22347. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22348. o && o()
  22349. }
  22350. .bind(this)),
  22351. e === M.Hide && this.path.discardPathObject(),
  22352. !0
  22353. }
  22354. ,
  22355. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22356. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22357. s && s(),
  22358. !1)
  22359. }
  22360. ,
  22361. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22362. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22363. a && a(),
  22364. !1)
  22365. }
  22366. ,
  22367. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22368. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22369. }
  22370. ,
  22371. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22372. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22373. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22374. t && t(),
  22375. !1)
  22376. }
  22377. ,
  22378. t.prototype.aimTourCamera = function(e, t, i, n) {
  22379. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22380. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22381. }
  22382. ,
  22383. t.prototype.showPathToHeroLocation = function(e) {
  22384. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22385. }
  22386. ,
  22387. t.prototype.tourInterlude = function(e, t) {
  22388. this.history.invalidate(),
  22389. this.path.discardSlow();
  22390. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22391. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22392. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22393. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22394. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22395. var timeEachItem = 2000;//假设每个item飞的时间
  22396. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22397. }
  22398. rotTime = Math.max(0, rotTime)
  22399. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22400. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22401. t && t()
  22402. }
  22403. .bind(this), rotTime)
  22404. }
  22405. ,
  22406. t.prototype.stopInterlude = function() {
  22407. this.interruptAndFastForward(null, 0)
  22408. }
  22409. ,
  22410. t.prototype.interruptAndFastForward = function(e, t) {
  22411. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22412. this.flying && this.emit(W.FlyingInterrupted),
  22413. this.path.interruptAndFastForward(e, t)
  22414. }
  22415. ,
  22416. t.prototype.setSize = function(e, t) {
  22417. var i = e / t;
  22418. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22419. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22420. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22421. this.cameraControls.cameras) {
  22422. var o = this.cameraControls.cameras[r];
  22423. o.fov = this.baseFov * (1 / this.zoomLevel),
  22424. o.updateAspect(i)
  22425. }
  22426. }
  22427. ,
  22428. t.prototype.toJSON = function() {
  22429. var e = {};
  22430. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22431. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22432. return e.hidden ? 0 : 1
  22433. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22434. e
  22435. }
  22436. ,
  22437. t.prototype.getCurrentNodePanos = function(e) {
  22438. if (this.model.panos.map,
  22439. e.length = 0,
  22440. this.path.nodes)
  22441. for (var t = 0; t < this.path.nodes.length; t++) {
  22442. var i = this.path.nodes[t];
  22443. e.push(this.model.panos.get(i))
  22444. }
  22445. }
  22446. ,
  22447. t.prototype.zoomIncrementally = function(e) {
  22448. var t = this.zoomLevel;
  22449. this.zoomTo(this.zoomLevel + e),
  22450. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22451. }
  22452. ,
  22453. t.prototype.zoomInIncrementally = function(e) {
  22454. e = e || this.defaultZoomIncrement,
  22455. this.zoomIncrementally(e)
  22456. }
  22457. ,
  22458. t.prototype.zoomOutIncrementally = function(e) {
  22459. e = e || -this.defaultZoomIncrement,
  22460. this.zoomIncrementally(e)
  22461. }
  22462. ,
  22463. t.prototype.zoomBy = function(e) {
  22464. this.zoomTo(this.zoomLevel * e)
  22465. }
  22466. ,
  22467. t.prototype.zoomIn = function() {
  22468. this.zoomBy(1 + this.zoomSpeed)
  22469. }
  22470. ,
  22471. t.prototype.zoomOut = function() {
  22472. this.zoomBy(1 - this.zoomSpeed)
  22473. }
  22474. ,
  22475. t.prototype.zoomTo = function(e, t) {
  22476. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22477. e > k.zoom.max && (e = k.zoom.max),
  22478. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22479. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22480. e === k.zoom.min && this.emit(m.ZoomMin)),
  22481. this.cameraControls.activeControl)) {
  22482. var i = this.cameraControls.activeControl.camera;
  22483. this.zoomLevel = e,
  22484. i.fov = this.baseFov * (1 / this.zoomLevel),
  22485. i.updateProjectionMatrix(),
  22486. this.zoomFov = i.fov
  22487. }
  22488. }
  22489. ,
  22490. t.prototype.increaseZoomSpeed = function() {
  22491. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22492. }
  22493. ,
  22494. t.prototype.decreaseZoomSpeed = function() {
  22495. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22496. }
  22497. ,
  22498. t.prototype.clampZoomSpeed = function(e) {
  22499. return e < 0 ? 0 : e
  22500. }
  22501. ,
  22502. t.prototype.activatePersistentZooming = function(e) {
  22503. this.zooming = e ? 1 : -1
  22504. }
  22505. ,
  22506. t.prototype.deactivatePersistentZooming = function() {
  22507. this.zooming = 0
  22508. }
  22509. ,
  22510. t.prototype.zoomDefault = function() {
  22511. this.zoomTo(1, !0)
  22512. }
  22513. ,
  22514. t.prototype.smoothZoomToDefault = function(e, t) {
  22515. var i, n = this.zoomLevel, r = function(e) {
  22516. 1 < e && (e = 1),
  22517. i = n * (1 - e) + e,
  22518. this.zoomTo(i, !0)
  22519. }
  22520. .bind(this), o = function() {
  22521. this.zoomDefault(),
  22522. t && window.setTimeout(t, 50)
  22523. }
  22524. .bind(this);
  22525. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22526. }
  22527. ,
  22528. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22529. var i,
  22530. n = this.zoomLevel,
  22531. aimLevel = zoomLevel || this.baseFov / fov
  22532. if (n == aimLevel) return
  22533. var fun = function (e) {
  22534. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22535. }.bind(this)
  22536. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic])
  22537. }
  22538. ,
  22539. t.prototype.updateZoomPano = function() {
  22540. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22541. var e = this.currentPano;
  22542. if (e) {
  22543. var t = this.zoomLevel > k.zoom.activationThreshold
  22544. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22545. t);
  22546. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22547. this.panoRenderer.setZoomingActive(i, e, !0);
  22548. var n = function(e, t) {
  22549. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22550. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22551. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22552. e.setZoomed(t)
  22553. }
  22554. .bind(this);
  22555. i && !e.zoomed ? (n(e, !0),
  22556. this.panoRenderer.enableUltraHighQualityMode(function() {
  22557. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22558. i && n(e, !0)
  22559. }
  22560. .bind(this))) : !t && e.zoomed && n(e, !1)
  22561. }
  22562. }
  22563. },
  22564. //--------
  22565. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22566. var f2;
  22567. if (this.mode == mode) {
  22568. f1 && f1()
  22569. } else {
  22570. f2 = f1;
  22571. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22572. this.afterCModeFuc = function() {
  22573. this.afterCModeFuc = f2
  22574. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22575. }.bind(this)
  22576. } else {
  22577. this.afterCModeFuc = f2;//飞入后执行
  22578. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22579. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22580. }catch(e){}
  22581. }
  22582. }
  22583. }
  22584. ,
  22585. t.prototype.checkHasNeighbor = function(pano){//add
  22586. for(var i in pano.neighbourPanos ){
  22587. if(i == pano.id)continue;
  22588. if(pano.neighbourPanos[i]){
  22589. return true;
  22590. }
  22591. }
  22592. }
  22593. ,
  22594. ee.exports = t
  22595. }
  22596. ).call(this, "/js/player.js")
  22597. }
  22598. , {
  22599. "./constants": 8,
  22600. "./enum/AlignmentType": 17,
  22601. "./enum/BlackoutStyle": 18,
  22602. "./enum/ControlEvents": 21,
  22603. "./enum/Keys": 30,
  22604. "./enum/ModelManagerEvents": 33,
  22605. "./enum/PanoSizeClass": 36,
  22606. "./enum/PanoramaEvents": 37,
  22607. "./enum/PathDiscardMode": 38,
  22608. "./enum/PathDisplayMode": 39,
  22609. "./enum/PlayerEvents": 40,
  22610. "./enum/TagStates": 44,
  22611. "./enum/Vectors": 50,
  22612. "./enum/Viewmode": 51,
  22613. "./enum/WarpStyle": 52,
  22614. "./enum/ZoomEvents": 53,
  22615. "./exception/BasicException": 55,
  22616. "./model/ModelManager": 140,
  22617. "./objects/NSpider": 147,
  22618. "./objects/Panorama": 148,
  22619. "./objects/Reticule": 149,
  22620. "./objects/ShowPath": 151,
  22621. "./objects/Snapshot": 153,
  22622. "./objects/View": 154,
  22623. "./settings": 166,
  22624. "./shaders": 167,
  22625. "./tile/TileDownloader": 171,
  22626. "./tile/TilePrioritizer": 172,
  22627. "./util/ZoomStats": 179,
  22628. "./util/browser": 182,
  22629. "./util/camera": 183,
  22630. "./util/cameraLight": 184,
  22631. "./util/common": 185,
  22632. "./util/easing": 186,
  22633. "./util/history": 187,
  22634. "./util/lerp": 188,
  22635. "./util/logger": 189,
  22636. "./util/math": 190,
  22637. "./util/transitions": 195,
  22638. hot: "hot",
  22639. scaleImg: "scaleImg",
  22640. events: 202,
  22641. three: 217
  22642. }],
  22643. scaleImg: [function(e, t) {
  22644. var i = t;
  22645. (function() {
  22646. function e(e, t, i, n) {
  22647. function r() {
  22648. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22649. U.height = p,
  22650. H = U.getContext("2d")
  22651. }
  22652. function o(e) {
  22653. if (e) {
  22654. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22655. for (t = 0; t < ie; t += 4)
  22656. n[t] = e[t] * ne | 0,
  22657. n[t + 1] = e[t + 1] * ne | 0,
  22658. n[t + 2] = e[t + 2] * ne | 0,
  22659. n[t + 3] = e[t + 3] * ne | 0;
  22660. return delete e,
  22661. i
  22662. }
  22663. return H.getImageData(0, 0, d, p)
  22664. }
  22665. function a(e, t, i, n, r) {
  22666. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22667. }
  22668. var s, l;
  22669. if (t || (t = e.input,
  22670. i = e.output,
  22671. n = e.inputRemovable,
  22672. e.scale && (e = e.scale)),
  22673. t.src)
  22674. if (s = document.createElement("canvas"),
  22675. null != t.naturalWidth)
  22676. s.width = t.naturalWidth,
  22677. s.height = t.naturalHeight;
  22678. else if (null != t.runtimeStyle) {
  22679. var c = t.runtimeStyle
  22680. , h = c.width
  22681. , u = c.height;
  22682. c.width = "auto",
  22683. c.height = "auto",
  22684. s.width = t.width,
  22685. s.height = t.height,
  22686. c.width = h,
  22687. c.height = u
  22688. } else {
  22689. h = t.width,
  22690. u = t.height;
  22691. t.removeAttribute && (t.removeAttribute("width"),
  22692. t.removeAttribute("height")),
  22693. s.width = t.width,
  22694. s.height = t.height,
  22695. t.width = h,
  22696. t.height = u
  22697. }
  22698. else
  22699. s = t;
  22700. l = s.getContext("2d"),
  22701. t.src && l.drawImage(t, 0, 0);
  22702. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22703. if (!f || !g)
  22704. return !1;
  22705. (t.src || n) && s.clearRect(0, 0, f, g),
  22706. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22707. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22708. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22709. e * g + .5 | 0);
  22710. 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;
  22711. if (1 < re || 1 < oe)
  22712. for (r(),
  22713. G = (z = o()).data,
  22714. C = 0; C < p; C++)
  22715. for (V = (y = C / oe) - (w = 0 | y),
  22716. j = w * $,
  22717. W = w < 1 ? j : j - $,
  22718. w < g - 2 ? (Y = j + $,
  22719. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22720. A = 0; A < d; A++,
  22721. te += 4)
  22722. Z = (b = 0 | (v = A / re)) << 2,
  22723. b < f - 2 ? (K = Z + 4,
  22724. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22725. 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,
  22726. ++Z,
  22727. ++K,
  22728. ++Q,
  22729. 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,
  22730. ++Z,
  22731. ++K,
  22732. ++Q,
  22733. 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,
  22734. ++Z,
  22735. ++K,
  22736. ++Q,
  22737. 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,
  22738. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22739. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22740. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22741. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22742. else {
  22743. if (le.Float32Array)
  22744. L = new Float32Array(ie);
  22745. else
  22746. for (L = [],
  22747. te = 0; te < ie; ++te)
  22748. L[te] = 0;
  22749. for (y = 0; y < g; y++)
  22750. for (I = (_ = 0 | (C = y * oe)) * J,
  22751. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22752. R = C + oe - _ - 1),
  22753. v = 0; v < f; v++,
  22754. ee += 4)
  22755. switch (A = v * re,
  22756. E = 0 | A,
  22757. te = I + (E << 2),
  22758. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22759. P && (x = 1 + E - A,
  22760. S = A + re - E - 1),
  22761. D = m[ee],
  22762. F = m[ee + 1],
  22763. B = m[ee + 2],
  22764. N = m[ee + 3],
  22765. P + O) {
  22766. case 0:
  22767. L[te] += D * ae,
  22768. L[te + 1] += F * ae,
  22769. L[te + 2] += B * ae,
  22770. L[te + 3] += N * ae;
  22771. break;
  22772. case 1:
  22773. T = x * oe,
  22774. L[te] += D * T,
  22775. L[te + 1] += F * T,
  22776. L[te + 2] += B * T,
  22777. L[te + 3] += N * T,
  22778. T = S * oe,
  22779. L[te + 4] += D * T,
  22780. L[te + 5] += F * T,
  22781. L[te + 6] += B * T,
  22782. L[te + 7] += N * T;
  22783. break;
  22784. case 2:
  22785. T = re * M,
  22786. L[te] += D * T,
  22787. L[te + 1] += F * T,
  22788. L[te + 2] += B * T,
  22789. L[te + 3] += N * T,
  22790. T = re * R,
  22791. L[te += J] += D * T,
  22792. L[te + 1] += F * T,
  22793. L[te + 2] += B * T,
  22794. L[te + 3] += N * T;
  22795. break;
  22796. default:
  22797. T = x * M,
  22798. L[te] += D * T,
  22799. L[te + 1] += F * T,
  22800. L[te + 2] += B * T,
  22801. L[te + 3] += N * T,
  22802. T = S * M,
  22803. L[te + 4] += D * T,
  22804. L[te + 5] += F * T,
  22805. L[te + 6] += B * T,
  22806. L[te + 7] += N * T,
  22807. T = x * R,
  22808. L[te += J] += D * T,
  22809. L[te + 1] += F * T,
  22810. L[te + 2] += B * T,
  22811. L[te + 3] += N * T,
  22812. T = S * R,
  22813. L[te + 4] += D * T,
  22814. L[te + 5] += F * T,
  22815. L[te + 6] += B * T,
  22816. L[te + 7] += N * T
  22817. }
  22818. delete m,
  22819. r(),
  22820. z = o(L)
  22821. }
  22822. if (H.putImageData(z, 0, 0),
  22823. "string" == typeof i) {
  22824. var se;
  22825. if ("png" === i || "jpeg" === i)
  22826. return (se = n && t.src ? t : new Image).width = d,
  22827. se.height = p,
  22828. se.src = U.toDataURL("image/" + i, .85),
  22829. se;
  22830. if ("png-src" === i || "jpeg-src" === i)
  22831. return U.toDataURL("image/" + i.split("-")[0], .85)
  22832. }
  22833. return U
  22834. }
  22835. var le = this;
  22836. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22837. exports.scale = e) : c = e
  22838. }
  22839. ).call(this),
  22840. i.exports = c
  22841. }
  22842. , {}],
  22843. 156: [function(i, n, e) {
  22844. (function(e) {
  22845. "use strict";
  22846. function t(e, t) {
  22847. this.model = e,
  22848. this.panos = e.panos,
  22849. this.player = t,
  22850. this.imagePanos = this.listImagePanos(),
  22851. this.retryMinimumTime = 1e4
  22852. }
  22853. var r = (i("three"),
  22854. i("./enum/Viewmode"))
  22855. , o = (i("./settings"),
  22856. i("./objects/Panorama"))
  22857. , a = new (i("./util/logger"))(e);
  22858. t.prototype.start = function() {
  22859. this.loadNextPano(function(e) {
  22860. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22861. setTimeout(function() {
  22862. this.start()
  22863. }
  22864. .bind(this), 1e3))
  22865. }
  22866. .bind(this))
  22867. }
  22868. ,
  22869. t.prototype.validLoadTarget = function(e) {
  22870. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22871. }
  22872. ,
  22873. t.prototype.listImagePanos = function() {
  22874. var i = []
  22875. , n = this;
  22876. return this.model.images.forEach(function(e) {
  22877. if (e.metadata && e.metadata.scan_id) {
  22878. var t = n.model.panos.get(e.metadata.scan_id);
  22879. t && !t.isLoaded("high") && i.push(t)
  22880. }
  22881. }),
  22882. i
  22883. }
  22884. ,
  22885. t.prototype.nextNotLoadedImage = function() {
  22886. for (; 0 < this.imagePanos.length; ) {
  22887. var e = this.imagePanos[0];
  22888. if (!e.isLoaded("high"))
  22889. return e;
  22890. this.imagePanos.shift()
  22891. }
  22892. return null
  22893. }
  22894. ,
  22895. t.prototype.loadNextPano = function(e) {
  22896. var t, i, n = this.model.waitQueue.filter(function(e) {
  22897. return e.object instanceof o
  22898. });
  22899. 0 < n.length ? (t = n[0].object,
  22900. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22901. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22902. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22903. t = this.imagePanos[0],
  22904. 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),
  22905. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22906. a.debug("Preloading " + i + "-res pano " + t.id),
  22907. t.loadCube(i).done(e).fail(function() {
  22908. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22909. e()
  22910. })) : e && e(null)
  22911. }
  22912. ,
  22913. n.exports = t
  22914. }
  22915. ).call(this, "/js/preloaders.js")
  22916. }
  22917. , {
  22918. "./enum/Viewmode": 51,
  22919. "./objects/Panorama": 148,
  22920. "./settings": 166,
  22921. "./util/logger": 189,
  22922. three: 217
  22923. }],
  22924. 157: [function(a, s, e) {
  22925. (function(e) {
  22926. "use strict";
  22927. function t(e, t, i, n, r) {
  22928. this.qualityManager = e,
  22929. this.scene = t,
  22930. this.camera = i,
  22931. this.container = r,
  22932. this.controls = n,
  22933. this.controls.enabled = !0,
  22934. this.controls.locked = !0,
  22935. this.quickstartCamera = n.camera,
  22936. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22937. this.skybox = null
  22938. }
  22939. var i = a("three")
  22940. , n = a("../util/logger")
  22941. , o = a("../constants")
  22942. , h = (a("../util/transitions"),
  22943. a("../util/lerp"),
  22944. a("../util/easing"),
  22945. a("../enum/Vectors"))
  22946. , u = a("../enum/PanoSizeClass")
  22947. , r = (a("../materials/ModelTextureMaterial"),
  22948. a("../materials/CubemapMaterial"))
  22949. , d = (a("../cameras/PanoramaCamera"),
  22950. a("../controls/PanoramaControls"),
  22951. a("../tile/TileUtils"),
  22952. a("../util/camera"),
  22953. a("../util/cameraLight"))
  22954. , p = (a("../util/browser"),
  22955. a("../settings"),
  22956. a("../gui/helpManager"),
  22957. new n(e));
  22958. t.prototype.load = function(e) {
  22959. e.pano.shouldRedrawOnBaseLoaded = !0;
  22960. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22961. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22962. var a = this.qualityManager.getPanoSize(u.BASE)
  22963. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22964. if (e.pano.tiled) {
  22965. p.warn("Loading startPano, TILED", e.pano.id);
  22966. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22967. , c = this.quickstartCamera.fov;
  22968. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22969. t = e.pano.loadTiledPano(s, r, {
  22970. hFov: l,
  22971. vFov: c
  22972. }, !1, !1, !0),
  22973. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22974. } else
  22975. p.warn("Loading startPano", e.pano.id),
  22976. t = e.pano.loadCube("high");
  22977. return $.when(t).then(function() {
  22978. n.init(e.pano, e.quaternion),
  22979. e.pano.tiled ? i.done(function() {
  22980. e.pano.lockUntilRenderingComplete = !1,
  22981. this.controls.locked = !1
  22982. }
  22983. .bind(this)) : this.controls.locked = !1
  22984. }
  22985. .bind(this))
  22986. }
  22987. ,
  22988. t.prototype.init = function(e, t) {
  22989. p.info("Quickstart done loading, adding scene objects"),
  22990. e.lockUntilRenderingComplete = !0,
  22991. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22992. side: i.BackSide
  22993. })),
  22994. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22995. this.skybox.quaternion.copy(e.quaternion),
  22996. this.scene.add(this.skybox),
  22997. $(this.container).show()
  22998. }
  22999. ,
  23000. t.prototype.update = function(e) {
  23001. this.controls.update(e),
  23002. this.camera.copy(this.quickstartCamera)
  23003. }
  23004. ,
  23005. t.prototype.setSize = function(e, t) {
  23006. this.quickstartCamera.updateAspect(e / t)
  23007. }
  23008. ,
  23009. t.prototype.destroy = function() {
  23010. this.scene.remove(this.skybox)
  23011. }
  23012. ,
  23013. s.exports = t
  23014. }
  23015. ).call(this, "/js/scene/QuickstartManager.js")
  23016. }
  23017. , {
  23018. "../cameras/PanoramaCamera": 7,
  23019. "../constants": 8,
  23020. "../controls/PanoramaControls": 13,
  23021. "../enum/PanoSizeClass": 36,
  23022. "../enum/Vectors": 50,
  23023. "../gui/helpManager": 68,
  23024. "../materials/CubemapMaterial": 117,
  23025. "../materials/ModelTextureMaterial": 118,
  23026. "../settings": 166,
  23027. "../tile/TileUtils": 174,
  23028. "../util/browser": 182,
  23029. "../util/camera": 183,
  23030. "../util/cameraLight": 184,
  23031. "../util/easing": 186,
  23032. "../util/lerp": 188,
  23033. "../util/logger": 189,
  23034. "../util/transitions": 195,
  23035. three: 217
  23036. }],
  23037. 158: [function(e, t, i) {
  23038. "use strict";
  23039. function h(e, t, i) {
  23040. this.scene = e,
  23041. this.camera = t,
  23042. this.renderer = null,
  23043. this.effects = i,
  23044. this.animateCallback = null,
  23045. this.composer = null,
  23046. this.qualityManager = null,
  23047. e.renderWidth = 0,
  23048. e.renderHeight = 0,
  23049. this.updateClock = new M.Clock,
  23050. this.components = [],
  23051. this.updateListeners = [],
  23052. this.resizeListeners = [],
  23053. this.forceUpdateSize = !1,
  23054. this.started = !1,
  23055. this.textures = {},
  23056. this.suspendedObjects = []
  23057. }
  23058. 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;
  23059. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23060. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23061. this.components.push(e),
  23062. e.update && this.updateListeners.push(e),
  23063. e.setSize && (this.resizeListeners.push(e),
  23064. this.forceUpdateSize = !0)
  23065. }
  23066. ,
  23067. h.prototype.removeComponent = function(t) {
  23068. function e(e) {
  23069. return e !== t
  23070. }
  23071. this.components = this.components.filter(e),
  23072. this.updateListeners = this.updateListeners.filter(e),
  23073. this.resizeListeners = this.resizeListeners.filter(e)
  23074. }
  23075. ,
  23076. h.prototype.start = function(e) {
  23077. if (this.started)
  23078. throw new l("Can't start SceneRenderer, already started");
  23079. this.createContext(e),
  23080. //u.isMobile() && this.boluoVrInit(),
  23081. this.initComposer(),
  23082. this.started = !0,
  23083. (b = b.bind(this))()
  23084. }
  23085. ,
  23086. h.prototype.createContext = function(e) {
  23087. try {
  23088. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23089. this.renderer.autoClear = !0,
  23090. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23091. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23092. this.emit(r.ContextCreated)
  23093. } catch (e) {
  23094. throw new c("Unable to create a WebGL rendering context")
  23095. }
  23096. d.profiling.enabled && this.overrideTextures(),
  23097. e.appendChild(this.renderer.domElement)
  23098. }
  23099. ,
  23100. h.prototype.overrideTextures = function() {
  23101. var d = this.renderer.context
  23102. , t = 0
  23103. , i = d.createTexture;
  23104. d.createTexture = function() {
  23105. var e = i.call(d);
  23106. return e.id = t++,
  23107. this.textures[e.id] = e
  23108. }
  23109. .bind(this);
  23110. var p = d.texImage2D;
  23111. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23112. var c, h = this.getTextureTypeFromTarget(d, e);
  23113. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23114. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23115. s = r,
  23116. n = (l = o).naturalWidth,
  23117. r = l.naturalHeight,
  23118. p.call(d, e, t, i, a, s, l));
  23119. var u = this.textures[c.id];
  23120. u.width = h === f.TextureCube ? 6 * n : n,
  23121. u.height = r
  23122. }
  23123. .bind(this);
  23124. var n = d.deleteTexture;
  23125. d.deleteTexture = function(e) {
  23126. delete this.textures[e.id],
  23127. n.call(d, e)
  23128. }
  23129. .bind(this)
  23130. }
  23131. ,
  23132. h.prototype.updateTextureMemory = (n = null,
  23133. function() {
  23134. var e = 0;
  23135. for (var t in this.textures) {
  23136. var i = this.textures[t];
  23137. i.width && i.height && (e += i.width * i.height * 4)
  23138. }
  23139. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23140. n = e
  23141. }
  23142. ),
  23143. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23144. switch (t) {
  23145. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23146. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23147. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23148. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23149. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23150. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23151. return f.TextureCube;
  23152. case e.TEXTURE_2D:
  23153. return f.Texture2D;
  23154. default:
  23155. return null
  23156. }
  23157. }
  23158. ,
  23159. h.prototype.initComposer = function() {
  23160. this.composer = new M.EffectComposer(this.renderer),
  23161. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23162. this.composer.addPass(this.effects.hblurPass),
  23163. this.composer.addPass(this.effects.vblurPass)
  23164. }
  23165. ,
  23166. h.prototype.setSize = function(e, t, i) {
  23167. this.renderWidth = e,
  23168. this.renderHeight = t,
  23169. this.effects.aspect = e / t,
  23170. this.renderer.setSize(e, t, !1, i),
  23171. this.composer.setSize(e, t);
  23172. for (var n = 0; n < this.resizeListeners.length; n++)
  23173. this.resizeListeners[n].setSize(e, t)
  23174. }
  23175. ,
  23176. h.prototype.render = function() {
  23177. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23178. }
  23179. ,
  23180. h.prototype.boluoVrInit = function() {
  23181. console.log("boluoVrInit"),
  23182. this.isHuawei5X = u.detectHUAWEI5X(),
  23183. this.oldRenderer = this.renderer,
  23184. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23185. window.panoCamera = this.camera;
  23186. var i = this;
  23187. window._vrEnabled = !1,
  23188. Object.defineProperty(window, "vrEnabled", {
  23189. get: function() {
  23190. return window._vrEnabled
  23191. },
  23192. set: function(e) {
  23193. (e = !!e) ? (i.renderer = i.newRenderer,
  23194. window.vrMarkers.forEach(function(e) {
  23195. e.visible = !0
  23196. })) : (i.renderer = i.oldRenderer,
  23197. window.vrMarkers.forEach(function(e) {
  23198. e.visible = !1
  23199. })),
  23200. i.cursor.visible = e,
  23201. i.setSize($("#player").width(), $("#player").height()),
  23202. window._vrEnabled = e,
  23203. setTimeout(function() {
  23204. console.log(player.cameraControls.activeControl.camera.fov)
  23205. }, 500)
  23206. }
  23207. }),
  23208. this.createCursor(.5, !1, 1, 16777215, 0);
  23209. var e = {
  23210. setSize: function(e, t) {
  23211. i.camera.aspect = e / t
  23212. }
  23213. };
  23214. this.resizeListeners.push(e),
  23215. this.vrLoadingInit()
  23216. }
  23217. ,
  23218. h.prototype.vrLoadingInit = function() {
  23219. var e = new (e = function(camera) {
  23220. var t = this
  23221. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23222. , i = new M.MeshBasicMaterial({
  23223. color: 4967932,
  23224. side: M.DoubleSide
  23225. })
  23226. , n = new M.Mesh(e,i);
  23227. (this.mesh = n).position.z = -2,
  23228. n.scale.set(.08, .08, .08),
  23229. n.visible = !1,
  23230. //window.player.camera.add(n),
  23231. camera.add(n),
  23232. t.enabled = !1,
  23233. this.update = function(e) {
  23234. 1 == t.enabled && (n.rotation.z += 15 * e)
  23235. }
  23236. }
  23237. )(this.camera);
  23238. window.Loading = e,
  23239. this.updateListeners.push(e)
  23240. }
  23241. ,
  23242. h.prototype.createCursor = function(e, t, i, n, r) {
  23243. var o, a = new M.SpriteMaterial({
  23244. opacity: i,
  23245. color: n,
  23246. transparent: t,
  23247. map: this.boluoGetTexture("images/cursor.png"),
  23248. needsUpdate: !0,
  23249. side: M.DoubleSide
  23250. });
  23251. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23252. a.map.repeat = new M.Vector2(1 / 17,1),
  23253. a.depthTest = !1,
  23254. a.blending = M.AdditiveBlending,
  23255. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23256. o.position.z = -2,
  23257. o.visible = !1,
  23258. o.name = "cursor",
  23259. this.camera.add(o),
  23260. this.scene.add(this.camera),
  23261. this.cursor = o;
  23262. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23263. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23264. this.updateListeners.push(s)
  23265. }
  23266. ,
  23267. h.prototype.CursorAnimation = function(e, t, o) {
  23268. this.cursor = t,
  23269. this.raycaster = new M.Raycaster,
  23270. this.targetEventObj = {},
  23271. this.type = 1,
  23272. this.tweenFlag = !0;
  23273. var s = this;
  23274. this.target = o,
  23275. console.log(o.uuid),
  23276. this.euler = new M.Euler,
  23277. this.q0 = new M.Quaternion,
  23278. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23279. this.zee = new M.Vector3(0,0,1),
  23280. this.alpha = -1e3,
  23281. this.beta = -1e3,
  23282. this.gamma = -1e3,
  23283. this.orient = M.Math.degToRad(window.orientation || 0),
  23284. window.addEventListener("orientationchange", function() {
  23285. s.orient = M.Math.degToRad(window.orientation || 0)
  23286. }),
  23287. window.addEventListener("deviceorientation", function(e) {
  23288. var t = M.Math.degToRad(e.alpha)
  23289. , i = M.Math.degToRad(e.beta)
  23290. , n = M.Math.degToRad(e.gamma);
  23291. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23292. -1e3 === s.beta && (s.beta = i),
  23293. -1e3 === s.gamma && (s.gamma = n),
  23294. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23295. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23296. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23297. s.beta = i,
  23298. s.gamma = n),
  23299. h.vrDebug) {
  23300. $("#info-device-orientation").css("display", "block");
  23301. var r = "";
  23302. r += "alpha=(" + s.alpha + ")<BR/>",
  23303. r += "beta=(" + s.beta + ")<BR/>",
  23304. r += "gamma=" + s.gamma + "<BR/>",
  23305. document.getElementById("info-device-orientation").innerHTML = r
  23306. }
  23307. }),
  23308. this.setObjectQuaternion = function(e, t, i, n, r) {
  23309. s.euler.set(i, t, -n, "YXZ"),
  23310. e.setFromEuler(s.euler),
  23311. e.multiply(s.q1),
  23312. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23313. o.updateMatrixWorld()
  23314. }
  23315. ,
  23316. parent !== window && window.addEventListener("message", function(e) {
  23317. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23318. o && o.alpha && o.beta && o.gamma && (t = a,
  23319. i = M.Math.degToRad(o.alpha),
  23320. n = M.Math.degToRad(o.beta),
  23321. r = M.Math.degToRad(o.gamma),
  23322. t ? (-1e3 === s.alpha && (s.alpha = i),
  23323. -1e3 === s.beta && (s.beta = n),
  23324. -1e3 === s.gamma && (s.gamma = r),
  23325. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23326. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23327. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23328. s.beta = n,
  23329. s.gamma = r))
  23330. }),
  23331. this.update = function(e) {
  23332. TWEEN.update(),
  23333. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23334. this.triggerTargetEvent())
  23335. }
  23336. ,
  23337. this.triggerTargetEvent = function() {
  23338. var e = this.choseObj()
  23339. , t = e ? e.object : void 0;
  23340. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23341. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23342. t && t.enabled && this.startAnimate(function() {
  23343. this.clickCallback(t)
  23344. }
  23345. .bind(this))) : this.type,
  23346. this.targetEventObj.lastObj = t)
  23347. }
  23348. ,
  23349. this.choseObj = function() {
  23350. this.raycaster.setFromCamera({
  23351. x: 0,
  23352. y: 0
  23353. }, o);
  23354. var e = (this.raycaster.ray,
  23355. window.vrMarkers)
  23356. , t = this.raycaster.intersectObjects(e);
  23357. if (0 < t.length)
  23358. return t[0]
  23359. }
  23360. ,
  23361. this.clickCallback = function(e) {
  23362. this.runTHREEAction(e, "onclick")
  23363. }
  23364. ,
  23365. this.runTHREEAction = function(e, t) {
  23366. switch (t) {
  23367. case "onclick":
  23368. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23369. e()
  23370. });
  23371. break;
  23372. case "onhover":
  23373. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23374. e()
  23375. });
  23376. break;
  23377. case "onout":
  23378. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23379. e()
  23380. })
  23381. }
  23382. }
  23383. ,
  23384. this.startAnimate = function(e) {
  23385. this.tweenFlag && this.initAnimation(e)
  23386. }
  23387. ,
  23388. this.initAnimation = function(e) {
  23389. var t = this
  23390. , i = this.cursor.material.map.offset;
  23391. t.tweenFlag = !1,
  23392. this.cursorAnimate = new TWEEN.Tween(i).to({
  23393. x: 1
  23394. }, 1e3).onStart(function() {
  23395. t.tweenFlag = !1
  23396. }).onStop(function() {
  23397. t.tweenFlag = !0,
  23398. this.x = 0,
  23399. i.x = 0
  23400. }).onUpdate(function() {}).onComplete(function() {
  23401. e(),
  23402. i.x = 0,
  23403. setTimeout(function() {
  23404. t.tweenFlag = !0
  23405. }, 1500)
  23406. }),
  23407. this.cursorAnimate.easing(function(e) {
  23408. return Math.floor(17 * e) / 17
  23409. }),
  23410. this.cursorAnimate.start()
  23411. }
  23412. ,
  23413. this.autoCursorPosition = function(e) {
  23414. this.cursor.scale.set(.3, .3, .3)
  23415. }
  23416. }
  23417. ,
  23418. h.prototype.vrRenderer = function(a, i, e) {
  23419. var s = new i.vrCamera(e);
  23420. s.bananaAspect = .8,
  23421. this.width,
  23422. this.height;
  23423. i = this;
  23424. this.setSize = function(e, t) {
  23425. a.setSize.call(this, e, t),
  23426. i.width = e,
  23427. i.height = t
  23428. }
  23429. ,
  23430. this.render = function(e, t, i, n) {
  23431. var r, o;
  23432. if (window.cameraQua = t.quaternion.clone(),
  23433. t.__RESS__SKIP__STEREO__)
  23434. return a.render(e, t, i, n);
  23435. if ("PerspectiveCamera" === t.type)
  23436. r = s.cameraL,
  23437. o = s.cameraR,
  23438. e.updateMatrixWorld(),
  23439. null === t.parent && t.updateMatrixWorld(),
  23440. s.vrCameraUpdate(t);
  23441. else {
  23442. if ("OrthographicCamera" !== t.type)
  23443. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23444. r = o = t
  23445. }
  23446. a.setScissorTest(!0),
  23447. a.setScissor(0, 0, this.width / 2, this.height),
  23448. a.setViewport(0, 0, this.width / 2, this.height),
  23449. a.render.call(this, e, r, i, n),
  23450. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23451. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23452. a.render.call(this, e, o, i, n),
  23453. a.setScissorTest(!1)
  23454. }
  23455. ,
  23456. this.__proto__ = {
  23457. __proto__: a
  23458. }
  23459. }
  23460. ,
  23461. h.prototype.vrCamera = function(e) {
  23462. this.type = "StereoCamera",
  23463. this._aspect = 1,
  23464. this._overlap = .064,
  23465. this.cameraL = new M.PerspectiveCamera,
  23466. this.cameraL.layers.enable(1),
  23467. this.cameraL.matrixAutoUpdate = !1,
  23468. this.cameraR = new M.PerspectiveCamera,
  23469. this.cameraR.layers.enable(2),
  23470. this.cameraR.matrixAutoUpdate = !1,
  23471. this.eyeRight = new M.Matrix4,
  23472. this.eyeLeft = new M.Matrix4,
  23473. this.vrCameraNeedsUpdate = !0,
  23474. window.vrCameraL = this.cameraL,
  23475. Object.defineProperty(this, "bananaAspect", {
  23476. get: function() {
  23477. return this._aspect
  23478. },
  23479. set: function(e) {
  23480. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23481. this._aspect = e
  23482. }
  23483. }),
  23484. Object.defineProperty(this, "overlap", {
  23485. get: function() {
  23486. return this._overlap
  23487. },
  23488. set: function(e) {
  23489. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23490. this._overlap = e
  23491. }
  23492. }),
  23493. this.vrCameraUpdate = function(e) {
  23494. if (this.vrCameraNeedsUpdate = !0,
  23495. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23496. this.vrCameraNeedsUpdate) {
  23497. this.vrCameraNeedsUpdate = !1,
  23498. console.debug("vrCameraUpdate"),
  23499. this.bananaFocus = e.focus,
  23500. this.bananaFov = e.fov,
  23501. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23502. this.bananaNear = e.near,
  23503. this.bananaFar = e.far,
  23504. console.debug(e.aspect),
  23505. this.bananaFocus = 10;
  23506. 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);
  23507. this.eyeLeft.elements[12] = -r,
  23508. this.eyeRight.elements[12] = r,
  23509. t = -a * this.bananaReal_aspect + o,
  23510. i = a * this.bananaReal_aspect + o,
  23511. n.elements[0] = 2 * this.bananaNear / (i - t),
  23512. n.elements[8] = (i + t) / (i - t),
  23513. this.cameraL.projectionMatrix.copy(n),
  23514. t = -a * this.bananaReal_aspect - o,
  23515. i = a * this.bananaReal_aspect - o,
  23516. n.elements[0] = 2 * this.bananaNear / (i - t),
  23517. n.elements[8] = (i + t) / (i - t),
  23518. this.cameraR.projectionMatrix.copy(n)
  23519. }
  23520. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23521. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23522. }
  23523. }
  23524. ,
  23525. h.prototype.boluoGetTexture = function(e) {
  23526. var t = new M.TextureLoader;
  23527. return t.crossOrigin = "anonymous",
  23528. t.load(e)
  23529. }
  23530. ,
  23531. h.prototype.updateScreenSize = function(e) {
  23532. var t, i, n, r = !1;
  23533. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23534. n = e.height,
  23535. r = !0,
  23536. t = 1) : (i = $("#player").width(),
  23537. n = $("#player").height(),
  23538. e && e.resize && (o = this.renderWidth,
  23539. a = this.renderHeight),
  23540. i === o && n === a && !this.forceUpdateSize || (o = i,
  23541. a = n,
  23542. r = !0,
  23543. t = window.devicePixelRatio)),
  23544. r && (this.setSize(i, n, t),
  23545. this.forceUpdateSize = !1)
  23546. }
  23547. ,
  23548. h.prototype.updateComponents = function() {
  23549. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23550. this.updateListeners[t].update(e)
  23551. }
  23552. ,
  23553. h.prototype.suspend = function() {
  23554. this.started = !1,
  23555. this.suspendedObjects = this.scene.children.map(function(e) {
  23556. return this.scene.remove(e),
  23557. e
  23558. }
  23559. .bind(this)),
  23560. this.render()
  23561. }
  23562. ,
  23563. h.prototype.resume = function() {
  23564. this.suspendedObjects.forEach(function(e) {
  23565. this.scene.add(e)
  23566. }
  23567. .bind(this)),
  23568. this.suspendedObjects = [],
  23569. this.started = !0,
  23570. b()
  23571. }
  23572. ;
  23573. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23574. this.started && (window.requestAnimationFrame(b),
  23575. this.updateScreenSize(),
  23576. this.updateComponents(),
  23577. this.updateTextureMemory(),
  23578. this.render(),
  23579. this.emit(r.AfterRender))
  23580. };
  23581. h.prototype.getImageData = (E = document.createElement("canvas"),
  23582. _ = E.getContext("2d"),
  23583. function(e, t, i) {
  23584. return E.width === t && E.height === i || (E.width = t,
  23585. E.height = i),
  23586. _.drawImage(e, 0, 0, t, i),
  23587. _.getImageData(0, 0, t, i)
  23588. }
  23589. ),
  23590. h.prototype.initSizedTexture2D = function(e, t, i) {
  23591. var n = this.renderer
  23592. , r = n.context
  23593. , o = n.state
  23594. , a = new M.Texture(null);
  23595. !(a.flipY = !1) !== i && (i = !1),
  23596. a.generateMipmaps = i;
  23597. var s = n.paramThreeToGL(a.format)
  23598. , l = n.paramThreeToGL(a.type)
  23599. , c = n.properties.get(a)
  23600. , h = r.createTexture();
  23601. o.bindTexture(r.TEXTURE_2D, h),
  23602. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23603. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23604. a.wrapS = t,
  23605. a.wrapT = t;
  23606. var u = n.paramThreeToGL(t);
  23607. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23608. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23609. i ? (a.magFilter = M.LinearFilter,
  23610. a.minFilter = M.LinearMipMapLinearFilter,
  23611. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23612. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23613. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23614. a.minFilter = M.LinearFilter,
  23615. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23616. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23617. o.bindTexture(r.TEXTURE_2D, null),
  23618. c.__webglTexture = h,
  23619. a
  23620. }
  23621. ,
  23622. h.prototype.initSizedCubeMap = function(e, t) {
  23623. var i = this.renderer
  23624. , n = i.context
  23625. , r = i.state
  23626. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23627. o.flipY = !1,
  23628. o.generateMipmaps = t;
  23629. var a = i.paramThreeToGL(o.format)
  23630. , s = i.paramThreeToGL(o.type)
  23631. , l = i.properties.get(o)
  23632. , c = n.createTexture();
  23633. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23634. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23635. for (var h = 0; h < 6; h++)
  23636. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23637. return t ? (o.magFilter = M.LinearFilter,
  23638. o.minFilter = M.LinearMipMapLinearFilter,
  23639. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23640. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23641. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23642. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23643. o.minFilter = M.LinearFilter,
  23644. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23645. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23646. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23647. l.__image__webglTextureCube = c,
  23648. o
  23649. }
  23650. ,
  23651. h.prototype.deallocateCubeTexture = function(e) {
  23652. var t = this.renderer
  23653. , i = t.context
  23654. , n = t.properties.get(e);
  23655. i.deleteTexture(n.__image__webglTextureCube)
  23656. }
  23657. ,
  23658. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23659. var a = this.renderer
  23660. , s = a.context
  23661. , l = a.state
  23662. , c = a.properties.get(t);
  23663. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23664. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23665. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23666. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23667. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23668. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23669. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23670. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23671. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23672. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23673. l.bindTexture(s.TEXTURE_2D, null)
  23674. }
  23675. ,
  23676. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23677. var s = this.renderer
  23678. , l = s.context
  23679. , c = s.state
  23680. , h = s.properties.get(t);
  23681. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23682. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23683. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23684. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23685. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23686. }
  23687. ,
  23688. h.prototype.rebuildMipMaps2D = function(e) {
  23689. var t = this.renderer
  23690. , i = t.context
  23691. , n = t.state;
  23692. t.properties.get(e),
  23693. i.generateMipmap(i.TEXTURE_2D),
  23694. n.bindTexture(i.TEXTURE_2D, null)
  23695. }
  23696. ,
  23697. h.prototype.rebuildMipMaps3D = function(e) {
  23698. var t = this.renderer
  23699. , i = t.context
  23700. , n = t.state
  23701. , r = t.properties.get(e);
  23702. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23703. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23704. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23705. }
  23706. ,
  23707. h.prototype.renderToCubeMap = (P = !1,
  23708. F = N = D = L = O = null,
  23709. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23710. this.renderer.context,
  23711. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23712. (O = new M.Scene).add(L),
  23713. D = new M.ShaderMaterial({
  23714. uniforms: {
  23715. tDiffuse: {
  23716. type: "t",
  23717. value: null
  23718. },
  23719. alpha: {
  23720. type: "f",
  23721. value: 1
  23722. }
  23723. },
  23724. vertexShader: R.basicTextured.vertexShader,
  23725. fragmentShader: R.basicTextured.fragmentShader,
  23726. depthWrite: !1,
  23727. depthTest: !1,
  23728. side: M.DoubleSide
  23729. }),
  23730. N = new M.PlaneBufferGeometry(1,1),
  23731. (F = new M.Mesh(N,D)).position.z = 0,
  23732. O.add(F),
  23733. P = !0);
  23734. var m = N.getAttribute("uv");
  23735. m.setDynamic(!0),
  23736. m.needsUpdate = !0;
  23737. var v = m.array
  23738. , y = r / i
  23739. , A = o / n
  23740. , C = a / i
  23741. , I = s / n;
  23742. v[0] = y,
  23743. v[1] = A + I,
  23744. v[2] = y + C,
  23745. v[3] = A + I,
  23746. v[4] = y,
  23747. v[5] = A,
  23748. v[6] = y + C,
  23749. v[7] = A;
  23750. var E = N.getAttribute("position");
  23751. E.setDynamic(!0),
  23752. E.needsUpdate = !0;
  23753. var _ = E.array
  23754. , b = l / t.width - .5
  23755. , w = c / t.height - .5
  23756. , T = h / t.width
  23757. , x = u / t.height;
  23758. _[0] = b,
  23759. _[1] = w + x,
  23760. _[3] = b + T,
  23761. _[4] = w + x,
  23762. _[6] = b,
  23763. _[7] = w,
  23764. _[9] = b + T,
  23765. _[10] = w,
  23766. this.renderer.properties.get(e),
  23767. D.uniforms.tDiffuse.value = e,
  23768. D.blending = p || M.NoBlending,
  23769. D.transparent = !!f,
  23770. null != g || (g = 1),
  23771. D.uniforms.alpha.value = g,
  23772. D.needUpdate = !0,
  23773. t.activeCubeFace = d,
  23774. t.viewport.set(0, 0, t.width, t.height);
  23775. var S = this.renderer.autoClear;
  23776. this.renderer.autoClear = !1,
  23777. this.renderer.render(O, L, t, !1),
  23778. this.renderer.autoClear = S
  23779. }
  23780. ),
  23781. h.prototype.copyCubeMap = (g = !1,
  23782. C = A = y = v = m = null,
  23783. I = new M.Euler,
  23784. new M.Vector3,
  23785. function(e, t, i, n, r, o, a, s, l) {
  23786. this.renderer,
  23787. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23788. (m = new M.Scene).add(v),
  23789. y = new M.ShaderMaterial({
  23790. uniforms: {
  23791. tDiffuse: {
  23792. type: "t",
  23793. value: null
  23794. },
  23795. alpha: {
  23796. type: "f",
  23797. value: 1
  23798. }
  23799. },
  23800. vertexShader: R.copyCubeMap.vertexShader,
  23801. fragmentShader: R.copyCubeMap.fragmentShader,
  23802. depthWrite: !1,
  23803. depthTest: !1,
  23804. side: M.DoubleSide
  23805. }),
  23806. A = new M.BoxGeometry(2,2,2),
  23807. C = new M.Mesh(A,y),
  23808. m.add(C),
  23809. g = !0);
  23810. for (var c = 0; c < 6; c++)
  23811. h.getCubeOrientationForCubeFace(c, I),
  23812. C.rotation.copy(I),
  23813. C.matrixWorldNeedsUpdate = !0,
  23814. C.updateMatrixWorld(),
  23815. y.uniforms.tDiffuse.value = e,
  23816. y.blending = a || M.NoBlending,
  23817. y.transparent = !!s,
  23818. null != l || (l = 1),
  23819. y.uniforms.alpha.value = l,
  23820. y.needUpdate = !0,
  23821. t.activeCubeFace = c,
  23822. t.viewport.set(0, 0, r, o),
  23823. this.renderer.render(m, v, t, !1)
  23824. }
  23825. ),
  23826. h.getLookAtForCubeFace = function(e, t) {
  23827. switch (e) {
  23828. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23829. t.set(1, 0, 0);
  23830. break;
  23831. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23832. t.set(-1, 0, 0);
  23833. break;
  23834. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23835. t.set(0, 1, 0);
  23836. break;
  23837. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23838. t.set(0, -1, 0);
  23839. break;
  23840. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23841. t.set(0, 0, 1);
  23842. break;
  23843. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23844. t.set(0, 0, -1)
  23845. }
  23846. }
  23847. ,
  23848. h.getCubeOrientationForCubeFace = function(e, t) {
  23849. switch (e) {
  23850. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23851. t.set(0, -Math.PI / 2, 0);
  23852. break;
  23853. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23854. t.set(0, Math.PI / 2, 0);
  23855. break;
  23856. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23857. t.set(Math.PI / 2, Math.PI, 0);
  23858. break;
  23859. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23860. t.set(-Math.PI / 2, Math.PI, 0);
  23861. break;
  23862. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23863. t.set(0, -Math.PI, 0);
  23864. break;
  23865. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23866. t.set(0, 0, 0)
  23867. }
  23868. }
  23869. ,
  23870. t.exports = h
  23871. }
  23872. , {
  23873. "../enum/GLCubeFaces": 25,
  23874. "../enum/GLTextureType": 26,
  23875. "../enum/SceneRendererEvents": 43,
  23876. "../exception/BasicException": 55,
  23877. "../exception/RendererCreationException": 57,
  23878. "../settings": 166,
  23879. "../shaders": 167,
  23880. "../util/browser": 182,
  23881. events: 202,
  23882. three: 217
  23883. }],
  23884. 159: [function(e, t, i) {
  23885. "use strict";
  23886. function n(e) {
  23887. this.messenger = new a(e),
  23888. this.clientKey = null
  23889. }
  23890. var o = e("../util/ajax")
  23891. , r = e("./PostMessageType")
  23892. , a = e("./postmessage")
  23893. , s = e("./VersionInfo")
  23894. , l = e("events").EventEmitter
  23895. , c = window.location.origin + "/api/v1/user/";
  23896. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23897. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23898. }
  23899. ,
  23900. n.prototype.waitForConnection = function() {
  23901. return new Promise(function(t, i) {
  23902. this.messenger.on(r.CONNECT, function(e) {
  23903. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23904. }
  23905. .bind(this))
  23906. }
  23907. .bind(this))
  23908. }
  23909. ,
  23910. n.prototype.onConnectionReceived = function(i) {
  23911. return this.messenger.setTarget(i.source, i.origin),
  23912. this.verifyConnection(i).then(function(e, t) {
  23913. this.messenger.send({
  23914. type: r.ACCEPT,
  23915. toId: i.fromId,
  23916. warning: t
  23917. }),
  23918. this.clientKey = e,
  23919. this.messenger.removeAllListeners(r.CONNECT),
  23920. this.bindEvents()
  23921. }
  23922. .bind(this), function(e) {
  23923. this.messenger.send({
  23924. type: r.REJECT,
  23925. toId: i.fromId,
  23926. reason: e
  23927. }),
  23928. this.messenger.setTarget()
  23929. }
  23930. .bind(this))
  23931. }
  23932. ,
  23933. n.prototype.verifyConnection = function(r) {
  23934. return new Promise(function(e, t) {
  23935. var i;
  23936. if (s.isDeprecated(r.sdkVersion))
  23937. i = "这个版本正在被弃用";
  23938. else if (!s.isSupported(r.sdkVersion))
  23939. return t("不支持此版本的SDK");
  23940. var n = {
  23941. cache: !1,
  23942. headers: {
  23943. "X-port-Application-Key": r.applicationKey,
  23944. "X-port-Referrer": r.origin
  23945. }
  23946. };
  23947. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23948. }
  23949. )
  23950. }
  23951. ,
  23952. n.prototype.onMessageReceived = function(t) {
  23953. if (this.validateClientApplicationKey(t.applicationKey)) {
  23954. var i = this;
  23955. t.onDone = function(e) {
  23956. e.toId = t.fromId,
  23957. e.uid = t.uid,
  23958. e.type = r.RESPONSE,
  23959. i.messenger.send(e)
  23960. }
  23961. ,
  23962. this.emit(r.ACTION, t)
  23963. }
  23964. }
  23965. ,
  23966. n.prototype.validateClientApplicationKey = function(e) {
  23967. return this.clientKey === e
  23968. }
  23969. ,
  23970. n.prototype.sendEvent = function(e, t) {
  23971. this.messenger.send({
  23972. type: r.EVENT,
  23973. eventType: e,
  23974. eventData: t
  23975. })
  23976. }
  23977. ,
  23978. t.exports = n
  23979. }
  23980. , {
  23981. "../util/ajax": 181,
  23982. "./PostMessageType": 160,
  23983. "./VersionInfo": 163,
  23984. "./postmessage": 165,
  23985. events: 202
  23986. }],
  23987. 160: [function(e, t, i) {
  23988. "use strict";
  23989. t.exports = Object.freeze({
  23990. CONNECT: "postmessage.connect",
  23991. ACCEPT: "postmessage.accept",
  23992. REJECT: "postmessage.reject",
  23993. ACTION: "postmessage.action",
  23994. RESPONSE: "postmessage.response",
  23995. EVENT: "postmessage.event"
  23996. })
  23997. }
  23998. , {}],
  23999. 161: [function(e, t, i) {
  24000. "use strict";
  24001. t.exports = Object.freeze({
  24002. MOVE: "sdk.move",
  24003. ENTER_PANO: "sdk.enterpano",
  24004. MODEL_LOADED: "sdk.modelloaded"
  24005. })
  24006. }
  24007. , {}],
  24008. 162: [function(e, t, i) {
  24009. "use strict";
  24010. t.exports = Object.freeze({
  24011. FLY: "transition.fly",
  24012. FADEOUT: "transition.fade",
  24013. INSTANT: "transition.instant"
  24014. })
  24015. }
  24016. , {}],
  24017. 163: [function(e, t, i) {
  24018. "use strict";
  24019. t.exports = {
  24020. current: "1.0",
  24021. supported: ["1.0"],
  24022. deprecated: [],
  24023. isSupported: function(e) {
  24024. return -1 !== this.supported.indexOf(e)
  24025. },
  24026. isDeprecated: function(e) {
  24027. return -1 !== this.deprecated.indexOf(e)
  24028. },
  24029. isValid: function(e) {
  24030. return this.isSupported(e) || this.isDeprecated(e)
  24031. }
  24032. }
  24033. }
  24034. , {}],
  24035. 164: [function(q, X, e) {
  24036. (function(e) {
  24037. "use strict";
  24038. function r(e, t, i) {
  24039. e = e && e.toLowerCase().trim();
  24040. var n = new C.UP.clone
  24041. , r = Math.PI / 3
  24042. , o = Math.PI / 2;
  24043. switch (e) {
  24044. case "left":
  24045. i.copy(t),
  24046. i.applyAxisAngle(n, o);
  24047. break;
  24048. case "right":
  24049. i.copy(t),
  24050. i.applyAxisAngle(n, -o);
  24051. break;
  24052. case "forwardleft":
  24053. i.copy(t),
  24054. i.applyAxisAngle(n, r);
  24055. break;
  24056. case "forwardright":
  24057. i.copy(t),
  24058. i.applyAxisAngle(n, -r);
  24059. break;
  24060. case "forward":
  24061. default:
  24062. i.copy(t)
  24063. }
  24064. return i
  24065. }
  24066. function o(e, t) {
  24067. if (e) {
  24068. var i = {
  24069. pano: e,
  24070. lookAtPoint: null,
  24071. duration: null,
  24072. maxDistanceOverride: null,
  24073. skipWarpingCheck: !1
  24074. };
  24075. this.player.flyToPano(i, function() {
  24076. t && t({
  24077. success: !0,
  24078. message: "Transition complete."
  24079. })
  24080. })
  24081. } else
  24082. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24083. t && t({
  24084. success: !1,
  24085. error: "Unable to find pano."
  24086. })
  24087. }
  24088. function a(e, t) {
  24089. t.copy(C.FORWARD),
  24090. e.getDirection(t)
  24091. }
  24092. function c(i) {
  24093. return {
  24094. panos: i.panos.list.map(function(e) {
  24095. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24096. return {
  24097. uuid: e.id,
  24098. aligned: e.alignmentType === g.ALIGNED,
  24099. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24100. position: function(e) {
  24101. return e.alignmentType !== g.ALIGNED ? null : {
  24102. x: e.position.x,
  24103. y: e.position.y,
  24104. z: e.position.z
  24105. }
  24106. }(e),
  24107. rotation: function(e) {
  24108. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24109. return {
  24110. x: h.Math.radToDeg(t._x),
  24111. y: h.Math.radToDeg(t._y),
  24112. z: h.Math.radToDeg(t._z)
  24113. }
  24114. }(e),
  24115. thumbnail: t
  24116. }
  24117. })
  24118. }
  24119. }
  24120. 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"),
  24121. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24122. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24123. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24124. N.angle = 0,
  24125. N.angleTravelled = 0,
  24126. N.playerDirection = new h.Vector3,
  24127. N.lastFacingDirection = new h.Vector3,
  24128. N.onDone = null,
  24129. N.player = null,
  24130. N.start = function(e, t, i, n) {
  24131. N.active = !0,
  24132. e && t && (t = 0),
  24133. N.angle = e || t,
  24134. N.xAngle = e,
  24135. N.yAngle = t,
  24136. N.angleTravelled = 0,
  24137. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24138. i.getDirection(N.playerDirection),
  24139. N.lastFacingDirection.copy(N.playerDirection),
  24140. N.projectVectors(),
  24141. N.onDone = n,
  24142. N.player = i,
  24143. N()
  24144. }
  24145. ,
  24146. N.projectVectors = function() {
  24147. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24148. N.lastFacingDirection.projectOnPlane(C.UP))
  24149. }
  24150. ,
  24151. N), P = (i = new h.Vector3,
  24152. function(e) {
  24153. e ? (i.copy(e.position),
  24154. i.add(e.discPosition),
  24155. s.projectPositionToCanvas(i, this.player.camera, i),
  24156. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24157. }
  24158. ), O = (l = new h.Vector3,
  24159. function(e) {
  24160. var t = this.player.getDirection();
  24161. l.copy(t);
  24162. var i = l.y;
  24163. l.y = 0,
  24164. l.normalize();
  24165. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24166. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24167. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24168. 0;
  24169. this.player.mode === I.DOLLHOUSE && (n = -n);
  24170. var r = function() {
  24171. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24172. }
  24173. .call(this) - .1
  24174. , o = function() {
  24175. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24176. }
  24177. .call(this) + .1
  24178. , a = n + e;
  24179. r < a ? a = r : a < o && (a = o);
  24180. var s = a - n;
  24181. return 0 < e && s < .01 && (s = 0),
  24182. e < 0 && -.01 < s && (s = 0),
  24183. s
  24184. }
  24185. ), L = (t = new h.Euler,
  24186. function(e) {
  24187. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24188. {
  24189. position: {
  24190. x: e.position.x,
  24191. y: e.position.y,
  24192. z: e.position.z
  24193. },
  24194. rotation: {
  24195. x: h.Math.radToDeg(t.x),
  24196. y: h.Math.radToDeg(t.y),
  24197. z: 0
  24198. },
  24199. pano: e.currentPano ? e.currentPano.id : null,
  24200. mode: e.mode
  24201. }
  24202. }
  24203. ), D = null;
  24204. function N() {
  24205. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24206. N.player.getDirection(N.playerDirection),
  24207. N.projectVectors();
  24208. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24209. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24210. N.onDone && (0,
  24211. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24212. window.setTimeout(N, 4))
  24213. }
  24214. X.exports = {
  24215. init: function(e, t, i, n, r) {
  24216. Y.init(e, t, i, r),
  24217. D = new Promise(function(e, t) {
  24218. i.on(_.Ready, function() {
  24219. e()
  24220. })
  24221. }
  24222. .bind(this));
  24223. var o = new u(window)
  24224. , a = o.waitForConnection();
  24225. a.then(function(e) {
  24226. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24227. });
  24228. var s, l = (s = Date.now(),
  24229. function() {
  24230. if (!(Date.now() - s < 100)) {
  24231. var e = L(i);
  24232. o.sendEvent(b.MOVE, {
  24233. state: e
  24234. }),
  24235. s = Date.now()
  24236. }
  24237. }
  24238. );
  24239. i.on(_.Move, l),
  24240. i.on(_.ViewChanged, l),
  24241. n.on(p.ActiveModelChanged, function(e) {
  24242. function t(e) {
  24243. var t, i = e.newPano.id;
  24244. e.oldPano && (t = e.oldPano.id),
  24245. i !== t && o.sendEvent(b.ENTER_PANO, {
  24246. oldPano: t,
  24247. newPano: i
  24248. })
  24249. }
  24250. var i = e.model
  24251. , n = e.oldModel;
  24252. Y.model = i,
  24253. a.then(function() {
  24254. o.sendEvent(b.MODEL_LOADED, {
  24255. metadata: c(i)
  24256. })
  24257. }),
  24258. n && n.panos.forEach(function(e) {
  24259. e.removeEventListener("enter", t)
  24260. }),
  24261. i.panos.forEach(function(e) {
  24262. e.on("enter", t)
  24263. })
  24264. })
  24265. }
  24266. };
  24267. var F, B, V, k, U, H, z, G, W, j, Y = {
  24268. director: null,
  24269. player: null,
  24270. controls: null,
  24271. sceneRenderer: null,
  24272. model: null,
  24273. init: function(e, t, i, n) {
  24274. this.director = e,
  24275. this.player = i,
  24276. this.controls = t,
  24277. this.sceneRenderer = n
  24278. },
  24279. handleToObject: {},
  24280. objectToHandle: {},
  24281. handleCount: 0,
  24282. onMessageReceive: function(e) {
  24283. if (e) {
  24284. var t = e.targetFunction
  24285. , i = e.params
  24286. , n = e.onDone;
  24287. t && this[t] && this[t](i, n)
  24288. }
  24289. },
  24290. waitForInit: function(e, t) {
  24291. D.then(t.bind({
  24292. success: !0,
  24293. message: "Init complete."
  24294. }))
  24295. },
  24296. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24297. j = new h.Quaternion,
  24298. function(e, t) {
  24299. var i = e.pano
  24300. , n = e.rotation
  24301. , r = e.transition;
  24302. if (!this.model)
  24303. return t({
  24304. success: !1,
  24305. error: "The model has not been loaded yet"
  24306. });
  24307. var o = this.model.panos.get(i);
  24308. if (!o)
  24309. return t({
  24310. success: !1,
  24311. error: i + " does not exist in this model"
  24312. });
  24313. if (!n)
  24314. return t({
  24315. sucess: !1,
  24316. erorr: n + " is not a valid rotation"
  24317. });
  24318. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24319. console.log(n.z);
  24320. var a = {
  24321. success: !0,
  24322. message: i
  24323. };
  24324. if (r === v.FADEOUT)
  24325. j.setFromEuler(W),
  24326. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24327. else {
  24328. var s, l;
  24329. r === v.INSTANT && (l = s = 0);
  24330. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24331. this.player.flyToPano({
  24332. pano: o,
  24333. lookAtPoint: c,
  24334. duration: s,
  24335. aimDuration: l
  24336. }, t.bind(this, a))
  24337. }
  24338. }
  24339. ),
  24340. moveInDirection: function(e, t) {
  24341. var i = e.direction;
  24342. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24343. void (t && t({
  24344. success: !1,
  24345. error: "Invalid direction."
  24346. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24347. t(e ? {
  24348. success: !0,
  24349. message: "moved " + i
  24350. } : {
  24351. success: !1,
  24352. error: "Cannot move in direction: " + i
  24353. })
  24354. })
  24355. },
  24356. getPose: function(e, t) {
  24357. return this.player.camera.position,
  24358. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24359. t({
  24360. success: !0,
  24361. message: L(this.player)
  24362. })
  24363. },
  24364. takeScreenShot: (z = new h.PerspectiveCamera,
  24365. G = new h.WebGLRenderTarget,
  24366. function(e, t) {
  24367. if (!e.resolution)
  24368. return t({
  24369. success: !1,
  24370. error: "An invalid resolution was specified"
  24371. });
  24372. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24373. var i = this.sceneRenderer.renderer.getSize();
  24374. e.resolution.width = i.width,
  24375. e.resolution.height = i.height
  24376. }
  24377. z.layers.set(T.DEFAULT),
  24378. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24379. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24380. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24381. var n = e.resolution.width
  24382. , r = e.resolution.height
  24383. , o = n / r;
  24384. z.position.copy(this.sceneRenderer.camera.position),
  24385. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24386. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24387. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24388. G.setSize(n, r),
  24389. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24390. var a = new Uint8Array(n * r * 4);
  24391. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24392. var s = S.encode({
  24393. data: a,
  24394. width: n,
  24395. height: r,
  24396. heading: 180,
  24397. pitch: 0
  24398. }, {
  24399. quality: 75,
  24400. flipY: !0
  24401. });
  24402. t({
  24403. success: !0,
  24404. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24405. })
  24406. }
  24407. ),
  24408. findRankedPano: (U = new h.Vector3,
  24409. H = new h.Vector3,
  24410. function(e, t) {
  24411. a(this.player, H),
  24412. r(t, H, U);
  24413. var i = this.player.rankedPanoInDirection(e, U);
  24414. if (i) {
  24415. var n = this.objectToHandle[i.id];
  24416. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24417. this.handleToObject[n] = i),
  24418. n
  24419. }
  24420. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24421. -1
  24422. }
  24423. ),
  24424. findRankedtag: (V = new h.Vector3,
  24425. k = new h.Vector3,
  24426. function(e, t) {
  24427. a(this.player, k),
  24428. r(t, k, V);
  24429. var i = this.player.rankedtagInDirection(e, V);
  24430. if (i) {
  24431. var n = this.objectToHandle[i.sid];
  24432. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24433. this.handleToObject[n] = i),
  24434. n
  24435. }
  24436. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24437. -1
  24438. }
  24439. ),
  24440. clickNearesttag: function(e) {
  24441. this.clickRankedtag(0, e)
  24442. },
  24443. clickRankedtag: function(e, t) {
  24444. var i = function(e, t) {
  24445. var i = this.findRankedtag(e, t);
  24446. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24447. null)
  24448. }
  24449. .call(this, e, t);
  24450. i && P.call(this, i)
  24451. },
  24452. clickNearestPano: function(e, t) {
  24453. this.clickRankedPano(0, e, t)
  24454. },
  24455. clickRankedPano: function(e, t, i) {
  24456. var n = function(e, t) {
  24457. var i = this.findRankedPano(e, t);
  24458. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24459. null)
  24460. }
  24461. .call(this, e, t);
  24462. n ? o.call(this, n, i) : i(null)
  24463. },
  24464. clickPano: function(e, t) {
  24465. var i = this.handleTable[e];
  24466. i ? o.call(this, i, t) : t(null)
  24467. },
  24468. rotateDirection: function(e, t) {
  24469. var i = e.direction
  24470. , n = e.angle;
  24471. if (!R.active) {
  24472. var r = 0
  24473. , o = 0
  24474. , a = 0
  24475. , s = 0;
  24476. if (!n || isNaN(n))
  24477. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24478. void (t && t({
  24479. success: !1,
  24480. error: "Invalid rotation angle."
  24481. }));
  24482. if (this.player.mode === I.TRANSITIONING)
  24483. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24484. void (t && t({
  24485. success: !1,
  24486. error: "Cannot rotate while transitioning"
  24487. }));
  24488. if (i === m.RIGHT || i === m.LEFT)
  24489. i === m.RIGHT && (n = -n),
  24490. r = 0 < n ? -1 : 1,
  24491. a = n;
  24492. else {
  24493. if (i !== m.UP && i !== m.DOWN)
  24494. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24495. void (t && t({
  24496. success: !1,
  24497. error: "Invalid direction for rotation."
  24498. }));
  24499. if (this.player.mode === I.FLOORPLAN)
  24500. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24501. void (t && t({
  24502. success: !1,
  24503. error: "Cannot rotate " + i + " in floorplan mode"
  24504. }));
  24505. if (i === m.DOWN && (n = -n),
  24506. 0 === (n = O.call(this, n)))
  24507. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24508. void (t && t({
  24509. success: !1,
  24510. error: "Already at maximum rotation in direction: " + i
  24511. }));
  24512. o = 0 < n ? 1 : -1,
  24513. s = n
  24514. }
  24515. var l = n;
  24516. n = h.Math.degToRad(n),
  24517. a = h.Math.degToRad(a),
  24518. s = h.Math.degToRad(s);
  24519. var c = this.controls.activeControl;
  24520. c.startRotating(r, o),
  24521. R.start(a, s, this.player, function() {
  24522. c.stopRotating(!0),
  24523. t && t({
  24524. success: !0,
  24525. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24526. })
  24527. })
  24528. }
  24529. },
  24530. rotate: (F = new h.Vector3,
  24531. B = new h.Vector3,
  24532. function(e, t) {
  24533. var i = e.xAngle
  24534. , n = e.yAngle;
  24535. if (!R.active) {
  24536. if (i = i || 0,
  24537. n = n || 0,
  24538. isNaN(i) || isNaN(n))
  24539. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24540. void (t && t({
  24541. success: !1,
  24542. error: "Invalid rotation angle."
  24543. }));
  24544. if (this.player.mode === I.TRANSITIONING)
  24545. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24546. void (t && t({
  24547. success: !1,
  24548. error: "Cannot rotate while transitioning"
  24549. }));
  24550. Math.abs(i) < .01 && (i = 0),
  24551. Math.abs(n) < .01 && (n = 0);
  24552. var r = n;
  24553. n = O.call(this, n);
  24554. var o = 0 < r ? "UP" : "DOWN";
  24555. if (!(i = -i) && r && !n)
  24556. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24557. void (t && t({
  24558. success: !1,
  24559. error: "Already at maximum rotation in direction: " + o
  24560. }));
  24561. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24562. var a = n;
  24563. n = h.Math.degToRad(n),
  24564. i = h.Math.degToRad(i),
  24565. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24566. this.player.getDirection(F),
  24567. B.copy(F).applyAxisAngle(C.UP, i),
  24568. B.applyAxisAngle(C.RIGHT, n);
  24569. var s = (F.angleTo(B),
  24570. 0 < i ? -1 : i < 0 ? 1 : 0)
  24571. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24572. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24573. var c = this.controls.activeControl;
  24574. c.startRotating(s, l),
  24575. R.start(i, n, this.player, function() {
  24576. c.stopRotating(!0),
  24577. t && t({
  24578. success: !0,
  24579. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24580. })
  24581. })
  24582. }
  24583. }
  24584. ),
  24585. panCamera: function(e, i) {
  24586. function t(e) {
  24587. switch (r.removeAllListeners(w.AutoPanComplete),
  24588. r.removeAllListeners(w.AutoPanInterrupt),
  24589. r.removeAllListeners(w.AutoPanClamped),
  24590. e) {
  24591. case w.AutoPanInterrupt:
  24592. i({
  24593. success: !0,
  24594. message: "Camera panning interrupted."
  24595. });
  24596. break;
  24597. case w.AutoPanClamped:
  24598. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24599. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24600. return void i({
  24601. success: !1,
  24602. error: "Already at edge of current model bounds."
  24603. });
  24604. var t = "The view point is outside the bounds for the current model. ";
  24605. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24606. console.warn(t)
  24607. }
  24608. case w.AutoPanComplete:
  24609. i({
  24610. success: !0,
  24611. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24612. })
  24613. }
  24614. }
  24615. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24616. return i({
  24617. success: !1,
  24618. error: "Camera panning is not available in the current mode: " + this.player.mode
  24619. });
  24620. var n = e.position
  24621. , r = this.player.control;
  24622. r.setAutoPanPosition(n.x, n.z),
  24623. r.autoPan = !0;
  24624. var o = function(e, t) {
  24625. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24626. };
  24627. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24628. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24629. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24630. },
  24631. click: function(e, t) {
  24632. var i = e.x
  24633. , n = e.y;
  24634. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24635. n = n / 100 * $("#player").height()),
  24636. this.player.handleInputStart(i, n),
  24637. this.player.updateIntersect(),
  24638. this.player.handleInputEnd(i, n)
  24639. },
  24640. mouseOver: function(e, t) {
  24641. var i = e.x
  24642. , n = e.y;
  24643. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24644. n = n / 100 * $("#player").height()),
  24645. this.player.handleInputMove(i, n),
  24646. this.player.updateIntersect()
  24647. },
  24648. moveToMode: function(e, t) {
  24649. function i(e) {
  24650. t(e ? {
  24651. success: !1,
  24652. error: "Failed to load new mode: " + e
  24653. } : {
  24654. success: !0,
  24655. message: "Moved to new mode: " + n
  24656. })
  24657. }
  24658. var n = e.mode;
  24659. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24660. i()
  24661. }, function(e) {
  24662. i(e)
  24663. }) : t({
  24664. success: !1,
  24665. error: "Invalid mode selection"
  24666. })
  24667. }
  24668. }
  24669. }
  24670. ).call(this, "/js/sdk/automation.js")
  24671. }
  24672. , {
  24673. "../constants": 8,
  24674. "../enum/AlignmentType": 17,
  24675. "../enum/ControlEvents": 21,
  24676. "../enum/Direction": 22,
  24677. "../enum/GLCubeFaces": 25,
  24678. "../enum/Keys": 30,
  24679. "../enum/ModelManagerEvents": 33,
  24680. "../enum/PlayerEvents": 40,
  24681. "../enum/RenderLayers": 41,
  24682. "../enum/Vectors": 50,
  24683. "../enum/Viewmode": 51,
  24684. "../enum/WarpStyle": 52,
  24685. "../lib/jpeg_encoder": 94,
  24686. "../sdk/SdkEvents": 161,
  24687. "../settings": 166,
  24688. "../util/common": 185,
  24689. "../util/logger": 189,
  24690. "../util/math": 190,
  24691. "../util/panorama": 191,
  24692. "./ApiHost": 159,
  24693. "./PostMessageType": 160,
  24694. "./TransitionStyles": 162,
  24695. three: 217
  24696. }],
  24697. 165: [function(e, t, i) {
  24698. "use strict";
  24699. function n(e) {
  24700. this.sourceWindow = e,
  24701. this.targetWindow = null,
  24702. this.targetOrigin = null,
  24703. this.id = Math.floor(1e5 * Math.random()),
  24704. this.bindEvents()
  24705. }
  24706. var r = e("./PostMessageType")
  24707. , o = e("events").EventEmitter;
  24708. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24709. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24710. }
  24711. ,
  24712. n.prototype.setTarget = function(e, t) {
  24713. this.targetWindow = e,
  24714. this.targetOrigin = t
  24715. }
  24716. ,
  24717. n.prototype.onPostmessageReceived = function(e) {
  24718. var t = e.origin || e.originalEvent.origin
  24719. , i = e.source;
  24720. switch (e.data.type) {
  24721. case r.CONNECT:
  24722. break;
  24723. case r.RESPONSE:
  24724. if (this.id !== e.data.toId)
  24725. return;
  24726. default:
  24727. if (!this.validateMessageOrigin(t))
  24728. return
  24729. }
  24730. var n = e.data;
  24731. n.source = i,
  24732. n.origin = t,
  24733. n.timestamp = Date.now(),
  24734. this.emit(e.data.type, n)
  24735. }
  24736. ,
  24737. n.prototype.validateMessageOrigin = function(e) {
  24738. return "*" === this.targetOrigin || e === this.targetOrigin
  24739. }
  24740. ,
  24741. n.prototype.send = function(e) {
  24742. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24743. this.targetWindow.postMessage(e, this.targetOrigin))
  24744. }
  24745. ,
  24746. t.exports = n
  24747. }
  24748. , {
  24749. "./PostMessageType": 160,
  24750. events: 202
  24751. }],
  24752. 166: [function(e, t, i) {
  24753. "use strict";
  24754. var n = e("three")
  24755. , r = e("./util/browser")
  24756. , o = e("./enum/Viewmode")
  24757. , a = e("./enum/VROption")
  24758. , s = e("./enum/Colors")
  24759. , l = e("./enum/WarpStyle")
  24760. , c = e("./util/easing")
  24761. , h = e("./util/common")
  24762. , u = e("./util/showcase")
  24763. , d = e("./constants")
  24764. , p = {
  24765. debug: !1,
  24766. version: "2.25.6-0-gd87e5b1",
  24767. languageTag: r.valueFromHash("lang", null),
  24768. pageTitle: "四维虚拟漫游",
  24769. authorizationHeader: u.getAuthorizationHeader(),
  24770. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24771. logLevel: r.valueFromHash("log", 2),
  24772. skyboxRadius: 2500,
  24773. modelBoundsPadding: 5,
  24774. showNeighbors: !1,
  24775. brand: r.valueFromHash("brand", !0),
  24776. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24777. startHighlights: r.valueFromHash("hl", -1),
  24778. specialEdition: r.valueFromHash("bn", 0),
  24779. useWheel: r.valueFromHash("wh", !0),
  24780. crossOrigin: "anonymous",
  24781. fancierTransition: !1,
  24782. wireframe: !1,
  24783. skyboxWireframe: !1,
  24784. modelAlpha: 1,
  24785. highlightPanoSelection: !1,
  24786. showSweeps: !0,
  24787. showSkyboxes: !1,
  24788. showMesh: !0,
  24789. showFloors: !1,
  24790. showFloorDuration: 300,
  24791. showFloorDelay: 300,
  24792. hideFloorDuration: 300,
  24793. hideFloorDelay: 0,
  24794. reticuleOpacityTransitionTime: 250,
  24795. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24796. markerOpacityTransitionTime: 500,
  24797. guiAnimationSpeed: 250,
  24798. highlightAnimationDuration: 500,
  24799. modelComponentLoadSpinnerDelay: 150,
  24800. captureErrors: !1,
  24801. maxMobileTextures: 6,
  24802. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24803. startupFlyinDelay: 3e3,
  24804. dollhouseDefault: {
  24805. minDistance: 1,//15, //编辑页面给近一些
  24806. maxDistance: 50,
  24807. minPolarAngle: n.Math.degToRad(10),
  24808. maxPolarAngle: n.Math.degToRad(90)
  24809. },
  24810. hideReticuleTimeout: 1e3,
  24811. analytics: {
  24812. inactivityThreshold: 30,
  24813. sessionTrackingRate: .15,
  24814. maxTrackedErrors: 20,
  24815. sessionDurationPingFrequency: 10,
  24816. sessionDurationTimeout: 15
  24817. },
  24818. flydown: {
  24819. movementEasing: "easeInOutQuad",
  24820. movementDelay: .001,
  24821. rotationEasing: "easeInOutQuad",
  24822. rotationDelay: .5,
  24823. modelTextureDelay: .75,
  24824. skyboxDelay: .75
  24825. },
  24826. transition: {
  24827. flySpeed: .001,
  24828. flyTime: 750,
  24829. flytimeMaxDistanceThreshold: 5,
  24830. flytimeDistanceMultiplier: 150,
  24831. aimTime: 1500,
  24832. aimSlowFactor: 1.5,
  24833. blur: .8,
  24834. movementEasing: "easeInOutQuad",
  24835. blendEasing: "easeInOutQuad",
  24836. fastForwardFactor: 3
  24837. },
  24838. show360Views: {
  24839. enabled: !0,
  24840. transitionTime: 1e3
  24841. },
  24842. quickstart: {
  24843. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24844. animation: 1400,
  24845. showTextDelay: 500,
  24846. fadeOutDelay: 3e3,
  24847. fovChange: 10
  24848. },
  24849. appConfig: {
  24850. webvr_version: null,
  24851. segment_key: null,
  24852. embedly_key: null,
  24853. branch_key: null,
  24854. keen_write_key: null,
  24855. keen_project_id: null
  24856. },
  24857. vr: {
  24858. enabled: !0,
  24859. allowWebVR: !1,
  24860. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24861. },
  24862. share: {
  24863. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24864. },
  24865. input: {
  24866. longTapThreshold: 200,
  24867. moveToleranceNDC: .08,
  24868. touchMoveThreshold: 25
  24869. },
  24870. help: {
  24871. modalStayDuration: 600
  24872. },
  24873. immersive: {
  24874. timeToShowAgain: 1250,
  24875. uiStayDuration: 600
  24876. },
  24877. tourInteraction: {
  24878. disabled: "0" === r.valueFromHash("tourcta", null),
  24879. showPauseButton: 1e3,
  24880. showModal: 1500,
  24881. allowNextClick: 200,
  24882. largeModal: "1" === r.valueFromHash("tourcta", null),
  24883. smallModal: "2" === r.valueFromHash("tourcta", null)
  24884. },
  24885. labels: {
  24886. enabled: !1,
  24887. hideUntilStart: !0,
  24888. fadeInDuration: 250,
  24889. fadeInDelay: 250,
  24890. fadeOutDuration: 250,
  24891. fadeOutDelay: 0,
  24892. zoomHideThreshhold: {
  24893. mobile: r.isSmallScreen() ? .45 : .6,
  24894. desktop: 2
  24895. },
  24896. zoomTruncateThreshhold: {
  24897. mobile: r.isSmallScreen() ? .35 : .45,
  24898. desktop: .85
  24899. },
  24900. minLengthForTruncate: 16,
  24901. truncateLength: 12,
  24902. truncateSuffix: "..."
  24903. },
  24904. tags: {
  24905. enabled: r.valueFromHash("mt", 1),
  24906. startup: {
  24907. hideUntilStart: !0,
  24908. fadeInDuration: 500,
  24909. fadeInDelay: 100
  24910. },
  24911. visibility: {
  24912. anyDistance: !0,
  24913. visibleDistance: 8,
  24914. cameraClearance: .1,
  24915. alphaTestLevel: .05,
  24916. hideViaFloor: !0,
  24917. hideOffScreenDisc: !1,
  24918. hideOffScreenObject: !1
  24919. },
  24920. disc: {
  24921. opacity: 1,
  24922. disabledOpacity: .5,
  24923. scale: {
  24924. nearBound: 1.5,
  24925. farBound: 4.8,
  24926. linkFarBound: !1,
  24927. linkPercent: 40,
  24928. maxSize: 80,
  24929. minSize: 40,
  24930. baseViewportSize: 800,
  24931. responsiveness: 100
  24932. }
  24933. },
  24934. pole: {
  24935. enabled: !0,
  24936. height: .5,
  24937. width: 2,
  24938. opacity: .5,
  24939. color: "white"
  24940. },
  24941. navigate: {
  24942. nearestPano: !0,
  24943. lineOfSight: !0,
  24944. reactivate: !0,
  24945. aimAt: "disc",
  24946. tiltTolerance: 25,
  24947. rotateSpeedFactor: .6
  24948. }
  24949. },
  24950. path: {
  24951. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24952. colorUp: s._desat(s.newBlue, .5),
  24953. colorDown: s._darken(s.newBlue, .35),
  24954. opacity: .5,
  24955. style: "ribbon",
  24956. height: .025,
  24957. ribbonWidth: .24,
  24958. outsideHeight: .5,
  24959. waypointRadius: .5,
  24960. waypointIndoorRadius: .24,
  24961. waypointPulse: 1e3,
  24962. typ: l.BLACK,
  24963. meshFree: r.valueFromHash("mf", 1),
  24964. mapGuides: r.valueFromHash("guides", !0),
  24965. fadeInTime: 400,
  24966. fadeOutTime: 300
  24967. },
  24968. warp: {
  24969. nearPanoDist: .1,
  24970. matchCam: !1,
  24971. blur: .33,
  24972. fastTime: 1500,
  24973. teleportTime: 1500,
  24974. outsideTime: 2e3,
  24975. lookAheadMax: .3,
  24976. lookAheadDist: 2.5,
  24977. softPushDist: .37,
  24978. softPushEnd: .3,
  24979. softBendAngle: 8,
  24980. softBendTilt: 4,
  24981. softBendEnd: .3,
  24982. doBurns: !0,
  24983. burnsAngle: 8,
  24984. minBurnsAngle: 35,
  24985. minDownAngle: -35,
  24986. maxTurnPerSec: 280,
  24987. maxAimPerSec: 35,
  24988. minRotation: 12,
  24989. maxAimRotation: 33.2,
  24990. turnFriction: .2,
  24991. flySpeed: .01,
  24992. minWarpTime: 1200,
  24993. warpInterruptionRedirectTime: 500,
  24994. tourStepDelay: r.valueFromHash("st", 0),
  24995. walkDelay: 0,
  24996. walkMaxDist: 50,
  24997. walkMinDist: .8,
  24998. walkSlideShowThreshhold: 3e3,
  24999. walkExtraPanosDistance: .4,
  25000. timePerMeter: 1200,
  25001. motionLeadTime: 5e3,
  25002. movementEasing: "easeInOutQuad",
  25003. blendEasing: "easeInOutQuad",
  25004. showBunny: !1,
  25005. loop: r.valueFromHash("lp", !1),
  25006. auto: r.valueFromHash("ts", -1),
  25007. eOrder: "YXZ",
  25008. stepFactor: .25,
  25009. brakeStrength: 2,
  25010. minBrakeAngle: .1,
  25011. maxBrakeAngle: 1.8,
  25012. climbEffort: 4
  25013. },
  25014. rotationFriction: .05,
  25015. rotationAccelerationInside: 4.5,
  25016. rotationAccelerationOutside: .15,
  25017. rotationAfterMoveMultiplier: 40,
  25018. rotationAfterMoveHistoryCount: 5,
  25019. panFriction: .09,
  25020. panAccelerationOutside: 60,
  25021. onload: r.valueFromHash("onload", o.PANORAMA),
  25022. zoomNearLimit: .1,
  25023. zoomFarLimit: 50,
  25024. navigation: {
  25025. panoScores: !1,
  25026. mouseDirection: !0,
  25027. filterStrictness: .75,
  25028. angleFactor: -30,
  25029. directionFactor: 10,
  25030. distanceFactor: -1,
  25031. optionalityFactor: 3
  25032. },
  25033. sdkInit: !1,
  25034. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25035. console: r.valueFromHash("console", !1),
  25036. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25037. panoramaNeighbourMaxDistance: 5,
  25038. panoFloorClickRadius: .35,
  25039. showScreenshotLocations: !1,
  25040. showAxis: !1,
  25041. showNeighbourRaycasts: !1,
  25042. colorMarkerOnLoad: !1,
  25043. colorMarkerByFloor: !1,
  25044. tiling: {
  25045. panoPreRenderRepeatDelay: 2500,
  25046. panoPreRenderDelay: 500,
  25047. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25048. tilingFlagNames: ["usetiles", "tiles"],
  25049. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25050. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25051. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25052. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25053. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25054. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25055. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25056. customCompression: r.valueFromHash("tilecustcomp", 0),
  25057. mobileHighQualityOverride: 1,
  25058. allowUltraHighResolution: !0
  25059. },
  25060. zoom: {
  25061. enabled: !0,
  25062. forceOff: r.valueFromHash("nozoom", 0),
  25063. overridemax: r.valueFromHash("maxzoom", null),
  25064. overridemin: r.valueFromHash("minzoom", null),
  25065. max: d.highQualityMaxZoom,
  25066. min: 1,
  25067. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25068. activationThreshold: 1.1,
  25069. restoreTime: 500
  25070. },
  25071. profiling: {
  25072. enabled: r.valueFromHash("mem", !1)
  25073. }
  25074. };
  25075. (p = h.deepExtend(p, d, {
  25076. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25077. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25078. panorama: {
  25079. transitionTime: 1e3,
  25080. modelAlpha: 0,
  25081. modelAlphaDelay: p.flydown.modelTextureDelay,
  25082. modelAlphaLength: 1,
  25083. skyboxOpacity: 1,
  25084. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25085. skyboxOpacityLength: .9,
  25086. fovLength: 1,
  25087. fovDelay: 0,
  25088. cameraMatrixDuration: .8,
  25089. cameraMatrixDelay: 0,
  25090. cameraMatrixEase: c.easeInCubic,
  25091. reticuleOpacity: 1,
  25092. markerOpacity: .3,
  25093. markerOpacityOnHover: 1
  25094. },
  25095. dollhouse: {
  25096. transitionTime: 1e3,
  25097. modelAlpha: 1,
  25098. modelAlphaDelay: 0,
  25099. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25100. skyboxOpacity: 0,
  25101. skyboxOpacityDelay: 0,
  25102. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25103. fovLength: 1,
  25104. fovDelay: 0,
  25105. cameraMatrixDuration: .8,
  25106. cameraMatrixDelay: .3,
  25107. cameraMatrixEase: c.easeInCubic,
  25108. reticuleOpacity: 1,
  25109. markerOpacity: 0,
  25110. markerOpacityOnHover: 0
  25111. },
  25112. floorplan: {
  25113. transitionTime: 1e3,
  25114. modelAlpha: 1,
  25115. modelAlphaDelay: 0,
  25116. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25117. skyboxOpacity: 0,
  25118. skyboxOpacityDelay: 0,
  25119. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25120. fovLength: 1,
  25121. fovDelay: 0,
  25122. cameraMatrixDuration: .5,
  25123. cameraMatrixDelay: 0,
  25124. cameraMatrixEase: c.easeOutCubic,
  25125. reticuleOpacity: 1,
  25126. markerOpacity: 0,
  25127. markerOpacityOnHover: 0,
  25128. cameraHeight: 50
  25129. },
  25130. transitioning: {
  25131. reticuleOpacity: 0,
  25132. markerOpacity: .3,
  25133. markerOpacityOnHover: 1
  25134. },
  25135. "floorplan-dollhouse": {
  25136. rotationDelay: 0,
  25137. rotationDuration: 1
  25138. },
  25139. "floorplan-panorama": {
  25140. rotationDelay: .5,
  25141. rotationDuration: 1
  25142. },
  25143. "dollhouse-panorama": {
  25144. rotationDelay: .5,
  25145. rotationDuration: 1
  25146. },
  25147. "dollhouse-floorplan": {
  25148. rotationDelay: 0,
  25149. rotationDuration: 1,
  25150. cameraMatrixDuration: 1.05,
  25151. cameraMatrixDelay: .5
  25152. },
  25153. "panorama-dollhouse": {
  25154. rotationDelay: 0,
  25155. rotationDuration: .5
  25156. },
  25157. "panorama-floorplan": {
  25158. transitionTime: 1500,
  25159. rotationDelay: 0,
  25160. rotationDuration: .5
  25161. }
  25162. })).path.meshFree && (p.path.typ = l.WALK),
  25163. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25164. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25165. t.exports = p
  25166. }
  25167. , {
  25168. "./constants": 8,
  25169. "./enum/Colors": 19,
  25170. "./enum/VROption": 47,
  25171. "./enum/Viewmode": 51,
  25172. "./enum/WarpStyle": 52,
  25173. "./util/browser": 182,
  25174. "./util/common": 185,
  25175. "./util/easing": 186,
  25176. "./util/showcase": 193,
  25177. three: 217
  25178. }],
  25179. 167: [function(e, t, i) {
  25180. "use strict";
  25181. var n = e("three")
  25182. , r = e("./settings")
  25183. , 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"
  25184. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25185. t.exports = {
  25186. basicTextured: {
  25187. uniforms: {
  25188. tDiffuse: {
  25189. type: "t",
  25190. value: null
  25191. },
  25192. alpha: {
  25193. type: "f",
  25194. value: 1
  25195. }
  25196. },
  25197. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25198. 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}"
  25199. },
  25200. copyCubeMap: {
  25201. uniforms: {
  25202. tDiffuse: {
  25203. type: "t",
  25204. value: null
  25205. },
  25206. alpha: {
  25207. type: "f",
  25208. value: 1
  25209. }
  25210. },
  25211. 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}",
  25212. 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}"
  25213. },
  25214. cube: {
  25215. uniforms: {
  25216. map: {
  25217. type: "t",
  25218. value: null
  25219. },
  25220. opacity: {
  25221. type: "f",
  25222. value: 1
  25223. }
  25224. },
  25225. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25226. 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"
  25227. },
  25228. model: {
  25229. uniforms: {
  25230. map: {
  25231. type: "t",
  25232. value: null
  25233. },
  25234. modelAlpha: {
  25235. type: "f",
  25236. value: r.modelAlpha
  25237. },
  25238. opacity: {
  25239. type: "f",
  25240. value: 1
  25241. },
  25242. progress: {
  25243. type: "f",
  25244. value: 0
  25245. },
  25246. blackout: {
  25247. type: "i",
  25248. value: 0
  25249. },
  25250. pano0Map: {
  25251. type: "t",
  25252. value: null
  25253. },
  25254. pano0Position: {
  25255. type: "v3",
  25256. value: new n.Vector3
  25257. },
  25258. pano0Matrix: {
  25259. type: "m4",
  25260. value: new n.Matrix4
  25261. },
  25262. pano1Map: {
  25263. type: "t",
  25264. value: null
  25265. },
  25266. pano1Position: {
  25267. type: "v3",
  25268. value: new n.Vector3
  25269. },
  25270. pano1Matrix: {
  25271. type: "m4",
  25272. value: new n.Matrix4
  25273. }
  25274. },
  25275. 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",
  25276. 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"
  25277. },
  25278. hot: {
  25279. uniforms: {
  25280. color: {
  25281. type: "c",
  25282. value: new n.Color(16720384)
  25283. },
  25284. opac: {
  25285. type: "f",
  25286. value: 0
  25287. },
  25288. texture1: {
  25289. type: "t",
  25290. value: null
  25291. },
  25292. texture2: {
  25293. type: "t",
  25294. value: null
  25295. }
  25296. },
  25297. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25298. 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"
  25299. },
  25300. modelOutside: {
  25301. uniforms: {
  25302. map: {
  25303. type: "t",
  25304. value: null
  25305. },
  25306. opacity: {
  25307. type: "f",
  25308. value: 1
  25309. }
  25310. },
  25311. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25312. 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"
  25313. },
  25314. ribbon: {
  25315. uniforms: {
  25316. map: {
  25317. type: "t",
  25318. value: null
  25319. },
  25320. opacity: {
  25321. type: "f",
  25322. value: 1
  25323. },
  25324. color: {
  25325. type: "c",
  25326. value: new n.Color(r.path.color)
  25327. }
  25328. },
  25329. 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",
  25330. 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"
  25331. },
  25332. waypoint: {
  25333. uniforms: {
  25334. map: {
  25335. type: "t",
  25336. value: null
  25337. },
  25338. opacity: {
  25339. type: "f",
  25340. value: 1
  25341. },
  25342. pulse: {
  25343. type: "f",
  25344. value: 1
  25345. },
  25346. nearFade: {
  25347. type: "v2",
  25348. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25349. },
  25350. color: {
  25351. type: "c",
  25352. value: new n.Color(r.reticuleColor)
  25353. }
  25354. },
  25355. 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",
  25356. 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"
  25357. },
  25358. modelDebug: {
  25359. uniforms: {
  25360. map: {
  25361. type: "t",
  25362. value: null
  25363. },
  25364. modelAlpha: {
  25365. type: "f",
  25366. value: r.modelAlpha
  25367. },
  25368. depthmapRatio: {
  25369. type: "f",
  25370. value: 0
  25371. },
  25372. opacity: {
  25373. type: "f",
  25374. value: 1
  25375. },
  25376. progress: {
  25377. type: "f",
  25378. value: 0
  25379. },
  25380. considerOcclusion: {
  25381. type: "i",
  25382. value: r.fancierTransition
  25383. },
  25384. highlightPanoSelection: {
  25385. type: "i",
  25386. value: 0
  25387. },
  25388. useThirdPano: {
  25389. type: "i",
  25390. value: r.useThirdPano
  25391. },
  25392. pano0Map: {
  25393. type: "t",
  25394. value: null
  25395. },
  25396. pano0Depth: {
  25397. type: "t",
  25398. value: null
  25399. },
  25400. pano0Position: {
  25401. type: "v3",
  25402. value: new n.Vector3
  25403. },
  25404. pano0Matrix: {
  25405. type: "m4",
  25406. value: new n.Matrix4
  25407. },
  25408. pano0Weight: {
  25409. type: "f",
  25410. value: r.transition.pano0Weight
  25411. },
  25412. pano1Map: {
  25413. type: "t",
  25414. value: null
  25415. },
  25416. pano1Depth: {
  25417. type: "t",
  25418. value: null
  25419. },
  25420. pano1Position: {
  25421. type: "v3",
  25422. value: new n.Vector3
  25423. },
  25424. pano1Matrix: {
  25425. type: "m4",
  25426. value: new n.Matrix4
  25427. },
  25428. pano1Weight: {
  25429. type: "f",
  25430. value: r.transition.pano1Weight
  25431. },
  25432. pano2Map: {
  25433. type: "t",
  25434. value: null
  25435. },
  25436. pano2Depth: {
  25437. type: "t",
  25438. value: null
  25439. },
  25440. pano2Position: {
  25441. type: "v3",
  25442. value: new n.Vector3
  25443. },
  25444. pano2Matrix: {
  25445. type: "m4",
  25446. value: new n.Matrix4
  25447. },
  25448. pano2Weight: {
  25449. type: "f",
  25450. value: r.transition.pano2Weight
  25451. }
  25452. },
  25453. 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",
  25454. 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"
  25455. },
  25456. customDepth: {
  25457. uniforms: {
  25458. panoPosition: {
  25459. type: "v3",
  25460. value: new n.Vector3
  25461. }
  25462. },
  25463. 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",
  25464. 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"
  25465. },
  25466. skysphere: {
  25467. uniforms: {
  25468. radius: {
  25469. type: "f",
  25470. value: 0
  25471. }
  25472. },
  25473. 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",
  25474. 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"
  25475. },
  25476. tagDisc: {
  25477. uniforms: {
  25478. opacity: {
  25479. type: "f",
  25480. value: 0
  25481. },
  25482. color: {
  25483. type: "c",
  25484. value: new n.Color
  25485. },
  25486. bg: {
  25487. type: "t",
  25488. value: null
  25489. },
  25490. mask: {
  25491. type: "t",
  25492. value: null
  25493. }
  25494. },
  25495. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25496. 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"
  25497. }
  25498. }
  25499. window.shaders = t.exports;
  25500. }
  25501. , {
  25502. "./settings": 166,
  25503. three: 217
  25504. }],
  25505. 168: [function(E, _, e) {
  25506. (function(e) {
  25507. "use strict";
  25508. var t = E("three")
  25509. , i = (E("url"),
  25510. E("./util/ajax"))
  25511. , n = E("./settings")
  25512. , r = E("./util/logger")
  25513. , o = E("./util/math")
  25514. , a = E("./util/showcase")
  25515. , s = E("./objects/Panorama")
  25516. , l = new r(e)
  25517. , c = E("./model/Model")
  25518. , h = E("./shaders")
  25519. , u = E("./util/transitions")
  25520. , d = E("./objects/Chunk")
  25521. , p = E("./objects/Reticule")
  25522. , f = E("./objects/Skybox")
  25523. , g = E("./objects/Floor")
  25524. , m = E("./cameras/DollhouseCamera")
  25525. , v = E("./cameras/FloorplanCamera")
  25526. , y = E("./cameras/PanoramaCamera")
  25527. , A = E("./controls/DollhouseControls")
  25528. , C = E("./controls/FloorplanControls")
  25529. , I = E("./controls/PanoramaControls");
  25530. t.ImageUtils.crossOrigin = n.crossOrigin,
  25531. _.exports = {
  25532. shaders: h,
  25533. transitions: u,
  25534. Model: c,
  25535. Chunk: d,
  25536. Floor: g,
  25537. Skybox: f,
  25538. Reticule: p,
  25539. Panorama: s,
  25540. DollhouseCamera: m,
  25541. FloorplanCamera: v,
  25542. PanoramaCamera: y,
  25543. DollhouseControls: A,
  25544. FloorplanControls: C,
  25545. PanoramaControls: I,
  25546. getModel: function(e) {
  25547. if (!e.url)
  25548. throw 'getModel(): missing parameter "url"';
  25549. e.autoload = void 0 === e.autoload || e.autoload;
  25550. var t = a.parseSidUrl(e.url);
  25551. e.urlBase = t.urlBase,
  25552. e.urlModel = t.urlModel,
  25553. e.urlFiles = t.urlFiles;
  25554. var i = this._getPlatformError();
  25555. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25556. this._loadModel().then(this._buildModel.bind(this)))
  25557. },
  25558. _getPlatformError: function() {
  25559. 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"
  25560. },
  25561. _loadModel: function() {
  25562. return i.get(this.options.urlModel, {
  25563. responseType: "json",
  25564. prefetchFrom: "model",
  25565. auth: a.getAuthorizationHeader()
  25566. }).then(null, function() {
  25567. return l.warn("Model loading failed at initial metadata load"),
  25568. "loading-failed"
  25569. })
  25570. },
  25571. _buildModel: function(e) {
  25572. e = a.normalizeModeldata(e, o);
  25573. var t = new c(this.options,e);
  25574. return this.options.autoload ? t.load(!0) : $.when(t)
  25575. }
  25576. }
  25577. }
  25578. ).call(this, "/js/showcase.js")
  25579. }
  25580. , {
  25581. "./cameras/DollhouseCamera": 5,
  25582. "./cameras/FloorplanCamera": 6,
  25583. "./cameras/PanoramaCamera": 7,
  25584. "./controls/DollhouseControls": 10,
  25585. "./controls/FloorplanControls": 11,
  25586. "./controls/PanoramaControls": 13,
  25587. "./model/Model": 139,
  25588. "./objects/Chunk": 144,
  25589. "./objects/Floor": 146,
  25590. "./objects/Panorama": 148,
  25591. "./objects/Reticule": 149,
  25592. "./objects/Skybox": 152,
  25593. "./settings": 166,
  25594. "./shaders": 167,
  25595. "./util/ajax": 181,
  25596. "./util/logger": 189,
  25597. "./util/math": 190,
  25598. "./util/showcase": 193,
  25599. "./util/transitions": 195,
  25600. three: 217,
  25601. url: 208
  25602. }],
  25603. 169: [function(e, t, i) {
  25604. "use strict";
  25605. function l(e) {
  25606. var t = {
  25607. renderTarget: null,
  25608. inUse: !1,
  25609. size: -1,
  25610. pano: null
  25611. };
  25612. return t.inUse = !0,
  25613. t.size = e,
  25614. function(e) {
  25615. O.push(e)
  25616. }(t),
  25617. t
  25618. }
  25619. function c(e) {
  25620. for (var t = 0; t < O.length; t++) {
  25621. var i = O[t];
  25622. if (i.renderTarget === e)
  25623. return !(i.inUse = !1)
  25624. }
  25625. return !1
  25626. }
  25627. function n() {
  25628. this.tileDirectory = {},
  25629. this.activeRenderTargetDescriptors = {},
  25630. this.activePanos = [],
  25631. this.panoLODDescriptors = {},
  25632. this.panoDescriptors = {},
  25633. this.tileTrees = {},
  25634. this.sceneRenderer = null,
  25635. this.tileDownloader = null,
  25636. this.forceQueue = [],
  25637. this.uploadQueues = {},
  25638. this.uploadInterval = null,
  25639. this.uploadIntervalCancelled = !1,
  25640. this.usingTileOverlay = !1,
  25641. this.overlayTilesLoaded = !1,
  25642. this.overlayTileBase = null,
  25643. this.overlayTilesBasic = {},
  25644. this.overlayTilesEnhanced = {},
  25645. this.zoomRenderTarget = null,
  25646. this.zoomPano = null,
  25647. this.zoomingActive = !1,
  25648. this.zoomPanoId = null,
  25649. this.zoomPanoRenderingDisabled = !1,
  25650. this.direction = new _.Vector3,
  25651. this.initTime = -1,
  25652. this.maxBaseUploadsPerFrame = R,
  25653. this.maxNonBaseUploadsPerFrame = M
  25654. }
  25655. 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"),
  25656. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25657. e("../objects/Panorama"),
  25658. e("./TileTree")), y = (e("./TileDownloader"),
  25659. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25660. e("../util/browser"),
  25661. 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 = {
  25662. Base: 0,
  25663. Remaining: 1
  25664. }, O = [];
  25665. function L(e) {
  25666. var t = e.shift();
  25667. return t.uploadQueued = !1,
  25668. t
  25669. }
  25670. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25671. this.sceneRenderer = e,
  25672. this.tileDownloader = t,
  25673. this.qualityManager = i,
  25674. this.bindEvents(),
  25675. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25676. this.initTime = performance.now()
  25677. }
  25678. ,
  25679. n.prototype.getActivePanoTextures = function(e) {
  25680. e = e || [];
  25681. for (var t = 0; t < O.length; t++) {
  25682. var i = O[t];
  25683. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25684. }
  25685. }
  25686. ,
  25687. n.prototype.hasQueuedTiles = function() {
  25688. var e = this.peekNextFromUploadQueue();
  25689. return null != e
  25690. }
  25691. ,
  25692. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25693. return this.activeRenderTargetDescriptors[e]
  25694. }
  25695. ,
  25696. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25697. this.activeRenderTargetDescriptors[e] = t
  25698. }
  25699. ,
  25700. n.prototype.loadOverlayTiles = function() {
  25701. if (0 !== d.tiling.overlayStyle) {
  25702. var n = 0
  25703. , e = function(e, t, i) {
  25704. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25705. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25706. ++n === r.length && (this.overlayTilesLoaded = !0)
  25707. }
  25708. .bind(this)
  25709. , 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)]];
  25710. r.forEach(function(e) {
  25711. this.tileDownloader.loadImage(e[0], 0, e[1])
  25712. }
  25713. .bind(this)),
  25714. this.usingTileOverlay = !0
  25715. } else
  25716. this.usingTileOverlay = !1
  25717. }
  25718. ,
  25719. n.prototype.bindEvents = function() {
  25720. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25721. }
  25722. ,
  25723. n.prototype.setupZoomRenderTarget = function() {
  25724. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25725. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25726. return;
  25727. var e = this.zoomRenderTarget;
  25728. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25729. e) {
  25730. var t = e.width
  25731. , i = this.zoomRenderTarget.width;
  25732. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25733. e.texture.dispose(),
  25734. e.texture.loaded = !1,
  25735. e.texture.version = 0,
  25736. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25737. e.texture = null
  25738. }
  25739. this.zoomPanoRenderingDisabled = !1
  25740. } else
  25741. this.zoomPanoRenderingDisabled = !0
  25742. }
  25743. ,
  25744. n.prototype.enableUltraHighQualityMode = function(t) {
  25745. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25746. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25747. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25748. e && (this.qualityManager.enableUltraHighQualityMode(),
  25749. this.setupZoomRenderTarget(),
  25750. t())
  25751. }
  25752. .bind(this))
  25753. }
  25754. }
  25755. ,
  25756. n.prototype.activateTiledPano = function(e, t, i) {
  25757. i && this.clearAllQueuedUploads();
  25758. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25759. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25760. this.linkAllTilesAndNodes(e);
  25761. var r = this.getActiveRenderTargetDescriptor(e.id)
  25762. , o = t;
  25763. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25764. !r || o !== r.size) {
  25765. if (r && c(r.renderTarget),
  25766. !(r = function(e) {
  25767. for (var t = 0; t < O.length; t++) {
  25768. var i = O[t];
  25769. if (!i.inUse && i.size === e)
  25770. return i.inUse = !0,
  25771. i
  25772. }
  25773. return null
  25774. }(o))) {
  25775. var a = this.initTiledPano(o, !1);
  25776. (r = l(a.width)).renderTarget = a
  25777. }
  25778. r.pano = e,
  25779. this.resetPanoDescriptor(e.id),
  25780. this.resetPanoLODDescriptors(e.id),
  25781. this.resetRenderStatus(e.id, !0, !0)
  25782. }
  25783. this.setActiveRenderTargetDescriptor(e.id, r);
  25784. var s = i ? 0 : 1;
  25785. return this.updateActivePanos(e, s),
  25786. r.renderTarget
  25787. }
  25788. ,
  25789. n.prototype.deactivateTiledPano = function(e) {
  25790. var t = this.getActiveRenderTargetDescriptor(e.id);
  25791. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25792. this.setActiveRenderTargetDescriptor(e.id, null);
  25793. var i = this.getUploadQueueForPano(e.id);
  25794. this.clearUploadQueue(i),
  25795. this.updateActivePanos()
  25796. }
  25797. ,
  25798. n.prototype.updateActivePanos = (s = [],
  25799. function(e, t) {
  25800. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25801. e && s.length === t && s.push(e);
  25802. var n = this.activePanos[i]
  25803. , r = this.getActiveRenderTargetDescriptor(n.id);
  25804. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25805. }
  25806. e && t >= s.length && s.push(e),
  25807. this.activePanos.length = 0,
  25808. this.activePanos.push.apply(this.activePanos, s)
  25809. }
  25810. ),
  25811. n.prototype.getActivePanoCount = function() {
  25812. return this.activePanos.length
  25813. }
  25814. ,
  25815. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25816. var i = null;
  25817. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25818. for (var n = function(e, t, i, n) {
  25819. o && (t.tile.zoomUploaded = !1),
  25820. r && (t.tile.uploaded = !1)
  25821. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25822. this.getTileTree(e, a).breadthFirst({
  25823. callback: n.bind(this, a),
  25824. minLevel: i
  25825. })
  25826. }
  25827. }
  25828. ,
  25829. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25830. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25831. t.tile.zoomUploaded = t.tile.uploaded,
  25832. t.zoomCovered = t.covered
  25833. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25834. this.getTileTree(e, n).breadthFirst({
  25835. callback: i.bind(this, n),
  25836. maxLevel: t
  25837. })
  25838. }
  25839. }
  25840. ,
  25841. n.prototype.renderPanoTiles = (h = [],
  25842. function(e, t, i, n) {
  25843. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25844. t = t || this.direction || m.FORWARD;
  25845. var r = this.getActiveRenderTargetDescriptor(e);
  25846. if (!this.isRenderTargetDescriptorValid(r))
  25847. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25848. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25849. var a = this.getTileTree(e, o);
  25850. h.length = 0,
  25851. a.breadthFirst({
  25852. saveVisited: h
  25853. });
  25854. for (var s = 0; s < h.length; s++) {
  25855. var l = h[s];
  25856. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25857. }
  25858. }
  25859. this.updateDirection(t)
  25860. }
  25861. ),
  25862. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25863. return e && e.renderTarget
  25864. }
  25865. ,
  25866. n.prototype.isPanoActive = function(e) {
  25867. var t = this.getActiveRenderTargetDescriptor(e);
  25868. return this.isRenderTargetDescriptorValid(t)
  25869. }
  25870. ,
  25871. n.prototype.isPanoZoomed = function(e) {
  25872. return this.zoomingActive && this.zoomPanoId === e
  25873. }
  25874. ,
  25875. n.prototype.initTileTree = function(e, t, i) {
  25876. var n = this.tileTrees[e];
  25877. n || (n = [],
  25878. this.tileTrees[e] = n);
  25879. var r = n[t];
  25880. if (!r) {
  25881. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25882. r = new v(A.TILE_SIZE,o),
  25883. n[t] = r
  25884. }
  25885. }
  25886. ,
  25887. n.prototype.getTileTree = function(e, t) {
  25888. var i = this.tileTrees[e];
  25889. if (!i)
  25890. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25891. var n = i[t];
  25892. if (!n)
  25893. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25894. return n
  25895. }
  25896. ,
  25897. n.prototype.initTiledPano = function(e, t) {
  25898. var i = this.sceneRenderer.renderer
  25899. , n = (i.context,
  25900. new _.WebGLRenderTargetCube(e,e,{
  25901. stencilBuffer: !1
  25902. }))
  25903. , r = new _.CubeTexture([]);
  25904. (n.texture = r).image = [null, null, null, null, null, null],
  25905. r.flipY = !0,
  25906. t ? (r.generateMipmaps = !0,
  25907. r.magFilter = _.LinearFilter,
  25908. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25909. r.magFilter = _.LinearFilter,
  25910. r.minFilter = _.LinearFilter),
  25911. r.format = _.RGBAFormat,
  25912. i.setRenderTarget(n),
  25913. i.setRenderTarget(null);
  25914. var o = i.properties.get(r);
  25915. return o.__image__webglTextureCube = o.__webglTexture,
  25916. n
  25917. }
  25918. ,
  25919. n.prototype.getUploadQueueForPano = function(e) {
  25920. var t = this.uploadQueues[e];
  25921. return t || (t = [],
  25922. this.uploadQueues[e] = t),
  25923. t
  25924. }
  25925. ,
  25926. n.prototype.isTileUploaded = function(e) {
  25927. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25928. }
  25929. ,
  25930. n.prototype.setUploaded = function(e, t) {
  25931. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25932. }
  25933. ,
  25934. n.prototype.queueTileUpload = function(e, t, i) {
  25935. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25936. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25937. var r = this.getUploadQueueForPano(e.panoId);
  25938. 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),
  25939. e.uploadQueued = !0,
  25940. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25941. }
  25942. }
  25943. ,
  25944. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25945. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25946. }
  25947. ,
  25948. n.prototype.getTopUploadQueue = function() {
  25949. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25950. for (var n = 0; n < this.activePanos.length; n++)
  25951. if (e = this.activePanos[n],
  25952. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25953. switch (i) {
  25954. case P.Base:
  25955. if (0 === t[0].level)
  25956. return t;
  25957. break;
  25958. case P.Remaining:
  25959. return t
  25960. }
  25961. return null
  25962. }
  25963. ,
  25964. n.prototype.getNextFromUploadQueue = function() {
  25965. if (0 < this.forceQueue.length)
  25966. return L(this.forceQueue);
  25967. var e = this.getTopUploadQueue();
  25968. return e && 0 < e.length ? L(e) : null
  25969. }
  25970. ,
  25971. n.prototype.peekNextFromUploadQueue = function() {
  25972. if (0 < this.forceQueue.length)
  25973. return this.forceQueue[0];
  25974. var e = this.getTopUploadQueue();
  25975. return e && 0 < e.length ? e[0] : null
  25976. }
  25977. ,
  25978. n.prototype.clearAllQueuedUploads = function() {
  25979. this.clearAllUploadQueues(null, 0)
  25980. }
  25981. ,
  25982. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25983. this.clearAllUploadQueues(e, 0)
  25984. }
  25985. ,
  25986. n.prototype.clearAllUploadQueues = function(e, t) {
  25987. if (e)
  25988. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25989. this.clearUploadQueue(this.forceQueue, t, e);
  25990. else {
  25991. for (var i = 0; i < this.activePanos.length; i++) {
  25992. var n = this.activePanos[i];
  25993. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25994. }
  25995. this.clearUploadQueue(this.forceQueue, t)
  25996. }
  25997. }
  25998. ,
  25999. n.prototype.clearUploadQueue = function(e, t, i) {
  26000. null != t || (t = 0);
  26001. for (var n = 0; n < e.length; ) {
  26002. var r = e[n];
  26003. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26004. e.splice(n, 1)) : n++
  26005. }
  26006. }
  26007. ,
  26008. n.prototype.refreshUploadInterval = (a = null,
  26009. function(e) {
  26010. this.uploadIntervalCancelled || (a = a || function() {
  26011. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26012. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26013. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26014. }
  26015. .bind(this),
  26016. null != e || (e = x),
  26017. T || (e = S),
  26018. this.uploadInterval = window.setTimeout(a, e),
  26019. this.uploadIntervalDelay = e)
  26020. }
  26021. ),
  26022. n.prototype.update = (r = performance.now(),
  26023. o = 0,
  26024. function() {
  26025. this.uploadIntervalCancelled = !0,
  26026. window.clearTimeout(this.uploadInterval),
  26027. this.uploadInterval = null;
  26028. var e = performance.now() - r;
  26029. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26030. r = performance.now()),
  26031. o++
  26032. }
  26033. ),
  26034. n.prototype.updateUploadQueue = function(e, t) {
  26035. e = e || 1;
  26036. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26037. var r = this.getNextFromUploadQueue();
  26038. if (!r)
  26039. break;
  26040. if (0 !== r.level ? i++ : n++,
  26041. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26042. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26043. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26044. }
  26045. }
  26046. }
  26047. ,
  26048. n.prototype.updateDirection = function(e) {
  26049. if (e = e || this.direction) {
  26050. this.direction = e;
  26051. for (var t = 0; t < this.activePanos.length; t++) {
  26052. var i = this.activePanos[t]
  26053. , n = this.getUploadQueueForPano(i.id);
  26054. y.sortPanoTiles(n, i, this.direction)
  26055. }
  26056. }
  26057. }
  26058. ,
  26059. n.prototype.uploadTile = (I = {},
  26060. new _.Vector4,
  26061. E = d.tiling.overlayStyle,
  26062. function(e, t) {
  26063. var i = e.panoId
  26064. , n = e.image
  26065. , r = e.tileSize
  26066. , o = e.panoSize
  26067. , a = e.tileIndex
  26068. , s = (e.faceTileIndex,
  26069. e.totalTiles)
  26070. , l = (e.face,
  26071. e.tileX)
  26072. , c = e.tileY
  26073. , h = !0
  26074. , u = !1
  26075. , d = (this.getPanoDescriptor(i),
  26076. this.getPanoLODDescriptor(i, o))
  26077. , p = this.getActiveRenderTargetDescriptor(i)
  26078. , f = p.renderTarget
  26079. , g = p.size;
  26080. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26081. g = this.qualityManager.getMaxZoomPanoSize()),
  26082. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26083. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26084. this.isTileUploaded(e) && (u = h = !1)),
  26085. h) {
  26086. var m = r / o * g
  26087. , v = l * r / o * g
  26088. , y = c * r / o * g;
  26089. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26090. var A = I[r];
  26091. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26092. 1 === E || 2 === E) {
  26093. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26094. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26095. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26096. } else
  26097. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26098. d.uploadCount++,
  26099. this.emit(b.TileRenderSuccess, i, o, a, s),
  26100. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26101. this.setUploaded(e, !0),
  26102. this.addCoverageForNode(e.node)
  26103. } else
  26104. this.setUploaded(e, !1);
  26105. return e.uploadAttempted || (d.uploadAttempts++,
  26106. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26107. e.uploadAttempted = !0,
  26108. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26109. u
  26110. }
  26111. ),
  26112. n.prototype.linkTileAndNode = function(e, t) {
  26113. (t.tile = e).node = t
  26114. }
  26115. ,
  26116. n.prototype.linkAllTilesAndNodes = function(a) {
  26117. for (var e = function(e, t, i, n, r) {
  26118. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26119. this.linkTileAndNode(o, i)
  26120. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26121. var i = this.getTileTree(a.id, t);
  26122. i.breadthFirst({
  26123. callback: e.bind(this, i, t)
  26124. })
  26125. }
  26126. }
  26127. ,
  26128. n.prototype.anyUploaded = function(e) {
  26129. if (!e)
  26130. return !1;
  26131. if (e.tile && this.isTileUploaded(e.tile))
  26132. return !0;
  26133. if (e.children)
  26134. for (var t = 0; t < e.children.length; t++) {
  26135. var i = e.children[t];
  26136. if (this.anyUploaded(i))
  26137. return !0
  26138. }
  26139. return !1
  26140. }
  26141. ,
  26142. n.prototype.setNodeCovered = function(e, t) {
  26143. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26144. }
  26145. ,
  26146. n.prototype.isNodeCovered = function(e) {
  26147. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26148. }
  26149. ,
  26150. n.prototype.addCoverageForNode = function(e) {
  26151. if (this.setNodeCovered(e, !0),
  26152. e.parent && e.covered) {
  26153. var t = e.parent;
  26154. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26155. }
  26156. }
  26157. ,
  26158. n.prototype.calcFullCoverage = function(e) {
  26159. var t = !1;
  26160. if (e.children)
  26161. for (var i = 0; i < e.children.length; i++) {
  26162. var n = e.children[i];
  26163. t = t || this.calcFullCoverage(n)
  26164. }
  26165. e.covered = e.tile.uploaded || t
  26166. }
  26167. ,
  26168. n.prototype.nodeSubcovered = function(e) {
  26169. if (!e.children)
  26170. return !1;
  26171. for (var t = 0; t < e.children.length; t++)
  26172. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26173. return !1;
  26174. return !0
  26175. }
  26176. ,
  26177. n.prototype.resetPanoDescriptor = function(e) {
  26178. this.getPanoDescriptor(e)
  26179. }
  26180. ,
  26181. n.prototype.getPanoDescriptor = function(e) {
  26182. var t = this.panoDescriptors[e];
  26183. return t || (t = {},
  26184. this.panoDescriptors[e] = t),
  26185. t
  26186. }
  26187. ,
  26188. n.prototype.resetPanoLODDescriptors = function(e) {
  26189. var t = this.getPanoLODDescriptors(e);
  26190. for (var i in t)
  26191. if (t.hasOwnProperty(i)) {
  26192. var n = t[i];
  26193. n.uploadCount = 0,
  26194. n.uploadAttempts = 0
  26195. }
  26196. }
  26197. ,
  26198. n.prototype.getPanoLODDescriptor = function(e, t) {
  26199. var i = this.getPanoLODDescriptors(e)
  26200. , n = i[t];
  26201. return n || (n = {
  26202. uploadCount: 0,
  26203. uploadAttempts: 0
  26204. },
  26205. i[t] = n),
  26206. n
  26207. }
  26208. ,
  26209. n.prototype.getPanoLODDescriptors = function(e) {
  26210. var t = this.panoLODDescriptors[e];
  26211. return t || (t = {},
  26212. this.panoLODDescriptors[e] = t),
  26213. t
  26214. }
  26215. ,
  26216. n.prototype.onTileDownloaded = function(e) {
  26217. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26218. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26219. if (i.downloaded = !0,
  26220. i.image = e.image,
  26221. i.panoSize = e.panoSize,
  26222. i.tileX = e.tileX,
  26223. i.tileY = e.tileY,
  26224. i.totalTiles = e.totalTiles,
  26225. i.tileIndex = e.tileIndex,
  26226. i.faceTileIndex = e.faceTileIndex,
  26227. i.face = e.face,
  26228. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26229. i.panoId = e.panoId,
  26230. i.tileSize = e.tileSize,
  26231. i.direction = (new _.Vector3).copy(e.direction),
  26232. i.node = null,
  26233. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26234. this.isPanoActive(i.panoId)) {
  26235. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26236. this.linkTileAndNode(i, n),
  26237. this.queueTileUpload(i, !0)
  26238. }
  26239. }
  26240. ,
  26241. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26242. var r = this.tileDirectory[e];
  26243. r || (r = {},
  26244. this.tileDirectory[e] = r);
  26245. var o = 16384 * t + 1024 * i + n
  26246. , a = r[o];
  26247. return a || (a = {
  26248. downloaded: !1,
  26249. uploaded: !1,
  26250. zoomUploaded: !1
  26251. },
  26252. r[o] = a),
  26253. a._key = e + ":" + t + ":" + i + ":" + n,
  26254. a._tileKey = o,
  26255. a
  26256. }
  26257. ,
  26258. n.prototype.setZoomingActive = function(e, t, i) {
  26259. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26260. this.zoomPanoId = t.id,
  26261. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26262. }
  26263. ,
  26264. n.prototype.updateZoomedPanoFromBase = function(e) {
  26265. if (!this.zoomPanoRenderingDisabled) {
  26266. var t = this.getActiveRenderTargetDescriptor(e.id);
  26267. if (t && t.renderTarget) {
  26268. var i = this.qualityManager.getMaxZoomPanoSize()
  26269. , n = t.renderTarget
  26270. , r = t.size;
  26271. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26272. this.copyBaseRenderStatusToZoomed(e.id)
  26273. }
  26274. }
  26275. }
  26276. ,
  26277. t.exports = n
  26278. }
  26279. , {
  26280. "../enum/GLCubeFaces": 25,
  26281. "../enum/PanoRendererEvents": 35,
  26282. "../enum/PanoSizeClass": 36,
  26283. "../enum/SceneRendererEvents": 43,
  26284. "../enum/TileDownloaderEvents": 45,
  26285. "../enum/Vectors": 50,
  26286. "../exception/BasicException": 55,
  26287. "../objects/Panorama": 148,
  26288. "../settings": 166,
  26289. "../util/browser": 182,
  26290. "../util/panorama": 191,
  26291. "./TileDownloader": 171,
  26292. "./TilePrioritizer": 172,
  26293. "./TileTree": 173,
  26294. "./TileUtils": 174,
  26295. events: 202,
  26296. three: 217
  26297. }],
  26298. 170: [function(e, t, i) {
  26299. "use strict";
  26300. function n(e, t, i) {
  26301. this.maxNavPanoSize = -1,
  26302. this.maxZoomPanoSize = -1,
  26303. this.devicePixelDensity = e,
  26304. this.deviceScreenSize = t,
  26305. this.clientBandwidth = i,
  26306. this.panoSizeClassMap = {},
  26307. this.useHighResolutionPanos = !0,
  26308. this.useUltraHighResolutionPanos = !1,
  26309. this.modelHasUltraHighPanos = !1
  26310. }
  26311. var r = e("../enum/PanoSizeClass")
  26312. , o = e("../settings")
  26313. , a = e("../util/browser")
  26314. , s = e("../constants")
  26315. , l = e("../util/showcase")
  26316. , c = e("../enum/ModelManagerEvents");
  26317. n.prototype.init = function(e) {
  26318. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26319. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26320. this.highSize = this.getPanoSize(r.HIGH),
  26321. this.standardSize = this.getPanoSize(r.STANDARD),
  26322. this.baseSize = this.getPanoSize(r.BASE),
  26323. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26324. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26325. this.updateMaximums(),
  26326. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26327. }
  26328. ,
  26329. n.prototype.updateFromModel = function(e) {
  26330. this.updateHighResolutionSettings(e),
  26331. this.updateUltraHighResolutionSettings(e)
  26332. }
  26333. ,
  26334. n.prototype.updateHighResolutionSettings = function(e) {
  26335. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26336. this.updateMaximums()
  26337. }
  26338. ,
  26339. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26340. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26341. this.updateMaximums()
  26342. }
  26343. ,
  26344. n.prototype.enableUltraHighQualityMode = function() {
  26345. this.modelHasUltraHighPanos = !0,
  26346. this.updateUltraHighResolutionSettings(null)
  26347. }
  26348. ,
  26349. n.prototype.ultraHighQualityModeEnabled = function() {
  26350. return this.modelHasUltraHighPanos
  26351. }
  26352. ,
  26353. n.prototype.onModelChanged = function(e) {
  26354. this.updateFromModel(e.model),
  26355. this.updateMaximums()
  26356. }
  26357. ,
  26358. n.prototype.updateMaximums = function() {
  26359. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26360. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26361. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26362. }
  26363. ,
  26364. n.prototype.buildPanoSizeClassMap = function() {
  26365. this.panoSizeClassMap[r.BASE] = 512,
  26366. this.panoSizeClassMap[r.STANDARD] = 1024,
  26367. this.panoSizeClassMap[r.HIGH] = 2048,
  26368. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26369. }
  26370. ,
  26371. n.prototype.getPanoSize = function(e) {
  26372. return this.panoSizeClassMap[e]
  26373. }
  26374. ,
  26375. n.prototype.getMaxPossiblePanoSize = function() {
  26376. return this.getPanoSize(r.ULTRAHIGH)
  26377. }
  26378. ,
  26379. n.prototype.getMaxPanoSize = function() {
  26380. return this.maxZoomPanoSize
  26381. }
  26382. ,
  26383. n.prototype.getMaxNavPanoSize = function() {
  26384. return this.maxNavPanoSize
  26385. }
  26386. ,
  26387. n.prototype.getMaxZoomPanoSize = function() {
  26388. return this.maxZoomPanoSize
  26389. }
  26390. ,
  26391. n.prototype.detectMaxNavPanoSizeClass = function() {
  26392. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26393. }
  26394. ,
  26395. n.prototype.detectMaxNavPanoSize = function() {
  26396. var e = this.detectMaxNavPanoSizeClass();
  26397. return this.getPanoSize(e)
  26398. }
  26399. ,
  26400. n.prototype.detectMaxZoomPanoSize = function() {
  26401. 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)
  26402. }
  26403. ,
  26404. t.exports = n
  26405. }
  26406. , {
  26407. "../constants": 8,
  26408. "../enum/ModelManagerEvents": 33,
  26409. "../enum/PanoSizeClass": 36,
  26410. "../settings": 166,
  26411. "../util/browser": 182,
  26412. "../util/showcase": 193
  26413. }],
  26414. 171: [function(A, C, e) {
  26415. (function(e) {
  26416. "use strict";
  26417. function i(e) {
  26418. this.panos = null,
  26419. this.retryMinimumTime = 1e4,
  26420. this.urls = null,
  26421. this.panoLoadCallbacks = {},
  26422. this.downloadDescriptors = {},
  26423. this.priorityQueue = [],
  26424. this.forceQueue = [],
  26425. this.activeDownloads = [],
  26426. this.qualityManager = null,
  26427. this.tilePrioritizer = null,
  26428. this.refreshInterval = null,
  26429. this.processPriorityQueue = !1,
  26430. this.concurrentDownloads = e.concurrentDownloads || 1,
  26431. this.downloadTestResults = {}
  26432. }
  26433. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26434. A("../settings")), r = (A("../objects/Panorama"),
  26435. A("../util/logger")), o = (A("../enum/Vectors"),
  26436. A("../enum/PanoSizeClass"),
  26437. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26438. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26439. Object.freeze({
  26440. Testing: 1,
  26441. Success: 2,
  26442. Fail: 3
  26443. }));
  26444. i.prototype = Object.create(l.prototype),
  26445. i.IDLE_REFRESH_DELAY = 500,
  26446. i.ACTIVE_REFRESH_DELAY = 16,
  26447. i.DOWNLOAD_RETRIES = 4,
  26448. i.prototype.init = function(e) {
  26449. this.qualityManager = e
  26450. }
  26451. ,
  26452. i.prototype.setUrls = function(e) {
  26453. this.urls = e
  26454. }
  26455. ,
  26456. i.prototype.setPanoData = function(e, t, i) {
  26457. this.panos = e,
  26458. this.imagePanos = t,
  26459. this.panoGroupId = i
  26460. }
  26461. ,
  26462. i.prototype.start = function() {
  26463. this.refreshUpdateInterval(0)
  26464. }
  26465. ,
  26466. i.prototype.stop = function() {
  26467. window.cancel(this.refreshInterval)
  26468. }
  26469. ,
  26470. i.prototype.refreshUpdateInterval = function(e) {
  26471. e = e || 0,
  26472. this.refreshInterval = window.setTimeout(function() {
  26473. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26474. }
  26475. .bind(this), e)
  26476. }
  26477. ,
  26478. i.prototype.update = function() {
  26479. var e = 0 < this.forceQueue.length;
  26480. return this.processQueueForDownloading(this.forceQueue),
  26481. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26482. 0 < this.priorityQueue.length && (e = !0),
  26483. this.processQueueForDownloading(this.priorityQueue)),
  26484. e
  26485. }
  26486. ,
  26487. i.prototype.forceQueueTilesForPano = (p = [],
  26488. f = [],
  26489. function(e, t, i, n, r, o) {
  26490. p.length = 0;
  26491. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26492. var l = a[s];
  26493. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26494. }
  26495. if (i && 0 < p.length) {
  26496. g.sortPanoTiles(p, e, i),
  26497. f.length = 0,
  26498. m.matchingTilesInDirection(e, t, i, n, r, f);
  26499. for (var c = 0, h = function(e) {
  26500. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26501. }; c < p.length; ) {
  26502. var u = p[c];
  26503. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26504. }
  26505. }
  26506. for (var d = 0; d < p.length; d++)
  26507. this.forceQueue.push(p[d]);
  26508. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26509. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26510. o && this.processQueueForDownloading(this.forceQueue, !0)
  26511. }
  26512. ),
  26513. i.prototype.clearForceQueue = function() {
  26514. this.clearQueue(this.forceQueue)
  26515. }
  26516. ,
  26517. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26518. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26519. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26520. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26521. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26522. }
  26523. ,
  26524. i.prototype.clearQueue = function(e) {
  26525. this.setStatusForAllDescriptors(e, v.None),
  26526. e.length = 0
  26527. }
  26528. ,
  26529. i.prototype.clearFromQueue = function(e, t, i) {
  26530. for (var n = 0; n < e.length; n++) {
  26531. var r = e[n];
  26532. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26533. }
  26534. }
  26535. ,
  26536. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26537. for (var i = 0; i < e.length; i++) {
  26538. var n = e[i];
  26539. n && (n.status = t)
  26540. }
  26541. }
  26542. ,
  26543. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26544. for (var i = 0; i < e.length; i++) {
  26545. var n = e[i];
  26546. n && (n.status !== t ? n.status = t : e[i] = null)
  26547. }
  26548. }
  26549. ,
  26550. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26551. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26552. , n = i[t];
  26553. return n || (n = this.buildDownloadDescriptorArray(t),
  26554. i[t] = n,
  26555. this.initTileDownloadDescriptors(n, e, t)),
  26556. n
  26557. }
  26558. ,
  26559. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26560. var t = this.downloadDescriptors[e.id];
  26561. return t || (t = {},
  26562. this.downloadDescriptors[e.id] = t),
  26563. t
  26564. }
  26565. ,
  26566. i.prototype.processQueueForDownloading = function(e, t) {
  26567. if (this.cleanupActiveDownloads(),
  26568. this.activeDownloads.length < this.concurrentDownloads || t)
  26569. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26570. var r = e.shift();
  26571. r && (this.startDownload(r),
  26572. n++)
  26573. }
  26574. }
  26575. ,
  26576. i.prototype.testDownload = function(t, e, i) {
  26577. var n = this.downloadTestResults[t];
  26578. if (n)
  26579. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26580. else {
  26581. this.downloadTestResults[t] = y.Testing;
  26582. var r = this.panos.list[0]
  26583. , o = this.getTileUrl(r.id, t, e, 0)
  26584. , a = function(e) {
  26585. this.downloadTestResults[t] = y.Success,
  26586. i(!0)
  26587. }
  26588. .bind(this)
  26589. , s = function() {
  26590. this.downloadTestResults[t] = y.Fail,
  26591. i(!1)
  26592. }
  26593. .bind(this);
  26594. this.loadImage(o, 0, a, s)
  26595. }
  26596. }
  26597. ,
  26598. i.prototype.startDownload = function(e) {
  26599. e.status = v.Downloading;
  26600. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26601. this.activeDownloads.push(e),
  26602. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26603. }
  26604. ,
  26605. i.prototype.downloadFailed = function(e, t) {}
  26606. ,
  26607. i.prototype.downloadComplete = function(e, t) {
  26608. if (e.panoGroupId === this.panoGroupId) {
  26609. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26610. e.status = v.Downloaded,
  26611. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26612. var n = {
  26613. panoId: e.pano.id,
  26614. image: t,
  26615. tileSize: e.tileSize,
  26616. panoSize: e.panoSize,
  26617. tileIndex: e.tileIndex,
  26618. faceTileIndex: e.faceTileIndex,
  26619. totalTiles: e.totalTiles,
  26620. face: e.face,
  26621. tileX: e.tileX,
  26622. tileY: e.tileY,
  26623. direction: e.direction
  26624. };
  26625. e.image = t,
  26626. this.emit(o.TileDownloadSuccess, n),
  26627. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26628. panoId: e.pano.id,
  26629. tileSize: e.tileSize,
  26630. panoSize: e.panoSize
  26631. },
  26632. this.emit(o.PanoDownloadComplete, n),
  26633. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26634. }
  26635. }
  26636. ,
  26637. i.prototype.cleanupActiveDownloads = (n = [],
  26638. function() {
  26639. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26640. var t = this.activeDownloads[e];
  26641. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26642. }
  26643. this.activeDownloads.length = 0,
  26644. this.activeDownloads.push.apply(this.activeDownloads, n)
  26645. }
  26646. ),
  26647. i.prototype.isPanoDownloaded = function(e, t) {
  26648. var i = this.getTileDownloadDescriptors(e, t);
  26649. if (i.length <= 0)
  26650. return !1;
  26651. for (var n = 0; n < i.length; n++) {
  26652. if (i[n].status !== v.Downloaded)
  26653. return !1
  26654. }
  26655. return !0
  26656. }
  26657. ,
  26658. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26659. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26660. this.panoLoadCallbacks[o] = {
  26661. onLoad: i,
  26662. onFail: n,
  26663. onProgress: r
  26664. }
  26665. }
  26666. ,
  26667. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26668. var i = e.id + ":" + t;
  26669. return this.panoLoadCallbacks[i]
  26670. }
  26671. ,
  26672. i.prototype.buildDownloadDescriptorArray = function(e) {
  26673. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26674. var r = this.buildDownloadDescriptor();
  26675. i.push(r)
  26676. }
  26677. return i
  26678. }
  26679. ,
  26680. i.prototype.buildDownloadDescriptor = function() {
  26681. return {
  26682. panoGroupId: null,
  26683. pano: null,
  26684. panoSize: -1,
  26685. tileSize: -1,
  26686. tileIndex: -1,
  26687. totalTiles: -1,
  26688. faceTileIndex: -1,
  26689. status: v.None,
  26690. url: null,
  26691. image: null,
  26692. direction: new t.Vector3,
  26693. face: -1,
  26694. cubeFace: -1,
  26695. tileX: -1,
  26696. tileY: -1
  26697. }
  26698. }
  26699. ,
  26700. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26701. for (var n = 0; n < e.length; n++) {
  26702. var r = e[n];
  26703. this.initTileDownloadDescriptor(r, t, i, n)
  26704. }
  26705. }
  26706. ,
  26707. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26708. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26709. e.face = m.getFaceForTile(i, n),
  26710. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26711. e.panoGroupId = this.panoGroupId,
  26712. e.pano = t,
  26713. e.panoSize = i,
  26714. e.tileSize = r,
  26715. e.tileIndex = n,
  26716. e.totalTiles = m.getTileCountForSize(i),
  26717. e.status = v.None,
  26718. e.image = null,
  26719. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26720. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26721. }
  26722. ,
  26723. i.prototype.getTileUrl = (c = {
  26724. 256: "256",
  26725. 512: "512",
  26726. 1024: "1k",
  26727. 2048: "2k",
  26728. 4096: "4k"
  26729. },
  26730. h = {
  26731. face: -1,
  26732. faceTileIndex: -1,
  26733. tileX: -1,
  26734. tileY: -1
  26735. },
  26736. function(e, t, i, n) {
  26737. m.getTileLocation(t, n, h);
  26738. var r = Math.floor(t / i)
  26739. , o = r * r
  26740. , a = Math.floor(n / o)
  26741. , s = "";
  26742. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26743. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26744. return d.changeIfTileGenerating(l)
  26745. }
  26746. ),
  26747. i.prototype.loadImage = function(e, t, i, n) {
  26748. s.getImage(e, t).then(function(e) {
  26749. i(e)
  26750. }).fail(n)
  26751. }
  26752. ,
  26753. C.exports = i
  26754. }
  26755. ).call(this, "/js/tile/TileDownloader.js")
  26756. }
  26757. , {
  26758. "../ab": 3,
  26759. "../enum/DownloadStatus": 24,
  26760. "../enum/GLCubeFaces": 25,
  26761. "../enum/PanoSizeClass": 36,
  26762. "../enum/TileDownloaderEvents": 45,
  26763. "../enum/Vectors": 50,
  26764. "../enum/Viewmode": 51,
  26765. "../objects/Panorama": 148,
  26766. "../settings": 166,
  26767. "../util/ajax": 181,
  26768. "../util/logger": 189,
  26769. "../util/panorama": 191,
  26770. "./TilePrioritizer": 172,
  26771. "./TileUtils": 174,
  26772. events: 202,
  26773. three: 217
  26774. }],
  26775. 172: [function(n, C, e) {
  26776. (function(e) {
  26777. "use strict";
  26778. function h(e, t, i, n, r) {
  26779. this.qualityManager = e,
  26780. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26781. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26782. this.baseSize = t,
  26783. this.standardSize = i,
  26784. this.highSize = n,
  26785. this.ultraHighSize = r,
  26786. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26787. }
  26788. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26789. n("../settings"),
  26790. n("../settings"),
  26791. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26792. n("../enum/PanoSizeClass"),
  26793. n("../enum/ModelManagerEvents"),
  26794. n("../enum/GLCubeFaces"),
  26795. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26796. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26797. new t(e),
  26798. Object.freeze({
  26799. None: 0,
  26800. DirectionalFOV: 1
  26801. }));
  26802. h.PriorityCriteria = function(e, t, i, n, r) {
  26803. this.pano = e,
  26804. this.cameraPosition = (new o.Vector3).copy(t),
  26805. this.cameraDir = (new o.Vector3).copy(i),
  26806. this.panoSpaceDir = (new o.Vector3).copy(n),
  26807. this.upcomingPanos = r,
  26808. this.copy = function(e) {
  26809. this.pano = e.pano,
  26810. this.cameraPosition.copy(e.cameraPosition),
  26811. this.cameraDir.copy(e.cameraDir),
  26812. this.panoSpaceDir.copy(e.panoSpaceDir),
  26813. this.upcomingPanos = r
  26814. }
  26815. ,
  26816. this.zoomingActive = !1
  26817. }
  26818. ,
  26819. h.DIRECTIONAL_FOV = 180,
  26820. h.DIRECTIONAL_FOV_NARROW = 120,
  26821. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26822. h.MAX_SCORED_PANOS_TOADD = 2,
  26823. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26824. h.DIRECTION_SCORE_STRICTNESS = .75,
  26825. h.appendQueue = function(e, t) {
  26826. if (e && t)
  26827. for (var i = 0; i < t.length; i++)
  26828. e.push(t[i])
  26829. }
  26830. ,
  26831. h.prototype.updateCriteria = function(e, t, i, n) {
  26832. this.priorityCriteria.pano = e,
  26833. this.priorityCriteria.cameraPosition.copy(t),
  26834. this.priorityCriteria.cameraDir.copy(i),
  26835. this.priorityCriteria.upcomingPanos = n,
  26836. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26837. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26838. }
  26839. ,
  26840. h.prototype.filterAndPrioritize = (u = [],
  26841. p = [],
  26842. f = [],
  26843. function(e, t, i) {
  26844. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26845. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26846. var n = this.baseSize
  26847. , r = this.standardSize
  26848. , o = this.highSize
  26849. , a = this.ultraHighSize;
  26850. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26851. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26852. f.length = 0,
  26853. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26854. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26855. h.appendQueue(e, f),
  26856. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26857. f.length = 0,
  26858. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26859. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26860. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26861. h.appendQueue(e, f),
  26862. f.length = 0,
  26863. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26864. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26865. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26866. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26867. h.appendQueue(e, f),
  26868. this.queueTilesForPanos(e, u, i, n)
  26869. }
  26870. ),
  26871. h.prototype.canDownloadSize = function(e) {
  26872. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26873. }
  26874. ,
  26875. h.prototype.populateNeighborPanos = function(e, t, i) {
  26876. (i = i || []).length = 0;
  26877. var n = t.getNeighbours(e);
  26878. for (var r in n)
  26879. if (n.hasOwnProperty(r)) {
  26880. var o = t.get(r);
  26881. i.push(o)
  26882. }
  26883. return i
  26884. }
  26885. ,
  26886. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26887. (i = i || []).length = 0;
  26888. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26889. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26890. , s = t.sortByScore(o, a);
  26891. if (s)
  26892. for (var l = 0; l < s.length && l < r; l++) {
  26893. var c = s[l].pano;
  26894. i.push(c)
  26895. }
  26896. return i
  26897. }
  26898. ,
  26899. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26900. for (var o = 0, a = 0; a < t.length; a++) {
  26901. var s = t[a];
  26902. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26903. r && r <= o)
  26904. break
  26905. }
  26906. return o
  26907. }
  26908. ,
  26909. h.prototype.queueTilesForPano = (r = {
  26910. filter: a.None
  26911. },
  26912. function(e, t, i, n) {
  26913. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26914. }
  26915. ),
  26916. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26917. function(e, t, i, n, r, o, a, s) {
  26918. for (var l = 0, c = 0; c < i.length; c++) {
  26919. var h = i[c];
  26920. d.copy(h.position),
  26921. d.sub(r),
  26922. d.normalize();
  26923. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26924. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26925. s && s <= l))
  26926. break
  26927. }
  26928. return l
  26929. }
  26930. ),
  26931. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26932. for (var l = 0, c = 0; c < i.length; c++) {
  26933. var h = i[c];
  26934. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26935. s && s <= l)
  26936. break
  26937. }
  26938. return l
  26939. }
  26940. ,
  26941. h.prototype.queueTilesInDirectionForPano = (s = {
  26942. filter: a.DirectionalFOV,
  26943. direction: new o.Vector3,
  26944. fov: 60
  26945. },
  26946. l = new o.Vector3,
  26947. function(e, t, i, n, r, o, a) {
  26948. return l.copy(o),
  26949. m.getRelativeDirection(i.quaternion, l),
  26950. s.direction.copy(l),
  26951. s.fov = a,
  26952. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26953. }
  26954. ),
  26955. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26956. function(e, t, i, n, r) {
  26957. var o = t.getTileDownloadDescriptors(i, n);
  26958. c.length = 0,
  26959. this.filterTileDownloadDescriptors(i, o, c, r);
  26960. for (var a = 0, s = 0; s < c.length; s++) {
  26961. var l = c[s];
  26962. l && (e.push(l),
  26963. a++)
  26964. }
  26965. return a
  26966. }
  26967. ),
  26968. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26969. function(e, t, i, n) {
  26970. var r, o;
  26971. switch (n.filter) {
  26972. case a.DirectionalFOV:
  26973. for (r = 0; r < t.length; r++)
  26974. o = t[r],
  26975. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26976. break;
  26977. default:
  26978. for (r = 0; r < t.length; r++)
  26979. o = t[r],
  26980. i.push(o)
  26981. }
  26982. for (r = 0; r < i.length; r++)
  26983. o = i[r],
  26984. this.canIncludeDescriptor(o) || (i[r] = null)
  26985. }
  26986. ),
  26987. h.prototype.canIncludeDescriptor = function(e) {
  26988. return e.status !== i.Downloading && e.status !== i.Downloaded
  26989. }
  26990. ,
  26991. h.prototype.canIncludePano = function(e, t) {
  26992. return !e.isLoaded(t)
  26993. }
  26994. ,
  26995. h.getFOVDotThreshold = function(e) {
  26996. return Math.cos(o.Math.degToRad(e / 2))
  26997. }
  26998. ;
  26999. var y = (A._panoSpaceDir = new o.Vector3,
  27000. A._fovThreshold = -1,
  27001. A._fovThresholdNarrow = -1,
  27002. A);
  27003. function A(e, t) {
  27004. var i = A._panoSpaceDir
  27005. , n = A._fovThreshold
  27006. , r = A._fovThresholdNarrow
  27007. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27008. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27009. return e._dot = o,
  27010. t._dot = a,
  27011. 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)
  27012. }
  27013. h.sortPanoTiles = function(e, t, i) {
  27014. y._panoSpaceDir.copy(i),
  27015. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27016. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27017. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27018. e.sort(y)
  27019. }
  27020. ,
  27021. h.insertSortedPanoTile = function(e, t, i, n) {
  27022. y._panoSpaceDir.copy(n),
  27023. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27024. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27025. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27026. for (var r = -1, o = 0; o < e.length; o++) {
  27027. if (y(t, e[o]) <= 0) {
  27028. r = o;
  27029. break
  27030. }
  27031. }
  27032. if (-1 === r)
  27033. e[e.length] = t;
  27034. else {
  27035. for (var a = e.length; r < a; a--)
  27036. e[a] = e[a - 1];
  27037. e[r] = t
  27038. }
  27039. }
  27040. ,
  27041. h.prototype.setZoomingActive = function(e) {
  27042. e !== this.zoomingActive && (this.zoomingActive = e)
  27043. }
  27044. ,
  27045. C.exports = h
  27046. }
  27047. ).call(this, "/js/tile/TilePrioritizer.js")
  27048. }
  27049. , {
  27050. "../enum/DownloadStatus": 24,
  27051. "../enum/GLCubeFaces": 25,
  27052. "../enum/ModelManagerEvents": 33,
  27053. "../enum/PanoSizeClass": 36,
  27054. "../enum/Vectors": 50,
  27055. "../enum/Viewmode": 51,
  27056. "../objects/Panorama": 148,
  27057. "../settings": 166,
  27058. "../util/browser": 182,
  27059. "../util/logger": 189,
  27060. "../util/math": 190,
  27061. "./TileUtils": 174,
  27062. events: 202,
  27063. three: 217
  27064. }],
  27065. 173: [function(e, t, i) {
  27066. "use strict";
  27067. function f(e, t) {
  27068. this.levels = t,
  27069. this.tileSize = e,
  27070. this.root = null,
  27071. this.allNodes = [],
  27072. function(e) {
  27073. e.root = function e(t, i, n) {
  27074. if (n > t.levels)
  27075. return null;
  27076. var r = new a(t,i);
  27077. t.allNodes.push(r);
  27078. for (var o = 0; o < s; o++)
  27079. r.children[o] = e(t, r, n + 1);
  27080. return r
  27081. }(e, null, 0)
  27082. }(this)
  27083. }
  27084. function a(e, t) {
  27085. this.tree = e,
  27086. this.parent = t,
  27087. this.children = [],
  27088. this.id = ++n
  27089. }
  27090. var g = (e("three"),
  27091. e("./TileUtils"),
  27092. e("../objects/Panorama"),
  27093. e("../util/panorama"),
  27094. e("events").EventEmitter,
  27095. 2)
  27096. , s = g * g;
  27097. f.TraversalType = Object.freeze({
  27098. PreOrder: 0,
  27099. PostOrder: 1
  27100. });
  27101. var n = 0;
  27102. f.getLevelCountForSize = function(e, t) {
  27103. var i = 0;
  27104. for (t < e && (t = e); !((t /= g) < e); )
  27105. i++;
  27106. return i
  27107. }
  27108. ,
  27109. f.getSizeForLevel = function(e, t) {
  27110. return Math.pow(g, t) * e
  27111. }
  27112. ,
  27113. f.prototype.getSubNode = function(e, t, i) {
  27114. (!t || e < this.tileSize) && (t = 0),
  27115. (!i || e < this.tileSize) && (i = 0),
  27116. e < this.tileSize && (e = this.tileSize);
  27117. var n = f.getLevelCountForSize(this.tileSize, e);
  27118. return function e(t, i, n, r, o) {
  27119. if (!t)
  27120. return null;
  27121. if (0 === n)
  27122. return t;
  27123. if (!t.children || 0 === t.children.length)
  27124. return null;
  27125. var a = Math.pow(g, n) / g
  27126. , s = r % a
  27127. , l = o % a
  27128. , c = Math.floor(o / a)
  27129. , h = Math.floor(r / a)
  27130. , u = c * g + h;
  27131. return e(t.children[u], i + 1, n - 1, s, l)
  27132. }(this.root, 0, n, t, i)
  27133. }
  27134. ,
  27135. f.prototype.breadthFirst = function(e) {
  27136. var t = !!(e = e || {}).nullLevelEnd
  27137. , i = e.maxLevel
  27138. , n = e.minLevel
  27139. , r = e.callback
  27140. , o = e.saveVisited
  27141. , a = []
  27142. , s = {}
  27143. , l = 0;
  27144. for (a.push(this.root),
  27145. a.push(s); 0 < a.length && !(i && i < l); ) {
  27146. var c = a.shift();
  27147. if (c === s)
  27148. (!n || n <= l) && (r && t && r(null),
  27149. o && t && o.push(null)),
  27150. 0 < a.length && a.push(s),
  27151. l++,
  27152. 0;
  27153. else {
  27154. if (c.children)
  27155. for (var h = 0; h < c.children.length; h++) {
  27156. c.children[h] && a.push(c.children[h])
  27157. }
  27158. var u = this.getFaceIndexFromNode(c);
  27159. (!n || n <= l) && (r && r(c, l, u),
  27160. o && o.push(c)),
  27161. 0
  27162. }
  27163. }
  27164. }
  27165. ,
  27166. f.prototype.getFaceIndexFromNode = function(e) {
  27167. if (!e)
  27168. return -1;
  27169. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27170. var o = i.parent;
  27171. if (!o)
  27172. break;
  27173. for (var a = -1, s = 0; s < o.children.length; s++)
  27174. o.children[s] === i && (a = s);
  27175. n = a % g * t + n,
  27176. r = Math.floor(a / g) * t + r,
  27177. t *= g,
  27178. i = o
  27179. }
  27180. return r * t + n
  27181. }
  27182. ,
  27183. f.prototype.depthFirst = function(e, t, i) {
  27184. !function e(t, i, n, r, o, a, s, l) {
  27185. if (t) {
  27186. s = s || f.TraversalType.PreOrder;
  27187. var c = r * g + n;
  27188. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27189. a && a.push(t)),
  27190. t.children && 0 !== t.children.length) {
  27191. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27192. for (var p = 0; p < g; p++)
  27193. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27194. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27195. a && a.push(t))
  27196. }
  27197. }
  27198. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27199. }
  27200. ,
  27201. t.exports = f
  27202. }
  27203. , {
  27204. "../objects/Panorama": 148,
  27205. "../util/panorama": 191,
  27206. "./TileUtils": 174,
  27207. events: 202,
  27208. three: 217
  27209. }],
  27210. 174: [function(e, t, i) {
  27211. "use strict";
  27212. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27213. b.TILE_SIZE = 512,
  27214. b.FACES_PER_PANO = 6,
  27215. b.LocationOnTile = {
  27216. Center: 0,
  27217. UpperLeft: 1,
  27218. UpperRight: 2,
  27219. LowerRight: 3,
  27220. LowerLeft: 4
  27221. },
  27222. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27223. var l = e / t
  27224. , c = t / e * 2
  27225. , h = c / 2
  27226. , u = n / l * 2 - 1 + h
  27227. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27228. switch (o = o || b.LocationOnTile.Center) {
  27229. case b.LocationOnTile.UpperLeft:
  27230. u -= h,
  27231. d += h,
  27232. u += a * c;
  27233. break;
  27234. case b.LocationOnTile.UpperRight:
  27235. u += h,
  27236. d += h,
  27237. d -= a * c;
  27238. break;
  27239. case b.LocationOnTile.LowerRight:
  27240. u += h,
  27241. d -= h,
  27242. u -= a * c;
  27243. break;
  27244. case b.LocationOnTile.LowerLeft:
  27245. u -= h,
  27246. d -= h,
  27247. d += a * c;
  27248. break;
  27249. case b.LocationOnTile.Center:
  27250. }
  27251. switch (i) {
  27252. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27253. _.setVector(s, -1, d, -u);
  27254. break;
  27255. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27256. _.setVector(s, 1, d, u);
  27257. break;
  27258. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27259. _.setVector(s, -u, 1, -d);
  27260. break;
  27261. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27262. _.setVector(s, -u, -1, d);
  27263. break;
  27264. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27265. _.setVector(s, -u, d, 1);
  27266. break;
  27267. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27268. _.setVector(s, u, d, -1)
  27269. }
  27270. _.normalize(s)
  27271. }
  27272. ,
  27273. b.getFaceForTile = function(e, t) {
  27274. var i = b.TILE_SIZE;
  27275. e < b.TILE_SIZE && (i = e);
  27276. var n = Math.floor(e / i)
  27277. , r = n * n;
  27278. return Math.floor(t / r)
  27279. }
  27280. ,
  27281. b.getTileLocation = function(e, t, i) {
  27282. var n = b.TILE_SIZE;
  27283. e < b.TILE_SIZE && (n = e);
  27284. var r = b.getFaceForTile(e, t)
  27285. , o = Math.floor(e / n)
  27286. , a = t - r * (o * o);
  27287. i.tileX = a % o,
  27288. i.tileY = Math.floor(a / o),
  27289. i.face = r,
  27290. i.faceTileIndex = a
  27291. }
  27292. ,
  27293. b.getTileCountForSize = function(e) {
  27294. if (e <= b.TILE_SIZE)
  27295. return b.FACES_PER_PANO;
  27296. var t = Math.floor(e / b.TILE_SIZE);
  27297. return t * t * b.FACES_PER_PANO
  27298. }
  27299. ,
  27300. b.getRelativeDirection = (r = new _.Matrix4,
  27301. o = new _.Quaternion,
  27302. function(e, t) {
  27303. o.copy(e),
  27304. o.inverse(),
  27305. r.makeRotationFromQuaternion(o),
  27306. r.applyToVector3(t),
  27307. _.normalize(t)
  27308. }
  27309. ),
  27310. b.matchingTilesInDirection = (c = new _.Vector3,
  27311. h = new _.Vector3(0,0,-1),
  27312. u = new _.Quaternion,
  27313. l = {
  27314. face: -1,
  27315. faceTileIndex: -1,
  27316. tileX: -1,
  27317. tileY: -1
  27318. },
  27319. d = function(e, t, i) {
  27320. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27321. b.getTileLocation(e, o, l),
  27322. t && !t(l) || (r++,
  27323. i && (a = l,
  27324. i.push({
  27325. face: a.face,
  27326. faceTileIndex: a.faceTileIndex,
  27327. tileX: a.tileX,
  27328. tileY: a.tileY
  27329. })));
  27330. var a;
  27331. return r
  27332. }
  27333. ,
  27334. function(e, t, i, n, r, o) {
  27335. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27336. if (b.getTileCountForSize(t),
  27337. !n && !r)
  27338. return d(t, null, o);
  27339. var s = !!r;
  27340. return r = r || n,
  27341. r = Math.max(0, Math.min(r, 360)),
  27342. n = Math.max(0, Math.min(n, 360)),
  27343. _.copyVector(i, c),
  27344. b.getRelativeDirection(e.quaternion, c),
  27345. s ? (u.setFromUnitVectors(c, h),
  27346. d(t, function(e) {
  27347. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27348. }, o)) : d(t, function(e) {
  27349. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27350. }, o)
  27351. }
  27352. ),
  27353. b.isTileWithinFrustum = (E = new _.Vector3,
  27354. function(e, t, i, n, r, o, a, s) {
  27355. 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++)
  27356. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27357. _.applyQuaternionToVector(o, E),
  27358. -1e-5 <= E.z)
  27359. ;
  27360. else {
  27361. var A = -1 / E.z
  27362. , C = E.x * A
  27363. , I = E.y * A;
  27364. l < I ? p++ : I < c && f++,
  27365. h < C ? g++ : C < u && m++,
  27366. v++
  27367. }
  27368. return f !== v && p !== v && g !== v && m !== v
  27369. }
  27370. ),
  27371. b.isTileWithinFOV = (p = new _.Vector3,
  27372. f = new _.Vector3(0,1,0),
  27373. g = new _.Vector3(1,0,0),
  27374. function(e, t, i, n, r, o, a) {
  27375. var s = b.mapFaceToCubemapFace(i);
  27376. if (_.cross(o, f, g),
  27377. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27378. b.isWithinFOV(p, o, a, null))
  27379. return !0;
  27380. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27381. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27382. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27383. b.isWithinFOV(p, o, a, null))
  27384. return !0;
  27385. h += l
  27386. }
  27387. return !1
  27388. }
  27389. ),
  27390. b.isWithinFOV = (a = new _.Vector3,
  27391. s = new _.Vector3,
  27392. function(e, t, i, n) {
  27393. if (_.copyVector(e, s),
  27394. n) {
  27395. _.copyVector(n, a),
  27396. _.normalize(a);
  27397. var r = _.dot(a, e);
  27398. a.x *= r,
  27399. a.y *= r,
  27400. a.z *= r,
  27401. _.subVector(s, a)
  27402. }
  27403. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27404. return Math.cos(o) <= _.dot(s, t)
  27405. }
  27406. ),
  27407. b.mapFaceToCubemapFace = (n = {
  27408. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27409. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27410. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27411. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27412. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27413. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27414. },
  27415. function(e) {
  27416. return n[e]
  27417. }
  27418. ),
  27419. t.exports = b
  27420. }
  27421. , {
  27422. "../enum/GLCubeFaces": 25,
  27423. "../util/MathLight": 176
  27424. }],
  27425. 175: [function(i, n, e) {
  27426. (function(e) {
  27427. "use strict";
  27428. function t() {
  27429. this.list = [],
  27430. this.index = {},
  27431. Object.defineProperty(this, "length", {
  27432. get: function() {
  27433. return this.list.length
  27434. }
  27435. })
  27436. }
  27437. new (i("./common"),
  27438. i("./logger"))(e),
  27439. t.prototype.forEach = function(e) {
  27440. this.list.forEach(e)
  27441. }
  27442. ,
  27443. t.prototype.add = function(e) {
  27444. this.list.push(e),
  27445. this.index[this.getIndex(e)] = e
  27446. }
  27447. ,
  27448. t.prototype.getIndex = function(e) {
  27449. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27450. }
  27451. ,
  27452. t.prototype.extend = function(e) {
  27453. for (var t = 0; t < e.length; t++)
  27454. this.add(e[t])
  27455. }
  27456. ,
  27457. t.prototype.get = function(e) {
  27458. return this.index[e]
  27459. }
  27460. ,
  27461. t.prototype.first = function() {
  27462. return this.list[0]
  27463. }
  27464. ,
  27465. t.prototype.last = function() {
  27466. return this.list[this.list.length - 1]
  27467. }
  27468. ,
  27469. t.prototype.reIndex = function() {
  27470. this.index = {};
  27471. var t = this;
  27472. this.forEach(function(e) {
  27473. t.index[t.getIndex(e)] = e
  27474. })
  27475. }
  27476. ,
  27477. t.prototype.filter = function(e) {
  27478. var t = this.list.filter(e);
  27479. return this.reIndex(),
  27480. t
  27481. }
  27482. ,
  27483. t.prototype.reduce = function(e, t) {
  27484. return this.list.reduce(e, t)
  27485. }
  27486. ,
  27487. t.prototype.sort = function(e) {
  27488. return this.list.sort(e)
  27489. }
  27490. ,
  27491. t.prototype.indexOf = function(e) {
  27492. for (var t = 0; t < this.list.length; ++t)
  27493. if (this.list[t] === e)
  27494. return t;
  27495. return -1
  27496. }
  27497. ,
  27498. n.exports = t
  27499. }
  27500. ).call(this, "/js/util/IndexedCollection.js")
  27501. }
  27502. , {
  27503. "./common": 185,
  27504. "./logger": 189
  27505. }],
  27506. 176: [function(e, t, i) {
  27507. "use strict";
  27508. e("../constants");
  27509. var n, r, o = {};
  27510. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27511. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27512. o.Vector3 = function(e, t, i) {
  27513. this.x = e || 0,
  27514. this.y = t || 0,
  27515. this.z = i || 0
  27516. }
  27517. ,
  27518. o.Matrix4 = function() {
  27519. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27520. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27521. }
  27522. ,
  27523. o.Matrix4.prototype = {
  27524. identity: function() {
  27525. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27526. this
  27527. },
  27528. copy: function(e) {
  27529. return this.elements.set(e.elements),
  27530. this
  27531. },
  27532. applyToVector3: function(e) {
  27533. var t = e.x
  27534. , i = e.y
  27535. , n = e.z
  27536. , r = this.elements;
  27537. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27538. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27539. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27540. this
  27541. },
  27542. getInverse: function(e, t) {
  27543. var i = this.elements
  27544. , n = e.elements
  27545. , r = n[0]
  27546. , o = n[1]
  27547. , a = n[2]
  27548. , s = n[3]
  27549. , l = n[4]
  27550. , c = n[5]
  27551. , h = n[6]
  27552. , u = n[7]
  27553. , d = n[8]
  27554. , p = n[9]
  27555. , f = n[10]
  27556. , g = n[11]
  27557. , m = n[12]
  27558. , v = n[13]
  27559. , y = n[14]
  27560. , A = n[15]
  27561. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27562. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27563. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27564. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27565. , b = r * C + o * I + a * E + s * _;
  27566. if (0 == b) {
  27567. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27568. if (t)
  27569. throw new Error(w);
  27570. return console.warn(w),
  27571. this.identity()
  27572. }
  27573. var T = 1 / b;
  27574. return i[0] = C * T,
  27575. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27576. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27577. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27578. i[4] = I * T,
  27579. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27580. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27581. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27582. i[8] = E * T,
  27583. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27584. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27585. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27586. i[12] = _ * T,
  27587. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27588. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27589. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27590. this
  27591. },
  27592. makeRotationFromQuaternion: function(e) {
  27593. var t = this.elements
  27594. , i = e.x
  27595. , n = e.y
  27596. , r = e.z
  27597. , o = e.w
  27598. , a = i + i
  27599. , s = n + n
  27600. , l = r + r
  27601. , c = i * a
  27602. , h = i * s
  27603. , u = i * l
  27604. , d = n * s
  27605. , p = n * l
  27606. , f = r * l
  27607. , g = o * a
  27608. , m = o * s
  27609. , v = o * l;
  27610. return t[0] = 1 - (d + f),
  27611. t[4] = h - v,
  27612. t[8] = u + m,
  27613. t[1] = h + v,
  27614. t[5] = 1 - (c + f),
  27615. t[9] = p - g,
  27616. t[2] = u - m,
  27617. t[6] = p + g,
  27618. t[10] = 1 - (c + d),
  27619. t[3] = 0,
  27620. t[7] = 0,
  27621. t[11] = 0,
  27622. t[12] = 0,
  27623. t[13] = 0,
  27624. t[14] = 0,
  27625. t[15] = 1,
  27626. this
  27627. }
  27628. },
  27629. o.Quaternion = function(e, t, i, n) {
  27630. this._x = e || 0,
  27631. this._y = t || 0,
  27632. this._z = i || 0,
  27633. this._w = void 0 !== n ? n : 1
  27634. }
  27635. ,
  27636. o.Quaternion.prototype = {
  27637. get x() {
  27638. return this._x
  27639. },
  27640. set x(e) {
  27641. this._x = e
  27642. },
  27643. get y() {
  27644. return this._y
  27645. },
  27646. set y(e) {
  27647. this._y = e
  27648. },
  27649. get z() {
  27650. return this._z
  27651. },
  27652. set z(e) {
  27653. this._z = e
  27654. },
  27655. get w() {
  27656. return this._w
  27657. },
  27658. set w(e) {
  27659. this._w = e
  27660. },
  27661. copy: function(e) {
  27662. this._x = e.x,
  27663. this._y = e.y,
  27664. this._z = e.z,
  27665. this._w = e.w
  27666. },
  27667. inverse: function() {
  27668. return this.conjugate().normalize()
  27669. },
  27670. conjugate: function() {
  27671. return this._x *= -1,
  27672. this._y *= -1,
  27673. this._z *= -1,
  27674. this
  27675. },
  27676. length: function() {
  27677. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27678. },
  27679. normalize: function() {
  27680. var e = this.length();
  27681. return 0 === e ? (this._x = 0,
  27682. this._y = 0,
  27683. this._z = 0,
  27684. this._w = 1) : (e = 1 / e,
  27685. this._x = this._x * e,
  27686. this._y = this._y * e,
  27687. this._z = this._z * e,
  27688. this._w = this._w * e),
  27689. this
  27690. },
  27691. setFromAxisAngle: function(e, t) {
  27692. var i = t / 2
  27693. , n = Math.sin(i);
  27694. return this._x = e.x * n,
  27695. this._y = e.y * n,
  27696. this._z = e.z * n,
  27697. this._w = Math.cos(i),
  27698. this
  27699. },
  27700. setFromUnitVectors: function(e, t) {
  27701. return void 0 === n && (n = new o.Vector3),
  27702. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27703. 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),
  27704. this._x = n.x,
  27705. this._y = n.y,
  27706. this._z = n.z,
  27707. this._w = r,
  27708. this.normalize()
  27709. },
  27710. multiply: function(e) {
  27711. return this.multiplyQuaternions(this, e)
  27712. },
  27713. premultiply: function(e) {
  27714. return this.multiplyQuaternions(e, this)
  27715. },
  27716. multiplyQuaternions: function(e, t) {
  27717. var i = e._x
  27718. , n = e._y
  27719. , r = e._z
  27720. , o = e._w
  27721. , a = t._x
  27722. , s = t._y
  27723. , l = t._z
  27724. , c = t._w;
  27725. return this._x = i * c + o * a + n * l - r * s,
  27726. this._y = n * c + o * s + r * a - i * l,
  27727. this._z = r * c + o * l + i * s - n * a,
  27728. this._w = o * c - i * a - n * s - r * l,
  27729. this
  27730. }
  27731. },
  27732. o.convertWorkshopVector = function(e) {
  27733. return new o.Vector3(-e.x,e.y,e.z)
  27734. }
  27735. ,
  27736. o.convertWorkshopQuaternion = function(e) {
  27737. 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))
  27738. }
  27739. ,
  27740. o.convertWorkshopOrthoZoom = function(e) {
  27741. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27742. }
  27743. ,
  27744. o.convertWorkshopPanoramaQuaternion = function(e) {
  27745. 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))
  27746. }
  27747. ,
  27748. o.normalize = function(e) {
  27749. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27750. , i = Math.sqrt(t);
  27751. e.x /= i,
  27752. e.y /= i,
  27753. e.z /= i
  27754. }
  27755. ,
  27756. o.dot = function(e, t) {
  27757. return e.x * t.x + e.y * t.y + e.z * t.z
  27758. }
  27759. ,
  27760. o.cross = function(e, t, i) {
  27761. var n = e.x
  27762. , r = e.y
  27763. , o = e.z;
  27764. i.x = r * t.z - o * t.y,
  27765. i.y = o * t.x - n * t.z,
  27766. i.z = n * t.y - r * t.x
  27767. }
  27768. ,
  27769. o.setVector = function(e, t, i, n) {
  27770. e.x = t,
  27771. e.y = i,
  27772. e.z = n
  27773. }
  27774. ,
  27775. o.copyVector = function(e, t) {
  27776. t.x = e.x,
  27777. t.y = e.y,
  27778. t.z = e.z
  27779. }
  27780. ,
  27781. o.addVector = function(e, t) {
  27782. e.x += t.x,
  27783. e.y += t.y,
  27784. e.z += t.z
  27785. }
  27786. ,
  27787. o.subVector = function(e, t) {
  27788. e.x -= t.x,
  27789. e.y -= t.y,
  27790. e.z -= t.z
  27791. }
  27792. ,
  27793. o.applyQuaternionToVector = function(e, t) {
  27794. var i = t.x
  27795. , n = t.y
  27796. , r = t.z
  27797. , o = e.x
  27798. , a = e.y
  27799. , s = e.z
  27800. , l = e.w
  27801. , c = l * i + a * r - s * n
  27802. , h = l * n + s * i - o * r
  27803. , u = l * r + o * n - a * i
  27804. , d = -o * i - a * n - s * r;
  27805. t.x = c * l + d * -o + h * -s - u * -a,
  27806. t.y = h * l + d * -a + u * -o - c * -s,
  27807. t.z = u * l + d * -s + c * -a - h * -o
  27808. }
  27809. ,
  27810. o.angleBetweenVectors = function(e, t) {
  27811. return Math.acos(o.dot(e, t))
  27812. }
  27813. ,
  27814. t.exports = o
  27815. }
  27816. , {
  27817. "../constants": 8
  27818. }],
  27819. 177: [function(c, h, e) {
  27820. (function(e) {
  27821. "use strict";
  27822. function t(e) {
  27823. this.cache = null,
  27824. this.expires = 0
  27825. }
  27826. function i() {
  27827. this.baseUrl = null,
  27828. this.cache = null,
  27829. this.expires = 0
  27830. }
  27831. function n() {
  27832. this.baseUrl = null,
  27833. this.expires = 0
  27834. }
  27835. function r(e) {
  27836. this.initialLoadingPromise = null,
  27837. this.endpoint = e + "?type=3",
  27838. this.urlContainer = null,
  27839. this.authorizationHeader = s.getAuthorizationHeader(),
  27840. this.containerClasses = [n, i, t]
  27841. }
  27842. c("./ajax");
  27843. var o = c("./logger")
  27844. , a = c("../constants")
  27845. , s = c("./showcase")
  27846. , l = (c("../ab"),
  27847. new o(e));
  27848. t.prototype = {
  27849. version: 1,
  27850. validate: function(e) {
  27851. return "catalog.json"in e && 0 < Object.keys(e).length
  27852. },
  27853. update: function(e) {
  27854. return this.cache = e,
  27855. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27856. $.when()
  27857. },
  27858. get: function(e) {
  27859. return this.cache[e]
  27860. }
  27861. },
  27862. i.prototype = {
  27863. version: 2,
  27864. validate: function(e) {
  27865. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27866. },
  27867. update: function(e) {
  27868. return this.baseUrl = e["base.url"],
  27869. this.cache = e,
  27870. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27871. $.when()
  27872. },
  27873. get: function(e) {
  27874. var t = this.cache[e];
  27875. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27876. }
  27877. },
  27878. n.prototype = {
  27879. version: 3,
  27880. validate: function(e) {
  27881. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27882. },
  27883. update: function(e) {
  27884. return this.baseUrl = e.templates[0],
  27885. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27886. $.when()
  27887. },
  27888. get: function(e) {
  27889. return this.baseUrl.replace("{{filename}}", e)
  27890. }
  27891. },
  27892. r.prototype = {
  27893. init: function() {
  27894. return this.initialLoadingPromise || (setInterval(function() {
  27895. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27896. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27897. this.refresh().done(function() {
  27898. l.debug("Refreshed")
  27899. }).fail(function() {
  27900. l.error("Failed url refresh, urls might go stale soon")
  27901. }))
  27902. }
  27903. .bind(this), a.signedUrlCheckInterval),
  27904. this.initialLoadingPromise = this.refresh()),
  27905. this.initialLoadingPromise
  27906. },
  27907. refresh: function(e) {
  27908. return {},
  27909. $.Deferred().resolve()
  27910. },
  27911. get: function(e) {
  27912. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27913. }
  27914. },
  27915. h.exports = r
  27916. }
  27917. ).call(this, "/js/util/ModelUrls.js")
  27918. }
  27919. , {
  27920. "../ab": 3,
  27921. "../constants": 8,
  27922. "./ajax": 181,
  27923. "./logger": 189,
  27924. "./showcase": 193
  27925. }],
  27926. 178: [function(l, c, e) {
  27927. (function(e) {
  27928. "use strict";
  27929. function t() {
  27930. i.call(this),
  27931. this.neighbourMap = {},
  27932. this.map = null
  27933. }
  27934. 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"),
  27935. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27936. n.inherit(t, i),
  27937. t.prototype.getIndex = function(e) {
  27938. return e.id
  27939. }
  27940. ,
  27941. t.prototype.find = function(e, t) {
  27942. var i = n.filterAll(this.list, e);
  27943. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27944. i = n.stableSort(i, e)
  27945. }),
  27946. i[0])
  27947. }
  27948. ,
  27949. t.prototype.sortByScore = function(e, t) {
  27950. var i = n.filterAll(this.list, e);
  27951. return 0 === i.length ? null : i = i.map(function(i) {
  27952. return {
  27953. pano: i,
  27954. score: t.reduce(function(e, t) {
  27955. return e + t(i)
  27956. }, 0)
  27957. }
  27958. }).sort(function(e, t) {
  27959. return t.score - e.score
  27960. })
  27961. }
  27962. ,
  27963. t.prototype.lowestByScore = function(e, t, i) {
  27964. return this.findRankedByScore(0, e, t, i)
  27965. }
  27966. ,
  27967. t.prototype.findRankedByScore = function(e, t, i, n) {
  27968. n && (n.candidates = null,
  27969. n.pano = null),
  27970. e = e || 0;
  27971. var r = this.sortByScore(t, i);
  27972. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27973. n.pano = r[e].pano),
  27974. r[e].pano)
  27975. }
  27976. ,
  27977. t.prototype.showPanoScores = function(e) {
  27978. this.list.forEach(function(e) {
  27979. e.removeTextSprite()
  27980. });
  27981. var t = 6344768;
  27982. e.forEach(function(e) {
  27983. e.pano.addTextSprite(e.score.toFixed(2), t),
  27984. t = 16428055
  27985. })
  27986. }
  27987. ,
  27988. t.prototype.isNeighbour = function(e, t) {
  27989. return this.neighbourMap[e.id][t.id]
  27990. }
  27991. ,
  27992. t.prototype.getNeighbours = function(e) {
  27993. return this.neighbourMap[e.id]
  27994. }
  27995. ,
  27996. t.prototype.setNeighbour = function(e, t, i) {
  27997. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27998. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27999. this.neighbourMap[e.id][e.id] = !0,
  28000. this.neighbourMap[t.id][t.id] = !0,
  28001. this.neighbourMap[e.id][t.id] = i,
  28002. this.neighbourMap[t.id][e.id] = i,
  28003. this.neighbourMap[e.id]
  28004. }
  28005. ,
  28006. t.prototype.findClosest = function(e, t) {
  28007. var i = [r.filters.isPanoAligned()];
  28008. return t && i.push(r.filters.inDirection(e, t, .75)),
  28009. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28010. }
  28011. ,
  28012. t.prototype.dualNeighbors = function(e, t) {
  28013. var i, n = [];
  28014. for (i in this.neighbourMap[e.id])
  28015. this.neighbourMap[t.id][i] && n.push(i);
  28016. return n
  28017. }
  28018. ,
  28019. t.prototype.populate_path_graph = function() {
  28020. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28021. for (e = 0; e < this.list.length; e += 1) {
  28022. for (t in s = !(a = {}),
  28023. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28024. if (i[t]) {
  28025. o = this.index[t],
  28026. u.copy(r.floorPosition),
  28027. u.sub(o.floorPosition);
  28028. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28029. , p = (Math.abs(u.y),
  28030. Math.max(d, .01),
  28031. Math.max(0, Math.abs(u.y) - .2));
  28032. n = 0 < p ? (1,
  28033. p = Math.pow(4 * p, 2),
  28034. d = Math.pow(d, 2),
  28035. Math.sqrt(p * p + d * d)) : (1,
  28036. u.length()),
  28037. a[o.id] = n,
  28038. s = !0
  28039. }
  28040. s ? c[r.id] = a : h += 1
  28041. }
  28042. this.map = c,
  28043. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28044. }
  28045. ,
  28046. t.prototype.aStarSearch = function(e, t) {
  28047. var i = Date.now()
  28048. , n = new o({
  28049. start: e,
  28050. isEnd: function(e) {
  28051. return e === t
  28052. },
  28053. neighbor: function(e) {
  28054. var t = e.neighbourPanos || e.findNeighourPanos()
  28055. , i = [];
  28056. for (var n in t)
  28057. i.push(this.index[n]);
  28058. return i
  28059. }
  28060. .bind(this),
  28061. distance: function(e, t) {
  28062. return this.map[e.id][t.id]
  28063. }
  28064. .bind(this),
  28065. heuristic: function(e, t) {
  28066. return 1
  28067. }
  28068. .bind(this),
  28069. hash: function(e) {
  28070. return e.id
  28071. },
  28072. timeout: 5e3
  28073. });
  28074. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28075. "success" !== n.status)
  28076. return T.debug("Did not find A* path from " + e + " to " + t),
  28077. null;
  28078. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28079. var r = [];
  28080. return n.path.forEach(function(e) {
  28081. r.push(e.id)
  28082. }),
  28083. r
  28084. }
  28085. ,
  28086. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28087. g = new w.Vector3,
  28088. m = new w.Vector3,
  28089. v = new w.Vector3,
  28090. y = new w.Vector3,
  28091. A = new w.Vector3,
  28092. C = new w.Vector3,
  28093. I = new w.Vector3,
  28094. E = [],
  28095. _ = new w.Vector3,
  28096. b = new w.Vector3,
  28097. function(e, t) {
  28098. if (e)
  28099. for (var i = function(e, t, i) {
  28100. return y.copy(t).sub(e),
  28101. y.dot(i)
  28102. }, n = function(e, t) {
  28103. return i(_, e.position, m) - i(_, t.position, m)
  28104. }, r = 0; r < e.length - 1; ) {
  28105. var o = e[r]
  28106. , a = e[r + 1]
  28107. , s = this.index[o]
  28108. , l = this.index[a];
  28109. _.copy(s.position),
  28110. b.copy(l.position),
  28111. E.length = 0,
  28112. f.copy(b).sub(_),
  28113. m.copy(f).normalize();
  28114. for (var c = 0; c < this.list.length; c++) {
  28115. var h = this.list[c];
  28116. y.copy(h.position).sub(_);
  28117. var u = y.dot(m);
  28118. 0 < u && (C.copy(m),
  28119. C.multiplyScalar(u),
  28120. A.copy(y),
  28121. A.sub(C),
  28122. A.length() < t && (g.copy(f).negate(),
  28123. v.copy(g).normalize(),
  28124. I.copy(h.position).sub(b),
  28125. 0 < I.dot(v) && E.push(h)))
  28126. }
  28127. if (0 < E.length) {
  28128. E.sort(n);
  28129. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28130. e[d] = e[d - E.length];
  28131. for (var p = 0; p < E.length; p++)
  28132. e[p + r + 1] = E[p].id
  28133. }
  28134. r += E.length + 1
  28135. }
  28136. }
  28137. ),
  28138. t.prototype.fadeMarkerOpacity = function(e, t) {
  28139. var i = void 0 === e ? a.panorama.markerOpacity : e
  28140. , n = this.list.findIndex(function(e) {
  28141. return e.marker
  28142. });
  28143. if (!(n < 0)) {
  28144. var r = this.list[n].marker.material.opacity;
  28145. if (r !== e) {
  28146. var o = i - r;
  28147. s.trigger({
  28148. func: function(e, t) {
  28149. var i = r + e * o;
  28150. this.forEach(function(e) {
  28151. e.marker && (e.marker.material.opacity = i)
  28152. })
  28153. }
  28154. .bind(this),
  28155. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28156. name: "_fpm"
  28157. })
  28158. }
  28159. }
  28160. }
  28161. ,
  28162. c.exports = t
  28163. }
  28164. ).call(this, "/js/util/PanoramaCollection.js")
  28165. }
  28166. , {
  28167. "../objects/Panorama": 148,
  28168. "../settings": 166,
  28169. "./IndexedCollection": 175,
  28170. "./aStar": 180,
  28171. "./common": 185,
  28172. "./logger": 189,
  28173. "./transitions": 195,
  28174. three: 217
  28175. }],
  28176. 179: [function(e, t, i) {
  28177. "use strict";
  28178. function n() {
  28179. this.actionSequence = [],
  28180. this.actionSequenceInProgress = !1
  28181. }
  28182. function r(e, t, i, n) {
  28183. c.trackAlways("zoom_" + e, {
  28184. from: t,
  28185. to: i,
  28186. pano: n
  28187. })
  28188. }
  28189. var o, a, s, l, c = e("../analytics");
  28190. n.prototype.reset = function(e) {
  28191. this.actionSequenceInProgress = !1,
  28192. this.actionSequence.length = 0
  28193. }
  28194. ,
  28195. n.prototype.addZoomAction = (a = o = null,
  28196. s = !1,
  28197. l = function() {
  28198. if (o = null,
  28199. 0 < this.actionSequence.length) {
  28200. var e = this.actionSequence[0].start
  28201. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28202. 1 === e ? function(e, t) {
  28203. r("initial", 1, e, t)
  28204. }(t, a) : function(e, t, i) {
  28205. r("followup", e, t, i)
  28206. }(e, t, a)
  28207. }
  28208. this.reset()
  28209. }
  28210. ,
  28211. function(e, t, i) {
  28212. if (e !== t) {
  28213. s || (l = l.bind(this),
  28214. s = !0),
  28215. o && (window.clearTimeout(o),
  28216. o = null),
  28217. i === a && this.actionSequenceInProgress || (this.reset(),
  28218. a = i),
  28219. this.actionSequenceInProgress = !0;
  28220. var n = {
  28221. start: e,
  28222. end: t
  28223. };
  28224. this.actionSequence.push(n),
  28225. o = window.setTimeout(l, 150)
  28226. }
  28227. }
  28228. ),
  28229. t.exports = n
  28230. }
  28231. , {
  28232. "../analytics": 4
  28233. }],
  28234. 180: [function(e, t, i) {
  28235. "use strict";
  28236. function g(e) {
  28237. if (void 0 === e.parent)
  28238. return [e.data];
  28239. var t = g(e.parent);
  28240. return t.push(e.data),
  28241. t
  28242. }
  28243. function m(e) {
  28244. return e.toString()
  28245. }
  28246. function v(e, t) {
  28247. return e.f - t.f
  28248. }
  28249. var y = e("Set")
  28250. , A = e("heap")
  28251. , C = e("dict");
  28252. t.exports = function(e) {
  28253. void 0 === e.timeout && (e.timeout = 1 / 0);
  28254. var t = e.hash || m
  28255. , i = {
  28256. data: e.start,
  28257. g: 0,
  28258. h: e.heuristic(e.start)
  28259. }
  28260. , n = i;
  28261. i.f = i.h;
  28262. var r = new y
  28263. , o = new A(v)
  28264. , a = C();
  28265. o.push(i),
  28266. a.set(t(i.data), i);
  28267. for (var s = new Date; o.size(); ) {
  28268. if (new Date - s > e.timeout)
  28269. return {
  28270. status: "timeout",
  28271. cost: n.g,
  28272. path: g(n)
  28273. };
  28274. var l = o.pop();
  28275. if (a.delete(t(l.data)),
  28276. e.isEnd(l.data))
  28277. return {
  28278. status: "success",
  28279. cost: l.g,
  28280. path: g(l)
  28281. };
  28282. r.add(t(l.data));
  28283. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28284. var u = c[h];
  28285. if (!r.contains(t(u))) {
  28286. var d = l.g + e.distance(l.data, u)
  28287. , p = a.get(t(u))
  28288. , f = !1;
  28289. if (void 0 === p)
  28290. p = {
  28291. data: u
  28292. },
  28293. a.set(t(u), p);
  28294. else {
  28295. if (p.g < d)
  28296. continue;
  28297. f = !0
  28298. }
  28299. p.parent = l,
  28300. p.g = d,
  28301. p.h = e.heuristic(u),
  28302. p.f = d + p.h,
  28303. p.h < n.h && (n = p),
  28304. f ? o.heapify() : o.push(p)
  28305. }
  28306. }
  28307. }
  28308. return {
  28309. status: "noPath",
  28310. cost: n.g,
  28311. path: g(n)
  28312. }
  28313. }
  28314. }
  28315. , {
  28316. Set: 196,
  28317. dict: 210,
  28318. heap: 211
  28319. }],
  28320. 181: [function(i, n, e) {
  28321. (function(e) {
  28322. "use strict";
  28323. function s(e, t, i) {
  28324. function n() {
  28325. l.warn("Retrying ", t),
  28326. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28327. }
  28328. var r = function(e, t, i) {
  28329. var n = new XMLHttpRequest;
  28330. if (i && "withCredentials"in n)
  28331. n.open(e, t, i);
  28332. else if ("undefined" != typeof XDomainRequest)
  28333. (n = new XDomainRequest).open(e, t);
  28334. else {
  28335. if (i)
  28336. throw "Browser does not support CORS!";
  28337. n.open(e, t)
  28338. }
  28339. return n
  28340. }(e, t, !1);
  28341. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28342. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28343. i.responseType)
  28344. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28345. r.responseType = i.responseType;
  28346. else {
  28347. if ("image/jpeg" !== i.responseType)
  28348. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28349. r.responseType = "arraybuffer"
  28350. }
  28351. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28352. i.auth && r.setRequestHeader("Authorization", i.auth),
  28353. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28354. r.setRequestHeader("Content-Type", "application/json")),
  28355. "object" == typeof i.headers)
  28356. for (var o in i.headers)
  28357. r.setRequestHeader(o, i.headers[o]);
  28358. var a = $.Deferred();
  28359. return r.onreadystatechange = function(e) {
  28360. if (4 === this.readyState)
  28361. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28362. i.retries++,
  28363. setTimeout(n, 1e3);
  28364. else if (200 === this.status) {
  28365. var t = function(e, t) {
  28366. var i = e.response;
  28367. if ("json" === t && "object" != typeof i)
  28368. try {
  28369. i = JSON.parse(e.responseText)
  28370. } catch (e) {
  28371. return void a.reject({
  28372. error: "Failed parsing JSON"
  28373. })
  28374. }
  28375. else if ("image/jpeg" === t) {
  28376. var n = new Uint8Array(e.response)
  28377. , r = new Blob([n],{
  28378. type: "image/jpeg"
  28379. })
  28380. , o = URL.createObjectURL(r);
  28381. (i = new Image).src = o,
  28382. i.crossOrigin = "Anonymous",
  28383. i.onload = function() {
  28384. URL.revokeObjectURL(o)
  28385. }
  28386. }
  28387. return i
  28388. }(this, i.responseType);
  28389. a.resolve(t)
  28390. } else
  28391. a.reject(this)
  28392. }
  28393. ,
  28394. r.onprogress = function(e) {
  28395. a.notify(e)
  28396. }
  28397. ,
  28398. r.send(i.data),
  28399. a.promise()
  28400. }
  28401. function o(e, t) {
  28402. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28403. return t.headers && function(t) {
  28404. return Object.keys(t).sort().map(function(e) {
  28405. return {
  28406. key: e,
  28407. value: t[e]
  28408. }
  28409. })
  28410. }(t.headers).forEach(function(e) {
  28411. i += "__" + e.key + ":" + e.value
  28412. }),
  28413. i
  28414. }
  28415. var t = i("./logger")
  28416. , a = i("../ab")
  28417. , l = new t(e);
  28418. window.URL = window.URL || window.webkitURL,
  28419. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28420. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28421. n.exports = {
  28422. get: function(e, t) {
  28423. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28424. if (n) {
  28425. var r = function(e, t) {
  28426. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28427. }(e, t);
  28428. if (r)
  28429. return r
  28430. }
  28431. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28432. n && function(e, t, i) {
  28433. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28434. }(e, t, i),
  28435. i
  28436. },
  28437. post: function(e, t) {
  28438. return s("POST", e, t)
  28439. },
  28440. patch: function(e, t) {
  28441. return s("PATCH", e, t)
  28442. },
  28443. getImage: function(e, t) {
  28444. function i() {
  28445. l.warn("Retrying ", e),
  28446. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28447. }
  28448. var n = $.Deferred()
  28449. , r = new Image
  28450. , o = this;
  28451. return e = a.changeIfImageOptimzing(e),
  28452. null != t || (t = 3),
  28453. r.onerror = function() {
  28454. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28455. }
  28456. ,
  28457. r.onload = function() {
  28458. n.resolve(r)
  28459. }
  28460. ,
  28461. r.crossOrigin = "anonymous",
  28462. r.src = e,
  28463. n
  28464. }
  28465. }
  28466. }
  28467. ).call(this, "/js/util/ajax.js")
  28468. }
  28469. , {
  28470. "../ab": 3,
  28471. "./logger": 189
  28472. }],
  28473. 182: [function(e, t, i) {
  28474. "use strict";
  28475. function n(e, t) {
  28476. var i = window.navigator.userAgent.match(e);
  28477. return i = i ? i[1].split(t) : [],
  28478. {
  28479. major: parseInt(i[0]) || 0,
  28480. minor: parseInt(i[1]) || 0,
  28481. patch: parseInt(i[2]) || 0
  28482. }
  28483. }
  28484. var r = e("../exception/DeviceMismatchException");
  28485. t.exports = {
  28486. isFullscreen: function() {
  28487. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28488. },
  28489. supportsFullscreen: function() {
  28490. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28491. },
  28492. isPointerLocked: function() {
  28493. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28494. },
  28495. requestFullscreen: function(e, t) {
  28496. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28497. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28498. },
  28499. requestPointerLock: function() {
  28500. var e;
  28501. if (document.fullscreenElement)
  28502. e = document.fullscreenElement();
  28503. else if (document.mozFullscreenElement)
  28504. e = document.mozFullscreenElement();
  28505. else if (document.mozFullScreenElement)
  28506. e = document.mozFullScreenElement();
  28507. else {
  28508. if (!document.webkitFullscreenElement)
  28509. return;
  28510. e = document.webkitFullscreenElement()
  28511. }
  28512. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28513. e.requestPointerLock(),
  28514. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28515. },
  28516. exitPointerLock: function() {
  28517. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28518. document.exitPointerLock()
  28519. },
  28520. exitFullscreen: function() {
  28521. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28522. },
  28523. details: function() {
  28524. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28525. return e ? {
  28526. name: e[1],
  28527. version: parseInt(e[2]),
  28528. platform: navigator.platform
  28529. } : {}
  28530. },
  28531. is: function(e) {
  28532. return this.details() && this.details().name === e
  28533. },
  28534. inIframe: function() {
  28535. return window.parent !== window
  28536. },
  28537. aspectRatio: function() {
  28538. var e = $("#player").width() / $("#player").height();
  28539. return isFinite(e) ? e : 0
  28540. },
  28541. userAgent: function() {
  28542. return window.navigator.userAgent
  28543. },
  28544. isMobile: function() {
  28545. var e = navigator.userAgent || navigator.vendor || window.opera;
  28546. 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))
  28547. },
  28548. isLandscape: function() {
  28549. return this.isMobile && 1 < this.aspectRatio()
  28550. },
  28551. isSmallScreen: function() {
  28552. return screen.width / window.devicePixelRatio < 240
  28553. },
  28554. detectIE: function() {
  28555. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28556. },
  28557. detectSafari: function() {
  28558. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28559. },
  28560. detectFirefox: function() {
  28561. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28562. },
  28563. detectChrome: function() {
  28564. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28565. },
  28566. detectOpera: function() {
  28567. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28568. },
  28569. detectIOS: function() {
  28570. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28571. },
  28572. detectIPad: function() {
  28573. var e = window.navigator.userAgent;
  28574. return /iPad/.test(e)
  28575. },
  28576. detectIPod: function() {
  28577. var e = window.navigator.userAgent;
  28578. return /iPod/.test(e)
  28579. },
  28580. detectIPhone: function() {
  28581. var e = window.navigator.userAgent;
  28582. return /iPhone/.test(e)
  28583. },
  28584. detectAndroid: function() {
  28585. return -1 !== window.navigator.userAgent.indexOf("Android")
  28586. },
  28587. detectAndroidMobile: function() {
  28588. var e = window.navigator.userAgent;
  28589. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28590. },
  28591. detectSamsungNative: function() {
  28592. var e = window.navigator.userAgent;
  28593. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28594. },
  28595. detectSamsungS6: function() {
  28596. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28597. },
  28598. detectHUAWEI5X: function() {
  28599. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28600. },
  28601. detectWebVR: function() {
  28602. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28603. },
  28604. getVRDisplay: function() {
  28605. var t = $.Deferred();
  28606. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28607. 1 <= e.length && t.resolve(e[0]),
  28608. t.reject(null)
  28609. }),
  28610. t) : t.reject(null)
  28611. },
  28612. iosVersion: function() {
  28613. if (!this.detectIOS())
  28614. throw new r("Did not detect an iDevice");
  28615. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28616. },
  28617. androidVersion: function() {
  28618. if (!this.detectAndroid())
  28619. throw new r("Did not detect an Android based device");
  28620. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28621. },
  28622. valueFromCookie: function(e, t) {
  28623. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28624. if (!i)
  28625. return t;
  28626. var n = i[1];
  28627. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28628. },
  28629. valueFromHash: function(e, t) {
  28630. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28631. if (!i)
  28632. return t;
  28633. var n = i[1];
  28634. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28635. }
  28636. }
  28637. }
  28638. , {
  28639. "../exception/DeviceMismatchException": 56
  28640. }],
  28641. 183: [function(i, n, e) {
  28642. (function(e) {
  28643. "use strict";
  28644. var o = i("../controls/serializer")
  28645. , a = i("../util/math")
  28646. , s = i("./browser")
  28647. , l = i("../enum/Viewmode")
  28648. , t = i("../util/logger")
  28649. , c = i("three")
  28650. , h = new t(e);
  28651. n.exports = {
  28652. getStartCameraOptions: function(e, t) {
  28653. var i = function(e) {
  28654. var t = s.valueFromHash("start", "")
  28655. , i = {};
  28656. if ("" !== t) {
  28657. h.debug("Start override found in parameters, trying to parse..."),
  28658. i = function(e) {
  28659. return o.deserialize(e)
  28660. }(t) || {};
  28661. var n = s.valueFromHash("tag", null);
  28662. n && (i.tag = n),
  28663. i.panoId && (i.pano = e.get(i.panoId))
  28664. }
  28665. return i
  28666. }(t);
  28667. if (0 < Object.keys(i).length)
  28668. return i;
  28669. if (e.heroImage)
  28670. i = function(e, t) {
  28671. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28672. return {};
  28673. var i = {}
  28674. , n = e.heroImage.metadata;
  28675. h.debug("Using start position from thumbnail image"),
  28676. i.position = n.camera_position,
  28677. i.quaternion = n.camera_quaternion;
  28678. try {
  28679. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28680. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28681. } catch (e) {
  28682. h.debug(e.message)
  28683. }
  28684. return i
  28685. }(e, t);
  28686. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28687. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28688. try {
  28689. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28690. i.position = (new c.Vector3).fromArray(n.camera.position),
  28691. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28692. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28693. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28694. h.debug("Using camera_start"),
  28695. h.debug("Modeldata pano: ", i.pano.quaternion),
  28696. h.debug("Camera start pano: ", n.pano.quaternion)),
  28697. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28698. } catch (e) {
  28699. h.warn(e.message)
  28700. if(i.mode == "panorama" && !i.pano){
  28701. i.pano = t.list[0]
  28702. }
  28703. }
  28704. }
  28705. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28706. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28707. i.pano = t.findClosest(i.position) ,
  28708. i.quaternion = i.pano.quaternion),
  28709. 0 === Object.keys(i).length) {
  28710. var r = t.list[0];
  28711. r && (i.mode = l.PANORAMA,
  28712. i.pano = r,
  28713. i.position = r.position,
  28714. i.quaternion = r.quaternion,
  28715. h.info("Starting at 1st pano " + r.id))
  28716. }
  28717. return i.mode = i.mode || l.DOLLHOUSE,
  28718. i
  28719. }
  28720. }
  28721. }
  28722. ).call(this, "/js/util/camera.js")
  28723. }
  28724. , {
  28725. "../controls/serializer": 14,
  28726. "../enum/Viewmode": 51,
  28727. "../util/logger": 189,
  28728. "../util/math": 190,
  28729. "./browser": 182,
  28730. three: 217
  28731. }],
  28732. 184: [function(e, t, i) {
  28733. "use strict";
  28734. function r(e, t, i) {
  28735. var n = t
  28736. , r = i;
  28737. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28738. }
  28739. function o(e, t, i) {
  28740. var n = t
  28741. , r = i;
  28742. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28743. }
  28744. var a = e("./MathLight");
  28745. t.exports = {
  28746. clampVFOV: function(e, t, i, n) {
  28747. return t < r(e, i, n) ? o(t, i, n) : e
  28748. },
  28749. getHFOVForCamera: function(e, t, i) {
  28750. return r(e.fov, t, i)
  28751. },
  28752. getHFOVFromVFOV: r,
  28753. getVFOVFromHFOV: o
  28754. }
  28755. window.MathLight = t.exports
  28756. }
  28757. , {
  28758. "./MathLight": 176
  28759. }],
  28760. 185: [function(e, t, i) {
  28761. "use strict";
  28762. var a = e("three");
  28763. t.exports = {
  28764. delayOneFrame: function(e) {
  28765. window.setTimeout(e, 1)
  28766. },
  28767. normalizeUrl: function(e) {
  28768. return e.replace("https://", "http://")
  28769. },
  28770. domainFromUrl: function(e) {
  28771. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28772. return t ? t[3] : e
  28773. },
  28774. average: function(e, t) {
  28775. if (0 === e.length)
  28776. return null;
  28777. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28778. i += t ? e[r][t] : e[r],
  28779. n++
  28780. }
  28781. return i / n
  28782. },
  28783. countUnique: function(e) {
  28784. for (var t = {}, i = 0; i < e.length; i++)
  28785. t[e[i]] = 1 + (t[e[i]] || 0);
  28786. return Object.keys(t).length
  28787. },
  28788. averageVectors: function(e, t) {
  28789. var i = new a.Vector3;
  28790. if (0 === e.length)
  28791. return i;
  28792. for (var n = 0, r = 0; r < e.length; r++) {
  28793. var o = t ? e[r][t] : e[r];
  28794. i.add(o),
  28795. n++
  28796. }
  28797. return i.divideScalar(n)
  28798. },
  28799. equalLists: function(e, t) {
  28800. if (e.length !== t.length)
  28801. return !1;
  28802. for (var i = 0; i < e.length; i++)
  28803. if (e[i] !== t[i])
  28804. return !1;
  28805. return !0
  28806. },
  28807. lowerMedian: function(e, t) {
  28808. return 0 === e.length ? null : (t = t || 2,
  28809. e.sort(function(e, t) {
  28810. return e - t
  28811. }),
  28812. e[Math.floor(e.length / t)])
  28813. },
  28814. stableSort: function(e, n) {
  28815. return e.map(function(e, t) {
  28816. return {
  28817. value: e,
  28818. index: t
  28819. }
  28820. }).sort(function(e, t) {
  28821. var i = n(e.value, t.value);
  28822. return 0 !== i ? i : e.index - t.index
  28823. }).map(function(e) {
  28824. return e.value
  28825. })
  28826. },
  28827. filterAll: function(e, i) {
  28828. return e.filter(function(t) {
  28829. return i.every(function(e) {
  28830. return e(t)
  28831. })
  28832. })
  28833. },
  28834. formatDate: function(e) {
  28835. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28836. },
  28837. formatDatetime: function(e) {
  28838. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28839. },
  28840. randomString: function(e) {
  28841. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28842. t += i.charAt(Math.floor(Math.random() * i.length));
  28843. return t
  28844. },
  28845. uint8ToBase64: function(e, t) {
  28846. t && "number" == typeof t || (t = 8192);
  28847. for (var i = [], n = 0; n < e.length; n += t)
  28848. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28849. return btoa(i.join(""))
  28850. },
  28851. uuid4: function e(t) {
  28852. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28853. },
  28854. nth: function(e) {
  28855. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28856. },
  28857. extendObject: function(t, i) {
  28858. return Object.keys(i).forEach(function(e) {
  28859. t[e] = i[e]
  28860. }),
  28861. t
  28862. },
  28863. deepExtend: function e(t) {
  28864. t = t || {};
  28865. for (var i = 1; i < arguments.length; i++) {
  28866. var n = arguments[i];
  28867. if (n)
  28868. for (var r in n)
  28869. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28870. }
  28871. return t
  28872. },
  28873. inherit: function(e, t) {
  28874. e.prototype = Object.create(t.prototype),
  28875. e.prototype.constructor = e
  28876. },
  28877. extend: function(e, t) {
  28878. for (var i in t.prototype)
  28879. e.prototype[i] = t.prototype[i]
  28880. },
  28881. getVisiblePano : function(position, options={}){//add
  28882. var visiblePanos = [];
  28883. var B = position.clone();
  28884. var panos = options.panos || player.model.panos.list;
  28885. panos.forEach((pano)=>{
  28886. if(!pano.isAligned())return;
  28887. var A = pano.position.clone();
  28888. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  28889. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  28890. if (!o || !o.length)visiblePanos.push(pano );
  28891. })
  28892. return visiblePanos
  28893. }
  28894. ,
  28895. sortByScore : function(list, request, rank) {
  28896. var i = this.filterAll(list, request);
  28897. return 0 === i.length ? null : i = i.map(function(e) {
  28898. return {
  28899. item: e,
  28900. score: rank.reduce(function(t, i) {
  28901. return t + i(e);
  28902. }, 0)
  28903. };
  28904. }).sort(function(e, t) {
  28905. return t.score - e.score;
  28906. });
  28907. }
  28908. },
  28909. Math.sign = function(e) {
  28910. return e < 0 ? -1 : 1
  28911. }
  28912. window.common = t.exports
  28913. }
  28914. , {
  28915. three: 217
  28916. }],
  28917. 186: [function(e, t, i) {
  28918. "use strict";
  28919. var r = {
  28920. linearTween: function(e, t, i, n) {
  28921. return i * e / n + t
  28922. },
  28923. easeInQuad: function(e, t, i, n) {
  28924. return i * (e /= n) * e + t
  28925. },
  28926. easeOutQuad: function(e, t, i, n) {
  28927. return -i * (e /= n) * (e - 2) + t
  28928. },
  28929. easeInOutQuad: function(e, t, i, n) {
  28930. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28931. },
  28932. easeInCubic: function(e, t, i, n) {
  28933. return i * (e /= n) * e * e + t
  28934. },
  28935. easeOutCubic: function(e, t, i, n) {
  28936. return e /= n,
  28937. i * (--e * e * e + 1) + t
  28938. },
  28939. easeInOutCubic: function(e, t, i, n) {
  28940. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28941. },
  28942. easeInQuart: function(e, t, i, n) {
  28943. return i * (e /= n) * e * e * e + t
  28944. },
  28945. easeOutQuart: function(e, t, i, n) {
  28946. return e /= n,
  28947. -i * (--e * e * e * e - 1) + t
  28948. },
  28949. easeInOutQuart: function(e, t, i, n) {
  28950. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28951. },
  28952. easeInQuint: function(e, t, i, n) {
  28953. return i * (e /= n) * e * e * e * e + t
  28954. },
  28955. easeOutQuint: function(e, t, i, n) {
  28956. return e /= n,
  28957. i * (--e * e * e * e * e + 1) + t
  28958. },
  28959. easeInOutQuint: function(e, t, i, n) {
  28960. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28961. },
  28962. easeInSine: function(e, t, i, n) {
  28963. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28964. },
  28965. easeOutSine: function(e, t, i, n) {
  28966. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28967. },
  28968. easeInOutSine: function(e, t, i, n) {
  28969. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28970. },
  28971. easeInExpo: function(e, t, i, n) {
  28972. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28973. },
  28974. easeOutExpo: function(e, t, i, n) {
  28975. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28976. },
  28977. easeInOutExpo: function(e, t, i, n) {
  28978. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28979. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28980. },
  28981. easeInCirc: function(e, t, i, n) {
  28982. return e /= n,
  28983. -i * (Math.sqrt(1 - e * e) - 1) + t
  28984. },
  28985. easeOutCirc: function(e, t, i, n) {
  28986. return e /= n,
  28987. e--,
  28988. i * Math.sqrt(1 - e * e) + t
  28989. },
  28990. easeInOutCirc: function(e, t, i, n) {
  28991. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28992. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28993. },
  28994. easeInElastic: function(e, t, i, n) {
  28995. var r = 1.70158
  28996. , o = 0
  28997. , a = i;
  28998. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28999. r = a < Math.abs(i) ? (a = i,
  29000. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29001. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29002. },
  29003. easeOutElastic: function(e, t, i, n) {
  29004. var r = 1.70158
  29005. , o = 0
  29006. , a = i;
  29007. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29008. r = a < Math.abs(i) ? (a = i,
  29009. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29010. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29011. },
  29012. easeInOutElastic: function(e, t, i, n) {
  29013. var r = 1.70158
  29014. , o = 0
  29015. , a = i;
  29016. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29017. r = a < Math.abs(i) ? (a = i,
  29018. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29019. 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)
  29020. },
  29021. easeInBack: function(e, t, i, n, r) {
  29022. return void 0 === r && (r = 1.70158),
  29023. i * (e /= n) * e * ((r + 1) * e - r) + t
  29024. },
  29025. easeOutBack: function(e, t, i, n, r) {
  29026. return void 0 === r && (r = 1.70158),
  29027. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29028. },
  29029. easeInOutBack: function(e, t, i, n, r) {
  29030. return void 0 === r && (r = 1.70158),
  29031. (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
  29032. },
  29033. easeOutBounce: function(e, t, i, n) {
  29034. 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
  29035. },
  29036. easeInBounce: function(e, t, i, n) {
  29037. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29038. },
  29039. easeInOutBounce: function(e, t, i, n) {
  29040. 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
  29041. }
  29042. };
  29043. t.exports = r
  29044. }
  29045. , {}],
  29046. 187: [function(e, t, i) {
  29047. "use strict";
  29048. function n() {
  29049. this.events = [],
  29050. this.valid = !1
  29051. }
  29052. var r = e("../enum/Joystick");
  29053. n.prototype.push = function(e, t) {
  29054. this.events.push({
  29055. direction: e,
  29056. pano: t
  29057. }),
  29058. this.valid = !0
  29059. }
  29060. ,
  29061. n.prototype.pop = function(e) {
  29062. var t = this.events.pop();
  29063. return this.events.length < 1 && (this.valid = !1),
  29064. t
  29065. }
  29066. ,
  29067. n.prototype.peek = function() {
  29068. return this.events.length ? this.events[this.events.length - 1] : {
  29069. direction: null,
  29070. pano: null
  29071. }
  29072. }
  29073. ,
  29074. n.prototype.invalidate = function() {
  29075. this.events = [],
  29076. this.valid = !1
  29077. }
  29078. ,
  29079. n.prototype.reversePano = function(e) {
  29080. if (!this.valid)
  29081. return null;
  29082. var t = this.peek();
  29083. return r.opposite(e) === t.direction ? (this.pop(),
  29084. t.pano) : null
  29085. }
  29086. ,
  29087. t.exports = n
  29088. }
  29089. , {
  29090. "../enum/Joystick": 29
  29091. }],
  29092. 188: [function(e, t, i) {
  29093. "use strict";
  29094. t.exports = {
  29095. vector: function(t, i) {
  29096. var n = t.clone();
  29097. return i = i.clone(),
  29098. function(e) {
  29099. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29100. }
  29101. },
  29102. quaternion: function(t, i) {
  29103. var n = t.clone();
  29104. return function(e) {
  29105. t.copy(n).slerp(i, e)
  29106. }
  29107. },
  29108. property: function(t, i, n, r) {
  29109. var o = t[i];
  29110. return function(e) {
  29111. t[i] = o * (1 - e) + n * e,
  29112. r && r(t[i])
  29113. }
  29114. },
  29115. uniform: function(t, i, n) {
  29116. var r = t.material.uniforms[i].value;
  29117. return function(e) {
  29118. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29119. }
  29120. },
  29121. matrix4: function(o, a) {
  29122. var s = o.clone();
  29123. return function(e) {
  29124. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29125. t[r] = i[r] * (1 - e) + n[r] * e
  29126. }
  29127. },
  29128. allUniforms: function(e, t, i) {
  29129. var n = e.map(function(e) {
  29130. return this.uniform(e, t, i)
  29131. }
  29132. .bind(this));
  29133. return function(t) {
  29134. n.forEach(function(e) {
  29135. e(t)
  29136. })
  29137. }
  29138. }
  29139. }
  29140. }
  29141. , {}],
  29142. 189: [function(e, t, i) {
  29143. "use strict";
  29144. function h(n) {
  29145. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29146. if (h.consoleEnabled) {
  29147. var l = function(e) {
  29148. $("#debug-console").append("<p>" + e + "</p>"),
  29149. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29150. };
  29151. e = function(e) {
  29152. l(Array.prototype.slice.call(arguments).join(" "))
  29153. }
  29154. ,
  29155. t = function(e) {
  29156. l(Array.prototype.slice.call(arguments).join(" "))
  29157. }
  29158. ,
  29159. i = function(e) {
  29160. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29161. }
  29162. ,
  29163. r = function(e) {
  29164. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29165. }
  29166. } else
  29167. console.log ? (e = console.log,
  29168. t = console.info ? console.info : console.log,
  29169. i = console.warn ? console.warn : console.log,
  29170. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29171. ;
  29172. function c(e) {
  29173. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29174. }
  29175. return {
  29176. debug: function() {
  29177. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29178. },
  29179. info: function() {
  29180. h.level >= h.levels.info && t.apply(console, c(arguments))
  29181. },
  29182. warn: function() {
  29183. (function(e, t) {
  29184. if (u) {
  29185. var i = Array.prototype.slice.call(e).join(" ");
  29186. u.captureMessage(i, {
  29187. level: t,
  29188. path: n,
  29189. timestamp: h.timestamp()
  29190. })
  29191. }
  29192. }
  29193. )(arguments, "warn"),
  29194. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29195. },
  29196. error: function() {
  29197. (function(e, t) {
  29198. if (u) {
  29199. var i = Array.prototype.slice.call(e).join(" ");
  29200. u.captureException(new Error(i), {
  29201. level: t,
  29202. path: n,
  29203. timestamp: h.timestamp()
  29204. })
  29205. }
  29206. }
  29207. )(arguments, "error"),
  29208. h.level >= h.levels.error && r.apply(console, c(arguments))
  29209. },
  29210. v3str: function(e, t) {
  29211. var i = void 0 === t ? 2 : t;
  29212. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29213. },
  29214. eulstr: function(e, t) {
  29215. var i = void 0 === t ? 2 : t;
  29216. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29217. },
  29218. time: function(e) {
  29219. h.level >= h.levels.debug && (s[e] = Date.now())
  29220. },
  29221. timeEnd: function(e) {
  29222. if (h.level >= h.levels.debug) {
  29223. var t = s[e];
  29224. if (!t)
  29225. return;
  29226. var i = (Date.now() - t) / 1e3;
  29227. this.debug(e, i + "s")
  29228. }
  29229. }
  29230. }
  29231. }
  29232. var u = window.Raven;
  29233. h.timestamp = function() {
  29234. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29235. }
  29236. ,
  29237. h.level = (h.levels = {
  29238. debug: 3,
  29239. info: 2,
  29240. warn: 1,
  29241. error: 0
  29242. }).info,
  29243. t.exports = h
  29244. }
  29245. , {}],
  29246. 190: [function(e, t, i) {
  29247. "use strict";
  29248. var o = e("three")
  29249. , r = e("../enum/GLCubeFaces");
  29250. e("../constants");
  29251. t.exports = {
  29252. convertVisionVector: function(e) {
  29253. return new o.Vector3(e.x,e.z,-e.y)
  29254. },
  29255. convertVisionQuaternion: function(e) {
  29256. 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)))
  29257. },
  29258. convertWorkshopVector: function(e) {
  29259. return new o.Vector3(-e.x,e.y,e.z)
  29260. },
  29261. convertWorkshopQuaternion: function(e) {
  29262. 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))
  29263. },
  29264. convertWorkshopPanoramaQuaternion: function(e) {
  29265. 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)))
  29266. },
  29267. convertWorkshopOrthoZoom: function(e) {
  29268. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29269. },
  29270. toPrecision: function(e, t) {
  29271. function i(e, t) {
  29272. var i = Math.pow(10, t);
  29273. return Math.round(e * i) / i
  29274. }
  29275. if (e instanceof Array) {
  29276. for (var n = 0; n < e.length; n++)
  29277. e[n] = i(e[n], t);
  29278. return e
  29279. }
  29280. return i(e, t)
  29281. },
  29282. isEmptyQuaternion: function(e) {
  29283. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29284. },
  29285. projectPositionToCanvas: function(e, t, i) {
  29286. (i = i || new o.Vector3).copy(e);
  29287. var n = .5 * $("#player").width()
  29288. , r = .5 * $("#player").height();
  29289. return i.project(t),
  29290. i.x = i.x * n + n,
  29291. i.y = -i.y * r + r,
  29292. i
  29293. },
  29294. convertScreenPositionToNDC: function(e, t, i) {
  29295. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29296. i.y = -t / $("#player").height() * 2 + 1,
  29297. i
  29298. },
  29299. constrainedTurn: function(e) {
  29300. var t = e % (2 * Math.PI);
  29301. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29302. },
  29303. getFOVDotThreshold: function(e) {
  29304. return Math.cos(o.Math.degToRad(e / 2))
  29305. },
  29306. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29307. switch (e) {
  29308. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29309. i.set(1, t.y, t.x);
  29310. break;
  29311. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29312. i.set(-1, t.y, -t.x);
  29313. break;
  29314. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29315. i.set(-t.x, 1, -t.y);
  29316. break;
  29317. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29318. i.set(-t.x, -1, t.y);
  29319. break;
  29320. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29321. i.set(-t.x, t.y, 1);
  29322. break;
  29323. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29324. i.set(t.x, t.y, -1)
  29325. }
  29326. n && i.normalize()
  29327. },
  29328. //add:
  29329. getPos2d : function(point, camera, dom){
  29330. var camera = camera ;
  29331. var dom = dom;
  29332. 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);
  29333. var x,y;
  29334. x = (pos.x + 1) / 2 * dom.clientWidth;
  29335. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29336. var inSight = x <= dom.clientWidth && x >= 0
  29337. && y <= dom.clientHeight && y >= 0
  29338. return {
  29339. pos: new THREE.Vector2(x,y),
  29340. vector: pos,
  29341. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29342. inSight : inSight //在屏幕范围内可见
  29343. };
  29344. },
  29345. }
  29346. window.math = t.exports
  29347. }
  29348. , {
  29349. "../constants": 8,
  29350. "../enum/GLCubeFaces": 25,
  29351. three: 217
  29352. }],
  29353. 191: [function(e, t, i) {
  29354. "use strict";
  29355. function o(e) {
  29356. return r[e]
  29357. }
  29358. var n = e("../enum/GLCubeFaces")
  29359. , a = [0, 1, 2, 3, 4, 5]
  29360. , r = {
  29361. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29362. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29363. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29364. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29365. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29366. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29367. };
  29368. t.exports = {
  29369. mapFaceToCubemapFace: o,
  29370. getCubemapUrls: function(i, n, r) {
  29371. return a.map(function(e, t) {
  29372. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29373. }
  29374. .bind(this))
  29375. }
  29376. }
  29377. }
  29378. , {
  29379. "../enum/GLCubeFaces": 25
  29380. }],
  29381. 192: [function(e, t, i) {
  29382. "use strict";
  29383. t.exports = {
  29384. captureErrors: function(e, t, i) {
  29385. if ("Raven"in window) {
  29386. Raven.config(e, t).install(),
  29387. i && Raven.setTagsContext(i);
  29388. var n = console.warn
  29389. , r = console.error;
  29390. console.warn = function() {
  29391. var e = Array.prototype.slice.call(arguments);
  29392. Raven.captureMessage(e.join(" "), {
  29393. level: "warning"
  29394. }),
  29395. n.apply(console, e)
  29396. }
  29397. ,
  29398. console.error = function() {
  29399. var e = Array.prototype.slice.call(arguments);
  29400. Raven.captureException(new Error(e.join(" ")), {
  29401. level: "error"
  29402. }),
  29403. r.apply(console, e)
  29404. }
  29405. } else
  29406. console.error("Raven not found, not capturing errors.")
  29407. }
  29408. }
  29409. }
  29410. , {}],
  29411. 193: [function(c, h, e) {
  29412. (function(e) {
  29413. "use strict";
  29414. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29415. getAuthorizationHeader: function() {
  29416. var e = n.valueFromHash("auth");
  29417. if (e)
  29418. return e.replace(",", " ");
  29419. var t = n.valueFromCookie("token");
  29420. return t ? "Token " + t : null
  29421. },
  29422. parseSidUrl: function(e) {
  29423. var t, i;
  29424. if (t = g_Prefix,
  29425. (e = e || "").match(/^https?/)) {
  29426. o.parse(e);
  29427. t = g_Prefix,
  29428. i = e
  29429. } else
  29430. i = (t = g_Prefix) + "data/" + e;
  29431. return {
  29432. urlBase: t,
  29433. urlModel: i,
  29434. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29435. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29436. }
  29437. },
  29438. getModelIDFromQueryString: function() {
  29439. return n.valueFromHash("model") || n.valueFromHash("m")
  29440. },
  29441. /* normalizeModeldata: function(e, i) {
  29442. e = JSON.parse(JSON.stringify(e));
  29443. var n = null;
  29444. if (e.images.forEach(function(t) {
  29445. if (t.metadata) {
  29446. if ("string" == typeof t.metadata)
  29447. try {
  29448. t.metadata = JSON.parse(t.metadata)
  29449. } catch (e) {
  29450. s.warn("Unable to parse image metadata"),
  29451. t.metadata = null
  29452. }
  29453. else
  29454. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29455. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29456. 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)),
  29457. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29458. t.metadata.zoom = t.metadata.zoom || 1),
  29459. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29460. }
  29461. }),
  29462. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29463. var t = {};
  29464. t.pano = {
  29465. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29466. position: i.convertWorkshopVector(n.scan_position),
  29467. uuid: n.scan_id
  29468. },
  29469. t.camera = {
  29470. quaternion: n.camera_quaternion,
  29471. position: n.camera_position
  29472. },
  29473. e.startPano = t
  29474. }
  29475. return e
  29476. }, */
  29477. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29478. e = JSON.parse(JSON.stringify(e));
  29479. var i = null;
  29480. var deal = function(n) {
  29481. if(!n.metadata) return;
  29482. if ("string" == typeof n.metadata)
  29483. try {
  29484. n.metadata = JSON.parse(n.metadata)
  29485. } catch (e) {
  29486. s.warn("Unable to parse image metadata"),
  29487. n.metadata = null
  29488. }
  29489. else{
  29490. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29491. }
  29492. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29493. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29494. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29495. }else{
  29496. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29497. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29498. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29499. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29500. }
  29501. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29502. }
  29503. //改
  29504. e.images.forEach(info=>{
  29505. if(info.locations){
  29506. info.locations.forEach(a=>deal(a))
  29507. }else{
  29508. deal(info)
  29509. }
  29510. })
  29511. //icon初始视角的:
  29512. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29513. var n = {};
  29514. n.pano = {
  29515. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29516. position: t.convertWorkshopVector(i.scan_position),
  29517. uuid: i.scan_id
  29518. },
  29519. n.camera = {
  29520. quaternion: i.camera_quaternion,
  29521. position: i.camera_position
  29522. },
  29523. e.startPano = n
  29524. }
  29525. return e
  29526. },
  29527. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29528. function(e) {
  29529. if (!e)
  29530. throw new Error("Vision version is required");
  29531. var t = i.exec(e);
  29532. if (null === t)
  29533. throw new Error("String is not a vision version: " + e);
  29534. return parseInt(t[1])
  29535. }
  29536. ),
  29537. modelDataPromisesTiles: function(e) {
  29538. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29539. if (t)
  29540. try {
  29541. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29542. } catch (e) {
  29543. s.warn("Invalid vision version: " + t)
  29544. }
  29545. return !1
  29546. }
  29547. };
  29548. h.exports = l
  29549. }
  29550. ).call(this, "/js/util/showcase.js")
  29551. }
  29552. , {
  29553. "../constants": 8,
  29554. "./browser": 182,
  29555. "./logger": 189,
  29556. three: 217,
  29557. url: 208
  29558. }],
  29559. 194: [function(e, t, i) {
  29560. "use strict";
  29561. var r = e("../util/ajax")
  29562. , o = e("three")
  29563. , a = e("../settings")
  29564. , s = {};
  29565. t.exports = {
  29566. load: function(e, t, i) {
  29567. var n = s[e];
  29568. return n ? t && setTimeout(function() {
  29569. t(n)
  29570. }, 1) : (n = new o.Texture,
  29571. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29572. n.magFilter = o.LinearFilter,
  29573. n.generateMipmaps = !1),
  29574. n.sourceFile = e,
  29575. s[e] = n,
  29576. r.getImage(e).then(function(e) {
  29577. n.image = e,
  29578. n.needsUpdate = !0,
  29579. t && t(n)
  29580. }).fail(i)),
  29581. n
  29582. },
  29583. loadBase64: function(e, t) {
  29584. t = t || "png";
  29585. var i = new o.Texture;
  29586. return i.image = document.createElement("img"),
  29587. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29588. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29589. i.magFilter = o.LinearFilter,
  29590. i.generateMipmaps = !1),
  29591. i.needsUpdate = !0,
  29592. i
  29593. },
  29594. isLoaded: function(e) {
  29595. return !!s[e]
  29596. }
  29597. }
  29598. window.Texture = t.exports
  29599. }
  29600. , {
  29601. "../settings": 166,
  29602. "../util/ajax": 181,
  29603. three: 217
  29604. }],
  29605. 195: [function(e, t, i) {
  29606. "use strict";
  29607. var l = e("./easing");
  29608. t.exports = {
  29609. globalDone: null,
  29610. funcs: [],
  29611. counter: 0,
  29612. uniqueID: 0,
  29613. start: function(e, t, i, n, r, o, a) {
  29614. return n = n || 0,
  29615. this.funcs.push({
  29616. func: e,
  29617. current: -n * Math.abs(t),
  29618. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29619. done: i,
  29620. easing: r || l.linearTween,
  29621. cycling: t < 0,
  29622. running: !0,
  29623. debug: n < 0,
  29624. name: o || "T" + this.counter,
  29625. id: void 0 === a ? this.counter : a,
  29626. paused: !1
  29627. }),
  29628. e(0, 16),
  29629. this.counter += 1,
  29630. e
  29631. },
  29632. trigger: function(e) {
  29633. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29634. , i = e.func || function() {}
  29635. , n = void 0 === e.duration ? 0 : e.duration;
  29636. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29637. var r = e.done || null
  29638. , o = e.easing || l.linearTween
  29639. , a = e.name || "R" + this.counter
  29640. , s = void 0 === e.id ? this.counter : e.id;
  29641. return this.start(i, n, r, t, o, a, s)
  29642. },
  29643. setTimeout: function(e, t, i) {
  29644. var n = void 0 === i ? this.counter : i;
  29645. return this.trigger({
  29646. done: e,
  29647. duration: void 0 === t ? 0 : t,
  29648. name: "O" + this.counter,
  29649. id: n
  29650. })
  29651. },
  29652. pause: function() {
  29653. this.paused = !0
  29654. },
  29655. resume: function() {
  29656. this.paused = !1
  29657. },
  29658. update: function(n) {
  29659. this.funcs.forEach(function(e) {
  29660. if (!(e.paused || (e.current += 1e3 * n,
  29661. e.current < 0)))
  29662. if (e.current >= e.duration && !e.cycling) {
  29663. var t = e.easing(1, 0, 1, 1);
  29664. e.func(t, 1e3 * n),
  29665. e.done && e.done(),
  29666. e.running = !1
  29667. } else {
  29668. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29669. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29670. e.running = !1)
  29671. }
  29672. });
  29673. var e = this.funcs.length;
  29674. this.funcs = this.funcs.filter(function(e) {
  29675. return e.running
  29676. });
  29677. var t = this.funcs.length;
  29678. if (0 < e && 0 === t && this.globalDone) {
  29679. var i = this.globalDone;
  29680. this.globalDone = null,
  29681. i()
  29682. }
  29683. },
  29684. adjustSpeed: function(e, t) {
  29685. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29686. var r = i[n];
  29687. r.duration /= t,
  29688. r.current /= t
  29689. }
  29690. },
  29691. getById: function(t) {
  29692. return this.funcs.filter(function(e) {
  29693. return t === e.id
  29694. })
  29695. },
  29696. get: function(e) {
  29697. for (var t = 0; t < this.funcs.length; t += 1)
  29698. if (this.funcs[t].func === e)
  29699. return this.funcs[t];
  29700. return null
  29701. },
  29702. isRunning: function(e) {
  29703. var t = this.get(e);
  29704. return null !== t && t.running
  29705. },
  29706. countActive: function() {
  29707. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29708. e += this.funcs[t].running;
  29709. return e
  29710. },
  29711. listActive: function() {
  29712. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29713. this.funcs[t].running && e.push(this.funcs[t].name);
  29714. return e
  29715. },
  29716. done: function(e) {
  29717. this.globalDone = e
  29718. },
  29719. cancelById: function(e) {
  29720. var t = void 0 === e ? 0 : e;
  29721. this.funcs = this.funcs.filter(function(e) {
  29722. return e.id !== t
  29723. })
  29724. },
  29725. cancel: function(t) {
  29726. this.funcs = this.funcs.filter(function(e) {
  29727. return e.func !== t
  29728. })
  29729. },
  29730. getUniqueId: function() {
  29731. return this.uniqueID -= 1,
  29732. this.uniqueID
  29733. }
  29734. }
  29735. }
  29736. , {
  29737. "./easing": 186
  29738. }],
  29739. 196: [function(e, t, i) {
  29740. function n(e) {
  29741. if (this.set = {},
  29742. this.infContains = function() {
  29743. return !0
  29744. }
  29745. ,
  29746. "object" == typeof e)
  29747. if (e instanceof Array)
  29748. for (var t = 0; t < e.length; t++)
  29749. this.set[e[t]] = !0;
  29750. else
  29751. this.set = e;
  29752. else if ("function" == typeof e)
  29753. this.infContains = e;
  29754. else if (void 0 !== e)
  29755. throw new Error("set must be either an array or an object.")
  29756. }
  29757. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29758. return !!this.set[e]
  29759. }
  29760. ,
  29761. n.prototype.add = function(e) {
  29762. if (1 == arguments.length)
  29763. this.set[e] = !0;
  29764. else
  29765. for (var t = 0; t < arguments.length; t++)
  29766. this.set[arguments[t]] = !0
  29767. }
  29768. ,
  29769. n.prototype.addAll = function(e) {
  29770. if ("object" != typeof e && !(e instanceof Array))
  29771. throw new Error("arr must be an array.");
  29772. for (var t = 0; t < e.length; t++)
  29773. this.add(e[t])
  29774. }
  29775. ,
  29776. n.prototype.delete = n.prototype.remove = function(e) {
  29777. if (1 == arguments.length)
  29778. delete this.set[e];
  29779. else
  29780. for (var t = 0; t < arguments.length; t++)
  29781. delete this.set[arguments[t]]
  29782. }
  29783. ,
  29784. n.prototype.clear = function() {
  29785. this.set = {}
  29786. }
  29787. ,
  29788. n.prototype.size = function() {
  29789. return Object.keys(this.set).length
  29790. }
  29791. ,
  29792. n.prototype.toString = function() {
  29793. return "{" + Object.keys(this.set).toString() + "}"
  29794. }
  29795. ,
  29796. n.prototype["*values"] = n.prototype.toArray = function() {
  29797. return void 0 === this.set ? [] : Object.keys(this.set)
  29798. }
  29799. }
  29800. , {}],
  29801. 197: [function(e, t, i) {}
  29802. , {}],
  29803. 198: [function(N, e, F) {
  29804. (function(e) {
  29805. "use strict";
  29806. function i() {
  29807. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29808. }
  29809. function o(e, t) {
  29810. if (i() < t)
  29811. throw new RangeError("Invalid typed array length");
  29812. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29813. e.length = t),
  29814. e
  29815. }
  29816. function u(e, t, i) {
  29817. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29818. return new u(e,t,i);
  29819. if ("number" != typeof e)
  29820. return n(this, e, t, i);
  29821. if ("string" == typeof t)
  29822. throw new Error("If encoding is specified then the first argument must be a string");
  29823. return a(this, e)
  29824. }
  29825. function n(e, t, i, n) {
  29826. if ("number" == typeof t)
  29827. throw new TypeError('"value" argument must not be a number');
  29828. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29829. if (t.byteLength,
  29830. i < 0 || t.byteLength < i)
  29831. throw new RangeError("'offset' is out of bounds");
  29832. if (t.byteLength < i + (n || 0))
  29833. throw new RangeError("'length' is out of bounds");
  29834. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29835. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29836. e
  29837. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29838. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29839. !u.isEncoding(i))
  29840. throw new TypeError('"encoding" must be a valid string encoding');
  29841. var n = 0 | c(t, i)
  29842. , r = (e = o(e, n)).write(t, i);
  29843. return r !== n && (e = e.slice(0, r)),
  29844. e
  29845. }(e, t, i) : function(e, t) {
  29846. if (u.isBuffer(t)) {
  29847. var i = 0 | l(t.length);
  29848. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29849. e
  29850. }
  29851. if (t) {
  29852. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29853. return "number" != typeof t.length || function(e) {
  29854. return e != e
  29855. }(t.length) ? o(e, 0) : s(e, t);
  29856. if ("Buffer" === t.type && L(t.data))
  29857. return s(e, t.data)
  29858. }
  29859. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29860. }(e, t)
  29861. }
  29862. function r(e) {
  29863. if ("number" != typeof e)
  29864. throw new TypeError('"size" argument must be a number');
  29865. if (e < 0)
  29866. throw new RangeError('"size" argument must not be negative')
  29867. }
  29868. function a(e, t) {
  29869. if (r(t),
  29870. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29871. !u.TYPED_ARRAY_SUPPORT)
  29872. for (var i = 0; i < t; ++i)
  29873. e[i] = 0;
  29874. return e
  29875. }
  29876. function s(e, t) {
  29877. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29878. e = o(e, i);
  29879. for (var n = 0; n < i; n += 1)
  29880. e[n] = 255 & t[n];
  29881. return e
  29882. }
  29883. function l(e) {
  29884. if (e >= i())
  29885. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29886. return 0 | e
  29887. }
  29888. function c(e, t) {
  29889. if (u.isBuffer(e))
  29890. return e.length;
  29891. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29892. return e.byteLength;
  29893. "string" != typeof e && (e = "" + e);
  29894. var i = e.length;
  29895. if (0 === i)
  29896. return 0;
  29897. for (var n = !1; ; )
  29898. switch (t) {
  29899. case "ascii":
  29900. case "latin1":
  29901. case "binary":
  29902. return i;
  29903. case "utf8":
  29904. case "utf-8":
  29905. case void 0:
  29906. return S(e).length;
  29907. case "ucs2":
  29908. case "ucs-2":
  29909. case "utf16le":
  29910. case "utf-16le":
  29911. return 2 * i;
  29912. case "hex":
  29913. return i >>> 1;
  29914. case "base64":
  29915. return M(e).length;
  29916. default:
  29917. if (n)
  29918. return S(e).length;
  29919. t = ("" + t).toLowerCase(),
  29920. n = !0
  29921. }
  29922. }
  29923. function h(e, t, i) {
  29924. var n = e[t];
  29925. e[t] = e[i],
  29926. e[i] = n
  29927. }
  29928. function d(e, t, i, n, r) {
  29929. if (0 === e.length)
  29930. return -1;
  29931. if ("string" == typeof i ? (n = i,
  29932. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29933. i = +i,
  29934. isNaN(i) && (i = r ? 0 : e.length - 1),
  29935. i < 0 && (i = e.length + i),
  29936. i >= e.length) {
  29937. if (r)
  29938. return -1;
  29939. i = e.length - 1
  29940. } else if (i < 0) {
  29941. if (!r)
  29942. return -1;
  29943. i = 0
  29944. }
  29945. if ("string" == typeof t && (t = u.from(t, n)),
  29946. u.isBuffer(t))
  29947. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29948. if ("number" == typeof t)
  29949. return t &= 255,
  29950. 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);
  29951. throw new TypeError("val must be string, number or Buffer")
  29952. }
  29953. function p(e, t, i, n, r) {
  29954. function o(e, t) {
  29955. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29956. }
  29957. var a, s = 1, l = e.length, c = t.length;
  29958. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29959. if (e.length < 2 || t.length < 2)
  29960. return -1;
  29961. l /= s = 2,
  29962. c /= 2,
  29963. i /= 2
  29964. }
  29965. if (r) {
  29966. var h = -1;
  29967. for (a = i; a < l; a++)
  29968. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29969. if (-1 === h && (h = a),
  29970. a - h + 1 === c)
  29971. return h * s
  29972. } else
  29973. -1 !== h && (a -= a - h),
  29974. h = -1
  29975. } else
  29976. for (l < i + c && (i = l - c),
  29977. a = i; 0 <= a; a--) {
  29978. for (var u = !0, d = 0; d < c; d++)
  29979. if (o(e, a + d) !== o(t, d)) {
  29980. u = !1;
  29981. break
  29982. }
  29983. if (u)
  29984. return a
  29985. }
  29986. return -1
  29987. }
  29988. function g(e, t, i, n) {
  29989. i = Number(i) || 0;
  29990. var r = e.length - i;
  29991. n ? r < (n = Number(n)) && (n = r) : n = r;
  29992. var o = t.length;
  29993. if (o % 2 != 0)
  29994. throw new TypeError("Invalid hex string");
  29995. o / 2 < n && (n = o / 2);
  29996. for (var a = 0; a < n; ++a) {
  29997. var s = parseInt(t.substr(2 * a, 2), 16);
  29998. if (isNaN(s))
  29999. return a;
  30000. e[i + a] = s
  30001. }
  30002. return a
  30003. }
  30004. function m(e, t, i, n) {
  30005. return R(function(e) {
  30006. for (var t = [], i = 0; i < e.length; ++i)
  30007. t.push(255 & e.charCodeAt(i));
  30008. return t
  30009. }(t), e, i, n)
  30010. }
  30011. function f(e, t, i) {
  30012. i = Math.min(e.length, i);
  30013. for (var n = [], r = t; r < i; ) {
  30014. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30015. if (r + u <= i)
  30016. switch (u) {
  30017. case 1:
  30018. c < 128 && (h = c);
  30019. break;
  30020. case 2:
  30021. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30022. break;
  30023. case 3:
  30024. o = e[r + 1],
  30025. a = e[r + 2],
  30026. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30027. break;
  30028. case 4:
  30029. o = e[r + 1],
  30030. a = e[r + 2],
  30031. s = e[r + 3],
  30032. 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))
  30033. }
  30034. null === h ? (h = 65533,
  30035. u = 1) : 65535 < h && (h -= 65536,
  30036. n.push(h >>> 10 & 1023 | 55296),
  30037. h = 56320 | 1023 & h),
  30038. n.push(h),
  30039. r += u
  30040. }
  30041. return function(e) {
  30042. var t = e.length;
  30043. if (t <= D)
  30044. return String.fromCharCode.apply(String, e);
  30045. for (var i = "", n = 0; n < t; )
  30046. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30047. return i
  30048. }(n)
  30049. }
  30050. function v(e, t, i) {
  30051. var n = "";
  30052. i = Math.min(e.length, i);
  30053. for (var r = t; r < i; ++r)
  30054. n += String.fromCharCode(127 & e[r]);
  30055. return n
  30056. }
  30057. function y(e, t, i) {
  30058. var n = "";
  30059. i = Math.min(e.length, i);
  30060. for (var r = t; r < i; ++r)
  30061. n += String.fromCharCode(e[r]);
  30062. return n
  30063. }
  30064. function A(e, t, i) {
  30065. var n, r = e.length;
  30066. (!t || t < 0) && (t = 0),
  30067. (!i || i < 0 || r < i) && (i = r);
  30068. for (var o = "", a = t; a < i; ++a)
  30069. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30070. return o
  30071. }
  30072. function C(e, t, i) {
  30073. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30074. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30075. return r
  30076. }
  30077. function I(e, t, i) {
  30078. if (e % 1 != 0 || e < 0)
  30079. throw new RangeError("offset is not uint");
  30080. if (i < e + t)
  30081. throw new RangeError("Trying to access beyond buffer length")
  30082. }
  30083. function E(e, t, i, n, r, o) {
  30084. if (!u.isBuffer(e))
  30085. throw new TypeError('"buffer" argument must be a Buffer instance');
  30086. if (r < t || t < o)
  30087. throw new RangeError('"value" argument is out of bounds');
  30088. if (i + n > e.length)
  30089. throw new RangeError("Index out of range")
  30090. }
  30091. function _(e, t, i, n) {
  30092. t < 0 && (t = 65535 + t + 1);
  30093. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30094. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30095. }
  30096. function b(e, t, i, n) {
  30097. t < 0 && (t = 4294967295 + t + 1);
  30098. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30099. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30100. }
  30101. function w(e, t, i, n) {
  30102. if (i + n > e.length)
  30103. throw new RangeError("Index out of range");
  30104. if (i < 0)
  30105. throw new RangeError("Index out of range")
  30106. }
  30107. function T(e, t, i, n, r) {
  30108. return r || w(e, 0, i, 4),
  30109. O.write(e, t, i, n, 23, 4),
  30110. i + 4
  30111. }
  30112. function x(e, t, i, n, r) {
  30113. return r || w(e, 0, i, 8),
  30114. O.write(e, t, i, n, 52, 8),
  30115. i + 8
  30116. }
  30117. function S(e, t) {
  30118. t = t || 1 / 0;
  30119. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30120. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30121. if (!r) {
  30122. if (56319 < i) {
  30123. -1 < (t -= 3) && o.push(239, 191, 189);
  30124. continue
  30125. }
  30126. if (a + 1 === n) {
  30127. -1 < (t -= 3) && o.push(239, 191, 189);
  30128. continue
  30129. }
  30130. r = i;
  30131. continue
  30132. }
  30133. if (i < 56320) {
  30134. -1 < (t -= 3) && o.push(239, 191, 189),
  30135. r = i;
  30136. continue
  30137. }
  30138. i = 65536 + (r - 55296 << 10 | i - 56320)
  30139. } else
  30140. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30141. if (r = null,
  30142. i < 128) {
  30143. if ((t -= 1) < 0)
  30144. break;
  30145. o.push(i)
  30146. } else if (i < 2048) {
  30147. if ((t -= 2) < 0)
  30148. break;
  30149. o.push(i >> 6 | 192, 63 & i | 128)
  30150. } else if (i < 65536) {
  30151. if ((t -= 3) < 0)
  30152. break;
  30153. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30154. } else {
  30155. if (!(i < 1114112))
  30156. throw new Error("Invalid code point");
  30157. if ((t -= 4) < 0)
  30158. break;
  30159. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30160. }
  30161. }
  30162. return o
  30163. }
  30164. function M(e) {
  30165. return P.toByteArray(function(e) {
  30166. if ((e = function(e) {
  30167. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30168. }(e).replace(t, "")).length < 2)
  30169. return "";
  30170. for (; e.length % 4 != 0; )
  30171. e += "=";
  30172. return e
  30173. }(e))
  30174. }
  30175. function R(e, t, i, n) {
  30176. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30177. t[r + i] = e[r];
  30178. return r
  30179. }
  30180. var P = N("base64-js")
  30181. , O = N("ieee754")
  30182. , L = N("isarray");
  30183. F.Buffer = u,
  30184. F.SlowBuffer = function(e) {
  30185. return +e != e && (e = 0),
  30186. u.alloc(+e)
  30187. }
  30188. ,
  30189. F.INSPECT_MAX_BYTES = 50,
  30190. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30191. try {
  30192. var e = new Uint8Array(1);
  30193. return e.__proto__ = {
  30194. __proto__: Uint8Array.prototype,
  30195. foo: function() {
  30196. return 42
  30197. }
  30198. },
  30199. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30200. } catch (e) {
  30201. return !1
  30202. }
  30203. }(),
  30204. F.kMaxLength = i(),
  30205. u.poolSize = 8192,
  30206. u._augment = function(e) {
  30207. return e.__proto__ = u.prototype,
  30208. e
  30209. }
  30210. ,
  30211. u.from = function(e, t, i) {
  30212. return n(null, e, t, i)
  30213. }
  30214. ,
  30215. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30216. u.__proto__ = Uint8Array,
  30217. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30218. value: null,
  30219. configurable: !0
  30220. })),
  30221. u.alloc = function(e, t, i) {
  30222. return function(e, t, i, n) {
  30223. return r(t),
  30224. 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)
  30225. }(null, e, t, i)
  30226. }
  30227. ,
  30228. u.allocUnsafe = function(e) {
  30229. return a(null, e)
  30230. }
  30231. ,
  30232. u.allocUnsafeSlow = function(e) {
  30233. return a(null, e)
  30234. }
  30235. ,
  30236. u.isBuffer = function(e) {
  30237. return !(null == e || !e._isBuffer)
  30238. }
  30239. ,
  30240. u.compare = function(e, t) {
  30241. if (!u.isBuffer(e) || !u.isBuffer(t))
  30242. throw new TypeError("Arguments must be Buffers");
  30243. if (e === t)
  30244. return 0;
  30245. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30246. if (e[r] !== t[r]) {
  30247. i = e[r],
  30248. n = t[r];
  30249. break
  30250. }
  30251. return i < n ? -1 : n < i ? 1 : 0
  30252. }
  30253. ,
  30254. u.isEncoding = function(e) {
  30255. switch (String(e).toLowerCase()) {
  30256. case "hex":
  30257. case "utf8":
  30258. case "utf-8":
  30259. case "ascii":
  30260. case "latin1":
  30261. case "binary":
  30262. case "base64":
  30263. case "ucs2":
  30264. case "ucs-2":
  30265. case "utf16le":
  30266. case "utf-16le":
  30267. return !0;
  30268. default:
  30269. return !1
  30270. }
  30271. }
  30272. ,
  30273. u.concat = function(e, t) {
  30274. if (!L(e))
  30275. throw new TypeError('"list" argument must be an Array of Buffers');
  30276. if (0 === e.length)
  30277. return u.alloc(0);
  30278. var i;
  30279. if (void 0 === t)
  30280. for (i = t = 0; i < e.length; ++i)
  30281. t += e[i].length;
  30282. var n = u.allocUnsafe(t)
  30283. , r = 0;
  30284. for (i = 0; i < e.length; ++i) {
  30285. var o = e[i];
  30286. if (!u.isBuffer(o))
  30287. throw new TypeError('"list" argument must be an Array of Buffers');
  30288. o.copy(n, r),
  30289. r += o.length
  30290. }
  30291. return n
  30292. }
  30293. ,
  30294. u.byteLength = c,
  30295. u.prototype._isBuffer = !0,
  30296. u.prototype.swap16 = function() {
  30297. var e = this.length;
  30298. if (e % 2 != 0)
  30299. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30300. for (var t = 0; t < e; t += 2)
  30301. h(this, t, t + 1);
  30302. return this
  30303. }
  30304. ,
  30305. u.prototype.swap32 = function() {
  30306. var e = this.length;
  30307. if (e % 4 != 0)
  30308. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30309. for (var t = 0; t < e; t += 4)
  30310. h(this, t, t + 3),
  30311. h(this, t + 1, t + 2);
  30312. return this
  30313. }
  30314. ,
  30315. u.prototype.swap64 = function() {
  30316. var e = this.length;
  30317. if (e % 8 != 0)
  30318. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30319. for (var t = 0; t < e; t += 8)
  30320. h(this, t, t + 7),
  30321. h(this, t + 1, t + 6),
  30322. h(this, t + 2, t + 5),
  30323. h(this, t + 3, t + 4);
  30324. return this
  30325. }
  30326. ,
  30327. u.prototype.toString = function() {
  30328. var e = 0 | this.length;
  30329. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30330. var n, r, o, a = !1;
  30331. if ((void 0 === t || t < 0) && (t = 0),
  30332. t > this.length)
  30333. return "";
  30334. if ((void 0 === i || i > this.length) && (i = this.length),
  30335. i <= 0)
  30336. return "";
  30337. if ((i >>>= 0) <= (t >>>= 0))
  30338. return "";
  30339. for (e = e || "utf8"; ; )
  30340. switch (e) {
  30341. case "hex":
  30342. return A(this, t, i);
  30343. case "utf8":
  30344. case "utf-8":
  30345. return f(this, t, i);
  30346. case "ascii":
  30347. return v(this, t, i);
  30348. case "latin1":
  30349. case "binary":
  30350. return y(this, t, i);
  30351. case "base64":
  30352. return n = this,
  30353. o = i,
  30354. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30355. case "ucs2":
  30356. case "ucs-2":
  30357. case "utf16le":
  30358. case "utf-16le":
  30359. return C(this, t, i);
  30360. default:
  30361. if (a)
  30362. throw new TypeError("Unknown encoding: " + e);
  30363. e = (e + "").toLowerCase(),
  30364. a = !0
  30365. }
  30366. }
  30367. .apply(this, arguments)
  30368. }
  30369. ,
  30370. u.prototype.equals = function(e) {
  30371. if (!u.isBuffer(e))
  30372. throw new TypeError("Argument must be a Buffer");
  30373. return this === e || 0 === u.compare(this, e)
  30374. }
  30375. ,
  30376. u.prototype.inspect = function() {
  30377. var e = ""
  30378. , t = F.INSPECT_MAX_BYTES;
  30379. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30380. this.length > t && (e += " ... ")),
  30381. "<Buffer " + e + ">"
  30382. }
  30383. ,
  30384. u.prototype.compare = function(e, t, i, n, r) {
  30385. if (!u.isBuffer(e))
  30386. throw new TypeError("Argument must be a Buffer");
  30387. if (void 0 === t && (t = 0),
  30388. void 0 === i && (i = e ? e.length : 0),
  30389. void 0 === n && (n = 0),
  30390. void 0 === r && (r = this.length),
  30391. t < 0 || i > e.length || n < 0 || r > this.length)
  30392. throw new RangeError("out of range index");
  30393. if (r <= n && i <= t)
  30394. return 0;
  30395. if (r <= n)
  30396. return -1;
  30397. if (i <= t)
  30398. return 1;
  30399. if (this === e)
  30400. return 0;
  30401. 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)
  30402. if (l[h] !== c[h]) {
  30403. o = l[h],
  30404. a = c[h];
  30405. break
  30406. }
  30407. return o < a ? -1 : a < o ? 1 : 0
  30408. }
  30409. ,
  30410. u.prototype.includes = function(e, t, i) {
  30411. return -1 !== this.indexOf(e, t, i)
  30412. }
  30413. ,
  30414. u.prototype.indexOf = function(e, t, i) {
  30415. return d(this, e, t, i, !0)
  30416. }
  30417. ,
  30418. u.prototype.lastIndexOf = function(e, t, i) {
  30419. return d(this, e, t, i, !1)
  30420. }
  30421. ,
  30422. u.prototype.write = function(e, t, i, n) {
  30423. if (void 0 === t)
  30424. n = "utf8",
  30425. i = this.length,
  30426. t = 0;
  30427. else if (void 0 === i && "string" == typeof t)
  30428. n = t,
  30429. i = this.length,
  30430. t = 0;
  30431. else {
  30432. if (!isFinite(t))
  30433. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30434. t |= 0,
  30435. isFinite(i) ? (i |= 0,
  30436. void 0 === n && (n = "utf8")) : (n = i,
  30437. i = void 0)
  30438. }
  30439. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30440. if ((void 0 === i || p < i) && (i = p),
  30441. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30442. throw new RangeError("Attempt to write outside buffer bounds");
  30443. n = n || "utf8";
  30444. for (var f = !1; ; )
  30445. switch (n) {
  30446. case "hex":
  30447. return g(this, e, t, i);
  30448. case "utf8":
  30449. case "utf-8":
  30450. return u = t,
  30451. d = i,
  30452. R(S(e, (h = this).length - u), h, u, d);
  30453. case "ascii":
  30454. return m(this, e, t, i);
  30455. case "latin1":
  30456. case "binary":
  30457. return m(this, e, t, i);
  30458. case "base64":
  30459. return s = this,
  30460. l = t,
  30461. c = i,
  30462. R(M(e), s, l, c);
  30463. case "ucs2":
  30464. case "ucs-2":
  30465. case "utf16le":
  30466. case "utf-16le":
  30467. return o = t,
  30468. a = i,
  30469. R(function(e, t) {
  30470. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30471. i = e.charCodeAt(a),
  30472. n = i >> 8,
  30473. r = i % 256,
  30474. o.push(r),
  30475. o.push(n);
  30476. return o
  30477. }(e, (r = this).length - o), r, o, a);
  30478. default:
  30479. if (f)
  30480. throw new TypeError("Unknown encoding: " + n);
  30481. n = ("" + n).toLowerCase(),
  30482. f = !0
  30483. }
  30484. }
  30485. ,
  30486. u.prototype.toJSON = function() {
  30487. return {
  30488. type: "Buffer",
  30489. data: Array.prototype.slice.call(this._arr || this, 0)
  30490. }
  30491. }
  30492. ;
  30493. var D = 4096;
  30494. u.prototype.slice = function(e, t) {
  30495. var i, n = this.length;
  30496. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30497. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30498. t < e && (t = e),
  30499. u.TYPED_ARRAY_SUPPORT)
  30500. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30501. else {
  30502. var r = t - e;
  30503. i = new u(r,void 0);
  30504. for (var o = 0; o < r; ++o)
  30505. i[o] = this[o + e]
  30506. }
  30507. return i
  30508. }
  30509. ,
  30510. u.prototype.readUIntLE = function(e, t, i) {
  30511. e |= 0,
  30512. t |= 0,
  30513. i || I(e, t, this.length);
  30514. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30515. n += this[e + o] * r;
  30516. return n
  30517. }
  30518. ,
  30519. u.prototype.readUIntBE = function(e, t, i) {
  30520. e |= 0,
  30521. t |= 0,
  30522. i || I(e, t, this.length);
  30523. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30524. n += this[e + --t] * r;
  30525. return n
  30526. }
  30527. ,
  30528. u.prototype.readUInt8 = function(e, t) {
  30529. return t || I(e, 1, this.length),
  30530. this[e]
  30531. }
  30532. ,
  30533. u.prototype.readUInt16LE = function(e, t) {
  30534. return t || I(e, 2, this.length),
  30535. this[e] | this[e + 1] << 8
  30536. }
  30537. ,
  30538. u.prototype.readUInt16BE = function(e, t) {
  30539. return t || I(e, 2, this.length),
  30540. this[e] << 8 | this[e + 1]
  30541. }
  30542. ,
  30543. u.prototype.readUInt32LE = function(e, t) {
  30544. return t || I(e, 4, this.length),
  30545. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30546. }
  30547. ,
  30548. u.prototype.readUInt32BE = function(e, t) {
  30549. return t || I(e, 4, this.length),
  30550. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30551. }
  30552. ,
  30553. u.prototype.readIntLE = function(e, t, i) {
  30554. e |= 0,
  30555. t |= 0,
  30556. i || I(e, t, this.length);
  30557. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30558. n += this[e + o] * r;
  30559. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30560. n
  30561. }
  30562. ,
  30563. u.prototype.readIntBE = function(e, t, i) {
  30564. e |= 0,
  30565. t |= 0,
  30566. i || I(e, t, this.length);
  30567. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30568. o += this[e + --n] * r;
  30569. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30570. o
  30571. }
  30572. ,
  30573. u.prototype.readInt8 = function(e, t) {
  30574. return t || I(e, 1, this.length),
  30575. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30576. }
  30577. ,
  30578. u.prototype.readInt16LE = function(e, t) {
  30579. t || I(e, 2, this.length);
  30580. var i = this[e] | this[e + 1] << 8;
  30581. return 32768 & i ? 4294901760 | i : i
  30582. }
  30583. ,
  30584. u.prototype.readInt16BE = function(e, t) {
  30585. t || I(e, 2, this.length);
  30586. var i = this[e + 1] | this[e] << 8;
  30587. return 32768 & i ? 4294901760 | i : i
  30588. }
  30589. ,
  30590. u.prototype.readInt32LE = function(e, t) {
  30591. return t || I(e, 4, this.length),
  30592. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30593. }
  30594. ,
  30595. u.prototype.readInt32BE = function(e, t) {
  30596. return t || I(e, 4, this.length),
  30597. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30598. }
  30599. ,
  30600. u.prototype.readFloatLE = function(e, t) {
  30601. return t || I(e, 4, this.length),
  30602. O.read(this, e, !0, 23, 4)
  30603. }
  30604. ,
  30605. u.prototype.readFloatBE = function(e, t) {
  30606. return t || I(e, 4, this.length),
  30607. O.read(this, e, !1, 23, 4)
  30608. }
  30609. ,
  30610. u.prototype.readDoubleLE = function(e, t) {
  30611. return t || I(e, 8, this.length),
  30612. O.read(this, e, !0, 52, 8)
  30613. }
  30614. ,
  30615. u.prototype.readDoubleBE = function(e, t) {
  30616. return t || I(e, 8, this.length),
  30617. O.read(this, e, !1, 52, 8)
  30618. }
  30619. ,
  30620. u.prototype.writeUIntLE = function(e, t, i, n) {
  30621. e = +e,
  30622. t |= 0,
  30623. i |= 0,
  30624. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30625. var r = 1
  30626. , o = 0;
  30627. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30628. this[t + o] = e / r & 255;
  30629. return t + i
  30630. }
  30631. ,
  30632. u.prototype.writeUIntBE = function(e, t, i, n) {
  30633. e = +e,
  30634. t |= 0,
  30635. i |= 0,
  30636. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30637. var r = i - 1
  30638. , o = 1;
  30639. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30640. this[t + r] = e / o & 255;
  30641. return t + i
  30642. }
  30643. ,
  30644. u.prototype.writeUInt8 = function(e, t, i) {
  30645. return e = +e,
  30646. t |= 0,
  30647. i || E(this, e, t, 1, 255, 0),
  30648. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30649. this[t] = 255 & e,
  30650. t + 1
  30651. }
  30652. ,
  30653. u.prototype.writeUInt16LE = function(e, t, i) {
  30654. return e = +e,
  30655. t |= 0,
  30656. i || E(this, e, t, 2, 65535, 0),
  30657. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30658. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30659. t + 2
  30660. }
  30661. ,
  30662. u.prototype.writeUInt16BE = function(e, t, i) {
  30663. return e = +e,
  30664. t |= 0,
  30665. i || E(this, e, t, 2, 65535, 0),
  30666. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30667. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30668. t + 2
  30669. }
  30670. ,
  30671. u.prototype.writeUInt32LE = function(e, t, i) {
  30672. return e = +e,
  30673. t |= 0,
  30674. i || E(this, e, t, 4, 4294967295, 0),
  30675. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30676. this[t + 2] = e >>> 16,
  30677. this[t + 1] = e >>> 8,
  30678. this[t] = 255 & e) : b(this, e, t, !0),
  30679. t + 4
  30680. }
  30681. ,
  30682. u.prototype.writeUInt32BE = function(e, t, i) {
  30683. return e = +e,
  30684. t |= 0,
  30685. i || E(this, e, t, 4, 4294967295, 0),
  30686. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30687. this[t + 1] = e >>> 16,
  30688. this[t + 2] = e >>> 8,
  30689. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30690. t + 4
  30691. }
  30692. ,
  30693. u.prototype.writeIntLE = function(e, t, i, n) {
  30694. if (e = +e,
  30695. t |= 0,
  30696. !n) {
  30697. var r = Math.pow(2, 8 * i - 1);
  30698. E(this, e, t, i, r - 1, -r)
  30699. }
  30700. var o = 0
  30701. , a = 1
  30702. , s = 0;
  30703. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30704. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30705. this[t + o] = (e / a >> 0) - s & 255;
  30706. return t + i
  30707. }
  30708. ,
  30709. u.prototype.writeIntBE = function(e, t, i, n) {
  30710. if (e = +e,
  30711. t |= 0,
  30712. !n) {
  30713. var r = Math.pow(2, 8 * i - 1);
  30714. E(this, e, t, i, r - 1, -r)
  30715. }
  30716. var o = i - 1
  30717. , a = 1
  30718. , s = 0;
  30719. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30720. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30721. this[t + o] = (e / a >> 0) - s & 255;
  30722. return t + i
  30723. }
  30724. ,
  30725. u.prototype.writeInt8 = function(e, t, i) {
  30726. return e = +e,
  30727. t |= 0,
  30728. i || E(this, e, t, 1, 127, -128),
  30729. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30730. e < 0 && (e = 255 + e + 1),
  30731. this[t] = 255 & e,
  30732. t + 1
  30733. }
  30734. ,
  30735. u.prototype.writeInt16LE = function(e, t, i) {
  30736. return e = +e,
  30737. t |= 0,
  30738. i || E(this, e, t, 2, 32767, -32768),
  30739. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30740. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30741. t + 2
  30742. }
  30743. ,
  30744. u.prototype.writeInt16BE = function(e, t, i) {
  30745. return e = +e,
  30746. t |= 0,
  30747. i || E(this, e, t, 2, 32767, -32768),
  30748. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30749. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30750. t + 2
  30751. }
  30752. ,
  30753. u.prototype.writeInt32LE = function(e, t, i) {
  30754. return e = +e,
  30755. t |= 0,
  30756. i || E(this, e, t, 4, 2147483647, -2147483648),
  30757. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30758. this[t + 1] = e >>> 8,
  30759. this[t + 2] = e >>> 16,
  30760. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30761. t + 4
  30762. }
  30763. ,
  30764. u.prototype.writeInt32BE = function(e, t, i) {
  30765. return e = +e,
  30766. t |= 0,
  30767. i || E(this, e, t, 4, 2147483647, -2147483648),
  30768. e < 0 && (e = 4294967295 + e + 1),
  30769. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30770. this[t + 1] = e >>> 16,
  30771. this[t + 2] = e >>> 8,
  30772. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30773. t + 4
  30774. }
  30775. ,
  30776. u.prototype.writeFloatLE = function(e, t, i) {
  30777. return T(this, e, t, !0, i)
  30778. }
  30779. ,
  30780. u.prototype.writeFloatBE = function(e, t, i) {
  30781. return T(this, e, t, !1, i)
  30782. }
  30783. ,
  30784. u.prototype.writeDoubleLE = function(e, t, i) {
  30785. return x(this, e, t, !0, i)
  30786. }
  30787. ,
  30788. u.prototype.writeDoubleBE = function(e, t, i) {
  30789. return x(this, e, t, !1, i)
  30790. }
  30791. ,
  30792. u.prototype.copy = function(e, t, i, n) {
  30793. if (i = i || 0,
  30794. n || 0 === n || (n = this.length),
  30795. t >= e.length && (t = e.length),
  30796. t = t || 0,
  30797. 0 < n && n < i && (n = i),
  30798. n === i)
  30799. return 0;
  30800. if (0 === e.length || 0 === this.length)
  30801. return 0;
  30802. if (t < 0)
  30803. throw new RangeError("targetStart out of bounds");
  30804. if (i < 0 || i >= this.length)
  30805. throw new RangeError("sourceStart out of bounds");
  30806. if (n < 0)
  30807. throw new RangeError("sourceEnd out of bounds");
  30808. n > this.length && (n = this.length),
  30809. e.length - t < n - i && (n = e.length - t + i);
  30810. var r, o = n - i;
  30811. if (this === e && i < t && t < n)
  30812. for (r = o - 1; 0 <= r; --r)
  30813. e[r + t] = this[r + i];
  30814. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30815. for (r = 0; r < o; ++r)
  30816. e[r + t] = this[r + i];
  30817. else
  30818. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30819. return o
  30820. }
  30821. ,
  30822. u.prototype.fill = function(e, t, i, n) {
  30823. if ("string" == typeof e) {
  30824. if ("string" == typeof t ? (n = t,
  30825. t = 0,
  30826. i = this.length) : "string" == typeof i && (n = i,
  30827. i = this.length),
  30828. 1 === e.length) {
  30829. var r = e.charCodeAt(0);
  30830. r < 256 && (e = r)
  30831. }
  30832. if (void 0 !== n && "string" != typeof n)
  30833. throw new TypeError("encoding must be a string");
  30834. if ("string" == typeof n && !u.isEncoding(n))
  30835. throw new TypeError("Unknown encoding: " + n)
  30836. } else
  30837. "number" == typeof e && (e &= 255);
  30838. if (t < 0 || this.length < t || this.length < i)
  30839. throw new RangeError("Out of range index");
  30840. if (i <= t)
  30841. return this;
  30842. var o;
  30843. if (t >>>= 0,
  30844. i = void 0 === i ? this.length : i >>> 0,
  30845. "number" == typeof (e = e || 0))
  30846. for (o = t; o < i; ++o)
  30847. this[o] = e;
  30848. else {
  30849. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30850. , s = a.length;
  30851. for (o = 0; o < i - t; ++o)
  30852. this[o + t] = a[o % s]
  30853. }
  30854. return this
  30855. }
  30856. ;
  30857. var t = /[^+\/0-9A-Za-z-_]/g
  30858. }
  30859. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30860. }
  30861. , {
  30862. "base64-js": 199,
  30863. ieee754: 200,
  30864. isarray: 201
  30865. }],
  30866. 199: [function(e, t, i) {
  30867. "use strict";
  30868. function l(e) {
  30869. var t = e.length;
  30870. if (0 < t % 4)
  30871. throw new Error("Invalid string. Length must be a multiple of 4");
  30872. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30873. }
  30874. function c(e, t, i) {
  30875. for (var n, r = [], o = t; o < i; o += 3)
  30876. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30877. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30878. var a;
  30879. return r.join("")
  30880. }
  30881. i.byteLength = function(e) {
  30882. return 3 * e.length / 4 - l(e)
  30883. }
  30884. ,
  30885. i.toByteArray = function(e) {
  30886. var t, i, n, r, o, a = e.length;
  30887. r = l(e),
  30888. o = new d(3 * a / 4 - r),
  30889. i = 0 < r ? a - 4 : a;
  30890. var s = 0;
  30891. for (t = 0; t < i; t += 4,
  30892. 3)
  30893. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30894. o[s++] = n >> 16 & 255,
  30895. o[s++] = n >> 8 & 255,
  30896. o[s++] = 255 & n;
  30897. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30898. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30899. o[s++] = n >> 8 & 255,
  30900. o[s++] = 255 & n),
  30901. o
  30902. }
  30903. ,
  30904. i.fromByteArray = function(e) {
  30905. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30906. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30907. return 1 == n ? (t = e[i - 1],
  30908. r += h[t >> 2],
  30909. r += h[t << 4 & 63],
  30910. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30911. r += h[t >> 10],
  30912. r += h[t >> 4 & 63],
  30913. r += h[t << 2 & 63],
  30914. r += "="),
  30915. o.push(r),
  30916. o.join("")
  30917. }
  30918. ;
  30919. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30920. h[r] = n[r],
  30921. u[n.charCodeAt(r)] = r;
  30922. u["-".charCodeAt(0)] = 62,
  30923. u["_".charCodeAt(0)] = 63
  30924. }
  30925. , {}],
  30926. 200: [function(e, t, i) {
  30927. i.read = function(e, t, i, n, r) {
  30928. 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];
  30929. for (u += d,
  30930. o = p & (1 << -h) - 1,
  30931. p >>= -h,
  30932. h += s; 0 < h; o = 256 * o + e[t + u],
  30933. u += d,
  30934. h -= 8)
  30935. ;
  30936. for (a = o & (1 << -h) - 1,
  30937. o >>= -h,
  30938. h += n; 0 < h; a = 256 * a + e[t + u],
  30939. u += d,
  30940. h -= 8)
  30941. ;
  30942. if (0 === o)
  30943. o = 1 - c;
  30944. else {
  30945. if (o === l)
  30946. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30947. a += Math.pow(2, n),
  30948. o -= c
  30949. }
  30950. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30951. }
  30952. ,
  30953. i.write = function(e, t, i, n, r, o) {
  30954. 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;
  30955. for (t = Math.abs(t),
  30956. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30957. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30958. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30959. l *= 2),
  30960. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30961. l /= 2),
  30962. h <= a + u ? (s = 0,
  30963. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30964. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30965. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30966. p += f,
  30967. s /= 256,
  30968. r -= 8)
  30969. ;
  30970. for (a = a << r | s,
  30971. c += r; 0 < c; e[i + p] = 255 & a,
  30972. p += f,
  30973. a /= 256,
  30974. c -= 8)
  30975. ;
  30976. e[i + p - f] |= 128 * g
  30977. }
  30978. }
  30979. , {}],
  30980. 201: [function(e, t, i) {
  30981. var n = {}.toString;
  30982. t.exports = Array.isArray || function(e) {
  30983. return "[object Array]" == n.call(e)
  30984. }
  30985. }
  30986. , {}],
  30987. 202: [function(e, t, i) {
  30988. function n() {
  30989. this._events = this._events || {},
  30990. this._maxListeners = this._maxListeners || void 0
  30991. }
  30992. function l(e) {
  30993. return "function" == typeof e
  30994. }
  30995. function c(e) {
  30996. return "object" == typeof e && null !== e
  30997. }
  30998. function h(e) {
  30999. return void 0 === e
  31000. }
  31001. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31002. n.prototype._maxListeners = void 0,
  31003. n.defaultMaxListeners = 10,
  31004. n.prototype.setMaxListeners = function(e) {
  31005. if (!function(e) {
  31006. return "number" == typeof e
  31007. }(e) || e < 0 || isNaN(e))
  31008. throw TypeError("n must be a positive number");
  31009. return this._maxListeners = e,
  31010. this
  31011. }
  31012. ,
  31013. n.prototype.emit = function(e) {
  31014. var t, i, n, r, o, a;
  31015. if (this._events || (this._events = {}),
  31016. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31017. if ((t = arguments[1])instanceof Error)
  31018. throw t;
  31019. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31020. throw s.context = t,
  31021. s
  31022. }
  31023. if (h(i = this._events[e]))
  31024. return !1;
  31025. if (l(i))
  31026. switch (arguments.length) {
  31027. case 1:
  31028. i.call(this);
  31029. break;
  31030. case 2:
  31031. i.call(this, arguments[1]);
  31032. break;
  31033. case 3:
  31034. i.call(this, arguments[1], arguments[2]);
  31035. break;
  31036. default:
  31037. r = Array.prototype.slice.call(arguments, 1),
  31038. i.apply(this, r)
  31039. }
  31040. else if (c(i))
  31041. for (r = Array.prototype.slice.call(arguments, 1),
  31042. n = (a = i.slice()).length,
  31043. o = 0; o < n; o++)
  31044. a[o].apply(this, r);
  31045. return !0
  31046. }
  31047. ,
  31048. n.prototype.on = n.prototype.addListener = function(e, t) {
  31049. var i;
  31050. if (!l(t))
  31051. throw TypeError("listener must be a function");
  31052. return this._events || (this._events = {}),
  31053. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31054. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31055. 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,
  31056. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31057. "function" == typeof console.trace && console.trace())),
  31058. this
  31059. }
  31060. ,
  31061. n.prototype.once = function(e, t) {
  31062. function i() {
  31063. this.removeListener(e, i),
  31064. n || (n = !0,
  31065. t.apply(this, arguments))
  31066. }
  31067. if (!l(t))
  31068. throw TypeError("listener must be a function");
  31069. var n = !1;
  31070. return i.listener = t,
  31071. this.on(e, i),
  31072. this
  31073. }
  31074. ,
  31075. n.prototype.removeListener = function(e, t) {
  31076. var i, n, r, o;
  31077. if (!l(t))
  31078. throw TypeError("listener must be a function");
  31079. if (!this._events || !this._events[e])
  31080. return this;
  31081. if (r = (i = this._events[e]).length,
  31082. n = -1,
  31083. i === t || l(i.listener) && i.listener === t)
  31084. delete this._events[e],
  31085. this._events.removeListener && this.emit("removeListener", e, t);
  31086. else if (c(i)) {
  31087. for (o = r; 0 < o--; )
  31088. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31089. n = o;
  31090. break
  31091. }
  31092. if (n < 0)
  31093. return this;
  31094. 1 === i.length ? (i.length = 0,
  31095. delete this._events[e]) : i.splice(n, 1),
  31096. this._events.removeListener && this.emit("removeListener", e, t)
  31097. }
  31098. return this
  31099. }
  31100. ,
  31101. n.prototype.removeAllListeners = function(e) {
  31102. var t, i;
  31103. if (!this._events)
  31104. return this;
  31105. if (!this._events.removeListener)
  31106. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31107. this;
  31108. if (0 === arguments.length) {
  31109. for (t in this._events)
  31110. "removeListener" !== t && this.removeAllListeners(t);
  31111. return this.removeAllListeners("removeListener"),
  31112. this._events = {},
  31113. this
  31114. }
  31115. if (l(i = this._events[e]))
  31116. this.removeListener(e, i);
  31117. else if (i)
  31118. for (; i.length; )
  31119. this.removeListener(e, i[i.length - 1]);
  31120. return delete this._events[e],
  31121. this
  31122. }
  31123. ,
  31124. n.prototype.listeners = function(e) {
  31125. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31126. }
  31127. ,
  31128. n.prototype.listenerCount = function(e) {
  31129. if (this._events) {
  31130. var t = this._events[e];
  31131. if (l(t))
  31132. return 1;
  31133. if (t)
  31134. return t.length
  31135. }
  31136. return 0
  31137. }
  31138. ,
  31139. n.listenerCount = function(e, t) {
  31140. return e.listenerCount(t)
  31141. }
  31142. }
  31143. , {}],
  31144. 203: [function(e, t, i) {
  31145. function n() {
  31146. throw new Error("setTimeout has not been defined")
  31147. }
  31148. function r() {
  31149. throw new Error("clearTimeout has not been defined")
  31150. }
  31151. function o(t) {
  31152. if (h === setTimeout)
  31153. return setTimeout(t, 0);
  31154. if ((h === n || !h) && setTimeout)
  31155. return h = setTimeout,
  31156. setTimeout(t, 0);
  31157. try {
  31158. return h(t, 0)
  31159. } catch (e) {
  31160. try {
  31161. return h.call(null, t, 0)
  31162. } catch (e) {
  31163. return h.call(this, t, 0)
  31164. }
  31165. }
  31166. }
  31167. function a() {
  31168. g && p && (g = !1,
  31169. p.length ? f = p.concat(f) : m = -1,
  31170. f.length && s())
  31171. }
  31172. function s() {
  31173. if (!g) {
  31174. var e = o(a);
  31175. g = !0;
  31176. for (var t = f.length; t; ) {
  31177. for (p = f,
  31178. f = []; ++m < t; )
  31179. p && p[m].run();
  31180. m = -1,
  31181. t = f.length
  31182. }
  31183. p = null,
  31184. g = !1,
  31185. function(t) {
  31186. if (u === clearTimeout)
  31187. return clearTimeout(t);
  31188. if ((u === r || !u) && clearTimeout)
  31189. return u = clearTimeout,
  31190. clearTimeout(t);
  31191. try {
  31192. u(t)
  31193. } catch (e) {
  31194. try {
  31195. return u.call(null, t)
  31196. } catch (e) {
  31197. return u.call(this, t)
  31198. }
  31199. }
  31200. }(e)
  31201. }
  31202. }
  31203. function l(e, t) {
  31204. this.fun = e,
  31205. this.array = t
  31206. }
  31207. function c() {}
  31208. var h, u, d = t.exports = {};
  31209. !function() {
  31210. try {
  31211. h = "function" == typeof setTimeout ? setTimeout : n
  31212. } catch (e) {
  31213. h = n
  31214. }
  31215. try {
  31216. u = "function" == typeof clearTimeout ? clearTimeout : r
  31217. } catch (e) {
  31218. u = r
  31219. }
  31220. }();
  31221. var p, f = [], g = !1, m = -1;
  31222. d.nextTick = function(e) {
  31223. var t = new Array(arguments.length - 1);
  31224. if (1 < arguments.length)
  31225. for (var i = 1; i < arguments.length; i++)
  31226. t[i - 1] = arguments[i];
  31227. f.push(new l(e,t)),
  31228. 1 !== f.length || g || o(s)
  31229. }
  31230. ,
  31231. l.prototype.run = function() {
  31232. this.fun.apply(null, this.array)
  31233. }
  31234. ,
  31235. d.title = "browser",
  31236. d.browser = !0,
  31237. d.env = {},
  31238. d.argv = [],
  31239. d.version = "",
  31240. d.versions = {},
  31241. d.on = c,
  31242. d.addListener = c,
  31243. d.once = c,
  31244. d.off = c,
  31245. d.removeListener = c,
  31246. d.removeAllListeners = c,
  31247. d.emit = c,
  31248. d.binding = function(e) {
  31249. throw new Error("process.binding is not supported")
  31250. }
  31251. ,
  31252. d.cwd = function() {
  31253. return "/"
  31254. }
  31255. ,
  31256. d.chdir = function(e) {
  31257. throw new Error("process.chdir is not supported")
  31258. }
  31259. ,
  31260. d.umask = function() {
  31261. return 0
  31262. }
  31263. }
  31264. , {}],
  31265. 204: [function(e, O, L) {
  31266. (function(P) {
  31267. !function(e) {
  31268. function v(e) {
  31269. throw new RangeError(g[e])
  31270. }
  31271. function r(e, t) {
  31272. for (var i = e.length, n = []; i--; )
  31273. n[i] = t(e[i]);
  31274. return n
  31275. }
  31276. function t(e, t) {
  31277. var i = e.split("@")
  31278. , n = "";
  31279. return 1 < i.length && (n = i[0] + "@",
  31280. e = i[1]),
  31281. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31282. }
  31283. function y(e) {
  31284. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31285. 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),
  31286. r--) : n.push(t);
  31287. return n
  31288. }
  31289. function A(e) {
  31290. return r(e, function(e) {
  31291. var t = "";
  31292. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31293. e = 56320 | 1023 & e),
  31294. t + R(e)
  31295. }).join("")
  31296. }
  31297. function C(e, t) {
  31298. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31299. }
  31300. function I(e, t, i) {
  31301. var n = 0;
  31302. for (e = i ? M(e / u) : e >> 1,
  31303. e += M(e / t); m * w >> 1 < e; n += _)
  31304. e = M(e / m);
  31305. return M(n + (m + 1) * e / (e + h))
  31306. }
  31307. function i(e) {
  31308. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31309. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31310. n = 0; n < i; ++n)
  31311. 128 <= e.charCodeAt(n) && v("not-basic"),
  31312. d.push(e.charCodeAt(n));
  31313. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31314. for (o = f,
  31315. a = 1,
  31316. s = _; p <= r && v("invalid-input"),
  31317. u = e.charCodeAt(r++),
  31318. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31319. f += l * a,
  31320. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31321. a > M(E / (h = _ - c)) && v("overflow"),
  31322. a *= h;
  31323. m = I(f - o, t = d.length + 1, 0 == o),
  31324. M(f / t) > E - g && v("overflow"),
  31325. g += M(f / t),
  31326. f %= t,
  31327. d.splice(f++, 0, g)
  31328. }
  31329. return A(d)
  31330. }
  31331. function n(e) {
  31332. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31333. for (d = (e = y(e)).length,
  31334. t = x,
  31335. o = T,
  31336. a = i = 0; a < d; ++a)
  31337. (u = e[a]) < 128 && m.push(R(u));
  31338. for (n = r = m.length,
  31339. r && m.push(S); n < d; ) {
  31340. for (s = E,
  31341. a = 0; a < d; ++a)
  31342. t <= (u = e[a]) && u < s && (s = u);
  31343. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31344. i += (s - t) * p,
  31345. t = s,
  31346. a = 0; a < d; ++a)
  31347. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31348. u == t) {
  31349. for (l = i,
  31350. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31351. g = l - h,
  31352. f = _ - h,
  31353. m.push(R(C(h + g % f, 0))),
  31354. l = M(g / f);
  31355. m.push(R(C(l, 0))),
  31356. o = I(i, p, n == r),
  31357. i = 0,
  31358. ++n
  31359. }
  31360. ++i,
  31361. ++t
  31362. }
  31363. return m.join("")
  31364. }
  31365. var o = "object" == typeof L && L && !L.nodeType && L
  31366. , a = "object" == typeof O && O && !O.nodeType && O
  31367. , s = "object" == typeof P && P;
  31368. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31369. 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 = {
  31370. overflow: "Overflow: input needs wider integers to process",
  31371. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31372. "invalid-input": "Invalid input"
  31373. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31374. if (l = {
  31375. version: "1.4.1",
  31376. ucs2: {
  31377. decode: y,
  31378. encode: A
  31379. },
  31380. decode: i,
  31381. encode: n,
  31382. toASCII: function(e) {
  31383. return t(e, function(e) {
  31384. return p.test(e) ? "xn--" + n(e) : e
  31385. })
  31386. },
  31387. toUnicode: function(e) {
  31388. return t(e, function(e) {
  31389. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31390. })
  31391. }
  31392. },
  31393. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31394. define("punycode", function() {
  31395. return l
  31396. });
  31397. else if (o && a)
  31398. if (O.exports == o)
  31399. a.exports = l;
  31400. else
  31401. for (c in l)
  31402. l.hasOwnProperty(c) && (o[c] = l[c]);
  31403. else
  31404. e.punycode = l
  31405. }(this)
  31406. }
  31407. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31408. }
  31409. , {}],
  31410. 205: [function(e, t, i) {
  31411. "use strict";
  31412. t.exports = function(e, t, i, n) {
  31413. t = t || "&",
  31414. i = i || "=";
  31415. var r = {};
  31416. if ("string" != typeof e || 0 === e.length)
  31417. return r;
  31418. var o = /\+/g;
  31419. e = e.split(t);
  31420. var a = 1e3;
  31421. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31422. var s, l, c = e.length;
  31423. 0 < a && a < c && (c = a);
  31424. for (var h = 0; h < c; ++h) {
  31425. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31426. d = 0 <= m ? (u = g.substr(0, m),
  31427. g.substr(m + 1)) : (u = g,
  31428. ""),
  31429. p = decodeURIComponent(u),
  31430. f = decodeURIComponent(d),
  31431. s = r,
  31432. l = p,
  31433. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31434. }
  31435. return r
  31436. }
  31437. ;
  31438. var v = Array.isArray || function(e) {
  31439. return "[object Array]" === Object.prototype.toString.call(e)
  31440. }
  31441. }
  31442. , {}],
  31443. 206: [function(e, t, i) {
  31444. "use strict";
  31445. function o(e, t) {
  31446. if (e.map)
  31447. return e.map(t);
  31448. for (var i = [], n = 0; n < e.length; n++)
  31449. i.push(t(e[n], n));
  31450. return i
  31451. }
  31452. function a(e) {
  31453. switch (typeof e) {
  31454. case "string":
  31455. return e;
  31456. case "boolean":
  31457. return e ? "true" : "false";
  31458. case "number":
  31459. return isFinite(e) ? e : "";
  31460. default:
  31461. return ""
  31462. }
  31463. }
  31464. t.exports = function(i, n, r, e) {
  31465. return n = n || "&",
  31466. r = r || "=",
  31467. null === i && (i = void 0),
  31468. "object" == typeof i ? o(l(i), function(e) {
  31469. var t = encodeURIComponent(a(e)) + r;
  31470. return s(i[e]) ? o(i[e], function(e) {
  31471. return t + encodeURIComponent(a(e))
  31472. }).join(n) : t + encodeURIComponent(a(i[e]))
  31473. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31474. }
  31475. ;
  31476. var s = Array.isArray || function(e) {
  31477. return "[object Array]" === Object.prototype.toString.call(e)
  31478. }
  31479. , l = Object.keys || function(e) {
  31480. var t = [];
  31481. for (var i in e)
  31482. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31483. return t
  31484. }
  31485. }
  31486. , {}],
  31487. 207: [function(e, t, i) {
  31488. "use strict";
  31489. i.decode = i.parse = e("./decode"),
  31490. i.encode = i.stringify = e("./encode")
  31491. }
  31492. , {
  31493. "./decode": 205,
  31494. "./encode": 206
  31495. }],
  31496. 208: [function(e, t, i) {
  31497. "use strict";
  31498. function x() {
  31499. this.protocol = null,
  31500. this.slashes = null,
  31501. this.auth = null,
  31502. this.host = null,
  31503. this.port = null,
  31504. this.hostname = null,
  31505. this.hash = null,
  31506. this.search = null,
  31507. this.query = null,
  31508. this.pathname = null,
  31509. this.path = null,
  31510. this.href = null
  31511. }
  31512. function n(e, t, i) {
  31513. if (e && D.isObject(e) && e instanceof x)
  31514. return e;
  31515. var n = new x;
  31516. return n.parse(e, t, i),
  31517. n
  31518. }
  31519. var L = e("punycode")
  31520. , D = e("./util");
  31521. i.parse = n,
  31522. i.resolve = function(e, t) {
  31523. return n(e, !1, !0).resolve(t)
  31524. }
  31525. ,
  31526. i.resolveObject = function(e, t) {
  31527. return e ? n(e, !1, !0).resolveObject(t) : t
  31528. }
  31529. ,
  31530. i.format = function(e) {
  31531. return D.isString(e) && (e = n(e)),
  31532. e instanceof x ? e.format() : x.prototype.format.call(e)
  31533. }
  31534. ,
  31535. i.Url = x;
  31536. var N = /^([a-z0-9.+-]+:)/i
  31537. , r = /:[0-9]*$/
  31538. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31539. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31540. , B = ["'"].concat(o)
  31541. , V = ["%", "/", "?", ";", "#"].concat(B)
  31542. , k = ["/", "?", "#"]
  31543. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31544. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31545. , z = {
  31546. javascript: !0,
  31547. "javascript:": !0
  31548. }
  31549. , G = {
  31550. javascript: !0,
  31551. "javascript:": !0
  31552. }
  31553. , W = {
  31554. http: !0,
  31555. https: !0,
  31556. ftp: !0,
  31557. gopher: !0,
  31558. file: !0,
  31559. "http:": !0,
  31560. "https:": !0,
  31561. "ftp:": !0,
  31562. "gopher:": !0,
  31563. "file:": !0
  31564. }
  31565. , j = e("querystring");
  31566. x.prototype.parse = function(e, t, i) {
  31567. if (!D.isString(e))
  31568. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31569. var n = e.indexOf("?")
  31570. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31571. , o = e.split(r);
  31572. o[0] = o[0].replace(/\\/g, "/");
  31573. var a = e = o.join(r);
  31574. if (a = a.trim(),
  31575. !i && 1 === e.split("#").length) {
  31576. var s = F.exec(a);
  31577. if (s)
  31578. return this.path = a,
  31579. this.href = a,
  31580. this.pathname = s[1],
  31581. s[2] ? (this.search = s[2],
  31582. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31583. this.query = {}),
  31584. this
  31585. }
  31586. var l = N.exec(a);
  31587. if (l) {
  31588. var c = (l = l[0]).toLowerCase();
  31589. this.protocol = c,
  31590. a = a.substr(l.length)
  31591. }
  31592. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31593. var h = "//" === a.substr(0, 2);
  31594. !h || l && G[l] || (a = a.substr(2),
  31595. this.slashes = !0)
  31596. }
  31597. if (!G[l] && (h || l && !W[l])) {
  31598. for (var u = -1, d = 0; d < k.length; d++) {
  31599. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31600. }
  31601. var p, f;
  31602. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31603. a = a.slice(f + 1),
  31604. this.auth = decodeURIComponent(p)),
  31605. u = -1;
  31606. for (d = 0; d < V.length; d++) {
  31607. var g;
  31608. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31609. }
  31610. -1 === u && (u = a.length),
  31611. this.host = a.slice(0, u),
  31612. a = a.slice(u),
  31613. this.parseHost(),
  31614. this.hostname = this.hostname || "";
  31615. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31616. if (!m)
  31617. for (var v = this.hostname.split(/\./), y = (d = 0,
  31618. v.length); d < y; d++) {
  31619. var A = v[d];
  31620. if (A && !A.match(U)) {
  31621. for (var C = "", I = 0, E = A.length; I < E; I++)
  31622. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31623. if (!C.match(U)) {
  31624. var _ = v.slice(0, d)
  31625. , b = v.slice(d + 1)
  31626. , w = A.match(H);
  31627. w && (_.push(w[1]),
  31628. b.unshift(w[2])),
  31629. b.length && (a = "/" + b.join(".") + a),
  31630. this.hostname = _.join(".");
  31631. break
  31632. }
  31633. }
  31634. }
  31635. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31636. m || (this.hostname = L.toASCII(this.hostname));
  31637. var T = this.port ? ":" + this.port : ""
  31638. , x = this.hostname || "";
  31639. this.host = x + T,
  31640. this.href += this.host,
  31641. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31642. "/" !== a[0] && (a = "/" + a))
  31643. }
  31644. if (!z[c])
  31645. for (d = 0,
  31646. y = B.length; d < y; d++) {
  31647. var S = B[d];
  31648. if (-1 !== a.indexOf(S)) {
  31649. var M = encodeURIComponent(S);
  31650. M === S && (M = escape(S)),
  31651. a = a.split(S).join(M)
  31652. }
  31653. }
  31654. var R = a.indexOf("#");
  31655. -1 !== R && (this.hash = a.substr(R),
  31656. a = a.slice(0, R));
  31657. var P = a.indexOf("?");
  31658. if (-1 !== P ? (this.search = a.substr(P),
  31659. this.query = a.substr(P + 1),
  31660. t && (this.query = j.parse(this.query)),
  31661. a = a.slice(0, P)) : t && (this.search = "",
  31662. this.query = {}),
  31663. a && (this.pathname = a),
  31664. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31665. this.pathname || this.search) {
  31666. T = this.pathname || "";
  31667. var O = this.search || "";
  31668. this.path = T + O
  31669. }
  31670. return this.href = this.format(),
  31671. this
  31672. }
  31673. ,
  31674. x.prototype.format = function() {
  31675. var e = this.auth || "";
  31676. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31677. e += "@");
  31678. var t = this.protocol || ""
  31679. , i = this.pathname || ""
  31680. , n = this.hash || ""
  31681. , r = !1
  31682. , o = "";
  31683. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31684. this.port && (r += ":" + this.port)),
  31685. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31686. var a = this.search || o && "?" + o || "";
  31687. return t && ":" !== t.substr(-1) && (t += ":"),
  31688. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31689. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31690. n && "#" !== n.charAt(0) && (n = "#" + n),
  31691. a && "?" !== a.charAt(0) && (a = "?" + a),
  31692. t + r + (i = i.replace(/[?#]/g, function(e) {
  31693. return encodeURIComponent(e)
  31694. })) + (a = a.replace("#", "%23")) + n
  31695. }
  31696. ,
  31697. x.prototype.resolve = function(e) {
  31698. return this.resolveObject(n(e, !1, !0)).format()
  31699. }
  31700. ,
  31701. x.prototype.resolveObject = function(e) {
  31702. if (D.isString(e)) {
  31703. var t = new x;
  31704. t.parse(e, !1, !0),
  31705. e = t
  31706. }
  31707. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31708. var o = n[r];
  31709. i[o] = this[o]
  31710. }
  31711. if (i.hash = e.hash,
  31712. "" === e.href)
  31713. return i.href = i.format(),
  31714. i;
  31715. if (e.slashes && !e.protocol) {
  31716. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31717. var l = a[s];
  31718. "protocol" !== l && (i[l] = e[l])
  31719. }
  31720. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31721. i.href = i.format(),
  31722. i
  31723. }
  31724. if (e.protocol && e.protocol !== i.protocol) {
  31725. if (!W[e.protocol]) {
  31726. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31727. var u = c[h];
  31728. i[u] = e[u]
  31729. }
  31730. return i.href = i.format(),
  31731. i
  31732. }
  31733. if (i.protocol = e.protocol,
  31734. e.host || G[e.protocol])
  31735. i.pathname = e.pathname;
  31736. else {
  31737. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31738. ;
  31739. e.host || (e.host = ""),
  31740. e.hostname || (e.hostname = ""),
  31741. "" !== d[0] && d.unshift(""),
  31742. d.length < 2 && d.unshift(""),
  31743. i.pathname = d.join("/")
  31744. }
  31745. if (i.search = e.search,
  31746. i.query = e.query,
  31747. i.host = e.host || "",
  31748. i.auth = e.auth,
  31749. i.hostname = e.hostname || e.host,
  31750. i.port = e.port,
  31751. i.pathname || i.search) {
  31752. var p = i.pathname || ""
  31753. , f = i.search || "";
  31754. i.path = p + f
  31755. }
  31756. return i.slashes = i.slashes || e.slashes,
  31757. i.href = i.format(),
  31758. i
  31759. }
  31760. var g = i.pathname && "/" === i.pathname.charAt(0)
  31761. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31762. , v = m || g || i.host && e.pathname
  31763. , y = v
  31764. , A = i.pathname && i.pathname.split("/") || []
  31765. , C = (d = e.pathname && e.pathname.split("/") || [],
  31766. i.protocol && !W[i.protocol]);
  31767. if (C && (i.hostname = "",
  31768. i.port = null,
  31769. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31770. i.host = "",
  31771. e.protocol && (e.hostname = null,
  31772. e.port = null,
  31773. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31774. e.host = null),
  31775. v = v && ("" === d[0] || "" === A[0])),
  31776. m)
  31777. i.host = e.host || "" === e.host ? e.host : i.host,
  31778. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31779. i.search = e.search,
  31780. i.query = e.query,
  31781. A = d;
  31782. else if (d.length)
  31783. (A = A || []).pop(),
  31784. A = A.concat(d),
  31785. i.search = e.search,
  31786. i.query = e.query;
  31787. else if (!D.isNullOrUndefined(e.search)) {
  31788. if (C)
  31789. i.hostname = i.host = A.shift(),
  31790. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31791. i.host = i.hostname = w.shift());
  31792. return i.search = e.search,
  31793. i.query = e.query,
  31794. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31795. i.href = i.format(),
  31796. i
  31797. }
  31798. if (!A.length)
  31799. return i.pathname = null,
  31800. i.search ? i.path = "/" + i.search : i.path = null,
  31801. i.href = i.format(),
  31802. i;
  31803. 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--)
  31804. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31805. _++) : _ && (A.splice(b, 1),
  31806. _--);
  31807. if (!v && !y)
  31808. for (; _--; )
  31809. A.unshift("..");
  31810. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31811. E && "/" !== A.join("/").substr(-1) && A.push("");
  31812. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31813. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31814. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31815. i.host = i.hostname = w.shift()));
  31816. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31817. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31818. i.path = null),
  31819. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31820. i.auth = e.auth || i.auth,
  31821. i.slashes = i.slashes || e.slashes,
  31822. i.href = i.format(),
  31823. i
  31824. }
  31825. ,
  31826. x.prototype.parseHost = function() {
  31827. var e = this.host
  31828. , t = r.exec(e);
  31829. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31830. e = e.substr(0, e.length - t.length)),
  31831. e && (this.hostname = e)
  31832. }
  31833. }
  31834. , {
  31835. "./util": 209,
  31836. punycode: 204,
  31837. querystring: 207
  31838. }],
  31839. 209: [function(e, t, i) {
  31840. "use strict";
  31841. t.exports = {
  31842. isString: function(e) {
  31843. return "string" == typeof e
  31844. },
  31845. isObject: function(e) {
  31846. return "object" == typeof e && null !== e
  31847. },
  31848. isNull: function(e) {
  31849. return null === e
  31850. },
  31851. isNullOrUndefined: function(e) {
  31852. return null == e
  31853. }
  31854. }
  31855. }
  31856. , {}],
  31857. 210: [function(e, t, i) {
  31858. "use strict";
  31859. function r(e) {
  31860. return c + e
  31861. }
  31862. function s(e) {
  31863. if ("string" != typeof e)
  31864. throw new TypeError("key must be a string.")
  31865. }
  31866. var l = Object.prototype.hasOwnProperty
  31867. , c = "~";
  31868. t.exports = function(t) {
  31869. var o = Object.create(null)
  31870. , n = 0
  31871. , a = {};
  31872. return function(e, t) {
  31873. for (var i in t)
  31874. Object.defineProperty(e, i, {
  31875. value: t[i],
  31876. configurable: !0,
  31877. writable: !0
  31878. })
  31879. }(a, {
  31880. get: function(e, t) {
  31881. s(e);
  31882. var i = r(e);
  31883. return i in o ? o[i] : t
  31884. },
  31885. set: function(e, t) {
  31886. s(e);
  31887. var i = r(e);
  31888. return i in o || ++n,
  31889. o[i] = t
  31890. },
  31891. has: function(e) {
  31892. return s(e),
  31893. r(e)in o
  31894. },
  31895. delete: function(e) {
  31896. s(e);
  31897. var t = r(e);
  31898. return t in o && (--n,
  31899. delete o[t],
  31900. !0)
  31901. },
  31902. clear: function() {
  31903. o = Object.create(null),
  31904. n = 0
  31905. },
  31906. forEach: function(e, t) {
  31907. if ("function" != typeof e)
  31908. throw new TypeError("`callback` must be a function");
  31909. for (var i in o)
  31910. if (l.call(o, i)) {
  31911. var n = i.substring(c.length)
  31912. , r = o[i];
  31913. e.call(t, r, n, a)
  31914. }
  31915. }
  31916. }),
  31917. Object.defineProperty(a, "size", {
  31918. get: function() {
  31919. return n
  31920. },
  31921. configurable: !0
  31922. }),
  31923. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31924. a.set(e, t[e])
  31925. }),
  31926. a
  31927. }
  31928. }
  31929. , {}],
  31930. 211: [function(e, t, i) {
  31931. t.exports = e("./lib/heap")
  31932. }
  31933. , {
  31934. "./lib/heap": 212
  31935. }],
  31936. 212: [function(e, y, A) {
  31937. (function() {
  31938. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31939. function v(e) {
  31940. this.cmp = null != e ? e : d,
  31941. this.nodes = []
  31942. }
  31943. l = Math.floor,
  31944. m = Math.min,
  31945. d = function(e, t) {
  31946. return e < t ? -1 : t < e ? 1 : 0
  31947. }
  31948. ,
  31949. g = function(e, t, i, n, r) {
  31950. var o;
  31951. if (null == i && (i = 0),
  31952. null == r && (r = d),
  31953. i < 0)
  31954. throw new Error("lo must be non-negative");
  31955. for (null == n && (n = e.length); i < n; )
  31956. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31957. return [].splice.apply(e, [i, i - i].concat(t)),
  31958. t
  31959. }
  31960. ,
  31961. t = function(e, t, i) {
  31962. return null == i && (i = d),
  31963. e.push(t),
  31964. h(e, 0, e.length - 1, i)
  31965. }
  31966. ,
  31967. f = function(e, t) {
  31968. var i, n;
  31969. return null == t && (t = d),
  31970. i = e.pop(),
  31971. e.length ? (n = e[0],
  31972. e[0] = i,
  31973. u(e, 0, t)) : n = i,
  31974. n
  31975. }
  31976. ,
  31977. i = function(e, t, i) {
  31978. var n;
  31979. return null == i && (i = d),
  31980. n = e[0],
  31981. e[0] = t,
  31982. u(e, 0, i),
  31983. n
  31984. }
  31985. ,
  31986. c = function(e, t, i) {
  31987. var n;
  31988. return null == i && (i = d),
  31989. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31990. e[0] = n[1],
  31991. u(e, 0, i)),
  31992. t
  31993. }
  31994. ,
  31995. p = function(i, e) {
  31996. var t, n, r, o, a, s;
  31997. for (null == e && (e = d),
  31998. a = [],
  31999. n = 0,
  32000. r = (o = function() {
  32001. s = [];
  32002. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32003. s.push(e);
  32004. return s
  32005. }
  32006. .apply(this).reverse()).length; n < r; n++)
  32007. t = o[n],
  32008. a.push(u(i, t, e));
  32009. return a
  32010. }
  32011. ,
  32012. o = function(e, t, i) {
  32013. var n;
  32014. if (null == i && (i = d),
  32015. -1 !== (n = e.indexOf(t)))
  32016. return h(e, 0, n, i),
  32017. u(e, n, i)
  32018. }
  32019. ,
  32020. n = function(e, t, i) {
  32021. var n, r, o, a, s;
  32022. if (null == i && (i = d),
  32023. !(r = e.slice(0, t)).length)
  32024. return r;
  32025. for (p(r, i),
  32026. o = 0,
  32027. a = (s = e.slice(t)).length; o < a; o++)
  32028. n = s[o],
  32029. c(r, n, i);
  32030. return r.sort(i).reverse()
  32031. }
  32032. ,
  32033. r = function(e, t, i) {
  32034. var n, r, o, a, s, l, c, h, u;
  32035. if (null == i && (i = d),
  32036. 10 * t <= e.length) {
  32037. if (!(o = e.slice(0, t).sort(i)).length)
  32038. return o;
  32039. for (r = o[o.length - 1],
  32040. a = 0,
  32041. l = (c = e.slice(t)).length; a < l; a++)
  32042. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32043. o.pop(),
  32044. r = o[o.length - 1]);
  32045. return o
  32046. }
  32047. for (p(e, i),
  32048. u = [],
  32049. s = 0,
  32050. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32051. u.push(f(e, i));
  32052. return u
  32053. }
  32054. ,
  32055. h = function(e, t, i, n) {
  32056. var r, o, a;
  32057. for (null == n && (n = d),
  32058. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32059. e[i] = o,
  32060. i = a;
  32061. return e[i] = r
  32062. }
  32063. ,
  32064. u = function(e, t, i) {
  32065. var n, r, o, a, s;
  32066. for (null == i && (i = d),
  32067. r = e.length,
  32068. o = e[s = t],
  32069. n = 2 * t + 1; n < r; )
  32070. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32071. e[t] = e[n],
  32072. n = 2 * (t = n) + 1;
  32073. return e[t] = o,
  32074. h(e, s, t, i)
  32075. }
  32076. ,
  32077. v.push = t,
  32078. v.pop = f,
  32079. v.replace = i,
  32080. v.pushpop = c,
  32081. v.heapify = p,
  32082. v.updateItem = o,
  32083. v.nlargest = n,
  32084. v.nsmallest = r,
  32085. v.prototype.push = function(e) {
  32086. return t(this.nodes, e, this.cmp)
  32087. }
  32088. ,
  32089. v.prototype.pop = function() {
  32090. return f(this.nodes, this.cmp)
  32091. }
  32092. ,
  32093. v.prototype.peek = function() {
  32094. return this.nodes[0]
  32095. }
  32096. ,
  32097. v.prototype.contains = function(e) {
  32098. return -1 !== this.nodes.indexOf(e)
  32099. }
  32100. ,
  32101. v.prototype.replace = function(e) {
  32102. return i(this.nodes, e, this.cmp)
  32103. }
  32104. ,
  32105. v.prototype.pushpop = function(e) {
  32106. return c(this.nodes, e, this.cmp)
  32107. }
  32108. ,
  32109. v.prototype.heapify = function() {
  32110. return p(this.nodes, this.cmp)
  32111. }
  32112. ,
  32113. v.prototype.updateItem = function(e) {
  32114. return o(this.nodes, e, this.cmp)
  32115. }
  32116. ,
  32117. v.prototype.clear = function() {
  32118. return this.nodes = []
  32119. }
  32120. ,
  32121. v.prototype.empty = function() {
  32122. return 0 === this.nodes.length
  32123. }
  32124. ,
  32125. v.prototype.size = function() {
  32126. return this.nodes.length
  32127. }
  32128. ,
  32129. v.prototype.clone = function() {
  32130. var e;
  32131. return (e = new v).nodes = this.nodes.slice(0),
  32132. e
  32133. }
  32134. ,
  32135. v.prototype.toArray = function() {
  32136. return this.nodes.slice(0)
  32137. }
  32138. ,
  32139. v.prototype.insert = v.prototype.push,
  32140. v.prototype.top = v.prototype.peek,
  32141. v.prototype.front = v.prototype.peek,
  32142. v.prototype.has = v.prototype.contains,
  32143. v.prototype.copy = v.prototype.clone,
  32144. e = v,
  32145. a = this,
  32146. s = function() {
  32147. return e
  32148. }
  32149. ,
  32150. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32151. }
  32152. ).call(this)
  32153. }
  32154. , {}],
  32155. 213: [function(e, t, i) {
  32156. function n() {}
  32157. function o(e) {
  32158. if ("object" != typeof this)
  32159. throw new TypeError("Promises must be constructed via new");
  32160. if ("function" != typeof e)
  32161. throw new TypeError("not a function");
  32162. this._state = 0,
  32163. this._handled = !1,
  32164. this._value = void 0,
  32165. this._deferreds = [],
  32166. h(e, this)
  32167. }
  32168. function r(i, n) {
  32169. for (; 3 === i._state; )
  32170. i = i._value;
  32171. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32172. void o._immediateFn(function() {
  32173. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32174. if (null !== e) {
  32175. var t;
  32176. try {
  32177. t = e(i._value)
  32178. } catch (e) {
  32179. return void s(n.promise, e)
  32180. }
  32181. a(n.promise, t)
  32182. } else
  32183. (1 === i._state ? a : s)(n.promise, i._value)
  32184. }))
  32185. }
  32186. function a(e, t) {
  32187. try {
  32188. if (t === e)
  32189. throw new TypeError("A promise cannot be resolved with itself.");
  32190. if (t && ("object" == typeof t || "function" == typeof t)) {
  32191. var i = t.then;
  32192. if (t instanceof o)
  32193. return e._state = 3,
  32194. e._value = t,
  32195. void l(e);
  32196. if ("function" == typeof i)
  32197. return void h(function(e, t) {
  32198. return function() {
  32199. e.apply(t, arguments)
  32200. }
  32201. }(i, t), e)
  32202. }
  32203. e._state = 1,
  32204. e._value = t,
  32205. l(e)
  32206. } catch (t) {
  32207. s(e, t)
  32208. }
  32209. }
  32210. function s(e, t) {
  32211. e._state = 2,
  32212. e._value = t,
  32213. l(e)
  32214. }
  32215. function l(e) {
  32216. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32217. e._handled || o._unhandledRejectionFn(e._value)
  32218. });
  32219. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32220. r(e, e._deferreds[t]);
  32221. e._deferreds = null
  32222. }
  32223. function c(e, t, i) {
  32224. this.onFulfilled = "function" == typeof e ? e : null,
  32225. this.onRejected = "function" == typeof t ? t : null,
  32226. this.promise = i
  32227. }
  32228. function h(e, t) {
  32229. var i = !1;
  32230. try {
  32231. e(function(e) {
  32232. i || (i = !0,
  32233. a(t, e))
  32234. }, function(e) {
  32235. i || (i = !0,
  32236. s(t, e))
  32237. })
  32238. } catch (e) {
  32239. if (i)
  32240. return;
  32241. i = !0,
  32242. s(t, e)
  32243. }
  32244. }
  32245. var u, d;
  32246. u = this,
  32247. d = setTimeout,
  32248. o.prototype.catch = function(e) {
  32249. return this.then(null, e)
  32250. }
  32251. ,
  32252. o.prototype.then = function(e, t) {
  32253. var i = new this.constructor(n);
  32254. return r(this, new c(e,t,i)),
  32255. i
  32256. }
  32257. ,
  32258. o.all = function(e) {
  32259. var s = Array.prototype.slice.call(e);
  32260. return new o(function(n, r) {
  32261. function o(t, e) {
  32262. try {
  32263. if (e && ("object" == typeof e || "function" == typeof e)) {
  32264. var i = e.then;
  32265. if ("function" == typeof i)
  32266. return void i.call(e, function(e) {
  32267. o(t, e)
  32268. }, r)
  32269. }
  32270. s[t] = e,
  32271. 0 == --a && n(s)
  32272. } catch (e) {
  32273. r(e)
  32274. }
  32275. }
  32276. if (0 === s.length)
  32277. return n([]);
  32278. for (var a = s.length, e = 0; e < s.length; e++)
  32279. o(e, s[e])
  32280. }
  32281. )
  32282. }
  32283. ,
  32284. o.resolve = function(t) {
  32285. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32286. e(t)
  32287. }
  32288. )
  32289. }
  32290. ,
  32291. o.reject = function(i) {
  32292. return new o(function(e, t) {
  32293. t(i)
  32294. }
  32295. )
  32296. }
  32297. ,
  32298. o.race = function(r) {
  32299. return new o(function(e, t) {
  32300. for (var i = 0, n = r.length; i < n; i++)
  32301. r[i].then(e, t)
  32302. }
  32303. )
  32304. }
  32305. ,
  32306. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32307. setImmediate(e)
  32308. }
  32309. || function(e) {
  32310. d(e, 0)
  32311. }
  32312. ,
  32313. o._unhandledRejectionFn = function(e) {
  32314. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32315. }
  32316. ,
  32317. o._setImmediateFn = function(e) {
  32318. o._immediateFn = e
  32319. }
  32320. ,
  32321. o._setUnhandledRejectionFn = function(e) {
  32322. o._unhandledRejectionFn = e
  32323. }
  32324. ,
  32325. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32326. }
  32327. , {}],
  32328. 214: [function(p, i, e) {
  32329. (function(d) {
  32330. var e, t;
  32331. e = this,
  32332. t = function(I, e) {
  32333. "use strict";
  32334. var a, t, u, i, s, n, r, o = {};
  32335. return o.ByteBuffer = I,
  32336. o.Long = I.Long || null,
  32337. o.VERSION = "5.0.1",
  32338. o.WIRE_TYPES = {},
  32339. o.WIRE_TYPES.VARINT = 0,
  32340. o.WIRE_TYPES.BITS64 = 1,
  32341. o.WIRE_TYPES.LDELIM = 2,
  32342. o.WIRE_TYPES.STARTGROUP = 3,
  32343. o.WIRE_TYPES.ENDGROUP = 4,
  32344. o.WIRE_TYPES.BITS32 = 5,
  32345. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32346. o.TYPES = {
  32347. int32: {
  32348. name: "int32",
  32349. wireType: o.WIRE_TYPES.VARINT,
  32350. defaultValue: 0
  32351. },
  32352. uint32: {
  32353. name: "uint32",
  32354. wireType: o.WIRE_TYPES.VARINT,
  32355. defaultValue: 0
  32356. },
  32357. sint32: {
  32358. name: "sint32",
  32359. wireType: o.WIRE_TYPES.VARINT,
  32360. defaultValue: 0
  32361. },
  32362. int64: {
  32363. name: "int64",
  32364. wireType: o.WIRE_TYPES.VARINT,
  32365. defaultValue: o.Long ? o.Long.ZERO : void 0
  32366. },
  32367. uint64: {
  32368. name: "uint64",
  32369. wireType: o.WIRE_TYPES.VARINT,
  32370. defaultValue: o.Long ? o.Long.UZERO : void 0
  32371. },
  32372. sint64: {
  32373. name: "sint64",
  32374. wireType: o.WIRE_TYPES.VARINT,
  32375. defaultValue: o.Long ? o.Long.ZERO : void 0
  32376. },
  32377. bool: {
  32378. name: "bool",
  32379. wireType: o.WIRE_TYPES.VARINT,
  32380. defaultValue: !1
  32381. },
  32382. double: {
  32383. name: "double",
  32384. wireType: o.WIRE_TYPES.BITS64,
  32385. defaultValue: 0
  32386. },
  32387. string: {
  32388. name: "string",
  32389. wireType: o.WIRE_TYPES.LDELIM,
  32390. defaultValue: ""
  32391. },
  32392. bytes: {
  32393. name: "bytes",
  32394. wireType: o.WIRE_TYPES.LDELIM,
  32395. defaultValue: null
  32396. },
  32397. fixed32: {
  32398. name: "fixed32",
  32399. wireType: o.WIRE_TYPES.BITS32,
  32400. defaultValue: 0
  32401. },
  32402. sfixed32: {
  32403. name: "sfixed32",
  32404. wireType: o.WIRE_TYPES.BITS32,
  32405. defaultValue: 0
  32406. },
  32407. fixed64: {
  32408. name: "fixed64",
  32409. wireType: o.WIRE_TYPES.BITS64,
  32410. defaultValue: o.Long ? o.Long.UZERO : void 0
  32411. },
  32412. sfixed64: {
  32413. name: "sfixed64",
  32414. wireType: o.WIRE_TYPES.BITS64,
  32415. defaultValue: o.Long ? o.Long.ZERO : void 0
  32416. },
  32417. float: {
  32418. name: "float",
  32419. wireType: o.WIRE_TYPES.BITS32,
  32420. defaultValue: 0
  32421. },
  32422. enum: {
  32423. name: "enum",
  32424. wireType: o.WIRE_TYPES.VARINT,
  32425. defaultValue: 0
  32426. },
  32427. message: {
  32428. name: "message",
  32429. wireType: o.WIRE_TYPES.LDELIM,
  32430. defaultValue: null
  32431. },
  32432. group: {
  32433. name: "group",
  32434. wireType: o.WIRE_TYPES.STARTGROUP,
  32435. defaultValue: null
  32436. }
  32437. },
  32438. 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],
  32439. o.ID_MIN = 1,
  32440. o.ID_MAX = 536870911,
  32441. o.convertFieldsToCamelCase = !1,
  32442. o.populateAccessors = !0,
  32443. o.populateDefaults = !0,
  32444. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32445. r.XHR = function() {
  32446. for (var e = [function() {
  32447. return new XMLHttpRequest
  32448. }
  32449. , function() {
  32450. return new ActiveXObject("Msxml2.XMLHTTP")
  32451. }
  32452. , function() {
  32453. return new ActiveXObject("Msxml3.XMLHTTP")
  32454. }
  32455. , function() {
  32456. return new ActiveXObject("Microsoft.XMLHTTP")
  32457. }
  32458. ], t = null, i = 0; i < e.length; i++) {
  32459. try {
  32460. t = e[i]()
  32461. } catch (e) {
  32462. continue
  32463. }
  32464. break
  32465. }
  32466. if (!t)
  32467. throw Error("XMLHttpRequest is not supported");
  32468. return t
  32469. }
  32470. ,
  32471. r.fetch = function(e, i) {
  32472. if (i && "function" != typeof i && (i = null),
  32473. r.IS_NODE) {
  32474. var t = p("fs");
  32475. if (i)
  32476. t.readFile(e, function(e, t) {
  32477. i(e ? null : "" + t)
  32478. });
  32479. else
  32480. try {
  32481. return t.readFileSync(e)
  32482. } catch (e) {
  32483. return null
  32484. }
  32485. } else {
  32486. var n = r.XHR();
  32487. if (n.open("GET", e, !!i),
  32488. n.setRequestHeader("Accept", "text/plain"),
  32489. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32490. !i)
  32491. return n.send(null),
  32492. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32493. if (n.onreadystatechange = function() {
  32494. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32495. }
  32496. ,
  32497. 4 == n.readyState)
  32498. return;
  32499. n.send(null)
  32500. }
  32501. }
  32502. ,
  32503. r.toCamelCase = function(e) {
  32504. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32505. return t.toUpperCase()
  32506. })
  32507. }
  32508. ,
  32509. r),
  32510. o.Lang = {
  32511. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32512. RULE: /^(?:required|optional|repeated|map)$/,
  32513. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32514. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32515. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32516. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32517. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32518. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32519. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32520. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32521. NUMBER_OCT: /^0[0-7]+$/,
  32522. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32523. BOOL: /^(?:true|false)$/i,
  32524. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32525. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32526. WHITESPACE: /\s/,
  32527. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32528. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32529. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32530. },
  32531. o.DotProto = function(r, a) {
  32532. function s(e, t) {
  32533. var i = -1
  32534. , n = 1;
  32535. if ("-" == e.charAt(0) && (n = -1,
  32536. e = e.substring(1)),
  32537. a.NUMBER_DEC.test(e))
  32538. i = parseInt(e);
  32539. else if (a.NUMBER_HEX.test(e))
  32540. i = parseInt(e.substring(2), 16);
  32541. else {
  32542. if (!a.NUMBER_OCT.test(e))
  32543. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32544. i = parseInt(e.substring(1), 8)
  32545. }
  32546. if (i = n * i | 0,
  32547. !t && i < 0)
  32548. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32549. return i
  32550. }
  32551. function o(e) {
  32552. var t = 1;
  32553. if ("-" == e.charAt(0) && (t = -1,
  32554. e = e.substring(1)),
  32555. a.NUMBER_DEC.test(e))
  32556. return t * parseInt(e, 10);
  32557. if (a.NUMBER_HEX.test(e))
  32558. return t * parseInt(e.substring(2), 16);
  32559. if (a.NUMBER_OCT.test(e))
  32560. return t * parseInt(e.substring(1), 8);
  32561. if ("inf" === e)
  32562. return t * (1 / 0);
  32563. if ("nan" === e)
  32564. return NaN;
  32565. if (a.NUMBER_FLT.test(e))
  32566. return t * parseFloat(e);
  32567. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32568. }
  32569. function n(e, t, i) {
  32570. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32571. e[t].push(i))
  32572. }
  32573. function t(e) {
  32574. this.source = e + "",
  32575. this.index = 0,
  32576. this.line = 1,
  32577. this.stack = [],
  32578. this._stringOpen = null
  32579. }
  32580. var e = {}
  32581. , i = t.prototype;
  32582. i._readString = function() {
  32583. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32584. e.lastIndex = this.index - 1;
  32585. var t = e.exec(this.source);
  32586. if (!t)
  32587. throw Error("unterminated string");
  32588. return this.index = e.lastIndex,
  32589. this.stack.push(this._stringOpen),
  32590. this._stringOpen = null,
  32591. t[1]
  32592. }
  32593. ,
  32594. i.next = function() {
  32595. if (0 < this.stack.length)
  32596. return this.stack.shift();
  32597. if (this.index >= this.source.length)
  32598. return null;
  32599. if (null !== this._stringOpen)
  32600. return this._readString();
  32601. var e, t, i;
  32602. do {
  32603. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32604. if ("\n" === i && ++this.line,
  32605. ++this.index === this.source.length)
  32606. return null;
  32607. if ("/" === this.source.charAt(this.index))
  32608. if (++this.index,
  32609. "/" === this.source.charAt(this.index)) {
  32610. for (; "\n" !== this.source.charAt(++this.index); )
  32611. if (this.index == this.source.length)
  32612. return null;
  32613. ++this.index,
  32614. ++this.line,
  32615. e = !0
  32616. } else {
  32617. if ("*" !== (i = this.source.charAt(this.index)))
  32618. return "/";
  32619. do {
  32620. if ("\n" === i && ++this.line,
  32621. ++this.index === this.source.length)
  32622. return null;
  32623. t = i,
  32624. i = this.source.charAt(this.index)
  32625. } while ("*" !== t || "/" !== i);++this.index,
  32626. e = !0
  32627. }
  32628. } while (e);if (this.index === this.source.length)
  32629. return null;
  32630. var n = this.index;
  32631. if (a.DELIM.lastIndex = 0,
  32632. !a.DELIM.test(this.source.charAt(n++)))
  32633. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32634. ++n;
  32635. var r = this.source.substring(this.index, this.index = n);
  32636. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32637. r
  32638. }
  32639. ,
  32640. i.peek = function() {
  32641. if (0 === this.stack.length) {
  32642. var e = this.next();
  32643. if (null === e)
  32644. return null;
  32645. this.stack.push(e)
  32646. }
  32647. return this.stack[0]
  32648. }
  32649. ,
  32650. i.skip = function(e) {
  32651. var t = this.next();
  32652. if (t !== e)
  32653. throw Error("illegal '" + t + "', '" + e + "' expected")
  32654. }
  32655. ,
  32656. i.omit = function(e) {
  32657. return this.peek() === e && (this.next(),
  32658. !0)
  32659. }
  32660. ,
  32661. i.toString = function() {
  32662. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32663. }
  32664. ,
  32665. e.Tokenizer = t;
  32666. function l(e) {
  32667. this.tn = new t(e),
  32668. this.proto3 = !1
  32669. }
  32670. var c = l.prototype;
  32671. return c.parse = function() {
  32672. var e, t, i = {
  32673. name: "[ROOT]",
  32674. package: null,
  32675. messages: [],
  32676. enums: [],
  32677. imports: [],
  32678. options: {},
  32679. services: []
  32680. }, n = !0;
  32681. try {
  32682. for (; e = this.tn.next(); )
  32683. switch (e) {
  32684. case "package":
  32685. if (!n || null !== i.package)
  32686. throw Error("unexpected 'package'");
  32687. if (e = this.tn.next(),
  32688. !a.TYPEREF.test(e))
  32689. throw Error("illegal package name: " + e);
  32690. this.tn.skip(";"),
  32691. i.package = e;
  32692. break;
  32693. case "import":
  32694. if (!n)
  32695. throw Error("unexpected 'import'");
  32696. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32697. e = this._readString(),
  32698. this.tn.skip(";"),
  32699. t || i.imports.push(e);
  32700. break;
  32701. case "syntax":
  32702. if (!n)
  32703. throw Error("unexpected 'syntax'");
  32704. this.tn.skip("="),
  32705. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32706. this.tn.skip(";");
  32707. break;
  32708. case "message":
  32709. this._parseMessage(i, null),
  32710. n = !1;
  32711. break;
  32712. case "enum":
  32713. this._parseEnum(i),
  32714. n = !1;
  32715. break;
  32716. case "option":
  32717. this._parseOption(i);
  32718. break;
  32719. case "service":
  32720. this._parseService(i);
  32721. break;
  32722. case "extend":
  32723. this._parseExtend(i);
  32724. break;
  32725. default:
  32726. throw Error("unexpected '" + e + "'")
  32727. }
  32728. } catch (e) {
  32729. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32730. e
  32731. }
  32732. return delete i.name,
  32733. i
  32734. }
  32735. ,
  32736. l.parse = function(e) {
  32737. return new l(e).parse()
  32738. }
  32739. ,
  32740. c._readString = function() {
  32741. var e, t, i = "";
  32742. do {
  32743. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32744. throw Error("illegal string delimiter: " + t);
  32745. i += this.tn.next(),
  32746. this.tn.skip(t),
  32747. e = this.tn.peek()
  32748. } while ('"' === e || '"' === e);return i
  32749. }
  32750. ,
  32751. c._readValue = function(e) {
  32752. var t = this.tn.peek();
  32753. if ('"' === t || "'" === t)
  32754. return this._readString();
  32755. if (this.tn.next(),
  32756. a.NUMBER.test(t))
  32757. return o(t);
  32758. if (a.BOOL.test(t))
  32759. return "true" === t.toLowerCase();
  32760. if (e && a.TYPEREF.test(t))
  32761. return t;
  32762. throw Error("illegal value: " + t)
  32763. }
  32764. ,
  32765. c._parseOption = function(e, t) {
  32766. var i = this.tn.next()
  32767. , n = !1;
  32768. if ("(" === i && (n = !0,
  32769. i = this.tn.next()),
  32770. !a.TYPEREF.test(i))
  32771. throw Error("illegal option name: " + i);
  32772. var r = i;
  32773. n && (this.tn.skip(")"),
  32774. r = "(" + r + ")",
  32775. i = this.tn.peek(),
  32776. a.FQTYPEREF.test(i) && (r += i,
  32777. this.tn.next())),
  32778. this.tn.skip("="),
  32779. this._parseOptionValue(e, r),
  32780. t || this.tn.skip(";")
  32781. }
  32782. ,
  32783. c._parseOptionValue = function(e, t) {
  32784. var i = this.tn.peek();
  32785. if ("{" !== i)
  32786. n(e.options, t, this._readValue(!0));
  32787. else
  32788. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32789. if (!a.NAME.test(i))
  32790. throw Error("illegal option name: " + t + "." + i);
  32791. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32792. }
  32793. }
  32794. ,
  32795. c._parseService = function(e) {
  32796. var t = this.tn.next();
  32797. if (!a.NAME.test(t))
  32798. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32799. var i = {
  32800. name: t,
  32801. rpc: {},
  32802. options: {}
  32803. };
  32804. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32805. if ("option" === t)
  32806. this._parseOption(i);
  32807. else {
  32808. if ("rpc" !== t)
  32809. throw Error("illegal service token: " + t);
  32810. this._parseServiceRPC(i)
  32811. }
  32812. this.tn.omit(";"),
  32813. e.services.push(i)
  32814. }
  32815. ,
  32816. c._parseServiceRPC = function(e) {
  32817. var t = this.tn.next();
  32818. if (!a.NAME.test(t))
  32819. throw Error("illegal rpc service method name: " + t);
  32820. var i = t
  32821. , n = {
  32822. request: null,
  32823. response: null,
  32824. request_stream: !1,
  32825. response_stream: !1,
  32826. options: {}
  32827. };
  32828. if (this.tn.skip("("),
  32829. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32830. t = this.tn.next()),
  32831. !a.TYPEREF.test(t))
  32832. throw Error("illegal rpc service request type: " + t);
  32833. if (n.request = t,
  32834. this.tn.skip(")"),
  32835. "returns" !== (t = this.tn.next()).toLowerCase())
  32836. throw Error("illegal rpc service request type delimiter: " + t);
  32837. if (this.tn.skip("("),
  32838. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32839. t = this.tn.next()),
  32840. n.response = t,
  32841. this.tn.skip(")"),
  32842. "{" === (t = this.tn.peek())) {
  32843. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32844. if ("option" !== t)
  32845. throw Error("illegal rpc service token: " + t);
  32846. this._parseOption(n)
  32847. }
  32848. this.tn.omit(";")
  32849. } else
  32850. this.tn.skip(";");
  32851. void 0 === e.rpc && (e.rpc = {}),
  32852. e.rpc[i] = n
  32853. }
  32854. ,
  32855. c._parseMessage = function(e, t) {
  32856. var i = !!t
  32857. , n = this.tn.next()
  32858. , r = {
  32859. name: "",
  32860. fields: [],
  32861. enums: [],
  32862. messages: [],
  32863. options: {},
  32864. services: [],
  32865. oneofs: {}
  32866. };
  32867. if (!a.NAME.test(n))
  32868. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32869. for (r.name = n,
  32870. i && (this.tn.skip("="),
  32871. t.id = s(this.tn.next()),
  32872. r.isGroup = !0),
  32873. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32874. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32875. if (a.RULE.test(n))
  32876. this._parseMessageField(r, n);
  32877. else if ("oneof" === n)
  32878. this._parseMessageOneOf(r);
  32879. else if ("enum" === n)
  32880. this._parseEnum(r);
  32881. else if ("message" === n)
  32882. this._parseMessage(r);
  32883. else if ("option" === n)
  32884. this._parseOption(r);
  32885. else if ("service" === n)
  32886. this._parseService(r);
  32887. else if ("extensions" === n)
  32888. r.extensions = this._parseExtensionRanges();
  32889. else if ("reserved" === n)
  32890. this._parseIgnored();
  32891. else if ("extend" === n)
  32892. this._parseExtend(r);
  32893. else {
  32894. if (!a.TYPEREF.test(n))
  32895. throw Error("illegal message token: " + n);
  32896. if (!this.proto3)
  32897. throw Error("illegal field rule: " + n);
  32898. this._parseMessageField(r, "optional", n)
  32899. }
  32900. return this.tn.omit(";"),
  32901. e.messages.push(r),
  32902. r
  32903. }
  32904. ,
  32905. c._parseIgnored = function() {
  32906. for (; ";" !== this.tn.peek(); )
  32907. this.tn.next();
  32908. this.tn.skip(";")
  32909. }
  32910. ,
  32911. c._parseMessageField = function(e, t, i) {
  32912. if (!a.RULE.test(t))
  32913. throw Error("illegal message field rule: " + t);
  32914. var n, r = {
  32915. rule: t,
  32916. type: "",
  32917. name: "",
  32918. options: {},
  32919. id: 0
  32920. };
  32921. if ("map" === t) {
  32922. if (i)
  32923. throw Error("illegal type: " + i);
  32924. if (this.tn.skip("<"),
  32925. n = this.tn.next(),
  32926. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32927. throw Error("illegal message field type: " + n);
  32928. if (r.keytype = n,
  32929. this.tn.skip(","),
  32930. n = this.tn.next(),
  32931. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32932. throw Error("illegal message field: " + n);
  32933. if (r.type = n,
  32934. this.tn.skip(">"),
  32935. n = this.tn.next(),
  32936. !a.NAME.test(n))
  32937. throw Error("illegal message field name: " + n);
  32938. r.name = n,
  32939. this.tn.skip("="),
  32940. r.id = s(this.tn.next()),
  32941. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32942. this.tn.skip(";")
  32943. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32944. var o = this._parseMessage(e, r);
  32945. if (!/^[A-Z]/.test(o.name))
  32946. throw Error("illegal group name: " + o.name);
  32947. r.type = o.name,
  32948. r.name = o.name.toLowerCase(),
  32949. this.tn.omit(";")
  32950. } else {
  32951. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32952. throw Error("illegal message field type: " + i);
  32953. if (r.type = i,
  32954. n = this.tn.next(),
  32955. !a.NAME.test(n))
  32956. throw Error("illegal message field name: " + n);
  32957. r.name = n,
  32958. this.tn.skip("="),
  32959. r.id = s(this.tn.next()),
  32960. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32961. this.tn.skip(";")
  32962. }
  32963. return e.fields.push(r),
  32964. r
  32965. }
  32966. ,
  32967. c._parseMessageOneOf = function(e) {
  32968. var t = this.tn.next();
  32969. if (!a.NAME.test(t))
  32970. throw Error("illegal oneof name: " + t);
  32971. var i, n = t, r = [];
  32972. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32973. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32974. r.push(i.id);
  32975. this.tn.omit(";"),
  32976. e.oneofs[n] = r
  32977. }
  32978. ,
  32979. c._parseFieldOptions = function(e) {
  32980. this.tn.skip("[");
  32981. for (var t = !0; "]" !== this.tn.peek(); )
  32982. t || this.tn.skip(","),
  32983. this._parseOption(e, !0),
  32984. t = !1;
  32985. this.tn.next()
  32986. }
  32987. ,
  32988. c._parseEnum = function(e) {
  32989. var t = {
  32990. name: "",
  32991. values: [],
  32992. options: {}
  32993. }
  32994. , i = this.tn.next();
  32995. if (!a.NAME.test(i))
  32996. throw Error("illegal name: " + i);
  32997. for (t.name = i,
  32998. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32999. if ("option" === i)
  33000. this._parseOption(t);
  33001. else {
  33002. if (!a.NAME.test(i))
  33003. throw Error("illegal name: " + i);
  33004. this.tn.skip("=");
  33005. var n = {
  33006. name: i,
  33007. id: s(this.tn.next(), !0)
  33008. };
  33009. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33010. options: {}
  33011. }),
  33012. this.tn.skip(";"),
  33013. t.values.push(n)
  33014. }
  33015. this.tn.omit(";"),
  33016. e.enums.push(t)
  33017. }
  33018. ,
  33019. c._parseExtensionRanges = function() {
  33020. var e, t, i, n = [];
  33021. do {
  33022. for (t = []; ; ) {
  33023. switch (e = this.tn.next()) {
  33024. case "min":
  33025. i = r.ID_MIN;
  33026. break;
  33027. case "max":
  33028. i = r.ID_MAX;
  33029. break;
  33030. default:
  33031. i = o(e)
  33032. }
  33033. if (t.push(i),
  33034. 2 === t.length)
  33035. break;
  33036. if ("to" !== this.tn.peek()) {
  33037. t.push(i);
  33038. break
  33039. }
  33040. this.tn.next()
  33041. }
  33042. n.push(t)
  33043. } while (this.tn.omit(","));return this.tn.skip(";"),
  33044. n
  33045. }
  33046. ,
  33047. c._parseExtend = function(e) {
  33048. var t = this.tn.next();
  33049. if (!a.TYPEREF.test(t))
  33050. throw Error("illegal extend reference: " + t);
  33051. var i = {
  33052. ref: t,
  33053. fields: []
  33054. };
  33055. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33056. if (a.RULE.test(t))
  33057. this._parseMessageField(i, t);
  33058. else {
  33059. if (!a.TYPEREF.test(t))
  33060. throw Error("illegal extend token: " + t);
  33061. if (!this.proto3)
  33062. throw Error("illegal field rule: " + t);
  33063. this._parseMessageField(i, "optional", t)
  33064. }
  33065. return this.tn.omit(";"),
  33066. e.messages.push(i),
  33067. i
  33068. }
  33069. ,
  33070. c.toString = function() {
  33071. return "Parser at line " + this.tn.line
  33072. }
  33073. ,
  33074. e.Parser = l,
  33075. e
  33076. }(o, o.Lang),
  33077. o.Reflect = function(g) {
  33078. function a(e, t) {
  33079. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33080. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33081. if ("string" == typeof e)
  33082. return g.Long.fromString(e, t || !1, 10);
  33083. if ("number" == typeof e)
  33084. return g.Long.fromNumber(e, t || !1);
  33085. throw Error("not convertible to Long")
  33086. }
  33087. function m(e, t) {
  33088. var i = t.readVarint32()
  33089. , n = 7 & i
  33090. , r = i >>> 3;
  33091. switch (n) {
  33092. case g.WIRE_TYPES.VARINT:
  33093. for (; 128 == (128 & (i = t.readUint8())); )
  33094. ;
  33095. break;
  33096. case g.WIRE_TYPES.BITS64:
  33097. t.offset += 8;
  33098. break;
  33099. case g.WIRE_TYPES.LDELIM:
  33100. i = t.readVarint32(),
  33101. t.offset += i;
  33102. break;
  33103. case g.WIRE_TYPES.STARTGROUP:
  33104. m(r, t);
  33105. break;
  33106. case g.WIRE_TYPES.ENDGROUP:
  33107. if (r === e)
  33108. return !1;
  33109. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33110. case g.WIRE_TYPES.BITS32:
  33111. t.offset += 4;
  33112. break;
  33113. default:
  33114. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33115. }
  33116. return !0
  33117. }
  33118. function h(e, t, i) {
  33119. this.builder = e,
  33120. this.parent = t,
  33121. this.name = i,
  33122. this.className
  33123. }
  33124. var s = {}
  33125. , e = h.prototype;
  33126. e.fqn = function() {
  33127. for (var e = this.name, t = this; null != (t = t.parent); )
  33128. e = t.name + "." + e;
  33129. return e
  33130. }
  33131. ,
  33132. e.toString = function(e) {
  33133. return (e ? this.className + " " : "") + this.fqn()
  33134. }
  33135. ,
  33136. e.build = function() {
  33137. throw Error(this.toString(!0) + " cannot be built directly")
  33138. }
  33139. ,
  33140. s.T = h;
  33141. function l(e, t, i, n, r) {
  33142. h.call(this, e, t, i),
  33143. this.className = "Namespace",
  33144. this.children = [],
  33145. this.options = n || {},
  33146. this.syntax = r || "proto2"
  33147. }
  33148. var t = l.prototype = Object.create(h.prototype);
  33149. t.getChildren = function(e) {
  33150. if (null == (e = e || null))
  33151. return this.children.slice();
  33152. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33153. this.children[i]instanceof e && t.push(this.children[i]);
  33154. return t
  33155. }
  33156. ,
  33157. t.addChild = function(e) {
  33158. var t;
  33159. if (t = this.getChild(e.name))
  33160. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33161. t.name = t.originalName;
  33162. else {
  33163. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33164. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33165. e.name = e.originalName
  33166. }
  33167. this.children.push(e)
  33168. }
  33169. ,
  33170. t.getChild = function(e) {
  33171. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33172. if (this.children[i][t] === e)
  33173. return this.children[i];
  33174. return null
  33175. }
  33176. ,
  33177. t.resolve = function(e, t) {
  33178. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33179. if ("" === n[o]) {
  33180. for (; null !== r.parent; )
  33181. r = r.parent;
  33182. o++
  33183. }
  33184. do {
  33185. do {
  33186. if (!(r instanceof s.Namespace)) {
  33187. r = null;
  33188. break
  33189. }
  33190. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33191. r = null;
  33192. break
  33193. }
  33194. r = i,
  33195. o++
  33196. } while (o < n.length);if (null != r)
  33197. break;
  33198. if (null !== this.parent)
  33199. return this.parent.resolve(e, t)
  33200. } while (null != r);return r
  33201. }
  33202. ,
  33203. t.qn = function(e) {
  33204. for (var t = [], i = e; t.unshift(i.name),
  33205. null !== (i = i.parent); )
  33206. ;
  33207. for (var n = 1; n <= t.length; n++) {
  33208. var r = t.slice(t.length - n);
  33209. if (e === this.resolve(r, e instanceof s.Namespace))
  33210. return r.join(".")
  33211. }
  33212. return e.fqn()
  33213. }
  33214. ,
  33215. t.build = function() {
  33216. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33217. (e = i[n])instanceof l && (t[e.name] = e.build());
  33218. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33219. value: this.buildOpt()
  33220. }),
  33221. t
  33222. }
  33223. ,
  33224. t.buildOpt = function() {
  33225. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33226. var r = t[i]
  33227. , o = this.options[t[i]];
  33228. e[r] = o
  33229. }
  33230. return e
  33231. }
  33232. ,
  33233. t.getOption = function(e) {
  33234. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33235. }
  33236. ,
  33237. s.Namespace = l;
  33238. function u(e, t, i, n) {
  33239. if (this.type = e,
  33240. this.resolvedType = t,
  33241. this.isMapKey = i,
  33242. this.syntax = n,
  33243. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33244. throw Error("Invalid map key type: " + e.name)
  33245. }
  33246. var i = u.prototype;
  33247. u.defaultFieldValue = function(e) {
  33248. if ("string" == typeof e && (e = g.TYPES[e]),
  33249. void 0 === e.defaultValue)
  33250. throw Error("default value for type " + e.name + " is not supported");
  33251. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33252. }
  33253. ,
  33254. i.verifyValue = function(t) {
  33255. function i(e, t) {
  33256. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33257. }
  33258. var n = this;
  33259. switch (this.type) {
  33260. case g.TYPES.int32:
  33261. case g.TYPES.sint32:
  33262. case g.TYPES.sfixed32:
  33263. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33264. 4294967295 < t ? 0 | t : t;
  33265. case g.TYPES.uint32:
  33266. case g.TYPES.fixed32:
  33267. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33268. t < 0 ? t >>> 0 : t;
  33269. case g.TYPES.int64:
  33270. case g.TYPES.sint64:
  33271. case g.TYPES.sfixed64:
  33272. if (g.Long)
  33273. try {
  33274. return a(t, !1)
  33275. } catch (e) {
  33276. i(typeof t, e.message)
  33277. }
  33278. else
  33279. i(typeof t, "requires Long.js");
  33280. case g.TYPES.uint64:
  33281. case g.TYPES.fixed64:
  33282. if (g.Long)
  33283. try {
  33284. return a(t, !0)
  33285. } catch (e) {
  33286. i(typeof t, e.message)
  33287. }
  33288. else
  33289. i(typeof t, "requires Long.js");
  33290. case g.TYPES.bool:
  33291. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33292. t;
  33293. case g.TYPES.float:
  33294. case g.TYPES.double:
  33295. return "number" != typeof t && i(typeof t, "not a number"),
  33296. t;
  33297. case g.TYPES.string:
  33298. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33299. "" + t;
  33300. case g.TYPES.bytes:
  33301. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33302. case g.TYPES.enum:
  33303. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33304. for (o = 0; o < e.length; o++) {
  33305. if (e[o].name == t)
  33306. return e[o].id;
  33307. if (e[o].id == t)
  33308. return e[o].id
  33309. }
  33310. if ("proto3" === this.syntax)
  33311. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33312. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33313. t;
  33314. i(t, "not a valid enum value");
  33315. case g.TYPES.group:
  33316. case g.TYPES.message:
  33317. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33318. t instanceof this.resolvedType.clazz)
  33319. return t;
  33320. if (t instanceof g.Builder.Message) {
  33321. var r = {};
  33322. for (var o in t)
  33323. t.hasOwnProperty(o) && (r[o] = t[o]);
  33324. t = r
  33325. }
  33326. return new this.resolvedType.clazz(t)
  33327. }
  33328. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33329. }
  33330. ,
  33331. i.calculateLength = function(e, t) {
  33332. if (null === t)
  33333. return 0;
  33334. var i;
  33335. switch (this.type) {
  33336. case g.TYPES.int32:
  33337. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33338. case g.TYPES.uint32:
  33339. return I.calculateVarint32(t);
  33340. case g.TYPES.sint32:
  33341. return I.calculateVarint32(I.zigZagEncode32(t));
  33342. case g.TYPES.fixed32:
  33343. case g.TYPES.sfixed32:
  33344. case g.TYPES.float:
  33345. return 4;
  33346. case g.TYPES.int64:
  33347. case g.TYPES.uint64:
  33348. return I.calculateVarint64(t);
  33349. case g.TYPES.sint64:
  33350. return I.calculateVarint64(I.zigZagEncode64(t));
  33351. case g.TYPES.fixed64:
  33352. case g.TYPES.sfixed64:
  33353. return 8;
  33354. case g.TYPES.bool:
  33355. return 1;
  33356. case g.TYPES.enum:
  33357. return I.calculateVarint32(t);
  33358. case g.TYPES.double:
  33359. return 8;
  33360. case g.TYPES.string:
  33361. return i = I.calculateUTF8Bytes(t),
  33362. I.calculateVarint32(i) + i;
  33363. case g.TYPES.bytes:
  33364. if (t.remaining() < 0)
  33365. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33366. return I.calculateVarint32(t.remaining()) + t.remaining();
  33367. case g.TYPES.message:
  33368. return i = this.resolvedType.calculate(t),
  33369. I.calculateVarint32(i) + i;
  33370. case g.TYPES.group:
  33371. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33372. }
  33373. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33374. }
  33375. ,
  33376. i.encodeValue = function(e, t, i) {
  33377. if (null === t)
  33378. return i;
  33379. switch (this.type) {
  33380. case g.TYPES.int32:
  33381. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33382. break;
  33383. case g.TYPES.uint32:
  33384. i.writeVarint32(t);
  33385. break;
  33386. case g.TYPES.sint32:
  33387. i.writeVarint32ZigZag(t);
  33388. break;
  33389. case g.TYPES.fixed32:
  33390. i.writeUint32(t);
  33391. break;
  33392. case g.TYPES.sfixed32:
  33393. i.writeInt32(t);
  33394. break;
  33395. case g.TYPES.int64:
  33396. case g.TYPES.uint64:
  33397. i.writeVarint64(t);
  33398. break;
  33399. case g.TYPES.sint64:
  33400. i.writeVarint64ZigZag(t);
  33401. break;
  33402. case g.TYPES.fixed64:
  33403. i.writeUint64(t);
  33404. break;
  33405. case g.TYPES.sfixed64:
  33406. i.writeInt64(t);
  33407. break;
  33408. case g.TYPES.bool:
  33409. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33410. break;
  33411. case g.TYPES.enum:
  33412. i.writeVarint32(t);
  33413. break;
  33414. case g.TYPES.float:
  33415. i.writeFloat32(t);
  33416. break;
  33417. case g.TYPES.double:
  33418. i.writeFloat64(t);
  33419. break;
  33420. case g.TYPES.string:
  33421. i.writeVString(t);
  33422. break;
  33423. case g.TYPES.bytes:
  33424. if (t.remaining() < 0)
  33425. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33426. var n = t.offset;
  33427. i.writeVarint32(t.remaining()),
  33428. i.append(t),
  33429. t.offset = n;
  33430. break;
  33431. case g.TYPES.message:
  33432. var r = (new I).LE();
  33433. this.resolvedType.encode(t, r),
  33434. i.writeVarint32(r.offset),
  33435. i.append(r.flip());
  33436. break;
  33437. case g.TYPES.group:
  33438. this.resolvedType.encode(t, i),
  33439. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33440. break;
  33441. default:
  33442. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33443. }
  33444. return i
  33445. }
  33446. ,
  33447. i.decode = function(e, t, i) {
  33448. if (t != this.type.wireType)
  33449. throw Error("Unexpected wire type for element");
  33450. var n, r;
  33451. switch (this.type) {
  33452. case g.TYPES.int32:
  33453. return 0 | e.readVarint32();
  33454. case g.TYPES.uint32:
  33455. return e.readVarint32() >>> 0;
  33456. case g.TYPES.sint32:
  33457. return 0 | e.readVarint32ZigZag();
  33458. case g.TYPES.fixed32:
  33459. return e.readUint32() >>> 0;
  33460. case g.TYPES.sfixed32:
  33461. return 0 | e.readInt32();
  33462. case g.TYPES.int64:
  33463. return e.readVarint64();
  33464. case g.TYPES.uint64:
  33465. return e.readVarint64().toUnsigned();
  33466. case g.TYPES.sint64:
  33467. return e.readVarint64ZigZag();
  33468. case g.TYPES.fixed64:
  33469. return e.readUint64();
  33470. case g.TYPES.sfixed64:
  33471. return e.readInt64();
  33472. case g.TYPES.bool:
  33473. return !!e.readVarint32();
  33474. case g.TYPES.enum:
  33475. return e.readVarint32();
  33476. case g.TYPES.float:
  33477. return e.readFloat();
  33478. case g.TYPES.double:
  33479. return e.readDouble();
  33480. case g.TYPES.string:
  33481. return e.readVString();
  33482. case g.TYPES.bytes:
  33483. if (r = e.readVarint32(),
  33484. e.remaining() < r)
  33485. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33486. return (n = e.clone()).limit = n.offset + r,
  33487. e.offset += r,
  33488. n;
  33489. case g.TYPES.message:
  33490. return r = e.readVarint32(),
  33491. this.resolvedType.decode(e, r);
  33492. case g.TYPES.group:
  33493. return this.resolvedType.decode(e, -1, i)
  33494. }
  33495. throw Error("[INTERNAL] Illegal decode type")
  33496. }
  33497. ,
  33498. i.valueFromString = function(e) {
  33499. if (!this.isMapKey)
  33500. throw Error("valueFromString() called on non-map-key element");
  33501. switch (this.type) {
  33502. case g.TYPES.int32:
  33503. case g.TYPES.sint32:
  33504. case g.TYPES.sfixed32:
  33505. case g.TYPES.uint32:
  33506. case g.TYPES.fixed32:
  33507. return this.verifyValue(parseInt(e));
  33508. case g.TYPES.int64:
  33509. case g.TYPES.sint64:
  33510. case g.TYPES.sfixed64:
  33511. case g.TYPES.uint64:
  33512. case g.TYPES.fixed64:
  33513. return this.verifyValue(e);
  33514. case g.TYPES.bool:
  33515. return "true" === e;
  33516. case g.TYPES.string:
  33517. return this.verifyValue(e);
  33518. case g.TYPES.bytes:
  33519. return I.fromBinary(e)
  33520. }
  33521. }
  33522. ,
  33523. i.valueToString = function(e) {
  33524. if (!this.isMapKey)
  33525. throw Error("valueToString() called on non-map-key element");
  33526. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33527. }
  33528. ,
  33529. s.Element = u;
  33530. var d = function(e, t, i, n, r, o) {
  33531. l.call(this, e, t, i, n, o),
  33532. this.className = "Message",
  33533. this.extensions = void 0,
  33534. this.clazz = null,
  33535. this.isGroup = !!r,
  33536. this._fields = null,
  33537. this._fieldsById = null,
  33538. this._fieldsByName = null
  33539. }
  33540. , n = d.prototype = Object.create(l.prototype);
  33541. n.build = function(e) {
  33542. if (this.clazz && !e)
  33543. return this.clazz;
  33544. var t = function(u, a) {
  33545. function d(e, i, n, r) {
  33546. if (null === e || "object" != typeof e) {
  33547. if (r && r instanceof u.Reflect.Enum) {
  33548. var t = u.Reflect.Enum.getName(r.object, e);
  33549. if (null !== t)
  33550. return t
  33551. }
  33552. return e
  33553. }
  33554. if (I.isByteBuffer(e))
  33555. return i ? e.toBase64() : e.toBuffer();
  33556. if (u.Long.isLong(e))
  33557. return n ? e.toString() : u.Long.fromValue(e);
  33558. var o;
  33559. if (Array.isArray(e))
  33560. return o = [],
  33561. e.forEach(function(e, t) {
  33562. o[t] = d(e, i, n, r)
  33563. }),
  33564. o;
  33565. if (o = {},
  33566. e instanceof u.Map) {
  33567. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33568. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33569. return o
  33570. }
  33571. var l = e.$type
  33572. , c = void 0;
  33573. for (var h in e)
  33574. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33575. return o
  33576. }
  33577. var s = a.getChildren(u.Reflect.Message.Field)
  33578. , l = a.getChildren(u.Reflect.Message.OneOf)
  33579. , c = function(e, t) {
  33580. u.Builder.Message.call(this);
  33581. for (var i = 0, n = l.length; i < n; ++i)
  33582. this[l[i].name] = null;
  33583. for (i = 0,
  33584. n = s.length; i < n; ++i) {
  33585. var r = s[i];
  33586. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33587. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33588. }
  33589. var o;
  33590. if (0 < arguments.length)
  33591. 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)
  33592. for (i = 0,
  33593. n = arguments.length; i < n; ++i)
  33594. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33595. else
  33596. this.$set(e)
  33597. }
  33598. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33599. o.add = function(e, t, i) {
  33600. var n = a._fieldsByName[e];
  33601. if (!i) {
  33602. if (!n)
  33603. throw Error(this + "#" + e + " is undefined");
  33604. if (!(n instanceof u.Reflect.Message.Field))
  33605. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33606. if (!n.repeated)
  33607. throw Error(this + "#" + e + " is not a repeated field");
  33608. t = n.verifyValue(t, !0)
  33609. }
  33610. return null === this[e] && (this[e] = []),
  33611. this[e].push(t),
  33612. this
  33613. }
  33614. ,
  33615. o.$add = o.add,
  33616. o.set = function(e, t, i) {
  33617. if (e && "object" == typeof e) {
  33618. for (var n in i = t,
  33619. e)
  33620. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33621. return this
  33622. }
  33623. var r = a._fieldsByName[e];
  33624. if (i)
  33625. this[e] = t;
  33626. else {
  33627. if (!r)
  33628. throw Error(this + "#" + e + " is not a field: undefined");
  33629. if (!(r instanceof u.Reflect.Message.Field))
  33630. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33631. this[r.name] = t = r.verifyValue(t)
  33632. }
  33633. if (r && r.oneof) {
  33634. var o = this[r.oneof.name];
  33635. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33636. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33637. }
  33638. return this
  33639. }
  33640. ,
  33641. o.$set = o.set,
  33642. o.get = function(e, t) {
  33643. if (t)
  33644. return this[e];
  33645. var i = a._fieldsByName[e];
  33646. if (!(i && i instanceof u.Reflect.Message.Field))
  33647. throw Error(this + "#" + e + " is not a field: undefined");
  33648. if (!(i instanceof u.Reflect.Message.Field))
  33649. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33650. return this[i.name]
  33651. }
  33652. ,
  33653. o.$get = o.get;
  33654. for (var e = 0; e < s.length; e++) {
  33655. var t = s[e];
  33656. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33657. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33658. return e.toUpperCase().replace("_", "")
  33659. });
  33660. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33661. function t(e, t) {
  33662. return this[i.name] = t ? e : i.verifyValue(e),
  33663. this
  33664. }
  33665. function n() {
  33666. return this[i.name]
  33667. }
  33668. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33669. return "_" + e
  33670. });
  33671. null === a.getChild("set" + e) && (o["set" + e] = t),
  33672. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33673. null === a.getChild("get" + e) && (o["get" + e] = n),
  33674. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33675. }(t)
  33676. }
  33677. return o.encode = function(t, e) {
  33678. "boolean" == typeof t && (e = t,
  33679. t = void 0);
  33680. var i = !1;
  33681. t || (t = new I,
  33682. i = !0);
  33683. var n = t.littleEndian;
  33684. try {
  33685. return a.encode(this, t.LE(), e),
  33686. (i ? t.flip() : t).LE(n)
  33687. } catch (e) {
  33688. throw t.LE(n),
  33689. e
  33690. }
  33691. }
  33692. ,
  33693. c.encode = function(e, t, i) {
  33694. return new c(e).encode(t, i)
  33695. }
  33696. ,
  33697. o.calculate = function() {
  33698. return a.calculate(this)
  33699. }
  33700. ,
  33701. o.encodeDelimited = function(e, t) {
  33702. var i = !1;
  33703. e || (e = new I,
  33704. i = !0);
  33705. var n = (new I).LE();
  33706. return a.encode(this, n, t).flip(),
  33707. e.writeVarint32(n.remaining()),
  33708. e.append(n),
  33709. i ? e.flip() : e
  33710. }
  33711. ,
  33712. o.encodeAB = function() {
  33713. try {
  33714. return this.encode().toArrayBuffer()
  33715. } catch (e) {
  33716. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33717. e
  33718. }
  33719. }
  33720. ,
  33721. o.toArrayBuffer = o.encodeAB,
  33722. o.encodeNB = function() {
  33723. try {
  33724. return this.encode().toBuffer()
  33725. } catch (e) {
  33726. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33727. e
  33728. }
  33729. }
  33730. ,
  33731. o.toBuffer = o.encodeNB,
  33732. o.encode64 = function() {
  33733. try {
  33734. return this.encode().toBase64()
  33735. } catch (e) {
  33736. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33737. e
  33738. }
  33739. }
  33740. ,
  33741. o.toBase64 = o.encode64,
  33742. o.encodeHex = function() {
  33743. try {
  33744. return this.encode().toHex()
  33745. } catch (e) {
  33746. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33747. e
  33748. }
  33749. }
  33750. ,
  33751. o.toHex = o.encodeHex,
  33752. o.toRaw = function(e, t) {
  33753. return d(this, !!e, !!t, this.$type)
  33754. }
  33755. ,
  33756. o.encodeJSON = function() {
  33757. return JSON.stringify(d(this, !0, !0, this.$type))
  33758. }
  33759. ,
  33760. c.decode = function(t, e, i) {
  33761. "string" == typeof e && (i = e,
  33762. e = -1),
  33763. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33764. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33765. try {
  33766. var r = a.decode(t.LE());
  33767. return t.LE(n),
  33768. r
  33769. } catch (e) {
  33770. throw t.LE(n),
  33771. e
  33772. }
  33773. }
  33774. ,
  33775. c.decodeDelimited = function(t, e) {
  33776. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33777. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33778. return null;
  33779. var i = t.offset
  33780. , n = t.readVarint32();
  33781. if (t.remaining() < n)
  33782. return t.offset = i,
  33783. null;
  33784. try {
  33785. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33786. return t.offset += n,
  33787. r
  33788. } catch (e) {
  33789. throw t.offset += n,
  33790. e
  33791. }
  33792. }
  33793. ,
  33794. c.decode64 = function(e) {
  33795. return c.decode(e, "base64")
  33796. }
  33797. ,
  33798. c.decodeHex = function(e) {
  33799. return c.decode(e, "hex")
  33800. }
  33801. ,
  33802. c.decodeJSON = function(e) {
  33803. return new c(JSON.parse(e))
  33804. }
  33805. ,
  33806. o.toString = function() {
  33807. return a.toString()
  33808. }
  33809. ,
  33810. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33811. value: a.buildOpt()
  33812. }),
  33813. Object.defineProperty(o, "$options", {
  33814. value: c.$options
  33815. }),
  33816. Object.defineProperty(c, "$type", {
  33817. value: a
  33818. }),
  33819. Object.defineProperty(o, "$type", {
  33820. value: a
  33821. })),
  33822. c
  33823. }(g, this);
  33824. this._fields = [],
  33825. this._fieldsById = {},
  33826. this._fieldsByName = {};
  33827. for (var i, n = 0, r = this.children.length; n < r; n++)
  33828. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33829. if (t.hasOwnProperty(i.name))
  33830. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33831. t[i.name] = i.build()
  33832. } else if (i instanceof d.Field)
  33833. i.build(),
  33834. this._fields.push(i),
  33835. this._fieldsById[i.id] = i,
  33836. this._fieldsByName[i.name] = i;
  33837. else if (!(i instanceof d.OneOf || i instanceof v))
  33838. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33839. return this.clazz = t
  33840. }
  33841. ,
  33842. n.encode = function(e, t, i) {
  33843. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33844. r = e[(n = this._fields[a]).name],
  33845. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33846. if (null === o)
  33847. return t;
  33848. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33849. throw l.encoded = t,
  33850. l
  33851. }
  33852. ,
  33853. n.calculate = function(e) {
  33854. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33855. if (i = e[(t = this._fields[r]).name],
  33856. t.required && null === i)
  33857. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33858. n += t.calculate(i, e)
  33859. }
  33860. return n
  33861. }
  33862. ,
  33863. n.decode = function(e, t, i) {
  33864. t = "number" == typeof t ? t : -1;
  33865. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33866. if (o = (n = e.readVarint32()) >>> 3,
  33867. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33868. if (o !== i)
  33869. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33870. break
  33871. }
  33872. if (a = this._fieldsById[o]) {
  33873. if (a.repeated && !a.options.packed)
  33874. l[a.name].push(a.decode(r, e));
  33875. else if (a.map) {
  33876. var c = a.decode(r, e);
  33877. l[a.name].set(c[0], c[1])
  33878. } else if (l[a.name] = a.decode(r, e),
  33879. a.oneof) {
  33880. var h = l[a.oneof.name];
  33881. null !== h && h !== a.name && (l[h] = null),
  33882. l[a.oneof.name] = a.name
  33883. }
  33884. } else
  33885. switch (r) {
  33886. case g.WIRE_TYPES.VARINT:
  33887. e.readVarint32();
  33888. break;
  33889. case g.WIRE_TYPES.BITS32:
  33890. e.offset += 4;
  33891. break;
  33892. case g.WIRE_TYPES.BITS64:
  33893. e.offset += 8;
  33894. break;
  33895. case g.WIRE_TYPES.LDELIM:
  33896. var u = e.readVarint32();
  33897. e.offset += u;
  33898. break;
  33899. case g.WIRE_TYPES.STARTGROUP:
  33900. for (; m(o, e); )
  33901. ;
  33902. break;
  33903. default:
  33904. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33905. }
  33906. }
  33907. for (var d = 0, p = this._fields.length; d < p; ++d)
  33908. if (null === l[(a = this._fields[d]).name])
  33909. if ("proto3" === this.syntax)
  33910. l[a.name] = a.defaultValue;
  33911. else {
  33912. if (a.required) {
  33913. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33914. throw f.decoded = l,
  33915. f
  33916. }
  33917. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33918. }
  33919. return l
  33920. }
  33921. ,
  33922. s.Message = d;
  33923. function c(e, t, i, n, r, o, a, s, l, c) {
  33924. h.call(this, e, t, o),
  33925. this.className = "Message.Field",
  33926. this.required = "required" === i,
  33927. this.repeated = "repeated" === i,
  33928. this.map = "map" === i,
  33929. this.keyType = n || null,
  33930. this.type = r,
  33931. this.resolvedType = null,
  33932. this.id = a,
  33933. this.options = s || {},
  33934. this.defaultValue = null,
  33935. this.oneof = l || null,
  33936. this.syntax = c || "proto2",
  33937. this.originalName = this.name,
  33938. this.element = null,
  33939. this.keyElement = null,
  33940. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33941. }
  33942. var r = c.prototype = Object.create(h.prototype);
  33943. r.build = function() {
  33944. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33945. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33946. "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)
  33947. }
  33948. ,
  33949. r.verifyValue = function(e, t) {
  33950. function i(e, t) {
  33951. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33952. }
  33953. t = t || !1;
  33954. var n, r = this;
  33955. if (null === e)
  33956. return this.required && i(typeof e, "required"),
  33957. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33958. null;
  33959. if (!this.repeated || t)
  33960. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33961. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33962. this.element.verifyValue(e));
  33963. Array.isArray(e) || (e = [e]);
  33964. var o = [];
  33965. for (n = 0; n < e.length; n++)
  33966. o.push(this.element.verifyValue(e[n]));
  33967. return o
  33968. }
  33969. ,
  33970. r.hasWirePresence = function(e, t) {
  33971. if ("proto3" !== this.syntax)
  33972. return null !== e;
  33973. if (this.oneof && t[this.oneof.name] === this.name)
  33974. return !0;
  33975. switch (this.type) {
  33976. case g.TYPES.int32:
  33977. case g.TYPES.sint32:
  33978. case g.TYPES.sfixed32:
  33979. case g.TYPES.uint32:
  33980. case g.TYPES.fixed32:
  33981. return 0 !== e;
  33982. case g.TYPES.int64:
  33983. case g.TYPES.sint64:
  33984. case g.TYPES.sfixed64:
  33985. case g.TYPES.uint64:
  33986. case g.TYPES.fixed64:
  33987. return 0 !== e.low || 0 !== e.high;
  33988. case g.TYPES.bool:
  33989. return e;
  33990. case g.TYPES.float:
  33991. case g.TYPES.double:
  33992. return 0 !== e;
  33993. case g.TYPES.string:
  33994. return 0 < e.length;
  33995. case g.TYPES.bytes:
  33996. return 0 < e.remaining();
  33997. case g.TYPES.enum:
  33998. return 0 !== e;
  33999. case g.TYPES.message:
  34000. return null !== e;
  34001. default:
  34002. return !0
  34003. }
  34004. }
  34005. ,
  34006. r.encode = function(t, r, e) {
  34007. if (null === this.type || "object" != typeof this.type)
  34008. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34009. if (null === t || this.repeated && 0 == t.length)
  34010. return r;
  34011. try {
  34012. var i;
  34013. if (this.repeated)
  34014. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34015. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34016. r.ensureCapacity(r.offset += 1);
  34017. var n = r.offset;
  34018. for (i = 0; i < t.length; i++)
  34019. this.element.encodeValue(this.id, t[i], r);
  34020. var o = r.offset - n
  34021. , a = I.calculateVarint32(o);
  34022. if (1 < a) {
  34023. var s = r.slice(n, r.offset);
  34024. n += a - 1,
  34025. r.offset = n,
  34026. r.append(s)
  34027. }
  34028. r.writeVarint32(o, n - a)
  34029. } else
  34030. for (i = 0; i < t.length; i++)
  34031. r.writeVarint32(this.id << 3 | this.type.wireType),
  34032. this.element.encodeValue(this.id, t[i], r);
  34033. else
  34034. this.map ? t.forEach(function(e, t, i) {
  34035. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34036. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34037. r.writeVarint32(n),
  34038. r.writeVarint32(8 | this.keyType.wireType),
  34039. this.keyElement.encodeValue(1, t, r),
  34040. r.writeVarint32(16 | this.type.wireType),
  34041. this.element.encodeValue(2, e, r)
  34042. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34043. this.element.encodeValue(this.id, t, r))
  34044. } catch (e) {
  34045. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34046. }
  34047. return r
  34048. }
  34049. ,
  34050. r.calculate = function(t, e) {
  34051. if (t = this.verifyValue(t),
  34052. null === this.type || "object" != typeof this.type)
  34053. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34054. if (null === t || this.repeated && 0 == t.length)
  34055. return 0;
  34056. var r = 0;
  34057. try {
  34058. var i, n;
  34059. if (this.repeated)
  34060. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34061. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34062. i = n = 0; i < t.length; i++)
  34063. n += this.element.calculateLength(this.id, t[i]);
  34064. r += I.calculateVarint32(n),
  34065. r += n
  34066. } else
  34067. for (i = 0; i < t.length; i++)
  34068. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34069. r += this.element.calculateLength(this.id, t[i]);
  34070. else
  34071. this.map ? t.forEach(function(e, t, i) {
  34072. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34073. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34074. r += I.calculateVarint32(n),
  34075. r += n
  34076. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34077. r += this.element.calculateLength(this.id, t))
  34078. } catch (e) {
  34079. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34080. }
  34081. return r
  34082. }
  34083. ,
  34084. r.decode = function(e, t, i) {
  34085. var n, r;
  34086. 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))
  34087. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34088. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34089. r = t.readVarint32(),
  34090. r = t.offset + r;
  34091. for (var o = []; t.offset < r; )
  34092. o.push(this.decode(this.type.wireType, t, !0));
  34093. return o
  34094. }
  34095. if (this.map) {
  34096. var a = u.defaultFieldValue(this.keyType);
  34097. if (n = u.defaultFieldValue(this.type),
  34098. r = t.readVarint32(),
  34099. t.remaining() < r)
  34100. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34101. var s = t.clone();
  34102. for (s.limit = s.offset + r,
  34103. t.offset += r; 0 < s.remaining(); ) {
  34104. var l = s.readVarint32();
  34105. e = 7 & l;
  34106. var c = l >>> 3;
  34107. if (1 == c)
  34108. a = this.keyElement.decode(s, e, c);
  34109. else {
  34110. if (2 != c)
  34111. throw Error("Unexpected tag in map field key/value submessage");
  34112. n = this.element.decode(s, e, c)
  34113. }
  34114. }
  34115. return [a, n]
  34116. }
  34117. return this.element.decode(t, e, this.id)
  34118. }
  34119. ,
  34120. s.Message.Field = c;
  34121. function o(e, t, i, n, r, o, a) {
  34122. c.call(this, e, t, i, null, n, r, o, a),
  34123. this.extension
  34124. }
  34125. o.prototype = Object.create(c.prototype),
  34126. s.Message.ExtensionField = o;
  34127. s.Message.OneOf = function(e, t, i) {
  34128. h.call(this, e, t, i),
  34129. this.fields = []
  34130. }
  34131. ;
  34132. var p = function(e, t, i, n, r) {
  34133. l.call(this, e, t, i, n, r),
  34134. this.className = "Enum",
  34135. this.object = null
  34136. };
  34137. p.getName = function(e, t) {
  34138. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34139. if (e[i = n[r]] === t)
  34140. return i;
  34141. return null
  34142. }
  34143. ,
  34144. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34145. if (this.object && !e)
  34146. return this.object;
  34147. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34148. t[i[n].name] = i[n].id;
  34149. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34150. value: this.buildOpt(),
  34151. enumerable: !1
  34152. }),
  34153. this.object = t
  34154. }
  34155. ,
  34156. s.Enum = p;
  34157. function f(e, t, i, n) {
  34158. h.call(this, e, t, i),
  34159. this.className = "Enum.Value",
  34160. this.id = n
  34161. }
  34162. f.prototype = Object.create(h.prototype),
  34163. s.Enum.Value = f;
  34164. var v = function(e, t, i, n) {
  34165. h.call(this, e, t, i),
  34166. this.field = n
  34167. };
  34168. v.prototype = Object.create(h.prototype),
  34169. s.Extension = v;
  34170. var y = function(e, t, i, n) {
  34171. l.call(this, e, t, i, n),
  34172. this.className = "Service",
  34173. this.clazz = null
  34174. };
  34175. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34176. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34177. for (var o = function(e) {
  34178. t.Builder.Service.call(this),
  34179. this.rpcImpl = e || function(e, t, i) {
  34180. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34181. }
  34182. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34183. !function(n) {
  34184. e[n.name] = function(e, i) {
  34185. try {
  34186. try {
  34187. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34188. } catch (e) {
  34189. if (!(e instanceof TypeError))
  34190. throw e
  34191. }
  34192. if (null === e || "object" != typeof e)
  34193. throw Error("Illegal arguments");
  34194. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34195. this.rpcImpl(n.fqn(), e, function(e, t) {
  34196. if (!e) {
  34197. null === t && (t = "");
  34198. try {
  34199. t = n.resolvedResponseType.clazz.decode(t)
  34200. } catch (e) {}
  34201. 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))
  34202. }
  34203. i(e)
  34204. })
  34205. } catch (e) {
  34206. setTimeout(i.bind(this, e), 0)
  34207. }
  34208. }
  34209. ,
  34210. o[n.name] = function(e, t, i) {
  34211. new o(e)[n.name](t, i)
  34212. }
  34213. ,
  34214. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34215. value: n.buildOpt()
  34216. }),
  34217. Object.defineProperty(e[n.name], "$options", {
  34218. value: o[n.name].$options
  34219. }))
  34220. }(i[n]);
  34221. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34222. value: r.buildOpt()
  34223. }),
  34224. Object.defineProperty(e, "$options", {
  34225. value: o.$options
  34226. }),
  34227. Object.defineProperty(o, "$type", {
  34228. value: r
  34229. }),
  34230. Object.defineProperty(e, "$type", {
  34231. value: r
  34232. })),
  34233. o
  34234. }(g, this)
  34235. }
  34236. ,
  34237. s.Service = y;
  34238. function A(e, t, i, n) {
  34239. h.call(this, e, t, i),
  34240. this.className = "Service.Method",
  34241. this.options = n || {}
  34242. }
  34243. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34244. s.Service.Method = A;
  34245. function C(e, t, i, n, r, o, a, s) {
  34246. A.call(this, e, t, i, s),
  34247. this.className = "Service.RPCMethod",
  34248. this.requestName = n,
  34249. this.responseName = r,
  34250. this.requestStream = o,
  34251. this.responseStream = a,
  34252. this.resolvedRequestType = null,
  34253. this.resolvedResponseType = null
  34254. }
  34255. return C.prototype = Object.create(A.prototype),
  34256. s.Service.RPCMethod = C,
  34257. s
  34258. }(o),
  34259. o.Builder = (i = (u = o).Lang,
  34260. s = o.Reflect,
  34261. n = h.prototype,
  34262. h.isMessage = function(e) {
  34263. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34264. }
  34265. ,
  34266. h.isMessageField = function(e) {
  34267. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34268. }
  34269. ,
  34270. h.isEnum = function(e) {
  34271. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34272. }
  34273. ,
  34274. h.isService = function(e) {
  34275. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34276. }
  34277. ,
  34278. h.isExtend = function(e) {
  34279. return "string" == typeof e.ref
  34280. }
  34281. ,
  34282. n.reset = function() {
  34283. return this.ptr = this.ns,
  34284. this
  34285. }
  34286. ,
  34287. n.define = function(e) {
  34288. if ("string" != typeof e || !i.TYPEREF.test(e))
  34289. throw Error("illegal namespace: " + e);
  34290. return e.split(".").forEach(function(e) {
  34291. var t = this.ptr.getChild(e);
  34292. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34293. this.ptr = t
  34294. }, this),
  34295. this
  34296. }
  34297. ,
  34298. n.create = function(e) {
  34299. if (!e)
  34300. return this;
  34301. if (Array.isArray(e)) {
  34302. if (0 === e.length)
  34303. return this;
  34304. e = e.slice()
  34305. } else
  34306. e = [e];
  34307. for (var t = [e]; 0 < t.length; ) {
  34308. if (e = t.pop(),
  34309. !Array.isArray(e))
  34310. throw Error("not a valid namespace: " + JSON.stringify(e));
  34311. for (; 0 < e.length; ) {
  34312. var i = e.shift();
  34313. if (h.isMessage(i)) {
  34314. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34315. , n = {};
  34316. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34317. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34318. }, this),
  34319. i.fields && i.fields.forEach(function(e) {
  34320. if (null !== o.getChild(0 | e.id))
  34321. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34322. if (e.options && "object" != typeof e.options)
  34323. throw Error("illegal field options in " + o.name + "#" + e.name);
  34324. var t = null;
  34325. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34326. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34327. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34328. t && t.fields.push(e),
  34329. o.addChild(e)
  34330. }, this);
  34331. var r = [];
  34332. if (i.enums && i.enums.forEach(function(e) {
  34333. r.push(e)
  34334. }),
  34335. i.messages && i.messages.forEach(function(e) {
  34336. r.push(e)
  34337. }),
  34338. i.services && i.services.forEach(function(e) {
  34339. r.push(e)
  34340. }),
  34341. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34342. this.ptr.addChild(o),
  34343. 0 < r.length) {
  34344. t.push(e),
  34345. e = r,
  34346. r = null,
  34347. this.ptr = o,
  34348. o = null;
  34349. continue
  34350. }
  34351. r = null
  34352. } else if (h.isEnum(i))
  34353. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34354. i.values.forEach(function(e) {
  34355. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34356. }, this),
  34357. this.ptr.addChild(o);
  34358. else if (h.isService(i))
  34359. o = new s.Service(this,this.ptr,i.name,i.options),
  34360. Object.keys(i.rpc).forEach(function(e) {
  34361. var t = i.rpc[e];
  34362. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34363. }, this),
  34364. this.ptr.addChild(o);
  34365. else {
  34366. if (!h.isExtend(i))
  34367. throw Error("not a valid definition: " + JSON.stringify(i));
  34368. if (o = this.ptr.resolve(i.ref, !0))
  34369. i.fields.forEach(function(t) {
  34370. if (null !== o.getChild(0 | t.id))
  34371. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34372. if (o.extensions) {
  34373. var i = !1;
  34374. if (o.extensions.forEach(function(e) {
  34375. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34376. }),
  34377. !i)
  34378. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34379. }
  34380. var e = t.name;
  34381. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34382. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34383. , r = new s.Extension(this,this.ptr,t.name,n);
  34384. n.extension = r,
  34385. this.ptr.addChild(r),
  34386. o.addChild(n)
  34387. }, this);
  34388. else if (!/\.?google\.protobuf\./.test(i.ref))
  34389. throw Error("extended message " + i.ref + " is not defined")
  34390. }
  34391. o = i = null
  34392. }
  34393. e = null,
  34394. this.ptr = this.ptr.parent
  34395. }
  34396. return this.resolved = !1,
  34397. this.result = null,
  34398. this
  34399. }
  34400. ,
  34401. n.import = function(t, e) {
  34402. var i = "/";
  34403. if ("string" == typeof e) {
  34404. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34405. !0 === this.files[e])
  34406. return this.reset();
  34407. this.files[e] = !0
  34408. } else if ("object" == typeof e) {
  34409. var n = e.root;
  34410. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34411. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34412. var r = n + i + e.file;
  34413. if (!0 === this.files[r])
  34414. return this.reset();
  34415. this.files[r] = !0
  34416. }
  34417. if (t.imports && 0 < t.imports.length) {
  34418. var o, a = !1;
  34419. "object" == typeof e ? (this.importRoot = e.root,
  34420. a = !0,
  34421. o = this.importRoot,
  34422. e = e.file,
  34423. (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(/\\[^\\]*$/, ""),
  34424. i = "\\") : o = "." : o = null;
  34425. for (var s = 0; s < t.imports.length; s++)
  34426. if ("string" == typeof t.imports[s]) {
  34427. if (!o)
  34428. throw Error("cannot determine import root");
  34429. var l = t.imports[s];
  34430. if ("google/protobuf/descriptor.proto" === l)
  34431. continue;
  34432. if (l = o + i + l,
  34433. !0 === this.files[l])
  34434. continue;
  34435. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34436. var c = u.Util.fetch(l);
  34437. if (null === c)
  34438. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34439. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34440. } else
  34441. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34442. return t + "_import" + s + "." + i
  34443. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34444. a && (this.importRoot = null)
  34445. }
  34446. t.package && this.define(t.package),
  34447. t.syntax && function t(i) {
  34448. i.messages && i.messages.forEach(function(e) {
  34449. e.syntax = i.syntax,
  34450. t(e)
  34451. }),
  34452. i.enums && i.enums.forEach(function(e) {
  34453. e.syntax = i.syntax
  34454. })
  34455. }(t);
  34456. var h = this.ptr;
  34457. return t.options && Object.keys(t.options).forEach(function(e) {
  34458. h.options[e] = t.options[e]
  34459. }),
  34460. t.messages && (this.create(t.messages),
  34461. this.ptr = h),
  34462. t.enums && (this.create(t.enums),
  34463. this.ptr = h),
  34464. t.services && (this.create(t.services),
  34465. this.ptr = h),
  34466. t.extends && this.create(t.extends),
  34467. this.reset()
  34468. }
  34469. ,
  34470. n.resolveAll = function() {
  34471. var e;
  34472. if (null == this.ptr || "object" == typeof this.ptr.type)
  34473. return this;
  34474. if (this.ptr instanceof s.Namespace)
  34475. this.ptr.children.forEach(function(e) {
  34476. this.ptr = e,
  34477. this.resolveAll()
  34478. }, this);
  34479. else if (this.ptr instanceof s.Message.Field) {
  34480. if (i.TYPE.test(this.ptr.type))
  34481. this.ptr.type = u.TYPES[this.ptr.type];
  34482. else {
  34483. if (!i.TYPEREF.test(this.ptr.type))
  34484. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34485. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34486. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34487. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34488. if (this.ptr.type = u.TYPES.enum,
  34489. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34490. throw Error("proto3 message cannot reference proto2 enum")
  34491. } else {
  34492. if (!(e instanceof s.Message))
  34493. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34494. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34495. }
  34496. }
  34497. if (this.ptr.map) {
  34498. if (!i.TYPE.test(this.ptr.keyType))
  34499. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34500. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34501. }
  34502. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34503. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34504. throw Error("illegal service type in " + this.ptr.toString(!0));
  34505. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34506. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34507. if (this.ptr.resolvedRequestType = e,
  34508. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34509. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34510. this.ptr.resolvedResponseType = e
  34511. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34512. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34513. return this.reset()
  34514. }
  34515. ,
  34516. n.build = function(e) {
  34517. if (this.reset(),
  34518. this.resolved || (this.resolveAll(),
  34519. this.resolved = !0,
  34520. this.result = null),
  34521. null === this.result && (this.result = this.ns.build()),
  34522. !e)
  34523. return this.result;
  34524. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34525. if (!i[t[n]]) {
  34526. i = null;
  34527. break
  34528. }
  34529. i = i[t[n]]
  34530. }
  34531. return i
  34532. }
  34533. ,
  34534. n.lookup = function(e, t) {
  34535. return e ? this.ns.resolve(e, t) : this.ns
  34536. }
  34537. ,
  34538. n.toString = function() {
  34539. return "Builder"
  34540. }
  34541. ,
  34542. h.Message = function() {}
  34543. ,
  34544. h.Enum = function() {}
  34545. ,
  34546. h.Service = function() {}
  34547. ,
  34548. h),
  34549. o.Map = (a = o.Reflect,
  34550. (t = c.prototype).clear = function() {
  34551. this.map = {}
  34552. }
  34553. ,
  34554. t.delete = function(e) {
  34555. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34556. , i = t in this.map;
  34557. return delete this.map[t],
  34558. i
  34559. }
  34560. ,
  34561. t.entries = function() {
  34562. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34563. t.push([(e = this.map[i[n]]).key, e.value]);
  34564. return l(t)
  34565. }
  34566. ,
  34567. t.keys = function() {
  34568. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34569. e.push(this.map[t[i]].key);
  34570. return l(e)
  34571. }
  34572. ,
  34573. t.values = function() {
  34574. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34575. e.push(this.map[t[i]].value);
  34576. return l(e)
  34577. }
  34578. ,
  34579. t.forEach = function(e, t) {
  34580. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34581. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34582. }
  34583. ,
  34584. t.set = function(e, t) {
  34585. var i = this.keyElem.verifyValue(e)
  34586. , n = this.valueElem.verifyValue(t);
  34587. return this.map[this.keyElem.valueToString(i)] = {
  34588. key: i,
  34589. value: n
  34590. },
  34591. this
  34592. }
  34593. ,
  34594. t.get = function(e) {
  34595. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34596. if (t in this.map)
  34597. return this.map[t].value
  34598. }
  34599. ,
  34600. t.has = function(e) {
  34601. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34602. }
  34603. ,
  34604. c),
  34605. o.loadProto = function(e, t, i) {
  34606. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34607. t = void 0),
  34608. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34609. }
  34610. ,
  34611. o.protoFromString = o.loadProto,
  34612. o.loadProtoFile = function(t, i, n) {
  34613. if (i && "object" == typeof i ? (n = i,
  34614. i = null) : i && "function" == typeof i || (i = null),
  34615. i)
  34616. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34617. if (null !== e)
  34618. try {
  34619. i(null, o.loadProto(e, n, t))
  34620. } catch (e) {
  34621. i(e)
  34622. }
  34623. else
  34624. i(Error("Failed to fetch file"))
  34625. });
  34626. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34627. return null === e ? null : o.loadProto(e, n, t)
  34628. }
  34629. ,
  34630. o.protoFromFile = o.loadProtoFile,
  34631. o.newBuilder = function(e) {
  34632. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34633. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34634. new o.Builder(e)
  34635. }
  34636. ,
  34637. o.loadJson = function(e, t, i) {
  34638. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34639. t = null),
  34640. t && "object" == typeof t || (t = o.newBuilder()),
  34641. "string" == typeof e && (e = JSON.parse(e)),
  34642. t.import(e, i),
  34643. t.resolveAll(),
  34644. t
  34645. }
  34646. ,
  34647. o.loadJsonFile = function(t, i, n) {
  34648. if (i && "object" == typeof i ? (n = i,
  34649. i = null) : i && "function" == typeof i || (i = null),
  34650. i)
  34651. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34652. if (null !== e)
  34653. try {
  34654. i(null, o.loadJson(JSON.parse(e), n, t))
  34655. } catch (e) {
  34656. i(e)
  34657. }
  34658. else
  34659. i(Error("Failed to fetch file"))
  34660. });
  34661. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34662. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34663. }
  34664. ,
  34665. o;
  34666. function l(e) {
  34667. var t = 0;
  34668. return {
  34669. next: function() {
  34670. return t < e.length ? {
  34671. done: !1,
  34672. value: e[t++]
  34673. } : {
  34674. done: !0
  34675. }
  34676. }
  34677. }
  34678. }
  34679. function c(e, t) {
  34680. if (!e.map)
  34681. throw Error("field is not a map");
  34682. if (this.field = e,
  34683. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34684. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34685. this.map = {},
  34686. Object.defineProperty(this, "size", {
  34687. get: function() {
  34688. return Object.keys(this.map).length
  34689. }
  34690. }),
  34691. t)
  34692. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34693. var r = this.keyElem.valueFromString(i[n])
  34694. , o = this.valueElem.verifyValue(t[i[n]]);
  34695. this.map[this.keyElem.valueToString(r)] = {
  34696. key: r,
  34697. value: o
  34698. }
  34699. }
  34700. }
  34701. function h(e) {
  34702. this.ns = new s.Namespace(this,null,""),
  34703. this.ptr = this.ns,
  34704. this.resolved = !1,
  34705. this.result = null,
  34706. this.files = {},
  34707. this.importRoot = null,
  34708. this.options = e || {}
  34709. }
  34710. }
  34711. ,
  34712. "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)
  34713. }
  34714. ).call(this, p("_process"))
  34715. }
  34716. , {
  34717. _process: 203,
  34718. bytebuffer: 215,
  34719. fs: 197,
  34720. path: 197
  34721. }],
  34722. 215: [function(t, e, i) {
  34723. var n, r;
  34724. n = this,
  34725. r = function(l) {
  34726. "use strict";
  34727. function s(e) {
  34728. var t = 0;
  34729. return function() {
  34730. return t < e.length ? e.charCodeAt(t++) : null
  34731. }
  34732. }
  34733. function c() {
  34734. var e = []
  34735. , t = [];
  34736. return function() {
  34737. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34738. e.length = 0),
  34739. void Array.prototype.push.apply(e, arguments))
  34740. }
  34741. }
  34742. function n(e, t, i, n, r) {
  34743. 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];
  34744. for (u += d,
  34745. o = p & (1 << -h) - 1,
  34746. p >>= -h,
  34747. h += s; 0 < h; o = 256 * o + e[t + u],
  34748. u += d,
  34749. h -= 8)
  34750. ;
  34751. for (a = o & (1 << -h) - 1,
  34752. o >>= -h,
  34753. h += n; 0 < h; a = 256 * a + e[t + u],
  34754. u += d,
  34755. h -= 8)
  34756. ;
  34757. if (0 === o)
  34758. o = 1 - c;
  34759. else {
  34760. if (o === l)
  34761. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34762. a += Math.pow(2, n),
  34763. o -= c
  34764. }
  34765. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34766. }
  34767. function r(e, t, i, n, r, o) {
  34768. 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;
  34769. for (t = Math.abs(t),
  34770. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34771. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34772. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34773. l *= 2),
  34774. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34775. l /= 2),
  34776. h <= a + u ? (s = 0,
  34777. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34778. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34779. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34780. p += f,
  34781. s /= 256,
  34782. r -= 8)
  34783. ;
  34784. for (a = a << r | s,
  34785. c += r; 0 < c; e[i + p] = 255 & a,
  34786. p += f,
  34787. a /= 256,
  34788. c -= 8)
  34789. ;
  34790. e[i + p - f] |= 128 * g
  34791. }
  34792. var f = function(e, t, i) {
  34793. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34794. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34795. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34796. !i) {
  34797. if ((e |= 0) < 0)
  34798. throw RangeError("Illegal capacity");
  34799. t = !!t,
  34800. i = !!i
  34801. }
  34802. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34803. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34804. this.offset = 0,
  34805. this.markedOffset = -1,
  34806. this.limit = e,
  34807. this.littleEndian = t,
  34808. this.noAssert = i
  34809. };
  34810. f.VERSION = "5.0.1",
  34811. f.LITTLE_ENDIAN = !0,
  34812. f.BIG_ENDIAN = !1,
  34813. f.DEFAULT_CAPACITY = 16,
  34814. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34815. f.DEFAULT_NOASSERT = !1,
  34816. f.Long = l || null;
  34817. var a = f.prototype;
  34818. a.__isByteBuffer__,
  34819. Object.defineProperty(a, "__isByteBuffer__", {
  34820. value: !0,
  34821. enumerable: !1,
  34822. configurable: !1
  34823. });
  34824. var o = new ArrayBuffer(0)
  34825. , i = String.fromCharCode;
  34826. f.accessor = function() {
  34827. return Uint8Array
  34828. }
  34829. ,
  34830. f.allocate = function(e, t, i) {
  34831. return new f(e,t,i)
  34832. }
  34833. ,
  34834. f.concat = function(e, t, i, n) {
  34835. "boolean" != typeof t && "string" == typeof t || (n = i,
  34836. i = t,
  34837. t = void 0);
  34838. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34839. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34840. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34841. if (0 === o)
  34842. return new f(0,i,n);
  34843. var l, c = new f(o,i,n);
  34844. for (a = 0; a < s; )
  34845. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34846. c.offset += r);
  34847. return c.limit = c.offset,
  34848. c.offset = 0,
  34849. c
  34850. }
  34851. ,
  34852. f.isByteBuffer = function(e) {
  34853. return !0 === (e && e.__isByteBuffer__)
  34854. }
  34855. ,
  34856. f.type = function() {
  34857. return ArrayBuffer
  34858. }
  34859. ,
  34860. f.wrap = function(e, t, i, n) {
  34861. if ("string" != typeof t && (n = i,
  34862. i = t,
  34863. t = void 0),
  34864. "string" == typeof e)
  34865. switch (void 0 === t && (t = "utf8"),
  34866. t) {
  34867. case "base64":
  34868. return f.fromBase64(e, i);
  34869. case "hex":
  34870. return f.fromHex(e, i);
  34871. case "binary":
  34872. return f.fromBinary(e, i);
  34873. case "utf8":
  34874. return f.fromUTF8(e, i);
  34875. case "debug":
  34876. return f.fromDebug(e, i);
  34877. default:
  34878. throw Error("Unsupported encoding: " + t)
  34879. }
  34880. if (null === e || "object" != typeof e)
  34881. throw TypeError("Illegal buffer");
  34882. var r;
  34883. if (f.isByteBuffer(e))
  34884. return (r = a.clone.call(e)).markedOffset = -1,
  34885. r;
  34886. if (e instanceof Uint8Array)
  34887. r = new f(0,i,n),
  34888. 0 < e.length && (r.buffer = e.buffer,
  34889. r.offset = e.byteOffset,
  34890. r.limit = e.byteOffset + e.byteLength,
  34891. r.view = new Uint8Array(e.buffer));
  34892. else if (e instanceof ArrayBuffer)
  34893. r = new f(0,i,n),
  34894. 0 < e.byteLength && (r.buffer = e,
  34895. r.offset = 0,
  34896. r.limit = e.byteLength,
  34897. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34898. else {
  34899. if ("[object Array]" !== Object.prototype.toString.call(e))
  34900. throw TypeError("Illegal buffer");
  34901. (r = new f(e.length,i,n)).limit = e.length;
  34902. for (var o = 0; o < e.length; ++o)
  34903. r.view[o] = e[o]
  34904. }
  34905. return r
  34906. }
  34907. ,
  34908. a.writeBitSet = function(e, t) {
  34909. var i = void 0 === t;
  34910. if (i && (t = this.offset),
  34911. !this.noAssert) {
  34912. if (!(e instanceof Array))
  34913. throw TypeError("Illegal BitSet: Not an array");
  34914. if ("number" != typeof t || t % 1 != 0)
  34915. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34916. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34917. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34918. }
  34919. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34920. for (t += this.writeVarint32(o, t); a--; )
  34921. 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,
  34922. this.writeByte(n, t++);
  34923. if (s < o) {
  34924. var l = 0;
  34925. for (n = 0; s < o; )
  34926. n |= (1 & !!e[s++]) << l++;
  34927. this.writeByte(n, t++)
  34928. }
  34929. return i ? (this.offset = t,
  34930. this) : t - r
  34931. }
  34932. ,
  34933. a.readBitSet = function(e) {
  34934. var t = void 0 === e;
  34935. t && (e = this.offset);
  34936. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34937. for (e += n.length; o--; )
  34938. i = this.readByte(e++),
  34939. s[a++] = !!(1 & i),
  34940. s[a++] = !!(2 & i),
  34941. s[a++] = !!(4 & i),
  34942. s[a++] = !!(8 & i),
  34943. s[a++] = !!(16 & i),
  34944. s[a++] = !!(32 & i),
  34945. s[a++] = !!(64 & i),
  34946. s[a++] = !!(128 & i);
  34947. if (a < r) {
  34948. var l = 0;
  34949. for (i = this.readByte(e++); a < r; )
  34950. s[a++] = !!(i >> l++ & 1)
  34951. }
  34952. return t && (this.offset = e),
  34953. s
  34954. }
  34955. ,
  34956. a.readBytes = function(e, t) {
  34957. var i = void 0 === t;
  34958. if (i && (t = this.offset),
  34959. !this.noAssert) {
  34960. if ("number" != typeof t || t % 1 != 0)
  34961. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34962. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34963. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34964. }
  34965. var n = this.slice(t, t + e);
  34966. return i && (this.offset += e),
  34967. n
  34968. }
  34969. ,
  34970. a.writeBytes = a.append,
  34971. a.writeInt8 = function(e, t) {
  34972. var i = void 0 === t;
  34973. if (i && (t = this.offset),
  34974. !this.noAssert) {
  34975. if ("number" != typeof e || e % 1 != 0)
  34976. throw TypeError("Illegal value: " + e + " (not an integer)");
  34977. if (e |= 0,
  34978. "number" != typeof t || t % 1 != 0)
  34979. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34980. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34981. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34982. }
  34983. t += 1;
  34984. var n = this.buffer.byteLength;
  34985. return n < t && this.resize((n *= 2) > t ? n : t),
  34986. t -= 1,
  34987. this.view[t] = e,
  34988. i && (this.offset += 1),
  34989. this
  34990. }
  34991. ,
  34992. a.writeByte = a.writeInt8,
  34993. a.readInt8 = function(e) {
  34994. var t = void 0 === e;
  34995. if (t && (e = this.offset),
  34996. !this.noAssert) {
  34997. if ("number" != typeof e || e % 1 != 0)
  34998. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34999. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35000. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35001. }
  35002. var i = this.view[e];
  35003. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35004. t && (this.offset += 1),
  35005. i
  35006. }
  35007. ,
  35008. a.readByte = a.readInt8,
  35009. a.writeUint8 = function(e, t) {
  35010. var i = void 0 === t;
  35011. if (i && (t = this.offset),
  35012. !this.noAssert) {
  35013. if ("number" != typeof e || e % 1 != 0)
  35014. throw TypeError("Illegal value: " + e + " (not an integer)");
  35015. if (e >>>= 0,
  35016. "number" != typeof t || t % 1 != 0)
  35017. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35018. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35019. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35020. }
  35021. t += 1;
  35022. var n = this.buffer.byteLength;
  35023. return n < t && this.resize((n *= 2) > t ? n : t),
  35024. t -= 1,
  35025. this.view[t] = e,
  35026. i && (this.offset += 1),
  35027. this
  35028. }
  35029. ,
  35030. a.writeUInt8 = a.writeUint8,
  35031. a.readUint8 = function(e) {
  35032. var t = void 0 === e;
  35033. if (t && (e = this.offset),
  35034. !this.noAssert) {
  35035. if ("number" != typeof e || e % 1 != 0)
  35036. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35037. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35038. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35039. }
  35040. var i = this.view[e];
  35041. return t && (this.offset += 1),
  35042. i
  35043. }
  35044. ,
  35045. a.readUInt8 = a.readUint8,
  35046. a.writeInt16 = function(e, t) {
  35047. var i = void 0 === t;
  35048. if (i && (t = this.offset),
  35049. !this.noAssert) {
  35050. if ("number" != typeof e || e % 1 != 0)
  35051. throw TypeError("Illegal value: " + e + " (not an integer)");
  35052. if (e |= 0,
  35053. "number" != typeof t || t % 1 != 0)
  35054. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35055. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35056. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35057. }
  35058. t += 2;
  35059. var n = this.buffer.byteLength;
  35060. return n < t && this.resize((n *= 2) > t ? n : t),
  35061. t -= 2,
  35062. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35063. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35064. this.view[t + 1] = 255 & e),
  35065. i && (this.offset += 2),
  35066. this
  35067. }
  35068. ,
  35069. a.writeShort = a.writeInt16,
  35070. a.readInt16 = function(e) {
  35071. var t = void 0 === e;
  35072. if (t && (e = this.offset),
  35073. !this.noAssert) {
  35074. if ("number" != typeof e || e % 1 != 0)
  35075. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35076. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35077. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35078. }
  35079. var i = 0;
  35080. return this.littleEndian ? (i = this.view[e],
  35081. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35082. i |= this.view[e + 1]),
  35083. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35084. t && (this.offset += 2),
  35085. i
  35086. }
  35087. ,
  35088. a.readShort = a.readInt16,
  35089. a.writeUint16 = function(e, t) {
  35090. var i = void 0 === t;
  35091. if (i && (t = this.offset),
  35092. !this.noAssert) {
  35093. if ("number" != typeof e || e % 1 != 0)
  35094. throw TypeError("Illegal value: " + e + " (not an integer)");
  35095. if (e >>>= 0,
  35096. "number" != typeof t || t % 1 != 0)
  35097. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35098. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35099. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35100. }
  35101. t += 2;
  35102. var n = this.buffer.byteLength;
  35103. return n < t && this.resize((n *= 2) > t ? n : t),
  35104. t -= 2,
  35105. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35106. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35107. this.view[t + 1] = 255 & e),
  35108. i && (this.offset += 2),
  35109. this
  35110. }
  35111. ,
  35112. a.writeUInt16 = a.writeUint16,
  35113. a.readUint16 = function(e) {
  35114. var t = void 0 === e;
  35115. if (t && (e = this.offset),
  35116. !this.noAssert) {
  35117. if ("number" != typeof e || e % 1 != 0)
  35118. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35119. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35120. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35121. }
  35122. var i = 0;
  35123. return this.littleEndian ? (i = this.view[e],
  35124. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35125. i |= this.view[e + 1]),
  35126. t && (this.offset += 2),
  35127. i
  35128. }
  35129. ,
  35130. a.readUInt16 = a.readUint16,
  35131. a.writeInt32 = function(e, t) {
  35132. var i = void 0 === t;
  35133. if (i && (t = this.offset),
  35134. !this.noAssert) {
  35135. if ("number" != typeof e || e % 1 != 0)
  35136. throw TypeError("Illegal value: " + e + " (not an integer)");
  35137. if (e |= 0,
  35138. "number" != typeof t || t % 1 != 0)
  35139. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35140. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35141. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35142. }
  35143. t += 4;
  35144. var n = this.buffer.byteLength;
  35145. return n < t && this.resize((n *= 2) > t ? n : t),
  35146. t -= 4,
  35147. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35148. this.view[t + 2] = e >>> 16 & 255,
  35149. this.view[t + 1] = e >>> 8 & 255,
  35150. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35151. this.view[t + 1] = e >>> 16 & 255,
  35152. this.view[t + 2] = e >>> 8 & 255,
  35153. this.view[t + 3] = 255 & e),
  35154. i && (this.offset += 4),
  35155. this
  35156. }
  35157. ,
  35158. a.writeInt = a.writeInt32,
  35159. a.readInt32 = function(e) {
  35160. var t = void 0 === e;
  35161. if (t && (e = this.offset),
  35162. !this.noAssert) {
  35163. if ("number" != typeof e || e % 1 != 0)
  35164. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35165. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35166. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35167. }
  35168. var i = 0;
  35169. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35170. i |= this.view[e + 1] << 8,
  35171. i |= this.view[e],
  35172. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35173. i |= this.view[e + 2] << 8,
  35174. i |= this.view[e + 3],
  35175. i += this.view[e] << 24 >>> 0),
  35176. i |= 0,
  35177. t && (this.offset += 4),
  35178. i
  35179. }
  35180. ,
  35181. a.readInt = a.readInt32,
  35182. a.writeUint32 = function(e, t) {
  35183. var i = void 0 === t;
  35184. if (i && (t = this.offset),
  35185. !this.noAssert) {
  35186. if ("number" != typeof e || e % 1 != 0)
  35187. throw TypeError("Illegal value: " + e + " (not an integer)");
  35188. if (e >>>= 0,
  35189. "number" != typeof t || t % 1 != 0)
  35190. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35191. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35192. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35193. }
  35194. t += 4;
  35195. var n = this.buffer.byteLength;
  35196. return n < t && this.resize((n *= 2) > t ? n : t),
  35197. t -= 4,
  35198. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35199. this.view[t + 2] = e >>> 16 & 255,
  35200. this.view[t + 1] = e >>> 8 & 255,
  35201. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35202. this.view[t + 1] = e >>> 16 & 255,
  35203. this.view[t + 2] = e >>> 8 & 255,
  35204. this.view[t + 3] = 255 & e),
  35205. i && (this.offset += 4),
  35206. this
  35207. }
  35208. ,
  35209. a.writeUInt32 = a.writeUint32,
  35210. a.readUint32 = 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 = 0;
  35220. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35221. i |= this.view[e + 1] << 8,
  35222. i |= this.view[e],
  35223. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35224. i |= this.view[e + 2] << 8,
  35225. i |= this.view[e + 3],
  35226. i += this.view[e] << 24 >>> 0),
  35227. t && (this.offset += 4),
  35228. i
  35229. }
  35230. ,
  35231. a.readUInt32 = a.readUint32,
  35232. l && (a.writeInt64 = function(e, t) {
  35233. var i = void 0 === t;
  35234. if (i && (t = this.offset),
  35235. !this.noAssert) {
  35236. if ("number" == typeof e)
  35237. e = l.fromNumber(e);
  35238. else if ("string" == typeof e)
  35239. e = l.fromString(e);
  35240. else if (!(e && e instanceof l))
  35241. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35242. if ("number" != typeof t || t % 1 != 0)
  35243. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35244. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35245. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35246. }
  35247. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35248. t += 8;
  35249. var n = this.buffer.byteLength;
  35250. n < t && this.resize((n *= 2) > t ? n : t),
  35251. t -= 8;
  35252. var r = e.low
  35253. , o = e.high;
  35254. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35255. this.view[t + 2] = r >>> 16 & 255,
  35256. this.view[t + 1] = r >>> 8 & 255,
  35257. this.view[t] = 255 & r,
  35258. t += 4,
  35259. this.view[t + 3] = o >>> 24 & 255,
  35260. this.view[t + 2] = o >>> 16 & 255,
  35261. this.view[t + 1] = o >>> 8 & 255,
  35262. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35263. this.view[t + 1] = o >>> 16 & 255,
  35264. this.view[t + 2] = o >>> 8 & 255,
  35265. this.view[t + 3] = 255 & o,
  35266. t += 4,
  35267. this.view[t] = r >>> 24 & 255,
  35268. this.view[t + 1] = r >>> 16 & 255,
  35269. this.view[t + 2] = r >>> 8 & 255,
  35270. this.view[t + 3] = 255 & r),
  35271. i && (this.offset += 8),
  35272. this
  35273. }
  35274. ,
  35275. a.writeLong = a.writeInt64,
  35276. a.readInt64 = function(e) {
  35277. var t = void 0 === e;
  35278. if (t && (e = this.offset),
  35279. !this.noAssert) {
  35280. if ("number" != typeof e || e % 1 != 0)
  35281. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35282. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35283. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35284. }
  35285. var i = 0
  35286. , n = 0;
  35287. this.littleEndian ? (i = this.view[e + 2] << 16,
  35288. i |= this.view[e + 1] << 8,
  35289. i |= this.view[e],
  35290. i += this.view[e + 3] << 24 >>> 0,
  35291. e += 4,
  35292. n = this.view[e + 2] << 16,
  35293. n |= this.view[e + 1] << 8,
  35294. n |= this.view[e],
  35295. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35296. n |= this.view[e + 2] << 8,
  35297. n |= this.view[e + 3],
  35298. n += this.view[e] << 24 >>> 0,
  35299. e += 4,
  35300. i = this.view[e + 1] << 16,
  35301. i |= this.view[e + 2] << 8,
  35302. i |= this.view[e + 3],
  35303. i += this.view[e] << 24 >>> 0);
  35304. var r = new l(i,n,!1);
  35305. return t && (this.offset += 8),
  35306. r
  35307. }
  35308. ,
  35309. a.readLong = a.readInt64,
  35310. a.writeUint64 = function(e, t) {
  35311. var i = void 0 === t;
  35312. if (i && (t = this.offset),
  35313. !this.noAssert) {
  35314. if ("number" == typeof e)
  35315. e = l.fromNumber(e);
  35316. else if ("string" == typeof e)
  35317. e = l.fromString(e);
  35318. else if (!(e && e instanceof l))
  35319. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35320. if ("number" != typeof t || t % 1 != 0)
  35321. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35322. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35323. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35324. }
  35325. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35326. t += 8;
  35327. var n = this.buffer.byteLength;
  35328. n < t && this.resize((n *= 2) > t ? n : t),
  35329. t -= 8;
  35330. var r = e.low
  35331. , o = e.high;
  35332. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35333. this.view[t + 2] = r >>> 16 & 255,
  35334. this.view[t + 1] = r >>> 8 & 255,
  35335. this.view[t] = 255 & r,
  35336. t += 4,
  35337. this.view[t + 3] = o >>> 24 & 255,
  35338. this.view[t + 2] = o >>> 16 & 255,
  35339. this.view[t + 1] = o >>> 8 & 255,
  35340. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35341. this.view[t + 1] = o >>> 16 & 255,
  35342. this.view[t + 2] = o >>> 8 & 255,
  35343. this.view[t + 3] = 255 & o,
  35344. t += 4,
  35345. this.view[t] = r >>> 24 & 255,
  35346. this.view[t + 1] = r >>> 16 & 255,
  35347. this.view[t + 2] = r >>> 8 & 255,
  35348. this.view[t + 3] = 255 & r),
  35349. i && (this.offset += 8),
  35350. this
  35351. }
  35352. ,
  35353. a.writeUInt64 = a.writeUint64,
  35354. a.readUint64 = function(e) {
  35355. var t = void 0 === e;
  35356. if (t && (e = this.offset),
  35357. !this.noAssert) {
  35358. if ("number" != typeof e || e % 1 != 0)
  35359. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35360. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35361. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35362. }
  35363. var i = 0
  35364. , n = 0;
  35365. this.littleEndian ? (i = this.view[e + 2] << 16,
  35366. i |= this.view[e + 1] << 8,
  35367. i |= this.view[e],
  35368. i += this.view[e + 3] << 24 >>> 0,
  35369. e += 4,
  35370. n = this.view[e + 2] << 16,
  35371. n |= this.view[e + 1] << 8,
  35372. n |= this.view[e],
  35373. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35374. n |= this.view[e + 2] << 8,
  35375. n |= this.view[e + 3],
  35376. n += this.view[e] << 24 >>> 0,
  35377. e += 4,
  35378. i = this.view[e + 1] << 16,
  35379. i |= this.view[e + 2] << 8,
  35380. i |= this.view[e + 3],
  35381. i += this.view[e] << 24 >>> 0);
  35382. var r = new l(i,n,!0);
  35383. return t && (this.offset += 8),
  35384. r
  35385. }
  35386. ,
  35387. a.readUInt64 = a.readUint64),
  35388. a.writeFloat32 = function(e, t) {
  35389. var i = void 0 === t;
  35390. if (i && (t = this.offset),
  35391. !this.noAssert) {
  35392. if ("number" != typeof e)
  35393. throw TypeError("Illegal value: " + e + " (not a number)");
  35394. if ("number" != typeof t || t % 1 != 0)
  35395. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35396. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35397. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35398. }
  35399. t += 4;
  35400. var n = this.buffer.byteLength;
  35401. return n < t && this.resize((n *= 2) > t ? n : t),
  35402. t -= 4,
  35403. r(this.view, e, t, this.littleEndian, 23, 4),
  35404. i && (this.offset += 4),
  35405. this
  35406. }
  35407. ,
  35408. a.writeFloat = a.writeFloat32,
  35409. a.readFloat32 = function(e) {
  35410. var t = void 0 === e;
  35411. if (t && (e = this.offset),
  35412. !this.noAssert) {
  35413. if ("number" != typeof e || e % 1 != 0)
  35414. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35415. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35416. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35417. }
  35418. var i = n(this.view, e, this.littleEndian, 23, 4);
  35419. return t && (this.offset += 4),
  35420. i
  35421. }
  35422. ,
  35423. a.readFloat = a.readFloat32,
  35424. a.writeFloat64 = function(e, t) {
  35425. var i = void 0 === t;
  35426. if (i && (t = this.offset),
  35427. !this.noAssert) {
  35428. if ("number" != typeof e)
  35429. throw TypeError("Illegal value: " + e + " (not a number)");
  35430. if ("number" != typeof t || t % 1 != 0)
  35431. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35432. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35433. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35434. }
  35435. t += 8;
  35436. var n = this.buffer.byteLength;
  35437. return n < t && this.resize((n *= 2) > t ? n : t),
  35438. t -= 8,
  35439. r(this.view, e, t, this.littleEndian, 52, 8),
  35440. i && (this.offset += 8),
  35441. this
  35442. }
  35443. ,
  35444. a.writeDouble = a.writeFloat64,
  35445. a.readFloat64 = function(e) {
  35446. var t = void 0 === e;
  35447. if (t && (e = this.offset),
  35448. !this.noAssert) {
  35449. if ("number" != typeof e || e % 1 != 0)
  35450. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35451. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35452. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35453. }
  35454. var i = n(this.view, e, this.littleEndian, 52, 8);
  35455. return t && (this.offset += 8),
  35456. i
  35457. }
  35458. ,
  35459. a.readDouble = a.readFloat64,
  35460. f.MAX_VARINT32_BYTES = 5,
  35461. f.calculateVarint32 = function(e) {
  35462. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35463. }
  35464. ,
  35465. f.zigZagEncode32 = function(e) {
  35466. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35467. }
  35468. ,
  35469. f.zigZagDecode32 = function(e) {
  35470. return e >>> 1 ^ -(1 & e) | 0
  35471. }
  35472. ,
  35473. a.writeVarint32 = function(e, t) {
  35474. var i = void 0 === t;
  35475. if (i && (t = this.offset),
  35476. !this.noAssert) {
  35477. if ("number" != typeof e || e % 1 != 0)
  35478. throw TypeError("Illegal value: " + e + " (not an integer)");
  35479. if (e |= 0,
  35480. "number" != typeof t || t % 1 != 0)
  35481. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35482. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35483. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35484. }
  35485. var n, r = f.calculateVarint32(e);
  35486. t += r;
  35487. var o = this.buffer.byteLength;
  35488. for (o < t && this.resize((o *= 2) > t ? o : t),
  35489. t -= r,
  35490. e >>>= 0; 128 <= e; )
  35491. n = 127 & e | 128,
  35492. this.view[t++] = n,
  35493. e >>>= 7;
  35494. return this.view[t++] = e,
  35495. i ? (this.offset = t,
  35496. this) : r
  35497. }
  35498. ,
  35499. a.writeVarint32ZigZag = function(e, t) {
  35500. return this.writeVarint32(f.zigZagEncode32(e), t)
  35501. }
  35502. ,
  35503. a.readVarint32 = function(e) {
  35504. var t = void 0 === e;
  35505. if (t && (e = this.offset),
  35506. !this.noAssert) {
  35507. if ("number" != typeof e || e % 1 != 0)
  35508. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35509. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35510. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35511. }
  35512. var i, n = 0, r = 0;
  35513. do {
  35514. if (!this.noAssert && e > this.limit) {
  35515. var o = Error("Truncated");
  35516. throw o.truncated = !0,
  35517. o
  35518. }
  35519. i = this.view[e++],
  35520. n < 5 && (r |= (127 & i) << 7 * n),
  35521. ++n
  35522. } while (0 != (128 & i));return r |= 0,
  35523. t ? (this.offset = e,
  35524. r) : {
  35525. value: r,
  35526. length: n
  35527. }
  35528. }
  35529. ,
  35530. a.readVarint32ZigZag = function(e) {
  35531. var t = this.readVarint32(e);
  35532. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35533. t
  35534. }
  35535. ,
  35536. l && (f.MAX_VARINT64_BYTES = 10,
  35537. f.calculateVarint64 = function(e) {
  35538. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35539. var t = e.toInt() >>> 0
  35540. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35541. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35542. 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
  35543. }
  35544. ,
  35545. f.zigZagEncode64 = function(e) {
  35546. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35547. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35548. }
  35549. ,
  35550. f.zigZagDecode64 = function(e) {
  35551. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35552. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35553. }
  35554. ,
  35555. a.writeVarint64 = function(e, t) {
  35556. var i = void 0 === t;
  35557. if (i && (t = this.offset),
  35558. !this.noAssert) {
  35559. if ("number" == typeof e)
  35560. e = l.fromNumber(e);
  35561. else if ("string" == typeof e)
  35562. e = l.fromString(e);
  35563. else if (!(e && e instanceof l))
  35564. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  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. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35571. var n = f.calculateVarint64(e)
  35572. , r = e.toInt() >>> 0
  35573. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35574. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35575. t += n;
  35576. var s = this.buffer.byteLength;
  35577. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35578. t -= n,
  35579. n) {
  35580. case 10:
  35581. this.view[t + 9] = a >>> 7 & 1;
  35582. case 9:
  35583. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35584. case 8:
  35585. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35586. case 7:
  35587. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35588. case 6:
  35589. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35590. case 5:
  35591. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35592. case 4:
  35593. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35594. case 3:
  35595. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35596. case 2:
  35597. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35598. case 1:
  35599. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35600. }
  35601. return i ? (this.offset += n,
  35602. this) : n
  35603. }
  35604. ,
  35605. a.writeVarint64ZigZag = function(e, t) {
  35606. return this.writeVarint64(f.zigZagEncode64(e), t)
  35607. }
  35608. ,
  35609. a.readVarint64 = function(e) {
  35610. var t = void 0 === e;
  35611. if (t && (e = this.offset),
  35612. !this.noAssert) {
  35613. if ("number" != typeof e || e % 1 != 0)
  35614. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35615. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35616. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35617. }
  35618. var i = e
  35619. , n = 0
  35620. , r = 0
  35621. , o = 0
  35622. , a = 0;
  35623. if (n = 127 & (a = this.view[e++]),
  35624. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35625. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35626. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35627. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35628. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35629. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35630. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35631. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35632. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35633. 128 & a || this.noAssert && void 0 === a))))))))))
  35634. throw Error("Buffer overrun");
  35635. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35636. return t ? (this.offset = e,
  35637. s) : {
  35638. value: s,
  35639. length: e - i
  35640. }
  35641. }
  35642. ,
  35643. a.readVarint64ZigZag = function(e) {
  35644. var t = this.readVarint64(e);
  35645. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35646. t
  35647. }
  35648. ),
  35649. a.writeCString = function(e, t) {
  35650. var i = void 0 === t;
  35651. i && (t = this.offset);
  35652. var n, r = e.length;
  35653. if (!this.noAssert) {
  35654. if ("string" != typeof e)
  35655. throw TypeError("Illegal str: Not a string");
  35656. for (n = 0; n < r; ++n)
  35657. if (0 === e.charCodeAt(n))
  35658. throw RangeError("Illegal str: Contains NULL-characters");
  35659. if ("number" != typeof t || t % 1 != 0)
  35660. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35661. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35662. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35663. }
  35664. r = d.calculateUTF16asUTF8(s(e))[1],
  35665. t += r + 1;
  35666. var o = this.buffer.byteLength;
  35667. return o < t && this.resize((o *= 2) > t ? o : t),
  35668. t -= r + 1,
  35669. d.encodeUTF16toUTF8(s(e), function(e) {
  35670. this.view[t++] = e
  35671. }
  35672. .bind(this)),
  35673. this.view[t++] = 0,
  35674. i ? (this.offset = t,
  35675. this) : r
  35676. }
  35677. ,
  35678. a.readCString = function(e) {
  35679. var t = void 0 === e;
  35680. if (t && (e = this.offset),
  35681. !this.noAssert) {
  35682. if ("number" != typeof e || e % 1 != 0)
  35683. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35684. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35685. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35686. }
  35687. var i, n = e, r = -1;
  35688. return d.decodeUTF8toUTF16(function() {
  35689. if (0 === r)
  35690. return null;
  35691. if (e >= this.limit)
  35692. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35693. return 0 === (r = this.view[e++]) ? null : r
  35694. }
  35695. .bind(this), i = c(), !0),
  35696. t ? (this.offset = e,
  35697. i()) : {
  35698. string: i(),
  35699. length: e - n
  35700. }
  35701. }
  35702. ,
  35703. a.writeIString = function(e, t) {
  35704. var i = void 0 === t;
  35705. if (i && (t = this.offset),
  35706. !this.noAssert) {
  35707. if ("string" != typeof e)
  35708. throw TypeError("Illegal str: Not a string");
  35709. if ("number" != typeof t || t % 1 != 0)
  35710. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35711. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35712. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35713. }
  35714. var n, r = t;
  35715. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35716. t += 4 + n;
  35717. var o = this.buffer.byteLength;
  35718. if (o < t && this.resize((o *= 2) > t ? o : t),
  35719. t -= 4 + n,
  35720. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35721. this.view[t + 2] = n >>> 16 & 255,
  35722. this.view[t + 1] = n >>> 8 & 255,
  35723. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35724. this.view[t + 1] = n >>> 16 & 255,
  35725. this.view[t + 2] = n >>> 8 & 255,
  35726. this.view[t + 3] = 255 & n),
  35727. t += 4,
  35728. d.encodeUTF16toUTF8(s(e), function(e) {
  35729. this.view[t++] = e
  35730. }
  35731. .bind(this)),
  35732. t !== r + 4 + n)
  35733. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35734. return i ? (this.offset = t,
  35735. this) : t - r
  35736. }
  35737. ,
  35738. a.readIString = function(e) {
  35739. var t = void 0 === e;
  35740. if (t && (e = this.offset),
  35741. !this.noAssert) {
  35742. if ("number" != typeof e || e % 1 != 0)
  35743. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35744. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35745. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35746. }
  35747. var i = e
  35748. , n = this.readUint32(e)
  35749. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35750. return e += r.length,
  35751. t ? (this.offset = e,
  35752. r.string) : {
  35753. string: r.string,
  35754. length: e - i
  35755. }
  35756. }
  35757. ,
  35758. f.METRICS_CHARS = "c",
  35759. f.METRICS_BYTES = "b",
  35760. a.writeUTF8String = function(e, t) {
  35761. var i = void 0 === t;
  35762. if (i && (t = this.offset),
  35763. !this.noAssert) {
  35764. if ("number" != typeof t || t % 1 != 0)
  35765. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35766. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35767. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35768. }
  35769. var n, r = t;
  35770. n = d.calculateUTF16asUTF8(s(e))[1],
  35771. t += n;
  35772. var o = this.buffer.byteLength;
  35773. return o < t && this.resize((o *= 2) > t ? o : t),
  35774. t -= n,
  35775. d.encodeUTF16toUTF8(s(e), function(e) {
  35776. this.view[t++] = e
  35777. }
  35778. .bind(this)),
  35779. i ? (this.offset = t,
  35780. this) : t - r
  35781. }
  35782. ,
  35783. a.writeString = a.writeUTF8String,
  35784. f.calculateUTF8Chars = function(e) {
  35785. return d.calculateUTF16asUTF8(s(e))[0]
  35786. }
  35787. ,
  35788. f.calculateUTF8Bytes = function(e) {
  35789. return d.calculateUTF16asUTF8(s(e))[1]
  35790. }
  35791. ,
  35792. f.calculateString = f.calculateUTF8Bytes,
  35793. a.readUTF8String = function(e, t, i) {
  35794. "number" == typeof t && (i = t,
  35795. t = void 0);
  35796. var n = void 0 === i;
  35797. if (n && (i = this.offset),
  35798. void 0 === t && (t = f.METRICS_CHARS),
  35799. !this.noAssert) {
  35800. if ("number" != typeof e || e % 1 != 0)
  35801. throw TypeError("Illegal length: " + e + " (not an integer)");
  35802. if (e |= 0,
  35803. "number" != typeof i || i % 1 != 0)
  35804. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35805. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35806. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35807. }
  35808. var r, o = 0, a = i;
  35809. if (t === f.METRICS_CHARS) {
  35810. if (r = c(),
  35811. d.decodeUTF8(function() {
  35812. return o < e && i < this.limit ? this.view[i++] : null
  35813. }
  35814. .bind(this), function(e) {
  35815. ++o,
  35816. d.UTF8toUTF16(e, r)
  35817. }),
  35818. o !== e)
  35819. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35820. return n ? (this.offset = i,
  35821. r()) : {
  35822. string: r(),
  35823. length: i - a
  35824. }
  35825. }
  35826. if (t !== f.METRICS_BYTES)
  35827. throw TypeError("Unsupported metrics: " + t);
  35828. if (!this.noAssert) {
  35829. if ("number" != typeof i || i % 1 != 0)
  35830. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35831. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35832. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35833. }
  35834. var s = i + e;
  35835. if (d.decodeUTF8toUTF16(function() {
  35836. return i < s ? this.view[i++] : null
  35837. }
  35838. .bind(this), r = c(), this.noAssert),
  35839. i !== s)
  35840. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35841. return n ? (this.offset = i,
  35842. r()) : {
  35843. string: r(),
  35844. length: i - a
  35845. }
  35846. }
  35847. ,
  35848. a.readString = a.readUTF8String,
  35849. a.writeVString = function(e, t) {
  35850. var i = void 0 === t;
  35851. if (i && (t = this.offset),
  35852. !this.noAssert) {
  35853. if ("string" != typeof e)
  35854. throw TypeError("Illegal str: Not a string");
  35855. if ("number" != typeof t || t % 1 != 0)
  35856. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35857. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35858. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35859. }
  35860. var n, r, o = t;
  35861. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35862. r = f.calculateVarint32(n),
  35863. t += r + n;
  35864. var a = this.buffer.byteLength;
  35865. if (a < t && this.resize((a *= 2) > t ? a : t),
  35866. t -= r + n,
  35867. t += this.writeVarint32(n, t),
  35868. d.encodeUTF16toUTF8(s(e), function(e) {
  35869. this.view[t++] = e
  35870. }
  35871. .bind(this)),
  35872. t !== o + n + r)
  35873. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35874. return i ? (this.offset = t,
  35875. this) : t - o
  35876. }
  35877. ,
  35878. a.readVString = function(e) {
  35879. var t = void 0 === e;
  35880. if (t && (e = this.offset),
  35881. !this.noAssert) {
  35882. if ("number" != typeof e || e % 1 != 0)
  35883. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35884. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35885. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35886. }
  35887. var i = e
  35888. , n = this.readVarint32(e)
  35889. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35890. return e += r.length,
  35891. t ? (this.offset = e,
  35892. r.string) : {
  35893. string: r.string,
  35894. length: e - i
  35895. }
  35896. }
  35897. ,
  35898. a.append = function(e, t, i) {
  35899. "number" != typeof t && "string" == typeof t || (i = t,
  35900. t = void 0);
  35901. var n = void 0 === i;
  35902. if (n && (i = this.offset),
  35903. !this.noAssert) {
  35904. if ("number" != typeof i || i % 1 != 0)
  35905. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35906. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35907. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35908. }
  35909. e instanceof f || (e = f.wrap(e, t));
  35910. var r = e.limit - e.offset;
  35911. if (r <= 0)
  35912. return this;
  35913. i += r;
  35914. var o = this.buffer.byteLength;
  35915. return o < i && this.resize((o *= 2) > i ? o : i),
  35916. i -= r,
  35917. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35918. e.offset += r,
  35919. n && (this.offset += r),
  35920. this
  35921. }
  35922. ,
  35923. a.appendTo = function(e, t) {
  35924. return e.append(this, t),
  35925. this
  35926. }
  35927. ,
  35928. a.assert = function(e) {
  35929. return this.noAssert = !e,
  35930. this
  35931. }
  35932. ,
  35933. a.capacity = function() {
  35934. return this.buffer.byteLength
  35935. }
  35936. ,
  35937. a.clear = function() {
  35938. return this.offset = 0,
  35939. this.limit = this.buffer.byteLength,
  35940. this.markedOffset = -1,
  35941. this
  35942. }
  35943. ,
  35944. a.clone = function(e) {
  35945. var t = new f(0,this.littleEndian,this.noAssert);
  35946. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35947. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35948. t.view = this.view),
  35949. t.offset = this.offset,
  35950. t.markedOffset = this.markedOffset,
  35951. t.limit = this.limit,
  35952. t
  35953. }
  35954. ,
  35955. a.compact = function(e, t) {
  35956. if (void 0 === e && (e = this.offset),
  35957. void 0 === t && (t = this.limit),
  35958. !this.noAssert) {
  35959. if ("number" != typeof e || e % 1 != 0)
  35960. throw TypeError("Illegal begin: Not an integer");
  35961. if (e >>>= 0,
  35962. "number" != typeof t || t % 1 != 0)
  35963. throw TypeError("Illegal end: Not an integer");
  35964. if (t >>>= 0,
  35965. e < 0 || t < e || t > this.buffer.byteLength)
  35966. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35967. }
  35968. if (0 === e && t === this.buffer.byteLength)
  35969. return this;
  35970. var i = t - e;
  35971. if (0 == i)
  35972. return this.buffer = o,
  35973. this.view = null,
  35974. 0 <= this.markedOffset && (this.markedOffset -= e),
  35975. this.offset = 0,
  35976. this.limit = 0,
  35977. this;
  35978. var n = new ArrayBuffer(i)
  35979. , r = new Uint8Array(n);
  35980. return r.set(this.view.subarray(e, t)),
  35981. this.buffer = n,
  35982. this.view = r,
  35983. 0 <= this.markedOffset && (this.markedOffset -= e),
  35984. this.offset = 0,
  35985. this.limit = i,
  35986. this
  35987. }
  35988. ,
  35989. a.copy = function(e, t) {
  35990. if (void 0 === e && (e = this.offset),
  35991. void 0 === t && (t = this.limit),
  35992. !this.noAssert) {
  35993. if ("number" != typeof e || e % 1 != 0)
  35994. throw TypeError("Illegal begin: Not an integer");
  35995. if (e >>>= 0,
  35996. "number" != typeof t || t % 1 != 0)
  35997. throw TypeError("Illegal end: Not an integer");
  35998. if (t >>>= 0,
  35999. e < 0 || t < e || t > this.buffer.byteLength)
  36000. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36001. }
  36002. if (e === t)
  36003. return new f(0,this.littleEndian,this.noAssert);
  36004. var i = t - e
  36005. , n = new f(i,this.littleEndian,this.noAssert);
  36006. return n.offset = 0,
  36007. n.limit = i,
  36008. 0 <= n.markedOffset && (n.markedOffset -= e),
  36009. this.copyTo(n, 0, e, t),
  36010. n
  36011. }
  36012. ,
  36013. a.copyTo = function(e, t, i, n) {
  36014. var r, o;
  36015. if (!this.noAssert && !f.isByteBuffer(e))
  36016. throw TypeError("Illegal target: Not a ByteBuffer");
  36017. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36018. i = (r = void 0 === i) ? this.offset : 0 | i,
  36019. n = void 0 === n ? this.limit : 0 | n,
  36020. t < 0 || t > e.buffer.byteLength)
  36021. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36022. if (i < 0 || n > this.buffer.byteLength)
  36023. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36024. var a = n - i;
  36025. return 0 == a ? e : (e.ensureCapacity(t + a),
  36026. e.view.set(this.view.subarray(i, n), t),
  36027. r && (this.offset += a),
  36028. o && (e.offset += a),
  36029. this)
  36030. }
  36031. ,
  36032. a.ensureCapacity = function(e) {
  36033. var t = this.buffer.byteLength;
  36034. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36035. }
  36036. ,
  36037. a.fill = function(e, t, i) {
  36038. var n = void 0 === t;
  36039. if (n && (t = this.offset),
  36040. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36041. void 0 === t && (t = this.offset),
  36042. void 0 === i && (i = this.limit),
  36043. !this.noAssert) {
  36044. if ("number" != typeof e || e % 1 != 0)
  36045. throw TypeError("Illegal value: " + e + " (not an integer)");
  36046. if (e |= 0,
  36047. "number" != typeof t || t % 1 != 0)
  36048. throw TypeError("Illegal begin: Not an integer");
  36049. if (t >>>= 0,
  36050. "number" != typeof i || i % 1 != 0)
  36051. throw TypeError("Illegal end: Not an integer");
  36052. if (i >>>= 0,
  36053. t < 0 || i < t || i > this.buffer.byteLength)
  36054. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36055. }
  36056. if (i <= t)
  36057. return this;
  36058. for (; t < i; )
  36059. this.view[t++] = e;
  36060. return n && (this.offset = t),
  36061. this
  36062. }
  36063. ,
  36064. a.flip = function() {
  36065. return this.limit = this.offset,
  36066. this.offset = 0,
  36067. this
  36068. }
  36069. ,
  36070. a.mark = function(e) {
  36071. if (e = void 0 === e ? this.offset : e,
  36072. !this.noAssert) {
  36073. if ("number" != typeof e || e % 1 != 0)
  36074. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36075. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36076. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36077. }
  36078. return this.markedOffset = e,
  36079. this
  36080. }
  36081. ,
  36082. a.order = function(e) {
  36083. if (!this.noAssert && "boolean" != typeof e)
  36084. throw TypeError("Illegal littleEndian: Not a boolean");
  36085. return this.littleEndian = !!e,
  36086. this
  36087. }
  36088. ,
  36089. a.LE = function(e) {
  36090. return this.littleEndian = void 0 === e || !!e,
  36091. this
  36092. }
  36093. ,
  36094. a.BE = function(e) {
  36095. return this.littleEndian = void 0 !== e && !e,
  36096. this
  36097. }
  36098. ,
  36099. a.prepend = function(e, t, i) {
  36100. "number" != typeof t && "string" == typeof t || (i = t,
  36101. t = void 0);
  36102. var n = void 0 === i;
  36103. if (n && (i = this.offset),
  36104. !this.noAssert) {
  36105. if ("number" != typeof i || i % 1 != 0)
  36106. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36107. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36108. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36109. }
  36110. e instanceof f || (e = f.wrap(e, t));
  36111. var r = e.limit - e.offset;
  36112. if (r <= 0)
  36113. return this;
  36114. var o = r - i;
  36115. if (0 < o) {
  36116. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36117. , s = new Uint8Array(a);
  36118. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36119. this.buffer = a,
  36120. this.view = s,
  36121. this.offset += o,
  36122. 0 <= this.markedOffset && (this.markedOffset += o),
  36123. this.limit += o,
  36124. i += o
  36125. } else
  36126. new Uint8Array(this.buffer);
  36127. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36128. e.offset = e.limit,
  36129. n && (this.offset -= r),
  36130. this
  36131. }
  36132. ,
  36133. a.prependTo = function(e, t) {
  36134. return e.prepend(this, t),
  36135. this
  36136. }
  36137. ,
  36138. a.printDebug = function(e) {
  36139. "function" != typeof e && (e = console.log.bind(console)),
  36140. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36141. }
  36142. ,
  36143. a.remaining = function() {
  36144. return this.limit - this.offset
  36145. }
  36146. ,
  36147. a.reset = function() {
  36148. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36149. this.markedOffset = -1) : this.offset = 0,
  36150. this
  36151. }
  36152. ,
  36153. a.resize = function(e) {
  36154. if (!this.noAssert) {
  36155. if ("number" != typeof e || e % 1 != 0)
  36156. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36157. if ((e |= 0) < 0)
  36158. throw RangeError("Illegal capacity: 0 <= " + e)
  36159. }
  36160. if (this.buffer.byteLength < e) {
  36161. var t = new ArrayBuffer(e)
  36162. , i = new Uint8Array(t);
  36163. i.set(this.view),
  36164. this.buffer = t,
  36165. this.view = i
  36166. }
  36167. return this
  36168. }
  36169. ,
  36170. a.reverse = function(e, t) {
  36171. if (void 0 === e && (e = this.offset),
  36172. void 0 === t && (t = this.limit),
  36173. !this.noAssert) {
  36174. if ("number" != typeof e || e % 1 != 0)
  36175. throw TypeError("Illegal begin: Not an integer");
  36176. if (e >>>= 0,
  36177. "number" != typeof t || t % 1 != 0)
  36178. throw TypeError("Illegal end: Not an integer");
  36179. if (t >>>= 0,
  36180. e < 0 || t < e || t > this.buffer.byteLength)
  36181. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36182. }
  36183. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36184. this
  36185. }
  36186. ,
  36187. a.skip = function(e) {
  36188. if (!this.noAssert) {
  36189. if ("number" != typeof e || e % 1 != 0)
  36190. throw TypeError("Illegal length: " + e + " (not an integer)");
  36191. e |= 0
  36192. }
  36193. var t = this.offset + e;
  36194. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36195. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36196. return this.offset = t,
  36197. this
  36198. }
  36199. ,
  36200. a.slice = function(e, t) {
  36201. if (void 0 === e && (e = this.offset),
  36202. void 0 === t && (t = this.limit),
  36203. !this.noAssert) {
  36204. if ("number" != typeof e || e % 1 != 0)
  36205. throw TypeError("Illegal begin: Not an integer");
  36206. if (e >>>= 0,
  36207. "number" != typeof t || t % 1 != 0)
  36208. throw TypeError("Illegal end: Not an integer");
  36209. if (t >>>= 0,
  36210. e < 0 || t < e || t > this.buffer.byteLength)
  36211. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36212. }
  36213. var i = this.clone();
  36214. return i.offset = e,
  36215. i.limit = t,
  36216. i
  36217. }
  36218. ,
  36219. a.toBuffer = function(e) {
  36220. var t = this.offset
  36221. , i = this.limit;
  36222. if (!this.noAssert) {
  36223. if ("number" != typeof t || t % 1 != 0)
  36224. throw TypeError("Illegal offset: Not an integer");
  36225. if (t >>>= 0,
  36226. "number" != typeof i || i % 1 != 0)
  36227. throw TypeError("Illegal limit: Not an integer");
  36228. if (i >>>= 0,
  36229. t < 0 || i < t || i > this.buffer.byteLength)
  36230. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36231. }
  36232. if (!e && 0 === t && i === this.buffer.byteLength)
  36233. return this.buffer;
  36234. if (t === i)
  36235. return o;
  36236. var n = new ArrayBuffer(i - t);
  36237. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36238. n
  36239. }
  36240. ,
  36241. a.toArrayBuffer = a.toBuffer,
  36242. a.toString = function(e, t, i) {
  36243. if (void 0 === e)
  36244. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36245. switch ("number" == typeof e && (i = t = e = "utf8"),
  36246. e) {
  36247. case "utf8":
  36248. return this.toUTF8(t, i);
  36249. case "base64":
  36250. return this.toBase64(t, i);
  36251. case "hex":
  36252. return this.toHex(t, i);
  36253. case "binary":
  36254. return this.toBinary(t, i);
  36255. case "debug":
  36256. return this.toDebug();
  36257. case "columns":
  36258. return this.toColumns();
  36259. default:
  36260. throw Error("Unsupported encoding: " + e)
  36261. }
  36262. }
  36263. ;
  36264. var h = function() {
  36265. 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)
  36266. a[r[t]] = t;
  36267. return e.encode = function(e, t) {
  36268. for (var i, n; null !== (i = e()); )
  36269. t(r[i >> 2 & 63]),
  36270. n = (3 & i) << 4,
  36271. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36272. n = (15 & i) << 2,
  36273. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36274. t(r[63 & i])) : (t(r[63 & n]),
  36275. t(61))) : (t(r[63 & n]),
  36276. t(61),
  36277. t(61))
  36278. }
  36279. ,
  36280. e.decode = function(e, t) {
  36281. function i(e) {
  36282. throw Error("Illegal character code: " + e)
  36283. }
  36284. for (var n, r, o; null !== (n = e()); )
  36285. if (void 0 === (r = a[n]) && i(n),
  36286. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36287. t(r << 2 >>> 0 | (48 & o) >> 4),
  36288. null !== (n = e()))) {
  36289. if (void 0 === (r = a[n])) {
  36290. if (61 === n)
  36291. break;
  36292. i(n)
  36293. }
  36294. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36295. null !== (n = e())) {
  36296. if (void 0 === (o = a[n])) {
  36297. if (61 === n)
  36298. break;
  36299. i(n)
  36300. }
  36301. t((3 & r) << 6 >>> 0 | o)
  36302. }
  36303. }
  36304. }
  36305. ,
  36306. e.test = function(e) {
  36307. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36308. }
  36309. ,
  36310. e
  36311. }();
  36312. a.toBase64 = function(e, t) {
  36313. if (void 0 === e && (e = this.offset),
  36314. void 0 === t && (t = this.limit),
  36315. t |= 0,
  36316. (e |= 0) < 0 || t > this.capacity || t < e)
  36317. throw RangeError("begin, end");
  36318. var i;
  36319. return h.encode(function() {
  36320. return e < t ? this.view[e++] : null
  36321. }
  36322. .bind(this), i = c()),
  36323. i()
  36324. }
  36325. ,
  36326. f.fromBase64 = function(e, t) {
  36327. if ("string" != typeof e)
  36328. throw TypeError("str");
  36329. var i = new f(e.length / 4 * 3,t)
  36330. , n = 0;
  36331. return h.decode(s(e), function(e) {
  36332. i.view[n++] = e
  36333. }),
  36334. i.limit = n,
  36335. i
  36336. }
  36337. ,
  36338. f.btoa = function(e) {
  36339. return f.fromBinary(e).toBase64()
  36340. }
  36341. ,
  36342. f.atob = function(e) {
  36343. return f.fromBase64(e).toBinary()
  36344. }
  36345. ,
  36346. a.toBinary = function(e, t) {
  36347. if (void 0 === e && (e = this.offset),
  36348. void 0 === t && (t = this.limit),
  36349. t |= 0,
  36350. (e |= 0) < 0 || t > this.capacity() || t < e)
  36351. throw RangeError("begin, end");
  36352. if (e === t)
  36353. return "";
  36354. for (var i = [], n = []; e < t; )
  36355. i.push(this.view[e++]),
  36356. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36357. i = []);
  36358. return n.join("") + String.fromCharCode.apply(String, i)
  36359. }
  36360. ,
  36361. f.fromBinary = function(e, t) {
  36362. if ("string" != typeof e)
  36363. throw TypeError("str");
  36364. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36365. if (255 < (i = e.charCodeAt(n)))
  36366. throw RangeError("illegal char code: " + i);
  36367. o.view[n++] = i
  36368. }
  36369. return o.limit = r,
  36370. o
  36371. }
  36372. ,
  36373. a.toDebug = function(e) {
  36374. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36375. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36376. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36377. ++i,
  36378. e && 0 < i && i % 16 == 0 && i !== n) {
  36379. for (; r.length < 51; )
  36380. r += " ";
  36381. a += r + o + "\n",
  36382. r = o = ""
  36383. }
  36384. 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 ? " " : ""
  36385. }
  36386. if (e && " " !== r) {
  36387. for (; r.length < 51; )
  36388. r += " ";
  36389. a += r + o + "\n"
  36390. }
  36391. return e ? a : r
  36392. }
  36393. ,
  36394. f.fromDebug = function(e, t, i) {
  36395. 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; ) {
  36396. switch (n = e.charAt(s++)) {
  36397. case "!":
  36398. if (!i) {
  36399. if (h || u || d) {
  36400. p = !0;
  36401. break
  36402. }
  36403. h = u = d = !0
  36404. }
  36405. a.offset = a.markedOffset = a.limit = l,
  36406. c = !1;
  36407. break;
  36408. case "|":
  36409. if (!i) {
  36410. if (h || d) {
  36411. p = !0;
  36412. break
  36413. }
  36414. h = d = !0
  36415. }
  36416. a.offset = a.limit = l,
  36417. c = !1;
  36418. break;
  36419. case "[":
  36420. if (!i) {
  36421. if (h || u) {
  36422. p = !0;
  36423. break
  36424. }
  36425. h = u = !0
  36426. }
  36427. a.offset = a.markedOffset = l,
  36428. c = !1;
  36429. break;
  36430. case "<":
  36431. if (!i) {
  36432. if (h) {
  36433. p = !0;
  36434. break
  36435. }
  36436. h = !0
  36437. }
  36438. a.offset = l,
  36439. c = !1;
  36440. break;
  36441. case "]":
  36442. if (!i) {
  36443. if (d || u) {
  36444. p = !0;
  36445. break
  36446. }
  36447. d = u = !0
  36448. }
  36449. a.limit = a.markedOffset = l,
  36450. c = !1;
  36451. break;
  36452. case ">":
  36453. if (!i) {
  36454. if (d) {
  36455. p = !0;
  36456. break
  36457. }
  36458. d = !0
  36459. }
  36460. a.limit = l,
  36461. c = !1;
  36462. break;
  36463. case "'":
  36464. if (!i) {
  36465. if (u) {
  36466. p = !0;
  36467. break
  36468. }
  36469. u = !0
  36470. }
  36471. a.markedOffset = l,
  36472. c = !1;
  36473. break;
  36474. case " ":
  36475. c = !1;
  36476. break;
  36477. default:
  36478. if (!i && c) {
  36479. p = !0;
  36480. break
  36481. }
  36482. if (r = parseInt(n + e.charAt(s++), 16),
  36483. !i && (isNaN(r) || r < 0 || 255 < r))
  36484. throw TypeError("Illegal str: Not a debug encoded string");
  36485. a.view[l++] = r,
  36486. c = !0
  36487. }
  36488. if (p)
  36489. throw TypeError("Illegal str: Invalid symbol at " + s)
  36490. }
  36491. if (!i) {
  36492. if (!h || !d)
  36493. throw TypeError("Illegal str: Missing offset or limit");
  36494. if (l < a.buffer.byteLength)
  36495. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36496. }
  36497. return a
  36498. }
  36499. ,
  36500. a.toHex = function(e, t) {
  36501. if (e = void 0 === e ? this.offset : e,
  36502. t = void 0 === t ? this.limit : t,
  36503. !this.noAssert) {
  36504. if ("number" != typeof e || e % 1 != 0)
  36505. throw TypeError("Illegal begin: Not an integer");
  36506. if (e >>>= 0,
  36507. "number" != typeof t || t % 1 != 0)
  36508. throw TypeError("Illegal end: Not an integer");
  36509. if (t >>>= 0,
  36510. e < 0 || t < e || t > this.buffer.byteLength)
  36511. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36512. }
  36513. for (var i, n = new Array(t - e); e < t; )
  36514. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36515. return n.join("")
  36516. }
  36517. ,
  36518. f.fromHex = function(e, t, i) {
  36519. if (!i) {
  36520. if ("string" != typeof e)
  36521. throw TypeError("Illegal str: Not a string");
  36522. if (e.length % 2 != 0)
  36523. throw TypeError("Illegal str: Length not a multiple of 2")
  36524. }
  36525. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36526. if (n = parseInt(e.substring(a, a + 2), 16),
  36527. !i && (!isFinite(n) || n < 0 || 255 < n))
  36528. throw TypeError("Illegal str: Contains non-hex characters");
  36529. o.view[s++] = n
  36530. }
  36531. return o.limit = s,
  36532. o
  36533. }
  36534. ;
  36535. var u, d = u = {
  36536. MAX_CODEPOINT: 1114111,
  36537. encodeUTF8: function(e, t) {
  36538. var i = null;
  36539. for ("number" == typeof e && (i = e,
  36540. e = function() {
  36541. return null
  36542. }
  36543. ); null !== i || null !== (i = e()); )
  36544. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36545. t(i >> 12 & 63 | 128)),
  36546. t(i >> 6 & 63 | 128)),
  36547. t(63 & i | 128)),
  36548. i = null
  36549. },
  36550. decodeUTF8: function(e, t) {
  36551. for (var i, n, r, o, a = function(e) {
  36552. e = e.slice(0, e.indexOf(null));
  36553. var t = Error(e.toString());
  36554. throw t.name = "TruncatedError",
  36555. t.bytes = e,
  36556. t
  36557. }; null !== (i = e()); )
  36558. if (0 == (128 & i))
  36559. t(i);
  36560. else if (192 == (224 & i))
  36561. null === (n = e()) && a([i, n]),
  36562. t((31 & i) << 6 | 63 & n);
  36563. else if (224 == (240 & i))
  36564. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36565. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36566. else {
  36567. if (240 != (248 & i))
  36568. throw RangeError("Illegal starting byte: " + i);
  36569. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36570. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36571. }
  36572. },
  36573. UTF16toUTF8: function(e, t) {
  36574. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36575. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36576. n = null) : t(i);
  36577. null !== n && t(n)
  36578. },
  36579. UTF8toUTF16: function(e, t) {
  36580. var i = null;
  36581. for ("number" == typeof e && (i = e,
  36582. e = function() {
  36583. return null
  36584. }
  36585. ); null !== i || null !== (i = e()); )
  36586. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36587. t(i % 1024 + 56320)),
  36588. i = null
  36589. },
  36590. encodeUTF16toUTF8: function(e, t) {
  36591. u.UTF16toUTF8(e, function(e) {
  36592. u.encodeUTF8(e, t)
  36593. })
  36594. },
  36595. decodeUTF8toUTF16: function(e, t) {
  36596. u.decodeUTF8(e, function(e) {
  36597. u.UTF8toUTF16(e, t)
  36598. })
  36599. },
  36600. calculateCodePoint: function(e) {
  36601. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36602. },
  36603. calculateUTF8: function(e) {
  36604. for (var t, i = 0; null !== (t = e()); )
  36605. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36606. return i
  36607. },
  36608. calculateUTF16asUTF8: function(e) {
  36609. var t = 0
  36610. , i = 0;
  36611. return u.UTF16toUTF8(e, function(e) {
  36612. ++t,
  36613. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36614. }),
  36615. [t, i]
  36616. }
  36617. };
  36618. return a.toUTF8 = function(t, i) {
  36619. if (void 0 === t && (t = this.offset),
  36620. void 0 === i && (i = this.limit),
  36621. !this.noAssert) {
  36622. if ("number" != typeof t || t % 1 != 0)
  36623. throw TypeError("Illegal begin: Not an integer");
  36624. if (t >>>= 0,
  36625. "number" != typeof i || i % 1 != 0)
  36626. throw TypeError("Illegal end: Not an integer");
  36627. if (i >>>= 0,
  36628. t < 0 || i < t || i > this.buffer.byteLength)
  36629. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36630. }
  36631. var e;
  36632. try {
  36633. d.decodeUTF8toUTF16(function() {
  36634. return t < i ? this.view[t++] : null
  36635. }
  36636. .bind(this), e = c())
  36637. } catch (e) {
  36638. if (t !== i)
  36639. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36640. }
  36641. return e()
  36642. }
  36643. ,
  36644. f.fromUTF8 = function(e, t, i) {
  36645. if (!i && "string" != typeof e)
  36646. throw TypeError("Illegal str: Not a string");
  36647. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36648. , r = 0;
  36649. return d.encodeUTF16toUTF8(s(e), function(e) {
  36650. n.view[r++] = e
  36651. }),
  36652. n.limit = r,
  36653. n
  36654. }
  36655. ,
  36656. f
  36657. }
  36658. ,
  36659. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36660. var e;
  36661. try {
  36662. e = t("long")
  36663. } catch (e) {}
  36664. return r(e)
  36665. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36666. }
  36667. , {
  36668. long: 216
  36669. }],
  36670. 216: [function(e, t, i) {
  36671. var n, r;
  36672. n = this,
  36673. r = function() {
  36674. "use strict";
  36675. function n(e, t, i) {
  36676. this.low = 0 | e,
  36677. this.high = 0 | t,
  36678. this.unsigned = !!i
  36679. }
  36680. function p(e) {
  36681. return !0 === (e && e.__isLong__)
  36682. }
  36683. function e(e, t) {
  36684. var i, n, r;
  36685. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36686. r && (a[e] = i),
  36687. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36688. r && (o[e] = i),
  36689. i)
  36690. }
  36691. function f(e, t) {
  36692. if (isNaN(e) || !isFinite(e))
  36693. return t ? l : y;
  36694. if (t) {
  36695. if (e < 0)
  36696. return l;
  36697. if (r <= e)
  36698. return I
  36699. } else {
  36700. if (e <= -s)
  36701. return E;
  36702. if (s <= e + 1)
  36703. return C
  36704. }
  36705. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36706. }
  36707. function g(e, t, i) {
  36708. return new n(e,t,i)
  36709. }
  36710. function h(e, t, i) {
  36711. if (0 === e.length)
  36712. throw Error("empty string");
  36713. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36714. return y;
  36715. if (t = "number" == typeof t ? (i = t,
  36716. !1) : !!t,
  36717. (i = i || 10) < 2 || 36 < i)
  36718. throw RangeError("radix");
  36719. var n;
  36720. if (0 < (n = e.indexOf("-")))
  36721. throw Error("interior hyphen");
  36722. if (0 === n)
  36723. return h(e.substring(1), t, i).neg();
  36724. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36725. var s = Math.min(8, e.length - a)
  36726. , l = parseInt(e.substring(a, a + s), i);
  36727. if (s < 8) {
  36728. var c = f(u(i, s));
  36729. o = o.mul(c).add(f(l))
  36730. } else
  36731. o = (o = o.mul(r)).add(f(l))
  36732. }
  36733. return o.unsigned = t,
  36734. o
  36735. }
  36736. function m(e) {
  36737. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36738. }
  36739. Object.defineProperty(n.prototype, "__isLong__", {
  36740. value: !0,
  36741. enumerable: !1,
  36742. configurable: !1
  36743. }),
  36744. n.isLong = p;
  36745. var o = {}
  36746. , a = {};
  36747. n.fromInt = e,
  36748. n.fromNumber = f,
  36749. n.fromBits = g;
  36750. var u = Math.pow;
  36751. n.fromString = h,
  36752. n.fromValue = m;
  36753. var i = 4294967296
  36754. , r = 0x10000000000000000
  36755. , s = r / 2
  36756. , v = e(1 << 24)
  36757. , y = e(0);
  36758. n.ZERO = y;
  36759. var l = e(0, !0);
  36760. n.UZERO = l;
  36761. var c = e(1);
  36762. n.ONE = c;
  36763. var d = e(1, !0);
  36764. n.UONE = d;
  36765. var A = e(-1);
  36766. n.NEG_ONE = A;
  36767. var C = g(-1, 2147483647, !1);
  36768. n.MAX_VALUE = C;
  36769. var I = g(-1, -1, !0);
  36770. n.MAX_UNSIGNED_VALUE = I;
  36771. var E = g(0, -2147483648, !1);
  36772. n.MIN_VALUE = E;
  36773. var t = n.prototype;
  36774. return t.toInt = function() {
  36775. return this.unsigned ? this.low >>> 0 : this.low
  36776. }
  36777. ,
  36778. t.toNumber = function() {
  36779. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36780. }
  36781. ,
  36782. t.toString = function(e) {
  36783. if ((e = e || 10) < 2 || 36 < e)
  36784. throw RangeError("radix");
  36785. if (this.isZero())
  36786. return "0";
  36787. if (this.isNegative()) {
  36788. if (this.eq(E)) {
  36789. var t = f(e)
  36790. , i = this.div(t)
  36791. , n = i.mul(t).sub(this);
  36792. return i.toString(e) + n.toInt().toString(e)
  36793. }
  36794. return "-" + this.neg().toString(e)
  36795. }
  36796. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36797. var s = o.div(r)
  36798. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36799. if ((o = s).isZero())
  36800. return l + a;
  36801. for (; l.length < 6; )
  36802. l = "0" + l;
  36803. a = "" + l + a
  36804. }
  36805. }
  36806. ,
  36807. t.getHighBits = function() {
  36808. return this.high
  36809. }
  36810. ,
  36811. t.getHighBitsUnsigned = function() {
  36812. return this.high >>> 0
  36813. }
  36814. ,
  36815. t.getLowBits = function() {
  36816. return this.low
  36817. }
  36818. ,
  36819. t.getLowBitsUnsigned = function() {
  36820. return this.low >>> 0
  36821. }
  36822. ,
  36823. t.getNumBitsAbs = function() {
  36824. if (this.isNegative())
  36825. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36826. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36827. ;
  36828. return 0 != this.high ? t + 33 : t + 1
  36829. }
  36830. ,
  36831. t.isZero = function() {
  36832. return 0 === this.high && 0 === this.low
  36833. }
  36834. ,
  36835. t.isNegative = function() {
  36836. return !this.unsigned && this.high < 0
  36837. }
  36838. ,
  36839. t.isPositive = function() {
  36840. return this.unsigned || 0 <= this.high
  36841. }
  36842. ,
  36843. t.isOdd = function() {
  36844. return 1 == (1 & this.low)
  36845. }
  36846. ,
  36847. t.isEven = function() {
  36848. return 0 == (1 & this.low)
  36849. }
  36850. ,
  36851. t.equals = function(e) {
  36852. return p(e) || (e = m(e)),
  36853. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36854. }
  36855. ,
  36856. t.eq = t.equals,
  36857. t.notEquals = function(e) {
  36858. return !this.eq(e)
  36859. }
  36860. ,
  36861. t.neq = t.notEquals,
  36862. t.lessThan = function(e) {
  36863. return this.comp(e) < 0
  36864. }
  36865. ,
  36866. t.lt = t.lessThan,
  36867. t.lessThanOrEqual = function(e) {
  36868. return this.comp(e) <= 0
  36869. }
  36870. ,
  36871. t.lte = t.lessThanOrEqual,
  36872. t.greaterThan = function(e) {
  36873. return 0 < this.comp(e)
  36874. }
  36875. ,
  36876. t.gt = t.greaterThan,
  36877. t.greaterThanOrEqual = function(e) {
  36878. return 0 <= this.comp(e)
  36879. }
  36880. ,
  36881. t.gte = t.greaterThanOrEqual,
  36882. t.compare = function(e) {
  36883. if (p(e) || (e = m(e)),
  36884. this.eq(e))
  36885. return 0;
  36886. var t = this.isNegative()
  36887. , i = e.isNegative();
  36888. 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
  36889. }
  36890. ,
  36891. t.comp = t.compare,
  36892. t.negate = function() {
  36893. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36894. }
  36895. ,
  36896. t.neg = t.negate,
  36897. t.add = function(e) {
  36898. p(e) || (e = m(e));
  36899. var t = this.high >>> 16
  36900. , i = 65535 & this.high
  36901. , n = this.low >>> 16
  36902. , r = 65535 & this.low
  36903. , o = e.high >>> 16
  36904. , a = 65535 & e.high
  36905. , s = e.low >>> 16
  36906. , l = 0
  36907. , c = 0
  36908. , h = 0
  36909. , u = 0;
  36910. return h += (u += r + (65535 & e.low)) >>> 16,
  36911. c += (h += n + s) >>> 16,
  36912. l += (c += i + a) >>> 16,
  36913. l += t + o,
  36914. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36915. }
  36916. ,
  36917. t.subtract = function(e) {
  36918. return p(e) || (e = m(e)),
  36919. this.add(e.neg())
  36920. }
  36921. ,
  36922. t.sub = t.subtract,
  36923. t.multiply = function(e) {
  36924. if (this.isZero())
  36925. return y;
  36926. if (p(e) || (e = m(e)),
  36927. e.isZero())
  36928. return y;
  36929. if (this.eq(E))
  36930. return e.isOdd() ? E : y;
  36931. if (e.eq(E))
  36932. return this.isOdd() ? E : y;
  36933. if (this.isNegative())
  36934. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36935. if (e.isNegative())
  36936. return this.mul(e.neg()).neg();
  36937. if (this.lt(v) && e.lt(v))
  36938. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36939. var t = this.high >>> 16
  36940. , i = 65535 & this.high
  36941. , n = this.low >>> 16
  36942. , r = 65535 & this.low
  36943. , o = e.high >>> 16
  36944. , a = 65535 & e.high
  36945. , s = e.low >>> 16
  36946. , l = 65535 & e.low
  36947. , c = 0
  36948. , h = 0
  36949. , u = 0
  36950. , d = 0;
  36951. return u += (d += r * l) >>> 16,
  36952. h += (u += n * l) >>> 16,
  36953. u &= 65535,
  36954. h += (u += r * s) >>> 16,
  36955. c += (h += i * l) >>> 16,
  36956. h &= 65535,
  36957. c += (h += n * s) >>> 16,
  36958. h &= 65535,
  36959. c += (h += r * a) >>> 16,
  36960. c += t * l + i * s + n * a + r * o,
  36961. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36962. }
  36963. ,
  36964. t.mul = t.multiply,
  36965. t.divide = function(e) {
  36966. if (p(e) || (e = m(e)),
  36967. e.isZero())
  36968. throw Error("division by zero");
  36969. if (this.isZero())
  36970. return this.unsigned ? l : y;
  36971. var t, i, n;
  36972. if (this.unsigned) {
  36973. if (e.unsigned || (e = e.toUnsigned()),
  36974. e.gt(this))
  36975. return l;
  36976. if (e.gt(this.shru(1)))
  36977. return d;
  36978. n = l
  36979. } else {
  36980. if (this.eq(E))
  36981. 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)),
  36982. n = t.add(i.div(e)));
  36983. if (e.eq(E))
  36984. return this.unsigned ? l : y;
  36985. if (this.isNegative())
  36986. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36987. if (e.isNegative())
  36988. return this.div(e.neg()).neg();
  36989. n = y
  36990. }
  36991. for (i = this; i.gte(e); ) {
  36992. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36993. 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); )
  36994. s = (a = f(t -= o, this.unsigned)).mul(e);
  36995. a.isZero() && (a = c),
  36996. n = n.add(a),
  36997. i = i.sub(s)
  36998. }
  36999. return n
  37000. }
  37001. ,
  37002. t.div = t.divide,
  37003. t.modulo = function(e) {
  37004. return p(e) || (e = m(e)),
  37005. this.sub(this.div(e).mul(e))
  37006. }
  37007. ,
  37008. t.mod = t.modulo,
  37009. t.not = function() {
  37010. return g(~this.low, ~this.high, this.unsigned)
  37011. }
  37012. ,
  37013. t.and = function(e) {
  37014. return p(e) || (e = m(e)),
  37015. g(this.low & e.low, this.high & e.high, this.unsigned)
  37016. }
  37017. ,
  37018. t.or = function(e) {
  37019. return p(e) || (e = m(e)),
  37020. g(this.low | e.low, this.high | e.high, this.unsigned)
  37021. }
  37022. ,
  37023. t.xor = function(e) {
  37024. return p(e) || (e = m(e)),
  37025. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37026. }
  37027. ,
  37028. t.shiftLeft = function(e) {
  37029. return p(e) && (e = e.toInt()),
  37030. 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)
  37031. }
  37032. ,
  37033. t.shl = t.shiftLeft,
  37034. t.shiftRight = function(e) {
  37035. return p(e) && (e = e.toInt()),
  37036. 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)
  37037. }
  37038. ,
  37039. t.shr = t.shiftRight,
  37040. t.shiftRightUnsigned = function(e) {
  37041. if (p(e) && (e = e.toInt()),
  37042. 0 === (e &= 63))
  37043. return this;
  37044. var t = this.high;
  37045. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37046. }
  37047. ,
  37048. t.shru = t.shiftRightUnsigned,
  37049. t.toSigned = function() {
  37050. return this.unsigned ? g(this.low, this.high, !1) : this
  37051. }
  37052. ,
  37053. t.toUnsigned = function() {
  37054. return this.unsigned ? this : g(this.low, this.high, !0)
  37055. }
  37056. ,
  37057. t.toBytes = function(e) {
  37058. return e ? this.toBytesLE() : this.toBytesBE()
  37059. }
  37060. ,
  37061. t.toBytesLE = function() {
  37062. var e = this.high
  37063. , t = this.low;
  37064. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37065. }
  37066. ,
  37067. t.toBytesBE = function() {
  37068. var e = this.high
  37069. , t = this.low;
  37070. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37071. }
  37072. ,
  37073. n
  37074. }
  37075. ,
  37076. "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()
  37077. }
  37078. , {}],
  37079. 217: [function(e, t, i) {
  37080. 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 = {
  37081. REVISION: "75"
  37082. };
  37083. function Ii(e, t) {
  37084. return e.distance - t.distance
  37085. }
  37086. function Ei(e, t, i, n) {
  37087. if (!1 !== e.visible && (e.raycast(t, i),
  37088. !0 === n))
  37089. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37090. Ei(r[o], t, i, !0)
  37091. }
  37092. function _i(e, t, i) {
  37093. return i < 0 && (i += 1),
  37094. 1 < i && (i -= 1),
  37095. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37096. }
  37097. function bi(e, t, i, n, r, o, a) {
  37098. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37099. r.multiplyScalar(Vt.x),
  37100. o.multiplyScalar(Vt.y),
  37101. a.multiplyScalar(Vt.z),
  37102. r.add(o).add(a),
  37103. r.clone()
  37104. }
  37105. function wi(e, t, i, n, r, o, a) {
  37106. var s = e.material;
  37107. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37108. return null;
  37109. Ut.copy(a),
  37110. Ut.applyMatrix4(e.matrixWorld);
  37111. var l = t.ray.origin.distanceTo(Ut);
  37112. return l < t.near || l > t.far ? null : {
  37113. distance: l,
  37114. point: Ut.clone(),
  37115. object: e
  37116. }
  37117. }
  37118. function Ti(e, t, i, n, r, o, a, s) {
  37119. Mt.fromArray(n, 3 * o),
  37120. Rt.fromArray(n, 3 * a),
  37121. Pt.fromArray(n, 3 * s);
  37122. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37123. return l && (r && (Nt.fromArray(r, 2 * o),
  37124. Ft.fromArray(r, 2 * a),
  37125. Bt.fromArray(r, 2 * s),
  37126. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37127. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37128. l.faceIndex = o),
  37129. l
  37130. }
  37131. function xi() {}
  37132. function Si(e, t, i, n, r, o) {
  37133. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37134. if (s = e[o[t]].x,
  37135. l = e[o[t]].y,
  37136. c = e[o[i]].x,
  37137. h = e[o[i]].y,
  37138. u = e[o[n]].x,
  37139. d = e[o[n]].y,
  37140. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37141. return !1;
  37142. for (g = u - c,
  37143. m = d - h,
  37144. v = s - u,
  37145. y = l - d,
  37146. A = c - s,
  37147. C = h - l,
  37148. a = 0; a < r; a++)
  37149. if (p = e[o[a]].x,
  37150. f = e[o[a]].y,
  37151. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37152. E = v * (f - d) - y * (p - u),
  37153. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37154. return !1;
  37155. return !0
  37156. }
  37157. function Mi(e) {
  37158. switch (e) {
  37159. case Ci.LinearEncoding:
  37160. return ["Linear", "( value )"];
  37161. case Ci.sRGBEncoding:
  37162. return ["sRGB", "( value )"];
  37163. case Ci.RGBEEncoding:
  37164. return ["RGBE", "( value )"];
  37165. case Ci.RGBM7Encoding:
  37166. return ["RGBM", "( value, 7.0 )"];
  37167. case Ci.RGBM16Encoding:
  37168. return ["RGBM", "( value, 16.0 )"];
  37169. case Ci.RGBDEncoding:
  37170. return ["RGBD", "( value, 256.0 )"];
  37171. case Ci.GammaEncoding:
  37172. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37173. default:
  37174. throw new Error("unsupported encoding: " + e)
  37175. }
  37176. }
  37177. function Ri(e, t) {
  37178. var i = Mi(t);
  37179. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37180. }
  37181. function Pi(e) {
  37182. return "" !== e
  37183. }
  37184. function Oi(e, t) {
  37185. 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)
  37186. }
  37187. function Li(e) {
  37188. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37189. var i = Ci.ShaderChunk[t];
  37190. if (void 0 === i)
  37191. throw new Error("Can not resolve #include <" + t + ">");
  37192. return Li(i)
  37193. })
  37194. }
  37195. function Di(e) {
  37196. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37197. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37198. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37199. return r
  37200. })
  37201. }
  37202. function Ni(e, t, i, n) {
  37203. gi.set(t, i, n).unproject(mi);
  37204. var r = fi[e];
  37205. if (void 0 !== r)
  37206. for (var o = 0, a = r.length; o < a; o++)
  37207. pi.vertices[r[o]].copy(gi)
  37208. }
  37209. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37210. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37211. void 0 === Math.sign && (Math.sign = function(e) {
  37212. return e < 0 ? -1 : 0 < e ? 1 : +e
  37213. }
  37214. ),
  37215. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37216. get: function() {
  37217. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37218. }
  37219. }),
  37220. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37221. writable: !0,
  37222. configurable: !0,
  37223. value: function(e) {
  37224. "use strict";
  37225. if (null == e)
  37226. throw new TypeError("Cannot convert first argument to object");
  37227. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37228. var r = arguments[i];
  37229. if (null != r) {
  37230. r = Object(r);
  37231. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37232. var l = o[a]
  37233. , c = Object.getOwnPropertyDescriptor(r, l);
  37234. void 0 !== c && c.enumerable && (t[l] = r[l])
  37235. }
  37236. }
  37237. }
  37238. return t
  37239. }
  37240. }),
  37241. Ci.MOUSE = {
  37242. LEFT: 0,
  37243. MIDDLE: 1,
  37244. RIGHT: 2
  37245. },
  37246. Ci.CullFaceNone = 0,
  37247. Ci.CullFaceBack = 1,
  37248. Ci.CullFaceFront = 2,
  37249. Ci.CullFaceFrontBack = 3,
  37250. Ci.FrontFaceDirectionCW = 0,
  37251. Ci.FrontFaceDirectionCCW = 1,
  37252. Ci.BasicShadowMap = 0,
  37253. Ci.PCFShadowMap = 1,
  37254. Ci.PCFSoftShadowMap = 2,
  37255. Ci.FrontSide = 0,
  37256. Ci.BackSide = 1,
  37257. Ci.DoubleSide = 2,
  37258. Ci.FlatShading = 1,
  37259. Ci.SmoothShading = 2,
  37260. Ci.NoColors = 0,
  37261. Ci.FaceColors = 1,
  37262. Ci.VertexColors = 2,
  37263. Ci.NoBlending = 0,
  37264. Ci.NormalBlending = 1,
  37265. Ci.AdditiveBlending = 2,
  37266. Ci.SubtractiveBlending = 3,
  37267. Ci.MultiplyBlending = 4,
  37268. Ci.CustomBlending = 5,
  37269. Ci.AddEquation = 100,
  37270. Ci.SubtractEquation = 101,
  37271. Ci.ReverseSubtractEquation = 102,
  37272. Ci.MinEquation = 103,
  37273. Ci.MaxEquation = 104,
  37274. Ci.ZeroFactor = 200,
  37275. Ci.OneFactor = 201,
  37276. Ci.SrcColorFactor = 202,
  37277. Ci.OneMinusSrcColorFactor = 203,
  37278. Ci.SrcAlphaFactor = 204,
  37279. Ci.OneMinusSrcAlphaFactor = 205,
  37280. Ci.DstAlphaFactor = 206,
  37281. Ci.OneMinusDstAlphaFactor = 207,
  37282. Ci.DstColorFactor = 208,
  37283. Ci.OneMinusDstColorFactor = 209,
  37284. Ci.SrcAlphaSaturateFactor = 210,
  37285. Ci.NeverDepth = 0,
  37286. Ci.AlwaysDepth = 1,
  37287. Ci.LessDepth = 2,
  37288. Ci.LessEqualDepth = 3,
  37289. Ci.EqualDepth = 4,
  37290. Ci.GreaterEqualDepth = 5,
  37291. Ci.GreaterDepth = 6,
  37292. Ci.NotEqualDepth = 7,
  37293. Ci.MultiplyOperation = 0,
  37294. Ci.MixOperation = 1,
  37295. Ci.AddOperation = 2,
  37296. Ci.NoToneMapping = 0,
  37297. Ci.LinearToneMapping = 1,
  37298. Ci.ReinhardToneMapping = 2,
  37299. Ci.Uncharted2ToneMapping = 3,
  37300. Ci.CineonToneMapping = 4,
  37301. Ci.UVMapping = 300,
  37302. Ci.CubeReflectionMapping = 301,
  37303. Ci.CubeRefractionMapping = 302,
  37304. Ci.EquirectangularReflectionMapping = 303,
  37305. Ci.EquirectangularRefractionMapping = 304,
  37306. Ci.SphericalReflectionMapping = 305,
  37307. Ci.CubeUVReflectionMapping = 306,
  37308. Ci.CubeUVRefractionMapping = 307,
  37309. Ci.RepeatWrapping = 1e3,
  37310. Ci.ClampToEdgeWrapping = 1001,
  37311. Ci.MirroredRepeatWrapping = 1002,
  37312. Ci.NearestFilter = 1003,
  37313. Ci.NearestMipMapNearestFilter = 1004,
  37314. Ci.NearestMipMapLinearFilter = 1005,
  37315. Ci.LinearFilter = 1006,
  37316. Ci.LinearMipMapNearestFilter = 1007,
  37317. Ci.LinearMipMapLinearFilter = 1008,
  37318. Ci.UnsignedByteType = 1009,
  37319. Ci.ByteType = 1010,
  37320. Ci.ShortType = 1011,
  37321. Ci.UnsignedShortType = 1012,
  37322. Ci.IntType = 1013,
  37323. Ci.UnsignedIntType = 1014,
  37324. Ci.FloatType = 1015,
  37325. Ci.HalfFloatType = 1025,
  37326. Ci.UnsignedShort4444Type = 1016,
  37327. Ci.UnsignedShort5551Type = 1017,
  37328. Ci.UnsignedShort565Type = 1018,
  37329. Ci.AlphaFormat = 1019,
  37330. Ci.RGBFormat = 1020,
  37331. Ci.RGBAFormat = 1021,
  37332. Ci.LuminanceFormat = 1022,
  37333. Ci.LuminanceAlphaFormat = 1023,
  37334. Ci.RGBEFormat = Ci.RGBAFormat,
  37335. Ci.RGB_S3TC_DXT1_Format = 2001,
  37336. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37337. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37338. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37339. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37340. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37341. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37342. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37343. Ci.RGB_ETC1_Format = 2151,
  37344. Ci.LoopOnce = 2200,
  37345. Ci.LoopRepeat = 2201,
  37346. Ci.LoopPingPong = 2202,
  37347. Ci.InterpolateDiscrete = 2300,
  37348. Ci.InterpolateLinear = 2301,
  37349. Ci.InterpolateSmooth = 2302,
  37350. Ci.ZeroCurvatureEnding = 2400,
  37351. Ci.ZeroSlopeEnding = 2401,
  37352. Ci.WrapAroundEnding = 2402,
  37353. Ci.TrianglesDrawMode = 0,
  37354. Ci.TriangleStripDrawMode = 1,
  37355. Ci.TriangleFanDrawMode = 2,
  37356. Ci.LinearEncoding = 3e3,
  37357. Ci.sRGBEncoding = 3001,
  37358. Ci.GammaEncoding = 3007,
  37359. Ci.RGBEEncoding = 3002,
  37360. Ci.LogLuvEncoding = 3003,
  37361. Ci.RGBM7Encoding = 3004,
  37362. Ci.RGBM16Encoding = 3005,
  37363. Ci.RGBDEncoding = 3006,
  37364. Ci.Color = function(e) {
  37365. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37366. }
  37367. ,
  37368. Ci.Color.prototype = {
  37369. constructor: Ci.Color,
  37370. r: 1,
  37371. g: 1,
  37372. b: 1,
  37373. set: function(e) {
  37374. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37375. this
  37376. },
  37377. setScalar: function(e) {
  37378. this.r = e,
  37379. this.g = e,
  37380. this.b = e
  37381. },
  37382. setHex: function(e) {
  37383. return e = Math.floor(e),
  37384. this.r = (e >> 16 & 255) / 255,
  37385. this.g = (e >> 8 & 255) / 255,
  37386. this.b = (255 & e) / 255,
  37387. this
  37388. },
  37389. setRGB: function(e, t, i) {
  37390. return this.r = e,
  37391. this.g = t,
  37392. this.b = i,
  37393. this
  37394. },
  37395. setHSL: function(e, t, i) {
  37396. if (e = Ci.Math.euclideanModulo(e, 1),
  37397. t = Ci.Math.clamp(t, 0, 1),
  37398. i = Ci.Math.clamp(i, 0, 1),
  37399. 0 === t)
  37400. this.r = this.g = this.b = i;
  37401. else {
  37402. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37403. , r = 2 * i - n;
  37404. this.r = _i(r, n, e + 1 / 3),
  37405. this.g = _i(r, n, e),
  37406. this.b = _i(r, n, e - 1 / 3)
  37407. }
  37408. return this
  37409. },
  37410. setStyle: function(t) {
  37411. function e(e) {
  37412. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37413. }
  37414. var i;
  37415. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37416. var n, r = i[1], o = i[2];
  37417. switch (r) {
  37418. case "rgb":
  37419. case "rgba":
  37420. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37421. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37422. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37423. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37424. e(n[5]),
  37425. this;
  37426. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37427. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37428. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37429. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37430. e(n[5]),
  37431. this;
  37432. break;
  37433. case "hsl":
  37434. case "hsla":
  37435. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37436. var a = parseFloat(n[1]) / 360
  37437. , s = parseInt(n[2], 10) / 100
  37438. , l = parseInt(n[3], 10) / 100;
  37439. return e(n[5]),
  37440. this.setHSL(a, s, l)
  37441. }
  37442. }
  37443. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37444. var c, h = (c = i[1]).length;
  37445. if (3 === h)
  37446. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37447. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37448. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37449. this;
  37450. if (6 === h)
  37451. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37452. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37453. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37454. this
  37455. }
  37456. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37457. return this
  37458. },
  37459. clone: function() {
  37460. return new this.constructor(this.r,this.g,this.b)
  37461. },
  37462. copy: function(e) {
  37463. return this.r = e.r,
  37464. this.g = e.g,
  37465. this.b = e.b,
  37466. this
  37467. },
  37468. copyGammaToLinear: function(e, t) {
  37469. return void 0 === t && (t = 2),
  37470. this.r = Math.pow(e.r, t),
  37471. this.g = Math.pow(e.g, t),
  37472. this.b = Math.pow(e.b, t),
  37473. this
  37474. },
  37475. copyLinearToGamma: function(e, t) {
  37476. void 0 === t && (t = 2);
  37477. var i = 0 < t ? 1 / t : 1;
  37478. return this.r = Math.pow(e.r, i),
  37479. this.g = Math.pow(e.g, i),
  37480. this.b = Math.pow(e.b, i),
  37481. this
  37482. },
  37483. convertGammaToLinear: function() {
  37484. var e = this.r
  37485. , t = this.g
  37486. , i = this.b;
  37487. return this.r = e * e,
  37488. this.g = t * t,
  37489. this.b = i * i,
  37490. this
  37491. },
  37492. convertLinearToGamma: function() {
  37493. return this.r = Math.sqrt(this.r),
  37494. this.g = Math.sqrt(this.g),
  37495. this.b = Math.sqrt(this.b),
  37496. this
  37497. },
  37498. getHex: function() {
  37499. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37500. },
  37501. getHexString: function() {
  37502. return ("000000" + this.getHex().toString(16)).slice(-6)
  37503. },
  37504. getHSL: function(e) {
  37505. var t, i, n = e || {
  37506. h: 0,
  37507. s: 0,
  37508. l: 0
  37509. }, 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;
  37510. if (l === s)
  37511. i = t = 0;
  37512. else {
  37513. var h = s - l;
  37514. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37515. s) {
  37516. case r:
  37517. t = (o - a) / h + (o < a ? 6 : 0);
  37518. break;
  37519. case o:
  37520. t = (a - r) / h + 2;
  37521. break;
  37522. case a:
  37523. t = (r - o) / h + 4
  37524. }
  37525. t /= 6
  37526. }
  37527. return n.h = t,
  37528. n.s = i,
  37529. n.l = c,
  37530. n
  37531. },
  37532. getStyle: function() {
  37533. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37534. },
  37535. offsetHSL: function(e, t, i) {
  37536. var n = this.getHSL();
  37537. return n.h += e,
  37538. n.s += t,
  37539. n.l += i,
  37540. this.setHSL(n.h, n.s, n.l),
  37541. this
  37542. },
  37543. add: function(e) {
  37544. return this.r += e.r,
  37545. this.g += e.g,
  37546. this.b += e.b,
  37547. this
  37548. },
  37549. addColors: function(e, t) {
  37550. return this.r = e.r + t.r,
  37551. this.g = e.g + t.g,
  37552. this.b = e.b + t.b,
  37553. this
  37554. },
  37555. addScalar: function(e) {
  37556. return this.r += e,
  37557. this.g += e,
  37558. this.b += e,
  37559. this
  37560. },
  37561. multiply: function(e) {
  37562. return this.r *= e.r,
  37563. this.g *= e.g,
  37564. this.b *= e.b,
  37565. this
  37566. },
  37567. multiplyScalar: function(e) {
  37568. return this.r *= e,
  37569. this.g *= e,
  37570. this.b *= e,
  37571. this
  37572. },
  37573. lerp: function(e, t) {
  37574. return this.r += (e.r - this.r) * t,
  37575. this.g += (e.g - this.g) * t,
  37576. this.b += (e.b - this.b) * t,
  37577. this
  37578. },
  37579. equals: function(e) {
  37580. return e.r === this.r && e.g === this.g && e.b === this.b
  37581. },
  37582. fromArray: function(e, t) {
  37583. return void 0 === t && (t = 0),
  37584. this.r = e[t],
  37585. this.g = e[t + 1],
  37586. this.b = e[t + 2],
  37587. this
  37588. },
  37589. toArray: function(e, t) {
  37590. return void 0 === e && (e = []),
  37591. void 0 === t && (t = 0),
  37592. e[t] = this.r,
  37593. e[t + 1] = this.g,
  37594. e[t + 2] = this.b,
  37595. e
  37596. }
  37597. },
  37598. Ci.ColorKeywords = {
  37599. aliceblue: 15792383,
  37600. antiquewhite: 16444375,
  37601. aqua: 65535,
  37602. aquamarine: 8388564,
  37603. azure: 15794175,
  37604. beige: 16119260,
  37605. bisque: 16770244,
  37606. black: 0,
  37607. blanchedalmond: 16772045,
  37608. blue: 255,
  37609. blueviolet: 9055202,
  37610. brown: 10824234,
  37611. burlywood: 14596231,
  37612. cadetblue: 6266528,
  37613. chartreuse: 8388352,
  37614. chocolate: 13789470,
  37615. coral: 16744272,
  37616. cornflowerblue: 6591981,
  37617. cornsilk: 16775388,
  37618. crimson: 14423100,
  37619. cyan: 65535,
  37620. darkblue: 139,
  37621. darkcyan: 35723,
  37622. darkgoldenrod: 12092939,
  37623. darkgray: 11119017,
  37624. darkgreen: 25600,
  37625. darkgrey: 11119017,
  37626. darkkhaki: 12433259,
  37627. darkmagenta: 9109643,
  37628. darkolivegreen: 5597999,
  37629. darkorange: 16747520,
  37630. darkorchid: 10040012,
  37631. darkred: 9109504,
  37632. darksalmon: 15308410,
  37633. darkseagreen: 9419919,
  37634. darkslateblue: 4734347,
  37635. darkslategray: 3100495,
  37636. darkslategrey: 3100495,
  37637. darkturquoise: 52945,
  37638. darkviolet: 9699539,
  37639. deeppink: 16716947,
  37640. deepskyblue: 49151,
  37641. dimgray: 6908265,
  37642. dimgrey: 6908265,
  37643. dodgerblue: 2003199,
  37644. firebrick: 11674146,
  37645. floralwhite: 16775920,
  37646. forestgreen: 2263842,
  37647. fuchsia: 16711935,
  37648. gainsboro: 14474460,
  37649. ghostwhite: 16316671,
  37650. gold: 16766720,
  37651. goldenrod: 14329120,
  37652. gray: 8421504,
  37653. green: 32768,
  37654. greenyellow: 11403055,
  37655. grey: 8421504,
  37656. honeydew: 15794160,
  37657. hotpink: 16738740,
  37658. indianred: 13458524,
  37659. indigo: 4915330,
  37660. ivory: 16777200,
  37661. khaki: 15787660,
  37662. lavender: 15132410,
  37663. lavenderblush: 16773365,
  37664. lawngreen: 8190976,
  37665. lemonchiffon: 16775885,
  37666. lightblue: 11393254,
  37667. lightcoral: 15761536,
  37668. lightcyan: 14745599,
  37669. lightgoldenrodyellow: 16448210,
  37670. lightgray: 13882323,
  37671. lightgreen: 9498256,
  37672. lightgrey: 13882323,
  37673. lightpink: 16758465,
  37674. lightsalmon: 16752762,
  37675. lightseagreen: 2142890,
  37676. lightskyblue: 8900346,
  37677. lightslategray: 7833753,
  37678. lightslategrey: 7833753,
  37679. lightsteelblue: 11584734,
  37680. lightyellow: 16777184,
  37681. lime: 65280,
  37682. limegreen: 3329330,
  37683. linen: 16445670,
  37684. magenta: 16711935,
  37685. maroon: 8388608,
  37686. mediumaquamarine: 6737322,
  37687. mediumblue: 205,
  37688. mediumorchid: 12211667,
  37689. mediumpurple: 9662683,
  37690. mediumseagreen: 3978097,
  37691. mediumslateblue: 8087790,
  37692. mediumspringgreen: 64154,
  37693. mediumturquoise: 4772300,
  37694. mediumvioletred: 13047173,
  37695. midnightblue: 1644912,
  37696. mintcream: 16121850,
  37697. mistyrose: 16770273,
  37698. moccasin: 16770229,
  37699. navajowhite: 16768685,
  37700. navy: 128,
  37701. oldlace: 16643558,
  37702. olive: 8421376,
  37703. olivedrab: 7048739,
  37704. orange: 16753920,
  37705. orangered: 16729344,
  37706. orchid: 14315734,
  37707. palegoldenrod: 15657130,
  37708. palegreen: 10025880,
  37709. paleturquoise: 11529966,
  37710. palevioletred: 14381203,
  37711. papayawhip: 16773077,
  37712. peachpuff: 16767673,
  37713. peru: 13468991,
  37714. pink: 16761035,
  37715. plum: 14524637,
  37716. powderblue: 11591910,
  37717. purple: 8388736,
  37718. red: 16711680,
  37719. rosybrown: 12357519,
  37720. royalblue: 4286945,
  37721. saddlebrown: 9127187,
  37722. salmon: 16416882,
  37723. sandybrown: 16032864,
  37724. seagreen: 3050327,
  37725. seashell: 16774638,
  37726. sienna: 10506797,
  37727. silver: 12632256,
  37728. skyblue: 8900331,
  37729. slateblue: 6970061,
  37730. slategray: 7372944,
  37731. slategrey: 7372944,
  37732. snow: 16775930,
  37733. springgreen: 65407,
  37734. steelblue: 4620980,
  37735. tan: 13808780,
  37736. teal: 32896,
  37737. thistle: 14204888,
  37738. tomato: 16737095,
  37739. turquoise: 4251856,
  37740. violet: 15631086,
  37741. wheat: 16113331,
  37742. white: 16777215,
  37743. whitesmoke: 16119285,
  37744. yellow: 16776960,
  37745. yellowgreen: 10145074
  37746. },
  37747. Ci.Quaternion = function(e, t, i, n) {
  37748. this._x = e || 0,
  37749. this._y = t || 0,
  37750. this._z = i || 0,
  37751. this._w = void 0 !== n ? n : 1
  37752. }
  37753. ,
  37754. Ci.Quaternion.prototype = {
  37755. constructor: Ci.Quaternion,
  37756. get x() {
  37757. return this._x
  37758. },
  37759. set x(e) {
  37760. this._x = e,
  37761. this.onChangeCallback()
  37762. },
  37763. get y() {
  37764. return this._y
  37765. },
  37766. set y(e) {
  37767. this._y = e,
  37768. this.onChangeCallback()
  37769. },
  37770. get z() {
  37771. return this._z
  37772. },
  37773. set z(e) {
  37774. this._z = e,
  37775. this.onChangeCallback()
  37776. },
  37777. get w() {
  37778. return this._w
  37779. },
  37780. set w(e) {
  37781. this._w = e,
  37782. this.onChangeCallback()
  37783. },
  37784. set: function(e, t, i, n) {
  37785. return this._x = e,
  37786. this._y = t,
  37787. this._z = i,
  37788. this._w = n,
  37789. this.onChangeCallback(),
  37790. this
  37791. },
  37792. clone: function() {
  37793. return new this.constructor(this._x,this._y,this._z,this._w)
  37794. },
  37795. toObject:function(){//add
  37796. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37797. },
  37798. copy: function(e) {
  37799. return this._x = e.x,
  37800. this._y = e.y,
  37801. this._z = e.z,
  37802. this._w = e.w,
  37803. this.onChangeCallback(),
  37804. this
  37805. },
  37806. setFromEuler: function(e, t) {
  37807. if (e instanceof Ci.Euler == 0)
  37808. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37809. var i = Math.cos(e._x / 2)
  37810. , n = Math.cos(e._y / 2)
  37811. , r = Math.cos(e._z / 2)
  37812. , o = Math.sin(e._x / 2)
  37813. , a = Math.sin(e._y / 2)
  37814. , s = Math.sin(e._z / 2)
  37815. , l = e.order;
  37816. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37817. this._y = i * a * r - o * n * s,
  37818. this._z = i * n * s + o * a * r,
  37819. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37820. this._y = i * a * r - o * n * s,
  37821. this._z = i * n * s - o * a * r,
  37822. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37823. this._y = i * a * r + o * n * s,
  37824. this._z = i * n * s + o * a * r,
  37825. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37826. this._y = i * a * r + o * n * s,
  37827. this._z = i * n * s - o * a * r,
  37828. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37829. this._y = i * a * r + o * n * s,
  37830. this._z = i * n * s - o * a * r,
  37831. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37832. this._y = i * a * r - o * n * s,
  37833. this._z = i * n * s + o * a * r,
  37834. this._w = i * n * r + o * a * s),
  37835. !1 !== t && this.onChangeCallback(),
  37836. this
  37837. },
  37838. setFromAxisAngle: function(e, t) {
  37839. var i = t / 2
  37840. , n = Math.sin(i);
  37841. return this._x = e.x * n,
  37842. this._y = e.y * n,
  37843. this._z = e.z * n,
  37844. this._w = Math.cos(i),
  37845. this.onChangeCallback(),
  37846. this
  37847. },
  37848. setFromRotationMatrix: function(e) {
  37849. 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;
  37850. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37851. this._w = .25 / t,
  37852. this._x = (h - l) * t,
  37853. this._y = (o - c) * t,
  37854. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37855. this._w = (h - l) / t,
  37856. this._x = .25 * t,
  37857. this._y = (r + a) / t,
  37858. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37859. this._w = (o - c) / t,
  37860. this._x = (r + a) / t,
  37861. this._y = .25 * t,
  37862. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37863. this._w = (a - r) / t,
  37864. this._x = (o + c) / t,
  37865. this._y = (l + h) / t,
  37866. this._z = .25 * t),
  37867. this.onChangeCallback(),
  37868. this
  37869. },
  37870. setFromUnitVectors: function(e, t) {
  37871. return void 0 === Be && (Be = new Ci.Vector3),
  37872. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37873. 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),
  37874. this._x = Be.x,
  37875. this._y = Be.y,
  37876. this._z = Be.z,
  37877. this._w = Ve,
  37878. this.normalize(),
  37879. this
  37880. },
  37881. inverse: function() {
  37882. return this.conjugate().normalize(),
  37883. this
  37884. },
  37885. conjugate: function() {
  37886. return this._x *= -1,
  37887. this._y *= -1,
  37888. this._z *= -1,
  37889. this.onChangeCallback(),
  37890. this
  37891. },
  37892. dot: function(e) {
  37893. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37894. },
  37895. lengthSq: function() {
  37896. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37897. },
  37898. length: function() {
  37899. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37900. },
  37901. normalize: function() {
  37902. var e = this.length();
  37903. return 0 === e ? (this._x = 0,
  37904. this._y = 0,
  37905. this._z = 0,
  37906. this._w = 1) : (e = 1 / e,
  37907. this._x = this._x * e,
  37908. this._y = this._y * e,
  37909. this._z = this._z * e,
  37910. this._w = this._w * e),
  37911. this.onChangeCallback(),
  37912. this
  37913. },
  37914. multiply: function(e, t) {
  37915. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37916. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37917. },
  37918. multiplyQuaternions: function(e, t) {
  37919. var i = e._x
  37920. , n = e._y
  37921. , r = e._z
  37922. , o = e._w
  37923. , a = t._x
  37924. , s = t._y
  37925. , l = t._z
  37926. , c = t._w;
  37927. return this._x = i * c + o * a + n * l - r * s,
  37928. this._y = n * c + o * s + r * a - i * l,
  37929. this._z = r * c + o * l + i * s - n * a,
  37930. this._w = o * c - i * a - n * s - r * l,
  37931. this.onChangeCallback(),
  37932. this
  37933. },
  37934. slerp: function(e, t) {
  37935. if (0 === t)
  37936. return this;
  37937. if (1 === t)
  37938. return this.copy(e);
  37939. var i = this._x
  37940. , n = this._y
  37941. , r = this._z
  37942. , o = this._w
  37943. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37944. if (a < 0 ? (this._w = -e._w,
  37945. this._x = -e._x,
  37946. this._y = -e._y,
  37947. this._z = -e._z,
  37948. a = -a) : this.copy(e),
  37949. 1 <= a)
  37950. return this._w = o,
  37951. this._x = i,
  37952. this._y = n,
  37953. this._z = r,
  37954. this;
  37955. var s = Math.sqrt(1 - a * a);
  37956. if (Math.abs(s) < .001)
  37957. return this._w = .5 * (o + this._w),
  37958. this._x = .5 * (i + this._x),
  37959. this._y = .5 * (n + this._y),
  37960. this._z = .5 * (r + this._z),
  37961. this;
  37962. var l = Math.atan2(s, a)
  37963. , c = Math.sin((1 - t) * l) / s
  37964. , h = Math.sin(t * l) / s;
  37965. return this._w = o * c + this._w * h,
  37966. this._x = i * c + this._x * h,
  37967. this._y = n * c + this._y * h,
  37968. this._z = r * c + this._z * h,
  37969. this.onChangeCallback(),
  37970. this
  37971. },
  37972. equals: function(e) {
  37973. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37974. },
  37975. fromArray: function(e, t) {
  37976. return void 0 === t && (t = 0),
  37977. this._x = e[t],
  37978. this._y = e[t + 1],
  37979. this._z = e[t + 2],
  37980. this._w = e[t + 3],
  37981. this.onChangeCallback(),
  37982. this
  37983. },
  37984. toArray: function(e, t) {
  37985. return void 0 === e && (e = []),
  37986. void 0 === t && (t = 0),
  37987. e[t] = this._x,
  37988. e[t + 1] = this._y,
  37989. e[t + 2] = this._z,
  37990. e[t + 3] = this._w,
  37991. e
  37992. },
  37993. onChange: function(e) {
  37994. return this.onChangeCallback = e,
  37995. this
  37996. },
  37997. onChangeCallback: function() {}
  37998. },
  37999. Object.assign(Ci.Quaternion, {
  38000. slerp: function(e, t, i, n) {
  38001. return i.copy(e).slerp(t, n)
  38002. },
  38003. slerpFlat: function(e, t, i, n, r, o, a) {
  38004. var s = i[n + 0]
  38005. , l = i[n + 1]
  38006. , c = i[n + 2]
  38007. , h = i[n + 3]
  38008. , u = r[o + 0]
  38009. , d = r[o + 1]
  38010. , p = r[o + 2]
  38011. , f = r[o + 3];
  38012. if (h !== f || s !== u || l !== d || c !== p) {
  38013. var g = 1 - a
  38014. , m = s * u + l * d + c * p + h * f
  38015. , v = 0 <= m ? 1 : -1
  38016. , y = 1 - m * m;
  38017. if (y > Number.EPSILON) {
  38018. var A = Math.sqrt(y)
  38019. , C = Math.atan2(A, m * v);
  38020. g = Math.sin(g * C) / A,
  38021. a = Math.sin(a * C) / A
  38022. }
  38023. var I = a * v;
  38024. if (s = s * g + u * I,
  38025. l = l * g + d * I,
  38026. c = c * g + p * I,
  38027. h = h * g + f * I,
  38028. g === 1 - a) {
  38029. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38030. s *= E,
  38031. l *= E,
  38032. c *= E,
  38033. h *= E
  38034. }
  38035. }
  38036. e[t] = s,
  38037. e[t + 1] = l,
  38038. e[t + 2] = c,
  38039. e[t + 3] = h
  38040. }
  38041. }),
  38042. Ci.Vector2 = function(e, t) {
  38043. this.x = e || 0,
  38044. this.y = t || 0
  38045. }
  38046. ,
  38047. Ci.Vector2.prototype = {
  38048. constructor: Ci.Vector2,
  38049. get width() {
  38050. return this.x
  38051. },
  38052. set width(e) {
  38053. this.x = e
  38054. },
  38055. get height() {
  38056. return this.y
  38057. },
  38058. set height(e) {
  38059. this.y = e
  38060. },
  38061. set: function(e, t) {
  38062. return this.x = e,
  38063. this.y = t,
  38064. this
  38065. },
  38066. setScalar: function(e) {
  38067. return this.x = e,
  38068. this.y = e,
  38069. this
  38070. },
  38071. setX: function(e) {
  38072. return this.x = e,
  38073. this
  38074. },
  38075. setY: function(e) {
  38076. return this.y = e,
  38077. this
  38078. },
  38079. setComponent: function(e, t) {
  38080. switch (e) {
  38081. case 0:
  38082. this.x = t;
  38083. break;
  38084. case 1:
  38085. this.y = t;
  38086. break;
  38087. default:
  38088. throw new Error("index is out of range: " + e)
  38089. }
  38090. },
  38091. getComponent: function(e) {
  38092. switch (e) {
  38093. case 0:
  38094. return this.x;
  38095. case 1:
  38096. return this.y;
  38097. default:
  38098. throw new Error("index is out of range: " + e)
  38099. }
  38100. },
  38101. clone: function() {
  38102. return new this.constructor(this.x,this.y)
  38103. },
  38104. copy: function(e) {
  38105. return this.x = e.x,
  38106. this.y = e.y,
  38107. this
  38108. },
  38109. add: function(e, t) {
  38110. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38111. this.addVectors(e, t)) : (this.x += e.x,
  38112. this.y += e.y,
  38113. this)
  38114. },
  38115. addScalar: function(e) {
  38116. return this.x += e,
  38117. this.y += e,
  38118. this
  38119. },
  38120. addVectors: function(e, t) {
  38121. return this.x = e.x + t.x,
  38122. this.y = e.y + t.y,
  38123. this
  38124. },
  38125. addScaledVector: function(e, t) {
  38126. return this.x += e.x * t,
  38127. this.y += e.y * t,
  38128. this
  38129. },
  38130. sub: function(e, t) {
  38131. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38132. this.subVectors(e, t)) : (this.x -= e.x,
  38133. this.y -= e.y,
  38134. this)
  38135. },
  38136. subScalar: function(e) {
  38137. return this.x -= e,
  38138. this.y -= e,
  38139. this
  38140. },
  38141. subVectors: function(e, t) {
  38142. return this.x = e.x - t.x,
  38143. this.y = e.y - t.y,
  38144. this
  38145. },
  38146. multiply: function(e) {
  38147. return this.x *= e.x,
  38148. this.y *= e.y,
  38149. this
  38150. },
  38151. multiplyScalar: function(e) {
  38152. return isFinite(e) ? (this.x *= e,
  38153. this.y *= e) : (this.x = 0,
  38154. this.y = 0),
  38155. this
  38156. },
  38157. divide: function(e) {
  38158. return this.x /= e.x,
  38159. this.y /= e.y,
  38160. this
  38161. },
  38162. divideScalar: function(e) {
  38163. return this.multiplyScalar(1 / e)
  38164. },
  38165. min: function(e) {
  38166. return this.x = Math.min(this.x, e.x),
  38167. this.y = Math.min(this.y, e.y),
  38168. this
  38169. },
  38170. max: function(e) {
  38171. return this.x = Math.max(this.x, e.x),
  38172. this.y = Math.max(this.y, e.y),
  38173. this
  38174. },
  38175. clamp: function(e, t) {
  38176. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38177. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38178. this
  38179. },
  38180. clampScalar: function(e, t) {
  38181. return void 0 === Ne && (Ne = new Ci.Vector2,
  38182. Fe = new Ci.Vector2),
  38183. Ne.set(e, e),
  38184. Fe.set(t, t),
  38185. this.clamp(Ne, Fe)
  38186. },
  38187. clampLength: function(e, t) {
  38188. var i = this.length();
  38189. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38190. this
  38191. },
  38192. floor: function() {
  38193. return this.x = Math.floor(this.x),
  38194. this.y = Math.floor(this.y),
  38195. this
  38196. },
  38197. ceil: function() {
  38198. return this.x = Math.ceil(this.x),
  38199. this.y = Math.ceil(this.y),
  38200. this
  38201. },
  38202. round: function() {
  38203. return this.x = Math.round(this.x),
  38204. this.y = Math.round(this.y),
  38205. this
  38206. },
  38207. roundToZero: function() {
  38208. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38209. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38210. this
  38211. },
  38212. negate: function() {
  38213. return this.x = -this.x,
  38214. this.y = -this.y,
  38215. this
  38216. },
  38217. dot: function(e) {
  38218. return this.x * e.x + this.y * e.y
  38219. },
  38220. lengthSq: function() {
  38221. return this.x * this.x + this.y * this.y
  38222. },
  38223. length: function() {
  38224. return Math.sqrt(this.x * this.x + this.y * this.y)
  38225. },
  38226. lengthManhattan: function() {
  38227. return Math.abs(this.x) + Math.abs(this.y)
  38228. },
  38229. normalize: function() {
  38230. return this.divideScalar(this.length())
  38231. },
  38232. angle: function() {
  38233. var e = Math.atan2(this.y, this.x);
  38234. return e < 0 && (e += 2 * Math.PI),
  38235. e
  38236. },
  38237. distanceTo: function(e) {
  38238. return Math.sqrt(this.distanceToSquared(e))
  38239. },
  38240. distanceToSquared: function(e) {
  38241. var t = this.x - e.x
  38242. , i = this.y - e.y;
  38243. return t * t + i * i
  38244. },
  38245. setLength: function(e) {
  38246. return this.multiplyScalar(e / this.length())
  38247. },
  38248. lerp: function(e, t) {
  38249. return this.x += (e.x - this.x) * t,
  38250. this.y += (e.y - this.y) * t,
  38251. this
  38252. },
  38253. lerpVectors: function(e, t, i) {
  38254. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38255. this
  38256. },
  38257. equals: function(e) {
  38258. return e.x === this.x && e.y === this.y
  38259. },
  38260. fromArray: function(e, t) {
  38261. return void 0 === t && (t = 0),
  38262. this.x = e[t],
  38263. this.y = e[t + 1],
  38264. this
  38265. },
  38266. toArray: function(e, t) {
  38267. return void 0 === e && (e = []),
  38268. void 0 === t && (t = 0),
  38269. e[t] = this.x,
  38270. e[t + 1] = this.y,
  38271. e
  38272. },
  38273. fromAttribute: function(e, t, i) {
  38274. return void 0 === i && (i = 0),
  38275. t = t * e.itemSize + i,
  38276. this.x = e.array[t],
  38277. this.y = e.array[t + 1],
  38278. this
  38279. },
  38280. rotateAround: function(e, t) {
  38281. var i = Math.cos(t)
  38282. , n = Math.sin(t)
  38283. , r = this.x - e.x
  38284. , o = this.y - e.y;
  38285. return this.x = r * i - o * n + e.x,
  38286. this.y = r * n + o * i + e.y,
  38287. this
  38288. }
  38289. },
  38290. Ci.Vector3 = function(e, t, i) {
  38291. this.x = e || 0,
  38292. this.y = t || 0,
  38293. this.z = i || 0
  38294. }
  38295. ,
  38296. Ci.Vector3.prototype = {
  38297. constructor: Ci.Vector3,
  38298. set: function(e, t, i) {
  38299. return this.x = e,
  38300. this.y = t,
  38301. this.z = i,
  38302. this
  38303. },
  38304. setScalar: function(e) {
  38305. return this.x = e,
  38306. this.y = e,
  38307. this.z = e,
  38308. this
  38309. },
  38310. setX: function(e) {
  38311. return this.x = e,
  38312. this
  38313. },
  38314. setY: function(e) {
  38315. return this.y = e,
  38316. this
  38317. },
  38318. setZ: function(e) {
  38319. return this.z = e,
  38320. this
  38321. },
  38322. setComponent: function(e, t) {
  38323. switch (e) {
  38324. case 0:
  38325. this.x = t;
  38326. break;
  38327. case 1:
  38328. this.y = t;
  38329. break;
  38330. case 2:
  38331. this.z = t;
  38332. break;
  38333. default:
  38334. throw new Error("index is out of range: " + e)
  38335. }
  38336. },
  38337. getComponent: function(e) {
  38338. switch (e) {
  38339. case 0:
  38340. return this.x;
  38341. case 1:
  38342. return this.y;
  38343. case 2:
  38344. return this.z;
  38345. default:
  38346. throw new Error("index is out of range: " + e)
  38347. }
  38348. },
  38349. clone: function() {
  38350. return new this.constructor(this.x,this.y,this.z)
  38351. },
  38352. copy: function(e) {
  38353. return this.x = e.x,
  38354. this.y = e.y,
  38355. this.z = e.z,
  38356. this
  38357. },
  38358. add: function(e, t) {
  38359. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38360. this.addVectors(e, t)) : (this.x += e.x,
  38361. this.y += e.y,
  38362. this.z += e.z,
  38363. this)
  38364. },
  38365. addScalar: function(e) {
  38366. return this.x += e,
  38367. this.y += e,
  38368. this.z += e,
  38369. this
  38370. },
  38371. addVectors: function(e, t) {
  38372. return this.x = e.x + t.x,
  38373. this.y = e.y + t.y,
  38374. this.z = e.z + t.z,
  38375. this
  38376. },
  38377. addScaledVector: function(e, t) {
  38378. return this.x += e.x * t,
  38379. this.y += e.y * t,
  38380. this.z += e.z * t,
  38381. this
  38382. },
  38383. sub: function(e, t) {
  38384. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38385. this.subVectors(e, t)) : (this.x -= e.x,
  38386. this.y -= e.y,
  38387. this.z -= e.z,
  38388. this)
  38389. },
  38390. subScalar: function(e) {
  38391. return this.x -= e,
  38392. this.y -= e,
  38393. this.z -= e,
  38394. this
  38395. },
  38396. subVectors: function(e, t) {
  38397. return this.x = e.x - t.x,
  38398. this.y = e.y - t.y,
  38399. this.z = e.z - t.z,
  38400. this
  38401. },
  38402. multiply: function(e, t) {
  38403. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38404. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38405. this.y *= e.y,
  38406. this.z *= e.z,
  38407. this)
  38408. },
  38409. multiplyScalar: function(e) {
  38410. return isFinite(e) ? (this.x *= e,
  38411. this.y *= e,
  38412. this.z *= e) : (this.x = 0,
  38413. this.y = 0,
  38414. this.z = 0),
  38415. this
  38416. },
  38417. multiplyVectors: function(e, t) {
  38418. return this.x = e.x * t.x,
  38419. this.y = e.y * t.y,
  38420. this.z = e.z * t.z,
  38421. this
  38422. },
  38423. applyEuler: function(e) {
  38424. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38425. void 0 === De && (De = new Ci.Quaternion),
  38426. this.applyQuaternion(De.setFromEuler(e)),
  38427. this
  38428. },
  38429. applyAxisAngle: function(e, t) {
  38430. return void 0 === Le && (Le = new Ci.Quaternion),
  38431. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38432. this
  38433. },
  38434. applyMatrix3: function(e) {
  38435. var t = this.x
  38436. , i = this.y
  38437. , n = this.z
  38438. , r = e.elements;
  38439. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38440. this.y = r[1] * t + r[4] * i + r[7] * n,
  38441. this.z = r[2] * t + r[5] * i + r[8] * n,
  38442. this
  38443. },
  38444. applyMatrix4: function(e) {
  38445. var t = this.x
  38446. , i = this.y
  38447. , n = this.z
  38448. , r = e.elements;
  38449. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38450. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38451. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38452. this
  38453. },
  38454. applyProjection: function(e) {
  38455. var t = this.x
  38456. , i = this.y
  38457. , n = this.z
  38458. , r = e.elements
  38459. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38460. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38461. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38462. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38463. this
  38464. },
  38465. applyQuaternion: function(e) {
  38466. var t = this.x
  38467. , i = this.y
  38468. , n = this.z
  38469. , r = e.x
  38470. , o = e.y
  38471. , a = e.z
  38472. , s = e.w
  38473. , l = s * t + o * n - a * i
  38474. , c = s * i + a * t - r * n
  38475. , h = s * n + r * i - o * t
  38476. , u = -r * t - o * i - a * n;
  38477. return this.x = l * s + u * -r + c * -a - h * -o,
  38478. this.y = c * s + u * -o + h * -r - l * -a,
  38479. this.z = h * s + u * -a + l * -o - c * -r,
  38480. this
  38481. },
  38482. project: function(e) {
  38483. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38484. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38485. this.applyProjection(Oe)
  38486. },
  38487. unproject: function(e) {
  38488. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38489. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38490. this.applyProjection(Pe)
  38491. },
  38492. transformDirection: function(e) {
  38493. var t = this.x
  38494. , i = this.y
  38495. , n = this.z
  38496. , r = e.elements;
  38497. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38498. this.y = r[1] * t + r[5] * i + r[9] * n,
  38499. this.z = r[2] * t + r[6] * i + r[10] * n,
  38500. this.normalize(),
  38501. this
  38502. },
  38503. divide: function(e) {
  38504. return this.x /= e.x,
  38505. this.y /= e.y,
  38506. this.z /= e.z,
  38507. this
  38508. },
  38509. divideScalar: function(e) {
  38510. return this.multiplyScalar(1 / e)
  38511. },
  38512. min: function(e) {
  38513. return this.x = Math.min(this.x, e.x),
  38514. this.y = Math.min(this.y, e.y),
  38515. this.z = Math.min(this.z, e.z),
  38516. this
  38517. },
  38518. max: function(e) {
  38519. return this.x = Math.max(this.x, e.x),
  38520. this.y = Math.max(this.y, e.y),
  38521. this.z = Math.max(this.z, e.z),
  38522. this
  38523. },
  38524. clamp: function(e, t) {
  38525. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38526. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38527. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38528. this
  38529. },
  38530. clampScalar: function(e, t) {
  38531. return void 0 === Me && (Me = new Ci.Vector3,
  38532. Re = new Ci.Vector3),
  38533. Me.set(e, e, e),
  38534. Re.set(t, t, t),
  38535. this.clamp(Me, Re)
  38536. },
  38537. clampLength: function(e, t) {
  38538. var i = this.length();
  38539. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38540. this
  38541. },
  38542. floor: function() {
  38543. return this.x = Math.floor(this.x),
  38544. this.y = Math.floor(this.y),
  38545. this.z = Math.floor(this.z),
  38546. this
  38547. },
  38548. ceil: function() {
  38549. return this.x = Math.ceil(this.x),
  38550. this.y = Math.ceil(this.y),
  38551. this.z = Math.ceil(this.z),
  38552. this
  38553. },
  38554. round: function() {
  38555. return this.x = Math.round(this.x),
  38556. this.y = Math.round(this.y),
  38557. this.z = Math.round(this.z),
  38558. this
  38559. },
  38560. roundToZero: function() {
  38561. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38562. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38563. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38564. this
  38565. },
  38566. negate: function() {
  38567. return this.x = -this.x,
  38568. this.y = -this.y,
  38569. this.z = -this.z,
  38570. this
  38571. },
  38572. dot: function(e) {
  38573. return this.x * e.x + this.y * e.y + this.z * e.z
  38574. },
  38575. lengthSq: function() {
  38576. return this.x * this.x + this.y * this.y + this.z * this.z
  38577. },
  38578. length: function() {
  38579. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38580. },
  38581. lengthManhattan: function() {
  38582. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38583. },
  38584. normalize: function() {
  38585. return this.divideScalar(this.length())
  38586. },
  38587. setLength: function(e) {
  38588. return this.multiplyScalar(e / this.length())
  38589. },
  38590. lerp: function(e, t) {
  38591. return this.x += (e.x - this.x) * t,
  38592. this.y += (e.y - this.y) * t,
  38593. this.z += (e.z - this.z) * t,
  38594. this
  38595. },
  38596. lerpVectors: function(e, t, i) {
  38597. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38598. this
  38599. },
  38600. cross: function(e, t) {
  38601. if (void 0 !== t)
  38602. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38603. this.crossVectors(e, t);
  38604. var i = this.x
  38605. , n = this.y
  38606. , r = this.z;
  38607. return this.x = n * e.z - r * e.y,
  38608. this.y = r * e.x - i * e.z,
  38609. this.z = i * e.y - n * e.x,
  38610. this
  38611. },
  38612. crossVectors: function(e, t) {
  38613. var i = e.x
  38614. , n = e.y
  38615. , r = e.z
  38616. , o = t.x
  38617. , a = t.y
  38618. , s = t.z;
  38619. return this.x = n * s - r * a,
  38620. this.y = r * o - i * s,
  38621. this.z = i * a - n * o,
  38622. this
  38623. },
  38624. projectOnVector: function(e) {
  38625. return void 0 === xe && (xe = new Ci.Vector3),
  38626. xe.copy(e).normalize(),
  38627. Se = this.dot(xe),
  38628. this.copy(xe).multiplyScalar(Se)
  38629. },
  38630. projectOnPlane: function(e) {
  38631. return void 0 === Te && (Te = new Ci.Vector3),
  38632. Te.copy(this).projectOnVector(e),
  38633. this.sub(Te)
  38634. },
  38635. reflect: function(e) {
  38636. return void 0 === we && (we = new Ci.Vector3),
  38637. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38638. },
  38639. angleTo: function(e) {
  38640. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38641. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38642. },
  38643. distanceTo: function(e) {
  38644. return Math.sqrt(this.distanceToSquared(e))
  38645. },
  38646. distanceToSquared: function(e) {
  38647. var t = this.x - e.x
  38648. , i = this.y - e.y
  38649. , n = this.z - e.z;
  38650. return t * t + i * i + n * n
  38651. },
  38652. setFromSpherical: function(e) {
  38653. var t = Math.sin(e.phi) * e.radius;
  38654. return this.x = t * Math.sin(e.theta),
  38655. this.y = Math.cos(e.phi) * e.radius,
  38656. this.z = t * Math.cos(e.theta),
  38657. this
  38658. },
  38659. setFromMatrixPosition: function(e) {
  38660. return this.setFromMatrixColumn(e, 3)
  38661. },
  38662. setFromMatrixScale: function(e) {
  38663. var t = this.setFromMatrixColumn(e, 0).length()
  38664. , i = this.setFromMatrixColumn(e, 1).length()
  38665. , n = this.setFromMatrixColumn(e, 2).length();
  38666. return this.x = t,
  38667. this.y = i,
  38668. this.z = n,
  38669. this
  38670. },
  38671. setFromMatrixColumn: function(e, t) {
  38672. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38673. t = e = t),
  38674. this.fromArray(e.elements, 4 * t)
  38675. },
  38676. equals: function(e) {
  38677. return e.x === this.x && e.y === this.y && e.z === this.z
  38678. },
  38679. fromArray: function(e, t) {
  38680. return void 0 === t && (t = 0),
  38681. this.x = e[t],
  38682. this.y = e[t + 1],
  38683. this.z = e[t + 2],
  38684. this
  38685. },
  38686. toArray: function(e, t) {
  38687. return void 0 === e && (e = []),
  38688. void 0 === t && (t = 0),
  38689. e[t] = this.x,
  38690. e[t + 1] = this.y,
  38691. e[t + 2] = this.z,
  38692. e
  38693. },
  38694. fromAttribute: function(e, t, i) {
  38695. return void 0 === i && (i = 0),
  38696. t = t * e.itemSize + i,
  38697. this.x = e.array[t],
  38698. this.y = e.array[t + 1],
  38699. this.z = e.array[t + 2],
  38700. this
  38701. }
  38702. },
  38703. Ci.Vector4 = function(e, t, i, n) {
  38704. this.x = e || 0,
  38705. this.y = t || 0,
  38706. this.z = i || 0,
  38707. this.w = void 0 !== n ? n : 1
  38708. }
  38709. ,
  38710. Ci.Vector4.prototype = {
  38711. constructor: Ci.Vector4,
  38712. set: function(e, t, i, n) {
  38713. return this.x = e,
  38714. this.y = t,
  38715. this.z = i,
  38716. this.w = n,
  38717. this
  38718. },
  38719. setScalar: function(e) {
  38720. return this.x = e,
  38721. this.y = e,
  38722. this.z = e,
  38723. this.w = e,
  38724. this
  38725. },
  38726. setX: function(e) {
  38727. return this.x = e,
  38728. this
  38729. },
  38730. setY: function(e) {
  38731. return this.y = e,
  38732. this
  38733. },
  38734. setZ: function(e) {
  38735. return this.z = e,
  38736. this
  38737. },
  38738. setW: function(e) {
  38739. return this.w = e,
  38740. this
  38741. },
  38742. setComponent: function(e, t) {
  38743. switch (e) {
  38744. case 0:
  38745. this.x = t;
  38746. break;
  38747. case 1:
  38748. this.y = t;
  38749. break;
  38750. case 2:
  38751. this.z = t;
  38752. break;
  38753. case 3:
  38754. this.w = t;
  38755. break;
  38756. default:
  38757. throw new Error("index is out of range: " + e)
  38758. }
  38759. },
  38760. getComponent: function(e) {
  38761. switch (e) {
  38762. case 0:
  38763. return this.x;
  38764. case 1:
  38765. return this.y;
  38766. case 2:
  38767. return this.z;
  38768. case 3:
  38769. return this.w;
  38770. default:
  38771. throw new Error("index is out of range: " + e)
  38772. }
  38773. },
  38774. clone: function() {
  38775. return new this.constructor(this.x,this.y,this.z,this.w)
  38776. },
  38777. copy: function(e) {
  38778. return this.x = e.x,
  38779. this.y = e.y,
  38780. this.z = e.z,
  38781. this.w = void 0 !== e.w ? e.w : 1,
  38782. this
  38783. },
  38784. add: function(e, t) {
  38785. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38786. this.addVectors(e, t)) : (this.x += e.x,
  38787. this.y += e.y,
  38788. this.z += e.z,
  38789. this.w += e.w,
  38790. this)
  38791. },
  38792. addScalar: function(e) {
  38793. return this.x += e,
  38794. this.y += e,
  38795. this.z += e,
  38796. this.w += e,
  38797. this
  38798. },
  38799. addVectors: function(e, t) {
  38800. return this.x = e.x + t.x,
  38801. this.y = e.y + t.y,
  38802. this.z = e.z + t.z,
  38803. this.w = e.w + t.w,
  38804. this
  38805. },
  38806. addScaledVector: function(e, t) {
  38807. return this.x += e.x * t,
  38808. this.y += e.y * t,
  38809. this.z += e.z * t,
  38810. this.w += e.w * t,
  38811. this
  38812. },
  38813. sub: function(e, t) {
  38814. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38815. this.subVectors(e, t)) : (this.x -= e.x,
  38816. this.y -= e.y,
  38817. this.z -= e.z,
  38818. this.w -= e.w,
  38819. this)
  38820. },
  38821. subScalar: function(e) {
  38822. return this.x -= e,
  38823. this.y -= e,
  38824. this.z -= e,
  38825. this.w -= e,
  38826. this
  38827. },
  38828. subVectors: function(e, t) {
  38829. return this.x = e.x - t.x,
  38830. this.y = e.y - t.y,
  38831. this.z = e.z - t.z,
  38832. this.w = e.w - t.w,
  38833. this
  38834. },
  38835. multiplyScalar: function(e) {
  38836. return isFinite(e) ? (this.x *= e,
  38837. this.y *= e,
  38838. this.z *= e,
  38839. this.w *= e) : (this.x = 0,
  38840. this.y = 0,
  38841. this.z = 0,
  38842. this.w = 0),
  38843. this
  38844. },
  38845. applyMatrix4: function(e) {
  38846. var t = this.x
  38847. , i = this.y
  38848. , n = this.z
  38849. , r = this.w
  38850. , o = e.elements;
  38851. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38852. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38853. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38854. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38855. this
  38856. },
  38857. divideScalar: function(e) {
  38858. return this.multiplyScalar(1 / e)
  38859. },
  38860. setAxisAngleFromQuaternion: function(e) {
  38861. this.w = 2 * Math.acos(e.w);
  38862. var t = Math.sqrt(1 - e.w * e.w);
  38863. return t < 1e-4 ? (this.x = 1,
  38864. this.y = 0,
  38865. this.z = 0) : (this.x = e.x / t,
  38866. this.y = e.y / t,
  38867. this.z = e.z / t),
  38868. this
  38869. },
  38870. setAxisAngleFromRotationMatrix: function(e) {
  38871. 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];
  38872. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38873. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38874. return this.set(1, 0, 0, 0),
  38875. this;
  38876. t = Math.PI;
  38877. var g = (a + 1) / 2
  38878. , m = (h + 1) / 2
  38879. , v = (f + 1) / 2
  38880. , y = (s + c) / 4
  38881. , A = (l + d) / 4
  38882. , C = (u + p) / 4;
  38883. return m < g && v < g ? r = g < .01 ? (i = 0,
  38884. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38885. A / i) : v < m ? r = m < .01 ? (n = 0,
  38886. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38887. C / n) : v < .01 ? (n = i = .707106781,
  38888. r = 0) : (i = A / (r = Math.sqrt(v)),
  38889. n = C / r),
  38890. this.set(i, n, r, t),
  38891. this
  38892. }
  38893. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38894. return Math.abs(I) < .001 && (I = 1),
  38895. this.x = (p - u) / I,
  38896. this.y = (l - d) / I,
  38897. this.z = (c - s) / I,
  38898. this.w = Math.acos((a + h + f - 1) / 2),
  38899. this
  38900. },
  38901. min: function(e) {
  38902. return this.x = Math.min(this.x, e.x),
  38903. this.y = Math.min(this.y, e.y),
  38904. this.z = Math.min(this.z, e.z),
  38905. this.w = Math.min(this.w, e.w),
  38906. this
  38907. },
  38908. max: function(e) {
  38909. return this.x = Math.max(this.x, e.x),
  38910. this.y = Math.max(this.y, e.y),
  38911. this.z = Math.max(this.z, e.z),
  38912. this.w = Math.max(this.w, e.w),
  38913. this
  38914. },
  38915. clamp: function(e, t) {
  38916. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38917. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38918. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38919. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38920. this
  38921. },
  38922. clampScalar: function(e, t) {
  38923. return void 0 === _e && (_e = new Ci.Vector4,
  38924. be = new Ci.Vector4),
  38925. _e.set(e, e, e, e),
  38926. be.set(t, t, t, t),
  38927. this.clamp(_e, be)
  38928. },
  38929. floor: function() {
  38930. return this.x = Math.floor(this.x),
  38931. this.y = Math.floor(this.y),
  38932. this.z = Math.floor(this.z),
  38933. this.w = Math.floor(this.w),
  38934. this
  38935. },
  38936. ceil: function() {
  38937. return this.x = Math.ceil(this.x),
  38938. this.y = Math.ceil(this.y),
  38939. this.z = Math.ceil(this.z),
  38940. this.w = Math.ceil(this.w),
  38941. this
  38942. },
  38943. round: function() {
  38944. return this.x = Math.round(this.x),
  38945. this.y = Math.round(this.y),
  38946. this.z = Math.round(this.z),
  38947. this.w = Math.round(this.w),
  38948. this
  38949. },
  38950. roundToZero: function() {
  38951. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38952. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38953. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38954. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38955. this
  38956. },
  38957. negate: function() {
  38958. return this.x = -this.x,
  38959. this.y = -this.y,
  38960. this.z = -this.z,
  38961. this.w = -this.w,
  38962. this
  38963. },
  38964. dot: function(e) {
  38965. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38966. },
  38967. lengthSq: function() {
  38968. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38969. },
  38970. length: function() {
  38971. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38972. },
  38973. lengthManhattan: function() {
  38974. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38975. },
  38976. normalize: function() {
  38977. return this.divideScalar(this.length())
  38978. },
  38979. setLength: function(e) {
  38980. return this.multiplyScalar(e / this.length())
  38981. },
  38982. lerp: function(e, t) {
  38983. return this.x += (e.x - this.x) * t,
  38984. this.y += (e.y - this.y) * t,
  38985. this.z += (e.z - this.z) * t,
  38986. this.w += (e.w - this.w) * t,
  38987. this
  38988. },
  38989. lerpVectors: function(e, t, i) {
  38990. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38991. this
  38992. },
  38993. equals: function(e) {
  38994. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38995. },
  38996. fromArray: function(e, t) {
  38997. return void 0 === t && (t = 0),
  38998. this.x = e[t],
  38999. this.y = e[t + 1],
  39000. this.z = e[t + 2],
  39001. this.w = e[t + 3],
  39002. this
  39003. },
  39004. toArray: function(e, t) {
  39005. return void 0 === e && (e = []),
  39006. void 0 === t && (t = 0),
  39007. e[t] = this.x,
  39008. e[t + 1] = this.y,
  39009. e[t + 2] = this.z,
  39010. e[t + 3] = this.w,
  39011. e
  39012. },
  39013. fromAttribute: function(e, t, i) {
  39014. return void 0 === i && (i = 0),
  39015. t = t * e.itemSize + i,
  39016. this.x = e.array[t],
  39017. this.y = e.array[t + 1],
  39018. this.z = e.array[t + 2],
  39019. this.w = e.array[t + 3],
  39020. this
  39021. }
  39022. },
  39023. Ci.Euler = function(e, t, i, n) {
  39024. this._x = e || 0,
  39025. this._y = t || 0,
  39026. this._z = i || 0,
  39027. this._order = n || Ci.Euler.DefaultOrder
  39028. }
  39029. ,
  39030. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39031. Ci.Euler.DefaultOrder = "XYZ",
  39032. Ci.Euler.prototype = {
  39033. constructor: Ci.Euler,
  39034. get x() {
  39035. return this._x
  39036. },
  39037. set x(e) {
  39038. this._x = e,
  39039. this.onChangeCallback()
  39040. },
  39041. get y() {
  39042. return this._y
  39043. },
  39044. set y(e) {
  39045. this._y = e,
  39046. this.onChangeCallback()
  39047. },
  39048. get z() {
  39049. return this._z
  39050. },
  39051. set z(e) {
  39052. this._z = e,
  39053. this.onChangeCallback()
  39054. },
  39055. get order() {
  39056. return this._order
  39057. },
  39058. set order(e) {
  39059. this._order = e,
  39060. this.onChangeCallback()
  39061. },
  39062. set: function(e, t, i, n) {
  39063. return this._x = e,
  39064. this._y = t,
  39065. this._z = i,
  39066. this._order = n || this._order,
  39067. this.onChangeCallback(),
  39068. this
  39069. },
  39070. clone: function() {
  39071. return new this.constructor(this._x,this._y,this._z,this._order)
  39072. },
  39073. copy: function(e) {
  39074. return this._x = e._x,
  39075. this._y = e._y,
  39076. this._z = e._z,
  39077. this._order = e._order,
  39078. this.onChangeCallback(),
  39079. this
  39080. },
  39081. toObject: function() {//xzw
  39082. return {x:this.x,y:this.y,z:this.z}
  39083. },
  39084. setFromRotationMatrix: function(e, t, i) {
  39085. var n = Ci.Math.clamp
  39086. , r = e.elements
  39087. , o = r[0]
  39088. , a = r[4]
  39089. , s = r[8]
  39090. , l = r[1]
  39091. , c = r[5]
  39092. , h = r[9]
  39093. , u = r[2]
  39094. , d = r[6]
  39095. , p = r[10];
  39096. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39097. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39098. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39099. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39100. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39101. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39102. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39103. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39104. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39105. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39106. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39107. this._z = Math.atan2(l, o)) : (this._x = 0,
  39108. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39109. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39110. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39111. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39112. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39113. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39114. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39115. this._order = t,
  39116. !1 !== i && this.onChangeCallback(),
  39117. this
  39118. },
  39119. setFromQuaternion: function(e, t, i) {
  39120. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39121. Ee.makeRotationFromQuaternion(e),
  39122. this.setFromRotationMatrix(Ee, t, i),
  39123. this
  39124. },
  39125. setFromVector3: function(e, t) {
  39126. return this.set(e.x, e.y, e.z, t || this._order)
  39127. },
  39128. reorder: (Ie = new Ci.Quaternion,
  39129. function(e) {
  39130. Ie.setFromEuler(this),
  39131. this.setFromQuaternion(Ie, e)
  39132. }
  39133. ),
  39134. equals: function(e) {
  39135. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39136. },
  39137. fromArray: function(e) {
  39138. return this._x = e[0],
  39139. this._y = e[1],
  39140. this._z = e[2],
  39141. void 0 !== e[3] && (this._order = e[3]),
  39142. this.onChangeCallback(),
  39143. this
  39144. },
  39145. toArray: function(e, t) {
  39146. return void 0 === e && (e = []),
  39147. void 0 === t && (t = 0),
  39148. e[t] = this._x,
  39149. e[t + 1] = this._y,
  39150. e[t + 2] = this._z,
  39151. e[t + 3] = this._order,
  39152. e
  39153. },
  39154. toVector3: function(e) {
  39155. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39156. },
  39157. onChange: function(e) {
  39158. return this.onChangeCallback = e,
  39159. this
  39160. },
  39161. onChangeCallback: function() {}
  39162. },
  39163. Ci.Line3 = function(e, t) {
  39164. this.start = void 0 !== e ? e : new Ci.Vector3,
  39165. this.end = void 0 !== t ? t : new Ci.Vector3
  39166. }
  39167. ,
  39168. Ci.Line3.prototype = {
  39169. constructor: Ci.Line3,
  39170. set: function(e, t) {
  39171. return this.start.copy(e),
  39172. this.end.copy(t),
  39173. this
  39174. },
  39175. clone: function() {
  39176. return (new this.constructor).copy(this)
  39177. },
  39178. copy: function(e) {
  39179. return this.start.copy(e.start),
  39180. this.end.copy(e.end),
  39181. this
  39182. },
  39183. center: function(e) {
  39184. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39185. },
  39186. delta: function(e) {
  39187. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39188. },
  39189. distanceSq: function() {
  39190. return this.start.distanceToSquared(this.end)
  39191. },
  39192. distance: function() {
  39193. return this.start.distanceTo(this.end)
  39194. },
  39195. at: function(e, t) {
  39196. var i = t || new Ci.Vector3;
  39197. return this.delta(i).multiplyScalar(e).add(this.start)
  39198. },
  39199. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39200. Ce = new Ci.Vector3,
  39201. function(e, t) {
  39202. Ae.subVectors(e, this.start),
  39203. Ce.subVectors(this.end, this.start);
  39204. var i = Ce.dot(Ce)
  39205. , n = Ce.dot(Ae) / i;
  39206. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39207. n
  39208. }
  39209. ),
  39210. closestPointToPoint: function(e, t, i) {
  39211. var n = this.closestPointToPointParameter(e, t)
  39212. , r = i || new Ci.Vector3;
  39213. return this.delta(r).multiplyScalar(n).add(this.start)
  39214. },
  39215. applyMatrix4: function(e) {
  39216. return this.start.applyMatrix4(e),
  39217. this.end.applyMatrix4(e),
  39218. this
  39219. },
  39220. equals: function(e) {
  39221. return e.start.equals(this.start) && e.end.equals(this.end)
  39222. }
  39223. },
  39224. Ci.Box2 = function(e, t) {
  39225. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39226. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39227. }
  39228. ,
  39229. Ci.Box2.prototype = {
  39230. constructor: Ci.Box2,
  39231. set: function(e, t) {
  39232. return this.min.copy(e),
  39233. this.max.copy(t),
  39234. this
  39235. },
  39236. setFromPoints: function(e) {
  39237. this.makeEmpty();
  39238. for (var t = 0, i = e.length; t < i; t++)
  39239. this.expandByPoint(e[t]);
  39240. return this
  39241. },
  39242. setFromCenterAndSize: (ye = new Ci.Vector2,
  39243. function(e, t) {
  39244. var i = ye.copy(t).multiplyScalar(.5);
  39245. return this.min.copy(e).sub(i),
  39246. this.max.copy(e).add(i),
  39247. this
  39248. }
  39249. ),
  39250. clone: function() {
  39251. return (new this.constructor).copy(this)
  39252. },
  39253. copy: function(e) {
  39254. return this.min.copy(e.min),
  39255. this.max.copy(e.max),
  39256. this
  39257. },
  39258. makeEmpty: function() {
  39259. return this.min.x = this.min.y = 1 / 0,
  39260. this.max.x = this.max.y = -1 / 0,
  39261. this
  39262. },
  39263. isEmpty: function() {
  39264. return this.max.x < this.min.x || this.max.y < this.min.y
  39265. },
  39266. center: function(e) {
  39267. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39268. },
  39269. size: function(e) {
  39270. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39271. },
  39272. expandByPoint: function(e) {
  39273. return this.min.min(e),
  39274. this.max.max(e),
  39275. this
  39276. },
  39277. expandByVector: function(e) {
  39278. return this.min.sub(e),
  39279. this.max.add(e),
  39280. this
  39281. },
  39282. expandByScalar: function(e) {
  39283. return this.min.addScalar(-e),
  39284. this.max.addScalar(e),
  39285. this
  39286. },
  39287. containsPoint: function(e) {
  39288. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39289. },
  39290. containsBox: function(e) {
  39291. 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
  39292. },
  39293. getParameter: function(e, t) {
  39294. 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))
  39295. },
  39296. intersectsBox: function(e) {
  39297. 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)
  39298. },
  39299. clampPoint: function(e, t) {
  39300. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39301. },
  39302. distanceToPoint: (ve = new Ci.Vector2,
  39303. function(e) {
  39304. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39305. }
  39306. ),
  39307. intersect: function(e) {
  39308. return this.min.max(e.min),
  39309. this.max.min(e.max),
  39310. this
  39311. },
  39312. union: function(e) {
  39313. return this.min.min(e.min),
  39314. this.max.max(e.max),
  39315. this
  39316. },
  39317. translate: function(e) {
  39318. return this.min.add(e),
  39319. this.max.add(e),
  39320. this
  39321. },
  39322. equals: function(e) {
  39323. return e.min.equals(this.min) && e.max.equals(this.max)
  39324. }
  39325. },
  39326. Ci.Box3 = function(e, t) {
  39327. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39328. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39329. }
  39330. ,
  39331. Ci.Box3.prototype = {
  39332. constructor: Ci.Box3,
  39333. set: function(e, t) {
  39334. return this.min.copy(e),
  39335. this.max.copy(t),
  39336. this
  39337. },
  39338. setFromArray: function(e) {
  39339. this.makeEmpty();
  39340. 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) {
  39341. var c = e[s]
  39342. , h = e[s + 1]
  39343. , u = e[s + 2];
  39344. c < t && (t = c),
  39345. h < i && (i = h),
  39346. u < n && (n = u),
  39347. r < c && (r = c),
  39348. o < h && (o = h),
  39349. a < u && (a = u)
  39350. }
  39351. this.min.set(t, i, n),
  39352. this.max.set(r, o, a)
  39353. },
  39354. setFromPoints: function(e) {
  39355. this.makeEmpty();
  39356. for (var t = 0, i = e.length; t < i; t++)
  39357. this.expandByPoint(e[t]);
  39358. return this
  39359. },
  39360. setFromCenterAndSize: (me = new Ci.Vector3,
  39361. function(e, t) {
  39362. var i = me.copy(t).multiplyScalar(.5);
  39363. return this.min.copy(e).sub(i),
  39364. this.max.copy(e).add(i),
  39365. this
  39366. }
  39367. ),
  39368. setFromObject: function(e) {
  39369. void 0 === ge && (ge = new Ci.Box3);
  39370. var i = this;
  39371. return this.makeEmpty(),
  39372. e.updateMatrixWorld(!0),
  39373. e.traverse(function(e) {
  39374. var t = e.geometry;
  39375. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39376. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39377. ge.applyMatrix4(e.matrixWorld),
  39378. i.union(ge)))
  39379. }),
  39380. this
  39381. },
  39382. clone: function() {
  39383. return (new this.constructor).copy(this)
  39384. },
  39385. copy: function(e) {
  39386. return this.min.copy(e.min),
  39387. this.max.copy(e.max),
  39388. this
  39389. },
  39390. makeEmpty: function() {
  39391. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39392. this.max.x = this.max.y = this.max.z = -1 / 0,
  39393. this
  39394. },
  39395. isEmpty: function() {
  39396. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39397. },
  39398. center: function(e) {
  39399. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39400. },
  39401. size: function(e) {
  39402. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39403. },
  39404. expandByPoint: function(e) {
  39405. return this.min.min(e),
  39406. this.max.max(e),
  39407. this
  39408. },
  39409. expandByVector: function(e) {
  39410. return this.min.sub(e),
  39411. this.max.add(e),
  39412. this
  39413. },
  39414. expandByScalar: function(e) {
  39415. return this.min.addScalar(-e),
  39416. this.max.addScalar(e),
  39417. this
  39418. },
  39419. containsPoint: function(e) {
  39420. 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)
  39421. },
  39422. containsBox: function(e) {
  39423. 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
  39424. },
  39425. getParameter: function(e, t) {
  39426. 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))
  39427. },
  39428. intersectsBox: function(e) {
  39429. 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)
  39430. },
  39431. intersectsSphere: function(e) {
  39432. return void 0 === fe && (fe = new Ci.Vector3),
  39433. this.clampPoint(e.center, fe),
  39434. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39435. },
  39436. intersectsPlane: function(e) {
  39437. var t, i;
  39438. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39439. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39440. e.normal.x * this.min.x),
  39441. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39442. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39443. i += e.normal.y * this.min.y),
  39444. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39445. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39446. i += e.normal.z * this.min.z),
  39447. t <= e.constant && i >= e.constant
  39448. },
  39449. clampPoint: function(e, t) {
  39450. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39451. },
  39452. distanceToPoint: (pe = new Ci.Vector3,
  39453. function(e) {
  39454. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39455. }
  39456. ),
  39457. getBoundingSphere: (de = new Ci.Vector3,
  39458. function(e) {
  39459. var t = e || new Ci.Sphere;
  39460. return t.center = this.center(),
  39461. t.radius = .5 * this.size(de).length(),
  39462. t
  39463. }
  39464. ),
  39465. intersect: function(e) {
  39466. return this.min.max(e.min),
  39467. this.max.min(e.max),
  39468. this
  39469. },
  39470. union: function(e) {
  39471. return this.min.min(e.min),
  39472. this.max.max(e.max),
  39473. this
  39474. },
  39475. 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],
  39476. function(e) {
  39477. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39478. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39479. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39480. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39481. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39482. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39483. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39484. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39485. this.makeEmpty(),
  39486. this.setFromPoints(ue),
  39487. this
  39488. }
  39489. ),
  39490. translate: function(e) {
  39491. return this.min.add(e),
  39492. this.max.add(e),
  39493. this
  39494. },
  39495. equals: function(e) {
  39496. return e.min.equals(this.min) && e.max.equals(this.max)
  39497. }
  39498. },
  39499. Ci.Matrix3 = function() {
  39500. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39501. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39502. }
  39503. ,
  39504. Ci.Matrix3.prototype = {
  39505. constructor: Ci.Matrix3,
  39506. set: function(e, t, i, n, r, o, a, s, l) {
  39507. var c = this.elements;
  39508. return c[0] = e,
  39509. c[1] = n,
  39510. c[2] = a,
  39511. c[3] = t,
  39512. c[4] = r,
  39513. c[5] = s,
  39514. c[6] = i,
  39515. c[7] = o,
  39516. c[8] = l,
  39517. this
  39518. },
  39519. identity: function() {
  39520. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39521. this
  39522. },
  39523. clone: function() {
  39524. return (new this.constructor).fromArray(this.elements)
  39525. },
  39526. copy: function(e) {
  39527. var t = e.elements;
  39528. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39529. this
  39530. },
  39531. setFromMatrix4: function(e) {
  39532. var t = e.elements;
  39533. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39534. this
  39535. },
  39536. applyToVector3Array: function(e, t, i) {
  39537. void 0 === he && (he = new Ci.Vector3),
  39538. void 0 === t && (t = 0),
  39539. void 0 === i && (i = e.length);
  39540. for (var n = 0, r = t; n < i; n += 3,
  39541. r += 3)
  39542. he.fromArray(e, r),
  39543. he.applyMatrix3(this),
  39544. he.toArray(e, r);
  39545. return e
  39546. },
  39547. applyToBuffer: function(e, t, i) {
  39548. void 0 === ce && (ce = new Ci.Vector3),
  39549. void 0 === t && (t = 0),
  39550. void 0 === i && (i = e.length / e.itemSize);
  39551. for (var n = 0, r = t; n < i; n++,
  39552. r++)
  39553. ce.x = e.getX(r),
  39554. ce.y = e.getY(r),
  39555. ce.z = e.getZ(r),
  39556. ce.applyMatrix3(this),
  39557. e.setXYZ(ce.x, ce.y, ce.z);
  39558. return e
  39559. },
  39560. multiplyScalar: function(e) {
  39561. var t = this.elements;
  39562. return t[0] *= e,
  39563. t[3] *= e,
  39564. t[6] *= e,
  39565. t[1] *= e,
  39566. t[4] *= e,
  39567. t[7] *= e,
  39568. t[2] *= e,
  39569. t[5] *= e,
  39570. t[8] *= e,
  39571. this
  39572. },
  39573. determinant: function() {
  39574. var e = this.elements
  39575. , t = e[0]
  39576. , i = e[1]
  39577. , n = e[2]
  39578. , r = e[3]
  39579. , o = e[4]
  39580. , a = e[5]
  39581. , s = e[6]
  39582. , l = e[7]
  39583. , c = e[8];
  39584. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39585. },
  39586. getInverse: function(e, t) {
  39587. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39588. var i = e.elements
  39589. , n = this.elements
  39590. , r = i[0]
  39591. , o = i[1]
  39592. , a = i[2]
  39593. , s = i[3]
  39594. , l = i[4]
  39595. , c = i[5]
  39596. , h = i[6]
  39597. , u = i[7]
  39598. , d = i[8]
  39599. , p = d * l - c * u
  39600. , f = c * h - d * s
  39601. , g = u * s - l * h
  39602. , m = r * p + o * f + a * g;
  39603. if (0 != m)
  39604. return n[0] = p,
  39605. n[1] = a * u - d * o,
  39606. n[2] = c * o - a * l,
  39607. n[3] = f,
  39608. n[4] = d * r - a * h,
  39609. n[5] = a * s - c * r,
  39610. n[6] = g,
  39611. n[7] = o * h - u * r,
  39612. n[8] = l * r - o * s,
  39613. this.multiplyScalar(1 / m);
  39614. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39615. if (t)
  39616. throw new Error(v);
  39617. return console.warn(v),
  39618. this.identity()
  39619. },
  39620. transpose: function() {
  39621. var e, t = this.elements;
  39622. return e = t[1],
  39623. t[1] = t[3],
  39624. t[3] = e,
  39625. e = t[2],
  39626. t[2] = t[6],
  39627. t[6] = e,
  39628. e = t[5],
  39629. t[5] = t[7],
  39630. t[7] = e,
  39631. this
  39632. },
  39633. flattenToArrayOffset: function(e, t) {
  39634. var i = this.elements;
  39635. return e[t] = i[0],
  39636. e[t + 1] = i[1],
  39637. e[t + 2] = i[2],
  39638. e[t + 3] = i[3],
  39639. e[t + 4] = i[4],
  39640. e[t + 5] = i[5],
  39641. e[t + 6] = i[6],
  39642. e[t + 7] = i[7],
  39643. e[t + 8] = i[8],
  39644. e
  39645. },
  39646. getNormalMatrix: function(e) {
  39647. return this.setFromMatrix4(e).getInverse(this).transpose()
  39648. },
  39649. transposeIntoArray: function(e) {
  39650. var t = this.elements;
  39651. return e[0] = t[0],
  39652. e[1] = t[3],
  39653. e[2] = t[6],
  39654. e[3] = t[1],
  39655. e[4] = t[4],
  39656. e[5] = t[7],
  39657. e[6] = t[2],
  39658. e[7] = t[5],
  39659. e[8] = t[8],
  39660. this
  39661. },
  39662. fromArray: function(e) {
  39663. return this.elements.set(e),
  39664. this
  39665. },
  39666. toArray: function() {
  39667. var e = this.elements;
  39668. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39669. }
  39670. },
  39671. Ci.Matrix4 = function() {
  39672. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39673. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39674. }
  39675. ,
  39676. Ci.Matrix4.prototype = {
  39677. constructor: Ci.Matrix4,
  39678. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39679. var m = this.elements;
  39680. return m[0] = e,
  39681. m[4] = t,
  39682. m[8] = i,
  39683. m[12] = n,
  39684. m[1] = r,
  39685. m[5] = o,
  39686. m[9] = a,
  39687. m[13] = s,
  39688. m[2] = l,
  39689. m[6] = c,
  39690. m[10] = h,
  39691. m[14] = u,
  39692. m[3] = d,
  39693. m[7] = p,
  39694. m[11] = f,
  39695. m[15] = g,
  39696. this
  39697. },
  39698. identity: function() {
  39699. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39700. this
  39701. },
  39702. clone: function() {
  39703. return (new Ci.Matrix4).fromArray(this.elements)
  39704. },
  39705. copy: function(e) {
  39706. return this.elements.set(e.elements),
  39707. this
  39708. },
  39709. copyPosition: function(e) {
  39710. var t = this.elements
  39711. , i = e.elements;
  39712. return t[12] = i[12],
  39713. t[13] = i[13],
  39714. t[14] = i[14],
  39715. this
  39716. },
  39717. extractBasis: function(e, t, i) {
  39718. return e.setFromMatrixColumn(this, 0),
  39719. t.setFromMatrixColumn(this, 1),
  39720. i.setFromMatrixColumn(this, 2),
  39721. this
  39722. },
  39723. makeBasis: function(e, t, i) {
  39724. 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),
  39725. this
  39726. },
  39727. extractRotation: function(e) {
  39728. void 0 === le && (le = new Ci.Vector3);
  39729. var t = this.elements
  39730. , i = e.elements
  39731. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39732. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39733. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39734. return t[0] = i[0] * n,
  39735. t[1] = i[1] * n,
  39736. t[2] = i[2] * n,
  39737. t[4] = i[4] * r,
  39738. t[5] = i[5] * r,
  39739. t[6] = i[6] * r,
  39740. t[8] = i[8] * o,
  39741. t[9] = i[9] * o,
  39742. t[10] = i[10] * o,
  39743. this
  39744. },
  39745. makeRotationFromEuler: function(e) {
  39746. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39747. var t = this.elements
  39748. , i = e.x
  39749. , n = e.y
  39750. , r = e.z
  39751. , o = Math.cos(i)
  39752. , a = Math.sin(i)
  39753. , s = Math.cos(n)
  39754. , l = Math.sin(n)
  39755. , c = Math.cos(r)
  39756. , h = Math.sin(r);
  39757. if ("XYZ" === e.order) {
  39758. var u = o * c
  39759. , d = o * h
  39760. , p = a * c
  39761. , f = a * h;
  39762. t[0] = s * c,
  39763. t[4] = -s * h,
  39764. t[8] = l,
  39765. t[1] = d + p * l,
  39766. t[5] = u - f * l,
  39767. t[9] = -a * s,
  39768. t[2] = f - u * l,
  39769. t[6] = p + d * l,
  39770. t[10] = o * s
  39771. } else if ("YXZ" === e.order) {
  39772. var g = s * c
  39773. , m = s * h
  39774. , v = l * c
  39775. , y = l * h;
  39776. t[0] = g + y * a,
  39777. t[4] = v * a - m,
  39778. t[8] = o * l,
  39779. t[1] = o * h,
  39780. t[5] = o * c,
  39781. t[9] = -a,
  39782. t[2] = m * a - v,
  39783. t[6] = y + g * a,
  39784. t[10] = o * s
  39785. } else if ("ZXY" === e.order) {
  39786. g = s * c,
  39787. m = s * h,
  39788. v = l * c,
  39789. y = l * h;
  39790. t[0] = g - y * a,
  39791. t[4] = -o * h,
  39792. t[8] = v + m * a,
  39793. t[1] = m + v * a,
  39794. t[5] = o * c,
  39795. t[9] = y - g * a,
  39796. t[2] = -o * l,
  39797. t[6] = a,
  39798. t[10] = o * s
  39799. } else if ("ZYX" === e.order) {
  39800. u = o * c,
  39801. d = o * h,
  39802. p = a * c,
  39803. f = a * h;
  39804. t[0] = s * c,
  39805. t[4] = p * l - d,
  39806. t[8] = u * l + f,
  39807. t[1] = s * h,
  39808. t[5] = f * l + u,
  39809. t[9] = d * l - p,
  39810. t[2] = -l,
  39811. t[6] = a * s,
  39812. t[10] = o * s
  39813. } else if ("YZX" === e.order) {
  39814. var A = o * s
  39815. , C = o * l
  39816. , I = a * s
  39817. , E = a * l;
  39818. t[0] = s * c,
  39819. t[4] = E - A * h,
  39820. t[8] = I * h + C,
  39821. t[1] = h,
  39822. t[5] = o * c,
  39823. t[9] = -a * c,
  39824. t[2] = -l * c,
  39825. t[6] = C * h + I,
  39826. t[10] = A - E * h
  39827. } else if ("XZY" === e.order) {
  39828. A = o * s,
  39829. C = o * l,
  39830. I = a * s,
  39831. E = a * l;
  39832. t[0] = s * c,
  39833. t[4] = -h,
  39834. t[8] = l * c,
  39835. t[1] = A * h + E,
  39836. t[5] = o * c,
  39837. t[9] = C * h - I,
  39838. t[2] = I * h - C,
  39839. t[6] = a * c,
  39840. t[10] = E * h + A
  39841. }
  39842. return t[3] = 0,
  39843. t[7] = 0,
  39844. t[11] = 0,
  39845. t[12] = 0,
  39846. t[13] = 0,
  39847. t[14] = 0,
  39848. t[15] = 1,
  39849. this
  39850. },
  39851. makeRotationFromQuaternion: function(e) {
  39852. var t = this.elements
  39853. , i = e.x
  39854. , n = e.y
  39855. , r = e.z
  39856. , o = e.w
  39857. , a = i + i
  39858. , s = n + n
  39859. , l = r + r
  39860. , c = i * a
  39861. , h = i * s
  39862. , u = i * l
  39863. , d = n * s
  39864. , p = n * l
  39865. , f = r * l
  39866. , g = o * a
  39867. , m = o * s
  39868. , v = o * l;
  39869. return t[0] = 1 - (d + f),
  39870. t[4] = h - v,
  39871. t[8] = u + m,
  39872. t[1] = h + v,
  39873. t[5] = 1 - (c + f),
  39874. t[9] = p - g,
  39875. t[2] = u - m,
  39876. t[6] = p + g,
  39877. t[10] = 1 - (c + d),
  39878. t[3] = 0,
  39879. t[7] = 0,
  39880. t[11] = 0,
  39881. t[12] = 0,
  39882. t[13] = 0,
  39883. t[14] = 0,
  39884. t[15] = 1,
  39885. this
  39886. },
  39887. lookAt: function(e, t, i) {
  39888. void 0 === oe && (oe = new Ci.Vector3),
  39889. void 0 === ae && (ae = new Ci.Vector3),
  39890. void 0 === se && (se = new Ci.Vector3);
  39891. var n = this.elements;
  39892. return se.subVectors(e, t).normalize(),
  39893. 0 === se.lengthSq() && (se.z = 1),
  39894. oe.crossVectors(i, se).normalize(),
  39895. 0 === oe.lengthSq() && (se.x += 1e-4,
  39896. oe.crossVectors(i, se).normalize()),
  39897. ae.crossVectors(se, oe),
  39898. n[0] = oe.x,
  39899. n[4] = ae.x,
  39900. n[8] = se.x,
  39901. n[1] = oe.y,
  39902. n[5] = ae.y,
  39903. n[9] = se.y,
  39904. n[2] = oe.z,
  39905. n[6] = ae.z,
  39906. n[10] = se.z,
  39907. this
  39908. },
  39909. multiply: function(e, t) {
  39910. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39911. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39912. },
  39913. multiplyMatrices: function(e, t) {
  39914. var i = e.elements
  39915. , n = t.elements
  39916. , r = this.elements
  39917. , o = i[0]
  39918. , a = i[4]
  39919. , s = i[8]
  39920. , l = i[12]
  39921. , c = i[1]
  39922. , h = i[5]
  39923. , u = i[9]
  39924. , d = i[13]
  39925. , p = i[2]
  39926. , f = i[6]
  39927. , g = i[10]
  39928. , m = i[14]
  39929. , v = i[3]
  39930. , y = i[7]
  39931. , A = i[11]
  39932. , C = i[15]
  39933. , I = n[0]
  39934. , E = n[4]
  39935. , _ = n[8]
  39936. , b = n[12]
  39937. , w = n[1]
  39938. , T = n[5]
  39939. , x = n[9]
  39940. , S = n[13]
  39941. , M = n[2]
  39942. , R = n[6]
  39943. , P = n[10]
  39944. , O = n[14]
  39945. , L = n[3]
  39946. , D = n[7]
  39947. , N = n[11]
  39948. , F = n[15];
  39949. return r[0] = o * I + a * w + s * M + l * L,
  39950. r[4] = o * E + a * T + s * R + l * D,
  39951. r[8] = o * _ + a * x + s * P + l * N,
  39952. r[12] = o * b + a * S + s * O + l * F,
  39953. r[1] = c * I + h * w + u * M + d * L,
  39954. r[5] = c * E + h * T + u * R + d * D,
  39955. r[9] = c * _ + h * x + u * P + d * N,
  39956. r[13] = c * b + h * S + u * O + d * F,
  39957. r[2] = p * I + f * w + g * M + m * L,
  39958. r[6] = p * E + f * T + g * R + m * D,
  39959. r[10] = p * _ + f * x + g * P + m * N,
  39960. r[14] = p * b + f * S + g * O + m * F,
  39961. r[3] = v * I + y * w + A * M + C * L,
  39962. r[7] = v * E + y * T + A * R + C * D,
  39963. r[11] = v * _ + y * x + A * P + C * N,
  39964. r[15] = v * b + y * S + A * O + C * F,
  39965. this
  39966. },
  39967. multiplyToArray: function(e, t, i) {
  39968. var n = this.elements;
  39969. return this.multiplyMatrices(e, t),
  39970. i[0] = n[0],
  39971. i[1] = n[1],
  39972. i[2] = n[2],
  39973. i[3] = n[3],
  39974. i[4] = n[4],
  39975. i[5] = n[5],
  39976. i[6] = n[6],
  39977. i[7] = n[7],
  39978. i[8] = n[8],
  39979. i[9] = n[9],
  39980. i[10] = n[10],
  39981. i[11] = n[11],
  39982. i[12] = n[12],
  39983. i[13] = n[13],
  39984. i[14] = n[14],
  39985. i[15] = n[15],
  39986. this
  39987. },
  39988. multiplyScalar: function(e) {
  39989. var t = this.elements;
  39990. return t[0] *= e,
  39991. t[4] *= e,
  39992. t[8] *= e,
  39993. t[12] *= e,
  39994. t[1] *= e,
  39995. t[5] *= e,
  39996. t[9] *= e,
  39997. t[13] *= e,
  39998. t[2] *= e,
  39999. t[6] *= e,
  40000. t[10] *= e,
  40001. t[14] *= e,
  40002. t[3] *= e,
  40003. t[7] *= e,
  40004. t[11] *= e,
  40005. t[15] *= e,
  40006. this
  40007. },
  40008. applyToVector3Array: function(e, t, i) {
  40009. void 0 === re && (re = new Ci.Vector3),
  40010. void 0 === t && (t = 0),
  40011. void 0 === i && (i = e.length);
  40012. for (var n = 0, r = t; n < i; n += 3,
  40013. r += 3)
  40014. re.fromArray(e, r),
  40015. re.applyMatrix4(this),
  40016. re.toArray(e, r);
  40017. return e
  40018. },
  40019. applyToBuffer: function(e, t, i) {
  40020. void 0 === ne && (ne = new Ci.Vector3),
  40021. void 0 === t && (t = 0),
  40022. void 0 === i && (i = e.length / e.itemSize);
  40023. for (var n = 0, r = t; n < i; n++,
  40024. r++)
  40025. ne.x = e.getX(r),
  40026. ne.y = e.getY(r),
  40027. ne.z = e.getZ(r),
  40028. ne.applyMatrix4(this),
  40029. e.setXYZ(ne.x, ne.y, ne.z);
  40030. return e
  40031. },
  40032. determinant: function() {
  40033. var e = this.elements
  40034. , t = e[0]
  40035. , i = e[4]
  40036. , n = e[8]
  40037. , r = e[12]
  40038. , o = e[1]
  40039. , a = e[5]
  40040. , s = e[9]
  40041. , l = e[13]
  40042. , c = e[2]
  40043. , h = e[6]
  40044. , u = e[10]
  40045. , d = e[14];
  40046. 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)
  40047. },
  40048. transpose: function() {
  40049. var e, t = this.elements;
  40050. return e = t[1],
  40051. t[1] = t[4],
  40052. t[4] = e,
  40053. e = t[2],
  40054. t[2] = t[8],
  40055. t[8] = e,
  40056. e = t[6],
  40057. t[6] = t[9],
  40058. t[9] = e,
  40059. e = t[3],
  40060. t[3] = t[12],
  40061. t[12] = e,
  40062. e = t[7],
  40063. t[7] = t[13],
  40064. t[13] = e,
  40065. e = t[11],
  40066. t[11] = t[14],
  40067. t[14] = e,
  40068. this
  40069. },
  40070. flattenToArrayOffset: function(e, t) {
  40071. var i = this.elements;
  40072. return e[t] = i[0],
  40073. e[t + 1] = i[1],
  40074. e[t + 2] = i[2],
  40075. e[t + 3] = i[3],
  40076. e[t + 4] = i[4],
  40077. e[t + 5] = i[5],
  40078. e[t + 6] = i[6],
  40079. e[t + 7] = i[7],
  40080. e[t + 8] = i[8],
  40081. e[t + 9] = i[9],
  40082. e[t + 10] = i[10],
  40083. e[t + 11] = i[11],
  40084. e[t + 12] = i[12],
  40085. e[t + 13] = i[13],
  40086. e[t + 14] = i[14],
  40087. e[t + 15] = i[15],
  40088. e
  40089. },
  40090. getPosition: function() {
  40091. return void 0 === ie && (ie = new Ci.Vector3),
  40092. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40093. ie.setFromMatrixColumn(this, 3)
  40094. },
  40095. setPosition: function(e) {
  40096. var t = this.elements;
  40097. return t[12] = e.x,
  40098. t[13] = e.y,
  40099. t[14] = e.z,
  40100. this
  40101. },
  40102. getInverse: function(e, t) {
  40103. var i = this.elements
  40104. , n = e.elements
  40105. , r = n[0]
  40106. , o = n[1]
  40107. , a = n[2]
  40108. , s = n[3]
  40109. , l = n[4]
  40110. , c = n[5]
  40111. , h = n[6]
  40112. , u = n[7]
  40113. , d = n[8]
  40114. , p = n[9]
  40115. , f = n[10]
  40116. , g = n[11]
  40117. , m = n[12]
  40118. , v = n[13]
  40119. , y = n[14]
  40120. , A = n[15]
  40121. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40122. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40123. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40124. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40125. , b = r * C + o * I + a * E + s * _;
  40126. if (0 != b)
  40127. return i[0] = C,
  40128. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40129. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40130. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40131. i[4] = I,
  40132. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40133. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40134. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40135. i[8] = E,
  40136. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40137. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40138. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40139. i[12] = _,
  40140. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40141. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40142. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40143. this.multiplyScalar(1 / b);
  40144. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40145. if (t)
  40146. throw new Error(w);
  40147. return console.warn(w),
  40148. this.identity()
  40149. },
  40150. scale: function(e) {
  40151. var t = this.elements
  40152. , i = e.x
  40153. , n = e.y
  40154. , r = e.z;
  40155. return t[0] *= i,
  40156. t[4] *= n,
  40157. t[8] *= r,
  40158. t[1] *= i,
  40159. t[5] *= n,
  40160. t[9] *= r,
  40161. t[2] *= i,
  40162. t[6] *= n,
  40163. t[10] *= r,
  40164. t[3] *= i,
  40165. t[7] *= n,
  40166. t[11] *= r,
  40167. this
  40168. },
  40169. getMaxScaleOnAxis: function() {
  40170. var e = this.elements
  40171. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40172. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40173. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40174. return Math.sqrt(Math.max(t, i, n))
  40175. },
  40176. makeTranslation: function(e, t, i) {
  40177. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40178. this
  40179. },
  40180. makeRotationX: function(e) {
  40181. var t = Math.cos(e)
  40182. , i = Math.sin(e);
  40183. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40184. this
  40185. },
  40186. makeRotationY: function(e) {
  40187. var t = Math.cos(e)
  40188. , i = Math.sin(e);
  40189. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40190. this
  40191. },
  40192. makeRotationZ: function(e) {
  40193. var t = Math.cos(e)
  40194. , i = Math.sin(e);
  40195. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40196. this
  40197. },
  40198. makeRotationAxis: function(e, t) {
  40199. var i = Math.cos(t)
  40200. , n = Math.sin(t)
  40201. , r = 1 - i
  40202. , o = e.x
  40203. , a = e.y
  40204. , s = e.z
  40205. , l = r * o
  40206. , c = r * a;
  40207. 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),
  40208. this
  40209. },
  40210. makeScale: function(e, t, i) {
  40211. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40212. this
  40213. },
  40214. compose: function(e, t, i) {
  40215. return this.makeRotationFromQuaternion(t),
  40216. this.scale(i),
  40217. this.setPosition(e),
  40218. this
  40219. },
  40220. decompose: function(e, t, i) {
  40221. void 0 === ee && (ee = new Ci.Vector3),
  40222. void 0 === te && (te = new Ci.Matrix4);
  40223. var n = this.elements
  40224. , r = ee.set(n[0], n[1], n[2]).length()
  40225. , o = ee.set(n[4], n[5], n[6]).length()
  40226. , a = ee.set(n[8], n[9], n[10]).length();
  40227. this.determinant() < 0 && (r = -r),
  40228. e.x = n[12],
  40229. e.y = n[13],
  40230. e.z = n[14],
  40231. te.elements.set(this.elements);
  40232. var s = 1 / r
  40233. , l = 1 / o
  40234. , c = 1 / a;
  40235. return te.elements[0] *= s,
  40236. te.elements[1] *= s,
  40237. te.elements[2] *= s,
  40238. te.elements[4] *= l,
  40239. te.elements[5] *= l,
  40240. te.elements[6] *= l,
  40241. te.elements[8] *= c,
  40242. te.elements[9] *= c,
  40243. te.elements[10] *= c,
  40244. t.setFromRotationMatrix(te),
  40245. i.x = r,
  40246. i.y = o,
  40247. i.z = a,
  40248. this
  40249. },
  40250. makeFrustum: function(e, t, i, n, r, o) {
  40251. var a = this.elements
  40252. , s = 2 * r / (t - e)
  40253. , l = 2 * r / (n - i)
  40254. , c = (t + e) / (t - e)
  40255. , h = (n + i) / (n - i)
  40256. , u = -(o + r) / (o - r)
  40257. , d = -2 * o * r / (o - r);
  40258. return a[0] = s,
  40259. a[4] = 0,
  40260. a[8] = c,
  40261. a[12] = 0,
  40262. a[1] = 0,
  40263. a[5] = l,
  40264. a[9] = h,
  40265. a[13] = 0,
  40266. a[2] = 0,
  40267. a[6] = 0,
  40268. a[10] = u,
  40269. a[14] = d,
  40270. a[3] = 0,
  40271. a[7] = 0,
  40272. a[11] = -1,
  40273. a[15] = 0,
  40274. this
  40275. },
  40276. makePerspective: function(e, t, i, n) {
  40277. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40278. , o = -r
  40279. , a = o * t
  40280. , s = r * t;
  40281. return this.makeFrustum(a, s, o, r, i, n)
  40282. },
  40283. makeOrthographic: function(e, t, i, n, r, o) {
  40284. var a = this.elements
  40285. , s = 1 / (t - e)
  40286. , l = 1 / (i - n)
  40287. , c = 1 / (o - r)
  40288. , h = (t + e) * s
  40289. , u = (i + n) * l
  40290. , d = (o + r) * c;
  40291. return a[0] = 2 * s,
  40292. a[4] = 0,
  40293. a[8] = 0,
  40294. a[12] = -h,
  40295. a[1] = 0,
  40296. a[5] = 2 * l,
  40297. a[9] = 0,
  40298. a[13] = -u,
  40299. a[2] = 0,
  40300. a[6] = 0,
  40301. a[10] = -2 * c,
  40302. a[14] = -d,
  40303. a[3] = 0,
  40304. a[7] = 0,
  40305. a[11] = 0,
  40306. a[15] = 1,
  40307. this
  40308. },
  40309. equals: function(e) {
  40310. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40311. if (t[n] !== i[n])
  40312. return !1;
  40313. return !0
  40314. },
  40315. fromArray: function(e) {
  40316. return this.elements.set(e),
  40317. this
  40318. },
  40319. toArray: function() {
  40320. var e = this.elements;
  40321. 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]]
  40322. }
  40323. },
  40324. Ci.Ray = function(e, t) {
  40325. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40326. this.direction = void 0 !== t ? t : new Ci.Vector3
  40327. }
  40328. ,
  40329. Ci.Ray.prototype = {
  40330. constructor: Ci.Ray,
  40331. set: function(e, t) {
  40332. return this.origin.copy(e),
  40333. this.direction.copy(t),
  40334. this
  40335. },
  40336. clone: function() {
  40337. return (new this.constructor).copy(this)
  40338. },
  40339. copy: function(e) {
  40340. return this.origin.copy(e.origin),
  40341. this.direction.copy(e.direction),
  40342. this
  40343. },
  40344. at: function(e, t) {
  40345. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40346. },
  40347. lookAt: function(e) {
  40348. this.direction.copy(e).sub(this.origin).normalize()
  40349. },
  40350. recast: ($ = new Ci.Vector3,
  40351. function(e) {
  40352. return this.origin.copy(this.at(e, $)),
  40353. this
  40354. }
  40355. ),
  40356. closestPointToPoint: function(e, t) {
  40357. var i = t || new Ci.Vector3;
  40358. i.subVectors(e, this.origin);
  40359. var n = i.dot(this.direction);
  40360. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40361. },
  40362. distanceToPoint: function(e) {
  40363. return Math.sqrt(this.distanceSqToPoint(e))
  40364. },
  40365. distanceSqToPoint: (J = new Ci.Vector3,
  40366. function(e) {
  40367. var t = J.subVectors(e, this.origin).dot(this.direction);
  40368. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40369. J.distanceToSquared(e))
  40370. }
  40371. ),
  40372. distanceSqToSegment: (Z = new Ci.Vector3,
  40373. K = new Ci.Vector3,
  40374. Q = new Ci.Vector3,
  40375. function(e, t, i, n) {
  40376. Z.copy(e).add(t).multiplyScalar(.5),
  40377. K.copy(t).sub(e).normalize(),
  40378. Q.copy(this.origin).sub(Z);
  40379. 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);
  40380. if (0 < p)
  40381. if (o = c * h - u,
  40382. s = l * p,
  40383. 0 <= (r = c * u - h))
  40384. if (-s <= o)
  40385. if (o <= s) {
  40386. var f = 1 / p;
  40387. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40388. } else
  40389. o = l,
  40390. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40391. else
  40392. o = -l,
  40393. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40394. else
  40395. 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,
  40396. (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;
  40397. else
  40398. o = 0 < c ? -l : l,
  40399. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40400. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40401. n && n.copy(K).multiplyScalar(o).add(Z),
  40402. a
  40403. }
  40404. ),
  40405. intersectSphere: (X = new Ci.Vector3,
  40406. function(e, t) {
  40407. X.subVectors(e.center, this.origin);
  40408. var i = X.dot(this.direction)
  40409. , n = X.dot(X) - i * i
  40410. , r = e.radius * e.radius;
  40411. if (r < n)
  40412. return null;
  40413. var o = Math.sqrt(r - n)
  40414. , a = i - o
  40415. , s = i + o;
  40416. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40417. }
  40418. ),
  40419. intersectsSphere: function(e) {
  40420. return this.distanceToPoint(e.center) <= e.radius
  40421. },
  40422. distanceToPlane: function(e) {
  40423. var t = e.normal.dot(this.direction);
  40424. if (0 === t)
  40425. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40426. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40427. return 0 <= i ? i : null
  40428. },
  40429. intersectPlane: function(e, t) {
  40430. var i = this.distanceToPlane(e);
  40431. return null === i ? null : this.at(i, t)
  40432. },
  40433. intersectsPlane: function(e) {
  40434. var t = e.distanceToPoint(this.origin);
  40435. return 0 === t || e.normal.dot(this.direction) * t < 0
  40436. },
  40437. intersectBox: function(e, t) {
  40438. 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;
  40439. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40440. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40441. (e.min.x - u.x) * l),
  40442. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40443. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40444. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40445. (o < n || n != n) && (n = o),
  40446. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40447. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40448. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40449. (s < n || n != n) && (n = s),
  40450. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40451. },
  40452. intersectsBox: (q = new Ci.Vector3,
  40453. function(e) {
  40454. return null !== this.intersectBox(e, q)
  40455. }
  40456. ),
  40457. intersectTriangle: (G = new Ci.Vector3,
  40458. W = new Ci.Vector3,
  40459. j = new Ci.Vector3,
  40460. Y = new Ci.Vector3,
  40461. function(e, t, i, n, r) {
  40462. W.subVectors(t, e),
  40463. j.subVectors(i, e),
  40464. Y.crossVectors(W, j);
  40465. var o, a = this.direction.dot(Y);
  40466. if (0 < a) {
  40467. if (n)
  40468. return null;
  40469. o = 1
  40470. } else {
  40471. if (!(a < 0))
  40472. return null;
  40473. o = -1,
  40474. a = -a
  40475. }
  40476. G.subVectors(this.origin, e);
  40477. var s = o * this.direction.dot(j.crossVectors(G, j));
  40478. if (s < 0)
  40479. return null;
  40480. var l = o * this.direction.dot(W.cross(G));
  40481. if (l < 0)
  40482. return null;
  40483. if (a < s + l)
  40484. return null;
  40485. var c = -o * G.dot(Y);
  40486. return c < 0 ? null : this.at(c / a, r)
  40487. }
  40488. ),
  40489. applyMatrix4: function(e) {
  40490. return this.direction.add(this.origin).applyMatrix4(e),
  40491. this.origin.applyMatrix4(e),
  40492. this.direction.sub(this.origin),
  40493. this.direction.normalize(),
  40494. this
  40495. },
  40496. equals: function(e) {
  40497. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40498. }
  40499. },
  40500. Ci.Sphere = function(e, t) {
  40501. this.center = void 0 !== e ? e : new Ci.Vector3,
  40502. this.radius = void 0 !== t ? t : 0
  40503. }
  40504. ,
  40505. Ci.Sphere.prototype = {
  40506. constructor: Ci.Sphere,
  40507. set: function(e, t) {
  40508. return this.center.copy(e),
  40509. this.radius = t,
  40510. this
  40511. },
  40512. setFromPoints: (z = new Ci.Box3,
  40513. function(e, t) {
  40514. var i = this.center;
  40515. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40516. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40517. n = Math.max(n, i.distanceToSquared(e[r]));
  40518. return this.radius = Math.sqrt(n),
  40519. this
  40520. }
  40521. ),
  40522. clone: function() {
  40523. return (new this.constructor).copy(this)
  40524. },
  40525. copy: function(e) {
  40526. return this.center.copy(e.center),
  40527. this.radius = e.radius,
  40528. this
  40529. },
  40530. empty: function() {
  40531. return this.radius <= 0
  40532. },
  40533. containsPoint: function(e) {
  40534. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40535. },
  40536. distanceToPoint: function(e) {
  40537. return e.distanceTo(this.center) - this.radius
  40538. },
  40539. intersectsSphere: function(e) {
  40540. var t = this.radius + e.radius;
  40541. return e.center.distanceToSquared(this.center) <= t * t
  40542. },
  40543. intersectsBox: function(e) {
  40544. return e.intersectsSphere(this)
  40545. },
  40546. intersectsPlane: function(e) {
  40547. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40548. },
  40549. clampPoint: function(e, t) {
  40550. var i = this.center.distanceToSquared(e)
  40551. , n = t || new Ci.Vector3;
  40552. return n.copy(e),
  40553. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40554. n.multiplyScalar(this.radius).add(this.center)),
  40555. n
  40556. },
  40557. getBoundingBox: function(e) {
  40558. var t = e || new Ci.Box3;
  40559. return t.set(this.center, this.center),
  40560. t.expandByScalar(this.radius),
  40561. t
  40562. },
  40563. applyMatrix4: function(e) {
  40564. return this.center.applyMatrix4(e),
  40565. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40566. this
  40567. },
  40568. translate: function(e) {
  40569. return this.center.add(e),
  40570. this
  40571. },
  40572. equals: function(e) {
  40573. return e.center.equals(this.center) && e.radius === this.radius
  40574. }
  40575. },
  40576. Ci.Frustum = function(e, t, i, n, r, o) {
  40577. 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]
  40578. }
  40579. ,
  40580. Ci.Frustum.prototype = {
  40581. constructor: Ci.Frustum,
  40582. set: function(e, t, i, n, r, o) {
  40583. var a = this.planes;
  40584. return a[0].copy(e),
  40585. a[1].copy(t),
  40586. a[2].copy(i),
  40587. a[3].copy(n),
  40588. a[4].copy(r),
  40589. a[5].copy(o),
  40590. this
  40591. },
  40592. clone: function() {
  40593. return (new this.constructor).copy(this)
  40594. },
  40595. copy: function(e) {
  40596. for (var t = this.planes, i = 0; i < 6; i++)
  40597. t[i].copy(e.planes[i]);
  40598. return this
  40599. },
  40600. setFromMatrix: function(e) {
  40601. var t = this.planes
  40602. , i = e.elements
  40603. , n = i[0]
  40604. , r = i[1]
  40605. , o = i[2]
  40606. , a = i[3]
  40607. , s = i[4]
  40608. , l = i[5]
  40609. , c = i[6]
  40610. , h = i[7]
  40611. , u = i[8]
  40612. , d = i[9]
  40613. , p = i[10]
  40614. , f = i[11]
  40615. , g = i[12]
  40616. , m = i[13]
  40617. , v = i[14]
  40618. , y = i[15];
  40619. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40620. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40621. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40622. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40623. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40624. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40625. this
  40626. },
  40627. intersectsObject: (H = new Ci.Sphere,
  40628. function(e) {
  40629. var t = e.geometry;
  40630. return null === t.boundingSphere && t.computeBoundingSphere(),
  40631. H.copy(t.boundingSphere),
  40632. H.applyMatrix4(e.matrixWorld),
  40633. this.intersectsSphere(H)
  40634. }
  40635. ),
  40636. intersectsSphere: function(e) {
  40637. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40638. if (t[r].distanceToPoint(i) < n)
  40639. return !1
  40640. }
  40641. return !0
  40642. },
  40643. intersectsBox: (k = new Ci.Vector3,
  40644. U = new Ci.Vector3,
  40645. function(e) {
  40646. for (var t = this.planes, i = 0; i < 6; i++) {
  40647. var n = t[i];
  40648. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40649. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40650. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40651. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40652. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40653. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40654. var r = n.distanceToPoint(k)
  40655. , o = n.distanceToPoint(U);
  40656. if (r < 0 && o < 0)
  40657. return !1
  40658. }
  40659. return !0
  40660. }
  40661. ),
  40662. containsPoint: function(e) {
  40663. for (var t = this.planes, i = 0; i < 6; i++)
  40664. if (t[i].distanceToPoint(e) < 0)
  40665. return !1;
  40666. return !0
  40667. }
  40668. },
  40669. Ci.Plane = function(e, t) {
  40670. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40671. this.constant = void 0 !== t ? t : 0
  40672. }
  40673. ,
  40674. Ci.Plane.prototype = {
  40675. constructor: Ci.Plane,
  40676. set: function(e, t) {
  40677. return this.normal.copy(e),
  40678. this.constant = t,
  40679. this
  40680. },
  40681. setComponents: function(e, t, i, n) {
  40682. return this.normal.set(e, t, i),
  40683. this.constant = n,
  40684. this
  40685. },
  40686. setFromNormalAndCoplanarPoint: function(e, t) {
  40687. return this.normal.copy(e),
  40688. this.constant = -t.dot(this.normal),
  40689. this
  40690. },
  40691. setFromCoplanarPoints: (B = new Ci.Vector3,
  40692. V = new Ci.Vector3,
  40693. function(e, t, i) {
  40694. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40695. return this.setFromNormalAndCoplanarPoint(n, e),
  40696. this
  40697. }
  40698. ),
  40699. clone: function() {
  40700. return (new this.constructor).copy(this)
  40701. },
  40702. copy: function(e) {
  40703. return this.normal.copy(e.normal),
  40704. this.constant = e.constant,
  40705. this
  40706. },
  40707. normalize: function() {
  40708. var e = 1 / this.normal.length();
  40709. return this.normal.multiplyScalar(e),
  40710. this.constant *= e,
  40711. this
  40712. },
  40713. negate: function() {
  40714. return this.constant *= -1,
  40715. this.normal.negate(),
  40716. this
  40717. },
  40718. distanceToPoint: function(e) {
  40719. return this.normal.dot(e) + this.constant
  40720. },
  40721. distanceToSphere: function(e) {
  40722. return this.distanceToPoint(e.center) - e.radius
  40723. },
  40724. projectPoint: function(e, t) {
  40725. return this.orthoPoint(e, t).sub(e).negate()
  40726. },
  40727. orthoPoint: function(e, t) {
  40728. var i = this.distanceToPoint(e);
  40729. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40730. },
  40731. intersectLine: (F = new Ci.Vector3,
  40732. function(e, t) {
  40733. var i = t || new Ci.Vector3
  40734. , n = e.delta(F)
  40735. , r = this.normal.dot(n);
  40736. if (0 !== r) {
  40737. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40738. if (!(o < 0 || 1 < o))
  40739. return i.copy(n).multiplyScalar(o).add(e.start)
  40740. } else if (0 === this.distanceToPoint(e.start))
  40741. return i.copy(e.start)
  40742. }
  40743. ),
  40744. intersectsLine: function(e) {
  40745. var t = this.distanceToPoint(e.start)
  40746. , i = this.distanceToPoint(e.end);
  40747. return t < 0 && 0 < i || i < 0 && 0 < t
  40748. },
  40749. intersectsBox: function(e) {
  40750. return e.intersectsPlane(this)
  40751. },
  40752. intersectsSphere: function(e) {
  40753. return e.intersectsPlane(this)
  40754. },
  40755. coplanarPoint: function(e) {
  40756. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40757. },
  40758. applyMatrix4: (L = new Ci.Vector3,
  40759. D = new Ci.Vector3,
  40760. N = new Ci.Matrix3,
  40761. function(e, t) {
  40762. var i = t || N.getNormalMatrix(e)
  40763. , n = L.copy(this.normal).applyMatrix3(i)
  40764. , r = this.coplanarPoint(D);
  40765. return r.applyMatrix4(e),
  40766. this.setFromNormalAndCoplanarPoint(n, r),
  40767. this
  40768. }
  40769. ),
  40770. translate: function(e) {
  40771. return this.constant = this.constant - e.dot(this.normal),
  40772. this
  40773. },
  40774. equals: function(e) {
  40775. return e.normal.equals(this.normal) && e.constant === this.constant
  40776. }
  40777. },
  40778. Ci.Spherical = function(e, t, i) {
  40779. return this.radius = void 0 !== e ? e : 1,
  40780. this.phi = void 0 !== t ? t : 0,
  40781. this.theta = void 0 !== i ? i : 0,
  40782. this
  40783. }
  40784. ,
  40785. Ci.Spherical.prototype = {
  40786. constructor: Ci.Spherical,
  40787. set: function(e, t, i) {
  40788. this.radius = e,
  40789. this.phi = t,
  40790. this.theta = i
  40791. },
  40792. clone: function() {
  40793. return (new this.constructor).copy(this)
  40794. },
  40795. copy: function(e) {
  40796. return this.radius.copy(e.radius),
  40797. this.phi.copy(e.phi),
  40798. this.theta.copy(e.theta),
  40799. this
  40800. },
  40801. makeSafe: function() {
  40802. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40803. },
  40804. setFromVector3: function(e) {
  40805. return this.radius = e.length(),
  40806. 0 === this.radius ? (this.theta = 0,
  40807. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40808. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40809. this
  40810. }
  40811. },
  40812. Ci.Math = {
  40813. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40814. P = new Array(36),
  40815. O = 0,
  40816. function() {
  40817. for (var e = 0; e < 36; e++)
  40818. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40819. M = 15 & O,
  40820. O >>= 4,
  40821. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40822. return P.join("")
  40823. }
  40824. ),
  40825. clamp: function(e, t, i) {
  40826. return Math.max(t, Math.min(i, e))
  40827. },
  40828. euclideanModulo: function(e, t) {
  40829. return (e % t + t) % t
  40830. },
  40831. mapLinear: function(e, t, i, n, r) {
  40832. return n + (e - t) * (r - n) / (i - t)
  40833. },
  40834. smoothstep: function(e, t, i) {
  40835. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40836. },
  40837. smootherstep: function(e, t, i) {
  40838. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40839. },
  40840. random16: function() {
  40841. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40842. Math.random()
  40843. },
  40844. randInt: function(e, t) {
  40845. return e + Math.floor(Math.random() * (t - e + 1))
  40846. },
  40847. randFloat: function(e, t) {
  40848. return e + Math.random() * (t - e)
  40849. },
  40850. randFloatSpread: function(e) {
  40851. return e * (.5 - Math.random())
  40852. },
  40853. degToRad: (S = Math.PI / 180,
  40854. function(e) {
  40855. return e * S
  40856. }
  40857. ),
  40858. radToDeg: (x = 180 / Math.PI,
  40859. function(e) {
  40860. return e * x
  40861. }
  40862. ),
  40863. isPowerOfTwo: function(e) {
  40864. return 0 == (e & e - 1) && 0 !== e
  40865. },
  40866. nearestPowerOfTwo: function(e) {
  40867. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40868. },
  40869. nextPowerOfTwo: function(e) {
  40870. return e--,
  40871. e |= e >> 1,
  40872. e |= e >> 2,
  40873. e |= e >> 4,
  40874. e |= e >> 8,
  40875. e |= e >> 16,
  40876. ++e
  40877. }
  40878. },
  40879. Ci.Spline = function(e) {
  40880. function t(e, t, i, n, r, o, a) {
  40881. var s = .5 * (i - e)
  40882. , l = .5 * (n - t);
  40883. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40884. }
  40885. this.points = e;
  40886. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40887. x: 0,
  40888. y: 0,
  40889. z: 0
  40890. };
  40891. this.initFromArray = function(e) {
  40892. this.points = [];
  40893. for (var t = 0; t < e.length; t++)
  40894. this.points[t] = {
  40895. x: e[t][0],
  40896. y: e[t][1],
  40897. z: e[t][2]
  40898. }
  40899. }
  40900. ,
  40901. this.getPoint = function(e) {
  40902. return i = (this.points.length - 1) * e,
  40903. n = Math.floor(i),
  40904. r = i - n,
  40905. u[0] = 0 === n ? n : n - 1,
  40906. u[1] = n,
  40907. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40908. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40909. s = this.points[u[0]],
  40910. l = this.points[u[1]],
  40911. c = this.points[u[2]],
  40912. h = this.points[u[3]],
  40913. a = r * (o = r * r),
  40914. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40915. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40916. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40917. d
  40918. }
  40919. ,
  40920. this.getControlPointsArray = function() {
  40921. var e, t, i = this.points.length, n = [];
  40922. for (e = 0; e < i; e++)
  40923. t = this.points[e],
  40924. n[e] = [t.x, t.y, t.z];
  40925. return n
  40926. }
  40927. ,
  40928. this.getLength = function(e) {
  40929. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40930. for (h[0] = 0,
  40931. e = e || 100,
  40932. n = this.points.length * e,
  40933. l.copy(this.points[0]),
  40934. t = 1; t < n; t++)
  40935. i = t / n,
  40936. r = this.getPoint(i),
  40937. c.copy(r),
  40938. u += c.distanceTo(l),
  40939. l.copy(r),
  40940. o = (this.points.length - 1) * i,
  40941. (a = Math.floor(o)) !== s && (h[a] = u,
  40942. s = a);
  40943. return h[h.length] = u,
  40944. {
  40945. chunks: h,
  40946. total: u
  40947. }
  40948. }
  40949. ,
  40950. this.reparametrizeByArcLength = function(e) {
  40951. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40952. for (c.push(h.copy(this.points[0]).clone()),
  40953. t = 1; t < this.points.length; t++) {
  40954. for (a = u.chunks[t] - u.chunks[t - 1],
  40955. s = Math.ceil(e * a / u.total),
  40956. r = (t - 1) / (this.points.length - 1),
  40957. o = t / (this.points.length - 1),
  40958. i = 1; i < s - 1; i++)
  40959. n = r + i * (1 / s) * (o - r),
  40960. l = this.getPoint(n),
  40961. c.push(h.copy(l).clone());
  40962. c.push(h.copy(this.points[t]).clone())
  40963. }
  40964. this.points = c
  40965. }
  40966. }
  40967. ,
  40968. Ci.Triangle = function(e, t, i) {
  40969. this.a = void 0 !== e ? e : new Ci.Vector3,
  40970. this.b = void 0 !== t ? t : new Ci.Vector3,
  40971. this.c = void 0 !== i ? i : new Ci.Vector3
  40972. }
  40973. ,
  40974. Ci.Triangle.normal = (T = new Ci.Vector3,
  40975. function(e, t, i, n) {
  40976. var r = n || new Ci.Vector3;
  40977. r.subVectors(i, t),
  40978. T.subVectors(e, t),
  40979. r.cross(T);
  40980. var o = r.lengthSq();
  40981. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40982. }
  40983. ),
  40984. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40985. b = new Ci.Vector3,
  40986. w = new Ci.Vector3,
  40987. function(e, t, i, n, r) {
  40988. _.subVectors(n, t),
  40989. b.subVectors(i, t),
  40990. w.subVectors(e, t);
  40991. var o = _.dot(_)
  40992. , a = _.dot(b)
  40993. , s = _.dot(w)
  40994. , l = b.dot(b)
  40995. , c = b.dot(w)
  40996. , h = o * l - a * a
  40997. , u = r || new Ci.Vector3;
  40998. if (0 == h)
  40999. return u.set(-2, -1, -1);
  41000. var d = 1 / h
  41001. , p = (l * s - a * c) * d
  41002. , f = (o * c - a * s) * d;
  41003. return u.set(1 - p - f, f, p)
  41004. }
  41005. ),
  41006. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41007. function(e, t, i, n) {
  41008. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41009. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41010. }
  41011. ),
  41012. Ci.Triangle.prototype = {
  41013. constructor: Ci.Triangle,
  41014. set: function(e, t, i) {
  41015. return this.a.copy(e),
  41016. this.b.copy(t),
  41017. this.c.copy(i),
  41018. this
  41019. },
  41020. setFromPointsAndIndices: function(e, t, i, n) {
  41021. return this.a.copy(e[t]),
  41022. this.b.copy(e[i]),
  41023. this.c.copy(e[n]),
  41024. this
  41025. },
  41026. clone: function() {
  41027. return (new this.constructor).copy(this)
  41028. },
  41029. copy: function(e) {
  41030. return this.a.copy(e.a),
  41031. this.b.copy(e.b),
  41032. this.c.copy(e.c),
  41033. this
  41034. },
  41035. area: (C = new Ci.Vector3,
  41036. I = new Ci.Vector3,
  41037. function() {
  41038. return C.subVectors(this.c, this.b),
  41039. I.subVectors(this.a, this.b),
  41040. .5 * C.cross(I).length()
  41041. }
  41042. ),
  41043. midpoint: function(e) {
  41044. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41045. },
  41046. normal: function(e) {
  41047. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41048. },
  41049. plane: function(e) {
  41050. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41051. },
  41052. barycoordFromPoint: function(e, t) {
  41053. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41054. },
  41055. containsPoint: function(e) {
  41056. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41057. },
  41058. equals: function(e) {
  41059. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41060. }
  41061. },
  41062. Ci.Interpolant = function(e, t, i, n) {
  41063. this.parameterPositions = e,
  41064. this._cachedIndex = 0,
  41065. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41066. this.sampleValues = t,
  41067. this.valueSize = i
  41068. }
  41069. ,
  41070. Ci.Interpolant.prototype = {
  41071. constructor: Ci.Interpolant,
  41072. evaluate: function(e) {
  41073. var t = this.parameterPositions
  41074. , i = this._cachedIndex
  41075. , n = t[i]
  41076. , r = t[i - 1];
  41077. e: {
  41078. t: {
  41079. var o;
  41080. i: {
  41081. n: if (!(e < n)) {
  41082. for (var a = i + 2; ; ) {
  41083. if (void 0 === n) {
  41084. if (e < r)
  41085. break n;
  41086. return i = t.length,
  41087. this._cachedIndex = i,
  41088. this.afterEnd_(i - 1, e, r)
  41089. }
  41090. if (i === a)
  41091. break;
  41092. if (r = n,
  41093. e < (n = t[++i]))
  41094. break t
  41095. }
  41096. o = t.length;
  41097. break i
  41098. }
  41099. if (r <= e)
  41100. break e;
  41101. var s = t[1];
  41102. e < s && (i = 2,
  41103. r = s);
  41104. for (a = i - 2; ; ) {
  41105. if (void 0 === r)
  41106. return this._cachedIndex = 0,
  41107. this.beforeStart_(0, e, n);
  41108. if (i === a)
  41109. break;
  41110. if (n = r,
  41111. (r = t[--i - 1]) <= e)
  41112. break t
  41113. }
  41114. o = i,
  41115. i = 0
  41116. }
  41117. for (; i < o; ) {
  41118. var l = i + o >>> 1;
  41119. e < t[l] ? o = l : i = 1 + l
  41120. }
  41121. if (n = t[i],
  41122. void 0 === (r = t[i - 1]))
  41123. return this._cachedIndex = 0,
  41124. this.beforeStart_(0, e, n);
  41125. if (void 0 === n)
  41126. return i = t.length,
  41127. this._cachedIndex = i,
  41128. this.afterEnd_(i - 1, r, e)
  41129. }
  41130. this._cachedIndex = i,
  41131. this.intervalChanged_(i, r, n)
  41132. }
  41133. return this.interpolate_(i, r, e, n)
  41134. },
  41135. settings: null,
  41136. DefaultSettings_: {},
  41137. getSettings_: function() {
  41138. return this.settings || this.DefaultSettings_
  41139. },
  41140. copySampleValue_: function(e) {
  41141. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41142. t[o] = i[r + o];
  41143. return t
  41144. },
  41145. interpolate_: function(e, t, i, n) {
  41146. throw new Error("call to abstract method")
  41147. },
  41148. intervalChanged_: function(e, t, i) {}
  41149. },
  41150. Object.assign(Ci.Interpolant.prototype, {
  41151. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41152. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41153. }),
  41154. Ci.CubicInterpolant = function(e, t, i, n) {
  41155. Ci.Interpolant.call(this, e, t, i, n),
  41156. this._weightPrev = -0,
  41157. this._offsetPrev = -0,
  41158. this._weightNext = -0,
  41159. this._offsetNext = -0
  41160. }
  41161. ,
  41162. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41163. constructor: Ci.CubicInterpolant,
  41164. DefaultSettings_: {
  41165. endingStart: Ci.ZeroCurvatureEnding,
  41166. endingEnd: Ci.ZeroCurvatureEnding
  41167. },
  41168. intervalChanged_: function(e, t, i) {
  41169. var n = this.parameterPositions
  41170. , r = e - 2
  41171. , o = e + 1
  41172. , a = n[r]
  41173. , s = n[o];
  41174. if (void 0 === a)
  41175. switch (this.getSettings_().endingStart) {
  41176. case Ci.ZeroSlopeEnding:
  41177. r = e,
  41178. a = 2 * t - i;
  41179. break;
  41180. case Ci.WrapAroundEnding:
  41181. a = t + n[r = n.length - 2] - n[r + 1];
  41182. break;
  41183. default:
  41184. r = e,
  41185. a = i
  41186. }
  41187. if (void 0 === s)
  41188. switch (this.getSettings_().endingEnd) {
  41189. case Ci.ZeroSlopeEnding:
  41190. o = e,
  41191. s = 2 * i - t;
  41192. break;
  41193. case Ci.WrapAroundEnding:
  41194. s = i + n[o = 1] - n[0];
  41195. break;
  41196. default:
  41197. o = e - 1,
  41198. s = t
  41199. }
  41200. var l = .5 * (i - t)
  41201. , c = this.valueSize;
  41202. this._weightPrev = l / (t - a),
  41203. this._weightNext = l / (s - i),
  41204. this._offsetPrev = r * c,
  41205. this._offsetNext = o * c
  41206. },
  41207. interpolate_: function(e, t, i, n) {
  41208. 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)
  41209. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41210. return r
  41211. }
  41212. }),
  41213. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41214. Ci.Interpolant.call(this, e, t, i, n)
  41215. }
  41216. ,
  41217. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41218. constructor: Ci.DiscreteInterpolant,
  41219. interpolate_: function(e, t, i, n) {
  41220. return this.copySampleValue_(e - 1)
  41221. }
  41222. }),
  41223. Ci.LinearInterpolant = function(e, t, i, n) {
  41224. Ci.Interpolant.call(this, e, t, i, n)
  41225. }
  41226. ,
  41227. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41228. constructor: Ci.LinearInterpolant,
  41229. interpolate_: function(e, t, i, n) {
  41230. 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)
  41231. r[u] = o[l + u] * h + o[s + u] * c;
  41232. return r
  41233. }
  41234. }),
  41235. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41236. Ci.Interpolant.call(this, e, t, i, n)
  41237. }
  41238. ,
  41239. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41240. constructor: Ci.QuaternionLinearInterpolant,
  41241. interpolate_: function(e, t, i, n) {
  41242. 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)
  41243. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41244. return r
  41245. }
  41246. }),
  41247. Ci.Clock = function(e) {
  41248. this.autoStart = void 0 === e || e,
  41249. this.startTime = 0,
  41250. this.oldTime = 0,
  41251. this.elapsedTime = 0,
  41252. this.running = !1
  41253. }
  41254. ,
  41255. Ci.Clock.prototype = {
  41256. constructor: Ci.Clock,
  41257. start: function() {
  41258. this.startTime = performance.now(),
  41259. this.oldTime = this.startTime,
  41260. this.running = !0
  41261. },
  41262. stop: function() {
  41263. this.getElapsedTime(),
  41264. this.running = !1
  41265. },
  41266. getElapsedTime: function() {
  41267. return this.getDelta(),
  41268. this.elapsedTime
  41269. },
  41270. getDelta: function() {
  41271. var e = 0;
  41272. if (this.autoStart && !this.running && this.start(),
  41273. this.running) {
  41274. var t = performance.now();
  41275. e = .001 * (t - this.oldTime),
  41276. this.oldTime = t,
  41277. this.elapsedTime += e
  41278. }
  41279. return e
  41280. }
  41281. },
  41282. Ci.EventDispatcher = function() {}
  41283. ,
  41284. Ci.EventDispatcher.prototype = {
  41285. constructor: Ci.EventDispatcher,
  41286. apply: function(e) {
  41287. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41288. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41289. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41290. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41291. },
  41292. addEventListener: function(e, t) {
  41293. void 0 === this._listeners && (this._listeners = {});
  41294. var i = this._listeners;
  41295. void 0 === i[e] && (i[e] = []),
  41296. -1 === i[e].indexOf(t) && i[e].push(t)
  41297. },
  41298. hasEventListener: function(e, t) {
  41299. if (void 0 === this._listeners)
  41300. return !1;
  41301. var i = this._listeners;
  41302. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41303. },
  41304. removeEventListener: function(e, t) {
  41305. if (void 0 !== this._listeners) {
  41306. var i = this._listeners[e];
  41307. if (void 0 !== i) {
  41308. var n = i.indexOf(t);
  41309. -1 !== n && i.splice(n, 1)
  41310. }
  41311. }
  41312. },
  41313. dispatchEvent: function(e) {
  41314. if (void 0 !== this._listeners) {
  41315. var t = this._listeners[e.type];
  41316. if (void 0 !== t) {
  41317. e.target = this;
  41318. for (var i = [], n = t.length, r = 0; r < n; r++)
  41319. i[r] = t[r];
  41320. for (r = 0; r < n; r++)
  41321. i[r].call(this, e)
  41322. }
  41323. }
  41324. }
  41325. },
  41326. Ci.Layers = function() {
  41327. this.mask = 1
  41328. }
  41329. ,
  41330. Ci.Layers.prototype = {
  41331. constructor: Ci.Layers,
  41332. set: function(e) {
  41333. this.mask = 1 << e
  41334. },
  41335. enable: function(e) {
  41336. this.mask |= 1 << e
  41337. },
  41338. toggle: function(e) {
  41339. this.mask ^= 1 << e
  41340. },
  41341. disable: function(e) {
  41342. this.mask &= ~(1 << e)
  41343. },
  41344. test: function(e) {
  41345. return 0 != (this.mask & e.mask)
  41346. }
  41347. },
  41348. (A = Ci).Raycaster = function(e, t, i, n) {
  41349. this.ray = new A.Ray(e,t),
  41350. this.near = i || 0,
  41351. this.far = n || 1 / 0,
  41352. this.params = {
  41353. Mesh: {},
  41354. Line: {},
  41355. LOD: {},
  41356. Points: {
  41357. threshold: 1
  41358. },
  41359. Sprite: {}
  41360. },
  41361. Object.defineProperties(this.params, {
  41362. PointCloud: {
  41363. get: function() {
  41364. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41365. this.Points
  41366. }
  41367. }
  41368. })
  41369. }
  41370. ,
  41371. A.Raycaster.prototype = {
  41372. constructor: A.Raycaster,
  41373. linePrecision: 1,
  41374. set: function(e, t) {
  41375. this.ray.set(e, t)
  41376. },
  41377. setFromCamera: function(e, t) {
  41378. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41379. 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),
  41380. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41381. },
  41382. intersectObject: function(e, t) {
  41383. var i = [];
  41384. return Ei(e, this, i, t),
  41385. i.sort(Ii),
  41386. i
  41387. },
  41388. intersectObjects: function(e, t) {
  41389. var i = [];
  41390. if (!1 === Array.isArray(e))
  41391. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41392. i;
  41393. for (var n = 0, r = e.length; n < r; n++)
  41394. Ei(e[n], this, i, t);
  41395. return i.sort(Ii),
  41396. i
  41397. }
  41398. },
  41399. Ci.Object3D = function() {
  41400. Object.defineProperty(this, "id", {
  41401. value: Ci.Object3DIdCount++
  41402. }),
  41403. this.uuid = Ci.Math.generateUUID(),
  41404. this.name = "",
  41405. this.type = "Object3D",
  41406. this.parent = null,
  41407. this.children = [],
  41408. this.up = Ci.Object3D.DefaultUp.clone();
  41409. var e = new Ci.Vector3
  41410. , t = new Ci.Euler
  41411. , i = new Ci.Quaternion
  41412. , n = new Ci.Vector3(1,1,1);
  41413. t.onChange(function() {
  41414. i.setFromEuler(t, !1)
  41415. }),
  41416. i.onChange(function() {
  41417. t.setFromQuaternion(i, void 0, !1)
  41418. }),
  41419. Object.defineProperties(this, {
  41420. position: {
  41421. enumerable: !0,
  41422. value: e
  41423. },
  41424. rotation: {
  41425. enumerable: !0,
  41426. value: t
  41427. },
  41428. quaternion: {
  41429. enumerable: !0,
  41430. value: i
  41431. },
  41432. scale: {
  41433. enumerable: !0,
  41434. value: n
  41435. },
  41436. modelViewMatrix: {
  41437. value: new Ci.Matrix4
  41438. },
  41439. normalMatrix: {
  41440. value: new Ci.Matrix3
  41441. }
  41442. }),
  41443. this.rotationAutoUpdate = !0,
  41444. this.matrix = new Ci.Matrix4,
  41445. this.matrixWorld = new Ci.Matrix4,
  41446. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41447. this.matrixWorldNeedsUpdate = !1,
  41448. this.layers = new Ci.Layers,
  41449. this.visible = !0,
  41450. this.castShadow = !1,
  41451. this.receiveShadow = !1,
  41452. this.frustumCulled = !0,
  41453. this.renderOrder = 0,
  41454. this.userData = {}
  41455. }
  41456. ,
  41457. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41458. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41459. Ci.Object3D.prototype = {
  41460. constructor: Ci.Object3D,
  41461. applyMatrix: function(e) {
  41462. this.matrix.multiplyMatrices(e, this.matrix),
  41463. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41464. },
  41465. setRotationFromAxisAngle: function(e, t) {
  41466. this.quaternion.setFromAxisAngle(e, t)
  41467. },
  41468. setRotationFromEuler: function(e) {
  41469. this.quaternion.setFromEuler(e, !0)
  41470. },
  41471. setRotationFromMatrix: function(e) {
  41472. this.quaternion.setFromRotationMatrix(e)
  41473. },
  41474. setRotationFromQuaternion: function(e) {
  41475. this.quaternion.copy(e)
  41476. },
  41477. rotateOnAxis: (y = new Ci.Quaternion,
  41478. function(e, t) {
  41479. return y.setFromAxisAngle(e, t),
  41480. this.quaternion.multiply(y),
  41481. this
  41482. }
  41483. ),
  41484. rotateX: (v = new Ci.Vector3(1,0,0),
  41485. function(e) {
  41486. return this.rotateOnAxis(v, e)
  41487. }
  41488. ),
  41489. rotateY: (m = new Ci.Vector3(0,1,0),
  41490. function(e) {
  41491. return this.rotateOnAxis(m, e)
  41492. }
  41493. ),
  41494. rotateZ: (g = new Ci.Vector3(0,0,1),
  41495. function(e) {
  41496. return this.rotateOnAxis(g, e)
  41497. }
  41498. ),
  41499. translateOnAxis: (f = new Ci.Vector3,
  41500. function(e, t) {
  41501. return f.copy(e).applyQuaternion(this.quaternion),
  41502. this.position.add(f.multiplyScalar(t)),
  41503. this
  41504. }
  41505. ),
  41506. translateX: (p = new Ci.Vector3(1,0,0),
  41507. function(e) {
  41508. return this.translateOnAxis(p, e)
  41509. }
  41510. ),
  41511. translateY: (d = new Ci.Vector3(0,1,0),
  41512. function(e) {
  41513. return this.translateOnAxis(d, e)
  41514. }
  41515. ),
  41516. translateZ: (u = new Ci.Vector3(0,0,1),
  41517. function(e) {
  41518. return this.translateOnAxis(u, e)
  41519. }
  41520. ),
  41521. localToWorld: function(e) {
  41522. return e.applyMatrix4(this.matrixWorld)
  41523. },
  41524. worldToLocal: (h = new Ci.Matrix4,
  41525. function(e) {
  41526. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41527. }
  41528. ),
  41529. lookAt: (c = new Ci.Matrix4,
  41530. function(e) {
  41531. c.lookAt(e, this.position, this.up),
  41532. this.quaternion.setFromRotationMatrix(c)
  41533. }
  41534. ),
  41535. add: function(e) {
  41536. if (1 < arguments.length) {
  41537. for (var t = 0; t < arguments.length; t++)
  41538. this.add(arguments[t]);
  41539. return this
  41540. }
  41541. 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),
  41542. e.parent = this,
  41543. e.dispatchEvent({
  41544. type: "added"
  41545. }),
  41546. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41547. this
  41548. },
  41549. remove: function(e) {
  41550. if (1 < arguments.length)
  41551. for (var t = 0; t < arguments.length; t++)
  41552. this.remove(arguments[t]);
  41553. var i = this.children.indexOf(e);
  41554. -1 !== i && (e.parent = null,
  41555. e.dispatchEvent({
  41556. type: "removed"
  41557. }),
  41558. this.children.splice(i, 1))
  41559. },
  41560. getObjectById: function(e) {
  41561. return this.getObjectByProperty("id", e)
  41562. },
  41563. getObjectByName: function(e) {
  41564. return this.getObjectByProperty("name", e)
  41565. },
  41566. getObjectByProperty: function(e, t) {
  41567. if (this[e] === t)
  41568. return this;
  41569. for (var i = 0, n = this.children.length; i < n; i++) {
  41570. var r = this.children[i].getObjectByProperty(e, t);
  41571. if (void 0 !== r)
  41572. return r
  41573. }
  41574. },
  41575. getWorldPosition: function(e) {
  41576. var t = e || new Ci.Vector3;
  41577. return this.updateMatrixWorld(!0),
  41578. t.setFromMatrixPosition(this.matrixWorld)
  41579. },
  41580. getWorldQuaternion: (s = new Ci.Vector3,
  41581. l = new Ci.Vector3,
  41582. function(e) {
  41583. var t = e || new Ci.Quaternion;
  41584. return this.updateMatrixWorld(!0),
  41585. this.matrixWorld.decompose(s, t, l),
  41586. t
  41587. }
  41588. ),
  41589. getWorldRotation: (a = new Ci.Quaternion,
  41590. function(e) {
  41591. var t = e || new Ci.Euler;
  41592. return this.getWorldQuaternion(a),
  41593. t.setFromQuaternion(a, this.rotation.order, !1)
  41594. }
  41595. ),
  41596. getWorldScale: (r = new Ci.Vector3,
  41597. o = new Ci.Quaternion,
  41598. function(e) {
  41599. var t = e || new Ci.Vector3;
  41600. return this.updateMatrixWorld(!0),
  41601. this.matrixWorld.decompose(r, o, t),
  41602. t
  41603. }
  41604. ),
  41605. getWorldDirection: (n = new Ci.Quaternion,
  41606. function(e) {
  41607. var t = e || new Ci.Vector3;
  41608. return this.getWorldQuaternion(n),
  41609. t.set(0, 0, 1).applyQuaternion(n)
  41610. }
  41611. ),
  41612. raycast: function() {},
  41613. traverse: function(e) {
  41614. e(this);
  41615. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41616. t[i].traverse(e)
  41617. },
  41618. traverseVisible: function(e) {
  41619. if (!1 !== this.visible) {
  41620. e(this);
  41621. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41622. t[i].traverseVisible(e)
  41623. }
  41624. },
  41625. traverseAncestors: function(e) {
  41626. var t = this.parent;
  41627. null !== t && (e(t),
  41628. t.traverseAncestors(e))
  41629. },
  41630. updateMatrix: function() {
  41631. this.matrix.compose(this.position, this.quaternion, this.scale),
  41632. this.matrixWorldNeedsUpdate = !0
  41633. },
  41634. updateMatrixWorld: function(e) {
  41635. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41636. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41637. e = !(this.matrixWorldNeedsUpdate = !1));
  41638. for (var t = 0, i = this.children.length; t < i; t++)
  41639. this.children[t].updateMatrixWorld(e)
  41640. },
  41641. toJSON: function(e) {
  41642. function t(e) {
  41643. var t = [];
  41644. for (var i in e) {
  41645. var n = e[i];
  41646. delete n.metadata,
  41647. t.push(n)
  41648. }
  41649. return t
  41650. }
  41651. var i = void 0 === e
  41652. , n = {};
  41653. i && (e = {
  41654. geometries: {},
  41655. materials: {},
  41656. textures: {},
  41657. images: {}
  41658. },
  41659. n.metadata = {
  41660. version: 4.4,
  41661. type: "Object",
  41662. generator: "Object3D.toJSON"
  41663. });
  41664. var r = {};
  41665. if (r.uuid = this.uuid,
  41666. r.type = this.type,
  41667. "" !== this.name && (r.name = this.name),
  41668. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41669. !0 === this.castShadow && (r.castShadow = !0),
  41670. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41671. !1 === this.visible && (r.visible = !1),
  41672. r.matrix = this.matrix.toArray(),
  41673. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41674. r.geometry = this.geometry.uuid),
  41675. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41676. r.material = this.material.uuid),
  41677. 0 < this.children.length) {
  41678. r.children = [];
  41679. for (var o = 0; o < this.children.length; o++)
  41680. r.children.push(this.children[o].toJSON(e).object)
  41681. }
  41682. if (i) {
  41683. var a = t(e.geometries)
  41684. , s = t(e.materials)
  41685. , l = t(e.textures)
  41686. , c = t(e.images);
  41687. 0 < a.length && (n.geometries = a),
  41688. 0 < s.length && (n.materials = s),
  41689. 0 < l.length && (n.textures = l),
  41690. 0 < c.length && (n.images = c)
  41691. }
  41692. return n.object = r,
  41693. n
  41694. },
  41695. clone: function(e) {
  41696. return (new this.constructor).copy(this, e)
  41697. },
  41698. copy: function(e, t) {
  41699. if (void 0 === t && (t = !0),
  41700. this.name = e.name,
  41701. this.up.copy(e.up),
  41702. this.position.copy(e.position),
  41703. this.quaternion.copy(e.quaternion),
  41704. this.scale.copy(e.scale),
  41705. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41706. this.matrix.copy(e.matrix),
  41707. this.matrixWorld.copy(e.matrixWorld),
  41708. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41709. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41710. this.visible = e.visible,
  41711. this.castShadow = e.castShadow,
  41712. this.receiveShadow = e.receiveShadow,
  41713. this.frustumCulled = e.frustumCulled,
  41714. this.renderOrder = e.renderOrder,
  41715. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41716. !0 === t)
  41717. for (var i = 0; i < e.children.length; i++) {
  41718. var n = e.children[i];
  41719. this.add(n.clone())
  41720. }
  41721. return this
  41722. }
  41723. },
  41724. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41725. Ci.Object3DIdCount = 0,
  41726. Ci.Face3 = function(e, t, i, n, r, o) {
  41727. this.a = e,
  41728. this.b = t,
  41729. this.c = i,
  41730. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41731. this.vertexNormals = Array.isArray(n) ? n : [],
  41732. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41733. this.vertexColors = Array.isArray(r) ? r : [],
  41734. this.materialIndex = void 0 !== o ? o : 0
  41735. }
  41736. ,
  41737. Ci.Face3.prototype = {
  41738. constructor: Ci.Face3,
  41739. clone: function() {
  41740. return (new this.constructor).copy(this)
  41741. },
  41742. copy: function(e) {
  41743. this.a = e.a,
  41744. this.b = e.b,
  41745. this.c = e.c,
  41746. this.normal.copy(e.normal),
  41747. this.color.copy(e.color),
  41748. this.materialIndex = e.materialIndex;
  41749. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41750. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41751. for (t = 0,
  41752. i = e.vertexColors.length; t < i; t++)
  41753. this.vertexColors[t] = e.vertexColors[t].clone();
  41754. return this
  41755. }
  41756. },
  41757. Ci.BufferAttribute = function(e, t) {
  41758. this.uuid = Ci.Math.generateUUID(),
  41759. this.array = e,
  41760. this.itemSize = t,
  41761. this.dynamic = !1,
  41762. this.updateRange = {
  41763. offset: 0,
  41764. count: -1
  41765. },
  41766. this.version = 0
  41767. }
  41768. ,
  41769. Ci.BufferAttribute.prototype = {
  41770. constructor: Ci.BufferAttribute,
  41771. get count() {
  41772. return this.array.length / this.itemSize
  41773. },
  41774. set needsUpdate(e) {
  41775. !0 === e && this.version++
  41776. },
  41777. setDynamic: function(e) {
  41778. return this.dynamic = e,
  41779. this
  41780. },
  41781. copy: function(e) {
  41782. return this.array = new e.array.constructor(e.array),
  41783. this.itemSize = e.itemSize,
  41784. this.dynamic = e.dynamic,
  41785. this
  41786. },
  41787. copyAt: function(e, t, i) {
  41788. e *= this.itemSize,
  41789. i *= t.itemSize;
  41790. for (var n = 0, r = this.itemSize; n < r; n++)
  41791. this.array[e + n] = t.array[i + n];
  41792. return this
  41793. },
  41794. copyArray: function(e) {
  41795. return this.array.set(e),
  41796. this
  41797. },
  41798. copyColorsArray: function(e) {
  41799. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41800. var o = e[n];
  41801. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41802. o = new Ci.Color),
  41803. t[i++] = o.r,
  41804. t[i++] = o.g,
  41805. t[i++] = o.b
  41806. }
  41807. return this
  41808. },
  41809. copyIndicesArray: function(e) {
  41810. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41811. var o = e[n];
  41812. t[i++] = o.a,
  41813. t[i++] = o.b,
  41814. t[i++] = o.c
  41815. }
  41816. return this
  41817. },
  41818. copyVector2sArray: function(e) {
  41819. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41820. var o = e[n];
  41821. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41822. o = new Ci.Vector2),
  41823. t[i++] = o.x,
  41824. t[i++] = o.y
  41825. }
  41826. return this
  41827. },
  41828. copyVector3sArray: function(e) {
  41829. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41830. var o = e[n];
  41831. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41832. o = new Ci.Vector3),
  41833. t[i++] = o.x,
  41834. t[i++] = o.y,
  41835. t[i++] = o.z
  41836. }
  41837. return this
  41838. },
  41839. copyVector4sArray: function(e) {
  41840. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41841. var o = e[n];
  41842. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41843. o = new Ci.Vector4),
  41844. t[i++] = o.x,
  41845. t[i++] = o.y,
  41846. t[i++] = o.z,
  41847. t[i++] = o.w
  41848. }
  41849. return this
  41850. },
  41851. set: function(e, t) {
  41852. return void 0 === t && (t = 0),
  41853. this.array.set(e, t),
  41854. this
  41855. },
  41856. getX: function(e) {
  41857. return this.array[e * this.itemSize]
  41858. },
  41859. setX: function(e, t) {
  41860. return this.array[e * this.itemSize] = t,
  41861. this
  41862. },
  41863. getY: function(e) {
  41864. return this.array[e * this.itemSize + 1]
  41865. },
  41866. setY: function(e, t) {
  41867. return this.array[e * this.itemSize + 1] = t,
  41868. this
  41869. },
  41870. getZ: function(e) {
  41871. return this.array[e * this.itemSize + 2]
  41872. },
  41873. setZ: function(e, t) {
  41874. return this.array[e * this.itemSize + 2] = t,
  41875. this
  41876. },
  41877. getW: function(e) {
  41878. return this.array[e * this.itemSize + 3]
  41879. },
  41880. setW: function(e, t) {
  41881. return this.array[e * this.itemSize + 3] = t,
  41882. this
  41883. },
  41884. setXY: function(e, t, i) {
  41885. return e *= this.itemSize,
  41886. this.array[e + 0] = t,
  41887. this.array[e + 1] = i,
  41888. this
  41889. },
  41890. setXYZ: function(e, t, i, n) {
  41891. return e *= this.itemSize,
  41892. this.array[e + 0] = t,
  41893. this.array[e + 1] = i,
  41894. this.array[e + 2] = n,
  41895. this
  41896. },
  41897. setXYZW: function(e, t, i, n, r) {
  41898. return e *= this.itemSize,
  41899. this.array[e + 0] = t,
  41900. this.array[e + 1] = i,
  41901. this.array[e + 2] = n,
  41902. this.array[e + 3] = r,
  41903. this
  41904. },
  41905. clone: function() {
  41906. return (new this.constructor).copy(this)
  41907. }
  41908. },
  41909. Ci.Int8Attribute = function(e, t) {
  41910. return new Ci.BufferAttribute(new Int8Array(e),t)
  41911. }
  41912. ,
  41913. Ci.Uint8Attribute = function(e, t) {
  41914. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41915. }
  41916. ,
  41917. Ci.Uint8ClampedAttribute = function(e, t) {
  41918. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41919. }
  41920. ,
  41921. Ci.Int16Attribute = function(e, t) {
  41922. return new Ci.BufferAttribute(new Int16Array(e),t)
  41923. }
  41924. ,
  41925. Ci.Uint16Attribute = function(e, t) {
  41926. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41927. }
  41928. ,
  41929. Ci.Int32Attribute = function(e, t) {
  41930. return new Ci.BufferAttribute(new Int32Array(e),t)
  41931. }
  41932. ,
  41933. Ci.Uint32Attribute = function(e, t) {
  41934. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41935. }
  41936. ,
  41937. Ci.Float32Attribute = function(e, t) {
  41938. return new Ci.BufferAttribute(new Float32Array(e),t)
  41939. }
  41940. ,
  41941. Ci.Float64Attribute = function(e, t) {
  41942. return new Ci.BufferAttribute(new Float64Array(e),t)
  41943. }
  41944. ,
  41945. Ci.DynamicBufferAttribute = function(e, t) {
  41946. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41947. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41948. }
  41949. ,
  41950. Ci.InstancedBufferAttribute = function(e, t, i) {
  41951. Ci.BufferAttribute.call(this, e, t),
  41952. this.meshPerAttribute = i || 1
  41953. }
  41954. ,
  41955. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41956. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41957. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41958. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41959. this.meshPerAttribute = e.meshPerAttribute,
  41960. this
  41961. }
  41962. ,
  41963. Ci.InterleavedBuffer = function(e, t) {
  41964. this.uuid = Ci.Math.generateUUID(),
  41965. this.array = e,
  41966. this.stride = t,
  41967. this.dynamic = !1,
  41968. this.updateRange = {
  41969. offset: 0,
  41970. count: -1
  41971. },
  41972. this.version = 0
  41973. }
  41974. ,
  41975. Ci.InterleavedBuffer.prototype = {
  41976. constructor: Ci.InterleavedBuffer,
  41977. get length() {
  41978. return this.array.length
  41979. },
  41980. get count() {
  41981. return this.array.length / this.stride
  41982. },
  41983. set needsUpdate(e) {
  41984. !0 === e && this.version++
  41985. },
  41986. setDynamic: function(e) {
  41987. return this.dynamic = e,
  41988. this
  41989. },
  41990. copy: function(e) {
  41991. return this.array = new e.array.constructor(e.array),
  41992. this.stride = e.stride,
  41993. this.dynamic = e.dynamic,
  41994. this
  41995. },
  41996. copyAt: function(e, t, i) {
  41997. e *= this.stride,
  41998. i *= t.stride;
  41999. for (var n = 0, r = this.stride; n < r; n++)
  42000. this.array[e + n] = t.array[i + n];
  42001. return this
  42002. },
  42003. set: function(e, t) {
  42004. return void 0 === t && (t = 0),
  42005. this.array.set(e, t),
  42006. this
  42007. },
  42008. clone: function() {
  42009. return (new this.constructor).copy(this)
  42010. }
  42011. },
  42012. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42013. Ci.InterleavedBuffer.call(this, e, t),
  42014. this.meshPerAttribute = i || 1
  42015. }
  42016. ,
  42017. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42018. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42019. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42020. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42021. this.meshPerAttribute = e.meshPerAttribute,
  42022. this
  42023. }
  42024. ,
  42025. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42026. this.uuid = Ci.Math.generateUUID(),
  42027. this.data = e,
  42028. this.itemSize = t,
  42029. this.offset = i
  42030. }
  42031. ,
  42032. Ci.InterleavedBufferAttribute.prototype = {
  42033. constructor: Ci.InterleavedBufferAttribute,
  42034. get length() {
  42035. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42036. this.array.length
  42037. },
  42038. get count() {
  42039. return this.data.count
  42040. },
  42041. setX: function(e, t) {
  42042. return this.data.array[e * this.data.stride + this.offset] = t,
  42043. this
  42044. },
  42045. setY: function(e, t) {
  42046. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42047. this
  42048. },
  42049. setZ: function(e, t) {
  42050. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42051. this
  42052. },
  42053. setW: function(e, t) {
  42054. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42055. this
  42056. },
  42057. getX: function(e) {
  42058. return this.data.array[e * this.data.stride + this.offset]
  42059. },
  42060. getY: function(e) {
  42061. return this.data.array[e * this.data.stride + this.offset + 1]
  42062. },
  42063. getZ: function(e) {
  42064. return this.data.array[e * this.data.stride + this.offset + 2]
  42065. },
  42066. getW: function(e) {
  42067. return this.data.array[e * this.data.stride + this.offset + 3]
  42068. },
  42069. setXY: function(e, t, i) {
  42070. return e = e * this.data.stride + this.offset,
  42071. this.data.array[e + 0] = t,
  42072. this.data.array[e + 1] = i,
  42073. this
  42074. },
  42075. setXYZ: function(e, t, i, n) {
  42076. return e = e * this.data.stride + this.offset,
  42077. this.data.array[e + 0] = t,
  42078. this.data.array[e + 1] = i,
  42079. this.data.array[e + 2] = n,
  42080. this
  42081. },
  42082. setXYZW: function(e, t, i, n, r) {
  42083. return e = e * this.data.stride + this.offset,
  42084. this.data.array[e + 0] = t,
  42085. this.data.array[e + 1] = i,
  42086. this.data.array[e + 2] = n,
  42087. this.data.array[e + 3] = r,
  42088. this
  42089. }
  42090. },
  42091. Ci.Geometry = function() {
  42092. Object.defineProperty(this, "id", {
  42093. value: Ci.GeometryIdCount++
  42094. }),
  42095. this.uuid = Ci.Math.generateUUID(),
  42096. this.name = "",
  42097. this.type = "Geometry",
  42098. this.vertices = [],
  42099. this.colors = [],
  42100. this.faces = [],
  42101. this.faceVertexUvs = [[]],
  42102. this.morphTargets = [],
  42103. this.morphNormals = [],
  42104. this.skinWeights = [],
  42105. this.skinIndices = [],
  42106. this.lineDistances = [],
  42107. this.boundingBox = null,
  42108. this.boundingSphere = null,
  42109. this.verticesNeedUpdate = !1,
  42110. this.elementsNeedUpdate = !1,
  42111. this.uvsNeedUpdate = !1,
  42112. this.normalsNeedUpdate = !1,
  42113. this.colorsNeedUpdate = !1,
  42114. this.lineDistancesNeedUpdate = !1,
  42115. this.groupsNeedUpdate = !1
  42116. }
  42117. ,
  42118. Ci.Geometry.prototype = {
  42119. constructor: Ci.Geometry,
  42120. applyMatrix: function(e) {
  42121. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42122. this.vertices[i].applyMatrix4(e)
  42123. }
  42124. for (i = 0,
  42125. n = this.faces.length; i < n; i++) {
  42126. var r = this.faces[i];
  42127. r.normal.applyMatrix3(t).normalize();
  42128. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42129. r.vertexNormals[o].applyMatrix3(t).normalize()
  42130. }
  42131. return null !== this.boundingBox && this.computeBoundingBox(),
  42132. null !== this.boundingSphere && this.computeBoundingSphere(),
  42133. this.verticesNeedUpdate = !0,
  42134. this.normalsNeedUpdate = !0,
  42135. this
  42136. },
  42137. rotateX: function(e) {
  42138. return void 0 === mt && (mt = new Ci.Matrix4),
  42139. mt.makeRotationX(e),
  42140. this.applyMatrix(mt),
  42141. this
  42142. },
  42143. rotateY: function(e) {
  42144. return void 0 === gt && (gt = new Ci.Matrix4),
  42145. gt.makeRotationY(e),
  42146. this.applyMatrix(gt),
  42147. this
  42148. },
  42149. rotateZ: function(e) {
  42150. return void 0 === ft && (ft = new Ci.Matrix4),
  42151. ft.makeRotationZ(e),
  42152. this.applyMatrix(ft),
  42153. this
  42154. },
  42155. translate: function(e, t, i) {
  42156. return void 0 === pt && (pt = new Ci.Matrix4),
  42157. pt.makeTranslation(e, t, i),
  42158. this.applyMatrix(pt),
  42159. this
  42160. },
  42161. scale: function(e, t, i) {
  42162. return void 0 === dt && (dt = new Ci.Matrix4),
  42163. dt.makeScale(e, t, i),
  42164. this.applyMatrix(dt),
  42165. this
  42166. },
  42167. lookAt: function(e) {
  42168. void 0 === ut && (ut = new Ci.Object3D),
  42169. ut.lookAt(e),
  42170. ut.updateMatrix(),
  42171. this.applyMatrix(ut.matrix)
  42172. },
  42173. fromBufferGeometry: function(e) {
  42174. function t(e, t, i, n) {
  42175. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42176. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42177. , a = new Ci.Face3(e,t,i,r,o,n);
  42178. s.faces.push(a),
  42179. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42180. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42181. }
  42182. var s = this
  42183. , i = null !== e.index ? e.index.array : void 0
  42184. , n = e.attributes
  42185. , r = n.position.array
  42186. , l = void 0 !== n.normal ? n.normal.array : void 0
  42187. , c = void 0 !== n.color ? n.color.array : void 0
  42188. , h = void 0 !== n.uv ? n.uv.array : void 0
  42189. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42190. void 0 !== u && (this.faceVertexUvs[1] = []);
  42191. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42192. a += 2)
  42193. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42194. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42195. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42196. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42197. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42198. if (void 0 !== i) {
  42199. var g = e.groups;
  42200. if (0 < g.length)
  42201. for (o = 0; o < g.length; o++)
  42202. for (var m = g[o], v = m.start, y = (a = v,
  42203. v + m.count); a < y; a += 3)
  42204. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42205. else
  42206. for (o = 0; o < i.length; o += 3)
  42207. t(i[o], i[o + 1], i[o + 2])
  42208. } else
  42209. for (o = 0; o < r.length / 3; o += 3)
  42210. t(o, o + 1, o + 2);
  42211. return this.computeFaceNormals(),
  42212. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42213. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42214. this
  42215. },
  42216. center: function() {
  42217. this.computeBoundingBox();
  42218. var e = this.boundingBox.center().negate();
  42219. return this.translate(e.x, e.y, e.z),
  42220. e
  42221. },
  42222. normalize: function() {
  42223. this.computeBoundingSphere();
  42224. var e = this.boundingSphere.center
  42225. , t = this.boundingSphere.radius
  42226. , i = 0 === t ? 1 : 1 / t
  42227. , n = new Ci.Matrix4;
  42228. 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),
  42229. this.applyMatrix(n),
  42230. this
  42231. },
  42232. computeFaceNormals: function() {
  42233. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42234. var r = this.faces[i]
  42235. , o = this.vertices[r.a]
  42236. , a = this.vertices[r.b]
  42237. , s = this.vertices[r.c];
  42238. e.subVectors(s, a),
  42239. t.subVectors(o, a),
  42240. e.cross(t),
  42241. e.normalize(),
  42242. r.normal.copy(e)
  42243. }
  42244. },
  42245. computeVertexNormals: function(e) {
  42246. var t, i, n, r, o, a;
  42247. for (void 0 === e && (e = !0),
  42248. a = new Array(this.vertices.length),
  42249. t = 0,
  42250. i = this.vertices.length; t < i; t++)
  42251. a[t] = new Ci.Vector3;
  42252. if (e) {
  42253. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42254. for (n = 0,
  42255. r = this.faces.length; n < r; n++)
  42256. o = this.faces[n],
  42257. s = this.vertices[o.a],
  42258. l = this.vertices[o.b],
  42259. c = this.vertices[o.c],
  42260. h.subVectors(c, l),
  42261. u.subVectors(s, l),
  42262. h.cross(u),
  42263. a[o.a].add(h),
  42264. a[o.b].add(h),
  42265. a[o.c].add(h)
  42266. } else
  42267. for (n = 0,
  42268. r = this.faces.length; n < r; n++)
  42269. a[(o = this.faces[n]).a].add(o.normal),
  42270. a[o.b].add(o.normal),
  42271. a[o.c].add(o.normal);
  42272. for (t = 0,
  42273. i = this.vertices.length; t < i; t++)
  42274. a[t].normalize();
  42275. for (n = 0,
  42276. r = this.faces.length; n < r; n++) {
  42277. var d = (o = this.faces[n]).vertexNormals;
  42278. 3 === d.length ? (d[0].copy(a[o.a]),
  42279. d[1].copy(a[o.b]),
  42280. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42281. d[1] = a[o.b].clone(),
  42282. d[2] = a[o.c].clone())
  42283. }
  42284. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42285. },
  42286. computeMorphNormals: function() {
  42287. var e, t, i, n, r;
  42288. for (i = 0,
  42289. n = this.faces.length; i < n; i++)
  42290. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42291. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42292. e = 0,
  42293. t = r.vertexNormals.length; e < t; e++)
  42294. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42295. var o = new Ci.Geometry;
  42296. for (o.faces = this.faces,
  42297. e = 0,
  42298. t = this.morphTargets.length; e < t; e++) {
  42299. if (!this.morphNormals[e]) {
  42300. this.morphNormals[e] = {},
  42301. this.morphNormals[e].faceNormals = [],
  42302. this.morphNormals[e].vertexNormals = [];
  42303. var a = this.morphNormals[e].faceNormals
  42304. , s = this.morphNormals[e].vertexNormals;
  42305. for (i = 0,
  42306. n = this.faces.length; i < n; i++)
  42307. l = new Ci.Vector3,
  42308. c = {
  42309. a: new Ci.Vector3,
  42310. b: new Ci.Vector3,
  42311. c: new Ci.Vector3
  42312. },
  42313. a.push(l),
  42314. s.push(c)
  42315. }
  42316. var l, c, h = this.morphNormals[e];
  42317. for (o.vertices = this.morphTargets[e].vertices,
  42318. o.computeFaceNormals(),
  42319. o.computeVertexNormals(),
  42320. i = 0,
  42321. n = this.faces.length; i < n; i++)
  42322. r = this.faces[i],
  42323. l = h.faceNormals[i],
  42324. c = h.vertexNormals[i],
  42325. l.copy(r.normal),
  42326. c.a.copy(r.vertexNormals[0]),
  42327. c.b.copy(r.vertexNormals[1]),
  42328. c.c.copy(r.vertexNormals[2])
  42329. }
  42330. for (i = 0,
  42331. n = this.faces.length; i < n; i++)
  42332. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42333. r.vertexNormals = r.__originalVertexNormals
  42334. },
  42335. computeTangents: function() {
  42336. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42337. },
  42338. computeLineDistances: function() {
  42339. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42340. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42341. this.lineDistances[i] = e
  42342. },
  42343. computeBoundingBox: function() {
  42344. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42345. this.boundingBox.setFromPoints(this.vertices)
  42346. },
  42347. computeBoundingSphere: function() {
  42348. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42349. this.boundingSphere.setFromPoints(this.vertices)
  42350. },
  42351. merge: function(e, t, i) {
  42352. if (e instanceof Ci.Geometry != 0) {
  42353. 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];
  42354. void 0 === i && (i = 0),
  42355. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42356. for (var u = 0, d = a.length; u < d; u++) {
  42357. var p = a[u].clone();
  42358. void 0 !== t && p.applyMatrix4(t),
  42359. o.push(p)
  42360. }
  42361. for (u = 0,
  42362. d = l.length; u < d; u++) {
  42363. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42364. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42365. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42366. for (var C = 0, I = y.length; C < I; C++)
  42367. g = y[C].clone(),
  42368. void 0 !== n && g.applyMatrix3(n).normalize(),
  42369. f.vertexNormals.push(g);
  42370. f.color.copy(v.color);
  42371. for (C = 0,
  42372. I = A.length; C < I; C++)
  42373. m = A[C],
  42374. f.vertexColors.push(m.clone());
  42375. f.materialIndex = v.materialIndex + i,
  42376. s.push(f)
  42377. }
  42378. for (u = 0,
  42379. d = h.length; u < d; u++) {
  42380. var E = h[u]
  42381. , _ = [];
  42382. if (void 0 !== E) {
  42383. for (C = 0,
  42384. I = E.length; C < I; C++)
  42385. _.push(E[C].clone());
  42386. c.push(_)
  42387. }
  42388. }
  42389. } else
  42390. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42391. },
  42392. mergeMesh: function(e) {
  42393. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42394. void this.merge(e.geometry, e.matrix))
  42395. },
  42396. mergeVertices: function() {
  42397. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42398. for (i = 0,
  42399. n = this.vertices.length; i < n; i++)
  42400. e = this.vertices[i],
  42401. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42402. c.push(this.vertices[i]),
  42403. h[i] = c.length - 1) : h[i] = h[l[t]];
  42404. var d = [];
  42405. for (i = 0,
  42406. n = this.faces.length; i < n; i++) {
  42407. (r = this.faces[i]).a = h[r.a],
  42408. r.b = h[r.b],
  42409. r.c = h[r.c],
  42410. o = [r.a, r.b, r.c];
  42411. for (var p = 0; p < 3; p++)
  42412. if (o[p] === o[(p + 1) % 3]) {
  42413. p,
  42414. d.push(i);
  42415. break
  42416. }
  42417. }
  42418. for (i = d.length - 1; 0 <= i; i--) {
  42419. var f = d[i];
  42420. for (this.faces.splice(f, 1),
  42421. a = 0,
  42422. s = this.faceVertexUvs.length; a < s; a++)
  42423. this.faceVertexUvs[a].splice(f, 1)
  42424. }
  42425. var g = this.vertices.length - c.length;
  42426. return this.vertices = c,
  42427. g
  42428. },
  42429. sortFacesByMaterialIndex: function() {
  42430. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42431. e[i]._id = i;
  42432. e.sort(function(e, t) {
  42433. return e.materialIndex - t.materialIndex
  42434. });
  42435. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42436. o && o.length === t && (n = []),
  42437. a && a.length === t && (r = []);
  42438. for (i = 0; i < t; i++) {
  42439. var s = e[i]._id;
  42440. n && n.push(o[s]),
  42441. r && r.push(a[s])
  42442. }
  42443. n && (this.faceVertexUvs[0] = n),
  42444. r && (this.faceVertexUvs[1] = r)
  42445. },
  42446. toJSON: function() {
  42447. function e(e, t, i) {
  42448. return i ? e | 1 << t : e & ~(1 << t)
  42449. }
  42450. function t(e) {
  42451. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42452. return void 0 !== d[t] || (d[t] = u.length / 3,
  42453. u.push(e.x, e.y, e.z)),
  42454. d[t]
  42455. }
  42456. function i(e) {
  42457. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42458. return void 0 !== f[t] || (f[t] = p.length,
  42459. p.push(e.getHex())),
  42460. f[t]
  42461. }
  42462. function n(e) {
  42463. var t = e.x.toString() + e.y.toString();
  42464. return void 0 !== m[t] || (m[t] = g.length / 2,
  42465. g.push(e.x, e.y)),
  42466. m[t]
  42467. }
  42468. var r = {
  42469. metadata: {
  42470. version: 4.4,
  42471. type: "Geometry",
  42472. generator: "Geometry.toJSON"
  42473. }
  42474. };
  42475. if (r.uuid = this.uuid,
  42476. r.type = this.type,
  42477. "" !== this.name && (r.name = this.name),
  42478. void 0 !== this.parameters) {
  42479. var o = this.parameters;
  42480. for (var a in o)
  42481. void 0 !== o[a] && (r[a] = o[a]);
  42482. return r
  42483. }
  42484. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42485. var c = this.vertices[l];
  42486. s.push(c.x, c.y, c.z)
  42487. }
  42488. var h = []
  42489. , u = []
  42490. , d = {}
  42491. , p = []
  42492. , f = {}
  42493. , g = []
  42494. , m = {};
  42495. for (l = 0; l < this.faces.length; l++) {
  42496. var v = this.faces[l]
  42497. , y = void 0 !== this.faceVertexUvs[0][l]
  42498. , A = 0 < v.normal.length()
  42499. , C = 0 < v.vertexNormals.length
  42500. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42501. , E = 0 < v.vertexColors.length
  42502. , _ = 0;
  42503. 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),
  42504. h.push(_),
  42505. h.push(v.a, v.b, v.c),
  42506. h.push(v.materialIndex),
  42507. y) {
  42508. var b = this.faceVertexUvs[0][l];
  42509. h.push(n(b[0]), n(b[1]), n(b[2]))
  42510. }
  42511. if (A && h.push(t(v.normal)),
  42512. C) {
  42513. var w = v.vertexNormals;
  42514. h.push(t(w[0]), t(w[1]), t(w[2]))
  42515. }
  42516. if (I && h.push(i(v.color)),
  42517. E) {
  42518. var T = v.vertexColors;
  42519. h.push(i(T[0]), i(T[1]), i(T[2]))
  42520. }
  42521. }
  42522. return r.data = {},
  42523. r.data.vertices = s,
  42524. r.data.normals = u,
  42525. 0 < p.length && (r.data.colors = p),
  42526. 0 < g.length && (r.data.uvs = [g]),
  42527. r.data.faces = h,
  42528. r
  42529. },
  42530. clone: function() {
  42531. return (new Ci.Geometry).copy(this)
  42532. },
  42533. copy: function(e) {
  42534. this.vertices = [],
  42535. this.faces = [],
  42536. this.faceVertexUvs = [[]];
  42537. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42538. this.vertices.push(t[i].clone());
  42539. var r = e.faces;
  42540. for (i = 0,
  42541. n = r.length; i < n; i++)
  42542. this.faces.push(r[i].clone());
  42543. for (i = 0,
  42544. n = e.faceVertexUvs.length; i < n; i++) {
  42545. var o = e.faceVertexUvs[i];
  42546. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42547. for (var a = 0, s = o.length; a < s; a++) {
  42548. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42549. var d = l[h];
  42550. c.push(d.clone())
  42551. }
  42552. this.faceVertexUvs[i].push(c)
  42553. }
  42554. }
  42555. return this
  42556. },
  42557. dispose: function() {
  42558. this.dispatchEvent({
  42559. type: "dispose"
  42560. })
  42561. }
  42562. },
  42563. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42564. Ci.GeometryIdCount = 0,
  42565. Ci.DirectGeometry = function() {
  42566. Object.defineProperty(this, "id", {
  42567. value: Ci.GeometryIdCount++
  42568. }),
  42569. this.uuid = Ci.Math.generateUUID(),
  42570. this.name = "",
  42571. this.type = "DirectGeometry",
  42572. this.indices = [],
  42573. this.vertices = [],
  42574. this.normals = [],
  42575. this.colors = [],
  42576. this.uvs = [],
  42577. this.uvs2 = [],
  42578. this.groups = [],
  42579. this.morphTargets = {},
  42580. this.skinWeights = [],
  42581. this.skinIndices = [],
  42582. this.boundingBox = null,
  42583. this.boundingSphere = null,
  42584. this.verticesNeedUpdate = !1,
  42585. this.normalsNeedUpdate = !1,
  42586. this.colorsNeedUpdate = !1,
  42587. this.uvsNeedUpdate = !1,
  42588. this.groupsNeedUpdate = !1
  42589. }
  42590. ,
  42591. Ci.DirectGeometry.prototype = {
  42592. constructor: Ci.DirectGeometry,
  42593. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42594. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42595. computeFaceNormals: function() {
  42596. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42597. },
  42598. computeVertexNormals: function() {
  42599. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42600. },
  42601. computeGroups: function(e) {
  42602. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42603. var a = r[o];
  42604. a.materialIndex !== i && (i = a.materialIndex,
  42605. void 0 !== t && (t.count = 3 * o - t.start,
  42606. n.push(t)),
  42607. t = {
  42608. start: 3 * o,
  42609. materialIndex: i
  42610. })
  42611. }
  42612. void 0 !== t && (t.count = 3 * o - t.start,
  42613. n.push(t)),
  42614. this.groups = n
  42615. },
  42616. fromGeometry: function(e) {
  42617. 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;
  42618. if (0 < l) {
  42619. t = [];
  42620. for (var c = 0; c < l; c++)
  42621. t[c] = [];
  42622. this.morphTargets.position = t
  42623. }
  42624. var h, u = e.morphNormals, d = u.length;
  42625. if (0 < d) {
  42626. h = [];
  42627. for (c = 0; c < d; c++)
  42628. h[c] = [];
  42629. this.morphTargets.normal = h
  42630. }
  42631. var p = e.skinIndices
  42632. , f = e.skinWeights
  42633. , g = p.length === n.length
  42634. , m = f.length === n.length;
  42635. for (c = 0; c < i.length; c++) {
  42636. var v = i[c];
  42637. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42638. var y = v.vertexNormals;
  42639. if (3 === y.length)
  42640. this.normals.push(y[0], y[1], y[2]);
  42641. else {
  42642. var A = v.normal;
  42643. this.normals.push(A, A, A)
  42644. }
  42645. var C, I = v.vertexColors;
  42646. if (3 === I.length)
  42647. this.colors.push(I[0], I[1], I[2]);
  42648. else {
  42649. var E = v.color;
  42650. this.colors.push(E, E, E)
  42651. }
  42652. if (!0 === o)
  42653. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42654. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42655. if (!0 === a)
  42656. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42657. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42658. for (var _ = 0; _ < l; _++) {
  42659. var b = s[_].vertices;
  42660. t[_].push(b[v.a], b[v.b], b[v.c])
  42661. }
  42662. for (_ = 0; _ < d; _++) {
  42663. var w = u[_].vertexNormals[c];
  42664. h[_].push(w.a, w.b, w.c)
  42665. }
  42666. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42667. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42668. }
  42669. return this.computeGroups(e),
  42670. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42671. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42672. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42673. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42674. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42675. this
  42676. },
  42677. dispose: function() {
  42678. this.dispatchEvent({
  42679. type: "dispose"
  42680. })
  42681. }
  42682. },
  42683. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42684. Ci.BufferGeometry = function() {
  42685. Object.defineProperty(this, "id", {
  42686. value: Ci.GeometryIdCount++
  42687. }),
  42688. this.uuid = Ci.Math.generateUUID(),
  42689. this.name = "",
  42690. this.type = "BufferGeometry",
  42691. this.index = null,
  42692. this.attributes = {},
  42693. this.morphAttributes = {},
  42694. this.groups = [],
  42695. this.boundingBox = null,
  42696. this.boundingSphere = null,
  42697. this.drawRange = {
  42698. start: 0,
  42699. count: 1 / 0
  42700. }
  42701. }
  42702. ,
  42703. Ci.BufferGeometry.prototype = {
  42704. constructor: Ci.BufferGeometry,
  42705. getIndex: function() {
  42706. return this.index
  42707. },
  42708. setIndex: function(e) {
  42709. this.index = e
  42710. },
  42711. addAttribute: function(e, t) {
  42712. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42713. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42714. void this.setIndex(t)) : (this.attributes[e] = t,
  42715. this)
  42716. },
  42717. getAttribute: function(e) {
  42718. return this.attributes[e]
  42719. },
  42720. removeAttribute: function(e) {
  42721. return delete this.attributes[e],
  42722. this
  42723. },
  42724. addGroup: function(e, t, i) {
  42725. this.groups.push({
  42726. start: e,
  42727. count: t,
  42728. materialIndex: void 0 !== i ? i : 0
  42729. })
  42730. },
  42731. clearGroups: function() {
  42732. this.groups = []
  42733. },
  42734. setDrawRange: function(e, t) {
  42735. this.drawRange.start = e,
  42736. this.drawRange.count = t
  42737. },
  42738. applyMatrix: function(e) {
  42739. var t = this.attributes.position;
  42740. void 0 !== t && (e.applyToVector3Array(t.array),
  42741. t.needsUpdate = !0);
  42742. var i = this.attributes.normal;
  42743. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42744. i.needsUpdate = !0);
  42745. return null !== this.boundingBox && this.computeBoundingBox(),
  42746. null !== this.boundingSphere && this.computeBoundingSphere(),
  42747. this
  42748. },
  42749. rotateX: function(e) {
  42750. return void 0 === ht && (ht = new Ci.Matrix4),
  42751. ht.makeRotationX(e),
  42752. this.applyMatrix(ht),
  42753. this
  42754. },
  42755. rotateY: function(e) {
  42756. return void 0 === ct && (ct = new Ci.Matrix4),
  42757. ct.makeRotationY(e),
  42758. this.applyMatrix(ct),
  42759. this
  42760. },
  42761. rotateZ: function(e) {
  42762. return void 0 === lt && (lt = new Ci.Matrix4),
  42763. lt.makeRotationZ(e),
  42764. this.applyMatrix(lt),
  42765. this
  42766. },
  42767. translate: function(e, t, i) {
  42768. return void 0 === st && (st = new Ci.Matrix4),
  42769. st.makeTranslation(e, t, i),
  42770. this.applyMatrix(st),
  42771. this
  42772. },
  42773. scale: function(e, t, i) {
  42774. return void 0 === at && (at = new Ci.Matrix4),
  42775. at.makeScale(e, t, i),
  42776. this.applyMatrix(at),
  42777. this
  42778. },
  42779. lookAt: function(e) {
  42780. void 0 === ot && (ot = new Ci.Object3D),
  42781. ot.lookAt(e),
  42782. ot.updateMatrix(),
  42783. this.applyMatrix(ot.matrix)
  42784. },
  42785. center: function() {
  42786. this.computeBoundingBox();
  42787. var e = this.boundingBox.center().negate();
  42788. return this.translate(e.x, e.y, e.z),
  42789. e
  42790. },
  42791. setFromObject: function(e) {
  42792. var t = e.geometry;
  42793. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42794. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42795. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42796. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42797. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42798. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42799. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42800. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42801. }
  42802. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42803. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42804. } else
  42805. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42806. return this
  42807. },
  42808. updateFromObject: function(e) {
  42809. var t, i = e.geometry;
  42810. if (e instanceof Ci.Mesh) {
  42811. var n = i.__directGeometry;
  42812. if (void 0 === n)
  42813. return this.fromGeometry(i);
  42814. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42815. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42816. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42817. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42818. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42819. i.verticesNeedUpdate = !1,
  42820. i.normalsNeedUpdate = !1,
  42821. i.colorsNeedUpdate = !1,
  42822. i.uvsNeedUpdate = !1,
  42823. i.groupsNeedUpdate = !1,
  42824. i = n
  42825. }
  42826. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42827. t.needsUpdate = !0),
  42828. i.verticesNeedUpdate = !1);
  42829. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42830. t.needsUpdate = !0),
  42831. i.normalsNeedUpdate = !1);
  42832. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42833. t.needsUpdate = !0),
  42834. i.colorsNeedUpdate = !1);
  42835. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42836. t.needsUpdate = !0),
  42837. i.uvsNeedUpdate = !1);
  42838. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42839. t.needsUpdate = !0),
  42840. i.lineDistancesNeedUpdate = !1);
  42841. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42842. this.groups = i.groups,
  42843. i.groupsNeedUpdate = !1),
  42844. this
  42845. },
  42846. fromGeometry: function(e) {
  42847. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42848. this.fromDirectGeometry(e.__directGeometry)
  42849. },
  42850. fromDirectGeometry: function(e) {
  42851. var t = new Float32Array(3 * e.vertices.length);
  42852. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42853. 0 < e.normals.length) {
  42854. var i = new Float32Array(3 * e.normals.length);
  42855. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42856. }
  42857. if (0 < e.colors.length) {
  42858. var n = new Float32Array(3 * e.colors.length);
  42859. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42860. }
  42861. if (0 < e.uvs.length) {
  42862. var r = new Float32Array(2 * e.uvs.length);
  42863. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42864. }
  42865. if (0 < e.uvs2.length) {
  42866. var o = new Float32Array(2 * e.uvs2.length);
  42867. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42868. }
  42869. if (0 < e.indices.length) {
  42870. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42871. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42872. }
  42873. for (var s in this.groups = e.groups,
  42874. e.morphTargets) {
  42875. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42876. var d = c[h]
  42877. , p = new Ci.Float32Attribute(3 * d.length,3);
  42878. l.push(p.copyVector3sArray(d))
  42879. }
  42880. this.morphAttributes[s] = l
  42881. }
  42882. if (0 < e.skinIndices.length) {
  42883. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42884. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42885. }
  42886. if (0 < e.skinWeights.length) {
  42887. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42888. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42889. }
  42890. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42891. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42892. this
  42893. },
  42894. computeBoundingBox: (new Ci.Vector3,
  42895. function() {
  42896. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42897. var e = this.attributes.position.array;
  42898. e && this.boundingBox.setFromArray(e),
  42899. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42900. this.boundingBox.max.set(0, 0, 0)),
  42901. (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)
  42902. }
  42903. ),
  42904. computeBoundingSphere: (nt = new Ci.Box3,
  42905. rt = new Ci.Vector3,
  42906. function() {
  42907. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42908. var e = this.attributes.position.array;
  42909. if (e) {
  42910. var t = this.boundingSphere.center;
  42911. nt.setFromArray(e),
  42912. nt.center(t);
  42913. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42914. rt.fromArray(e, n),
  42915. i = Math.max(i, t.distanceToSquared(rt));
  42916. this.boundingSphere.radius = Math.sqrt(i),
  42917. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42918. }
  42919. }
  42920. ),
  42921. computeFaceNormals: function() {},
  42922. computeVertexNormals: function() {
  42923. var e = this.index
  42924. , t = this.attributes
  42925. , i = this.groups;
  42926. if (t.position) {
  42927. var n = t.position.array;
  42928. if (void 0 === t.normal)
  42929. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42930. else
  42931. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42932. r[o] = 0;
  42933. 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;
  42934. if (e) {
  42935. var m = e.array;
  42936. 0 === i.length && this.addGroup(0, m.length);
  42937. for (var v = 0, y = i.length; v < y; ++v) {
  42938. var A = i[v]
  42939. , C = A.start;
  42940. for (o = C,
  42941. a = C + A.count; o < a; o += 3)
  42942. s = 3 * m[o + 0],
  42943. l = 3 * m[o + 1],
  42944. c = 3 * m[o + 2],
  42945. u.fromArray(n, s),
  42946. d.fromArray(n, l),
  42947. p.fromArray(n, c),
  42948. f.subVectors(p, d),
  42949. g.subVectors(u, d),
  42950. f.cross(g),
  42951. h[s] += f.x,
  42952. h[1 + s] += f.y,
  42953. h[2 + s] += f.z,
  42954. h[l] += f.x,
  42955. h[1 + l] += f.y,
  42956. h[2 + l] += f.z,
  42957. h[c] += f.x,
  42958. h[1 + c] += f.y,
  42959. h[2 + c] += f.z
  42960. }
  42961. } else
  42962. for (o = 0,
  42963. a = n.length; o < a; o += 9)
  42964. u.fromArray(n, o),
  42965. d.fromArray(n, o + 3),
  42966. p.fromArray(n, o + 6),
  42967. f.subVectors(p, d),
  42968. g.subVectors(u, d),
  42969. f.cross(g),
  42970. h[o] = f.x,
  42971. h[o + 1] = f.y,
  42972. h[o + 2] = f.z,
  42973. h[o + 3] = f.x,
  42974. h[o + 4] = f.y,
  42975. h[o + 5] = f.z,
  42976. h[o + 6] = f.x,
  42977. h[o + 7] = f.y,
  42978. h[o + 8] = f.z;
  42979. this.normalizeNormals(),
  42980. t.normal.needsUpdate = !0
  42981. }
  42982. },
  42983. merge: function(e, t) {
  42984. if (e instanceof Ci.BufferGeometry != 0) {
  42985. void 0 === t && (t = 0);
  42986. var i = this.attributes;
  42987. for (var n in i)
  42988. if (void 0 !== e.attributes[n])
  42989. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42990. l++)
  42991. r[l] = a[s];
  42992. return this
  42993. }
  42994. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42995. },
  42996. normalizeNormals: function() {
  42997. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42998. e = r[o],
  42999. t = r[o + 1],
  43000. i = r[o + 2],
  43001. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43002. r[o] *= n,
  43003. r[o + 1] *= n,
  43004. r[o + 2] *= n
  43005. },
  43006. toNonIndexed: function() {
  43007. if (null === this.index)
  43008. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43009. this;
  43010. var e = new Ci.BufferGeometry
  43011. , t = this.index.array
  43012. , i = this.attributes;
  43013. for (var n in i) {
  43014. 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++) {
  43015. l = t[h] * a;
  43016. for (var d = 0; d < a; d++)
  43017. s[c++] = o[l++]
  43018. }
  43019. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43020. }
  43021. return e
  43022. },
  43023. toJSON: function() {
  43024. var e = {
  43025. metadata: {
  43026. version: 4.4,
  43027. type: "BufferGeometry",
  43028. generator: "BufferGeometry.toJSON"
  43029. }
  43030. };
  43031. if (e.uuid = this.uuid,
  43032. e.type = this.type,
  43033. "" !== this.name && (e.name = this.name),
  43034. void 0 !== this.parameters) {
  43035. var t = this.parameters;
  43036. for (var i in t)
  43037. void 0 !== t[i] && (e[i] = t[i]);
  43038. return e
  43039. }
  43040. e.data = {
  43041. attributes: {}
  43042. };
  43043. var n = this.index;
  43044. if (null !== n) {
  43045. var r = Array.prototype.slice.call(n.array);
  43046. e.data.index = {
  43047. type: n.array.constructor.name,
  43048. array: r
  43049. }
  43050. }
  43051. var o = this.attributes;
  43052. for (var i in o) {
  43053. var a = o[i];
  43054. r = Array.prototype.slice.call(a.array);
  43055. e.data.attributes[i] = {
  43056. itemSize: a.itemSize,
  43057. type: a.array.constructor.name,
  43058. array: r
  43059. }
  43060. }
  43061. var s = this.groups;
  43062. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43063. var l = this.boundingSphere;
  43064. return null !== l && (e.data.boundingSphere = {
  43065. center: l.center.toArray(),
  43066. radius: l.radius
  43067. }),
  43068. e
  43069. },
  43070. clone: function() {
  43071. return (new Ci.BufferGeometry).copy(this)
  43072. },
  43073. copy: function(e) {
  43074. var t = e.index;
  43075. null !== t && this.setIndex(t.clone());
  43076. var i = e.attributes;
  43077. for (var n in i) {
  43078. var r = i[n];
  43079. this.addAttribute(n, r.clone())
  43080. }
  43081. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43082. var l = o[a];
  43083. this.addGroup(l.start, l.count)
  43084. }
  43085. return this
  43086. },
  43087. dispose: function() {
  43088. this.dispatchEvent({
  43089. type: "dispose"
  43090. })
  43091. }
  43092. },
  43093. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43094. Ci.BufferGeometry.MaxIndex = 65535,
  43095. Ci.InstancedBufferGeometry = function() {
  43096. Ci.BufferGeometry.call(this),
  43097. this.type = "InstancedBufferGeometry",
  43098. this.maxInstancedCount = void 0
  43099. }
  43100. ,
  43101. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43102. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43103. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43104. this.groups.push({
  43105. start: e,
  43106. count: t,
  43107. instances: i
  43108. })
  43109. }
  43110. ,
  43111. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43112. var t = e.index;
  43113. null !== t && this.setIndex(t.clone());
  43114. var i = e.attributes;
  43115. for (var n in i) {
  43116. var r = i[n];
  43117. this.addAttribute(n, r.clone())
  43118. }
  43119. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43120. var l = o[a];
  43121. this.addGroup(l.start, l.count, l.instances)
  43122. }
  43123. return this
  43124. }
  43125. ,
  43126. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43127. Ci.Uniform = function(e, t) {
  43128. this.type = e,
  43129. this.value = t,
  43130. this.dynamic = !1
  43131. }
  43132. ,
  43133. Ci.Uniform.prototype = {
  43134. constructor: Ci.Uniform,
  43135. onUpdate: function(e) {
  43136. return this.dynamic = !0,
  43137. this.onUpdateCallback = e,
  43138. this
  43139. }
  43140. },
  43141. Ci.AnimationClip = function(e, t, i) {
  43142. this.name = e || Ci.Math.generateUUID(),
  43143. this.tracks = i,
  43144. this.duration = void 0 !== t ? t : -1,
  43145. this.duration < 0 && this.resetDuration(),
  43146. this.trim(),
  43147. this.optimize()
  43148. }
  43149. ,
  43150. Ci.AnimationClip.prototype = {
  43151. constructor: Ci.AnimationClip,
  43152. resetDuration: function() {
  43153. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43154. var n = this.tracks[t];
  43155. e = Math.max(e, n.times[n.times.length - 1])
  43156. }
  43157. this.duration = e
  43158. },
  43159. trim: function() {
  43160. for (var e = 0; e < this.tracks.length; e++)
  43161. this.tracks[e].trim(0, this.duration);
  43162. return this
  43163. },
  43164. optimize: function() {
  43165. for (var e = 0; e < this.tracks.length; e++)
  43166. this.tracks[e].optimize();
  43167. return this
  43168. }
  43169. },
  43170. Object.assign(Ci.AnimationClip, {
  43171. parse: function(e) {
  43172. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43173. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43174. return new Ci.AnimationClip(e.name,e.duration,t)
  43175. },
  43176. toJSON: function(e) {
  43177. for (var t = [], i = e.tracks, n = {
  43178. name: e.name,
  43179. duration: e.duration,
  43180. tracks: t
  43181. }, r = 0, o = i.length; r !== o; ++r)
  43182. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43183. return n
  43184. },
  43185. CreateFromMorphTargetSequence: function(e, t, i) {
  43186. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43187. var a = []
  43188. , s = [];
  43189. a.push((o + n - 1) % n, o, (o + 1) % n),
  43190. s.push(0, 1, 0);
  43191. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43192. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43193. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43194. 0 === a[0] && (a.push(n),
  43195. s.push(s[0])),
  43196. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43197. }
  43198. return new Ci.AnimationClip(e,-1,r)
  43199. },
  43200. findByName: function(e, t) {
  43201. for (var i = 0; i < e.length; i++)
  43202. if (e[i].name === t)
  43203. return e[i];
  43204. return null
  43205. },
  43206. CreateClipsFromMorphTargetSequences: function(e, t) {
  43207. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43208. var a = e[r]
  43209. , s = a.name.match(n);
  43210. if (s && 1 < s.length) {
  43211. var l = i[h = s[1]];
  43212. l || (i[h] = l = []),
  43213. l.push(a)
  43214. }
  43215. }
  43216. var c = [];
  43217. for (var h in i)
  43218. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43219. return c
  43220. },
  43221. parseAnimation: function(e, t, i) {
  43222. if (!e)
  43223. return console.error(" no animation in JSONLoader data"),
  43224. null;
  43225. function n(e, t, i, n, r) {
  43226. if (0 !== i.length) {
  43227. var o = []
  43228. , a = [];
  43229. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43230. 0 !== o.length && r.push(new e(t,o,a))
  43231. }
  43232. }
  43233. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43234. var h = l[c].keys;
  43235. if (h && 0 != h.length)
  43236. if (h[0].morphTargets) {
  43237. for (var u = {}, d = 0; d < h.length; d++)
  43238. if (h[d].morphTargets)
  43239. for (var p = 0; p < h[d].morphTargets.length; p++)
  43240. u[h[d].morphTargets[p]] = -1;
  43241. for (var f in u) {
  43242. var g = []
  43243. , m = [];
  43244. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43245. var v = h[d];
  43246. g.push(v.time),
  43247. m.push(v.morphTarget === f ? 1 : 0)
  43248. }
  43249. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43250. }
  43251. a = u.length * (s || 1)
  43252. } else {
  43253. var y = ".bones[" + t[c].name + "]";
  43254. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43255. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43256. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43257. }
  43258. }
  43259. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43260. }
  43261. }),
  43262. Ci.AnimationMixer = function(e) {
  43263. this._root = e,
  43264. this._initMemoryManager(),
  43265. this._accuIndex = 0,
  43266. this.time = 0,
  43267. this.timeScale = 1
  43268. }
  43269. ,
  43270. Ci.AnimationMixer.prototype = {
  43271. constructor: Ci.AnimationMixer,
  43272. clipAction: function(e, t) {
  43273. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43274. if (void 0 !== a) {
  43275. var s = a.actionByRoot[n];
  43276. if (void 0 !== s)
  43277. return s;
  43278. if (o = (i = a.knownActions[0])._clip,
  43279. e !== r && e !== o)
  43280. throw new Error("Different clips with the same name detected!")
  43281. }
  43282. if (null === o)
  43283. return null;
  43284. var l = new Ci.AnimationMixer._Action(this,o,t);
  43285. return this._bindAction(l, i),
  43286. this._addInactiveAction(l, r, n),
  43287. l
  43288. },
  43289. existingAction: function(e, t) {
  43290. var i = (t || this._root).uuid
  43291. , n = "string" == typeof e ? e : e.name
  43292. , r = this._actionsByClip[n];
  43293. return void 0 !== r && r.actionByRoot[i] || null
  43294. },
  43295. stopAllAction: function() {
  43296. var e = this._actions
  43297. , t = this._nActiveActions
  43298. , i = this._bindings
  43299. , n = this._nActiveBindings;
  43300. this._nActiveActions = 0;
  43301. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43302. e[r].reset();
  43303. for (r = 0; r !== n; ++r)
  43304. i[r].useCount = 0;
  43305. return this
  43306. },
  43307. update: function(e) {
  43308. e *= this.timeScale;
  43309. 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) {
  43310. var s = t[a];
  43311. s.enabled && s._update(n, e, r, o)
  43312. }
  43313. var l = this._bindings
  43314. , c = this._nActiveBindings;
  43315. for (a = 0; a !== c; ++a)
  43316. l[a].apply(o);
  43317. return this
  43318. },
  43319. getRoot: function() {
  43320. return this._root
  43321. },
  43322. uncacheClip: function(e) {
  43323. var t = this._actions
  43324. , i = e.name
  43325. , n = this._actionsByClip
  43326. , r = n[i];
  43327. if (void 0 !== r) {
  43328. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43329. var l = o[a];
  43330. this._deactivateAction(l);
  43331. var c = l._cacheIndex
  43332. , h = t[t.length - 1];
  43333. l._cacheIndex = null,
  43334. l._byClipCacheIndex = null,
  43335. t[h._cacheIndex = c] = h,
  43336. t.pop(),
  43337. this._removeInactiveBindingsForAction(l)
  43338. }
  43339. delete n[i]
  43340. }
  43341. },
  43342. uncacheRoot: function(e) {
  43343. var t = e.uuid
  43344. , i = this._actionsByClip;
  43345. for (var n in i) {
  43346. var r = i[n].actionByRoot[t];
  43347. void 0 !== r && (this._deactivateAction(r),
  43348. this._removeInactiveAction(r))
  43349. }
  43350. var o = this._bindingsByRootAndName[t];
  43351. if (void 0 !== o)
  43352. for (var a in o) {
  43353. var s = o[a];
  43354. s.restoreOriginalState(),
  43355. this._removeInactiveBinding(s)
  43356. }
  43357. },
  43358. uncacheAction: function(e, t) {
  43359. var i = this.existingAction(e, t);
  43360. null !== i && (this._deactivateAction(i),
  43361. this._removeInactiveAction(i))
  43362. }
  43363. },
  43364. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43365. Ci.AnimationMixer._Action = function(e, t, i) {
  43366. this._mixer = e,
  43367. this._clip = t,
  43368. this._localRoot = i || null;
  43369. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43370. endingStart: Ci.ZeroCurvatureEnding,
  43371. endingEnd: Ci.ZeroCurvatureEnding
  43372. }, s = 0; s !== r; ++s) {
  43373. var l = n[s].createInterpolant(null);
  43374. (o[s] = l).settings = a
  43375. }
  43376. this._interpolantSettings = a,
  43377. this._interpolants = o,
  43378. this._propertyBindings = new Array(r),
  43379. this._cacheIndex = null,
  43380. this._byClipCacheIndex = null,
  43381. this._timeScaleInterpolant = null,
  43382. this._weightInterpolant = null,
  43383. this.loop = Ci.LoopRepeat,
  43384. this._loopCount = -1,
  43385. this._startTime = null,
  43386. this.time = 0,
  43387. this.timeScale = 1,
  43388. this._effectiveTimeScale = 1,
  43389. this.weight = 1,
  43390. this._effectiveWeight = 1,
  43391. this.repetitions = 1 / 0,
  43392. this.paused = !1,
  43393. this.enabled = !0,
  43394. this.clampWhenFinished = !1,
  43395. this.zeroSlopeAtStart = !0,
  43396. this.zeroSlopeAtEnd = !0
  43397. }
  43398. ,
  43399. Ci.AnimationMixer._Action.prototype = {
  43400. constructor: Ci.AnimationMixer._Action,
  43401. play: function() {
  43402. return this._mixer._activateAction(this),
  43403. this
  43404. },
  43405. stop: function() {
  43406. return this._mixer._deactivateAction(this),
  43407. this.reset()
  43408. },
  43409. reset: function() {
  43410. return this.paused = !1,
  43411. this.enabled = !0,
  43412. this.time = 0,
  43413. this._loopCount = -1,
  43414. this._startTime = null,
  43415. this.stopFading().stopWarping()
  43416. },
  43417. isRunning: function() {
  43418. return this._startTime,
  43419. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43420. },
  43421. isScheduled: function() {
  43422. return this._mixer._isActiveAction(this)
  43423. },
  43424. startAt: function(e) {
  43425. return this._startTime = e,
  43426. this
  43427. },
  43428. setLoop: function(e, t) {
  43429. return this.loop = e,
  43430. this.repetitions = t,
  43431. this
  43432. },
  43433. setEffectiveWeight: function(e) {
  43434. return this.weight = e,
  43435. this._effectiveWeight = this.enabled ? e : 0,
  43436. this.stopFading()
  43437. },
  43438. getEffectiveWeight: function() {
  43439. return this._effectiveWeight
  43440. },
  43441. fadeIn: function(e) {
  43442. return this._scheduleFading(e, 0, 1)
  43443. },
  43444. fadeOut: function(e) {
  43445. return this._scheduleFading(e, 1, 0)
  43446. },
  43447. crossFadeFrom: function(e, t, i) {
  43448. if (this._mixer,
  43449. e.fadeOut(t),
  43450. this.fadeIn(t),
  43451. i) {
  43452. var n = this._clip.duration
  43453. , r = e._clip.duration
  43454. , o = r / n
  43455. , a = n / r;
  43456. e.warp(1, o, t),
  43457. this.warp(a, 1, t)
  43458. }
  43459. return this
  43460. },
  43461. crossFadeTo: function(e, t, i) {
  43462. return e.crossFadeFrom(this, t, i)
  43463. },
  43464. stopFading: function() {
  43465. var e = this._weightInterpolant;
  43466. return null !== e && (this._weightInterpolant = null,
  43467. this._mixer._takeBackControlInterpolant(e)),
  43468. this
  43469. },
  43470. setEffectiveTimeScale: function(e) {
  43471. return this.timeScale = e,
  43472. this._effectiveTimeScale = this.paused ? 0 : e,
  43473. this.stopWarping()
  43474. },
  43475. getEffectiveTimeScale: function() {
  43476. return this._effectiveTimeScale
  43477. },
  43478. setDuration: function(e) {
  43479. return this.timeScale = this._clip.duration / e,
  43480. this.stopWarping()
  43481. },
  43482. syncWith: function(e) {
  43483. return this.time = e.time,
  43484. this.timeScale = e.timeScale,
  43485. this.stopWarping()
  43486. },
  43487. halt: function(e) {
  43488. return this.warp(this._currentTimeScale, 0, e)
  43489. },
  43490. warp: function(e, t, i) {
  43491. var n = this._mixer
  43492. , r = n.time
  43493. , o = this._timeScaleInterpolant
  43494. , a = this.timeScale;
  43495. null === o && (o = n._lendControlInterpolant(),
  43496. this._timeScaleInterpolant = o);
  43497. var s = o.parameterPositions
  43498. , l = o.sampleValues;
  43499. return s[0] = r,
  43500. s[1] = r + i,
  43501. l[0] = e / a,
  43502. l[1] = t / a,
  43503. this
  43504. },
  43505. stopWarping: function() {
  43506. var e = this._timeScaleInterpolant;
  43507. return null !== e && (this._timeScaleInterpolant = null,
  43508. this._mixer._takeBackControlInterpolant(e)),
  43509. this
  43510. },
  43511. getMixer: function() {
  43512. return this._mixer
  43513. },
  43514. getClip: function() {
  43515. return this._clip
  43516. },
  43517. getRoot: function() {
  43518. return this._localRoot || this._mixer._root
  43519. },
  43520. _update: function(e, t, i, n) {
  43521. var r = this._startTime;
  43522. if (null !== r) {
  43523. var o = (e - r) * i;
  43524. if (o < 0 || 0 === i)
  43525. return;
  43526. this._startTime = null,
  43527. t = i * o
  43528. }
  43529. t *= this._updateTimeScale(e);
  43530. var a = this._updateTime(t)
  43531. , s = this._updateWeight(e);
  43532. if (0 < s)
  43533. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43534. l[h].evaluate(a),
  43535. c[h].accumulate(n, s)
  43536. },
  43537. _updateWeight: function(e) {
  43538. var t = 0;
  43539. if (this.enabled) {
  43540. t = this.weight;
  43541. var i = this._weightInterpolant;
  43542. if (null !== i) {
  43543. var n = i.evaluate(e)[0];
  43544. t *= n,
  43545. e > i.parameterPositions[1] && (this.stopFading(),
  43546. 0 === n && (this.enabled = !1))
  43547. }
  43548. }
  43549. return this._effectiveWeight = t
  43550. },
  43551. _updateTimeScale: function(e) {
  43552. var t = 0;
  43553. if (!this.paused) {
  43554. t = this.timeScale;
  43555. var i = this._timeScaleInterpolant;
  43556. if (null !== i)
  43557. t *= i.evaluate(e)[0],
  43558. e > i.parameterPositions[1] && (this.stopWarping(),
  43559. 0 === t ? this.pause = !0 : this.timeScale = t)
  43560. }
  43561. return this._effectiveTimeScale = t
  43562. },
  43563. _updateTime: function(e) {
  43564. var t = this.time + e;
  43565. if (0 === e)
  43566. return t;
  43567. var i = this._clip.duration
  43568. , n = this.loop
  43569. , r = this._loopCount
  43570. , o = !1;
  43571. switch (n) {
  43572. case Ci.LoopOnce:
  43573. if (-1 === r && (this.loopCount = 0,
  43574. this._setEndings(!0, !0, !1)),
  43575. i <= t)
  43576. t = i;
  43577. else {
  43578. if (!(t < 0))
  43579. break;
  43580. t = 0
  43581. }
  43582. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43583. this._mixer.dispatchEvent({
  43584. type: "finished",
  43585. action: this,
  43586. direction: e < 0 ? -1 : 1
  43587. });
  43588. break;
  43589. case Ci.LoopPingPong:
  43590. o = !0;
  43591. case Ci.LoopRepeat:
  43592. if (-1 === r && (0 < e ? (r = 0,
  43593. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43594. i <= t || t < 0) {
  43595. var a = Math.floor(t / i);
  43596. t -= i * a,
  43597. r += Math.abs(a);
  43598. var s = this.repetitions - r;
  43599. if (s < 0) {
  43600. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43601. t = 0 < e ? i : 0,
  43602. this._mixer.dispatchEvent({
  43603. type: "finished",
  43604. action: this,
  43605. direction: 0 < e ? 1 : -1
  43606. });
  43607. break
  43608. }
  43609. if (0 == s) {
  43610. var l = e < 0;
  43611. this._setEndings(l, !l, o)
  43612. } else
  43613. this._setEndings(!1, !1, o);
  43614. this._loopCount = r,
  43615. this._mixer.dispatchEvent({
  43616. type: "loop",
  43617. action: this,
  43618. loopDelta: a
  43619. })
  43620. }
  43621. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43622. return i - (this.time = t)
  43623. }
  43624. return this.time = t
  43625. },
  43626. _setEndings: function(e, t, i) {
  43627. var n = this._interpolantSettings;
  43628. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43629. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43630. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43631. },
  43632. _scheduleFading: function(e, t, i) {
  43633. var n = this._mixer
  43634. , r = n.time
  43635. , o = this._weightInterpolant;
  43636. null === o && (o = n._lendControlInterpolant(),
  43637. this._weightInterpolant = o);
  43638. var a = o.parameterPositions
  43639. , s = o.sampleValues;
  43640. return a[0] = r,
  43641. s[0] = t,
  43642. a[1] = r + e,
  43643. s[1] = i,
  43644. this
  43645. }
  43646. },
  43647. Object.assign(Ci.AnimationMixer.prototype, {
  43648. _bindAction: function(e, t) {
  43649. var i = e._localRoot || this._root
  43650. , n = e._clip.tracks
  43651. , r = n.length
  43652. , o = e._propertyBindings
  43653. , a = e._interpolants
  43654. , s = i.uuid
  43655. , l = this._bindingsByRootAndName
  43656. , c = l[s];
  43657. void 0 === c && (c = {},
  43658. l[s] = c);
  43659. for (var h = 0; h !== r; ++h) {
  43660. var u = n[h]
  43661. , d = u.name
  43662. , p = c[d];
  43663. if (void 0 !== p)
  43664. o[h] = p;
  43665. else {
  43666. if (void 0 !== (p = o[h])) {
  43667. null === p._cacheIndex && (++p.referenceCount,
  43668. this._addInactiveBinding(p, s, d));
  43669. continue
  43670. }
  43671. var f = t && t._propertyBindings[h].binding.parsedPath;
  43672. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43673. this._addInactiveBinding(p, s, d),
  43674. o[h] = p
  43675. }
  43676. a[h].resultBuffer = p.buffer
  43677. }
  43678. },
  43679. _activateAction: function(e) {
  43680. if (!this._isActiveAction(e)) {
  43681. if (null === e._cacheIndex) {
  43682. var t = (e._localRoot || this._root).uuid
  43683. , i = e._clip.name
  43684. , n = this._actionsByClip[i];
  43685. this._bindAction(e, n && n.knownActions[0]),
  43686. this._addInactiveAction(e, i, t)
  43687. }
  43688. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43689. var s = r[o];
  43690. 0 == s.useCount++ && (this._lendBinding(s),
  43691. s.saveOriginalState())
  43692. }
  43693. this._lendAction(e)
  43694. }
  43695. },
  43696. _deactivateAction: function(e) {
  43697. if (this._isActiveAction(e)) {
  43698. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43699. var r = t[i];
  43700. 0 == --r.useCount && (r.restoreOriginalState(),
  43701. this._takeBackBinding(r))
  43702. }
  43703. this._takeBackAction(e)
  43704. }
  43705. },
  43706. _initMemoryManager: function() {
  43707. this._actions = [],
  43708. this._nActiveActions = 0,
  43709. this._actionsByClip = {},
  43710. this._bindings = [],
  43711. this._nActiveBindings = 0,
  43712. this._bindingsByRootAndName = {},
  43713. this._controlInterpolants = [],
  43714. this._nActiveControlInterpolants = 0;
  43715. var e = this;
  43716. this.stats = {
  43717. actions: {
  43718. get total() {
  43719. return e._actions.length
  43720. },
  43721. get inUse() {
  43722. return e._nActiveActions
  43723. }
  43724. },
  43725. bindings: {
  43726. get total() {
  43727. return e._bindings.length
  43728. },
  43729. get inUse() {
  43730. return e._nActiveBindings
  43731. }
  43732. },
  43733. controlInterpolants: {
  43734. get total() {
  43735. return e._controlInterpolants.length
  43736. },
  43737. get inUse() {
  43738. return e._nActiveControlInterpolants
  43739. }
  43740. }
  43741. }
  43742. },
  43743. _isActiveAction: function(e) {
  43744. var t = e._cacheIndex;
  43745. return null !== t && t < this._nActiveActions
  43746. },
  43747. _addInactiveAction: function(e, t, i) {
  43748. var n = this._actions
  43749. , r = this._actionsByClip
  43750. , o = r[t];
  43751. if (void 0 === o)
  43752. o = {
  43753. knownActions: [e],
  43754. actionByRoot: {}
  43755. },
  43756. e._byClipCacheIndex = 0,
  43757. r[t] = o;
  43758. else {
  43759. var a = o.knownActions;
  43760. e._byClipCacheIndex = a.length,
  43761. a.push(e)
  43762. }
  43763. e._cacheIndex = n.length,
  43764. n.push(e),
  43765. o.actionByRoot[i] = e
  43766. },
  43767. _removeInactiveAction: function(e) {
  43768. var t = this._actions
  43769. , i = t[t.length - 1]
  43770. , n = e._cacheIndex;
  43771. t[i._cacheIndex = n] = i,
  43772. t.pop(),
  43773. e._cacheIndex = null;
  43774. var r = e._clip.name
  43775. , o = this._actionsByClip
  43776. , a = o[r]
  43777. , s = a.knownActions
  43778. , l = s[s.length - 1]
  43779. , c = e._byClipCacheIndex;
  43780. s[l._byClipCacheIndex = c] = l,
  43781. s.pop(),
  43782. e._byClipCacheIndex = null,
  43783. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43784. 0 === s.length && delete o[r],
  43785. this._removeInactiveBindingsForAction(e)
  43786. },
  43787. _removeInactiveBindingsForAction: function(e) {
  43788. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43789. var r = t[i];
  43790. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43791. }
  43792. },
  43793. _lendAction: function(e) {
  43794. var t = this._actions
  43795. , i = e._cacheIndex
  43796. , n = this._nActiveActions++
  43797. , r = t[n];
  43798. t[e._cacheIndex = n] = e,
  43799. t[r._cacheIndex = i] = r
  43800. },
  43801. _takeBackAction: function(e) {
  43802. var t = this._actions
  43803. , i = e._cacheIndex
  43804. , n = --this._nActiveActions
  43805. , r = t[n];
  43806. t[e._cacheIndex = n] = e,
  43807. t[r._cacheIndex = i] = r
  43808. },
  43809. _addInactiveBinding: function(e, t, i) {
  43810. var n = this._bindingsByRootAndName
  43811. , r = n[t]
  43812. , o = this._bindings;
  43813. void 0 === r && (r = {},
  43814. n[t] = r),
  43815. (r[i] = e)._cacheIndex = o.length,
  43816. o.push(e)
  43817. },
  43818. _removeInactiveBinding: function(e) {
  43819. var t = this._bindings
  43820. , i = e.binding
  43821. , n = i.rootNode.uuid
  43822. , r = i.path
  43823. , o = this._bindingsByRootAndName
  43824. , a = o[n]
  43825. , s = t[t.length - 1]
  43826. , l = e._cacheIndex;
  43827. t[s._cacheIndex = l] = s,
  43828. t.pop(),
  43829. delete a[r];
  43830. e: {
  43831. for (var c in a)
  43832. break e;
  43833. delete o[n]
  43834. }
  43835. },
  43836. _lendBinding: function(e) {
  43837. var t = this._bindings
  43838. , i = e._cacheIndex
  43839. , n = this._nActiveBindings++
  43840. , r = t[n];
  43841. t[e._cacheIndex = n] = e,
  43842. t[r._cacheIndex = i] = r
  43843. },
  43844. _takeBackBinding: function(e) {
  43845. var t = this._bindings
  43846. , i = e._cacheIndex
  43847. , n = --this._nActiveBindings
  43848. , r = t[n];
  43849. t[e._cacheIndex = n] = e,
  43850. t[r._cacheIndex = i] = r
  43851. },
  43852. _lendControlInterpolant: function() {
  43853. var e = this._controlInterpolants
  43854. , t = this._nActiveControlInterpolants++
  43855. , i = e[t];
  43856. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43857. i
  43858. },
  43859. _takeBackControlInterpolant: function(e) {
  43860. var t = this._controlInterpolants
  43861. , i = e.__cacheIndex
  43862. , n = --this._nActiveControlInterpolants
  43863. , r = t[n];
  43864. t[e.__cacheIndex = n] = e,
  43865. t[r.__cacheIndex = i] = r
  43866. },
  43867. _controlInterpolantsResultBuffer: new Float32Array(1)
  43868. }),
  43869. Ci.AnimationObjectGroup = function(e) {
  43870. this.uuid = Ci.Math.generateUUID(),
  43871. this._objects = Array.prototype.slice.call(arguments),
  43872. this.nCachedObjects_ = 0;
  43873. var t = {};
  43874. this._indicesByUUID = t;
  43875. for (var i = 0, n = arguments.length; i !== n; ++i)
  43876. t[arguments[i].uuid] = i;
  43877. this._paths = [],
  43878. this._parsedPaths = [],
  43879. this._bindings = [],
  43880. this._bindingsIndicesByPath = {};
  43881. var r = this;
  43882. this.stats = {
  43883. objects: {
  43884. get total() {
  43885. return r._objects.length
  43886. },
  43887. get inUse() {
  43888. return this.total - r.nCachedObjects_
  43889. }
  43890. },
  43891. get bindingsPerObject() {
  43892. return r._bindings.length
  43893. }
  43894. }
  43895. }
  43896. ,
  43897. Ci.AnimationObjectGroup.prototype = {
  43898. constructor: Ci.AnimationObjectGroup,
  43899. add: function(e) {
  43900. 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) {
  43901. var u = arguments[c]
  43902. , d = u.uuid
  43903. , p = r[d];
  43904. if (void 0 === p) {
  43905. p = i++,
  43906. r[d] = p,
  43907. t.push(u);
  43908. for (var f = 0, g = l; f !== g; ++f)
  43909. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43910. } else if (p < n) {
  43911. var m = t[p]
  43912. , v = --n
  43913. , y = t[v];
  43914. t[r[y.uuid] = p] = y,
  43915. t[r[d] = v] = u;
  43916. for (f = 0,
  43917. g = l; f !== g; ++f) {
  43918. var A = s[f]
  43919. , C = A[v]
  43920. , I = A[p];
  43921. A[p] = C,
  43922. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43923. A[v] = I
  43924. }
  43925. } else
  43926. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43927. }
  43928. this.nCachedObjects_ = n
  43929. },
  43930. remove: function(e) {
  43931. for (var t = this._objects, i = (t.length,
  43932. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43933. var l = arguments[a]
  43934. , c = l.uuid
  43935. , h = n[c];
  43936. if (void 0 !== h && i <= h) {
  43937. var u = i++
  43938. , d = t[u];
  43939. t[n[d.uuid] = h] = d,
  43940. t[n[c] = u] = l;
  43941. for (var p = 0, f = o; p !== f; ++p) {
  43942. var g = r[p]
  43943. , m = g[u]
  43944. , v = g[h];
  43945. g[h] = m,
  43946. g[u] = v
  43947. }
  43948. }
  43949. }
  43950. this.nCachedObjects_ = i
  43951. },
  43952. uncache: function(e) {
  43953. 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) {
  43954. var c = arguments[s].uuid
  43955. , h = r[c];
  43956. if (void 0 !== h)
  43957. if (delete r[c],
  43958. h < n) {
  43959. var u = --n
  43960. , d = t[u]
  43961. , p = t[y = --i];
  43962. t[r[d.uuid] = h] = d,
  43963. t[r[p.uuid] = u] = p,
  43964. t.pop();
  43965. for (var f = 0, g = a; f !== g; ++f) {
  43966. var m = (A = o[f])[u]
  43967. , v = A[y];
  43968. A[h] = m,
  43969. A[u] = v,
  43970. A.pop()
  43971. }
  43972. } else {
  43973. var y;
  43974. t[r[(p = t[y = --i]).uuid] = h] = p,
  43975. t.pop();
  43976. for (f = 0,
  43977. g = a; f !== g; ++f) {
  43978. var A;
  43979. (A = o[f])[h] = A[y],
  43980. A.pop()
  43981. }
  43982. }
  43983. }
  43984. this.nCachedObjects_ = n
  43985. },
  43986. subscribe_: function(e, t) {
  43987. var i = this._bindingsIndicesByPath
  43988. , n = i[e]
  43989. , r = this._bindings;
  43990. if (void 0 !== n)
  43991. return r[n];
  43992. var o = this._paths
  43993. , a = this._parsedPaths
  43994. , s = this._objects
  43995. , l = s.length
  43996. , c = this.nCachedObjects_
  43997. , h = new Array(l);
  43998. n = r.length,
  43999. i[e] = n,
  44000. o.push(e),
  44001. a.push(t),
  44002. r.push(h);
  44003. for (var u = c, d = s.length; u !== d; ++u) {
  44004. var p = s[u];
  44005. h[u] = new Ci.PropertyBinding(p,e,t)
  44006. }
  44007. return h
  44008. },
  44009. unsubscribe_: function(e) {
  44010. var t = this._bindingsIndicesByPath
  44011. , i = t[e];
  44012. if (void 0 !== i) {
  44013. var n = this._paths
  44014. , r = this._parsedPaths
  44015. , o = this._bindings
  44016. , a = o.length - 1
  44017. , s = o[a];
  44018. o[t[e[a]] = i] = s,
  44019. o.pop(),
  44020. r[i] = r[a],
  44021. r.pop(),
  44022. n[i] = n[a],
  44023. n.pop()
  44024. }
  44025. }
  44026. },
  44027. Ci.AnimationUtils = {
  44028. arraySlice: function(e, t, i) {
  44029. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44030. },
  44031. convertArray: function(e, t, i) {
  44032. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44033. },
  44034. isTypedArray: function(e) {
  44035. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44036. },
  44037. getKeyframeOrder: function(i) {
  44038. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44039. t[n] = n;
  44040. return t.sort(function(e, t) {
  44041. return i[e] - i[t]
  44042. }),
  44043. t
  44044. },
  44045. sortedArray: function(e, t, i) {
  44046. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44047. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44048. r[a++] = e[s + l];
  44049. return r
  44050. },
  44051. flattenJSON: function(e, t, i, n) {
  44052. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44053. o = e[r++];
  44054. if (void 0 !== o) {
  44055. var a = o[n];
  44056. if (void 0 !== a)
  44057. if (Array.isArray(a))
  44058. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44059. i.push.apply(i, a)),
  44060. void 0 !== (o = e[r++]); )
  44061. ;
  44062. else if (void 0 !== a.toArray)
  44063. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44064. a.toArray(i, i.length)),
  44065. void 0 !== (o = e[r++]); )
  44066. ;
  44067. else
  44068. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44069. i.push(a)),
  44070. void 0 !== (o = e[r++]); )
  44071. ;
  44072. }
  44073. }
  44074. },
  44075. Ci.KeyframeTrack = function(e, t, i, n) {
  44076. if (void 0 === e)
  44077. throw new Error("track name is undefined");
  44078. if (void 0 === t || 0 === t.length)
  44079. throw new Error("no keyframes in track named " + e);
  44080. this.name = e,
  44081. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44082. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44083. this.setInterpolation(n || this.DefaultInterpolation),
  44084. this.validate(),
  44085. this.optimize()
  44086. }
  44087. ,
  44088. Ci.KeyframeTrack.prototype = {
  44089. constructor: Ci.KeyframeTrack,
  44090. TimeBufferType: Float32Array,
  44091. ValueBufferType: Float32Array,
  44092. DefaultInterpolation: Ci.InterpolateLinear,
  44093. InterpolantFactoryMethodDiscrete: function(e) {
  44094. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44095. },
  44096. InterpolantFactoryMethodLinear: function(e) {
  44097. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44098. },
  44099. InterpolantFactoryMethodSmooth: function(e) {
  44100. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44101. },
  44102. setInterpolation: function(e) {
  44103. var t = void 0;
  44104. switch (e) {
  44105. case Ci.InterpolateDiscrete:
  44106. t = this.InterpolantFactoryMethodDiscrete;
  44107. break;
  44108. case Ci.InterpolateLinear:
  44109. t = this.InterpolantFactoryMethodLinear;
  44110. break;
  44111. case Ci.InterpolateSmooth:
  44112. t = this.InterpolantFactoryMethodSmooth
  44113. }
  44114. if (void 0 !== t)
  44115. this.createInterpolant = t;
  44116. else {
  44117. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44118. if (void 0 === this.createInterpolant) {
  44119. if (e === this.DefaultInterpolation)
  44120. throw new Error(i);
  44121. this.setInterpolation(this.DefaultInterpolation)
  44122. }
  44123. console.warn(i)
  44124. }
  44125. },
  44126. getInterpolation: function() {
  44127. switch (this.createInterpolant) {
  44128. case this.InterpolantFactoryMethodDiscrete:
  44129. return Ci.InterpolateDiscrete;
  44130. case this.InterpolantFactoryMethodLinear:
  44131. return Ci.InterpolateLinear;
  44132. case this.InterpolantFactoryMethodSmooth:
  44133. return Ci.InterpolateSmooth
  44134. }
  44135. },
  44136. getValueSize: function() {
  44137. return this.values.length / this.times.length
  44138. },
  44139. shift: function(e) {
  44140. if (0 !== e)
  44141. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44142. t[i] += e;
  44143. return this
  44144. },
  44145. scale: function(e) {
  44146. if (1 !== e)
  44147. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44148. t[i] *= e;
  44149. return this
  44150. },
  44151. trim: function(e, t) {
  44152. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44153. ++r;
  44154. for (; -1 !== o && i[o] > t; )
  44155. --o;
  44156. if (++o,
  44157. 0 !== r || o !== n) {
  44158. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44159. var a = this.getValueSize();
  44160. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44161. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44162. }
  44163. return this
  44164. },
  44165. validate: function() {
  44166. var e = !0
  44167. , t = this.getValueSize();
  44168. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44169. e = !1);
  44170. var i = this.times
  44171. , n = this.values
  44172. , r = i.length;
  44173. 0 === r && (console.error("track is empty", this),
  44174. e = !1);
  44175. for (var o = null, a = 0; a !== r; a++) {
  44176. var s = i[a];
  44177. if ("number" == typeof s && isNaN(s)) {
  44178. console.error("time is not a valid number", this, a, s),
  44179. e = !1;
  44180. break
  44181. }
  44182. if (null !== o && s < o) {
  44183. console.error("out of order keys", this, a, s, o),
  44184. e = !1;
  44185. break
  44186. }
  44187. o = s
  44188. }
  44189. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44190. a = 0;
  44191. for (var l = n.length; a !== l; ++a) {
  44192. var c = n[a];
  44193. if (isNaN(c)) {
  44194. console.error("value is not a valid number", this, a, c),
  44195. e = !1;
  44196. break
  44197. }
  44198. }
  44199. }
  44200. return e
  44201. },
  44202. optimize: function() {
  44203. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44204. var a = !1
  44205. , s = e[r];
  44206. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44207. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44208. var d = t[l + u];
  44209. if (d !== t[c + u] || d !== t[h + u]) {
  44210. a = !0;
  44211. break
  44212. }
  44213. }
  44214. if (a) {
  44215. if (r !== n) {
  44216. e[n] = e[r];
  44217. var p = r * i
  44218. , f = n * i;
  44219. for (u = 0; u !== i; ++u)
  44220. t[f + u] = t[p + u]
  44221. }
  44222. ++n
  44223. }
  44224. }
  44225. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44226. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44227. this
  44228. }
  44229. },
  44230. Object.assign(Ci.KeyframeTrack, {
  44231. parse: function(e) {
  44232. if (void 0 === e.type)
  44233. throw new Error("track type undefined, can not parse");
  44234. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44235. if (void 0 === e.times) {
  44236. console.warn("legacy JSON format detected, converting");
  44237. var i = []
  44238. , n = [];
  44239. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44240. e.times = i,
  44241. e.values = n
  44242. }
  44243. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44244. },
  44245. toJSON: function(e) {
  44246. var t, i = e.constructor;
  44247. if (void 0 !== i.toJSON)
  44248. t = i.toJSON(e);
  44249. else {
  44250. t = {
  44251. name: e.name,
  44252. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44253. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44254. };
  44255. var n = e.getInterpolation();
  44256. n !== e.DefaultInterpolation && (t.interpolation = n)
  44257. }
  44258. return t.type = e.ValueTypeName,
  44259. t
  44260. },
  44261. _getTrackTypeForValueTypeName: function(e) {
  44262. switch (e.toLowerCase()) {
  44263. case "scalar":
  44264. case "double":
  44265. case "float":
  44266. case "number":
  44267. case "integer":
  44268. return Ci.NumberKeyframeTrack;
  44269. case "vector":
  44270. case "vector2":
  44271. case "vector3":
  44272. case "vector4":
  44273. return Ci.VectorKeyframeTrack;
  44274. case "color":
  44275. return Ci.ColorKeyframeTrack;
  44276. case "quaternion":
  44277. return Ci.QuaternionKeyframeTrack;
  44278. case "bool":
  44279. case "boolean":
  44280. return Ci.BooleanKeyframeTrack;
  44281. case "string":
  44282. return Ci.StringKeyframeTrack
  44283. }
  44284. throw new Error("Unsupported typeName: " + e)
  44285. }
  44286. }),
  44287. Ci.PropertyBinding = function(e, t, i) {
  44288. this.path = t,
  44289. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44290. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44291. this.rootNode = e
  44292. }
  44293. ,
  44294. Ci.PropertyBinding.prototype = {
  44295. constructor: Ci.PropertyBinding,
  44296. getValue: function(e, t) {
  44297. this.bind(),
  44298. this.getValue(e, t)
  44299. },
  44300. setValue: function(e, t) {
  44301. this.bind(),
  44302. this.setValue(e, t)
  44303. },
  44304. bind: function() {
  44305. var e = this.node
  44306. , t = this.parsedPath
  44307. , i = t.objectName
  44308. , n = t.propertyName
  44309. , r = t.propertyIndex;
  44310. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44311. this.node = e),
  44312. this.getValue = this._getValue_unavailable,
  44313. this.setValue = this._setValue_unavailable,
  44314. e) {
  44315. if (i) {
  44316. var o = t.objectIndex;
  44317. switch (i) {
  44318. case "materials":
  44319. if (!e.material)
  44320. return void console.error(" can not bind to material as node does not have a material", this);
  44321. if (!e.material.materials)
  44322. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44323. e = e.material.materials;
  44324. break;
  44325. case "bones":
  44326. if (!e.skeleton)
  44327. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44328. e = e.skeleton.bones;
  44329. for (var a = 0; a < e.length; a++)
  44330. if (e[a].name === o) {
  44331. o = a;
  44332. break
  44333. }
  44334. break;
  44335. default:
  44336. if (void 0 === e[i])
  44337. return void console.error(" can not bind to objectName of node, undefined", this);
  44338. e = e[i]
  44339. }
  44340. if (void 0 !== o) {
  44341. if (void 0 === e[o])
  44342. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44343. e = e[o]
  44344. }
  44345. }
  44346. var s = e[n];
  44347. if (s) {
  44348. var l = this.Versioning.None;
  44349. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44350. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44351. this.targetObject = e);
  44352. var c = this.BindingType.Direct;
  44353. if (void 0 !== r) {
  44354. if ("morphTargetInfluences" === n) {
  44355. if (!e.geometry)
  44356. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44357. if (!e.geometry.morphTargets)
  44358. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44359. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44360. if (e.geometry.morphTargets[a].name === r) {
  44361. r = a;
  44362. break
  44363. }
  44364. }
  44365. c = this.BindingType.ArrayElement,
  44366. this.resolvedProperty = s,
  44367. this.propertyIndex = r
  44368. } else
  44369. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44370. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44371. this.resolvedProperty = s) : this.propertyName = n;
  44372. this.getValue = this.GetterByBindingType[c],
  44373. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44374. } else {
  44375. var h = t.nodeName;
  44376. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44377. }
  44378. } else
  44379. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44380. },
  44381. unbind: function() {
  44382. this.node = null,
  44383. this.getValue = this._getValue_unbound,
  44384. this.setValue = this._setValue_unbound
  44385. }
  44386. },
  44387. Object.assign(Ci.PropertyBinding.prototype, {
  44388. _getValue_unavailable: function() {},
  44389. _setValue_unavailable: function() {},
  44390. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44391. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44392. BindingType: {
  44393. Direct: 0,
  44394. EntireArray: 1,
  44395. ArrayElement: 2,
  44396. HasFromToArray: 3
  44397. },
  44398. Versioning: {
  44399. None: 0,
  44400. NeedsUpdate: 1,
  44401. MatrixWorldNeedsUpdate: 2
  44402. },
  44403. GetterByBindingType: [function(e, t) {
  44404. e[t] = this.node[this.propertyName]
  44405. }
  44406. , function(e, t) {
  44407. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44408. e[t++] = i[n]
  44409. }
  44410. , function(e, t) {
  44411. e[t] = this.resolvedProperty[this.propertyIndex]
  44412. }
  44413. , function(e, t) {
  44414. this.resolvedProperty.toArray(e, t)
  44415. }
  44416. ],
  44417. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44418. this.node[this.propertyName] = e[t]
  44419. }
  44420. , function(e, t) {
  44421. this.node[this.propertyName] = e[t],
  44422. this.targetObject.needsUpdate = !0
  44423. }
  44424. , function(e, t) {
  44425. this.node[this.propertyName] = e[t],
  44426. this.targetObject.matrixWorldNeedsUpdate = !0
  44427. }
  44428. ], [function(e, t) {
  44429. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44430. i[n] = e[t++]
  44431. }
  44432. , function(e, t) {
  44433. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44434. i[n] = e[t++];
  44435. this.targetObject.needsUpdate = !0
  44436. }
  44437. , function(e, t) {
  44438. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44439. i[n] = e[t++];
  44440. this.targetObject.matrixWorldNeedsUpdate = !0
  44441. }
  44442. ], [function(e, t) {
  44443. this.resolvedProperty[this.propertyIndex] = e[t]
  44444. }
  44445. , function(e, t) {
  44446. this.resolvedProperty[this.propertyIndex] = e[t],
  44447. this.targetObject.needsUpdate = !0
  44448. }
  44449. , function(e, t) {
  44450. this.resolvedProperty[this.propertyIndex] = e[t],
  44451. this.targetObject.matrixWorldNeedsUpdate = !0
  44452. }
  44453. ], [function(e, t) {
  44454. this.resolvedProperty.fromArray(e, t)
  44455. }
  44456. , function(e, t) {
  44457. this.resolvedProperty.fromArray(e, t),
  44458. this.targetObject.needsUpdate = !0
  44459. }
  44460. , function(e, t) {
  44461. this.resolvedProperty.fromArray(e, t),
  44462. this.targetObject.matrixWorldNeedsUpdate = !0
  44463. }
  44464. ]]
  44465. }),
  44466. Ci.PropertyBinding.Composite = function(e, t, i) {
  44467. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44468. this._targetGroup = e,
  44469. this._bindings = e.subscribe_(t, n)
  44470. }
  44471. ,
  44472. Ci.PropertyBinding.Composite.prototype = {
  44473. constructor: Ci.PropertyBinding.Composite,
  44474. getValue: function(e, t) {
  44475. this.bind();
  44476. var i = this._targetGroup.nCachedObjects_
  44477. , n = this._bindings[i];
  44478. void 0 !== n && n.getValue(e, t)
  44479. },
  44480. setValue: function(e, t) {
  44481. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44482. i[n].setValue(e, t)
  44483. },
  44484. bind: function() {
  44485. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44486. e[t].bind()
  44487. },
  44488. unbind: function() {
  44489. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44490. e[t].unbind()
  44491. }
  44492. },
  44493. Ci.PropertyBinding.create = function(e, t, i) {
  44494. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44495. }
  44496. ,
  44497. Ci.PropertyBinding.parseTrackName = function(e) {
  44498. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44499. , i = t.exec(e);
  44500. if (!i)
  44501. throw new Error("cannot parse trackName at all: " + e);
  44502. i.index === t.lastIndex && t.lastIndex++;
  44503. var n = {
  44504. nodeName: i[3],
  44505. objectName: i[5],
  44506. objectIndex: i[7],
  44507. propertyName: i[9],
  44508. propertyIndex: i[11]
  44509. };
  44510. if (null === n.propertyName || 0 === n.propertyName.length)
  44511. throw new Error("can not parse propertyName from trackName: " + e);
  44512. return n
  44513. }
  44514. ,
  44515. Ci.PropertyBinding.findNode = function(e, r) {
  44516. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44517. return e;
  44518. if (e.skeleton) {
  44519. var t = function(e) {
  44520. for (var t = 0; t < e.bones.length; t++) {
  44521. var i = e.bones[t];
  44522. if (i.name === r)
  44523. return i
  44524. }
  44525. return null
  44526. }(e.skeleton);
  44527. if (t)
  44528. return t
  44529. }
  44530. if (e.children) {
  44531. var o = function(e) {
  44532. for (var t = 0; t < e.length; t++) {
  44533. var i = e[t];
  44534. if (i.name === r || i.uuid === r)
  44535. return i;
  44536. var n = o(i.children);
  44537. if (n)
  44538. return n
  44539. }
  44540. return null
  44541. }
  44542. , i = o(e.children);
  44543. if (i)
  44544. return i
  44545. }
  44546. return null
  44547. }
  44548. ,
  44549. Ci.PropertyMixer = function(e, t, i) {
  44550. this.binding = e,
  44551. this.valueSize = i;
  44552. var n, r = Float64Array;
  44553. switch (t) {
  44554. case "quaternion":
  44555. n = this._slerp;
  44556. break;
  44557. case "string":
  44558. case "bool":
  44559. r = Array,
  44560. n = this._select;
  44561. break;
  44562. default:
  44563. n = this._lerp
  44564. }
  44565. this.buffer = new r(4 * i),
  44566. this._mixBufferRegion = n,
  44567. this.cumulativeWeight = 0,
  44568. this.useCount = 0,
  44569. this.referenceCount = 0
  44570. }
  44571. ,
  44572. Ci.PropertyMixer.prototype = {
  44573. constructor: Ci.PropertyMixer,
  44574. accumulate: function(e, t) {
  44575. var i = this.buffer
  44576. , n = this.valueSize
  44577. , r = e * n + n
  44578. , o = this.cumulativeWeight;
  44579. if (0 === o) {
  44580. for (var a = 0; a !== n; ++a)
  44581. i[r + a] = i[a];
  44582. o = t
  44583. } else {
  44584. var s = t / (o += t);
  44585. this._mixBufferRegion(i, r, 0, s, n)
  44586. }
  44587. this.cumulativeWeight = o
  44588. },
  44589. apply: function(e) {
  44590. var t = this.valueSize
  44591. , i = this.buffer
  44592. , n = e * t + t
  44593. , r = this.cumulativeWeight
  44594. , o = this.binding;
  44595. if (this.cumulativeWeight = 0,
  44596. r < 1) {
  44597. var a = 3 * t;
  44598. this._mixBufferRegion(i, n, a, 1 - r, t)
  44599. }
  44600. for (var s = t, l = t + t; s !== l; ++s)
  44601. if (i[s] !== i[s + t]) {
  44602. o.setValue(i, n);
  44603. break
  44604. }
  44605. },
  44606. saveOriginalState: function() {
  44607. var e = this.binding
  44608. , t = this.buffer
  44609. , i = this.valueSize
  44610. , n = 3 * i;
  44611. e.getValue(t, n);
  44612. for (var r = i, o = n; r !== o; ++r)
  44613. t[r] = t[n + r % i];
  44614. this.cumulativeWeight = 0
  44615. },
  44616. restoreOriginalState: function() {
  44617. var e = 3 * this.valueSize;
  44618. this.binding.setValue(this.buffer, e)
  44619. },
  44620. _select: function(e, t, i, n, r) {
  44621. if (.5 <= n)
  44622. for (var o = 0; o !== r; ++o)
  44623. e[t + o] = e[i + o]
  44624. },
  44625. _slerp: function(e, t, i, n, r) {
  44626. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44627. },
  44628. _lerp: function(e, t, i, n, r) {
  44629. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44630. var s = t + a;
  44631. e[s] = e[s] * o + e[i + a] * n
  44632. }
  44633. }
  44634. },
  44635. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44636. Ci.KeyframeTrack.call(this, e, t, i)
  44637. }
  44638. ,
  44639. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44640. constructor: Ci.BooleanKeyframeTrack,
  44641. ValueTypeName: "bool",
  44642. ValueBufferType: Array,
  44643. DefaultInterpolation: Ci.IntepolateDiscrete,
  44644. InterpolantFactoryMethodLinear: void 0,
  44645. InterpolantFactoryMethodSmooth: void 0
  44646. }),
  44647. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44648. Ci.KeyframeTrack.call(this, e, t, i, n)
  44649. }
  44650. ,
  44651. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44652. constructor: Ci.NumberKeyframeTrack,
  44653. ValueTypeName: "number"
  44654. }),
  44655. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44656. Ci.KeyframeTrack.call(this, e, t, i, n)
  44657. }
  44658. ,
  44659. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44660. constructor: Ci.QuaternionKeyframeTrack,
  44661. ValueTypeName: "quaternion",
  44662. DefaultInterpolation: Ci.InterpolateLinear,
  44663. InterpolantFactoryMethodLinear: function(e) {
  44664. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44665. },
  44666. InterpolantFactoryMethodSmooth: void 0
  44667. }),
  44668. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44669. Ci.KeyframeTrack.call(this, e, t, i, n)
  44670. }
  44671. ,
  44672. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44673. constructor: Ci.StringKeyframeTrack,
  44674. ValueTypeName: "string",
  44675. ValueBufferType: Array,
  44676. DefaultInterpolation: Ci.IntepolateDiscrete,
  44677. InterpolantFactoryMethodLinear: void 0,
  44678. InterpolantFactoryMethodSmooth: void 0
  44679. }),
  44680. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44681. Ci.KeyframeTrack.call(this, e, t, i, n)
  44682. }
  44683. ,
  44684. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44685. constructor: Ci.VectorKeyframeTrack,
  44686. ValueTypeName: "vector"
  44687. }),
  44688. Ci.Audio = function(e) {
  44689. Ci.Object3D.call(this),
  44690. this.type = "Audio",
  44691. this.context = e.context,
  44692. this.source = this.context.createBufferSource(),
  44693. this.source.onended = this.onEnded.bind(this),
  44694. this.gain = this.context.createGain(),
  44695. this.gain.connect(e.getInput()),
  44696. this.autoplay = !1,
  44697. this.startTime = 0,
  44698. this.playbackRate = 1,
  44699. this.isPlaying = !1,
  44700. this.hasPlaybackControl = !0,
  44701. this.sourceType = "empty",
  44702. this.filter = null
  44703. }
  44704. ,
  44705. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44706. Ci.Audio.prototype.constructor = Ci.Audio,
  44707. Ci.Audio.prototype.getOutput = function() {
  44708. return this.gain
  44709. }
  44710. ,
  44711. Ci.Audio.prototype.load = function(e) {
  44712. var t = new Ci.AudioBuffer(this.context);
  44713. return t.load(e),
  44714. this.setBuffer(t),
  44715. this
  44716. }
  44717. ,
  44718. Ci.Audio.prototype.setNodeSource = function(e) {
  44719. return this.hasPlaybackControl = !1,
  44720. this.sourceType = "audioNode",
  44721. this.source = e,
  44722. this.connect(),
  44723. this
  44724. }
  44725. ,
  44726. Ci.Audio.prototype.setBuffer = function(e) {
  44727. var t = this;
  44728. return e.onReady(function(e) {
  44729. t.source.buffer = e,
  44730. t.sourceType = "buffer",
  44731. t.autoplay && t.play()
  44732. }),
  44733. this
  44734. }
  44735. ,
  44736. Ci.Audio.prototype.play = function() {
  44737. if (!0 !== this.isPlaying)
  44738. if (!1 !== this.hasPlaybackControl) {
  44739. var e = this.context.createBufferSource();
  44740. e.buffer = this.source.buffer,
  44741. e.loop = this.source.loop,
  44742. e.onended = this.source.onended,
  44743. e.start(0, this.startTime),
  44744. e.playbackRate.value = this.playbackRate,
  44745. this.isPlaying = !0,
  44746. this.source = e,
  44747. this.connect()
  44748. } else
  44749. console.warn("THREE.Audio: this Audio has no playback control.");
  44750. else
  44751. console.warn("THREE.Audio: Audio is already playing.")
  44752. }
  44753. ,
  44754. Ci.Audio.prototype.pause = function() {
  44755. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44756. void (this.startTime = this.context.currentTime))
  44757. }
  44758. ,
  44759. Ci.Audio.prototype.stop = function() {
  44760. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44761. void (this.startTime = 0))
  44762. }
  44763. ,
  44764. Ci.Audio.prototype.connect = function() {
  44765. null !== this.filter ? (this.source.connect(this.filter),
  44766. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44767. }
  44768. ,
  44769. Ci.Audio.prototype.disconnect = function() {
  44770. null !== this.filter ? (this.source.disconnect(this.filter),
  44771. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44772. }
  44773. ,
  44774. Ci.Audio.prototype.getFilter = function() {
  44775. return this.filter
  44776. }
  44777. ,
  44778. Ci.Audio.prototype.setFilter = function(e) {
  44779. void 0 === e && (e = null),
  44780. !0 === this.isPlaying ? (this.disconnect(),
  44781. this.filter = e,
  44782. this.connect()) : this.filter = e
  44783. }
  44784. ,
  44785. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44786. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44787. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44788. }
  44789. ,
  44790. Ci.Audio.prototype.getPlaybackRate = function() {
  44791. return this.playbackRate
  44792. }
  44793. ,
  44794. Ci.Audio.prototype.onEnded = function() {
  44795. this.isPlaying = !1
  44796. }
  44797. ,
  44798. Ci.Audio.prototype.setLoop = function(e) {
  44799. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44800. }
  44801. ,
  44802. Ci.Audio.prototype.getLoop = function() {
  44803. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44804. !1) : this.source.loop
  44805. }
  44806. ,
  44807. Ci.Audio.prototype.setVolume = function(e) {
  44808. this.gain.gain.value = e
  44809. }
  44810. ,
  44811. Ci.Audio.prototype.getVolume = function() {
  44812. return this.gain.gain.value
  44813. }
  44814. ,
  44815. Ci.AudioAnalyser = function(e, t) {
  44816. this.analyser = e.context.createAnalyser(),
  44817. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44818. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44819. e.getOutput().connect(this.analyser)
  44820. }
  44821. ,
  44822. Ci.AudioAnalyser.prototype = {
  44823. constructor: Ci.AudioAnalyser,
  44824. getData: function() {
  44825. return this.analyser.getByteFrequencyData(this.data),
  44826. this.data
  44827. }
  44828. },
  44829. Ci.AudioBuffer = function(e) {
  44830. this.context = e,
  44831. this.ready = !1,
  44832. this.readyCallbacks = []
  44833. }
  44834. ,
  44835. Ci.AudioBuffer.prototype.load = function(e) {
  44836. var i = this
  44837. , t = new XMLHttpRequest;
  44838. return t.open("GET", e, !0),
  44839. t.responseType = "arraybuffer",
  44840. t.onload = function(e) {
  44841. i.context.decodeAudioData(this.response, function(e) {
  44842. i.buffer = e,
  44843. i.ready = !0;
  44844. for (var t = 0; t < i.readyCallbacks.length; t++)
  44845. i.readyCallbacks[t](i.buffer);
  44846. i.readyCallbacks = []
  44847. })
  44848. }
  44849. ,
  44850. t.send(),
  44851. this
  44852. }
  44853. ,
  44854. Ci.AudioBuffer.prototype.onReady = function(e) {
  44855. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44856. }
  44857. ,
  44858. Ci.PositionalAudio = function(e) {
  44859. Ci.Audio.call(this, e),
  44860. this.panner = this.context.createPanner(),
  44861. this.panner.connect(this.gain)
  44862. }
  44863. ,
  44864. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44865. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44866. Ci.PositionalAudio.prototype.getOutput = function() {
  44867. return this.panner
  44868. }
  44869. ,
  44870. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44871. this.panner.refDistance = e
  44872. }
  44873. ,
  44874. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44875. return this.panner.refDistance
  44876. }
  44877. ,
  44878. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44879. this.panner.rolloffFactor = e
  44880. }
  44881. ,
  44882. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44883. return this.panner.rolloffFactor
  44884. }
  44885. ,
  44886. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44887. this.panner.distanceModel = e
  44888. }
  44889. ,
  44890. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44891. return this.panner.distanceModel
  44892. }
  44893. ,
  44894. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44895. this.panner.maxDistance = e
  44896. }
  44897. ,
  44898. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44899. return this.panner.maxDistance
  44900. }
  44901. ,
  44902. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44903. function(e) {
  44904. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44905. it.setFromMatrixPosition(this.matrixWorld),
  44906. this.panner.setPosition(it.x, it.y, it.z)
  44907. }
  44908. ),
  44909. Ci.AudioListener = function() {
  44910. Ci.Object3D.call(this),
  44911. this.type = "AudioListener",
  44912. this.context = new (window.AudioContext || window.webkitAudioContext),
  44913. this.gain = this.context.createGain(),
  44914. this.gain.connect(this.context.destination),
  44915. this.filter = null
  44916. }
  44917. ,
  44918. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44919. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44920. Ci.AudioListener.prototype.getInput = function() {
  44921. return this.gain
  44922. }
  44923. ,
  44924. Ci.AudioListener.prototype.removeFilter = function() {
  44925. null !== this.filter && (this.gain.disconnect(this.filter),
  44926. this.filter.disconnect(this.context.destination),
  44927. this.gain.connect(this.context.destination),
  44928. this.filter = null)
  44929. }
  44930. ,
  44931. Ci.AudioListener.prototype.setFilter = function(e) {
  44932. null !== this.filter ? (this.gain.disconnect(this.filter),
  44933. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44934. this.filter = e,
  44935. this.gain.connect(this.filter),
  44936. this.filter.connect(this.context.destination)
  44937. }
  44938. ,
  44939. Ci.AudioListener.prototype.getFilter = function() {
  44940. return this.filter
  44941. }
  44942. ,
  44943. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44944. this.gain.gain.value = e
  44945. }
  44946. ,
  44947. Ci.AudioListener.prototype.getMasterVolume = function() {
  44948. return this.gain.gain.value
  44949. }
  44950. ,
  44951. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44952. $e = new Ci.Quaternion,
  44953. et = new Ci.Vector3,
  44954. tt = new Ci.Vector3,
  44955. function(e) {
  44956. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44957. var t = this.context.listener
  44958. , i = this.up;
  44959. this.matrixWorld.decompose(Je, $e, et),
  44960. tt.set(0, 0, -1).applyQuaternion($e),
  44961. t.setPosition(Je.x, Je.y, Je.z),
  44962. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44963. }
  44964. ),
  44965. Ci.Camera = function() {
  44966. Ci.Object3D.call(this),
  44967. this.type = "Camera",
  44968. this.matrixWorldInverse = new Ci.Matrix4,
  44969. this.projectionMatrix = new Ci.Matrix4
  44970. }
  44971. ,
  44972. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44973. Ci.Camera.prototype.constructor = Ci.Camera,
  44974. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44975. function(e) {
  44976. var t = e || new Ci.Vector3;
  44977. return this.getWorldQuaternion(Qe),
  44978. t.set(0, 0, -1).applyQuaternion(Qe)
  44979. }
  44980. ),
  44981. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44982. function(e) {
  44983. Ke.lookAt(this.position, e, this.up),
  44984. this.quaternion.setFromRotationMatrix(Ke)
  44985. }
  44986. ),
  44987. Ci.Camera.prototype.clone = function() {
  44988. return (new this.constructor).copy(this)
  44989. }
  44990. ,
  44991. Ci.Camera.prototype.copy = function(e) {
  44992. return Ci.Object3D.prototype.copy.call(this, e),
  44993. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44994. this.projectionMatrix.copy(e.projectionMatrix),
  44995. this
  44996. }
  44997. ,
  44998. Ci.CubeCamera = function(e, t, i) {
  44999. Ci.Object3D.call(this),
  45000. this.type = "CubeCamera";
  45001. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45002. r.up.set(0, -1, 0),
  45003. r.lookAt(new Ci.Vector3(1,0,0)),
  45004. this.add(r);
  45005. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45006. o.up.set(0, -1, 0),
  45007. o.lookAt(new Ci.Vector3(-1,0,0)),
  45008. this.add(o);
  45009. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45010. a.up.set(0, 0, 1),
  45011. a.lookAt(new Ci.Vector3(0,1,0)),
  45012. this.add(a);
  45013. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45014. s.up.set(0, 0, -1),
  45015. s.lookAt(new Ci.Vector3(0,-1,0)),
  45016. this.add(s);
  45017. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45018. l.up.set(0, -1, 0),
  45019. l.lookAt(new Ci.Vector3(0,0,1)),
  45020. this.add(l);
  45021. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45022. c.up.set(0, -1, 0),
  45023. c.lookAt(new Ci.Vector3(0,0,-1)),
  45024. this.add(c);
  45025. var n = {
  45026. format: Ci.RGBFormat,
  45027. magFilter: Ci.LinearFilter,
  45028. minFilter: Ci.LinearFilter
  45029. };
  45030. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45031. this.updateCubeMap = function(e, t) {
  45032. null === this.parent && this.updateMatrixWorld();
  45033. var i = this.renderTarget
  45034. , n = i.texture.generateMipmaps;
  45035. i.texture.generateMipmaps = !1,
  45036. i.activeCubeFace = 0,
  45037. e.render(t, r, i),
  45038. i.activeCubeFace = 1,
  45039. e.render(t, o, i),
  45040. i.activeCubeFace = 2,
  45041. e.render(t, a, i),
  45042. i.activeCubeFace = 3,
  45043. e.render(t, s, i),
  45044. i.activeCubeFace = 4,
  45045. e.render(t, l, i),
  45046. i.texture.generateMipmaps = n,
  45047. i.activeCubeFace = 5,
  45048. e.render(t, c, i),
  45049. e.setRenderTarget(null)
  45050. }
  45051. }
  45052. ,
  45053. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45054. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45055. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45056. Ci.Camera.call(this),
  45057. this.type = "OrthographicCamera",
  45058. this.zoom = 1,
  45059. this.left = e,
  45060. this.right = t,
  45061. this.top = i,
  45062. this.bottom = n,
  45063. this.near = void 0 !== r ? r : .1,
  45064. this.far = void 0 !== o ? o : 2e3,
  45065. this.updateProjectionMatrix()
  45066. }
  45067. ,
  45068. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45069. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45070. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45071. var e = (this.right - this.left) / (2 * this.zoom)
  45072. , t = (this.top - this.bottom) / (2 * this.zoom)
  45073. , i = (this.right + this.left) / 2
  45074. , n = (this.top + this.bottom) / 2;
  45075. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45076. }
  45077. ,
  45078. Ci.OrthographicCamera.prototype.copy = function(e) {
  45079. return Ci.Camera.prototype.copy.call(this, e),
  45080. this.left = e.left,
  45081. this.right = e.right,
  45082. this.top = e.top,
  45083. this.bottom = e.bottom,
  45084. this.near = e.near,
  45085. this.far = e.far,
  45086. this.zoom = e.zoom,
  45087. this
  45088. }
  45089. ,
  45090. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45091. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45092. return t.object.zoom = this.zoom,
  45093. t.object.left = this.left,
  45094. t.object.right = this.right,
  45095. t.object.top = this.top,
  45096. t.object.bottom = this.bottom,
  45097. t.object.near = this.near,
  45098. t.object.far = this.far,
  45099. t
  45100. }
  45101. ,
  45102. Ci.PerspectiveCamera = function(e, t, i, n) {
  45103. Ci.Camera.call(this),
  45104. this.type = "PerspectiveCamera",
  45105. this.focalLength = 10,
  45106. this.zoom = 1,
  45107. this.fov = void 0 !== e ? e : 50,
  45108. this.aspect = void 0 !== t ? t : 1,
  45109. this.near = void 0 !== i ? i : .1,
  45110. this.far = void 0 !== n ? n : 2e3,
  45111. this.updateProjectionMatrix()
  45112. }
  45113. ,
  45114. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45115. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45116. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45117. void 0 === t && (t = 24),
  45118. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45119. this.updateProjectionMatrix()
  45120. }
  45121. ,
  45122. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45123. this.fullWidth = e,
  45124. this.fullHeight = t,
  45125. this.x = i,
  45126. this.y = n,
  45127. this.width = r,
  45128. this.height = o,
  45129. this.updateProjectionMatrix()
  45130. }
  45131. ,
  45132. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45133. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45134. if (this.fullWidth) {
  45135. var t = this.fullWidth / this.fullHeight
  45136. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45137. , n = -i
  45138. , r = t * n
  45139. , o = t * i
  45140. , a = Math.abs(o - r)
  45141. , s = Math.abs(i - n);
  45142. 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)
  45143. } else
  45144. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45145. }
  45146. ,
  45147. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45148. return Ci.Camera.prototype.copy.call(this, e),
  45149. this.focalLength = e.focalLength,
  45150. this.zoom = e.zoom,
  45151. this.fov = e.fov,
  45152. this.aspect = e.aspect,
  45153. this.near = e.near,
  45154. this.far = e.far,
  45155. this
  45156. }
  45157. ,
  45158. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45159. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45160. return t.object.focalLength = this.focalLength,
  45161. t.object.zoom = this.zoom,
  45162. t.object.fov = this.fov,
  45163. t.object.aspect = this.aspect,
  45164. t.object.near = this.near,
  45165. t.object.far = this.far,
  45166. t
  45167. }
  45168. ,
  45169. Ci.StereoCamera = function() {
  45170. this.type = "StereoCamera",
  45171. this.aspect = 1,
  45172. this.cameraL = new Ci.PerspectiveCamera,
  45173. this.cameraL.layers.enable(1),
  45174. this.cameraL.matrixAutoUpdate = !1,
  45175. this.cameraR = new Ci.PerspectiveCamera,
  45176. this.cameraR.layers.enable(2),
  45177. this.cameraR.matrixAutoUpdate = !1
  45178. }
  45179. ,
  45180. Ci.StereoCamera.prototype = {
  45181. constructor: Ci.StereoCamera,
  45182. update: (Xe = new Ci.Matrix4,
  45183. Ze = new Ci.Matrix4,
  45184. function(e) {
  45185. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45186. Ge = e.focalLength,
  45187. We = e.fov,
  45188. je = e.aspect * this.aspect,
  45189. Ye = e.near,
  45190. qe = e.far;
  45191. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45192. Ze.elements[12] = -.032,
  45193. Xe.elements[12] = .032,
  45194. t = -o * je + r,
  45195. i = o * je + r,
  45196. n.elements[0] = 2 * Ye / (i - t),
  45197. n.elements[8] = (i + t) / (i - t),
  45198. this.cameraL.projectionMatrix.copy(n),
  45199. t = -o * je - r,
  45200. i = o * je - r,
  45201. n.elements[0] = 2 * Ye / (i - t),
  45202. n.elements[8] = (i + t) / (i - t),
  45203. this.cameraR.projectionMatrix.copy(n)
  45204. }
  45205. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45206. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45207. }
  45208. )
  45209. },
  45210. Ci.Light = function(e, t) {
  45211. Ci.Object3D.call(this),
  45212. this.type = "Light",
  45213. this.color = new Ci.Color(e),
  45214. this.intensity = void 0 !== t ? t : 1,
  45215. this.receiveShadow = void 0
  45216. }
  45217. ,
  45218. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45219. Ci.Light.prototype.constructor = Ci.Light,
  45220. Ci.Light.prototype.copy = function(e) {
  45221. return Ci.Object3D.prototype.copy.call(this, e),
  45222. this.color.copy(e.color),
  45223. this.intensity = e.intensity,
  45224. this
  45225. }
  45226. ,
  45227. Ci.Light.prototype.toJSON = function(e) {
  45228. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45229. return t.object.color = this.color.getHex(),
  45230. t.object.intensity = this.intensity,
  45231. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45232. void 0 !== this.distance && (t.object.distance = this.distance),
  45233. void 0 !== this.angle && (t.object.angle = this.angle),
  45234. void 0 !== this.decay && (t.object.decay = this.decay),
  45235. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45236. t
  45237. }
  45238. ,
  45239. Ci.LightShadow = function(e) {
  45240. this.camera = e,
  45241. this.bias = 0,
  45242. this.radius = 1,
  45243. this.mapSize = new Ci.Vector2(512,512),
  45244. this.map = null,
  45245. this.matrix = new Ci.Matrix4
  45246. }
  45247. ,
  45248. Ci.LightShadow.prototype = {
  45249. constructor: Ci.LightShadow,
  45250. copy: function(e) {
  45251. return this.camera = e.camera.clone(),
  45252. this.bias = e.bias,
  45253. this.radius = e.radius,
  45254. this.mapSize.copy(e.mapSize),
  45255. this
  45256. },
  45257. clone: function() {
  45258. return (new this.constructor).copy(this)
  45259. }
  45260. },
  45261. Ci.AmbientLight = function(e, t) {
  45262. Ci.Light.call(this, e, t),
  45263. this.type = "AmbientLight",
  45264. this.castShadow = void 0
  45265. }
  45266. ,
  45267. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45268. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45269. Ci.DirectionalLight = function(e, t) {
  45270. Ci.Light.call(this, e, t),
  45271. this.type = "DirectionalLight",
  45272. this.position.set(0, 1, 0),
  45273. this.updateMatrix(),
  45274. this.target = new Ci.Object3D,
  45275. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45276. }
  45277. ,
  45278. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45279. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45280. Ci.DirectionalLight.prototype.copy = function(e) {
  45281. return Ci.Light.prototype.copy.call(this, e),
  45282. this.target = e.target.clone(),
  45283. this.shadow = e.shadow.clone(),
  45284. this
  45285. }
  45286. ,
  45287. Ci.HemisphereLight = function(e, t, i) {
  45288. Ci.Light.call(this, e, i),
  45289. this.type = "HemisphereLight",
  45290. this.castShadow = void 0,
  45291. this.position.set(0, 1, 0),
  45292. this.updateMatrix(),
  45293. this.groundColor = new Ci.Color(t)
  45294. }
  45295. ,
  45296. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45297. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45298. Ci.HemisphereLight.prototype.copy = function(e) {
  45299. return Ci.Light.prototype.copy.call(this, e),
  45300. this.groundColor.copy(e.groundColor),
  45301. this
  45302. }
  45303. ,
  45304. Ci.PointLight = function(e, t, i, n) {
  45305. Ci.Light.call(this, e, t),
  45306. this.type = "PointLight",
  45307. this.distance = void 0 !== i ? i : 0,
  45308. this.decay = void 0 !== n ? n : 1,
  45309. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45310. }
  45311. ,
  45312. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45313. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45314. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45315. get: function() {
  45316. return 4 * this.intensity * Math.PI
  45317. },
  45318. set: function(e) {
  45319. this.intensity = e / (4 * Math.PI)
  45320. }
  45321. }),
  45322. Ci.PointLight.prototype.copy = function(e) {
  45323. return Ci.Light.prototype.copy.call(this, e),
  45324. this.distance = e.distance,
  45325. this.decay = e.decay,
  45326. this.shadow = e.shadow.clone(),
  45327. this
  45328. }
  45329. ,
  45330. Ci.SpotLight = function(e, t, i, n, r, o) {
  45331. Ci.Light.call(this, e, t),
  45332. this.type = "SpotLight",
  45333. this.position.set(0, 1, 0),
  45334. this.updateMatrix(),
  45335. this.target = new Ci.Object3D,
  45336. this.distance = void 0 !== i ? i : 0,
  45337. this.angle = void 0 !== n ? n : Math.PI / 3,
  45338. this.penumbra = void 0 !== r ? r : 0,
  45339. this.decay = void 0 !== o ? o : 1,
  45340. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45341. }
  45342. ,
  45343. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45344. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45345. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45346. get: function() {
  45347. return this.intensity * Math.PI
  45348. },
  45349. set: function(e) {
  45350. this.intensity = e / Math.PI
  45351. }
  45352. }),
  45353. Ci.SpotLight.prototype.copy = function(e) {
  45354. return Ci.Light.prototype.copy.call(this, e),
  45355. this.distance = e.distance,
  45356. this.angle = e.angle,
  45357. this.penumbra = e.penumbra,
  45358. this.decay = e.decay,
  45359. this.target = e.target.clone(),
  45360. this.shadow = e.shadow.clone(),
  45361. this
  45362. }
  45363. ,
  45364. Ci.Cache = {
  45365. enabled: !1,
  45366. files: {},
  45367. add: function(e, t) {
  45368. !1 !== this.enabled && (this.files[e] = t)
  45369. },
  45370. get: function(e) {
  45371. if (!1 !== this.enabled)
  45372. return this.files[e]
  45373. },
  45374. remove: function(e) {
  45375. delete this.files[e]
  45376. },
  45377. clear: function() {
  45378. this.files = {}
  45379. }
  45380. },
  45381. Ci.Loader = function() {
  45382. this.onLoadStart = function() {}
  45383. ,
  45384. this.onLoadProgress = function() {}
  45385. ,
  45386. this.onLoadComplete = function() {}
  45387. }
  45388. ,
  45389. Ci.Loader.prototype = {
  45390. constructor: Ci.Loader,
  45391. crossOrigin: void 0,
  45392. extractUrlBase: function(e) {
  45393. var t = e.split("/");
  45394. return 1 === t.length ? "./" : (t.pop(),
  45395. t.join("/") + "/")
  45396. },
  45397. initMaterials: function(e, t, i) {
  45398. for (var n = [], r = 0; r < e.length; ++r)
  45399. n[r] = this.createMaterial(e[r], t, i);
  45400. return n
  45401. },
  45402. createMaterial: function(e, c, h) {
  45403. function t(e, t, i, n, r) {
  45404. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45405. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45406. He.load(a)),
  45407. void 0 !== t && (o.repeat.fromArray(t),
  45408. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45409. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45410. void 0 !== i && o.offset.fromArray(i),
  45411. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45412. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45413. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45414. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45415. void 0 !== r && (o.anisotropy = r);
  45416. var l = Ci.Math.generateUUID();
  45417. return u[l] = o,
  45418. l
  45419. }
  45420. void 0 === Ue && (Ue = new Ci.Color),
  45421. void 0 === He && (He = new Ci.TextureLoader),
  45422. void 0 === ze && (ze = new Ci.MaterialLoader);
  45423. var u = {}
  45424. , i = {
  45425. uuid: Ci.Math.generateUUID(),
  45426. type: "MeshLambertMaterial"
  45427. };
  45428. for (var n in e) {
  45429. var r = e[n];
  45430. switch (n) {
  45431. case "DbgColor":
  45432. case "DbgIndex":
  45433. case "opticalDensity":
  45434. case "illumination":
  45435. break;
  45436. case "DbgName":
  45437. i.name = r;
  45438. break;
  45439. case "blending":
  45440. i.blending = Ci[r];
  45441. break;
  45442. case "colorAmbient":
  45443. case "mapAmbient":
  45444. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45445. break;
  45446. case "colorDiffuse":
  45447. i.color = Ue.fromArray(r).getHex();
  45448. break;
  45449. case "colorSpecular":
  45450. i.specular = Ue.fromArray(r).getHex();
  45451. break;
  45452. case "colorEmissive":
  45453. i.emissive = Ue.fromArray(r).getHex();
  45454. break;
  45455. case "specularCoef":
  45456. i.shininess = r;
  45457. break;
  45458. case "shading":
  45459. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45460. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45461. break;
  45462. case "mapDiffuse":
  45463. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45464. break;
  45465. case "mapDiffuseRepeat":
  45466. case "mapDiffuseOffset":
  45467. case "mapDiffuseWrap":
  45468. case "mapDiffuseAnisotropy":
  45469. break;
  45470. case "mapLight":
  45471. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45472. break;
  45473. case "mapLightRepeat":
  45474. case "mapLightOffset":
  45475. case "mapLightWrap":
  45476. case "mapLightAnisotropy":
  45477. break;
  45478. case "mapAO":
  45479. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45480. break;
  45481. case "mapAORepeat":
  45482. case "mapAOOffset":
  45483. case "mapAOWrap":
  45484. case "mapAOAnisotropy":
  45485. break;
  45486. case "mapBump":
  45487. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45488. break;
  45489. case "mapBumpScale":
  45490. i.bumpScale = r;
  45491. break;
  45492. case "mapBumpRepeat":
  45493. case "mapBumpOffset":
  45494. case "mapBumpWrap":
  45495. case "mapBumpAnisotropy":
  45496. break;
  45497. case "mapNormal":
  45498. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45499. break;
  45500. case "mapNormalFactor":
  45501. i.normalScale = [r, r];
  45502. break;
  45503. case "mapNormalRepeat":
  45504. case "mapNormalOffset":
  45505. case "mapNormalWrap":
  45506. case "mapNormalAnisotropy":
  45507. break;
  45508. case "mapSpecular":
  45509. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45510. break;
  45511. case "mapSpecularRepeat":
  45512. case "mapSpecularOffset":
  45513. case "mapSpecularWrap":
  45514. case "mapSpecularAnisotropy":
  45515. break;
  45516. case "mapAlpha":
  45517. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45518. break;
  45519. case "mapAlphaRepeat":
  45520. case "mapAlphaOffset":
  45521. case "mapAlphaWrap":
  45522. case "mapAlphaAnisotropy":
  45523. break;
  45524. case "flipSided":
  45525. i.side = Ci.BackSide;
  45526. break;
  45527. case "doubleSided":
  45528. i.side = Ci.DoubleSide;
  45529. break;
  45530. case "transparency":
  45531. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45532. i.opacity = r;
  45533. break;
  45534. case "depthTest":
  45535. case "depthWrite":
  45536. case "colorWrite":
  45537. case "opacity":
  45538. case "reflectivity":
  45539. case "transparent":
  45540. case "visible":
  45541. case "wireframe":
  45542. i[n] = r;
  45543. break;
  45544. case "vertexColors":
  45545. !0 === r && (i.vertexColors = Ci.VertexColors),
  45546. "face" === r && (i.vertexColors = Ci.FaceColors);
  45547. break;
  45548. default:
  45549. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45550. }
  45551. }
  45552. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45553. "MeshPhongMaterial" !== i.type && delete i.specular,
  45554. i.opacity < 1 && (i.transparent = !0),
  45555. ze.setTextures(u),
  45556. ze.parse(i)
  45557. }
  45558. },
  45559. Ci.Loader.Handlers = {
  45560. handlers: [],
  45561. add: function(e, t) {
  45562. this.handlers.push(e, t)
  45563. },
  45564. get: function(e) {
  45565. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45566. var r = t[i]
  45567. , o = t[i + 1];
  45568. if (r.test(e))
  45569. return o
  45570. }
  45571. return null
  45572. }
  45573. },
  45574. Ci.XHRLoader = function(e) {
  45575. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45576. }
  45577. ,
  45578. Ci.XHRLoader.prototype = {
  45579. constructor: Ci.XHRLoader,
  45580. load: function(i, n, t, r) {
  45581. void 0 !== this.path && (i = this.path + i);
  45582. var o = this
  45583. , e = Ci.Cache.get(i);
  45584. if (void 0 !== e)
  45585. return n && setTimeout(function() {
  45586. n(e)
  45587. }, 0),
  45588. e;
  45589. var a = new XMLHttpRequest;
  45590. return a.overrideMimeType("text/plain"),
  45591. a.open("GET", i, !0),
  45592. a.addEventListener("load", function(e) {
  45593. var t = e.target.response;
  45594. Ci.Cache.add(i, t),
  45595. 200 === this.status ? (n && n(t),
  45596. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45597. n && n(t),
  45598. o.manager.itemEnd(i)) : (r && r(e),
  45599. o.manager.itemError(i))
  45600. }, !1),
  45601. void 0 !== t && a.addEventListener("progress", function(e) {
  45602. t(e)
  45603. }, !1),
  45604. a.addEventListener("error", function(e) {
  45605. r && r(e),
  45606. o.manager.itemError(i)
  45607. }, !1),
  45608. void 0 !== this.responseType && (a.responseType = this.responseType),
  45609. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45610. a.send(null),
  45611. o.manager.itemStart(i),
  45612. a
  45613. },
  45614. setPath: function(e) {
  45615. this.path = e
  45616. },
  45617. setResponseType: function(e) {
  45618. this.responseType = e
  45619. },
  45620. setWithCredentials: function(e) {
  45621. this.withCredentials = e
  45622. }
  45623. },
  45624. Ci.FontLoader = function(e) {
  45625. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45626. }
  45627. ,
  45628. Ci.FontLoader.prototype = {
  45629. constructor: Ci.FontLoader,
  45630. load: function(e, t, i, n) {
  45631. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45632. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45633. }, i, n)
  45634. }
  45635. },
  45636. Ci.ImageLoader = function(e) {
  45637. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45638. }
  45639. ,
  45640. Ci.ImageLoader.prototype = {
  45641. constructor: Ci.ImageLoader,
  45642. load: function(t, i, n, r) {
  45643. void 0 !== this.path && (t = this.path + t);
  45644. var o = this
  45645. , e = Ci.Cache.get(t);
  45646. if (void 0 !== e)
  45647. return o.manager.itemStart(t),
  45648. i ? setTimeout(function() {
  45649. i(e),
  45650. o.manager.itemEnd(t)
  45651. }, 0) : o.manager.itemEnd(t),
  45652. e;
  45653. var a = document.createElement("img");
  45654. return a.addEventListener("load", function(e) {
  45655. Ci.Cache.add(t, this),
  45656. i && i(this),
  45657. o.manager.itemEnd(t)
  45658. }, !1),
  45659. void 0 !== n && a.addEventListener("progress", function(e) {
  45660. n(e)
  45661. }, !1),
  45662. a.addEventListener("error", function(e) {
  45663. r && r(e),
  45664. o.manager.itemError(t)
  45665. }, !1),
  45666. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45667. o.manager.itemStart(t),
  45668. a.src = t,
  45669. a
  45670. },
  45671. setCrossOrigin: function(e) {
  45672. this.crossOrigin = e
  45673. },
  45674. setPath: function(e) {
  45675. this.path = e
  45676. }
  45677. },
  45678. Ci.JSONLoader = function(e) {
  45679. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45680. e = void 0),
  45681. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45682. this.withCredentials = !1
  45683. }
  45684. ,
  45685. Ci.JSONLoader.prototype = {
  45686. constructor: Ci.JSONLoader,
  45687. get statusDomElement() {
  45688. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45689. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45690. this._statusDomElement
  45691. },
  45692. load: function(o, a, e, t) {
  45693. var s = this
  45694. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45695. , i = new Ci.XHRLoader(this.manager);
  45696. i.setWithCredentials(this.withCredentials),
  45697. i.load(o, function(e) {
  45698. var t = JSON.parse(e)
  45699. , i = t.metadata;
  45700. if (void 0 !== i) {
  45701. var n = i.type;
  45702. if (void 0 !== n) {
  45703. if ("object" === n.toLowerCase())
  45704. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45705. if ("scene" === n.toLowerCase())
  45706. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45707. }
  45708. }
  45709. var r = s.parse(t, l);
  45710. a(r.geometry, r.materials)
  45711. }, e, t)
  45712. },
  45713. setTexturePath: function(e) {
  45714. this.texturePath = e
  45715. },
  45716. parse: function(D, e) {
  45717. var N = new Ci.Geometry
  45718. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45719. if (function(e) {
  45720. function t(e, t) {
  45721. return e & 1 << t
  45722. }
  45723. 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;
  45724. if (void 0 !== D.uvs) {
  45725. for (i = 0; i < D.uvs.length; i++)
  45726. D.uvs[i].length && L++;
  45727. for (i = 0; i < L; i++)
  45728. N.faceVertexUvs[i] = []
  45729. }
  45730. for (o = 0,
  45731. a = R.length; o < a; )
  45732. (A = new Ci.Vector3).x = R[o++] * e,
  45733. A.y = R[o++] * e,
  45734. A.z = R[o++] * e,
  45735. N.vertices.push(A);
  45736. for (o = 0,
  45737. a = M.length; o < a; )
  45738. if (d = t(u = M[o++], 0),
  45739. p = t(u, 1),
  45740. f = t(u, 3),
  45741. g = t(u, 4),
  45742. m = t(u, 5),
  45743. v = t(u, 6),
  45744. y = t(u, 7),
  45745. d) {
  45746. if ((I = new Ci.Face3).a = M[o],
  45747. I.b = M[o + 1],
  45748. I.c = M[o + 3],
  45749. (E = new Ci.Face3).a = M[o + 1],
  45750. E.b = M[o + 2],
  45751. E.c = M[o + 3],
  45752. o += 4,
  45753. p && (h = M[o++],
  45754. I.materialIndex = h,
  45755. E.materialIndex = h),
  45756. r = N.faces.length,
  45757. f)
  45758. for (i = 0; i < L; i++)
  45759. for (w = D.uvs[i],
  45760. N.faceVertexUvs[i][r] = [],
  45761. N.faceVertexUvs[i][r + 1] = [],
  45762. n = 0; n < 4; n++)
  45763. x = w[2 * (c = M[o++])],
  45764. S = w[2 * c + 1],
  45765. T = new Ci.Vector2(x,S),
  45766. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45767. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45768. if (g && (l = 3 * M[o++],
  45769. I.normal.set(P[l++], P[l++], P[l]),
  45770. E.normal.copy(I.normal)),
  45771. m)
  45772. for (i = 0; i < 4; i++)
  45773. l = 3 * M[o++],
  45774. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45775. 2 !== i && I.vertexNormals.push(b),
  45776. 0 !== i && E.vertexNormals.push(b);
  45777. if (v && (_ = O[s = M[o++]],
  45778. I.color.setHex(_),
  45779. E.color.setHex(_)),
  45780. y)
  45781. for (i = 0; i < 4; i++)
  45782. _ = O[s = M[o++]],
  45783. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45784. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45785. N.faces.push(I),
  45786. N.faces.push(E)
  45787. } else {
  45788. if ((C = new Ci.Face3).a = M[o++],
  45789. C.b = M[o++],
  45790. C.c = M[o++],
  45791. p && (h = M[o++],
  45792. C.materialIndex = h),
  45793. r = N.faces.length,
  45794. f)
  45795. for (i = 0; i < L; i++)
  45796. for (w = D.uvs[i],
  45797. N.faceVertexUvs[i][r] = [],
  45798. n = 0; n < 3; n++)
  45799. x = w[2 * (c = M[o++])],
  45800. S = w[2 * c + 1],
  45801. T = new Ci.Vector2(x,S),
  45802. N.faceVertexUvs[i][r].push(T);
  45803. if (g && (l = 3 * M[o++],
  45804. C.normal.set(P[l++], P[l++], P[l])),
  45805. m)
  45806. for (i = 0; i < 3; i++)
  45807. l = 3 * M[o++],
  45808. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45809. C.vertexNormals.push(b);
  45810. if (v && (s = M[o++],
  45811. C.color.setHex(O[s])),
  45812. y)
  45813. for (i = 0; i < 3; i++)
  45814. s = M[o++],
  45815. C.vertexColors.push(new Ci.Color(O[s]));
  45816. N.faces.push(C)
  45817. }
  45818. }(t),
  45819. function() {
  45820. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45821. if (D.skinWeights)
  45822. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45823. var n = D.skinWeights[t]
  45824. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45825. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45826. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45827. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45828. }
  45829. if (D.skinIndices)
  45830. for (t = 0,
  45831. i = D.skinIndices.length; t < i; t += e) {
  45832. var s = D.skinIndices[t]
  45833. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45834. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45835. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45836. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45837. }
  45838. N.bones = D.bones,
  45839. 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.")
  45840. }(),
  45841. function(e) {
  45842. if (void 0 !== D.morphTargets)
  45843. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45844. N.morphTargets[t] = {},
  45845. N.morphTargets[t].name = D.morphTargets[t].name,
  45846. N.morphTargets[t].vertices = [];
  45847. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45848. var s = new Ci.Vector3;
  45849. s.x = r[o] * e,
  45850. s.y = r[o + 1] * e,
  45851. s.z = r[o + 2] * e,
  45852. n.push(s)
  45853. }
  45854. }
  45855. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45856. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45857. var l = N.faces
  45858. , c = D.morphColors[0].colors;
  45859. for (t = 0,
  45860. i = l.length; t < i; t++)
  45861. l[t].color.fromArray(c, 3 * t)
  45862. }
  45863. }(t),
  45864. function() {
  45865. var e = []
  45866. , t = [];
  45867. void 0 !== D.animation && t.push(D.animation),
  45868. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45869. for (var i = 0; i < t.length; i++) {
  45870. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45871. n && e.push(n)
  45872. }
  45873. if (N.morphTargets) {
  45874. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45875. e = e.concat(r)
  45876. }
  45877. 0 < e.length && (N.animations = e)
  45878. }(),
  45879. N.computeFaceNormals(),
  45880. N.computeBoundingSphere(),
  45881. void 0 === D.materials || 0 === D.materials.length)
  45882. return {
  45883. geometry: N
  45884. };
  45885. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45886. return {
  45887. geometry: N,
  45888. materials: i
  45889. }
  45890. }
  45891. },
  45892. Ci.LoadingManager = function(e, t, i) {
  45893. var n = this
  45894. , r = !1
  45895. , o = 0
  45896. , a = 0;
  45897. this.onStart = void 0,
  45898. this.onLoad = e,
  45899. this.onProgress = t,
  45900. this.onError = i,
  45901. this.itemStart = function(e) {
  45902. a++,
  45903. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45904. r = !0
  45905. }
  45906. ,
  45907. this.itemEnd = function(e) {
  45908. o++,
  45909. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45910. o === a && (r = !1,
  45911. void 0 !== n.onLoad && n.onLoad())
  45912. }
  45913. ,
  45914. this.itemError = function(e) {
  45915. void 0 !== n.onError && n.onError(e)
  45916. }
  45917. }
  45918. ,
  45919. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45920. Ci.BufferGeometryLoader = function(e) {
  45921. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45922. }
  45923. ,
  45924. Ci.BufferGeometryLoader.prototype = {
  45925. constructor: Ci.BufferGeometryLoader,
  45926. load: function(e, t, i, n) {
  45927. var r = this;
  45928. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45929. t(r.parse(JSON.parse(e)))
  45930. }, i, n)
  45931. },
  45932. parse: function(e) {
  45933. var t = new Ci.BufferGeometry
  45934. , i = e.data.index
  45935. , n = {
  45936. Int8Array: Int8Array,
  45937. Uint8Array: Uint8Array,
  45938. Uint8ClampedArray: Uint8ClampedArray,
  45939. Int16Array: Int16Array,
  45940. Uint16Array: Uint16Array,
  45941. Int32Array: Int32Array,
  45942. Uint32Array: Uint32Array,
  45943. Float32Array: Float32Array,
  45944. Float64Array: Float64Array
  45945. };
  45946. if (void 0 !== i) {
  45947. var r = new n[i.type](i.array);
  45948. t.setIndex(new Ci.BufferAttribute(r,1))
  45949. }
  45950. var o = e.data.attributes;
  45951. for (var a in o) {
  45952. var s = o[a];
  45953. r = new n[s.type](s.array);
  45954. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45955. }
  45956. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45957. if (void 0 !== l)
  45958. for (var c = 0, h = l.length; c !== h; ++c) {
  45959. var u = l[c];
  45960. t.addGroup(u.start, u.count, u.materialIndex)
  45961. }
  45962. var d = e.data.boundingSphere;
  45963. if (void 0 !== d) {
  45964. var p = new Ci.Vector3;
  45965. void 0 !== d.center && p.fromArray(d.center),
  45966. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45967. }
  45968. return t
  45969. }
  45970. },
  45971. Ci.MaterialLoader = function(e) {
  45972. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45973. this.textures = {}
  45974. }
  45975. ,
  45976. Ci.MaterialLoader.prototype = {
  45977. constructor: Ci.MaterialLoader,
  45978. load: function(e, t, i, n) {
  45979. var r = this;
  45980. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45981. t(r.parse(JSON.parse(e)))
  45982. }, i, n)
  45983. },
  45984. setTextures: function(e) {
  45985. this.textures = e
  45986. },
  45987. getTexture: function(e) {
  45988. var t = this.textures;
  45989. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45990. t[e]
  45991. },
  45992. parse: function(e) {
  45993. var t = new Ci[e.type];
  45994. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45995. void 0 !== e.name && (t.name = e.name),
  45996. void 0 !== e.color && t.color.setHex(e.color),
  45997. void 0 !== e.roughness && (t.roughness = e.roughness),
  45998. void 0 !== e.metalness && (t.metalness = e.metalness),
  45999. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46000. void 0 !== e.specular && t.specular.setHex(e.specular),
  46001. void 0 !== e.shininess && (t.shininess = e.shininess),
  46002. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46003. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46004. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46005. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46006. void 0 !== e.shading && (t.shading = e.shading),
  46007. void 0 !== e.blending && (t.blending = e.blending),
  46008. void 0 !== e.side && (t.side = e.side),
  46009. void 0 !== e.opacity && (t.opacity = e.opacity),
  46010. void 0 !== e.transparent && (t.transparent = e.transparent),
  46011. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46012. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46013. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46014. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46015. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46016. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46017. void 0 !== e.size && (t.size = e.size),
  46018. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46019. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46020. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46021. t.transparent = !0),
  46022. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46023. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46024. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46025. void 0 !== e.normalScale) {
  46026. var i = e.normalScale;
  46027. !1 === Array.isArray(i) && (i = [i, i]),
  46028. t.normalScale = (new Ci.Vector2).fromArray(i)
  46029. }
  46030. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46031. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46032. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46033. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46034. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46035. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46036. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46037. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46038. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46039. t.combine = Ci.MultiplyOperation),
  46040. e.reflectivity && (t.reflectivity = e.reflectivity),
  46041. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46042. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46043. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46044. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46045. void 0 !== e.materials)
  46046. for (var n = 0, r = e.materials.length; n < r; n++)
  46047. t.materials.push(this.parse(e.materials[n]));
  46048. return t
  46049. }
  46050. },
  46051. Ci.ObjectLoader = function(e) {
  46052. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46053. this.texturePath = ""
  46054. }
  46055. ,
  46056. Ci.ObjectLoader.prototype = {
  46057. constructor: Ci.ObjectLoader,
  46058. load: function(e, t, i, n) {
  46059. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46060. var r = this;
  46061. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46062. r.parse(JSON.parse(e), t)
  46063. }, i, n)
  46064. },
  46065. setTexturePath: function(e) {
  46066. this.texturePath = e
  46067. },
  46068. setCrossOrigin: function(e) {
  46069. this.crossOrigin = e
  46070. },
  46071. parse: function(e, t) {
  46072. var i = this.parseGeometries(e.geometries)
  46073. , n = this.parseImages(e.images, function() {
  46074. void 0 !== t && t(a)
  46075. })
  46076. , r = this.parseTextures(e.textures, n)
  46077. , o = this.parseMaterials(e.materials, r)
  46078. , a = this.parseObject(e.object, i, o);
  46079. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46080. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46081. a
  46082. },
  46083. parseGeometries: function(e) {
  46084. var t = {};
  46085. if (void 0 !== e)
  46086. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46087. var a, s = e[r];
  46088. switch (s.type) {
  46089. case "PlaneGeometry":
  46090. case "PlaneBufferGeometry":
  46091. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46092. break;
  46093. case "BoxGeometry":
  46094. case "BoxBufferGeometry":
  46095. case "CubeGeometry":
  46096. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46097. break;
  46098. case "CircleGeometry":
  46099. case "CircleBufferGeometry":
  46100. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46101. break;
  46102. case "CylinderGeometry":
  46103. case "CylinderBufferGeometry":
  46104. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46105. break;
  46106. case "SphereGeometry":
  46107. case "SphereBufferGeometry":
  46108. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46109. break;
  46110. case "DodecahedronGeometry":
  46111. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46112. break;
  46113. case "IcosahedronGeometry":
  46114. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46115. break;
  46116. case "OctahedronGeometry":
  46117. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46118. break;
  46119. case "TetrahedronGeometry":
  46120. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46121. break;
  46122. case "RingGeometry":
  46123. case "RingBufferGeometry":
  46124. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46125. break;
  46126. case "TorusGeometry":
  46127. case "TorusBufferGeometry":
  46128. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46129. break;
  46130. case "TorusKnotGeometry":
  46131. case "TorusKnotBufferGeometry":
  46132. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46133. break;
  46134. case "LatheGeometry":
  46135. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46136. break;
  46137. case "BufferGeometry":
  46138. a = n.parse(s);
  46139. break;
  46140. case "Geometry":
  46141. a = i.parse(s.data, this.texturePath).geometry;
  46142. break;
  46143. default:
  46144. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46145. continue
  46146. }
  46147. a.uuid = s.uuid,
  46148. void 0 !== s.name && (a.name = s.name),
  46149. t[s.uuid] = a
  46150. }
  46151. return t
  46152. },
  46153. parseMaterials: function(e, t) {
  46154. var i = {};
  46155. if (void 0 !== e) {
  46156. var n = new Ci.MaterialLoader;
  46157. n.setTextures(t);
  46158. for (var r = 0, o = e.length; r < o; r++) {
  46159. var a = n.parse(e[r]);
  46160. i[a.uuid] = a
  46161. }
  46162. }
  46163. return i
  46164. },
  46165. parseAnimations: function(e) {
  46166. for (var t = [], i = 0; i < e.length; i++) {
  46167. var n = Ci.AnimationClip.parse(e[i]);
  46168. t.push(n)
  46169. }
  46170. return t
  46171. },
  46172. parseImages: function(e, t) {
  46173. function i(e) {
  46174. return n.manager.itemStart(e),
  46175. a.load(e, function() {
  46176. n.manager.itemEnd(e)
  46177. })
  46178. }
  46179. var n = this
  46180. , r = {};
  46181. if (void 0 !== e && 0 < e.length) {
  46182. var o = new Ci.LoadingManager(t)
  46183. , a = new Ci.ImageLoader(o);
  46184. a.setCrossOrigin(this.crossOrigin);
  46185. for (var s = 0, l = e.length; s < l; s++) {
  46186. var c = e[s]
  46187. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46188. r[c.uuid] = i(h)
  46189. }
  46190. }
  46191. return r
  46192. },
  46193. parseTextures: function(e, t) {
  46194. function i(e) {
  46195. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46196. Ci[e])
  46197. }
  46198. var n = {};
  46199. if (void 0 !== e)
  46200. for (var r = 0, o = e.length; r < o; r++) {
  46201. var a = e[r];
  46202. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46203. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46204. var s = new Ci.Texture(t[a.image]);
  46205. s.needsUpdate = !0,
  46206. s.uuid = a.uuid,
  46207. void 0 !== a.name && (s.name = a.name),
  46208. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46209. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46210. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46211. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46212. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46213. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46214. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46215. s.wrapT = i(a.wrap[1])),
  46216. n[a.uuid] = s
  46217. }
  46218. return n
  46219. },
  46220. parseObject: (ke = new Ci.Matrix4,
  46221. function(e, t, i) {
  46222. function n(e) {
  46223. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46224. t[e]
  46225. }
  46226. function r(e) {
  46227. if (void 0 !== e)
  46228. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46229. i[e]
  46230. }
  46231. var o;
  46232. switch (e.type) {
  46233. case "Scene":
  46234. o = new Ci.Scene;
  46235. break;
  46236. case "PerspectiveCamera":
  46237. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46238. break;
  46239. case "OrthographicCamera":
  46240. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46241. break;
  46242. case "AmbientLight":
  46243. o = new Ci.AmbientLight(e.color,e.intensity);
  46244. break;
  46245. case "DirectionalLight":
  46246. o = new Ci.DirectionalLight(e.color,e.intensity);
  46247. break;
  46248. case "PointLight":
  46249. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46250. break;
  46251. case "SpotLight":
  46252. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46253. break;
  46254. case "HemisphereLight":
  46255. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46256. break;
  46257. case "Mesh":
  46258. var a = n(e.geometry)
  46259. , s = r(e.material);
  46260. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46261. break;
  46262. case "LOD":
  46263. o = new Ci.LOD;
  46264. break;
  46265. case "Line":
  46266. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46267. break;
  46268. case "PointCloud":
  46269. case "Points":
  46270. o = new Ci.Points(n(e.geometry),r(e.material));
  46271. break;
  46272. case "Sprite":
  46273. o = new Ci.Sprite(r(e.material));
  46274. break;
  46275. case "Group":
  46276. o = new Ci.Group;
  46277. break;
  46278. default:
  46279. o = new Ci.Object3D
  46280. }
  46281. if (o.uuid = e.uuid,
  46282. void 0 !== e.name && (o.name = e.name),
  46283. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46284. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46285. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46286. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46287. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46288. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46289. void 0 !== e.visible && (o.visible = e.visible),
  46290. void 0 !== e.userData && (o.userData = e.userData),
  46291. void 0 !== e.children)
  46292. for (var l in e.children)
  46293. o.add(this.parseObject(e.children[l], t, i));
  46294. if ("LOD" === e.type)
  46295. for (var c = e.levels, h = 0; h < c.length; h++) {
  46296. var u = c[h];
  46297. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46298. }
  46299. return o
  46300. }
  46301. )
  46302. },
  46303. Ci.TextureLoader = function(e) {
  46304. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46305. }
  46306. ,
  46307. Ci.TextureLoader.prototype = {
  46308. constructor: Ci.TextureLoader,
  46309. load: function(e, t, i, n) {
  46310. var r = new Ci.Texture
  46311. , o = new Ci.ImageLoader(this.manager);
  46312. return o.setCrossOrigin(this.crossOrigin),
  46313. o.setPath(this.path),
  46314. o.load(e, function(e) {
  46315. r.image = e,
  46316. r.needsUpdate = !0,
  46317. void 0 !== t && t(r)
  46318. }, i, n),
  46319. r
  46320. },
  46321. setCrossOrigin: function(e) {
  46322. this.crossOrigin = e
  46323. },
  46324. setPath: function(e) {
  46325. this.path = e
  46326. }
  46327. },
  46328. Ci.CubeTextureLoader = function(e) {
  46329. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46330. }
  46331. ,
  46332. Ci.CubeTextureLoader.prototype = {
  46333. constructor: Ci.CubeTextureLoader,
  46334. load: function(e, i, t, n) {
  46335. function r(t) {
  46336. a.load(e[t], function(e) {
  46337. o.images[t] = e,
  46338. 6 === ++s && (o.needsUpdate = !0,
  46339. i && i(o))
  46340. }, void 0, n)
  46341. }
  46342. var o = new Ci.CubeTexture
  46343. , a = new Ci.ImageLoader(this.manager);
  46344. a.setCrossOrigin(this.crossOrigin),
  46345. a.setPath(this.path);
  46346. for (var s = 0, l = 0; l < e.length; ++l)
  46347. r(l);
  46348. return o
  46349. },
  46350. setCrossOrigin: function(e) {
  46351. this.crossOrigin = e
  46352. },
  46353. setPath: function(e) {
  46354. this.path = e
  46355. }
  46356. },
  46357. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46358. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46359. this._parser = null
  46360. }
  46361. ,
  46362. Ci.BinaryTextureLoader.prototype = {
  46363. constructor: Ci.BinaryTextureLoader,
  46364. load: function(e, i, t, n) {
  46365. var r = this
  46366. , o = new Ci.DataTexture
  46367. , a = new Ci.XHRLoader(this.manager);
  46368. return a.setResponseType("arraybuffer"),
  46369. a.load(e, function(e) {
  46370. var t = r._parser(e);
  46371. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46372. o.image.height = t.height,
  46373. o.image.data = t.data),
  46374. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46375. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46376. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46377. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46378. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46379. void 0 !== t.format && (o.format = t.format),
  46380. void 0 !== t.type && (o.type = t.type),
  46381. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46382. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46383. o.needsUpdate = !0,
  46384. i && i(o, t))
  46385. }, t, n),
  46386. o
  46387. }
  46388. },
  46389. Ci.CompressedTextureLoader = function(e) {
  46390. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46391. this._parser = null
  46392. }
  46393. ,
  46394. Ci.CompressedTextureLoader.prototype = {
  46395. constructor: Ci.CompressedTextureLoader,
  46396. load: function(e, o, t, n) {
  46397. function i(i) {
  46398. r.load(e[i], function(e) {
  46399. var t = a._parser(e, !0);
  46400. s[i] = {
  46401. width: t.width,
  46402. height: t.height,
  46403. format: t.format,
  46404. mipmaps: t.mipmaps
  46405. },
  46406. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46407. l.format = t.format,
  46408. l.needsUpdate = !0,
  46409. o && o(l))
  46410. }, t, n)
  46411. }
  46412. var a = this
  46413. , s = []
  46414. , l = new Ci.CompressedTexture;
  46415. l.image = s;
  46416. var r = new Ci.XHRLoader(this.manager);
  46417. if (r.setPath(this.path),
  46418. r.setResponseType("arraybuffer"),
  46419. Array.isArray(e))
  46420. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46421. i(h);
  46422. else
  46423. r.load(e, function(e) {
  46424. var t = a._parser(e, !0);
  46425. if (t.isCubemap)
  46426. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46427. s[n] = {
  46428. mipmaps: []
  46429. };
  46430. for (var r = 0; r < t.mipmapCount; r++)
  46431. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46432. s[n].format = t.format,
  46433. s[n].width = t.width,
  46434. s[n].height = t.height
  46435. }
  46436. else
  46437. l.image.width = t.width,
  46438. l.image.height = t.height,
  46439. l.mipmaps = t.mipmaps;
  46440. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46441. l.format = t.format,
  46442. l.needsUpdate = !0,
  46443. o && o(l)
  46444. }, t, n);
  46445. return l
  46446. },
  46447. setPath: function(e) {
  46448. this.path = e
  46449. }
  46450. },
  46451. Ci.Material = function() {
  46452. Object.defineProperty(this, "id", {
  46453. value: Ci.MaterialIdCount++
  46454. }),
  46455. this.uuid = Ci.Math.generateUUID(),
  46456. this.name = "",
  46457. this.type = "Material",
  46458. this.side = Ci.FrontSide,
  46459. this.opacity = 1,
  46460. this.transparent = !1,
  46461. this.blending = Ci.NormalBlending,
  46462. this.blendSrc = Ci.SrcAlphaFactor,
  46463. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46464. this.blendEquation = Ci.AddEquation,
  46465. this.blendSrcAlpha = null,
  46466. this.blendDstAlpha = null,
  46467. this.blendEquationAlpha = null,
  46468. this.depthFunc = Ci.LessEqualDepth,
  46469. this.depthTest = !0,
  46470. this.depthWrite = !0,
  46471. this.colorWrite = !0,
  46472. this.precision = null,
  46473. this.polygonOffset = !1,
  46474. this.polygonOffsetFactor = 0,
  46475. this.polygonOffsetUnits = 0,
  46476. this.alphaTest = 0,
  46477. this.premultipliedAlpha = !1,
  46478. this.overdraw = 0,
  46479. this.visible = !0,
  46480. this._needsUpdate = !0
  46481. }
  46482. ,
  46483. Ci.Material.prototype = {
  46484. constructor: Ci.Material,
  46485. get needsUpdate() {
  46486. return this._needsUpdate
  46487. },
  46488. set needsUpdate(e) {
  46489. !0 === e && this.update(),
  46490. this._needsUpdate = e
  46491. },
  46492. setValues: function(e) {
  46493. if (void 0 !== e)
  46494. for (var t in e) {
  46495. var i = e[t];
  46496. if (void 0 !== i) {
  46497. var n = this[t];
  46498. 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.")
  46499. } else
  46500. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46501. }
  46502. },
  46503. toJSON: function(e) {
  46504. function t(e) {
  46505. var t = [];
  46506. for (var i in e) {
  46507. var n = e[i];
  46508. delete n.metadata,
  46509. t.push(n)
  46510. }
  46511. return t
  46512. }
  46513. var i = void 0 === e;
  46514. i && (e = {
  46515. textures: {},
  46516. images: {}
  46517. });
  46518. var n = {
  46519. metadata: {
  46520. version: 4.4,
  46521. type: "Material",
  46522. generator: "Material.toJSON"
  46523. }
  46524. };
  46525. if (n.uuid = this.uuid,
  46526. n.type = this.type,
  46527. "" !== this.name && (n.name = this.name),
  46528. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46529. .5 !== this.roughness && (n.roughness = this.roughness),
  46530. .5 !== this.metalness && (n.metalness = this.metalness),
  46531. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46532. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46533. void 0 !== this.shininess && (n.shininess = this.shininess),
  46534. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46535. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46536. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46537. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46538. n.bumpScale = this.bumpScale),
  46539. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46540. n.normalScale = this.normalScale.toArray()),
  46541. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46542. n.displacementScale = this.displacementScale,
  46543. n.displacementBias = this.displacementBias),
  46544. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46545. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46546. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46547. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46548. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46549. n.reflectivity = this.reflectivity),
  46550. void 0 !== this.size && (n.size = this.size),
  46551. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46552. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46553. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46554. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46555. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46556. this.opacity < 1 && (n.opacity = this.opacity),
  46557. !0 === this.transparent && (n.transparent = this.transparent),
  46558. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46559. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46560. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46561. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46562. i) {
  46563. var r = t(e.textures)
  46564. , o = t(e.images);
  46565. 0 < r.length && (n.textures = r),
  46566. 0 < o.length && (n.images = o)
  46567. }
  46568. return n
  46569. },
  46570. clone: function() {
  46571. return (new this.constructor).copy(this)
  46572. },
  46573. copy: function(e) {
  46574. return this.name = e.name,
  46575. this.side = e.side,
  46576. this.opacity = e.opacity,
  46577. this.transparent = e.transparent,
  46578. this.blending = e.blending,
  46579. this.blendSrc = e.blendSrc,
  46580. this.blendDst = e.blendDst,
  46581. this.blendEquation = e.blendEquation,
  46582. this.blendSrcAlpha = e.blendSrcAlpha,
  46583. this.blendDstAlpha = e.blendDstAlpha,
  46584. this.blendEquationAlpha = e.blendEquationAlpha,
  46585. this.depthFunc = e.depthFunc,
  46586. this.depthTest = e.depthTest,
  46587. this.depthWrite = e.depthWrite,
  46588. this.colorWrite = e.colorWrite,
  46589. this.precision = e.precision,
  46590. this.polygonOffset = e.polygonOffset,
  46591. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46592. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46593. this.alphaTest = e.alphaTest,
  46594. this.premultipliedAlpha = e.premultipliedAlpha,
  46595. this.overdraw = e.overdraw,
  46596. this.visible = e.visible,
  46597. this
  46598. },
  46599. update: function() {
  46600. this.dispatchEvent({
  46601. type: "update"
  46602. })
  46603. },
  46604. dispose: function() {
  46605. this.dispatchEvent({
  46606. type: "dispose"
  46607. })
  46608. }
  46609. },
  46610. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46611. Ci.MaterialIdCount = 0,
  46612. Ci.LineBasicMaterial = function(e) {
  46613. Ci.Material.call(this),
  46614. this.type = "LineBasicMaterial",
  46615. this.color = new Ci.Color(16777215),
  46616. this.linewidth = 1,
  46617. this.linecap = "round",
  46618. this.linejoin = "round",
  46619. this.blending = Ci.NormalBlending,
  46620. this.vertexColors = Ci.NoColors,
  46621. this.fog = !0,
  46622. this.setValues(e)
  46623. }
  46624. ,
  46625. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46626. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46627. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46628. return Ci.Material.prototype.copy.call(this, e),
  46629. this.color.copy(e.color),
  46630. this.linewidth = e.linewidth,
  46631. this.linecap = e.linecap,
  46632. this.linejoin = e.linejoin,
  46633. this.vertexColors = e.vertexColors,
  46634. this.fog = e.fog,
  46635. this
  46636. }
  46637. ,
  46638. Ci.LineDashedMaterial = function(e) {
  46639. Ci.Material.call(this),
  46640. this.type = "LineDashedMaterial",
  46641. this.color = new Ci.Color(16777215),
  46642. this.linewidth = 1,
  46643. this.scale = 1,
  46644. this.dashSize = 3,
  46645. this.gapSize = 1,
  46646. this.blending = Ci.NormalBlending,
  46647. this.vertexColors = Ci.NoColors,
  46648. this.fog = !0,
  46649. this.setValues(e)
  46650. }
  46651. ,
  46652. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46653. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46654. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46655. return Ci.Material.prototype.copy.call(this, e),
  46656. this.color.copy(e.color),
  46657. this.linewidth = e.linewidth,
  46658. this.scale = e.scale,
  46659. this.dashSize = e.dashSize,
  46660. this.gapSize = e.gapSize,
  46661. this.vertexColors = e.vertexColors,
  46662. this.fog = e.fog,
  46663. this
  46664. }
  46665. ,
  46666. Ci.MeshBasicMaterial = function(e) {
  46667. Ci.Material.call(this),
  46668. this.type = "MeshBasicMaterial",
  46669. this.color = new Ci.Color(16777215),
  46670. this.map = null,
  46671. this.aoMap = null,
  46672. this.aoMapIntensity = 1,
  46673. this.specularMap = null,
  46674. this.alphaMap = null,
  46675. this.envMap = null,
  46676. this.combine = Ci.MultiplyOperation,
  46677. this.reflectivity = 1,
  46678. this.refractionRatio = .98,
  46679. this.fog = !0,
  46680. this.shading = Ci.SmoothShading,
  46681. this.blending = Ci.NormalBlending,
  46682. this.wireframe = !1,
  46683. this.wireframeLinewidth = 1,
  46684. this.wireframeLinecap = "round",
  46685. this.wireframeLinejoin = "round",
  46686. this.vertexColors = Ci.NoColors,
  46687. this.skinning = !1,
  46688. this.morphTargets = !1,
  46689. this.setValues(e)
  46690. }
  46691. ,
  46692. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46693. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46694. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46695. return Ci.Material.prototype.copy.call(this, e),
  46696. this.color.copy(e.color),
  46697. this.map = e.map,
  46698. this.aoMap = e.aoMap,
  46699. this.aoMapIntensity = e.aoMapIntensity,
  46700. this.specularMap = e.specularMap,
  46701. this.alphaMap = e.alphaMap,
  46702. this.envMap = e.envMap,
  46703. this.combine = e.combine,
  46704. this.reflectivity = e.reflectivity,
  46705. this.refractionRatio = e.refractionRatio,
  46706. this.fog = e.fog,
  46707. this.shading = e.shading,
  46708. this.wireframe = e.wireframe,
  46709. this.wireframeLinewidth = e.wireframeLinewidth,
  46710. this.wireframeLinecap = e.wireframeLinecap,
  46711. this.wireframeLinejoin = e.wireframeLinejoin,
  46712. this.vertexColors = e.vertexColors,
  46713. this.skinning = e.skinning,
  46714. this.morphTargets = e.morphTargets,
  46715. this
  46716. }
  46717. ,
  46718. Ci.MeshLambertMaterial = function(e) {
  46719. Ci.Material.call(this),
  46720. this.type = "MeshLambertMaterial",
  46721. this.color = new Ci.Color(16777215),
  46722. this.map = null,
  46723. this.lightMap = null,
  46724. this.lightMapIntensity = 1,
  46725. this.aoMap = null,
  46726. this.aoMapIntensity = 1,
  46727. this.emissive = new Ci.Color(0),
  46728. this.emissiveIntensity = 1,
  46729. this.emissiveMap = null,
  46730. this.specularMap = null,
  46731. this.alphaMap = null,
  46732. this.envMap = null,
  46733. this.combine = Ci.MultiplyOperation,
  46734. this.reflectivity = 1,
  46735. this.refractionRatio = .98,
  46736. this.fog = !0,
  46737. this.blending = Ci.NormalBlending,
  46738. this.wireframe = !1,
  46739. this.wireframeLinewidth = 1,
  46740. this.wireframeLinecap = "round",
  46741. this.wireframeLinejoin = "round",
  46742. this.vertexColors = Ci.NoColors,
  46743. this.skinning = !1,
  46744. this.morphTargets = !1,
  46745. this.morphNormals = !1,
  46746. this.setValues(e)
  46747. }
  46748. ,
  46749. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46750. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46751. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46752. return Ci.Material.prototype.copy.call(this, e),
  46753. this.color.copy(e.color),
  46754. this.map = e.map,
  46755. this.lightMap = e.lightMap,
  46756. this.lightMapIntensity = e.lightMapIntensity,
  46757. this.aoMap = e.aoMap,
  46758. this.aoMapIntensity = e.aoMapIntensity,
  46759. this.emissive.copy(e.emissive),
  46760. this.emissiveMap = e.emissiveMap,
  46761. this.emissiveIntensity = e.emissiveIntensity,
  46762. this.specularMap = e.specularMap,
  46763. this.alphaMap = e.alphaMap,
  46764. this.envMap = e.envMap,
  46765. this.combine = e.combine,
  46766. this.reflectivity = e.reflectivity,
  46767. this.refractionRatio = e.refractionRatio,
  46768. this.fog = e.fog,
  46769. this.wireframe = e.wireframe,
  46770. this.wireframeLinewidth = e.wireframeLinewidth,
  46771. this.wireframeLinecap = e.wireframeLinecap,
  46772. this.wireframeLinejoin = e.wireframeLinejoin,
  46773. this.vertexColors = e.vertexColors,
  46774. this.skinning = e.skinning,
  46775. this.morphTargets = e.morphTargets,
  46776. this.morphNormals = e.morphNormals,
  46777. this
  46778. }
  46779. ,
  46780. Ci.MeshPhongMaterial = function(e) {
  46781. Ci.Material.call(this),
  46782. this.type = "MeshPhongMaterial",
  46783. this.color = new Ci.Color(16777215),
  46784. this.specular = new Ci.Color(1118481),
  46785. this.shininess = 30,
  46786. this.map = null,
  46787. this.lightMap = null,
  46788. this.lightMapIntensity = 1,
  46789. this.aoMap = null,
  46790. this.aoMapIntensity = 1,
  46791. this.emissive = new Ci.Color(0),
  46792. this.emissiveIntensity = 1,
  46793. this.emissiveMap = null,
  46794. this.bumpMap = null,
  46795. this.bumpScale = 1,
  46796. this.normalMap = null,
  46797. this.normalScale = new Ci.Vector2(1,1),
  46798. this.displacementMap = null,
  46799. this.displacementScale = 1,
  46800. this.displacementBias = 0,
  46801. this.specularMap = null,
  46802. this.alphaMap = null,
  46803. this.envMap = null,
  46804. this.combine = Ci.MultiplyOperation,
  46805. this.reflectivity = 1,
  46806. this.refractionRatio = .98,
  46807. this.fog = !0,
  46808. this.shading = Ci.SmoothShading,
  46809. this.blending = Ci.NormalBlending,
  46810. this.wireframe = !1,
  46811. this.wireframeLinewidth = 1,
  46812. this.wireframeLinecap = "round",
  46813. this.wireframeLinejoin = "round",
  46814. this.vertexColors = Ci.NoColors,
  46815. this.skinning = !1,
  46816. this.morphTargets = !1,
  46817. this.morphNormals = !1,
  46818. this.setValues(e)
  46819. }
  46820. ,
  46821. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46822. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46823. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46824. return Ci.Material.prototype.copy.call(this, e),
  46825. this.color.copy(e.color),
  46826. this.specular.copy(e.specular),
  46827. this.shininess = e.shininess,
  46828. this.map = e.map,
  46829. this.lightMap = e.lightMap,
  46830. this.lightMapIntensity = e.lightMapIntensity,
  46831. this.aoMap = e.aoMap,
  46832. this.aoMapIntensity = e.aoMapIntensity,
  46833. this.emissive.copy(e.emissive),
  46834. this.emissiveMap = e.emissiveMap,
  46835. this.emissiveIntensity = e.emissiveIntensity,
  46836. this.bumpMap = e.bumpMap,
  46837. this.bumpScale = e.bumpScale,
  46838. this.normalMap = e.normalMap,
  46839. this.normalScale.copy(e.normalScale),
  46840. this.displacementMap = e.displacementMap,
  46841. this.displacementScale = e.displacementScale,
  46842. this.displacementBias = e.displacementBias,
  46843. this.specularMap = e.specularMap,
  46844. this.alphaMap = e.alphaMap,
  46845. this.envMap = e.envMap,
  46846. this.combine = e.combine,
  46847. this.reflectivity = e.reflectivity,
  46848. this.refractionRatio = e.refractionRatio,
  46849. this.fog = e.fog,
  46850. this.shading = e.shading,
  46851. this.wireframe = e.wireframe,
  46852. this.wireframeLinewidth = e.wireframeLinewidth,
  46853. this.wireframeLinecap = e.wireframeLinecap,
  46854. this.wireframeLinejoin = e.wireframeLinejoin,
  46855. this.vertexColors = e.vertexColors,
  46856. this.skinning = e.skinning,
  46857. this.morphTargets = e.morphTargets,
  46858. this.morphNormals = e.morphNormals,
  46859. this
  46860. }
  46861. ,
  46862. Ci.MeshStandardMaterial = function(e) {
  46863. Ci.Material.call(this),
  46864. this.type = "MeshStandardMaterial",
  46865. this.color = new Ci.Color(16777215),
  46866. this.roughness = .5,
  46867. this.metalness = .5,
  46868. this.map = null,
  46869. this.lightMap = null,
  46870. this.lightMapIntensity = 1,
  46871. this.aoMap = null,
  46872. this.aoMapIntensity = 1,
  46873. this.emissive = new Ci.Color(0),
  46874. this.emissiveIntensity = 1,
  46875. this.emissiveMap = null,
  46876. this.bumpMap = null,
  46877. this.bumpScale = 1,
  46878. this.normalMap = null,
  46879. this.normalScale = new Ci.Vector2(1,1),
  46880. this.displacementMap = null,
  46881. this.displacementScale = 1,
  46882. this.displacementBias = 0,
  46883. this.roughnessMap = null,
  46884. this.metalnessMap = null,
  46885. this.alphaMap = null,
  46886. this.envMap = null,
  46887. this.envMapIntensity = 1,
  46888. this.refractionRatio = .98,
  46889. this.fog = !0,
  46890. this.shading = Ci.SmoothShading,
  46891. this.blending = Ci.NormalBlending,
  46892. this.wireframe = !1,
  46893. this.wireframeLinewidth = 1,
  46894. this.wireframeLinecap = "round",
  46895. this.wireframeLinejoin = "round",
  46896. this.vertexColors = Ci.NoColors,
  46897. this.skinning = !1,
  46898. this.morphTargets = !1,
  46899. this.morphNormals = !1,
  46900. this.setValues(e)
  46901. }
  46902. ,
  46903. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46904. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46905. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46906. return Ci.Material.prototype.copy.call(this, e),
  46907. this.color.copy(e.color),
  46908. this.roughness = e.roughness,
  46909. this.metalness = e.metalness,
  46910. this.map = e.map,
  46911. this.lightMap = e.lightMap,
  46912. this.lightMapIntensity = e.lightMapIntensity,
  46913. this.aoMap = e.aoMap,
  46914. this.aoMapIntensity = e.aoMapIntensity,
  46915. this.emissive.copy(e.emissive),
  46916. this.emissiveMap = e.emissiveMap,
  46917. this.emissiveIntensity = e.emissiveIntensity,
  46918. this.bumpMap = e.bumpMap,
  46919. this.bumpScale = e.bumpScale,
  46920. this.normalMap = e.normalMap,
  46921. this.normalScale.copy(e.normalScale),
  46922. this.displacementMap = e.displacementMap,
  46923. this.displacementScale = e.displacementScale,
  46924. this.displacementBias = e.displacementBias,
  46925. this.roughnessMap = e.roughnessMap,
  46926. this.metalnessMap = e.metalnessMap,
  46927. this.alphaMap = e.alphaMap,
  46928. this.envMap = e.envMap,
  46929. this.envMapIntensity = e.envMapIntensity,
  46930. this.refractionRatio = e.refractionRatio,
  46931. this.fog = e.fog,
  46932. this.shading = e.shading,
  46933. this.wireframe = e.wireframe,
  46934. this.wireframeLinewidth = e.wireframeLinewidth,
  46935. this.wireframeLinecap = e.wireframeLinecap,
  46936. this.wireframeLinejoin = e.wireframeLinejoin,
  46937. this.vertexColors = e.vertexColors,
  46938. this.skinning = e.skinning,
  46939. this.morphTargets = e.morphTargets,
  46940. this.morphNormals = e.morphNormals,
  46941. this
  46942. }
  46943. ,
  46944. Ci.MeshDepthMaterial = function(e) {
  46945. Ci.Material.call(this),
  46946. this.type = "MeshDepthMaterial",
  46947. this.morphTargets = !1,
  46948. this.wireframe = !1,
  46949. this.wireframeLinewidth = 1,
  46950. this.setValues(e)
  46951. }
  46952. ,
  46953. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46954. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46955. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46956. return Ci.Material.prototype.copy.call(this, e),
  46957. this.wireframe = e.wireframe,
  46958. this.wireframeLinewidth = e.wireframeLinewidth,
  46959. this
  46960. }
  46961. ,
  46962. Ci.MeshNormalMaterial = function(e) {
  46963. Ci.Material.call(this, e),
  46964. this.type = "MeshNormalMaterial",
  46965. this.wireframe = !1,
  46966. this.wireframeLinewidth = 1,
  46967. this.morphTargets = !1,
  46968. this.setValues(e)
  46969. }
  46970. ,
  46971. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46972. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46973. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46974. return Ci.Material.prototype.copy.call(this, e),
  46975. this.wireframe = e.wireframe,
  46976. this.wireframeLinewidth = e.wireframeLinewidth,
  46977. this
  46978. }
  46979. ,
  46980. Ci.MultiMaterial = function(e) {
  46981. this.uuid = Ci.Math.generateUUID(),
  46982. this.type = "MultiMaterial",
  46983. this.materials = e instanceof Array ? e : [],
  46984. this.visible = !0
  46985. }
  46986. ,
  46987. Ci.MultiMaterial.prototype = {
  46988. constructor: Ci.MultiMaterial,
  46989. toJSON: function(e) {
  46990. for (var t = {
  46991. metadata: {
  46992. version: 4.2,
  46993. type: "material",
  46994. generator: "MaterialExporter"
  46995. },
  46996. uuid: this.uuid,
  46997. type: this.type,
  46998. materials: []
  46999. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47000. var o = i[n].toJSON(e);
  47001. delete o.metadata,
  47002. t.materials.push(o)
  47003. }
  47004. return t.visible = this.visible,
  47005. t
  47006. },
  47007. clone: function() {
  47008. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47009. e.materials.push(this.materials[t].clone());
  47010. return e.visible = this.visible,
  47011. e
  47012. }
  47013. },
  47014. Ci.PointsMaterial = function(e) {
  47015. Ci.Material.call(this),
  47016. this.type = "PointsMaterial",
  47017. this.color = new Ci.Color(16777215),
  47018. this.map = null,
  47019. this.size = 1,
  47020. this.sizeAttenuation = !0,
  47021. this.blending = Ci.NormalBlending,
  47022. this.vertexColors = Ci.NoColors,
  47023. this.fog = !0,
  47024. this.setValues(e)
  47025. }
  47026. ,
  47027. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47028. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47029. Ci.PointsMaterial.prototype.copy = function(e) {
  47030. return Ci.Material.prototype.copy.call(this, e),
  47031. this.color.copy(e.color),
  47032. this.map = e.map,
  47033. this.size = e.size,
  47034. this.sizeAttenuation = e.sizeAttenuation,
  47035. this.vertexColors = e.vertexColors,
  47036. this.fog = e.fog,
  47037. this
  47038. }
  47039. ,
  47040. Ci.ShaderMaterial = function(e) {
  47041. Ci.Material.call(this),
  47042. this.type = "ShaderMaterial",
  47043. this.defines = {},
  47044. this.uniforms = {},
  47045. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47046. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47047. this.shading = Ci.SmoothShading,
  47048. this.linewidth = 1,
  47049. this.wireframe = !1,
  47050. this.wireframeLinewidth = 1,
  47051. this.fog = !1,
  47052. this.lights = !1,
  47053. this.vertexColors = Ci.NoColors,
  47054. this.skinning = !1,
  47055. this.morphTargets = !1,
  47056. this.morphNormals = !1,
  47057. this.extensions = {
  47058. derivatives: !1,
  47059. fragDepth: !1,
  47060. drawBuffers: !1,
  47061. shaderTextureLOD: !1
  47062. },
  47063. this.defaultAttributeValues = {
  47064. color: [1, 1, 1],
  47065. uv: [0, 0],
  47066. uv2: [0, 0]
  47067. },
  47068. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47069. this.setValues(e))
  47070. }
  47071. ,
  47072. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47073. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47074. Ci.ShaderMaterial.prototype.copy = function(e) {
  47075. return Ci.Material.prototype.copy.call(this, e),
  47076. this.fragmentShader = e.fragmentShader,
  47077. this.vertexShader = e.vertexShader,
  47078. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47079. this.defines = e.defines,
  47080. this.shading = e.shading,
  47081. this.wireframe = e.wireframe,
  47082. this.wireframeLinewidth = e.wireframeLinewidth,
  47083. this.fog = e.fog,
  47084. this.lights = e.lights,
  47085. this.vertexColors = e.vertexColors,
  47086. this.skinning = e.skinning,
  47087. this.morphTargets = e.morphTargets,
  47088. this.morphNormals = e.morphNormals,
  47089. this.extensions = e.extensions,
  47090. this
  47091. }
  47092. ,
  47093. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47094. var t = Ci.Material.prototype.toJSON.call(this, e);
  47095. return t.uniforms = this.uniforms,
  47096. t.vertexShader = this.vertexShader,
  47097. t.fragmentShader = this.fragmentShader,
  47098. t
  47099. }
  47100. ,
  47101. Ci.RawShaderMaterial = function(e) {
  47102. Ci.ShaderMaterial.call(this, e),
  47103. this.type = "RawShaderMaterial"
  47104. }
  47105. ,
  47106. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47107. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47108. Ci.SpriteMaterial = function(e) {
  47109. Ci.Material.call(this),
  47110. this.type = "SpriteMaterial",
  47111. this.color = new Ci.Color(16777215),
  47112. this.map = null,
  47113. this.rotation = 0,
  47114. this.fog = !1,
  47115. this.setValues(e)
  47116. }
  47117. ,
  47118. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47119. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47120. Ci.SpriteMaterial.prototype.copy = function(e) {
  47121. return Ci.Material.prototype.copy.call(this, e),
  47122. this.color.copy(e.color),
  47123. this.map = e.map,
  47124. this.rotation = e.rotation,
  47125. this.fog = e.fog,
  47126. this
  47127. }
  47128. ,
  47129. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47130. Object.defineProperty(this, "id", {
  47131. value: Ci.TextureIdCount++
  47132. }),
  47133. this.uuid = Ci.Math.generateUUID(),
  47134. this.name = "",
  47135. this.sourceFile = "",
  47136. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47137. this.mipmaps = [],
  47138. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47139. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47140. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47141. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47142. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47143. this.anisotropy = void 0 !== l ? l : 1,
  47144. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47145. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47146. this.offset = new Ci.Vector2(0,0),
  47147. this.repeat = new Ci.Vector2(1,1),
  47148. this.generateMipmaps = !0,
  47149. this.premultiplyAlpha = !1,
  47150. this.flipY = !0,
  47151. this.unpackAlignment = 4,
  47152. this.encoding = Ci.LinearEncoding,
  47153. this.version = 0,
  47154. this.onUpdate = null
  47155. }
  47156. ,
  47157. Ci.Texture.DEFAULT_IMAGE = void 0,
  47158. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47159. Ci.Texture.prototype = {
  47160. constructor: Ci.Texture,
  47161. set needsUpdate(e) {
  47162. !0 === e && this.version++
  47163. },
  47164. clone: function() {
  47165. return (new this.constructor).copy(this)
  47166. },
  47167. copy: function(e) {
  47168. return this.image = e.image,
  47169. this.mipmaps = e.mipmaps.slice(0),
  47170. this.mapping = e.mapping,
  47171. this.wrapS = e.wrapS,
  47172. this.wrapT = e.wrapT,
  47173. this.magFilter = e.magFilter,
  47174. this.minFilter = e.minFilter,
  47175. this.anisotropy = e.anisotropy,
  47176. this.format = e.format,
  47177. this.type = e.type,
  47178. this.offset.copy(e.offset),
  47179. this.repeat.copy(e.repeat),
  47180. this.generateMipmaps = e.generateMipmaps,
  47181. this.premultiplyAlpha = e.premultiplyAlpha,
  47182. this.flipY = e.flipY,
  47183. this.unpackAlignment = e.unpackAlignment,
  47184. this.encoding = e.encoding,
  47185. this
  47186. },
  47187. toJSON: function(e) {
  47188. if (void 0 !== e.textures[this.uuid])
  47189. return e.textures[this.uuid];
  47190. var t, i, n = {
  47191. metadata: {
  47192. version: 4.4,
  47193. type: "Texture",
  47194. generator: "Texture.toJSON"
  47195. },
  47196. uuid: this.uuid,
  47197. name: this.name,
  47198. mapping: this.mapping,
  47199. repeat: [this.repeat.x, this.repeat.y],
  47200. offset: [this.offset.x, this.offset.y],
  47201. wrap: [this.wrapS, this.wrapT],
  47202. minFilter: this.minFilter,
  47203. magFilter: this.magFilter,
  47204. anisotropy: this.anisotropy
  47205. };
  47206. if (void 0 !== this.image) {
  47207. var r = this.image;
  47208. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47209. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47210. uuid: r.uuid,
  47211. url: (t = r,
  47212. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47213. i.height = t.height,
  47214. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47215. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47216. }),
  47217. n.image = r.uuid
  47218. }
  47219. return e.textures[this.uuid] = n
  47220. },
  47221. dispose: function() {
  47222. this.dispatchEvent({
  47223. type: "dispose"
  47224. })
  47225. },
  47226. transformUv: function(e) {
  47227. if (this.mapping === Ci.UVMapping) {
  47228. if (e.multiply(this.repeat),
  47229. e.add(this.offset),
  47230. e.x < 0 || 1 < e.x)
  47231. switch (this.wrapS) {
  47232. case Ci.RepeatWrapping:
  47233. e.x = e.x - Math.floor(e.x);
  47234. break;
  47235. case Ci.ClampToEdgeWrapping:
  47236. e.x = e.x < 0 ? 0 : 1;
  47237. break;
  47238. case Ci.MirroredRepeatWrapping:
  47239. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47240. }
  47241. if (e.y < 0 || 1 < e.y)
  47242. switch (this.wrapT) {
  47243. case Ci.RepeatWrapping:
  47244. e.y = e.y - Math.floor(e.y);
  47245. break;
  47246. case Ci.ClampToEdgeWrapping:
  47247. e.y = e.y < 0 ? 0 : 1;
  47248. break;
  47249. case Ci.MirroredRepeatWrapping:
  47250. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47251. }
  47252. this.flipY && (e.y = 1 - e.y)
  47253. }
  47254. }
  47255. },
  47256. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47257. Ci.TextureIdCount = 0,
  47258. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47259. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47260. this.needsUpdate = !0
  47261. }
  47262. ,
  47263. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47264. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47265. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47266. e = void 0 !== e ? e : [],
  47267. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47268. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47269. this.flipY = !1
  47270. }
  47271. ,
  47272. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47273. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47274. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47275. get: function() {
  47276. return this.image
  47277. },
  47278. set: function(e) {
  47279. this.image = e
  47280. }
  47281. }),
  47282. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47283. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47284. this.image = {
  47285. width: t,
  47286. height: i
  47287. },
  47288. this.mipmaps = e,
  47289. this.flipY = !1,
  47290. this.generateMipmaps = !1
  47291. }
  47292. ,
  47293. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47294. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47295. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47296. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47297. this.image = {
  47298. data: e,
  47299. width: t,
  47300. height: i
  47301. },
  47302. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47303. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47304. this.flipY = !1,
  47305. this.generateMipmaps = !1
  47306. }
  47307. ,
  47308. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47309. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47310. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47311. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47312. this.generateMipmaps = !1;
  47313. var c = this;
  47314. !function e() {
  47315. requestAnimationFrame(e),
  47316. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47317. }()
  47318. }
  47319. ,
  47320. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47321. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47322. Ci.Group = function() {
  47323. Ci.Object3D.call(this),
  47324. this.type = "Group"
  47325. }
  47326. ,
  47327. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47328. Ci.Group.prototype.constructor = Ci.Group,
  47329. Ci.Points = function(e, t) {
  47330. Ci.Object3D.call(this),
  47331. this.type = "Points",
  47332. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47333. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47334. color: 16777215 * Math.random()
  47335. })
  47336. }
  47337. ,
  47338. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47339. Ci.Points.prototype.constructor = Ci.Points,
  47340. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47341. jt = new Ci.Ray,
  47342. Yt = new Ci.Sphere,
  47343. function(o, a) {
  47344. function e(e, t) {
  47345. var i = jt.distanceSqToPoint(e);
  47346. if (i < c) {
  47347. var n = jt.closestPointToPoint(e);
  47348. n.applyMatrix4(l);
  47349. var r = o.ray.origin.distanceTo(n);
  47350. if (r < o.near || r > o.far)
  47351. return;
  47352. a.push({
  47353. distance: r,
  47354. distanceToRay: Math.sqrt(i),
  47355. point: n.clone(),
  47356. index: t,
  47357. face: null,
  47358. object: s
  47359. })
  47360. }
  47361. }
  47362. var s = this
  47363. , t = this.geometry
  47364. , l = this.matrixWorld
  47365. , i = o.params.Points.threshold;
  47366. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47367. Yt.copy(t.boundingSphere),
  47368. Yt.applyMatrix4(l),
  47369. !1 !== o.ray.intersectsSphere(Yt)) {
  47370. Wt.getInverse(l),
  47371. jt.copy(o.ray).applyMatrix4(Wt);
  47372. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47373. , c = n * n
  47374. , r = new Ci.Vector3;
  47375. if (t instanceof Ci.BufferGeometry) {
  47376. var h = t.index
  47377. , u = t.attributes.position.array;
  47378. if (null !== h)
  47379. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47380. var g = d[p];
  47381. r.fromArray(u, 3 * g),
  47382. e(r, g)
  47383. }
  47384. else {
  47385. p = 0;
  47386. for (var m = u.length / 3; p < m; p++)
  47387. r.fromArray(u, 3 * p),
  47388. e(r, p)
  47389. }
  47390. } else {
  47391. var v = t.vertices;
  47392. for (p = 0,
  47393. m = v.length; p < m; p++)
  47394. e(v[p], p)
  47395. }
  47396. }
  47397. }
  47398. ),
  47399. Ci.Points.prototype.clone = function() {
  47400. return new this.constructor(this.geometry,this.material).copy(this)
  47401. }
  47402. ,
  47403. Ci.Line = function(e, t, i) {
  47404. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47405. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47406. this.type = "Line",
  47407. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47408. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47409. color: 16777215 * Math.random()
  47410. })))
  47411. }
  47412. ,
  47413. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47414. Ci.Line.prototype.constructor = Ci.Line,
  47415. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47416. zt = new Ci.Ray,
  47417. Gt = new Ci.Sphere,
  47418. function(e, t) {
  47419. var i = e.linePrecision
  47420. , n = i * i
  47421. , r = this.geometry
  47422. , o = this.matrixWorld;
  47423. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47424. Gt.copy(r.boundingSphere),
  47425. Gt.applyMatrix4(o),
  47426. !1 !== e.ray.intersectsSphere(Gt)) {
  47427. Ht.getInverse(o),
  47428. zt.copy(e.ray).applyMatrix4(Ht);
  47429. var a = new Ci.Vector3
  47430. , s = new Ci.Vector3
  47431. , l = new Ci.Vector3
  47432. , c = new Ci.Vector3
  47433. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47434. if (r instanceof Ci.BufferGeometry) {
  47435. var u = r.index
  47436. , d = r.attributes.position.array;
  47437. if (null !== u)
  47438. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47439. var m = p[f]
  47440. , v = p[f + 1];
  47441. a.fromArray(d, 3 * m),
  47442. s.fromArray(d, 3 * v),
  47443. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47444. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47445. distance: C,
  47446. point: l.clone().applyMatrix4(this.matrixWorld),
  47447. index: f,
  47448. face: null,
  47449. faceIndex: null,
  47450. object: this
  47451. }))
  47452. }
  47453. else
  47454. for (f = 0,
  47455. g = d.length / 3 - 1; f < g; f += h)
  47456. a.fromArray(d, 3 * f),
  47457. s.fromArray(d, 3 * f + 3),
  47458. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47459. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47460. distance: C,
  47461. point: l.clone().applyMatrix4(this.matrixWorld),
  47462. index: f,
  47463. face: null,
  47464. faceIndex: null,
  47465. object: this
  47466. }))
  47467. } else if (r instanceof Ci.Geometry) {
  47468. var y = r.vertices
  47469. , A = y.length;
  47470. for (f = 0; f < A - 1; f += h) {
  47471. var C;
  47472. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47473. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47474. distance: C,
  47475. point: l.clone().applyMatrix4(this.matrixWorld),
  47476. index: f,
  47477. face: null,
  47478. faceIndex: null,
  47479. object: this
  47480. }))
  47481. }
  47482. }
  47483. }
  47484. }
  47485. ),
  47486. Ci.Line.prototype.clone = function() {
  47487. return new this.constructor(this.geometry,this.material).copy(this)
  47488. }
  47489. ,
  47490. Ci.LineStrip = 0,
  47491. Ci.LinePieces = 1,
  47492. Ci.LineSegments = function(e, t) {
  47493. Ci.Line.call(this, e, t),
  47494. this.type = "LineSegments"
  47495. }
  47496. ,
  47497. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47498. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47499. Ci.Mesh = function(e, t) {
  47500. Ci.Object3D.call(this),
  47501. this.type = "Mesh",
  47502. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47503. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47504. color: 16777215 * Math.random()
  47505. }),
  47506. this.drawMode = Ci.TrianglesDrawMode,
  47507. this.updateMorphTargets()
  47508. }
  47509. ,
  47510. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47511. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47512. Ci.Mesh.prototype.setDrawMode = function(e) {
  47513. this.drawMode = e
  47514. }
  47515. ,
  47516. Ci.Mesh.prototype.updateMorphTargets = function() {
  47517. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47518. this.morphTargetBase = -1,
  47519. this.morphTargetInfluences = [],
  47520. this.morphTargetDictionary = {};
  47521. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47522. this.morphTargetInfluences.push(0),
  47523. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47524. }
  47525. }
  47526. ,
  47527. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47528. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47529. 0)
  47530. }
  47531. ,
  47532. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47533. xt = new Ci.Ray,
  47534. St = new Ci.Sphere,
  47535. Mt = new Ci.Vector3,
  47536. Rt = new Ci.Vector3,
  47537. Pt = new Ci.Vector3,
  47538. Ot = new Ci.Vector3,
  47539. Lt = new Ci.Vector3,
  47540. Dt = new Ci.Vector3,
  47541. Nt = new Ci.Vector2,
  47542. Ft = new Ci.Vector2,
  47543. Bt = new Ci.Vector2,
  47544. Vt = new Ci.Vector3,
  47545. kt = new Ci.Vector3,
  47546. Ut = new Ci.Vector3,
  47547. function(e, t) {
  47548. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47549. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47550. St.copy(r.boundingSphere),
  47551. St.applyMatrix4(a),
  47552. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47553. xt.copy(e.ray).applyMatrix4(Tt),
  47554. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47555. if (r instanceof Ci.BufferGeometry) {
  47556. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47557. if (void 0 !== u.uv && (i = u.uv.array),
  47558. null !== h)
  47559. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47560. s = p[f],
  47561. l = p[f + 1],
  47562. c = p[f + 2],
  47563. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47564. t.push(n));
  47565. else
  47566. for (f = 0,
  47567. g = d.length; f < g; f += 9)
  47568. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47569. t.push(n))
  47570. } else if (r instanceof Ci.Geometry) {
  47571. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47572. 0 < _.length && (i = _);
  47573. for (var b = 0, w = E.length; b < w; b++) {
  47574. var T = E[b]
  47575. , x = 1 == A ? C[T.materialIndex] : o;
  47576. if (void 0 !== x) {
  47577. if (m = I[T.a],
  47578. v = I[T.b],
  47579. y = I[T.c],
  47580. !0 === x.morphTargets) {
  47581. var S = r.morphTargets
  47582. , M = this.morphTargetInfluences;
  47583. Mt.set(0, 0, 0),
  47584. Rt.set(0, 0, 0),
  47585. Pt.set(0, 0, 0);
  47586. for (var R = 0, P = S.length; R < P; R++) {
  47587. var O = M[R];
  47588. if (0 !== O) {
  47589. var L = S[R].vertices;
  47590. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47591. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47592. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47593. }
  47594. }
  47595. Mt.add(m),
  47596. Rt.add(v),
  47597. Pt.add(y),
  47598. m = Mt,
  47599. v = Rt,
  47600. y = Pt
  47601. }
  47602. if (n = wi(this, e, xt, m, v, y, kt)) {
  47603. if (i) {
  47604. var D = i[b];
  47605. Nt.copy(D[0]),
  47606. Ft.copy(D[1]),
  47607. Bt.copy(D[2]),
  47608. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47609. }
  47610. n.face = T,
  47611. n.faceIndex = b,
  47612. t.push(n)
  47613. }
  47614. }
  47615. }
  47616. }
  47617. }
  47618. ),
  47619. Ci.Mesh.prototype.clone = function() {
  47620. return new this.constructor(this.geometry,this.material).copy(this)
  47621. }
  47622. ,
  47623. Ci.Bone = function(e) {
  47624. Ci.Object3D.call(this),
  47625. this.type = "Bone",
  47626. this.skin = e
  47627. }
  47628. ,
  47629. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47630. Ci.Bone.prototype.constructor = Ci.Bone,
  47631. Ci.Bone.prototype.copy = function(e) {
  47632. return Ci.Object3D.prototype.copy.call(this, e),
  47633. this.skin = e.skin,
  47634. this
  47635. }
  47636. ,
  47637. Ci.Skeleton = function(e, t, i) {
  47638. if (this.useVertexTexture = void 0 === i || i,
  47639. this.identityMatrix = new Ci.Matrix4,
  47640. e = e || [],
  47641. this.bones = e.slice(0),
  47642. this.useVertexTexture) {
  47643. var n = Math.sqrt(4 * this.bones.length);
  47644. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47645. n = Math.max(n, 4),
  47646. this.boneTextureWidth = n,
  47647. this.boneTextureHeight = n,
  47648. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47649. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47650. } else
  47651. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47652. if (void 0 === t)
  47653. this.calculateInverses();
  47654. else if (this.bones.length === t.length)
  47655. this.boneInverses = t.slice(0);
  47656. else {
  47657. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47658. this.boneInverses = [];
  47659. for (var r = 0, o = this.bones.length; r < o; r++)
  47660. this.boneInverses.push(new Ci.Matrix4)
  47661. }
  47662. }
  47663. ,
  47664. Ci.Skeleton.prototype.calculateInverses = function() {
  47665. this.boneInverses = [];
  47666. for (var e = 0, t = this.bones.length; e < t; e++) {
  47667. var i = new Ci.Matrix4;
  47668. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47669. this.boneInverses.push(i)
  47670. }
  47671. }
  47672. ,
  47673. Ci.Skeleton.prototype.pose = function() {
  47674. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47675. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47676. for (t = 0,
  47677. i = this.bones.length; t < i; t++)
  47678. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47679. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47680. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47681. }
  47682. ,
  47683. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47684. function() {
  47685. for (var e = 0, t = this.bones.length; e < t; e++) {
  47686. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47687. wt.multiplyMatrices(i, this.boneInverses[e]),
  47688. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47689. }
  47690. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47691. }
  47692. ),
  47693. Ci.Skeleton.prototype.clone = function() {
  47694. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47695. }
  47696. ,
  47697. Ci.SkinnedMesh = function(e, t, i) {
  47698. Ci.Mesh.call(this, e, t),
  47699. this.type = "SkinnedMesh",
  47700. this.bindMode = "attached",
  47701. this.bindMatrix = new Ci.Matrix4,
  47702. this.bindMatrixInverse = new Ci.Matrix4;
  47703. var n = [];
  47704. if (this.geometry && void 0 !== this.geometry.bones) {
  47705. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47706. o = this.geometry.bones[a],
  47707. r = new Ci.Bone(this),
  47708. n.push(r),
  47709. r.name = o.name,
  47710. r.position.fromArray(o.pos),
  47711. r.quaternion.fromArray(o.rotq),
  47712. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47713. for (a = 0,
  47714. s = this.geometry.bones.length; a < s; ++a)
  47715. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47716. }
  47717. this.normalizeSkinWeights(),
  47718. this.updateMatrixWorld(!0),
  47719. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47720. }
  47721. ,
  47722. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47723. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47724. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47725. this.skeleton = e,
  47726. void 0 === t && (this.updateMatrixWorld(!0),
  47727. this.skeleton.calculateInverses(),
  47728. t = this.matrixWorld),
  47729. this.bindMatrix.copy(t),
  47730. this.bindMatrixInverse.getInverse(t)
  47731. }
  47732. ,
  47733. Ci.SkinnedMesh.prototype.pose = function() {
  47734. this.skeleton.pose()
  47735. }
  47736. ,
  47737. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47738. if (this.geometry instanceof Ci.Geometry)
  47739. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47740. var t = this.geometry.skinWeights[e];
  47741. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47742. }
  47743. else if (this.geometry instanceof Ci.BufferGeometry) {
  47744. var i = new Ci.Vector4
  47745. , n = this.geometry.attributes.skinWeight;
  47746. for (e = 0; e < n.count; e++) {
  47747. var r;
  47748. i.x = n.getX(e),
  47749. i.y = n.getY(e),
  47750. i.z = n.getZ(e),
  47751. i.w = n.getW(e),
  47752. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47753. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47754. }
  47755. }
  47756. }
  47757. ,
  47758. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47759. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47760. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47761. }
  47762. ,
  47763. Ci.SkinnedMesh.prototype.clone = function() {
  47764. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47765. }
  47766. ,
  47767. Ci.LOD = function() {
  47768. Ci.Object3D.call(this),
  47769. this.type = "LOD",
  47770. Object.defineProperties(this, {
  47771. levels: {
  47772. enumerable: !0,
  47773. value: []
  47774. },
  47775. objects: {
  47776. get: function() {
  47777. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47778. this.levels
  47779. }
  47780. }
  47781. })
  47782. }
  47783. ,
  47784. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47785. Ci.LOD.prototype.constructor = Ci.LOD,
  47786. Ci.LOD.prototype.addLevel = function(e, t) {
  47787. void 0 === t && (t = 0),
  47788. t = Math.abs(t);
  47789. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47790. ;
  47791. i.splice(n, 0, {
  47792. distance: t,
  47793. object: e
  47794. }),
  47795. this.add(e)
  47796. }
  47797. ,
  47798. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47799. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47800. ;
  47801. return t[i - 1].object
  47802. }
  47803. ,
  47804. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47805. function(e, t) {
  47806. bt.setFromMatrixPosition(this.matrixWorld);
  47807. var i = e.ray.origin.distanceTo(bt);
  47808. this.getObjectForDistance(i).raycast(e, t)
  47809. }
  47810. ),
  47811. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47812. _t = new Ci.Vector3,
  47813. function(e) {
  47814. var t = this.levels;
  47815. if (1 < t.length) {
  47816. Et.setFromMatrixPosition(e.matrixWorld),
  47817. _t.setFromMatrixPosition(this.matrixWorld);
  47818. var i = Et.distanceTo(_t);
  47819. t[0].object.visible = !0;
  47820. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47821. t[n - 1].object.visible = !1,
  47822. t[n].object.visible = !0;
  47823. for (; n < r; n++)
  47824. t[n].object.visible = !1
  47825. }
  47826. }
  47827. ),
  47828. Ci.LOD.prototype.copy = function(e) {
  47829. Ci.Object3D.prototype.copy.call(this, e, !1);
  47830. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47831. var r = t[i];
  47832. this.addLevel(r.object.clone(), r.distance)
  47833. }
  47834. return this
  47835. }
  47836. ,
  47837. Ci.LOD.prototype.toJSON = function(e) {
  47838. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47839. t.object.levels = [];
  47840. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47841. var o = i[n];
  47842. t.object.levels.push({
  47843. object: o.object.uuid,
  47844. distance: o.distance
  47845. })
  47846. }
  47847. return t
  47848. }
  47849. ,
  47850. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47851. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47852. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47853. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47854. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47855. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47856. function(e) {
  47857. Ci.Object3D.call(this),
  47858. this.type = "Sprite",
  47859. this.geometry = It,
  47860. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47861. }
  47862. ),
  47863. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47864. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47865. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47866. function(e, t) {
  47867. vt.setFromMatrixPosition(this.matrixWorld);
  47868. var i = e.ray.distanceSqToPoint(vt);
  47869. this.scale.x * this.scale.y < i || t.push({
  47870. distance: Math.sqrt(i),
  47871. point: this.position,
  47872. face: null,
  47873. object: this
  47874. })
  47875. }
  47876. ),
  47877. Ci.Sprite.prototype.clone = function() {
  47878. return new this.constructor(this.material).copy(this)
  47879. }
  47880. ,
  47881. Ci.Particle = Ci.Sprite,
  47882. Ci.LensFlare = function(e, t, i, n, r) {
  47883. Ci.Object3D.call(this),
  47884. this.lensFlares = [],
  47885. this.positionScreen = new Ci.Vector3,
  47886. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47887. }
  47888. ,
  47889. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47890. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47891. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47892. void 0 === t && (t = -1),
  47893. void 0 === i && (i = 0),
  47894. void 0 === o && (o = 1),
  47895. void 0 === r && (r = new Ci.Color(16777215)),
  47896. void 0 === n && (n = Ci.NormalBlending),
  47897. i = Math.min(i, Math.max(0, i)),
  47898. this.lensFlares.push({
  47899. texture: e,
  47900. size: t,
  47901. distance: i,
  47902. x: 0,
  47903. y: 0,
  47904. z: 0,
  47905. scale: 1,
  47906. rotation: 0,
  47907. opacity: o,
  47908. color: r,
  47909. blending: n
  47910. })
  47911. }
  47912. ,
  47913. Ci.LensFlare.prototype.updateLensFlares = function() {
  47914. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47915. for (e = 0; e < i; e++)
  47916. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47917. t.y = this.positionScreen.y + r * t.distance,
  47918. t.wantedRotation = t.x * Math.PI * .25,
  47919. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47920. }
  47921. ,
  47922. Ci.LensFlare.prototype.copy = function(e) {
  47923. Ci.Object3D.prototype.copy.call(this, e),
  47924. this.positionScreen.copy(e.positionScreen),
  47925. this.customUpdateCallback = e.customUpdateCallback;
  47926. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47927. this.lensFlares.push(e.lensFlares[t]);
  47928. return this
  47929. }
  47930. ,
  47931. Ci.Scene = function() {
  47932. Ci.Object3D.call(this),
  47933. this.type = "Scene",
  47934. this.fog = null,
  47935. this.overrideMaterial = null,
  47936. this.autoUpdate = !0
  47937. }
  47938. ,
  47939. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47940. Ci.Scene.prototype.constructor = Ci.Scene,
  47941. Ci.Scene.prototype.copy = function(e, t) {
  47942. return Ci.Object3D.prototype.copy.call(this, e, t),
  47943. null !== e.fog && (this.fog = e.fog.clone()),
  47944. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47945. this.autoUpdate = e.autoUpdate,
  47946. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47947. this
  47948. }
  47949. ,
  47950. Ci.Fog = function(e, t, i) {
  47951. this.name = "",
  47952. this.color = new Ci.Color(e),
  47953. this.near = void 0 !== t ? t : 1,
  47954. this.far = void 0 !== i ? i : 1e3
  47955. }
  47956. ,
  47957. Ci.Fog.prototype.clone = function() {
  47958. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47959. }
  47960. ,
  47961. Ci.FogExp2 = function(e, t) {
  47962. this.name = "",
  47963. this.color = new Ci.Color(e),
  47964. this.density = void 0 !== t ? t : 25e-5
  47965. }
  47966. ,
  47967. Ci.FogExp2.prototype.clone = function() {
  47968. return new Ci.FogExp2(this.color.getHex(),this.density)
  47969. }
  47970. ,
  47971. Ci.ShaderChunk = {},
  47972. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47973. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47974. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47975. 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",
  47976. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47977. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47978. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47979. 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",
  47980. 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",
  47981. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47982. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47983. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47984. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47985. 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",
  47986. 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",
  47987. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47988. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47989. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47990. 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",
  47991. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47992. 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",
  47993. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47994. 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",
  47995. 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",
  47996. 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",
  47997. 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",
  47998. 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",
  47999. 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",
  48000. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48001. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48002. 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",
  48003. 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",
  48004. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48005. 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",
  48006. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48007. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48008. 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",
  48009. 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",
  48010. 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",
  48011. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48012. 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",
  48013. 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",
  48014. 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",
  48015. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48016. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48017. 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",
  48018. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48019. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48020. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48021. 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",
  48022. 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",
  48023. 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",
  48024. 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",
  48025. 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",
  48026. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48027. 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",
  48028. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48029. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48030. 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",
  48031. 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",
  48032. 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",
  48033. 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",
  48034. 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",
  48035. 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",
  48036. 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",
  48037. 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",
  48038. 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",
  48039. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48040. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48041. 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",
  48042. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48043. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48044. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48045. 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",
  48046. 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",
  48047. 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",
  48048. 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",
  48049. Ci.UniformsUtils = {
  48050. merge: function(e) {
  48051. for (var t = {}, i = 0; i < e.length; i++) {
  48052. var n = this.clone(e[i]);
  48053. for (var r in n)
  48054. t[r] = n[r]
  48055. }
  48056. return t
  48057. },
  48058. clone: function(e) {
  48059. var t = {};
  48060. for (var i in e)
  48061. for (var n in t[i] = {},
  48062. e[i]) {
  48063. var r = e[i][n];
  48064. 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
  48065. }
  48066. return t
  48067. }
  48068. },
  48069. Ci.UniformsLib = {
  48070. common: {
  48071. diffuse: {
  48072. type: "c",
  48073. value: new Ci.Color(15658734)
  48074. },
  48075. opacity: {
  48076. type: "f",
  48077. value: 1
  48078. },
  48079. map: {
  48080. type: "t",
  48081. value: null
  48082. },
  48083. offsetRepeat: {
  48084. type: "v4",
  48085. value: new Ci.Vector4(0,0,1,1)
  48086. },
  48087. specularMap: {
  48088. type: "t",
  48089. value: null
  48090. },
  48091. alphaMap: {
  48092. type: "t",
  48093. value: null
  48094. },
  48095. envMap: {
  48096. type: "t",
  48097. value: null
  48098. },
  48099. flipEnvMap: {
  48100. type: "f",
  48101. value: -1
  48102. },
  48103. reflectivity: {
  48104. type: "f",
  48105. value: 1
  48106. },
  48107. refractionRatio: {
  48108. type: "f",
  48109. value: .98
  48110. }
  48111. },
  48112. aomap: {
  48113. aoMap: {
  48114. type: "t",
  48115. value: null
  48116. },
  48117. aoMapIntensity: {
  48118. type: "f",
  48119. value: 1
  48120. }
  48121. },
  48122. lightmap: {
  48123. lightMap: {
  48124. type: "t",
  48125. value: null
  48126. },
  48127. lightMapIntensity: {
  48128. type: "f",
  48129. value: 1
  48130. }
  48131. },
  48132. emissivemap: {
  48133. emissiveMap: {
  48134. type: "t",
  48135. value: null
  48136. }
  48137. },
  48138. bumpmap: {
  48139. bumpMap: {
  48140. type: "t",
  48141. value: null
  48142. },
  48143. bumpScale: {
  48144. type: "f",
  48145. value: 1
  48146. }
  48147. },
  48148. normalmap: {
  48149. normalMap: {
  48150. type: "t",
  48151. value: null
  48152. },
  48153. normalScale: {
  48154. type: "v2",
  48155. value: new Ci.Vector2(1,1)
  48156. }
  48157. },
  48158. displacementmap: {
  48159. displacementMap: {
  48160. type: "t",
  48161. value: null
  48162. },
  48163. displacementScale: {
  48164. type: "f",
  48165. value: 1
  48166. },
  48167. displacementBias: {
  48168. type: "f",
  48169. value: 0
  48170. }
  48171. },
  48172. roughnessmap: {
  48173. roughnessMap: {
  48174. type: "t",
  48175. value: null
  48176. }
  48177. },
  48178. metalnessmap: {
  48179. metalnessMap: {
  48180. type: "t",
  48181. value: null
  48182. }
  48183. },
  48184. fog: {
  48185. fogDensity: {
  48186. type: "f",
  48187. value: 25e-5
  48188. },
  48189. fogNear: {
  48190. type: "f",
  48191. value: 1
  48192. },
  48193. fogFar: {
  48194. type: "f",
  48195. value: 2e3
  48196. },
  48197. fogColor: {
  48198. type: "c",
  48199. value: new Ci.Color(16777215)
  48200. }
  48201. },
  48202. lights: {
  48203. ambientLightColor: {
  48204. type: "fv",
  48205. value: []
  48206. },
  48207. directionalLights: {
  48208. type: "sa",
  48209. value: [],
  48210. properties: {
  48211. direction: {
  48212. type: "v3"
  48213. },
  48214. color: {
  48215. type: "c"
  48216. },
  48217. shadow: {
  48218. type: "i"
  48219. },
  48220. shadowBias: {
  48221. type: "f"
  48222. },
  48223. shadowRadius: {
  48224. type: "f"
  48225. },
  48226. shadowMapSize: {
  48227. type: "v2"
  48228. }
  48229. }
  48230. },
  48231. directionalShadowMap: {
  48232. type: "tv",
  48233. value: []
  48234. },
  48235. directionalShadowMatrix: {
  48236. type: "m4v",
  48237. value: []
  48238. },
  48239. spotLights: {
  48240. type: "sa",
  48241. value: [],
  48242. properties: {
  48243. color: {
  48244. type: "c"
  48245. },
  48246. position: {
  48247. type: "v3"
  48248. },
  48249. direction: {
  48250. type: "v3"
  48251. },
  48252. distance: {
  48253. type: "f"
  48254. },
  48255. coneCos: {
  48256. type: "f"
  48257. },
  48258. penumbraCos: {
  48259. type: "f"
  48260. },
  48261. decay: {
  48262. type: "f"
  48263. },
  48264. shadow: {
  48265. type: "i"
  48266. },
  48267. shadowBias: {
  48268. type: "f"
  48269. },
  48270. shadowRadius: {
  48271. type: "f"
  48272. },
  48273. shadowMapSize: {
  48274. type: "v2"
  48275. }
  48276. }
  48277. },
  48278. spotShadowMap: {
  48279. type: "tv",
  48280. value: []
  48281. },
  48282. spotShadowMatrix: {
  48283. type: "m4v",
  48284. value: []
  48285. },
  48286. pointLights: {
  48287. type: "sa",
  48288. value: [],
  48289. properties: {
  48290. color: {
  48291. type: "c"
  48292. },
  48293. position: {
  48294. type: "v3"
  48295. },
  48296. decay: {
  48297. type: "f"
  48298. },
  48299. distance: {
  48300. type: "f"
  48301. },
  48302. shadow: {
  48303. type: "i"
  48304. },
  48305. shadowBias: {
  48306. type: "f"
  48307. },
  48308. shadowRadius: {
  48309. type: "f"
  48310. },
  48311. shadowMapSize: {
  48312. type: "v2"
  48313. }
  48314. }
  48315. },
  48316. pointShadowMap: {
  48317. type: "tv",
  48318. value: []
  48319. },
  48320. pointShadowMatrix: {
  48321. type: "m4v",
  48322. value: []
  48323. },
  48324. hemisphereLights: {
  48325. type: "sa",
  48326. value: [],
  48327. properties: {
  48328. direction: {
  48329. type: "v3"
  48330. },
  48331. skyColor: {
  48332. type: "c"
  48333. },
  48334. groundColor: {
  48335. type: "c"
  48336. }
  48337. }
  48338. }
  48339. },
  48340. points: {
  48341. diffuse: {
  48342. type: "c",
  48343. value: new Ci.Color(15658734)
  48344. },
  48345. opacity: {
  48346. type: "f",
  48347. value: 1
  48348. },
  48349. size: {
  48350. type: "f",
  48351. value: 1
  48352. },
  48353. scale: {
  48354. type: "f",
  48355. value: 1
  48356. },
  48357. map: {
  48358. type: "t",
  48359. value: null
  48360. },
  48361. offsetRepeat: {
  48362. type: "v4",
  48363. value: new Ci.Vector4(0,0,1,1)
  48364. }
  48365. }
  48366. },
  48367. 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",
  48368. 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",
  48369. 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",
  48370. 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",
  48371. 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",
  48372. 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",
  48373. 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",
  48374. 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",
  48375. 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",
  48376. 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",
  48377. 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",
  48378. 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",
  48379. 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",
  48380. 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",
  48381. 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",
  48382. 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",
  48383. 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",
  48384. 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",
  48385. 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",
  48386. 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",
  48387. 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",
  48388. 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",
  48389. 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",
  48390. 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",
  48391. Ci.ShaderLib = {
  48392. basic: {
  48393. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48394. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48395. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48396. },
  48397. lambert: {
  48398. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48399. emissive: {
  48400. type: "c",
  48401. value: new Ci.Color(0)
  48402. }
  48403. }]),
  48404. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48405. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48406. },
  48407. phong: {
  48408. 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, {
  48409. emissive: {
  48410. type: "c",
  48411. value: new Ci.Color(0)
  48412. },
  48413. specular: {
  48414. type: "c",
  48415. value: new Ci.Color(1118481)
  48416. },
  48417. shininess: {
  48418. type: "f",
  48419. value: 30
  48420. }
  48421. }]),
  48422. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48423. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48424. },
  48425. standard: {
  48426. 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, {
  48427. emissive: {
  48428. type: "c",
  48429. value: new Ci.Color(0)
  48430. },
  48431. roughness: {
  48432. type: "f",
  48433. value: .5
  48434. },
  48435. metalness: {
  48436. type: "f",
  48437. value: 0
  48438. },
  48439. envMapIntensity: {
  48440. type: "f",
  48441. value: 1
  48442. }
  48443. }]),
  48444. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48445. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48446. },
  48447. points: {
  48448. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48449. vertexShader: Ci.ShaderChunk.points_vert,
  48450. fragmentShader: Ci.ShaderChunk.points_frag
  48451. },
  48452. dashed: {
  48453. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48454. scale: {
  48455. type: "f",
  48456. value: 1
  48457. },
  48458. dashSize: {
  48459. type: "f",
  48460. value: 1
  48461. },
  48462. totalSize: {
  48463. type: "f",
  48464. value: 2
  48465. }
  48466. }]),
  48467. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48468. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48469. },
  48470. depth: {
  48471. uniforms: {
  48472. mNear: {
  48473. type: "f",
  48474. value: 1
  48475. },
  48476. mFar: {
  48477. type: "f",
  48478. value: 2e3
  48479. },
  48480. opacity: {
  48481. type: "f",
  48482. value: 1
  48483. }
  48484. },
  48485. vertexShader: Ci.ShaderChunk.depth_vert,
  48486. fragmentShader: Ci.ShaderChunk.depth_frag
  48487. },
  48488. normal: {
  48489. uniforms: {
  48490. opacity: {
  48491. type: "f",
  48492. value: 1
  48493. }
  48494. },
  48495. vertexShader: Ci.ShaderChunk.normal_vert,
  48496. fragmentShader: Ci.ShaderChunk.normal_frag
  48497. },
  48498. cube: {
  48499. uniforms: {
  48500. tCube: {
  48501. type: "t",
  48502. value: null
  48503. },
  48504. tFlip: {
  48505. type: "f",
  48506. value: -1
  48507. }
  48508. },
  48509. vertexShader: Ci.ShaderChunk.cube_vert,
  48510. fragmentShader: Ci.ShaderChunk.cube_frag
  48511. },
  48512. equirect: {
  48513. uniforms: {
  48514. tEquirect: {
  48515. type: "t",
  48516. value: null
  48517. },
  48518. tFlip: {
  48519. type: "f",
  48520. value: -1
  48521. }
  48522. },
  48523. vertexShader: Ci.ShaderChunk.equirect_vert,
  48524. fragmentShader: Ci.ShaderChunk.equirect_frag
  48525. },
  48526. depthRGBA: {
  48527. uniforms: {},
  48528. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48529. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48530. },
  48531. distanceRGBA: {
  48532. uniforms: {
  48533. lightPos: {
  48534. type: "v3",
  48535. value: new Ci.Vector3(0,0,0)
  48536. }
  48537. },
  48538. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48539. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48540. }
  48541. },
  48542. Ci.WebGLRenderer = function(e) {
  48543. function S() {
  48544. return null === Q ? he : 1
  48545. }
  48546. function i(e, t, i, n) {
  48547. !0 === V && (e *= n,
  48548. t *= n,
  48549. i *= n),
  48550. _e.clearColor(e, t, i, n)
  48551. }
  48552. function t() {
  48553. _e.init(),
  48554. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48555. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48556. i(ae.r, ae.g, ae.b, se)
  48557. }
  48558. function n() {
  48559. te = K = null,
  48560. ee = "",
  48561. $ = -1,
  48562. _e.reset()
  48563. }
  48564. function r(e) {
  48565. e.preventDefault(),
  48566. n(),
  48567. t(),
  48568. be.clear()
  48569. }
  48570. function f(e) {
  48571. var t = e.target;
  48572. t.removeEventListener("dispose", f),
  48573. function(e) {
  48574. var t = be.get(e);
  48575. if (e.image && t.__image__webglTextureCube)
  48576. X.deleteTexture(t.__image__webglTextureCube);
  48577. else {
  48578. if (void 0 === t.__webglInit)
  48579. return;
  48580. X.deleteTexture(t.__webglTexture)
  48581. }
  48582. be.delete(e)
  48583. }(t),
  48584. ye.textures--
  48585. }
  48586. function a(e) {
  48587. var t = e.target;
  48588. t.removeEventListener("dispose", a),
  48589. function(e) {
  48590. var t = be.get(e)
  48591. , i = be.get(e.texture);
  48592. if (e && void 0 !== i.__webglTexture) {
  48593. if (X.deleteTexture(i.__webglTexture),
  48594. e instanceof Ci.WebGLRenderTargetCube)
  48595. for (var n = 0; n < 6; n++)
  48596. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48597. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48598. else
  48599. X.deleteFramebuffer(t.__webglFramebuffer),
  48600. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48601. be.delete(e.texture),
  48602. be.delete(e)
  48603. }
  48604. }(t),
  48605. ye.textures--
  48606. }
  48607. function v(e) {
  48608. var t = e.target;
  48609. t.removeEventListener("dispose", v),
  48610. function(e) {
  48611. y(e),
  48612. be.delete(e)
  48613. }(t)
  48614. }
  48615. function y(e) {
  48616. var t = be.get(e).program;
  48617. (e.program = void 0) !== t && Te.releaseProgram(t)
  48618. }
  48619. function M(e, t) {
  48620. return Math.abs(t[0]) - Math.abs(e[0])
  48621. }
  48622. function s(e, t) {
  48623. 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
  48624. }
  48625. function l(e, t) {
  48626. 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
  48627. }
  48628. function d(e, t, i, n, r) {
  48629. var o, a;
  48630. a = i.transparent ? (o = G,
  48631. ++W) : (o = H,
  48632. ++z);
  48633. var s = o[a];
  48634. void 0 !== s ? (s.id = e.id,
  48635. s.object = e,
  48636. s.geometry = t,
  48637. s.material = i,
  48638. s.z = me.z,
  48639. s.group = r) : (s = {
  48640. id: e.id,
  48641. object: e,
  48642. geometry: t,
  48643. material: i,
  48644. z: me.z,
  48645. group: r
  48646. },
  48647. o.push(s))
  48648. }
  48649. function c(e, t, i, n) {
  48650. for (var r = 0, o = e.length; r < o; r++) {
  48651. var a = e[r]
  48652. , s = a.object
  48653. , l = a.geometry
  48654. , c = void 0 === n ? a.material : n
  48655. , h = a.group;
  48656. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48657. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48658. s instanceof Ci.ImmediateRenderObject) {
  48659. R(c);
  48660. var u = P(t, i, c, s);
  48661. ee = "",
  48662. s.render(function(e) {
  48663. Z.renderBufferImmediate(e, u, c)
  48664. })
  48665. } else
  48666. Z.renderBufferDirect(t, i, l, c, s, h)
  48667. }
  48668. }
  48669. function R(e) {
  48670. (function(e) {
  48671. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48672. _e.setFlipSided(e.side === Ci.BackSide)
  48673. }
  48674. )(e),
  48675. !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),
  48676. _e.setDepthFunc(e.depthFunc),
  48677. _e.setDepthTest(e.depthTest),
  48678. _e.setDepthWrite(e.depthWrite),
  48679. _e.setColorWrite(e.colorWrite),
  48680. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48681. }
  48682. function P(e, t, i, n) {
  48683. oe = 0;
  48684. var r = be.get(i);
  48685. void 0 === r.program && (i.needsUpdate = !0),
  48686. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48687. i.needsUpdate && (function(e, t, i) {
  48688. var n = be.get(e)
  48689. , r = Te.getParameters(e, ve, t, i)
  48690. , o = Te.getProgramCode(e, r)
  48691. , a = n.program
  48692. , s = !0;
  48693. if (void 0 === a)
  48694. e.addEventListener("dispose", v);
  48695. else if (a.code !== o)
  48696. y(e);
  48697. else {
  48698. if (void 0 !== r.shaderID)
  48699. return;
  48700. s = !1
  48701. }
  48702. if (s) {
  48703. if (r.shaderID) {
  48704. var l = Ci.ShaderLib[r.shaderID];
  48705. n.__webglShader = {
  48706. name: e.type,
  48707. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48708. vertexShader: l.vertexShader,
  48709. fragmentShader: l.fragmentShader
  48710. }
  48711. } else
  48712. n.__webglShader = {
  48713. name: e.type,
  48714. uniforms: e.uniforms,
  48715. vertexShader: e.vertexShader,
  48716. fragmentShader: e.fragmentShader
  48717. };
  48718. e.__webglShader = n.__webglShader,
  48719. a = Te.acquireProgram(e, r, o),
  48720. n.program = a,
  48721. e.program = a
  48722. }
  48723. var c = a.getAttributes();
  48724. if (e.morphTargets)
  48725. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48726. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48727. if (e.morphNormals)
  48728. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48729. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48730. n.uniformsList = [];
  48731. var u = n.__webglShader.uniforms
  48732. , d = n.program.getUniforms();
  48733. for (var p in u) {
  48734. var f = d[p];
  48735. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48736. }
  48737. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48738. u.ambientLightColor.value = ve.ambient,
  48739. u.directionalLights.value = ve.directional,
  48740. u.spotLights.value = ve.spot,
  48741. u.pointLights.value = ve.point,
  48742. u.hemisphereLights.value = ve.hemi,
  48743. u.directionalShadowMap.value = ve.directionalShadowMap,
  48744. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48745. u.spotShadowMap.value = ve.spotShadowMap,
  48746. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48747. u.pointShadowMap.value = ve.pointShadowMap,
  48748. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48749. n.hasDynamicUniforms = !1;
  48750. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48751. if (!0 === n.uniformsList[g][0].dynamic) {
  48752. n.hasDynamicUniforms = !0;
  48753. break
  48754. }
  48755. }
  48756. }(i, t, n),
  48757. i.needsUpdate = !1);
  48758. var o = !1
  48759. , a = !1
  48760. , s = !1
  48761. , l = r.program
  48762. , c = l.getUniforms()
  48763. , h = r.__webglShader.uniforms;
  48764. if (l.id !== K && (X.useProgram(l.program),
  48765. K = l.id,
  48766. s = a = o = !0),
  48767. i.id !== $ && ($ = i.id,
  48768. a = !0),
  48769. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48770. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48771. e !== te && (te = e,
  48772. s = a = !0),
  48773. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48774. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48775. (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),
  48776. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48777. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48778. i.skinning)
  48779. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48780. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48781. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48782. if (void 0 !== c.boneTexture) {
  48783. var u = A();
  48784. X.uniform1i(c.boneTexture, u),
  48785. Z.setTexture(n.skeleton.boneTexture, u)
  48786. }
  48787. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48788. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48789. } else
  48790. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48791. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48792. e.ambientLightColor.needsUpdate = t,
  48793. e.directionalLights.needsUpdate = t,
  48794. e.pointLights.needsUpdate = t,
  48795. e.spotLights.needsUpdate = t,
  48796. e.hemisphereLights.needsUpdate = t
  48797. }(h, s),
  48798. t && i.fog && function(e, t) {
  48799. e.fogColor.value = t.color,
  48800. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48801. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48802. }(h, t),
  48803. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48804. var i;
  48805. if (e.opacity.value = t.opacity,
  48806. e.diffuse.value = t.color,
  48807. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48808. e.map.value = t.map,
  48809. e.specularMap.value = t.specularMap,
  48810. e.alphaMap.value = t.alphaMap,
  48811. t.aoMap && (e.aoMap.value = t.aoMap,
  48812. e.aoMapIntensity.value = t.aoMapIntensity),
  48813. 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),
  48814. void 0 !== i) {
  48815. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48816. var n = i.offset
  48817. , r = i.repeat;
  48818. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48819. }
  48820. e.envMap.value = t.envMap,
  48821. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48822. e.reflectivity.value = t.reflectivity,
  48823. e.refractionRatio.value = t.refractionRatio
  48824. }(h, i),
  48825. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48826. function(e, t) {
  48827. e.dashSize.value = t.dashSize,
  48828. e.totalSize.value = t.dashSize + t.gapSize,
  48829. e.scale.value = t.scale
  48830. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48831. if (e.diffuse.value = t.color,
  48832. e.opacity.value = t.opacity,
  48833. e.size.value = t.size * he,
  48834. e.scale.value = O.clientHeight / 2,
  48835. e.map.value = t.map,
  48836. null !== t.map) {
  48837. var i = t.map.offset
  48838. , n = t.map.repeat;
  48839. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48840. }
  48841. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48842. t.lightMap && (e.lightMap.value = t.lightMap,
  48843. e.lightMapIntensity.value = t.lightMapIntensity),
  48844. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48845. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48846. e.specular.value = t.specular,
  48847. e.shininess.value = Math.max(t.shininess, 1e-4),
  48848. t.lightMap && (e.lightMap.value = t.lightMap,
  48849. e.lightMapIntensity.value = t.lightMapIntensity),
  48850. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48851. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48852. e.bumpScale.value = t.bumpScale),
  48853. t.normalMap && (e.normalMap.value = t.normalMap,
  48854. e.normalScale.value.copy(t.normalScale)),
  48855. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48856. e.displacementScale.value = t.displacementScale,
  48857. e.displacementBias.value = t.displacementBias)
  48858. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48859. e.roughness.value = t.roughness,
  48860. e.metalness.value = t.metalness,
  48861. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48862. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48863. t.lightMap && (e.lightMap.value = t.lightMap,
  48864. e.lightMapIntensity.value = t.lightMapIntensity),
  48865. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48866. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48867. e.bumpScale.value = t.bumpScale),
  48868. t.normalMap && (e.normalMap.value = t.normalMap,
  48869. e.normalScale.value.copy(t.normalScale)),
  48870. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48871. e.displacementScale.value = t.displacementScale,
  48872. e.displacementBias.value = t.displacementBias),
  48873. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48874. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48875. h.mFar.value = e.far,
  48876. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48877. g(r.uniformsList)),
  48878. function(e, t) {
  48879. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48880. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48881. }(c, n),
  48882. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48883. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48884. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48885. var a = e[r][0]
  48886. , s = a.onUpdateCallback;
  48887. void 0 !== s && (s.bind(a)(t, i),
  48888. n.push(e[r]))
  48889. }
  48890. g(n)
  48891. }(r.uniformsList, n, e),
  48892. l
  48893. }
  48894. function p(e, t) {
  48895. e.diffuse.value = t.color,
  48896. e.opacity.value = t.opacity
  48897. }
  48898. function A() {
  48899. var e = oe;
  48900. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48901. oe += 1,
  48902. e
  48903. }
  48904. function C(e, t, i, n) {
  48905. var r, o;
  48906. if ("1i" === t)
  48907. X.uniform1i(i, n);
  48908. else if ("1f" === t)
  48909. X.uniform1f(i, n);
  48910. else if ("2f" === t)
  48911. X.uniform2f(i, n[0], n[1]);
  48912. else if ("3f" === t)
  48913. X.uniform3f(i, n[0], n[1], n[2]);
  48914. else if ("4f" === t)
  48915. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48916. else if ("1iv" === t)
  48917. X.uniform1iv(i, n);
  48918. else if ("3iv" === t)
  48919. X.uniform3iv(i, n);
  48920. else if ("1fv" === t)
  48921. X.uniform1fv(i, n);
  48922. else if ("2fv" === t)
  48923. X.uniform2fv(i, n);
  48924. else if ("3fv" === t)
  48925. X.uniform3fv(i, n);
  48926. else if ("4fv" === t)
  48927. X.uniform4fv(i, n);
  48928. else if ("Matrix2fv" === t)
  48929. X.uniformMatrix2fv(i, !1, n);
  48930. else if ("Matrix3fv" === t)
  48931. X.uniformMatrix3fv(i, !1, n);
  48932. else if ("Matrix4fv" === t)
  48933. X.uniformMatrix4fv(i, !1, n);
  48934. else if ("i" === t)
  48935. X.uniform1i(i, n);
  48936. else if ("f" === t)
  48937. X.uniform1f(i, n);
  48938. else if ("v2" === t)
  48939. X.uniform2f(i, n.x, n.y);
  48940. else if ("v3" === t)
  48941. X.uniform3f(i, n.x, n.y, n.z);
  48942. else if ("v4" === t)
  48943. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48944. else if ("c" === t)
  48945. X.uniform3f(i, n.r, n.g, n.b);
  48946. else if ("s" === t) {
  48947. var a = e.properties;
  48948. for (var s in a) {
  48949. var l = a[s]
  48950. , c = i[s]
  48951. , h = n[s];
  48952. C(l, l.type, c, h)
  48953. }
  48954. } else if ("sa" === t) {
  48955. a = e.properties;
  48956. for (var u = 0, d = n.length; u < d; u++)
  48957. for (var s in a) {
  48958. l = a[s],
  48959. c = i[u][s],
  48960. h = n[u][s];
  48961. C(l, l.type, c, h)
  48962. }
  48963. } else if ("iv1" === t)
  48964. X.uniform1iv(i, n);
  48965. else if ("iv" === t)
  48966. X.uniform3iv(i, n);
  48967. else if ("fv1" === t)
  48968. X.uniform1fv(i, n);
  48969. else if ("fv" === t)
  48970. X.uniform3fv(i, n);
  48971. else if ("v2v" === t) {
  48972. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48973. u = 0;
  48974. for (var p = 0, f = n.length; u < f; u++,
  48975. p += 2)
  48976. e._array[p + 0] = n[u].x,
  48977. e._array[p + 1] = n[u].y;
  48978. X.uniform2fv(i, e._array)
  48979. } else if ("v3v" === t) {
  48980. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48981. u = 0;
  48982. var g = 0;
  48983. for (f = n.length; u < f; u++,
  48984. g += 3)
  48985. e._array[g + 0] = n[u].x,
  48986. e._array[g + 1] = n[u].y,
  48987. e._array[g + 2] = n[u].z;
  48988. X.uniform3fv(i, e._array)
  48989. } else if ("v4v" === t) {
  48990. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48991. u = 0;
  48992. var m = 0;
  48993. for (f = n.length; u < f; u++,
  48994. m += 4)
  48995. e._array[m + 0] = n[u].x,
  48996. e._array[m + 1] = n[u].y,
  48997. e._array[m + 2] = n[u].z,
  48998. e._array[m + 3] = n[u].w;
  48999. X.uniform4fv(i, e._array)
  49000. } else if ("m2" === t)
  49001. X.uniformMatrix2fv(i, !1, n.elements);
  49002. else if ("m3" === t)
  49003. X.uniformMatrix3fv(i, !1, n.elements);
  49004. else if ("m3v" === t) {
  49005. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49006. for (u = 0,
  49007. f = n.length; u < f; u++)
  49008. n[u].flattenToArrayOffset(e._array, 9 * u);
  49009. X.uniformMatrix3fv(i, !1, e._array)
  49010. } else if ("m4" === t)
  49011. X.uniformMatrix4fv(i, !1, n.elements);
  49012. else if ("m4v" === t) {
  49013. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49014. for (u = 0,
  49015. f = n.length; u < f; u++)
  49016. n[u].flattenToArrayOffset(e._array, 16 * u);
  49017. X.uniformMatrix4fv(i, !1, e._array)
  49018. } else if ("t" === t) {
  49019. if (r = n,
  49020. o = A(),
  49021. X.uniform1i(i, o),
  49022. !r)
  49023. return;
  49024. 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)
  49025. } else if ("tv" === t) {
  49026. void 0 === e._array && (e._array = []);
  49027. for (u = 0,
  49028. f = e.value.length; u < f; u++)
  49029. e._array[u] = A();
  49030. X.uniform1iv(i, e._array);
  49031. for (u = 0,
  49032. f = e.value.length; u < f; u++)
  49033. r = e.value[u],
  49034. o = e._array[u],
  49035. 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))
  49036. } else
  49037. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49038. }
  49039. function g(e) {
  49040. for (var t = 0, i = e.length; t < i; t++) {
  49041. var n = e[t][0];
  49042. if (!1 !== n.needsUpdate)
  49043. C(n, n.type, e[t][1], n.value)
  49044. }
  49045. }
  49046. function m(e, t, i) {
  49047. var n;
  49048. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49049. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49050. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49051. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49052. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49053. 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),
  49054. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49055. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49056. 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)),
  49057. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49058. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49059. return;
  49060. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49061. return;
  49062. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49063. be.get(t).__currentAnisotropy = t.anisotropy)
  49064. }
  49065. }
  49066. function o(e, t, i) {
  49067. void 0 === e.__webglInit && (e.__webglInit = !0,
  49068. t.addEventListener("dispose", f),
  49069. e.__webglTexture = X.createTexture(),
  49070. ye.textures++),
  49071. _e.activeTexture(X.TEXTURE0 + i),
  49072. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49073. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49074. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49075. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49076. var n = I(t.image, Ee.maxTextureSize);
  49077. !function(e) {
  49078. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49079. }(t) || !1 !== E(n) || (n = function(e) {
  49080. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49081. var t = document.createElement("canvas");
  49082. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49083. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49084. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49085. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49086. t
  49087. }
  49088. return e
  49089. }(n));
  49090. var r = E(n)
  49091. , o = x(t.format)
  49092. , a = x(t.type);
  49093. m(X.TEXTURE_2D, t, r);
  49094. var s, l = t.mipmaps;
  49095. if (t instanceof Ci.DataTexture)
  49096. if (0 < l.length && r) {
  49097. for (var c = 0, h = l.length; c < h; c++)
  49098. s = l[c],
  49099. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49100. t.generateMipmaps = !1
  49101. } else
  49102. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49103. else if (t instanceof Ci.CompressedTexture)
  49104. for (c = 0,
  49105. h = l.length; c < h; c++)
  49106. s = l[c],
  49107. 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);
  49108. else if (0 < l.length && r) {
  49109. for (c = 0,
  49110. h = l.length; c < h; c++)
  49111. s = l[c],
  49112. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49113. t.generateMipmaps = !1
  49114. } else
  49115. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49116. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49117. e.__version = t.version,
  49118. t.onUpdate && t.onUpdate(t)
  49119. }
  49120. function I(e, t) {
  49121. if (e.width > t || e.height > t) {
  49122. var i = t / Math.max(e.width, e.height)
  49123. , n = document.createElement("canvas");
  49124. return n.width = Math.floor(e.width * i),
  49125. n.height = Math.floor(e.height * i),
  49126. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49127. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49128. n
  49129. }
  49130. return e
  49131. }
  49132. function E(e) {
  49133. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49134. }
  49135. function _(e, t) {
  49136. var i = be.get(e);
  49137. if (6 === e.image.length)
  49138. if (0 < e.version && i.__version !== e.version) {
  49139. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49140. i.__image__webglTextureCube = X.createTexture(),
  49141. ye.textures++),
  49142. _e.activeTexture(X.TEXTURE0 + t),
  49143. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49144. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49145. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49146. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49147. var s = E(o[0])
  49148. , l = x(e.format)
  49149. , c = x(e.type);
  49150. m(X.TEXTURE_CUBE_MAP, e, s);
  49151. for (a = 0; a < 6; a++)
  49152. if (n)
  49153. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49154. h = u[d],
  49155. 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);
  49156. else
  49157. 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]);
  49158. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49159. i.__version = e.version,
  49160. e.onUpdate && e.onUpdate(e)
  49161. } else
  49162. _e.activeTexture(X.TEXTURE0 + t),
  49163. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49164. }
  49165. function b(e, t) {
  49166. _e.activeTexture(X.TEXTURE0 + t),
  49167. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49168. }
  49169. function h(e, t, i, n) {
  49170. var r = x(t.texture.format)
  49171. , o = x(t.texture.type);
  49172. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49173. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49174. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49175. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49176. }
  49177. function u(e, t) {
  49178. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49179. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49180. 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),
  49181. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49182. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49183. }
  49184. function w(e) {
  49185. var t = be.get(e)
  49186. , i = be.get(e.texture);
  49187. e.addEventListener("dispose", a),
  49188. i.__webglTexture = X.createTexture(),
  49189. ye.textures++;
  49190. var n = e instanceof Ci.WebGLRenderTargetCube
  49191. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49192. if (n) {
  49193. t.__webglFramebuffer = [];
  49194. for (var o = 0; o < 6; o++)
  49195. t.__webglFramebuffer[o] = X.createFramebuffer()
  49196. } else
  49197. t.__webglFramebuffer = X.createFramebuffer();
  49198. if (n) {
  49199. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49200. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49201. for (o = 0; o < 6; o++)
  49202. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49203. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49204. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49205. } else
  49206. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49207. m(X.TEXTURE_2D, e.texture, r),
  49208. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49209. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49210. _e.bindTexture(X.TEXTURE_2D, null);
  49211. e.depthBuffer && function(e) {
  49212. var t = be.get(e);
  49213. if (e instanceof Ci.WebGLRenderTargetCube) {
  49214. t.__webglDepthbuffer = [];
  49215. for (var i = 0; i < 6; i++)
  49216. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49217. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49218. u(t.__webglDepthbuffer[i], e)
  49219. } else
  49220. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49221. t.__webglDepthbuffer = X.createRenderbuffer(),
  49222. u(t.__webglDepthbuffer, e);
  49223. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49224. }(e)
  49225. }
  49226. function T(e) {
  49227. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49228. }
  49229. function x(e) {
  49230. var t;
  49231. if (e === Ci.RepeatWrapping)
  49232. return X.REPEAT;
  49233. if (e === Ci.ClampToEdgeWrapping)
  49234. return X.CLAMP_TO_EDGE;
  49235. if (e === Ci.MirroredRepeatWrapping)
  49236. return X.MIRRORED_REPEAT;
  49237. if (e === Ci.NearestFilter)
  49238. return X.NEAREST;
  49239. if (e === Ci.NearestMipMapNearestFilter)
  49240. return X.NEAREST_MIPMAP_NEAREST;
  49241. if (e === Ci.NearestMipMapLinearFilter)
  49242. return X.NEAREST_MIPMAP_LINEAR;
  49243. if (e === Ci.LinearFilter)
  49244. return X.LINEAR;
  49245. if (e === Ci.LinearMipMapNearestFilter)
  49246. return X.LINEAR_MIPMAP_NEAREST;
  49247. if (e === Ci.LinearMipMapLinearFilter)
  49248. return X.LINEAR_MIPMAP_LINEAR;
  49249. if (e === Ci.UnsignedByteType)
  49250. return X.UNSIGNED_BYTE;
  49251. if (e === Ci.UnsignedShort4444Type)
  49252. return X.UNSIGNED_SHORT_4_4_4_4;
  49253. if (e === Ci.UnsignedShort5551Type)
  49254. return X.UNSIGNED_SHORT_5_5_5_1;
  49255. if (e === Ci.UnsignedShort565Type)
  49256. return X.UNSIGNED_SHORT_5_6_5;
  49257. if (e === Ci.ByteType)
  49258. return X.BYTE;
  49259. if (e === Ci.ShortType)
  49260. return X.SHORT;
  49261. if (e === Ci.UnsignedShortType)
  49262. return X.UNSIGNED_SHORT;
  49263. if (e === Ci.IntType)
  49264. return X.INT;
  49265. if (e === Ci.UnsignedIntType)
  49266. return X.UNSIGNED_INT;
  49267. if (e === Ci.FloatType)
  49268. return X.FLOAT;
  49269. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49270. return t.HALF_FLOAT_OES;
  49271. if (e === Ci.AlphaFormat)
  49272. return X.ALPHA;
  49273. if (e === Ci.RGBFormat)
  49274. return X.RGB;
  49275. if (e === Ci.RGBAFormat)
  49276. return X.RGBA;
  49277. if (e === Ci.LuminanceFormat)
  49278. return X.LUMINANCE;
  49279. if (e === Ci.LuminanceAlphaFormat)
  49280. return X.LUMINANCE_ALPHA;
  49281. if (e === Ci.AddEquation)
  49282. return X.FUNC_ADD;
  49283. if (e === Ci.SubtractEquation)
  49284. return X.FUNC_SUBTRACT;
  49285. if (e === Ci.ReverseSubtractEquation)
  49286. return X.FUNC_REVERSE_SUBTRACT;
  49287. if (e === Ci.ZeroFactor)
  49288. return X.ZERO;
  49289. if (e === Ci.OneFactor)
  49290. return X.ONE;
  49291. if (e === Ci.SrcColorFactor)
  49292. return X.SRC_COLOR;
  49293. if (e === Ci.OneMinusSrcColorFactor)
  49294. return X.ONE_MINUS_SRC_COLOR;
  49295. if (e === Ci.SrcAlphaFactor)
  49296. return X.SRC_ALPHA;
  49297. if (e === Ci.OneMinusSrcAlphaFactor)
  49298. return X.ONE_MINUS_SRC_ALPHA;
  49299. if (e === Ci.DstAlphaFactor)
  49300. return X.DST_ALPHA;
  49301. if (e === Ci.OneMinusDstAlphaFactor)
  49302. return X.ONE_MINUS_DST_ALPHA;
  49303. if (e === Ci.DstColorFactor)
  49304. return X.DST_COLOR;
  49305. if (e === Ci.OneMinusDstColorFactor)
  49306. return X.ONE_MINUS_DST_COLOR;
  49307. if (e === Ci.SrcAlphaSaturateFactor)
  49308. return X.SRC_ALPHA_SATURATE;
  49309. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49310. if (e === Ci.RGB_S3TC_DXT1_Format)
  49311. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49312. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49313. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49314. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49315. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49316. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49317. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49318. }
  49319. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49320. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49321. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49322. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49323. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49324. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49325. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49326. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49327. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49328. }
  49329. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49330. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49331. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49332. if (e === Ci.MinEquation)
  49333. return t.MIN_EXT;
  49334. if (e === Ci.MaxEquation)
  49335. return t.MAX_EXT
  49336. }
  49337. return 0
  49338. }
  49339. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49340. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49341. , L = void 0 !== e.context ? e.context : null
  49342. , D = void 0 !== e.alpha && e.alpha
  49343. , N = void 0 === e.depth || e.depth
  49344. , F = void 0 === e.stencil || e.stencil
  49345. , B = void 0 !== e.antialias && e.antialias
  49346. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49347. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49348. , U = []
  49349. , H = []
  49350. , z = -1
  49351. , G = []
  49352. , W = -1
  49353. , j = new Float32Array(8)
  49354. , Y = []
  49355. , q = [];
  49356. this.domElement = O,
  49357. this.context = null,
  49358. this.autoClear = !0,
  49359. this.autoClearColor = !0,
  49360. this.autoClearDepth = !0,
  49361. this.autoClearStencil = !0,
  49362. this.sortObjects = !0,
  49363. this.gammaFactor = 2,
  49364. this.gammaInput = !1,
  49365. this.gammaOutput = !1,
  49366. this.physicallyCorrectLights = !1,
  49367. this.toneMapping = Ci.LinearToneMapping,
  49368. this.toneMappingExposure = 1,
  49369. this.toneMappingWhitePoint = 1,
  49370. this.maxMorphTargets = 8,
  49371. this.maxMorphNormals = 4,
  49372. this.autoScaleCubemaps = !0;
  49373. 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 = {
  49374. hash: "",
  49375. ambient: [0, 0, 0],
  49376. directional: [],
  49377. directionalShadowMap: [],
  49378. directionalShadowMatrix: [],
  49379. spot: [],
  49380. spotShadowMap: [],
  49381. spotShadowMatrix: [],
  49382. point: [],
  49383. pointShadowMap: [],
  49384. pointShadowMatrix: [],
  49385. hemi: [],
  49386. shadows: [],
  49387. shadowsPointLight: 0
  49388. }, ye = {
  49389. geometries: 0,
  49390. textures: 0
  49391. }, Ae = {
  49392. calls: 0,
  49393. vertices: 0,
  49394. faces: 0,
  49395. points: 0
  49396. };
  49397. this.info = {
  49398. render: Ae,
  49399. memory: ye,
  49400. programs: null
  49401. };
  49402. try {
  49403. var Ce = {
  49404. alpha: D,
  49405. depth: N,
  49406. stencil: F,
  49407. antialias: B,
  49408. premultipliedAlpha: V,
  49409. preserveDrawingBuffer: k
  49410. };
  49411. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49412. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49413. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49414. return {
  49415. rangeMin: 1,
  49416. rangeMax: 1,
  49417. precision: 1
  49418. }
  49419. }
  49420. ),
  49421. O.addEventListener("webglcontextlost", r, !1)
  49422. } catch (e) {
  49423. console.error("THREE.WebGLRenderer: " + e)
  49424. }
  49425. var Ie = new Ci.WebGLExtensions(X);
  49426. Ie.get("OES_texture_float"),
  49427. Ie.get("OES_texture_float_linear"),
  49428. Ie.get("OES_texture_half_float"),
  49429. Ie.get("OES_texture_half_float_linear"),
  49430. Ie.get("OES_standard_derivatives"),
  49431. Ie.get("ANGLE_instanced_arrays"),
  49432. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49433. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49434. , _e = new Ci.WebGLState(X,Ie,x)
  49435. , be = new Ci.WebGLProperties
  49436. , we = new Ci.WebGLObjects(X,be,this.info)
  49437. , Te = new Ci.WebGLPrograms(this,Ee)
  49438. , xe = new Ci.WebGLLights;
  49439. this.info.programs = Te.programs;
  49440. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49441. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49442. t(),
  49443. this.context = X,
  49444. this.capabilities = Ee,
  49445. this.extensions = Ie,
  49446. this.properties = be,
  49447. this.state = _e;
  49448. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49449. this.shadowMap = Re;
  49450. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49451. this.getContext = function() {
  49452. return X
  49453. }
  49454. ,
  49455. this.getContextAttributes = function() {
  49456. return X.getContextAttributes()
  49457. }
  49458. ,
  49459. this.forceContextLoss = function() {
  49460. Ie.get("WEBGL_lose_context").loseContext()
  49461. }
  49462. ,
  49463. this.getMaxAnisotropy = function() {
  49464. if (void 0 !== Pe)
  49465. return Pe;
  49466. var e = Ie.get("EXT_texture_filter_anisotropic");
  49467. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49468. }
  49469. ,
  49470. this.getPrecision = function() {
  49471. return Ee.precision
  49472. }
  49473. ,
  49474. this.getPixelRatio = function() {
  49475. return he
  49476. }
  49477. ,
  49478. this.setPixelRatio = function(e) {
  49479. void 0 !== e && (he = e,
  49480. this.setSize(pe.z, pe.w, !1))
  49481. }
  49482. ,
  49483. this.getSize = function() {
  49484. return {
  49485. width: le,
  49486. height: ce
  49487. }
  49488. }
  49489. ,
  49490. this.setSize = function(e, t, i, n) {
  49491. null != n && (he = n),
  49492. le = e,
  49493. ce = t,
  49494. O.width = e * he,
  49495. O.height = t * he,
  49496. !1 !== i && (O.style.width = e + "px",
  49497. O.style.height = t + "px"),
  49498. this.setViewport(0, 0, e, t)
  49499. }
  49500. ,
  49501. this.setViewport = function(e, t, i, n) {
  49502. _e.viewport(pe.set(e, t, i, n))
  49503. }
  49504. ,
  49505. this.setScissor = function(e, t, i, n) {
  49506. _e.scissor(ue.set(e, t, i, n))
  49507. }
  49508. ,
  49509. this.setScissorTest = function(e) {
  49510. _e.setScissorTest(de = e)
  49511. }
  49512. ,
  49513. this.getClearColor = function() {
  49514. return ae
  49515. }
  49516. ,
  49517. this.setClearColor = function(e, t) {
  49518. ae.set(e),
  49519. se = void 0 !== t ? t : 1,
  49520. i(ae.r, ae.g, ae.b, se)
  49521. }
  49522. ,
  49523. this.getClearAlpha = function() {
  49524. return se
  49525. }
  49526. ,
  49527. this.setClearAlpha = function(e) {
  49528. se = e,
  49529. i(ae.r, ae.g, ae.b, se)
  49530. }
  49531. ,
  49532. this.clear = function(e, t, i) {
  49533. var n = 0;
  49534. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49535. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49536. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49537. X.clear(n)
  49538. }
  49539. ,
  49540. this.clearColor = function() {
  49541. this.clear(!0, !1, !1)
  49542. }
  49543. ,
  49544. this.clearDepth = function() {
  49545. this.clear(!1, !0, !1)
  49546. }
  49547. ,
  49548. this.clearStencil = function() {
  49549. this.clear(!1, !1, !0)
  49550. }
  49551. ,
  49552. this.clearTarget = function(e, t, i, n) {
  49553. this.setRenderTarget(e),
  49554. this.clear(t, i, n)
  49555. }
  49556. ,
  49557. this.resetGLState = n,
  49558. this.dispose = function() {
  49559. O.removeEventListener("webglcontextlost", r, !1)
  49560. }
  49561. ,
  49562. this.renderBufferImmediate = function(e, t, i) {
  49563. _e.initAttributes();
  49564. var n = be.get(e);
  49565. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49566. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49567. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49568. e.hasColors && !n.color && (n.color = X.createBuffer());
  49569. var r = t.getAttributes();
  49570. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49571. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49572. _e.enableAttribute(r.position),
  49573. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49574. e.hasNormals) {
  49575. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49576. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49577. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49578. var s = e.normalArray
  49579. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49580. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49581. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49582. s[o + 0] = l,
  49583. s[o + 1] = c,
  49584. s[o + 2] = h,
  49585. s[o + 3] = l,
  49586. s[o + 4] = c,
  49587. s[o + 5] = h,
  49588. s[o + 6] = l,
  49589. s[o + 7] = c,
  49590. s[o + 8] = h
  49591. }
  49592. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49593. _e.enableAttribute(r.normal),
  49594. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49595. }
  49596. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49597. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49598. _e.enableAttribute(r.uv),
  49599. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49600. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49601. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49602. _e.enableAttribute(r.color),
  49603. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49604. _e.disableUnusedAttributes(),
  49605. X.drawArrays(X.TRIANGLES, 0, e.count),
  49606. e.count = 0
  49607. }
  49608. ,
  49609. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49610. R(n);
  49611. var a = P(e, t, n, r)
  49612. , s = !1
  49613. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49614. l !== ee && (ee = l,
  49615. s = !0);
  49616. var c = r.morphTargetInfluences;
  49617. if (void 0 !== c) {
  49618. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49619. var p = c[u];
  49620. h.push([p, u])
  49621. }
  49622. h.sort(M),
  49623. 8 < h.length && (h.length = 8);
  49624. var f = i.morphAttributes;
  49625. for (u = 0,
  49626. d = h.length; u < d; u++) {
  49627. p = h[u];
  49628. if (j[u] = p[0],
  49629. 0 !== p[0]) {
  49630. var g = p[1];
  49631. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49632. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49633. } else
  49634. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49635. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49636. }
  49637. var m = a.getUniforms();
  49638. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49639. s = !0
  49640. }
  49641. g = i.index;
  49642. var v, y = i.attributes.position;
  49643. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49644. null !== g ? (v = Me).setIndex(g) : v = Se,
  49645. s && (function(e, t, i, n) {
  49646. var r;
  49647. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49648. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49649. else {
  49650. void 0 === n && (n = 0),
  49651. _e.initAttributes();
  49652. var o = i.attributes
  49653. , a = t.getAttributes()
  49654. , s = e.defaultAttributeValues;
  49655. for (var l in a) {
  49656. var c = a[l];
  49657. if (0 <= c) {
  49658. var h = o[l];
  49659. if (void 0 !== h) {
  49660. var u = h.itemSize
  49661. , d = we.getAttributeBuffer(h);
  49662. if (h instanceof Ci.InterleavedBufferAttribute) {
  49663. var p = h.data
  49664. , f = p.stride
  49665. , g = h.offset;
  49666. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49667. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49668. X.bindBuffer(X.ARRAY_BUFFER, d),
  49669. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49670. } else
  49671. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49672. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49673. X.bindBuffer(X.ARRAY_BUFFER, d),
  49674. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49675. } else if (void 0 !== s) {
  49676. var m = s[l];
  49677. if (void 0 !== m)
  49678. switch (m.length) {
  49679. case 2:
  49680. X.vertexAttrib2fv(c, m);
  49681. break;
  49682. case 3:
  49683. X.vertexAttrib3fv(c, m);
  49684. break;
  49685. case 4:
  49686. X.vertexAttrib4fv(c, m);
  49687. break;
  49688. default:
  49689. X.vertexAttrib1fv(c, m)
  49690. }
  49691. }
  49692. }
  49693. }
  49694. _e.disableUnusedAttributes()
  49695. }
  49696. }(n, a, i),
  49697. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49698. var A = 1 / 0;
  49699. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49700. var C = i.drawRange.start
  49701. , I = i.drawRange.count
  49702. , E = null !== o ? o.start : 0
  49703. , _ = null !== o ? o.count : 1 / 0
  49704. , b = Math.max(0, C, E)
  49705. , w = Math.min(0 + A, C + I, E + _) - 1
  49706. , T = Math.max(0, w - b + 1);
  49707. if (r instanceof Ci.Mesh)
  49708. if (!0 === n.wireframe)
  49709. _e.setLineWidth(n.wireframeLinewidth * S()),
  49710. v.setMode(X.LINES);
  49711. else
  49712. switch (r.drawMode) {
  49713. case Ci.TrianglesDrawMode:
  49714. v.setMode(X.TRIANGLES);
  49715. break;
  49716. case Ci.TriangleStripDrawMode:
  49717. v.setMode(X.TRIANGLE_STRIP);
  49718. break;
  49719. case Ci.TriangleFanDrawMode:
  49720. v.setMode(X.TRIANGLE_FAN)
  49721. }
  49722. else if (r instanceof Ci.Line) {
  49723. var x = n.linewidth;
  49724. void 0 === x && (x = 1),
  49725. _e.setLineWidth(x * S()),
  49726. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49727. } else
  49728. r instanceof Ci.Points && v.setMode(X.POINTS);
  49729. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49730. }
  49731. ,
  49732. this.render = function(e, t, i, n) {
  49733. if (t instanceof Ci.Camera != 0) {
  49734. var r = e.fog;
  49735. if (ee = "",
  49736. $ = -1,
  49737. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49738. null === t.parent && t.updateMatrixWorld(),
  49739. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49740. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49741. fe.setFromMatrix(ge),
  49742. U.length = 0,
  49743. W = z = -1,
  49744. Y.length = 0,
  49745. q.length = 0,
  49746. function e(t, i) {
  49747. if (!1 !== t.visible) {
  49748. if (t.layers.test(i.layers))
  49749. if (t instanceof Ci.Light)
  49750. U.push(t);
  49751. else if (t instanceof Ci.Sprite)
  49752. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49753. else if (t instanceof Ci.LensFlare)
  49754. q.push(t);
  49755. else if (t instanceof Ci.ImmediateRenderObject)
  49756. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49757. me.applyProjection(ge)),
  49758. d(t, null, t.material, me.z, null);
  49759. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49760. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49761. var n = t.material;
  49762. if (!0 === n.visible) {
  49763. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49764. me.applyProjection(ge));
  49765. var r = we.update(t);
  49766. if (n instanceof Ci.MultiMaterial)
  49767. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49768. var c = o[s]
  49769. , h = a[c.materialIndex];
  49770. !0 === h.visible && d(t, r, h, me.z, c)
  49771. }
  49772. else
  49773. d(t, r, n, me.z, null)
  49774. }
  49775. }
  49776. var u = t.children;
  49777. for (s = 0,
  49778. l = u.length; s < l; s++)
  49779. e(u[s], i)
  49780. }
  49781. }(e, t),
  49782. H.length = z + 1,
  49783. G.length = W + 1,
  49784. !0 === Z.sortObjects && (H.sort(s),
  49785. G.sort(l)),
  49786. function(e, t) {
  49787. 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;
  49788. for (i = ve.shadowsPointLight = 0,
  49789. n = e.length; i < n; i++)
  49790. if (o = (r = e[i]).color,
  49791. a = r.intensity,
  49792. s = r.distance,
  49793. r instanceof Ci.AmbientLight)
  49794. l += o.r * a,
  49795. c += o.g * a,
  49796. h += o.b * a;
  49797. else if (r instanceof Ci.DirectionalLight) {
  49798. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49799. v.direction.setFromMatrixPosition(r.matrixWorld),
  49800. me.setFromMatrixPosition(r.target.matrixWorld),
  49801. v.direction.sub(me),
  49802. v.direction.transformDirection(u),
  49803. v.shadow = r.castShadow,
  49804. r.castShadow && (v.shadowBias = r.shadow.bias,
  49805. v.shadowRadius = r.shadow.radius,
  49806. v.shadowMapSize = r.shadow.mapSize,
  49807. ve.shadows[m++] = r),
  49808. ve.directionalShadowMap[d] = r.shadow.map,
  49809. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49810. ve.directional[d++] = v
  49811. } else if (r instanceof Ci.SpotLight) {
  49812. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49813. v.position.applyMatrix4(u),
  49814. v.color.copy(o).multiplyScalar(a),
  49815. v.distance = s,
  49816. v.direction.setFromMatrixPosition(r.matrixWorld),
  49817. me.setFromMatrixPosition(r.target.matrixWorld),
  49818. v.direction.sub(me),
  49819. v.direction.transformDirection(u),
  49820. v.coneCos = Math.cos(r.angle),
  49821. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49822. v.decay = 0 === r.distance ? 0 : r.decay,
  49823. v.shadow = r.castShadow,
  49824. r.castShadow && (v.shadowBias = r.shadow.bias,
  49825. v.shadowRadius = r.shadow.radius,
  49826. v.shadowMapSize = r.shadow.mapSize,
  49827. ve.shadows[m++] = r),
  49828. ve.spotShadowMap[f] = r.shadow.map,
  49829. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49830. ve.spot[f++] = v
  49831. } else if (r instanceof Ci.PointLight) {
  49832. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49833. v.position.applyMatrix4(u),
  49834. v.color.copy(r.color).multiplyScalar(r.intensity),
  49835. v.distance = r.distance,
  49836. v.decay = 0 === r.distance ? 0 : r.decay,
  49837. v.shadow = r.castShadow,
  49838. r.castShadow && (v.shadowBias = r.shadow.bias,
  49839. v.shadowRadius = r.shadow.radius,
  49840. v.shadowMapSize = r.shadow.mapSize,
  49841. ve.shadows[m++] = r),
  49842. ve.pointShadowMap[p] = r.shadow.map,
  49843. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49844. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49845. ve.pointShadowMatrix[p].identity().setPosition(me),
  49846. ve.point[p++] = v
  49847. } else if (r instanceof Ci.HemisphereLight) {
  49848. var v;
  49849. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49850. v.direction.transformDirection(u),
  49851. v.direction.normalize(),
  49852. v.skyColor.copy(r.color).multiplyScalar(a),
  49853. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49854. ve.hemi[g++] = v
  49855. }
  49856. ve.ambient[0] = l,
  49857. ve.ambient[1] = c,
  49858. ve.ambient[2] = h,
  49859. ve.directional.length = d,
  49860. ve.spot.length = f,
  49861. ve.point.length = p,
  49862. ve.hemi.length = g,
  49863. ve.shadows.length = m,
  49864. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49865. }(U, t),
  49866. Re.render(e, t),
  49867. Ae.calls = 0,
  49868. Ae.vertices = 0,
  49869. Ae.faces = 0,
  49870. void (Ae.points = 0) === i && (i = null),
  49871. this.setRenderTarget(i),
  49872. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49873. e.overrideMaterial) {
  49874. var o = e.overrideMaterial;
  49875. c(H, t, r, o),
  49876. c(G, t, r, o)
  49877. } else
  49878. _e.setBlending(Ci.NoBlending),
  49879. c(H, t, r),
  49880. c(G, t, r);
  49881. if (Oe.render(e, t),
  49882. Le.render(e, t, re),
  49883. i) {
  49884. var a = i.texture;
  49885. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49886. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49887. , i = be.get(e.texture).__webglTexture;
  49888. _e.bindTexture(t, i),
  49889. X.generateMipmap(t),
  49890. _e.bindTexture(t, null)
  49891. }(i)
  49892. }
  49893. _e.setDepthTest(!0),
  49894. _e.setDepthWrite(!0),
  49895. _e.setColorWrite(!0)
  49896. } else
  49897. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49898. }
  49899. ,
  49900. this.setFaceCulling = function(e, t) {
  49901. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49902. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49903. _e.enable(X.CULL_FACE))
  49904. }
  49905. ,
  49906. this.setTexture = function(e, t) {
  49907. var i = be.get(e);
  49908. if (0 < e.version && i.__version !== e.version) {
  49909. var n = e.image;
  49910. 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)
  49911. }
  49912. _e.activeTexture(X.TEXTURE0 + t),
  49913. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49914. }
  49915. ,
  49916. this.getCurrentRenderTarget = function() {
  49917. return Q
  49918. }
  49919. ,
  49920. this.setRenderTarget = function(e) {
  49921. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49922. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49923. if (e) {
  49924. var n = be.get(e);
  49925. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49926. ie.copy(e.scissor),
  49927. ne = e.scissorTest,
  49928. re.copy(e.viewport)
  49929. } else
  49930. t = null,
  49931. ie.copy(ue).multiplyScalar(he),
  49932. ne = de,
  49933. re.copy(pe).multiplyScalar(he);
  49934. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49935. J = t),
  49936. _e.scissor(ie),
  49937. _e.setScissorTest(ne),
  49938. _e.viewport(re),
  49939. i) {
  49940. var r = be.get(e.texture);
  49941. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49942. }
  49943. }
  49944. ,
  49945. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49946. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49947. var a = be.get(e).__webglFramebuffer;
  49948. if (a) {
  49949. var s = !1;
  49950. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49951. s = !0);
  49952. try {
  49953. var l = e.texture;
  49954. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49955. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49956. 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")))
  49957. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49958. 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.")
  49959. } finally {
  49960. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49961. }
  49962. }
  49963. } else
  49964. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49965. }
  49966. }
  49967. ,
  49968. Ci.WebGLRenderTarget = function(e, t, i) {
  49969. this.uuid = Ci.Math.generateUUID(),
  49970. this.width = e,
  49971. this.height = t,
  49972. this.scissor = new Ci.Vector4(0,0,e,t),
  49973. this.scissorTest = !1,
  49974. this.viewport = new Ci.Vector4(0,0,e,t),
  49975. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49976. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49977. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49978. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49979. }
  49980. ,
  49981. Ci.WebGLRenderTarget.prototype = {
  49982. constructor: Ci.WebGLRenderTarget,
  49983. setSize: function(e, t) {
  49984. this.width === e && this.height === t || (this.width = e,
  49985. this.height = t,
  49986. this.dispose()),
  49987. this.viewport.set(0, 0, e, t),
  49988. this.scissor.set(0, 0, e, t)
  49989. },
  49990. clone: function() {
  49991. return (new this.constructor).copy(this)
  49992. },
  49993. copy: function(e) {
  49994. return this.width = e.width,
  49995. this.height = e.height,
  49996. this.viewport.copy(e.viewport),
  49997. this.texture = e.texture.clone(),
  49998. this.depthBuffer = e.depthBuffer,
  49999. this.stencilBuffer = e.stencilBuffer,
  50000. this
  50001. },
  50002. dispose: function() {
  50003. this.dispatchEvent({
  50004. type: "dispose"
  50005. })
  50006. }
  50007. },
  50008. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50009. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50010. Ci.WebGLRenderTarget.call(this, e, t, i),
  50011. this.activeCubeFace = 0,
  50012. this.activeMipMapLevel = 0
  50013. }
  50014. ,
  50015. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50016. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50017. Ci.WebGLBufferRenderer = function(r, o, a) {
  50018. var s;
  50019. this.setMode = function(e) {
  50020. s = e
  50021. }
  50022. ,
  50023. this.render = function(e, t) {
  50024. r.drawArrays(s, e, t),
  50025. a.calls++,
  50026. a.vertices += t,
  50027. s === r.TRIANGLES && (a.faces += t / 3)
  50028. }
  50029. ,
  50030. this.renderInstances = function(e) {
  50031. var t = o.get("ANGLE_instanced_arrays");
  50032. if (null !== t) {
  50033. var i = e.attributes.position
  50034. , n = 0;
  50035. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50036. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50037. a.calls++,
  50038. a.vertices += n * e.maxInstancedCount,
  50039. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50040. } else
  50041. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50042. }
  50043. }
  50044. ,
  50045. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50046. var s, l, c;
  50047. this.setMode = function(e) {
  50048. s = e
  50049. }
  50050. ,
  50051. this.setIndex = function(e) {
  50052. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50053. 4) : (l = r.UNSIGNED_SHORT,
  50054. 2)
  50055. }
  50056. ,
  50057. this.render = function(e, t) {
  50058. r.drawElements(s, t, l, e * c),
  50059. a.calls++,
  50060. a.vertices += t,
  50061. s === r.TRIANGLES && (a.faces += t / 3)
  50062. }
  50063. ,
  50064. this.renderInstances = function(e, t, i) {
  50065. var n = o.get("ANGLE_instanced_arrays");
  50066. 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),
  50067. a.calls++,
  50068. a.vertices += i * e.maxInstancedCount,
  50069. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50070. }
  50071. }
  50072. ,
  50073. Ci.WebGLExtensions = function(i) {
  50074. var n = {};
  50075. this.get = function(e) {
  50076. if (void 0 !== n[e])
  50077. return n[e];
  50078. var t;
  50079. switch (e) {
  50080. case "EXT_texture_filter_anisotropic":
  50081. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50082. break;
  50083. case "WEBGL_compressed_texture_s3tc":
  50084. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50085. break;
  50086. case "WEBGL_compressed_texture_pvrtc":
  50087. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50088. break;
  50089. case "WEBGL_compressed_texture_etc1":
  50090. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50091. break;
  50092. default:
  50093. t = i.getExtension(e)
  50094. }
  50095. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50096. n[e] = t
  50097. }
  50098. }
  50099. ,
  50100. Ci.WebGLCapabilities = function(t, e, i) {
  50101. function n(e) {
  50102. if ("highp" === e) {
  50103. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50104. return "highp";
  50105. e = "mediump"
  50106. }
  50107. 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"
  50108. }
  50109. this.getMaxPrecision = n,
  50110. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50111. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50112. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50113. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50114. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50115. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50116. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50117. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50118. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50119. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50120. this.vertexTextures = 0 < this.maxVertexTextures,
  50121. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50122. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50123. var r = n(this.precision);
  50124. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50125. this.precision = r),
  50126. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50127. }
  50128. ,
  50129. Ci.WebGLGeometries = function(i, o, a) {
  50130. function s(e) {
  50131. var t = e.target
  50132. , i = c[t.id];
  50133. null !== i.index && l(i.index),
  50134. function(e) {
  50135. for (var t in e)
  50136. l(e[t])
  50137. }(i.attributes),
  50138. t.removeEventListener("dispose", s),
  50139. delete c[t.id];
  50140. var n = o.get(t);
  50141. n.wireframe && l(n.wireframe),
  50142. o.delete(t);
  50143. var r = o.get(i);
  50144. r.wireframe && l(r.wireframe),
  50145. o.delete(i),
  50146. a.memory.geometries--
  50147. }
  50148. function l(e) {
  50149. var t = function(e) {
  50150. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50151. }(e);
  50152. void 0 !== t && (i.deleteBuffer(t),
  50153. function(e) {
  50154. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50155. }(e))
  50156. }
  50157. var c = {};
  50158. this.get = function(e) {
  50159. var t, i = e.geometry;
  50160. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50161. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50162. t = i._bufferGeometry),
  50163. c[i.id] = t,
  50164. a.memory.geometries++,
  50165. t)
  50166. }
  50167. }
  50168. ,
  50169. Ci.WebGLLights = function() {
  50170. var i = {};
  50171. this.get = function(e) {
  50172. if (void 0 !== i[e.id])
  50173. return i[e.id];
  50174. var t;
  50175. switch (e.type) {
  50176. case "DirectionalLight":
  50177. t = {
  50178. direction: new Ci.Vector3,
  50179. color: new Ci.Color,
  50180. shadow: !1,
  50181. shadowBias: 0,
  50182. shadowRadius: 1,
  50183. shadowMapSize: new Ci.Vector2
  50184. };
  50185. break;
  50186. case "SpotLight":
  50187. t = {
  50188. position: new Ci.Vector3,
  50189. direction: new Ci.Vector3,
  50190. color: new Ci.Color,
  50191. distance: 0,
  50192. coneCos: 0,
  50193. penumbraCos: 0,
  50194. decay: 0,
  50195. shadow: !1,
  50196. shadowBias: 0,
  50197. shadowRadius: 1,
  50198. shadowMapSize: new Ci.Vector2
  50199. };
  50200. break;
  50201. case "PointLight":
  50202. t = {
  50203. position: new Ci.Vector3,
  50204. color: new Ci.Color,
  50205. distance: 0,
  50206. decay: 0,
  50207. shadow: !1,
  50208. shadowBias: 0,
  50209. shadowRadius: 1,
  50210. shadowMapSize: new Ci.Vector2
  50211. };
  50212. break;
  50213. case "HemisphereLight":
  50214. t = {
  50215. direction: new Ci.Vector3,
  50216. skyColor: new Ci.Color,
  50217. groundColor: new Ci.Color
  50218. }
  50219. }
  50220. return i[e.id] = t
  50221. }
  50222. }
  50223. ,
  50224. Ci.WebGLObjects = function(g, m, e) {
  50225. function v(e, t) {
  50226. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50227. , n = m.get(i);
  50228. void 0 === n.__webglBuffer ? function(e, t, i) {
  50229. e.__webglBuffer = g.createBuffer(),
  50230. g.bindBuffer(i, e.__webglBuffer);
  50231. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50232. g.bufferData(i, t.array, n),
  50233. e.version = t.version
  50234. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50235. g.bindBuffer(i, e.__webglBuffer),
  50236. !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)),
  50237. t.updateRange.count = 0),
  50238. e.version = t.version
  50239. }(n, i, t)
  50240. }
  50241. function y(e, t, i) {
  50242. if (i < t) {
  50243. var n = t;
  50244. t = i,
  50245. i = n
  50246. }
  50247. var r = e[t];
  50248. return void 0 === r ? (e[t] = [i],
  50249. !0) : -1 === r.indexOf(i) && (r.push(i),
  50250. !0)
  50251. }
  50252. var c = new Ci.WebGLGeometries(g,m,e);
  50253. this.getAttributeBuffer = function(e) {
  50254. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50255. }
  50256. ,
  50257. this.getWireframeAttribute = function(e) {
  50258. var t = m.get(e);
  50259. if (void 0 !== t.wireframe)
  50260. return t.wireframe;
  50261. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50262. if (null !== r)
  50263. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50264. var h = i[l + 0]
  50265. , u = i[l + 1]
  50266. , d = i[l + 2];
  50267. y(s, h, u) && n.push(h, u),
  50268. y(s, u, d) && n.push(u, d),
  50269. y(s, d, h) && n.push(d, h)
  50270. }
  50271. else
  50272. for (l = 0,
  50273. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50274. h = l + 0,
  50275. u = l + 1,
  50276. d = l + 2;
  50277. n.push(h, u, u, d, d, h)
  50278. }
  50279. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50280. , f = new Ci.BufferAttribute(new p(n),1);
  50281. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50282. t.wireframe = f
  50283. }
  50284. ,
  50285. this.update = function(e) {
  50286. var t = c.get(e);
  50287. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50288. var i = t.index
  50289. , n = t.attributes;
  50290. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50291. n)
  50292. v(n[r], g.ARRAY_BUFFER);
  50293. var o = t.morphAttributes;
  50294. for (var r in o)
  50295. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50296. v(a[s], g.ARRAY_BUFFER);
  50297. return t
  50298. }
  50299. }
  50300. ,
  50301. Ci.WebGLProgram = (Qt = 0,
  50302. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50303. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50304. ei = /^([\w\d_]+)\[0\]$/,
  50305. function(e, t, i, n) {
  50306. var r = e.context
  50307. , o = i.extensions
  50308. , a = i.defines
  50309. , s = i.__webglShader.vertexShader
  50310. , l = i.__webglShader.fragmentShader
  50311. , c = "SHADOWMAP_TYPE_BASIC";
  50312. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50313. var h = "ENVMAP_TYPE_CUBE"
  50314. , u = "ENVMAP_MODE_REFLECTION"
  50315. , d = "ENVMAP_BLENDING_MULTIPLY";
  50316. if (n.envMap) {
  50317. switch (i.envMap.mapping) {
  50318. case Ci.CubeReflectionMapping:
  50319. case Ci.CubeRefractionMapping:
  50320. h = "ENVMAP_TYPE_CUBE";
  50321. break;
  50322. case Ci.CubeUVReflectionMapping:
  50323. case Ci.CubeUVRefractionMapping:
  50324. h = "ENVMAP_TYPE_CUBE_UV";
  50325. break;
  50326. case Ci.EquirectangularReflectionMapping:
  50327. case Ci.EquirectangularRefractionMapping:
  50328. h = "ENVMAP_TYPE_EQUIREC";
  50329. break;
  50330. case Ci.SphericalReflectionMapping:
  50331. h = "ENVMAP_TYPE_SPHERE"
  50332. }
  50333. switch (i.envMap.mapping) {
  50334. case Ci.CubeRefractionMapping:
  50335. case Ci.EquirectangularRefractionMapping:
  50336. u = "ENVMAP_MODE_REFRACTION"
  50337. }
  50338. switch (i.combine) {
  50339. case Ci.MultiplyOperation:
  50340. d = "ENVMAP_BLENDING_MULTIPLY";
  50341. break;
  50342. case Ci.MixOperation:
  50343. d = "ENVMAP_BLENDING_MIX";
  50344. break;
  50345. case Ci.AddOperation:
  50346. d = "ENVMAP_BLENDING_ADD"
  50347. }
  50348. }
  50349. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50350. 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")
  50351. }(o, n, e.extensions), v = function(e) {
  50352. var t = [];
  50353. for (var i in e) {
  50354. var n = e[i];
  50355. !1 !== n && t.push("#define " + i + " " + n)
  50356. }
  50357. return t.join("\n")
  50358. }(a), y = r.createProgram();
  50359. 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"),
  50360. [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) {
  50361. var i;
  50362. switch (t) {
  50363. case Ci.LinearToneMapping:
  50364. i = "Linear";
  50365. break;
  50366. case Ci.ReinhardToneMapping:
  50367. i = "Reinhard";
  50368. break;
  50369. case Ci.Uncharted2ToneMapping:
  50370. i = "Uncharted2";
  50371. break;
  50372. case Ci.CineonToneMapping:
  50373. i = "OptimizedCineon";
  50374. break;
  50375. default:
  50376. throw new Error("unsupported toneMapping: " + t)
  50377. }
  50378. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50379. }("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) {
  50380. var i = Mi(t);
  50381. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50382. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50383. s = Oi(s = Li(s), n),
  50384. l = Oi(l = Li(l), n),
  50385. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50386. l = Di(l));
  50387. var A = p + s
  50388. , C = f + l
  50389. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50390. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50391. r.attachShader(y, I),
  50392. r.attachShader(y, E),
  50393. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50394. r.linkProgram(y);
  50395. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50396. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50397. 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),
  50398. M && (this.diagnostics = {
  50399. runnable: S,
  50400. material: i,
  50401. programLog: w,
  50402. vertexShader: {
  50403. log: T,
  50404. prefix: p
  50405. },
  50406. fragmentShader: {
  50407. log: x,
  50408. prefix: f
  50409. }
  50410. }),
  50411. r.deleteShader(I),
  50412. r.deleteShader(E),
  50413. this.getUniforms = function() {
  50414. return void 0 === _ && (_ = function(e, t) {
  50415. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50416. var o = e.getActiveUniform(t, r).name
  50417. , a = e.getUniformLocation(t, o)
  50418. , s = Jt.exec(o);
  50419. if (s) {
  50420. var l = s[1]
  50421. , c = s[2]
  50422. , h = i[l];
  50423. (h = h || (i[l] = {}))[c] = a
  50424. } else if (s = $t.exec(o)) {
  50425. var u = s[1]
  50426. , d = s[2]
  50427. , p = s[3]
  50428. , f = i[u]
  50429. , g = (f = f || (i[u] = []))[d];
  50430. (g = g || (f[d] = {}))[p] = a
  50431. } else
  50432. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50433. }
  50434. return i
  50435. }(r, y)),
  50436. _
  50437. }
  50438. ,
  50439. this.getAttributes = function() {
  50440. return void 0 === b && (b = function(e, t) {
  50441. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50442. var o = e.getActiveAttrib(t, r).name;
  50443. i[o] = e.getAttribLocation(t, o)
  50444. }
  50445. return i
  50446. }(r, y)),
  50447. b
  50448. }
  50449. ,
  50450. this.destroy = function() {
  50451. r.deleteProgram(y),
  50452. this.program = void 0
  50453. }
  50454. ,
  50455. Object.defineProperties(this, {
  50456. uniforms: {
  50457. get: function() {
  50458. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50459. this.getUniforms()
  50460. }
  50461. },
  50462. attributes: {
  50463. get: function() {
  50464. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50465. this.getAttributes()
  50466. }
  50467. }
  50468. }),
  50469. this.id = Qt++,
  50470. this.code = t,
  50471. this.usedTimes = 1,
  50472. this.program = y,
  50473. this.vertexShader = I,
  50474. this.fragmentShader = E,
  50475. this
  50476. }
  50477. ),
  50478. Ci.WebGLPrograms = function(s, l) {
  50479. function c(e, t) {
  50480. var i;
  50481. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50482. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50483. i
  50484. }
  50485. var h = []
  50486. , u = {
  50487. MeshDepthMaterial: "depth",
  50488. MeshNormalMaterial: "normal",
  50489. MeshBasicMaterial: "basic",
  50490. MeshLambertMaterial: "lambert",
  50491. MeshPhongMaterial: "phong",
  50492. MeshStandardMaterial: "standard",
  50493. LineBasicMaterial: "basic",
  50494. LineDashedMaterial: "dashed",
  50495. PointsMaterial: "points"
  50496. }
  50497. , 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"];
  50498. this.getParameters = function(e, t, i, n) {
  50499. var r = u[e.type]
  50500. , o = function(e) {
  50501. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50502. return 1024;
  50503. var t = l.maxVertexUniforms
  50504. , i = Math.floor((t - 20) / 4);
  50505. 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)")),
  50506. i
  50507. }(n)
  50508. , a = s.getPrecision();
  50509. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50510. {
  50511. shaderID: r,
  50512. precision: a,
  50513. supportsVertexTextures: l.vertexTextures,
  50514. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50515. map: !!e.map,
  50516. mapEncoding: c(e.map, s.gammaInput),
  50517. envMap: !!e.envMap,
  50518. envMapMode: e.envMap && e.envMap.mapping,
  50519. envMapEncoding: c(e.envMap, s.gammaInput),
  50520. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50521. lightMap: !!e.lightMap,
  50522. aoMap: !!e.aoMap,
  50523. emissiveMap: !!e.emissiveMap,
  50524. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50525. bumpMap: !!e.bumpMap,
  50526. normalMap: !!e.normalMap,
  50527. displacementMap: !!e.displacementMap,
  50528. roughnessMap: !!e.roughnessMap,
  50529. metalnessMap: !!e.metalnessMap,
  50530. specularMap: !!e.specularMap,
  50531. alphaMap: !!e.alphaMap,
  50532. combine: e.combine,
  50533. vertexColors: e.vertexColors,
  50534. fog: i,
  50535. useFog: e.fog,
  50536. fogExp: i instanceof Ci.FogExp2,
  50537. flatShading: e.shading === Ci.FlatShading,
  50538. sizeAttenuation: e.sizeAttenuation,
  50539. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50540. skinning: e.skinning,
  50541. maxBones: o,
  50542. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50543. morphTargets: e.morphTargets,
  50544. morphNormals: e.morphNormals,
  50545. maxMorphTargets: s.maxMorphTargets,
  50546. maxMorphNormals: s.maxMorphNormals,
  50547. numDirLights: t.directional.length,
  50548. numPointLights: t.point.length,
  50549. numSpotLights: t.spot.length,
  50550. numHemiLights: t.hemi.length,
  50551. pointLightShadows: t.shadowsPointLight,
  50552. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50553. shadowMapType: s.shadowMap.type,
  50554. toneMapping: s.toneMapping,
  50555. physicallyCorrectLights: s.physicallyCorrectLights,
  50556. premultipliedAlpha: e.premultipliedAlpha,
  50557. alphaTest: e.alphaTest,
  50558. doubleSided: e.side === Ci.DoubleSide,
  50559. flipSided: e.side === Ci.BackSide
  50560. }
  50561. }
  50562. ,
  50563. this.getProgramCode = function(e, t) {
  50564. var i = [];
  50565. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50566. i.push(e.vertexShader)),
  50567. void 0 !== e.defines)
  50568. for (var n in e.defines)
  50569. i.push(n),
  50570. i.push(e.defines[n]);
  50571. for (var r = 0; r < a.length; r++) {
  50572. var o = a[r];
  50573. i.push(o),
  50574. i.push(t[o])
  50575. }
  50576. return i.join()
  50577. }
  50578. ,
  50579. this.acquireProgram = function(e, t, i) {
  50580. for (var n, r = 0, o = h.length; r < o; r++) {
  50581. var a = h[r];
  50582. if (a.code === i) {
  50583. ++(n = a).usedTimes;
  50584. break
  50585. }
  50586. }
  50587. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50588. h.push(n)),
  50589. n
  50590. }
  50591. ,
  50592. this.releaseProgram = function(e) {
  50593. if (0 == --e.usedTimes) {
  50594. var t = h.indexOf(e);
  50595. h[t] = h[h.length - 1],
  50596. h.pop(),
  50597. e.destroy()
  50598. }
  50599. }
  50600. ,
  50601. this.programs = h
  50602. }
  50603. ,
  50604. Ci.WebGLProperties = function() {
  50605. var n = {};
  50606. this.get = function(e) {
  50607. var t = e.uuid
  50608. , i = n[t];
  50609. return void 0 === i && (i = {},
  50610. n[t] = i),
  50611. i
  50612. }
  50613. ,
  50614. this.delete = function(e) {
  50615. delete n[e.uuid]
  50616. }
  50617. ,
  50618. this.clear = function() {
  50619. n = {}
  50620. }
  50621. }
  50622. ,
  50623. Ci.WebGLShader = function(e, t, i) {
  50624. var n = e.createShader(t);
  50625. return e.shaderSource(n, i),
  50626. e.compileShader(n),
  50627. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50628. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50629. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50630. t[i] = i + 1 + ": " + t[i];
  50631. return t.join("\n")
  50632. }(i)),
  50633. n
  50634. }
  50635. ,
  50636. Ci.WebGLShadowMap = function(P, O, L) {
  50637. function D(e, t, i, n) {
  50638. var r = e.geometry
  50639. , o = null
  50640. , a = p
  50641. , s = e.customDepthMaterial;
  50642. if (i && (a = f,
  50643. s = e.customDistanceMaterial),
  50644. s)
  50645. o = s;
  50646. else {
  50647. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50648. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50649. , h = 0;
  50650. l && (h |= u),
  50651. c && (h |= d),
  50652. o = a[h]
  50653. }
  50654. return o.visible = t.visible,
  50655. o.wireframe = t.wireframe,
  50656. o.wireframeLinewidth = t.wireframeLinewidth,
  50657. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50658. o
  50659. }
  50660. function N(e, t, i) {
  50661. if (!1 !== e.visible) {
  50662. 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)))
  50663. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50664. G.push(e));
  50665. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50666. N(n[r], t, i)
  50667. }
  50668. }
  50669. 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) {
  50670. var a = 0 != (o & u)
  50671. , s = 0 != (o & d)
  50672. , l = new Ci.ShaderMaterial({
  50673. uniforms: i,
  50674. vertexShader: t.vertexShader,
  50675. fragmentShader: t.fragmentShader,
  50676. morphTargets: a,
  50677. skinning: s
  50678. });
  50679. p[o] = l;
  50680. var c = new Ci.ShaderMaterial({
  50681. defines: {
  50682. USE_SHADOWMAP: ""
  50683. },
  50684. uniforms: r,
  50685. vertexShader: n.vertexShader,
  50686. fragmentShader: n.fragmentShader,
  50687. morphTargets: a,
  50688. skinning: s
  50689. });
  50690. f[o] = c
  50691. }
  50692. var q = this;
  50693. this.enabled = !1,
  50694. this.autoUpdate = !0,
  50695. this.needsUpdate = !1,
  50696. this.type = Ci.PCFShadowMap,
  50697. this.cullFace = Ci.CullFaceFront,
  50698. this.render = function(e, t) {
  50699. var i, n, r = O.shadows;
  50700. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50701. B.clearColor(1, 1, 1, 1),
  50702. B.disable(F.BLEND),
  50703. B.enable(F.CULL_FACE),
  50704. F.frontFace(F.CCW),
  50705. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50706. B.setDepthTest(!0),
  50707. B.setScissorTest(!1);
  50708. for (var o = 0, a = r.length; o < a; o++) {
  50709. var s = r[o]
  50710. , l = s.shadow
  50711. , c = l.camera;
  50712. if (U.copy(l.mapSize),
  50713. s instanceof Ci.PointLight) {
  50714. i = 6,
  50715. n = !0;
  50716. var h = U.x
  50717. , u = U.y;
  50718. Y[0].set(2 * h, u, h, u),
  50719. Y[1].set(0, u, h, u),
  50720. Y[2].set(3 * h, u, h, u),
  50721. Y[3].set(h, u, h, u),
  50722. Y[4].set(3 * h, 0, h, u),
  50723. Y[5].set(h, 0, h, u),
  50724. U.x *= 4,
  50725. U.y *= 2
  50726. } else
  50727. n = !(i = 1);
  50728. if (null === l.map) {
  50729. var d = {
  50730. minFilter: Ci.NearestFilter,
  50731. magFilter: Ci.NearestFilter,
  50732. format: Ci.RGBAFormat
  50733. };
  50734. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50735. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50736. c.updateProjectionMatrix()
  50737. }
  50738. var p = l.map
  50739. , f = l.matrix;
  50740. z.setFromMatrixPosition(s.matrixWorld),
  50741. c.position.copy(z),
  50742. P.setRenderTarget(p),
  50743. P.clear();
  50744. for (var g = 0; g < i; g++) {
  50745. if (n) {
  50746. H.copy(c.position),
  50747. H.add(W[g]),
  50748. c.up.copy(j[g]),
  50749. c.lookAt(H);
  50750. var m = Y[g];
  50751. B.viewport(m)
  50752. } else
  50753. H.setFromMatrixPosition(s.target.matrixWorld),
  50754. c.lookAt(H);
  50755. c.updateMatrixWorld(),
  50756. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50757. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50758. f.multiply(c.projectionMatrix),
  50759. f.multiply(c.matrixWorldInverse),
  50760. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50761. V.setFromMatrix(k),
  50762. G.length = 0,
  50763. N(e, t, c);
  50764. for (var v = 0, y = G.length; v < y; v++) {
  50765. var A = G[v]
  50766. , C = L.update(A)
  50767. , I = A.material;
  50768. if (I instanceof Ci.MultiMaterial)
  50769. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50770. var T = E[b]
  50771. , x = _[T.materialIndex];
  50772. if (!0 === x.visible) {
  50773. var S = D(A, x, n, z);
  50774. P.renderBufferDirect(c, null, C, S, A, T)
  50775. }
  50776. }
  50777. else {
  50778. S = D(A, I, n, z);
  50779. P.renderBufferDirect(c, null, C, S, A, null)
  50780. }
  50781. }
  50782. }
  50783. }
  50784. var M = P.getClearColor()
  50785. , R = P.getClearAlpha();
  50786. P.setClearColor(M, R),
  50787. B.enable(F.BLEND),
  50788. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50789. q.needsUpdate = !1
  50790. }
  50791. }
  50792. }
  50793. ,
  50794. Ci.WebGLState = function(l, i, c) {
  50795. var n = this
  50796. , r = new Ci.Vector4
  50797. , o = new Uint8Array(16)
  50798. , a = new Uint8Array(16)
  50799. , s = new Uint8Array(16)
  50800. , t = {}
  50801. , h = null
  50802. , u = null
  50803. , d = null
  50804. , p = null
  50805. , f = null
  50806. , g = null
  50807. , m = null
  50808. , v = null
  50809. , y = !1
  50810. , A = null
  50811. , C = null
  50812. , I = null
  50813. , E = null
  50814. , _ = null
  50815. , b = null
  50816. , w = null
  50817. , T = null
  50818. , x = null
  50819. , S = null
  50820. , M = null
  50821. , R = null
  50822. , P = null
  50823. , O = null
  50824. , L = null
  50825. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50826. , N = void 0
  50827. , F = {}
  50828. , B = new Ci.Vector4
  50829. , V = null
  50830. , k = null
  50831. , U = new Ci.Vector4
  50832. , H = new Ci.Vector4
  50833. , z = l.createTexture();
  50834. l.bindTexture(l.TEXTURE_2D, z),
  50835. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50836. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50837. this.init = function() {
  50838. this.clearColor(0, 0, 0, 1),
  50839. this.clearDepth(1),
  50840. this.clearStencil(0),
  50841. this.enable(l.DEPTH_TEST),
  50842. l.depthFunc(l.LEQUAL),
  50843. l.frontFace(l.CCW),
  50844. l.cullFace(l.BACK),
  50845. this.enable(l.CULL_FACE),
  50846. this.enable(l.BLEND),
  50847. l.blendEquation(l.FUNC_ADD),
  50848. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50849. }
  50850. ,
  50851. this.initAttributes = function() {
  50852. for (var e = 0, t = o.length; e < t; e++)
  50853. o[e] = 0
  50854. }
  50855. ,
  50856. this.enableAttribute = function(e) {
  50857. o[e] = 1,
  50858. 0 === a[e] && (l.enableVertexAttribArray(e),
  50859. a[e] = 1),
  50860. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50861. s[e] = 0)
  50862. }
  50863. ,
  50864. this.enableAttributeAndDivisor = function(e, t, i) {
  50865. o[e] = 1,
  50866. 0 === a[e] && (l.enableVertexAttribArray(e),
  50867. a[e] = 1),
  50868. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50869. s[e] = t)
  50870. }
  50871. ,
  50872. this.disableUnusedAttributes = function() {
  50873. for (var e = 0, t = a.length; e < t; e++)
  50874. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50875. a[e] = 0)
  50876. }
  50877. ,
  50878. this.enable = function(e) {
  50879. !0 !== t[e] && (l.enable(e),
  50880. t[e] = !0)
  50881. }
  50882. ,
  50883. this.disable = function(e) {
  50884. !1 !== t[e] && (l.disable(e),
  50885. t[e] = !1)
  50886. }
  50887. ,
  50888. this.getCompressedTextureFormats = function() {
  50889. if (null === h && (h = [],
  50890. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50891. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50892. h.push(e[t]);
  50893. return h
  50894. }
  50895. ,
  50896. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50897. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50898. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50899. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50900. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50901. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50902. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50903. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50904. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50905. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50906. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50907. u = e,
  50908. y = s),
  50909. e === Ci.CustomBlending ? (r = r || t,
  50910. o = o || i,
  50911. a = a || n,
  50912. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50913. d = t,
  50914. g = r),
  50915. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50916. p = i,
  50917. f = n,
  50918. m = o,
  50919. v = a)) : v = m = g = f = p = d = null
  50920. }
  50921. ,
  50922. this.setDepthFunc = function(e) {
  50923. if (A !== e) {
  50924. if (e)
  50925. switch (e) {
  50926. case Ci.NeverDepth:
  50927. l.depthFunc(l.NEVER);
  50928. break;
  50929. case Ci.AlwaysDepth:
  50930. l.depthFunc(l.ALWAYS);
  50931. break;
  50932. case Ci.LessDepth:
  50933. l.depthFunc(l.LESS);
  50934. break;
  50935. case Ci.LessEqualDepth:
  50936. l.depthFunc(l.LEQUAL);
  50937. break;
  50938. case Ci.EqualDepth:
  50939. l.depthFunc(l.EQUAL);
  50940. break;
  50941. case Ci.GreaterEqualDepth:
  50942. l.depthFunc(l.GEQUAL);
  50943. break;
  50944. case Ci.GreaterDepth:
  50945. l.depthFunc(l.GREATER);
  50946. break;
  50947. case Ci.NotEqualDepth:
  50948. l.depthFunc(l.NOTEQUAL);
  50949. break;
  50950. default:
  50951. l.depthFunc(l.LEQUAL)
  50952. }
  50953. else
  50954. l.depthFunc(l.LEQUAL);
  50955. A = e
  50956. }
  50957. }
  50958. ,
  50959. this.setDepthTest = function(e) {
  50960. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50961. }
  50962. ,
  50963. this.setDepthWrite = function(e) {
  50964. C !== e && (l.depthMask(e),
  50965. C = e)
  50966. }
  50967. ,
  50968. this.setColorWrite = function(e) {
  50969. I !== e && (l.colorMask(e, e, e, e),
  50970. I = e)
  50971. }
  50972. ,
  50973. this.setStencilFunc = function(e, t, i) {
  50974. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50975. _ = e,
  50976. b = t,
  50977. w = i)
  50978. }
  50979. ,
  50980. this.setStencilOp = function(e, t, i) {
  50981. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50982. T = e,
  50983. x = t,
  50984. S = i)
  50985. }
  50986. ,
  50987. this.setStencilTest = function(e) {
  50988. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50989. }
  50990. ,
  50991. this.setStencilWrite = function(e) {
  50992. E !== e && (l.stencilMask(e),
  50993. E = e)
  50994. }
  50995. ,
  50996. this.setFlipSided = function(e) {
  50997. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50998. M = e)
  50999. }
  51000. ,
  51001. this.setLineWidth = function(e) {
  51002. e !== R && (l.lineWidth(e),
  51003. R = e)
  51004. }
  51005. ,
  51006. this.setPolygonOffset = function(e, t, i) {
  51007. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51008. !e || P === t && O === i || (l.polygonOffset(t, i),
  51009. P = t,
  51010. O = i)
  51011. }
  51012. ,
  51013. this.getScissorTest = function() {
  51014. return L
  51015. }
  51016. ,
  51017. this.setScissorTest = function(e) {
  51018. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51019. }
  51020. ,
  51021. this.activeTexture = function(e) {
  51022. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51023. N !== e && (l.activeTexture(e),
  51024. N = e)
  51025. }
  51026. ,
  51027. this.bindTexture = function(e, t) {
  51028. void 0 === N && n.activeTexture();
  51029. var i = F[N];
  51030. void 0 === i && (i = {
  51031. type: void 0,
  51032. texture: void 0
  51033. },
  51034. F[N] = i),
  51035. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51036. i.type = e,
  51037. i.texture = t)
  51038. }
  51039. ,
  51040. this.compressedTexImage2D = function() {
  51041. try {
  51042. l.compressedTexImage2D.apply(l, arguments)
  51043. } catch (e) {
  51044. console.error(e)
  51045. }
  51046. }
  51047. ,
  51048. this.texImage2D = function() {
  51049. try {
  51050. l.texImage2D.apply(l, arguments)
  51051. } catch (e) {
  51052. console.error(e)
  51053. }
  51054. }
  51055. ,
  51056. this.clearColor = function(e, t, i, n) {
  51057. r.set(e, t, i, n),
  51058. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51059. B.copy(r))
  51060. }
  51061. ,
  51062. this.clearDepth = function(e) {
  51063. V !== e && (l.clearDepth(e),
  51064. V = e)
  51065. }
  51066. ,
  51067. this.clearStencil = function(e) {
  51068. k !== e && (l.clearStencil(e),
  51069. k = e)
  51070. }
  51071. ,
  51072. this.scissor = function(e) {
  51073. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51074. U.copy(e))
  51075. }
  51076. ,
  51077. this.viewport = function(e) {
  51078. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51079. H.copy(e))
  51080. }
  51081. ,
  51082. this.reset = function() {
  51083. for (var e = 0; e < a.length; e++)
  51084. 1 === a[e] && (l.disableVertexAttribArray(e),
  51085. a[e] = 0);
  51086. t = {},
  51087. N = void 0,
  51088. F = {},
  51089. M = E = C = I = u = h = null
  51090. }
  51091. }
  51092. ,
  51093. Ci.LensFlarePlugin = function(v, y) {
  51094. function A() {
  51095. 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]);
  51096. C = S.createBuffer(),
  51097. I = S.createBuffer(),
  51098. S.bindBuffer(S.ARRAY_BUFFER, C),
  51099. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51100. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51101. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51102. T = S.createTexture(),
  51103. x = S.createTexture(),
  51104. M.bindTexture(S.TEXTURE_2D, T),
  51105. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51106. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51107. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51108. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51109. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51110. M.bindTexture(S.TEXTURE_2D, x),
  51111. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51112. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51113. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51114. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51115. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51116. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51117. 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"),
  51118. 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")
  51119. } : {
  51120. 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"),
  51121. 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")
  51122. },
  51123. E = function(e) {
  51124. var t = S.createProgram()
  51125. , i = S.createShader(S.FRAGMENT_SHADER)
  51126. , n = S.createShader(S.VERTEX_SHADER)
  51127. , r = "precision " + v.getPrecision() + " float;\n";
  51128. return S.shaderSource(i, r + e.fragmentShader),
  51129. S.shaderSource(n, r + e.vertexShader),
  51130. S.compileShader(i),
  51131. S.compileShader(n),
  51132. S.attachShader(t, i),
  51133. S.attachShader(t, n),
  51134. S.linkProgram(t),
  51135. t
  51136. }(e),
  51137. _ = {
  51138. vertex: S.getAttribLocation(E, "position"),
  51139. uv: S.getAttribLocation(E, "uv")
  51140. },
  51141. b = {
  51142. renderType: S.getUniformLocation(E, "renderType"),
  51143. map: S.getUniformLocation(E, "map"),
  51144. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51145. opacity: S.getUniformLocation(E, "opacity"),
  51146. color: S.getUniformLocation(E, "color"),
  51147. scale: S.getUniformLocation(E, "scale"),
  51148. rotation: S.getUniformLocation(E, "rotation"),
  51149. screenPosition: S.getUniformLocation(E, "screenPosition")
  51150. }
  51151. }
  51152. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51153. this.render = function(e, t, i) {
  51154. if (0 !== y.length) {
  51155. var n = new Ci.Vector3
  51156. , r = i.w / i.z
  51157. , o = .5 * i.z
  51158. , a = .5 * i.w
  51159. , s = 16 / i.w
  51160. , l = new Ci.Vector2(s * r,s)
  51161. , c = new Ci.Vector3(1,1,0)
  51162. , h = new Ci.Vector2(1,1);
  51163. void 0 === E && A(),
  51164. S.useProgram(E),
  51165. M.initAttributes(),
  51166. M.enableAttribute(_.vertex),
  51167. M.enableAttribute(_.uv),
  51168. M.disableUnusedAttributes(),
  51169. S.uniform1i(b.occlusionMap, 0),
  51170. S.uniform1i(b.map, 1),
  51171. S.bindBuffer(S.ARRAY_BUFFER, C),
  51172. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51173. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51174. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51175. M.disable(S.CULL_FACE),
  51176. M.setDepthWrite(!1);
  51177. for (var u = 0, d = y.length; u < d; u++) {
  51178. s = 16 / i.w,
  51179. l.set(s * r, s);
  51180. var p = y[u];
  51181. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51182. n.applyMatrix4(t.matrixWorldInverse),
  51183. n.applyProjection(t.projectionMatrix),
  51184. c.copy(n),
  51185. h.x = c.x * o + o,
  51186. h.y = c.y * a + a,
  51187. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51188. M.activeTexture(S.TEXTURE0),
  51189. M.bindTexture(S.TEXTURE_2D, null),
  51190. M.activeTexture(S.TEXTURE1),
  51191. M.bindTexture(S.TEXTURE_2D, T),
  51192. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51193. S.uniform1i(b.renderType, 0),
  51194. S.uniform2f(b.scale, l.x, l.y),
  51195. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51196. M.disable(S.BLEND),
  51197. M.enable(S.DEPTH_TEST),
  51198. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51199. M.activeTexture(S.TEXTURE0),
  51200. M.bindTexture(S.TEXTURE_2D, x),
  51201. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51202. S.uniform1i(b.renderType, 1),
  51203. M.disable(S.DEPTH_TEST),
  51204. M.activeTexture(S.TEXTURE1),
  51205. M.bindTexture(S.TEXTURE_2D, T),
  51206. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51207. p.positionScreen.copy(c),
  51208. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51209. S.uniform1i(b.renderType, 2),
  51210. M.enable(S.BLEND);
  51211. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51212. var m = p.lensFlares[f];
  51213. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51214. c.y = m.y,
  51215. c.z = m.z,
  51216. s = m.size * m.scale / i.w,
  51217. l.x = s * r,
  51218. l.y = s,
  51219. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51220. S.uniform2f(b.scale, l.x, l.y),
  51221. S.uniform1f(b.rotation, m.rotation),
  51222. S.uniform1f(b.opacity, m.opacity),
  51223. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51224. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51225. v.setTexture(m.texture, 1),
  51226. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51227. }
  51228. }
  51229. }
  51230. M.enable(S.CULL_FACE),
  51231. M.enable(S.DEPTH_TEST),
  51232. M.setDepthWrite(!0),
  51233. v.resetGLState()
  51234. }
  51235. }
  51236. }
  51237. ,
  51238. Ci.SpritePlugin = function(u, d) {
  51239. function p() {
  51240. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51241. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51242. g = I.createBuffer(),
  51243. m = I.createBuffer(),
  51244. I.bindBuffer(I.ARRAY_BUFFER, g),
  51245. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51246. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51247. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51248. v = function() {
  51249. var e = I.createProgram()
  51250. , t = I.createShader(I.VERTEX_SHADER)
  51251. , i = I.createShader(I.FRAGMENT_SHADER);
  51252. 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")),
  51253. 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")),
  51254. I.compileShader(t),
  51255. I.compileShader(i),
  51256. I.attachShader(e, t),
  51257. I.attachShader(e, i),
  51258. I.linkProgram(e),
  51259. e
  51260. }(),
  51261. y = {
  51262. position: I.getAttribLocation(v, "position"),
  51263. uv: I.getAttribLocation(v, "uv")
  51264. },
  51265. A = {
  51266. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51267. uvScale: I.getUniformLocation(v, "uvScale"),
  51268. rotation: I.getUniformLocation(v, "rotation"),
  51269. scale: I.getUniformLocation(v, "scale"),
  51270. color: I.getUniformLocation(v, "color"),
  51271. map: I.getUniformLocation(v, "map"),
  51272. opacity: I.getUniformLocation(v, "opacity"),
  51273. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51274. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51275. fogType: I.getUniformLocation(v, "fogType"),
  51276. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51277. fogNear: I.getUniformLocation(v, "fogNear"),
  51278. fogFar: I.getUniformLocation(v, "fogFar"),
  51279. fogColor: I.getUniformLocation(v, "fogColor"),
  51280. alphaTest: I.getUniformLocation(v, "alphaTest")
  51281. };
  51282. var i = document.createElement("canvas");
  51283. i.width = 8,
  51284. i.height = 8;
  51285. var n = i.getContext("2d");
  51286. n.fillStyle = "white",
  51287. n.fillRect(0, 0, 8, 8),
  51288. (C = new Ci.Texture(i)).needsUpdate = !0
  51289. }
  51290. function f(e, t) {
  51291. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51292. }
  51293. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51294. this.render = function(e, t) {
  51295. if (0 !== d.length) {
  51296. void 0 === v && p(),
  51297. I.useProgram(v),
  51298. E.initAttributes(),
  51299. E.enableAttribute(y.position),
  51300. E.enableAttribute(y.uv),
  51301. E.disableUnusedAttributes(),
  51302. E.disable(I.CULL_FACE),
  51303. E.enable(I.BLEND),
  51304. I.bindBuffer(I.ARRAY_BUFFER, g),
  51305. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51306. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51307. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51308. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51309. E.activeTexture(I.TEXTURE0),
  51310. I.uniform1i(A.map, 0);
  51311. var i = 0
  51312. , n = 0
  51313. , r = e.fog;
  51314. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51315. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51316. I.uniform1f(A.fogFar, r.far),
  51317. I.uniform1i(A.fogType, 1),
  51318. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51319. I.uniform1i(A.fogType, 2),
  51320. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51321. n = i = 0);
  51322. for (var o = 0, a = d.length; o < a; o++) {
  51323. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51324. l.z = -l.modelViewMatrix.elements[14]
  51325. }
  51326. d.sort(f);
  51327. var s = [];
  51328. for (o = 0,
  51329. a = d.length; o < a; o++) {
  51330. var l, c = (l = d[o]).material;
  51331. I.uniform1f(A.alphaTest, c.alphaTest),
  51332. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51333. l.matrixWorld.decompose(_, b, w),
  51334. s[0] = w.x,
  51335. s[1] = w.y;
  51336. var h = 0;
  51337. e.fog && c.fog && (h = n),
  51338. i !== h && (I.uniform1i(A.fogType, h),
  51339. i = h),
  51340. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51341. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51342. I.uniform2f(A.uvScale, 1, 1)),
  51343. I.uniform1f(A.opacity, c.opacity),
  51344. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51345. I.uniform1f(A.rotation, c.rotation),
  51346. I.uniform2fv(A.scale, s),
  51347. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51348. E.setDepthTest(c.depthTest),
  51349. E.setDepthWrite(c.depthWrite),
  51350. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51351. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51352. }
  51353. E.enable(I.CULL_FACE),
  51354. u.resetGLState()
  51355. }
  51356. }
  51357. }
  51358. ,
  51359. Object.defineProperties(Ci.Box2.prototype, {
  51360. empty: {
  51361. value: function() {
  51362. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51363. this.isEmpty()
  51364. }
  51365. },
  51366. isIntersectionBox: {
  51367. value: function(e) {
  51368. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51369. this.intersectsBox(e)
  51370. }
  51371. }
  51372. }),
  51373. Object.defineProperties(Ci.Box3.prototype, {
  51374. empty: {
  51375. value: function() {
  51376. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51377. this.isEmpty()
  51378. }
  51379. },
  51380. isIntersectionBox: {
  51381. value: function(e) {
  51382. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51383. this.intersectsBox(e)
  51384. }
  51385. },
  51386. isIntersectionSphere: {
  51387. value: function(e) {
  51388. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51389. this.intersectsSphere(e)
  51390. }
  51391. }
  51392. }),
  51393. Object.defineProperties(Ci.Matrix3.prototype, {
  51394. multiplyVector3: {
  51395. value: function(e) {
  51396. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51397. e.applyMatrix3(this)
  51398. }
  51399. },
  51400. multiplyVector3Array: {
  51401. value: function(e) {
  51402. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51403. this.applyToVector3Array(e)
  51404. }
  51405. }
  51406. }),
  51407. Object.defineProperties(Ci.Matrix4.prototype, {
  51408. extractPosition: {
  51409. value: function(e) {
  51410. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51411. this.copyPosition(e)
  51412. }
  51413. },
  51414. setRotationFromQuaternion: {
  51415. value: function(e) {
  51416. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51417. this.makeRotationFromQuaternion(e)
  51418. }
  51419. },
  51420. multiplyVector3: {
  51421. value: function(e) {
  51422. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51423. e.applyProjection(this)
  51424. }
  51425. },
  51426. multiplyVector4: {
  51427. value: function(e) {
  51428. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51429. e.applyMatrix4(this)
  51430. }
  51431. },
  51432. multiplyVector3Array: {
  51433. value: function(e) {
  51434. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51435. this.applyToVector3Array(e)
  51436. }
  51437. },
  51438. rotateAxis: {
  51439. value: function(e) {
  51440. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51441. e.transformDirection(this)
  51442. }
  51443. },
  51444. crossVector: {
  51445. value: function(e) {
  51446. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51447. e.applyMatrix4(this)
  51448. }
  51449. },
  51450. translate: {
  51451. value: function(e) {
  51452. console.error("THREE.Matrix4: .translate() has been removed.")
  51453. }
  51454. },
  51455. rotateX: {
  51456. value: function(e) {
  51457. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51458. }
  51459. },
  51460. rotateY: {
  51461. value: function(e) {
  51462. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51463. }
  51464. },
  51465. rotateZ: {
  51466. value: function(e) {
  51467. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51468. }
  51469. },
  51470. rotateByAxis: {
  51471. value: function(e, t) {
  51472. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51473. }
  51474. }
  51475. }),
  51476. Object.defineProperties(Ci.Plane.prototype, {
  51477. isIntersectionLine: {
  51478. value: function(e) {
  51479. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51480. this.intersectsLine(e)
  51481. }
  51482. }
  51483. }),
  51484. Object.defineProperties(Ci.Quaternion.prototype, {
  51485. multiplyVector3: {
  51486. value: function(e) {
  51487. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51488. e.applyQuaternion(this)
  51489. }
  51490. }
  51491. }),
  51492. Object.defineProperties(Ci.Ray.prototype, {
  51493. isIntersectionBox: {
  51494. value: function(e) {
  51495. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51496. this.intersectsBox(e)
  51497. }
  51498. },
  51499. isIntersectionPlane: {
  51500. value: function(e) {
  51501. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51502. this.intersectsPlane(e)
  51503. }
  51504. },
  51505. isIntersectionSphere: {
  51506. value: function(e) {
  51507. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51508. this.intersectsSphere(e)
  51509. }
  51510. }
  51511. }),
  51512. Object.defineProperties(Ci.Vector3.prototype, {
  51513. setEulerFromRotationMatrix: {
  51514. value: function() {
  51515. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51516. }
  51517. },
  51518. setEulerFromQuaternion: {
  51519. value: function() {
  51520. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51521. }
  51522. },
  51523. getPositionFromMatrix: {
  51524. value: function(e) {
  51525. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51526. this.setFromMatrixPosition(e)
  51527. }
  51528. },
  51529. getScaleFromMatrix: {
  51530. value: function(e) {
  51531. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51532. this.setFromMatrixScale(e)
  51533. }
  51534. },
  51535. getColumnFromMatrix: {
  51536. value: function(e, t) {
  51537. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51538. this.setFromMatrixColumn(e, t)
  51539. }
  51540. }
  51541. }),
  51542. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51543. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51544. new Ci.Face3(e,t,i,r,o,a)
  51545. }
  51546. ,
  51547. Ci.Vertex = function(e, t, i) {
  51548. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51549. new Ci.Vector3(e,t,i)
  51550. }
  51551. ,
  51552. Object.defineProperties(Ci.Object3D.prototype, {
  51553. eulerOrder: {
  51554. get: function() {
  51555. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51556. this.rotation.order
  51557. },
  51558. set: function(e) {
  51559. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51560. this.rotation.order = e
  51561. }
  51562. },
  51563. getChildByName: {
  51564. value: function(e) {
  51565. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51566. this.getObjectByName(e)
  51567. }
  51568. },
  51569. renderDepth: {
  51570. set: function(e) {
  51571. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51572. }
  51573. },
  51574. translate: {
  51575. value: function(e, t) {
  51576. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51577. this.translateOnAxis(t, e)
  51578. }
  51579. },
  51580. useQuaternion: {
  51581. get: function() {
  51582. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51583. },
  51584. set: function(e) {
  51585. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51586. }
  51587. }
  51588. }),
  51589. Object.defineProperties(Ci, {
  51590. PointCloud: {
  51591. value: function(e, t) {
  51592. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51593. new Ci.Points(e,t)
  51594. }
  51595. },
  51596. ParticleSystem: {
  51597. value: function(e, t) {
  51598. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51599. new Ci.Points(e,t)
  51600. }
  51601. }
  51602. }),
  51603. Object.defineProperties(Ci.Light.prototype, {
  51604. onlyShadow: {
  51605. set: function(e) {
  51606. console.warn("THREE.Light: .onlyShadow has been removed.")
  51607. }
  51608. },
  51609. shadowCameraFov: {
  51610. set: function(e) {
  51611. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51612. this.shadow.camera.fov = e
  51613. }
  51614. },
  51615. shadowCameraLeft: {
  51616. set: function(e) {
  51617. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51618. this.shadow.camera.left = e
  51619. }
  51620. },
  51621. shadowCameraRight: {
  51622. set: function(e) {
  51623. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51624. this.shadow.camera.right = e
  51625. }
  51626. },
  51627. shadowCameraTop: {
  51628. set: function(e) {
  51629. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51630. this.shadow.camera.top = e
  51631. }
  51632. },
  51633. shadowCameraBottom: {
  51634. set: function(e) {
  51635. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51636. this.shadow.camera.bottom = e
  51637. }
  51638. },
  51639. shadowCameraNear: {
  51640. set: function(e) {
  51641. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51642. this.shadow.camera.near = e
  51643. }
  51644. },
  51645. shadowCameraFar: {
  51646. set: function(e) {
  51647. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51648. this.shadow.camera.far = e
  51649. }
  51650. },
  51651. shadowCameraVisible: {
  51652. set: function(e) {
  51653. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51654. }
  51655. },
  51656. shadowBias: {
  51657. set: function(e) {
  51658. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51659. this.shadow.bias = e
  51660. }
  51661. },
  51662. shadowDarkness: {
  51663. set: function(e) {
  51664. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51665. }
  51666. },
  51667. shadowMapWidth: {
  51668. set: function(e) {
  51669. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51670. this.shadow.mapSize.width = e
  51671. }
  51672. },
  51673. shadowMapHeight: {
  51674. set: function(e) {
  51675. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51676. this.shadow.mapSize.height = e
  51677. }
  51678. }
  51679. }),
  51680. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51681. length: {
  51682. get: function() {
  51683. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51684. this.array.length
  51685. }
  51686. }
  51687. }),
  51688. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51689. drawcalls: {
  51690. get: function() {
  51691. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51692. this.groups
  51693. }
  51694. },
  51695. offsets: {
  51696. get: function() {
  51697. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51698. this.groups
  51699. }
  51700. },
  51701. addIndex: {
  51702. value: function(e) {
  51703. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51704. this.setIndex(e)
  51705. }
  51706. },
  51707. addDrawCall: {
  51708. value: function(e, t, i) {
  51709. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51710. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51711. this.addGroup(e, t)
  51712. }
  51713. },
  51714. clearDrawCalls: {
  51715. value: function() {
  51716. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51717. this.clearGroups()
  51718. }
  51719. },
  51720. computeTangents: {
  51721. value: function() {
  51722. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51723. }
  51724. },
  51725. computeOffsets: {
  51726. value: function() {
  51727. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51728. }
  51729. }
  51730. }),
  51731. Object.defineProperties(Ci.Material.prototype, {
  51732. wrapAround: {
  51733. get: function() {
  51734. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51735. },
  51736. set: function(e) {
  51737. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51738. }
  51739. },
  51740. wrapRGB: {
  51741. get: function() {
  51742. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51743. new Ci.Color
  51744. }
  51745. }
  51746. }),
  51747. Object.defineProperties(Ci, {
  51748. PointCloudMaterial: {
  51749. value: function(e) {
  51750. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51751. new Ci.PointsMaterial(e)
  51752. }
  51753. },
  51754. ParticleBasicMaterial: {
  51755. value: function(e) {
  51756. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51757. new Ci.PointsMaterial(e)
  51758. }
  51759. },
  51760. ParticleSystemMaterial: {
  51761. value: function(e) {
  51762. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51763. new Ci.PointsMaterial(e)
  51764. }
  51765. }
  51766. }),
  51767. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51768. metal: {
  51769. get: function() {
  51770. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51771. !1
  51772. },
  51773. set: function(e) {
  51774. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51775. }
  51776. }
  51777. }),
  51778. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51779. derivatives: {
  51780. get: function() {
  51781. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51782. this.extensions.derivatives
  51783. },
  51784. set: function(e) {
  51785. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51786. this.extensions.derivatives = e
  51787. }
  51788. }
  51789. }),
  51790. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51791. supportsFloatTextures: {
  51792. value: function() {
  51793. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51794. this.extensions.get("OES_texture_float")
  51795. }
  51796. },
  51797. supportsHalfFloatTextures: {
  51798. value: function() {
  51799. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51800. this.extensions.get("OES_texture_half_float")
  51801. }
  51802. },
  51803. supportsStandardDerivatives: {
  51804. value: function() {
  51805. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51806. this.extensions.get("OES_standard_derivatives")
  51807. }
  51808. },
  51809. supportsCompressedTextureS3TC: {
  51810. value: function() {
  51811. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51812. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51813. }
  51814. },
  51815. supportsCompressedTexturePVRTC: {
  51816. value: function() {
  51817. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51818. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51819. }
  51820. },
  51821. supportsBlendMinMax: {
  51822. value: function() {
  51823. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51824. this.extensions.get("EXT_blend_minmax")
  51825. }
  51826. },
  51827. supportsVertexTextures: {
  51828. value: function() {
  51829. return this.capabilities.vertexTextures
  51830. }
  51831. },
  51832. supportsInstancedArrays: {
  51833. value: function() {
  51834. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51835. this.extensions.get("ANGLE_instanced_arrays")
  51836. }
  51837. },
  51838. enableScissorTest: {
  51839. value: function(e) {
  51840. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51841. this.setScissorTest(e)
  51842. }
  51843. },
  51844. initMaterial: {
  51845. value: function() {
  51846. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51847. }
  51848. },
  51849. addPrePlugin: {
  51850. value: function() {
  51851. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51852. }
  51853. },
  51854. addPostPlugin: {
  51855. value: function() {
  51856. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51857. }
  51858. },
  51859. updateShadowMap: {
  51860. value: function() {
  51861. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51862. }
  51863. },
  51864. shadowMapEnabled: {
  51865. get: function() {
  51866. return this.shadowMap.enabled
  51867. },
  51868. set: function(e) {
  51869. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51870. this.shadowMap.enabled = e
  51871. }
  51872. },
  51873. shadowMapType: {
  51874. get: function() {
  51875. return this.shadowMap.type
  51876. },
  51877. set: function(e) {
  51878. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51879. this.shadowMap.type = e
  51880. }
  51881. },
  51882. shadowMapCullFace: {
  51883. get: function() {
  51884. return this.shadowMap.cullFace
  51885. },
  51886. set: function(e) {
  51887. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51888. this.shadowMap.cullFace = e
  51889. }
  51890. }
  51891. }),
  51892. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51893. wrapS: {
  51894. get: function() {
  51895. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51896. this.texture.wrapS
  51897. },
  51898. set: function(e) {
  51899. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51900. this.texture.wrapS = e
  51901. }
  51902. },
  51903. wrapT: {
  51904. get: function() {
  51905. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51906. this.texture.wrapT
  51907. },
  51908. set: function(e) {
  51909. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51910. this.texture.wrapT = e
  51911. }
  51912. },
  51913. magFilter: {
  51914. get: function() {
  51915. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51916. this.texture.magFilter
  51917. },
  51918. set: function(e) {
  51919. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51920. this.texture.magFilter = e
  51921. }
  51922. },
  51923. minFilter: {
  51924. get: function() {
  51925. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51926. this.texture.minFilter
  51927. },
  51928. set: function(e) {
  51929. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51930. this.texture.minFilter = e
  51931. }
  51932. },
  51933. anisotropy: {
  51934. get: function() {
  51935. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51936. this.texture.anisotropy
  51937. },
  51938. set: function(e) {
  51939. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51940. this.texture.anisotropy = e
  51941. }
  51942. },
  51943. offset: {
  51944. get: function() {
  51945. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51946. this.texture.offset
  51947. },
  51948. set: function(e) {
  51949. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51950. this.texture.offset = e
  51951. }
  51952. },
  51953. repeat: {
  51954. get: function() {
  51955. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51956. this.texture.repeat
  51957. },
  51958. set: function(e) {
  51959. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51960. this.texture.repeat = e
  51961. }
  51962. },
  51963. format: {
  51964. get: function() {
  51965. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51966. this.texture.format
  51967. },
  51968. set: function(e) {
  51969. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51970. this.texture.format = e
  51971. }
  51972. },
  51973. type: {
  51974. get: function() {
  51975. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51976. this.texture.type
  51977. },
  51978. set: function(e) {
  51979. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51980. this.texture.type = e
  51981. }
  51982. },
  51983. generateMipmaps: {
  51984. get: function() {
  51985. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51986. this.texture.generateMipmaps
  51987. },
  51988. set: function(e) {
  51989. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51990. this.texture.generateMipmaps = e
  51991. }
  51992. }
  51993. }),
  51994. Ci.GeometryUtils = {
  51995. merge: function(e, t, i) {
  51996. var n;
  51997. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51998. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51999. n = t.matrix,
  52000. t = t.geometry),
  52001. e.merge(t, n, i)
  52002. },
  52003. center: function(e) {
  52004. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52005. e.center()
  52006. }
  52007. },
  52008. Ci.ImageUtils = {
  52009. crossOrigin: void 0,
  52010. loadTexture: function(e, t, i, n) {
  52011. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52012. var r = new Ci.TextureLoader;
  52013. r.setCrossOrigin(this.crossOrigin);
  52014. var o = r.load(e, i, void 0, n);
  52015. return t && (o.mapping = t),
  52016. o
  52017. },
  52018. loadTextureCube: function(e, t, i, n) {
  52019. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52020. var r = new Ci.CubeTextureLoader;
  52021. r.setCrossOrigin(this.crossOrigin);
  52022. var o = r.load(e, i, void 0, n);
  52023. return t && (o.mapping = t),
  52024. o
  52025. },
  52026. loadCompressedTexture: function() {
  52027. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52028. },
  52029. loadCompressedTextureCube: function() {
  52030. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52031. }
  52032. },
  52033. Ci.Projector = function() {
  52034. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52035. this.projectVector = function(e, t) {
  52036. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52037. e.project(t)
  52038. }
  52039. ,
  52040. this.unprojectVector = function(e, t) {
  52041. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52042. e.unproject(t)
  52043. }
  52044. ,
  52045. this.pickingRay = function(e, t) {
  52046. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52047. }
  52048. }
  52049. ,
  52050. Ci.CanvasRenderer = function() {
  52051. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52052. this.domElement = document.createElement("canvas"),
  52053. this.clear = function() {}
  52054. ,
  52055. this.render = function() {}
  52056. ,
  52057. this.setClearColor = function() {}
  52058. ,
  52059. this.setSize = function() {}
  52060. }
  52061. ,
  52062. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52063. Ci.CurveUtils = {
  52064. tangentQuadraticBezier: function(e, t, i, n) {
  52065. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52066. },
  52067. tangentCubicBezier: function(e, t, i, n, r) {
  52068. 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
  52069. },
  52070. tangentSpline: function(e, t, i, n, r) {
  52071. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52072. },
  52073. interpolate: function(e, t, i, n, r) {
  52074. var o = .5 * (i - e)
  52075. , a = .5 * (n - t)
  52076. , s = r * r;
  52077. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52078. }
  52079. },
  52080. Ci.SceneUtils = {
  52081. createMultiMaterialObject: function(e, t) {
  52082. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52083. i.add(new Ci.Mesh(e,t[n]));
  52084. return i
  52085. },
  52086. detach: function(e, t, i) {
  52087. e.applyMatrix(t.matrixWorld),
  52088. t.remove(e),
  52089. i.add(e)
  52090. },
  52091. attach: function(e, t, i) {
  52092. var n = new Ci.Matrix4;
  52093. n.getInverse(i.matrixWorld),
  52094. e.applyMatrix(n),
  52095. t.remove(e),
  52096. i.add(e)
  52097. }
  52098. },
  52099. Ci.ShapeUtils = {
  52100. area: function(e) {
  52101. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52102. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52103. return .5 * i
  52104. },
  52105. triangulate: function(e, t) {
  52106. var i = e.length;
  52107. if (i < 3)
  52108. return null;
  52109. var n, r, o, a = [], s = [], l = [];
  52110. if (0 < Ci.ShapeUtils.area(e))
  52111. for (r = 0; r < i; r++)
  52112. s[r] = r;
  52113. else
  52114. for (r = 0; r < i; r++)
  52115. s[r] = i - 1 - r;
  52116. var c = i
  52117. , h = 2 * c;
  52118. for (r = c - 1; 2 < c; ) {
  52119. if (h-- <= 0)
  52120. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52121. t ? l : a;
  52122. if (c <= (n = r) && (n = 0),
  52123. c <= (r = n + 1) && (r = 0),
  52124. c <= (o = r + 1) && (o = 0),
  52125. Si(e, n, r, o, c, s)) {
  52126. var u, d, p, f, g;
  52127. for (u = s[n],
  52128. d = s[r],
  52129. p = s[o],
  52130. a.push([e[u], e[d], e[p]]),
  52131. l.push([s[n], s[r], s[o]]),
  52132. g = (f = r) + 1; g < c; f++,
  52133. g++)
  52134. s[f] = s[g];
  52135. h = 2 * --c
  52136. }
  52137. }
  52138. return t ? l : a
  52139. },
  52140. triangulateShape: function(e, t) {
  52141. function w(e, t, i) {
  52142. 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
  52143. }
  52144. function b(e, t, i, n, r) {
  52145. var o = t.x - e.x
  52146. , a = t.y - e.y
  52147. , s = n.x - i.x
  52148. , l = n.y - i.y
  52149. , c = e.x - i.x
  52150. , h = e.y - i.y
  52151. , u = a * s - o * l
  52152. , d = a * c - o * h;
  52153. if (Math.abs(u) > Number.EPSILON) {
  52154. var p;
  52155. if (0 < u) {
  52156. if (d < 0 || u < d)
  52157. return [];
  52158. if ((p = l * c - s * h) < 0 || u < p)
  52159. return []
  52160. } else {
  52161. if (0 < d || d < u)
  52162. return [];
  52163. if (0 < (p = l * c - s * h) || p < u)
  52164. return []
  52165. }
  52166. if (0 === p)
  52167. return !r || 0 != d && d != u ? [e] : [];
  52168. if (p === u)
  52169. return !r || 0 != d && d != u ? [t] : [];
  52170. if (0 == d)
  52171. return [i];
  52172. if (d == u)
  52173. return [n];
  52174. var f = p / u;
  52175. return [{
  52176. x: e.x + f * o,
  52177. y: e.y + f * a
  52178. }]
  52179. }
  52180. if (0 != d || l * c != s * h)
  52181. return [];
  52182. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52183. 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,
  52184. (m = t).x) : (v = (g = t).x,
  52185. (m = e).x),
  52186. i.x < n.x ? (I = (A = i).x,
  52187. (C = n).x) : (I = (A = n).x,
  52188. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52189. (m = t).y) : (v = (g = t).y,
  52190. (m = e).y),
  52191. i.y < n.y ? (I = (A = i).y,
  52192. (C = n).y) : (I = (A = n).y,
  52193. (C = i).y)),
  52194. 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])
  52195. }
  52196. function T(e, t, i, n) {
  52197. var r = t.x - e.x
  52198. , o = t.y - e.y
  52199. , a = i.x - e.x
  52200. , s = i.y - e.y
  52201. , l = n.x - e.x
  52202. , c = n.y - e.y
  52203. , h = r * s - o * a
  52204. , u = r * c - o * l;
  52205. if (Math.abs(h) > Number.EPSILON) {
  52206. var d = l * s - c * a;
  52207. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52208. }
  52209. return 0 < u
  52210. }
  52211. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52212. Array.prototype.push.apply(c, t[h]);
  52213. for (i = 0,
  52214. n = c.length; i < n; i++)
  52215. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52216. l[a] = i;
  52217. var d = function(e, a) {
  52218. function t(e, t) {
  52219. var i = m.length - 1
  52220. , n = e - 1;
  52221. n < 0 && (n = i);
  52222. var r = e + 1;
  52223. i < r && (r = 0);
  52224. var o = T(m[e], m[n], m[r], c[t]);
  52225. if (!o)
  52226. return !1;
  52227. var a = c.length - 1
  52228. , s = t - 1;
  52229. s < 0 && (s = a);
  52230. var l = t + 1;
  52231. return a < l && (l = 0),
  52232. !!(o = T(c[t], c[s], c[l], m[e]))
  52233. }
  52234. function i(e, t) {
  52235. var i, n;
  52236. for (i = 0; i < m.length; i++)
  52237. if (n = i + 1,
  52238. n %= m.length,
  52239. 0 < b(e, t, m[i], m[n], !0).length)
  52240. return !0;
  52241. return !1
  52242. }
  52243. function n(e, t) {
  52244. var i, n, r, o;
  52245. for (i = 0; i < v.length; i++)
  52246. for (n = a[v[i]],
  52247. r = 0; r < n.length; r++)
  52248. if (o = r + 1,
  52249. o %= n.length,
  52250. 0 < b(e, t, n[r], n[o], !0).length)
  52251. return !0;
  52252. return !1
  52253. }
  52254. 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++)
  52255. v.push(A);
  52256. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52257. if (--E < 0) {
  52258. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52259. break
  52260. }
  52261. for (o = I; o < m.length; o++) {
  52262. s = m[o],
  52263. r = -1;
  52264. for (A = 0; A < v.length; A++)
  52265. if (h = v[A],
  52266. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52267. c = a[h];
  52268. for (var _ = 0; _ < c.length; _++)
  52269. if (l = c[_],
  52270. t(o, _) && !i(s, l) && !n(s, l)) {
  52271. r = _,
  52272. v.splice(A, 1),
  52273. d = m.slice(0, o + 1),
  52274. p = m.slice(o),
  52275. f = c.slice(r),
  52276. g = c.slice(0, r + 1),
  52277. m = d.concat(f).concat(g).concat(p),
  52278. I = o;
  52279. break
  52280. }
  52281. if (0 <= r)
  52282. break;
  52283. y[u] = !0
  52284. }
  52285. if (0 <= r)
  52286. break
  52287. }
  52288. }
  52289. return m
  52290. }(e, t)
  52291. , p = Ci.ShapeUtils.triangulate(d, !1);
  52292. for (i = 0,
  52293. n = p.length; i < n; i++)
  52294. for (o = p[i],
  52295. r = 0; r < 3; r++)
  52296. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52297. return p.concat()
  52298. },
  52299. isClockWise: function(e) {
  52300. return Ci.ShapeUtils.area(e) < 0
  52301. },
  52302. b2: function(e, t, i, n) {
  52303. return function(e, t) {
  52304. var i = 1 - e;
  52305. return i * i * t
  52306. }(e, t) + function(e, t) {
  52307. return 2 * (1 - e) * e * t
  52308. }(e, i) + function(e, t) {
  52309. return e * e * t
  52310. }(e, n)
  52311. },
  52312. b3: function(e, t, i, n, r) {
  52313. return function(e, t) {
  52314. var i = 1 - e;
  52315. return i * i * i * t
  52316. }(e, t) + function(e, t) {
  52317. var i = 1 - e;
  52318. return 3 * i * i * e * t
  52319. }(e, i) + function(e, t) {
  52320. return 3 * (1 - e) * e * e * t
  52321. }(e, n) + function(e, t) {
  52322. return e * e * e * t
  52323. }(e, r)
  52324. }
  52325. },
  52326. Ci.Curve = function() {}
  52327. ,
  52328. Ci.Curve.prototype = {
  52329. constructor: Ci.Curve,
  52330. getPoint: function(e) {
  52331. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52332. null
  52333. },
  52334. getPointAt: function(e) {
  52335. var t = this.getUtoTmapping(e);
  52336. return this.getPoint(t)
  52337. },
  52338. getPoints: function(e) {
  52339. e = e || 5;
  52340. var t, i = [];
  52341. for (t = 0; t <= e; t++)
  52342. i.push(this.getPoint(t / e));
  52343. return i
  52344. },
  52345. getSpacedPoints: function(e) {
  52346. e = e || 5;
  52347. var t, i = [];
  52348. for (t = 0; t <= e; t++)
  52349. i.push(this.getPointAt(t / e));
  52350. return i
  52351. },
  52352. getLength: function() {
  52353. var e = this.getLengths();
  52354. return e[e.length - 1]
  52355. },
  52356. getLengths: function(e) {
  52357. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52358. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52359. return this.cacheArcLengths;
  52360. this.needsUpdate = !1;
  52361. var t, i, n = [], r = this.getPoint(0), o = 0;
  52362. for (n.push(0),
  52363. i = 1; i <= e; i++)
  52364. o += (t = this.getPoint(i / e)).distanceTo(r),
  52365. n.push(o),
  52366. r = t;
  52367. return this.cacheArcLengths = n
  52368. },
  52369. updateArcLengths: function() {
  52370. this.needsUpdate = !0,
  52371. this.getLengths()
  52372. },
  52373. getUtoTmapping: function(e, t) {
  52374. var i, n = this.getLengths(), r = 0, o = n.length;
  52375. i = t || e * n[o - 1];
  52376. for (var a, s = 0, l = o - 1; s <= l; )
  52377. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52378. s = r + 1;
  52379. else {
  52380. if (!(0 < a)) {
  52381. l = r;
  52382. break
  52383. }
  52384. l = r - 1
  52385. }
  52386. if (n[r = l] === i)
  52387. return r / (o - 1);
  52388. var c = n[r];
  52389. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52390. },
  52391. getTangent: function(e) {
  52392. var t = e - 1e-4
  52393. , i = e + 1e-4;
  52394. t < 0 && (t = 0),
  52395. 1 < i && (i = 1);
  52396. var n = this.getPoint(t);
  52397. return this.getPoint(i).clone().sub(n).normalize()
  52398. },
  52399. getTangentAt: function(e) {
  52400. var t = this.getUtoTmapping(e);
  52401. return this.getTangent(t)
  52402. }
  52403. },
  52404. Ci.Curve.create = function(e, t) {
  52405. return e.prototype = Object.create(Ci.Curve.prototype),
  52406. (e.prototype.constructor = e).prototype.getPoint = t,
  52407. e
  52408. }
  52409. ,
  52410. Ci.CurvePath = function() {
  52411. this.curves = [],
  52412. this.autoClose = !1
  52413. }
  52414. ,
  52415. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52416. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52417. Ci.CurvePath.prototype.add = function(e) {
  52418. this.curves.push(e)
  52419. }
  52420. ,
  52421. Ci.CurvePath.prototype.closePath = function() {
  52422. var e = this.curves[0].getPoint(0)
  52423. , t = this.curves[this.curves.length - 1].getPoint(1);
  52424. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52425. }
  52426. ,
  52427. Ci.CurvePath.prototype.getPoint = function(e) {
  52428. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52429. if (i[n] >= t) {
  52430. var r = i[n] - t
  52431. , o = this.curves[n]
  52432. , a = 1 - r / o.getLength();
  52433. return o.getPointAt(a)
  52434. }
  52435. n++
  52436. }
  52437. return null
  52438. }
  52439. ,
  52440. Ci.CurvePath.prototype.getLength = function() {
  52441. var e = this.getCurveLengths();
  52442. return e[e.length - 1]
  52443. }
  52444. ,
  52445. Ci.CurvePath.prototype.getCurveLengths = function() {
  52446. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52447. return this.cacheLengths;
  52448. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52449. t += this.curves[i].getLength(),
  52450. e.push(t);
  52451. return this.cacheLengths = e
  52452. }
  52453. ,
  52454. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52455. var t = this.getPoints(e);
  52456. return this.createGeometry(t)
  52457. }
  52458. ,
  52459. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52460. var t = this.getSpacedPoints(e);
  52461. return this.createGeometry(t)
  52462. }
  52463. ,
  52464. Ci.CurvePath.prototype.createGeometry = function(e) {
  52465. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52466. var r = e[i];
  52467. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52468. }
  52469. return t
  52470. }
  52471. ,
  52472. Ci.Font = function(e) {
  52473. this.data = e
  52474. }
  52475. ,
  52476. Ci.Font.prototype = {
  52477. constructor: Ci.Font,
  52478. generateShapes: function(e, s, b) {
  52479. function l(e, t, i) {
  52480. var n = w.glyphs[e] || w.glyphs["?"];
  52481. if (n) {
  52482. 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;
  52483. if (n.o)
  52484. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52485. switch (A[C++]) {
  52486. case "m":
  52487. r = A[C++] * t + i,
  52488. o = A[C++] * t,
  52489. g.moveTo(r, o);
  52490. break;
  52491. case "l":
  52492. r = A[C++] * t + i,
  52493. o = A[C++] * t,
  52494. g.lineTo(r, o);
  52495. break;
  52496. case "q":
  52497. if (a = A[C++] * t + i,
  52498. s = A[C++] * t,
  52499. h = A[C++] * t + i,
  52500. u = A[C++] * t,
  52501. g.quadraticCurveTo(h, u, a, s),
  52502. f = m[m.length - 1]) {
  52503. l = f.x,
  52504. c = f.y;
  52505. for (var E = 1; E <= b; E++) {
  52506. v(_ = E / b, l, h, a),
  52507. v(_, c, u, s)
  52508. }
  52509. }
  52510. break;
  52511. case "b":
  52512. if (a = A[C++] * t + i,
  52513. s = A[C++] * t,
  52514. h = A[C++] * t + i,
  52515. u = A[C++] * t,
  52516. d = A[C++] * t + i,
  52517. p = A[C++] * t,
  52518. g.bezierCurveTo(h, u, d, p, a, s),
  52519. f = m[m.length - 1]) {
  52520. l = f.x,
  52521. c = f.y;
  52522. for (E = 1; E <= b; E++) {
  52523. var _;
  52524. y(_ = E / b, l, h, d, a),
  52525. y(_, c, u, p, s)
  52526. }
  52527. }
  52528. }
  52529. }
  52530. return {
  52531. offset: n.ha * t,
  52532. path: g
  52533. }
  52534. }
  52535. }
  52536. void 0 === s && (s = 100),
  52537. void 0 === b && (b = 4);
  52538. for (var w = this.data, t = function(e) {
  52539. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52540. var a = l(t[o], i, n);
  52541. n += a.offset,
  52542. r.push(a.path)
  52543. }
  52544. return r
  52545. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52546. Array.prototype.push.apply(i, t[n].toShapes());
  52547. return i
  52548. }
  52549. },
  52550. Ci.Path = function(e) {
  52551. Ci.CurvePath.call(this),
  52552. this.actions = [],
  52553. e && this.fromPoints(e)
  52554. }
  52555. ,
  52556. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52557. Ci.Path.prototype.constructor = Ci.Path,
  52558. Ci.Path.prototype.fromPoints = function(e) {
  52559. this.moveTo(e[0].x, e[0].y);
  52560. for (var t = 1, i = e.length; t < i; t++)
  52561. this.lineTo(e[t].x, e[t].y)
  52562. }
  52563. ,
  52564. Ci.Path.prototype.moveTo = function(e, t) {
  52565. this.actions.push({
  52566. action: "moveTo",
  52567. args: [e, t]
  52568. })
  52569. }
  52570. ,
  52571. Ci.Path.prototype.lineTo = function(e, t) {
  52572. var i = this.actions[this.actions.length - 1].args
  52573. , n = i[i.length - 2]
  52574. , r = i[i.length - 1]
  52575. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52576. this.curves.push(o),
  52577. this.actions.push({
  52578. action: "lineTo",
  52579. args: [e, t]
  52580. })
  52581. }
  52582. ,
  52583. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52584. var r = this.actions[this.actions.length - 1].args
  52585. , o = r[r.length - 2]
  52586. , a = r[r.length - 1]
  52587. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52588. this.curves.push(s),
  52589. this.actions.push({
  52590. action: "quadraticCurveTo",
  52591. args: [e, t, i, n]
  52592. })
  52593. }
  52594. ,
  52595. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52596. var a = this.actions[this.actions.length - 1].args
  52597. , s = a[a.length - 2]
  52598. , l = a[a.length - 1]
  52599. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52600. this.curves.push(c),
  52601. this.actions.push({
  52602. action: "bezierCurveTo",
  52603. args: [e, t, i, n, r, o]
  52604. })
  52605. }
  52606. ,
  52607. Ci.Path.prototype.splineThru = function(e) {
  52608. var t = Array.prototype.slice.call(arguments)
  52609. , i = this.actions[this.actions.length - 1].args
  52610. , n = i[i.length - 2]
  52611. , r = i[i.length - 1]
  52612. , o = [new Ci.Vector2(n,r)];
  52613. Array.prototype.push.apply(o, e);
  52614. var a = new Ci.SplineCurve(o);
  52615. this.curves.push(a),
  52616. this.actions.push({
  52617. action: "splineThru",
  52618. args: t
  52619. })
  52620. }
  52621. ,
  52622. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52623. var a = this.actions[this.actions.length - 1].args
  52624. , s = a[a.length - 2]
  52625. , l = a[a.length - 1];
  52626. this.absarc(e + s, t + l, i, n, r, o)
  52627. }
  52628. ,
  52629. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52630. this.absellipse(e, t, i, i, n, r, o)
  52631. }
  52632. ,
  52633. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52634. var l = this.actions[this.actions.length - 1].args
  52635. , c = l[l.length - 2]
  52636. , h = l[l.length - 1];
  52637. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52638. }
  52639. ,
  52640. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52641. var l = [e, t, i, n, r, o, a, s || 0]
  52642. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52643. this.curves.push(c);
  52644. var h = c.getPoint(1);
  52645. l.push(h.x),
  52646. l.push(h.y),
  52647. this.actions.push({
  52648. action: "ellipse",
  52649. args: l
  52650. })
  52651. }
  52652. ,
  52653. Ci.Path.prototype.getSpacedPoints = function(e) {
  52654. e = e || 40;
  52655. for (var t = [], i = 0; i < e; i++)
  52656. t.push(this.getPoint(i / e));
  52657. return this.autoClose && t.push(t[0]),
  52658. t
  52659. }
  52660. ,
  52661. Ci.Path.prototype.getPoints = function(e) {
  52662. e = e || 12;
  52663. 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++) {
  52664. var v = this.actions[g]
  52665. , y = v.action
  52666. , A = v.args;
  52667. switch (y) {
  52668. case "moveTo":
  52669. case "lineTo":
  52670. f.push(new Ci.Vector2(A[0],A[1]));
  52671. break;
  52672. case "quadraticCurveTo":
  52673. t = A[2],
  52674. i = A[3],
  52675. o = A[0],
  52676. a = A[1],
  52677. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52678. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52679. c[c.length - 1]);
  52680. for (var C = 1; C <= e; C++) {
  52681. h = d(O = C / e, s, o, t),
  52682. u = d(O, l, a, i),
  52683. f.push(new Ci.Vector2(h,u))
  52684. }
  52685. break;
  52686. case "bezierCurveTo":
  52687. t = A[4],
  52688. i = A[5],
  52689. o = A[0],
  52690. a = A[1],
  52691. n = A[2],
  52692. r = A[3],
  52693. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52694. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52695. c[c.length - 1]);
  52696. for (C = 1; C <= e; C++) {
  52697. h = p(O = C / e, s, o, n, t),
  52698. u = p(O, l, a, r, i),
  52699. f.push(new Ci.Vector2(h,u))
  52700. }
  52701. break;
  52702. case "splineThru":
  52703. c = this.actions[g - 1].args;
  52704. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52705. , E = e * A[0].length;
  52706. I = I.concat(A[0]);
  52707. var _ = new Ci.SplineCurve(I);
  52708. for (C = 1; C <= E; C++)
  52709. f.push(_.getPointAt(C / E));
  52710. break;
  52711. case "arc":
  52712. var b = A[0]
  52713. , w = A[1]
  52714. , T = A[2]
  52715. , x = A[3]
  52716. , S = A[4]
  52717. , M = !!A[5]
  52718. , R = S - x
  52719. , P = 2 * e;
  52720. for (C = 1; C <= P; C++) {
  52721. var O = C / P;
  52722. M || (O = 1 - O),
  52723. L = x + O * R,
  52724. h = b + T * Math.cos(L),
  52725. u = w + T * Math.sin(L),
  52726. f.push(new Ci.Vector2(h,u))
  52727. }
  52728. break;
  52729. case "ellipse":
  52730. b = A[0],
  52731. w = A[1];
  52732. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52733. S = A[5],
  52734. M = !!A[6],
  52735. A[7]);
  52736. R = S - x,
  52737. P = 2 * e;
  52738. 0 !== V && (D = Math.cos(V),
  52739. N = Math.sin(V));
  52740. for (C = 1; C <= P; C++) {
  52741. O = C / P;
  52742. if (M || (O = 1 - O),
  52743. L = x + O * R,
  52744. h = b + F * Math.cos(L),
  52745. u = w + B * Math.sin(L),
  52746. 0 !== V) {
  52747. var k = h;
  52748. h = (k - b) * D - (u - w) * N + b,
  52749. u = (k - b) * N + (u - w) * D + w
  52750. }
  52751. f.push(new Ci.Vector2(h,u))
  52752. }
  52753. }
  52754. }
  52755. var U = f[f.length - 1];
  52756. 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),
  52757. this.autoClose && f.push(f[0]),
  52758. f
  52759. }
  52760. ,
  52761. Ci.Path.prototype.toShapes = function(e, t) {
  52762. function i(e) {
  52763. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52764. var r = e[i]
  52765. , o = new Ci.Shape;
  52766. o.actions = r.actions,
  52767. o.curves = r.curves,
  52768. t.push(o)
  52769. }
  52770. return t
  52771. }
  52772. function n(e, t) {
  52773. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52774. var a = t[r]
  52775. , s = t[o]
  52776. , l = s.x - a.x
  52777. , c = s.y - a.y;
  52778. if (Math.abs(c) > Number.EPSILON) {
  52779. if (c < 0 && (a = t[o],
  52780. l = -l,
  52781. s = t[r],
  52782. c = -c),
  52783. e.y < a.y || e.y > s.y)
  52784. continue;
  52785. if (e.y === a.y) {
  52786. if (e.x === a.x)
  52787. return !0
  52788. } else {
  52789. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52790. if (0 == h)
  52791. return !0;
  52792. if (h < 0)
  52793. continue;
  52794. n = !n
  52795. }
  52796. } else {
  52797. if (e.y !== a.y)
  52798. continue;
  52799. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52800. return !0
  52801. }
  52802. }
  52803. return n
  52804. }
  52805. var r = Ci.ShapeUtils.isClockWise
  52806. , o = function(e) {
  52807. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52808. var o = e[n]
  52809. , a = o.args
  52810. , s = o.action;
  52811. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52812. i = new Ci.Path),
  52813. i[s].apply(i, a)
  52814. }
  52815. return 0 !== i.actions.length && t.push(i),
  52816. t
  52817. }(this.actions);
  52818. if (0 === o.length)
  52819. return [];
  52820. if (!0 === t)
  52821. return i(o);
  52822. var a, s, l, c = [];
  52823. if (1 === o.length)
  52824. return s = o[0],
  52825. (l = new Ci.Shape).actions = s.actions,
  52826. l.curves = s.curves,
  52827. c.push(l),
  52828. c;
  52829. var h = !r(o[0].getPoints());
  52830. h = e ? !h : h;
  52831. var u, d = [], p = [], f = [], g = 0;
  52832. p[g] = void 0,
  52833. f[g] = [];
  52834. for (var m = 0, v = o.length; m < v; m++)
  52835. a = r(u = (s = o[m]).getPoints()),
  52836. (a = e ? !a : a) ? (!h && p[g] && g++,
  52837. p[g] = {
  52838. s: new Ci.Shape,
  52839. p: u
  52840. },
  52841. p[g].s.actions = s.actions,
  52842. p[g].s.curves = s.curves,
  52843. h && g++,
  52844. f[g] = []) : f[g].push({
  52845. h: s,
  52846. p: u[0]
  52847. });
  52848. if (!p[0])
  52849. return i(o);
  52850. if (1 < p.length) {
  52851. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52852. d[C] = [];
  52853. for (C = 0,
  52854. I = p.length; C < I; C++)
  52855. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52856. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52857. n(b.p, p[T].p) && (C !== T && A.push({
  52858. froms: C,
  52859. tos: T,
  52860. hole: _
  52861. }),
  52862. w ? (w = !1,
  52863. d[T].push(b)) : y = !0);
  52864. w && d[C].push(b)
  52865. }
  52866. 0 < A.length && (y || (f = d))
  52867. }
  52868. m = 0;
  52869. for (var x, S = p.length; m < S; m++) {
  52870. l = p[m].s,
  52871. c.push(l);
  52872. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52873. l.holes.push(x[M].h)
  52874. }
  52875. return c
  52876. }
  52877. ,
  52878. Ci.Shape = function() {
  52879. Ci.Path.apply(this, arguments),
  52880. this.holes = []
  52881. }
  52882. ,
  52883. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52884. Ci.Shape.prototype.constructor = Ci.Shape,
  52885. Ci.Shape.prototype.extrude = function(e) {
  52886. return new Ci.ExtrudeGeometry(this,e)
  52887. }
  52888. ,
  52889. Ci.Shape.prototype.makeGeometry = function(e) {
  52890. return new Ci.ShapeGeometry(this,e)
  52891. }
  52892. ,
  52893. Ci.Shape.prototype.getPointsHoles = function(e) {
  52894. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52895. t[i] = this.holes[i].getPoints(e);
  52896. return t
  52897. }
  52898. ,
  52899. Ci.Shape.prototype.extractAllPoints = function(e) {
  52900. return {
  52901. shape: this.getPoints(e),
  52902. holes: this.getPointsHoles(e)
  52903. }
  52904. }
  52905. ,
  52906. Ci.Shape.prototype.extractPoints = function(e) {
  52907. return this.extractAllPoints(e)
  52908. }
  52909. ,
  52910. Ci.LineCurve = function(e, t) {
  52911. this.v1 = e,
  52912. this.v2 = t
  52913. }
  52914. ,
  52915. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52916. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52917. Ci.LineCurve.prototype.getPoint = function(e) {
  52918. var t = this.v2.clone().sub(this.v1);
  52919. return t.multiplyScalar(e).add(this.v1),
  52920. t
  52921. }
  52922. ,
  52923. Ci.LineCurve.prototype.getPointAt = function(e) {
  52924. return this.getPoint(e)
  52925. }
  52926. ,
  52927. Ci.LineCurve.prototype.getTangent = function(e) {
  52928. return this.v2.clone().sub(this.v1).normalize()
  52929. }
  52930. ,
  52931. Ci.QuadraticBezierCurve = function(e, t, i) {
  52932. this.v0 = e,
  52933. this.v1 = t,
  52934. this.v2 = i
  52935. }
  52936. ,
  52937. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52938. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52939. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52940. var t = Ci.ShapeUtils.b2;
  52941. 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))
  52942. }
  52943. ,
  52944. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52945. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52946. 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()
  52947. }
  52948. ,
  52949. Ci.CubicBezierCurve = function(e, t, i, n) {
  52950. this.v0 = e,
  52951. this.v1 = t,
  52952. this.v2 = i,
  52953. this.v3 = n
  52954. }
  52955. ,
  52956. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52957. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52958. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52959. var t = Ci.ShapeUtils.b3;
  52960. 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))
  52961. }
  52962. ,
  52963. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52964. var t = Ci.CurveUtils.tangentCubicBezier;
  52965. 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()
  52966. }
  52967. ,
  52968. Ci.SplineCurve = function(e) {
  52969. this.points = null == e ? [] : e
  52970. }
  52971. ,
  52972. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52973. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52974. Ci.SplineCurve.prototype.getPoint = function(e) {
  52975. var t = this.points
  52976. , i = (t.length - 1) * e
  52977. , n = Math.floor(i)
  52978. , r = i - n
  52979. , o = t[0 === n ? n : n - 1]
  52980. , a = t[n]
  52981. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52982. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52983. , c = Ci.CurveUtils.interpolate;
  52984. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52985. }
  52986. ,
  52987. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52988. this.aX = e,
  52989. this.aY = t,
  52990. this.xRadius = i,
  52991. this.yRadius = n,
  52992. this.aStartAngle = r,
  52993. this.aEndAngle = o,
  52994. this.aClockwise = a,
  52995. this.aRotation = s || 0
  52996. }
  52997. ,
  52998. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52999. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53000. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53001. var t, i = this.aEndAngle - this.aStartAngle;
  53002. i < 0 && (i += 2 * Math.PI),
  53003. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53004. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53005. var n = this.aX + this.xRadius * Math.cos(t)
  53006. , r = this.aY + this.yRadius * Math.sin(t);
  53007. if (0 !== this.aRotation) {
  53008. var o = Math.cos(this.aRotation)
  53009. , a = Math.sin(this.aRotation)
  53010. , s = n
  53011. , l = r;
  53012. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53013. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53014. }
  53015. return new Ci.Vector2(n,r)
  53016. }
  53017. ,
  53018. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53019. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53020. }
  53021. ,
  53022. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53023. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53024. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53025. this.v1 = e,
  53026. this.v2 = t
  53027. }, function(e) {
  53028. var t = new Ci.Vector3;
  53029. return t.subVectors(this.v2, this.v1),
  53030. t.multiplyScalar(e),
  53031. t.add(this.v1),
  53032. t
  53033. }),
  53034. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53035. this.v0 = e,
  53036. this.v1 = t,
  53037. this.v2 = i
  53038. }, function(e) {
  53039. var t = Ci.ShapeUtils.b2;
  53040. 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))
  53041. }),
  53042. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53043. this.v0 = e,
  53044. this.v1 = t,
  53045. this.v2 = i,
  53046. this.v3 = n
  53047. }, function(e) {
  53048. var t = Ci.ShapeUtils.b3;
  53049. 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))
  53050. }),
  53051. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53052. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53053. this.points = null == e ? [] : e
  53054. }, function(e) {
  53055. var t = this.points
  53056. , i = (t.length - 1) * e
  53057. , n = Math.floor(i)
  53058. , r = i - n
  53059. , o = t[0 == n ? n : n - 1]
  53060. , a = t[n]
  53061. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53062. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53063. , c = Ci.CurveUtils.interpolate;
  53064. 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))
  53065. }),
  53066. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53067. Xt = new xi,
  53068. Zt = new xi,
  53069. Kt = new xi,
  53070. xi.prototype.init = function(e, t, i, n) {
  53071. this.c0 = e,
  53072. this.c1 = i,
  53073. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53074. this.c3 = 2 * e - 2 * t + i + n
  53075. }
  53076. ,
  53077. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53078. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53079. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53080. s *= o,
  53081. l *= o,
  53082. this.init(t, i, s, l)
  53083. }
  53084. ,
  53085. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53086. this.init(t, i, r * (i - e), r * (n - t))
  53087. }
  53088. ,
  53089. xi.prototype.calc = function(e) {
  53090. var t = e * e
  53091. , i = t * e;
  53092. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53093. }
  53094. ,
  53095. Ci.Curve.create(function(e) {
  53096. this.points = e || [],
  53097. this.closed = !1
  53098. }, function(e) {
  53099. var t, i, n, r, o, a, s, l, c = this.points;
  53100. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53101. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53102. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53103. n = 1),
  53104. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53105. qt),
  53106. a = c[i % r],
  53107. s = c[(i + 1) % r],
  53108. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53109. qt),
  53110. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53111. var h = "chordal" === this.type ? .5 : .25
  53112. , u = Math.pow(o.distanceToSquared(a), h)
  53113. , d = Math.pow(a.distanceToSquared(s), h)
  53114. , p = Math.pow(s.distanceToSquared(l), h);
  53115. d < 1e-4 && (d = 1),
  53116. u < 1e-4 && (u = d),
  53117. p < 1e-4 && (p = d),
  53118. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53119. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53120. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53121. } else if ("catmullrom" === this.type) {
  53122. var f = void 0 !== this.tension ? this.tension : .5;
  53123. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53124. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53125. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53126. }
  53127. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53128. })),
  53129. Ci.ClosedSplineCurve3 = function(e) {
  53130. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53131. Ci.CatmullRomCurve3.call(this, e),
  53132. this.type = "catmullrom",
  53133. this.closed = !0
  53134. }
  53135. ,
  53136. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53137. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53138. Ci.Geometry.call(this),
  53139. this.type = "BoxGeometry",
  53140. this.parameters = {
  53141. width: e,
  53142. height: t,
  53143. depth: i,
  53144. widthSegments: n,
  53145. heightSegments: r,
  53146. depthSegments: o
  53147. },
  53148. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53149. this.mergeVertices()
  53150. }
  53151. ,
  53152. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53153. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53154. Ci.CubeGeometry = Ci.BoxGeometry,
  53155. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53156. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53157. 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++)
  53158. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53159. var b = _ * u - p;
  53160. C[e] = b * n,
  53161. C[t] = E * r,
  53162. C[i] = g,
  53163. P[D] = C.x,
  53164. P[D + 1] = C.y,
  53165. P[D + 2] = C.z,
  53166. C[e] = 0,
  53167. C[t] = 0,
  53168. C[i] = 0 < s ? 1 : -1,
  53169. O[D] = C.x,
  53170. O[D + 1] = C.y,
  53171. O[D + 2] = C.z,
  53172. L[N] = _ / l,
  53173. L[N + 1] = 1 - I / c,
  53174. D += 3,
  53175. N += 2,
  53176. y += 1
  53177. }
  53178. for (I = 0; I < c; I++)
  53179. for (_ = 0; _ < l; _++) {
  53180. var w = B + _ + m * I
  53181. , T = B + _ + m * (I + 1)
  53182. , x = B + (_ + 1) + m * (I + 1)
  53183. , S = B + (_ + 1) + m * I;
  53184. R[F] = w,
  53185. R[F + 1] = T,
  53186. R[F + 2] = S,
  53187. R[F + 3] = T,
  53188. R[F + 4] = x,
  53189. R[F + 5] = S,
  53190. F += 6,
  53191. A += 6
  53192. }
  53193. M.addGroup(V, A, h),
  53194. V += A,
  53195. B += y
  53196. }
  53197. Ci.BufferGeometry.call(this),
  53198. this.type = "BoxBufferGeometry",
  53199. this.parameters = {
  53200. width: e,
  53201. height: t,
  53202. depth: i,
  53203. widthSegments: n,
  53204. heightSegments: r,
  53205. depthSegments: o
  53206. };
  53207. var M = this;
  53208. n = Math.floor(n) || 1,
  53209. r = Math.floor(r) || 1,
  53210. o = Math.floor(o) || 1;
  53211. var s, l, c, h, u = (h = 0,
  53212. h += (s = n) * (l = r) * 2,
  53213. h += s * (c = o) * 2,
  53214. 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;
  53215. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53216. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53217. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53218. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53219. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53220. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53221. this.setIndex(new Ci.BufferAttribute(R,1)),
  53222. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53223. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53224. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53225. }
  53226. ,
  53227. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53228. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53229. Ci.CircleGeometry = function(e, t, i, n) {
  53230. Ci.Geometry.call(this),
  53231. this.type = "CircleGeometry",
  53232. this.parameters = {
  53233. radius: e,
  53234. segments: t,
  53235. thetaStart: i,
  53236. thetaLength: n
  53237. },
  53238. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53239. }
  53240. ,
  53241. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53242. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53243. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53244. Ci.BufferGeometry.call(this),
  53245. this.type = "CircleBufferGeometry",
  53246. this.parameters = {
  53247. radius: e,
  53248. segments: t,
  53249. thetaStart: i,
  53250. thetaLength: n
  53251. },
  53252. e = e || 50,
  53253. t = void 0 !== t ? Math.max(3, t) : 8,
  53254. i = void 0 !== i ? i : 0,
  53255. n = void 0 !== n ? n : 2 * Math.PI;
  53256. var r = t + 2
  53257. , o = new Float32Array(3 * r)
  53258. , a = new Float32Array(3 * r)
  53259. , s = new Float32Array(2 * r);
  53260. a[2] = 1,
  53261. s[0] = .5,
  53262. s[1] = .5;
  53263. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53264. c += 3,
  53265. h += 2) {
  53266. var u = i + l / t * n;
  53267. o[c] = e * Math.cos(u),
  53268. o[c + 1] = e * Math.sin(u),
  53269. a[c + 2] = 1,
  53270. s[h] = (o[c] / e + 1) / 2,
  53271. s[h + 1] = (o[c + 1] / e + 1) / 2
  53272. }
  53273. var d = [];
  53274. for (c = 1; c <= t; c++)
  53275. d.push(c, c + 1, 0);
  53276. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53277. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53278. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53279. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53280. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53281. }
  53282. ,
  53283. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53284. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53285. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53286. function t(e) {
  53287. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53288. for (i = b,
  53289. t = 1; t <= m; t++)
  53290. I.setXYZ(b, 0, x * s, 0),
  53291. E.setXYZ(b, 0, s, 0),
  53292. !0 === e ? (r.x = t / m,
  53293. r.y = 0) : (r.x = (t - 1) / m,
  53294. r.y = 1),
  53295. _.setXY(b, r.x, r.y),
  53296. b++;
  53297. for (n = b,
  53298. t = 0; t <= m; t++) {
  53299. var l = t / m;
  53300. o.x = a * Math.sin(l * A + y),
  53301. o.y = x * s,
  53302. o.z = a * Math.cos(l * A + y),
  53303. I.setXYZ(b, o.x, o.y, o.z),
  53304. E.setXYZ(b, 0, s, 0),
  53305. _.setXY(b, l, !0 === e ? 1 : 0),
  53306. b++
  53307. }
  53308. for (t = 0; t < m; t++) {
  53309. var c = i + t
  53310. , h = n + t;
  53311. !0 === e ? (C.setX(w, h),
  53312. w++,
  53313. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53314. w++,
  53315. C.setX(w, h)),
  53316. w++,
  53317. C.setX(w, c),
  53318. w++
  53319. }
  53320. }
  53321. Ci.BufferGeometry.call(this),
  53322. this.type = "CylinderBufferGeometry",
  53323. this.parameters = {
  53324. radiusTop: p,
  53325. radiusBottom: f,
  53326. height: g,
  53327. radialSegments: m,
  53328. heightSegments: v,
  53329. openEnded: e,
  53330. thetaStart: y,
  53331. thetaLength: A
  53332. },
  53333. p = void 0 !== p ? p : 20,
  53334. f = void 0 !== f ? f : 20,
  53335. g = void 0 !== g ? g : 100,
  53336. m = Math.floor(m) || 8,
  53337. v = Math.floor(v) || 1,
  53338. e = void 0 !== e && e,
  53339. y = void 0 !== y ? y : 0,
  53340. A = void 0 !== A ? A : 2 * Math.PI;
  53341. var i, n, r = (n = (m + 1) * (v + 1),
  53342. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53343. n), o = (i = m * v * 2 * 3,
  53344. !1 === e && (i += 2 * m * 3),
  53345. 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;
  53346. (function() {
  53347. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53348. for (t = 0; t <= v; t++) {
  53349. var o = []
  53350. , a = t / v
  53351. , s = a * (f - p) + p;
  53352. for (e = 0; e <= m; e++) {
  53353. var l = e / m;
  53354. n.x = s * Math.sin(l * A + y),
  53355. n.y = -a * g + x,
  53356. n.z = s * Math.cos(l * A + y),
  53357. I.setXYZ(b, n.x, n.y, n.z),
  53358. i.copy(n),
  53359. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53360. i.z = Math.cos(l * A + y)),
  53361. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53362. E.setXYZ(b, i.x, i.y, i.z),
  53363. _.setXY(b, l, 1 - a),
  53364. o.push(b),
  53365. b++
  53366. }
  53367. T.push(o)
  53368. }
  53369. for (e = 0; e < m; e++)
  53370. for (t = 0; t < v; t++) {
  53371. var c = T[t][e]
  53372. , h = T[t + 1][e]
  53373. , u = T[t + 1][e + 1]
  53374. , d = T[t][e + 1];
  53375. C.setX(w, c),
  53376. w++,
  53377. C.setX(w, h),
  53378. w++,
  53379. C.setX(w, d),
  53380. w++,
  53381. C.setX(w, h),
  53382. w++,
  53383. C.setX(w, u),
  53384. w++,
  53385. C.setX(w, d),
  53386. w++
  53387. }
  53388. }
  53389. )(),
  53390. !1 === e && (0 < p && t(!0),
  53391. 0 < f && t(!1)),
  53392. this.setIndex(C),
  53393. this.addAttribute("position", I),
  53394. this.addAttribute("normal", E),
  53395. this.addAttribute("uv", _)
  53396. }
  53397. ,
  53398. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53399. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53400. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53401. Ci.Geometry.call(this),
  53402. this.type = "CylinderGeometry",
  53403. this.parameters = {
  53404. radiusTop: e,
  53405. radiusBottom: t,
  53406. height: i,
  53407. radialSegments: n,
  53408. heightSegments: r,
  53409. openEnded: o,
  53410. thetaStart: a,
  53411. thetaLength: s
  53412. },
  53413. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53414. this.mergeVertices()
  53415. }
  53416. ,
  53417. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53418. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53419. Ci.EdgesGeometry = function(e, t) {
  53420. function i(e, t) {
  53421. return e - t
  53422. }
  53423. Ci.BufferGeometry.call(this),
  53424. t = void 0 !== t ? t : 1;
  53425. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53426. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53427. n.mergeVertices(),
  53428. n.computeFaceNormals();
  53429. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53430. for (var d = c[h], p = 0; p < 3; p++) {
  53431. o[0] = d[s[p]],
  53432. o[1] = d[s[(p + 1) % 3]],
  53433. o.sort(i),
  53434. void 0 === a[g = o.toString()] ? a[g] = {
  53435. vert1: o[0],
  53436. vert2: o[1],
  53437. face1: h,
  53438. face2: void 0
  53439. } : a[g].face2 = h
  53440. }
  53441. var f = [];
  53442. for (var g in a) {
  53443. var m = a[g];
  53444. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53445. var v = l[m.vert1];
  53446. f.push(v.x),
  53447. f.push(v.y),
  53448. f.push(v.z),
  53449. v = l[m.vert2],
  53450. f.push(v.x),
  53451. f.push(v.y),
  53452. f.push(v.z)
  53453. }
  53454. }
  53455. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53456. }
  53457. ,
  53458. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53459. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53460. Ci.ExtrudeGeometry = function(e, t) {
  53461. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53462. this.type = "ExtrudeGeometry",
  53463. e = Array.isArray(e) ? e : [e],
  53464. this.addShapeList(e, t),
  53465. void this.computeFaceNormals())
  53466. }
  53467. ;
  53468. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53469. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53470. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53471. for (var i = e.length, n = 0; n < i; n++) {
  53472. var r = e[n];
  53473. this.addShape(r, t)
  53474. }
  53475. }
  53476. ,
  53477. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53478. function i(e, t, i) {
  53479. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53480. t.clone().multiplyScalar(i).add(e)
  53481. }
  53482. function n(e, t, i) {
  53483. 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;
  53484. if (Math.abs(u) > Number.EPSILON) {
  53485. var d = Math.sqrt(h)
  53486. , p = Math.sqrt(l * l + c * c)
  53487. , f = t.x - s / d
  53488. , g = t.y + a / d
  53489. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53490. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53491. if (v <= 2)
  53492. return new Ci.Vector2(n,r);
  53493. o = Math.sqrt(v / 2)
  53494. } else {
  53495. var y = !1;
  53496. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53497. o = y ? (n = -s,
  53498. r = a,
  53499. Math.sqrt(h)) : (n = a,
  53500. r = s,
  53501. Math.sqrt(h / 2))
  53502. }
  53503. return new Ci.Vector2(n / o,r / o)
  53504. }
  53505. function r(e, t) {
  53506. var i, n;
  53507. for (G = e.length; 0 <= --G; ) {
  53508. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53509. var r = 0
  53510. , o = A + 2 * m;
  53511. for (r = 0; r < o; r++) {
  53512. var a = U * r
  53513. , s = U * (r + 1);
  53514. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53515. }
  53516. }
  53517. }
  53518. function o(e, t, i) {
  53519. T.vertices.push(new Ci.Vector3(e,t,i))
  53520. }
  53521. function a(e, t, i) {
  53522. e += x,
  53523. t += x,
  53524. i += x,
  53525. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53526. var n = E.generateTopUV(T, e, t, i);
  53527. T.faceVertexUvs[0].push(n)
  53528. }
  53529. function l(e, t, i, n) {
  53530. e += x,
  53531. t += x,
  53532. i += x,
  53533. n += x,
  53534. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53535. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53536. var r = E.generateSideWallUV(T, e, t, i, n);
  53537. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53538. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53539. }
  53540. 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;
  53541. C && (s = C.getSpacedPoints(A),
  53542. v = !(I = !0),
  53543. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53544. h = new Ci.Vector3,
  53545. u = new Ci.Vector3,
  53546. d = new Ci.Vector3),
  53547. v || (g = f = m = 0);
  53548. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53549. if (P) {
  53550. for (M = M.reverse(),
  53551. b = 0,
  53552. w = R.length; b < w; b++)
  53553. _ = R[b],
  53554. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53555. P = !1
  53556. }
  53557. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53558. , L = M;
  53559. for (b = 0,
  53560. w = R.length; b < w; b++)
  53561. _ = R[b],
  53562. M = M.concat(_);
  53563. 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++,
  53564. j++,
  53565. Y++)
  53566. j === W && (j = 0),
  53567. Y === W && (Y = 0),
  53568. z[G] = n(L[G], L[j], L[Y]);
  53569. var q, X, Z = [], K = z.concat();
  53570. for (b = 0,
  53571. w = R.length; b < w; b++) {
  53572. for (_ = R[b],
  53573. q = [],
  53574. G = 0,
  53575. j = (W = _.length) - 1,
  53576. Y = G + 1; G < W; G++,
  53577. j++,
  53578. Y++)
  53579. j === W && (j = 0),
  53580. Y === W && (Y = 0),
  53581. q[G] = n(_[G], _[j], _[Y]);
  53582. Z.push(q),
  53583. K = K.concat(q)
  53584. }
  53585. for (D = 0; D < m; D++) {
  53586. for (B = f * (1 - (F = D / m)),
  53587. N = g * Math.sin(F * Math.PI / 2),
  53588. G = 0,
  53589. W = L.length; G < W; G++)
  53590. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53591. for (b = 0,
  53592. w = R.length; b < w; b++)
  53593. for (_ = R[b],
  53594. q = Z[b],
  53595. G = 0,
  53596. W = _.length; G < W; G++)
  53597. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53598. }
  53599. for (N = g,
  53600. G = 0; G < U; G++)
  53601. V = v ? i(M[G], K[G], N) : M[G],
  53602. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53603. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53604. d.copy(s[0]).add(u).add(h),
  53605. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53606. for (X = 1; X <= A; X++)
  53607. for (G = 0; G < U; G++)
  53608. V = v ? i(M[G], K[G], N) : M[G],
  53609. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53610. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53611. d.copy(s[X]).add(u).add(h),
  53612. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53613. for (D = m - 1; 0 <= D; D--) {
  53614. for (B = f * (1 - (F = D / m)),
  53615. N = g * Math.sin(F * Math.PI / 2),
  53616. G = 0,
  53617. W = L.length; G < W; G++)
  53618. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53619. for (b = 0,
  53620. w = R.length; b < w; b++)
  53621. for (_ = R[b],
  53622. q = Z[b],
  53623. G = 0,
  53624. W = _.length; G < W; G++)
  53625. V = i(_[G], q[G], N),
  53626. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53627. }
  53628. (function() {
  53629. if (v) {
  53630. var e = 0
  53631. , t = U * e;
  53632. for (G = 0; G < H; G++)
  53633. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53634. for (t = U * (e = A + 2 * m),
  53635. G = 0; G < H; G++)
  53636. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53637. } else {
  53638. for (G = 0; G < H; G++)
  53639. a((k = O[G])[2], k[1], k[0]);
  53640. for (G = 0; G < H; G++)
  53641. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53642. }
  53643. }
  53644. )(),
  53645. function() {
  53646. var e = 0;
  53647. for (r(L, e),
  53648. e += L.length,
  53649. b = 0,
  53650. w = R.length; b < w; b++)
  53651. r(_ = R[b], e),
  53652. e += _.length
  53653. }()
  53654. }
  53655. ,
  53656. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53657. generateTopUV: function(e, t, i, n) {
  53658. var r = e.vertices
  53659. , o = r[t]
  53660. , a = r[i]
  53661. , s = r[n];
  53662. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53663. },
  53664. generateSideWallUV: function(e, t, i, n, r) {
  53665. var o = e.vertices
  53666. , a = o[t]
  53667. , s = o[i]
  53668. , l = o[n]
  53669. , c = o[r];
  53670. 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)]
  53671. }
  53672. },
  53673. Ci.ShapeGeometry = function(e, t) {
  53674. Ci.Geometry.call(this),
  53675. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53676. this.addShapeList(e, t),
  53677. this.computeFaceNormals()
  53678. }
  53679. ,
  53680. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53681. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53682. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53683. for (var i = 0, n = e.length; i < n; i++)
  53684. this.addShape(e[i], t);
  53685. return this
  53686. }
  53687. ,
  53688. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53689. void 0 === t && (t = {});
  53690. 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);
  53691. if (d) {
  53692. for (h = h.reverse(),
  53693. i = 0,
  53694. n = u.length; i < n; i++)
  53695. r = u[i],
  53696. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53697. d = !1
  53698. }
  53699. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53700. for (i = 0,
  53701. n = u.length; i < n; i++)
  53702. r = u[i],
  53703. h = h.concat(r);
  53704. var f, g, m = h.length, v = p.length;
  53705. for (i = 0; i < m; i++)
  53706. f = h[i],
  53707. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53708. for (i = 0; i < v; i++) {
  53709. var y = (g = p[i])[0] + l
  53710. , A = g[1] + l
  53711. , C = g[2] + l;
  53712. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53713. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53714. }
  53715. }
  53716. ,
  53717. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53718. Ci.BufferGeometry.call(this),
  53719. this.type = "LatheBufferGeometry",
  53720. this.parameters = {
  53721. points: e,
  53722. segments: t,
  53723. phiStart: i,
  53724. phiLength: n
  53725. },
  53726. t = Math.floor(t) || 12,
  53727. i = i || 0,
  53728. n = n || 2 * Math.PI,
  53729. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53730. 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,
  53731. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53732. for (o = 0; o <= t; o++) {
  53733. var v = i + o * f * n
  53734. , y = Math.sin(v)
  53735. , A = Math.cos(v);
  53736. for (a = 0; a <= e.length - 1; a++)
  53737. g.x = e[a].x * y,
  53738. g.y = e[a].y,
  53739. g.z = e[a].x * A,
  53740. h.setXYZ(d, g.x, g.y, g.z),
  53741. m.x = o / t,
  53742. m.y = a / (e.length - 1),
  53743. u.setXY(d, m.x, m.y),
  53744. d++
  53745. }
  53746. for (o = 0; o < t; o++)
  53747. for (a = 0; a < e.length - 1; a++) {
  53748. var C = r = a + o * e.length
  53749. , I = r + e.length
  53750. , E = r + e.length + 1
  53751. , _ = r + 1;
  53752. c.setX(p, C),
  53753. p++,
  53754. c.setX(p, I),
  53755. p++,
  53756. c.setX(p, _),
  53757. p++,
  53758. c.setX(p, I),
  53759. p++,
  53760. c.setX(p, E),
  53761. p++,
  53762. c.setX(p, _),
  53763. p++
  53764. }
  53765. if (this.setIndex(c),
  53766. this.addAttribute("position", h),
  53767. this.addAttribute("uv", u),
  53768. this.computeVertexNormals(),
  53769. n === 2 * Math.PI) {
  53770. var b = this.attributes.normal.array
  53771. , w = new Ci.Vector3
  53772. , T = new Ci.Vector3
  53773. , x = new Ci.Vector3;
  53774. for (r = t * e.length * 3,
  53775. a = o = 0; o < e.length; o++,
  53776. a += 3)
  53777. w.x = b[a + 0],
  53778. w.y = b[a + 1],
  53779. w.z = b[a + 2],
  53780. T.x = b[r + a + 0],
  53781. T.y = b[r + a + 1],
  53782. T.z = b[r + a + 2],
  53783. x.addVectors(w, T).normalize(),
  53784. b[a + 0] = b[r + a + 0] = x.x,
  53785. b[a + 1] = b[r + a + 1] = x.y,
  53786. b[a + 2] = b[r + a + 2] = x.z
  53787. }
  53788. }
  53789. ,
  53790. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53791. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53792. Ci.LatheGeometry = function(e, t, i, n) {
  53793. Ci.Geometry.call(this),
  53794. this.type = "LatheGeometry",
  53795. this.parameters = {
  53796. points: e,
  53797. segments: t,
  53798. phiStart: i,
  53799. phiLength: n
  53800. },
  53801. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53802. this.mergeVertices()
  53803. }
  53804. ,
  53805. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53806. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53807. Ci.PlaneGeometry = function(e, t, i, n) {
  53808. Ci.Geometry.call(this),
  53809. this.type = "PlaneGeometry",
  53810. this.parameters = {
  53811. width: e,
  53812. height: t,
  53813. widthSegments: i,
  53814. heightSegments: n
  53815. },
  53816. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53817. }
  53818. ,
  53819. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53820. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53821. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53822. Ci.BufferGeometry.call(this),
  53823. this.type = "PlaneBufferGeometry",
  53824. this.parameters = {
  53825. width: e,
  53826. height: t,
  53827. widthSegments: i,
  53828. heightSegments: n
  53829. };
  53830. 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++)
  53831. for (var y = v * u - o, A = 0; A < l; A++) {
  53832. var C = A * h - r;
  53833. d[g] = C,
  53834. d[g + 1] = -y,
  53835. p[g + 2] = 1,
  53836. f[m] = A / a,
  53837. f[m + 1] = 1 - v / s,
  53838. g += 3,
  53839. m += 2
  53840. }
  53841. g = 0;
  53842. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53843. for (v = 0; v < s; v++)
  53844. for (A = 0; A < a; A++) {
  53845. var E = A + l * v
  53846. , _ = A + l * (v + 1)
  53847. , b = A + 1 + l * (v + 1)
  53848. , w = A + 1 + l * v;
  53849. I[g] = E,
  53850. I[g + 1] = _,
  53851. I[g + 2] = w,
  53852. I[g + 3] = _,
  53853. I[g + 4] = b,
  53854. I[g + 5] = w,
  53855. g += 6
  53856. }
  53857. this.setIndex(new Ci.BufferAttribute(I,1)),
  53858. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53859. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53860. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53861. }
  53862. ,
  53863. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53864. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53865. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53866. Ci.BufferGeometry.call(this),
  53867. this.type = "RingBufferGeometry",
  53868. this.parameters = {
  53869. innerRadius: e,
  53870. outerRadius: t,
  53871. thetaSegments: i,
  53872. phiSegments: n,
  53873. thetaStart: r,
  53874. thetaLength: o
  53875. },
  53876. e = e || 20,
  53877. t = t || 50,
  53878. r = void 0 !== r ? r : 0,
  53879. o = void 0 !== o ? o : 2 * Math.PI;
  53880. 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;
  53881. for (s = 0; s <= n; s++) {
  53882. for (l = 0; l <= i; l++)
  53883. a = r + l / i * o,
  53884. A.x = v * Math.cos(a),
  53885. A.y = v * Math.sin(a),
  53886. d.setXYZ(g, A.x, A.y, A.z),
  53887. p.setXYZ(g, 0, 0, 1),
  53888. C.x = (A.x / t + 1) / 2,
  53889. C.y = (A.y / t + 1) / 2,
  53890. f.setXY(g, C.x, C.y),
  53891. g++;
  53892. v += y
  53893. }
  53894. for (s = 0; s < n; s++) {
  53895. var I = s * (i + 1);
  53896. for (l = 0; l < i; l++) {
  53897. var E = a = l + I
  53898. , _ = a + i + 1
  53899. , b = a + i + 2
  53900. , w = a + 1;
  53901. u.setX(m, E),
  53902. m++,
  53903. u.setX(m, _),
  53904. m++,
  53905. u.setX(m, b),
  53906. m++,
  53907. u.setX(m, E),
  53908. m++,
  53909. u.setX(m, b),
  53910. m++,
  53911. u.setX(m, w),
  53912. m++
  53913. }
  53914. }
  53915. this.setIndex(u),
  53916. this.addAttribute("position", d),
  53917. this.addAttribute("normal", p),
  53918. this.addAttribute("uv", f)
  53919. }
  53920. ,
  53921. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53922. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53923. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53924. Ci.Geometry.call(this),
  53925. this.type = "RingGeometry",
  53926. this.parameters = {
  53927. innerRadius: e,
  53928. outerRadius: t,
  53929. thetaSegments: i,
  53930. phiSegments: n,
  53931. thetaStart: r,
  53932. thetaLength: o
  53933. },
  53934. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53935. }
  53936. ,
  53937. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53938. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53939. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53940. Ci.Geometry.call(this),
  53941. this.type = "SphereGeometry",
  53942. this.parameters = {
  53943. radius: e,
  53944. widthSegments: t,
  53945. heightSegments: i,
  53946. phiStart: n,
  53947. phiLength: r,
  53948. thetaStart: o,
  53949. thetaLength: a
  53950. },
  53951. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53952. }
  53953. ,
  53954. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53955. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53956. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53957. Ci.BufferGeometry.call(this),
  53958. this.type = "SphereBufferGeometry",
  53959. this.parameters = {
  53960. radius: e,
  53961. widthSegments: t,
  53962. heightSegments: i,
  53963. phiStart: n,
  53964. phiLength: r,
  53965. thetaStart: o,
  53966. thetaLength: a
  53967. },
  53968. e = e || 50,
  53969. t = Math.max(3, Math.floor(t) || 8),
  53970. i = Math.max(2, Math.floor(i) || 6),
  53971. n = void 0 !== n ? n : 0,
  53972. r = void 0 !== r ? r : 2 * Math.PI;
  53973. 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++) {
  53974. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53975. var A = y / t
  53976. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53977. , I = e * Math.cos(o + v * a)
  53978. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53979. f.set(C, I, E).normalize(),
  53980. c.setXYZ(d, C, I, E),
  53981. h.setXYZ(d, f.x, f.y, f.z),
  53982. u.setXY(d, A, 1 - v),
  53983. m.push(d),
  53984. d++
  53985. }
  53986. p.push(m)
  53987. }
  53988. var _ = [];
  53989. for (g = 0; g < i; g++)
  53990. for (y = 0; y < t; y++) {
  53991. var b = p[g][y + 1]
  53992. , w = p[g][y]
  53993. , T = p[g + 1][y]
  53994. , x = p[g + 1][y + 1];
  53995. (0 !== g || 0 < o) && _.push(b, w, x),
  53996. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53997. }
  53998. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53999. this.addAttribute("position", c),
  54000. this.addAttribute("normal", h),
  54001. this.addAttribute("uv", u),
  54002. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54003. }
  54004. ,
  54005. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54006. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54007. Ci.TextGeometry = function(e, t) {
  54008. var i = (t = t || {}).font;
  54009. if (i instanceof Ci.Font == 0)
  54010. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54011. new Ci.Geometry;
  54012. var n = i.generateShapes(e, t.size, t.curveSegments);
  54013. t.amount = void 0 !== t.height ? t.height : 50,
  54014. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54015. void 0 === t.bevelSize && (t.bevelSize = 8),
  54016. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54017. Ci.ExtrudeGeometry.call(this, n, t),
  54018. this.type = "TextGeometry"
  54019. }
  54020. ,
  54021. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54022. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54023. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54024. Ci.BufferGeometry.call(this),
  54025. this.type = "TorusBufferGeometry",
  54026. this.parameters = {
  54027. radius: e,
  54028. tube: t,
  54029. radialSegments: i,
  54030. tubularSegments: n,
  54031. arc: r
  54032. },
  54033. e = e || 100,
  54034. t = t || 40,
  54035. i = Math.floor(i) || 8,
  54036. n = Math.floor(n) || 6,
  54037. r = r || 2 * Math.PI;
  54038. 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;
  54039. for (o = 0; o <= i; o++)
  54040. for (a = 0; a <= n; a++) {
  54041. var A = a / n * r
  54042. , C = o / i * Math.PI * 2;
  54043. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54044. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54045. v.z = t * Math.sin(C),
  54046. h[p] = v.x,
  54047. h[p + 1] = v.y,
  54048. h[p + 2] = v.z,
  54049. m.x = e * Math.cos(A),
  54050. m.y = e * Math.sin(A),
  54051. y.subVectors(v, m).normalize(),
  54052. u[p] = y.x,
  54053. u[p + 1] = y.y,
  54054. u[p + 2] = y.z,
  54055. d[f] = a / n,
  54056. d[f + 1] = o / i,
  54057. p += 3,
  54058. f += 2
  54059. }
  54060. for (o = 1; o <= i; o++)
  54061. for (a = 1; a <= n; a++) {
  54062. var I = (n + 1) * o + a - 1
  54063. , E = (n + 1) * (o - 1) + a - 1
  54064. , _ = (n + 1) * (o - 1) + a
  54065. , b = (n + 1) * o + a;
  54066. c[g] = I,
  54067. c[g + 1] = E,
  54068. c[g + 2] = b,
  54069. c[g + 3] = E,
  54070. c[g + 4] = _,
  54071. c[g + 5] = b,
  54072. g += 6
  54073. }
  54074. this.setIndex(new Ci.BufferAttribute(c,1)),
  54075. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54076. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54077. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54078. }
  54079. ,
  54080. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54081. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54082. Ci.TorusGeometry = function(e, t, i, n, r) {
  54083. Ci.Geometry.call(this),
  54084. this.type = "TorusGeometry",
  54085. this.parameters = {
  54086. radius: e,
  54087. tube: t,
  54088. radialSegments: i,
  54089. tubularSegments: n,
  54090. arc: r
  54091. },
  54092. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54093. }
  54094. ,
  54095. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54096. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54097. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54098. function a(e, t, i, n, r) {
  54099. var o = Math.cos(e)
  54100. , a = Math.sin(e)
  54101. , s = i / t * e
  54102. , l = Math.cos(s);
  54103. r.x = n * (2 + l) * .5 * o,
  54104. r.y = n * (2 + l) * a * .5,
  54105. r.z = n * Math.sin(s) * .5
  54106. }
  54107. Ci.BufferGeometry.call(this),
  54108. this.type = "TorusKnotBufferGeometry",
  54109. this.parameters = {
  54110. radius: e,
  54111. tube: t,
  54112. tubularSegments: i,
  54113. radialSegments: n,
  54114. p: r,
  54115. q: o
  54116. },
  54117. e = e || 100,
  54118. t = t || 40,
  54119. i = Math.floor(i) || 64,
  54120. r = r || 2,
  54121. o = o || 3;
  54122. 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;
  54123. for (s = 0; s <= i; ++s) {
  54124. var w = s / i * r * Math.PI * 2;
  54125. for (a(w, r, o, e, C),
  54126. a(.01 + w, r, o, e, I),
  54127. _.subVectors(I, C),
  54128. b.addVectors(I, C),
  54129. E.crossVectors(_, b),
  54130. b.crossVectors(E, _),
  54131. E.normalize(),
  54132. b.normalize(),
  54133. l = 0; l <= n; ++l) {
  54134. var T = l / n * Math.PI * 2
  54135. , x = -t * Math.cos(T)
  54136. , S = t * Math.sin(T);
  54137. v.x = C.x + (x * b.x + S * E.x),
  54138. v.y = C.y + (x * b.y + S * E.y),
  54139. v.z = C.z + (x * b.z + S * E.z),
  54140. d.setXYZ(g, v.x, v.y, v.z),
  54141. y.subVectors(v, C).normalize(),
  54142. p.setXYZ(g, y.x, y.y, y.z),
  54143. A.x = s / i,
  54144. A.y = l / n,
  54145. f.setXY(g, A.x, A.y),
  54146. g++
  54147. }
  54148. }
  54149. for (l = 1; l <= i; l++)
  54150. for (s = 1; s <= n; s++) {
  54151. var M = (n + 1) * (l - 1) + (s - 1)
  54152. , R = (n + 1) * l + (s - 1)
  54153. , P = (n + 1) * l + s
  54154. , O = (n + 1) * (l - 1) + s;
  54155. u.setX(m, M),
  54156. m++,
  54157. u.setX(m, R),
  54158. m++,
  54159. u.setX(m, O),
  54160. m++,
  54161. u.setX(m, R),
  54162. m++,
  54163. u.setX(m, P),
  54164. m++,
  54165. u.setX(m, O),
  54166. m++
  54167. }
  54168. this.setIndex(u),
  54169. this.addAttribute("position", d),
  54170. this.addAttribute("normal", p),
  54171. this.addAttribute("uv", f)
  54172. }
  54173. ,
  54174. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54175. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54176. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54177. Ci.Geometry.call(this),
  54178. this.type = "TorusKnotGeometry",
  54179. this.parameters = {
  54180. radius: e,
  54181. tube: t,
  54182. tubularSegments: i,
  54183. radialSegments: n,
  54184. p: r,
  54185. q: o
  54186. },
  54187. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54188. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54189. this.mergeVertices()
  54190. }
  54191. ,
  54192. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54193. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54194. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54195. Ci.Geometry.call(this),
  54196. this.type = "TubeGeometry",
  54197. this.parameters = {
  54198. path: e,
  54199. segments: t,
  54200. radius: i,
  54201. radialSegments: n,
  54202. closed: r,
  54203. taper: o
  54204. },
  54205. t = t || 64,
  54206. i = i || 1,
  54207. n = n || 8,
  54208. r = r || !1,
  54209. o = o || Ci.TubeGeometry.NoTaper;
  54210. 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;
  54211. for (this.tangents = D,
  54212. this.normals = N,
  54213. this.binormals = F,
  54214. f = 0; f < P; f++)
  54215. for (M[f] = [],
  54216. l = f / (P - 1),
  54217. p = e.getPointAt(l),
  54218. D[f],
  54219. a = N[f],
  54220. s = F[f],
  54221. h = i * o(l),
  54222. g = 0; g < n; g++)
  54223. c = g / n * 2 * Math.PI,
  54224. u = -h * Math.cos(c),
  54225. d = h * Math.sin(c),
  54226. O.copy(p),
  54227. O.x += u * a.x + d * s.x,
  54228. O.y += u * a.y + d * s.y,
  54229. O.z += u * a.z + d * s.z,
  54230. M[f][g] = (T = O.x,
  54231. x = O.y,
  54232. S = O.z,
  54233. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54234. for (f = 0; f < t; f++)
  54235. for (g = 0; g < n; g++)
  54236. m = r ? (f + 1) % t : f + 1,
  54237. v = (g + 1) % n,
  54238. y = M[f][g],
  54239. A = M[m][g],
  54240. C = M[m][v],
  54241. I = M[f][v],
  54242. E = new Ci.Vector2(f / t,g / n),
  54243. _ = new Ci.Vector2((f + 1) / t,g / n),
  54244. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54245. w = new Ci.Vector2(f / t,(g + 1) / n),
  54246. this.faces.push(new Ci.Face3(y,A,I)),
  54247. this.faceVertexUvs[0].push([E, _, w]),
  54248. this.faces.push(new Ci.Face3(A,C,I)),
  54249. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54250. this.computeFaceNormals(),
  54251. this.computeVertexNormals()
  54252. }
  54253. ,
  54254. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54255. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54256. Ci.TubeGeometry.NoTaper = function(e) {
  54257. return 1
  54258. }
  54259. ,
  54260. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54261. return Math.sin(Math.PI * e)
  54262. }
  54263. ,
  54264. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54265. 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;
  54266. for (this.tangents = u,
  54267. this.normals = d,
  54268. this.binormals = p,
  54269. l = 0; l < m; l++)
  54270. c = l / (m - 1),
  54271. u[l] = e.getTangentAt(c),
  54272. u[l].normalize();
  54273. for (d[0] = new Ci.Vector3,
  54274. p[0] = new Ci.Vector3,
  54275. r = Number.MAX_VALUE,
  54276. o = Math.abs(u[0].x),
  54277. a = Math.abs(u[0].y),
  54278. s = Math.abs(u[0].z),
  54279. o <= r && (r = o,
  54280. h.set(1, 0, 0)),
  54281. a <= r && (r = a,
  54282. h.set(0, 1, 0)),
  54283. s <= r && h.set(0, 0, 1),
  54284. f.crossVectors(u[0], h).normalize(),
  54285. d[0].crossVectors(u[0], f),
  54286. p[0].crossVectors(u[0], d[0]),
  54287. l = 1; l < m; l++)
  54288. d[l] = d[l - 1].clone(),
  54289. p[l] = p[l - 1].clone(),
  54290. f.crossVectors(u[l - 1], u[l]),
  54291. f.length() > Number.EPSILON && (f.normalize(),
  54292. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54293. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54294. p[l].crossVectors(u[l], d[l]);
  54295. if (i)
  54296. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54297. n /= m - 1,
  54298. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54299. l = 1; l < m; l++)
  54300. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54301. p[l].crossVectors(u[l], d[l])
  54302. }
  54303. ,
  54304. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54305. function f(e) {
  54306. var t = e.normalize().clone();
  54307. t.index = m.vertices.push(t) - 1;
  54308. var i = a(e) / 2 / Math.PI + .5
  54309. , n = function(e) {
  54310. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54311. }(e) / Math.PI + .5;
  54312. return t.uv = new Ci.Vector2(i,1 - n),
  54313. t
  54314. }
  54315. function g(e, t, i, n) {
  54316. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54317. m.faces.push(r),
  54318. y.copy(e).add(t).add(i).divideScalar(3);
  54319. var o = a(y);
  54320. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54321. }
  54322. function r(e, t) {
  54323. 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++) {
  54324. a[l] = [];
  54325. 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++)
  54326. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54327. }
  54328. for (l = 0; l < i; l++)
  54329. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54330. var p = Math.floor(d / 2);
  54331. 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)
  54332. }
  54333. }
  54334. function a(e) {
  54335. return Math.atan2(e.z, -e.x)
  54336. }
  54337. function s(e, t, i) {
  54338. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54339. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54340. e.clone()
  54341. }
  54342. Ci.Geometry.call(this),
  54343. this.type = "PolyhedronGeometry",
  54344. this.parameters = {
  54345. vertices: e,
  54346. indices: t,
  54347. radius: i,
  54348. detail: n
  54349. },
  54350. i = i || 1,
  54351. n = n || 0;
  54352. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54353. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54354. var c = this.vertices
  54355. , h = []
  54356. , u = (o = 0,
  54357. 0);
  54358. for (l = t.length; o < l; o += 3,
  54359. u++) {
  54360. var d = c[t[o]]
  54361. , p = c[t[o + 1]]
  54362. , v = c[t[o + 2]];
  54363. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54364. }
  54365. var y = new Ci.Vector3;
  54366. for (o = 0,
  54367. l = h.length; o < l; o++)
  54368. r(h[o], n);
  54369. for (o = 0,
  54370. l = this.faceVertexUvs[0].length; o < l; o++) {
  54371. var A = this.faceVertexUvs[0][o]
  54372. , C = A[0].x
  54373. , I = A[1].x
  54374. , E = A[2].x
  54375. , _ = Math.max(C, I, E)
  54376. , b = Math.min(C, I, E);
  54377. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54378. I < .2 && (A[1].x += 1),
  54379. E < .2 && (A[2].x += 1))
  54380. }
  54381. for (o = 0,
  54382. l = this.vertices.length; o < l; o++)
  54383. this.vertices[o].multiplyScalar(i);
  54384. this.mergeVertices(),
  54385. this.computeFaceNormals(),
  54386. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54387. }
  54388. ,
  54389. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54390. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54391. Ci.DodecahedronGeometry = function(e, t) {
  54392. var i = (1 + Math.sqrt(5)) / 2
  54393. , n = 1 / i
  54394. , 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];
  54395. 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),
  54396. this.type = "DodecahedronGeometry",
  54397. this.parameters = {
  54398. radius: e,
  54399. detail: t
  54400. }
  54401. }
  54402. ,
  54403. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54404. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54405. Ci.IcosahedronGeometry = function(e, t) {
  54406. var i = (1 + Math.sqrt(5)) / 2
  54407. , 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];
  54408. 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),
  54409. this.type = "IcosahedronGeometry",
  54410. this.parameters = {
  54411. radius: e,
  54412. detail: t
  54413. }
  54414. }
  54415. ,
  54416. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54417. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54418. Ci.OctahedronGeometry = function(e, t) {
  54419. 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),
  54420. this.type = "OctahedronGeometry",
  54421. this.parameters = {
  54422. radius: e,
  54423. detail: t
  54424. }
  54425. }
  54426. ,
  54427. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54428. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54429. Ci.TetrahedronGeometry = function(e, t) {
  54430. 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),
  54431. this.type = "TetrahedronGeometry",
  54432. this.parameters = {
  54433. radius: e,
  54434. detail: t
  54435. }
  54436. }
  54437. ,
  54438. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54439. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54440. Ci.ParametricGeometry = function(e, t, i) {
  54441. Ci.Geometry.call(this),
  54442. this.type = "ParametricGeometry",
  54443. this.parameters = {
  54444. func: e,
  54445. slices: t,
  54446. stacks: i
  54447. };
  54448. 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;
  54449. for (n = 0; n <= i; n++)
  54450. for (a = n / i,
  54451. r = 0; r <= t; r++)
  54452. o = e(r / t, a),
  54453. g.push(o);
  54454. for (n = 0; n < i; n++)
  54455. for (r = 0; r < t; r++)
  54456. l = (s = n * y + r) + 1,
  54457. c = (n + 1) * y + r + 1,
  54458. h = (n + 1) * y + r,
  54459. u = new Ci.Vector2(r / t,n / i),
  54460. d = new Ci.Vector2((r + 1) / t,n / i),
  54461. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54462. f = new Ci.Vector2(r / t,(n + 1) / i),
  54463. m.push(new Ci.Face3(s,l,h)),
  54464. v.push([u, d, f]),
  54465. m.push(new Ci.Face3(l,c,h)),
  54466. v.push([d.clone(), p, f.clone()]);
  54467. this.computeFaceNormals(),
  54468. this.computeVertexNormals()
  54469. }
  54470. ,
  54471. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54472. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54473. Ci.WireframeGeometry = function(e) {
  54474. function t(e, t) {
  54475. return e - t
  54476. }
  54477. Ci.BufferGeometry.call(this);
  54478. var i = [0, 0]
  54479. , n = {}
  54480. , r = ["a", "b", "c"];
  54481. if (e instanceof Ci.Geometry) {
  54482. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54483. for (var u = a[c], d = 0; d < 3; d++) {
  54484. i[0] = u[r[d]],
  54485. i[1] = u[r[(d + 1) % 3]],
  54486. i.sort(t),
  54487. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54488. l[2 * s + 1] = i[1],
  54489. n[E] = !0,
  54490. s++)
  54491. }
  54492. var p = new Float32Array(2 * s * 3);
  54493. for (c = 0,
  54494. h = s; c < h; c++)
  54495. for (d = 0; d < 2; d++) {
  54496. var f = o[l[2 * c + d]];
  54497. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54498. p[_ + 1] = f.y,
  54499. p[_ + 2] = f.z
  54500. }
  54501. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54502. } else if (e instanceof Ci.BufferGeometry)
  54503. if (null !== e.index) {
  54504. var g = e.index.array
  54505. , m = (o = e.attributes.position,
  54506. e.groups);
  54507. s = 0;
  54508. 0 === m.length && e.addGroup(0, g.length);
  54509. l = new Uint32Array(2 * g.length);
  54510. for (var v = 0, y = m.length; v < y; ++v)
  54511. for (var A = m[v], C = A.start, I = (c = C,
  54512. C + A.count); c < I; c += 3)
  54513. for (d = 0; d < 3; d++) {
  54514. var E;
  54515. i[0] = g[c + d],
  54516. i[1] = g[c + (d + 1) % 3],
  54517. i.sort(t),
  54518. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54519. l[2 * s + 1] = i[1],
  54520. n[E] = !0,
  54521. s++)
  54522. }
  54523. for (p = new Float32Array(2 * s * 3),
  54524. c = 0,
  54525. h = s; c < h; c++)
  54526. for (d = 0; d < 2; d++) {
  54527. var _ = 6 * c + 3 * d
  54528. , b = l[2 * c + d];
  54529. p[_ + 0] = o.getX(b),
  54530. p[_ + 1] = o.getY(b),
  54531. p[_ + 2] = o.getZ(b)
  54532. }
  54533. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54534. } else {
  54535. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54536. for (p = new Float32Array(2 * s * 3),
  54537. c = 0,
  54538. h = w; c < h; c++)
  54539. for (d = 0; d < 3; d++) {
  54540. var T = 9 * c + 3 * d;
  54541. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54542. p[_ + 1] = o[1 + T],
  54543. p[_ + 2] = o[2 + T];
  54544. b = 9 * c + (d + 1) % 3 * 3;
  54545. p[_ + 3] = o[b],
  54546. p[_ + 4] = o[b + 1],
  54547. p[_ + 5] = o[b + 2]
  54548. }
  54549. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54550. }
  54551. }
  54552. ,
  54553. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54554. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54555. Ci.AxisHelper = function(e) {
  54556. e = e || 1;
  54557. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54558. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54559. , n = new Ci.BufferGeometry;
  54560. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54561. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54562. var r = new Ci.LineBasicMaterial({
  54563. vertexColors: Ci.VertexColors
  54564. });
  54565. Ci.LineSegments.call(this, n, r)
  54566. }
  54567. ,
  54568. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54569. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54570. Ci.ArrowHelper = function() {
  54571. var a = new Ci.Geometry;
  54572. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54573. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54574. return s.translate(0, -.5, 0),
  54575. function(e, t, i, n, r, o) {
  54576. Ci.Object3D.call(this),
  54577. void 0 === n && (n = 16776960),
  54578. void 0 === i && (i = 1),
  54579. void 0 === r && (r = .2 * i),
  54580. void 0 === o && (o = .2 * r),
  54581. this.position.copy(t),
  54582. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54583. color: n
  54584. })),
  54585. this.line.matrixAutoUpdate = !1,
  54586. this.add(this.line),
  54587. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54588. color: n
  54589. })),
  54590. this.cone.matrixAutoUpdate = !1,
  54591. this.add(this.cone),
  54592. this.setDirection(e),
  54593. this.setLength(i, r, o)
  54594. }
  54595. }(),
  54596. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54597. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54598. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54599. function(e) {
  54600. .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(),
  54601. yi = Math.acos(e.y),
  54602. this.quaternion.setFromAxisAngle(Ai, yi))
  54603. }
  54604. ),
  54605. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54606. void 0 === t && (t = .2 * e),
  54607. void 0 === i && (i = .2 * t),
  54608. this.line.scale.set(1, Math.max(0, e - t), 1),
  54609. this.line.updateMatrix(),
  54610. this.cone.scale.set(i, t, i),
  54611. this.cone.position.y = e,
  54612. this.cone.updateMatrix()
  54613. }
  54614. ,
  54615. Ci.ArrowHelper.prototype.setColor = function(e) {
  54616. this.line.material.color.set(e),
  54617. this.cone.material.color.set(e)
  54618. }
  54619. ,
  54620. Ci.BoxHelper = function(e) {
  54621. 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])
  54622. , i = new Float32Array(24)
  54623. , n = new Ci.BufferGeometry;
  54624. n.setIndex(new Ci.BufferAttribute(t,1)),
  54625. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54626. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54627. color: 16776960
  54628. })),
  54629. void 0 !== e && this.update(e)
  54630. }
  54631. ,
  54632. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54633. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54634. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54635. function(e) {
  54636. if (vi.setFromObject(e),
  54637. !vi.isEmpty()) {
  54638. var t = vi.min
  54639. , i = vi.max
  54640. , n = this.geometry.attributes.position
  54641. , r = n.array;
  54642. r[0] = i.x,
  54643. r[1] = i.y,
  54644. r[2] = i.z,
  54645. r[3] = t.x,
  54646. r[4] = i.y,
  54647. r[5] = i.z,
  54648. r[6] = t.x,
  54649. r[7] = t.y,
  54650. r[8] = i.z,
  54651. r[9] = i.x,
  54652. r[10] = t.y,
  54653. r[11] = i.z,
  54654. r[12] = i.x,
  54655. r[13] = i.y,
  54656. r[14] = t.z,
  54657. r[15] = t.x,
  54658. r[16] = i.y,
  54659. r[17] = t.z,
  54660. r[18] = t.x,
  54661. r[19] = t.y,
  54662. r[20] = t.z,
  54663. r[21] = i.x,
  54664. r[22] = t.y,
  54665. r[23] = t.z,
  54666. n.needsUpdate = !0,
  54667. this.geometry.computeBoundingSphere()
  54668. }
  54669. }
  54670. ),
  54671. Ci.BoundingBoxHelper = function(e, t) {
  54672. var i = void 0 !== t ? t : 8947848;
  54673. this.object = e,
  54674. this.box = new Ci.Box3,
  54675. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54676. color: i,
  54677. wireframe: !0
  54678. }))
  54679. }
  54680. ,
  54681. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54682. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54683. Ci.BoundingBoxHelper.prototype.update = function() {
  54684. this.box.setFromObject(this.object),
  54685. this.box.size(this.scale),
  54686. this.box.center(this.position)
  54687. }
  54688. ,
  54689. Ci.CameraHelper = function(e) {
  54690. function t(e, t, i) {
  54691. n(e, i),
  54692. n(t, i)
  54693. }
  54694. function n(e, t) {
  54695. i.vertices.push(new Ci.Vector3),
  54696. i.colors.push(new Ci.Color(t)),
  54697. void 0 === o[e] && (o[e] = []),
  54698. o[e].push(i.vertices.length - 1)
  54699. }
  54700. var i = new Ci.Geometry
  54701. , r = new Ci.LineBasicMaterial({
  54702. color: 16777215,
  54703. vertexColors: Ci.FaceColors
  54704. })
  54705. , o = {}
  54706. , a = 16755200
  54707. , s = 16711680
  54708. , l = 3355443;
  54709. t("n1", "n2", a),
  54710. t("n2", "n4", a),
  54711. t("n4", "n3", a),
  54712. t("n3", "n1", a),
  54713. t("f1", "f2", a),
  54714. t("f2", "f4", a),
  54715. t("f4", "f3", a),
  54716. t("f3", "f1", a),
  54717. t("n1", "f1", a),
  54718. t("n2", "f2", a),
  54719. t("n3", "f3", a),
  54720. t("n4", "f4", a),
  54721. t("p", "n1", s),
  54722. t("p", "n2", s),
  54723. t("p", "n3", s),
  54724. t("p", "n4", s),
  54725. t("u1", "u2", 43775),
  54726. t("u2", "u3", 43775),
  54727. t("u3", "u1", 43775),
  54728. t("c", "t", 16777215),
  54729. t("p", "c", l),
  54730. t("cn1", "cn2", l),
  54731. t("cn3", "cn4", l),
  54732. t("cf1", "cf2", l),
  54733. t("cf3", "cf4", l),
  54734. Ci.LineSegments.call(this, i, r),
  54735. this.camera = e,
  54736. this.camera.updateProjectionMatrix(),
  54737. this.matrix = e.matrixWorld,
  54738. this.matrixAutoUpdate = !1,
  54739. this.pointMap = o,
  54740. this.update()
  54741. }
  54742. ,
  54743. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54744. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54745. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54746. mi = new Ci.Camera,
  54747. function() {
  54748. pi = this.geometry,
  54749. fi = this.pointMap,
  54750. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54751. Ni("c", 0, 0, -1),
  54752. Ni("t", 0, 0, 1),
  54753. Ni("n1", -1, -1, -1),
  54754. Ni("n2", 1, -1, -1),
  54755. Ni("n3", -1, 1, -1),
  54756. Ni("n4", 1, 1, -1),
  54757. Ni("f1", -1, -1, 1),
  54758. Ni("f2", 1, -1, 1),
  54759. Ni("f3", -1, 1, 1),
  54760. Ni("f4", 1, 1, 1),
  54761. Ni("u1", .7, 1.1, -1),
  54762. Ni("u2", -.7, 1.1, -1),
  54763. Ni("u3", 0, 2, -1),
  54764. Ni("cf1", -1, 0, 1),
  54765. Ni("cf2", 1, 0, 1),
  54766. Ni("cf3", 0, -1, 1),
  54767. Ni("cf4", 0, 1, 1),
  54768. Ni("cn1", -1, 0, -1),
  54769. Ni("cn2", 1, 0, -1),
  54770. Ni("cn3", 0, -1, -1),
  54771. Ni("cn4", 0, 1, -1),
  54772. pi.verticesNeedUpdate = !0
  54773. }
  54774. ),
  54775. Ci.DirectionalLightHelper = function(e, t) {
  54776. Ci.Object3D.call(this),
  54777. this.light = e,
  54778. this.light.updateMatrixWorld(),
  54779. this.matrix = e.matrixWorld,
  54780. this.matrixAutoUpdate = !1,
  54781. t = t || 1;
  54782. var i = new Ci.Geometry;
  54783. 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));
  54784. var n = new Ci.LineBasicMaterial({
  54785. fog: !1
  54786. });
  54787. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54788. this.lightPlane = new Ci.Line(i,n),
  54789. this.add(this.lightPlane),
  54790. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54791. (n = new Ci.LineBasicMaterial({
  54792. fog: !1
  54793. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54794. this.targetLine = new Ci.Line(i,n),
  54795. this.add(this.targetLine),
  54796. this.update()
  54797. }
  54798. ,
  54799. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54800. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54801. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54802. this.lightPlane.geometry.dispose(),
  54803. this.lightPlane.material.dispose(),
  54804. this.targetLine.geometry.dispose(),
  54805. this.targetLine.material.dispose()
  54806. }
  54807. ,
  54808. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54809. ui = new Ci.Vector3,
  54810. di = new Ci.Vector3,
  54811. function() {
  54812. hi.setFromMatrixPosition(this.light.matrixWorld),
  54813. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54814. di.subVectors(ui, hi),
  54815. this.lightPlane.lookAt(di),
  54816. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54817. this.targetLine.geometry.vertices[1].copy(di),
  54818. this.targetLine.geometry.verticesNeedUpdate = !0,
  54819. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54820. }
  54821. ),
  54822. Ci.EdgesHelper = function(e, t, i) {
  54823. var n = void 0 !== t ? t : 16777215;
  54824. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54825. color: n
  54826. })),
  54827. this.matrix = e.matrixWorld,
  54828. this.matrixAutoUpdate = !1
  54829. }
  54830. ,
  54831. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54832. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54833. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54834. this.object = e,
  54835. this.size = void 0 !== t ? t : 1;
  54836. var r = void 0 !== i ? i : 16776960
  54837. , o = void 0 !== n ? n : 1
  54838. , a = 0
  54839. , s = this.object.geometry;
  54840. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54841. var l = new Ci.BufferGeometry
  54842. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54843. l.addAttribute("position", c),
  54844. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54845. color: r,
  54846. linewidth: o
  54847. })),
  54848. this.matrixAutoUpdate = !1,
  54849. this.update()
  54850. }
  54851. ,
  54852. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54853. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54854. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54855. li = new Ci.Vector3,
  54856. ci = new Ci.Matrix3,
  54857. function() {
  54858. this.object.updateMatrixWorld(!0),
  54859. ci.getNormalMatrix(this.object.matrixWorld);
  54860. 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++) {
  54861. var l = r[a]
  54862. , c = l.normal;
  54863. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54864. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54865. t.setXYZ(o, si.x, si.y, si.z),
  54866. o += 1,
  54867. t.setXYZ(o, li.x, li.y, li.z),
  54868. o += 1
  54869. }
  54870. return t.needsUpdate = !0,
  54871. this
  54872. }
  54873. ),
  54874. Ci.GridHelper = function(e, t) {
  54875. var i = new Ci.Geometry
  54876. , n = new Ci.LineBasicMaterial({
  54877. vertexColors: Ci.VertexColors
  54878. });
  54879. this.color1 = new Ci.Color(4473924),
  54880. this.color2 = new Ci.Color(8947848);
  54881. for (var r = -e; r <= e; r += t) {
  54882. 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));
  54883. var o = 0 === r ? this.color1 : this.color2;
  54884. i.colors.push(o, o, o, o)
  54885. }
  54886. Ci.LineSegments.call(this, i, n)
  54887. }
  54888. ,
  54889. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54890. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54891. Ci.GridHelper.prototype.setColors = function(e, t) {
  54892. this.color1.set(e),
  54893. this.color2.set(t),
  54894. this.geometry.colorsNeedUpdate = !0
  54895. }
  54896. ,
  54897. Ci.HemisphereLightHelper = function(e, t) {
  54898. Ci.Object3D.call(this),
  54899. this.light = e,
  54900. this.light.updateMatrixWorld(),
  54901. this.matrix = e.matrixWorld,
  54902. this.matrixAutoUpdate = !1,
  54903. this.colors = [new Ci.Color, new Ci.Color];
  54904. var i = new Ci.SphereGeometry(t,4,2);
  54905. i.rotateX(-Math.PI / 2);
  54906. for (var n = 0; n < 8; n++)
  54907. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54908. var r = new Ci.MeshBasicMaterial({
  54909. vertexColors: Ci.FaceColors,
  54910. wireframe: !0
  54911. });
  54912. this.lightSphere = new Ci.Mesh(i,r),
  54913. this.add(this.lightSphere),
  54914. this.update()
  54915. }
  54916. ,
  54917. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54918. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54919. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54920. this.lightSphere.geometry.dispose(),
  54921. this.lightSphere.material.dispose()
  54922. }
  54923. ,
  54924. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54925. function() {
  54926. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54927. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54928. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54929. this.lightSphere.geometry.colorsNeedUpdate = !0
  54930. }
  54931. ),
  54932. Ci.PointLightHelper = function(e, t) {
  54933. this.light = e,
  54934. this.light.updateMatrixWorld();
  54935. var i = new Ci.SphereGeometry(t,4,2)
  54936. , n = new Ci.MeshBasicMaterial({
  54937. wireframe: !0,
  54938. fog: !1
  54939. });
  54940. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54941. Ci.Mesh.call(this, i, n),
  54942. this.matrix = this.light.matrixWorld,
  54943. this.matrixAutoUpdate = !1
  54944. }
  54945. ,
  54946. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54947. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54948. Ci.PointLightHelper.prototype.dispose = function() {
  54949. this.geometry.dispose(),
  54950. this.material.dispose()
  54951. }
  54952. ,
  54953. Ci.PointLightHelper.prototype.update = function() {
  54954. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54955. }
  54956. ,
  54957. Ci.SkeletonHelper = function(e) {
  54958. this.bones = this.getBoneList(e);
  54959. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54960. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54961. t.vertices.push(new Ci.Vector3),
  54962. t.colors.push(new Ci.Color(0,0,1)),
  54963. t.colors.push(new Ci.Color(0,1,0)))
  54964. }
  54965. t.dynamic = !0;
  54966. var n = new Ci.LineBasicMaterial({
  54967. vertexColors: Ci.VertexColors,
  54968. depthTest: !1,
  54969. depthWrite: !1,
  54970. transparent: !0
  54971. });
  54972. Ci.LineSegments.call(this, t, n),
  54973. this.root = e,
  54974. this.matrix = e.matrixWorld,
  54975. this.matrixAutoUpdate = !1,
  54976. this.update()
  54977. }
  54978. ,
  54979. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54980. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54981. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54982. var t = [];
  54983. e instanceof Ci.Bone && t.push(e);
  54984. for (var i = 0; i < e.children.length; i++)
  54985. t.push.apply(t, this.getBoneList(e.children[i]));
  54986. return t
  54987. }
  54988. ,
  54989. Ci.SkeletonHelper.prototype.update = function() {
  54990. 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++) {
  54991. var o = this.bones[r];
  54992. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54993. e.vertices[n].setFromMatrixPosition(i),
  54994. i.multiplyMatrices(t, o.parent.matrixWorld),
  54995. e.vertices[n + 1].setFromMatrixPosition(i),
  54996. n += 2)
  54997. }
  54998. e.verticesNeedUpdate = !0,
  54999. e.computeBoundingSphere()
  55000. }
  55001. ,
  55002. Ci.SpotLightHelper = function(e) {
  55003. Ci.Object3D.call(this),
  55004. this.light = e,
  55005. this.light.updateMatrixWorld(),
  55006. this.matrix = e.matrixWorld,
  55007. this.matrixAutoUpdate = !1;
  55008. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55009. t.translate(0, -.5, 0),
  55010. t.rotateX(-Math.PI / 2);
  55011. var i = new Ci.MeshBasicMaterial({
  55012. wireframe: !0,
  55013. fog: !1
  55014. });
  55015. this.cone = new Ci.Mesh(t,i),
  55016. this.add(this.cone),
  55017. this.update()
  55018. }
  55019. ,
  55020. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55021. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55022. Ci.SpotLightHelper.prototype.dispose = function() {
  55023. this.cone.geometry.dispose(),
  55024. this.cone.material.dispose()
  55025. }
  55026. ,
  55027. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55028. oi = new Ci.Vector3,
  55029. function() {
  55030. var e = this.light.distance ? this.light.distance : 1e4
  55031. , t = e * Math.tan(this.light.angle);
  55032. this.cone.scale.set(t, t, e),
  55033. ri.setFromMatrixPosition(this.light.matrixWorld),
  55034. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55035. this.cone.lookAt(oi.sub(ri)),
  55036. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55037. }
  55038. ),
  55039. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55040. this.object = e,
  55041. this.size = void 0 !== t ? t : 1;
  55042. var r = void 0 !== i ? i : 16711680
  55043. , o = void 0 !== n ? n : 1
  55044. , a = 0
  55045. , s = this.object.geometry;
  55046. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55047. var l = new Ci.BufferGeometry
  55048. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55049. l.addAttribute("position", c),
  55050. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55051. color: r,
  55052. linewidth: o
  55053. })),
  55054. this.matrixAutoUpdate = !1,
  55055. this.update()
  55056. }
  55057. ,
  55058. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55059. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55060. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55061. ii = new Ci.Vector3,
  55062. ni = new Ci.Matrix3,
  55063. function() {
  55064. var e = ["a", "b", "c"];
  55065. this.object.updateMatrixWorld(!0),
  55066. ni.getNormalMatrix(this.object.matrixWorld);
  55067. var t = this.object.matrixWorld
  55068. , i = this.geometry.attributes.position
  55069. , n = this.object.geometry;
  55070. if (n instanceof Ci.Geometry)
  55071. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55072. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55073. var d = r[c[e[h]]]
  55074. , p = c.vertexNormals[h];
  55075. ti.copy(d).applyMatrix4(t),
  55076. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55077. i.setXYZ(a, ti.x, ti.y, ti.z),
  55078. a += 1,
  55079. i.setXYZ(a, ii.x, ii.y, ii.z),
  55080. a += 1
  55081. }
  55082. else if (n instanceof Ci.BufferGeometry) {
  55083. var f = n.attributes.position
  55084. , g = n.attributes.normal;
  55085. for (h = a = 0,
  55086. u = f.count; h < u; h++)
  55087. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55088. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55089. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55090. i.setXYZ(a, ti.x, ti.y, ti.z),
  55091. a += 1,
  55092. i.setXYZ(a, ii.x, ii.y, ii.z),
  55093. a += 1
  55094. }
  55095. return i.needsUpdate = !0,
  55096. this
  55097. }
  55098. ),
  55099. Ci.WireframeHelper = function(e, t) {
  55100. var i = void 0 !== t ? t : 16777215;
  55101. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55102. color: i
  55103. })),
  55104. this.matrix = e.matrixWorld,
  55105. this.matrixAutoUpdate = !1
  55106. }
  55107. ,
  55108. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55109. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55110. Ci.ImmediateRenderObject = function(e) {
  55111. Ci.Object3D.call(this),
  55112. this.material = e,
  55113. this.render = function(e) {}
  55114. }
  55115. ,
  55116. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55117. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55118. Ci.MorphBlendMesh = function(e, t) {
  55119. Ci.Mesh.call(this, e, t),
  55120. this.animationsMap = {},
  55121. this.animationsList = [];
  55122. var i = this.geometry.morphTargets.length
  55123. , n = i - 1
  55124. , r = i / 1;
  55125. this.createAnimation("__default", 0, n, r),
  55126. this.setAnimationWeight("__default", 1)
  55127. }
  55128. ,
  55129. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55130. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55131. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55132. var r = {
  55133. start: t,
  55134. end: i,
  55135. length: i - t + 1,
  55136. fps: n,
  55137. duration: (i - t) / n,
  55138. lastFrame: 0,
  55139. currentFrame: 0,
  55140. active: !1,
  55141. time: 0,
  55142. direction: 1,
  55143. weight: 1,
  55144. directionBackwards: !1,
  55145. mirroredLoop: !1
  55146. };
  55147. this.animationsMap[e] = r,
  55148. this.animationsList.push(r)
  55149. }
  55150. ,
  55151. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55152. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55153. var s = r.morphTargets[o].name.match(i);
  55154. if (s && 1 < s.length)
  55155. n[l = s[1]] || (n[l] = {
  55156. start: 1 / 0,
  55157. end: -1 / 0
  55158. }),
  55159. o < (c = n[l]).start && (c.start = o),
  55160. o > c.end && (c.end = o),
  55161. t = t || l
  55162. }
  55163. for (var l in n) {
  55164. var c = n[l];
  55165. this.createAnimation(l, c.start, c.end, e)
  55166. }
  55167. this.firstAnimation = t
  55168. }
  55169. ,
  55170. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55171. var t = this.animationsMap[e];
  55172. t && (t.direction = 1,
  55173. t.directionBackwards = !1)
  55174. }
  55175. ,
  55176. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55177. var t = this.animationsMap[e];
  55178. t && (t.direction = -1,
  55179. t.directionBackwards = !0)
  55180. }
  55181. ,
  55182. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55183. var i = this.animationsMap[e];
  55184. i && (i.fps = t,
  55185. i.duration = (i.end - i.start) / i.fps)
  55186. }
  55187. ,
  55188. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55189. var i = this.animationsMap[e];
  55190. i && (i.duration = t,
  55191. i.fps = (i.end - i.start) / i.duration)
  55192. }
  55193. ,
  55194. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55195. var i = this.animationsMap[e];
  55196. i && (i.weight = t)
  55197. }
  55198. ,
  55199. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55200. var i = this.animationsMap[e];
  55201. i && (i.time = t)
  55202. }
  55203. ,
  55204. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55205. var t = 0
  55206. , i = this.animationsMap[e];
  55207. return i && (t = i.time),
  55208. t
  55209. }
  55210. ,
  55211. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55212. var t = -1
  55213. , i = this.animationsMap[e];
  55214. return i && (t = i.duration),
  55215. t
  55216. }
  55217. ,
  55218. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55219. var t = this.animationsMap[e];
  55220. t ? (t.time = 0,
  55221. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55222. }
  55223. ,
  55224. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55225. var t = this.animationsMap[e];
  55226. t && (t.active = !1)
  55227. }
  55228. ,
  55229. Ci.MorphBlendMesh.prototype.update = function(e) {
  55230. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55231. var n = this.animationsList[t];
  55232. if (n.active) {
  55233. var r = n.duration / n.length;
  55234. n.time += n.direction * e,
  55235. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55236. n.time > n.duration && (n.time = n.duration,
  55237. n.directionBackwards = !0),
  55238. n.time < 0 && (n.time = 0,
  55239. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55240. n.time < 0 && (n.time += n.duration));
  55241. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55242. , a = n.weight;
  55243. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55244. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55245. this.morphTargetInfluences[o] = 0,
  55246. n.lastFrame = n.currentFrame,
  55247. n.currentFrame = o);
  55248. var s = n.time % r / r;
  55249. n.directionBackwards && (s = 1 - s),
  55250. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55251. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55252. }
  55253. }
  55254. }
  55255. ,
  55256. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55257. i.THREE = Ci) : this.THREE = Ci
  55258. }
  55259. , {}]
  55260. }, {}, [116]);