main_2020_edit.js 2.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423
  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 dom = {
  35. getOffset: function(e, t, i) {
  36. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  37. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  38. left += "left" == e ? t.offsetLeft : t.offsetTop;
  39. return left
  40. }
  41. };
  42. if (function() {
  43. "use strict";
  44. function o(e, t) {
  45. return typeof e === t
  46. }
  47. function a(e, t) {
  48. return e instanceof t
  49. }
  50. function s(e) {
  51. return e && e.nodeType
  52. }
  53. function l(e) {
  54. return s(e) ? e : a(e, y) ? e[0] : void 0
  55. }
  56. function e(e, i, n) {
  57. return y.each(e, function(e, t) {
  58. n = i.call(t, n, e, t)
  59. }),
  60. n
  61. }
  62. function t(e, t, i) {
  63. var n, r, o;
  64. if (e === t)
  65. return !0;
  66. if (!e || !t || e.constructor !== t.constructor)
  67. return !1;
  68. for (n = 0,
  69. r = i.length; n < r; n += 1) {
  70. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  71. return !1;
  72. if (e[o] !== t[o])
  73. return !1
  74. }
  75. return !0
  76. }
  77. function c(e, t, i, n) {
  78. this.left = w(e),
  79. this.top = w(t),
  80. this.width = w(i),
  81. this.height = w(n),
  82. this.right = this.left + this.width,
  83. this.bottom = this.top + this.height
  84. }
  85. function h(e, t, i, n) {
  86. this.visible = e || 0,
  87. this.viewport = t || 0,
  88. this.possible = i || 0,
  89. this.rects = n && I({}, n) || null
  90. }
  91. function r(e, t) {
  92. this.els = e,
  93. this.viewport = t
  94. }
  95. function n(e, t) {
  96. return e.val - t.val
  97. }
  98. function u(e, t) {
  99. return t.val - e.val
  100. }
  101. function d(e) {
  102. var t = c.ofContent(e, !0)
  103. , i = c.ofViewport(e, !0)
  104. , n = t.width - i.width
  105. , r = t.height - i.height;
  106. this.content = t,
  107. this.viewport = i,
  108. this.width = n <= 0 ? null : i.left / n,
  109. this.height = r <= 0 ? null : i.top / r,
  110. this.left = i.left,
  111. this.top = i.top,
  112. this.right = t.right - i.right,
  113. this.bottom = t.bottom - i.bottom
  114. }
  115. function p(e) {
  116. this.el = e || window
  117. }
  118. function f(e, t) {
  119. this.context = e,
  120. this.viewport = t,
  121. this.init()
  122. }
  123. function g(e, t, i, n) {
  124. this.context = new r(e,t),
  125. this.property = i,
  126. this.descending = n,
  127. this.init()
  128. }
  129. function m(e) {
  130. e && e !== window && e !== document ? (this.context = e,
  131. this.$autoTarget = y(e)) : this.context = window,
  132. this.init()
  133. }
  134. 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 = {},
  135. v = 1,
  136. function(e) {
  137. return e ? (i[e] || (i[e] = v,
  138. v += 1),
  139. i[e]) : 0
  140. }
  141. );
  142. I(c.prototype, {
  143. equals: function(e) {
  144. return t(this, e, ["left", "top", "width", "height"])
  145. },
  146. area: function() {
  147. return this.width * this.height
  148. },
  149. relativeTo: function(e) {
  150. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  151. },
  152. intersection: function(e) {
  153. if (!a(e, c))
  154. return null;
  155. var t = _(this.left, e.left)
  156. , i = b(this.right, e.right)
  157. , n = _(this.top, e.top)
  158. , r = i - t
  159. , o = b(this.bottom, e.bottom) - n;
  160. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  161. },
  162. envelope: function(e) {
  163. if (!a(e, c))
  164. return this;
  165. var t = b(this.left, e.left)
  166. , i = _(this.right, e.right)
  167. , n = b(this.top, e.top);
  168. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  169. }
  170. }),
  171. I(c, {
  172. ofContent: function(e, t) {
  173. 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())
  174. },
  175. ofViewport: function(e, t) {
  176. 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())
  177. },
  178. ofElement: function(e) {
  179. var t = y(e);
  180. if (!t.is(":visible"))
  181. return null;
  182. var i = t.offset();
  183. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  184. }
  185. }),
  186. I(h.prototype, {
  187. equals: function(e) {
  188. return this.fracsEqual(e) && this.rectsEqual(e)
  189. },
  190. fracsEqual: function(e) {
  191. return t(this, e, ["visible", "viewport", "possible"])
  192. },
  193. rectsEqual: function(e) {
  194. return t(this.rects, e.rects, ["document", "element", "viewport"])
  195. }
  196. }),
  197. I(h, {
  198. of: function(e, t) {
  199. var i, n, r;
  200. return e = s(e) && c.ofElement(e) || e,
  201. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  202. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  203. r = b(e.width, t.width) * b(e.height, t.height),
  204. new h(n / e.area(),n / t.area(),n / r,{
  205. document: i,
  206. element: i.relativeTo(e),
  207. viewport: i.relativeTo(t)
  208. })) : new h
  209. }
  210. });
  211. var x = ["width", "height", "left", "right", "top", "bottom"]
  212. , S = ["possible", "visible", "viewport"];
  213. I(r.prototype, {
  214. sorted: function(t, e) {
  215. var i = this.viewport;
  216. return y.map(this.els, function(e) {
  217. return {
  218. el: e,
  219. val: function(e, t, i) {
  220. var n;
  221. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  222. n ? n[i] : 0
  223. }(e, i, t)
  224. }
  225. }).sort(e ? u : n)
  226. },
  227. best: function(e, t) {
  228. return this.els.length ? this.sorted(e, t)[0] : null
  229. }
  230. }),
  231. I(d.prototype, {
  232. equals: function(e) {
  233. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  234. }
  235. }),
  236. I(p.prototype, {
  237. equals: function(e) {
  238. return t(this, e, ["el"])
  239. },
  240. scrollState: function() {
  241. return new d(this.el)
  242. },
  243. scrollTo: function(e, t, i) {
  244. var n = y(this.el === window ? "html,body" : this.el);
  245. e = e || 0,
  246. t = t || 0,
  247. i = isNaN(i) ? 1e3 : i,
  248. n.stop(!0).animate({
  249. scrollLeft: e,
  250. scrollTop: t
  251. }, i)
  252. },
  253. scroll: function(e, t, i) {
  254. var n = this.el === window ? A : y(this.el);
  255. e = e || 0,
  256. t = t || 0,
  257. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  258. },
  259. scrollToRect: function(e, t, i, n) {
  260. t = t || 0,
  261. i = i || 0,
  262. this.scrollTo(e.left - t, e.top - i, n)
  263. },
  264. scrollToElement: function(e, t, i, n) {
  265. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  266. this.scrollToRect(r, t, i, n)
  267. }
  268. });
  269. var M = {
  270. init: function() {
  271. this.callbacks = y.Callbacks("memory unique"),
  272. this.currVal = null,
  273. this.prevVal = null,
  274. this.checkProxy = y.proxy(this.check, this),
  275. this.autoCheck()
  276. },
  277. bind: function(e) {
  278. this.callbacks.add(e)
  279. },
  280. unbind: function(e) {
  281. e ? this.callbacks.remove(e) : this.callbacks.empty()
  282. },
  283. trigger: function() {
  284. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  285. },
  286. check: function(e) {
  287. var t = this.updatedValue(e);
  288. return void 0 !== t && (this.prevVal = this.currVal,
  289. this.currVal = t,
  290. this.trigger(),
  291. !0)
  292. },
  293. $autoTarget: A,
  294. autoEvents: "load resize scroll",
  295. autoCheck: function(e) {
  296. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  297. }
  298. };
  299. I(f.prototype, M, {
  300. updatedValue: function() {
  301. var e = h.of(this.context, this.viewport);
  302. return this.currVal && this.currVal.equals(e) ? void 0 : e
  303. }
  304. }),
  305. I(g.prototype, M, {
  306. updatedValue: function() {
  307. var e = this.context.best(this.property, this.descending);
  308. return e && (e = 0 < e.val ? e.el : null,
  309. this.currVal !== e) ? e : void 0
  310. }
  311. }),
  312. I(m.prototype, M, {
  313. updatedValue: function() {
  314. var e = new d(this.context);
  315. return this.currVal && this.currVal.equals(e) ? void 0 : e
  316. }
  317. });
  318. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  319. function H(e, t, i, n) {
  320. return i = N(i) ? i.apply(e, t) : i,
  321. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  322. }
  323. R = U,
  324. P = {
  325. statics: {
  326. version: "0.15.0",
  327. Rect: c,
  328. Fractions: h,
  329. Group: r,
  330. ScrollState: d,
  331. Viewport: p,
  332. FracsCallbacks: f,
  333. GroupCallbacks: g,
  334. ScrollStateCallbacks: m,
  335. fracs: function(e, t) {
  336. return h.of(e, t)
  337. }
  338. },
  339. methods: {
  340. content: function(e) {
  341. return this.length ? c.ofContent(this[0], e) : null
  342. },
  343. envelope: function() {
  344. return e(this, function(e) {
  345. var t = c.ofElement(this);
  346. return e ? e.envelope(t) : t
  347. })
  348. },
  349. fracs: function(e, i, n) {
  350. o(e, "string") || (n = i,
  351. i = e,
  352. e = null),
  353. E(i) || (n = i,
  354. i = null),
  355. n = l(n);
  356. var r = U + ".fracs." + T(n);
  357. return "unbind" === e ? this.each(function() {
  358. var e = y(this).data(r);
  359. e && e.unbind(i)
  360. }) : "check" === e ? this.each(function() {
  361. var e = y(this).data(r);
  362. e && e.check()
  363. }) : E(i) ? this.each(function() {
  364. var e = y(this)
  365. , t = e.data(r);
  366. t || (t = new f(this,n),
  367. e.data(r, t)),
  368. t.bind(i)
  369. }) : this.length ? h.of(this[0], n) : null
  370. },
  371. intersection: function() {
  372. return e(this, function(e) {
  373. var t = c.ofElement(this);
  374. return e ? e.intersection(t) : t
  375. })
  376. },
  377. max: function(e, t, i) {
  378. return E(t) || (i = t,
  379. t = null),
  380. i = l(i),
  381. t ? (new g(this,i,e,!0).bind(t),
  382. this) : this.pushStack(new r(this,i).best(e, !0).el)
  383. },
  384. min: function(e, t, i) {
  385. return E(t) || (i = t,
  386. t = null),
  387. i = l(i),
  388. t ? (new g(this,i,e).bind(t),
  389. this) : this.pushStack(new r(this,i).best(e).el)
  390. },
  391. rect: function() {
  392. return this.length ? c.ofElement(this[0]) : null
  393. },
  394. scrollState: function(e, i) {
  395. var n = U + ".scrollState";
  396. return o(e, "string") || (i = e,
  397. e = null),
  398. "unbind" === e ? this.each(function() {
  399. var e = y(this).data(n);
  400. e && e.unbind(i)
  401. }) : "check" === e ? this.each(function() {
  402. var e = y(this).data(n);
  403. e && e.check()
  404. }) : E(i) ? this.each(function() {
  405. var e = y(this)
  406. , t = e.data(n);
  407. t || (t = new m(this),
  408. e.data(n, t)),
  409. t.bind(i)
  410. }) : this.length ? new d(this[0]) : null
  411. },
  412. scroll: function(e, t, i) {
  413. return this.each(function() {
  414. new p(this).scroll(e, t, i)
  415. })
  416. },
  417. scrollTo: function(e, t, i, n) {
  418. return y.isNumeric(e) && (n = i,
  419. i = t,
  420. t = e,
  421. e = null),
  422. e = l(e),
  423. this.each(function() {
  424. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  425. })
  426. },
  427. scrollToThis: function(e, t, i, n) {
  428. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  429. this
  430. },
  431. softLink: function(t, i, n, r) {
  432. return r = new p(l(r)),
  433. this.filter("a[href^=#]").each(function() {
  434. var e = y(this);
  435. e.on("click", function() {
  436. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  437. })
  438. })
  439. },
  440. sort: function(e, t, i) {
  441. return o(t, "boolean") || (i = t,
  442. t = null),
  443. i = l(i),
  444. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  445. return e.el
  446. }))
  447. },
  448. viewport: function(e) {
  449. return this.length ? c.ofViewport(this[0], e) : null
  450. }
  451. },
  452. defaultStatic: "fracs",
  453. defaultMethod: "fracs"
  454. },
  455. O = [].slice,
  456. L = jQuery,
  457. D = L.extend,
  458. N = L.isFunction,
  459. F = D({}, P),
  460. B = function() {
  461. return H(this, O.call(arguments), F.defaultStatic, B)
  462. }
  463. ,
  464. V = function(e) {
  465. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  466. }
  467. ,
  468. (k = function(e) {
  469. e && (D(B, e.statics),
  470. D(V, e.methods)),
  471. B.modplug = k
  472. }
  473. ).prev = {
  474. statics: L[R],
  475. methods: L.fn[R]
  476. },
  477. k(P),
  478. L[R] = B,
  479. L.fn[R] = V
  480. }(),
  481. "undefined" == typeof jQuery)
  482. throw new Error("Bootstrap's JavaScript requires jQuery");
  483. !function(m) {
  484. "use strict";
  485. function r(e, t) {
  486. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  487. this.init("tooltip", e, t)
  488. }
  489. r.VERSION = "3.2.0",
  490. r.DEFAULTS = {
  491. animation: !0,
  492. placement: "top",
  493. selector: !1,
  494. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  495. trigger: "hover focus",
  496. title: "",
  497. delay: 0,
  498. html: !1,
  499. container: !1,
  500. viewport: {
  501. selector: "body",
  502. padding: 0
  503. }
  504. },
  505. r.prototype.init = function(e, t, i) {
  506. this.enabled = !0,
  507. this.type = e,
  508. this.$element = m(t),
  509. this.options = this.getOptions(i),
  510. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  511. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  512. var o = n[r];
  513. if ("click" == o)
  514. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  515. else if ("manual" != o) {
  516. var a = "hover" == o ? "mouseenter" : "focusin"
  517. , s = "hover" == o ? "mouseleave" : "focusout";
  518. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  519. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  520. }
  521. }
  522. this.options.selector ? this._options = m.extend({}, this.options, {
  523. trigger: "manual",
  524. selector: ""
  525. }) : this.fixTitle()
  526. }
  527. ,
  528. r.prototype.getDefaults = function() {
  529. return r.DEFAULTS
  530. }
  531. ,
  532. r.prototype.getOptions = function(e) {
  533. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  534. show: e.delay,
  535. hide: e.delay
  536. }),
  537. e
  538. }
  539. ,
  540. r.prototype.getDelegateOptions = function() {
  541. var i = {}
  542. , n = this.getDefaults();
  543. return this._options && m.each(this._options, function(e, t) {
  544. n[e] != t && (i[e] = t)
  545. }),
  546. i
  547. }
  548. ,
  549. r.prototype.enter = function(e) {
  550. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  551. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  552. m(e.currentTarget).data("bs." + this.type, t)),
  553. clearTimeout(t.timeout),
  554. t.hoverState = "in",
  555. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  556. }
  557. ,
  558. r.prototype.leave = function(e) {
  559. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  560. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  561. m(e.currentTarget).data("bs." + this.type, t)),
  562. clearTimeout(t.timeout),
  563. t.hoverState = "out",
  564. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  565. "out" == t.hoverState && t.hide()
  566. }, t.options.delay.hide)) : t.hide()
  567. }
  568. ,
  569. r.prototype.show = function() {
  570. var e = m.Event("show.bs." + this.type);
  571. if (this.hasContent() && this.enabled) {
  572. this.$element.trigger(e);
  573. var t = m.contains(document.documentElement, this.$element[0]);
  574. if (e.isDefaultPrevented() || !t)
  575. return;
  576. var i = this
  577. , n = this.tip()
  578. , r = this.getUID(this.type);
  579. this.setContent(),
  580. n.attr("id", r),
  581. this.$element.attr("aria-describedby", r),
  582. this.options.animation && n.addClass("fade");
  583. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  584. , a = /\s?auto?\s?/i
  585. , s = a.test(o);
  586. s && (o = o.replace(a, "") || "top"),
  587. n.detach().css({
  588. top: 0,
  589. left: 0,
  590. display: "block"
  591. }).addClass(o).data("bs." + this.type, this),
  592. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  593. var l = this.getPosition()
  594. , c = n[0].offsetWidth
  595. , h = n[0].offsetHeight;
  596. if (s) {
  597. var u = o
  598. , d = this.$element.parent()
  599. , p = this.getPosition(d);
  600. 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,
  601. n.removeClass(u).addClass(o)
  602. }
  603. var f = this.getCalculatedOffset(o, l, c, h);
  604. this.applyPlacement(f, o);
  605. var g = function() {
  606. i.$element.trigger("shown.bs." + i.type),
  607. i.hoverState = null
  608. };
  609. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  610. }
  611. }
  612. ,
  613. r.prototype.applyPlacement = function(e, t) {
  614. var i = this.tip()
  615. , n = i[0].offsetWidth
  616. , r = i[0].offsetHeight
  617. , o = parseInt(i.css("margin-top"), 10)
  618. , a = parseInt(i.css("margin-left"), 10);
  619. isNaN(o) && (o = 0),
  620. isNaN(a) && (a = 0),
  621. e.top = e.top + o,
  622. e.left = e.left + a,
  623. m.offset.setOffset(i[0], m.extend({
  624. using: function(e) {
  625. i.css({
  626. top: Math.round(e.top),
  627. left: Math.round(e.left)
  628. })
  629. }
  630. }, e), 0),
  631. i.addClass("in");
  632. var s = i[0].offsetWidth
  633. , l = i[0].offsetHeight;
  634. "top" == t && l != r && (e.top = e.top + r - l);
  635. var c = this.getViewportAdjustedDelta(t, e, s, l);
  636. c.left ? e.left += c.left : e.top += c.top;
  637. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  638. , u = c.left ? "left" : "top"
  639. , d = c.left ? "offsetWidth" : "offsetHeight";
  640. i.offset(e),
  641. this.replaceArrow(h, i[0][d], u)
  642. }
  643. ,
  644. r.prototype.replaceArrow = function(e, t, i) {
  645. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  646. }
  647. ,
  648. r.prototype.setContent = function() {
  649. var e = this.tip()
  650. , t = this.getTitle();
  651. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  652. e.removeClass("fade in top bottom left right")
  653. }
  654. ,
  655. r.prototype.hide = function() {
  656. function e() {
  657. "in" != t.hoverState && i.detach(),
  658. t.$element.trigger("hidden.bs." + t.type)
  659. }
  660. var t = this
  661. , i = this.tip()
  662. , n = m.Event("hide.bs." + this.type);
  663. if (this.$element.removeAttr("aria-describedby"),
  664. this.$element.trigger(n),
  665. !n.isDefaultPrevented())
  666. return i.removeClass("in"),
  667. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  668. this.hoverState = null,
  669. this
  670. }
  671. ,
  672. r.prototype.fixTitle = function() {
  673. var e = this.$element;
  674. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  675. }
  676. ,
  677. r.prototype.hasContent = function() {
  678. return this.getTitle()
  679. }
  680. ,
  681. r.prototype.getPosition = function(e) {
  682. var t = (e = e || this.$element)[0]
  683. , i = "BODY" == t.tagName;
  684. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  685. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  686. width: i ? m(window).width() : e.outerWidth(),
  687. height: i ? m(window).height() : e.outerHeight()
  688. }, i ? {
  689. top: 0,
  690. left: 0
  691. } : e.offset())
  692. }
  693. ,
  694. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  695. return "bottom" == e ? {
  696. top: t.top + t.height,
  697. left: t.left + t.width / 2 - i / 2
  698. } : "top" == e ? {
  699. top: t.top - n,
  700. left: t.left + t.width / 2 - i / 2
  701. } : "left" == e ? {
  702. top: t.top + t.height / 2 - n / 2,
  703. left: t.left - i
  704. } : {
  705. top: t.top + t.height / 2 - n / 2,
  706. left: t.left + t.width
  707. }
  708. }
  709. ,
  710. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  711. var r = {
  712. top: 0,
  713. left: 0
  714. };
  715. if (!this.$viewport)
  716. return r;
  717. var o = this.options.viewport && this.options.viewport.padding || 0
  718. , a = this.getPosition(this.$viewport);
  719. if (/right|left/.test(e)) {
  720. var s = t.top - o - a.scroll
  721. , l = t.top + o - a.scroll + n;
  722. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  723. } else {
  724. var c = t.left - o
  725. , h = t.left + o + i;
  726. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  727. }
  728. return r
  729. }
  730. ,
  731. r.prototype.getTitle = function() {
  732. var e = this.$element
  733. , t = this.options;
  734. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  735. }
  736. ,
  737. r.prototype.getUID = function(e) {
  738. for (; e += ~~(1e6 * Math.random()),
  739. document.getElementById(e); )
  740. ;
  741. return e
  742. }
  743. ,
  744. r.prototype.tip = function() {
  745. return this.$tip = this.$tip || m(this.options.template)
  746. }
  747. ,
  748. r.prototype.arrow = function() {
  749. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  750. }
  751. ,
  752. r.prototype.validate = function() {
  753. this.$element[0].parentNode || (this.hide(),
  754. this.$element = null,
  755. this.options = null)
  756. }
  757. ,
  758. r.prototype.enable = function() {
  759. this.enabled = !0
  760. }
  761. ,
  762. r.prototype.disable = function() {
  763. this.enabled = !1
  764. }
  765. ,
  766. r.prototype.toggleEnabled = function() {
  767. this.enabled = !this.enabled
  768. }
  769. ,
  770. r.prototype.toggle = function(e) {
  771. var t = this;
  772. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  773. m(e.currentTarget).data("bs." + this.type, t))),
  774. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  775. }
  776. ,
  777. r.prototype.destroy = function() {
  778. clearTimeout(this.timeout),
  779. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  780. }
  781. ;
  782. var e = m.fn.tooltip;
  783. m.fn.tooltip = function(n) {
  784. return this.each(function() {
  785. var e = m(this)
  786. , t = e.data("bs.tooltip")
  787. , i = "object" == typeof n && n;
  788. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  789. "string" == typeof n && t[n]())
  790. })
  791. }
  792. ,
  793. m.fn.tooltip.Constructor = r,
  794. m.fn.tooltip.noConflict = function() {
  795. return m.fn.tooltip = e,
  796. this
  797. }
  798. }(jQuery),
  799. function(e, t, i) {
  800. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  801. }(0, this, function() {
  802. "use strict";
  803. function Keen() {
  804. return _init.apply(this, arguments)
  805. }
  806. function _init(e) {
  807. if (_isUndefined(e))
  808. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  809. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  810. throw new Error("Please provide a projectId");
  811. this.configure(e)
  812. }
  813. function _extend(e) {
  814. for (var t = 1; t < arguments.length; t++)
  815. for (var i in arguments[t])
  816. e[i] = arguments[t][i];
  817. return e
  818. }
  819. function _isUndefined(e) {
  820. return void 0 === e
  821. }
  822. function _type(e) {
  823. var t = e && e.constructor ? e.constructor.toString() : void 0;
  824. return t ? t.match(/function (.*)\(/)[1] : "Null"
  825. }
  826. function _each(e, t, i) {
  827. var n;
  828. if (!e)
  829. return 0;
  830. if (i = i || e,
  831. "array" === _type(e)) {
  832. for (n = 0; n < e.length; n++)
  833. if (!1 === t.call(i, e[n], n, e))
  834. return 0
  835. } else
  836. for (n in e)
  837. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  838. return 0;
  839. return 1
  840. }
  841. function _parse_params(e) {
  842. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  843. return decodeURIComponent(e.replace(n, " "))
  844. }, a = e.split("?")[1]; t = r.exec(a); )
  845. i[o(t[1])] = o(t[2]);
  846. return i
  847. }
  848. function _set_protocol(e) {
  849. switch (e) {
  850. case "http":
  851. return "http";
  852. case "auto":
  853. return location.protocol.replace(/:/g, "");
  854. case "https":
  855. case void 0:
  856. default:
  857. return "https"
  858. }
  859. }
  860. function _set_request_type(e) {
  861. var t = e || "jsonp"
  862. , i = !1;
  863. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  864. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  865. }
  866. function _build_url(e) {
  867. return this.client.endpoint + "/projects/" + this.client.projectId + e
  868. }
  869. function _uploadEvent(e, t, i, n, r) {
  870. var o = _build_url.apply(this, ["/events/" + e])
  871. , a = {};
  872. for (var s in i = !1 !== i,
  873. this.client.globalProperties && (a = this.client.globalProperties(e)),
  874. t)
  875. t.hasOwnProperty(s) && (a[s] = t[s]);
  876. switch (this.client.requestType) {
  877. case "xhr":
  878. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  879. break;
  880. case "jsonp":
  881. var l = JSON.stringify(a)
  882. , c = Keen.Base64.encode(l);
  883. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  884. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  885. break;
  886. case "beacon":
  887. l = JSON.stringify(a),
  888. c = Keen.Base64.encode(l);
  889. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  890. o += "&c=clv1",
  891. _request.beacon.apply(this, [o, null, n, r])
  892. }
  893. }
  894. Keen.prototype.configure = function(e) {
  895. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  896. e.protocol = _set_protocol(e.protocol),
  897. e.requestType = _set_request_type(e.requestType),
  898. this.client = {
  899. projectId: e.projectId,
  900. writeKey: e.writeKey,
  901. readKey: e.readKey,
  902. globalProperties: null,
  903. endpoint: e.protocol + "://" + e.host,
  904. requestType: e.requestType
  905. },
  906. Keen.trigger("client", this, e),
  907. this.trigger("ready"),
  908. this
  909. }
  910. ;
  911. var _request = {
  912. xhr: function(e, t, i, n, r, o, a, s) {
  913. if (!r)
  914. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  915. var l = new XMLHttpRequest;
  916. if (l.onreadystatechange = function() {
  917. if (4 == l.readyState)
  918. if (200 <= l.status && l.status < 300) {
  919. var e;
  920. try {
  921. e = JSON.parse(l.responseText)
  922. } catch (e) {
  923. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  924. s && s(l, e)
  925. }
  926. a && e && a(e)
  927. } else
  928. Keen.log("HTTP request failed."),
  929. s && s(l, null)
  930. }
  931. ,
  932. l.open(e, t, o),
  933. r && l.setRequestHeader("Authorization", r),
  934. n && l.setRequestHeader("Content-Type", "application/json"),
  935. i)
  936. for (var c in i)
  937. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  938. var h = n ? JSON.stringify(n) : null;
  939. l.send(h)
  940. },
  941. jsonp: function(e, t, i, n) {
  942. if (!t)
  943. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  944. if (t && e.indexOf("api_key") < 0) {
  945. var r = 0 < e.indexOf("?") ? "&" : "?";
  946. e = e + r + "api_key=" + t
  947. }
  948. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  949. o += "a";
  950. var a = !1;
  951. window[o] = function(e) {
  952. a = !0,
  953. i && e && i(e),
  954. window[o] = void 0
  955. }
  956. ,
  957. e = e + "&jsonp=" + o;
  958. var s = document.createElement("script");
  959. s.id = "keen-jsonp",
  960. s.src = e,
  961. document.getElementsByTagName("head")[0].appendChild(s),
  962. s.onreadystatechange = function() {
  963. !1 === a && "loaded" === this.readyState && (a = !0,
  964. n && n())
  965. }
  966. ,
  967. s.onerror = function() {
  968. !1 === a && (a = !0,
  969. n && n())
  970. }
  971. },
  972. beacon: function(e, t, i, n) {
  973. if (t && e.indexOf("api_key") < 0) {
  974. var r = 0 < e.indexOf("?") ? "&" : "?";
  975. e = e + r + "api_key=" + t
  976. }
  977. var o = document.createElement("img");
  978. o.onload = function() {
  979. if (!0,
  980. "naturalHeight"in this) {
  981. if (this.naturalHeight + this.naturalWidth === 0)
  982. return void this.onerror()
  983. } else if (this.width + this.height === 0)
  984. return void this.onerror();
  985. i && i({
  986. created: !0
  987. })
  988. }
  989. ,
  990. o.onerror = function() {
  991. !0,
  992. n && n()
  993. }
  994. ,
  995. o.src = e
  996. }
  997. }
  998. , Events = Keen.Events = {
  999. on: function(e, t) {
  1000. return this.listeners || (this.listeners = {}),
  1001. (this.listeners[e] || (this.listeners[e] = [])).push({
  1002. callback: t
  1003. }),
  1004. this
  1005. },
  1006. off: function(e, t) {
  1007. if (!e && !t)
  1008. return this.listeners = void 0,
  1009. delete this.listeners,
  1010. this;
  1011. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1012. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1013. t && 0 != i.length || (this.listeners[e] = void 0,
  1014. delete this.listeners[e]);
  1015. return this
  1016. },
  1017. trigger: function(e) {
  1018. if (!this.listeners)
  1019. return this;
  1020. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1021. i[n].callback.apply(this, t);
  1022. return this
  1023. }
  1024. };
  1025. _extend(Keen.prototype, Events),
  1026. _extend(Keen, Events),
  1027. Keen.loaded = !0,
  1028. Keen.utils = {
  1029. each: _each,
  1030. extend: _extend,
  1031. parseParams: _parse_params
  1032. },
  1033. Keen.ready = function(e) {
  1034. Keen.loaded ? e() : Keen.on("ready", e)
  1035. }
  1036. ,
  1037. Keen.log = function(e) {
  1038. "object" == typeof console && console.log("[Keen IO]", e)
  1039. }
  1040. ;
  1041. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1042. Keen.prototype.addEvent = function() {
  1043. _uploadEvent.apply(this, arguments)
  1044. }
  1045. ,
  1046. Keen.prototype.addEventSync = function(e, t, i, n) {
  1047. _uploadEvent.apply(this, [e, t, !1, i, n])
  1048. }
  1049. ,
  1050. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1051. var o = e
  1052. , a = o.metaKey
  1053. , s = o.target
  1054. , l = !1
  1055. , c = function() {};
  1056. return void 0 === n && (n = 500),
  1057. "A" === s.nodeName ? c = function() {
  1058. a || l || (l = !0,
  1059. window.location = s.href)
  1060. }
  1061. : "FORM" === s.nodeName && (c = function() {
  1062. l || (l = !0,
  1063. s.submit())
  1064. }
  1065. ),
  1066. r && (c = function() {
  1067. l || (l = !0,
  1068. r())
  1069. }
  1070. ),
  1071. _uploadEvent.call(this, t, i, c, c),
  1072. setTimeout(function() {
  1073. c()
  1074. }, n),
  1075. !!a && void 0
  1076. }
  1077. ,
  1078. Keen.prototype.setGlobalProperties = function(e) {
  1079. if (!this.client)
  1080. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1081. if (!e || "function" != typeof e)
  1082. throw new Error("Invalid value for global properties: " + e);
  1083. this.client.globalProperties = e
  1084. }
  1085. ,
  1086. Keen.Base64 = {
  1087. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1088. encode: function(e) {
  1089. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1090. for (e = this.utf8.encode(e); c < e.length; )
  1091. t = e.charCodeAt(c++),
  1092. i = e.charCodeAt(c++),
  1093. n = e.charCodeAt(c++),
  1094. r = t >> 2,
  1095. o = (3 & t) << 4 | i >> 4,
  1096. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1097. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1098. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1099. return l
  1100. },
  1101. decode: function(e) {
  1102. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1103. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1104. t = c.indexOf(e.charAt(l++)),
  1105. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1106. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1107. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1108. return this.utf8.decode(s)
  1109. },
  1110. utf8: {
  1111. encode: function(e) {
  1112. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1113. 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);
  1114. return i
  1115. },
  1116. decode: function(e) {
  1117. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1118. 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];
  1119. return i
  1120. }
  1121. }
  1122. },
  1123. "object" != typeof JSON && (JSON = {}),
  1124. function() {
  1125. function f(e) {
  1126. return e < 10 ? "0" + e : e
  1127. }
  1128. function quote(e) {
  1129. return escapable.lastIndex = 0,
  1130. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1131. var t = meta[e];
  1132. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1133. }) + '"' : '"' + e + '"'
  1134. }
  1135. function str(e, t) {
  1136. var i, n, r, o, a, s = gap, l = t[e];
  1137. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1138. "function" == typeof rep && (l = rep.call(t, e, l)),
  1139. typeof l) {
  1140. case "string":
  1141. return quote(l);
  1142. case "number":
  1143. return isFinite(l) ? String(l) : "null";
  1144. case "boolean":
  1145. case "null":
  1146. return String(l);
  1147. case "object":
  1148. if (!l)
  1149. return "null";
  1150. if (gap += indent,
  1151. a = [],
  1152. "[object Array]" === Object.prototype.toString.apply(l)) {
  1153. for (o = l.length,
  1154. i = 0; i < o; i += 1)
  1155. a[i] = str(i, l) || "null";
  1156. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1157. gap = s,
  1158. r
  1159. }
  1160. if (rep && "object" == typeof rep)
  1161. for (o = rep.length,
  1162. i = 0; i < o; i += 1)
  1163. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1164. else
  1165. for (n in l)
  1166. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1167. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1168. gap = s,
  1169. r
  1170. }
  1171. }
  1172. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1173. 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
  1174. }
  1175. ,
  1176. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1177. return this.valueOf()
  1178. }
  1179. );
  1180. 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 = {
  1181. "\b": "\\b",
  1182. "\t": "\\t",
  1183. "\n": "\\n",
  1184. "\f": "\\f",
  1185. "\r": "\\r",
  1186. '"': '\\"',
  1187. "\\": "\\\\"
  1188. }, rep;
  1189. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1190. var n;
  1191. if (indent = gap = "",
  1192. "number" == typeof i)
  1193. for (n = 0; n < i; n += 1)
  1194. indent += " ";
  1195. else
  1196. "string" == typeof i && (indent = i);
  1197. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1198. throw new Error("JSON.stringify");
  1199. return str("", {
  1200. "": e
  1201. })
  1202. }
  1203. ),
  1204. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1205. function walk(e, t) {
  1206. var i, n, r = e[t];
  1207. if (r && "object" == typeof r)
  1208. for (i in r)
  1209. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1210. return reviver.call(e, t, r)
  1211. }
  1212. var j;
  1213. if (text = String(text),
  1214. cx.lastIndex = 0,
  1215. cx.test(text) && (text = text.replace(cx, function(e) {
  1216. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1217. })),
  1218. /^[\],:{}\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, "")))
  1219. return j = eval("(" + text + ")"),
  1220. "function" == typeof reviver ? walk({
  1221. "": j
  1222. }, "") : j;
  1223. throw new SyntaxError("JSON.parse")
  1224. }
  1225. )
  1226. }(),
  1227. Hh = Keen.utils,
  1228. Ih = function(i) {
  1229. function e(e) {
  1230. for (u = 1; e = n.shift(); )
  1231. e()
  1232. }
  1233. 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]);
  1234. return r[l] && r[l](s, t = function() {
  1235. r.removeEventListener(s, t, !1),
  1236. e()
  1237. }
  1238. , !1),
  1239. a && r.attachEvent(c, t = function() {
  1240. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1241. e())
  1242. }
  1243. ),
  1244. i = a ? function(t) {
  1245. self != top ? u ? t() : n.push(t) : function() {
  1246. try {
  1247. o.doScroll("left")
  1248. } catch (e) {
  1249. return setTimeout(function() {
  1250. i(t)
  1251. }, 50)
  1252. }
  1253. t()
  1254. }()
  1255. }
  1256. : function(e) {
  1257. u ? e() : n.push(e)
  1258. }
  1259. }
  1260. ,
  1261. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1262. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1263. if (loaded && cached) {
  1264. for (var instance in clients = cached.clients || {},
  1265. ready = cached.ready || [],
  1266. clients)
  1267. if (clients.hasOwnProperty(instance)) {
  1268. var client = clients[instance];
  1269. for (var method in Keen.prototype)
  1270. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1271. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1272. ,
  1273. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1274. ,
  1275. client._config && (client.configure.call(client, client._config),
  1276. delete client._config),
  1277. client._setGlobalProperties) {
  1278. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1279. client.setGlobalProperties.apply(client, globals[i]);
  1280. delete client._setGlobalProperties
  1281. }
  1282. if (client._addEvent) {
  1283. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1284. client.addEvent.apply(client, queue[i]);
  1285. delete client._addEvent
  1286. }
  1287. var callback = client._on || [];
  1288. if (client._on) {
  1289. for (var i = 0; i < callback.length; i++)
  1290. client.on.apply(client, callback[i]);
  1291. client.trigger("ready"),
  1292. delete client._on
  1293. }
  1294. }
  1295. for (var i = 0; i < ready.length; i++) {
  1296. var callback = ready[i];
  1297. Keen.on("ready", function() {
  1298. callback()
  1299. })
  1300. }
  1301. }
  1302. return Keen.loaded && setTimeout(function() {
  1303. Keen.utils.domready(function() {
  1304. Keen.trigger("ready")
  1305. })
  1306. }, 0),
  1307. Keen
  1308. }),
  1309. function() {
  1310. var i = window.analytics = window.analytics || [];
  1311. if (!i.initialize) {
  1312. if (i.invoked)
  1313. return window.console && console.error && console.error("Segment snippet included twice.");
  1314. i.invoked = !0,
  1315. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1316. i.factory = function(t) {
  1317. return function() {
  1318. var e = Array.prototype.slice.call(arguments);
  1319. return e.unshift(t),
  1320. i.push(e),
  1321. i
  1322. }
  1323. }
  1324. ;
  1325. for (var e = 0; e < i.methods.length; e++) {
  1326. var t = i.methods[e];
  1327. i[t] = i.factory(t)
  1328. }
  1329. i.load = function(e) {
  1330. var t = document.createElement("script");
  1331. t.type = "text/javascript",
  1332. t.async = !0,
  1333. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1334. var i = document.getElementsByTagName("script")[0];
  1335. i.parentNode.insertBefore(t, i)
  1336. }
  1337. ,
  1338. i.SNIPPET_VERSION = "4.0.0"
  1339. }
  1340. }(),
  1341. function(i, u) {
  1342. "use strict";
  1343. var d = "function"
  1344. , p = "undefined"
  1345. , f = "object"
  1346. , e = "major"
  1347. , t = "model"
  1348. , n = "name"
  1349. , r = "type"
  1350. , o = "vendor"
  1351. , a = "version"
  1352. , s = "architecture"
  1353. , l = "console"
  1354. , c = "mobile"
  1355. , h = "tablet"
  1356. , g = {
  1357. has: function(e, t) {
  1358. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1359. },
  1360. lowerize: function(e) {
  1361. return e.toLowerCase()
  1362. }
  1363. }
  1364. , m = {
  1365. rgx: function() {
  1366. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1367. var c = l[s]
  1368. , h = l[s + 1];
  1369. if (typeof e == p)
  1370. for (n in e = {},
  1371. h)
  1372. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1373. for (t = i = 0; t < c.length; t++)
  1374. if (o = c[t].exec(this.getUA())) {
  1375. for (n = 0; n < h.length; n++)
  1376. a = o[++i],
  1377. 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;
  1378. break
  1379. }
  1380. if (o)
  1381. break
  1382. }
  1383. return e
  1384. },
  1385. str: function(e, t) {
  1386. for (var i in t)
  1387. if (typeof t[i] == f && 0 < t[i].length) {
  1388. for (var n = 0; n < t[i].length; n++)
  1389. if (g.has(t[i][n], e))
  1390. return "?" === i ? u : i
  1391. } else if (g.has(t[i], e))
  1392. return "?" === i ? u : i;
  1393. return e
  1394. }
  1395. }
  1396. , v = {
  1397. browser: {
  1398. oldsafari: {
  1399. major: {
  1400. 1: ["/8", "/1", "/3"],
  1401. 2: "/4",
  1402. "?": "/"
  1403. },
  1404. version: {
  1405. "1.0": "/8",
  1406. 1.2: "/1",
  1407. 1.3: "/3",
  1408. "2.0": "/412",
  1409. "2.0.2": "/416",
  1410. "2.0.3": "/417",
  1411. "2.0.4": "/419",
  1412. "?": "/"
  1413. }
  1414. }
  1415. },
  1416. device: {
  1417. sprint: {
  1418. model: {
  1419. "Evo Shift 4G": "7373KT"
  1420. },
  1421. vendor: {
  1422. HTC: "APA",
  1423. Sprint: "Sprint"
  1424. }
  1425. }
  1426. },
  1427. os: {
  1428. windows: {
  1429. version: {
  1430. ME: "4.90",
  1431. "NT 3.11": "NT3.51",
  1432. "NT 4.0": "NT4.0",
  1433. 2e3: "NT 5.0",
  1434. XP: ["NT 5.1", "NT 5.2"],
  1435. Vista: "NT 6.0",
  1436. 7: "NT 6.1",
  1437. 8: "NT 6.2",
  1438. 8.1: "NT 6.3",
  1439. RT: "ARM"
  1440. }
  1441. }
  1442. }
  1443. }
  1444. , y = {
  1445. 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]],
  1446. 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]],
  1447. 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]],
  1448. 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]],
  1449. 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]]
  1450. }
  1451. , A = function(e) {
  1452. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1453. return this instanceof A ? (this.getBrowser = function() {
  1454. return m.rgx.apply(this, y.browser)
  1455. }
  1456. ,
  1457. this.getCPU = function() {
  1458. return m.rgx.apply(this, y.cpu)
  1459. }
  1460. ,
  1461. this.getDevice = function() {
  1462. return m.rgx.apply(this, y.device)
  1463. }
  1464. ,
  1465. this.getEngine = function() {
  1466. return m.rgx.apply(this, y.engine)
  1467. }
  1468. ,
  1469. this.getOS = function() {
  1470. return m.rgx.apply(this, y.os)
  1471. }
  1472. ,
  1473. this.getResult = function() {
  1474. return {
  1475. ua: this.getUA(),
  1476. browser: this.getBrowser(),
  1477. engine: this.getEngine(),
  1478. os: this.getOS(),
  1479. device: this.getDevice(),
  1480. cpu: this.getCPU()
  1481. }
  1482. }
  1483. ,
  1484. this.getUA = function() {
  1485. return t
  1486. }
  1487. ,
  1488. this.setUA = function(e) {
  1489. return t = e,
  1490. this
  1491. }
  1492. ,
  1493. void this.setUA(t)) : new A(e).getResult()
  1494. };
  1495. if (typeof exports != p)
  1496. typeof module != p && module.exports && (exports = module.exports = A),
  1497. exports.UAParser = A;
  1498. else if (i.UAParser = A,
  1499. typeof define == d && define.amd && define(function() {
  1500. return A
  1501. }),
  1502. typeof i.jQuery != p) {
  1503. var C = i.jQuery
  1504. , I = new A;
  1505. C.ua = I.getResult(),
  1506. C.ua.get = function() {
  1507. return I.getUA()
  1508. }
  1509. ,
  1510. C.ua.set = function(e) {
  1511. I.setUA(e);
  1512. var t = I.getResult();
  1513. for (var i in t)
  1514. C.ua[i] = t[i]
  1515. }
  1516. }
  1517. }(this),
  1518. window.Modernizr = function(e, t) {
  1519. function i(e, t) {
  1520. return typeof e === t
  1521. }
  1522. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1523. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1524. return t in e && i(e.constructor.prototype[t], "undefined")
  1525. }
  1526. : function(e, t) {
  1527. return p.call(e, t)
  1528. }
  1529. ,
  1530. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1531. var r = this;
  1532. if ("function" != typeof r)
  1533. throw new TypeError;
  1534. var o = d.call(arguments, 1)
  1535. , a = function() {
  1536. if (this instanceof a) {
  1537. function e() {}
  1538. e.prototype = r.prototype;
  1539. var t = new e
  1540. , i = r.apply(t, o.concat(d.call(arguments)));
  1541. return Object(i) === i ? i : t
  1542. }
  1543. return r.apply(n, o.concat(d.call(arguments)))
  1544. };
  1545. return a
  1546. }
  1547. ),
  1548. h.webgl = function() {
  1549. return !!e.WebGLRenderingContext
  1550. }
  1551. ,
  1552. h)
  1553. r(h, f) && (n = f.toLowerCase(),
  1554. a[n] = h[f](),
  1555. u.push((a[n] ? "" : "no-") + n));
  1556. return a.addTest = function(e, t) {
  1557. if ("object" == typeof e)
  1558. for (var i in e)
  1559. r(e, i) && a.addTest(i, e[i]);
  1560. else {
  1561. if (e = e.toLowerCase(),
  1562. void 0 !== a[e])
  1563. return a;
  1564. t = "function" == typeof t ? t() : t,
  1565. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1566. a[e] = t
  1567. }
  1568. return a
  1569. }
  1570. ,
  1571. o = "",
  1572. c.cssText = o,
  1573. l = null,
  1574. a._version = "2.8.2",
  1575. a
  1576. }(this, this.document),
  1577. function(xe, e, Se) {
  1578. "use strict";
  1579. function Me(s, e, n) {
  1580. function a(e) {
  1581. var t = Q.length;
  1582. if (G.old = xe.extend({}, G),
  1583. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1584. Y = W[F.horizontal ? "width" : "height"](),
  1585. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1586. Q.length = 0,
  1587. G.start = 0,
  1588. G.end = nt(z - H, 0),
  1589. le) {
  1590. $.length,
  1591. J = U.children(F.itemSelector),
  1592. $.length = 0;
  1593. 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;
  1594. z = 0,
  1595. J.each(function(e, t) {
  1596. var i = xe(t)
  1597. , n = t.getBoundingClientRect()
  1598. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1599. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1600. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1601. , s = r + o + a
  1602. , l = !o || !a
  1603. , c = {};
  1604. c.el = t,
  1605. c.size = l ? r : s,
  1606. c.half = c.size / 2,
  1607. c.start = z + (l ? o : 0),
  1608. c.center = c.start - it(H / 2 - c.size / 2),
  1609. c.end = c.start - H + c.size,
  1610. e || (z += u),
  1611. z += s,
  1612. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1613. e === g && (c.end += d,
  1614. z += d,
  1615. f = l ? a : 0),
  1616. $.push(c),
  1617. h = c
  1618. }),
  1619. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1620. z -= f,
  1621. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1622. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1623. }
  1624. if (G.center = it(G.end / 2 + G.start / 2),
  1625. v(),
  1626. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1627. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1628. X.end = Y - q,
  1629. _e || c()),
  1630. !V && 0 < H) {
  1631. var n = G.start
  1632. , r = "";
  1633. if (le)
  1634. xe.each($, function(e, t) {
  1635. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1636. Q.push(n),
  1637. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1638. });
  1639. else
  1640. for (; n - H < G.end; )
  1641. Q.push(n),
  1642. n += H;
  1643. if (Z[0] && t !== Q.length) {
  1644. for (var o = 0; o < Q.length; o++)
  1645. r += F.pageBuilder.call(B, o);
  1646. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1647. }
  1648. }
  1649. if (ee.slideeSize = z,
  1650. ee.frameSize = H,
  1651. ee.sbSize = Y,
  1652. ee.handleSize = q,
  1653. le) {
  1654. e && null != F.startAt && (m(F.startAt),
  1655. B[se ? "toCenter" : "toStart"](F.startAt));
  1656. var a = $[ee.activeItem];
  1657. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1658. } else
  1659. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1660. L("load")
  1661. }
  1662. function l(e, t, i) {
  1663. if (le && Ie.released && !i) {
  1664. var n = d(e)
  1665. , r = e > G.start && e < G.end;
  1666. se ? (r && (e = $[n.centerItem].center),
  1667. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1668. }
  1669. 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),
  1670. Ae.start = +new Date,
  1671. Ae.time = 0,
  1672. Ae.from = G.cur,
  1673. Ae.to = e,
  1674. Ae.delta = e - G.cur,
  1675. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1676. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1677. Ie.tweese = 0,
  1678. e !== G.dest && (G.dest = e,
  1679. L("change"),
  1680. _e || o()),
  1681. g(),
  1682. v(),
  1683. p(),
  1684. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1685. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1686. L("activePage", ye.page))
  1687. }
  1688. function o() {
  1689. if (B.initialized) {
  1690. if (!_e)
  1691. return _e = Ge(o),
  1692. void (Ie.released && L("moveStart"));
  1693. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1694. $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),
  1695. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1696. Ae.to === G.cur ? (G.cur = Ae.to,
  1697. Ie.tweese = _e = 0) : _e = Ge(o),
  1698. L("move"),
  1699. 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"),
  1700. !_e && Ie.released && L("moveEnd"),
  1701. c()
  1702. }
  1703. }
  1704. function c() {
  1705. 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,
  1706. X.cur = Fe(it(X.cur), X.start, X.end),
  1707. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1708. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1709. }
  1710. function t() {
  1711. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1712. Te = Ie.init ? Ge(t) : 0,
  1713. Ce.now = +new Date,
  1714. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1715. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1716. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1717. Ce.lastTime = Ce.now
  1718. }
  1719. function i(e, t, i) {
  1720. if ("boolean" === Re(t) && (i = t,
  1721. t = Se),
  1722. t === Se)
  1723. l(G[e], i);
  1724. else {
  1725. if (se && "center" !== e)
  1726. return;
  1727. var n = B.getPos(t);
  1728. n && l(n[e], i, !se)
  1729. }
  1730. }
  1731. function h(e) {
  1732. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1733. }
  1734. function u(e) {
  1735. return h(De(e) && e < 0 ? e + $.length : e)
  1736. }
  1737. function m(e, t) {
  1738. var i = h(e);
  1739. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1740. J.eq(i).addClass(F.activeClass),
  1741. ye.active = ee.activeItem = i,
  1742. p(),
  1743. L("active", i)),
  1744. i)
  1745. }
  1746. function d(e) {
  1747. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1748. var t = {}
  1749. , i = ae ? 0 : H / 2;
  1750. if (!V)
  1751. for (var n = 0, r = Q.length; n < r; n++) {
  1752. if (e >= G.end || n === Q.length - 1) {
  1753. t.activePage = Q.length - 1;
  1754. break
  1755. }
  1756. if (e <= Q[n] + i) {
  1757. t.activePage = n;
  1758. break
  1759. }
  1760. }
  1761. if (le) {
  1762. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1763. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1764. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1765. l === c - 1 || e <= $[l].end + $[l].half) {
  1766. a = l;
  1767. break
  1768. }
  1769. t.firstItem = De(o) ? o : 0,
  1770. t.centerItem = De(s) ? s : t.firstItem,
  1771. t.lastItem = De(a) ? a : t.centerItem
  1772. }
  1773. return t
  1774. }
  1775. function v(e) {
  1776. xe.extend(ee, d(e))
  1777. }
  1778. function p() {
  1779. var e = G.dest <= G.start
  1780. , t = G.dest >= G.end
  1781. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1782. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1783. ge.is("button,input") && ge.prop("disabled", e),
  1784. me.is("button,input") && me.prop("disabled", t),
  1785. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1786. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1787. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1788. de.is("button,input") && de.prop("disabled", e),
  1789. ue.is("button,input") && ue.prop("disabled", t)),
  1790. le && null != ee.activeItem) {
  1791. var n = 0 === ee.activeItem
  1792. , r = ee.activeItem >= $.length - 1
  1793. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1794. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1795. pe.is("button,input") && pe.prop("disabled", n),
  1796. fe.is("button,input") && fe.prop("disabled", r),
  1797. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1798. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1799. }
  1800. }
  1801. function r(e, t, i) {
  1802. if (e = u(e),
  1803. t = u(t),
  1804. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1805. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1806. var n = e < t ? e : i ? t : t - 1
  1807. , r = t < e ? e : i ? t + 1 : t
  1808. , o = t < e;
  1809. 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)),
  1810. a()
  1811. }
  1812. }
  1813. function f(e, t) {
  1814. for (var i = 0, n = ve[e].length; i < n; i++)
  1815. if (ve[e][i] === t)
  1816. return i;
  1817. return -1
  1818. }
  1819. function g() {
  1820. Ie.released && !B.isPaused && B.resume()
  1821. }
  1822. function y(e) {
  1823. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1824. }
  1825. function A() {
  1826. Ie.history[0] = Ie.history[1],
  1827. Ie.history[1] = Ie.history[2],
  1828. Ie.history[2] = Ie.history[3],
  1829. Ie.history[3] = Ie.delta
  1830. }
  1831. function C(e) {
  1832. Ie.released = 0,
  1833. Ie.source = e,
  1834. Ie.slidee = "slidee" === e
  1835. }
  1836. function I(e) {
  1837. var t = "touchstart" === e.type
  1838. , i = e.data.source
  1839. , n = "slidee" === i;
  1840. 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),
  1841. C(i),
  1842. Ie.init = 0,
  1843. Ie.$source = xe(e.target),
  1844. Ie.touch = t,
  1845. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1846. Ie.initX = Ie.pointer.pageX,
  1847. Ie.initY = Ie.pointer.pageY,
  1848. Ie.initPos = n ? G.cur : X.cur,
  1849. Ie.start = +new Date,
  1850. Ie.time = 0,
  1851. Ie.path = 0,
  1852. Ie.delta = 0,
  1853. Ie.locked = 0,
  1854. Ie.history = [0, 0, 0, 0],
  1855. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1856. We.on(t ? qe : Ye, E),
  1857. B.pause(1),
  1858. (n ? U : j).addClass(F.draggedClass),
  1859. L("moveStart"),
  1860. n && (be = setInterval(A, 10)))
  1861. }
  1862. function E(e) {
  1863. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1864. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1865. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1866. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1867. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1868. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1869. Ie.released || !(Ie.path < 1)) {
  1870. if (!Ie.init) {
  1871. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1872. return _();
  1873. Ie.init = 1
  1874. }
  1875. Pe(e),
  1876. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1877. Ie.$source.on(Ze, Oe)),
  1878. Ie.released && (_(),
  1879. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1880. Ie.delta += Ie.swing,
  1881. Ie.tweese = 10 < $e(Ie.swing))),
  1882. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1883. }
  1884. }
  1885. function _() {
  1886. clearInterval(be),
  1887. Ie.released = !0,
  1888. We.off(Ie.touch ? qe : Ye, E),
  1889. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1890. setTimeout(function() {
  1891. Ie.$source.off(Ze, Oe)
  1892. }),
  1893. G.cur === G.dest && Ie.init && L("moveEnd"),
  1894. B.resume(1),
  1895. Ie.init = 0
  1896. }
  1897. function b(e) {
  1898. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1899. }
  1900. function w() {
  1901. B.stop(),
  1902. We.off("mouseup", w)
  1903. }
  1904. function T(e) {
  1905. switch (Pe(e),
  1906. this) {
  1907. case ue[0]:
  1908. case de[0]:
  1909. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1910. We.on("mouseup", w);
  1911. break;
  1912. case pe[0]:
  1913. B.prev();
  1914. break;
  1915. case fe[0]:
  1916. B.next();
  1917. break;
  1918. case ge[0]:
  1919. B.prevPage();
  1920. break;
  1921. case me[0]:
  1922. B.nextPage()
  1923. }
  1924. }
  1925. function x(e) {
  1926. e.originalEvent[He] = B;
  1927. var t = +new Date;
  1928. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1929. ot = t;
  1930. else if (F.scrollBy && G.start !== G.end) {
  1931. var i = function(e) {
  1932. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1933. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1934. le ? (Ue = +new Date,
  1935. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1936. Ee.last = Ue,
  1937. Ee.delta += Ee.curDelta,
  1938. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1939. Ee.delta %= 1),
  1940. Ee.finalDelta) : Ee.curDelta
  1941. }(e.originalEvent);
  1942. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1943. B.slideBy(F.scrollBy * i)
  1944. }
  1945. }
  1946. function S(e) {
  1947. F.clickBar && e.target === W[0] && (Pe(e),
  1948. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1949. }
  1950. function M(e) {
  1951. if (F.keyboardNavBy)
  1952. switch (e.which) {
  1953. case F.horizontal ? 37 : 38:
  1954. Pe(e),
  1955. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1956. break;
  1957. case F.horizontal ? 39 : 40:
  1958. Pe(e),
  1959. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1960. }
  1961. }
  1962. function R(e) {
  1963. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1964. }
  1965. function P() {
  1966. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1967. }
  1968. function O(e) {
  1969. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1970. }
  1971. function L(e, t) {
  1972. if (ve[e]) {
  1973. for (N = ve[e].length,
  1974. Je.length = 0,
  1975. D = 0; D < N; D++)
  1976. Je.push(ve[e][D]);
  1977. for (D = 0; D < N; D++)
  1978. Je[D].call(B, e, t)
  1979. }
  1980. }
  1981. 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 = {
  1982. start: 0,
  1983. center: 0,
  1984. end: 0,
  1985. cur: 0,
  1986. dest: 0
  1987. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1988. start: 0,
  1989. end: 0,
  1990. cur: 0
  1991. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1992. firstItem: 0,
  1993. lastItem: 0,
  1994. centerItem: 0,
  1995. activeItem: null,
  1996. activePage: 0
  1997. }, 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 = {
  1998. released: 1
  1999. }, Ee = {
  2000. last: 0,
  2001. delta: 0,
  2002. resetTime: 200
  2003. }, _e = 0, be = 0, we = 0, Te = 0;
  2004. V || (s = k[0]),
  2005. B.initialized = 0,
  2006. B.frame = s,
  2007. B.slidee = U[0],
  2008. B.pos = G,
  2009. B.rel = ee,
  2010. B.items = $,
  2011. B.pages = Q,
  2012. B.isPaused = 0,
  2013. B.options = F,
  2014. B.dragging = Ie,
  2015. B.reload = function() {
  2016. a()
  2017. }
  2018. ,
  2019. B.getPos = function(e) {
  2020. if (le) {
  2021. var t = h(e);
  2022. return -1 !== t && $[t]
  2023. }
  2024. var i = U.find(e).eq(0);
  2025. if (i[0]) {
  2026. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2027. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2028. return {
  2029. start: n,
  2030. center: n - H / 2 + r / 2,
  2031. end: n - H + r,
  2032. size: r
  2033. }
  2034. }
  2035. return !1
  2036. }
  2037. ,
  2038. B.moveBy = function(e) {
  2039. Ce.speed = e,
  2040. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2041. Ce.startPos = G.cur,
  2042. C("button"),
  2043. Ie.init = 1,
  2044. L("moveStart"),
  2045. ze(Te),
  2046. t())
  2047. }
  2048. ,
  2049. B.stop = function() {
  2050. "button" === Ie.source && (Ie.init = 0,
  2051. Ie.released = 1)
  2052. }
  2053. ,
  2054. B.prev = function() {
  2055. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2056. }
  2057. ,
  2058. B.next = function() {
  2059. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2060. }
  2061. ,
  2062. B.prevPage = function() {
  2063. B.activatePage(ee.activePage - 1)
  2064. }
  2065. ,
  2066. B.nextPage = function() {
  2067. B.activatePage(ee.activePage + 1)
  2068. }
  2069. ,
  2070. B.slideBy = function(e, t) {
  2071. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2072. }
  2073. ,
  2074. B.slideTo = function(e, t) {
  2075. l(e, t)
  2076. }
  2077. ,
  2078. B.toStart = function(e, t) {
  2079. i("start", e, t)
  2080. }
  2081. ,
  2082. B.toEnd = function(e, t) {
  2083. i("end", e, t)
  2084. }
  2085. ,
  2086. B.toCenter = function(e, t) {
  2087. i("center", e, t)
  2088. }
  2089. ,
  2090. B.getIndex = h,
  2091. B.activate = function(e, t) {
  2092. var i = m(e);
  2093. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2094. }
  2095. ,
  2096. B.activatePage = function(e, t) {
  2097. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2098. }
  2099. ,
  2100. B.resume = function(e) {
  2101. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2102. we ? we = clearTimeout(we) : L("resume"),
  2103. we = setTimeout(function() {
  2104. switch (L("cycle"),
  2105. F.cycleBy) {
  2106. case "items":
  2107. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2108. break;
  2109. case "pages":
  2110. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2111. }
  2112. }, F.cycleInterval))
  2113. }
  2114. ,
  2115. B.pause = function(e) {
  2116. e < B.isPaused || (B.isPaused = e || 100,
  2117. we && (we = clearTimeout(we),
  2118. L("pause")))
  2119. }
  2120. ,
  2121. B.toggle = function() {
  2122. B[we ? "pause" : "resume"]()
  2123. }
  2124. ,
  2125. B.set = function(e, t) {
  2126. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2127. }
  2128. ,
  2129. B.add = function(e, t) {
  2130. var i = xe(e);
  2131. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2132. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2133. a()
  2134. }
  2135. ,
  2136. B.remove = function(e) {
  2137. if (le) {
  2138. var t = u(e);
  2139. if (-1 < t) {
  2140. J.eq(t).remove();
  2141. var i = t === ee.activeItem;
  2142. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2143. a(),
  2144. i && (ye.active = null,
  2145. B.activate(ee.activeItem))
  2146. }
  2147. } else
  2148. xe(e).remove(),
  2149. a()
  2150. }
  2151. ,
  2152. B.moveAfter = function(e, t) {
  2153. r(e, t, 1)
  2154. }
  2155. ,
  2156. B.moveBefore = function(e, t) {
  2157. r(e, t)
  2158. }
  2159. ,
  2160. B.on = function(e, t) {
  2161. if ("object" === Re(e))
  2162. for (var i in e)
  2163. e.hasOwnProperty(i) && B.on(i, e[i]);
  2164. else if ("function" === Re(t))
  2165. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2166. ve[n[r]] = ve[n[r]] || [],
  2167. -1 === f(n[r], t) && ve[n[r]].push(t);
  2168. else if ("array" === Re(t))
  2169. for (var a = 0, s = t.length; a < s; a++)
  2170. B.on(e, t[a])
  2171. }
  2172. ,
  2173. B.one = function(t, i) {
  2174. B.on(t, function e() {
  2175. i.apply(B, arguments),
  2176. B.off(t, e)
  2177. })
  2178. }
  2179. ,
  2180. B.off = function(e, t) {
  2181. if (t instanceof Array)
  2182. for (var i = 0, n = t.length; i < n; i++)
  2183. B.off(e, t[i]);
  2184. else
  2185. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2186. if (ve[r[o]] = ve[r[o]] || [],
  2187. null == t)
  2188. ve[r[o]].length = 0;
  2189. else {
  2190. var s = f(r[o], t);
  2191. -1 !== s && ve[r[o]].splice(s, 1)
  2192. }
  2193. }
  2194. ,
  2195. B.destroy = function() {
  2196. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2197. We.off("keydown", M),
  2198. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2199. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2200. Z.empty(),
  2201. V || (k.off("." + He),
  2202. te.restore(),
  2203. ie.restore(),
  2204. ne.restore(),
  2205. re.restore(),
  2206. xe.removeData(s, He)),
  2207. $.length = Q.length = 0,
  2208. ye = {},
  2209. B.initialized = 0,
  2210. B
  2211. }
  2212. ,
  2213. B.init = function() {
  2214. if (!B.initialized) {
  2215. B.on(n);
  2216. var e = ["overflow", "position"]
  2217. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2218. te.save.apply(te, e),
  2219. ne.save.apply(ne, e),
  2220. ie.save.apply(ie, t),
  2221. re.save.apply(re, t);
  2222. var i = j;
  2223. return V || (i = i.add(U),
  2224. k.css("overflow", "hidden"),
  2225. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2226. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2227. i.css({
  2228. position: "absolute"
  2229. })),
  2230. F.forward && ue.on(Ke, T),
  2231. F.backward && de.on(Ke, T),
  2232. F.prev && pe.on(Ze, T),
  2233. F.next && fe.on(Ze, T),
  2234. F.prevPage && ge.on(Ze, T),
  2235. F.nextPage && me.on(Ze, T),
  2236. ce.on(Xe, x),
  2237. W[0] && W.on(Ze, S),
  2238. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2239. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2240. he.on(je, {
  2241. source: "slidee"
  2242. }, I),
  2243. j && j.on(je, {
  2244. source: "handle"
  2245. }, I),
  2246. We.on("keydown", M),
  2247. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2248. k.on("scroll." + He, Le)),
  2249. B.initialized = 1,
  2250. a(!0),
  2251. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2252. B
  2253. }
  2254. }
  2255. }
  2256. function Re(e) {
  2257. 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
  2258. }
  2259. function Pe(e, t) {
  2260. e.preventDefault(),
  2261. t && e.stopPropagation()
  2262. }
  2263. function Oe(e) {
  2264. Pe(e, 1),
  2265. xe(this).off(e.type, Oe)
  2266. }
  2267. function Le() {
  2268. this.scrollLeft = 0,
  2269. this.scrollTop = 0
  2270. }
  2271. function De(e) {
  2272. return !isNaN(parseFloat(e)) && isFinite(e)
  2273. }
  2274. function Ne(e, t) {
  2275. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2276. }
  2277. function Fe(e, t, i) {
  2278. return e < t ? t : i < e ? i : e
  2279. }
  2280. function Be(t) {
  2281. var i = {
  2282. style: {},
  2283. save: function() {
  2284. if (t && t.nodeType) {
  2285. for (var e = 0; e < arguments.length; e++)
  2286. i.style[arguments[e]] = t.style[arguments[e]];
  2287. return i
  2288. }
  2289. },
  2290. restore: function() {
  2291. if (t && t.nodeType) {
  2292. for (var e in i.style)
  2293. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2294. return i
  2295. }
  2296. }
  2297. };
  2298. return i
  2299. }
  2300. 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;
  2301. function t(e) {
  2302. for (var t = 0, i = r.length; t < i; t++) {
  2303. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2304. if (null != o.style[n])
  2305. return n
  2306. }
  2307. }
  2308. We.on(Xe, function(e) {
  2309. var t = e.originalEvent[He]
  2310. , i = +new Date;
  2311. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2312. }),
  2313. function(t) {
  2314. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2315. var t = (new Date).getTime()
  2316. , i = Math.max(0, 16 - (t - r))
  2317. , n = setTimeout(e, i);
  2318. return r = t,
  2319. n
  2320. }
  2321. ;
  2322. var r = (new Date).getTime()
  2323. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2324. ze = function(e) {
  2325. i.call(t, e)
  2326. }
  2327. }(window),
  2328. r = ["", "webkit", "moz", "ms", "o"],
  2329. o = document.createElement("div"),
  2330. Ve = t("transform"),
  2331. ke = t("perspective") ? "translateZ(0) " : "",
  2332. e.Sly = Me,
  2333. xe.fn.sly = function(n, r) {
  2334. var o, a;
  2335. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2336. a = Array.prototype.slice.call(arguments, 1)),
  2337. n = {}),
  2338. this.each(function(e, t) {
  2339. var i = xe.data(t, He);
  2340. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2341. })
  2342. }
  2343. ,
  2344. Me.defaults = {
  2345. slidee: null,
  2346. horizontal: !1,
  2347. itemNav: null,
  2348. itemSelector: null,
  2349. smart: !1,
  2350. activateOn: null,
  2351. activateMiddle: !1,
  2352. scrollSource: null,
  2353. scrollBy: 0,
  2354. scrollHijack: 300,
  2355. scrollTrap: !1,
  2356. dragSource: null,
  2357. mouseDragging: !1,
  2358. touchDragging: !1,
  2359. releaseSwing: !1,
  2360. swingSpeed: .2,
  2361. elasticBounds: !1,
  2362. interactive: null,
  2363. scrollBar: null,
  2364. dragHandle: !1,
  2365. dynamicHandle: !1,
  2366. minHandleSize: 50,
  2367. clickBar: !1,
  2368. syncSpeed: .5,
  2369. pagesBar: null,
  2370. activatePageOn: null,
  2371. pageBuilder: function(e) {
  2372. return "<li>" + (e + 1) + "</li>"
  2373. },
  2374. forward: null,
  2375. backward: null,
  2376. prev: null,
  2377. next: null,
  2378. prevPage: null,
  2379. nextPage: null,
  2380. cycleBy: null,
  2381. cycleInterval: 5e3,
  2382. pauseOnHover: !1,
  2383. startPaused: !1,
  2384. moveBy: 300,
  2385. speed: 0,
  2386. easing: "swing",
  2387. startAt: null,
  2388. keyboardNavBy: null,
  2389. draggedClass: "dragged",
  2390. activeClass: "active",
  2391. disabledClass: "disabled"
  2392. }
  2393. }(jQuery, window),
  2394. function o(a, s, l) {
  2395. function c(i, e) {
  2396. if (!s[i]) {
  2397. if (!a[i]) {
  2398. var t = "function" == typeof require && require;
  2399. if (!e && t)
  2400. return t(i, !0);
  2401. if (h)
  2402. return h(i, !0);
  2403. var n = new Error("Cannot find module '" + i + "'");
  2404. throw n.code = "MODULE_NOT_FOUND",
  2405. n
  2406. }
  2407. var r = s[i] = {
  2408. exports: {}
  2409. };
  2410. a[i][0].call(r.exports, function(e) {
  2411. var t = a[i][1][e];
  2412. return c(t || e)
  2413. }, r, r.exports, o, a, s, l)
  2414. }
  2415. return s[i].exports
  2416. }
  2417. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2418. c(l[e]);
  2419. return c
  2420. }({
  2421. 1: [function(p, f, e) {
  2422. (function(e) {
  2423. "use strict";
  2424. function t(e) {
  2425. this.player = null,
  2426. this.director = null,
  2427. this.modelManager = null,
  2428. this.container = null,
  2429. this.tagManager = null,
  2430. this.fadeInSpeed = e,
  2431. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2432. }
  2433. var r = p("three")
  2434. , i = p("./util/logger")
  2435. , n = (p("./util/common"),
  2436. p("./enum/PlayerEvents"))
  2437. , o = p("./enum/DirectorEvents")
  2438. , a = p("./settings")
  2439. , s = p("./enum/Viewmode")
  2440. , l = (p("./enum/WarpStyle"),
  2441. p("./enum/BlackoutStyle"),
  2442. p("./enum/ModelManagerEvents"))
  2443. , c = p("./enum/tagEvents")
  2444. , h = p("./util/transitions")
  2445. , u = p("./util/lerp")
  2446. , d = new i(e);
  2447. window.THREE = r,
  2448. t.prototype.init = function(e, t, i, n, r) {
  2449. (window.app = this).player = t,
  2450. this.director = e,
  2451. this.modelManager = i,
  2452. this.tagManager = n,
  2453. this.container = r,
  2454. this.updateModel(),
  2455. this.bindEvents()
  2456. }
  2457. ,
  2458. t.prototype.bindEvents = function() {
  2459. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2460. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2461. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2462. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2463. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2464. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2465. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2466. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2467. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2468. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2469. }
  2470. ,
  2471. t.prototype.updateModel = function() {
  2472. this.model = this.modelManager.getActiveModel()
  2473. }
  2474. ,
  2475. t.prototype.handleWarpStarted = function() {
  2476. this.hidePlayerReticule()
  2477. }
  2478. ,
  2479. t.prototype.ontagActivated = function() {
  2480. this.hidePlayerReticule()
  2481. }
  2482. ,
  2483. t.prototype.onNavigationTotag = function() {
  2484. this.hidePlayerReticule()
  2485. }
  2486. ,
  2487. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2488. var n = this.modelManager.getActiveModel()
  2489. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2490. n.fadePanoMarkers(r),
  2491. n.setMode(t)
  2492. }
  2493. ,
  2494. t.prototype.handlePlayerModeChanged = function(e, t) {
  2495. var i = this.modelManager.getActiveModel()
  2496. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2497. i.setSide(n),
  2498. i.setMode(t)
  2499. }
  2500. ,
  2501. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2502. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2503. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2504. }
  2505. ,
  2506. t.prototype.handleActionInterruption = function() {}
  2507. ,
  2508. t.prototype.handleStartInside = function(e) {
  2509. var t = a[this.player.mode]
  2510. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2511. this.fadeIn(this.fadeInSpeed),
  2512. this.model.alpha = 0,
  2513. this.model.skybox.material.uniforms.opacity.value = 1,
  2514. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2515. var n = this.player.reticule;
  2516. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2517. }
  2518. ,
  2519. t.prototype.handleStartOutside = function(e) {
  2520. this.fadeIn(e)
  2521. }
  2522. ,
  2523. t.prototype.fadeIn = function(e) {
  2524. null != e || (e = 2e3,
  2525. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2526. $(this.container).fadeIn(e)
  2527. }
  2528. ,
  2529. t.prototype.hidePlayerReticule = function() {
  2530. this.player.reticule.hide()
  2531. }
  2532. ,
  2533. f.exports = t
  2534. }
  2535. ).call(this, "/js/DisplayController.js")
  2536. }
  2537. , {
  2538. "./enum/BlackoutStyle": 18,
  2539. "./enum/DirectorEvents": 23,
  2540. "./enum/tagEvents": 32,
  2541. "./enum/ModelManagerEvents": 33,
  2542. "./enum/PlayerEvents": 40,
  2543. "./enum/Viewmode": 51,
  2544. "./enum/WarpStyle": 52,
  2545. "./settings": 166,
  2546. "./util/common": 185,
  2547. "./util/lerp": 188,
  2548. "./util/logger": 189,
  2549. "./util/transitions": 195,
  2550. three: 217
  2551. }],
  2552. 2: [function(e, t, i) {
  2553. "use strict";
  2554. function n() {
  2555. this.baseStartTime = performance.timing.navigationStart,
  2556. this.loadingStartTime = null,
  2557. this.waitingStartTime = null,
  2558. this.appReadyTime = null
  2559. }
  2560. n.prototype.setBaseStartTime = function(e) {
  2561. this.baseStartTime = e || Date.now()
  2562. }
  2563. ,
  2564. n.prototype.setWaitingStartTime = function(e) {
  2565. this.waitingStartTime = e || Date.now()
  2566. }
  2567. ,
  2568. n.prototype.setLoadingStartTime = function(e) {
  2569. this.loadingStartTime = e || Date.now()
  2570. }
  2571. ,
  2572. n.prototype.setAppReadyTime = function(e) {
  2573. this.appReadyTime = e || Date.now()
  2574. }
  2575. ,
  2576. n.prototype.calcFullLoadingTime = function() {
  2577. var e = this.appReadyTime - this.baseStartTime;
  2578. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2579. e
  2580. }
  2581. ,
  2582. t.exports = n
  2583. }
  2584. , {}],
  2585. 3: [function(i, n, e) {
  2586. (function(e) {
  2587. "use strict";
  2588. function a() {
  2589. return 100 * Math.random()
  2590. }
  2591. var t = i("./util/logger")
  2592. , s = i("./util/browser")
  2593. , l = new t(e)
  2594. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2595. initialized: !1,
  2596. init: function(e, t) {
  2597. if (t = t || {},
  2598. !this.initialized) {
  2599. for (var i in this.initialized = !0,
  2600. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2601. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2602. e) {
  2603. var n = i.match("^sc_tilegen_([0-9]+)$");
  2604. n && (c.tilegen = a() < parseInt(n[1]));
  2605. var r = i.match("^sc_imgopt_([0-9]+)$");
  2606. r && (c.imgopt = a() < parseInt(r[1]))
  2607. }
  2608. for (var o in t)
  2609. c[o] = t[o],
  2610. l.debug("A/B override:", o, c[o])
  2611. }
  2612. },
  2613. changeIfTileGenerating: function(e) {
  2614. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2615. e += ""),
  2616. e
  2617. },
  2618. changeIfImageOptimzing: function(e) {
  2619. if(e.includes("blob:http"))return e;//add
  2620. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2621. e += ""),
  2622. e
  2623. },
  2624. tilegen: !1,
  2625. imgopt: !1
  2626. };
  2627. n.exports = c
  2628. }
  2629. ).call(this, "/js/ab.js")
  2630. }
  2631. , {
  2632. "./util/browser": 182,
  2633. "./util/logger": 189
  2634. }],
  2635. 4: [function(u, d, e) {
  2636. (function(e) {
  2637. "use strict";
  2638. function r(n, e, t, i) {
  2639. function r(e) {
  2640. a[e.sid] = !0;
  2641. var t = e.billboard.media && e.billboard.media.type
  2642. , i = {
  2643. tag_id: e.sid,
  2644. tags_visited: Object.keys(a).length,
  2645. tag_count: Object.keys(n.tags).length,
  2646. tag_view_count: ++d,
  2647. has_media: !!t
  2648. };
  2649. t && (i.media_type = t),
  2650. g("tag_opened", i)
  2651. }
  2652. var o, a = {}, s = Date.now() - P, l = null;
  2653. i && (l = Date.now() - window.navigationStart);
  2654. try {
  2655. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2656. } catch (n) {
  2657. o = !1
  2658. }
  2659. var c, h = n.supportsVR;
  2660. h || (c = "VR disabled at the model/account level",
  2661. 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"))),
  2662. g("model_loaded", {
  2663. duration: s,
  2664. duration_from_navigation_start: l,
  2665. has_hlr: o,
  2666. has_vr: h,
  2667. vr_reason: c
  2668. });
  2669. var u = 0;
  2670. n.panos.forEach(function(e) {
  2671. e.on("enter", function() {
  2672. f("pano_viewed", {
  2673. pano_id: e.id,
  2674. pano_view_count: ++u,
  2675. alignment_type: e.alignmentType,
  2676. interaction_source: R,
  2677. navigation_source: v
  2678. })
  2679. })
  2680. });
  2681. var d = 0;
  2682. for (var p in n.tags)
  2683. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2684. e.on("tour_auto", function(e) {
  2685. v = "tour_" + e
  2686. }),
  2687. e.on("tour_manual", function(e) {
  2688. R = "gui-" + e,
  2689. v = "tour_manual"
  2690. }),
  2691. t.on(C.InteractionKey, function() {
  2692. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2693. }),
  2694. t.on(C.InteractionDirect, function() {
  2695. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2696. }),
  2697. function(t) {
  2698. I.on(T.OPENED, function() {
  2699. f("showcase_share_intent", {
  2700. pano_id: t.currentPano && t.currentPano.id
  2701. })
  2702. }),
  2703. I.on(T.LINK_CLICKED, function(e) {
  2704. f("showcase_share_action", {
  2705. channel: e.channel,
  2706. pano_id: t.currentPano && t.currentPano.id
  2707. })
  2708. }),
  2709. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2710. f("showcase_share_origin_link_clicked")
  2711. })
  2712. }(e),
  2713. function() {
  2714. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2715. gui_action: "click_vr_button"
  2716. })),
  2717. _.on(S.LAUNCH, function(e) {
  2718. f("showcase_gui", {
  2719. gui_action: "launch_vr",
  2720. vr_platform: e.vr_platform,
  2721. vr_app: e.vr_app
  2722. })
  2723. }),
  2724. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2725. gui_action: "vr_modal_prev"
  2726. })),
  2727. _.on(S.NEXT, function(e) {
  2728. f("showcase_gui", {
  2729. gui_action: e.nextAction
  2730. })
  2731. }),
  2732. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2733. gui_action: "vr_modal_close"
  2734. })),
  2735. _.on(S.falseICECHOSEN, function(e) {
  2736. f("showcase_gui", {
  2737. gui_action: e.name + " "
  2738. })
  2739. }),
  2740. _.on(S.STORE, function(e) {
  2741. f("showcase_gui", {
  2742. gui_action: "launch_store",
  2743. store: e
  2744. })
  2745. })
  2746. }()
  2747. }
  2748. function f(e, t) {
  2749. if (t = t || {},
  2750. i)
  2751. try {
  2752. window.analytics.track(e, s.extendObject(t, c), {
  2753. context: {
  2754. app: {
  2755. name: "showcase",
  2756. version: "2.25.6-0-gd87e5b1"
  2757. },
  2758. screen: {
  2759. width: window.screen.width,
  2760. height: window.screen.height,
  2761. density: window.devicePixelRatio
  2762. }
  2763. }
  2764. })
  2765. } catch (t) {
  2766. console.warn("Failed to send data to segment for " + e)
  2767. }
  2768. }
  2769. function g(e, t) {
  2770. f(e, t = t || {})
  2771. }
  2772. function m(e, t) {
  2773. R = e === C.InteractionGui ? "gui-" + t : e,
  2774. v = "self_guided"
  2775. }
  2776. var v, o, a = (u("three"),
  2777. u("./util/ajax"),
  2778. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2779. 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"),
  2780. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2781. d.exports = {
  2782. report: function(e, t, i, n) {
  2783. !function(e, t) {
  2784. if (o)
  2785. try {
  2786. o.addEvent(e, s.extendObject({
  2787. host: window.location.host,
  2788. keen: {
  2789. addons: [{
  2790. name: "keen:ua_parser",
  2791. input: {
  2792. ua_string: "user_agent"
  2793. },
  2794. output: "parsed_user_agent"
  2795. }]
  2796. },
  2797. user_agent: "${keen.user_agent}",
  2798. referrer: {
  2799. url: s.normalizeUrl(document.referrer),
  2800. domain: s.domainFromUrl(document.referrer),
  2801. url_original: document.referrer
  2802. },
  2803. embedded: y.inIframe(),
  2804. is_mobile: y.isMobile(),
  2805. version: "2.25.6-0-gd87e5b1"
  2806. }, t))
  2807. } catch (e) {
  2808. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2809. }
  2810. }("Session starts", {
  2811. model: e,
  2812. status: t,
  2813. loadtime: Date.now() - (P || Date.now()),
  2814. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2815. autoplay: i,
  2816. quickstart: n,
  2817. ab_tilegen: a.tilegen,
  2818. ab_imgopt: a.imgopt
  2819. })
  2820. },
  2821. impression: function(e) {
  2822. g("impression", {
  2823. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2824. url_params: (void 0 !== e.immediate && e.immediate,
  2825. window.location.search.substr(1).split("&"))
  2826. })
  2827. },
  2828. initKeen: function(e) {
  2829. return e.token && e.appId ? void (o = new Keen({
  2830. projectId: e.appId,
  2831. writeKey: e.token,
  2832. readKey: "",
  2833. requestType: "xhr"
  2834. })) : void l.warn("no keen token/appId")
  2835. },
  2836. initSegment: function(e) {
  2837. return e.token ? (i = e.token,
  2838. window.analytics.load(e.token),
  2839. c = {
  2840. model_id: e.model,
  2841. start_source: e.startSource,
  2842. autoplay: e.autoplay,
  2843. quickstart: e.quickstart,
  2844. language_tag: t.languageTag,
  2845. is_mobile: y.isMobile(),
  2846. iframe: y.inIframe(),
  2847. aspect_ratio: y.aspectRatio(),
  2848. session_id: h,
  2849. window: {
  2850. width: $("#player").width(),
  2851. height: $("#player").height()
  2852. },
  2853. platform: {
  2854. browser: {
  2855. name: $.ua.browser.name,
  2856. major: $.ua.browser.major,
  2857. version: $.ua.browser.version
  2858. },
  2859. os: {
  2860. name: $.ua.os.name,
  2861. version: $.ua.os.version
  2862. },
  2863. device: {
  2864. vendor: $.ua.device.vendor,
  2865. model: $.ua.device.model,
  2866. type: $.ua.device.type
  2867. }
  2868. }
  2869. },
  2870. n = Math.random() < t.analytics.sessionTrackingRate,
  2871. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2872. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2873. },
  2874. sessionStart: function(e) {
  2875. l.debug("analytics user_session_start"),
  2876. f("session_started"),
  2877. P = Date.now(),
  2878. window.addEventListener("unload", function() {
  2879. !function(e, t) {
  2880. if (t = t || {},
  2881. navigator.sendBeacon && i)
  2882. try {
  2883. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2884. event: e,
  2885. anonymousId: window.analytics.user().anonymousId(),
  2886. properties: s.extendObject(t, c),
  2887. writeKey: i,
  2888. sentAt: Date.now(),
  2889. type: "track",
  2890. context: {
  2891. userAgent: y.userAgent(),
  2892. library: {
  2893. name: "showcase-beacon",
  2894. version: "2.25.6-0-gd87e5b1"
  2895. },
  2896. app: {
  2897. name: "showcase",
  2898. version: "2.25.6-0-gd87e5b1"
  2899. }
  2900. }
  2901. }))
  2902. } catch (e) {
  2903. console.warn("Failed to send async segment request")
  2904. }
  2905. }("session_ended", {
  2906. duration: Date.now() - P
  2907. })
  2908. })
  2909. },
  2910. modelLoaded: function(e, t, i, n) {
  2911. r(e, t, i, n)
  2912. },
  2913. loadComplete: function(e) {
  2914. f("load_times", {
  2915. time_to_app_start: e
  2916. })
  2917. },
  2918. track: function(e, t) {
  2919. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2920. f(e, t))
  2921. },
  2922. trackAlways: function(e, t) {
  2923. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2924. f(e, t)
  2925. },
  2926. getSessionId: function() {
  2927. return h
  2928. },
  2929. updateInteraction: m
  2930. }
  2931. }
  2932. ).call(this, "/js/analytics.js")
  2933. }
  2934. , {
  2935. "./ab": 3,
  2936. "./enum/ControlEvents": 21,
  2937. "./enum/PlayerEvents": 40,
  2938. "./enum/VROption": 47,
  2939. "./enum/VRPlatforms": 49,
  2940. "./enum/Viewmode": 51,
  2941. "./gui/sharing/ShareEvents": 76,
  2942. "./gui/sharing/modal": 77,
  2943. "./gui/title/TitleEvents": 80,
  2944. "./gui/title/titleBar": 82,
  2945. "./gui/vr/vrEvent": 85,
  2946. "./gui/vr/vrModal": 87,
  2947. "./localization/localize": 108,
  2948. "./tag/Billboard/BillboardEvent": 120,
  2949. "./settings": 166,
  2950. "./util/ajax": 181,
  2951. "./util/browser": 182,
  2952. "./util/common": 185,
  2953. "./util/logger": 189,
  2954. three: 217
  2955. }],
  2956. 5: [function(e, t, i) {
  2957. "use strict";
  2958. function n() {
  2959. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2960. this.controls = null
  2961. }
  2962. var r = e("three")
  2963. , o = e("../constants")
  2964. , a = e("../util/cameraLight");
  2965. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2966. this.aspect = e,
  2967. this.updateProjectionMatrix()
  2968. }
  2969. ,
  2970. t.exports = n
  2971. }
  2972. , {
  2973. "../constants": 8,
  2974. "../util/cameraLight": 184,
  2975. three: 217
  2976. }],
  2977. 6: [function(e, t, i) {
  2978. "use strict";
  2979. function n() {
  2980. var e = $("#player").width() / $("#player").height();
  2981. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2982. this.controls = null,
  2983. this.updateAspect(e)
  2984. }
  2985. var r = e("three")
  2986. , o = e("../constants");
  2987. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2988. this.aspect = e,
  2989. this.top = o.orthoBase / e,
  2990. this.bottom = -o.orthoBase / e,
  2991. this.updateProjectionMatrix()
  2992. }
  2993. ,
  2994. t.exports = n
  2995. }
  2996. , {
  2997. "../constants": 8,
  2998. three: 217
  2999. }],
  3000. 7: [function(e, t, i) {
  3001. "use strict";
  3002. function n() {
  3003. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3004. this.controls = null
  3005. }
  3006. var r = e("three")
  3007. , o = e("../settings")
  3008. , a = e("../util/cameraLight");
  3009. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3010. this.aspect = e,
  3011. this.updateProjectionMatrix()
  3012. }
  3013. ,
  3014. t.exports = n
  3015. }
  3016. , {
  3017. "../settings": 166,
  3018. "../util/cameraLight": 184,
  3019. three: 217
  3020. }],
  3021. 8: [function(e, t, i) {
  3022. "use strict";
  3023. t.exports = {
  3024. signedUrlDefaultExpireTime: 24e4,
  3025. signedUrlCheckInterval: 1e4,
  3026. signedUrlRefreshBuffer: 15e3,
  3027. dollhouseFOV: 70,
  3028. dollhouseNear: .1,//1,
  3029. dollhouseFar: 5e3,
  3030. insideFOV: 70,
  3031. insideFOVMax: 120,
  3032. insideNear: .1,
  3033. insideFar: 5e3,
  3034. insideLookSpeed: .12,
  3035. insideLookLimitUp: 40,
  3036. insideLookLimitDown: -40,
  3037. orthoNear: 1,
  3038. orthoFar: 5e3,
  3039. orthoBase: 10,
  3040. narrowLandscapeHeight: 290,
  3041. reallyNarrowLandscapeHeight: 250,
  3042. visionTilingStartDate: new Date("8/26/2016"),
  3043. visionTilingStartVersion: "1.1.407.13667",
  3044. windowHeightHighQualityThreshold: 900,
  3045. tourStepDelayDefault: 3500,
  3046. tourStepDelaySlideShow: 5e3,
  3047. workshopApsect: 9 / 16,
  3048. highQualityMaxZoom: 2,
  3049. ultraHighQualityMaxZoom: 3
  3050. }
  3051. }
  3052. , {}],
  3053. 9: [function(e, t, i) {
  3054. "use strict";
  3055. function n() {
  3056. this.activeControl = null,
  3057. this.controls = {},
  3058. this.cameras = {}
  3059. }
  3060. var a = e("./PanoramaControls")
  3061. , s = e("./DollhouseControls")
  3062. , l = e("./FloorplanControls")
  3063. , c = e("../cameras/PanoramaCamera")
  3064. , h = e("../cameras/DollhouseCamera")
  3065. , u = e("../cameras/FloorplanCamera")
  3066. , r = e("events").EventEmitter
  3067. , d = e("../enum/ControlEvents")
  3068. , o = e("../enum/ModelManagerEvents")
  3069. , p = e("../enum/Viewmode")
  3070. , f = e("../settings");
  3071. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3072. this.setUpControls(),
  3073. this.bindEvents(e, t)
  3074. }
  3075. ,
  3076. n.prototype.activateControls = function(e) {
  3077. this.activeControl && (this.activeControl.reset(),
  3078. this.activeControl.enabled = !1),
  3079. this.controls[e] && (this.controls[e].enabled = !0),
  3080. this.activeControl = this.controls[e]
  3081. }
  3082. ,
  3083. n.prototype.setUpControls = function() {
  3084. var i = {}
  3085. , n = {}
  3086. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3087. , r = [c, h, u]
  3088. , o = [a, s, l];
  3089. e.forEach(function(e, t) {
  3090. i[e] = new r[t],
  3091. n[e] = new o[t](i[e]),
  3092. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3093. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3094. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3095. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3096. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3097. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3098. }
  3099. .bind(this)),
  3100. this.controls = n,
  3101. this.cameras = i
  3102. }
  3103. ,
  3104. n.prototype.bindEvents = function(e, t) {
  3105. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3106. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3107. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3108. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3109. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3110. passive: !1
  3111. }),
  3112. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3113. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3114. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3115. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3116. e.addEventListener("contextmenu", function(e) {
  3117. e.preventDefault()
  3118. }),
  3119. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3120. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3121. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3122. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3123. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3124. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3125. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3126. t.on(o.ActiveModelChanged, function(e) {
  3127. this.setModelForControls(e.model)
  3128. }
  3129. .bind(this))
  3130. }
  3131. ,
  3132. n.prototype.setModelForControls = function(e) {
  3133. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3134. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3135. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3136. this.controls[e].setBounds(t)
  3137. }
  3138. .bind(this))
  3139. }
  3140. ,
  3141. n.prototype.onMouseDown = function(e) {
  3142. e.preventDefault(),
  3143. this.activeControl && this.activeControl.onMouseDown(e)
  3144. }
  3145. ,
  3146. n.prototype.onMouseMove = function(e) {
  3147. e.preventDefault(),
  3148. this.activeControl && this.activeControl.onMouseMove(e)
  3149. }
  3150. ,
  3151. n.prototype.onMouseUp = function(e) {
  3152. e.preventDefault(),
  3153. this.activeControl && this.activeControl.onMouseUp(e)
  3154. }
  3155. ,
  3156. n.prototype.onMouseOver = function(e) {
  3157. e.preventDefault(),
  3158. this.activeControl && this.activeControl.onMouseOver(e)
  3159. }
  3160. ,
  3161. n.prototype.onMouseWheel = function(e) {
  3162. e.preventDefault(),
  3163. this.activeControl && this.activeControl.onMouseWheel(e)
  3164. }
  3165. ,
  3166. n.prototype.onTouchStart = function(e) {
  3167. e.preventDefault(),
  3168. this.activeControl && this.activeControl.onTouchStart(e),
  3169. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3170. $("#hotListContent ul .active").removeClass("active"),
  3171. $("#hotList")[0].classList.remove("active")
  3172. }
  3173. ,
  3174. n.prototype.onTouchMove = function(e) {
  3175. e.preventDefault(),
  3176. this.activeControl && this.activeControl.onTouchMove(e)
  3177. }
  3178. ,
  3179. n.prototype.onTouchEnd = function(e) {
  3180. e.preventDefault(),
  3181. this.activeControl && this.activeControl.onTouchEnd(e)
  3182. }
  3183. ,
  3184. n.prototype.onPointerDown = function(e) {
  3185. if (e.preventDefault(),
  3186. this.activeControl)
  3187. switch (e.pointerType) {
  3188. case "mouse":
  3189. this.activeControl.onMouseDown(e);
  3190. break;
  3191. default:
  3192. this.activeControl.onPointerDown(e)
  3193. }
  3194. }
  3195. ,
  3196. n.prototype.onPointerMove = function(e) {
  3197. if (e.preventDefault(),
  3198. this.activeControl)
  3199. switch (e.pointerType) {
  3200. case "mouse":
  3201. this.activeControl.onMouseMove(e);
  3202. break;
  3203. default:
  3204. this.activeControl.onPointerMove(e)
  3205. }
  3206. }
  3207. ,
  3208. n.prototype.onPointerUp = function(e) {
  3209. if (e.preventDefault(),
  3210. this.activeControl)
  3211. switch (e.pointerType) {
  3212. case "mouse":
  3213. this.activeControl.onMouseUp(e);
  3214. break;
  3215. default:
  3216. this.activeControl.onPointerUp(e)
  3217. }
  3218. }
  3219. ,
  3220. n.prototype.onPointerCancel = function(e) {
  3221. e.preventDefault(),
  3222. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3223. }
  3224. ,
  3225. n.prototype.onKeyDown = function(e) {
  3226. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3227. this.activeControl && this.activeControl.onKeyDown(e))
  3228. }
  3229. ,
  3230. n.prototype.onKeyUp = function(e) {
  3231. e.preventDefault(),
  3232. this.activeControl && this.activeControl.onKeyUp(e)
  3233. }
  3234. ,
  3235. t.exports = n
  3236. }
  3237. , {
  3238. "../cameras/DollhouseCamera": 5,
  3239. "../cameras/FloorplanCamera": 6,
  3240. "../cameras/PanoramaCamera": 7,
  3241. "../enum/ControlEvents": 21,
  3242. "../enum/ModelManagerEvents": 33,
  3243. "../enum/Viewmode": 51,
  3244. "../settings": 166,
  3245. "./DollhouseControls": 10,
  3246. "./FloorplanControls": 11,
  3247. "./PanoramaControls": 13,
  3248. events: 202
  3249. }],
  3250. 10: [function(e, t, i) {
  3251. "use strict";
  3252. function n(e) {
  3253. a.call(this, e),
  3254. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3255. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3256. this.minDistance = o.dollhouseDefault.minDistance,
  3257. this.maxDistance = o.dollhouseDefault.maxDistance,
  3258. this.adjustedMinDistance = this.minDistance,
  3259. this.adjustedMaxDistance = this.maxDistance
  3260. }
  3261. var r = e("three")
  3262. , o = e("../settings")
  3263. , a = e("./OutsideControls");
  3264. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3265. this.camera.updateMatrix();
  3266. var i = this.camera.position.clone().sub(this.target).length();
  3267. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3268. this.panLeft(2 * e * i / $("#player").height()),
  3269. this.panUp(-2 * t * i / $("#player").height())
  3270. }
  3271. ,
  3272. n.prototype.updateZoom = function() {
  3273. return this.offset.length() * this.scale
  3274. }
  3275. ,
  3276. n.prototype.setZoomBounds = function(e) {
  3277. var t = e.min.distanceTo(e.max);
  3278. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3279. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3280. this.minDistance = this.adjustedMinDistance,
  3281. this.maxDistance = this.adjustedMaxDistance
  3282. }
  3283. ,
  3284. n.prototype.resetRanges = function(e, t) {
  3285. e ? (this.minDistance = Math.min(e, this.minDistance),
  3286. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3287. this.maxDistance = this.adjustedMaxDistance),
  3288. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3289. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3290. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3291. }
  3292. ,
  3293. n.prototype.toJSON = function() {
  3294. return a.prototype.toJSON.call(this)
  3295. }
  3296. ,
  3297. t.exports = n
  3298. }
  3299. , {
  3300. "../settings": 166,
  3301. "./OutsideControls": 12,
  3302. three: 217
  3303. }],
  3304. 11: [function(e, t, i) {
  3305. "use strict";
  3306. function n(e) {
  3307. c.call(this, e),
  3308. this.minDistance = 15,
  3309. this.maxDistance = 50,
  3310. this.noRotateUpDown = !0,
  3311. this.minPolarAngle = 0,
  3312. this.maxPolarAngle = 0,
  3313. this.mouseActions[u.LEFT] = h.PAN,
  3314. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3315. this.mouseActions[u.RIGHT] = h.ROTATE,
  3316. this.touchActions[1] = h.PAN,
  3317. this.touchActions[2] = h.ROTATE_DOLLY,
  3318. this.absoluteScale = 1,
  3319. this.currentScale = 1
  3320. }
  3321. 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");
  3322. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3323. var t = Math.max(e.x, e.z)
  3324. , i = Math.min(e.x, e.z)
  3325. , n = Math.max(t, i * this.camera.aspect)
  3326. , r = Math.max(i, t * this.camera.aspect);
  3327. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3328. this.currentScale = this.absoluteScale
  3329. }
  3330. ,
  3331. n.prototype.rotateToView = function(e, t) {
  3332. var i = 0;
  3333. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3334. this.rotateLeft(i),
  3335. this.update(0)
  3336. }
  3337. ,
  3338. n.prototype.pan = function(e, t) {
  3339. this.camera.updateMatrix(),
  3340. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3341. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3342. }
  3343. ,
  3344. n.prototype.updateZoom = function() {
  3345. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3346. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3347. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3348. this.camera.left = -l.orthoBase * this.currentScale,
  3349. this.camera.right = l.orthoBase * this.currentScale,
  3350. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3351. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3352. this.camera.updateProjectionMatrix(),
  3353. this.offset.length()
  3354. }
  3355. ,
  3356. n.prototype.toJSON = (r = new s.Quaternion,
  3357. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3358. a = new s.Quaternion,
  3359. function() {
  3360. var e = c.prototype.toJSON.call(this);
  3361. return r.copy(e.camera_quaternion),
  3362. a.copy(o),
  3363. a.multiply(r),
  3364. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3365. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3366. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3367. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3368. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3369. e
  3370. }
  3371. ),
  3372. t.exports = n
  3373. }
  3374. , {
  3375. "../enum/ControlActions": 20,
  3376. "../enum/MouseButton": 34,
  3377. "../settings": 166,
  3378. "../util/browser": 182,
  3379. "../util/math": 190,
  3380. "./OutsideControls": 12,
  3381. three: 217
  3382. }],
  3383. 12: [function(e, t, i) {
  3384. "use strict";
  3385. function n(e) {
  3386. this.camera = e,
  3387. (this.camera.controls = this).enabled = !1,
  3388. this.target = new a.Vector3,
  3389. this.targetBounds = new a.Box3,
  3390. this.zoomSpeed = 2,//编辑时缩放快一些
  3391. this.minDistance = 0,
  3392. this.maxDistance = 1 / 0,
  3393. this.noRotateUpDown = !1,
  3394. this.rotateSpeed = 1,
  3395. this.keyboardZoomSpeed = 0,
  3396. this.keyPanSpeed = 7,
  3397. this.autoRotate = !1,
  3398. this.autoRotateSpeed = 2,
  3399. this.autoPan = !1,
  3400. this.autoPanPosition = new a.Vector3,
  3401. this.minPolarAngle = a.Math.degToRad(25),
  3402. this.maxPolarAngle = a.Math.degToRad(65),
  3403. this.rotationAcceleration = new a.Vector2,
  3404. this.rotationSpeed = new a.Vector2,
  3405. this.panAcceleration = new a.Vector2,
  3406. this.panSpeed = new a.Vector2,
  3407. this.rotateStart = new a.Vector2,
  3408. this.rotateEnd = new a.Vector2,
  3409. this.rotateDelta = new a.Vector2,
  3410. this.panStart = new a.Vector2,
  3411. this.panEnd = new a.Vector2,
  3412. this.panDelta = new a.Vector2,
  3413. this.panOffset = new a.Vector3,
  3414. this.offset = new a.Vector3,
  3415. this.dollyStart = new a.Vector2,
  3416. this.dollyEnd = new a.Vector2,
  3417. this.dollyDelta = new a.Vector2,
  3418. this.phiDelta = 0,
  3419. this.thetaDelta = 0,
  3420. this.scale = 1,
  3421. this.panVector = new a.Vector3,
  3422. this.lastPosition = new a.Vector3,
  3423. this.state = u.NONE,
  3424. this.mouseActions = {},
  3425. this.mouseActions[d.LEFT] = u.ROTATE,
  3426. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3427. this.mouseActions[d.RIGHT] = u.PAN,
  3428. this.touchActions = {},
  3429. this.touchActions[1] = u.ROTATE,
  3430. this.touchActions[2] = u.PAN_DOLLY,
  3431. this.lastMoveTime = 0,
  3432. this.pointersLimit = 2,
  3433. this.pointers = []
  3434. }
  3435. 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;
  3436. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3437. this.targetBounds = e
  3438. }
  3439. ,
  3440. n.prototype.isEngaged = function() {
  3441. return this.state !== u.NONE
  3442. }
  3443. ,
  3444. n.prototype.rotateLeft = function(e) {
  3445. void 0 === e && (e = this.getAutoRotationAngle()),
  3446. this.thetaDelta -= e
  3447. }
  3448. ,
  3449. n.prototype.rotateUp = function(e) {
  3450. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3451. this.phiDelta -= e)
  3452. }
  3453. ,
  3454. n.prototype.panLeft = function(e) {
  3455. var t = this.camera.matrix.elements;
  3456. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3457. this.panOffset.multiplyScalar(-e),
  3458. this.panVector.add(this.panOffset)
  3459. }
  3460. ,
  3461. n.prototype.panUp = function(e) {
  3462. var t = this.camera.matrix.elements;
  3463. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3464. this.panOffset.multiplyScalar(-e),
  3465. this.panVector.add(this.panOffset)
  3466. }
  3467. ,
  3468. n.prototype.startRotating = function(e, t) {
  3469. e && this.navRotationAcc("x", e),
  3470. t && this.navRotationAcc("y", t)
  3471. }
  3472. ,
  3473. n.prototype.stopRotating = function(e) {
  3474. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3475. this.navRotationAcc("x", 0),
  3476. this.navRotationAcc("y", 0)
  3477. }
  3478. ,
  3479. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3480. o = new a.Vector3,
  3481. function(e, t) {
  3482. r.copy(this.camera.position),
  3483. void 0 === e && null === e || r.setX(e),
  3484. void 0 === t && null === t || r.setZ(t);
  3485. var i = this.camera.position.distanceTo(this.target)
  3486. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3487. this.targetClamped = !1,
  3488. o.copy(r).addScaledVector(n, i),
  3489. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3490. r.copy(o).addScaledVector(n, -i),
  3491. this.targetClamped = !0),
  3492. this.autoPanPosition.x = r.x,
  3493. this.autoPanPosition.z = r.z,
  3494. this.autoPan && this.stopAutoPanning()
  3495. }
  3496. ),
  3497. n.prototype.stopAutoPanning = function() {
  3498. var e = this.autoPan;
  3499. this.autoPan = !1,
  3500. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3501. }
  3502. ,
  3503. n.prototype.dollyIn = function(e) {
  3504. void 0 === e && (e = this.getZoomScale()),
  3505. this.scale /= e
  3506. }
  3507. ,
  3508. n.prototype.dollyOut = function(e) {
  3509. void 0 === e && (e = this.getZoomScale()),
  3510. this.scale *= e
  3511. }
  3512. ,
  3513. n.prototype.updatePan = function(e) {
  3514. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3515. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3516. this.autoPan) {
  3517. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3518. t.setY(0).clampLength(0, 50 * e),
  3519. this.target.add(t),
  3520. this.camera.position.add(t),
  3521. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3522. this.stopAutoPanning())
  3523. }
  3524. }
  3525. ,
  3526. n.prototype.update = function(e) {
  3527. e = e || 1 / 60,
  3528. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3529. this.rotateLeft(-this.rotationSpeed.x),
  3530. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3531. this.updatePan(e);
  3532. var t = this.camera.position;
  3533. this.offset.copy(t).sub(this.target);
  3534. var i = Math.atan2(this.offset.x, this.offset.z)
  3535. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3536. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3537. i += this.thetaDelta,
  3538. n += this.phiDelta,
  3539. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3540. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3541. var r = this.updateZoom();
  3542. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3543. this.target.add(this.panVector),
  3544. this.targetBounds.clampPoint(this.target, this.target),
  3545. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3546. this.offset.y = r * Math.cos(n),
  3547. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3548. t.copy(this.target).add(this.offset),
  3549. this.camera.lookAt(this.target),
  3550. this.thetaDelta = 0,
  3551. this.phiDelta = 0,
  3552. this.scale = 1,
  3553. this.panVector.set(0, 0, 0),
  3554. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3555. }
  3556. ,
  3557. n.prototype.getAutoRotationAngle = function() {
  3558. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3559. }
  3560. ,
  3561. n.prototype.getZoomScale = function() {
  3562. return Math.pow(.95, this.zoomSpeed)
  3563. }
  3564. ,
  3565. n.prototype.onMouseDown = function(e) {
  3566. if (this.enabled) {
  3567. switch (e.preventDefault(),
  3568. this.stopAutoPanning(),
  3569. this.mouseDown = !0,
  3570. this.state = this.mouseActions[e.button],
  3571. this.state) {
  3572. case u.ROTATE:
  3573. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3574. this.rotationSpeed.set(0, 0);
  3575. break;
  3576. case u.DOLLY:
  3577. this.dollyStart.set(e.clientX, e.clientY);
  3578. break;
  3579. case u.PAN:
  3580. this.panStart.set(e.clientX, e.clientY)
  3581. }
  3582. this.emit(f.InputStart, "mouse")
  3583. }
  3584. }
  3585. ,
  3586. n.prototype.onMouseMove = function(e) {
  3587. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3588. switch (e.preventDefault(),
  3589. this.state) {
  3590. case u.ROTATE:
  3591. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3592. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3593. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3594. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3595. this.rotateStart.copy(this.rotateEnd);
  3596. break;
  3597. case u.DOLLY:
  3598. this.dollyEnd.set(e.clientX, e.clientY),
  3599. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3600. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3601. this.dollyStart.copy(this.dollyEnd);
  3602. break;
  3603. case u.PAN:
  3604. this.panEnd.set(e.clientX, e.clientY),
  3605. this.panDelta.subVectors(this.panEnd, this.panStart),
  3606. this.pan(this.panDelta.x, this.panDelta.y),
  3607. this.panStart.copy(this.panEnd)
  3608. }
  3609. this.emit(f.Move, "mouse"),
  3610. this.lastMoveTime = e.timeStamp,
  3611. this.update()
  3612. }
  3613. }
  3614. ,
  3615. n.prototype.onMouseUp = function(e) {
  3616. this.enabled && (this.mouseDown = !1,
  3617. this.state = u.NONE,
  3618. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3619. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3620. this.update(),
  3621. this.rotationAcceleration.set(0, 0),
  3622. this.rotateDelta.set(0, 0)))
  3623. }
  3624. ,
  3625. n.prototype.onMouseOver = function(e) {
  3626. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3627. }
  3628. ,
  3629. n.prototype.onMouseWheel = function(e) {
  3630. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3631. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3632. this.update())
  3633. }
  3634. ,
  3635. n.prototype.onKeyDown = function(e) {
  3636. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3637. this.handleKeyDown(e.which)))
  3638. }
  3639. ,
  3640. n.prototype.navRotationAcc = function(e, t) {
  3641. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3642. }
  3643. ,
  3644. n.prototype.navPanAcc = function(e, t) {
  3645. this.stopAutoPanning(),
  3646. this.panAcceleration[e] = t
  3647. }
  3648. ,
  3649. n.prototype.handleKeyDown = function(e) {
  3650. var t = !0;
  3651. switch (e) {
  3652. case p.UPARROW:
  3653. case p.I:
  3654. this.navRotationAcc("y", 1);
  3655. break;
  3656. case p.DOWNARROW:
  3657. case p.K:
  3658. this.navRotationAcc("y", -1);
  3659. break;
  3660. case p.LEFTARROW:
  3661. case p.J:
  3662. this.navRotationAcc("x", -1);
  3663. break;
  3664. case p.RIGHTARROW:
  3665. case p.L:
  3666. this.navRotationAcc("x", 1);
  3667. break;
  3668. case p.W:
  3669. this.navPanAcc("y", 1);
  3670. break;
  3671. case p.S:
  3672. this.navPanAcc("y", -1);
  3673. break;
  3674. case p.A:
  3675. this.navPanAcc("x", -1);
  3676. break;
  3677. case p.D:
  3678. this.navPanAcc("x", 1);
  3679. break;
  3680. default:
  3681. t = !1
  3682. }
  3683. t && this.emit(f.Move, "key")
  3684. }
  3685. ,
  3686. n.prototype.onKeyUp = function(e) {
  3687. this.enabled && (e.preventDefault(),
  3688. e.stopPropagation(),
  3689. this.handleKeyUp(e.which))
  3690. }
  3691. ,
  3692. n.prototype.handleKeyUp = function(e) {
  3693. switch (e) {
  3694. case p.I:
  3695. case p.K:
  3696. case p.UPARROW:
  3697. case p.DOWNARROW:
  3698. this.keyboardZoomSpeed = 0,
  3699. this.rotationAcceleration.y = 0;
  3700. break;
  3701. case p.J:
  3702. case p.L:
  3703. case p.LEFTARROW:
  3704. case p.RIGHTARROW:
  3705. this.rotationAcceleration.x = 0;
  3706. break;
  3707. case p.S:
  3708. case p.W:
  3709. this.panAcceleration.y = 0;
  3710. break;
  3711. case p.A:
  3712. case p.D:
  3713. this.panAcceleration.x = 0
  3714. }
  3715. }
  3716. ,
  3717. n.prototype.onTouchStart = function(i) {
  3718. if (this.enabled || this.state === u.NONE) {
  3719. i.preventDefault(),
  3720. i.stopPropagation(),
  3721. this.stopAutoPanning();
  3722. var e = function() {
  3723. if (2 === i.touches.length) {
  3724. var e = i.touches[0].pageX - i.touches[1].pageX
  3725. , t = i.touches[0].pageY - i.touches[1].pageY;
  3726. this.dollyStart.set(e, t)
  3727. }
  3728. }
  3729. .bind(this)
  3730. , t = function() {
  3731. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3732. }
  3733. .bind(this)
  3734. , n = function() {
  3735. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3736. }
  3737. .bind(this);
  3738. switch (this.state = this.touchActions[i.touches.length],
  3739. this.state) {
  3740. case u.PAN_DOLLY:
  3741. e();
  3742. case u.PAN:
  3743. t();
  3744. break;
  3745. case u.ROTATE_DOLLY:
  3746. e();
  3747. case u.ROTATE:
  3748. n()
  3749. }
  3750. this.rotationSpeed.set(0, 0),
  3751. this.emit(f.InputStart, "touch")
  3752. }
  3753. }
  3754. ,
  3755. n.prototype.onTouchMove = function(a) {
  3756. if (this.enabled && this.state !== u.NONE) {
  3757. a.preventDefault(),
  3758. a.stopPropagation();
  3759. var s = function() {
  3760. var e = a.touches[0].pageX - a.touches[1].pageX
  3761. , t = a.touches[0].pageY - a.touches[1].pageY;
  3762. this.dollyEnd.set(e, t);
  3763. var i = this.dollyStart.length() - this.dollyEnd.length();
  3764. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3765. this.dollyStart.copy(this.dollyEnd)
  3766. }
  3767. .bind(this)
  3768. , e = function() {
  3769. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3770. this.panDelta.subVectors(this.panEnd, this.panStart),
  3771. this.pan(this.panDelta.x, this.panDelta.y),
  3772. this.panStart.copy(this.panEnd),
  3773. this.rotateDelta.set(0, 0)
  3774. }
  3775. .bind(this)
  3776. , l = function() {
  3777. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3778. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3779. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3780. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3781. this.rotateStart.copy(this.rotateEnd)
  3782. }
  3783. .bind(this)
  3784. , t = function() {
  3785. if (2 === a.touches.length) {
  3786. var e = window.devicePixelRatio || 1
  3787. , t = a.touches[1].pageX - a.touches[0].pageX
  3788. , i = a.touches[1].pageY - a.touches[0].pageY
  3789. , n = Math.sqrt(t * t + i * i);
  3790. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3791. this.state = u.DOLLY,
  3792. s();
  3793. else {
  3794. var r = h.average(a.touches, "pageX")
  3795. , o = h.average(a.touches, "pageY");
  3796. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3797. this.rotateStart.set(r, o),
  3798. l())
  3799. }
  3800. }
  3801. }
  3802. .bind(this);
  3803. switch (this.state) {
  3804. case u.PAN_DOLLY:
  3805. s();
  3806. case u.PAN:
  3807. e();
  3808. break;
  3809. case u.ROTATE_DOLLY:
  3810. t();
  3811. break;
  3812. case u.DOLLY:
  3813. s();
  3814. break;
  3815. case u.ROTATE:
  3816. l();
  3817. break;
  3818. default:
  3819. this.state = u.NONE
  3820. }
  3821. this.lastMoveTime = a.timeStamp,
  3822. this.emit(f.Move, "touch")
  3823. }
  3824. }
  3825. ,
  3826. n.prototype.onTouchEnd = function(e) {
  3827. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3828. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3829. this.state = u.NONE,
  3830. this.update(),
  3831. this.rotationAcceleration.set(0, 0),
  3832. this.rotateDelta.set(0, 0))
  3833. }
  3834. ,
  3835. n.prototype.onPointerDown = function(e) {
  3836. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3837. id: e.pointerId,
  3838. pageX: e.pageX,
  3839. pageY: e.pageY
  3840. }),
  3841. e.touches = this.pointers,
  3842. this.onTouchStart(e)),
  3843. this.emit(f.InputStart, "pointer"))
  3844. }
  3845. ,
  3846. n.prototype.onPointerMove = function(t) {
  3847. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3848. t.pointerId === e.id && (e.pageX = t.pageX,
  3849. e.pageY = t.pageY)
  3850. }),
  3851. t.touches = this.pointers,
  3852. this.onTouchMove(t))
  3853. }
  3854. ,
  3855. n.prototype.onPointerUp = function(i) {
  3856. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3857. i.pointerId === e.id && this.pointers.splice(t, 1)
  3858. }
  3859. .bind(this)),
  3860. i.touches = this.pointers,
  3861. this.onTouchEnd(i))
  3862. }
  3863. ,
  3864. n.prototype.reset = function() {
  3865. this.state = u.NONE,
  3866. this.stopAutoPanning(),
  3867. this.rotationSpeed.set(0, 0),
  3868. this.rotationAcceleration.set(0, 0),
  3869. this.panSpeed.set(0, 0),
  3870. this.panAcceleration.set(0, 0)
  3871. }
  3872. ,
  3873. n.prototype.toJSON = function() {
  3874. return {
  3875. camera_position: {
  3876. x: s.toPrecision(this.camera.position.x, 4),
  3877. y: s.toPrecision(this.camera.position.y, 4),
  3878. z: s.toPrecision(this.camera.position.z, 4)
  3879. },
  3880. camera_quaternion: {
  3881. x: s.toPrecision(this.camera.quaternion.x, 4),
  3882. y: s.toPrecision(this.camera.quaternion.y, 4),
  3883. z: s.toPrecision(this.camera.quaternion.z, 4),
  3884. w: s.toPrecision(this.camera.quaternion.w, 4)
  3885. }
  3886. }
  3887. }
  3888. ,
  3889. t.exports = n
  3890. }
  3891. , {
  3892. "../enum/ControlActions": 20,
  3893. "../enum/ControlEvents": 21,
  3894. "../enum/Keys": 30,
  3895. "../enum/MouseButton": 34,
  3896. "../enum/Vectors": 50,
  3897. "../settings": 166,
  3898. "../util/common": 185,
  3899. "../util/math": 190,
  3900. events: 202,
  3901. three: 217
  3902. }],
  3903. 13: [function(u, d, e) {
  3904. (function(e) {
  3905. "use strict";
  3906. function t(e) {
  3907. this.camera = e,
  3908. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3909. this.lookVector = new s.Vector3,
  3910. this.lookSpeed = .05,
  3911. this.rotationAcc = new s.Vector2,
  3912. this.rotationSpeed = new s.Vector2,
  3913. this.lat = 0,
  3914. this.lon = 0,
  3915. this.phi = 0,
  3916. this.theta = 0,
  3917. this.enabled = !1,
  3918. this.locked = !1,
  3919. this.pointer = new s.Vector2(0,0),
  3920. this.rotationHistory = [],
  3921. this.rotationDifference = new s.Vector2,
  3922. this.pointerDragOn = !1,
  3923. this.pointerDragStart = new s.Vector2(0,0),
  3924. this.pinchDistance = 0,
  3925. this.moveStart = new s.Vector2,
  3926. this.moveTolerance = .01,
  3927. this.pointersLimit = 2,
  3928. this.pointers = []
  3929. }
  3930. var s = u("three")
  3931. , i = u("../util/logger")
  3932. , n = u("../settings")
  3933. , r = u("../util/common")
  3934. , o = u("../util/math")
  3935. , a = (u("../enum/Vectors"),
  3936. u("../enum/MouseButton"))
  3937. , l = u("../enum/Keys")
  3938. , c = u("../enum/ControlEvents")
  3939. , h = u("events").EventEmitter;
  3940. new i(e),
  3941. (t.prototype = Object.create(h.prototype)).usable = function() {
  3942. return this.enabled && !this.locked
  3943. }
  3944. ,
  3945. t.prototype.lookAt = function(e) {
  3946. var t = this.camera.position.clone().sub(e)
  3947. , i = Math.atan(t.z / t.x);
  3948. i += t.x < 0 ? Math.PI : 0,
  3949. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3950. this.lon = s.Math.radToDeg(i) + 180;
  3951. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3952. , r = Math.atan(t.y / n);
  3953. this.lat = -s.Math.radToDeg(r)
  3954. }
  3955. ,
  3956. t.prototype.startRotationFrom = function(e, t) {
  3957. o.convertScreenPositionToNDC(e, t, this.pointer),
  3958. this.pointerDragOn = !0,
  3959. this.pointerDragStart.copy(this.pointer),
  3960. this.moveStart.copy(this.pointer),
  3961. this.rotationHistory = [],
  3962. this.rotationSpeed.set(0, 0)
  3963. }
  3964. ,
  3965. t.prototype.onMouseOver = function(e) {
  3966. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3967. }
  3968. ,
  3969. t.prototype.onTouchStart = function(e) {
  3970. if (this.usable()) {
  3971. switch (e.preventDefault(),
  3972. e.stopPropagation(),
  3973. e.touches.length) {
  3974. case 1:
  3975. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3976. break;
  3977. case 2:
  3978. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3979. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3980. this.pinchDistance = Math.sqrt(t * t + i * i)
  3981. }
  3982. this.emit(c.InputStart, "touch")
  3983. }
  3984. }
  3985. ,
  3986. t.prototype.onPointerDown = function(e) {
  3987. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3988. id: e.pointerId,
  3989. clientX: e.clientX,
  3990. clientY: e.clientY
  3991. }),
  3992. e.touches = this.pointers,
  3993. this.onTouchStart(e),
  3994. this.emit(c.InputStart, "pointer"))
  3995. }
  3996. ,
  3997. t.prototype.onMouseDown = function(e) {
  3998. if (this.usable()) {
  3999. switch (e.preventDefault(),
  4000. e.stopPropagation(),
  4001. e.button) {
  4002. case a.LEFT:
  4003. this.startRotationFrom(e.clientX, e.clientY)
  4004. }
  4005. this.emit(c.InputStart, "mouse")
  4006. }
  4007. }
  4008. ,
  4009. t.prototype.updateRotation = function() {
  4010. if (this.usable() && this.pointerDragOn) {
  4011. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4012. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4013. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4014. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4015. , r = Math.atan2(e.y, i)
  4016. , o = Math.atan2(t.y, n);
  4017. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4018. e.y = 0,
  4019. t.y = 0;
  4020. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4021. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4022. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4023. this.pointerDragStart.copy(this.pointer)
  4024. }
  4025. }
  4026. ,
  4027. t.prototype.onMouseMove = function(e) {
  4028. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4029. 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"))
  4030. }
  4031. ,
  4032. t.prototype.onTouchMove = function(e) {
  4033. if (this.usable())
  4034. switch (this.emit(c.Move, "touch"),
  4035. e.touches.length) {
  4036. case 1:
  4037. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4038. break;
  4039. case 2:
  4040. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4041. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4042. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4043. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4044. this.emit(c.Pinch, n),
  4045. this.pinchDistance -= n)
  4046. }
  4047. }
  4048. ,
  4049. t.prototype.onPointerMove = function(t) {
  4050. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4051. t.pointerId === e.id && (e.clientX = t.clientX,
  4052. e.clientY = t.clientY)
  4053. }),
  4054. t.touches = this.pointers,
  4055. this.onTouchMove(t))
  4056. }
  4057. ,
  4058. t.prototype.endRotation = function() {
  4059. this.pointerDragOn = !1;
  4060. var e = r.averageVectors(this.rotationHistory);
  4061. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4062. }
  4063. ,
  4064. t.prototype.onTouchEnd = function(e) {
  4065. this.usable() && (e.preventDefault(),
  4066. e.stopPropagation(),
  4067. this.endRotation())
  4068. }
  4069. ,
  4070. t.prototype.onMouseUp = function(e) {
  4071. this.usable() && (e.preventDefault(),
  4072. e.stopPropagation(),
  4073. this.endRotation())
  4074. }
  4075. ,
  4076. t.prototype.onPointerUp = function(i) {
  4077. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4078. i.pointerId === e.id && this.pointers.splice(t, 1)
  4079. }
  4080. .bind(this)),
  4081. i.touches = this.pointers,
  4082. this.onTouchEnd(i))
  4083. }
  4084. ,
  4085. t.prototype.update = function(e) {
  4086. for (this.lon,
  4087. this.lat,
  4088. this.updateRotation(),
  4089. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4090. this.rotationHistory.shift();
  4091. this.lon += this.rotationDifference.x,
  4092. this.lat += this.rotationDifference.y,
  4093. this.rotationDifference.set(0, 0),
  4094. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4095. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4096. this.lon += this.rotationSpeed.x * e,
  4097. this.lat += this.rotationSpeed.y * e,
  4098. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4099. this.phi = s.Math.degToRad(90 - this.lat),
  4100. this.theta = s.Math.degToRad(this.lon),
  4101. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4102. this.lookVector.y = Math.cos(this.phi),
  4103. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4104. this.target.copy(this.lookVector).add(this.camera.position),
  4105. this.camera.lookAt(this.target)
  4106. }
  4107. ,
  4108. t.prototype.onMouseWheel = function(e) {
  4109. if (this.usable()) {
  4110. var t = e.wheelDelta || -e.detail;
  4111. this.emit(c.InteractionDirect),
  4112. this.emit(c.Scroll, t)
  4113. }
  4114. }
  4115. ,
  4116. t.prototype.onKeyDown = function(e) {
  4117. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4118. this.handleKeyDown(e.which)))
  4119. }
  4120. ,
  4121. t.prototype.handleKeyDown = function(e) {
  4122. var t = function(e, t) {
  4123. this.rotationAcc[e] = t
  4124. }
  4125. .bind(this);
  4126. this.emit(c.InteractionKey);
  4127. var i = !0;
  4128. switch (e) {
  4129. case l.LEFTARROW:
  4130. case l.J:
  4131. t("x", -1);
  4132. break;
  4133. case l.RIGHTARROW:
  4134. case l.L:
  4135. t("x", 1);
  4136. break;
  4137. case l.I:
  4138. t("y", 1);
  4139. break;
  4140. case l.K:
  4141. t("y", -1);
  4142. break;
  4143. default:
  4144. i = !1
  4145. }
  4146. i && this.emit(c.Move, "key")
  4147. }
  4148. ,
  4149. t.prototype.onKeyUp = function(e) {
  4150. this.usable() && (e.preventDefault(),
  4151. e.stopPropagation(),
  4152. this.handleKeyUp(e.which))
  4153. }
  4154. ,
  4155. t.prototype.handleKeyUp = function(e) {
  4156. switch (e) {
  4157. case l.LEFTARROW:
  4158. case l.J:
  4159. case l.RIGHTARROW:
  4160. case l.L:
  4161. this.rotationAcc.x = 0;
  4162. break;
  4163. case l.I:
  4164. case l.K:
  4165. this.rotationAcc.y = 0
  4166. }
  4167. }
  4168. ,
  4169. t.prototype.startRotating = function(e, t) {
  4170. e && (this.rotationAcc.x = e),
  4171. t && (this.rotationAcc.y = t)
  4172. }
  4173. ,
  4174. t.prototype.stopRotating = function(e) {
  4175. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4176. this.rotationAcc.set(0, 0)
  4177. }
  4178. ,
  4179. t.prototype.reset = function() {
  4180. this.pointerDragOn = !1,
  4181. this.rotationAcc.set(0, 0),
  4182. this.rotationSpeed.set(0, 0),
  4183. this.pointers = []
  4184. }
  4185. ,
  4186. t.prototype.toJSON = function() {
  4187. return {
  4188. camera_position: {
  4189. x: o.toPrecision(this.camera.position.x, 4),
  4190. y: o.toPrecision(this.camera.position.y, 4),
  4191. z: o.toPrecision(this.camera.position.z, 4)
  4192. },
  4193. camera_quaternion: {
  4194. x: o.toPrecision(this.camera.quaternion.x, 4),
  4195. y: o.toPrecision(this.camera.quaternion.y, 4),
  4196. z: o.toPrecision(this.camera.quaternion.z, 4),
  4197. w: o.toPrecision(this.camera.quaternion.w, 4)
  4198. }
  4199. }
  4200. }
  4201. ,
  4202. t.prototype.setStateFromJSON = function(e) {
  4203. this.camera.position.copy(e.camera_position),
  4204. this.camera.quaternion.copy(e.camera_quaternion)
  4205. }
  4206. ,
  4207. d.exports = t
  4208. }
  4209. ).call(this, "/js/controls/PanoramaControls.js")
  4210. }
  4211. , {
  4212. "../enum/ControlEvents": 21,
  4213. "../enum/Keys": 30,
  4214. "../enum/MouseButton": 34,
  4215. "../enum/Vectors": 50,
  4216. "../settings": 166,
  4217. "../util/common": 185,
  4218. "../util/logger": 189,
  4219. "../util/math": 190,
  4220. events: 202,
  4221. three: 217
  4222. }],
  4223. 14: [function(t, i, e) {
  4224. (function(e) {
  4225. "use strict";
  4226. var c = t("three")
  4227. , h = t("../enum/Viewmode")
  4228. , u = new (t("../util/logger"))(e);
  4229. i.exports = {
  4230. serialize: function(e) {
  4231. return encodeURI(JSON.stringify(e))
  4232. },
  4233. deserialize: function(e) {
  4234. function t(e) {
  4235. return e.reduce(function(e, t) {
  4236. return e && "number" == typeof t && !isNaN(t)
  4237. }, !0)
  4238. }
  4239. try {
  4240. var i = JSON.parse(decodeURI(e))
  4241. , n = {
  4242. mode: h.fromInt(i.camera_mode),
  4243. panoId: i.scan_id,
  4244. position: (new c.Vector3).copy(i.camera_position),
  4245. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4246. zoom: i.ortho_zoom,
  4247. floorVisibility: i.floor_visibility
  4248. }
  4249. , r = n.position;
  4250. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4251. var o = n.quaternion;
  4252. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4253. n
  4254. } catch (i) {
  4255. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4256. try {
  4257. var a = e.split(",")
  4258. , s = {
  4259. x: parseFloat(a[2]),
  4260. y: parseFloat(a[3]),
  4261. z: parseFloat(a[4])
  4262. }
  4263. , l = {
  4264. x: parseFloat(a[5]),
  4265. y: parseFloat(a[6]),
  4266. z: parseFloat(a[7]),
  4267. w: parseFloat(a[8])
  4268. };
  4269. return t([s.x, s.y, s.z]) || (s.x = 0,
  4270. s.y = 0,
  4271. s.z = 0),
  4272. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4273. l.y = 0,
  4274. l.z = 0,
  4275. l.w = 1),
  4276. {
  4277. mode: h.fromInt(a[0]),
  4278. panoId: a[1],
  4279. position: (new c.Vector3).copy(s),
  4280. quaternion: (new c.Quaternion).copy(l)
  4281. }
  4282. } catch (t) {
  4283. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4284. }
  4285. }
  4286. return null
  4287. }
  4288. }
  4289. }
  4290. ).call(this, "/js/controls/serializer.js")
  4291. }
  4292. , {
  4293. "../enum/Viewmode": 51,
  4294. "../util/logger": 189,
  4295. three: 217
  4296. }],
  4297. 15: [function(C, I, e) {
  4298. (function(e) {
  4299. "use strict";
  4300. function t() {
  4301. this.endlessLoop = r.warp.loop,
  4302. this.clock = new i.Clock(!0),
  4303. this.model = null,
  4304. this.player = null,
  4305. this.currentItem = null,
  4306. this.destinationItem = null,
  4307. this.tourIsPlaying = !1,
  4308. this.transitionStage = v.None,
  4309. this.nextFunc = null,
  4310. this.onTheBus = !1,
  4311. this.tourInProgress = !1,
  4312. this.reachSource = null,
  4313. this.interrupted = !1,
  4314. this.nItems = 0,
  4315. this.walkingSectionPaused = !1
  4316. }
  4317. var i = C("three")
  4318. , n = C("./util/logger")
  4319. , r = C("./settings")
  4320. , o = C("./util/transitions")
  4321. , a = C("events").EventEmitter
  4322. , s = C("./enum/Viewmode")
  4323. , l = C("./analytics")
  4324. , c = C("./enum/WarpStyle")
  4325. , h = (o = C("./util/transitions"),
  4326. C("./model/ModelManager"),
  4327. C("./enum/ModelManagerEvents"))
  4328. , u = C("./enum/DirectorEvents")
  4329. , d = C("./enum/PlayerEvents")
  4330. , p = (C("./enum/ControlEvents"),
  4331. C("./enum/BlackoutStyle"))
  4332. , f = C("./enum/PathDiscardMode")
  4333. , g = C("./enum/PathDisplayMode")
  4334. , m = (C("./player"),
  4335. new n(e))
  4336. , v = Object.freeze({
  4337. None: 0,
  4338. Moving: 1,
  4339. Aiming: 2,
  4340. Interlude: 3
  4341. })
  4342. , y = Object.freeze({
  4343. Forward: 1,
  4344. NoChange: 0,
  4345. Backwards: -1
  4346. })
  4347. , A = o.getUniqueId();
  4348. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4349. this.player = e,
  4350. this.modelManager = t,
  4351. this.updateModel(),
  4352. this.resetAll(),
  4353. this.bindEvents()
  4354. }
  4355. ,
  4356. t.prototype.resetAll = function() {
  4357. if (this.currentItem = null,
  4358. this.destinationItem = null,
  4359. this.tourIsPlaying = !1,
  4360. this.bgmReplay(),
  4361. this.transitionStage = v.None,
  4362. this.nextFunc = null,
  4363. this.onTheBus = !1,
  4364. this.reachSource = null,
  4365. this.interrupted = !1,
  4366. this.model) {
  4367. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4368. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4369. } else
  4370. this.defaultWarpStyle = c.BLACK,
  4371. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4372. this.resetSpecialTransition()
  4373. }
  4374. ,
  4375. t.prototype.updateModel = function() {
  4376. this.model = this.modelManager.getActiveModel(),
  4377. this.nItems = this.model.heroLocations.length
  4378. }
  4379. ,
  4380. t.prototype.bindEvents = function() {
  4381. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4382. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4383. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4384. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4385. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4386. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4387. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4388. this.player.once(d.Move, function() {
  4389. o.cancelById(A)
  4390. })
  4391. }
  4392. ,
  4393. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4394. return e === c.WALK && (this.interrupt(p.NONE),
  4395. this.pauseWalkingSection(),
  4396. this.player.fastForwardActivePanoFlight(),
  4397. !0)
  4398. }
  4399. ,
  4400. t.prototype.handlePlayerMove = function(e) {
  4401. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4402. this.emit("update.controls")
  4403. }
  4404. ,
  4405. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4406. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4407. this.emit("update.controls"))
  4408. }
  4409. ,
  4410. t.prototype.handlePlayerModeChanged = function(e, t) {
  4411. this.intermediateState() || e === t || (this.onTheBus = !1,
  4412. this.emit("update.controls"))
  4413. }
  4414. ,
  4415. t.prototype.handlePlayerInputStart = function(e) {
  4416. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4417. }
  4418. ,
  4419. t.prototype.handlePlayerFlyingStarted = function() {
  4420. this.clearWalkingSectionPaused()
  4421. }
  4422. ,
  4423. t.prototype.describe = function() {
  4424. return {
  4425. nItems: this.nItems,
  4426. currentItem: this.currentItem,
  4427. destinationItem: this.destinationItem,
  4428. tourIsPlaying: this.tourIsPlaying,
  4429. onTheBus: this.onTheBus,
  4430. endlessLoop: this.endlessLoop,
  4431. viewMode: this.player.mode,
  4432. inTransition: this._inTransition(),
  4433. transitionStage: this.transitionStage,
  4434. tourInProgress: this.tourInProgress
  4435. }
  4436. }
  4437. ,
  4438. t.prototype._inTransition = function() {
  4439. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4440. }
  4441. ,
  4442. t.prototype.bounceable = function() {
  4443. var e = this.clock.getDelta();
  4444. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4445. }
  4446. ,
  4447. t.prototype.itemCompare = function(item1, item2, type){//add
  4448. if(type == 'equal'){//==
  4449. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4450. }else if(type == 'less'){//<
  4451. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4452. }
  4453. }
  4454. t.prototype.currentMoveDirection = function() {
  4455. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4456. 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
  4457. }
  4458. ,
  4459. t.prototype.clearPath = function() {
  4460. this._inTransition() || this.player.path.discardPathObject()
  4461. }
  4462. ,
  4463. t.prototype.allFloors = function() {
  4464. this.model.toggleAllFloors()
  4465. }
  4466. ,
  4467. t.prototype.actionComplete = function(e) {
  4468. if (this.interrupted = !1,
  4469. this.transitionStage = v.None,
  4470. this.resetSpecialTransition(),
  4471. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4472. this.tourIsPlaying || (this.player.disablePreRendering(),
  4473. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4474. this.emit("update.controls"),
  4475. this.nextFunc) {
  4476. var t = this.nextFunc;
  4477. this.nextFunc = null,
  4478. t()
  4479. }
  4480. }
  4481. ,
  4482. t.prototype.awaitCompletion = function(e, t) {
  4483. this.nextFunc = t,
  4484. e()
  4485. }
  4486. ,
  4487. t.prototype.updateSuccessFunction = function(e) {
  4488. this.nextFunc = e
  4489. }
  4490. ,
  4491. t.prototype.interrupt = function(e, t) {
  4492. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4493. this.tourIsPlaying = !1,
  4494. this.bgmReplay(),
  4495. this.interrupted = !0,
  4496. this.nextFunc = null,
  4497. this.emit(u.ActionInterrupted),
  4498. null != e || (e = p.BEGINNING),
  4499. this.player.interruptAndFastForward(e, t),
  4500. !0)
  4501. }
  4502. ,
  4503. t.prototype.wouldInterrupt = function() {
  4504. return this.transitionStage !== v.None
  4505. }
  4506. ,
  4507. t.prototype.intermediateState = function() {
  4508. return this.transitionStage !== v.None
  4509. }
  4510. ,
  4511. t.prototype.isInterrupted = function() {
  4512. return this.interrupted
  4513. }
  4514. ,
  4515. t.prototype.pauseWalkingSection = function() {
  4516. this.walkingSectionPaused = !0
  4517. }
  4518. ,
  4519. t.prototype.clearWalkingSectionPaused = function() {
  4520. this.walkingSectionPaused = !1
  4521. }
  4522. ,
  4523. t.prototype.autoTour = function() {
  4524. var i = Date.now();
  4525. this.model.auxDataPromise.then(function() {
  4526. i = Date.now() - i;
  4527. var e = r.warp.auto
  4528. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4529. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4530. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4531. done: function() {
  4532. this.playTour()
  4533. }
  4534. .bind(this),
  4535. name: "_atr",
  4536. id: A
  4537. })
  4538. }
  4539. .bind(this))
  4540. }
  4541. ,
  4542. t.prototype.atDestinationPano = function() {
  4543. if (!this.player.currentPano || null === this.destinationItem)
  4544. return !1;
  4545. var e = this.player.currentPano.id;
  4546. if (void 0 === e)
  4547. return !1;
  4548. var t = this.model.heroLocations;
  4549. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4550. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4551. return destination && destination.panoId == e
  4552. }
  4553. ,
  4554. t.prototype.redirectToItem = function(e, t) {
  4555. if (null != e)
  4556. if (this.wouldInterrupt())
  4557. if (this.player.mode !== s.TRANSITIONING) {
  4558. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4559. var i = function() {
  4560. o.setTimeout(function() {
  4561. this.setDestinationItem(e),
  4562. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4563. }
  4564. .bind(this), 0)
  4565. }
  4566. .bind(this);
  4567. this.interrupt(p.END, 0),
  4568. this.updateSuccessFunction(i)
  4569. } else
  4570. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4571. else
  4572. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4573. else
  4574. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4575. }
  4576. ,
  4577. t.prototype.useSpecialTransition = function(e) {
  4578. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4579. this.nextWarpStyle = c.BLACK
  4580. }
  4581. ,
  4582. t.prototype.resetSpecialTransition = function() {
  4583. this.nextWarpStyle = this.defaultWarpStyle
  4584. }
  4585. ,
  4586. t.prototype.arrivedAtDestination = function(e) {
  4587. if (this.player.flying || this.player.isWarping())
  4588. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4589. else {
  4590. this.transitionStage = v.Aiming;
  4591. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4592. this.player.model.fadePanoMarkers(0),
  4593. this.awaitCompletion(function() {
  4594. this.resetSpecialTransition(),
  4595. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4596. }
  4597. .bind(this), t)
  4598. }
  4599. }
  4600. ,
  4601. t.prototype.goToDestination = function(e, t, i, n) {
  4602. //音频
  4603. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4604. if(musicInfo && musicInfo.music){
  4605. var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4606. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4607. let audioSrc2 = o.split('/').pop();
  4608. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4609. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4610. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4611. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4612. g_tourAudio.play()
  4613. }
  4614. }else{//很可能是该folder的起始
  4615. g_tourAudio.src = manage.dealURL(o);
  4616. g_tourAudio.load()
  4617. }
  4618. }
  4619. if (this.onTheBus = !0,
  4620. this.emit("update.controls"),
  4621. this.player.updateLastView(),
  4622. n || !this.atDestinationPano())
  4623. if (this.player.flying || this.player.isWarping())
  4624. m.warn("Cannot go to new destination while player is flying or warping.");
  4625. else {
  4626. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4627. , s = null
  4628. , l = null;
  4629. if (a.isPano()) {
  4630. o = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4631. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4632. s = this.arrivedAtDestination.bind(this, !0)
  4633. } else{
  4634. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4635. s = this.arrivedAtDestination.bind(this, !1);
  4636. }
  4637. this.transitionStage = v.Moving,
  4638. this.model.fadePanoMarkers(0),
  4639. this.awaitCompletion(function() {
  4640. l()
  4641. }
  4642. .bind(this), s),
  4643. this.emit("update.controls")
  4644. }
  4645. else
  4646. this.arrivedAtDestination(!0)
  4647. }
  4648. ,
  4649. t.prototype.tourInterlude = function() {
  4650. if (l.trackAlways("reach_highlight", {
  4651. reach_source: this.reachSource
  4652. }),
  4653. this.model.fadePanoMarkers(0),
  4654. this.emit("update.controls"),
  4655. this.tourIsPlaying)
  4656. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4657. this.stopTour(),
  4658. this.emit(u.TourEnd),
  4659. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4660. this.transitionStage = v.Interlude,
  4661. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4662. }
  4663. .bind(this), this.goNext.bind(this))
  4664. }
  4665. ,
  4666. t.prototype.playTour = function() {
  4667. if (!this.bounceable())
  4668. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4669. this.tourInProgress = !0,
  4670. this.reachSource = "play",
  4671. this.tourIsPlaying = !0,
  4672. this.wasZoomEnabled = this.player.zoomEnabled,
  4673. this.player.zoomEnabled = !1,
  4674. this.resetSpecialTransition(),
  4675. this.emit("update.controls"),
  4676. this.emit(u.TourStart),
  4677. this.player.enablePreRendering(),
  4678. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4679. this.goToDestination()) : this.goNext()))
  4680. }
  4681. ,
  4682. t.prototype.bgmReplay = function() {
  4683. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4684. g_playAudio = g_bgAudio;
  4685. g_tourAudio && g_tourAudio.pause();
  4686. //window.tourAudio && window.tourAudio.pause();
  4687. manage.switchBgmState(true);
  4688. }
  4689. }
  4690. ,
  4691. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4692. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4693. this.tourIsPlaying = !1,
  4694. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4695. this.interrupt(),
  4696. this.clearWalkingSectionPaused(),
  4697. this.resetSpecialTransition(),
  4698. this.emit("update.controls"))
  4699. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4700. {
  4701. g_tourAudio.pause();
  4702. g_tourAudio.src = ""
  4703. }
  4704. }
  4705. ,
  4706. t.prototype.endTourProgress = function() {
  4707. this.tourInProgress = !1,
  4708. this.emit("update.controls"),
  4709. this.emit(u.TourEnd)
  4710. }
  4711. ,
  4712. t.prototype.goToHighlight = function(e) {
  4713. if (this.wouldInterrupt())
  4714. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4715. else {
  4716. if (m.debug("<tour.goto " + e + ">"),
  4717. this.isInterrupted())
  4718. return;
  4719. this.clearWalkingSectionPaused(),
  4720. this.setDestinationItem(e),
  4721. this.useSpecialTransition("Hilight"),
  4722. this.goToDestination(),
  4723. l.trackAlways("reach_highlight", {
  4724. reach_source: "thumb"
  4725. })
  4726. }
  4727. }
  4728. ,
  4729. t.prototype.prevHighlight = function() {
  4730. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4731. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4732. this.reachSource = "prev",
  4733. this.goPrev()))
  4734. }
  4735. ,
  4736. t.prototype.nextHighlight = function() {
  4737. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4738. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4739. this.reachSource = "next",
  4740. this.goNext()))
  4741. }
  4742. ,
  4743. t.prototype.changeMode = function(e) {
  4744. var t = $.Deferred()
  4745. , i = t.resolve.bind(t)
  4746. , n = t.reject.bind(t);
  4747. if (this.emit(u.StartModeChange),
  4748. !function() {
  4749. return this.clearWalkingSectionPaused(),
  4750. !!this.wouldInterrupt() && (this.interrupt(),
  4751. !0)
  4752. }
  4753. .bind(this)()) {
  4754. switch (e) {
  4755. case s.PANORAMA:
  4756. 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);
  4757. break;
  4758. case s.DOLLHOUSE:
  4759. case s.FLOORPLAN:
  4760. this.player.flyToNewMode({
  4761. mode: e
  4762. }).done(i).fail(n);
  4763. break;
  4764. case s.OUTDOOR:
  4765. 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)
  4766. }
  4767. return t.promise()
  4768. }
  4769. }
  4770. ,
  4771. t.prototype.atEndOfTour = function(item) {
  4772. //return this.currentItem >= this.nItems - 1
  4773. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4774. if(end){
  4775. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4776. if(heroLocations){
  4777. end = this.currentItem[1] >= heroLocations.length - 1
  4778. }
  4779. }
  4780. return end;
  4781. }
  4782. ,
  4783. t.prototype.firstDestination = function() {
  4784. //return 0 < this.nItems ? 0 : null
  4785. return 0 < this.nItems ? [0,0]: null
  4786. }
  4787. ,
  4788. t.prototype.finalDestination = function() {
  4789. //return 0 < this.nItems ? this.nItems - 1 : null
  4790. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4791. }
  4792. ,
  4793. t.prototype.goPrev = function() {
  4794. this.tourAdvance(-1)
  4795. }
  4796. ,
  4797. t.prototype.goNext = function() {
  4798. this.tourAdvance(1)
  4799. }
  4800. ,
  4801. t.prototype.setDestinationItem = function(e) {
  4802. this.destinationItem = e,
  4803. this.emit("update.controls")
  4804. }
  4805. ,
  4806. t.prototype.setCurrentItem = function(e) {
  4807. this.currentItem = e,
  4808. this.emit("update.controls")
  4809. }
  4810. ,
  4811. t.prototype.nextItem = function(currentItem) {
  4812. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4813. if(currentItem == void 0)return this.firstDestination()
  4814. var currentLocation = this.model.heroLocations[currentItem[0]];
  4815. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4816. var item;
  4817. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4818. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4819. }else{
  4820. item = [currentItem[0] , currentItem[1]+1]
  4821. }
  4822. if(item[0] >= this.nItems ){
  4823. item = this.firstDestination()
  4824. }
  4825. return item;
  4826. //暂时不理会endlessLoop,默认为false
  4827. }
  4828. ,
  4829. t.prototype.prevItem = function(currentItem) {
  4830. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4831. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4832. var item;
  4833. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4834. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4835. else{
  4836. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4837. if(this.currentItem[1] == 0){//子目录中第一个
  4838. return [currentItem[0] - 1, lastChildNum-1]
  4839. }else{
  4840. return [currentItem[0], currentItem[1]-1]
  4841. }
  4842. }
  4843. }
  4844. ,
  4845. t.prototype.tourAdvance = function(e) {//e是1或-1
  4846. m.debug("tourAdvance(" + e + ")")
  4847. if(null === this.currentItem || void 0 === this.currentItem){
  4848. this.setDestinationItem(this.firstDestination())
  4849. }else{
  4850. var item
  4851. if(e == 1){
  4852. item = this.nextItem(this.currentItem)
  4853. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  4854. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4855. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4856. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  4857. }else{
  4858. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  4859. } */
  4860. }else if(e == -1){
  4861. item = this.prevItem(this.currentItem)
  4862. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  4863. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  4864. else{
  4865. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4866. if(this.currentItem[1] == 0){//子目录中第一个
  4867. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  4868. }else{
  4869. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  4870. }
  4871. } */
  4872. }
  4873. //this.setDestinationItem(this.currentItem + e)
  4874. this.setDestinationItem(item)
  4875. }
  4876. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4877. this.useSpecialTransition("reverse-looping to end")
  4878. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4879. this.useSpecialTransition("looping back to start")
  4880. }
  4881. /* if(this.destinationItem[0] < 0 ){
  4882. this.setDestinationItem(this.finalDestination())
  4883. this.useSpecialTransition("reverse-looping to end")
  4884. }else{
  4885. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4886. this.useSpecialTransition("looping back to start"))
  4887. } */
  4888. var momentTour = this.getMomentTour(this.destinationItem);
  4889. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4890. var i = this.player.zoomLevel;
  4891. this.player.zoomEnabled = !0;
  4892. var t = function(e, t) {
  4893. this.player.zoomTo((1 - e) * i, !0)
  4894. }
  4895. .bind(this);
  4896. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4897. }
  4898. this.goToDestination()
  4899. }
  4900. ,
  4901. t.prototype.getMomentTour = function(destinationItem) {//add
  4902. /* if(!item) return window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4903. var currentLocation = this.model.heroLocations[item[0]];
  4904. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4905. if(item[1]>=currentChildNum-1){//子目录中最后一个
  4906. return window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4907. }else{
  4908. return currentLocation.momentTour || "walk";
  4909. } */
  4910. if(!destinationItem || destinationItem[1] == 0) return window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4911. else{
  4912. var currentLocation = this.model.heroLocations[destinationItem[0]];
  4913. return currentLocation.momentTour || "walk";
  4914. }
  4915. }
  4916. ,
  4917. I.exports = t
  4918. }
  4919. ).call(this, "/js/director.js")
  4920. }
  4921. , {
  4922. "./analytics": 4,
  4923. "./enum/BlackoutStyle": 18,
  4924. "./enum/ControlEvents": 21,
  4925. "./enum/DirectorEvents": 23,
  4926. "./enum/ModelManagerEvents": 33,
  4927. "./enum/PathDiscardMode": 38,
  4928. "./enum/PathDisplayMode": 39,
  4929. "./enum/PlayerEvents": 40,
  4930. "./enum/Viewmode": 51,
  4931. "./enum/WarpStyle": 52,
  4932. "./model/ModelManager": 140,
  4933. "./player": 155,
  4934. "./settings": 166,
  4935. "./util/logger": 189,
  4936. "./util/transitions": 195,
  4937. events: 202,
  4938. three: 217
  4939. }],
  4940. 16: [function(e, t, i) {
  4941. "use strict";
  4942. var n = e("three")
  4943. , r = e("./enum/Viewmode")
  4944. , o = (e("./settings"),
  4945. e("./util/transitions"))
  4946. , a = e("./enum/PlayerEvents")
  4947. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4948. , l = new n.ShaderPass(n.VerticalBlurShader);
  4949. l.renderToScreen = !0;
  4950. var c = $("#player").width() / $("#player").height();
  4951. isNaN(c) && (c = 1);
  4952. var h = {
  4953. currentBlur: 0,
  4954. aspect: c,
  4955. blurStrength: 1,
  4956. hblurPass: s,
  4957. vblurPass: l,
  4958. bindEvents: function(e) {
  4959. e.on(a.ModeChanged, function(e, t) {
  4960. e === r.PANORAMA && (o.cancel(h.blur),
  4961. o.cancel(h.addBlur),
  4962. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4963. })
  4964. },
  4965. blur: function(e) {
  4966. var t = (h.currentBlur = e) * h.blurStrength;
  4967. l.uniforms.v.value = t / 512 * h.aspect,
  4968. s.uniforms.h.value = t / 512
  4969. },
  4970. addBlur: function(e) {
  4971. e = Math.max(e, h.currentBlur),
  4972. h.blur(e)
  4973. },
  4974. removeBlur: function(e) {
  4975. e = Math.min(1 - e, h.currentBlur),
  4976. h.blur(e)
  4977. }
  4978. };
  4979. h.blur(0),
  4980. t.exports = h
  4981. }
  4982. , {
  4983. "./enum/PlayerEvents": 40,
  4984. "./enum/Viewmode": 51,
  4985. "./settings": 166,
  4986. "./util/transitions": 195,
  4987. three: 217
  4988. }],
  4989. 17: [function(e, t, i) {
  4990. "use strict";
  4991. t.exports = {
  4992. UNKNOWN: 0,
  4993. ALIGNED: 1,
  4994. UNALIGNED: 2,
  4995. PLACED: 3
  4996. }
  4997. }
  4998. , {}],
  4999. 18: [function(e, t, i) {
  5000. "use strict";
  5001. t.exports = {
  5002. NONE: 0,
  5003. MIDDLE: 1,
  5004. END: 2,
  5005. BEGINNING: 3,
  5006. FADEIN: 4
  5007. }
  5008. }
  5009. , {}],
  5010. 19: [function(e, t, i) {
  5011. "use strict";
  5012. var r = e("three");
  5013. t.exports = {
  5014. newBlue: new r.Color(4967932),
  5015. altBlue: new r.Color(47355),
  5016. tagDefault: new r.Color(223357),
  5017. classicBlue: new r.Color(53759),
  5018. mpYellow: new r.Color(16502016),
  5019. mpOrange: new r.Color(16428055),
  5020. mpBlue: new r.Color(12096),
  5021. mpLtGrey: new r.Color(13751252),
  5022. mpDkGrey: new r.Color(10000019),
  5023. mpRed: new r.Color(12525854),
  5024. mpOrangeDesat: new r.Color(16764529),
  5025. mpBlueDesat: new r.Color(4034734),
  5026. mpRedDesat: new r.Color(14705505),
  5027. white: new r.Color(16777215),
  5028. black: new r.Color(0),
  5029. _desat: function(e, t) {
  5030. var i = t || .3
  5031. , n = (new r.Color).copy(e).getHSL();
  5032. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5033. },
  5034. _darken: function(e, t) {
  5035. var i = t || .2
  5036. , n = e.getHSL();
  5037. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5038. }
  5039. }
  5040. }
  5041. , {
  5042. three: 217
  5043. }],
  5044. 20: [function(e, t, i) {
  5045. "use strict";
  5046. t.exports = {
  5047. NONE: -1,
  5048. ROTATE: 0,
  5049. DOLLY: 1,
  5050. PAN: 2,
  5051. ROTATE_DOLLY: 3,
  5052. PAN_DOLLY: 4
  5053. }
  5054. }
  5055. , {}],
  5056. 21: [function(e, t, i) {
  5057. "use strict";
  5058. t.exports = {
  5059. Move: "move",
  5060. InteractionDirect: "interaction.direct",
  5061. InteractionKey: "interaction.key",
  5062. InteractionGui: "interaction.gui",
  5063. FlyInDirection: "fly.direction",
  5064. InputStart: "input.start",
  5065. Pinch: "input.pinch",
  5066. Scroll: "input.scroll",
  5067. AutoPanInterrupt: "autopan.interrupt",
  5068. AutoPanComplete: "autopan.complete",
  5069. AutoPanClamped: "autopan.clamped",
  5070. LongTap: "longtap"
  5071. }
  5072. }
  5073. , {}],
  5074. 22: [function(e, t, i) {
  5075. "use strict";
  5076. t.exports = Object.freeze({
  5077. FORWARD: "FORWARD",
  5078. LEFT: "LEFT",
  5079. RIGHT: "RIGHT",
  5080. BACK: "BACK",
  5081. UP: "UP",
  5082. DOWN: "DOWN"
  5083. })
  5084. }
  5085. , {}],
  5086. 23: [function(e, t, i) {
  5087. "use strict";
  5088. t.exports = {
  5089. ActionInterrupted: "action.interrupted",
  5090. TourStart: "tour.start",
  5091. TourEnd: "tour.end",
  5092. StartModeChange: "mode.startChange"
  5093. }
  5094. }
  5095. , {}],
  5096. 24: [function(e, t, i) {
  5097. "use strict";
  5098. t.exports = Object.freeze({
  5099. None: 0,
  5100. Queued: 1,
  5101. ForceQueued: 2,
  5102. Downloading: 3,
  5103. Downloaded: 4,
  5104. DownloadFailed: 5
  5105. })
  5106. }
  5107. , {}],
  5108. 25: [function(e, t, i) {
  5109. "use strict";
  5110. t.exports = {
  5111. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5112. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5113. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5114. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5115. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5116. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5117. }
  5118. }
  5119. , {}],
  5120. 26: [function(e, t, i) {
  5121. "use strict";
  5122. t.exports = {
  5123. Texture2D: 0,
  5124. TextureCube: 1
  5125. }
  5126. }
  5127. , {}],
  5128. 27: [function(e, t, i) {
  5129. "use strict";
  5130. t.exports = {
  5131. SMALL: "small",
  5132. LARGE: "large"
  5133. }
  5134. }
  5135. , {}],
  5136. 28: [function(e, t, i) {
  5137. "use strict";
  5138. var n = e("./Viewmode")
  5139. , r = {
  5140. LANDING: {},
  5141. NAVIGATION: "navigation",
  5142. MORE_HELP: "moreHelp",
  5143. TOUR_INTERACTION: {}
  5144. };
  5145. r.LANDING[n.PANORAMA] = "panorama.landing",
  5146. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5147. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5148. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5149. r.TOUR_INTERACTION.standard = "standard.tour",
  5150. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5151. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5152. t.exports = r
  5153. }
  5154. , {
  5155. "./Viewmode": 51
  5156. }],
  5157. 29: [function(e, t, i) {
  5158. "use strict";
  5159. var n = {
  5160. UP: 1,
  5161. DOWN: -1,
  5162. LEFT: "L",
  5163. RIGHT: "R",
  5164. FORWARD: "F",
  5165. BACK: "B",
  5166. reverse: {},
  5167. opposite: function(e) {
  5168. return this.reverse[e.toString()]
  5169. }
  5170. };
  5171. n.reverse[n.UP] = n.DOWN,
  5172. n.reverse[n.DOWN] = n.UP,
  5173. n.reverse[n.LEFT] = n.RIGHT,
  5174. n.reverse[n.RIGHT] = n.LEFT,
  5175. n.reverse[n.FORWARD] = n.BACK,
  5176. n.reverse[n.BACK] = n.FORWARD,
  5177. t.exports = n
  5178. }
  5179. , {}],
  5180. 30: [function(e, t, i) {
  5181. "use strict";
  5182. var n = {
  5183. ZERO: 48,
  5184. ONE: 49,
  5185. TWO: 50,
  5186. THREE: 51,
  5187. FOUR: 52,
  5188. FIVE: 53,
  5189. SIX: 54,
  5190. SEVEN: 55,
  5191. EIGHT: 56,
  5192. NINE: 57,
  5193. LEFTARROW: 37,
  5194. UPARROW: 38,
  5195. RIGHTARROW: 39,
  5196. DOWNARROW: 40,
  5197. A: 65,
  5198. B: 66,
  5199. C: 67,
  5200. D: 68,
  5201. E: 69,
  5202. F: 70,
  5203. G: 71,
  5204. H: 72,
  5205. I: 73,
  5206. J: 74,
  5207. K: 75,
  5208. L: 76,
  5209. M: 77,
  5210. N: 78,
  5211. O: 79,
  5212. P: 80,
  5213. Q: 81,
  5214. R: 82,
  5215. S: 83,
  5216. T: 84,
  5217. U: 85,
  5218. V: 86,
  5219. W: 87,
  5220. X: 88,
  5221. Y: 89,
  5222. Z: 90,
  5223. SPACE: 32,
  5224. RETURN: 13,
  5225. SEMICOLON: 186,
  5226. PLUSEQUALS: 187,
  5227. DASHUNDERSCORE: 189,
  5228. OPENBRACKET: 219
  5229. };
  5230. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5231. n.PLUSEQUALS = 61,
  5232. n.DASHUNDERSCORE = 173),
  5233. t.exports = n
  5234. }
  5235. , {
  5236. "../util/browser": 182
  5237. }],
  5238. 31: [function(e, t, i) {
  5239. "use strict";
  5240. t.exports = {
  5241. EN_US: "en-US",
  5242. ES_MX: "es-MX",
  5243. FR_FR: "fr-FR",
  5244. DE_DE: "de-DE",
  5245. RU_RU: "ru-RU",
  5246. CN_CN: "cn-CN",
  5247. JP_JP: "jp-JP"
  5248. }
  5249. }
  5250. , {}],
  5251. 32: [function(e, t, i) {
  5252. "use strict";
  5253. t.exports = {
  5254. TagActivated: "tag.activated",
  5255. TagDismissed: "tag.dismissed",
  5256. TagNavigation: "tag.navigation"
  5257. }
  5258. }
  5259. , {}],
  5260. 33: [function(e, t, i) {
  5261. "use strict";
  5262. t.exports = {
  5263. ModelAdded: "model-added",
  5264. ActiveModelChanged: "active-model-changed"
  5265. }
  5266. }
  5267. , {}],
  5268. 34: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = {
  5271. LEFT: 0,
  5272. MIDDLE: 1,
  5273. RIGHT: 2
  5274. }
  5275. }
  5276. , {}],
  5277. 35: [function(e, t, i) {
  5278. "use strict";
  5279. t.exports = {
  5280. PanoRenderComplete: "panorama.render.complete",
  5281. TileRenderFailure: "panorama.tile.render.failed",
  5282. TileRenderSuccess: "panorama.tile.render.success",
  5283. TileUploadAttempted: "panorama.tile.upload.attempted",
  5284. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5285. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5286. }
  5287. }
  5288. , {}],
  5289. 36: [function(e, t, i) {
  5290. "use strict";
  5291. t.exports = {
  5292. BASE: 1,
  5293. STANDARD: 2,
  5294. HIGH: 3,
  5295. ULTRAHIGH: 4
  5296. }
  5297. }
  5298. , {}],
  5299. 37: [function(e, t, i) {
  5300. "use strict";
  5301. t.exports = {
  5302. LoadComplete: "panorama.load.complete",
  5303. LoadFailed: "panorama.load.failed",
  5304. TileLoaded: "panorama.tile.loaded"
  5305. }
  5306. }
  5307. , {}],
  5308. 38: [function(e, t, i) {
  5309. "use strict";
  5310. t.exports = Object.freeze({
  5311. Standard: 0,
  5312. Slow: 1,
  5313. Retain: 2
  5314. })
  5315. }
  5316. , {}],
  5317. 39: [function(e, t, i) {
  5318. "use strict";
  5319. t.exports = Object.freeze({
  5320. Show: 0,
  5321. Hide: 1,
  5322. Retain: 2
  5323. })
  5324. }
  5325. , {}],
  5326. 40: [function(e, t, i) {
  5327. "use strict";
  5328. t.exports = {
  5329. Move: "move",
  5330. MoveComplete: "move.complete",
  5331. ModeChanged: "mode.changed",
  5332. ModeChanging: "mode.changing",
  5333. PanoChosen: "pano.chosen",
  5334. ClosestPanoChanging: "closest.pano.changing",
  5335. WarpStarted: "warp.started",
  5336. WarpInterrupted: "warp.interrupted",
  5337. WarpEnded: "warp.ended",
  5338. FlyinFinished: "flyin.finished",
  5339. FlyingStarted: "flying.started",
  5340. FlyingInterrupted: "flying.interrupted",
  5341. FlyingEnded: "flying.ended",
  5342. Ready: "ready",
  5343. StartInside: "start.inside",
  5344. StartOutside: "start.outside",
  5345. ViewChanged: "view.changed",
  5346. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5347. InputStart: "input.start"
  5348. }
  5349. }
  5350. , {}],
  5351. 41: [function(e, t, i) {
  5352. "use strict";
  5353. t.exports = Object.freeze({
  5354. DEFAULT: 0,
  5355. PANOMARKERS: 1,
  5356. RETICULE: 2,
  5357. TAG: 3
  5358. })
  5359. }
  5360. , {}],
  5361. 42: [function(e, t, i) {
  5362. "use strict";
  5363. t.exports = {
  5364. visibleFloor: 1,
  5365. ghostFloor: 3,
  5366. boundingSkybox: 1,
  5367. panoMarker: 2,
  5368. reticule: 3,
  5369. tagStem: 4,
  5370. tagDisc: 5,
  5371. ribbon: 100
  5372. }
  5373. }
  5374. , {}],
  5375. 43: [function(e, t, i) {
  5376. "use strict";
  5377. t.exports = {
  5378. ContextCreated: "scene-renderer-context-created",
  5379. AfterRender: "after-render",
  5380. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5381. }
  5382. }
  5383. , {}],
  5384. 44: [function(e, t, i) {
  5385. "use strict";
  5386. t.exports = {
  5387. IDLE: "idle",
  5388. BROWSE: "browse",
  5389. EXAMINE: "examine"
  5390. }
  5391. }
  5392. , {}],
  5393. 45: [function(e, t, i) {
  5394. "use strict";
  5395. t.exports = {
  5396. TileDownloadSuccess: "tiledownloader.download.success",
  5397. TileDownloadFailure: "tiledownloader.download.failure",
  5398. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5399. }
  5400. }
  5401. , {}],
  5402. 46: [function(e, t, i) {
  5403. "use strict";
  5404. t.exports = {
  5405. CardboardAndroid: "googlevr",
  5406. GearVR: "gearvr",
  5407. CardboardIOS: "googlevrios",
  5408. Cardboard: "googlevr"
  5409. }
  5410. }
  5411. , {}],
  5412. 47: [function(e, t, i) {
  5413. "use strict";
  5414. t.exports = {
  5415. NONE: 0,
  5416. CONTEXTUAL: 1,
  5417. ANDROID: 2
  5418. }
  5419. }
  5420. , {}],
  5421. 48: [function(e, t, i) {
  5422. "use strict";
  5423. var n = {
  5424. Title: 0,
  5425. Cardboard: 1
  5426. }
  5427. , r = {
  5428. Title: 0,
  5429. Cardboard: 1,
  5430. Gear: 2
  5431. };
  5432. [n, r].forEach(function(e) {
  5433. e.pageCount = Object.keys(e).length
  5434. }),
  5435. t.exports.ios = n,
  5436. t.exports.standard = r
  5437. }
  5438. , {}],
  5439. 49: [function(e, t, i) {
  5440. "use strict";
  5441. t.exports = {
  5442. Android: "android",
  5443. IOS: "ios",
  5444. Desktop: "desktop",
  5445. UnsupportedAndroid: "android-unsupported"
  5446. }
  5447. }
  5448. , {}],
  5449. 50: [function(e, t, i) {
  5450. "use strict";
  5451. var n = e("three");
  5452. t.exports = {
  5453. UP: new n.Vector3(0,1,0),
  5454. DOWN: new n.Vector3(0,-1,0),
  5455. LEFT: new n.Vector3(-1,0,0),
  5456. RIGHT: new n.Vector3(1,0,0),
  5457. FORWARD: new n.Vector3(0,0,-1),
  5458. BACK: new n.Vector3(0,0,1)
  5459. }
  5460. }
  5461. , {
  5462. three: 217
  5463. }],
  5464. 51: [function(e, t, i) {
  5465. "use strict";
  5466. var n = e("../exception/ViewmodeConvertException")
  5467. , r = e("./coreViewmodes")
  5468. , o = {
  5469. MESH: "mesh",
  5470. OUTDOOR: "outdoor",
  5471. TRANSITIONING: "transitioning",
  5472. toInt: function(e) {
  5473. switch (e) {
  5474. case this.PANORAMA:
  5475. return 1;
  5476. case this.DOLLHOUSE:
  5477. return 2;
  5478. case this.FLOORPLAN:
  5479. return 3;
  5480. case this.OUTDOOR:
  5481. return 4;
  5482. case this.TRANSITIONING:
  5483. return -1
  5484. }
  5485. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5486. },
  5487. fromInt: function(e) {
  5488. switch (e) {
  5489. case "1":
  5490. case 1:
  5491. return this.PANORAMA;
  5492. case "2":
  5493. case 2:
  5494. return this.DOLLHOUSE;
  5495. case "3":
  5496. case 3:
  5497. return this.FLOORPLAN;
  5498. case "4":
  5499. case 4:
  5500. return this.OUTDOOR
  5501. }
  5502. throw new n("No known conversion for int to viewmode for int: " + e)
  5503. },
  5504. convertWorkshopModeInt: function(e) {
  5505. switch (e) {
  5506. case "0":
  5507. case 0:
  5508. case void 0:
  5509. return this.PANORAMA;
  5510. case "1":
  5511. case 1:
  5512. return this.FLOORPLAN;
  5513. case "2":
  5514. case 2:
  5515. return this.DOLLHOUSE;
  5516. case "3":
  5517. case 3:
  5518. return this.MESH
  5519. }
  5520. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5521. }
  5522. };
  5523. e("../util/common").extendObject(o, r),
  5524. t.exports = o
  5525. }
  5526. , {
  5527. "../exception/ViewmodeConvertException": 58,
  5528. "../util/common": 185,
  5529. "./coreViewmodes": 54
  5530. }],
  5531. 52: [function(e, t, i) {
  5532. "use strict";
  5533. t.exports = {
  5534. BLACK: "black",
  5535. STD: "std",
  5536. WALK: "walk"
  5537. }
  5538. }
  5539. , {}],
  5540. 53: [function(e, t, i) {
  5541. "use strict";
  5542. t.exports = {
  5543. ZoomIn: "zoom.in",
  5544. ZoomOut: "zoom.out",
  5545. ZoomMax: "zoom.max",
  5546. ZoomMin: "zoom.min"
  5547. }
  5548. }
  5549. , {}],
  5550. 54: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = {
  5553. PANORAMA: "panorama",
  5554. DOLLHOUSE: "dollhouse",
  5555. FLOORPLAN: "floorplan"
  5556. }
  5557. }
  5558. , {}],
  5559. 55: [function(e, t, i) {
  5560. "use strict";
  5561. t.exports = function(e) {
  5562. this.message = e
  5563. }
  5564. }
  5565. , {}],
  5566. 56: [function(e, t, i) {
  5567. "use strict";
  5568. function n(e) {
  5569. r.call(this, e)
  5570. }
  5571. var r = e("./BasicException");
  5572. n.prototype = Object.create(r.prototype),
  5573. t.exports = n
  5574. }
  5575. , {
  5576. "./BasicException": 55
  5577. }],
  5578. 57: [function(e, t, i) {
  5579. "use strict";
  5580. function n(e) {
  5581. r.call(this, e)
  5582. }
  5583. var r = e("./BasicException");
  5584. n.prototype = Object.create(r.prototype),
  5585. t.exports = n
  5586. }
  5587. , {
  5588. "./BasicException": 55
  5589. }],
  5590. 58: [function(e, t, i) {
  5591. "use strict";
  5592. function n(e) {
  5593. r.call(this, e)
  5594. }
  5595. var r = e("./BasicException");
  5596. n.prototype = Object.create(r.prototype),
  5597. t.exports = n
  5598. }
  5599. , {
  5600. "./BasicException": 55
  5601. }],
  5602. 59: [function(a, s, e) {
  5603. (function(e) {
  5604. "use strict";
  5605. var i = a("./util/ajax")
  5606. , n = a("./util/showcase")
  5607. , t = a("./util/logger")
  5608. , r = new t(e)
  5609. , o = {};
  5610. s.exports = {
  5611. loadFeatureFlags: function(e) {
  5612. var t = $.Deferred();
  5613. return i.get(e.urlBase + "", {
  5614. responseType: "json",
  5615. prefetchFrom: "user",
  5616. auth: n.getAuthorizationHeader()
  5617. }).done(function(e) {
  5618. (o = function(e) {
  5619. var t = {};
  5620. if (e) {
  5621. var i = e.flags;
  5622. if (i)
  5623. for (var n in i)
  5624. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5625. return t
  5626. }
  5627. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5628. null
  5629. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5630. }).fail(function() {
  5631. r.debug("Retrieval of feature flags failed."),
  5632. t.reject("loading-failed")
  5633. }),
  5634. t.promise()
  5635. },
  5636. getFlags: function() {
  5637. return o
  5638. },
  5639. updateDependentSettings: function(e, t) {
  5640. (e = e || o).labels && (t.labels.enabled = !0),
  5641. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5642. e.showcase_sdk && (t.sdkInit = !0),
  5643. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5644. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5645. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5646. e.hide_sc_sharing && (t.share.enabled = !1)
  5647. }
  5648. }
  5649. }
  5650. ).call(this, "/js/featureflags.js")
  5651. }
  5652. , {
  5653. "./util/ajax": 181,
  5654. "./util/logger": 189,
  5655. "./util/showcase": 193
  5656. }],
  5657. 60: [function(e, t, i) {
  5658. "use strict";
  5659. var n = (e("../util/common"),
  5660. {
  5661. status: 0,
  5662. set: function(e) {
  5663. if (isNaN(e))
  5664. return !1;
  5665. var t = $(".progressbar");
  5666. e < 0 && (e = 0),
  5667. 100 < e && (e = 100);
  5668. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5669. , n = Math.round(e)
  5670. , r = parseInt(i) - 15;
  5671. t.find(".bar").css("width", i),
  5672. t.find(".label").css("left", r),
  5673. t.find(".perc").text(n + "%"),
  5674. this.status = e
  5675. },
  5676. done: function(e) {
  5677. return e || this.status ? (this.status = null,
  5678. this.set(100)) : this
  5679. }
  5680. });
  5681. t.exports.circleLoader = n
  5682. }
  5683. , {
  5684. "../util/common": 185
  5685. }],
  5686. 61: [function(e, t, i) {
  5687. "use strict";
  5688. t.exports = Object.freeze({
  5689. CLOSE: "modal.closer.close"
  5690. })
  5691. }
  5692. , {}],
  5693. 62: [function(e, t, i) {
  5694. "use strict";
  5695. function n(t, e) {
  5696. function i() {
  5697. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5698. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5699. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5700. c.classList.remove("closeByFooter")))
  5701. }
  5702. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5703. }
  5704. var r = e("../../settings")
  5705. , o = (e("../../tag/Media/MediaEvent"),
  5706. e("../../util/browser"))
  5707. , a = e("../../util/common")
  5708. , s = e("./ModalCloserEvent")
  5709. , l = e("events").EventEmitter
  5710. , c = document.getElementsByClassName("footer")[0]
  5711. , h = c.querySelectorAll(".close")[0]
  5712. , u = null
  5713. , d = null
  5714. , p = null
  5715. , f = (o.isMobile(),
  5716. {
  5717. open: function(e) {
  5718. e && (n(e),
  5719. u && h.removeEventListener("click", u, !0),
  5720. u = function(e, t) {
  5721. t && (t.stopPropagation(),
  5722. t.preventDefault()),
  5723. e && this.emit(s.CLOSE, e),
  5724. f.reset()
  5725. }
  5726. .bind(this, e.id),
  5727. h.addEventListener("click", u, !0),
  5728. d && window.removeEventListener("resize", d, !0),
  5729. d = n.bind(this, e),
  5730. window.addEventListener("resize", d, !0))
  5731. },
  5732. reset: function() {
  5733. c.classList.remove("closeByFooter"),
  5734. h.removeEventListener("click", u, !0),
  5735. window.removeEventListener("resize", d, !0),
  5736. u = d = p = null
  5737. }
  5738. });
  5739. a.extendObject(f, l.prototype),
  5740. t.exports = f
  5741. }
  5742. , {
  5743. "../../tag/Media/MediaEvent": 131,
  5744. "../../settings": 166,
  5745. "../../util/browser": 182,
  5746. "../../util/common": 185,
  5747. "./ModalCloserEvent": 61,
  5748. events: 202
  5749. }],
  5750. 63: [function(e, t, i) {
  5751. "use strict";
  5752. var A = e("../lib/dat.gui")
  5753. , C = e("three")
  5754. , I = e("../util/easing")
  5755. , E = e("../enum/Viewmode")
  5756. , _ = e("../enum/Colors")
  5757. , b = e("../enum/WarpStyle")
  5758. , w = e("../settings");
  5759. e("../tag/tag"),
  5760. A.GUI.prototype.removeFolder = function(e) {
  5761. var t = this.__folders[e];
  5762. t && (t.close(),
  5763. this.__ul.removeChild(t.domElement.parentNode),
  5764. delete this.__folders[e],
  5765. this.onResize())
  5766. }
  5767. ,
  5768. t.exports.toggle = function(t, e, i) {
  5769. var n = new A.GUI({
  5770. width: 400
  5771. })
  5772. , r = n.addFolder("Flydown from Dollhouse");
  5773. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5774. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5775. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5776. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5777. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5778. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5779. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5780. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5781. var o = n.addFolder("Transition between panos");
  5782. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5783. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5784. w.transition.flyTime = 0,
  5785. o.__controllers.forEach(function(e) {
  5786. e.updateDisplay()
  5787. })
  5788. }),
  5789. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5790. w.transition.flySpeed = 0,
  5791. o.__controllers.forEach(function(e) {
  5792. e.updateDisplay()
  5793. })
  5794. }),
  5795. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5796. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5797. o.add(w.transition, "movementEasing", Object.keys(I));
  5798. var a = n.addFolder("Path Display");
  5799. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5800. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5801. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5802. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5803. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5804. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5805. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5806. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5807. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5808. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5809. w.path.color = _[w.path.color],
  5810. w.path.colorUp = _._desat(w.path.color),
  5811. w.path.colorDown = _.darken(w.path.color)
  5812. }),
  5813. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5814. w.reticuleColor = _[w.reticuleColor]
  5815. });
  5816. var s = n.addFolder("Warping")
  5817. , l = s.addFolder("Warp/Teleport");
  5818. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5819. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5820. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5821. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5822. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5823. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5824. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5825. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5826. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5827. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5828. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5829. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5830. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5831. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5832. w.path.typ = b[w.path.typ]
  5833. }),
  5834. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5835. e.endlessLoop = w.warp.loop
  5836. }),
  5837. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5838. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5839. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5840. var c = s.addFolder("Long Warp Only");
  5841. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5842. w.warp.flySpeed = 0,
  5843. c.__controllers.forEach(function(e) {
  5844. e.updateDisplay()
  5845. })
  5846. }),
  5847. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5848. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5849. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5850. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5851. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5852. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5853. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5854. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5855. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5856. var h = n.addFolder("Warp Esoterica");
  5857. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5858. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5859. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5860. w.warp.minWarpTime = 0,
  5861. h.__controllers.forEach(function(e) {
  5862. e.updateDisplay()
  5863. })
  5864. }),
  5865. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5866. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5867. h.add(w.warp, "movementEasing", Object.keys(I));
  5868. var u = n.addFolder("Misc");
  5869. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5870. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5871. }),
  5872. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5873. i.cameras[E.PANORAMA].fov = w.insideFOV
  5874. }),
  5875. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5876. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5877. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5878. var d = n.addFolder("Navigation");
  5879. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5880. w.navigation.panoScores || t.panos.forEach(function(e) {
  5881. e.floor.remove(e.text3d),
  5882. e.text3d = null
  5883. })
  5884. }),
  5885. d.add(w.navigation, "mouseDirection"),
  5886. d.add(w.navigation, "filterStrictness", 0, 1),
  5887. d.add(w.navigation, "angleFactor", -60, 0),
  5888. d.add(w.navigation, "directionFactor", 1, 20),
  5889. d.add(w.navigation, "distanceFactor", -5, 5),
  5890. d.add(w.navigation, "optionalityFactor", .1, 10);
  5891. var p = n.addFolder("tags")
  5892. , f = p.addFolder("Tag Creation");
  5893. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5894. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5895. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5896. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5897. var g = p.addFolder("Visibility");
  5898. g.add(w.tags.visibility, "anyDistance"),
  5899. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5900. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5901. g.add(w.tags.visibility, "hideViaFloor"),
  5902. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5903. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5904. var m = p.addFolder("Disc Parameters");
  5905. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5906. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5907. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5908. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5909. }),
  5910. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5911. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5912. }),
  5913. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5914. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5915. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5916. var v = p.addFolder("Navigate");
  5917. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5918. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5919. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5920. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5921. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5922. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5923. var y = n.addFolder("Debug");
  5924. y.add(w, "wireframe").onFinishChange(function() {
  5925. t.chunks.forEach(function(e) {
  5926. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5927. e.wireframeTwin.material.depthWrite = !1,
  5928. e.wireframeTwin.material.depthTest = !1,
  5929. e.wireframeTwin.material.opacity = .5,
  5930. e.wireframeTwin.material.transparent = !0),
  5931. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5932. })
  5933. }),
  5934. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5935. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5936. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5937. t.skybox.wireframe = null)
  5938. }),
  5939. y.add(w, "showSweeps").onFinishChange(function() {
  5940. t.setSweepVisibility(w.showSweeps)
  5941. }),
  5942. y.add(w, "showMesh").onFinishChange(function() {
  5943. t.chunks.forEach(function(e) {
  5944. e.visible = w.showMesh
  5945. })
  5946. }),
  5947. y.add(w, "showFloors").onFinishChange(function() {
  5948. t.floors.forEach(function(e) {
  5949. e.collider.children.forEach(function(e) {
  5950. e.material.visible = w.showFloors
  5951. })
  5952. })
  5953. }),
  5954. y.add(w, "showSkyboxes").onFinishChange(function() {
  5955. t.panos.forEach(function(e) {
  5956. e.skyboxMesh.visible = w.showSkyboxes
  5957. })
  5958. }),
  5959. y.add(w, "showNeighbors").onChange(function() {}),
  5960. y.add(t, "alpha", 0, 1)
  5961. }
  5962. }
  5963. , {
  5964. "../enum/Colors": 19,
  5965. "../enum/Viewmode": 51,
  5966. "../enum/WarpStyle": 52,
  5967. "../lib/dat.gui": 93,
  5968. "../tag/tag": 123,
  5969. "../settings": 166,
  5970. "../util/easing": 186,
  5971. three: 217
  5972. }],
  5973. 64: [function(c, h, e) {
  5974. (function(e) {
  5975. "use strict";
  5976. function i(e, t, i, n) {
  5977. $(".gui-error .error-problem-text").text(e),
  5978. $(".gui-error .error-solution-text").text(t),
  5979. $(".gui-error .error-explanation").text(i),
  5980. $(".gui-error .error-actions").html(n),
  5981. $(window).resize(),
  5982. $(".gui-error").fadeIn(),
  5983. $("#bottom-logo").fadeIn()
  5984. }
  5985. function n(e) {
  5986. 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("");
  5987. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5988. r.isMobile() || $("[rel=tiletip]").tooltip({
  5989. placement: "bottom",
  5990. delay: {
  5991. show: 50,
  5992. hide: 0
  5993. },
  5994. trigger: "hover",
  5995. viewport: {
  5996. selector: "body",
  5997. padding: 10
  5998. }
  5999. })
  6000. }
  6001. function t() {
  6002. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6003. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6004. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6005. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6006. e.preventDefault(),
  6007. e.stopPropagation(),
  6008. n(" ")
  6009. })
  6010. }
  6011. var r = c("./../util/browser")
  6012. , o = c("./../analytics")
  6013. , a = c("./../settings")
  6014. , s = c("../localization/localize")
  6015. , l = new (c("./../util/logger"))(e);
  6016. h.exports.error = function(e) {
  6017. if ($("head title").text(a.pageTitle),
  6018. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6019. $("#gui-loading").fadeOut(250),
  6020. $("#quick-blackout").hide(),
  6021. o.track("showcase_error", {
  6022. error_key: e
  6023. }),
  6024. s.locale || s.init(),
  6025. "webgl-unsupported" === e)
  6026. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6027. else if ("webgl-ios" === e)
  6028. 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>.");
  6029. else if ("webgl-safari" === e)
  6030. 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>.");
  6031. else if ("webgl-generic" === e)
  6032. t();
  6033. else if ("missing-urls" === e)
  6034. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6035. else if ("loading-failed" === e)
  6036. 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>.");
  6037. else {
  6038. if ("loading-failed-maintenance" !== e)
  6039. return void l.error("Unhandled error: " + e);
  6040. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6041. }
  6042. }
  6043. }
  6044. ).call(this, "/js/gui/error.js")
  6045. }
  6046. , {
  6047. "../localization/localize": 108,
  6048. "./../analytics": 4,
  6049. "./../settings": 166,
  6050. "./../util/browser": 182,
  6051. "./../util/logger": 189
  6052. }],
  6053. 65: [function(Oe, Le, e) {
  6054. (function(e) {
  6055. "use strict";
  6056. function c() {
  6057. for (var e in Ce)
  6058. if (Ce.hasOwnProperty(e)) {
  6059. var t = Ce[e];
  6060. if (!t.visible)
  6061. for (var i = 0; i < t.elements.length; i++)
  6062. $(t.elements[i]).hide()
  6063. }
  6064. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6065. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6066. ge = [],
  6067. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6068. ge.push(".hideTarget", ".pinTop.right")
  6069. }
  6070. function v(e, t) {
  6071. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6072. $("#gui-zoomin").toggle(i),
  6073. $("#gui-zoomout").toggle(i)
  6074. }
  6075. function l() {
  6076. n(),
  6077. $(".pinBottom").toggleClass("open"),
  6078. $("#drawer").toggleClass("open"),
  6079. $(".footer").toggleClass("open"),
  6080. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6081. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6082. O.resetDrawer()),
  6083. setTimeout(function() {
  6084. $("#pullTab").toggleClass("opened")
  6085. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6086. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6087. }
  6088. function t(e) {
  6089. var t;
  6090. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6091. t = e.position().top + e.outerHeight(),
  6092. e.attr("style", "display: none")),
  6093. $("#player").outerHeight() - 130 < t + 25
  6094. }
  6095. function y(e) {
  6096. "touchstart" === e.type && e.preventDefault(),
  6097. e.stopPropagation()
  6098. }
  6099. function n() {
  6100. w && (w.reload(),
  6101. w.init())
  6102. }
  6103. function r() {
  6104. $("#gui-spinner").stop(!0, !0),
  6105. $("#gui-spinner").fadeOut(1e3),
  6106. !(Ae = !0)
  6107. }
  6108. function A(e, t) {
  6109. var i = e.mode
  6110. , n = t || e.currentPano;
  6111. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6112. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6113. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6114. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6115. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6116. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6117. $("#gui-modes-outside").removeClass("desktop-only")),
  6118. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6119. pe = i,
  6120. $("#gui-modes-outside").addClass("hidden"),
  6121. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6122. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6123. }
  6124. function C(t, i) {
  6125. function e() {
  6126. document.getElementById("vr").classList.remove("hidden"),
  6127. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6128. S.supportsFullscreen() ? function(e) {
  6129. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6130. Q.init(t.data, i, e, x),
  6131. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6132. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6133. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6134. $(".improper-embed").toggleClass("hidden", !1),
  6135. n())
  6136. }, function(e) {
  6137. n()
  6138. }) : n()
  6139. }
  6140. function n() {
  6141. var e;
  6142. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6143. X.init(t.data, x),
  6144. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6145. function() {
  6146. _e("vr"),
  6147. V.open(e)
  6148. }
  6149. )),
  6150. X.on(Z.CLOSED, V.reset)
  6151. }
  6152. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6153. switch (M.vr.option) {
  6154. case le.CONTEXTUAL:
  6155. e();
  6156. break;
  6157. case le.ANDROID:
  6158. S.detectAndroid() && e();
  6159. break;
  6160. case le.NONE:
  6161. }
  6162. }
  6163. function h(e, i) {
  6164. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6165. if ("372" !== getQueryVariable("m")) {
  6166. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6167. $(".gui-floor").find(".container").prepend(r)
  6168. }
  6169. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6170. n.on("click", function(e) {
  6171. y(e),
  6172. _e("floor"),
  6173. n.toggleClass("open")
  6174. }),
  6175. $(".floorChoice").on("click", function(e) {
  6176. y(e);
  6177. var t = $(this).data("index");
  6178. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6179. i.player.gotoFloor(t),
  6180. R.track("showcase_gui", {
  6181. gui_action: "click_floor_select_button",
  6182. interaction_source: "gui"
  6183. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6184. _e("move"),
  6185. i.allFloors(),
  6186. R.track("showcase_gui", {
  6187. gui_action: "click_toggle_all_floors_button",
  6188. interaction_source: "gui"
  6189. })),
  6190. n.removeClass("open")
  6191. })
  6192. }
  6193. function I(e, t) {
  6194. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6195. $(".gui-floor-icon").hide(),
  6196. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6197. $(".gui-floor-icon").show(),
  6198. $(".gui-floor-title").hide()),
  6199. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6200. $(".gui-floor-number").text(se.FLOOR_ALL),
  6201. $(".floorChoice").removeClass("active"),
  6202. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6203. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6204. $(".floorChoice").removeClass("active"),
  6205. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6206. }
  6207. function E() {
  6208. var e = $("#player").width() - 20
  6209. , t = $("#scroller")
  6210. , i = $("#drawer")
  6211. , n = $(".pinBottom");
  6212. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6213. i.addClass("noScroll"),
  6214. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6215. i.toggleClass("noScroll"),
  6216. n.toggleClass("noScroll"))
  6217. }
  6218. function _(e) {
  6219. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6220. e = e || 0,
  6221. Ae = !1,
  6222. window.setTimeout(function() {
  6223. Ae || (!0,
  6224. $("#gui-spinner").stop(!0, !0).show())
  6225. }
  6226. .bind(this), e)
  6227. }(M.modelComponentLoadSpinnerDelay)
  6228. }
  6229. function b(e, t) {
  6230. for (var i = []; e; )
  6231. i.push(e),
  6232. e = e.parentNode;
  6233. for (; t && -1 === i.indexOf(t); )
  6234. t = t.parentNode;
  6235. return t
  6236. }
  6237. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6238. Oe("../util/ajax"),
  6239. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6240. Oe("../util/camera"),
  6241. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6242. 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"),
  6243. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6244. Oe("../enum/PathDisplayMode"),
  6245. Oe("../enum/DirectorEvents"),
  6246. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6247. Oe("../enum/WarpStyle"),
  6248. Oe("../enum/AlignmentType"),
  6249. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6250. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6251. coBrand: {
  6252. visible: !0,
  6253. elements: [".co-brand", "#loaderCoBrand"]
  6254. },
  6255. help: {
  6256. visible: !0,
  6257. elements: [".nav-help", "#nav-help"]
  6258. },
  6259. tourControls: {
  6260. visible: !0,
  6261. elements: [".next", ".previous", "#play"]
  6262. },
  6263. highlight: {
  6264. visible: !0,
  6265. elements: ["#drawer", "#pullTab"]
  6266. },
  6267. share: {
  6268. visible: !0,
  6269. elements: [".socialButton", "#share"]
  6270. },
  6271. fullScreen: {
  6272. visible: !0,
  6273. elements: ["#gui-fullscreen"]
  6274. },
  6275. floors: {
  6276. visible: !0,
  6277. elements: [".gui-floor"]
  6278. }
  6279. }, Ie = (g = document.getElementById("drawer"),
  6280. function() {
  6281. $("#player").height() < 400 && g.classList.contains("open") && l()
  6282. }
  6283. ), Ee = (f = document.getElementById("meta-info"),
  6284. function() {
  6285. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6286. }
  6287. ), _e = (i = document.getElementById("meta-info"),
  6288. s = document.getElementById("interaction-modal"),
  6289. u = $("#drawer").eq(0),
  6290. d = $(".gui-floor").eq(0),
  6291. p = $(".vr-popup").eq(0),
  6292. function(e) {
  6293. switch (e) {
  6294. case "info":
  6295. we(),
  6296. Te(),
  6297. Ie(),
  6298. Me(),
  6299. Re(),
  6300. xe(),
  6301. Pe();
  6302. break;
  6303. case "terms":
  6304. be(),
  6305. Te(),
  6306. Se(),
  6307. Me(),
  6308. Re(),
  6309. xe(),
  6310. Pe();
  6311. break;
  6312. case "help":
  6313. be(),
  6314. we(),
  6315. Me(),
  6316. Re(),
  6317. xe(),
  6318. Pe();
  6319. break;
  6320. case "vr":
  6321. be(),
  6322. we(),
  6323. Me(),
  6324. Re(),
  6325. Te(),
  6326. Pe(),
  6327. t(p) && Se();
  6328. break;
  6329. case "highlights":
  6330. Ee(),
  6331. we(),
  6332. Me(),
  6333. Re();
  6334. break;
  6335. case "share":
  6336. be(),
  6337. we(),
  6338. Te(),
  6339. Re(),
  6340. xe(),
  6341. Pe();
  6342. break;
  6343. case "floor":
  6344. we(),
  6345. Me(),
  6346. xe();
  6347. break;
  6348. case "view":
  6349. Re(),
  6350. Me(),
  6351. we(),
  6352. xe();
  6353. break;
  6354. case "tour":
  6355. case "move":
  6356. we(),
  6357. Me(),
  6358. Re(),
  6359. xe();
  6360. break;
  6361. case "resize":
  6362. be(),
  6363. Ie(),
  6364. Re();
  6365. break;
  6366. case "tag":
  6367. we(),
  6368. Te(),
  6369. Me(),
  6370. Re(),
  6371. xe()
  6372. }
  6373. }
  6374. );
  6375. function be() {
  6376. i.classList.contains("expand") && z.toggleMeta(!0)
  6377. }
  6378. function we() {
  6379. W.hide()
  6380. }
  6381. function Te() {
  6382. U.close()
  6383. }
  6384. function xe() {
  6385. X.dismiss()
  6386. }
  6387. function Se() {
  6388. u.hasClass("open") && l()
  6389. }
  6390. function Me() {
  6391. K.hide()
  6392. }
  6393. function Re() {
  6394. d.hasClass("open") && d.removeClass("open")
  6395. }
  6396. function Pe() {
  6397. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6398. }
  6399. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6400. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6401. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6402. setTimeout(function() {
  6403. $(".icon:visible").hide().show(0)
  6404. }, 100)
  6405. }),
  6406. $("#gui-fullscreen").find("a").on("click", function(e) {
  6407. y(e),
  6408. S.requestFullscreen($("body")[0]),
  6409. R.track("showcase_gui", {
  6410. gui_action: "click_enter_fullscreen",
  6411. interaction_source: "gui"
  6412. })
  6413. }),
  6414. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6415. y(e),
  6416. S.exitFullscreen(),
  6417. R.track("showcase_gui", {
  6418. gui_action: "click_exit_fullscreen",
  6419. interaction_source: "gui"
  6420. })
  6421. }),
  6422. $(window).on("resize", function(e) {
  6423. var t = e.target.innerHeight
  6424. , i = e.target.innerWidth;
  6425. t === o && i === a || (Ce.highlight.visible && E(),
  6426. _e("resize"),
  6427. $(".pinTop.right").removeClass("hideUnderMeta"),
  6428. n(),
  6429. o = t,
  6430. a = i)
  6431. }).resize(),
  6432. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6433. $("#pullTab").on("click", function(e) {
  6434. y(e),
  6435. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6436. gui_action: "hide_highlight_reel"
  6437. }),
  6438. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6439. gui_action: "show_highlight_reel"
  6440. }),
  6441. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6442. l()
  6443. }),
  6444. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6445. $("#hotList").on("click", function(e) {
  6446. y(e);
  6447. var t = $("#hotListWrap")[0];
  6448. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6449. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6450. this.classList.add("active"))
  6451. }),
  6452. $("#hotListContent ul").on("mouseover", function(e) {
  6453. y(e);
  6454. var t = e.target
  6455. , i = document.getElementById("hotListWrap");
  6456. if ("SPAN" === t.tagName) {
  6457. var n = t.parentElement.parentElement;
  6458. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6459. } else if ("LI" === t.tagName) {
  6460. n = t.parentElement;
  6461. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6462. } else
  6463. i.style.width = ""
  6464. }),
  6465. $("#hotListContent ul").on("click", function(e) {
  6466. y(e),
  6467. this.preElem && this.preElem.classList.remove("active"),
  6468. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6469. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6470. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6471. e.target.hot && e.target.hot.examine(window.player, !0),
  6472. this.preElem = e.target)
  6473. }),
  6474. $("#hotListClose").on("click", function(e) {
  6475. y(e),
  6476. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6477. $("#hotListContent ul .active").removeClass("active"),
  6478. $("#hotList")[0].classList.remove("active")
  6479. })),
  6480. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6481. $("#more-menu-button").on("click", function(e) {
  6482. y(e),
  6483. $("#more-menu").toggleClass("open")
  6484. }),
  6485. Le.exports.init = function(s, l, c, e, t, i, n) {
  6486. var r;
  6487. x = n,
  6488. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6489. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6490. F.init(),
  6491. D.init(s, i),
  6492. ce.init(s, l, e),
  6493. $(".icon").on("mouseover", function() {
  6494. l.player && l.player.reticule.hide()
  6495. }),
  6496. function(e, t) {
  6497. var i = t.player;
  6498. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6499. y(e),
  6500. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6501. R.track("USER", {
  6502. event_type: "showcase_gui",
  6503. gui_action: "click_inside_mode_button"
  6504. }),
  6505. t.changeMode(ie.PANORAMA)
  6506. }),
  6507. $("#gui-modes-outside").find("a").on("click", function(e) {
  6508. y(e),
  6509. R.track("showcase_gui", {
  6510. gui_action: "click_outside_mode_button"
  6511. }),
  6512. t.changeMode(pe)
  6513. }),
  6514. $("#gui-modes-floorplan").on("click", function(e) {
  6515. y(e),
  6516. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6517. gui_action: "click_floorplan_mode_button"
  6518. }),
  6519. t.changeMode(ie.FLOORPLAN))
  6520. }),
  6521. $("#gui-modes-dollhouse").on("click", function(e) {
  6522. y(e),
  6523. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6524. gui_action: "click_dollhouse_mode_button"
  6525. }),
  6526. t.changeMode(ie.DOLLHOUSE))
  6527. })
  6528. }(0, l),
  6529. function(e, t) {
  6530. $("#play").on("mousedown touchstart", function(e) {
  6531. y(e),
  6532. _e("tour"),
  6533. q.play(),
  6534. R.trackAlways("showcase_gui", {
  6535. gui_action: "play_highlights"
  6536. })
  6537. }),
  6538. window.startAndPlay = function(e) {
  6539. _e("tour"),
  6540. q.play(),
  6541. R.trackAlways("showcase_gui", {
  6542. gui_action: "play_highlights"
  6543. })
  6544. }
  6545. ,
  6546. $("#pause").on("mousedown touchstart", function(e) {
  6547. y(e),
  6548. q.pause(),
  6549. R.trackAlways("showcase_gui", {
  6550. gui_action: "pause_highlights"
  6551. })
  6552. }),
  6553. $("#gui-zoomin").find("a").on("click", function(e) {
  6554. y(e),
  6555. t.player.zoomInIncrementally()
  6556. }),
  6557. $("#gui-zoomout").find("a").on("click", function(e) {
  6558. y(e),
  6559. t.player.zoomOutIncrementally()
  6560. })
  6561. }(0, l),
  6562. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6563. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6564. function() {
  6565. _e("share"),
  6566. V.open(r)
  6567. }
  6568. )),
  6569. K.on(ae.CLOSED, V.reset)),
  6570. 0 < s.heroLocations.length ? function(e, i, t) {
  6571. var n = 100 / (fe = e.heroLocations.length) + "%"
  6572. , r = $("#thumb-container")
  6573. , o = $("#progressBar");
  6574. $("#status").find(".totalSteps").text(fe);
  6575. for (var a = 0; a < fe; a++) {
  6576. var s = e.heroLocations[a]
  6577. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6578. if(s.heroLocations){//有子项,选第一张截图
  6579. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6580. }else{
  6581. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6582. }
  6583. if (l.attr("data-index", a),
  6584. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6585. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6586. s.name) {
  6587. var c = $('<div class="overlay"></div>').text(s.name);
  6588. l.prepend(c)
  6589. }
  6590. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6591. var h = e.panos.get(s.panoId)
  6592. , 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>';
  6593. l.prepend(u)
  6594. }
  6595. r.append(l),
  6596. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6597. }
  6598. T = 144 * fe,
  6599. 111 * fe,
  6600. $(".thumbImg").on("mouseover", function() {
  6601. !function(e) {
  6602. return e.describe().inTransition
  6603. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6604. }),
  6605. $(".thumbImg").on("mouseout", function() {
  6606. i.clearPath()
  6607. }),
  6608. $(".thumbImg").on("click", function(e) {
  6609. y(e);
  6610. var t = $(this);
  6611. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6612. R.trackAlways("showcase_gui", {
  6613. gui_action: "click_highlight"
  6614. }),
  6615. i.goToHighlight([t.data("index"),0])//改
  6616. }),
  6617. $(".previous").find("a").on("click", function(e) {
  6618. y(e),
  6619. R.trackAlways("showcase_gui", {
  6620. gui_action: "prev_highlight"
  6621. }),
  6622. i.prevHighlight()
  6623. }),
  6624. $(".next").find("a").on("click", function(e) {
  6625. y(e),
  6626. R.trackAlways("showcase_gui", {
  6627. gui_action: "next_highlight"
  6628. }),
  6629. i.nextHighlight()
  6630. }),
  6631. $("#drawer").on("mouseleave", function(t) {
  6632. var i;
  6633. y(t);
  6634. try {
  6635. i = new MouseEvent("mouseup",{
  6636. clientX: t.clientX,
  6637. clientY: t.clientY,
  6638. screenX: t.screenX,
  6639. screenY: t.screenY
  6640. })
  6641. } catch (e) {
  6642. (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)
  6643. }
  6644. document.dispatchEvent(i)
  6645. }),
  6646. (w = new Sly($("#scrollFrame"),{
  6647. horizontal: !0,
  6648. itemNav: "centered",
  6649. smart: !0,
  6650. scrollTrap: !0,
  6651. scrollBy: 1,
  6652. mouseDragging: !0,
  6653. touchDragging: !0,
  6654. speed: 300,
  6655. dragHandle: !0,
  6656. dynamicHandle: !0,
  6657. clickBar: !0,
  6658. scrollBar: $("#scroller"),
  6659. activateOn: null
  6660. }).init()).on("active", function(e, t) {
  6661. t,
  6662. _e("tour"),
  6663. $(".step").removeClass("active"),
  6664. $("#status").find(".curIdx").text(t + 1);
  6665. for (var i = 0; i <= t; i++)
  6666. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6667. }),
  6668. E()
  6669. }(s, l, c) : (Ce.highlight.visible = !1,
  6670. Ce.tourControls.visible = !1),
  6671. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6672. function() {
  6673. var n;
  6674. document.body.addEventListener("mousedown", function(e) {
  6675. n = 0 === e.button || 1 === e.which ? e.target : null
  6676. }, !0),
  6677. document.body.addEventListener("mouseup", function(t) {
  6678. n !== t.target && (n = b(n, t.target));
  6679. var e = document.getElementById("gui-parent");
  6680. if (b(e, n) !== e && (n = null),
  6681. n) {
  6682. var i;
  6683. try {
  6684. i = new MouseEvent("click",t)
  6685. } catch (e) {
  6686. (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)
  6687. }
  6688. i.syntheticClick = !0,
  6689. n.dispatchEvent(i),
  6690. n = null
  6691. }
  6692. }, !0),
  6693. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6694. e.syntheticClick || (e.stopPropagation(),
  6695. "A" === e.target.nodeName && e.preventDefault())
  6696. }, !0)
  6697. }(),
  6698. A(c),
  6699. C(s, t),
  6700. s.on("floor.changed", I),
  6701. s.on("waiting", function(e) {
  6702. _(e)
  6703. }
  6704. .bind(this, s)),
  6705. s.on("waiting-done", function(e) {
  6706. _(e)
  6707. }
  6708. .bind(this, s)),
  6709. c.on(re.ModeChanged, function(e, t) {
  6710. A(c),
  6711. v(l, c),
  6712. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6713. U.updateMode(t)
  6714. }),
  6715. e.on(oe.Move, _e.bind(this, "move")),
  6716. c.on(re.Ready, function() {
  6717. O.init(e, c, c.tagManager, l),
  6718. c.on(re.ModeChanged, function(e, t) {
  6719. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6720. })
  6721. }),
  6722. c.on(re.PanoChosen, function(e, t) {
  6723. A(c, t),
  6724. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6725. }),
  6726. V.on(k.CLOSE, function(e) {
  6727. switch (e) {
  6728. case "vr-modal":
  6729. X.dismiss();
  6730. break;
  6731. case "share-modal":
  6732. K.hide();
  6733. break;
  6734. case "terms-modal":
  6735. W.hide()
  6736. }
  6737. });
  6738. 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();
  6739. l.on("update.controls", function() {
  6740. var e, t, i, n = l.describe();
  6741. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6742. u.show()),
  6743. n.tourInProgress && (d.forEach(function(e) {
  6744. e.classList.add("playing")
  6745. }),
  6746. p.addClass("playing"),
  6747. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6748. u.hide()),
  6749. n.tourInProgress || (q.stopTour(),
  6750. d.forEach(function(e) {
  6751. e.classList.remove("playing")
  6752. }),
  6753. p.removeClass("playing"),
  6754. f.removeClass("playing"))),
  6755. null !== n.currentItem) {
  6756. var r, o;
  6757. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6758. n.onTheBus ? (r = "active",
  6759. o = "recent") : (o = "active",
  6760. r = "recent");
  6761. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6762. for (e = 0; e < s.heroLocations.length; e += 1)
  6763. i = g.eq(e),
  6764. t = m.eq(e),
  6765. i.removeClass(o),
  6766. t.removeClass(o),
  6767. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6768. t.addClass(r),
  6769. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6770. t.addClass(r)) : (i.removeClass(r),
  6771. t.removeClass(r))
  6772. } else
  6773. for (e = 0; e < s.heroLocations.length; e += 1)
  6774. i = g.eq(e),
  6775. t = m.eq(e),
  6776. i.removeClass("active recent"),
  6777. t.removeClass("active recent");
  6778. v(l, c)
  6779. }),
  6780. document.addEventListener("keydown", function(e) {
  6781. switch (R.updateInteraction(oe.InteractionKey),
  6782. e.which) {
  6783. case te.ZERO:
  6784. M.debug && s.toggleAlpha();
  6785. break;
  6786. case te.NINE:
  6787. M.debug && B.toggle();
  6788. break;
  6789. case te.ONE:
  6790. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6791. break;
  6792. case te.TWO:
  6793. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6794. break;
  6795. case te.THREE:
  6796. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6797. break;
  6798. case te.FOUR:
  6799. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6800. break;
  6801. case te.SPACE:
  6802. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6803. break;
  6804. case te.RETURN:
  6805. M.debug && s.toggleExplodeUp();
  6806. break;
  6807. case te.P:
  6808. !function(e) {
  6809. me.gui || (me.gui = function(e) {
  6810. var t = new he.GUI;
  6811. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6812. e.setSweepVisibility(M.showSweeps)
  6813. }),
  6814. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6815. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6816. M.transition.flySpeed = 0,
  6817. t.__controllers.forEach(function(e) {
  6818. e.updateDisplay()
  6819. })
  6820. }),
  6821. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6822. $(t.__closeButton).hide(),
  6823. t
  6824. }(me.model)),
  6825. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6826. }(!me.visible);
  6827. break;
  6828. case te.U:
  6829. !function(e) {
  6830. ve.gui || (ve.gui = function(t, i) {
  6831. function e() {
  6832. var e = i.toJSON();
  6833. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6834. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6835. }
  6836. var n = {}
  6837. , r = new he.GUI({
  6838. autoPlace: !0,
  6839. width: "60%"
  6840. });
  6841. return e(),
  6842. i.on(re.ViewChanged, e),
  6843. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6844. r.domElement.id = "datLinks",
  6845. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6846. if (!S.detectSafari()) {
  6847. var t = document.createElement("button");
  6848. t.classList.add("btn-deep-link"),
  6849. t.innerText = se.MENU_COPY,
  6850. e.nextSibling.appendChild(t);
  6851. var n = function() {
  6852. alert(se.LINK_ALERT_COPY),
  6853. t.hide()
  6854. };
  6855. t.addEventListener("click", function(e) {
  6856. try {
  6857. var t = e.target.parentNode.childNodes[0];
  6858. t.select();
  6859. var i = document.execCommand("copy");
  6860. t.blur(),
  6861. i || n()
  6862. } catch (e) {
  6863. n()
  6864. }
  6865. })
  6866. }
  6867. }),
  6868. $(r.__closeButton).hide(),
  6869. r
  6870. }(ve.model, ve.player)),
  6871. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6872. }(!ve.visible);
  6873. break;
  6874. case te.X:
  6875. M.debug && s.toggleExplode();
  6876. break;
  6877. case te.PLUSEQUALS:
  6878. l.player.activatePersistentZooming(!0),
  6879. O.hideUi();
  6880. break;
  6881. case te.DASHUNDERSCORE:
  6882. l.player.activatePersistentZooming(!1),
  6883. O.hideUi();
  6884. break;
  6885. case te.SEVEN:
  6886. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6887. break;
  6888. case te.EIGHT:
  6889. l.player.decreaseZoomSpeed();
  6890. break;
  6891. case te.NINE:
  6892. l.player.increaseZoomSpeed()
  6893. }
  6894. return c && c.reticule.hide(),
  6895. !0
  6896. }
  6897. .bind(this)),
  6898. document.addEventListener("keyup", function(e) {
  6899. switch (e.which) {
  6900. case te.PLUSEQUALS:
  6901. l.player.deactivatePersistentZooming();
  6902. break;
  6903. case te.DASHUNDERSCORE:
  6904. l.player.deactivatePersistentZooming()
  6905. }
  6906. }
  6907. .bind(this)),
  6908. function(e) {
  6909. me = {
  6910. gui: null,
  6911. visible: !1,
  6912. model: e
  6913. }
  6914. }(s),
  6915. function(e, t) {
  6916. ve = {
  6917. gui: null,
  6918. visible: !1,
  6919. model: e,
  6920. player: t
  6921. }
  6922. }(s, l.player),
  6923. function(e) {
  6924. function t(e, i) {
  6925. $(e).find("a").each(function(e, t) {
  6926. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6927. t.style.pointerEvents = i ? "auto" : "none"
  6928. })
  6929. }
  6930. e.on(de.ZoomMax, function() {
  6931. t("#gui-zoomin", !1),
  6932. t("#gui-zoomout", !0)
  6933. }),
  6934. e.on(de.ZoomMin, function() {
  6935. t("#gui-zoomin", !0),
  6936. t("#gui-zoomout", !1)
  6937. }),
  6938. e.on(de.ZoomIn, function() {
  6939. t("#gui-zoomout", !0)
  6940. }),
  6941. e.on(de.ZoomOut, function() {
  6942. t("#gui-zoomin", !0)
  6943. }),
  6944. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6945. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6946. }(c),
  6947. P.setAutoPlay(s.heroCount()),
  6948. U.init(c, i.mode),
  6949. U.on(H.OPENED, _e.bind(this, "help")),
  6950. W.init(),
  6951. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6952. function() {
  6953. _e("terms"),
  6954. V.open(o)
  6955. }
  6956. )),
  6957. W.on(j.CLOSED, V.reset),
  6958. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6959. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6960. M.profiling.enabled && B.show(),
  6961. q.init(l)
  6962. }
  6963. ,
  6964. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6965. function a() {
  6966. o.setLoadingStartTime(),
  6967. function() {
  6968. function e(e) {
  6969. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6970. }
  6971. $("body").css("touch-action", "none"),
  6972. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6973. var t = document.getElementById("terms-text")
  6974. , i = document.getElementById("more-help-wrapper")
  6975. , n = (document.getElementById("navigation-help-wrapper"),
  6976. document.getElementById("help-dialog"),
  6977. document.getElementById("tag-billboards"));
  6978. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6979. passive: !1
  6980. }),
  6981. document.body.addEventListener("DOMMouseScroll", e)),
  6982. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6983. e.stopPropagation()
  6984. })
  6985. }(),
  6986. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6987. l()) : function(e) {
  6988. L.show(e),
  6989. c()
  6990. }(l)
  6991. }
  6992. var s = $.Deferred()
  6993. , l = s.resolve.bind(s);
  6994. ye = !0,
  6995. _(e);
  6996. e.data.player_options && function(e) {
  6997. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6998. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6999. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7000. }(e.data.player_options),
  7001. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7002. se.localizeGUI();
  7003. !function(i) {
  7004. function e(e, t) {
  7005. return !!i.player_options[e] && i[t || e]
  7006. }
  7007. $(".model-title").text(i.name);
  7008. var t = M.pageTitle;
  7009. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7010. document.title = t,
  7011. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7012. delay: {
  7013. show: 50,
  7014. hide: 0
  7015. },
  7016. trigger: "hover",
  7017. html: !1,
  7018. viewport: {
  7019. selector: "body",
  7020. padding: 10
  7021. }
  7022. }),
  7023. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7024. z.populate({
  7025. name: e("model_name", "name"),
  7026. coBrand: e("presented_by"),
  7027. description: e("model_summary", "summary") || "暂无内容",
  7028. contactName: e("contact_name"),
  7029. address: e("address"),
  7030. phone: e("contact_phone"),
  7031. formattedPhone: i.formatted_contact_phone,
  7032. email: e("contact_email"),
  7033. url: e("external_url"),
  7034. socialSharing: i.enable_social_sharing && i.is_public
  7035. })
  7036. }(e.data);
  7037. r || $(".quick").addClass("hidden");
  7038. n ? (R.impression(),
  7039. a()) : (o.setWaitingStartTime(),
  7040. N.show(r, a))
  7041. return s
  7042. }
  7043. ,
  7044. Le.exports.endLoading = function(e, t, i) {
  7045. var n = t.player;
  7046. function r() {
  7047. i.dismissExaminedTag(),
  7048. i.disableHovering()
  7049. }
  7050. $("#gui-thumb").fadeOut(2500),
  7051. L.hide(function() {
  7052. ye = !1
  7053. }),
  7054. Y.init(e, i),
  7055. z.finishSetup(Object.keys(e.tags).length),
  7056. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7057. X.on(Z.OPENED, r),
  7058. K.on(ae.OPENED, r),
  7059. U.on(H.OPENED, r),
  7060. W.on(j.OPENED, r);
  7061. var o = i.enableHovering.bind(i);
  7062. if (X.on(Z.CLOSED, o),
  7063. K.on(ae.CLOSED, o),
  7064. U.on(H.CLOSED, o),
  7065. W.on(j.CLOSED, o),
  7066. M.labels.enabled && Object.keys(e.labels).length,
  7067. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7068. I(e.currentFloor, n.mode)),
  7069. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7070. h(e, t)),
  7071. c(),
  7072. v(t, t.player),
  7073. $("#gui").fadeIn(1500),
  7074. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7075. l(),
  7076. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7077. }, 2e3),
  7078. !S.isMobile())
  7079. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7080. $(a[s]).addClass("hasHover");
  7081. _(e),
  7082. z.setupToggling(),
  7083. window.editHotPanel && editHotPanel(),
  7084. function() {
  7085. var i = $("#pullTab")
  7086. , e = {
  7087. bottom: {
  7088. "border-bottom-left-radius": "10px",
  7089. "border-bottom-right-radius": "10px"
  7090. },
  7091. top: {
  7092. "border-top-left-radius": "10px",
  7093. "border-top-right-radius": "10px"
  7094. }
  7095. }
  7096. , t = {
  7097. bottom: {
  7098. "border-top-right-radius": "10px",
  7099. "border-bottom-right-radius": "10px"
  7100. },
  7101. top: {
  7102. "border-bottom-left-radius": "10px",
  7103. "border-top-left-radius": "10px"
  7104. }
  7105. };
  7106. function n(e, t) {
  7107. $("#gui-modes-map > div:visible:last").css(e),
  7108. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7109. }
  7110. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7111. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  7112. }(),
  7113. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  7114. }
  7115. ,
  7116. Le.exports.onProgress = function(e) {
  7117. L.progress(e)
  7118. }
  7119. }
  7120. ).call(this, "/js/gui/gui.js")
  7121. }
  7122. , {
  7123. "../analytics": 4,
  7124. "../controls/serializer": 14,
  7125. "../enum/AlignmentType": 17,
  7126. "../enum/BlackoutStyle": 18,
  7127. "../enum/ControlEvents": 21,
  7128. "../enum/DirectorEvents": 23,
  7129. "../enum/Keys": 30,
  7130. "../enum/PathDiscardMode": 38,
  7131. "../enum/PathDisplayMode": 39,
  7132. "../enum/PlayerEvents": 40,
  7133. "../enum/VROption": 47,
  7134. "../enum/Vectors": 50,
  7135. "../enum/Viewmode": 51,
  7136. "../enum/WarpStyle": 52,
  7137. "../enum/ZoomEvents": 53,
  7138. "../lib/dat.gui": 93,
  7139. "../localization/localize": 108,
  7140. "../tag/Media/MediaEvent": 131,
  7141. "../objects/Snapshot": 153,
  7142. "../settings": 166,
  7143. "../util/ajax": 181,
  7144. "../util/browser": 182,
  7145. "../util/camera": 183,
  7146. "../util/logger": 189,
  7147. "../util/showcase": 193,
  7148. "../util/transitions": 195,
  7149. "./closer/ModalCloserEvent": 61,
  7150. "./closer/modalCloser": 62,
  7151. "./help/HelpEvent": 66,
  7152. "./help/help": 67,
  7153. "./helpManager": 68,
  7154. "./immersiveMode": 69,
  7155. "./konami": 70,
  7156. "./landingScreen": 71,
  7157. "./loadingScreen": 72,
  7158. "./memoryUsage": 73,
  7159. "./playButton": 74,
  7160. "./populateModal": 75,
  7161. "./sharing/ShareEvents": 76,
  7162. "./sharing/modal": 77,
  7163. "./terms/TermsEvent": 78,
  7164. "./terms/terms": 79,
  7165. "./title/TitleEvents": 80,
  7166. "./title/tagToggle": 81,
  7167. "./title/titleBar": 82,
  7168. "./tourInteraction": 84,
  7169. "./vr/vrEvent": 85,
  7170. "./vr/vrModal": 87,
  7171. "./webvr/WebVrEvent": 88,
  7172. "./webvr/webVRgui": 89,
  7173. three: 217
  7174. }],
  7175. 66: [function(e, t, i) {
  7176. "use strict";
  7177. t.exports = Object.freeze({
  7178. OPENED: "help.opened",
  7179. CLOSED: "help.closed"
  7180. })
  7181. }
  7182. , {}],
  7183. 67: [function(e, t, i) {
  7184. "use strict";
  7185. function n() {
  7186. p.on("click", function(e) {
  7187. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7188. setTimeout(function() {
  7189. x = !1
  7190. }, h.help.modalStayDuration),
  7191. S.emit(l.OPENED),
  7192. f.addClass("open " + T),
  7193. p.addClass("open"),
  7194. o(),
  7195. r(),
  7196. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7197. v.classList.add("fadeIn")))
  7198. }),
  7199. E.on("click", function(e) {
  7200. S.close()
  7201. }),
  7202. C.on("click", function(e) {
  7203. T && T !== a.TRANSITIONING && (o(),
  7204. r())
  7205. }),
  7206. I.on("click", function(e) {
  7207. o(),
  7208. I.addClass("underline-tab"),
  7209. c.fill(b, s.MORE_HELP),
  7210. f.addClass("more-help")
  7211. })
  7212. }
  7213. function r() {
  7214. C.addClass("underline-tab"),
  7215. c.fill(_, s.NAVIGATION, T),
  7216. f.addClass(T)
  7217. }
  7218. function o() {
  7219. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7220. A.forEach(function(e) {
  7221. e.classList.remove("underline-tab")
  7222. })
  7223. }
  7224. var a = e("../../enum/Viewmode")
  7225. , s = e("../../enum/HelpModalType")
  7226. , l = e("./HelpEvent")
  7227. , c = (e("../helpManager"),
  7228. e("./../populateModal"))
  7229. , h = e("../../settings")
  7230. , u = e("../../util/common")
  7231. , d = e("events").EventEmitter
  7232. , p = $(".footer-help").eq(0)
  7233. , f = $("#help-dialog").eq(0)
  7234. , g = document.querySelector("#quick-logo")
  7235. , m = document.querySelector("#loaderCoBrand")
  7236. , v = document.querySelector("#help-dialog")
  7237. , y = document.querySelector(".footer")
  7238. , A = $(".help-tabs").children().toArray()
  7239. , C = $(".navigation-tab").eq(0)
  7240. , I = $(".more-help-tab").eq(0)
  7241. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7242. f.find(".close").eq(0))
  7243. , _ = f.find(".interactions").toArray()
  7244. , b = f.find(".ui-instructions").toArray()
  7245. , w = a.PANORAMA
  7246. , T = a.PANORAMA
  7247. , x = !1
  7248. , S = {
  7249. init: function(e, t) {
  7250. w = T = t,
  7251. [v, m, g, y].forEach(function(e) {
  7252. e.classList.add(c.deviceType)
  7253. }),
  7254. n()
  7255. },
  7256. close: function() {
  7257. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7258. p.removeClass("open"),
  7259. f.removeClass("open"),
  7260. v.classList.contains("fadeIn"))) {
  7261. v.classList.remove("fadeIn");
  7262. var e = T === a.TRANSITIONING ? w : T;
  7263. c.clear(_, s.NAVIGATION, e)
  7264. }
  7265. },
  7266. updateMode: function(e) {
  7267. w = T,
  7268. T = e
  7269. }
  7270. };
  7271. u.extendObject(S, d.prototype),
  7272. t.exports = S
  7273. }
  7274. , {
  7275. "../../enum/HelpModalType": 28,
  7276. "../../enum/Viewmode": 51,
  7277. "../../settings": 166,
  7278. "../../util/common": 185,
  7279. "../helpManager": 68,
  7280. "./../populateModal": 75,
  7281. "./HelpEvent": 66,
  7282. events: 202
  7283. }],
  7284. 68: [function(s, l, e) {
  7285. (function(e) {
  7286. "use strict";
  7287. var t = s("../util/browser")
  7288. , i = s("./../util/logger")
  7289. , n = s("./../settings")
  7290. , r = new i(e)
  7291. , o = function() {
  7292. var t;
  7293. try {
  7294. return t = window.localStorage.getItem("visitCount") || "0",
  7295. t = (parseFloat(t) + 1).toString(),
  7296. window.localStorage.setItem("visitCount", t),
  7297. r.debug("visitCount = " + t),
  7298. t
  7299. } catch (e) {
  7300. t = "1",
  7301. r.debug("couldn't set local storage")
  7302. }
  7303. }()
  7304. , a = !1;
  7305. l.exports = {
  7306. isHelpDisabled: function() {
  7307. return "0" === t.valueFromHash("help", null) || a
  7308. },
  7309. isLargeHelpEnabled: function() {
  7310. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7311. },
  7312. isSmallHelpEnabled: function() {
  7313. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7314. },
  7315. isHelpEnabled: function() {
  7316. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7317. },
  7318. setAutoPlay: function(e) {
  7319. a = 0 <= n.warp.auto && 1 < e
  7320. }
  7321. }
  7322. }
  7323. ).call(this, "/js/gui/helpManager.js")
  7324. }
  7325. , {
  7326. "../util/browser": 182,
  7327. "./../settings": 166,
  7328. "./../util/logger": 189
  7329. }],
  7330. 69: [function(e, t, i) {
  7331. "use strict";
  7332. function r(e) {
  7333. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7334. T = !0,
  7335. h.close(),
  7336. function(e) {
  7337. !n(e) && S ? v.forEach(function(e) {
  7338. e.classList.remove("drawerOpen"),
  7339. e.classList.add("duringTour")
  7340. }) : C.hasClass("open") ? v.forEach(function(e) {
  7341. e.classList.remove("duringTour"),
  7342. e.classList.add("drawerOpen")
  7343. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7344. e.classList.add("fadeOut")
  7345. })
  7346. }(e),
  7347. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7348. C.hasClass("playing") || (y.forEach(function(e) {
  7349. e.classList.add("detectHover")
  7350. }),
  7351. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7352. }
  7353. function o() {
  7354. C.hasClass("playing") || (clearTimeout(x),
  7355. x = setTimeout(a, c.immersive.timeToShowAgain))
  7356. }
  7357. function a() {
  7358. clearTimeout(x),
  7359. T = !1,
  7360. m.forEach(function(e) {
  7361. e.classList.remove("drawerOpen")
  7362. }),
  7363. S || v.forEach(function(e) {
  7364. e.classList.remove("duringTour")
  7365. }),
  7366. y.forEach(function(e) {
  7367. e.classList.remove("detectHover")
  7368. })
  7369. }
  7370. function s() {
  7371. T ? a() : r(),
  7372. M = !0,
  7373. setTimeout(function() {
  7374. M = !1
  7375. }, c.immersive.uiStayDuration)
  7376. }
  7377. function n(e) {
  7378. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7379. }
  7380. var l = e("../util/browser")
  7381. , c = e("../settings")
  7382. , h = e("./help/help")
  7383. , u = e("../enum/tagEvents")
  7384. , d = e("../enum/ControlEvents")
  7385. , p = e("../enum/PlayerEvents")
  7386. , f = e("../enum/DirectorEvents")
  7387. , g = (p = e("../enum/PlayerEvents"),
  7388. e("../enum/Viewmode"))
  7389. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7390. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7391. , y = $("#hover-bottom, #hover-top").toArray()
  7392. , A = ($("#pullTab").eq(0),
  7393. $("#playHead").eq(0),
  7394. $(".pinBottom-container").eq(0))
  7395. , C = $("#drawer").eq(0)
  7396. , I = $("#drawer-container").eq(0)
  7397. , E = $("#meta-info").eq(0)
  7398. , _ = $(".pinTop.left").eq(0)
  7399. , b = $("#player").eq(0)
  7400. , w = document.getElementById("pullTab")
  7401. , T = !1
  7402. , x = null
  7403. , S = !1
  7404. , M = !1
  7405. , R = null
  7406. , P = !1;
  7407. t.exports.init = function(e, t, i, n) {
  7408. (function(t, i, e, n) {
  7409. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7410. t.controls[e].on(d.Move, r),
  7411. t.controls[e].on(d.LongTap, s)
  7412. }),
  7413. b.on("mousewheel DOMMouseScroll", r),
  7414. e.on(u.TagActivated, r),
  7415. e.on(u.TagNavigation, r),
  7416. i.on(p.FlyingEnded, o),
  7417. i.on(p.ModeChanging, function(e, t) {
  7418. P = t !== g.PANORAMA && e !== g.PANORAMA
  7419. }),
  7420. i.on(p.ModeChanged, function(e, t) {
  7421. R = i.mode,
  7422. t !== g.TRANSITIONING ? a() : r("modeChange")
  7423. }),
  7424. n.on(f.TourStart, function() {
  7425. S = !0,
  7426. r()
  7427. }),
  7428. n.on(f.TourEnd, function() {
  7429. S = !1,
  7430. a()
  7431. }),
  7432. n.on(f.ActionInterrupted, function() {
  7433. S = !1
  7434. }),
  7435. w.addEventListener("touchend", function() {
  7436. $("#pullTab").hasClass("opened") && !S && a()
  7437. }, !0)
  7438. }
  7439. )(e, t, i, n),
  7440. l.isMobile() ? (y.forEach(function(e) {
  7441. e.classList.add("mobile")
  7442. }),
  7443. A.click(a)) : (y.forEach(function(e) {
  7444. e.addEventListener("mouseleave", function() {
  7445. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7446. }, !0)
  7447. }),
  7448. b.mouseleave(function() {
  7449. y[0].classList.contains("detectHover") && a()
  7450. })),
  7451. R = t.mode
  7452. }
  7453. ,
  7454. t.exports.hideUi = r,
  7455. t.exports.resetDrawer = function() {
  7456. I.hasClass("duringTour") || (S = !1,
  7457. r("gui"),
  7458. a())
  7459. }
  7460. }
  7461. , {
  7462. "../enum/ControlEvents": 21,
  7463. "../enum/DirectorEvents": 23,
  7464. "../enum/tagEvents": 32,
  7465. "../enum/PlayerEvents": 40,
  7466. "../enum/Viewmode": 51,
  7467. "../settings": 166,
  7468. "../util/browser": 182,
  7469. "./help/help": 67
  7470. }],
  7471. 70: [function(i, n, e) {
  7472. (function(e) {
  7473. "use strict";
  7474. var t = i("./../util/logger")
  7475. , o = i("./../settings")
  7476. , a = i("./debug")
  7477. , s = i("./../util/common")
  7478. , l = (i("./gui"),
  7479. new t(e));
  7480. o.console && $("body").append('<div id="debug-console"></div>'),
  7481. n.exports.init = function(i, n, r) {
  7482. l.debug("konami has the modelInstance");
  7483. var t = [];
  7484. $(window).on("keydown", function(e) {
  7485. t.push(e.which),
  7486. t.length > o.secretPanelWord.length && t.shift(),
  7487. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7488. o.debug = !0)
  7489. }),
  7490. $(window).on("keydown", function e(t) {
  7491. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7492. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7493. })
  7494. }
  7495. }
  7496. ).call(this, "/js/gui/konami.js")
  7497. }
  7498. , {
  7499. "./../settings": 166,
  7500. "./../util/common": 185,
  7501. "./../util/logger": 189,
  7502. "./debug": 63,
  7503. "./gui": 65
  7504. }],
  7505. 71: [function(e, t, i) {
  7506. "use strict";
  7507. function r() {
  7508. s.clear(m, l.LANDING[v]),
  7509. g.removeClass("fadeIn")
  7510. }
  7511. var o = e("../settings")
  7512. , a = (e("./help/help"),
  7513. e("./helpManager"))
  7514. , s = e("./populateModal")
  7515. , l = e("../enum/HelpModalType")
  7516. , n = e("../enum/Viewmode")
  7517. , c = e("../enum/DirectorEvents")
  7518. , h = e("../enum/PlayerEvents")
  7519. , u = $("#quick-blackout").eq(0)
  7520. , d = $("#quick-logo").eq(0)
  7521. , p = $(".quick-brand").toArray()
  7522. , f = $("#loaderCoBrand").eq(0)
  7523. , g = $("#interaction-modal").eq(0)
  7524. , m = g.find(".interaction").toArray()
  7525. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7526. "");
  7527. t.exports.delayLanding = function(e) {
  7528. var t = $.Deferred();
  7529. e || t.resolve();
  7530. var i = o.startupFlyinDelay;
  7531. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7532. setTimeout(t.resolve.bind(t), i),
  7533. t
  7534. }
  7535. ,
  7536. t.exports.showMessage = function(e, t, i) {
  7537. var n = 0;
  7538. o.quickstart.enabled && (function(e) {
  7539. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7540. d.before(f),
  7541. p = $(".quick-brand").toArray()), */
  7542. u.addClass("fadeOut")
  7543. /* setTimeout(function() {
  7544. p.forEach(function(e) {
  7545. e.classList.add("fadeIn")
  7546. })
  7547. }, o.quickstart.showTextDelay),
  7548. setTimeout(function() {
  7549. p.forEach(function(e) {
  7550. e.classList.add("fadeOut")
  7551. })
  7552. }, o.quickstart.fadeOutDelay) */
  7553. }(i),
  7554. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7555. function(e, t) {
  7556. setTimeout(function() {
  7557. if (a.isHelpEnabled()) {
  7558. if (t(),
  7559. s.init(),
  7560. g.addClass("fadeIn landing " + s.deviceType),
  7561. a.isSmallHelpEnabled())
  7562. return void g.addClass("small");
  7563. s.fill(m, l.LANDING[v]),
  7564. g.addClass(v)
  7565. }
  7566. }, e);
  7567. var i = {
  7568. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7569. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7570. }
  7571. , n = $(".nav-icon .icon");
  7572. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7573. function r(e) {
  7574. e.on("click", function() {
  7575. var e = null;
  7576. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7577. i.length < e || e < 1)
  7578. return !1;
  7579. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7580. "data-page": e,
  7581. src: i.mobile[e - 1]
  7582. }) : n.attr({
  7583. "data-page": e,
  7584. src: i.pc[e - 1]
  7585. })
  7586. })
  7587. }
  7588. r($(".next-button")),
  7589. r($(".prev-button"))
  7590. }(n, function() {
  7591. e.once(h.Move, r),
  7592. t.once(c.TourStart, r)
  7593. })
  7594. }
  7595. ,
  7596. t.exports.init = function(e, t) {
  7597. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7598. }
  7599. ,
  7600. t.exports.dismissModal = r
  7601. }
  7602. , {
  7603. "../enum/DirectorEvents": 23,
  7604. "../enum/HelpModalType": 28,
  7605. "../enum/PlayerEvents": 40,
  7606. "../enum/Viewmode": 51,
  7607. "../settings": 166,
  7608. "./help/help": 67,
  7609. "./helpManager": 68,
  7610. "./populateModal": 75
  7611. }],
  7612. 72: [function(e, t, i) {
  7613. "use strict";
  7614. var n = e("./circleLoader").circleLoader;
  7615. t.exports = {
  7616. element: $("#gui-loading"),
  7617. hide: function(e) {
  7618. n.done(),
  7619. this.element.fadeOut(1500, e)
  7620. },
  7621. show: function(e) {
  7622. this.element.fadeIn(500, function() {
  7623. this.element.css("display", "table"),
  7624. e && e()
  7625. }
  7626. .bind(this))
  7627. },
  7628. progress: function(e) {
  7629. n.set(e)
  7630. }
  7631. }
  7632. }
  7633. , {
  7634. "./circleLoader": 60
  7635. }],
  7636. 73: [function(e, t, i) {
  7637. "use strict";
  7638. var n = e("../settings")
  7639. , r = $("#memory-info")
  7640. , o = r.find("#memory-gpu")
  7641. , a = !1;
  7642. t.exports = {
  7643. show: function() {
  7644. n.profiling.enabled && (r.show(),
  7645. a = !0)
  7646. },
  7647. hide: function() {
  7648. r.hide(),
  7649. a = !1
  7650. },
  7651. toggle: function() {
  7652. a ? this.hide() : this.show()
  7653. },
  7654. update: function(e) {
  7655. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7656. }
  7657. }
  7658. }
  7659. , {
  7660. "../settings": 166
  7661. }],
  7662. 74: [function(e, t, i) {
  7663. "use strict";
  7664. e("../util/browser"),
  7665. e("../analytics");
  7666. e("../settings"),
  7667. t.exports = {
  7668. show: function(e, t) {
  7669. $("#gui-message").fadeOut(500, function() {
  7670. t()
  7671. })
  7672. }
  7673. }
  7674. }
  7675. , {
  7676. "../analytics": 4,
  7677. "../settings": 166,
  7678. "../util/browser": 182
  7679. }],
  7680. 75: [function(e, t, i) {
  7681. "use strict";
  7682. function n(e, t, i, n) {
  7683. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7684. }
  7685. var r = e("../util/browser")
  7686. , o = e("../localization/localize")
  7687. , a = e("../enum/HelpModalType")
  7688. , s = (e("../enum/HelpModalSize"),
  7689. e("../enum/Viewmode"));
  7690. t.exports = {
  7691. init: function() {
  7692. if (!this.hasInitialized) {
  7693. this.hasInitialized = !0,
  7694. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7695. this.assets = {},
  7696. this.assets[a.LANDING[s.PANORAMA]] = {
  7697. desktop: {
  7698. left: {
  7699. "top-info": o.ROTATE,
  7700. "big-image": "images/nav_help_mouse_drag_left.png",
  7701. keyboard: "images/nav_help_keyboard_left_right.png"
  7702. },
  7703. middle: {
  7704. "top-info": o.MOVE,
  7705. "big-image": "images/nav_help_mouse_click.png",
  7706. keyboard: "images/nav_help_keyboard_up_down.png"
  7707. },
  7708. right: {
  7709. "top-info": o.ZOOM,
  7710. "big-image": "images/nav_help_mouse_zoom.png",
  7711. keyboard: "images/nav_help_zoom_keys.png"
  7712. }
  7713. },
  7714. mobile: {
  7715. left: {
  7716. "top-info": o.ROTATE,
  7717. "big-image": "images/nav_help_gesture_drag.png"
  7718. },
  7719. middle: {
  7720. "top-info": o.MOVE,
  7721. "big-image": "images/nav_help_gesture_tap.png"
  7722. },
  7723. right: {
  7724. "top-info": o.ZOOM,
  7725. "big-image": "images/nav_help_gesture_pinch.png"
  7726. }
  7727. }
  7728. },
  7729. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7730. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7731. desktop: {
  7732. left: {
  7733. "top-info": o.ROTATE,
  7734. "big-image": "images/nav_help_mouse_drag_left.png",
  7735. keyboard: "images/nav_help_keyboard_left_right.png"
  7736. },
  7737. middle: {
  7738. "top-info": o.MOVE,
  7739. "big-image": "images/nav_help_mouse_position_right.png"
  7740. }
  7741. },
  7742. mobile: {
  7743. left: {
  7744. "top-info": o.ROTATE,
  7745. "big-image": "images/nav_help_gesture_drag.png"
  7746. },
  7747. middle: {
  7748. "top-info": o.MOVE,
  7749. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7750. }
  7751. }
  7752. },
  7753. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7754. desktop: {
  7755. left: {
  7756. "top-info": o.MOVE,
  7757. "big-image": "images/nav_help_mouse_position_left.png"
  7758. },
  7759. middle: {
  7760. "top-info": o.ROTATE,
  7761. "big-image": "images/nav_help_mouse_drag_right.png",
  7762. keyboard: "images/nav_help_keyboard_left_right.png"
  7763. }
  7764. },
  7765. mobile: {
  7766. left: {
  7767. "top-info": o.MOVE,
  7768. "big-image": "images/nav_help_gesture_position.png"
  7769. },
  7770. middle: {
  7771. "top-info": o.ROTATE,
  7772. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7773. }
  7774. }
  7775. };
  7776. var e = {
  7777. "top-info": o.INSIDE,
  7778. "big-image": "images/nav_help_click_inside.png",
  7779. keyboard: "images/nav_help_inside_key.png"
  7780. };
  7781. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7782. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7783. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7784. var t = {
  7785. "top-info": o.INSIDE,
  7786. "big-image": "images/nav_help_tap_inside.png"
  7787. };
  7788. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7789. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7790. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7791. this.assets[a.NAVIGATION] = {},
  7792. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7793. desktop: {
  7794. left: {
  7795. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7796. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7797. "big-image": "images/nav_help_mouse_drag_left.png",
  7798. keyboard: "images/nav_help_keyboard_left_right.png"
  7799. },
  7800. middle: {
  7801. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7802. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7803. "big-image": "images/nav_help_mouse_click.png",
  7804. keyboard: "images/nav_help_keyboard_up_down.png"
  7805. },
  7806. right: {
  7807. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7808. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7809. "big-image": "images/nav_help_mouse_zoom.png",
  7810. keyboard: "images/nav_help_zoom_keys.png"
  7811. }
  7812. },
  7813. mobile: {
  7814. left: {
  7815. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7816. "big-image": "images/nav_help_gesture_drag.png"
  7817. },
  7818. middle: {
  7819. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7820. "big-image": "images/nav_help_gesture_tap.png"
  7821. },
  7822. right: {
  7823. "top-info": o.HELP_MOBILE_3,
  7824. "big-image": "images/nav_help_gesture_pinch.png"
  7825. }
  7826. }
  7827. },
  7828. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7829. desktop: {
  7830. left: {
  7831. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7832. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7833. "big-image": "images/nav_help_mouse_drag_left.png",
  7834. keyboard: "images/nav_help_keyboard_all.png"
  7835. },
  7836. middle: {
  7837. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7838. "big-image": "images/nav_help_mouse_position_right.png"
  7839. },
  7840. right: {
  7841. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7842. "big-image": "images/nav_help_mouse_zoom.png"
  7843. }
  7844. },
  7845. mobile: {
  7846. left: {
  7847. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7848. "big-image": "images/nav_help_gesture_drag.png"
  7849. },
  7850. middle: {
  7851. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7852. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7853. },
  7854. right: {
  7855. "top-info": o.HELP_MOBILE_3,
  7856. "big-image": "images/nav_help_gesture_pinch.png"
  7857. }
  7858. }
  7859. },
  7860. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7861. desktop: {
  7862. left: {
  7863. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7864. "big-image": "images/nav_help_mouse_position_left.png"
  7865. },
  7866. middle: {
  7867. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7868. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7869. "big-image": "images/nav_help_mouse_drag_right.png",
  7870. keyboard: "images/nav_help_keyboard_left_right.png"
  7871. },
  7872. right: {
  7873. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7874. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7875. "big-image": "images/nav_help_mouse_zoom.png",
  7876. keyboard: "images/nav_help_keyboard_up_down.png"
  7877. }
  7878. },
  7879. mobile: {
  7880. left: {
  7881. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7882. "big-image": "images/nav_help_gesture_position.png"
  7883. },
  7884. middle: {
  7885. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7886. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7887. },
  7888. right: {
  7889. "top-info": o.HELP_MOBILE_3,
  7890. "big-image": "images/nav_help_gesture_pinch.png"
  7891. }
  7892. }
  7893. },
  7894. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7895. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7896. "top-info": o.HELP_DESKTOP_360_2A,
  7897. "bottom-info": o.HELP_DESKTOP_360_2B,
  7898. "big-image": "images/nav_help_click_inside.png",
  7899. keyboard: "images/nav_help_inside_key.png"
  7900. },
  7901. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7902. "top-info": o.HELP_MOBILE_360_2,
  7903. "big-image": "images/nav_help_tap_inside.png"
  7904. },
  7905. this.assets[a.MORE_HELP] = {
  7906. desktop: {
  7907. "more-help-hlr": {
  7908. "top-info": o.HELP_MORE_HLR_A,
  7909. "big-image": "images/nav_help_expand.svg",
  7910. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7911. },
  7912. "more-help-dollhouse": {
  7913. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7914. "big-image": "images/nav_help_dollhouse.svg",
  7915. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7916. },
  7917. "more-help-floors": {
  7918. "top-info": o.HELP_MORE_FLOORS_A,
  7919. "big-image": "images/nav_help_floor picker.svg",
  7920. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7921. },
  7922. "more-help-tag": {
  7923. "top-info": o.HELP_MORE_TAG_A,
  7924. "big-image": "images/nav_help_tag.svg",
  7925. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7926. },
  7927. "more-help-zoom": {
  7928. "top-info": o.HELP_MORE_ZOOM_A,
  7929. "big-image": "images/nav_help_zoom.svg",
  7930. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7931. },
  7932. "more-help-tour": {
  7933. "top-info": o.HELP_MORE_TOUR_A,
  7934. "big-image": "images/nav_help_play.png",
  7935. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7936. },
  7937. "more-help-inside": {
  7938. "top-info": o.HELP_MORE_INSIDE_A,
  7939. "big-image": "images/nav_help_inside.svg",
  7940. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7941. },
  7942. "more-help-vr": {
  7943. "top-info": o.HELP_MORE_VR_A,
  7944. "big-image": "images/nav_help_vr.svg",
  7945. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7946. },
  7947. "more-help-360": {
  7948. "top-info": o.HELP_MORE_360_A,
  7949. "big-image": "images/nav_help_360.svg",
  7950. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7951. },
  7952. "more-help-fullscreen": {
  7953. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7954. "big-image": "images/nav_help_fullscreen.svg",
  7955. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7956. }
  7957. },
  7958. mobile: {
  7959. "more-help-hlr": {
  7960. "top-info": o.HELP_MORE_HLR_A,
  7961. "big-image": "images/nav_help_expand.svg",
  7962. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7963. },
  7964. "more-help-dollhouse": {
  7965. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7966. "big-image": "images/nav_help_dollhouse.svg",
  7967. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7968. },
  7969. "more-help-floors": {
  7970. "top-info": o.HELP_MORE_FLOORS_A,
  7971. "big-image": "images/nav_help_floor picker.svg",
  7972. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7973. },
  7974. "more-help-tag": {
  7975. "top-info": o.HELP_MORE_TAG_A,
  7976. "big-image": "images/nav_help_tag.svg",
  7977. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7978. },
  7979. "more-help-tour": {
  7980. "top-info": o.HELP_MORE_TOUR_A,
  7981. "big-image": "images/nav_help_play.png",
  7982. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7983. },
  7984. "more-help-inside": {
  7985. "top-info": o.HELP_MORE_INSIDE_A,
  7986. "big-image": "images/nav_help_inside.svg",
  7987. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7988. },
  7989. "more-help-vr": {
  7990. "top-info": o.HELP_MORE_VR_A,
  7991. "big-image": "images/webvr.svg",
  7992. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7993. },
  7994. "more-help-360": {
  7995. "top-info": o.HELP_MORE_360_A,
  7996. "big-image": "images/nav_help_360.svg",
  7997. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7998. }
  7999. }
  8000. },
  8001. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8002. desktop: {
  8003. left: {
  8004. "top-info": o.ROTATE,
  8005. "big-image": "images/nav_help_mouse_drag_left.png",
  8006. keyboard: "images/nav_help_keyboard_left_right.png"
  8007. },
  8008. middle: {
  8009. "top-info": o.MOVE,
  8010. "big-image": "images/nav_help_mouse_click.png",
  8011. keyboard: "images/nav_help_keyboard_up_down.png"
  8012. },
  8013. right: {
  8014. "top-info": o.PLAY,
  8015. "big-image": "images/Desktop-help-play-button.svg",
  8016. keyboard: "images/Desktop-help-spacebar-2.svg"
  8017. }
  8018. },
  8019. mobile: {
  8020. left: {
  8021. "top-info": o.ROTATE,
  8022. "big-image": "images/nav_help_gesture_drag.png"
  8023. },
  8024. middle: {
  8025. "top-info": o.MOVE,
  8026. "big-image": "images/nav_help_gesture_tap.png"
  8027. },
  8028. right: {
  8029. "top-info": o.PLAY,
  8030. "big-image": "images/mobile-help-play-button.svg"
  8031. }
  8032. }
  8033. },
  8034. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8035. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8036. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8037. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8038. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8039. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8040. }
  8041. },
  8042. fill: function(e, t, i) {
  8043. n.call(this, e, t, i, !0)
  8044. },
  8045. clear: function(e, t, i) {
  8046. n.call(this, e, t, i, !1)
  8047. }
  8048. }
  8049. }
  8050. , {
  8051. "../enum/HelpModalSize": 27,
  8052. "../enum/HelpModalType": 28,
  8053. "../enum/Viewmode": 51,
  8054. "../localization/localize": 108,
  8055. "../util/browser": 182
  8056. }],
  8057. 76: [function(e, t, i) {
  8058. "use strict";
  8059. t.exports = Object.freeze({
  8060. OPENED: "share.open",
  8061. CLOSED: "share.closed",
  8062. LINK_CLICKED: "share.linked"
  8063. })
  8064. }
  8065. , {}],
  8066. 77: [function(e, t, i) {
  8067. "use strict";
  8068. function n(n) {
  8069. function e(e, t) {
  8070. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8071. I.emit(l.LINK_CLICKED, {
  8072. channel: n
  8073. }),
  8074. window.open(C[n], "shareWindow", i)
  8075. }
  8076. switch (n) {
  8077. case A.FACEBOOK:
  8078. e(580, 420);
  8079. break;
  8080. case A.TWITTER:
  8081. e(550, 440);
  8082. break;
  8083. case A.MAIL:
  8084. I.emit(l.LINK_CLICKED, {
  8085. channel: "email"
  8086. }),
  8087. window.open(C[n], "_blank");
  8088. break;
  8089. case A.LINKEDIN:
  8090. }
  8091. }
  8092. function r(e) {
  8093. I.emit(l.LINK_CLICKED, {
  8094. channel: "copylink"
  8095. });
  8096. var t = document.createRange();
  8097. t.selectNodeContents(v);
  8098. var i = window.getSelection();
  8099. i.removeAllRanges(),
  8100. i.addRange(t),
  8101. document.execCommand("copy"),
  8102. y.classList.remove("hidden"),
  8103. v.classList.add("highlighted")
  8104. }
  8105. function o(e) {
  8106. e && (e.stopPropagation(),
  8107. e.target === v) || (window.getSelection().removeAllRanges(),
  8108. v.classList.remove("highlighted"),
  8109. y.classList.add("hidden"))
  8110. }
  8111. var a = e("../../util/browser")
  8112. , s = e("../../localization/localize")
  8113. , l = e("./ShareEvents")
  8114. , c = e("../../util/common")
  8115. , h = e("events").EventEmitter
  8116. , u = document.getElementById("sharing")
  8117. , d = document.getElementById("share-modal")
  8118. , p = document.getElementById("share-close")
  8119. , f = document.getElementById("facebook-share")
  8120. , g = document.getElementById("twitter-share")
  8121. , m = document.getElementById("mail-share")
  8122. , v = document.getElementById("share-url-text")
  8123. , y = document.getElementById("copy-success")
  8124. , A = Object.freeze({
  8125. FACEBOOK: "facebook",
  8126. TWITTER: "twitter",
  8127. MAIL: "mail",
  8128. LINKEDIN: "linkedin"
  8129. })
  8130. , C = {};
  8131. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8132. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8133. C[A.MAIL] = "mailto:?subject=";
  8134. var I = {
  8135. init: function(e) {
  8136. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8137. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8138. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8139. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8140. u.addEventListener("click", this.toggle.bind(this)),
  8141. p.addEventListener("click", this.hide.bind(this)),
  8142. v.addEventListener("click", r),
  8143. d.addEventListener("click", o),
  8144. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8145. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8146. m.addEventListener("click", n.bind(this, A.MAIL)),
  8147. v.textContent = window.location.href + "&utm_source=4",
  8148. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8149. u.classList.remove("hidden")
  8150. },
  8151. show: function() {
  8152. this.emit(l.OPENED),
  8153. d.classList.add("fadeIn")
  8154. },
  8155. hide: function() {
  8156. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8157. document.selection && document.selection.empty(),
  8158. window.getSelection().removeAllRanges(),
  8159. o(),
  8160. d.classList.remove("fadeIn"))
  8161. },
  8162. toggle: function() {
  8163. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8164. }
  8165. };
  8166. c.extendObject(I, h.prototype),
  8167. t.exports = I
  8168. }
  8169. , {
  8170. "../../localization/localize": 108,
  8171. "../../util/browser": 182,
  8172. "../../util/common": 185,
  8173. "./ShareEvents": 76,
  8174. events: 202
  8175. }],
  8176. 78: [function(e, t, i) {
  8177. "use strict";
  8178. t.exports = Object.freeze({
  8179. OPENED: "terms.opened",
  8180. CLOSED: "terms.closed"
  8181. })
  8182. }
  8183. , {}],
  8184. 79: [function(e, t, i) {
  8185. "use strict";
  8186. var n = e("./TermsEvent")
  8187. , r = e("../../localization/localize")
  8188. , o = e("../../analytics")
  8189. , a = e("../../util/ajax")
  8190. , s = e("../../util/common")
  8191. , l = e("events").EventEmitter
  8192. , c = document.getElementById("terms-modal")
  8193. , h = {
  8194. init: function() {
  8195. $(".footer-terms").on("click", function(e) {
  8196. e.preventDefault(),
  8197. this.show()
  8198. }
  8199. .bind(this)),
  8200. $("#terms-modal .close").on("click", this.hide.bind(this))
  8201. },
  8202. show: function() {
  8203. this.emit(n.OPENED),
  8204. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8205. var t = $("#terms-text").html(e);
  8206. o.track("showcase_gui", {
  8207. gui_action: "click_terms_button",
  8208. interaction_source: "gui"
  8209. }),
  8210. t.find("a").attr("target", "_blank")
  8211. }).fail(function() {
  8212. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8213. }),
  8214. c.classList.add("fadeIn")
  8215. },
  8216. hide: function(e) {
  8217. e && e.preventDefault(),
  8218. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8219. c.classList.remove("fadeIn")
  8220. }
  8221. };
  8222. s.extendObject(h, l.prototype),
  8223. t.exports = h
  8224. }
  8225. , {
  8226. "../../analytics": 4,
  8227. "../../localization/localize": 108,
  8228. "../../util/ajax": 181,
  8229. "../../util/common": 185,
  8230. "./TermsEvent": 78,
  8231. events: 202
  8232. }],
  8233. 80: [function(e, t, i) {
  8234. "use strict";
  8235. t.exports = Object.freeze({
  8236. OPEN_INFO: "title.open.info",
  8237. CLOSE_INFO: "title.close.info",
  8238. SHOW_INFO: "title.show.info",
  8239. HIDE_INFO: "title.hide.info",
  8240. LINK_CLICKED: "title.link.click",
  8241. CONTACT_LINK_CLICKED: "title.contact.click",
  8242. ORIGIN_LINK_CLICKED: "title.origin.click"
  8243. })
  8244. }
  8245. , {}],
  8246. 81: [function(e, t, i) {
  8247. "use strict";
  8248. var o = e("../../settings");
  8249. t.exports.init = function(e, t) {
  8250. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8251. function e(e) {
  8252. t.shouldShowtags = "show" === this.value,
  8253. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8254. }
  8255. document.getElementById("tag-toggles").classList.remove("hidden"),
  8256. document.getElementById("radio-tag-show").checked = !0;
  8257. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8258. n[r].addEventListener("change", e)
  8259. }(e, t)
  8260. }
  8261. }
  8262. , {
  8263. "../../settings": 166
  8264. }],
  8265. 82: [function(S, M, e) {
  8266. (function(e) {
  8267. "use strict";
  8268. function i(e) {
  8269. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8270. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8271. _.appendChild(function(e) {
  8272. var t = document.createElement("a");
  8273. return t.id = "url",
  8274. t.target = "_blank",
  8275. t.href = e,
  8276. t.innerText = e,
  8277. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8278. t
  8279. }(e)),
  8280. b.forEach(function(e) {
  8281. e.classList.add("share-link")
  8282. }),
  8283. 0))
  8284. }
  8285. function s(e, t) {
  8286. var i = e
  8287. , n = t;
  8288. return function(e, t) {
  8289. i.push(t || n, e)
  8290. }
  8291. }
  8292. var l = S("../../util/browser")
  8293. , t = S("../../util/common")
  8294. , n = S("../../util/logger")
  8295. , r = S("../../localization/localize")
  8296. , o = S("./titleBarSettings")
  8297. , c = S("../../settings")
  8298. , a = S("./TitleEvents")
  8299. , h = S("events").EventEmitter
  8300. , u = new n(e)
  8301. , d = document.querySelector(".pinTop.left")
  8302. , p = document.getElementsByClassName("title-container")[0]
  8303. , f = document.getElementById("title-toggle").querySelector("i")
  8304. , g = document.getElementById("meta-info-wrapper")
  8305. , m = document.getElementById("meta-info")
  8306. , v = document.getElementById("meta-description")
  8307. , y = document.getElementsByClassName("contact-info")[0]
  8308. , A = document.getElementById("contact-data")
  8309. , C = document.getElementById("addressTxt")
  8310. , I = document.getElementById("tag-toggles")
  8311. , E = document.getElementById("share-origin")
  8312. , _ = document.getElementById("share-link-wrapper")
  8313. , b = [m, g, p]
  8314. , w = !1
  8315. , T = !1
  8316. , x = {
  8317. populate: function(e) {
  8318. if (function(e, t) {
  8319. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8320. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8321. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8322. document.getElementById("gui-name").classList.add("noCoBrand"),
  8323. document.getElementById("cobrandTitle").classList.add("hidden")),
  8324. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8325. !1)
  8326. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8327. if (function(e) {
  8328. e ? (w = !0,
  8329. v.innerHTML = e) : v.classList.add("hidden")
  8330. }(e.description),
  8331. function(e, t, i, n) {
  8332. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8333. w = !0;
  8334. var r = []
  8335. , o = s(r, "<br>");
  8336. if (e && o('<span id="contactName">' + e + "</span>"),
  8337. t) {
  8338. var a = n || t;
  8339. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8340. }
  8341. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8342. r[0] = "",
  8343. A.innerHTML = r.join("")
  8344. } else
  8345. y.classList.add("hidden")
  8346. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8347. function(e) {
  8348. if ("string" == typeof e)
  8349. try {
  8350. e = JSON.parse(e)
  8351. } catch (e) {
  8352. return u.warn("Unable to parse address data"),
  8353. C.parentElement.classList.add("hidden")
  8354. }
  8355. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8356. w = !0;
  8357. var t = []
  8358. , i = s(t, " ");
  8359. e.address_1 && i(e.address_1),
  8360. e.address_2 && i(e.address_2),
  8361. e.city && i(e.city, ", "),
  8362. e.state && i(e.state, ", "),
  8363. e.zip && i(e.zip, e.state ? " " : ", "),
  8364. t[0] = "",
  8365. C.innerText = t.join("")
  8366. } else
  8367. C.parentElement.classList.add("hidden")
  8368. }(e.address),
  8369. w) {
  8370. var t = document.createElement("br");
  8371. I.insertBefore(t, I.firstElementChild)
  8372. }
  8373. e.socialSharing && c.share.enabled && (T = i(e.url))
  8374. }
  8375. },
  8376. finishSetup: function(e) {
  8377. w = w || !!e,
  8378. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8379. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8380. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8381. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8382. }),
  8383. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8384. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8385. contact_type: e.getAttribute("id")
  8386. }))
  8387. }),
  8388. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8389. },
  8390. toggleMeta: function(e, t) {
  8391. var i = document.getElementById("model-title");
  8392. t && t.preventDefault();
  8393. var n = m.classList.contains("expand");
  8394. e && !n || (n ? (b.forEach(function(e) {
  8395. e.classList.remove("expand")
  8396. }),
  8397. this.emit(a.CLOSE_INFO),
  8398. i.classList.remove("expand")) : (b.forEach(function(e) {
  8399. e.classList.add("expand")
  8400. }),
  8401. i.classList.add("expand"),
  8402. this.emit(a.OPEN_INFO)))
  8403. },
  8404. setupToggling: function() {
  8405. g.style.height = m.offsetHeight + "px",
  8406. m.addEventListener("transitionend", function() {
  8407. g.style.height = m.offsetHeight + "px"
  8408. })
  8409. },
  8410. toggleTitle: function(e) {
  8411. e && e.preventDefault(),
  8412. d.classList.contains("closed") ? (d.classList.add("open"),
  8413. f.classList.remove("icon-dpad-right"),
  8414. f.classList.add("icon-dpad-left"),
  8415. this.emit(a.SHOW_INFO),
  8416. setTimeout(function() {
  8417. d.classList.remove("closed"),
  8418. d.classList.remove("open")
  8419. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8420. f.classList.remove("icon-dpad-left"),
  8421. f.classList.add("icon-dpad-right"),
  8422. this.emit(a.HIDE_INFO))
  8423. }
  8424. };
  8425. t.extendObject(x, h.prototype),
  8426. M.exports = x
  8427. }
  8428. ).call(this, "/js/gui/title/titleBar.js")
  8429. }
  8430. , {
  8431. "../../localization/localize": 108,
  8432. "../../settings": 166,
  8433. "../../util/browser": 182,
  8434. "../../util/common": 185,
  8435. "../../util/logger": 189,
  8436. "./TitleEvents": 80,
  8437. "./titleBarSettings": 83,
  8438. events: 202
  8439. }],
  8440. 83: [function(e, t, i) {
  8441. "use strict";
  8442. t.exports = Object.freeze({
  8443. minTooltipCharacters: 19,
  8444. removeAnimationClasses: 500
  8445. })
  8446. }
  8447. , {}],
  8448. 84: [function(e, t, i) {
  8449. "use strict";
  8450. function n() {
  8451. v.playTour(),
  8452. y && clearTimeout(y),
  8453. c(),
  8454. E.removeClass("fadeIn")
  8455. }
  8456. function r() {
  8457. A.classList.contains("playing") && (v.stopTour(),
  8458. E.addClass("fadeIn"),
  8459. setTimeout(function() {
  8460. E.removeClass("fadeIn")
  8461. }, h.tourInteraction.showPauseButton),
  8462. M || (clearTimeout(y),
  8463. y = setTimeout(s, h.tourInteraction.showModal)),
  8464. setTimeout(function() {
  8465. A.classList.remove("playing")
  8466. }, h.tourInteraction.allowNextClick))
  8467. }
  8468. function o() {
  8469. v.tourInProgress && (v.stopTour(),
  8470. v.endTourProgress(),
  8471. A.classList.remove("playing"))
  8472. }
  8473. function a() {
  8474. _.is(":visible") ? n() : r()
  8475. }
  8476. function s() {//去掉导览结束时的提示
  8477. /* if (!h.tourInteraction.disabled) {
  8478. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8479. T.addClass("fadeIn tour " + p.deviceType);
  8480. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8481. if (!h.tourInteraction.smallModal)
  8482. 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,
  8483. p.fill(x, g.TOUR_INTERACTION[e]),
  8484. T.addClass(e);
  8485. T.addClass(t)
  8486. } */
  8487. }
  8488. function l(e, t) {
  8489. if (t) {
  8490. var i = "keydown" === t.type
  8491. , n = t.which === u.SPACE || v.tourIsPlaying;
  8492. i && n || e || (M = !0),
  8493. v.atEndOfTour() && c(),
  8494. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8495. c(),
  8496. t.which !== u.SPACE && o()),
  8497. i && n && a()
  8498. }
  8499. }
  8500. function c() {
  8501. T.removeClass("fadeIn")
  8502. }
  8503. var h = (e("../util/browser"),
  8504. e("../settings"))
  8505. , u = e("../enum/Keys")
  8506. , d = e("../enum/Viewmode")
  8507. , p = (e("./helpManager"),
  8508. e("./populateModal"))
  8509. , f = e("../enum/DirectorEvents")
  8510. , g = e("../enum/HelpModalType")
  8511. , m = e("../enum/HelpModalSize")
  8512. , v = null
  8513. , y = null
  8514. , A = document.getElementById("pause-overlay")
  8515. , C = document.getElementById("player")
  8516. , I = document.getElementById("gui")
  8517. , E = $("#pause-icon").eq(0)
  8518. , _ = $("#play").eq(0)
  8519. , b = $("#playHead").eq(0)
  8520. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8521. , T = $("#interaction-modal").eq(0)
  8522. , x = $("#interaction-modal .interaction").toArray()
  8523. , S = ["touchstart", "mousedown", "pointerdown"]
  8524. , M = !1;
  8525. t.exports.init = function(e) {
  8526. v = e,
  8527. S.forEach(function(t) {
  8528. C.addEventListener(t, l.bind(this, !1), !0),
  8529. I.addEventListener(t, l.bind(this, !0), !0),
  8530. A.addEventListener(t, r, !0),
  8531. w.forEach(function(e) {
  8532. e.addEventListener(t, o, !0)
  8533. }),
  8534. $("#drawer img").on(t, o)
  8535. }),
  8536. document.addEventListener("keydown", l.bind(this, !1), !0),
  8537. v.on(f.TourStart, function() {
  8538. A.classList.add("playing")
  8539. })
  8540. }
  8541. ,
  8542. t.exports.play = n,
  8543. t.exports.pause = r,
  8544. t.exports.pauseWithoutCTA = o,
  8545. t.exports.togglePlay = a,
  8546. t.exports.stopTour = function() {
  8547. b.hasClass("playing") && (clearTimeout(y),
  8548. v.atEndOfTour() ? (A.classList.remove("playing"),
  8549. s()) : E.removeClass("fadeIn"))
  8550. }
  8551. ,
  8552. t.exports.dismissModal = c
  8553. }
  8554. , {
  8555. "../enum/DirectorEvents": 23,
  8556. "../enum/HelpModalSize": 27,
  8557. "../enum/HelpModalType": 28,
  8558. "../enum/Keys": 30,
  8559. "../enum/Viewmode": 51,
  8560. "../settings": 166,
  8561. "../util/browser": 182,
  8562. "./helpManager": 68,
  8563. "./populateModal": 75
  8564. }],
  8565. 85: [function(e, t, i) {
  8566. "use strict";
  8567. t.exports = Object.freeze({
  8568. OPENED: "vr.modal.opened",
  8569. LAUNCH: "vr.modal.launch",
  8570. CLOSED: "vr.modal.closed",
  8571. NEXT: "vr.modal.next",
  8572. PREV: "vr.modal.prev",
  8573. STORE: "vr.modal.store",
  8574. falseICECHOSEN: "vr.modal.device"
  8575. })
  8576. }
  8577. , {}],
  8578. 86: [function(e, t, i) {
  8579. "use strict";
  8580. var h = e("../../util/browser")
  8581. , u = e("../../enum/VRApps")
  8582. , n = e("../../enum/VRPlatforms")
  8583. , d = e("../../util/ajax")
  8584. , p = e("../../settings")
  8585. , r = {};
  8586. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8587. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8588. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8589. u) {
  8590. var a = u[o];
  8591. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8592. }
  8593. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8594. "https://" + s);
  8595. t.exports.init = function(e, t, o) {
  8596. function a(e, t, i, n) {
  8597. function r() {
  8598. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8599. }
  8600. 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()
  8601. }
  8602. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8603. , l = g + "/vr/dlist/?ret=" + s
  8604. , c = g + "/vr/show/?ret=" + s;
  8605. switch (e) {
  8606. case n.IOS:
  8607. !function(t, e, i, n) {
  8608. var r = a(t, e, i, n)
  8609. , o = {
  8610. responseType: "json",
  8611. data: {
  8612. branch_key: p.appConfig.branch_key,
  8613. data: {
  8614. m: e,
  8615. full_url: r,
  8616. $desktop_url: "",
  8617. $og_app_id: "331853976762864119",
  8618. $og_title: i,
  8619. $og_description: n,
  8620. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8621. $canonical_url: window.location.href
  8622. }
  8623. }
  8624. };
  8625. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8626. f[t] = e.url
  8627. }).fail(function(e) {
  8628. f[t] = e
  8629. }
  8630. .bind(this, r))
  8631. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8632. break;
  8633. default:
  8634. !function(e, t, i) {
  8635. for (var n in u) {
  8636. var r = u[n]
  8637. , o = a(r, e, t, i);
  8638. f[r] = o
  8639. }
  8640. }(t.sid, t.name, t.summary)
  8641. }
  8642. }
  8643. ,
  8644. t.exports.launch = function(e) {
  8645. var t = f[e];
  8646. window.open(t, "_blank")
  8647. }
  8648. ,
  8649. t.exports.launchStore = function(e) {
  8650. var t = r[e];
  8651. window.open(t, "_blank")
  8652. }
  8653. }
  8654. , {
  8655. "../../enum/VRApps": 46,
  8656. "../../enum/VRPlatforms": 49,
  8657. "../../settings": 166,
  8658. "../../util/ajax": 181,
  8659. "../../util/browser": 182
  8660. }],
  8661. 87: [function(e, t, i) {
  8662. "use strict";
  8663. function c(e) {
  8664. var t;
  8665. switch (e) {
  8666. case y.IOS:
  8667. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8668. case y.Android:
  8669. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8670. }
  8671. return !1
  8672. }
  8673. function h(e) {
  8674. switch (e) {
  8675. case y.Android:
  8676. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8677. x.filter(".gearvr").off().on("click", q.gear),
  8678. n(k, U, "logo-button", "same-line");
  8679. break;
  8680. case y.UnsupportedAndroid:
  8681. n("", H, "", "");
  8682. break;
  8683. case y.IOS:
  8684. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8685. n(k, "", "logo-button", "");
  8686. break;
  8687. case y.Desktop:
  8688. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8689. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8690. n(k, U, "logo-button", "same-line"),
  8691. Q.cardboard()
  8692. }
  8693. }
  8694. function u(e) {
  8695. $(".p1, .p2, .p3").hide(),
  8696. l.insertAfter(T),
  8697. w.removeClass("front-page"),
  8698. w.removeClass("details-page"),
  8699. w.removeClass("lastPage"),
  8700. x.removeClass("logo-button"),
  8701. x.removeClass("same-line"),
  8702. T.removeClass("headsetOptions"),
  8703. S.attr("src", ""),
  8704. S.filter(".second").removeClass("gear"),
  8705. S.css("display", "inline-block"),
  8706. S.off(),
  8707. M.filter(".second").css("display", ""),
  8708. O.css("display", "none"),
  8709. $(".p" + (e + 1) + _).show(),
  8710. S.filter(".third").insertBefore(M.filter(".third"))
  8711. }
  8712. function n(e, t, i, n) {
  8713. w.addClass("front-page"),
  8714. S.filter(".first").attr("src", e),
  8715. S.filter(".second").attr("src", t),
  8716. x.filter(".first").addClass(i),
  8717. x.filter(".second").addClass(i),
  8718. x.addClass(n),
  8719. ".show-desktop" === _ && T.insertAfter(l)
  8720. }
  8721. function r(e, t, i) {
  8722. T.addClass("headsetOptions"),
  8723. x.off(),
  8724. S.filter(".second").attr("src", t),
  8725. O.css("display", "block"),
  8726. M.filter(".second").css("display", "none"),
  8727. O.on("click", function() {
  8728. u(b.Title),
  8729. h(y.Desktop)
  8730. }),
  8731. e && (X.emit(C.falseICECHOSEN, {
  8732. name: v.GearVR
  8733. }),
  8734. S.filter(".first").attr("src", e),
  8735. S.filter(".second").addClass("gear"),
  8736. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8737. Q.gearvr()),
  8738. i && (X.emit(C.falseICECHOSEN, {
  8739. name: v.Cardboard
  8740. }),
  8741. S.filter(".third").attr("src", i),
  8742. S.filter(".third").show(),
  8743. S.filter(".third").insertAfter(S.filter(".second")),
  8744. S.filter(".third").addClass("link"),
  8745. S.filter(".second").addClass("link"),
  8746. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8747. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8748. Q.cardboard())
  8749. }
  8750. function d(e, t) {
  8751. switch (t) {
  8752. case y.IOS:
  8753. j = W,
  8754. Y = G;
  8755. break;
  8756. case y.Desktop:
  8757. e === b.Cardboard ? (j = N,
  8758. Y = B,
  8759. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8760. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8761. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8762. Y = "");
  8763. break;
  8764. default:
  8765. Y = e === b.Cardboard ? (j = H,
  8766. G) : (j = V,
  8767. z)
  8768. }
  8769. }
  8770. function p(e, t, i) {
  8771. w.find(".inner").addClass("details-page"),
  8772. w.addClass("details-page"),
  8773. S.filter(".first").attr("src", e),
  8774. S.filter(".second").attr("src", t),
  8775. S.filter(".third").attr("src", i)
  8776. }
  8777. function f() {
  8778. var e = 1 < g.aspectRatio() && g.isMobile();
  8779. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8780. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8781. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8782. }
  8783. var g = e("../../util/browser")
  8784. , m = e("./vrLink")
  8785. , v = e("../../enum/VRApps")
  8786. , y = e("../../enum/VRPlatforms")
  8787. , A = e("../../enum/VRPages")
  8788. , C = e("./vrEvent")
  8789. , o = (e("../../settings"),
  8790. e("../../constants"))
  8791. , I = e("../../localization/localize")
  8792. , a = e("../../util/common")
  8793. , s = e("events").EventEmitter
  8794. , E = 0
  8795. , _ = null
  8796. , b = A.standard
  8797. , w = $(".vr-popup")
  8798. , l = w.find(".vr-popup-body")
  8799. , T = w.find(".vr-images")
  8800. , x = w.find(".img-container")
  8801. , S = w.find(".vr-sm-image")
  8802. , M = x.find(".vr-img-caption")
  8803. , R = $(".vr-buttons").find(".prev-button")
  8804. , P = $(".vr-buttons").find(".next-button")
  8805. , O = T.find(".front-close")
  8806. , L = $(".vr-page")
  8807. , D = w.find("img")
  8808. , N = "images/apple-store.png"
  8809. , F = "images/badge-oculus.png"
  8810. , B = "images/badge-cardboard.png"
  8811. , V = "images/logo-samsung.png"
  8812. , k = "images/headset-cardboard.png"
  8813. , U = "images/headset-gearvr.png"
  8814. , H = "images/ico-android-robot.png"
  8815. , z = "images/ico-gearvr.png"
  8816. , G = "images/ico-vr.png"
  8817. , W = "images/apple-logo-white.svg"
  8818. , j = null
  8819. , Y = null
  8820. , q = {}
  8821. , X = {
  8822. init: function(e, t) {
  8823. function i(e) {
  8824. X.emit(C.STORE, {
  8825. type: e
  8826. }),
  8827. m.launchStore(e)
  8828. }
  8829. function n(e) {
  8830. switch (e !== b.pageCount && (u(e),
  8831. L.text(e + 1 + " / " + b.pageCount)),
  8832. e) {
  8833. case b.Title:
  8834. R.css("display", "none"),
  8835. P.text(a[e]),
  8836. h(r);
  8837. break;
  8838. case b.Cardboard:
  8839. R.css("display", "block"),
  8840. P.text(a[e]),
  8841. x.filter(".cardboard").off(),
  8842. x.filter(".gearvr").off(),
  8843. d(e, r),
  8844. p(k, j, Y);
  8845. break;
  8846. case b.Gear:
  8847. P.text(a[e]),
  8848. d(e, r),
  8849. w.addClass("lastPage"),
  8850. p(U, j, Y);
  8851. break;
  8852. case b.pageCount:
  8853. w.removeClass("fadeIn"),
  8854. X.emit(C.CLOSED)
  8855. }
  8856. D.filter("[src='']").hide()
  8857. }
  8858. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8859. _ = ".show-supported",
  8860. y.Android) : (w.addClass("unsupported"),
  8861. _ = ".show-unsupported",
  8862. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8863. _ = ".show-ios",
  8864. b = A.ios,
  8865. y.IOS) : (w.addClass("desktop"),
  8866. _ = ".show-desktop",
  8867. y.Desktop);
  8868. function o(e) {
  8869. X.emit(C.LAUNCH, {
  8870. vr_platform: r,
  8871. vr_app: e
  8872. }),
  8873. m.launch(e)
  8874. }
  8875. m.init(r, e, t),
  8876. r !== y.Desktop && w.addClass("mobile"),
  8877. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8878. q.gear = o.bind(this, v.GearVR),
  8879. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8880. f(),
  8881. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8882. $(_).show();
  8883. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8884. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8885. r === y.IOS && (a.splice(1, 1),
  8886. s.splice(1, 1)),
  8887. $("#vr").on("click", function(e) {
  8888. e.preventDefault(),
  8889. window.vrEnabled || (window.vrEnabled = !0,
  8890. this.classList.add("active"),
  8891. $("#gui div").not("#vrOff").addClass("vrHide"),
  8892. $("#vrOffImg").css({
  8893. display: "inline-block"
  8894. }))
  8895. }),
  8896. $("#vrOff").on("click", function() {
  8897. window.vrEnabled = !1,
  8898. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8899. $("#vrOffImg").css({
  8900. display: "none"
  8901. }),
  8902. $("#player canvas").css({
  8903. width: "",
  8904. height: ""
  8905. }),
  8906. $("#vr").removeClass("active")
  8907. });
  8908. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8909. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8910. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8911. $("span.modelLink").text(l),
  8912. R.on("click", function(e) {
  8913. X.emit(C.PREV),
  8914. n(--E)
  8915. }),
  8916. P.on("click", function(e) {
  8917. P.text(),
  8918. X.emit(C.NEXT, {
  8919. nextAction: s[E]
  8920. }),
  8921. n(++E)
  8922. }),
  8923. w.find(".close").on("click", X.dismiss)
  8924. },
  8925. dismiss: function() {
  8926. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8927. X.emit(C.CLOSED))
  8928. },
  8929. isDeviceSupported: c
  8930. };
  8931. a.extendObject(X, s.prototype),
  8932. $(window).resize(f);
  8933. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8934. K = M.filter(".first").find(".gearvr"),
  8935. {
  8936. cardboard: function() {
  8937. K.addClass("hidden"),
  8938. Z.removeClass("hidden")
  8939. },
  8940. gearvr: function() {
  8941. Z.addClass("hidden"),
  8942. K.removeClass("hidden")
  8943. }
  8944. });
  8945. t.exports = X
  8946. }
  8947. , {
  8948. "../../constants": 8,
  8949. "../../enum/VRApps": 46,
  8950. "../../enum/VRPages": 48,
  8951. "../../enum/VRPlatforms": 49,
  8952. "../../localization/localize": 108,
  8953. "../../settings": 166,
  8954. "../../util/browser": 182,
  8955. "../../util/common": 185,
  8956. "./vrEvent": 85,
  8957. "./vrLink": 86,
  8958. events: 202
  8959. }],
  8960. 88: [function(e, t, i) {
  8961. "use strict";
  8962. t.exports = Object.freeze({
  8963. OPENED: "webvr.modal.opened",
  8964. SHOW_TERMS: "webvr.footer.show.terms"
  8965. })
  8966. }
  8967. , {}],
  8968. 89: [function(B, V, e) {
  8969. (function(e) {
  8970. "use strict";
  8971. function a() {
  8972. function t() {
  8973. p.isPresenting || (r.info("exiting webVR"),
  8974. c("webvr_exit_app"),
  8975. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8976. window.removeEventListener("vrdisplaypresentchange", t))
  8977. }
  8978. r.info("Headset mounted"),
  8979. u.suspend();
  8980. var e = document.createElement("canvas");
  8981. for (e.getContext("webgl"),
  8982. e.className = "webvr-canvas",
  8983. document.bgColor = "#000",
  8984. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8985. document.body.removeChild(document.body.firstChild);
  8986. document.body.appendChild(e),
  8987. c("webvr_enter_app"),
  8988. p.requestPresent([{
  8989. source: e,
  8990. predistorted: !0
  8991. }]).catch(function(e) {
  8992. r.error("Failed to present: " + e),
  8993. c("webvr_exit_calibrate"),
  8994. t()
  8995. }),
  8996. d.then(function() {
  8997. window.dispatchEvent(new Event("vrapp-start"))
  8998. }),
  8999. window.addEventListener("vrdisplaypresentchange", t)
  9000. }
  9001. function s() {
  9002. c("webvr_modal_close"),
  9003. _.find(".enter-button").off("click", a),
  9004. E.fadeOut(g.guiAnimationSpeed, function() {
  9005. _.toggleClass("hidden", !1),
  9006. b.toggleClass("hidden", !0),
  9007. f.exitFullscreen()
  9008. }),
  9009. I.fadeIn(g.guiAnimationSpeed)
  9010. }
  9011. function t() {
  9012. M.toggleClass("hidden", !0),
  9013. S.toggleClass("hidden", !1)
  9014. }
  9015. function l() {
  9016. _.toggleClass("hidden"),
  9017. b.toggleClass("hidden")
  9018. }
  9019. function c(e) {
  9020. var t = f.isLandscape() ? "landscape" : "portrait";
  9021. i.trackAlways("showcase_gui", {
  9022. gui_action: e,
  9023. orientation: t
  9024. })
  9025. }
  9026. function h() {
  9027. var e = f.isLandscape();
  9028. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9029. }
  9030. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9031. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9032. 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 = {
  9033. init: function(e, t, i, n) {
  9034. function r(e) {
  9035. e.preventDefault(),
  9036. o(e.currentTarget.id)
  9037. }
  9038. function o(i) {
  9039. F[i](),
  9040. Object.keys(F).map(function(e, t) {
  9041. $("#" + e).toggleClass("tabs-underlined", e === i)
  9042. })
  9043. }
  9044. p = i,
  9045. u = t,
  9046. y.init(m.Android, e, n),
  9047. h(),
  9048. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9049. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9050. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9051. w.filter(".device-headset-side").attr("src", R),
  9052. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9053. $("#vr").on("click", function(e) {
  9054. e.preventDefault(),
  9055. c("click_webvr_button"),
  9056. E.is(":hidden") && (N.emit(A.OPENED),
  9057. I.fadeOut(g.guiAnimationSpeed),
  9058. E.fadeIn(g.guiAnimationSpeed),
  9059. function() {
  9060. if (!d) {
  9061. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9062. d = new Promise(function(e, t) {
  9063. var i = document.createElement("script");
  9064. i.type = "text/javascript",
  9065. i.src = n,
  9066. i.onload = e,
  9067. document.head.appendChild(i)
  9068. }
  9069. )
  9070. }
  9071. _.find(".enter-button").on("click", a)
  9072. }())
  9073. }),
  9074. $(".webvr-popup .close").on("click", function(e) {
  9075. e.preventDefault(),
  9076. _.hasClass("hidden") ? (c("webvr_help_close"),
  9077. l()) : s()
  9078. }),
  9079. $("#tabcardboard").on("click", r),
  9080. $("#tabdaydream").on("click", r),
  9081. $("#tabnative").on("click", r),
  9082. $(".webvr-popup .open-with-app").on("click", function(e) {
  9083. e.preventDefault(),
  9084. c("webvr_learn_more"),
  9085. o("tabnative"),
  9086. l()
  9087. }),
  9088. $(".webvr-popup .help").on("click", function(e) {
  9089. e.preventDefault(),
  9090. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9091. l()
  9092. }),
  9093. $(".webvr-popup .terms").on("click", function(e) {
  9094. e.preventDefault(),
  9095. c("webvr_click_terms"),
  9096. s(),
  9097. N.emit(A.SHOW_TERMS)
  9098. }),
  9099. T.on("click", function(e) {
  9100. e.preventDefault(),
  9101. c(D),
  9102. window.open(L, "_blank")
  9103. }),
  9104. x.on("click", function(e) {
  9105. e.preventDefault(),
  9106. c("webvr_phone_link"),
  9107. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9108. }),
  9109. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9110. e.preventDefault(),
  9111. c("webvr_cardboard_link"),
  9112. y.launch(v.CardboardAndroid)
  9113. }),
  9114. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9115. e.preventDefault(),
  9116. c("webvr_oculus_link"),
  9117. y.launch(v.GearVR)
  9118. })
  9119. }
  9120. }, F = {
  9121. tabcardboard: function() {
  9122. w.filter(".device-headset").attr("src", R),
  9123. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9124. L = "https://vr.google.com/cardboard/get-cardboard/",
  9125. D = "webvr_cardboard_link",
  9126. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9127. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9128. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9129. t()
  9130. },
  9131. tabdaydream: function() {
  9132. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9133. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9134. L = P,
  9135. D = O,
  9136. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9137. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9138. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9139. t()
  9140. },
  9141. tabnative: function() {
  9142. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9143. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9144. M.toggleClass("hidden", !1),
  9145. S.toggleClass("hidden", !0)
  9146. }
  9147. };
  9148. n.extendObject(N, o.prototype),
  9149. $(window).resize(h),
  9150. V.exports = N
  9151. }
  9152. ).call(this, "/js/gui/webvr/webVRgui.js")
  9153. }
  9154. , {
  9155. "../../analytics": 4,
  9156. "../../constants": 8,
  9157. "../../enum/VRApps": 46,
  9158. "../../enum/VRPlatforms": 49,
  9159. "../../localization/localize": 108,
  9160. "../../settings": 166,
  9161. "../../util/browser": 182,
  9162. "../../util/common": 185,
  9163. "../../util/logger": 189,
  9164. "./../gui": 65,
  9165. "./../vr/vrLink": 86,
  9166. "./WebVrEvent": 88,
  9167. events: 202
  9168. }],
  9169. 90: [function(e, t, i) {
  9170. "use strict";
  9171. function n(e, t, i, n, r) {
  9172. this.floorId = n || 0 === n ? n : -1,
  9173. this.roomId = r || "",
  9174. this.labelId = e,
  9175. this.position = (new o.Vector3).copy(t),
  9176. this.text = i
  9177. }
  9178. var o = e("three")
  9179. , r = e("../util/browser");
  9180. n.prototype.build = function() {
  9181. var e = window.document.createElement("div");
  9182. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9183. var t = window.document.createElement("div");
  9184. t.setAttribute("class", "gui-floorplan-label-text");
  9185. var i = window.document.createTextNode(this.text);
  9186. t.appendChild(i),
  9187. e.appendChild(t),
  9188. window.document.body.appendChild(e),
  9189. this.labelGui = e,
  9190. this.textBlock = t,
  9191. $(this.labelGui).hide();
  9192. var n = window.getComputedStyle(this.labelGui);
  9193. this.initialTransform = n.transform || n.webkitTransform
  9194. }
  9195. ,
  9196. t.exports = n
  9197. }
  9198. , {
  9199. "../util/browser": 182,
  9200. three: 217
  9201. }],
  9202. 91: [function(e, t, i) {
  9203. "use strict";
  9204. function n() {
  9205. this.player = null,
  9206. this.modelManager = null,
  9207. this.container = null
  9208. }
  9209. var c, o, r = e("three"), a = (e("../util/common"),
  9210. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9211. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9212. e("../util/transitions"),
  9213. e("../util/lerp"),
  9214. e("../util/browser"));
  9215. n.prototype.init = function(e, t, i) {
  9216. this.player = e,
  9217. this.modelManager = t,
  9218. this.container = i,
  9219. this.updateModel(),
  9220. this.bindEvents()
  9221. }
  9222. ,
  9223. n.prototype.bindEvents = function() {
  9224. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9225. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9226. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9227. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9228. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9229. }
  9230. ,
  9231. n.prototype.updateModel = function() {
  9232. this.model = this.modelManager.getActiveModel()
  9233. }
  9234. ,
  9235. n.prototype.handlePlayerViewChanged = function() {
  9236. this.updateLabelVisibility(),
  9237. this.updateLabelDisplay()
  9238. }
  9239. ,
  9240. n.prototype.getLabelsForFloor = function(t, i) {
  9241. return (i = i || []).length = 0,
  9242. this.model.labels.forEach(function(e) {
  9243. this.labelVisibleForFloor(e, t) && i.push(e)
  9244. }
  9245. .bind(this)),
  9246. i
  9247. }
  9248. ,
  9249. n.prototype.getLabelsForCurrentFloor = function(e) {
  9250. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9251. }
  9252. ,
  9253. n.prototype.labelVisibleForFloor = function(e, t) {
  9254. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9255. if (!this.model.showingLabels || !e.labelGui || !i)
  9256. return !1;
  9257. var n = e.floorId === this.model.floors.size() - 1;
  9258. return this.model.allFloorsVisible ? n : e.floorId === t
  9259. }
  9260. ,
  9261. n.prototype.updateLabelVisibility = function(e) {
  9262. this.model.labels.forEach(function(e) {
  9263. 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)
  9264. }
  9265. .bind(this))
  9266. }
  9267. ,
  9268. n.prototype.showAllLabels = function(t, i) {
  9269. this.model.labels.forEach(function(e) {
  9270. this.showLabel(e, t, i)
  9271. }
  9272. .bind(this))
  9273. }
  9274. ,
  9275. n.prototype.hideAllLabels = function(t, i) {
  9276. this.model.labels.forEach(function(e) {
  9277. this.hideLabel(e, t, i)
  9278. }
  9279. .bind(this))
  9280. }
  9281. ,
  9282. n.prototype.showLabel = function(e, t, i) {
  9283. this.model.showingLabels && (e.visible || (e.visible = !0,
  9284. e.labelGui.style.display = "block",
  9285. e.labelGui.style.opacity = 0,
  9286. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9287. }
  9288. ,
  9289. n.prototype.hideLabel = function(e, t, i) {
  9290. e.visible && (e.visible = !1,
  9291. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9292. }
  9293. ,
  9294. n.prototype.supportedMode = function() {
  9295. return this.player.mode === h.FLOORPLAN
  9296. }
  9297. ,
  9298. n.prototype.updateLabelDisplay = (new r.Vector3,
  9299. new r.Vector3,
  9300. o = [],
  9301. function() {
  9302. var e = this.player.getLabelScaleFactor()
  9303. , t = 1.2 * (1 - e) + .6
  9304. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9305. this.getLabelsForCurrentFloor(o);
  9306. for (var n = 0; n < o.length; n++) {
  9307. var r = o[n];
  9308. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9309. 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)
  9310. }
  9311. }
  9312. ),
  9313. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9314. new r.Vector3,
  9315. function(e, t, i, n, r) {
  9316. t.style.fontSize = 100 * r + "%";
  9317. var o = .5 * $("#player").width()
  9318. , a = .5 * $("#player").height();
  9319. c.copy(i),
  9320. c.project(this.player.camera);
  9321. var s = c.x * o + o
  9322. , l = -c.y * a + a;
  9323. s -= e.offsetWidth / 2,
  9324. l -= e.offsetHeight / 2,
  9325. e.style.left = s + "px",
  9326. e.style.top = l + "px"
  9327. }
  9328. ),
  9329. n.prototype.handleStartInside = function(e) {
  9330. this.updateLabelVisibility()
  9331. }
  9332. ,
  9333. n.prototype.handleStartOutside = function() {
  9334. this.updateLabelVisibility()
  9335. }
  9336. ,
  9337. t.exports = n
  9338. }
  9339. , {
  9340. "../enum/DirectorEvents": 23,
  9341. "../enum/ModelManagerEvents": 33,
  9342. "../enum/PlayerEvents": 40,
  9343. "../enum/Viewmode": 51,
  9344. "../enum/WarpStyle": 52,
  9345. "../settings": 166,
  9346. "../util/browser": 182,
  9347. "../util/common": 185,
  9348. "../util/lerp": 188,
  9349. "../util/transitions": 195,
  9350. three: 217
  9351. }],
  9352. 92: [function(e, t, i) {
  9353. "use strict";
  9354. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9355. if (null == this)
  9356. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9357. if ("function" != typeof e)
  9358. throw new TypeError("predicate must be a function");
  9359. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9360. if (t = i[o],
  9361. e.call(r, t, o, i))
  9362. return o;
  9363. return -1
  9364. }
  9365. ),
  9366. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9367. value: function(e) {
  9368. if (null == this)
  9369. throw new TypeError('"this" is null or not defined');
  9370. var t = Object(this)
  9371. , i = t.length >>> 0;
  9372. if ("function" != typeof e)
  9373. throw new TypeError("predicate must be a function");
  9374. for (var n = arguments[1], r = 0; r < i; ) {
  9375. var o = t[r];
  9376. if (e.call(n, o, r, t))
  9377. return o;
  9378. r++
  9379. }
  9380. }
  9381. })
  9382. }
  9383. , {}],
  9384. 93: [function(e, t, i) {
  9385. "use strict";
  9386. 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 || {};
  9387. function te() {
  9388. this.backgroundElement = document.createElement("div"),
  9389. r.extend(this.backgroundElement.style, {
  9390. backgroundColor: "rgba(0,0,0,0.8)",
  9391. top: 0,
  9392. left: 0,
  9393. display: "none",
  9394. zIndex: "1000",
  9395. opacity: 0,
  9396. WebkitTransition: "opacity 0.2s linear"
  9397. }),
  9398. n.makeFullscreen(this.backgroundElement),
  9399. this.backgroundElement.style.position = "fixed",
  9400. this.domElement = document.createElement("div"),
  9401. r.extend(this.domElement.style, {
  9402. position: "fixed",
  9403. display: "none",
  9404. zIndex: "1001",
  9405. opacity: 0,
  9406. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9407. }),
  9408. document.body.appendChild(this.backgroundElement),
  9409. document.body.appendChild(this.domElement);
  9410. var e = this;
  9411. n.bind(this.backgroundElement, "click", function() {
  9412. e.hide()
  9413. })
  9414. }
  9415. function ie(e, t, i) {
  9416. Object.defineProperty(e, t, {
  9417. get: function() {
  9418. return "RGB" === this.__state.space || re(this, t, i),
  9419. this.__state[t]
  9420. },
  9421. set: function(e) {
  9422. "RGB" !== this.__state.space && (re(this, t, i),
  9423. this.__state.space = "RGB"),
  9424. this.__state[t] = e
  9425. }
  9426. })
  9427. }
  9428. function ne(e, t) {
  9429. Object.defineProperty(e, t, {
  9430. get: function() {
  9431. return "HSV" === this.__state.space || oe(this),
  9432. this.__state[t]
  9433. },
  9434. set: function(e) {
  9435. "HSV" !== this.__state.space && (oe(this),
  9436. this.__state.space = "HSV"),
  9437. this.__state[t] = e
  9438. }
  9439. })
  9440. }
  9441. function re(e, t, i) {
  9442. if ("HEX" === e.__state.space)
  9443. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9444. else {
  9445. if ("HSV" !== e.__state.space)
  9446. throw "Corrupted color state";
  9447. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9448. }
  9449. }
  9450. function oe(e) {
  9451. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9452. l.extend(e.__state, {
  9453. s: t.s,
  9454. v: t.v
  9455. }),
  9456. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9457. }
  9458. function ae() {
  9459. if (this.__state = o.apply(this, arguments),
  9460. !1 === this.__state)
  9461. throw "Failed to interpret color arguments";
  9462. this.__state.a = this.__state.a || 1
  9463. }
  9464. function se(e) {
  9465. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9466. }
  9467. function le(e, t) {
  9468. this.initialValue = e[t],
  9469. this.domElement = document.createElement("div"),
  9470. this.object = e,
  9471. this.property = t,
  9472. this.__onChange = void 0,
  9473. this.__onFinishChange = void 0
  9474. }
  9475. (t.exports = ee).gui = ee.gui || {},
  9476. ee.utils = ee.utils || {},
  9477. ee.controllers = ee.controllers || {},
  9478. ee.dom = ee.dom || {},
  9479. ee.color = ee.color || {},
  9480. ee.utils.css = {
  9481. load: function(e, t) {
  9482. var i = (t = t || document).createElement("link");
  9483. i.type = "text/css",
  9484. i.rel = "stylesheet",
  9485. i.href = e,
  9486. t.getElementsByTagName("head")[0].appendChild(i)
  9487. },
  9488. inject: function(e, t) {
  9489. t = t || document;
  9490. var i = document.createElement("style");
  9491. i.type = "text/css",
  9492. i.innerHTML = e,
  9493. t.getElementsByTagName("head")[0].appendChild(i)
  9494. }
  9495. },
  9496. ee.utils.common = (Q = Array.prototype.forEach,
  9497. J = Array.prototype.slice,
  9498. {
  9499. BREAK: {},
  9500. extend: function(i) {
  9501. return this.each(J.call(arguments, 1), function(e) {
  9502. for (var t in e)
  9503. this.isUndefined(e[t]) || (i[t] = e[t])
  9504. }, this),
  9505. i
  9506. },
  9507. defaults: function(i) {
  9508. return this.each(J.call(arguments, 1), function(e) {
  9509. for (var t in e)
  9510. this.isUndefined(i[t]) && (i[t] = e[t])
  9511. }, this),
  9512. i
  9513. },
  9514. compose: function() {
  9515. var i = J.call(arguments);
  9516. return function() {
  9517. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9518. e = [i[t].apply(this, e)];
  9519. return e[0]
  9520. }
  9521. },
  9522. each: function(e, t, i) {
  9523. if (e)
  9524. if (Q && e.forEach && e.forEach === Q)
  9525. e.forEach(t, i);
  9526. else if (e.length === e.length + 0) {
  9527. for (var n = 0, r = e.length; n < r; n++)
  9528. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9529. return
  9530. } else
  9531. for (var n in e)
  9532. if (t.call(i, e[n], n) === this.BREAK)
  9533. return
  9534. },
  9535. defer: function(e) {
  9536. setTimeout(e, 0)
  9537. },
  9538. toArray: function(e) {
  9539. return e.toArray ? e.toArray() : J.call(e)
  9540. },
  9541. isUndefined: function(e) {
  9542. return void 0 === e
  9543. },
  9544. isNull: function(e) {
  9545. return null === e
  9546. },
  9547. isNaN: function(e) {
  9548. return e != e
  9549. },
  9550. isArray: Array.isArray || function(e) {
  9551. return e.constructor === Array
  9552. }
  9553. ,
  9554. isObject: function(e) {
  9555. return e === Object(e)
  9556. },
  9557. isNumber: function(e) {
  9558. return e === e + 0
  9559. },
  9560. isString: function(e) {
  9561. return e === e + ""
  9562. },
  9563. isBoolean: function(e) {
  9564. return !1 === e || !0 === e
  9565. },
  9566. isFunction: function(e) {
  9567. return "[object Function]" === Object.prototype.toString.call(e)
  9568. }
  9569. }),
  9570. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9571. onChange: function(e) {
  9572. return this.__onChange = e,
  9573. this
  9574. },
  9575. onFinishChange: function(e) {
  9576. return this.__onFinishChange = e,
  9577. this
  9578. },
  9579. setValue: function(e) {
  9580. return this.object[this.property] = e,
  9581. this.__onChange && this.__onChange.call(this, e),
  9582. this.updateDisplay(),
  9583. this
  9584. },
  9585. getValue: function() {
  9586. return this.object[this.property]
  9587. },
  9588. updateDisplay: function() {
  9589. return this
  9590. },
  9591. isModified: function() {
  9592. return this.initialValue !== this.getValue()
  9593. }
  9594. }),
  9595. le),
  9596. ee.dom.dom = function(c) {
  9597. function i(e) {
  9598. if ("0" === e || c.isUndefined(e))
  9599. return 0;
  9600. var t = e.match(n);
  9601. return c.isNull(t) ? 0 : parseFloat(t[1])
  9602. }
  9603. var h = {};
  9604. c.each({
  9605. HTMLEvents: ["change"],
  9606. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9607. KeyboardEvents: ["keydown"]
  9608. }, function(e, t) {
  9609. c.each(e, function(e) {
  9610. h[e] = t
  9611. })
  9612. });
  9613. var n = /(\d+(\.\d+)?)px/
  9614. , r = {
  9615. makeSelectable: function(e, t) {
  9616. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9617. return !1
  9618. }
  9619. : function() {}
  9620. ,
  9621. e.style.MozUserSelect = t ? "auto" : "none",
  9622. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9623. e.unselectable = t ? "on" : "off")
  9624. },
  9625. makeFullscreen: function(e, t, i) {
  9626. c.isUndefined(t) && (t = !0),
  9627. c.isUndefined(i) && (i = !0),
  9628. e.style.position = "absolute",
  9629. t && (e.style.left = 0,
  9630. e.style.right = 0),
  9631. i && (e.style.top = 0,
  9632. e.style.bottom = 0)
  9633. },
  9634. fakeEvent: function(e, t, i, n) {
  9635. i = i || {};
  9636. var r = h[t];
  9637. if (!r)
  9638. throw new Error("Event type " + t + " not supported.");
  9639. var o = document.createEvent(r);
  9640. switch (r) {
  9641. case "MouseEvents":
  9642. var a = i.x || i.clientX || 0
  9643. , s = i.y || i.clientY || 0;
  9644. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9645. break;
  9646. case "KeyboardEvents":
  9647. var l = o.initKeyboardEvent || o.initKeyEvent;
  9648. c.defaults(i, {
  9649. cancelable: !0,
  9650. ctrlKey: !1,
  9651. altKey: !1,
  9652. shiftKey: !1,
  9653. metaKey: !1,
  9654. keyCode: void 0,
  9655. charCode: void 0
  9656. }),
  9657. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9658. break;
  9659. default:
  9660. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9661. }
  9662. c.defaults(o, n),
  9663. e.dispatchEvent(o)
  9664. },
  9665. bind: function(e, t, i, n) {
  9666. return n = n || !1,
  9667. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9668. r
  9669. },
  9670. unbind: function(e, t, i, n) {
  9671. return n = n || !1,
  9672. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9673. r
  9674. },
  9675. addClass: function(e, t) {
  9676. if (void 0 === e.className)
  9677. e.className = t;
  9678. else if (e.className !== t) {
  9679. var i = e.className.split(/ +/);
  9680. -1 == i.indexOf(t) && (i.push(t),
  9681. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9682. }
  9683. return r
  9684. },
  9685. removeClass: function(e, t) {
  9686. if (t)
  9687. if (void 0 === e.className)
  9688. ;
  9689. else if (e.className === t)
  9690. e.removeAttribute("class");
  9691. else {
  9692. var i = e.className.split(/ +/)
  9693. , n = i.indexOf(t);
  9694. -1 != n && (i.splice(n, 1),
  9695. e.className = i.join(" "))
  9696. }
  9697. else
  9698. e.className = void 0;
  9699. return r
  9700. },
  9701. hasClass: function(e, t) {
  9702. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9703. },
  9704. getWidth: function(e) {
  9705. var t = getComputedStyle(e);
  9706. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9707. },
  9708. getHeight: function(e) {
  9709. var t = getComputedStyle(e);
  9710. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9711. },
  9712. getOffset: function(e) {
  9713. var t = {
  9714. left: 0,
  9715. top: 0
  9716. };
  9717. if (e.offsetParent)
  9718. for (; t.left += e.offsetLeft,
  9719. t.top += e.offsetTop,
  9720. e = e.offsetParent; )
  9721. ;
  9722. return t
  9723. },
  9724. isActive: function(e) {
  9725. return e === document.activeElement && (e.type || e.href)
  9726. }
  9727. };
  9728. return r
  9729. }(ee.utils.common),
  9730. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9731. X = ee.dom.dom,
  9732. Z = ee.utils.common,
  9733. (K = function(e, t, i) {
  9734. K.superclass.call(this, e, t);
  9735. var n = this;
  9736. if (this.__select = document.createElement("select"),
  9737. Z.isArray(i)) {
  9738. var r = {};
  9739. Z.each(i, function(e) {
  9740. r[e] = e
  9741. }),
  9742. i = r
  9743. }
  9744. Z.each(i, function(e, t) {
  9745. var i = document.createElement("option");
  9746. i.innerHTML = t,
  9747. i.setAttribute("value", e),
  9748. n.__select.appendChild(i)
  9749. }),
  9750. this.updateDisplay(),
  9751. X.bind(this.__select, "change", function() {
  9752. var e = this.options[this.selectedIndex].value;
  9753. n.setValue(e)
  9754. }),
  9755. this.domElement.appendChild(this.__select)
  9756. }
  9757. ).superclass = q,
  9758. Z.extend(K.prototype, q.prototype, {
  9759. setValue: function(e) {
  9760. var t = K.superclass.prototype.setValue.call(this, e);
  9761. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9762. t
  9763. },
  9764. updateDisplay: function() {
  9765. return this.__select.value = this.getValue(),
  9766. K.superclass.prototype.updateDisplay.call(this)
  9767. }
  9768. }),
  9769. K),
  9770. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9771. j = ee.utils.common,
  9772. (Y = function(e, t, i) {
  9773. Y.superclass.call(this, e, t),
  9774. i = i || {},
  9775. this.__min = i.min,
  9776. this.__max = i.max,
  9777. this.__step = i.step,
  9778. 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,
  9779. this.__precision = se(this.__impliedStep)
  9780. }
  9781. ).superclass = W,
  9782. j.extend(Y.prototype, W.prototype, {
  9783. setValue: function(e) {
  9784. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9785. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9786. Y.superclass.prototype.setValue.call(this, e)
  9787. },
  9788. min: function(e) {
  9789. return this.__min = e,
  9790. this
  9791. },
  9792. max: function(e) {
  9793. return this.__max = e,
  9794. this
  9795. },
  9796. step: function(e) {
  9797. return this.__step = e,
  9798. this.__impliedStep = e,
  9799. this.__precision = se(e),
  9800. this
  9801. }
  9802. }),
  9803. Y),
  9804. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9805. H = ee.dom.dom,
  9806. z = ee.utils.common,
  9807. (G = function(e, t, i) {
  9808. function n() {
  9809. var e = parseFloat(s.__input.value);
  9810. z.isNaN(e) || s.setValue(e)
  9811. }
  9812. function r(e) {
  9813. var t = a - e.clientY;
  9814. s.setValue(s.getValue() + t * s.__impliedStep),
  9815. a = e.clientY
  9816. }
  9817. function o() {
  9818. H.unbind(window, "mousemove", r),
  9819. H.unbind(window, "mouseup", o)
  9820. }
  9821. this.__truncationSuspended = !1,
  9822. G.superclass.call(this, e, t, i);
  9823. var a, s = this;
  9824. this.__input = document.createElement("input"),
  9825. this.__input.setAttribute("type", "text"),
  9826. H.bind(this.__input, "change", n),
  9827. H.bind(this.__input, "blur", function() {
  9828. n(),
  9829. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9830. }),
  9831. H.bind(this.__input, "mousedown", function(e) {
  9832. H.bind(window, "mousemove", r),
  9833. H.bind(window, "mouseup", o),
  9834. a = e.clientY
  9835. }),
  9836. H.bind(this.__input, "keydown", function(e) {
  9837. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9838. this.blur(),
  9839. s.__truncationSuspended = !1)
  9840. }),
  9841. this.updateDisplay(),
  9842. this.domElement.appendChild(this.__input)
  9843. }
  9844. ).superclass = U,
  9845. z.extend(G.prototype, U.prototype, {
  9846. updateDisplay: function() {
  9847. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9848. var i = Math.pow(10, t);
  9849. return Math.round(e * i) / i
  9850. }(this.getValue(), this.__precision),
  9851. G.superclass.prototype.updateDisplay.call(this)
  9852. }
  9853. }),
  9854. G),
  9855. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9856. F = ee.dom.dom,
  9857. B = ee.utils.css,
  9858. V = ee.utils.common,
  9859. (k = function(e, t, i, n, r) {
  9860. function o(e) {
  9861. e.preventDefault();
  9862. var t = F.getOffset(s.__background)
  9863. , i = F.getWidth(s.__background);
  9864. return s.setValue(function(e, t, i, n, r) {
  9865. return n + (e - t) / (i - t) * (r - n)
  9866. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9867. !1
  9868. }
  9869. function a() {
  9870. F.unbind(window, "mousemove", o),
  9871. F.unbind(window, "mouseup", a),
  9872. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9873. }
  9874. k.superclass.call(this, e, t, {
  9875. min: i,
  9876. max: n,
  9877. step: r
  9878. });
  9879. var s = this;
  9880. this.__background = document.createElement("div"),
  9881. this.__foreground = document.createElement("div"),
  9882. F.bind(this.__background, "mousedown", function(e) {
  9883. F.bind(window, "mousemove", o),
  9884. F.bind(window, "mouseup", a),
  9885. o(e)
  9886. }),
  9887. F.addClass(this.__background, "slider"),
  9888. F.addClass(this.__foreground, "slider-fg"),
  9889. this.updateDisplay(),
  9890. this.__background.appendChild(this.__foreground),
  9891. this.domElement.appendChild(this.__background)
  9892. }
  9893. ).superclass = N,
  9894. k.useDefaultStyles = function() {
  9895. 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}")
  9896. }
  9897. ,
  9898. V.extend(k.prototype, N.prototype, {
  9899. updateDisplay: function() {
  9900. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9901. return this.__foreground.style.width = 100 * e + "%",
  9902. k.superclass.prototype.updateDisplay.call(this)
  9903. }
  9904. }),
  9905. k),
  9906. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9907. O = ee.dom.dom,
  9908. L = ee.utils.common,
  9909. (D = function(e, t, i) {
  9910. D.superclass.call(this, e, t);
  9911. var n = this;
  9912. this.__button = document.createElement("div"),
  9913. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9914. O.bind(this.__button, "click", function(e) {
  9915. return e.preventDefault(),
  9916. n.fire(),
  9917. !1
  9918. }),
  9919. O.addClass(this.__button, "button"),
  9920. this.domElement.appendChild(this.__button)
  9921. }
  9922. ).superclass = P,
  9923. L.extend(D.prototype, P.prototype, {
  9924. fire: function() {
  9925. this.__onChange && this.__onChange.call(this),
  9926. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9927. this.getValue().call(this.object)
  9928. }
  9929. }),
  9930. D),
  9931. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9932. S = ee.dom.dom,
  9933. M = ee.utils.common,
  9934. (R = function(e, t) {
  9935. R.superclass.call(this, e, t);
  9936. var i = this;
  9937. this.__prev = this.getValue(),
  9938. this.__checkbox = document.createElement("input"),
  9939. this.__checkbox.setAttribute("type", "checkbox"),
  9940. S.bind(this.__checkbox, "change", function() {
  9941. i.setValue(!i.__prev)
  9942. }, !1),
  9943. this.domElement.appendChild(this.__checkbox),
  9944. this.updateDisplay()
  9945. }
  9946. ).superclass = x,
  9947. M.extend(R.prototype, x.prototype, {
  9948. setValue: function(e) {
  9949. var t = R.superclass.prototype.setValue.call(this, e);
  9950. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9951. this.__prev = this.getValue(),
  9952. t
  9953. },
  9954. updateDisplay: function() {
  9955. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9956. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9957. R.superclass.prototype.updateDisplay.call(this)
  9958. }
  9959. }),
  9960. R),
  9961. ee.color.toString = (T = ee.utils.common,
  9962. function(e) {
  9963. if (1 == e.a || T.isUndefined(e.a)) {
  9964. for (var t = e.hex.toString(16); t.length < 6; )
  9965. t = "0" + t;
  9966. return "#" + t
  9967. }
  9968. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9969. }
  9970. ),
  9971. ee.color.interpret = (I = ee.color.toString,
  9972. E = ee.utils.common,
  9973. w = [{
  9974. litmus: E.isString,
  9975. conversions: {
  9976. THREE_CHAR_HEX: {
  9977. read: function(e) {
  9978. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9979. return null !== t && {
  9980. space: "HEX",
  9981. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9982. }
  9983. },
  9984. write: I
  9985. },
  9986. SIX_CHAR_HEX: {
  9987. read: function(e) {
  9988. var t = e.match(/^#([A-F0-9]{6})$/i);
  9989. return null !== t && {
  9990. space: "HEX",
  9991. hex: parseInt("0x" + t[1].toString())
  9992. }
  9993. },
  9994. write: I
  9995. },
  9996. CSS_RGB: {
  9997. read: function(e) {
  9998. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9999. return null !== t && {
  10000. space: "RGB",
  10001. r: parseFloat(t[1]),
  10002. g: parseFloat(t[2]),
  10003. b: parseFloat(t[3])
  10004. }
  10005. },
  10006. write: I
  10007. },
  10008. CSS_RGBA: {
  10009. read: function(e) {
  10010. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10011. return null !== t && {
  10012. space: "RGB",
  10013. r: parseFloat(t[1]),
  10014. g: parseFloat(t[2]),
  10015. b: parseFloat(t[3]),
  10016. a: parseFloat(t[4])
  10017. }
  10018. },
  10019. write: I
  10020. }
  10021. }
  10022. }, {
  10023. litmus: E.isNumber,
  10024. conversions: {
  10025. HEX: {
  10026. read: function(e) {
  10027. return {
  10028. space: "HEX",
  10029. hex: e,
  10030. conversionName: "HEX"
  10031. }
  10032. },
  10033. write: function(e) {
  10034. return e.hex
  10035. }
  10036. }
  10037. }
  10038. }, {
  10039. litmus: E.isArray,
  10040. conversions: {
  10041. RGB_ARRAY: {
  10042. read: function(e) {
  10043. return 3 == e.length && {
  10044. space: "RGB",
  10045. r: e[0],
  10046. g: e[1],
  10047. b: e[2]
  10048. }
  10049. },
  10050. write: function(e) {
  10051. return [e.r, e.g, e.b]
  10052. }
  10053. },
  10054. RGBA_ARRAY: {
  10055. read: function(e) {
  10056. return 4 == e.length && {
  10057. space: "RGB",
  10058. r: e[0],
  10059. g: e[1],
  10060. b: e[2],
  10061. a: e[3]
  10062. }
  10063. },
  10064. write: function(e) {
  10065. return [e.r, e.g, e.b, e.a]
  10066. }
  10067. }
  10068. }
  10069. }, {
  10070. litmus: E.isObject,
  10071. conversions: {
  10072. RGBA_OBJ: {
  10073. read: function(e) {
  10074. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10075. space: "RGB",
  10076. r: e.r,
  10077. g: e.g,
  10078. b: e.b,
  10079. a: e.a
  10080. }
  10081. },
  10082. write: function(e) {
  10083. return {
  10084. r: e.r,
  10085. g: e.g,
  10086. b: e.b,
  10087. a: e.a
  10088. }
  10089. }
  10090. },
  10091. RGB_OBJ: {
  10092. read: function(e) {
  10093. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10094. space: "RGB",
  10095. r: e.r,
  10096. g: e.g,
  10097. b: e.b
  10098. }
  10099. },
  10100. write: function(e) {
  10101. return {
  10102. r: e.r,
  10103. g: e.g,
  10104. b: e.b
  10105. }
  10106. }
  10107. },
  10108. HSVA_OBJ: {
  10109. read: function(e) {
  10110. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10111. space: "HSV",
  10112. h: e.h,
  10113. s: e.s,
  10114. v: e.v,
  10115. a: e.a
  10116. }
  10117. },
  10118. write: function(e) {
  10119. return {
  10120. h: e.h,
  10121. s: e.s,
  10122. v: e.v,
  10123. a: e.a
  10124. }
  10125. }
  10126. },
  10127. HSV_OBJ: {
  10128. read: function(e) {
  10129. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10130. space: "HSV",
  10131. h: e.h,
  10132. s: e.s,
  10133. v: e.v
  10134. }
  10135. },
  10136. write: function(e) {
  10137. return {
  10138. h: e.h,
  10139. s: e.s,
  10140. v: e.v
  10141. }
  10142. }
  10143. }
  10144. }
  10145. }],
  10146. function() {
  10147. b = !1;
  10148. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10149. return E.each(w, function(e) {
  10150. if (e.litmus(i))
  10151. return E.each(e.conversions, function(e, t) {
  10152. if (_ = e.read(i),
  10153. !1 === b && !1 !== _)
  10154. return (b = _).conversionName = t,
  10155. _.conversion = e,
  10156. E.BREAK
  10157. }),
  10158. E.BREAK
  10159. }),
  10160. b
  10161. }
  10162. ),
  10163. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10164. function y(e, t, i, n) {
  10165. if (void 0 === t[i])
  10166. throw new Error("Object " + t + ' has no property "' + i + '"');
  10167. var r;
  10168. if (n.color)
  10169. r = new g(t,i);
  10170. else {
  10171. var o = [t, i].concat(n.factoryArgs);
  10172. r = c.apply(e, o)
  10173. }
  10174. n.before instanceof h && (n.before = n.before.__li),
  10175. C(e, r),
  10176. m.addClass(r.domElement, "c");
  10177. var a = document.createElement("span");
  10178. m.addClass(a, "property-name"),
  10179. a.innerHTML = r.property;
  10180. var s = document.createElement("div");
  10181. s.appendChild(a),
  10182. s.appendChild(r.domElement);
  10183. var l = A(e, s, n.before);
  10184. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10185. m.addClass(l, typeof r.getValue()),
  10186. function(t, i, n) {
  10187. if (n.__li = i,
  10188. n.__gui = t,
  10189. v.extend(n, {
  10190. options: function(e) {
  10191. return 1 < arguments.length ? (n.remove(),
  10192. y(t, n.object, n.property, {
  10193. before: n.__li.nextElementSibling,
  10194. factoryArgs: [v.toArray(arguments)]
  10195. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10196. y(t, n.object, n.property, {
  10197. before: n.__li.nextElementSibling,
  10198. factoryArgs: [e]
  10199. })) : void 0
  10200. },
  10201. name: function(e) {
  10202. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10203. n
  10204. },
  10205. listen: function() {
  10206. return n.__gui.listen(n),
  10207. n
  10208. },
  10209. remove: function() {
  10210. return n.__gui.remove(n),
  10211. n
  10212. }
  10213. }),
  10214. n instanceof f) {
  10215. var r = new p(n.object,n.property,{
  10216. min: n.__min,
  10217. max: n.__max,
  10218. step: n.__step
  10219. });
  10220. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10221. var t = n[e]
  10222. , i = r[e];
  10223. n[e] = r[e] = function() {
  10224. var e = Array.prototype.slice.call(arguments);
  10225. return t.apply(n, e),
  10226. i.apply(r, e)
  10227. }
  10228. }),
  10229. m.addClass(i, "has-slider"),
  10230. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10231. } else if (n instanceof p) {
  10232. var e = function(e) {
  10233. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10234. y(t, n.object, n.property, {
  10235. before: n.__li.nextElementSibling,
  10236. factoryArgs: [n.__min, n.__max, n.__step]
  10237. })) : e
  10238. };
  10239. n.min = v.compose(e, n.min),
  10240. n.max = v.compose(e, n.max)
  10241. } else
  10242. n instanceof u ? (m.bind(i, "click", function() {
  10243. m.fakeEvent(n.__checkbox, "click")
  10244. }),
  10245. m.bind(n.__checkbox, "click", function(e) {
  10246. e.stopPropagation()
  10247. })) : n instanceof d ? (m.bind(i, "click", function() {
  10248. m.fakeEvent(n.__button, "click")
  10249. }),
  10250. m.bind(i, "mouseover", function() {
  10251. m.addClass(n.__button, "hover")
  10252. }),
  10253. m.bind(i, "mouseout", function() {
  10254. m.removeClass(n.__button, "hover")
  10255. })) : n instanceof g && (m.addClass(i, "color"),
  10256. n.updateDisplay = v.compose(function(e) {
  10257. return i.style.borderLeftColor = n.__color.toString(),
  10258. e
  10259. }, n.updateDisplay),
  10260. n.updateDisplay());
  10261. n.setValue = v.compose(function(e) {
  10262. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10263. e
  10264. }, n.setValue)
  10265. }(e, l, r),
  10266. e.__controllers.push(r),
  10267. r
  10268. }
  10269. function A(e, t, i) {
  10270. var n = document.createElement("li");
  10271. return t && n.appendChild(t),
  10272. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10273. e.onResize(),
  10274. n
  10275. }
  10276. function C(e, t) {
  10277. var i = e.getRoot()
  10278. , n = i.__rememberedObjects.indexOf(t.object);
  10279. if (-1 != n) {
  10280. var r = i.__rememberedObjectIndecesToControllers[n];
  10281. if (void 0 === r && (r = {},
  10282. i.__rememberedObjectIndecesToControllers[n] = r),
  10283. r[t.property] = t,
  10284. i.load && i.load.remembered) {
  10285. var o, a = i.load.remembered;
  10286. if (a[e.preset])
  10287. o = a[e.preset];
  10288. else {
  10289. if (!a[T])
  10290. return;
  10291. o = a[T]
  10292. }
  10293. if (o[n] && void 0 !== o[n][t.property]) {
  10294. var s = o[n][t.property];
  10295. t.initialValue = s,
  10296. t.setValue(s)
  10297. }
  10298. }
  10299. }
  10300. }
  10301. function I(e, t) {
  10302. return document.location.href + "." + t
  10303. }
  10304. function l(e, t) {
  10305. e.domElement.style.width = t + "px",
  10306. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10307. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10308. }
  10309. function a(r, o) {
  10310. var a = {};
  10311. return v.each(r.__rememberedObjects, function(e, t) {
  10312. var i = {}
  10313. , n = r.__rememberedObjectIndecesToControllers[t];
  10314. v.each(n, function(e, t) {
  10315. i[t] = o ? e.initialValue : e.getValue()
  10316. }),
  10317. a[t] = i
  10318. }),
  10319. a
  10320. }
  10321. function E(e, t, i) {
  10322. var n = document.createElement("option");
  10323. n.innerHTML = t,
  10324. n.value = t,
  10325. e.__preset_select.appendChild(n),
  10326. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10327. }
  10328. function _(e, t) {
  10329. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10330. i.innerHTML = t ? i.value + "*" : i.value
  10331. }
  10332. 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");
  10333. var b, w, T = "Default", x = function() {
  10334. try {
  10335. return "localStorage"in window && null !== window.localStorage
  10336. } catch (e) {
  10337. return !1
  10338. }
  10339. }(), S = !0, s = !1, M = [], R = function(t) {
  10340. var i = this;
  10341. this.domElement = document.createElement("div"),
  10342. this.__ul = document.createElement("ul"),
  10343. this.domElement.appendChild(this.__ul),
  10344. m.addClass(this.domElement, "dg"),
  10345. this.__folders = {},
  10346. this.__controllers = [],
  10347. this.__rememberedObjects = [],
  10348. this.__rememberedObjectIndecesToControllers = [],
  10349. this.__listening = [],
  10350. t = t || {},
  10351. t = v.defaults(t, {
  10352. autoPlace: !0,
  10353. width: R.DEFAULT_WIDTH
  10354. }),
  10355. t = v.defaults(t, {
  10356. resizable: t.autoPlace,
  10357. hideable: t.autoPlace
  10358. }),
  10359. v.isUndefined(t.load) ? t.load = {
  10360. preset: T
  10361. } : t.preset && (t.load.preset = t.preset),
  10362. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10363. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10364. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10365. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10366. if (Object.defineProperties(this, {
  10367. parent: {
  10368. get: function() {
  10369. return t.parent
  10370. }
  10371. },
  10372. scrollable: {
  10373. get: function() {
  10374. return t.scrollable
  10375. }
  10376. },
  10377. autoPlace: {
  10378. get: function() {
  10379. return t.autoPlace
  10380. }
  10381. },
  10382. preset: {
  10383. get: function() {
  10384. return i.parent ? i.getRoot().preset : t.load.preset
  10385. },
  10386. set: function(e) {
  10387. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10388. function(e) {
  10389. for (var t = 0; t < e.__preset_select.length; t++)
  10390. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10391. }(this),
  10392. i.revert()
  10393. }
  10394. },
  10395. width: {
  10396. get: function() {
  10397. return t.width
  10398. },
  10399. set: function(e) {
  10400. t.width = e,
  10401. l(i, e)
  10402. }
  10403. },
  10404. name: {
  10405. get: function() {
  10406. return t.name
  10407. },
  10408. set: function(e) {
  10409. t.name = e,
  10410. a && (a.innerHTML = t.name)
  10411. }
  10412. },
  10413. closed: {
  10414. get: function() {
  10415. return t.closed
  10416. },
  10417. set: function(e) {
  10418. t.closed = e,
  10419. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10420. this.onResize(),
  10421. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10422. }
  10423. },
  10424. load: {
  10425. get: function() {
  10426. return t.load
  10427. }
  10428. },
  10429. useLocalStorage: {
  10430. get: function() {
  10431. return r
  10432. },
  10433. set: function(e) {
  10434. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10435. localStorage.setItem(I(0, "isLocal"), e))
  10436. }
  10437. }
  10438. }),
  10439. v.isUndefined(t.parent)) {
  10440. if (t.closed = !1,
  10441. m.addClass(this.domElement, R.CLASS_MAIN),
  10442. m.makeSelectable(this.domElement, !1),
  10443. x && r) {
  10444. i.useLocalStorage = !0;
  10445. var o = localStorage.getItem(I(0, "gui"));
  10446. o && (t.load = JSON.parse(o))
  10447. }
  10448. this.__closeButton = document.createElement("div"),
  10449. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10450. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10451. this.domElement.appendChild(this.__closeButton),
  10452. m.bind(this.__closeButton, "click", function() {
  10453. i.closed = !i.closed
  10454. })
  10455. } else {
  10456. void 0 === t.closed && (t.closed = !0);
  10457. var a = document.createTextNode(t.name);
  10458. m.addClass(a, "controller-name");
  10459. var s = A(i, a);
  10460. m.addClass(this.__ul, R.CLASS_CLOSED),
  10461. m.addClass(s, "title"),
  10462. m.bind(s, "click", function(e) {
  10463. return e.preventDefault(),
  10464. i.closed = !i.closed,
  10465. !1
  10466. }),
  10467. t.closed || (this.closed = !1)
  10468. }
  10469. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10470. m.addClass(w, "dg"),
  10471. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10472. document.body.appendChild(w),
  10473. S = !1),
  10474. w.appendChild(this.domElement),
  10475. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10476. this.parent || l(i, t.width)),
  10477. m.bind(window, "resize", function() {
  10478. i.onResize()
  10479. }),
  10480. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10481. i.onResize()
  10482. }),
  10483. m.bind(this.__ul, "transitionend", function() {
  10484. i.onResize()
  10485. }),
  10486. m.bind(this.__ul, "oTransitionEnd", function() {
  10487. i.onResize()
  10488. }),
  10489. this.onResize(),
  10490. t.resizable && function(t) {
  10491. function e(e) {
  10492. return e.preventDefault(),
  10493. r = e.clientX,
  10494. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10495. m.bind(window, "mousemove", i),
  10496. m.bind(window, "mouseup", n),
  10497. !1
  10498. }
  10499. function i(e) {
  10500. return e.preventDefault(),
  10501. t.width += r - e.clientX,
  10502. t.onResize(),
  10503. r = e.clientX,
  10504. !1
  10505. }
  10506. function n() {
  10507. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10508. m.unbind(window, "mousemove", i),
  10509. m.unbind(window, "mouseup", n)
  10510. }
  10511. var r;
  10512. t.__resize_handle = document.createElement("div"),
  10513. v.extend(t.__resize_handle.style, {
  10514. width: "6px",
  10515. marginLeft: "-3px",
  10516. height: "200px",
  10517. cursor: "ew-resize",
  10518. position: "absolute"
  10519. }),
  10520. m.bind(t.__resize_handle, "mousedown", e),
  10521. m.bind(t.__closeButton, "mousedown", e),
  10522. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10523. }(this),
  10524. n = function() {
  10525. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10526. }
  10527. ,
  10528. this.saveToLocalStorageIfPossible = n,
  10529. i.getRoot(),
  10530. t.parent || ((e = i.getRoot()).width += 1,
  10531. v.defer(function() {
  10532. e.width -= 1
  10533. }))
  10534. };
  10535. return R.toggleHide = function() {
  10536. s = !s,
  10537. v.each(M, function(e) {
  10538. e.domElement.style.zIndex = s ? -999 : 999,
  10539. e.domElement.style.opacity = s ? 0 : 1
  10540. })
  10541. }
  10542. ,
  10543. R.CLASS_AUTO_PLACE = "a",
  10544. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10545. R.CLASS_MAIN = "main",
  10546. R.CLASS_CONTROLLER_ROW = "cr",
  10547. R.CLASS_TOO_TALL = "taller-than-window",
  10548. R.CLASS_CLOSED = "closed",
  10549. R.CLASS_CLOSE_BUTTON = "close-button",
  10550. R.CLASS_DRAG = "drag",
  10551. R.DEFAULT_WIDTH = 245,
  10552. R.TEXT_CLOSED = "Close Controls",
  10553. R.TEXT_OPEN = "Open Controls",
  10554. m.bind(window, "keydown", function(e) {
  10555. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10556. }, !1),
  10557. v.extend(R.prototype, {
  10558. add: function(e, t) {
  10559. return y(this, e, t, {
  10560. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10561. })
  10562. },
  10563. addColor: function(e, t) {
  10564. return y(this, e, t, {
  10565. color: !0
  10566. })
  10567. },
  10568. remove: function(e) {
  10569. this.__ul.removeChild(e.__li),
  10570. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10571. var t = this;
  10572. v.defer(function() {
  10573. t.onResize()
  10574. })
  10575. },
  10576. destroy: function() {
  10577. this.autoPlace && w.removeChild(this.domElement)
  10578. },
  10579. addFolder: function(e) {
  10580. if (void 0 !== this.__folders[e])
  10581. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10582. var t = {
  10583. name: e,
  10584. parent: this
  10585. };
  10586. t.autoPlace = this.autoPlace,
  10587. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10588. t.load = this.load.folders[e]);
  10589. var i = new R(t);
  10590. this.__folders[e] = i;
  10591. var n = A(this, i.domElement);
  10592. return m.addClass(n, "folder"),
  10593. i
  10594. },
  10595. open: function() {
  10596. this.closed = !1
  10597. },
  10598. close: function() {
  10599. this.closed = !0
  10600. },
  10601. onResize: function() {
  10602. var t = this.getRoot();
  10603. if (t.scrollable) {
  10604. var e = m.getOffset(t.__ul).top
  10605. , i = 0;
  10606. v.each(t.__ul.childNodes, function(e) {
  10607. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10608. }),
  10609. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10610. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10611. t.__ul.style.height = "auto")
  10612. }
  10613. t.__resize_handle && v.defer(function() {
  10614. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10615. }),
  10616. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10617. },
  10618. remember: function() {
  10619. 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>'),
  10620. this.parent)
  10621. throw new Error("You can only call remember on a top level GUI.");
  10622. var t = this;
  10623. v.each(Array.prototype.slice.call(arguments), function(e) {
  10624. 0 == t.__rememberedObjects.length && function(i) {
  10625. var e = i.__save_row = document.createElement("li");
  10626. m.addClass(i.domElement, "has-save"),
  10627. i.__ul.insertBefore(e, i.__ul.firstChild),
  10628. m.addClass(e, "save-row");
  10629. var t = document.createElement("span");
  10630. t.innerHTML = "&nbsp;",
  10631. m.addClass(t, "button gears");
  10632. var n = document.createElement("span");
  10633. n.innerHTML = "Save",
  10634. m.addClass(n, "button"),
  10635. m.addClass(n, "save");
  10636. var r = document.createElement("span");
  10637. r.innerHTML = "New",
  10638. m.addClass(r, "button"),
  10639. m.addClass(r, "save-as");
  10640. var o = document.createElement("span");
  10641. o.innerHTML = "Revert",
  10642. m.addClass(o, "button"),
  10643. m.addClass(o, "revert");
  10644. var a = i.__preset_select = document.createElement("select");
  10645. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10646. E(i, t, t == i.preset)
  10647. }) : E(i, T, !1),
  10648. m.bind(a, "change", function() {
  10649. for (var e = 0; e < i.__preset_select.length; e++)
  10650. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10651. i.preset = this.value
  10652. }),
  10653. e.appendChild(a),
  10654. e.appendChild(t),
  10655. e.appendChild(n),
  10656. e.appendChild(r),
  10657. e.appendChild(o),
  10658. x) {
  10659. var s = document.getElementById("dg-save-locally")
  10660. , l = document.getElementById("dg-local-explain");
  10661. s.style.display = "block";
  10662. var c = document.getElementById("dg-local-storage");
  10663. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10664. var h = function() {
  10665. l.style.display = i.useLocalStorage ? "block" : "none"
  10666. };
  10667. h(),
  10668. m.bind(c, "change", function() {
  10669. i.useLocalStorage = !i.useLocalStorage,
  10670. h()
  10671. })
  10672. }
  10673. var u = document.getElementById("dg-new-constructor");
  10674. m.bind(u, "keydown", function(e) {
  10675. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10676. }),
  10677. m.bind(t, "click", function() {
  10678. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10679. b.show(),
  10680. u.focus(),
  10681. u.select()
  10682. }),
  10683. m.bind(n, "click", function() {
  10684. i.save()
  10685. }),
  10686. m.bind(r, "click", function() {
  10687. var e = prompt("Enter a new preset name.");
  10688. e && i.saveAs(e)
  10689. }),
  10690. m.bind(o, "click", function() {
  10691. i.revert()
  10692. })
  10693. }(t),
  10694. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10695. }),
  10696. this.autoPlace && l(this, this.width)
  10697. },
  10698. getRoot: function() {
  10699. for (var e = this; e.parent; )
  10700. e = e.parent;
  10701. return e
  10702. },
  10703. getSaveObject: function() {
  10704. var i = this.load;
  10705. return i.closed = this.closed,
  10706. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10707. i.remembered || (i.remembered = {}),
  10708. i.remembered[this.preset] = a(this)),
  10709. i.folders = {},
  10710. v.each(this.__folders, function(e, t) {
  10711. i.folders[t] = e.getSaveObject()
  10712. }),
  10713. i
  10714. },
  10715. save: function() {
  10716. this.load.remembered || (this.load.remembered = {}),
  10717. this.load.remembered[this.preset] = a(this),
  10718. _(this, !1),
  10719. this.saveToLocalStorageIfPossible()
  10720. },
  10721. saveAs: function(e) {
  10722. this.load.remembered || (this.load.remembered = {},
  10723. this.load.remembered[T] = a(this, !0)),
  10724. this.load.remembered[e] = a(this),
  10725. this.preset = e,
  10726. E(this, e, !0),
  10727. this.saveToLocalStorageIfPossible()
  10728. },
  10729. revert: function(t) {
  10730. v.each(this.__controllers, function(e) {
  10731. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10732. }, this),
  10733. v.each(this.__folders, function(e) {
  10734. e.revert(e)
  10735. }),
  10736. t || _(this.getRoot(), !1)
  10737. },
  10738. listen: function(e) {
  10739. var t = 0 == this.__listening.length;
  10740. this.__listening.push(e),
  10741. t && function e(t) {
  10742. 0 != t.length && r(function() {
  10743. e(t)
  10744. }),
  10745. v.each(t, function(e) {
  10746. e.updateDisplay()
  10747. })
  10748. }(this.__listening)
  10749. }
  10750. }),
  10751. R
  10752. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10753. u = ee.controllers.NumberControllerBox,
  10754. d = ee.controllers.NumberControllerSlider,
  10755. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10756. y = ee.dom.dom,
  10757. A = ee.utils.common,
  10758. (C = function(e, t) {
  10759. function i() {
  10760. n.setValue(n.__input.value)
  10761. }
  10762. C.superclass.call(this, e, t);
  10763. var n = this;
  10764. this.__input = document.createElement("input"),
  10765. this.__input.setAttribute("type", "text"),
  10766. y.bind(this.__input, "keyup", i),
  10767. y.bind(this.__input, "change", i),
  10768. y.bind(this.__input, "blur", function() {
  10769. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10770. }),
  10771. y.bind(this.__input, "keydown", function(e) {
  10772. 13 === e.keyCode && this.blur()
  10773. }),
  10774. this.updateDisplay(),
  10775. this.domElement.appendChild(this.__input)
  10776. }
  10777. ).superclass = v,
  10778. A.extend(C.prototype, v.prototype, {
  10779. updateDisplay: function() {
  10780. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10781. C.superclass.prototype.updateDisplay.call(this)
  10782. }
  10783. }),
  10784. C),
  10785. f = ee.controllers.FunctionController,
  10786. g = ee.controllers.BooleanController,
  10787. m = ee.utils.common,
  10788. function(e, t) {
  10789. var i = e[t];
  10790. 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,{
  10791. min: arguments[2],
  10792. max: arguments[3]
  10793. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10794. }
  10795. ), 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) {
  10796. function f(t, i, n, r) {
  10797. t.style.background = "",
  10798. p.each(o, function(e) {
  10799. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10800. })
  10801. }
  10802. var g = function(e, t) {
  10803. function i(e) {
  10804. a(e),
  10805. h.bind(window, "mousemove", a),
  10806. h.bind(window, "mouseup", n)
  10807. }
  10808. function n() {
  10809. h.unbind(window, "mousemove", a),
  10810. h.unbind(window, "mouseup", n)
  10811. }
  10812. function r() {
  10813. var e = d(this.value);
  10814. !1 !== e ? (l.__color.__state = e,
  10815. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10816. }
  10817. function o() {
  10818. h.unbind(window, "mousemove", s),
  10819. h.unbind(window, "mouseup", o)
  10820. }
  10821. function a(e) {
  10822. e.preventDefault();
  10823. var t = h.getWidth(l.__saturation_field)
  10824. , i = h.getOffset(l.__saturation_field)
  10825. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10826. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10827. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10828. 1 < n ? n = 1 : n < 0 && (n = 0),
  10829. l.__color.v = r,
  10830. l.__color.s = n,
  10831. l.setValue(l.__color.toOriginal()),
  10832. !1
  10833. }
  10834. function s(e) {
  10835. e.preventDefault();
  10836. var t = h.getHeight(l.__hue_field)
  10837. , i = h.getOffset(l.__hue_field)
  10838. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10839. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10840. l.__color.h = 360 * n,
  10841. l.setValue(l.__color.toOriginal()),
  10842. !1
  10843. }
  10844. g.superclass.call(this, e, t),
  10845. this.__color = new u(this.getValue()),
  10846. this.__temp = new u(0);
  10847. var l = this;
  10848. this.domElement = document.createElement("div"),
  10849. h.makeSelectable(this.domElement, !1),
  10850. this.__selector = document.createElement("div"),
  10851. this.__selector.className = "selector",
  10852. this.__saturation_field = document.createElement("div"),
  10853. this.__saturation_field.className = "saturation-field",
  10854. this.__field_knob = document.createElement("div"),
  10855. this.__field_knob.className = "field-knob",
  10856. this.__field_knob_border = "2px solid ",
  10857. this.__hue_knob = document.createElement("div"),
  10858. this.__hue_knob.className = "hue-knob",
  10859. this.__hue_field = document.createElement("div"),
  10860. this.__hue_field.className = "hue-field",
  10861. this.__input = document.createElement("input"),
  10862. this.__input.type = "text",
  10863. this.__input_textShadow = "0 1px 1px ",
  10864. h.bind(this.__input, "keydown", function(e) {
  10865. 13 === e.keyCode && r.call(this)
  10866. }),
  10867. h.bind(this.__input, "blur", r),
  10868. h.bind(this.__selector, "mousedown", function(e) {
  10869. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10870. h.removeClass(l.__selector, "drag")
  10871. })
  10872. });
  10873. var c = document.createElement("div");
  10874. p.extend(this.__selector.style, {
  10875. width: "122px",
  10876. height: "102px",
  10877. padding: "3px",
  10878. backgroundColor: "#222",
  10879. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10880. }),
  10881. p.extend(this.__field_knob.style, {
  10882. position: "absolute",
  10883. width: "12px",
  10884. height: "12px",
  10885. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10886. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10887. borderRadius: "12px",
  10888. zIndex: 1
  10889. }),
  10890. p.extend(this.__hue_knob.style, {
  10891. position: "absolute",
  10892. width: "15px",
  10893. height: "2px",
  10894. borderRight: "4px solid #fff",
  10895. zIndex: 1
  10896. }),
  10897. p.extend(this.__saturation_field.style, {
  10898. width: "100px",
  10899. height: "100px",
  10900. border: "1px solid #555",
  10901. marginRight: "3px",
  10902. display: "inline-block",
  10903. cursor: "pointer"
  10904. }),
  10905. p.extend(c.style, {
  10906. width: "100%",
  10907. height: "100%",
  10908. background: "none"
  10909. }),
  10910. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10911. p.extend(this.__hue_field.style, {
  10912. width: "15px",
  10913. height: "100px",
  10914. display: "inline-block",
  10915. border: "1px solid #555",
  10916. cursor: "ns-resize"
  10917. }),
  10918. function(e) {
  10919. e.style.background = "",
  10920. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10921. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10922. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10923. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10924. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10925. }(this.__hue_field),
  10926. p.extend(this.__input.style, {
  10927. outline: "none",
  10928. textAlign: "center",
  10929. color: "#fff",
  10930. border: 0,
  10931. fontWeight: "bold",
  10932. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10933. }),
  10934. h.bind(this.__saturation_field, "mousedown", i),
  10935. h.bind(this.__field_knob, "mousedown", i),
  10936. h.bind(this.__hue_field, "mousedown", function(e) {
  10937. s(e),
  10938. h.bind(window, "mousemove", s),
  10939. h.bind(window, "mouseup", o)
  10940. }),
  10941. this.__saturation_field.appendChild(c),
  10942. this.__selector.appendChild(this.__field_knob),
  10943. this.__selector.appendChild(this.__saturation_field),
  10944. this.__selector.appendChild(this.__hue_field),
  10945. this.__hue_field.appendChild(this.__hue_knob),
  10946. this.domElement.appendChild(this.__input),
  10947. this.domElement.appendChild(this.__selector),
  10948. this.updateDisplay()
  10949. };
  10950. g.superclass = e,
  10951. p.extend(g.prototype, e.prototype, {
  10952. updateDisplay: function() {
  10953. var t = d(this.getValue());
  10954. if (!1 !== t) {
  10955. var i = !1;
  10956. p.each(u.COMPONENTS, function(e) {
  10957. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10958. return i = !0,
  10959. {}
  10960. }, this),
  10961. i && p.extend(this.__color.__state, t)
  10962. }
  10963. p.extend(this.__temp.__state, this.__color.__state),
  10964. this.__temp.a = 1;
  10965. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10966. , n = 255 - e;
  10967. p.extend(this.__field_knob.style, {
  10968. marginLeft: 100 * this.__color.s - 7 + "px",
  10969. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10970. backgroundColor: this.__temp.toString(),
  10971. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10972. }),
  10973. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10974. this.__temp.s = 1,
  10975. this.__temp.v = 1,
  10976. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10977. p.extend(this.__input.style, {
  10978. backgroundColor: this.__input.value = this.__color.toString(),
  10979. color: "rgb(" + e + "," + e + "," + e + ")",
  10980. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10981. })
  10982. }
  10983. });
  10984. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10985. return g
  10986. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10987. a = ee.color.math = {
  10988. hsv_to_rgb: function(e, t, i) {
  10989. var n = Math.floor(e / 60) % 6
  10990. , r = e / 60 - Math.floor(e / 60)
  10991. , o = i * (1 - t)
  10992. , a = i * (1 - r * t)
  10993. , s = i * (1 - (1 - r) * t)
  10994. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10995. return {
  10996. r: 255 * l[0],
  10997. g: 255 * l[1],
  10998. b: 255 * l[2]
  10999. }
  11000. },
  11001. rgb_to_hsv: function(e, t, i) {
  11002. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11003. return 0 == o ? {
  11004. h: NaN,
  11005. s: 0,
  11006. v: 0
  11007. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11008. (n /= 6) < 0 && (n += 1),
  11009. {
  11010. h: 360 * n,
  11011. s: a / o,
  11012. v: o / 255
  11013. })
  11014. },
  11015. rgb_to_hex: function(e, t, i) {
  11016. var n = this.hex_with_component(0, 2, e);
  11017. return n = this.hex_with_component(n, 1, t),
  11018. this.hex_with_component(n, 0, i)
  11019. },
  11020. component_from_hex: function(e, t) {
  11021. return e >> 8 * t & 255
  11022. },
  11023. hex_with_component: function(e, t, i) {
  11024. return i << (c = 8 * t) | e & ~(255 << c)
  11025. }
  11026. },
  11027. s = ee.color.toString,
  11028. l = ee.utils.common,
  11029. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11030. l.extend(ae.prototype, {
  11031. toString: function() {
  11032. return s(this)
  11033. },
  11034. toOriginal: function() {
  11035. return this.__state.conversion.write(this)
  11036. }
  11037. }),
  11038. ie(ae.prototype, "r", 2),
  11039. ie(ae.prototype, "g", 1),
  11040. ie(ae.prototype, "b", 0),
  11041. ne(ae.prototype, "h"),
  11042. ne(ae.prototype, "s"),
  11043. ne(ae.prototype, "v"),
  11044. Object.defineProperty(ae.prototype, "a", {
  11045. get: function() {
  11046. return this.__state.a
  11047. },
  11048. set: function(e) {
  11049. this.__state.a = e
  11050. }
  11051. }),
  11052. Object.defineProperty(ae.prototype, "hex", {
  11053. get: function() {
  11054. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11055. this.__state.hex
  11056. },
  11057. set: function(e) {
  11058. this.__state.space = "HEX",
  11059. this.__state.hex = e
  11060. }
  11061. }),
  11062. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11063. window.setTimeout(e, 1e3 / 60)
  11064. }
  11065. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11066. r = ee.utils.common,
  11067. te.prototype.show = function() {
  11068. var e = this;
  11069. this.backgroundElement.style.display = "block",
  11070. this.domElement.style.display = "block",
  11071. this.domElement.style.opacity = 0,
  11072. this.domElement.style.webkitTransform = "scale(1.1)",
  11073. this.layout(),
  11074. r.defer(function() {
  11075. e.backgroundElement.style.opacity = 1,
  11076. e.domElement.style.opacity = 1,
  11077. e.domElement.style.webkitTransform = "scale(1)"
  11078. })
  11079. }
  11080. ,
  11081. te.prototype.hide = function() {
  11082. var e = this
  11083. , t = function() {
  11084. e.domElement.style.display = "none",
  11085. e.backgroundElement.style.display = "none",
  11086. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11087. n.unbind(e.domElement, "transitionend", t),
  11088. n.unbind(e.domElement, "oTransitionEnd", t)
  11089. };
  11090. n.bind(this.domElement, "webkitTransitionEnd", t),
  11091. n.bind(this.domElement, "transitionend", t),
  11092. n.bind(this.domElement, "oTransitionEnd", t),
  11093. this.backgroundElement.style.opacity = 0,
  11094. this.domElement.style.opacity = 0,
  11095. this.domElement.style.webkitTransform = "scale(1.1)"
  11096. }
  11097. ,
  11098. te.prototype.layout = function() {
  11099. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11100. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11101. }
  11102. ,
  11103. te), ee.dom.dom, ee.utils.common)
  11104. }
  11105. , {}],
  11106. 94: [function(e, t, i) {
  11107. (function(J) {
  11108. "use strict";
  11109. function i(e) {
  11110. function t(e, t) {
  11111. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11112. for (var a = 1; a <= e[o]; a++)
  11113. r[t[n]] = [],
  11114. r[t[n]][0] = i,
  11115. r[t[n]][1] = o,
  11116. n++,
  11117. i++;
  11118. i *= 2
  11119. }
  11120. return r
  11121. }
  11122. function _(e) {
  11123. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11124. t & 1 << i && (B |= 1 << V),
  11125. i--,
  11126. --V < 0 && (255 == B ? (b(255),
  11127. b(0)) : b(B),
  11128. V = 7,
  11129. B = 0)
  11130. }
  11131. function b(e) {
  11132. F.push(e)
  11133. }
  11134. function w(e) {
  11135. b(e >> 8 & 255),
  11136. b(255 & e)
  11137. }
  11138. function T(e, t, i, n, r) {
  11139. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11140. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11141. for (h = 0; h < 8; ++h) {
  11142. i = e[d],
  11143. n = e[d + 1],
  11144. r = e[d + 2],
  11145. o = e[d + 3],
  11146. a = e[d + 4],
  11147. s = e[d + 5],
  11148. l = e[d + 6];
  11149. var p = i + (c = e[d + 7])
  11150. , f = i - c
  11151. , g = n + l
  11152. , m = n - l
  11153. , v = r + s
  11154. , y = r - s
  11155. , A = o + a
  11156. , C = o - a
  11157. , I = p + A
  11158. , E = p - A
  11159. , _ = g + v
  11160. , b = g - v;
  11161. e[d] = I + _,
  11162. e[d + 4] = I - _;
  11163. var w = .707106781 * (b + E);
  11164. e[d + 2] = E + w,
  11165. e[d + 6] = E - w;
  11166. var T = .382683433 * ((I = C + y) - (b = m + f))
  11167. , x = .5411961 * I + T
  11168. , S = 1.306562965 * b + T
  11169. , M = .707106781 * (_ = y + m)
  11170. , R = f + M
  11171. , P = f - M;
  11172. e[d + 5] = P + x,
  11173. e[d + 3] = P - x,
  11174. e[d + 1] = R + S,
  11175. e[d + 7] = R - S,
  11176. d += 8
  11177. }
  11178. for (h = d = 0; h < 8; ++h) {
  11179. i = e[d],
  11180. n = e[d + 8],
  11181. r = e[d + 16],
  11182. o = e[d + 24],
  11183. a = e[d + 32],
  11184. s = e[d + 40],
  11185. l = e[d + 48];
  11186. var O = i + (c = e[d + 56])
  11187. , L = i - c
  11188. , D = n + l
  11189. , N = n - l
  11190. , F = r + s
  11191. , B = r - s
  11192. , V = o + a
  11193. , k = o - a
  11194. , U = O + V
  11195. , H = O - V
  11196. , z = D + F
  11197. , G = D - F;
  11198. e[d] = U + z,
  11199. e[d + 32] = U - z;
  11200. var W = .707106781 * (G + H);
  11201. e[d + 16] = H + W,
  11202. e[d + 48] = H - W;
  11203. var j = .382683433 * ((U = k + B) - (G = N + L))
  11204. , Y = .5411961 * U + j
  11205. , q = 1.306562965 * G + j
  11206. , X = .707106781 * (z = B + N)
  11207. , Z = L + X
  11208. , K = L - X;
  11209. e[d + 40] = K + Y,
  11210. e[d + 24] = K - Y,
  11211. e[d + 8] = Z + q,
  11212. e[d + 56] = Z - q,
  11213. d++
  11214. }
  11215. for (h = 0; h < 64; ++h)
  11216. u = e[h] * t[h],
  11217. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11218. return Q
  11219. }(e, t), c = 0; c < 64; ++c)
  11220. A[C[c]] = l[c];
  11221. var h = A[0] - i;
  11222. i = A[0],
  11223. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11224. _(v[o]));
  11225. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11226. ;
  11227. if (0 == u)
  11228. return _(a),
  11229. i;
  11230. for (var d, p = 1; p <= u; ) {
  11231. for (var f = p; 0 == A[p] && p <= u; ++p)
  11232. ;
  11233. var g = p - f;
  11234. if (16 <= g) {
  11235. d = g >> 4;
  11236. for (var m = 1; m <= d; ++m)
  11237. _(s);
  11238. g &= 15
  11239. }
  11240. o = 32767 + A[p],
  11241. _(r[(g << 4) + y[o]]),
  11242. _(v[o]),
  11243. p++
  11244. }
  11245. return 63 != u && _(a),
  11246. i
  11247. }
  11248. function x(e) {
  11249. if (e <= 0 && (e = 1),
  11250. 100 < e && (e = 100),
  11251. i != e) {
  11252. (function(e) {
  11253. 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++) {
  11254. var n = u((t[i] * e + 50) / 100);
  11255. n < 1 ? n = 1 : 255 < n && (n = 255),
  11256. O[C[i]] = n
  11257. }
  11258. 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++) {
  11259. var a = u((r[o] * e + 50) / 100);
  11260. a < 1 ? a = 1 : 255 < a && (a = 255),
  11261. L[C[o]] = a
  11262. }
  11263. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11264. for (var h = 0; h < 8; h++)
  11265. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11266. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11267. l++
  11268. }
  11269. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11270. i = e
  11271. }
  11272. }
  11273. var S, M, R, P, i, u = (Math.round,
  11274. 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];
  11275. this.encode = function(e, t) {
  11276. var i = ((new Date).getTime(),
  11277. t.quality);
  11278. i && x(i),
  11279. F = new Array,
  11280. B = 0,
  11281. V = 7,
  11282. w(65496),
  11283. w(65504),
  11284. w(16),
  11285. b(74),
  11286. b(70),
  11287. b(73),
  11288. b(70),
  11289. b(0),
  11290. b(1),
  11291. b(1),
  11292. b(0),
  11293. w(1),
  11294. w(1),
  11295. b(0),
  11296. b(0),
  11297. function() {
  11298. w(65499),
  11299. w(132),
  11300. b(0);
  11301. for (var e = 0; e < 64; e++)
  11302. b(O[e]);
  11303. b(1);
  11304. for (var t = 0; t < 64; t++)
  11305. b(L[t])
  11306. }(),
  11307. function(e, t) {
  11308. w(65472),
  11309. w(17),
  11310. b(8),
  11311. w(t),
  11312. w(e),
  11313. b(3),
  11314. b(1),
  11315. b(17),
  11316. b(0),
  11317. b(2),
  11318. b(17),
  11319. b(1),
  11320. b(3),
  11321. b(17),
  11322. b(1)
  11323. }(e.width, e.height),
  11324. function() {
  11325. w(65476),
  11326. w(418),
  11327. b(0);
  11328. for (var e = 0; e < 16; e++)
  11329. b(G[e + 1]);
  11330. for (var t = 0; t <= 11; t++)
  11331. b(W[t]);
  11332. b(16);
  11333. for (var i = 0; i < 16; i++)
  11334. b(j[i + 1]);
  11335. for (var n = 0; n <= 161; n++)
  11336. b(Y[n]);
  11337. b(1);
  11338. for (var r = 0; r < 16; r++)
  11339. b(q[r + 1]);
  11340. for (var o = 0; o <= 11; o++)
  11341. b(X[o]);
  11342. b(17);
  11343. for (var a = 0; a < 16; a++)
  11344. b(Z[a + 1]);
  11345. for (var s = 0; s <= 161; s++)
  11346. b(K[s])
  11347. }(),
  11348. w(65498),
  11349. w(12),
  11350. b(3),
  11351. b(1),
  11352. b(0),
  11353. b(2),
  11354. b(17),
  11355. b(3),
  11356. b(17),
  11357. b(0),
  11358. b(63),
  11359. b(0);
  11360. var n = 0
  11361. , r = 0
  11362. , o = 0;
  11363. B = 0,
  11364. V = 7,
  11365. this.encode.displayName = "_encode_";
  11366. 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; ) {
  11367. for (a = 0; a < A; ) {
  11368. for (u = h = A * C + a,
  11369. d = -1,
  11370. f = p = 0; f < 64; f++)
  11371. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11372. v <= C + p && (u -= A * (C + 1 + p - v)),
  11373. A <= a + d && (u -= a + d - A + 4),
  11374. s = g[u++],
  11375. l = g[u++],
  11376. c = g[u++],
  11377. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11378. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11379. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11380. n = T(k, D, n, S, R),
  11381. r = T(U, N, r, M, P),
  11382. o = T(H, N, o, M, P),
  11383. a += 32
  11384. }
  11385. C += I
  11386. }
  11387. if (0 <= V) {
  11388. var E = [];
  11389. E[1] = V + 1,
  11390. E[0] = (1 << V + 1) - 1,
  11391. _(E)
  11392. }
  11393. return w(65497),
  11394. new J(F)
  11395. }
  11396. ,
  11397. (new Date).getTime(),
  11398. e = e || 50,
  11399. function() {
  11400. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11401. n[t] = e(t)
  11402. }(),
  11403. S = t(G, W),
  11404. M = t(q, X),
  11405. R = t(j, Y),
  11406. P = t(Z, K),
  11407. function() {
  11408. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11409. for (var n = e; n < t; n++)
  11410. y[32767 + n] = i,
  11411. v[32767 + n] = [],
  11412. v[32767 + n][1] = i,
  11413. v[32767 + n][0] = n;
  11414. for (var r = -(t - 1); r <= -e; r++)
  11415. y[32767 + r] = i,
  11416. v[32767 + r] = [],
  11417. v[32767 + r][1] = i,
  11418. v[32767 + r][0] = t - 1 + r;
  11419. e <<= 1,
  11420. t <<= 1
  11421. }
  11422. }(),
  11423. function() {
  11424. for (var e = 0; e < 256; e++)
  11425. z[e] = 19595 * e,
  11426. z[e + 256 >> 0] = 38470 * e,
  11427. z[e + 512 >> 0] = 7471 * e + 32768,
  11428. z[e + 768 >> 0] = -11059 * e,
  11429. z[e + 1024 >> 0] = -21709 * e,
  11430. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11431. z[e + 1536 >> 0] = -27439 * e,
  11432. z[e + 1792 >> 0] = -5329 * e
  11433. }(),
  11434. x(e),
  11435. (new Date).getTime()
  11436. }
  11437. t.exports.encode = function(e, t) {
  11438. return (t = t || {}).quality = t.quality || 50,
  11439. {
  11440. data: new i(t.quality).encode(e, t),
  11441. width: e.width,
  11442. height: e.height
  11443. }
  11444. }
  11445. }
  11446. ).call(this, e("buffer").Buffer)
  11447. }
  11448. , {
  11449. buffer: 198
  11450. }],
  11451. 95: [function(e, t, i) {
  11452. "use strict";
  11453. !function() {
  11454. if ("performance"in window == 0 && (window.performance = {}),
  11455. Date.now = Date.now || function() {
  11456. return (new Date).getTime()
  11457. }
  11458. ,
  11459. "now"in window.performance == 0) {
  11460. var e = Date.now();
  11461. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11462. window.performance.now = function() {
  11463. return Date.now() - e
  11464. }
  11465. }
  11466. }()
  11467. }
  11468. , {}],
  11469. 96: [function(e, t, i) {
  11470. "use strict";
  11471. var a = e("three");
  11472. a.EffectComposer = function(e, t) {
  11473. if (this.renderer = e,
  11474. void 0 === t) {
  11475. var i = {
  11476. minFilter: a.LinearFilter,
  11477. magFilter: a.LinearFilter,
  11478. format: a.RGBAFormat,
  11479. stencilBuffer: !1
  11480. }
  11481. , n = e.getSize();
  11482. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11483. }
  11484. this.renderTarget1 = t,
  11485. this.renderTarget2 = t.clone(),
  11486. this.writeBuffer = this.renderTarget1,
  11487. this.readBuffer = this.renderTarget2,
  11488. this.passes = [],
  11489. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11490. this.copyPass = new a.ShaderPass(a.CopyShader)
  11491. }
  11492. ,
  11493. a.EffectComposer.prototype = {
  11494. swapBuffers: function() {
  11495. var e = this.readBuffer;
  11496. this.readBuffer = this.writeBuffer,
  11497. this.writeBuffer = e
  11498. },
  11499. addPass: function(e) {
  11500. this.passes.push(e)
  11501. },
  11502. insertPass: function(e, t) {
  11503. this.passes.splice(t, 0, e)
  11504. },
  11505. render: function(e) {
  11506. this.writeBuffer = this.renderTarget1,
  11507. this.readBuffer = this.renderTarget2;
  11508. var t, i, n = !1, r = this.passes.length;
  11509. for (i = 0; i < r; i++)
  11510. if ((t = this.passes[i]).enabled) {
  11511. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11512. t.needsSwap) {
  11513. if (n) {
  11514. var o = this.renderer.context;
  11515. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11516. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11517. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11518. }
  11519. this.swapBuffers()
  11520. }
  11521. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11522. }
  11523. },
  11524. reset: function(e) {
  11525. if (void 0 === e) {
  11526. var t = this.renderer.getSize();
  11527. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11528. }
  11529. this.renderTarget1.dispose(),
  11530. this.renderTarget2.dispose(),
  11531. this.renderTarget1 = e,
  11532. this.renderTarget2 = e.clone(),
  11533. this.writeBuffer = this.renderTarget1,
  11534. this.readBuffer = this.renderTarget2
  11535. },
  11536. setSize: function(e, t) {
  11537. this.renderTarget1.setSize(e, t),
  11538. this.renderTarget2.setSize(e, t)
  11539. }
  11540. }
  11541. }
  11542. , {
  11543. three: 217
  11544. }],
  11545. 97: [function(e, t, i) {
  11546. "use strict";
  11547. var n = e("three");
  11548. n.MaskPass = function(e, t) {
  11549. this.scene = e,
  11550. this.camera = t,
  11551. this.enabled = !0,
  11552. this.clear = !0,
  11553. this.needsSwap = !1,
  11554. this.inverse = !1
  11555. }
  11556. ,
  11557. n.MaskPass.prototype = {
  11558. render: function(e, t, i, n) {
  11559. var r, o, a = e.context;
  11560. a.colorMask(!1, !1, !1, !1),
  11561. a.depthMask(!1),
  11562. o = this.inverse ? (r = 0,
  11563. 1) : (r = 1,
  11564. 0),
  11565. a.enable(a.STENCIL_TEST),
  11566. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11567. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11568. a.clearStencil(o),
  11569. e.render(this.scene, this.camera, i, this.clear),
  11570. e.render(this.scene, this.camera, t, this.clear),
  11571. a.colorMask(!0, !0, !0, !0),
  11572. a.depthMask(!0),
  11573. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11574. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11575. }
  11576. },
  11577. n.ClearMaskPass = function() {
  11578. this.enabled = !0
  11579. }
  11580. ,
  11581. n.ClearMaskPass.prototype = {
  11582. render: function(e, t, i, n) {
  11583. var r = e.context;
  11584. r.disable(r.STENCIL_TEST)
  11585. }
  11586. }
  11587. }
  11588. , {
  11589. three: 217
  11590. }],
  11591. 98: [function(e, t, i) {
  11592. "use strict";
  11593. var o = e("three");
  11594. o.RenderPass = function(e, t, i, n, r) {
  11595. this.scene = e,
  11596. this.camera = t,
  11597. this.overrideMaterial = i,
  11598. this.clearColor = n,
  11599. this.clearAlpha = void 0 !== r ? r : 1,
  11600. this.oldClearColor = new o.Color,
  11601. this.oldClearAlpha = 1,
  11602. this.enabled = !0,
  11603. this.clear = !0,
  11604. this.needsSwap = !1
  11605. }
  11606. ,
  11607. o.RenderPass.prototype = {
  11608. render: function(e, t, i, n) {
  11609. this.scene.overrideMaterial = this.overrideMaterial,
  11610. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11611. this.oldClearAlpha = e.getClearAlpha(),
  11612. e.setClearColor(this.clearColor, this.clearAlpha)),
  11613. e.render(this.scene, this.camera, i, this.clear),
  11614. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11615. this.scene.overrideMaterial = null
  11616. }
  11617. }
  11618. }
  11619. , {
  11620. three: 217
  11621. }],
  11622. 99: [function(e, t, i) {
  11623. "use strict";
  11624. var n = e("three");
  11625. n.ShaderPass = function(e, t) {
  11626. this.textureID = void 0 !== t ? t : "tDiffuse",
  11627. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11628. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11629. this.material = new n.ShaderMaterial({
  11630. defines: e.defines || {},
  11631. uniforms: this.uniforms,
  11632. vertexShader: e.vertexShader,
  11633. fragmentShader: e.fragmentShader
  11634. })),
  11635. this.renderToScreen = !1,
  11636. this.enabled = !0,
  11637. this.needsSwap = !0,
  11638. this.clear = !1,
  11639. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11640. this.scene = new n.Scene,
  11641. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11642. this.scene.add(this.quad)
  11643. }
  11644. ,
  11645. n.ShaderPass.prototype = {
  11646. render: function(e, t, i, n) {
  11647. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11648. this.quad.material = this.material,
  11649. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11650. }
  11651. }
  11652. }
  11653. , {
  11654. three: 217
  11655. }],
  11656. 100: [function(e, t, i) {
  11657. "use strict";
  11658. e("three").CopyShader = {
  11659. uniforms: {
  11660. tDiffuse: {
  11661. type: "t",
  11662. value: null
  11663. },
  11664. opacity: {
  11665. type: "f",
  11666. value: 1
  11667. }
  11668. },
  11669. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11670. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11671. }
  11672. }
  11673. , {
  11674. three: 217
  11675. }],
  11676. 101: [function(e, t, i) {
  11677. "use strict";
  11678. e("three").HorizontalBlurShader = {
  11679. uniforms: {
  11680. tDiffuse: {
  11681. type: "t",
  11682. value: null
  11683. },
  11684. h: {
  11685. type: "f",
  11686. value: 1 / 512
  11687. }
  11688. },
  11689. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11690. 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")
  11691. }
  11692. }
  11693. , {
  11694. three: 217
  11695. }],
  11696. 102: [function(e, t, i) {
  11697. "use strict";
  11698. e("three").VerticalBlurShader = {
  11699. uniforms: {
  11700. tDiffuse: {
  11701. type: "t",
  11702. value: null
  11703. },
  11704. v: {
  11705. type: "f",
  11706. value: 1 / 512
  11707. }
  11708. },
  11709. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11710. 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")
  11711. }
  11712. }
  11713. , {
  11714. three: 217
  11715. }],
  11716. 103: [function(e, t, i) {
  11717. "use strict";
  11718. var z = e("three");
  11719. !function() {
  11720. if ("performance"in window == 0 && (window.performance = {}),
  11721. "now"in window.performance == 0) {
  11722. var e = Date.now();
  11723. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11724. window.performance.now = function() {
  11725. return Date.now() - e
  11726. }
  11727. }
  11728. }(),
  11729. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11730. var t, i = this.extensions, n = this.context;
  11731. if (e === z.RepeatWrapping)
  11732. return n.REPEAT;
  11733. if (e === z.ClampToEdgeWrapping)
  11734. return n.CLAMP_TO_EDGE;
  11735. if (e === z.MirroredRepeatWrapping)
  11736. return n.MIRRORED_REPEAT;
  11737. if (e === z.NearestFilter)
  11738. return n.NEAREST;
  11739. if (e === z.NearestMipMapNearestFilter)
  11740. return n.NEAREST_MIPMAP_NEAREST;
  11741. if (e === z.NearestMipMapLinearFilter)
  11742. return n.NEAREST_MIPMAP_LINEAR;
  11743. if (e === z.LinearFilter)
  11744. return n.LINEAR;
  11745. if (e === z.LinearMipMapNearestFilter)
  11746. return n.LINEAR_MIPMAP_NEAREST;
  11747. if (e === z.LinearMipMapLinearFilter)
  11748. return n.LINEAR_MIPMAP_LINEAR;
  11749. if (e === z.UnsignedByteType)
  11750. return n.UNSIGNED_BYTE;
  11751. if (e === z.UnsignedShort4444Type)
  11752. return n.UNSIGNED_SHORT_4_4_4_4;
  11753. if (e === z.UnsignedShort5551Type)
  11754. return n.UNSIGNED_SHORT_5_5_5_1;
  11755. if (e === z.UnsignedShort565Type)
  11756. return n.UNSIGNED_SHORT_5_6_5;
  11757. if (e === z.ByteType)
  11758. return n.BYTE;
  11759. if (e === z.ShortType)
  11760. return n.SHORT;
  11761. if (e === z.UnsignedShortType)
  11762. return n.UNSIGNED_SHORT;
  11763. if (e === z.IntType)
  11764. return n.INT;
  11765. if (e === z.UnsignedIntType)
  11766. return n.UNSIGNED_INT;
  11767. if (e === z.FloatType)
  11768. return n.FLOAT;
  11769. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11770. return t.HALF_FLOAT_OES;
  11771. if (e === z.AlphaFormat)
  11772. return n.ALPHA;
  11773. if (e === z.RGBFormat)
  11774. return n.RGB;
  11775. if (e === z.RGBAFormat)
  11776. return n.RGBA;
  11777. if (e === z.LuminanceFormat)
  11778. return n.LUMINANCE;
  11779. if (e === z.LuminanceAlphaFormat)
  11780. return n.LUMINANCE_ALPHA;
  11781. if (e === z.AddEquation)
  11782. return n.FUNC_ADD;
  11783. if (e === z.SubtractEquation)
  11784. return n.FUNC_SUBTRACT;
  11785. if (e === z.ReverseSubtractEquation)
  11786. return n.FUNC_REVERSE_SUBTRACT;
  11787. if (e === z.ZeroFactor)
  11788. return n.ZERO;
  11789. if (e === z.OneFactor)
  11790. return n.ONE;
  11791. if (e === z.SrcColorFactor)
  11792. return n.SRC_COLOR;
  11793. if (e === z.OneMinusSrcColorFactor)
  11794. return n.ONE_MINUS_SRC_COLOR;
  11795. if (e === z.SrcAlphaFactor)
  11796. return n.SRC_ALPHA;
  11797. if (e === z.OneMinusSrcAlphaFactor)
  11798. return n.ONE_MINUS_SRC_ALPHA;
  11799. if (e === z.DstAlphaFactor)
  11800. return n.DST_ALPHA;
  11801. if (e === z.OneMinusDstAlphaFactor)
  11802. return n.ONE_MINUS_DST_ALPHA;
  11803. if (e === z.DstColorFactor)
  11804. return n.DST_COLOR;
  11805. if (e === z.OneMinusDstColorFactor)
  11806. return n.ONE_MINUS_DST_COLOR;
  11807. if (e === z.SrcAlphaSaturateFactor)
  11808. return n.SRC_ALPHA_SATURATE;
  11809. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11810. if (e === z.RGB_S3TC_DXT1_Format)
  11811. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11812. if (e === z.RGBA_S3TC_DXT1_Format)
  11813. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11814. if (e === z.RGBA_S3TC_DXT3_Format)
  11815. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11816. if (e === z.RGBA_S3TC_DXT5_Format)
  11817. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11818. }
  11819. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11820. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11821. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11822. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11823. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11824. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11825. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11826. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11827. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11828. }
  11829. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11830. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11831. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11832. if (e === z.MinEquation)
  11833. return t.MIN_EXT;
  11834. if (e === z.MaxEquation)
  11835. return t.MAX_EXT
  11836. }
  11837. return 0
  11838. }
  11839. ,
  11840. z.WebGLState = function(l, i, c) {
  11841. var n = this
  11842. , r = new z.Vector4
  11843. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11844. , o = new Uint8Array(e)
  11845. , a = new Uint8Array(e)
  11846. , s = new Uint8Array(e)
  11847. , t = {}
  11848. , h = null
  11849. , u = null
  11850. , d = null
  11851. , p = null
  11852. , f = null
  11853. , g = null
  11854. , m = null
  11855. , v = null
  11856. , y = !1
  11857. , A = null
  11858. , C = null
  11859. , I = null
  11860. , E = null
  11861. , _ = null
  11862. , b = null
  11863. , w = null
  11864. , T = null
  11865. , x = null
  11866. , S = null
  11867. , M = null
  11868. , R = null
  11869. , P = null
  11870. , O = null
  11871. , L = null
  11872. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11873. , N = void 0
  11874. , F = {}
  11875. , B = new z.Vector4
  11876. , V = null
  11877. , k = null
  11878. , U = new z.Vector4
  11879. , H = new z.Vector4;
  11880. this.init = function() {
  11881. this.clearColor(0, 0, 0, 1),
  11882. this.clearDepth(1),
  11883. this.clearStencil(0),
  11884. this.enable(l.DEPTH_TEST),
  11885. l.depthFunc(l.LEQUAL),
  11886. l.frontFace(l.CCW),
  11887. l.cullFace(l.BACK),
  11888. this.enable(l.CULL_FACE),
  11889. this.enable(l.BLEND),
  11890. l.blendEquation(l.FUNC_ADD),
  11891. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11892. }
  11893. ,
  11894. this.initAttributes = function() {
  11895. for (var e = 0, t = o.length; e < t; e++)
  11896. o[e] = 0
  11897. }
  11898. ,
  11899. this.enableAttribute = function(e) {
  11900. o[e] = 1,
  11901. 0 === a[e] && (l.enableVertexAttribArray(e),
  11902. a[e] = 1),
  11903. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11904. s[e] = 0)
  11905. }
  11906. ,
  11907. this.enableAttributeAndDivisor = function(e, t, i) {
  11908. o[e] = 1,
  11909. 0 === a[e] && (l.enableVertexAttribArray(e),
  11910. a[e] = 1),
  11911. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11912. s[e] = t)
  11913. }
  11914. ,
  11915. this.disableUnusedAttributes = function() {
  11916. for (var e = 0, t = a.length; e < t; e++)
  11917. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11918. a[e] = 0)
  11919. }
  11920. ,
  11921. this.enable = function(e) {
  11922. !0 !== t[e] && (l.enable(e),
  11923. t[e] = !0)
  11924. }
  11925. ,
  11926. this.disable = function(e) {
  11927. !1 !== t[e] && (l.disable(e),
  11928. t[e] = !1)
  11929. }
  11930. ,
  11931. this.getCompressedTextureFormats = function() {
  11932. if (null === h && (h = [],
  11933. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11934. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11935. h.push(e[t]);
  11936. return h
  11937. }
  11938. ,
  11939. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11940. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11941. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11942. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11943. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11944. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11945. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11946. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11947. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11948. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11949. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11950. u = e,
  11951. y = s),
  11952. e === z.CustomBlending ? (r = r || t,
  11953. o = o || i,
  11954. a = a || n,
  11955. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11956. d = t,
  11957. g = r),
  11958. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11959. p = i,
  11960. f = n,
  11961. m = o,
  11962. v = a)) : v = m = g = f = p = d = null
  11963. }
  11964. ,
  11965. this.setDepthFunc = function(e) {
  11966. if (A !== e) {
  11967. if (e)
  11968. switch (e) {
  11969. case z.NeverDepth:
  11970. l.depthFunc(l.NEVER);
  11971. break;
  11972. case z.AlwaysDepth:
  11973. l.depthFunc(l.ALWAYS);
  11974. break;
  11975. case z.LessDepth:
  11976. l.depthFunc(l.LESS);
  11977. break;
  11978. case z.LessEqualDepth:
  11979. l.depthFunc(l.LEQUAL);
  11980. break;
  11981. case z.EqualDepth:
  11982. l.depthFunc(l.EQUAL);
  11983. break;
  11984. case z.GreaterEqualDepth:
  11985. l.depthFunc(l.GEQUAL);
  11986. break;
  11987. case z.GreaterDepth:
  11988. l.depthFunc(l.GREATER);
  11989. break;
  11990. case z.NotEqualDepth:
  11991. l.depthFunc(l.NOTEQUAL);
  11992. break;
  11993. default:
  11994. l.depthFunc(l.LEQUAL)
  11995. }
  11996. else
  11997. l.depthFunc(l.LEQUAL);
  11998. A = e
  11999. }
  12000. }
  12001. ,
  12002. this.setDepthTest = function(e) {
  12003. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12004. }
  12005. ,
  12006. this.setDepthWrite = function(e) {
  12007. C !== e && (l.depthMask(e),
  12008. C = e)
  12009. }
  12010. ,
  12011. this.setColorWrite = function(e) {
  12012. I !== e && (l.colorMask(e, e, e, e),
  12013. I = e)
  12014. }
  12015. ,
  12016. this.setStencilFunc = function(e, t, i) {
  12017. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12018. _ = e,
  12019. b = t,
  12020. w = i)
  12021. }
  12022. ,
  12023. this.setStencilOp = function(e, t, i) {
  12024. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12025. T = e,
  12026. x = t,
  12027. S = i)
  12028. }
  12029. ,
  12030. this.setStencilTest = function(e) {
  12031. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12032. }
  12033. ,
  12034. this.setStencilWrite = function(e) {
  12035. E !== e && (l.stencilMask(e),
  12036. E = e)
  12037. }
  12038. ,
  12039. this.setFlipSided = function(e) {
  12040. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12041. M = e)
  12042. }
  12043. ,
  12044. this.setLineWidth = function(e) {
  12045. e !== R && (l.lineWidth(e),
  12046. R = e)
  12047. }
  12048. ,
  12049. this.setPolygonOffset = function(e, t, i) {
  12050. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12051. !e || P === t && O === i || (l.polygonOffset(t, i),
  12052. P = t,
  12053. O = i)
  12054. }
  12055. ,
  12056. this.getScissorTest = function() {
  12057. return L
  12058. }
  12059. ,
  12060. this.setScissorTest = function(e) {
  12061. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12062. }
  12063. ,
  12064. this.activeTexture = function(e) {
  12065. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12066. N !== e && (l.activeTexture(e),
  12067. N = e)
  12068. }
  12069. ,
  12070. this.bindTexture = function(e, t) {
  12071. void 0 === N && n.activeTexture();
  12072. var i = F[N];
  12073. void 0 === i && (i = {
  12074. type: void 0,
  12075. texture: void 0
  12076. },
  12077. F[N] = i),
  12078. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12079. i.type = e,
  12080. i.texture = t)
  12081. }
  12082. ,
  12083. this.compressedTexImage2D = function() {
  12084. try {
  12085. l.compressedTexImage2D.apply(l, arguments)
  12086. } catch (e) {
  12087. console.error(e)
  12088. }
  12089. }
  12090. ,
  12091. this.texImage2D = function() {
  12092. try {
  12093. l.texImage2D.apply(l, arguments)
  12094. } catch (e) {
  12095. console.error(e)
  12096. }
  12097. }
  12098. ,
  12099. this.clearColor = function(e, t, i, n) {
  12100. r.set(e, t, i, n),
  12101. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12102. B.copy(r))
  12103. }
  12104. ,
  12105. this.clearDepth = function(e) {
  12106. V !== e && (l.clearDepth(e),
  12107. V = e)
  12108. }
  12109. ,
  12110. this.clearStencil = function(e) {
  12111. k !== e && (l.clearStencil(e),
  12112. k = e)
  12113. }
  12114. ,
  12115. this.scissor = function(e) {
  12116. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12117. U.copy(e))
  12118. }
  12119. ,
  12120. this.viewport = function(e) {
  12121. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12122. H.copy(e))
  12123. }
  12124. ,
  12125. this.reset = function() {
  12126. for (var e = 0; e < a.length; e++)
  12127. 1 === a[e] && (l.disableVertexAttribArray(e),
  12128. a[e] = 0);
  12129. t = {},
  12130. N = void 0,
  12131. F = {},
  12132. M = E = C = I = u = h = null
  12133. }
  12134. }
  12135. }
  12136. , {
  12137. three: 217
  12138. }],
  12139. 104: [function(a, h, e) {
  12140. (function(i, e) {
  12141. "use strict";
  12142. function t(e) {
  12143. this.urls = e;
  12144. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12145. this.builder = n.loadProto(t),
  12146. this.decoder = this.builder.build("binary_mesh")
  12147. }
  12148. var s = a("three")
  12149. , n = a("protobufjs")
  12150. , r = a("../util/logger")
  12151. , o = (a("../util/common"),
  12152. a("../util/ajax"))
  12153. , l = a("../objects/Chunk")
  12154. , c = new r(e);
  12155. t.prototype = {
  12156. constructor: t,
  12157. load: function(t, i, n, r) {
  12158. return c.time("download"),
  12159. o.get(t, {
  12160. responseType: "arraybuffer"
  12161. }).done(function(e) {
  12162. c.timeEnd("download"),
  12163. this.parse(e, t, i, n, r)
  12164. }
  12165. .bind(this)).fail(r)
  12166. },
  12167. parse: function(e, t, i, n, r) {
  12168. var o = this.readProtobuf(e);
  12169. if (!o)
  12170. return r();
  12171. try {
  12172. c.time("convert to webgl"),
  12173. this.convertProtobufToSceneObject(o, t, i, n, r),
  12174. c.timeEnd("convert to webgl")
  12175. } catch (e) {
  12176. return c.error("failed parsing .dam"),
  12177. c.error(e.message),
  12178. r()
  12179. }
  12180. },
  12181. readProtobuf: function(e) {
  12182. var t;
  12183. try {
  12184. c.time("parse proto"),
  12185. t = this.decoder.decode(e),
  12186. c.timeEnd("parse proto")
  12187. } catch (e) {
  12188. return c.error("failed parsing proto for .dam"),
  12189. c.error(e.message),
  12190. null
  12191. }
  12192. return t
  12193. },
  12194. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12195. if (0 === e.chunk.length)
  12196. return c.warn("No chunks in damfile..."),
  12197. t([]);
  12198. var o = new s.Matrix4;
  12199. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12200. var a = e.chunk.map(function(e) {
  12201. var t = new s.BufferGeometry;
  12202. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12203. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12204. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12205. t.applyMatrix(o),
  12206. t.computeBoundingBox(),
  12207. new l({
  12208. geometry: t,
  12209. textureName: e.material_name,
  12210. name: e.chunk_name,
  12211. meshUrl: i
  12212. })
  12213. });
  12214. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12215. r())
  12216. }
  12217. },
  12218. h.exports = t
  12219. }
  12220. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12221. }
  12222. , {
  12223. "../objects/Chunk": 144,
  12224. "../util/ajax": 181,
  12225. "../util/common": 185,
  12226. "../util/logger": 189,
  12227. buffer: 198,
  12228. protobufjs: 214,
  12229. three: 217
  12230. }],
  12231. 105: [function(n, r, e) {
  12232. (function(e) {
  12233. "use strict";
  12234. var t = (n("three"),
  12235. n("../settings"),
  12236. n("../util/browser"),
  12237. n("./DamLoader"))
  12238. , i = n("../util/logger")
  12239. , u = (n("../ab"),
  12240. new i(e));
  12241. r.exports = {
  12242. getLoaders: function() {
  12243. return [["_50k", ".dam", t], ["", ".dam", t]]
  12244. },
  12245. load: function(e, t, i, n, r, o) {
  12246. var a = this.getLoaders()[o = o || 0];
  12247. if (a) {
  12248. var s = a[0]
  12249. , l = a[1]
  12250. , c = new a[2](t)
  12251. , h = t.get(e + s + l);
  12252. h ? (u.debug("Trying " + s + l),
  12253. c.load(h, i, n, function() {
  12254. this.load(e, t, i, n, r, ++o)
  12255. }
  12256. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12257. this.load(e, t, i, n, r, ++o))
  12258. } else
  12259. r && r("No suitable model file found...")
  12260. }
  12261. }
  12262. }
  12263. ).call(this, "/js/loaders/ModelLoader.js")
  12264. }
  12265. , {
  12266. "../ab": 3,
  12267. "../settings": 166,
  12268. "../util/browser": 182,
  12269. "../util/logger": 189,
  12270. "./DamLoader": 104,
  12271. three: 217
  12272. }],
  12273. 106: [function(i, n, e) {
  12274. (function(e) {
  12275. "use strict";
  12276. var l = i("../util/common")
  12277. , c = i("../util/texture")
  12278. , h = i("../util/browser")
  12279. , t = i("../util/logger")
  12280. , u = i("../settings")
  12281. , d = new t(e);
  12282. n.exports = {
  12283. load: function(i, n) {
  12284. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12285. return $.when();
  12286. var r = l.countUnique(i.chunks.map(function(e) {
  12287. return e.textureName
  12288. }))
  12289. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12290. , t = "_50k" == e ? "high" : "low";
  12291. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12292. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12293. t = "low"));
  12294. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12295. , a = $.Deferred()
  12296. , s = 0;
  12297. return i.chunks.forEach(function(e) {
  12298. if (!e.material.map && e.textureName) {
  12299. var t = i.urls.get(o + e.textureName);
  12300. e.setTextureMap(c.load(t, function(e, t) {
  12301. e || (n.push(t),
  12302. s++,
  12303. a.notify(s, r),
  12304. s === r && a.resolve())
  12305. }
  12306. .bind(this, c.isLoaded(t))))
  12307. }
  12308. }),
  12309. a.promise()
  12310. }
  12311. }
  12312. }
  12313. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12314. }
  12315. , {
  12316. "../settings": 166,
  12317. "../util/browser": 182,
  12318. "../util/common": 185,
  12319. "../util/logger": 189,
  12320. "../util/texture": 194
  12321. }],
  12322. 107: [function(s, l, e) {
  12323. (function(n, e) {
  12324. "use strict";
  12325. function t(e) {
  12326. this.model = e,
  12327. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12328. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12329. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12330. , i = r.loadProto(t);
  12331. this.decoder = i.build("VisionModeldata")
  12332. }
  12333. var r = s("protobufjs")
  12334. , i = s("../util/ajax")
  12335. , o = (s("../util/common"),
  12336. s("../util/math"))
  12337. , a = new (s("../util/logger"))(e);
  12338. t.prototype.load = function() {
  12339. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12340. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12341. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12342. $.when([]))
  12343. }
  12344. ,
  12345. t.prototype.loadVisionModelData = function() {
  12346. return i.get(this.modelDataPath, {
  12347. responseType: "arraybuffer"
  12348. }).then(function(e) {
  12349. var t;
  12350. try {
  12351. t = this.decoder.decode(e)
  12352. } catch (e) {
  12353. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12354. this.loadSweepLocationsCSV()
  12355. }
  12356. var i = t.sweepLocations.map(function(e) {
  12357. return {
  12358. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12359. position: {
  12360. x: e.pose.translation.x,
  12361. y: e.pose.translation.y,
  12362. z: e.pose.translation.z
  12363. },
  12364. quaternion: {
  12365. x: e.pose.rotation.x,
  12366. y: e.pose.rotation.y,
  12367. z: e.pose.rotation.z,
  12368. w: e.pose.rotation.w
  12369. },
  12370. puck: {
  12371. x: e.puck.x,
  12372. y: e.puck.y,
  12373. z: e.puck.z
  12374. },
  12375. floor: e.group,
  12376. neighbours: e.visibles,
  12377. alignmentType: e.alignment_type
  12378. }
  12379. }).map(function(e) {
  12380. return e.position = o.convertVisionVector(e.position),
  12381. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12382. e.puck = o.convertVisionVector(e.puck),
  12383. e
  12384. });
  12385. return i.forEach(function(e) {
  12386. e.neighbours = e.neighbours.map(function(e) {
  12387. return i[e].uuid
  12388. })
  12389. }),
  12390. i
  12391. }
  12392. .bind(this), function() {
  12393. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12394. this.loadSweepLocationsCSV()
  12395. }
  12396. .bind(this))
  12397. }
  12398. ,
  12399. t.prototype.loadSweepLocationsCSV = function() {
  12400. return i.get(this.sweepLocationsPath).then(function(e) {
  12401. return e.split("\n").map(function(e) {
  12402. return e.split(", ")
  12403. }).filter(function(e) {
  12404. return 1 < e.length
  12405. }).map(function(e) {
  12406. return {
  12407. uuid: e[0],
  12408. position: {
  12409. x: parseFloat(e[1]),
  12410. y: parseFloat(e[2]),
  12411. z: parseFloat(e[3])
  12412. },
  12413. quaternion: {
  12414. x: parseFloat(e[4]),
  12415. y: parseFloat(e[5]),
  12416. z: parseFloat(e[6]),
  12417. w: parseFloat(e[7])
  12418. }
  12419. }
  12420. }).map(function(e) {
  12421. return e.position = o.convertVisionVector(e.position),
  12422. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12423. e
  12424. })
  12425. }).fail(function() {
  12426. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12427. })
  12428. }
  12429. ,
  12430. l.exports = t
  12431. }
  12432. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12433. }
  12434. , {
  12435. "../util/ajax": 181,
  12436. "../util/common": 185,
  12437. "../util/logger": 189,
  12438. "../util/math": 190,
  12439. buffer: 198,
  12440. protobufjs: 214
  12441. }],
  12442. 108: [function(s, l, e) {
  12443. (function(e) {
  12444. "use strict";
  12445. function t() {
  12446. this.locale = null
  12447. }
  12448. var i = s("../settings")
  12449. , n = s("../util/common")
  12450. , r = s("../util/logger")
  12451. , o = s("../enum/Locale")
  12452. , a = new r(e);
  12453. t.prototype.init = function() {
  12454. var e;
  12455. switch (i.languageTag) {
  12456. case null:
  12457. case "en":
  12458. case o.EN_US:
  12459. this.locale = o.EN_US,
  12460. e = s("./strings-en-US");
  12461. break;
  12462. case "es":
  12463. case o.ES_MX:
  12464. this.locale = o.ES_MX,
  12465. e = s("./strings-es-MX");
  12466. break;
  12467. case "fr":
  12468. case o.FR_FR:
  12469. this.locale = o.FR_FR,
  12470. e = s("./strings-fr-FR");
  12471. break;
  12472. case "de":
  12473. case o.DE_DE:
  12474. this.locale = o.DE_DE,
  12475. e = s("./strings-de-DE");
  12476. break;
  12477. case "ru":
  12478. case o.RU_RU:
  12479. this.locale = o.RU_RU,
  12480. e = s("./strings-ru-RU");
  12481. break;
  12482. case "cn":
  12483. case o.CN_CN:
  12484. this.locale = o.CN_CN,
  12485. e = s("./strings-cn-CN");
  12486. break;
  12487. case "jp":
  12488. case o.JP_JP:
  12489. this.locale = o.JP_JP,
  12490. e = s("./strings-jp-JP");
  12491. break;
  12492. default:
  12493. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12494. this.locale = o.EN_US,
  12495. e = s("./strings-en-US")
  12496. }
  12497. a.info("Using locale '" + this.locale + "'"),
  12498. n.extendObject(this, e)
  12499. }
  12500. ,
  12501. t.prototype.localizeGUI = function() {
  12502. var e = document.querySelector("#gui-parent");
  12503. this.localizeTree(e),
  12504. this.localizeLoadingText()
  12505. }
  12506. ,
  12507. t.prototype.localizeLoadingText = function() {
  12508. document.querySelector("#help-dialog").classList.add(this.locale),
  12509. document.querySelector("#interaction-modal").classList.add(this.locale),
  12510. document.querySelector("#gui").classList.add(this.locale)
  12511. }
  12512. ,
  12513. t.prototype.localizeTree = function(e) {
  12514. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12515. if (e.nodeType === Node.TEXT_NODE)
  12516. (t = e.data.match(n)) && (i = t[1],
  12517. e.data = this.localizeText(i) || i);
  12518. else if (e.nodeType === Node.ELEMENT_NODE) {
  12519. var r = e.getAttribute("title");
  12520. r && ((t = r.match(n)) && (i = t[1],
  12521. e.setAttribute("title", this.localizeText(i) || i)))
  12522. }
  12523. for (e = e.firstChild; e; )
  12524. this.localizeTree(e),
  12525. e = e.nextSibling
  12526. }
  12527. ,
  12528. t.prototype.localizeText = function(e) {
  12529. var t = this[e];
  12530. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12531. t = s("./strings-en-US")[e]),
  12532. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12533. t
  12534. }
  12535. ,
  12536. l.exports = new t
  12537. }
  12538. ).call(this, "/js/localization/localize.js")
  12539. }
  12540. , {
  12541. "../enum/Locale": 31,
  12542. "../settings": 166,
  12543. "../util/common": 185,
  12544. "../util/logger": 189,
  12545. "./strings-cn-CN": 109,
  12546. "./strings-de-DE": 110,
  12547. "./strings-en-US": 111,
  12548. "./strings-es-MX": 112,
  12549. "./strings-fr-FR": 113,
  12550. "./strings-jp-JP": 114,
  12551. "./strings-ru-RU": 115
  12552. }],
  12553. 109: [function(e, t, i) {
  12554. "use strict";
  12555. t.exports = {
  12556. PAGE_TITLE: "",
  12557. LOADING: "正在加载",
  12558. PRESENTED_BY_CAPS: "呈现者:",
  12559. POWERED_BY: "技术支持:",
  12560. POWERED_BY_CAPS: "技术支持:",
  12561. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12562. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12563. PRESENTED_BY: "呈现者:",
  12564. MORE: "更多 ",
  12565. LESS: "更少 ",
  12566. TAG_CONTENT: "tag™ 内容",
  12567. SHOW: "显示",
  12568. HIDE: "隐藏",
  12569. DOLLHOUSE: "场景屋",
  12570. FLOOR_PLAN: "楼层平面图",
  12571. OPEN_HIGHLIGHTS: "打开精彩片段",
  12572. CLOSE_HIGHLIGHTS: "关闭",
  12573. PREVIOUS: "上一个",
  12574. PLAY: "播放",
  12575. PAUSE: "暂停",
  12576. NEXT: "下一个",
  12577. EXPLORE_3D_SPACE: "探索 3D 空间",
  12578. VIEW_DOLLHOUSE: "观看场景屋",
  12579. SOCIAL_SHARING: "分享这个空间",
  12580. VIEW_IN_VR: "以 VR 观看",
  12581. VIEW_FULLSCREEN: "全屏观看",
  12582. EXIT_FULLSCREEN: " 退出全屏",
  12583. ZOOM_IN: "放大",
  12584. ZOOM_OUT: "缩小",
  12585. FLOOR_NAME: "楼层",
  12586. FLOOR_ALL: "ALL",
  12587. FLOOR_Lang: ["Floor", ""],
  12588. TERMS: "条款",
  12589. PORT_TERMS: "port 条款",
  12590. TERMS_OF_USE: "使用条款",
  12591. CLOSE_TERMS: "关闭",
  12592. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12593. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12594. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12595. WEBVR_ENTER_WEBVR: "进入 VR",
  12596. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12597. WEBVR_LEARN_MORE: "了解更多",
  12598. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12599. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12600. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12601. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12602. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12603. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12604. VR_LEARN_MORE_CAPS: "了解更多",
  12605. VR_PREVIOUS_CAPS: "上一个’,",
  12606. VR_NEXT_CAPS: "下一个",
  12607. VR_GOT_IT_CAPS: "明白了",
  12608. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12609. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12610. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12611. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12612. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12613. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12614. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12615. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12616. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12617. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12618. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12619. VR_APP: "port VR 应用程序",
  12620. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12621. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12622. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12623. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12624. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12625. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12626. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12627. VR_ANDROID_DVICES: "Android 设备",
  12628. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12629. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12630. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12631. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12632. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12633. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12634. VR_DOWNLOAD_HERE: "在此下载",
  12635. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12636. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12637. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12638. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12639. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12640. SHARE_TO: "分享到",
  12641. SHARE_LINK: "直接链接",
  12642. SHARE_EXPLORE: "探索",
  12643. SHARE_AT: "在",
  12644. SHARE_WITH: "使用",
  12645. SHARE_3D: "以 3D",
  12646. SHARE_COPIED: "已复制!",
  12647. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12648. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12649. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12650. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12651. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12652. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12653. ERROR_GENERIC_ACTIONS_3: " 或",
  12654. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12655. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12656. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12657. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12658. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12659. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12660. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12661. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12662. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12663. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12664. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12665. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12666. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12667. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12668. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12669. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12670. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12671. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12672. LINK_TO_LOCATION: "地点链接",
  12673. MENU_COPY: "复制",
  12674. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12675. ROTATE: "旋转",
  12676. MOVE: "移动",
  12677. INSIDE: "内部",
  12678. ZOOM: "缩放",
  12679. HELP: "小帮手",
  12680. HELP_NAVIGATION_TAB: "导航",
  12681. HELP_MORE_HELP_TAB: "更多帮助",
  12682. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12683. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12684. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12685. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12686. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12687. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12688. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12689. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12690. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12691. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12692. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12693. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12694. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12695. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12696. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12697. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12698. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12699. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12700. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12701. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12702. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12703. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12704. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12705. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12706. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12707. HELP_MORE_HLR_A: "精彩片段集锦",
  12708. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12709. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12710. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12711. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12712. HELP_MORE_FLOORS_A: "楼层选择器",
  12713. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12714. HELP_MORE_TAG_A: "tag™ 贴文",
  12715. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12716. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12717. HELP_MORE_ZOOM_A: "缩放控件",
  12718. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12719. HELP_MORE_TOUR_A: "导览控件",
  12720. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12721. HELP_MORE_INSIDE_A: "内部视图",
  12722. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12723. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12724. HELP_MORE_VR_A: "VR 模式",
  12725. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12726. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12727. HELP_MORE_360_A: "360° 视图",
  12728. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12729. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12730. HELP_MORE_FULLSCREEN_A: "全屏",
  12731. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12732. CLOSE: "关闭"
  12733. }
  12734. }
  12735. , {}],
  12736. 110: [function(e, t, i) {
  12737. "use strict";
  12738. t.exports = {
  12739. PAGE_TITLE: "",
  12740. LOADING: "Lädt",
  12741. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12742. POWERED_BY: "Angetrieben von",
  12743. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12744. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12745. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12746. PRESENTED_BY: "Präsentiert von ",
  12747. MORE: "Mehr ",
  12748. LESS: "Weniger ",
  12749. TAG_CONTENT: "tag™ Inhalt",
  12750. SHOW: "Anzeigen",
  12751. HIDE: "Verbergen",
  12752. DOLLHOUSE: "Puppenhaus",
  12753. FLOOR_PLAN: "Grundriss",
  12754. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12755. CLOSE_HIGHLIGHTS: "Schließen",
  12756. PREVIOUS: "Vorheriges",
  12757. PLAY: "Abspielen",
  12758. PAUSE: "Pausieren",
  12759. NEXT: "Nächstes",
  12760. EXPLORE_3D_SPACE: "Innenraum betreten",
  12761. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12762. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12763. VIEW_IN_VR: "In VR ansehen",
  12764. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12765. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12766. ZOOM_IN: "Vergrößern",
  12767. ZOOM_OUT: "Verkleinern",
  12768. FLOOR_NAME: "Etage ",
  12769. FLOOR_ALL: "Alle",
  12770. TERMS: "Bedingungen",
  12771. PORT_TERMS: "port Bedingungen",
  12772. TERMS_OF_USE: "Nutzungsbedingungen",
  12773. TERMS_TEXT_FILE: "terms-de-DE.html",
  12774. CLOSE_TERMS: "Schließen",
  12775. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12776. HELP: "Hilfe",
  12777. HELP_NAVIGATION_TAB: "Navigation",
  12778. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12779. CLOSE: "Schließen",
  12780. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12781. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12782. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12783. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12784. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12785. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12786. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12787. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12788. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12789. 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.",
  12790. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12791. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12792. 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.",
  12793. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12794. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12795. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12796. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12797. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12798. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12799. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12800. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12801. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12802. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12803. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12804. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12805. HELP_MORE_HLR_A: "Liste das Highlight",
  12806. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12807. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12808. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12809. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12810. HELP_MORE_FLOORS_A: "Etage auswählen",
  12811. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12812. HELP_MORE_TAG_A: "tag™ Posts",
  12813. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12814. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12815. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12816. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12817. HELP_MORE_TOUR_A: "Tour Steuerung",
  12818. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12819. HELP_MORE_INSIDE_A: "Innenansicht",
  12820. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12821. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12822. HELP_MORE_VR_A: "VR Modus",
  12823. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12824. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12825. HELP_MORE_360_A: "360° Views Ansicht ",
  12826. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12827. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12828. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12829. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12830. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12831. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12832. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12833. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12834. WEBVR_LEARN_MORE: "Mehr Infos",
  12835. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12836. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12837. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12838. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12839. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12840. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12841. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12842. VR_APP: "port VR App",
  12843. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12844. 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",
  12845. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12846. VR_APP_FOR_ANDROID: "port VR app für Android",
  12847. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12848. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12849. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12850. VR_PREVIOUS_CAPS: "ZURÜCK",
  12851. VR_NEXT_CAPS: "WEITER",
  12852. VR_GOT_IT_CAPS: "VERSTANDEN",
  12853. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12854. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12855. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12856. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12857. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12858. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12859. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12860. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12861. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12862. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12863. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12864. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12865. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12866. VR_ANDROID_DVICES: "Android Geräte",
  12867. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12868. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12869. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12870. VR_DOWNLOAD_HERE: "Hier runterladen",
  12871. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12872. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12873. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12874. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12875. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12876. SHARE_TO: "Teilen auf",
  12877. SHARE_LINK: "Direkter Link",
  12878. SHARE_EXPLORE: "Umsehen",
  12879. SHARE_AT: "auf",
  12880. SHARE_WITH: "mit",
  12881. SHARE_3D: "in 3D",
  12882. SHARE_COPIED: "Kopiert!",
  12883. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12884. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12885. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12886. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12887. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12888. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12889. ERROR_GENERIC_ACTIONS_3: " oder ",
  12890. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12891. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12892. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12893. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12894. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12895. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12896. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12897. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12898. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12899. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12900. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12901. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12902. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12903. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12904. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12905. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12906. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12907. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12908. LINK_TO_LOCATION: "Link zu",
  12909. MENU_COPY: "Kopieren",
  12910. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12911. ROTATE: "Drehen",
  12912. INSIDE: "Drinnen",
  12913. MOVE: "Bewegen",
  12914. ZOOM: "Vergrößern"
  12915. }
  12916. }
  12917. , {}],
  12918. 111: [function(e, t, i) {
  12919. "use strict";
  12920. t.exports = {
  12921. PAGE_TITLE: "",
  12922. LOADING: "Loading",
  12923. PRESENTED_BY_CAPS: "PRESENTED BY",
  12924. POWERED_BY: "powered by ",
  12925. POWERED_BY_CAPS: "POWERED BY",
  12926. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12927. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12928. PRESENTED_BY: "Presented by ",
  12929. MORE: "More ",
  12930. LESS: "Less ",
  12931. TAG_CONTENT: "tag™ Content",
  12932. SHOW: "Show",
  12933. HIDE: "Hide",
  12934. DOLLHOUSE: "Dollhouse",
  12935. FLOOR_PLAN: "Floor plan",
  12936. OPEN_HIGHLIGHTS: "Open Highlights",
  12937. CLOSE_HIGHLIGHTS: "Close",
  12938. PREVIOUS: "Previous",
  12939. PLAY: "Play",
  12940. PAUSE: "Pause",
  12941. NEXT: "Next",
  12942. EXPLORE_3D_SPACE: "Explore 3D Space",
  12943. VIEW_DOLLHOUSE: "View dollhouse",
  12944. SOCIAL_SHARING: "Share this Space",
  12945. VIEW_IN_VR: "View in VR",
  12946. VIEW_FULLSCREEN: "全屏",
  12947. EXIT_FULLSCREEN: "退出全屏",
  12948. ZOOM_IN: "Zoom in",
  12949. ZOOM_OUT: "Zoom out",
  12950. FLOOR_NAME: "Floor ",
  12951. FLOOR_ALL: "全部",
  12952. TERMS: "Terms",
  12953. PORT_TERMS: "port terms",
  12954. TERMS_OF_USE: "Terms of Use",
  12955. TERMS_TEXT_FILE: "terms-en-US.html",
  12956. CLOSE_TERMS: "Close",
  12957. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12958. HELP: "Help",
  12959. HELP_NAVIGATION_TAB: "Navigation",
  12960. HELP_MORE_HELP_TAB: "More Help",
  12961. CLOSE: "Close",
  12962. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12963. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12964. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12965. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12966. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12967. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12968. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12969. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12970. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12971. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12972. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12973. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12974. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12975. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12976. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12977. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12978. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12979. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12980. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12981. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12982. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12983. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12984. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12985. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12986. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12987. HELP_MORE_HLR_A: "Highlight Reel",
  12988. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12989. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12990. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12991. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12992. HELP_MORE_FLOORS_A: "Floor Selector",
  12993. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12994. HELP_MORE_TAG_A: "tag™ Posts",
  12995. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12996. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12997. HELP_MORE_ZOOM_A: "Zoom Controls",
  12998. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12999. HELP_MORE_TOUR_A: "Tour Controls",
  13000. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13001. HELP_MORE_INSIDE_A: "Inside View",
  13002. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13003. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13004. HELP_MORE_VR_A: "VR Mode",
  13005. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13006. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13007. HELP_MORE_360_A: "360° Views",
  13008. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13009. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13010. HELP_MORE_FULLSCREEN_A: "Full screen",
  13011. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13012. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13013. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13014. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13015. WEBVR_ENTER_WEBVR: "ENTER VR",
  13016. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13017. WEBVR_LEARN_MORE: "Learn more",
  13018. WEBVR_VIEW_SPACE: "View Space in VR",
  13019. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13020. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13021. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13022. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13023. VR_PREVIOUS_CAPS: "PREVIOUS",
  13024. VR_NEXT_CAPS: "NEXT",
  13025. VR_GOT_IT_CAPS: "GOT IT",
  13026. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13027. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13028. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13029. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13030. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13031. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13032. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13033. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13034. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13035. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13036. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13037. VR_APP: "port VR App",
  13038. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13039. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13040. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13041. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13042. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13043. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13044. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13045. VR_ANDROID_DVICES: "Android Devices",
  13046. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13047. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13048. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13049. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13050. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13051. VR_APP_OPEN: "Open with the port VR app instead",
  13052. VR_DOWNLOAD_HERE: "Download here",
  13053. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13054. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13055. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13056. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13057. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13058. SHARE_TO: "Share to",
  13059. SHARE_LINK: "Direct Link",
  13060. SHARE_EXPLORE: "Explore ",
  13061. SHARE_AT: "at",
  13062. SHARE_WITH: "with",
  13063. SHARE_3D: " in 3D",
  13064. SHARE_COPIED: "Copied!",
  13065. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13066. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13067. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13068. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13069. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13070. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13071. ERROR_GENERIC_ACTIONS_3: " or ",
  13072. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13073. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13074. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13075. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13076. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13077. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13078. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13079. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13080. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13081. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13082. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13083. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13084. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13085. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13086. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13087. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13088. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13089. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13090. LINK_TO_LOCATION: "Link to location",
  13091. MENU_COPY: "Copy",
  13092. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13093. ROTATE: "Rotate",
  13094. INSIDE: "Inside",
  13095. MOVE: "Move",
  13096. ZOOM: "Zoom"
  13097. }
  13098. }
  13099. , {}],
  13100. 112: [function(e, t, i) {
  13101. "use strict";
  13102. t.exports = {
  13103. PAGE_TITLE: "",
  13104. LOADING: "Cargando",
  13105. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13106. POWERED_BY: "potenciando por ",
  13107. POWERED_BY_CAPS: "POTENCIADO POR ",
  13108. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13109. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13110. PRESENTED_BY: "Presentado por ",
  13111. MORE: "Más ",
  13112. LESS: "Menos ",
  13113. TAG_CONTENT: "Contenido de tag™",
  13114. SHOW: "Mostrar",
  13115. HIDE: "Ocultar",
  13116. DOLLHOUSE: "Dollhouse",
  13117. FLOOR_PLAN: "Planos",
  13118. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13119. CLOSE_HIGHLIGHTS: "Cerrar",
  13120. PREVIOUS: "Anterior",
  13121. PLAY: "Play",
  13122. PAUSE: "Pausa",
  13123. NEXT: "Siguiente",
  13124. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13125. VIEW_DOLLHOUSE: "Ver dollhouse",
  13126. SOCIAL_SHARING: "Compartir este espacio",
  13127. VIEW_IN_VR: "Ver en realidad virtual",
  13128. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13129. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13130. ZOOM_IN: "Acercar",
  13131. ZOOM_OUT: "Alejar",
  13132. FLOOR_NAME: "Piso ",
  13133. FLOOR_ALL: "Todas",
  13134. TERMS: "Condiciones",
  13135. PORT_TERMS: "port términos de uso",
  13136. TERMS_OF_USE: "Términos de uso",
  13137. TERMS_TEXT_FILE: "terms-es-MX.html",
  13138. CLOSE_TERMS: "Cerrar",
  13139. 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.",
  13140. HELP: "Ayuda",
  13141. HELP_NAVIGATION_TAB: "Navegación",
  13142. HELP_MORE_HELP_TAB: "Más Ayuda",
  13143. CLOSE: "Cerrar",
  13144. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13145. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13146. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13147. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13148. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13149. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13150. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13151. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13152. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13153. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13154. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13155. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13156. 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.",
  13157. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13158. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13159. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13160. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13161. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13162. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13163. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13164. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13165. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13166. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13167. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13168. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13169. HELP_MORE_HLR_A: "Galería destacada",
  13170. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13171. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13172. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13173. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13174. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13175. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13176. HELP_MORE_TAG_A: "tag™ Posts",
  13177. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13178. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13179. HELP_MORE_ZOOM_A: "Controles de zoom",
  13180. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13181. HELP_MORE_TOUR_A: "Controles de recorrido",
  13182. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13183. HELP_MORE_INSIDE_A: "Vista interior",
  13184. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13185. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13186. HELP_MORE_VR_A: "Modo de realidad virtual",
  13187. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13188. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13189. HELP_MORE_360_A: "360° Views",
  13190. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13191. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13192. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13193. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13194. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13195. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13196. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13197. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13198. WEBVR_LEARN_MORE: "Más información",
  13199. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13200. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13201. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13202. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13203. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13204. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13205. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13206. VR_APP: "port VR App",
  13207. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13208. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13209. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13210. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13211. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13212. VR_PREVIOUS_CAPS: "ANTERIOR",
  13213. VR_NEXT_CAPS: "SIGUIENTE",
  13214. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13215. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13216. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13217. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13218. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13219. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13220. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13221. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13222. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13223. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13224. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13225. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13226. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13227. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13228. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13229. VR_ANDROID_DVICES: "Dispositivos Android",
  13230. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13231. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13232. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13233. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13234. VR_DOWNLOAD_HERE: "Descargar aquí",
  13235. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13236. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13237. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13238. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13239. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13240. SHARE_TO: "Compartir en",
  13241. SHARE_LINK: "Enlace directo",
  13242. SHARE_EXPLORE: "Explorar ",
  13243. SHARE_AT: "en",
  13244. SHARE_WITH: "con",
  13245. SHARE_3D: " en 3D",
  13246. SHARE_COPIED: "¡Copiado!",
  13247. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13248. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13249. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13250. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13251. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13252. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13253. ERROR_GENERIC_ACTIONS_3: " o ",
  13254. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13255. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13256. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13257. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13258. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13259. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13260. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13261. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13262. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13263. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13264. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13265. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13266. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13267. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13268. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13269. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13270. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13271. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13272. LINK_TO_LOCATION: "Enlace a la ubicación",
  13273. MENU_COPY: "Copiar",
  13274. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13275. ROTATE: "Girar",
  13276. INSIDE: "Interior",
  13277. MOVE: "Moverse",
  13278. ZOOM: "Acercar o alejar"
  13279. }
  13280. }
  13281. , {}],
  13282. 113: [function(e, t, i) {
  13283. "use strict";
  13284. t.exports = {
  13285. PAGE_TITLE: "",
  13286. LOADING: "Chargement",
  13287. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13288. POWERED_BY: "alimenté par ",
  13289. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13290. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13291. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13292. PRESENTED_BY: "Présenté par ",
  13293. MORE: "Plus ",
  13294. LESS: "Moins ",
  13295. TAG_CONTENT: "Contenu tag™",
  13296. SHOW: "Montrer",
  13297. HIDE: "Cacher",
  13298. DOLLHOUSE: "Dollhouse",
  13299. FLOOR_PLAN: "Plan de sol",
  13300. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13301. CLOSE_HIGHLIGHTS: "Fermer",
  13302. PREVIOUS: "Précédent",
  13303. PLAY: "Lecture",
  13304. PAUSE: "Pause",
  13305. NEXT: "Suivant",
  13306. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13307. VIEW_DOLLHOUSE: "Voir dollhouse",
  13308. SOCIAL_SHARING: "Partager cet espace",
  13309. VIEW_IN_VR: "Voir en VR",
  13310. VIEW_FULLSCREEN: "Plein écran",
  13311. EXIT_FULLSCREEN: "Fermer plein écran",
  13312. ZOOM_IN: "Zoom avant",
  13313. ZOOM_OUT: "Zoom arrière",
  13314. FLOOR_NAME: "Étage ",
  13315. FLOOR_ALL: "Tous",
  13316. TERMS: "Mentions légales",
  13317. PORT_TERMS: "port mentions légales",
  13318. TERMS_OF_USE: "Conditions d'utilisation",
  13319. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13320. CLOSE_TERMS: "Fermer",
  13321. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13322. HELP: "Aide",
  13323. HELP_NAVIGATION_TAB: "Navigation",
  13324. HELP_MORE_HELP_TAB: "Aide",
  13325. CLOSE: "Fermer",
  13326. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13327. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13328. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13329. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13330. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13331. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13332. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13333. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13334. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13335. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13336. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13337. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13338. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13339. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13340. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13341. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13342. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13343. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13344. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13345. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13346. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13347. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13348. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13349. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13350. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13351. HELP_MORE_HLR_A: "Carrousel",
  13352. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13353. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13354. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13355. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13356. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13357. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13358. HELP_MORE_TAG_A: "tag™ Posts",
  13359. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13360. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13361. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13362. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13363. HELP_MORE_TOUR_A: "Commandes de la visite",
  13364. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13365. HELP_MORE_INSIDE_A: "Vue intérieure",
  13366. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13367. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13368. HELP_MORE_VR_A: "Mode RV",
  13369. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13370. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13371. HELP_MORE_360_A: "Vues 360°",
  13372. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13373. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13374. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13375. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13376. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13377. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13378. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13379. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13380. WEBVR_LEARN_MORE: "En savoir plus",
  13381. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13382. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13383. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13384. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13385. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13386. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13387. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13388. VR_NEXT_CAPS: "SUIVANT",
  13389. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13390. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13391. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13392. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13393. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13394. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13395. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13396. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13397. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13398. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13399. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13400. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13401. VR_APP: "port VR App",
  13402. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13403. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13404. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13405. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13406. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13407. 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",
  13408. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13409. VR_ANDROID_DVICES: "Appareils Android",
  13410. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13411. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13412. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13413. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13414. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13415. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13416. VR_DOWNLOAD_HERE: "Télécharger ici",
  13417. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13418. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13419. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13420. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13421. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13422. SHARE_TO: "Partager sur",
  13423. SHARE_LINK: "Lien direct",
  13424. SHARE_EXPLORE: "Explorer ",
  13425. SHARE_AT: "à",
  13426. SHARE_WITH: "avec",
  13427. SHARE_3D: " en 3D",
  13428. SHARE_COPIED: "Copié!",
  13429. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13430. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13431. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13432. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13433. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13434. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13435. ERROR_GENERIC_ACTIONS_3: " ou ",
  13436. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13437. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13438. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13439. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13440. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13441. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13442. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13443. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13444. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13445. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13446. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13447. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13448. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13449. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13450. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13451. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13452. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13453. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13454. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13455. MENU_COPY: "Copie",
  13456. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13457. ROTATE: "Faire pivoter",
  13458. INSIDE: "Intérieure",
  13459. MOVE: "Se déplacer",
  13460. ZOOM: "Zoom"
  13461. }
  13462. }
  13463. , {}],
  13464. 114: [function(e, t, i) {
  13465. "use strict";
  13466. t.exports = {
  13467. PAGE_TITLE: "",
  13468. LOADING: "読み込み中",
  13469. PRESENTED_BY_CAPS: "PRESENTED BY",
  13470. POWERED_BY: "powered by",
  13471. POWERED_BY_CAPS: "POWERED BY",
  13472. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13473. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13474. PRESENTED_BY: "Presented by ",
  13475. MORE: "全て表示 ",
  13476. LESS: "閉じる ",
  13477. TAG_CONTENT: "tag™コンテンツ ",
  13478. SHOW: "表示",
  13479. HIDE: "非表示",
  13480. DOLLHOUSE: "ドールハウス",
  13481. FLOOR_PLAN: "フロアプラン",
  13482. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13483. CLOSE_HIGHLIGHTS: "閉じる",
  13484. PREVIOUS: "前へ",
  13485. PLAY: "再生",
  13486. PAUSE: "一時停止",
  13487. NEXT: "次へ",
  13488. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13489. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13490. SOCIAL_SHARING: "このSpaceを共有する",
  13491. VIEW_IN_VR: "VRで表示",
  13492. VIEW_FULLSCREEN: "フルスクリーン表示",
  13493. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13494. ZOOM_IN: "ズームイン",
  13495. ZOOM_OUT: "ズームアウト",
  13496. FLOOR_NAME: "フロア ",
  13497. FLOOR_ALL: "すべて",
  13498. TERMS: "規約",
  13499. PORT_TERMS: "port規約",
  13500. TERMS_OF_USE: "利用規約",
  13501. CLOSE_TERMS: "閉じる",
  13502. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13503. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13504. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13505. WEBVR_ENTER_WEBVR: "VRに入る",
  13506. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13507. WEBVR_LEARN_MORE: "もっと詳しく",
  13508. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13509. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13510. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13511. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13512. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13513. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13514. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13515. VR_PREVIOUS_CAPS: "前へ",
  13516. VR_NEXT_CAPS: "次へ",
  13517. VR_GOT_IT_CAPS: "了解",
  13518. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13519. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13520. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13521. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13522. VR_WHAT_YOU_NEED: "必要なもの",
  13523. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13524. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13525. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13526. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13527. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13528. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13529. VR_APP: "port VRアプリ",
  13530. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13531. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13532. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13533. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13534. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13535. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13536. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13537. VR_ANDROID_DVICES: "Androidデバイス",
  13538. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13539. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13540. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13541. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13542. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13543. VR_APP_OPEN: "port VRアプリで開く",
  13544. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13545. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13546. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13547. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13548. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13549. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13550. SHARE_TO: "共有先",
  13551. SHARE_LINK: "ダイレクトリンク",
  13552. SHARE_EXPLORE: "探索",
  13553. SHARE_AT: "場所",
  13554. SHARE_WITH: "使用アプリ",
  13555. SHARE_3D: "3Dで",
  13556. SHARE_COPIED: "コピーされました!",
  13557. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13558. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13559. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13560. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13561. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13562. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13563. ERROR_GENERIC_ACTIONS_3: "または",
  13564. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13565. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13566. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13567. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13568. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13569. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13570. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13571. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13572. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13573. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13574. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13575. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13576. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13577. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13578. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13579. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13580. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13581. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13582. LINK_TO_LOCATION: "ロケーションへのリンク",
  13583. MENU_COPY: "コピー",
  13584. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13585. ROTATE: "回転",
  13586. MOVE: "移動",
  13587. INSIDE: "内側",
  13588. ZOOM: "ズーム",
  13589. HELP: "ヘルプ",
  13590. HELP_NAVIGATION_TAB: "ナビゲーション",
  13591. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13592. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13593. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13594. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13595. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13596. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13597. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13598. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13599. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13600. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13601. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13602. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13603. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13604. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13605. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13606. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13607. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13608. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13609. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13610. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13611. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13612. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13613. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13614. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13615. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13616. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13617. HELP_MORE_HLR_A: "ハイライト",
  13618. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13619. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13620. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13621. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13622. HELP_MORE_FLOORS_A: "フロアセレクター",
  13623. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13624. HELP_MORE_TAG_A: "tag™ Posts",
  13625. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13626. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13627. HELP_MORE_ZOOM_A: "ズームコントロール",
  13628. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13629. HELP_MORE_TOUR_A: "ツアーコントロール",
  13630. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13631. HELP_MORE_INSIDE_A: "内側ビュー",
  13632. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13633. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13634. HELP_MORE_VR_A: "VRモード",
  13635. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13636. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13637. HELP_MORE_360_A: "360° Views",
  13638. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13639. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13640. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13641. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13642. CLOSE: "閉じる"
  13643. }
  13644. }
  13645. , {}],
  13646. 115: [function(e, t, i) {
  13647. "use strict";
  13648. t.exports = {
  13649. PAGE_TITLE: "",
  13650. LOADING: "Загрузка",
  13651. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13652. POWERED_BY: "разработано на платформе ",
  13653. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13654. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13655. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13656. PRESENTED_BY: "Представлено ",
  13657. MORE: "Больше ",
  13658. LESS: "Меньше ",
  13659. TAG_CONTENT: "tag™ Контент",
  13660. SHOW: "Показать",
  13661. HIDE: "Скрыть",
  13662. DOLLHOUSE: "Dollhouse",
  13663. FLOOR_PLAN: "Планировка",
  13664. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13665. CLOSE_HIGHLIGHTS: "Закрыть",
  13666. PREVIOUS: "Предыдущий",
  13667. PLAY: "Воспроизвести",
  13668. PAUSE: "Пауза",
  13669. NEXT: "Следующий",
  13670. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13671. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13672. SOCIAL_SHARING: "Поделиться этой моделью",
  13673. VIEW_IN_VR: "Посмотреть в VR",
  13674. VIEW_FULLSCREEN: "Полный экран",
  13675. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13676. ZOOM_IN: "Увеличить",
  13677. ZOOM_OUT: "Уменьшить",
  13678. FLOOR_NAME: "Этаж ",
  13679. FLOOR_ALL: "Все",
  13680. TERMS: "Условия",
  13681. PORT_TERMS: "Правила пользования",
  13682. TERMS_OF_USE: "Условия использования",
  13683. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13684. CLOSE_TERMS: "Закрыть",
  13685. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13686. HELP: "Помощь",
  13687. HELP_NAVIGATION_TAB: "Навигация",
  13688. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13689. CLOSE: "Закрыть",
  13690. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13691. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13692. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13693. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13694. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13695. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13696. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13697. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13698. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13699. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13700. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13701. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13702. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13703. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13704. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13705. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13706. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13707. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13708. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13709. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13710. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13711. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13712. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13713. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13714. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13715. HELP_MORE_HLR_A: "Фотоколлаж",
  13716. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13717. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13718. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13719. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13720. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13721. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13722. HELP_MORE_TAG_A: "tag™ Posts",
  13723. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13724. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13725. HELP_MORE_ZOOM_A: "Масштаб",
  13726. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13727. HELP_MORE_TOUR_A: "Управление Туром",
  13728. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13729. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13730. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13731. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13732. HELP_MORE_VR_A: "Режим VR",
  13733. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13734. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13735. HELP_MORE_360_A: "360° Views",
  13736. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13737. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13738. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13739. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13740. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13741. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13742. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13743. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13744. WEBVR_LEARN_MORE: "Узнать больше",
  13745. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13746. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13747. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13748. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13749. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13750. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13751. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13752. VR_APP: "port VR App",
  13753. VR_APP_OPEN: "Или открыть через приложение port VR",
  13754. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13755. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13756. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13757. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13758. VR_VIEW_SPACE: "Запустить модель в VR",
  13759. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13760. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13761. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13762. VR_GOT_IT_CAPS: "ЯСНО",
  13763. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13764. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13765. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13766. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13767. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13768. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13769. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13770. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13771. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13772. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13773. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13774. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13775. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13776. VR_ANDROID_DVICES: "Android устройства",
  13777. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13778. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13779. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13780. VR_DOWNLOAD_HERE: "Скачать здесь",
  13781. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13782. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13783. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13784. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13785. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13786. SHARE_TO: "Поделиться",
  13787. SHARE_LINK: "Прямая ссылка",
  13788. SHARE_EXPLORE: "просмотреть",
  13789. SHARE_AT: "на",
  13790. SHARE_WITH: "с",
  13791. SHARE_3D: "в 3D",
  13792. SHARE_COPIED: "Скопировано!",
  13793. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13794. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13795. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13796. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13797. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13798. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13799. ERROR_GENERIC_ACTIONS_3: " или ",
  13800. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13801. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13802. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13803. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13804. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13805. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13806. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13807. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13808. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13809. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13810. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13811. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13812. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13813. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13814. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13815. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13816. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13817. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13818. LINK_TO_LOCATION: "Ссылка на местоположение",
  13819. MENU_COPY: "Копировать",
  13820. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13821. ROTATE: "Вращать",
  13822. MOVE: "Передвигаться",
  13823. INSIDE: "Вид изнутри",
  13824. ZOOM: "Масштаб"
  13825. }
  13826. }
  13827. , {}],
  13828. 116: [function(r, e, t) {
  13829. (function(i) {
  13830. "use strict";
  13831. function re(e) {
  13832. console.log("e1:" + e),
  13833. e = Math.round(.4 * e * 100),
  13834. console.log("e2:" + e);
  13835. var t = $(".progressbar");
  13836. t.find(".bar").css("width", e + "%"),
  13837. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13838. t.find(".perc").text(e + "%")
  13839. }
  13840. $("#gui-loading").fadeIn(200),
  13841. re(.1);
  13842. var e = g_version ? "modeldata.js" : "someData.json";
  13843. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13844. dataType: "json"
  13845. }).done(function(e) {
  13846. var t = matcher(e);
  13847. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13848. t.user = {
  13849. is_authenticated: !1,
  13850. 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"]
  13851. }
  13852. /* t.model.images = [
  13853. {
  13854. "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}",
  13855. "name": "1",
  13856. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  13857. "sid": "20201210_175837426"
  13858. },
  13859. {
  13860. "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}",
  13861. "name": "2",
  13862. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  13863. "sid": "20201210_175835333"
  13864. },
  13865. {
  13866. "name": "区域1 hasmusic",
  13867. "momentTour": "black",
  13868. "musicInfo": {
  13869. "name": "一段音乐.mp3",
  13870. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  13871. "time": 7818
  13872. },
  13873. "locations": [
  13874. {
  13875. "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}",
  13876. "sid": "20210425_152818526",
  13877. "name": "20210425_152818526",
  13878. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  13879. }
  13880. ]
  13881. },
  13882. {
  13883. "name": "区域2",
  13884. "momentTour": "black",
  13885. "locations": [
  13886. {
  13887. "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}",
  13888. "sid": "20210425_152857293",
  13889. "name": "20210425_152857293",
  13890. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  13891. },
  13892. {
  13893. "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}",
  13894. "sid": "20210425_152900502",
  13895. "name": "20210425_152900502",
  13896. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  13897. }
  13898. ]
  13899. },
  13900. {
  13901. "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}",
  13902. "sid": "20210425_152929593",
  13903. "name": "5",
  13904. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  13905. }
  13906. ] */
  13907. try{//处理一下导览数据
  13908. t.model.images = t.model.images.filter(e=>{
  13909. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13910. if(e.locations)e.locations = e.locations.filter(e=>e)
  13911. if(e.locations && e.locations.length == 0)return;
  13912. return e
  13913. })
  13914. }catch(e){console.log(e) }
  13915. window.MP_PREFETCHED_MODELDATA = t
  13916. t.model.summary = t.summary
  13917. t.model.name = t.name
  13918. for(let i in t){
  13919. t[i] == "false" && (t[i] = false)
  13920. }
  13921. re(.7),
  13922. function() {
  13923. function y(e) {
  13924. t.update(e)
  13925. }
  13926. function A(e, t) {
  13927. ne.error(t),
  13928. n.error(t),
  13929. N.report(e, "error-" + t)
  13930. }
  13931. function C(e, t, i) {
  13932. try {
  13933. e.start(t)
  13934. } catch (e) {
  13935. throw ne.warn(e.message),
  13936. function(e) {
  13937. var t = O.details();
  13938. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13939. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13940. N.report(e, "error-webgl-generic"))
  13941. }(i.sid),
  13942. e
  13943. }
  13944. }
  13945. function I(e) {
  13946. e.stopPropagation(),
  13947. e.preventDefault()
  13948. }
  13949. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13950. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13951. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13952. });
  13953. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13954. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13955. */
  13956. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  13957. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  13958. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic
  13959. $("#volume").show();
  13960. }else if (g_version === "one"){
  13961. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  13962. //g_bgAudio.src = manage.dealURL(src) ;
  13963. }
  13964. //隐藏公司logo
  13965. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13966. r("./lib/three75-shim"),
  13967. r("./lib/array-polyfill"),
  13968. r("./lib/performance-polyfill"),
  13969. r("./lib/shaders/CopyShader.js"),
  13970. r("./lib/shaders/HorizontalBlurShader.js"),
  13971. r("./lib/shaders/VerticalBlurShader.js"),
  13972. r("./lib/postprocessing/EffectComposer.js"),
  13973. r("./lib/postprocessing/RenderPass.js"),
  13974. r("./lib/postprocessing/MaskPass.js"),
  13975. r("./lib/postprocessing/ShaderPass.js"),
  13976. window.Promise || (window.Promise = r("promise-polyfill"));
  13977. var E = r("three")
  13978. , _ = r("three")
  13979. , b = (r("./util/sentry"),
  13980. r("./player"))
  13981. , w = r("./director")
  13982. , T = r("./controls/CameraControls")
  13983. , x = r("./model/ModelManager")
  13984. , S = r("./DisplayController")
  13985. , M = r("./label/LabelDisplayController")
  13986. , R = r("./enum/Viewmode")
  13987. , e = r("./util/logger")
  13988. , P = r("./showcase")
  13989. , O = r("./util/browser")
  13990. , L = r("./settings")
  13991. , D = r("./gui/gui")
  13992. , n = r("./gui/error")
  13993. , N = r("./analytics")
  13994. , F = r("./util/transitions")
  13995. , B = r("./effects")
  13996. , V = r("./objects/Skybox")
  13997. , k = (r("./util/common"),
  13998. r("./util/PanoramaCollection"),
  13999. r("./util/math"),
  14000. r("./util/showcase"))
  14001. , U = r("./util/camera")
  14002. , H = (r("./objects/Panorama"),
  14003. r("./cameras/PanoramaCamera"),
  14004. r("./preloaders"))
  14005. , z = r("events").EventEmitter
  14006. , G = r("./featureflags")
  14007. , W = (r("./util/lerp"),
  14008. r("./util/ajax"),
  14009. r("./ab"))
  14010. , j = r("./sdk/automation.js")
  14011. , Y = r("./scene/SceneRenderer")
  14012. , q = r("./scene/QuickstartManager")
  14013. , X = r("./tile/QualityManager.js")
  14014. , Z = r("./localization/localize")
  14015. , K = r("./tag/tagManager")
  14016. , Q = r("./tile/TileDownloader")
  14017. , J = r("./tile/PanoRenderer")
  14018. , ee = (r("./enum/PanoSizeClass"),
  14019. r("./enum/PanoramaEvents"),
  14020. r("./enum/SceneRendererEvents"))
  14021. , t = r("./gui/memoryUsage")
  14022. , te = r("./enum/RenderLayers")
  14023. , ie = r("./TimingData")
  14024. , ne = new e(i);
  14025. e.level = L.logLevel,
  14026. e.consoleEnabled = L.console,
  14027. function() {
  14028. var e = k.getModelIDFromQueryString();
  14029. if (!e)
  14030. return A(null, "loading-failed");
  14031. var t = k.parseSidUrl(e)
  14032. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14033. , n = {
  14034. panoElementsToLoad: 6,
  14035. modelElementsToLoad: 0,
  14036. totalElementsLoaded: 0,
  14037. totalElementsToLoad: 0,
  14038. totalPercentageLoaded: 0,
  14039. progressCallback: null
  14040. }
  14041. , r = document.getElementById("player")
  14042. , o = L.quickstart.enabled
  14043. , a = null
  14044. , s = null
  14045. , l = null
  14046. , c = null
  14047. , h = null
  14048. , u = null
  14049. , d = null
  14050. , p = null
  14051. , f = null
  14052. , g = null
  14053. , m = null
  14054. , v = new ie;
  14055. !function(e) {
  14056. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14057. z.defaultMaxListeners = 1e3,
  14058. function(e) {
  14059. e.addEventListener("dragenter", I, !1),
  14060. e.addEventListener("dragover", I, !1)
  14061. }(e),
  14062. O.valueFromHash("title", !0) || $(document).ready(function() {
  14063. $(".model-title").hide()
  14064. })
  14065. }(r),
  14066. function(e) {
  14067. return G.loadFeatureFlags(e).done(function(e) {
  14068. G.updateDependentSettings(e, L)
  14069. })
  14070. }({
  14071. urlBase: t.urlBase
  14072. }).then(function() {
  14073. return Z.init(),
  14074. function(e, t) {
  14075. var i = P.getModel({
  14076. url: t,
  14077. floors: O.valueFromHash("f", !0),
  14078. autoload: !1
  14079. });
  14080. return $.when(i, y).then(null, function(e) {
  14081. return this
  14082. })
  14083. }(0, e)
  14084. }).then(function(e) {
  14085. return re(.9),
  14086. function(e, t, i, n, r) {
  14087. ne.info("Model data loaded"),
  14088. ne.debug("UUID: " + e.data.job.uuid),
  14089. W.init(G.getFlags()),
  14090. i && N.initKeen({
  14091. token: i,
  14092. appId: n
  14093. }),
  14094. N.initSegment({
  14095. model: e.sid,
  14096. version: "2.25.6-0-gd87e5b1",
  14097. startSource: r.startSource,
  14098. token: t,
  14099. autoplay: r.autoplay,
  14100. quickstart: r.quickstart
  14101. })
  14102. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14103. startSource: i,
  14104. autoplay: L.autoplay,
  14105. quickstart: o
  14106. }),
  14107. g.urls.init()
  14108. }).then(function() {
  14109. return g.loadPanos()
  14110. }).then(function() {
  14111. s = U.getStartCameraOptions(g, g.panos);
  14112. //初始画面
  14113. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  14114. $("<img/>").attr("src", e).on("load", function() {
  14115. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14116. $(this).remove()
  14117. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14118. })
  14119. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  14120. d = function(e) {
  14121. var t = new E.PerspectiveCamera;
  14122. t.layers.enable(te.PANOMARKERS),
  14123. t.layers.enable(te.RETICULE),
  14124. t.layers.enable(te.TAG);
  14125. var o = new E.Scene
  14126. , i = new E.AmbientLight(16777215);
  14127. return o.add(i),
  14128. o.skybox = new V,
  14129. o.add(o.skybox),
  14130. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14131. side: E.DoubleSide
  14132. })),
  14133. o.plane.position.y = 0,
  14134. o.plane.rotateX(-Math.PI / 2),
  14135. o.plane.material.visible = !1,
  14136. o.add(o.plane),
  14137. o.updateMatrixWorld(),
  14138. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14139. if (e.metadata && e.metadata.camera_position) {
  14140. var t = e.metadata.camera_position
  14141. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14142. i.position = t.clone(),
  14143. o.add(i);
  14144. var n = e.metadata.camera_quaternion
  14145. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14146. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14147. }
  14148. }),
  14149. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14150. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14151. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14152. new Y(o,t,B)
  14153. }(g),
  14154. m = function(e, t) {
  14155. var i = e ? 1 : 1e3
  14156. , n = W.tilegen || W.imgopt ? 6 : 2;
  14157. n = O.valueFromHash("tileconc", n);
  14158. var r = new X
  14159. , o = new Q({
  14160. concurrentDownloads: n
  14161. })
  14162. , a = new J
  14163. , s = new x
  14164. , l = new w
  14165. , c = new b(t)
  14166. , h = new T
  14167. , u = new S(i)
  14168. , d = new M
  14169. , p = new K;
  14170. return {
  14171. qualityManager: r,
  14172. panoRenderer: a,
  14173. tileDownloader: o,
  14174. player: c,
  14175. director: l,
  14176. modelManager: s,
  14177. tagManager: p,
  14178. displayController: u,
  14179. labelDisplayController: d,
  14180. controls: h
  14181. }
  14182. }(o, s.mode),
  14183. l = m.controls,
  14184. c = m.player,
  14185. h = m.director,
  14186. u = m.tagManager,
  14187. p = m.tileDownloader,
  14188. f = m.qualityManager,
  14189. m.panoRenderer,
  14190. function(e, t, i, n) {
  14191. var r = i.controls
  14192. , o = i.qualityManager
  14193. , a = i.panoRenderer
  14194. , s = i.tileDownloader
  14195. , l = i.modelManager;
  14196. r.init(n, l),
  14197. j.init(i.director, r, i.player, l, t),
  14198. o.init(l),
  14199. s.init(o),
  14200. a.init(t, s, o),
  14201. l.init(s, a, o),
  14202. l.addModel(e),
  14203. t.addComponent(F)
  14204. }(g, d, m, r),
  14205. c.director = h,
  14206. g.supportsTiles && p.start(),
  14207. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14208. o = !1);
  14209. var e = null;
  14210. if (o) {
  14211. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14212. var t = l.controls[R.PANORAMA];
  14213. a = new q(f,d.scene,d.camera,t,r),
  14214. C(d, r, g),
  14215. e = a.load(s).then(function() {
  14216. d.addComponent(a),
  14217. d.once(ee.AfterRender, function() {
  14218. ne.warn("First render after quickstart load finished.")
  14219. })
  14220. })
  14221. }
  14222. return window.flyToFirst = function() {
  14223. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14224. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14225. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14226. c.flyToPano({
  14227. pano: e,
  14228. lookAtPoint: i
  14229. })
  14230. }
  14231. ,
  14232. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14233. }).then(function() {
  14234. return function(e, t, i, n, r) {
  14235. return r.progressCallback = t,
  14236. N.sessionStart(),
  14237. e.load(n).progress(function(e, t) {
  14238. e.modelElementsToLoad = t[1],
  14239. function(e) {
  14240. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14241. }(e),
  14242. function(e) {
  14243. e.totalElementsLoaded++,
  14244. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14245. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14246. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14247. console.log("pro:" + e.totalPercentageLoaded),
  14248. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14249. }(e)
  14250. }
  14251. .bind(this, r))
  14252. }(g, D.onProgress, 0, !o, n)
  14253. }).then(function() {
  14254. s.quickstart = o,
  14255. function(e, t, i, n) {
  14256. var r = i.qualityManager
  14257. , o = i.panoRenderer
  14258. , a = i.tileDownloader
  14259. , s = i.modelManager
  14260. , l = i.player
  14261. , c = i.director
  14262. , h = i.tagManager
  14263. , u = i.displayController
  14264. , d = i.labelDisplayController
  14265. , p = i.controls;
  14266. t.scene.add(e),
  14267. t.qualityManager = r;
  14268. var f = {
  14269. camera: t.camera,
  14270. director: c,
  14271. modelManager: s,
  14272. tileDownloader: a,
  14273. panoRenderer: o,
  14274. qualityManager: r,
  14275. tagManager: h,
  14276. container: n,
  14277. controls: p
  14278. };
  14279. l.init(f),
  14280. l.setScene(t.scene),
  14281. h.init(s, l),
  14282. c.init(l, s),
  14283. u.init(c, l, s, h, n),
  14284. d.init(l, s, n),
  14285. B.bindEvents(l),
  14286. t.addComponent(h),
  14287. t.addComponent(l),
  14288. t.addComponent(o),
  14289. l.sceneRenderer = t
  14290. }(g, d, m, r),
  14291. d.started || C(d, r, g),
  14292. N.modelLoaded(g, c, l, L.autoplay),
  14293. function(e, t, i, n) {
  14294. return ne.info("Starting player in " + i.mode),
  14295. N.report(t.sid, "started-playing", n, i.quickstart),
  14296. e.start(i)
  14297. }(c, g, s, L.autoplay).done(function() {
  14298. h.autoTour()
  14299. }),
  14300. g.supportsTiles || new H(g,c).start();
  14301. o && (d.removeComponent(a),
  14302. a.destroy(),
  14303. s.pano.enter()),
  14304. D.init(g, h, c, l, d, s, N.getSessionId()),
  14305. D.endLoading(g, h, u),
  14306. d.once(ee.AfterRender, function() {
  14307. v.setAppReadyTime();
  14308. var e = v.calcFullLoadingTime();
  14309. ne.warn("Total load time: " + e / 1e3),
  14310. N.loadComplete(e),
  14311. ne.warn("First render after model load finished.")
  14312. }),
  14313. d.on(ee.MemoryUsageUpdated, y)
  14314. }).fail(A.bind(this, e))
  14315. }()
  14316. }()
  14317. })
  14318. }
  14319. ).call(this, "/js/main.js")
  14320. }
  14321. , {
  14322. "./DisplayController": 1,
  14323. "./TimingData": 2,
  14324. "./ab": 3,
  14325. "./analytics": 4,
  14326. "./cameras/PanoramaCamera": 7,
  14327. "./controls/CameraControls": 9,
  14328. "./director": 15,
  14329. "./effects": 16,
  14330. "./enum/PanoSizeClass": 36,
  14331. "./enum/PanoramaEvents": 37,
  14332. "./enum/RenderLayers": 41,
  14333. "./enum/SceneRendererEvents": 43,
  14334. "./enum/Viewmode": 51,
  14335. "./featureflags": 59,
  14336. "./gui/error": 64,
  14337. "./gui/gui": 65,
  14338. "./gui/memoryUsage": 73,
  14339. "./label/LabelDisplayController": 91,
  14340. "./lib/array-polyfill": 92,
  14341. "./lib/performance-polyfill": 95,
  14342. "./lib/postprocessing/EffectComposer.js": 96,
  14343. "./lib/postprocessing/MaskPass.js": 97,
  14344. "./lib/postprocessing/RenderPass.js": 98,
  14345. "./lib/postprocessing/ShaderPass.js": 99,
  14346. "./lib/shaders/CopyShader.js": 100,
  14347. "./lib/shaders/HorizontalBlurShader.js": 101,
  14348. "./lib/shaders/VerticalBlurShader.js": 102,
  14349. "./lib/three75-shim": 103,
  14350. "./localization/localize": 108,
  14351. "./tag/tagManager": 124,
  14352. "./model/ModelManager": 140,
  14353. "./objects/Panorama": 148,
  14354. "./objects/Skybox": 152,
  14355. "./player": 155,
  14356. "./preloaders": 156,
  14357. "./scene/QuickstartManager": 157,
  14358. "./scene/SceneRenderer": 158,
  14359. "./sdk/automation.js": 164,
  14360. "./settings": 166,
  14361. "./showcase": 168,
  14362. "./tile/PanoRenderer": 169,
  14363. "./tile/QualityManager.js": 170,
  14364. "./tile/TileDownloader": 171,
  14365. "./util/PanoramaCollection": 178,
  14366. "./util/ajax": 181,
  14367. "./util/browser": 182,
  14368. "./util/camera": 183,
  14369. "./util/common": 185,
  14370. "./util/lerp": 188,
  14371. "./util/logger": 189,
  14372. "./util/math": 190,
  14373. "./util/sentry": 192,
  14374. "./util/showcase": 193,
  14375. "./util/transitions": 195,
  14376. events: 202,
  14377. "promise-polyfill": 213,
  14378. three: 217
  14379. }],
  14380. 117: [function(e, t, i) {
  14381. "use strict";
  14382. function n(e) {
  14383. e = e || {},
  14384. r.RawShaderMaterial.call(this, a.extendObject({
  14385. fragmentShader: o.cube.fragmentShader,
  14386. vertexShader: o.cube.vertexShader,
  14387. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14388. name: "CubemapMaterial"
  14389. }, e))
  14390. }
  14391. var r = e("three")
  14392. , o = e("../shaders")
  14393. , a = e("../util/common");
  14394. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14395. t.exports = n
  14396. }
  14397. , {
  14398. "../shaders": 167,
  14399. "../util/common": 185,
  14400. three: 217
  14401. }],
  14402. 118: [function(e, t, i) {
  14403. "use strict";
  14404. function n(e) {
  14405. e = e || {},
  14406. r.RawShaderMaterial.call(this, a.extendObject({
  14407. fragmentShader: o.model.fragmentShader,
  14408. vertexShader: o.model.vertexShader,
  14409. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14410. name: "ModelTextureMaterial"
  14411. }, e))
  14412. }
  14413. var r = e("three")
  14414. , o = e("../shaders")
  14415. , a = e("../util/common");
  14416. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14417. i && (this.uniforms.progress.value = 0),
  14418. e.ensureSkyboxReadyForRender(),
  14419. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14420. this.uniforms.pano0Position.value.copy(e.position),
  14421. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14422. t.ensureSkyboxReadyForRender(),
  14423. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14424. this.uniforms.pano1Position.value.copy(t.position),
  14425. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14426. }
  14427. ,
  14428. t.exports = n
  14429. }
  14430. , {
  14431. "../shaders": 167,
  14432. "../util/common": 185,
  14433. three: 217
  14434. }],
  14435. 119: [function(m, v, e) {
  14436. (function(e) {
  14437. "use strict";
  14438. function t(e, t, i, n) {
  14439. this.div = null,
  14440. this.body = null,
  14441. this.label = e,
  14442. this.description = t,
  14443. this.parsedDescription = [],
  14444. this.media = i || {
  14445. type: null
  14446. },
  14447. this.loadingSpinner = null,
  14448. this.parser = new r({
  14449. supportLinks: !c.valueFromHash("mls"),
  14450. keepLinkLabels: !0
  14451. }),
  14452. this.state = g.CLOSED,
  14453. this.orientation = "",
  14454. this.initialTransform = "",
  14455. this.hovering = !1,
  14456. this.openTransition = null,
  14457. this.closeTransition = null,
  14458. this.openPromise = null,
  14459. this.closePromise = null,
  14460. this.animationTransition = null,
  14461. this.animationScale = 0
  14462. }
  14463. var r = m("../Parser/DescriptionParser")
  14464. , i = m("../Media/Link")
  14465. , n = m("../Media/Image")
  14466. , o = m("../Media/EmbedlyPlayer")
  14467. , a = m("../Media/EmbedlyEmbed")
  14468. , s = m("../../util/transitions")
  14469. , l = m("../../util/lerp")
  14470. , c = m("../../util/browser")
  14471. , b = m("./BillboardEvent")
  14472. , w = m("../Media/MediaEvent")
  14473. , h = m("../Parser/DescriptionChunkType")
  14474. , u = m("events").EventEmitter
  14475. , d = m("./billboardSettings")
  14476. , T = m("./overlaySettings")
  14477. , p = new (m("../../util/logger"))(e)
  14478. , f = document.getElementById("tag-billboards");
  14479. f.addEventListener("touchend", function(e) {
  14480. f.style.pointerEvents = "none"
  14481. }),
  14482. f.addEventListener("touchcancel", function(e) {
  14483. f.style.pointerEvents = "none"
  14484. });
  14485. var g = {
  14486. CLOSED: "closed",
  14487. OPENING: "opening",
  14488. OPEN: "open",
  14489. CLOSING: "closing",
  14490. ACTIVE: "active"
  14491. };
  14492. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14493. this.parsedDescription = this.parser.parse(this.description);
  14494. var t = document.createElement("div");
  14495. t.className = "tag-container has-hotzone",
  14496. this.div = t,
  14497. this.body = document.createElement("div"),
  14498. this.body.className = "tag-body";
  14499. var i = document.createElement("div");
  14500. i.classList.add("tag-content");
  14501. var n = document.createElement("div");
  14502. n.classList.add("tag-text-content");
  14503. var r = document.createElement("div");
  14504. r.className = "tag-label",
  14505. r.textContent = this.label,
  14506. n.appendChild(r);
  14507. var o = document.createElement("div");
  14508. o.className = "tag-desc",
  14509. n.appendChild(o),
  14510. i.appendChild(n),
  14511. this.body.appendChild(i),
  14512. this.appendDescriptionElements(this.parsedDescription, o),
  14513. this.appendMedia(),
  14514. t.appendChild(this.body),
  14515. f.appendChild(t),
  14516. this.bindEvents(t, this.body)
  14517. }
  14518. ,
  14519. t.prototype.bindEvents = function(i, e) {
  14520. function t(n) {
  14521. return function(e) {
  14522. if (!this.div.classList.contains("overlay")) {
  14523. var t, i = document.getElementById("player");
  14524. try {
  14525. t = new MouseEvent(n,e)
  14526. } catch (i) {
  14527. (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)
  14528. }
  14529. i.dispatchEvent(t)
  14530. }
  14531. }
  14532. }
  14533. e.addEventListener("mousedown", function(e) {
  14534. e.stopPropagation()
  14535. }),
  14536. e.addEventListener("mouseup", function(e) {
  14537. e.stopPropagation()
  14538. }),
  14539. i.addEventListener("touchstart", function(e) {
  14540. f.style.pointerEvents = "auto"
  14541. }),
  14542. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14543. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14544. e.addEventListener("mouseover", function(e) {
  14545. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14546. }
  14547. .bind(this)),
  14548. i.addEventListener("mouseenter", function(e) {
  14549. this.state !== g.CLOSING && (this.hovering = !0,
  14550. this.emit(b.ENTER))
  14551. }
  14552. .bind(this)),
  14553. i.addEventListener("mouseleave", function(e) {
  14554. this.hovering = !1,
  14555. this.emit(b.LEAVE)
  14556. }
  14557. .bind(this)),
  14558. i.addEventListener("gesturestart", function(e) {
  14559. e.preventDefault()
  14560. });
  14561. var n = i.querySelector(".tag-text-content")
  14562. , r = 0;
  14563. n.addEventListener("touchstart", function(e) {
  14564. r = e.changedTouches[0].clientY
  14565. }),
  14566. n.addEventListener("touchmove", function(t) {
  14567. function e(e) {
  14568. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14569. }
  14570. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14571. }),
  14572. i.addEventListener("touchmove", function(e) {
  14573. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14574. })
  14575. }
  14576. ,
  14577. t.prototype.appendDescriptionElements = function(e, i) {
  14578. 0 < e.length && this.div.classList.add("has-text"),
  14579. e.forEach(function(e, t) {
  14580. switch (e.type) {
  14581. case h.TEXT:
  14582. i.appendChild(this.createTextElement(e.text));
  14583. break;
  14584. case h.LINK:
  14585. i.appendChild(this.createLinkElement(e.link))
  14586. }
  14587. }
  14588. .bind(this))
  14589. }
  14590. ,
  14591. t.prototype.appendLoadingSpinner = function() {
  14592. this.loadingSpinner = document.createElement("div"),
  14593. this.loadingSpinner.classList.add("loading-spinner");
  14594. var e = document.createElement("div");
  14595. e.classList.add("gui-spinner-icon"),
  14596. this.loadingSpinner.appendChild(e),
  14597. this.body.appendChild(this.loadingSpinner)
  14598. }
  14599. ,
  14600. t.prototype.onMediaLoadFinished = function() {
  14601. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14602. this.applyOrientation(this.orientation),
  14603. this.loadingSpinner = null)
  14604. }
  14605. ,
  14606. t.prototype.appendMedia = function() {
  14607. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14608. this.appendLoadingSpinner();
  14609. var e = document.createElement("div");
  14610. e.classList.add("tag-media-content");
  14611. var t = document.createElement("i");
  14612. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14613. t.classList.add(e)
  14614. }),
  14615. this.body.appendChild(t),
  14616. this.body.appendChild(e),
  14617. this.media.type) {
  14618. case h.IMAGE:
  14619. e.appendChild(this.createImageElement(this.media, this.body));
  14620. break;
  14621. case h.VIDEO:
  14622. e.appendChild(this.createVideoElement(this.media, this.body));
  14623. break;
  14624. case h.RICH:
  14625. e.appendChild(this.createEmbedElement(this.media, this.body))
  14626. }
  14627. }
  14628. }
  14629. ,
  14630. t.prototype.createTextElement = function(e) {
  14631. var t = document.createElement("span");
  14632. return t.textContent = e,
  14633. t
  14634. }
  14635. ,
  14636. t.prototype.createLinkElement = function(e) {
  14637. var t = new i(e);
  14638. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14639. t.createDomElement()
  14640. }
  14641. ,
  14642. t.prototype.createImageElement = function(t, C) {
  14643. function e() {
  14644. function e() {
  14645. p || (E.classList.remove("view-image"),
  14646. a.classList.add("overlay"),
  14647. t(),
  14648. window.addEventListener("resize", A),
  14649. a.addEventListener("click", i),
  14650. c.addEventListener("click", r),
  14651. o.addEventListener("click", n),
  14652. p = !0,
  14653. _.emit(w.IMAGE_OPENED))
  14654. }
  14655. function t() {
  14656. C.classList.add("show-info"),
  14657. s.classList.remove("collapsible"),
  14658. s.style.height = "";
  14659. var e = parseFloat(getComputedStyle(v).lineHeight)
  14660. , t = g + e
  14661. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14662. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14663. , r = n
  14664. , o = r * I.aspect;
  14665. i < o && (r = (o = i) / I.aspect),
  14666. n < r && (o = (r = n) * I.aspect),
  14667. o += m,
  14668. r += m + t,
  14669. C.style.width = o + "px",
  14670. C.style.height = r + "px",
  14671. l.style.paddingTop = e + m + "px",
  14672. 0 < _.description.length && (s.classList.add("collapsible"),
  14673. s.style.height = s.clientHeight + 12 + "px",
  14674. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14675. }
  14676. function i(e) {
  14677. e.target === a && n()
  14678. }
  14679. function n() {
  14680. p && (p = !1,
  14681. E.classList.add("view-image"),
  14682. a.classList.remove("overlay"),
  14683. s.style.height = "",
  14684. l.style.paddingTop = "",
  14685. C.style.width = "",
  14686. C.style.height = "",
  14687. window.removeEventListener("resize", A),
  14688. a.removeEventListener("click", i),
  14689. c.removeEventListener("click", r),
  14690. o.removeEventListener("click", n),
  14691. _.emit(w.IMAGE_CLOSED),
  14692. _.close(!0))
  14693. }
  14694. function r(e) {
  14695. C.classList.toggle("show-info")
  14696. }
  14697. var a = _.div
  14698. , s = a.getElementsByClassName("tag-content")[0]
  14699. , l = a.getElementsByClassName("tag-media-content")[0]
  14700. , o = C.getElementsByClassName("close")[0]
  14701. , c = s.getElementsByClassName("tag-label")[0];
  14702. a.classList.add("has-image"),
  14703. E.classList.add("view-image"),
  14704. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14705. _.applyOrientation(_.orientation);
  14706. 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,
  14707. function() {
  14708. clearInterval(h),
  14709. clearTimeout(u),
  14710. h = setInterval(function() {
  14711. var e = a.clientHeight;
  14712. d !== e && (t(),
  14713. d = e)
  14714. }, 100),
  14715. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14716. }
  14717. );
  14718. I.on(w.IMAGE_OPENING, e),
  14719. _.on(b.ACTIVATE, e),
  14720. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14721. _.on(b.CLOSING, n)
  14722. }
  14723. var I = new n
  14724. , E = I.createDomElement();
  14725. this.once(b.OPENED, function() {
  14726. I.load(t.src).then(e).catch(function(e) {
  14727. p.warn("Failed to load image:", t.src),
  14728. p.warn("with error:", e)
  14729. }).then(this.onMediaLoadFinished.bind(this))
  14730. });
  14731. var _ = this;
  14732. return E
  14733. }
  14734. ,
  14735. t.prototype.createVideoElement = function(t, e) {
  14736. var i = new o({
  14737. autoPlay: !0,
  14738. autoResume: !0,
  14739. startMuted: !1,
  14740. loop: !1
  14741. })
  14742. , n = i.createDomElement();
  14743. return this.once(b.OPENED, function() {
  14744. i.load(t.src).then(function() {
  14745. this.div.classList.add("has-video"),
  14746. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14747. i.play()),
  14748. this.on(b.OPENING, i.show.bind(i)),
  14749. this.on(b.OPENED, i.play.bind(i)),
  14750. this.on(b.CLOSING, i.pause.bind(i)),
  14751. this.on(b.CLOSED, i.hide.bind(i))
  14752. }
  14753. .bind(this)).catch(function(e) {
  14754. p.warn("Failed to embed video:", t.src),
  14755. p.warn("with error:", e)
  14756. }).then(this.onMediaLoadFinished.bind(this))
  14757. }
  14758. .bind(this)),
  14759. n
  14760. }
  14761. ,
  14762. t.prototype.createEmbedElement = function(t, e) {
  14763. var i = new a
  14764. , n = i.createDomElement();
  14765. return this.once(b.OPENED, function() {
  14766. i.load(t.src).then(function() {
  14767. this.div.classList.add("has-embed"),
  14768. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14769. this.applyOrientation(this.orientation),
  14770. this.on(b.OPENING, i.show.bind(i)),
  14771. this.on(b.CLOSED, i.hide.bind(i))
  14772. }
  14773. .bind(this)).catch(function(e) {
  14774. p.warn("Failed to embed:", t.src),
  14775. p.warn("with error:", e)
  14776. }).then(this.onMediaLoadFinished.bind(this))
  14777. }
  14778. .bind(this)),
  14779. n
  14780. }
  14781. ,
  14782. t.prototype.open = function(e) {
  14783. return this.openPromise = $.Deferred(),
  14784. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14785. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14786. this.state !== g.OPEN && (this.emit(b.OPENING),
  14787. e && this.emit(b.ACTIVATING),
  14788. this.state = g.OPENING,
  14789. this.animateOpen(function() {
  14790. e && this.setActiveState(),
  14791. this.openPromise.resolve()
  14792. }
  14793. .bind(this)))
  14794. }
  14795. .bind(this), d.animation.openDelay),
  14796. s.cancel(this.closeTransition),
  14797. this.closePromise && this.closePromise.reject(),
  14798. this.closeTransition = void 0,
  14799. this.openPromise.promise())
  14800. }
  14801. ,
  14802. t.prototype.close = function(e) {
  14803. return this.closePromise = $.Deferred(),
  14804. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14805. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14806. this.state = g.CLOSING,
  14807. this.animateClose())
  14808. }
  14809. .bind(this), d.animation.closeDelay)),
  14810. s.cancel(this.openTransition),
  14811. this.openPromise && this.openPromise.reject(),
  14812. this.openTransition = void 0,
  14813. this.closePromise.resolve(),
  14814. this.closePromise.promise())
  14815. }
  14816. ,
  14817. t.prototype.setActiveState = function() {
  14818. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14819. this.emit(b.ACTIVATE),
  14820. this.div.classList.remove("has-hotzone"))
  14821. }
  14822. ,
  14823. t.prototype.animateOpen = function(e) {
  14824. if (this.state === g.OPENING) {
  14825. if (s.cancel(this.animationTransition),
  14826. c.detectSamsungNative())
  14827. return this.boardOrientation = null,
  14828. this.div.style.visibility = "visible",
  14829. this.emit(b.OPENED),
  14830. this.state = g.OPEN,
  14831. void (e && e());
  14832. this.div.style.webkitTransform = "scale(0)",
  14833. this.div.style.transform = "scale(0)",
  14834. this.div.style.visibility = "visible",
  14835. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14836. this.emit(b.OPENED),
  14837. this.state = g.OPEN,
  14838. e && e()
  14839. }
  14840. .bind(this))
  14841. }
  14842. }
  14843. ,
  14844. t.prototype.animateClose = function(e) {
  14845. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14846. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14847. this.emit(b.CLOSED),
  14848. this.state = g.CLOSED,
  14849. this.div.style.visibility = "hidden",
  14850. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14851. e && e()
  14852. }
  14853. .bind(this)))
  14854. }
  14855. ,
  14856. t.prototype.needsUpdate = function() {
  14857. return this.state !== g.CLOSED
  14858. }
  14859. ,
  14860. t.prototype.update = function(e, t) {
  14861. if (this.needsUpdate()) {
  14862. var i = (this.updateOrientation(e),
  14863. this.calcScale(t))
  14864. , n = {
  14865. x: (e.x + 1) * $("#player").width() / 2,
  14866. y: (e.y + 1) * $("#player").height() / 2
  14867. };
  14868. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14869. this.div.style.webkitTransform = this.div.screenTransform,
  14870. this.div.style.transform = this.div.screenTransform
  14871. }
  14872. }
  14873. ,
  14874. t.prototype.getDimensions = function() {
  14875. return this.div.getBoundingClientRect()
  14876. }
  14877. ,
  14878. t.prototype.calcScale = function(e) {
  14879. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14880. }
  14881. ,
  14882. t.prototype.updateOrientation = function(e) {
  14883. if (this.state !== g.ACTIVE) {
  14884. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14885. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14886. , n = "";
  14887. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14888. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14889. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14890. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14891. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14892. }
  14893. }
  14894. ,
  14895. t.prototype.applyOrientation = function(e) {
  14896. this.div.style.transform = this.div.style.webkitTransform = "",
  14897. this.div.classList.remove("tag-container-" + this.orientation),
  14898. this.div.classList.add("tag-container-" + e);
  14899. var t = window.getComputedStyle(this.div);
  14900. this.initialTransform = t.transform || t.webkitTransform,
  14901. "none" === this.initialTransform && (this.initialTransform = "");
  14902. var i = t.transform.slice(7, -1).split(",")
  14903. , n = -i[4]
  14904. , r = -i[5];
  14905. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14906. this.div.style.transformOrigin = n + "px " + r + "px",
  14907. this.orientation = e
  14908. }
  14909. ,
  14910. v.exports = t
  14911. }
  14912. ).call(this, "/js/tag/Billboard/Billboard.js")
  14913. }
  14914. , {
  14915. "../../util/browser": 182,
  14916. "../../util/lerp": 188,
  14917. "../../util/logger": 189,
  14918. "../../util/transitions": 195,
  14919. "../Media/EmbedlyEmbed": 125,
  14920. "../Media/EmbedlyPlayer": 126,
  14921. "../Media/Image": 128,
  14922. "../Media/Link": 129,
  14923. "../Media/MediaEvent": 131,
  14924. "../Parser/DescriptionChunkType": 133,
  14925. "../Parser/DescriptionParser": 134,
  14926. "./BillboardEvent": 120,
  14927. "./billboardSettings": 121,
  14928. "./overlaySettings": 122,
  14929. events: 202
  14930. }],
  14931. 120: [function(e, t, i) {
  14932. "use strict";
  14933. t.exports = Object.freeze({
  14934. ENTER: "billboard.enter",
  14935. LEAVE: "billboard.leave",
  14936. OPENING: "billboard.opening",
  14937. OPENED: "billboard.open",
  14938. CLOSING: "billboard.closing",
  14939. CLOSED: "billboard.closed",
  14940. ACTIVATING: "billboard.activating",
  14941. ACTIVATE: "billboard.activate"
  14942. })
  14943. }
  14944. , {}],
  14945. 121: [function(e, t, i) {
  14946. "use strict";
  14947. t.exports = Object.freeze({
  14948. animation: Object.freeze({
  14949. hoverOnClosing: !1,
  14950. openDelay: 100,
  14951. closeDelay: 50,
  14952. openDuration: 200,
  14953. closeDuration: 100
  14954. }),
  14955. boardToDiscRatio: 1.2
  14956. })
  14957. }
  14958. , {}],
  14959. 122: [function(e, t, i) {
  14960. "use strict";
  14961. t.exports = Object.freeze({
  14962. boundaryWidth: 30,
  14963. boundaryHeight: 0
  14964. })
  14965. }
  14966. , {}],
  14967. hot: [function(e, t, i) {
  14968. "use strict";
  14969. function n(e, t, i) {
  14970. this.sid = e,
  14971. this.position = this.convertValue(t.position, g.Vector3)
  14972. if(t.quaternion){
  14973. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14974. }else{
  14975. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14976. }
  14977. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14978. this.isSprite = t.isSprite
  14979. this.noAction = t.noAction
  14980. this.linkType = t.linkType || "common"
  14981. this.link = t.link,
  14982. this.model = i,
  14983. this.size = t.size;
  14984. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14985. this.build()
  14986. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14987. this.changeTex()
  14988. this.setVisiblePanos(t.visiblePanos);
  14989. this.infoAttribute = t.infoAttribute;
  14990. }
  14991. var g = e("three")
  14992. , r = e("../shaders")
  14993. , m = e("../settings")
  14994. , v = e("../enum/Viewmode")
  14995. , d = e("../objects/Panorama")
  14996. , o = e("../util/texture")
  14997. , math = e("../util/math")
  14998. , p = new g.Raycaster
  14999. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  15000. var defaultTex1 = o.load(g_HotImage.point);
  15001. var defaultTex2 = o.load(g_HotImage.point2)
  15002. n.prototype.changeTex = function(){
  15003. var u = this.mesh.material.uniforms
  15004. if(this.styleTex.length){
  15005. u.texture1.value = o.load(this.styleTex[0].src);
  15006. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  15007. }else{
  15008. u.texture1.value = defaultTex1;
  15009. u.texture2.value = defaultTex2;
  15010. }
  15011. }
  15012. n.prototype.initStyleImg = function(t){
  15013. this.styleTex = []
  15014. t.styleImg = t.styleImg || [];
  15015. t.styleImg.forEach((src)=>{
  15016. this.styleTex.push({src:manage.dealURL(src)})
  15017. })
  15018. this.changeTex()
  15019. }
  15020. n.prototype.update = function(camera) {
  15021. if(this.isSprite){
  15022. this.mesh.quaternion.copy(camera.quaternion)
  15023. }
  15024. }
  15025. n.prototype.setVisiblePanos = function(visibleData){
  15026. if(visibleData == "get"){
  15027. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15028. }else if(visibleData){
  15029. this.visiblePanos = visibleData;
  15030. }
  15031. }
  15032. n.prototype.build = function() {
  15033. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15034. var e = new g.Mesh(a, new g.ShaderMaterial({
  15035. uniforms: t,
  15036. vertexShader: r.hot.vertexShader,
  15037. fragmentShader: r.hot.fragmentShader,
  15038. transparent: !0
  15039. }))
  15040. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15041. e.dynamic = !0,
  15042. e.position.copy(this.position);
  15043. e.quaternion.copy(this.quaternion)
  15044. t && e.scale.set(t, t, t),
  15045. e.name = this.sid,
  15046. e.type = "hotSprite",
  15047. (e.belongHot = this).link && (e.hotLink = this.link),
  15048. this.mesh = e,
  15049. this.model.add(e),
  15050. g_HotMeshes.push(e);
  15051. }
  15052. n.prototype.createTitleElem = function(title){
  15053. var root = $("#hot");
  15054. var elem = $(`<div> ${title}</div>`)
  15055. root.append(elem);
  15056. this.titleElem = elem;
  15057. }
  15058. n.prototype.showTitle = function(){
  15059. if(!this.titleElem)return;
  15060. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15061. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15062. this.titleElem.css("display","block");
  15063. }
  15064. n.prototype.hideTitle = function(){
  15065. if(!this.titleElem)return;
  15066. this.titleElem.css("display","none");
  15067. }
  15068. ,
  15069. n.prototype.closestPanoTowardTag = function(e, t) {
  15070. var i = []
  15071. , n = []
  15072. , r = this.mesh.position;
  15073. if (e === v.PANORAMA) {
  15074. var o = t.position.clone().sub(r).normalize();
  15075. n.push(d.scoreFunctions.direction(r, o))
  15076. }
  15077. var a = new g.Vector3;
  15078. i.push(function(e) {
  15079. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15080. }, function(e) {
  15081. a.copy(r).sub(e.position);
  15082. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15083. , i = m.tags.navigate.tiltTolerance;
  15084. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15085. },
  15086. (pano)=>{ // add
  15087. player.checkHasNeighbor(pano)
  15088. }
  15089. ),
  15090. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15091. var s = t.model.panos.sortByScore(i, n);
  15092. if (s && m.tags.navigate.lineOfSight) {
  15093. for (var l = 0; l < s.length; l++) {
  15094. var c = s[l].pano
  15095. , h = c.position.distanceTo(r);
  15096. p.set(c.position, r.clone().sub(c.position).normalize());
  15097. var u = p.intersectObjects(t.model.colliders);
  15098. if (0 === u.length || u[0].distance > h)
  15099. return console.log(l),
  15100. c
  15101. }
  15102. return null
  15103. }
  15104. return s && 0 < s.length && s[0].pano
  15105. }
  15106. var getLink = function(link){
  15107. var src = '';
  15108. var r = link.substring(link.indexOf("html") + 4)
  15109. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15110. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15111. return src
  15112. }
  15113. n.prototype.examine = function(e, options) {
  15114. options = options || {}
  15115. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15116. var src = getLink(this.infoAttribute.iframe[0]);
  15117. if(this.linkType=="jumpLink"){
  15118. var newPage = window.open(src, "_blank" );
  15119. newPage.focus();
  15120. }else if(this.linkType=="iframeDiv"){
  15121. var div = document.createElement("div");
  15122. $("body").append(div);
  15123. div.style.position = 'fixed';
  15124. div.style.width = div.style.height = "100%";
  15125. div.style.left = div.style.top = '0';
  15126. div.style["z-index"] = "999"
  15127. var exit = document.createElement("div");
  15128. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15129. exit.style.position = 'absolute';
  15130. exit.style.width = exit.style.height = "50px";
  15131. exit.style.left = '17px'; exit.style.top = "20px"
  15132. exit.style.cursor = "pointer";
  15133. exit.style["background-repeat"] = "no-repeat";
  15134. exit.style["background-size"] = "25%";
  15135. exit.style["background-position"] = "center center";
  15136. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15137. exit.style["border-radius"] = "50%";
  15138. exit.style["z-index"] = "3"
  15139. exit.onclick = ()=>{
  15140. $(div).remove()
  15141. if(g_bgAudio && g_bgAudio.pauseByHot){
  15142. manage.switchBgmState(true)
  15143. }
  15144. }
  15145. var myElement = document.createElement("iframe");
  15146. myElement.style.position = 'absolute';
  15147. myElement.style.width = myElement.style.height = "100%";
  15148. myElement.style.left = myElement.style.top = '0';
  15149. myElement.src = src
  15150. div.appendChild(exit);
  15151. div.appendChild(myElement)
  15152. if(g_bgAudio && !g_bgAudio.paused){
  15153. manage.switchBgmState(false);
  15154. g_bgAudio.pauseByHot = true
  15155. }
  15156. if(g_tourAudio)g_tourAudio.pause()
  15157. }
  15158. return;
  15159. }
  15160. if(!player.currentPano)return;
  15161. var i = document.getElementById("popup");
  15162. if (this.link && !options.dontOpen) {
  15163. g_currentHot = this,
  15164. i.style.display = "block",
  15165. i.classList.add("wait");
  15166. var n = document.createElement("iframe");
  15167. if(g_bgAudio && !g_bgAudio.paused){
  15168. manage.switchBgmState(false);
  15169. g_bgAudio.pauseByHot = true
  15170. }
  15171. if(g_tourAudio)g_tourAudio.pause()
  15172. var src = getLink(this.link )
  15173. n.src = src;
  15174. n.id = "id1",
  15175. n.allowTransparency = "true";
  15176. var a = document.getElementById("id1");
  15177. if (void 0 === a || null == a) {
  15178. document.querySelector(".popup-content").appendChild(n);
  15179. var s = !1;
  15180. window.loaddingSuccess = function() {
  15181. s = !0
  15182. }
  15183. ,
  15184. setTimeout(function e() {
  15185. if (s) {
  15186. var t = document.querySelector("#id1").contentWindow.document;
  15187. t.querySelector("video") && (t.querySelector("video").play(),
  15188. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15189. t.querySelector("audio") && t.querySelector("audio").play()
  15190. } else
  15191. setTimeout(e, 300)
  15192. }, 800)
  15193. }
  15194. }
  15195. var l = e.mode
  15196. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15197. , h = this.mesh.position;
  15198. e.flyingToTag = !0;
  15199. var u = function() {
  15200. e.flyingToTag = !1;
  15201. options.dontOpen || this.link && i.classList.remove("wait")
  15202. }
  15203. .bind(this);
  15204. if (l === v.PANORAMA) {
  15205. var d = {
  15206. pano: c,
  15207. lookAtPoint: h,
  15208. duration: null,
  15209. maxDistanceOverride: null,
  15210. skipWarpingCheck: !1
  15211. };
  15212. e.flyToPano(d, u)
  15213. } else {
  15214. var p = {
  15215. pano: c
  15216. };
  15217. if (h) {
  15218. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15219. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15220. }
  15221. p.callback = u,
  15222. p.duration = 1500,
  15223. p.mode = v.PANORAMA,
  15224. e.flyToNewMode(p)
  15225. }
  15226. }
  15227. ,
  15228. n.prototype.dispose = function(){
  15229. this.mesh.parent.remove(this.mesh);
  15230. var index = g_HotMeshes.indexOf(this.mesh);
  15231. g_HotMeshes.splice(index,1)
  15232. }
  15233. /* n.prototype.conversionArray = function(e) {
  15234. if ("[object Array]" == Object.prototype.toString.call(e))
  15235. return e;
  15236. var t = [];
  15237. for (var i in e)
  15238. t.push(parseFloat(e[i]));
  15239. return t
  15240. } */
  15241. n.prototype.convertValue = function(v ,Type){
  15242. var value;
  15243. if(v instanceof Array){
  15244. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15245. value = new Type().fromArray(v);
  15246. }else{
  15247. for(let i in v){v[i] = parseFloat(v[i])}
  15248. value = new Type().copy(v);
  15249. }
  15250. return value
  15251. }
  15252. ,
  15253. t.exports = n
  15254. }
  15255. , {
  15256. three: 217,
  15257. "../shaders": 167,
  15258. "../enum/Viewmode": 51,
  15259. "../objects/Panorama": 148,
  15260. "../util/texture": 194,
  15261. "../settings": 166,
  15262. "../util/math": 190,
  15263. }],
  15264. 123: [function(M, R, e) {
  15265. (function(e) {
  15266. "use strict";
  15267. function d(e, t, i) {
  15268. var n = i.version || "0";
  15269. "0" !== n && w.info("tag defined using version " + n),
  15270. this.model = e,
  15271. this.sid = t,
  15272. this.color = (new f.Color).set(i.color || o.tagDefault),
  15273. this.hoverColor = o._darken(this.color, .2),
  15274. this.floor = null,
  15275. this.floorIndex = i.floor,
  15276. this.mode = m.PANORAMA,
  15277. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15278. this.obj3d = null,
  15279. this.disc = null,
  15280. this.materials = {
  15281. disc: null,
  15282. pole: null
  15283. },
  15284. this.position = (new f.Vector3).copy(i.position),
  15285. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15286. this.discWorldPosition = null,
  15287. this.discScale = .05,
  15288. this.poleEnabled = i.stem.enabled,
  15289. this.billboard = new r(i.label,i.description,i.media,this),
  15290. this.visibleTransition = null,
  15291. this.hoveringDisc = !1
  15292. }
  15293. 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"),
  15294. 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);
  15295. d.prototype = Object.create(b.prototype),
  15296. d.raycaster = new f.Raycaster,
  15297. d.prototype.bindEvents = function() {
  15298. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15299. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15300. }
  15301. ,
  15302. d.prototype.build = function() {
  15303. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15304. this.floor && (this.billboard.build(this.model.sid),
  15305. this.obj3d = this.buildObject3D(),
  15306. this.floor.add(this.obj3d)),
  15307. this
  15308. }
  15309. ,
  15310. d.prototype.buildObject3D = function() {
  15311. var e = new f.Object3D;
  15312. e.position.copy(this.position);
  15313. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15314. t.bg.value = x,
  15315. t.mask.value = T,
  15316. t.color.value.copy(this.color),
  15317. this.materials.disc = new f.RawShaderMaterial({
  15318. transparent: !0,
  15319. vertexShader: A.tagDisc.vertexShader,
  15320. fragmentShader: A.tagDisc.fragmentShader,
  15321. uniforms: t
  15322. }),
  15323. this.disc = new f.Mesh(S,this.materials.disc),
  15324. this.disc.layers.set(a.TAG),
  15325. this.disc.position.copy(this.discPosition),
  15326. this.disc.renderOrder = s.tagDisc;
  15327. var i = (this.disc.tag = this).buildPole();
  15328. return i.layers.set(a.TAG),
  15329. i.renderOrder = s.tagStem,
  15330. e.add(i),
  15331. e.layers.set(a.TAG),
  15332. e.add(this.disc)
  15333. }
  15334. ,
  15335. d.prototype.buildPole = function() {
  15336. var e = new f.BufferGeometry
  15337. , t = new Float32Array(6);
  15338. return t[0] = t[1] = t[2] = 0,
  15339. t[3] = this.discPosition.x,
  15340. t[4] = this.discPosition.y,
  15341. t[5] = this.discPosition.z,
  15342. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15343. this.materials.pole = new f.LineBasicMaterial({
  15344. linewidth: g.tags.pole.width,
  15345. color: g.tags.pole.color,
  15346. opacity: 0,
  15347. visible: this.poleEnabled,
  15348. transparent: !0,
  15349. depthWrite: !1
  15350. }),
  15351. new f.Line(e,this.materials.pole)
  15352. }
  15353. ,
  15354. d.prototype.setFreeState = function(e) {
  15355. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15356. this.materials.disc.uniforms.color.value = this.color
  15357. }
  15358. .bind(this))
  15359. }
  15360. ,
  15361. d.prototype.setHoverState = function(e) {
  15362. this.billboard.open(e),
  15363. this.materials.disc.uniforms.color.value = this.hoverColor
  15364. }
  15365. ,
  15366. d.prototype.hide = function(e, t) {
  15367. var i = $.Deferred();
  15368. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15369. return i.resolve().promise();
  15370. e = e || 0,
  15371. t = t || 0,
  15372. C.cancel(this.visibleTransition);
  15373. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15374. return this.visibleTransition = C.start((n = this,
  15375. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15376. o = I.property(n.materials.pole, "opacity", 0),
  15377. function(e) {
  15378. r(e),
  15379. n.materials.pole && o(e)
  15380. }
  15381. ), s * a, function() {
  15382. i.resolve()
  15383. }, l, E[g.warp.blendEasing]),
  15384. i.promise()
  15385. }
  15386. ,
  15387. d.prototype.show = function(e, t) {
  15388. var i = $.Deferred();
  15389. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15390. return i.resolve().promise();
  15391. e = e || 0,
  15392. t = t || 0,
  15393. C.cancel(this.visibleTransition);
  15394. 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;
  15395. return this.visibleTransition = C.start((n = this,
  15396. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15397. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15398. function(e) {
  15399. r(e),
  15400. n.materials.pole && o(e)
  15401. }
  15402. ), s * a, function() {
  15403. i.resolve()
  15404. }, l, E[g.warp.blendEasing]),
  15405. i.promise()
  15406. }
  15407. ,
  15408. d.prototype.closestPanoTowardTag = function(e, t) {
  15409. var i = []
  15410. , n = []
  15411. , r = this.disc.getWorldPosition();
  15412. if (e === m.PANORAMA) {
  15413. var o = t.position.clone().sub(r).normalize();
  15414. i.push(y.filters.isPanoAligned()),
  15415. i.push(y.filters.inPanoDirection(r, o, .5)),
  15416. i.push(y.filters.isNeighbourPanoTo(t)),
  15417. n.push(y.scoreFunctions.direction(r, o))
  15418. }
  15419. var a = new f.Vector3;
  15420. i.push(function(e) {
  15421. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15422. }, function(e) {
  15423. a.copy(r).sub(e.position);
  15424. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15425. , i = g.tags.navigate.tiltTolerance;
  15426. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15427. }),
  15428. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15429. var s = this.model.panos.sortByScore(i, n);
  15430. if (g.tags.navigate.lineOfSight) {
  15431. for (var l = 0; l < s.length; l++) {
  15432. var c = s[l].pano
  15433. , h = c.position.distanceTo(r);
  15434. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15435. return null;
  15436. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15437. var u = d.raycaster.intersectObjects(this.model.colliders);
  15438. if (0 === u.length || u[0].distance > h)
  15439. return c
  15440. }
  15441. return null
  15442. }
  15443. return 0 < s.length && s[0].pano
  15444. }
  15445. ,
  15446. d.prototype.examine = function(i) {
  15447. if(!player.currentPano)return;
  15448. var e = i.mode
  15449. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15450. , t = this.disc.getWorldPosition();
  15451. this.billboard.setActiveState();
  15452. var r = function() {
  15453. var e = this.billboard.getDimensions()
  15454. , t = new f.Vector3;
  15455. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15456. t.unproject(i.camera),
  15457. i.flyToPano({
  15458. pano: n,
  15459. lookAtPoint: t
  15460. })
  15461. }
  15462. .bind(this);
  15463. if (e === m.PANORAMA)
  15464. if (n !== i.currentPano) {
  15465. var o = {
  15466. pano: n,
  15467. lookAtPoint: t,
  15468. duration: null,
  15469. maxDistanceOverride: null,
  15470. skipWarpingCheck: !1
  15471. };
  15472. i.flyToPano(o, r)
  15473. } else
  15474. setTimeout(function() {
  15475. this.billboard.open().then(function() {
  15476. r()
  15477. })
  15478. }
  15479. .bind(this), 0);
  15480. else {
  15481. var a = {
  15482. pano: n
  15483. };
  15484. if (t) {
  15485. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15486. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15487. }
  15488. a.callback = r,
  15489. a.duration = 1500,
  15490. a.mode = m.PANORAMA,
  15491. i.flyToNewMode(a)
  15492. }
  15493. }
  15494. ,
  15495. d.prototype.update = (n = new f.Vector3,
  15496. function(e, t) {
  15497. this.discWorldPosition = this.disc.getWorldPosition(),
  15498. this.updateDisc(e, t),
  15499. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15500. n.z < 1 && (n.y *= -1,
  15501. this.billboard.update(n, this.getDiscRadius(n, t))))
  15502. }
  15503. ),
  15504. d.prototype.updateDisc = (l = new f.Vector3,
  15505. c = new f.Vector3,
  15506. h = new f.Vector3,
  15507. u = new f.Vector3,
  15508. p = new f.Vector3,
  15509. function(e, t) {
  15510. var i = g.tags.visibility
  15511. , n = g.tags.disc.scale
  15512. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15513. 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)),
  15514. this.obj3d.visible) {
  15515. this.disc.quaternion.copy(t.quaternion);
  15516. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15517. l.copy(this.discWorldPosition).project(t),
  15518. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15519. h.set(o / 2, 0, 0).add(c),
  15520. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15521. p.copy(u).unproject(t);
  15522. var a = p.distanceTo(this.discWorldPosition)
  15523. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15524. this.discScale = a * s,
  15525. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15526. }
  15527. }
  15528. ),
  15529. d.prototype.getDiscRadius = (i = new f.Vector3,
  15530. function(e, t) {
  15531. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15532. Math.abs(e.x - i.x) * $("#player").width()
  15533. }
  15534. ),
  15535. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15536. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15537. }
  15538. ,
  15539. d.prototype.offScreen = function(e, t) {
  15540. var i = e.getWorldPosition().project(t);
  15541. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15542. }
  15543. ,
  15544. d.viewportScale = function() {
  15545. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15546. d.viewportHeight = $("#player").height(),
  15547. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15548. d.currentViewportScale
  15549. }
  15550. ,
  15551. R.exports = d
  15552. }
  15553. ).call(this, "/js/tag/tag.js")
  15554. }
  15555. , {
  15556. "../enum/Colors": 19,
  15557. "../enum/RenderLayers": 41,
  15558. "../enum/RenderOrder": 42,
  15559. "../enum/Viewmode": 51,
  15560. "../objects/Panorama": 148,
  15561. "../settings": 166,
  15562. "../shaders": 167,
  15563. "../util/common": 185,
  15564. "../util/easing": 186,
  15565. "../util/lerp": 188,
  15566. "../util/logger": 189,
  15567. "../util/math": 190,
  15568. "../util/texture": 194,
  15569. "../util/transitions": 195,
  15570. "./Billboard/Billboard": 119,
  15571. "./Billboard/BillboardEvent": 120,
  15572. events: 202,
  15573. three: 217
  15574. }],
  15575. 124: [function(M, R, e) {
  15576. (function(e) {
  15577. "use strict";
  15578. function t() {
  15579. this.tagState = T.IDLE,
  15580. this.intersectTag = null,
  15581. this.hoveredTag = null,
  15582. this.activeTag = null,
  15583. this.tagDiscs = [],
  15584. this.raycaster = new i.Raycaster,
  15585. this.modelManager = null,
  15586. this.player = null,
  15587. this.totaltags = 0,
  15588. this.navigatingViaTag = !1,
  15589. this.enabled = !1
  15590. }
  15591. 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"),
  15592. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15593. r.extend(t, x),
  15594. t.prototype.init = function(e, t) {
  15595. this.modelManager = e,
  15596. this.player = t,
  15597. this.updateModel(),
  15598. this.bindEvents()
  15599. }
  15600. ,
  15601. t.prototype.update = function(e) {
  15602. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15603. }
  15604. ,
  15605. t.prototype.updateTags = function(e, t, i, n) {
  15606. for (var r in this.model.tags)
  15607. this.model.tags[r].update(e, t, i, n)
  15608. }
  15609. ,
  15610. t.prototype.updateModel = function() {
  15611. this.model = this.modelManager.getActiveModel(),
  15612. this.gettagsFromModel(),
  15613. this.totaltags = Object.keys(this.model.tags).length
  15614. }
  15615. ,
  15616. t.prototype.gettagsFromModel = function() {
  15617. for (var e in this.tagDiscs = [],
  15618. this.model.tags) {
  15619. var t = this.model.tags[e].disc;
  15620. t && this.tagDiscs.push(t)
  15621. }
  15622. }
  15623. ,
  15624. t.prototype.bindEvents = function() {
  15625. function e() {
  15626. Object.keys(this.model.tags).forEach(function(e) {
  15627. var t = this.model.tags[e];
  15628. t.bindEvents(),
  15629. t.billboard.on(y.LINK_CLICK, function(e) {
  15630. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15631. }
  15632. .bind(this)),
  15633. t.billboard.on(y.IMAGE_OPENED, function() {
  15634. this.tagState = T.EXAMINE,
  15635. this.emit(y.IMAGE_OPENED)
  15636. }
  15637. .bind(this)),
  15638. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15639. }
  15640. .bind(this))
  15641. }
  15642. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15643. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15644. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15645. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15646. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15647. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15648. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15649. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15650. e.call(this)
  15651. }
  15652. ,
  15653. t.prototype.navigateViaLink = function(e) {
  15654. var t = a.deserialize(e);
  15655. if (t)
  15656. if (t.mode === C.PANORAMA) {
  15657. try {
  15658. this.player.model.panos.get(t.panoId)
  15659. } catch (e) {
  15660. return void S.warn("Unable to find panorama location", t.panoId)
  15661. }
  15662. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15663. } else {
  15664. var i = {
  15665. cameraMode: t.mode,
  15666. position: t.position,
  15667. quaternion: t.quaternion,
  15668. scanId: t.panoId,
  15669. orthoZoom: t.zoom,
  15670. floorVisibility: t.floorVisibility,
  15671. thumbUrl: null,
  15672. name: null
  15673. };
  15674. this.player.flyToNewMode({
  15675. mode: t.mode,
  15676. duration: m.warp.outsideTime,
  15677. warpDest: new g(i),
  15678. force: !0
  15679. })
  15680. }
  15681. }
  15682. ,
  15683. t.prototype.handleWarpStart = function(e, t, i, n) {
  15684. this.dismissExaminedTag(),
  15685. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15686. e && (i = E.END),
  15687. this.hideShowTagsForBlackoutStyle(i, n))
  15688. }
  15689. ,
  15690. t.prototype.handleWarpInterruption = function(e, t, i) {
  15691. null != i || (i = m.warp.teleportTime),
  15692. this.hideShowTagsForBlackoutStyle(t, i)
  15693. }
  15694. ,
  15695. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15696. var i = 0
  15697. , n = 0
  15698. , r = t / 2;
  15699. switch (null != e || (e = E.MIDDLE),
  15700. e) {
  15701. case E.END:
  15702. this.hideAlltags(r);
  15703. break;
  15704. case E.BEGINNING:
  15705. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15706. break;
  15707. case E.NONE:
  15708. break;
  15709. case E.MIDDLE:
  15710. n = i = r,
  15711. this.hideAlltags(n),
  15712. setTimeout(function() {
  15713. this.showAlltags(i)
  15714. }
  15715. .bind(this), n);
  15716. break;
  15717. case E.FADEIN:
  15718. setTimeout(function() {
  15719. this.showAlltags(r)
  15720. }
  15721. .bind(this), r)
  15722. }
  15723. }
  15724. ,
  15725. t.prototype.onPlayerModeChanging = function(e, t) {
  15726. t !== C.PANORAMA && this.dismissExaminedTag(),
  15727. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15728. var i = t !== C.OUTDOOR;
  15729. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15730. }
  15731. ,
  15732. t.prototype.onPanoChange = function(e, t) {
  15733. var i = this.navigatingViaTag;
  15734. if (this.navigatingViaTag = !1,
  15735. !i) {
  15736. this.dismissExaminedTag();
  15737. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15738. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15739. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15740. }
  15741. }
  15742. ,
  15743. t.prototype.onPlayerReady = function(e, t, i) {
  15744. this.startAlltags(e, t ? i : null)
  15745. }
  15746. ,
  15747. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15748. this.updateClosestTags(e)
  15749. }
  15750. ,
  15751. t.prototype.dismissExaminedTag = function() {
  15752. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15753. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15754. this.hoveredTag = null)
  15755. }
  15756. ,
  15757. t.prototype.startAlltags = function(e, t) {
  15758. this.model.shouldShowtags = m.tags.enabled,
  15759. this.enabled = !0,
  15760. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15761. t && setTimeout(function() {
  15762. this.activateTag(this.model.getTagBySid(t))
  15763. }
  15764. .bind(this), m.tags.startup.fadeInDuration / 2))
  15765. }
  15766. ,
  15767. t.prototype.showAlltags = function(e, t, i) {
  15768. function n() {
  15769. ++o === this.totaltags && (this.model.tagsShown = !0,
  15770. r.resolve())
  15771. }
  15772. var r = $.Deferred();
  15773. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15774. return r.resolve().promise();
  15775. var o = 0;
  15776. for (var a in this.model.tags) {
  15777. this.model.tags[a].show(e, t).done(n.bind(this))
  15778. }
  15779. return r.promise()
  15780. }
  15781. ,
  15782. t.prototype.hideAlltags = function(e, t) {
  15783. function i() {
  15784. ++r === this.totaltags && (this.model.tagsShown = !1,
  15785. n.resolve())
  15786. }
  15787. var n = $.Deferred()
  15788. , r = 0;
  15789. for (var o in this.model.tags) {
  15790. var a = this.model.tags[o];
  15791. a.hide(e, t).done(i.bind(this)),
  15792. a === this.activeTag && this.dismissActiveTag()
  15793. }
  15794. return n.promise()
  15795. }
  15796. ,
  15797. t.prototype.enableHovering = function() {
  15798. this.enabled = !0
  15799. }
  15800. ,
  15801. t.prototype.disableHovering = function() {
  15802. this.enabled = !1
  15803. }
  15804. ,
  15805. t.prototype.activateTag = function(e, t) {
  15806. t = t || T.EXAMINE,
  15807. this.activeTag = e,
  15808. this.activeTag.hoveringDisc = !0,
  15809. this.activeTag.setHoverState(t === T.EXAMINE),
  15810. this.tagState = t,
  15811. this.emit(b.TagActivated, e)
  15812. }
  15813. ,
  15814. t.prototype.dismissActiveTag = function() {
  15815. this.activeTag.hoveringDisc = !1,
  15816. this.activeTag.setFreeState(!0);
  15817. var e = this.activeTag;
  15818. this.activeTag = null,
  15819. this.tagState = T.IDLE,
  15820. this.emit(b.TagDismissed, e)
  15821. }
  15822. ,
  15823. t.prototype.clickedOnTag = function(e) {
  15824. var t = function() {
  15825. this.navigatingViaTag = !0,
  15826. this.activeTag.examine(this.player),
  15827. this.emit(b.TagNavigation, this.activeTag)
  15828. }
  15829. .bind(this);
  15830. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15831. this.activeTag = this.intersectTag,
  15832. t(),
  15833. !0) : (this.dismissActiveTag(),
  15834. !1)
  15835. }
  15836. ,
  15837. t.prototype.intersecttag = (s = new i.Vector3,
  15838. l = new i.Vector3,
  15839. c = new i.Vector3,
  15840. function(e, t, i) {
  15841. if (!this.enabled)
  15842. return null;
  15843. var n = null
  15844. , r = this.tagDiscs.filter(function(e) {
  15845. return e.parent.visible
  15846. });
  15847. if (0 < r.length) {
  15848. var o = this.model.floors.reduce(function(e, t) {
  15849. return t.hidden ? e : e.concat(t.collider.children)
  15850. }, r);
  15851. s.set(e.x, e.y, -1).unproject(i),
  15852. l.set(e.x, e.y, 1).unproject(i),
  15853. c.copy(l).sub(s).normalize(),
  15854. this.raycaster.set(s, c);
  15855. var a = this.raycaster.intersectObjects(o);
  15856. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15857. }
  15858. return this.intersectTag = n,
  15859. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15860. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15861. this.hoveredTag = n
  15862. }
  15863. .bind(this)),
  15864. n.billboard.on(v.LEAVE, function() {
  15865. this.hoveredTag = null
  15866. }
  15867. .bind(this))),
  15868. this.activateTag(n, T.BROWSE))),
  15869. n
  15870. }
  15871. ),
  15872. t.prototype.rankedtagInDirection = (h = [],
  15873. u = [],
  15874. d = new i.Vector3,
  15875. p = new i.Vector3,
  15876. f = new i.Vector3,
  15877. function(e, t, i, n) {
  15878. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15879. var a = this.closesttags[o];
  15880. p.copy(a.position),
  15881. p.add(a.discPosition),
  15882. d.copy(t),
  15883. d.sub(p).negate(),
  15884. d.normalize();
  15885. var s = d.dot(n);
  15886. if (0 <= s && (f.copy(p),
  15887. f.project(i),
  15888. this.intersecttag(f, !1, i))) {
  15889. if (r >= h.length)
  15890. for (var l = 0; l < 64; l++)
  15891. h.push({
  15892. tag: a,
  15893. dot: s
  15894. });
  15895. var c = h[r];
  15896. c.tag = a,
  15897. c.dot = s,
  15898. c.position = math.projectPositionToCanvas(p, i),
  15899. u.push(c),
  15900. r++
  15901. }
  15902. }
  15903. return u.sort(function(e, t) {
  15904. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15905. }),
  15906. e < u.length ? u[e].tag : null
  15907. }
  15908. ),
  15909. t.prototype.updateClosestTags = (o = new i.Vector3,
  15910. function(e) {
  15911. this.closesttags || (this.closesttags = []),
  15912. this.closesttags.length = 0;
  15913. var t = this.model.tags;
  15914. if (t)
  15915. for (var i in t)
  15916. if (t.hasOwnProperty(i)) {
  15917. var n = t[i]
  15918. , r = n.position;
  15919. o.copy(e),
  15920. o.sub(r).negate(),
  15921. o.lengthSq() < 30 && this.closesttags.push(n)
  15922. }
  15923. }
  15924. ),
  15925. R.exports = t
  15926. }
  15927. ).call(this, "/js/tag/tagManager.js")
  15928. }
  15929. , {
  15930. "../controls/serializer": 14,
  15931. "../enum/BlackoutStyle": 18,
  15932. "../enum/tagEvents": 32,
  15933. "../enum/ModelManagerEvents": 33,
  15934. "../enum/PlayerEvents": 40,
  15935. "../enum/TagStates": 44,
  15936. "../enum/Viewmode": 51,
  15937. "../enum/WarpStyle": 52,
  15938. "../objects/Snapshot": 153,
  15939. "../settings": 166,
  15940. "../util/common": 185,
  15941. "../util/lerp": 188,
  15942. "../util/logger": 189,
  15943. "./Billboard/BillboardEvent": 120,
  15944. "./Media/LinkType": 130,
  15945. "./Media/MediaEvent": 131,
  15946. events: 202,
  15947. three: 217
  15948. }],
  15949. 125: [function(r, o, e) {
  15950. (function(e) {
  15951. "use strict";
  15952. function t() {
  15953. this.embedWrapper = null,
  15954. this.embedElement = null
  15955. }
  15956. var i = r("../../util/ajax")
  15957. , a = r("./mediaSettings")
  15958. , n = r("../../settings")
  15959. , s = new (r("../../util/logger"))(e);
  15960. t.prototype.createDomElement = function() {
  15961. return this.embedWrapper = document.createElement("div"),
  15962. this.embedWrapper.classList.add("tag-embed"),
  15963. this.embedWrapper.classList.add("hidden"),
  15964. this.embedWrapper
  15965. }
  15966. ,
  15967. t.prototype.load = function(e) {
  15968. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15969. return new Promise(function(r, o) {
  15970. i.get(t).then(function(e) {
  15971. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15972. this.embedWrapper.innerHTML = e.html;
  15973. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15974. if (this.embedWrapper.style.width = t + "px",
  15975. e.height) {
  15976. var i = e.height / e.width;
  15977. this.embedWrapper.style.height = t * i + "px"
  15978. }
  15979. this.embedElement = this.embedWrapper.firstChild;
  15980. var n = [];
  15981. try {
  15982. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15983. } catch (e) {
  15984. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15985. }
  15986. n.forEach(function(e) {
  15987. e.setAttribute("target", "_blank")
  15988. }),
  15989. this.embedElement.classList.add("hidden"),
  15990. this.embedWrapper.classList.remove("hidden"),
  15991. r()
  15992. } else
  15993. o("Not a valid embed")
  15994. }
  15995. .bind(this), function(e) {
  15996. o(e.response)
  15997. })
  15998. }
  15999. .bind(this))
  16000. }
  16001. ,
  16002. t.prototype.show = function() {
  16003. this.embedElement && this.embedElement.classList.remove("hidden")
  16004. }
  16005. ,
  16006. t.prototype.hide = function() {
  16007. this.embedElement && this.embedElement.classList.add("hidden")
  16008. }
  16009. ,
  16010. o.exports = t
  16011. }
  16012. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16013. }
  16014. , {
  16015. "../../settings": 166,
  16016. "../../util/ajax": 181,
  16017. "../../util/logger": 189,
  16018. "./mediaSettings": 132
  16019. }],
  16020. 126: [function(a, s, e) {
  16021. (function(e) {
  16022. "use strict";
  16023. function t(e) {
  16024. r.call(this),
  16025. this.options = e,
  16026. this.playerControls = null,
  16027. this.state = o.NOT_READY
  16028. }
  16029. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16030. Object.freeze({
  16031. NOT_READY: "player.not.ready",
  16032. CUED: "player.cued",
  16033. PLAYING: "player.playing",
  16034. PAUSED: "player.paused"
  16035. }));
  16036. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16037. return this.embedWrapper = document.createElement("div"),
  16038. this.embedWrapper.classList.add("tag-video"),
  16039. this.embedWrapper.classList.add("hidden"),
  16040. this.embedWrapper
  16041. }
  16042. ,
  16043. t.prototype.load = function(e) {
  16044. var t = function() {
  16045. function e(e) {
  16046. this.playerState = e
  16047. }
  16048. this.playerControls = new playerjs.Player(this.embedElement),
  16049. this.playerControls.on("ready", function(e) {
  16050. this.playerState = o.CUED,
  16051. this.options.startMuted && this.playerControls.mute()
  16052. }
  16053. .bind(this)),
  16054. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16055. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16056. this.playerControls.on("ended", function(e) {
  16057. this.playerControls.setCurrentTime(0),
  16058. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16059. }
  16060. .bind(this))
  16061. }
  16062. .bind(this);
  16063. return r.prototype.load.call(this, e).then(t.bind(this))
  16064. }
  16065. ,
  16066. t.prototype.play = (i = n.isMobile(),
  16067. function() {
  16068. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16069. }
  16070. ),
  16071. t.prototype.pause = function() {
  16072. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16073. }
  16074. ,
  16075. s.exports = t
  16076. }
  16077. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16078. }
  16079. , {
  16080. "../../util/browser": 182,
  16081. "../../util/logger": 189,
  16082. "./EmbedlyEmbed": 125
  16083. }],
  16084. 127: [function(t, i, e) {
  16085. (function(e) {
  16086. "use strict";
  16087. var r = t("../../util/ajax")
  16088. , o = new (t("./mediaSettings"),
  16089. t("../../util/logger"))(e)
  16090. , a = Promise.resolve();
  16091. i.exports.enqueue = function(i) {
  16092. function n() {}
  16093. return a = new Promise(function(e, t) {
  16094. a.catch(n).then(function() {
  16095. (o.debug("requesting file from embedly:", i.href),
  16096. r.get(i.href, {
  16097. responseType: i.responseType
  16098. }).then(function(e) {
  16099. return o.debug("requesting file finished:", i.href),
  16100. e
  16101. })).then(e, t)
  16102. })
  16103. }
  16104. )
  16105. }
  16106. }
  16107. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16108. }
  16109. , {
  16110. "../../util/ajax": 181,
  16111. "../../util/logger": 189,
  16112. "./mediaSettings": 132
  16113. }],
  16114. 128: [function(s, l, e) {
  16115. (function(e) {
  16116. "use strict";
  16117. function t() {
  16118. this.imageWrapper = null,
  16119. this.width = 0,
  16120. this.height = 0,
  16121. this.aspect = 1
  16122. }
  16123. var i = s("./MediaEvent")
  16124. , n = s("./EmbedlyQueue")
  16125. , r = s("events").EventEmitter
  16126. , o = s("../../util/logger")
  16127. , a = s("../../settings");
  16128. new o(e),
  16129. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16130. return this.imageWrapper = document.createElement("div"),
  16131. this.imageWrapper.classList.add("tag-image"),
  16132. this.imageWrapper.classList.add("hidden"),
  16133. this.imageWrapper.addEventListener("click", function(e) {
  16134. e.stopPropagation(),
  16135. this.emit(i.IMAGE_OPENING),
  16136. this.imageWrapper.style.pointerEvents = "none"
  16137. }
  16138. .bind(this)),
  16139. this.imageWrapper
  16140. }
  16141. ,
  16142. t.prototype.onClosed = function() {
  16143. this.imageWrapper.style.pointerEvents = "auto"
  16144. }
  16145. ,
  16146. t.prototype.load = function(e) {
  16147. var t = Math.max(window.screen.height, window.screen.width)
  16148. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16149. return new Promise(function(o, e) {
  16150. n.enqueue({
  16151. href: i,
  16152. responseType: "arraybuffer"
  16153. }).then(function(e) {
  16154. var t = new Uint8Array(e)
  16155. , i = new Blob([t])
  16156. , n = new window.Image;
  16157. n.addEventListener("load", function(e) {
  16158. var t = e.target;
  16159. this.width = t.naturalWidth,
  16160. this.height = t.naturalHeight,
  16161. this.aspect = this.width / this.height;
  16162. var i = e.target.src;
  16163. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16164. this.imageWrapper.style.width = this.width + "px",
  16165. this.imageWrapper.style.height = this.height + "px",
  16166. this.imageWrapper.classList.remove("hidden"),
  16167. o()
  16168. }
  16169. .bind(this));
  16170. var r = URL.createObjectURL(i);
  16171. n.src = r
  16172. }
  16173. .bind(this), e)
  16174. }
  16175. .bind(this))
  16176. }
  16177. ,
  16178. l.exports = t
  16179. }
  16180. ).call(this, "/js/tag/Media/Image.js")
  16181. }
  16182. , {
  16183. "../../settings": 166,
  16184. "../../util/logger": 189,
  16185. "./EmbedlyQueue": 127,
  16186. "./MediaEvent": 131,
  16187. events: 202
  16188. }],
  16189. 129: [function(e, t, i) {
  16190. "use strict";
  16191. function n(e) {
  16192. this.label = e.label,
  16193. this.href = e.url,
  16194. this.type = this.updateLinkForType(),
  16195. this.domElement = null,
  16196. this.id = c++
  16197. }
  16198. var r = e("./LinkType")
  16199. , o = e("./MediaEvent")
  16200. , a = e("../../util/browser")
  16201. , s = e("../../analytics")
  16202. , l = e("events").EventEmitter
  16203. , c = 0;
  16204. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16205. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16206. 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,
  16207. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16208. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16209. r.MODEL) : r.EXT_LINK
  16210. }
  16211. ;
  16212. var h = {};
  16213. n.prototype.createDomElement = function() {
  16214. if (this.domElement = document.createElement("a"),
  16215. this.domElement.classList.add("tag-link"),
  16216. this.domElement.textContent = this.label,
  16217. this.type === r.EXT_LINK) {
  16218. this.domElement.textContent += " ";
  16219. var e = document.createElement("i");
  16220. e.classList.add("icon-ext-link"),
  16221. e.title = "Link to external web site",
  16222. this.domElement.appendChild(e)
  16223. }
  16224. return this.domElement.addEventListener("click", function(e) {
  16225. switch (e.stopPropagation(),
  16226. h[this.id] = !0,
  16227. s.trackAlways("click_tag_link", {
  16228. link_type: this.type,
  16229. link_count: c,
  16230. links_clicked: Object.keys(h).length
  16231. }),
  16232. this.type) {
  16233. case r.MODEL:
  16234. window.location.replace(this.href);
  16235. break;
  16236. case r.EXT_LINK:
  16237. window.open(this.href, "_blank")
  16238. }
  16239. this.emit(o.LINK_CLICK, {
  16240. type: this.type,
  16241. url: this.href
  16242. })
  16243. }
  16244. .bind(this)),
  16245. this.domElement
  16246. }
  16247. ,
  16248. t.exports = n
  16249. }
  16250. , {
  16251. "../../analytics": 4,
  16252. "../../util/browser": 182,
  16253. "./LinkType": 130,
  16254. "./MediaEvent": 131,
  16255. events: 202
  16256. }],
  16257. 130: [function(e, t, i) {
  16258. "use strict";
  16259. t.exports = {
  16260. NAVIGATION: "navigation",
  16261. MODEL: "model",
  16262. EXT_LINK: "ext-link"
  16263. }
  16264. }
  16265. , {}],
  16266. 131: [function(e, t, i) {
  16267. "use strict";
  16268. t.exports = Object.freeze({
  16269. LINK_CLICK: "mtmedia.link",
  16270. IMAGE_LOADED: "mtmedia.image.loaded",
  16271. IMAGE_OPENING: "mtmedia.image.opening",
  16272. IMAGE_OPENED: "mtmedia.image.opened",
  16273. IMAGE_CLOSING: "mtmedia.image.closing",
  16274. IMAGE_CLOSED: "mtmedia.image.closed",
  16275. VIDEO_START: "mtmedia.video.start",
  16276. VIDEO_PAUSE: "mtmedia.video.pause",
  16277. VIDEO_ENDED: "mtmedia.video.end"
  16278. })
  16279. }
  16280. , {}],
  16281. 132: [function(e, t, i) {
  16282. "use strict";
  16283. t.exports = Object.freeze({
  16284. maxEmbedWidth: 350,
  16285. defaultAspectRatio: .75
  16286. })
  16287. }
  16288. , {}],
  16289. 133: [function(e, t, i) {
  16290. "use strict";
  16291. t.exports = Object.freeze({
  16292. TEXT: "text",
  16293. LINK: "link",
  16294. IMAGE: "photo",
  16295. VIDEO: "video",
  16296. RICH: "rich"
  16297. })
  16298. }
  16299. , {}],
  16300. 134: [function(e, t, i) {
  16301. "use strict";
  16302. function n(e) {
  16303. this.capabilities = {
  16304. links: {
  16305. enable: e.supportLinks,
  16306. keepLabels: e.keepLinkLabels
  16307. }
  16308. }
  16309. }
  16310. var r = e("./DescriptionChunkType");
  16311. n.prototype.parse = function(e, i) {
  16312. var n = [];
  16313. return e.split("[").map(function(e, t) {
  16314. return 0 === t ? e : "[" + e
  16315. }).forEach(function(e) {
  16316. var t = this.findMarkdown(e);
  16317. if (t) {
  16318. if (-1 !== t.url.indexOf("javascript:"))
  16319. return;
  16320. this.addLinkChunk(n, t, i),
  16321. this.addTextChunk(n, e.slice(t.markdown.length))
  16322. } else
  16323. this.addTextChunk(n, e)
  16324. }
  16325. .bind(this)),
  16326. n
  16327. }
  16328. ,
  16329. n.prototype.findMarkdown = function(e) {
  16330. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16331. if (t) {
  16332. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16333. 0 !== n); )
  16334. r++;
  16335. var o = i.length - r;
  16336. return {
  16337. markdown: t[0].substring(0, t[0].length - o),
  16338. label: t[1],
  16339. url: t[2].substring(0, r)
  16340. }
  16341. }
  16342. }
  16343. ,
  16344. n.prototype.addTextChunk = function(e, t) {
  16345. 0 !== t.length && e.push({
  16346. type: r.TEXT,
  16347. text: t
  16348. })
  16349. }
  16350. ,
  16351. n.prototype.addLinkChunk = function(e, t) {
  16352. if (this.capabilities.links.enable) {
  16353. var i = {
  16354. label: t.label,
  16355. url: t.url
  16356. };
  16357. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16358. e.push({
  16359. type: r.LINK,
  16360. link: i
  16361. })
  16362. } else
  16363. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16364. }
  16365. ,
  16366. t.exports = n
  16367. }
  16368. , {
  16369. "./DescriptionChunkType": 133
  16370. }],
  16371. 135: [function(t, r, e) {
  16372. (function(e) {
  16373. "use strict";
  16374. var i = new (t("../util/logger"))(e)
  16375. , n = {
  16376. parseIdsFromChunkName: function(e, t) {
  16377. t.floorId = n.parseFloor(e),
  16378. t.roomId = n.parseRoom(e)
  16379. },
  16380. parseFloor: function(e) {
  16381. var t = e.match(/_group([0-9]+)/);
  16382. if (!t)
  16383. return 0;
  16384. try {
  16385. return parseInt(t[1], 10)
  16386. } catch (e) {
  16387. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16388. 0
  16389. }
  16390. },
  16391. parseRoom: function(e) {
  16392. var t = e.match(/_sub([0-9]+)/);
  16393. if (!t)
  16394. return -1;
  16395. try {
  16396. return parseInt(t[1], 10)
  16397. } catch (e) {
  16398. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16399. 0
  16400. }
  16401. }
  16402. };
  16403. r.exports = n
  16404. }
  16405. ).call(this, "/js/model/Chunks.js")
  16406. }
  16407. , {
  16408. "../util/logger": 189
  16409. }],
  16410. 136: [function(a, c, e) {
  16411. (function(e) {
  16412. "use strict";
  16413. function t(e) {
  16414. r.call(this),
  16415. this.model = e,
  16416. this.exploded = !1
  16417. }
  16418. var i = a("../objects/Floor")
  16419. , n = (a("../settings"),
  16420. a("../util/logger"))
  16421. , s = a("../util/transitions")
  16422. , r = a("../util/IndexedCollection")
  16423. , o = a("../util/common")
  16424. , l = a("../util/easing");
  16425. new n(e),
  16426. o.inherit(t, r),
  16427. t.prototype.add = function(e) {
  16428. r.prototype.add.call(this, e),
  16429. this.model.add(e)
  16430. }
  16431. ,
  16432. t.prototype.getIndex = function(e) {
  16433. return e.floorIndex
  16434. }
  16435. ,
  16436. t.prototype.build = function() {
  16437. this.list.forEach(function(e) {
  16438. e.build()
  16439. })
  16440. }
  16441. ,
  16442. t.prototype.size = function() {
  16443. return this.length
  16444. }
  16445. ,
  16446. t.prototype.sort = function() {
  16447. r.prototype.sort.call(this, function(e, t) {
  16448. return e.floorIndex - t.floorIndex
  16449. })
  16450. }
  16451. ,
  16452. t.prototype.nextFloor = function(e, t) {
  16453. return this.index[e.floorIndex + t] || null
  16454. }
  16455. ,
  16456. t.prototype.getFloorAtPoint = function(e) {
  16457. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16458. var r = this.list[n]
  16459. , o = r.distanceToPoint(e);
  16460. (!t || o < i) && (i = o,
  16461. t = r)
  16462. }
  16463. return t
  16464. }
  16465. ,
  16466. t.prototype.getOrMakeFloor = function(e) {
  16467. var t = this.index[e];
  16468. return t || (t = new i(this.model,e),
  16469. this.add(t)),
  16470. t
  16471. }
  16472. ,
  16473. t.prototype.hide = function() {
  16474. this.list.forEach(function(e) {
  16475. e.hide()
  16476. })
  16477. }
  16478. ,
  16479. t.prototype.show = function() {
  16480. this.list.forEach(function(e) {
  16481. e.show()
  16482. })
  16483. }
  16484. ,
  16485. t.prototype.names = function() {
  16486. return this.list.reduce(function(e, t) {
  16487. return e.concat(t.name)
  16488. }, [])
  16489. }
  16490. ,
  16491. t.prototype.toggleExplodeHorizontal = function() {
  16492. function i(e, t) {
  16493. a.copy(e.position),
  16494. e.position.x = r[e.floorIndex] * t,
  16495. e.position.y = 1 * e.floorIndex * t,
  16496. a.sub(e.position).multiplyScalar(-1),
  16497. e.panos.forEach(function(e) {
  16498. e.translate(a)
  16499. })
  16500. }
  16501. var n, r = [], o = 0;
  16502. this.list.forEach(function(e, t, i) {
  16503. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16504. o += n,
  16505. r[t] = o
  16506. }),
  16507. r = r.map(function(e) {
  16508. return e - o / 2
  16509. });
  16510. var a = this.list[0].position.clone();
  16511. this.exploded ? this.list.forEach(function(t) {
  16512. s.start(function(e) {
  16513. i(t, 1 - e)
  16514. }, 1500, null, 0, l.easeOutExpo)
  16515. }) : this.list.forEach(function(t) {
  16516. s.start(function(e) {
  16517. i(t, e)
  16518. }, 1500, null, 0, l.easeOutExpo)
  16519. }),
  16520. this.exploded = !this.exploded
  16521. }
  16522. ,
  16523. t.prototype.toggleExplodeVertical = function() {
  16524. function i(e, t) {
  16525. var i = i.copy(e.position);
  16526. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16527. i.sub(e.position).multiplyScalar(-1),
  16528. e.panos.forEach(function(e) {
  16529. e.translate(i)
  16530. })
  16531. }
  16532. var n = this.model.size;
  16533. this.list[0].position.clone(),
  16534. this.exploded ? this.list.forEach(function(t) {
  16535. s.start(function(e) {
  16536. i(t, 1 - e)
  16537. }, 1500, null, 0, l.easeOutExpo)
  16538. }) : this.list.forEach(function(t) {
  16539. s.start(function(e) {
  16540. i(t, e)
  16541. }, 1500, null, 0, l.easeOutExpo)
  16542. }),
  16543. this.exploded = !this.exploded
  16544. }
  16545. ,
  16546. c.exports = t
  16547. }
  16548. ).call(this, "/js/model/FloorCollection.js")
  16549. }
  16550. , {
  16551. "../objects/Floor": 146,
  16552. "../settings": 166,
  16553. "../util/IndexedCollection": 175,
  16554. "../util/common": 185,
  16555. "../util/easing": 186,
  16556. "../util/logger": 189,
  16557. "../util/transitions": 195
  16558. }],
  16559. 137: [function(r, o, e) {
  16560. (function(e) {
  16561. "use strict";
  16562. function h() {
  16563. n.call(this)
  16564. }
  16565. var u = r("../settings")
  16566. , t = r("../util/logger")
  16567. , d = r("../enum/Viewmode")
  16568. , p = r("../objects/Snapshot")
  16569. , i = (r("../util/math"),
  16570. r("../util/common"))
  16571. , n = r("../util/IndexedCollection")
  16572. , l = new t(e);
  16573. i.inherit(h, n),
  16574. h.prototype.getImage = function(e) {
  16575. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16576. }
  16577. ,
  16578. h.prototype.filterByModesAndReel = function(e, t) {
  16579. for (var i = [], n = 0; n < t.length; n += 1) {
  16580. var r = t[n]
  16581. , o = this.index[r.sid];
  16582. o && i.push(o)
  16583. }
  16584. var a = e[d.DOLLHOUSE]
  16585. , s = e[d.FLOORPLAN];
  16586. (i = i.filter(function(e) {
  16587. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16588. return !0;
  16589. var t;
  16590. try {
  16591. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16592. } catch (e) {
  16593. return l.debug(e.message),
  16594. !1
  16595. }
  16596. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16597. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16598. this.list = i,
  16599. this.reIndex()
  16600. }
  16601. ,
  16602. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16603. if (0 === this.list.length)
  16604. return [];
  16605. var locations = [];
  16606. var deal = (n, container)=>{
  16607. var r = n.thumbnail_signed_src,
  16608. o = n.name || "";
  16609. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16610. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16611. var a = panos.get(n.metadata.scan_id);
  16612. if (a && !a.isAligned()) return
  16613. }
  16614. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16615. if (s === d.MESH) return
  16616. if(window.isLocal)var src = manage.dealURL(r)
  16617. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16618. var l = {
  16619. cameraMode: s,
  16620. position: n.metadata.camera_position,
  16621. quaternion: n.metadata.camera_quaternion,
  16622. zoom: n.metadata.zoom,
  16623. panoId: n.metadata.scan_id,
  16624. orthoZoom: n.metadata.ortho_zoom,
  16625. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16626. thumbUrl: src,
  16627. name: h.filterImageName(o),
  16628. sid: n.sid
  16629. }
  16630. var item = new p(l);
  16631. container.push(item)
  16632. return item
  16633. }
  16634. }
  16635. this.list.forEach(image=>{
  16636. if(image.images){
  16637. var folder = $.extend({}, image )
  16638. folder.heroLocations = [];
  16639. image.images.list.forEach(child=>{
  16640. deal(child, folder.heroLocations);
  16641. })
  16642. folder.musicInfo = folder.musicInfo || {}
  16643. locations.push(folder)
  16644. delete folder.images;
  16645. delete folder.locations;
  16646. }else{
  16647. var item = deal(image, locations);
  16648. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16649. }
  16650. })
  16651. return locations
  16652. }
  16653. ,
  16654. h.prototype.getIndex = function(e) {
  16655. return e.sid
  16656. }
  16657. ,
  16658. h.filterImageName = function(e) {
  16659. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16660. }
  16661. ,
  16662. o.exports = h
  16663. }
  16664. ).call(this, "/js/model/ImageCollection.js")
  16665. }
  16666. , {
  16667. "../enum/Viewmode": 51,
  16668. "../objects/Snapshot": 153,
  16669. "../settings": 166,
  16670. "../util/IndexedCollection": 175,
  16671. "../util/common": 185,
  16672. "../util/logger": 189,
  16673. "../util/math": 190
  16674. }],
  16675. 138: [function(h, u, e) {
  16676. (function(e) {
  16677. "use strict";
  16678. function n() {
  16679. c.call(this)
  16680. }
  16681. var r = h("../label/Label")
  16682. , i = h("../settings")
  16683. , t = h("../util/logger")
  16684. , o = h("../util/math")
  16685. , a = h("../util/ajax")
  16686. , s = h("./RoomCollection")
  16687. , l = h("../util/common")
  16688. , c = h("../util/IndexedCollection");
  16689. new t(e),
  16690. l.inherit(n, c),
  16691. n.prototype.getIndex = function(e) {
  16692. return e.labelId
  16693. }
  16694. ,
  16695. n.prototype.associateWithRooms = function(e) {
  16696. this.forEach(function(t) {
  16697. e.forEach(function(e) {
  16698. e.roomId === t.roomId && (t.room = e)
  16699. })
  16700. })
  16701. }
  16702. ,
  16703. n.prototype.createFromLabelData = function(e) {
  16704. e.forEach(function(e) {
  16705. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16706. t = s.generateRoomId(e.floorId, t);
  16707. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16708. i.position = o.convertWorkshopVector(i.position),
  16709. this.add(i),
  16710. i.build()
  16711. }
  16712. .bind(this))
  16713. }
  16714. ,
  16715. n.prototype.load = function(e, t) {
  16716. return a.get(e, {
  16717. responseType: "json",
  16718. auth: t ? i.authorizationHeader : null
  16719. }).done(function(e) {
  16720. var t = [];
  16721. for (var i in e) {
  16722. var n = e[i];
  16723. t.push(n)
  16724. }
  16725. this.createFromLabelData(t)
  16726. }
  16727. .bind(this))
  16728. }
  16729. ,
  16730. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16731. var t = -1;
  16732. if (e) {
  16733. var i = e.split("_");
  16734. t = parseInt(i[0])
  16735. }
  16736. return t
  16737. }
  16738. ,
  16739. u.exports = n
  16740. }
  16741. ).call(this, "/js/model/LabelCollection.js")
  16742. }
  16743. , {
  16744. "../label/Label": 90,
  16745. "../settings": 166,
  16746. "../util/IndexedCollection": 175,
  16747. "../util/ajax": 181,
  16748. "../util/common": 185,
  16749. "../util/logger": 189,
  16750. "../util/math": 190,
  16751. "./RoomCollection": 141
  16752. }],
  16753. 139: [function(P, O, e) {
  16754. (function(e) {
  16755. "use strict";
  16756. function t(e, t) {
  16757. o.Object3D.call(this),
  16758. this.sid = window.number;//t.sid,
  16759. this.data = t,
  16760. this.options = e,
  16761. this.urls = new i(e.urlFiles),
  16762. this.isPublic = void 0 !== t.is_public && t.is_public,
  16763. //创建heroLocations
  16764. this.images = new E(this),
  16765. this.images.extend(t.images),
  16766. this.images.forEach((info)=>{
  16767. if(info.locations){
  16768. info.images = new E(this);
  16769. info.images.extend(info.locations)
  16770. }
  16771. })
  16772. this.heroLocations = []
  16773. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16774. this.outdoorPanoLocations = [],
  16775. this.floors = new c(this),
  16776. this.floorsEnabled = void 0 === e.floors || e.floors,
  16777. this.changingFloor = !1,
  16778. this.chunks = [],
  16779. this.panos = new g,
  16780. this.colliders = [],
  16781. this.loadPanosPromise = null,
  16782. this.loadMeshTexturesPromise = null,
  16783. this.auxDataPromise = null,
  16784. this.meshTexturesLoaded = !1,
  16785. this.meshTextures = [],
  16786. this.tags = {},
  16787. this.tagsShown = !1,
  16788. this.shouldShowtags = !1,
  16789. this.has360Views = !1,
  16790. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16791. this.supportedModes = {},
  16792. this.supportedModes[s.PANORAMA] = !0,
  16793. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16794. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16795. this.supportedModes[s.TRANSITIONING] = !0,
  16796. this.supportsTiles = this.configureTiling(),
  16797. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16798. this.mode = s.DOLLHOUSE,
  16799. this.size = null,
  16800. this.center = null,
  16801. this.boundingBox = new o.Box3,
  16802. this.currentFloor = null,
  16803. this.allFloorsVisible = !0,
  16804. this.projectedPano0 = null,
  16805. this.projectedPano1 = null,
  16806. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16807. this.addFloor(new r(this,t,e.trim()))
  16808. }
  16809. .bind(this)),
  16810. this.waitQueue = [],
  16811. this.on("load", function(e) {
  16812. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16813. return !e.isLoadedCallback()
  16814. }),
  16815. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16816. }
  16817. .bind(this)),
  16818. this.setupCustomProperties(),
  16819. this.hots = {}
  16820. }
  16821. var o = P("three")
  16822. , a = P("../util/ajax")
  16823. , i = P("../util/ModelUrls")
  16824. , n = P("../objects/BoundingTextureSkybox")
  16825. , s = P("../enum/Viewmode")
  16826. , l = P("../enum/RenderOrder")
  16827. , r = (P("../enum/AlignmentType"),
  16828. P("../objects/Floor"))
  16829. , c = P("./FloorCollection")
  16830. , h = P("../objects/Chunk")
  16831. , u = (P("../objects/Room"),
  16832. P("../objects/Snapshot"),
  16833. P("../label/Label"),
  16834. P("../util/math"),
  16835. P("../settings"))
  16836. , d = P("../shaders")
  16837. , p = P("../util/logger")
  16838. , f = (P("../tag/tag"),
  16839. P("../tag/tagManager"),
  16840. P("../objects/Panorama"))
  16841. , g = P("../util/PanoramaCollection")
  16842. , m = P("../loaders/ModelLoader")
  16843. , v = P("../loaders/ModelTextureLoader")
  16844. , y = P("../loaders/SweepDataLoader")
  16845. , A = P("../util/transitions")
  16846. , C = (P("../util/easing"),
  16847. P("../util/lerp"),
  16848. P("../util/common"))
  16849. , I = (P("../util/texture"),
  16850. P("./../util/browser"))
  16851. , E = P("./ImageCollection")
  16852. , _ = P("./RoomCollection")
  16853. , b = P("./LabelCollection")
  16854. , w = P("./Chunks")
  16855. , T = P("./../util/showcase")
  16856. , x = P("../exception/BasicException")
  16857. , S = (P("../constants"),
  16858. P("events").EventEmitter)
  16859. , M = P("hot")
  16860. , R = new p(e);
  16861. t.prototype = Object.create(o.Object3D.prototype),
  16862. C.extend(t, S),
  16863. t.prototype.setupCustomProperties = function() {
  16864. var t = u.modelAlpha;
  16865. Object.defineProperty(this, "alpha", {
  16866. get: function() {
  16867. return t
  16868. },
  16869. set: function(e) {
  16870. t = e,
  16871. this.chunks.forEach(function(e) {
  16872. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16873. })
  16874. }
  16875. })
  16876. }
  16877. ,
  16878. t.prototype.configureTiling = function() {
  16879. var e = function() {
  16880. try {
  16881. var e = document.createElement("canvas")
  16882. , t = e.getContext("webgl");
  16883. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16884. } catch (e) {
  16885. return 0
  16886. }
  16887. }();
  16888. if (e < 2048)
  16889. return !1;
  16890. R.warn("Max cube texture size: " + e);
  16891. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16892. var i = u.tiling.tilingFlagNames[t];
  16893. if ("1" === I.valueFromHash(i, null))
  16894. return !0;
  16895. if ("0" === I.valueFromHash(i, null))
  16896. return !1
  16897. }
  16898. return !!T.modelDataPromisesTiles(this.data)
  16899. }
  16900. ,
  16901. t.prototype.toggleAlpha = function() {
  16902. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16903. }
  16904. ,
  16905. t.prototype.load = function(e) {
  16906. var t = this.urls.init().then(function() {
  16907. return $.when(this.loadPanos(), this.loadMesh())
  16908. }
  16909. .bind(this));
  16910. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16911. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16912. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16913. }
  16914. ,
  16915. t.prototype.loadMesh = function() {
  16916. var n = $.Deferred()
  16917. , r = this;
  16918. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16919. if (0 === e.length) {
  16920. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16921. r.supportedModes[s.DOLLHOUSE] = !1,
  16922. r.supportedModes[s.FLOORPLAN] = !1;
  16923. var i = new h({
  16924. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16925. });
  16926. i.material.visible = !1,
  16927. i.rotateX(-Math.PI / 2),
  16928. i.geometry.computeBoundingBox(),
  16929. e = [i]
  16930. }
  16931. e.forEach(function(e) {
  16932. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16933. r.addChunk(t, e)
  16934. }),
  16935. r.floors.sort(),
  16936. n.resolve(r)
  16937. }, function(e, t) {
  16938. n.notify(e, t)
  16939. }, function(e) {
  16940. R.error(e),
  16941. n.reject("loading-failed")
  16942. }),
  16943. n.promise()
  16944. }
  16945. ,
  16946. t.prototype.loadMeshTextures = function() {
  16947. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16948. this.meshTexturesLoaded = !0
  16949. }
  16950. .bind(this))),
  16951. this.loadTexturesPromise
  16952. }
  16953. ,
  16954. t.prototype.shineHots = function() {
  16955. A.trigger({
  16956. func: function(e) {
  16957. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16958. for(var i in this.hots){
  16959. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16960. }
  16961. }
  16962. .bind(this),
  16963. cycling: !0,
  16964. duration: 3e3,
  16965. name: "hotShine"
  16966. })
  16967. }
  16968. ,
  16969. t.prototype.createHotItem = function(e, t) {
  16970. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16971. var o = document.createElement("li")
  16972. , a = document.createElement("span");
  16973. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16974. o.hot = t[n[r]],
  16975. o.appendChild(a),
  16976. i.appendChild(o)
  16977. }
  16978. document.querySelector("#hotListContent ul").appendChild(i),
  16979. console.log(i)
  16980. }
  16981. ,
  16982. t.prototype.loadOverlays = function(overlays){
  16983. var overlays = window.data2 && window.data2.overlays
  16984. overlays && overlays.forEach((info)=>{
  16985. new Overlay(info)
  16986. })
  16987. Overlay.load()
  16988. }
  16989. ,
  16990. t.prototype.loadhots = function() {
  16991. var r = $.Deferred()
  16992. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16993. return a.get(e, {
  16994. responseType: "json",
  16995. auth: this.isPublic ? null : u.authorizationHeader
  16996. }).done(function(e) {
  16997. window.data2 = e;
  16998. if(!e){
  16999. console.error("data2 is null")
  17000. }else{
  17001. g_data2 = hotMatcher(e)
  17002. this.hotsCount = 0;
  17003. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17004. window.hotData = {}
  17005. if(e.hots){
  17006. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17007. sids.forEach((sid)=>{
  17008. this.hotsCount++,
  17009. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17010. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17011. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17012. window.hotData[sid] = e.hots[sid];
  17013. })
  17014. }
  17015. this.createHotItem(window.hotData, this.hots);
  17016. g_index = I.valueFromHash("m")
  17017. /* e.tourAudio && (g_tourAudio = new Audio,
  17018. g_tourAudio.loop = !1,
  17019. g_tourAudio.addEventListener("ended", function() {
  17020. var e = document.createEvent("MouseEvent");
  17021. e.initEvent("tourAudioEnded", !0, !0),
  17022. window.dispatchEvent(e)
  17023. })); */
  17024. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17025. //window.wx && manage.weixinShare(),
  17026. }
  17027. /* var i = $.Deferred()
  17028. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  17029. a.get(n, {
  17030. responseType: "json",
  17031. auth: this.isPublic ? null : u.authorizationHeader
  17032. }).done(function(e) {
  17033. window.hotData = e,
  17034. this.createHotItem(e, this.hots);
  17035. for(let i in this.hots){
  17036. e[i] && this.hots[i].initStyleImg(e[i]);
  17037. }
  17038. i.resolve()
  17039. }
  17040. .bind(this)).fail(function() {
  17041. console.log("Data.js is empty");
  17042. i.resolve()
  17043. }),
  17044. */
  17045. r.resolve()
  17046. }
  17047. .bind(this)).fail(function() {
  17048. console.log("没有热点"),
  17049. //window.wx && manage.weixinShare(),
  17050. r.resolve()
  17051. }),
  17052. r
  17053. }
  17054. ,
  17055. t.prototype.loadPanos = function() {
  17056. if (this.loadPanosPromise)
  17057. return this.loadPanosPromise;
  17058. var e = new y(this);
  17059. return this.loadPanosPromise = e.load().then(function(e) {
  17060. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17061. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17062. else console.log(e.uuid)
  17063. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17064. }
  17065. .bind(this))),
  17066. this.panos.extend(e.map(function(e) {
  17067. return new f(this,e.uuid,e,this.supportsTiles)
  17068. }
  17069. .bind(this))),
  17070. this.panos.forEach(function(i) {
  17071. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17072. var t = this.panos.get(e);
  17073. t && this.panos.setNeighbour(i, t, !0)
  17074. }
  17075. .bind(this)),
  17076. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17077. }
  17078. .bind(this)),
  17079. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17080. this.supportedModes[s.PANORAMA] = !1),
  17081. $.when(this)
  17082. }
  17083. .bind(this)),
  17084. this.loadPanosPromise
  17085. }
  17086. ,
  17087. t.prototype.loadHighlightReel = function() {
  17088. var t = $.Deferred()
  17089. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17090. return a.get(e, {
  17091. responseType: "json",
  17092. auth: this.isPublic ? null : u.authorizationHeader
  17093. }).done(function(e) {
  17094. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17095. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17096. t.resolve()
  17097. }
  17098. .bind(this)).fail(function() {
  17099. R.warn("Getting highlight reel failed, no highlights available"),
  17100. t.resolve()
  17101. }),
  17102. t
  17103. }
  17104. ,
  17105. t.prototype.waitForLoad = function(e, t) {
  17106. t() || (this.waitQueue.push({
  17107. object: e,
  17108. isLoadedCallback: t
  17109. }),
  17110. 1 === this.waitQueue.length && this.emit("waiting"))
  17111. }
  17112. ,
  17113. t.prototype.hide = function() {
  17114. this.floors.hide()
  17115. }
  17116. ,
  17117. t.prototype.show = function() {
  17118. this.floors.show()
  17119. }
  17120. ,
  17121. t.prototype.floorNames = function() {
  17122. return this.floors.names()
  17123. }
  17124. ,
  17125. t.prototype.warpDestFloors = function(e, t) {
  17126. if (e && this.floors.length === e.length) {
  17127. var i = e.findIndex(function(e) {
  17128. return e
  17129. }
  17130. .bind(this));
  17131. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17132. } else
  17133. this.toggleAllFloors(!0)
  17134. }
  17135. ,
  17136. t.prototype.setFloor = function(e, t, i) {
  17137. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17138. this.allFloorsVisible = !1,
  17139. this._setFloor(e, t, i)
  17140. }
  17141. ,
  17142. t.prototype.toggleAllFloors = function(e) {
  17143. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17144. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17145. this._setFloor(this.currentFloor)
  17146. }
  17147. ,
  17148. t.prototype._setFloor = function(e, t, i) {
  17149. var n;
  17150. if (t = t || this.mode,
  17151. this.emit("floor.changed", e, t, this.currentFloor),
  17152. this.currentFloor = e,
  17153. t === s.PANORAMA) {
  17154. if (this.show(),
  17155. this.shouldShowtags && this.tagsShown)
  17156. for (n in this.tags)
  17157. this.tags[n].show(u.showFloorDuration)
  17158. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17159. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17160. }
  17161. .bind(this)),
  17162. this.shouldShowtags && this.tagsShown))
  17163. for (n in this.tags) {
  17164. var r = this.tags[n];
  17165. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17166. }
  17167. var o = this
  17168. , a = e;
  17169. A.start(function() {}, u.showFloorDelay, function() {
  17170. o.floors.forEach(function(t) {
  17171. t.chunks.forEach(function(e) {
  17172. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17173. })
  17174. })
  17175. }
  17176. .bind(this))
  17177. }
  17178. ,
  17179. t.prototype.toggleExplode = function() {
  17180. this.floors.toggleExplodeHorizontal()
  17181. }
  17182. ,
  17183. t.prototype.toggleExplodeUp = function() {
  17184. this.floors.toggleExplodeVertical()
  17185. }
  17186. ,
  17187. t.prototype.nextFloor = function(e) {
  17188. return this.floors.nextFloor(this.currentFloor, e)
  17189. }
  17190. ,
  17191. t.prototype.addFloor = function(e) {
  17192. this.floors.add(e)
  17193. }
  17194. ,
  17195. t.prototype.getFloorAtPoint = function(e) {
  17196. return this.floors.getFloorAtPoint(e)
  17197. }
  17198. ,
  17199. t.prototype.getTagBySid = function(e) {
  17200. return this.tags[e]
  17201. }
  17202. ,
  17203. t.prototype.addChunk = function(e, t) {
  17204. this.floors.getOrMakeFloor(e).addChunk(t),
  17205. this.chunks.push(t)
  17206. }
  17207. ,
  17208. t.prototype.setMode = function(t) {
  17209. if (!this.supportedModes[t])
  17210. throw new x("Mode not supported for this model: " + t);
  17211. this.mode = t
  17212. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17213. this.chunks.forEach(function(e) {
  17214. e.setMode(t)
  17215. })
  17216. }
  17217. ,
  17218. t.prototype.build = function() {
  17219. this.heroLocations = this.images.getHeroLocations(this.panos);
  17220. var e = function() {
  17221. 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()
  17222. }
  17223. .bind(this)();
  17224. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17225. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17226. }
  17227. .bind(this)) || e,
  17228. null === this.heroImage && R.warn("No hero image defined."),
  17229. this.currentFloor = this.floors.last(),
  17230. this.floors.build(),
  17231. this.colliders = this.floors.reduce(function(e, t) {
  17232. return e.concat(t.collider.children)
  17233. }, []),
  17234. this.panos.forEach(function(e) {
  17235. e.build1(),
  17236. e.on("enter", function() {
  17237. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17238. }
  17239. .bind(this))
  17240. }
  17241. .bind(this)),
  17242. this.panos.forEach(function(e) {
  17243. e.build2()
  17244. }),
  17245. this.floors.forEach(function(e) {
  17246. this.boundingBox.union(e.boundingBox)
  17247. }
  17248. .bind(this)),
  17249. this.size = this.boundingBox.size(),
  17250. this.center = this.boundingBox.center(),
  17251. this.floors.forEach(function(e) {
  17252. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17253. }
  17254. .bind(this)),
  17255. this.panos.populate_path_graph(),
  17256. this.skybox = new n(this.boundingBox),
  17257. this.skybox.matrixWorldNeedsUpdate = !0,
  17258. this.add(this.skybox),
  17259. setTimeout(function() {
  17260. this.hotsCount && this.shineHots()
  17261. }
  17262. .bind(this), 1300),
  17263. this.tags)
  17264. this.tags[t].build();
  17265. return R.debug("Done building model"),
  17266. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17267. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17268. this.buildRooms(),
  17269. this.labels.associateWithRooms(this.rooms),
  17270. $.when(this)
  17271. }
  17272. ,
  17273. t.prototype.loadLabels = function() {
  17274. this.labels = new b(this);
  17275. var e = $.Deferred();
  17276. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17277. !this.showingLabels) */
  17278. return e.resolve();
  17279. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17280. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17281. R.warn("Getting labels failed, not displaying labels."),
  17282. e.resolve()
  17283. }),
  17284. e
  17285. }
  17286. ,
  17287. t.prototype.buildRooms = function() {
  17288. this.rooms = new _(this),
  17289. this.rooms.createFromChunks(this.chunks),
  17290. this.rooms.calcRoomBoundaries()
  17291. }
  17292. ,
  17293. t.prototype.updateProjectedPanos = function() {
  17294. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17295. }
  17296. ,
  17297. t.prototype.setProjectedPanos = function(t, i, n) {
  17298. null != n || (n = !0),
  17299. n = !!n,
  17300. this.projectedPano0 = t,
  17301. this.projectedPano1 = i,
  17302. this.skybox.material.setProjectedPanos(t, i, n),
  17303. this.chunks.forEach(function(e) {
  17304. e.materialInside.setProjectedPanos(t, i, n)
  17305. })
  17306. }
  17307. ,
  17308. t.prototype.setSide = function(t) {
  17309. this.floors.forEach(function(e) {
  17310. e.collider.material.side = t
  17311. })
  17312. }
  17313. ,
  17314. t.prototype.heroCount = function() {
  17315. return this.heroLocations ? this.heroLocations.length : 0
  17316. }
  17317. ,
  17318. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17319. if (e[0] < 0)
  17320. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17321. null;
  17322. if (this.heroCount() < 1)
  17323. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17324. null;
  17325. var t = this.heroLocations[e[0]];
  17326. if(t.heroLocations && e[1]!=void 0){
  17327. t = t.heroLocations[e[1]];
  17328. }
  17329. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17330. null) : t
  17331. }
  17332. ,
  17333. t.prototype.findPanoramicHero = function() {
  17334. for (var e in this.heroLocations)
  17335. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17336. return this.heroLocations[e];
  17337. return null
  17338. }
  17339. ,
  17340. t.prototype.listImagePanos = function() {
  17341. var i = []
  17342. , n = this;
  17343. return this.images.forEach(function(e) {
  17344. if (e.metadata && e.metadata.scan_id) {
  17345. var t = n.panos.get(e.metadata.scan_id);
  17346. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17347. }
  17348. }),
  17349. i
  17350. }
  17351. ,
  17352. t.prototype.fadePanoMarkers = function(e, t) {
  17353. this.panos.fadeMarkerOpacity(e, t)
  17354. }
  17355. ,
  17356. t.prototype.setSweepVisibility = function(t) {
  17357. this.panos.forEach(function(e) {
  17358. e.marker && (e.marker.visible = t)
  17359. })
  17360. }
  17361. ,
  17362. t.prototype.outsideAllowed = function() {
  17363. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17364. }
  17365. ,
  17366. O.exports = t
  17367. }
  17368. ).call(this, "/js/model/Model.js")
  17369. }
  17370. , {
  17371. "../constants": 8,
  17372. "../enum/AlignmentType": 17,
  17373. "../enum/RenderOrder": 42,
  17374. "../enum/Viewmode": 51,
  17375. "../exception/BasicException": 55,
  17376. "../label/Label": 90,
  17377. "../loaders/ModelLoader": 105,
  17378. "../loaders/ModelTextureLoader": 106,
  17379. "../loaders/SweepDataLoader": 107,
  17380. "../tag/tag": 123,
  17381. "../tag/tagManager": 124,
  17382. "../objects/BoundingTextureSkybox": 143,
  17383. "../objects/Chunk": 144,
  17384. "../objects/Floor": 146,
  17385. "../objects/Panorama": 148,
  17386. "../objects/Room": 150,
  17387. "../objects/Snapshot": 153,
  17388. "../settings": 166,
  17389. "../shaders": 167,
  17390. "../util/ModelUrls": 177,
  17391. "../util/PanoramaCollection": 178,
  17392. "../util/ajax": 181,
  17393. "../util/common": 185,
  17394. "../util/easing": 186,
  17395. "../util/lerp": 188,
  17396. "../util/logger": 189,
  17397. "../util/math": 190,
  17398. "../util/texture": 194,
  17399. "../util/transitions": 195,
  17400. "./../util/browser": 182,
  17401. "./../util/showcase": 193,
  17402. "./Chunks": 135,
  17403. "./FloorCollection": 136,
  17404. "./ImageCollection": 137,
  17405. "./LabelCollection": 138,
  17406. "./RoomCollection": 141,
  17407. events: 202,
  17408. three: 217,
  17409. hot: "hot"
  17410. }],
  17411. 140: [function(e, t, i) {
  17412. "use strict";
  17413. function n() {
  17414. this.modelMap = {},
  17415. this.activeModel = null,
  17416. this.modelCount = 0,
  17417. this.tileDownloader = null,
  17418. this.panoRenderer = null
  17419. }
  17420. var r = (e("three"),
  17421. e("../util/common"))
  17422. , o = e("../exception/BasicException")
  17423. , a = e("../enum/ModelManagerEvents")
  17424. , s = e("../enum/PanoRendererEvents")
  17425. , l = e("events").EventEmitter;
  17426. n.prototype.init = function(e, t, i) {
  17427. this.tileDownloader = e,
  17428. this.panoRenderer = t,
  17429. this.qualityManager = i,
  17430. this.bindEvents()
  17431. }
  17432. ,
  17433. n.prototype.bindEvents = function() {
  17434. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17435. }
  17436. ,
  17437. n.prototype.onTileRendered = function(e, t, i, n) {}
  17438. ,
  17439. n.prototype.addModel = function(e) {
  17440. this.modelMap[e.sid] = e,
  17441. 0 === this.modelCount && this.activateModel(e.sid),
  17442. this.modelCount++,
  17443. this.emit(a.ModelAdded)
  17444. }
  17445. ,
  17446. n.prototype.getModel = function(e) {
  17447. return this.modelMap[e]
  17448. }
  17449. ,
  17450. n.prototype.activateModel = function(e) {
  17451. var t = this.modelMap[e];
  17452. if (!t)
  17453. throw new o("Tried to activate invalid model!");
  17454. var i = this.activeModel;
  17455. this.activeModel = t,
  17456. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17457. this.tileDownloader.setUrls(t.urls),
  17458. t.panos.forEach(function(e) {
  17459. e.attachToPanoRenderer(this.panoRenderer),
  17460. e.tileDownloader = this.tileDownloader,
  17461. e.qualityManager = this.qualityManager
  17462. }
  17463. .bind(this)),
  17464. this.emit(a.ActiveModelChanged, {
  17465. oldModel: i,
  17466. model: t
  17467. })
  17468. }
  17469. ,
  17470. n.prototype.getActiveModel = function() {
  17471. return this.activeModel
  17472. }
  17473. ,
  17474. r.extend(n, l),
  17475. t.exports = n
  17476. }
  17477. , {
  17478. "../enum/ModelManagerEvents": 33,
  17479. "../enum/PanoRendererEvents": 35,
  17480. "../exception/BasicException": 55,
  17481. "../util/common": 185,
  17482. events: 202,
  17483. three: 217
  17484. }],
  17485. 141: [function(r, l, e) {
  17486. (function(e) {
  17487. "use strict";
  17488. function o() {
  17489. n.call(this)
  17490. }
  17491. var a = r("../objects/Room")
  17492. , t = (r("../settings"),
  17493. r("../util/logger"))
  17494. , i = (r("../util/transitions"),
  17495. r("../util/easing"),
  17496. r("../util/common"))
  17497. , n = r("../util/IndexedCollection")
  17498. , s = r("./Chunks");
  17499. new t(e),
  17500. i.inherit(o, n),
  17501. o.prototype.getIndex = function(e) {
  17502. return e.roomId
  17503. }
  17504. ,
  17505. o.prototype.calcRoomBoundaries = function() {
  17506. this.forEach(function(e) {
  17507. e.calcBoundaries()
  17508. })
  17509. }
  17510. ,
  17511. o.prototype.createFromChunks = function(e) {
  17512. var n = {
  17513. floorId: -1,
  17514. roomId: -1
  17515. }
  17516. , r = {};
  17517. e.forEach(function(e) {
  17518. s.parseIdsFromChunkName(e.name, n);
  17519. var t = r[n.roomId];
  17520. if (!t) {
  17521. var i = o.generateRoomId(n.floorId, n.roomId);
  17522. t = new a(n.floorId,i),
  17523. this.add(t),
  17524. r[n.roomId] = t
  17525. }
  17526. t.addChunk(e)
  17527. }
  17528. .bind(this)),
  17529. this.calcRoomBoundaries()
  17530. }
  17531. ,
  17532. o.generateRoomId = function(e, t) {
  17533. return e + "_" + t
  17534. }
  17535. ,
  17536. l.exports = o
  17537. }
  17538. ).call(this, "/js/model/RoomCollection.js")
  17539. }
  17540. , {
  17541. "../objects/Room": 150,
  17542. "../settings": 166,
  17543. "../util/IndexedCollection": 175,
  17544. "../util/common": 185,
  17545. "../util/easing": 186,
  17546. "../util/logger": 189,
  17547. "../util/transitions": 195,
  17548. "./Chunks": 135
  17549. }],
  17550. 142: [function(e, t, i) {
  17551. "use strict";
  17552. function n(e, t, i) {
  17553. var n = (e = e.clone().expandByScalar(0.01)).size()
  17554. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17555. r.boundingBox = e,
  17556. o.Mesh.call(this, r, t),
  17557. this.position.copy(e.center()),
  17558. this.frustumCulled = !1,
  17559. i && this.add(new o.WireframeHelper(this))
  17560. }
  17561. var o = e("three");
  17562. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17563. t.exports = n
  17564. }
  17565. , {
  17566. three: 217
  17567. }],
  17568. 143: [function(l, c, e) {
  17569. (function(e) {
  17570. "use strict";
  17571. function t(e) {
  17572. s.time("Computing a nice bounding cubemap");
  17573. var t = new r({
  17574. side: i.BackSide,
  17575. transparent: !0
  17576. });
  17577. t.uniforms.modelAlpha.value = 0,
  17578. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17579. this.renderOrder = a.boundingSkybox,
  17580. n.call(this, e, t),
  17581. s.timeEnd("Computing a nice bounding cubemap")
  17582. }
  17583. var i = l("three")
  17584. , n = (l("../enum/Viewmode"),
  17585. l("../shaders"),
  17586. l("./BoundingMesh"))
  17587. , r = l("../materials/ModelTextureMaterial")
  17588. , o = l("../settings")
  17589. , a = l("../enum/RenderOrder")
  17590. , s = new (l("../util/logger"))(e);
  17591. (t.prototype = Object.create(n.prototype)).constructor = t,
  17592. c.exports = t
  17593. }
  17594. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17595. }
  17596. , {
  17597. "../enum/RenderOrder": 42,
  17598. "../enum/Viewmode": 51,
  17599. "../materials/ModelTextureMaterial": 118,
  17600. "../settings": 166,
  17601. "../shaders": 167,
  17602. "../util/logger": 189,
  17603. "./BoundingMesh": 142,
  17604. three: 217
  17605. }],
  17606. 144: [function(e, t, i) {
  17607. "use strict";
  17608. function n(e) {
  17609. this.materialInside = new s({
  17610. side: r.DoubleSide
  17611. });
  17612. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17613. this.materialOutside = new r.RawShaderMaterial({
  17614. fragmentShader: o.modelOutside.fragmentShader,
  17615. vertexShader: o.modelOutside.vertexShader,
  17616. uniforms: t,
  17617. side: r.FrontSide,
  17618. name: "chunkOut"
  17619. }),
  17620. r.Mesh.call(this, e.geometry, this.materialInside),
  17621. this.name = e.name || "",
  17622. this.textureName = e.textureName,
  17623. this.meshUrl = e.meshUrl
  17624. }
  17625. var r = e("three")
  17626. , o = e("../shaders")
  17627. , a = e("../enum/Viewmode")
  17628. , s = e("../materials/ModelTextureMaterial");
  17629. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17630. this.materialInside.uniforms.map.value = e,
  17631. this.materialOutside.uniforms.map.value = e
  17632. }
  17633. ,
  17634. n.prototype.setMode = function(e) {
  17635. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17636. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17637. t.transparent = this.material.transparent,
  17638. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17639. this.material = t
  17640. }
  17641. ,
  17642. t.exports = n
  17643. }
  17644. , {
  17645. "../enum/Viewmode": 51,
  17646. "../materials/ModelTextureMaterial": 118,
  17647. "../shaders": 167,
  17648. three: 217
  17649. }],
  17650. 145: [function(e, t, i) {
  17651. "use strict";
  17652. function n(e) {
  17653. this.chunksize = e || 10,
  17654. this.chunks = {},
  17655. this.boundingBoxes = {},
  17656. this.children = [],
  17657. this.offset = new m.Vector3(0,.5,0),
  17658. this.material = new m.MeshBasicMaterial({
  17659. color: 16777215 * Math.random(),
  17660. side: m.DoubleSide
  17661. })
  17662. }
  17663. var m = e("three");
  17664. e("../enum/Viewmode"),
  17665. n.prototype.add = function(e) {
  17666. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17667. u ? (t = u.position.array,
  17668. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17669. e.faces);
  17670. var d = new m.Vector3;
  17671. if (i)
  17672. for (n = 0,
  17673. r = i.length; n < r; n += 3) {
  17674. var p = 3 * i[n]
  17675. , f = 3 * i[n + 1]
  17676. , g = 3 * i[n + 2];
  17677. o = (t[p] + t[f] + t[g]) / 3,
  17678. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17679. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17680. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17681. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17682. this.boundingBoxes[l] = new m.Box3),
  17683. 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]),
  17684. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17685. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17686. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17687. }
  17688. else
  17689. for (n = 0,
  17690. r = t.length; n < r; n += 9)
  17691. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17692. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17693. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17694. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17695. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17696. this.boundingBoxes[l] = new m.Box3),
  17697. 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]),
  17698. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17699. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17700. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17701. }
  17702. ,
  17703. n.prototype.build = function() {
  17704. var e = new m.Object3D;
  17705. for (var t in e.material = this.material,
  17706. this.chunks) {
  17707. var i = this.chunks[t]
  17708. , n = new m.BufferGeometry;
  17709. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17710. n.boundingBox = this.boundingBoxes[t];
  17711. var r = new m.Mesh(n,this.material);
  17712. r.material.visible = !1,
  17713. e.add(r),
  17714. this.chunks[t] = []
  17715. }
  17716. return e
  17717. }
  17718. ,
  17719. t.exports = n
  17720. }
  17721. , {
  17722. "../enum/Viewmode": 51,
  17723. three: 217
  17724. }],
  17725. 146: [function(e, t, i) {
  17726. "use strict";
  17727. var n = e("three")
  17728. , r = e("../settings")
  17729. , o = e("../util/common")
  17730. , a = e("../util/lerp")
  17731. , s = e("./ChunkedCollider")
  17732. , l = e("../util/transitions")
  17733. , c = e("../util/easing")
  17734. , h = (e("../objects/Panorama"),
  17735. e("../enum/RenderOrder"));
  17736. e("../localization/localize");
  17737. function u(e, t, i) {
  17738. n.Object3D.call(this),
  17739. this.model = e,
  17740. this.floorIndex = t,
  17741. this.lang = r.languageTag,
  17742. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17743. this.panos = [],
  17744. this.chunks = [],
  17745. this.colliderBuilder = new s(3),
  17746. this.collider = null,
  17747. this.center = null,
  17748. this.boundingBox = new n.Box3,
  17749. this.size = null,
  17750. this.hidden = !1,
  17751. this.conservativeBoundingBox = new n.Box3,
  17752. this.debugColor = 16777215 * Math.random(),
  17753. this.transition = null
  17754. }
  17755. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17756. this.model.setFloor(this, e)
  17757. }
  17758. ,
  17759. u.prototype.hide = function(e) {
  17760. if (!this.hidden || this.transition) {
  17761. this.chunks.forEach(function(e) {
  17762. e.material.transparent = !0
  17763. }),
  17764. l.cancel(this.transition);
  17765. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17766. , i = e ? 0 : r.hideFloorDelay / t;
  17767. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17768. this.hidden = !0
  17769. }
  17770. .bind(this), i, c.easeInOutQuad)
  17771. }
  17772. }
  17773. ,
  17774. u.prototype.show = function(e) {
  17775. if (this.hidden || this.transition) {
  17776. this.hidden = !1,
  17777. l.cancel(this.transition);
  17778. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17779. , i = e ? 0 : r.showFloorDelay / t;
  17780. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17781. this.hidden || this.chunks.forEach(function(e) {
  17782. e.material.transparent = !1
  17783. })
  17784. }
  17785. .bind(this), i, c.easeInOutQuad)
  17786. }
  17787. }
  17788. ,
  17789. u.prototype.toggle = function(e, t) {
  17790. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17791. }
  17792. ,
  17793. u.prototype.containsPoint = function(t) {
  17794. return this.collider.children.some(function(e) {
  17795. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17796. e.geometry.boundingBox.containsPoint(t)
  17797. })
  17798. }
  17799. ,
  17800. u.prototype.distanceToPoint = function(i) {
  17801. var n = null
  17802. , r = 1 / 0;
  17803. return this.collider.children.forEach(function(e) {
  17804. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17805. var t = e.geometry.boundingBox.distanceToPoint(i);
  17806. (!n || t < r) && (r = t,
  17807. n = e)
  17808. }),
  17809. r
  17810. }
  17811. ,
  17812. u.prototype.addChunk = function(e) {
  17813. e.renderOrder = h.ghostFloor,
  17814. this.add(e),
  17815. this.chunks.push(e),
  17816. this.boundingBox.union(e.geometry.boundingBox),
  17817. this.size = this.boundingBox.size(),
  17818. this.colliderBuilder.add(e.geometry)
  17819. }
  17820. ,
  17821. u.prototype.addPano = function(e) {
  17822. this.panos.push(e),
  17823. this.add(e.skyboxMesh),
  17824. e.marker && this.add(e.marker);
  17825. var t = new n.Vector3(1,1,1)
  17826. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17827. this.boundingBox.union(i)
  17828. }
  17829. ,
  17830. u.prototype.build = function() {
  17831. this.collider = this.colliderBuilder.build(!0),
  17832. this.add(this.collider),
  17833. this.center = this.boundingBox.center(),
  17834. this.conservativeBoundingBox.copy(this.boundingBox),
  17835. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17836. return e.geometry.boundingBox.min.y
  17837. }), 5),
  17838. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17839. return e.geometry.boundingBox.max.y
  17840. }), 5),
  17841. this.colliderBuilder = null
  17842. }
  17843. ,
  17844. u.prototype.toShortString = function() {
  17845. return o.nth(this.floorIndex + 1)
  17846. }
  17847. ,
  17848. u.prototype.toString = function() {
  17849. return this.name
  17850. }
  17851. ,
  17852. t.exports = u
  17853. }
  17854. , {
  17855. "../enum/RenderOrder": 42,
  17856. "../localization/localize": 108,
  17857. "./strings-cn-CN": 109,
  17858. "../objects/Panorama": 148,
  17859. "../settings": 166,
  17860. "../util/common": 185,
  17861. "../util/easing": 186,
  17862. "../util/lerp": 188,
  17863. "../util/transitions": 195,
  17864. "./ChunkedCollider": 145,
  17865. three: 217
  17866. }],
  17867. 147: [function(e, t, i) {
  17868. "use strict";
  17869. function n(e) {
  17870. this.player = e,
  17871. this.obj3d = null,
  17872. this.UP = new u.Vector3(0,1,0)
  17873. }
  17874. var u = e("three")
  17875. , d = e("../settings");
  17876. n.prototype.prefs = {
  17877. linewidth: 3,
  17878. height: .07,
  17879. opacity: .45,
  17880. endScale: .05
  17881. },
  17882. n.prototype.discard = function() {
  17883. if (this.obj3d) {
  17884. var e = this.obj3d.parent;
  17885. e && e.remove(this.obj3d)
  17886. }
  17887. this.obj3d = null
  17888. }
  17889. ,
  17890. n.prototype.draw = function() {
  17891. if (this.discard(),
  17892. d.showNeighbors) {
  17893. var e = this.player.currentPano.floor;
  17894. this.obj3d = new u.Object3D;
  17895. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17896. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17897. i.y += this.prefs.height;
  17898. var n = .1525
  17899. , r = new u.Matrix4;
  17900. for (var o in t)
  17901. if (t[o]) {
  17902. var a = this.player.model.panos.get(o)
  17903. , s = (a.position.clone().sub(this.player.model.position),
  17904. a.position.clone().sub(a.floorPosition))
  17905. , l = a.floorPosition.clone().sub(this.player.model.position);
  17906. l.y += this.prefs.height;
  17907. var c = new u.Geometry;
  17908. 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)),
  17909. 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)),
  17910. r.identity().setPosition(s),
  17911. c.applyMatrix(r),
  17912. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17913. 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)),
  17914. r.lookAt(l, i, this.UP).setPosition(l),
  17915. c.applyMatrix(r),
  17916. c.vertices.push(l, i);
  17917. var h = new u.Line(c,new u.LineBasicMaterial({
  17918. color: a.debugColor.getHex(),
  17919. transparent: !0,
  17920. opacity: this.prefs.opacity,
  17921. depthWrite: !1,
  17922. name: "sLine" + o,
  17923. linewidth: this.prefs.linewidth
  17924. }));
  17925. this.obj3d.add(h)
  17926. }
  17927. e.add(this.obj3d)
  17928. }
  17929. }
  17930. ,
  17931. n.prototype.update = function() {
  17932. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17933. }
  17934. ,
  17935. t.exports = n
  17936. }
  17937. , {
  17938. "../settings": 166,
  17939. three: 217
  17940. }],
  17941. 148: [function(S, M, e) {
  17942. (function(e) {
  17943. "use strict";
  17944. function r(e, t, i, n) {
  17945. this.model = e,
  17946. this.id = t,
  17947. this.alignmentType = i.alignmentType || c.ALIGNED,
  17948. this.neighbourUUIDs = i.neighbours,
  17949. this.neighbourPanos = null,
  17950. this.floor = null,
  17951. this.floorIndex = i.floor,
  17952. this.failedLoadingAt = 0,
  17953. this.maxLoadRetries = 4,
  17954. this.origin = i.position.clone(),
  17955. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17956. this.quaternion = i.quaternion.clone(),
  17957. this.skyboxMesh = new s.Mesh(E),
  17958. this.skyboxMesh.position.copy(this.position),
  17959. this.skyboxMesh.quaternion.copy(this.quaternion),
  17960. this.skyboxMesh.name = "skybox",
  17961. this.skyboxMesh.visible = !1,
  17962. this.skyboxMesh.updateMatrix(),
  17963. this.skyboxMesh.updateMatrixWorld(),
  17964. this.marker = null,
  17965. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17966. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17967. map: b,
  17968. side: s.DoubleSide,
  17969. opacity: 0,
  17970. transparent: !0,
  17971. depthWrite: !1
  17972. })),
  17973. this.marker.visible = this.showFloorMarker,
  17974. this.marker.renderOrder = l.panoMarker,
  17975. this.marker.name = "marker",
  17976. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17977. this.marker.updateMatrixWorld(),
  17978. a.colorMarkerOnLoad && this.on("load", function() {
  17979. this.marker.material.color.set(65280)
  17980. })),
  17981. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17982. this.floorPosition = i.puck ? i.puck.clone() : null,
  17983. this.tiled = n,
  17984. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17985. this.solidSkybox.flipY = !1,
  17986. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17987. this.solidSkybox.magFilter = s.LinearFilter,
  17988. this.solidSkybox.generateMipmaps = !1)),
  17989. this.zoomed = !1,
  17990. this.panoRenderer = null,
  17991. this.qualityManager = null,
  17992. this.tileDownloader = null,
  17993. this.tiledPanoRenderTarget = null,
  17994. this.minimumTiledPanoLoaded = !1,
  17995. this.highestPartialTileRenderOpCompleted = 0,
  17996. this.highestFullTileRenderOpCompleted = 0,
  17997. this.shouldRedrawOnBaseLoaded = !1,
  17998. this.lockUntilRenderingComplete = !1,
  17999. a.colorMarkerOnLoad && this.on("load", function() {
  18000. this.marker.material.color.set(65280)
  18001. }),
  18002. (e = new s.TextureLoader).setCrossOrigin(!0);
  18003. var r = e.load("images/texture.jpg");
  18004. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  18005. color: 16777215,
  18006. transparent: !0,
  18007. opacity: .75,
  18008. map: r
  18009. })),
  18010. this.vrMarker.boluoType = "vr",
  18011. this.vrMarker.position.z = 1,
  18012. this.vrMarker.enabled = !0,
  18013. this.vrMarker.visible = !1,
  18014. window.vrMarkers = window.vrMarkers || [],
  18015. window.vrMarkers.push(this.vrMarker),
  18016. this.marker && this.marker.add(this.vrMarker),
  18017. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18018. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18019. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18020. this.adjustAngleEnable) {
  18021. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18022. this.skyboxMesh.quaternion.multiply(i);
  18023. var o = new s.Quaternion;
  18024. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18025. this.skyboxMesh.quaternion.multiply(o),
  18026. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18027. this.skyboxMesh.quaternion.multiply(n),
  18028. this.skyboxMesh.updateMatrix(),
  18029. this.skyboxMesh.updateMatrixWorld(),
  18030. this.model.updateProjectedPanos()
  18031. }
  18032. }
  18033. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18034. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18035. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18036. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18037. S("../enum/GLCubeFaces"),
  18038. 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");
  18039. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18040. function() {
  18041. this.setZoomed(!1),
  18042. this.emit("enter", {
  18043. oldPano: t,
  18044. newPano: this
  18045. }),
  18046. t = this
  18047. }
  18048. ),
  18049. r.prototype.exit = function() {
  18050. this.tiled ? (this.clearWaitDeferreds(),
  18051. this.minimumTiledPanoLoaded = !1,
  18052. this.tiledPanoRenderTarget = null,
  18053. this.setZoomed(!1),
  18054. this.panoRenderer.deactivateTiledPano(this),
  18055. this.highestPartialTileRenderOpCompleted = 0,
  18056. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18057. this.solidSkybox.loaded = !1,
  18058. this.solidSkybox.version = 0),
  18059. this.emit("exit")
  18060. }
  18061. ,
  18062. r.prototype.hoverOn = function(e) {
  18063. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18064. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18065. }
  18066. ,
  18067. r.prototype.hoverOff = function(e) {
  18068. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18069. }
  18070. ,
  18071. r.prototype.build1 = function() {
  18072. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18073. this.floor.addPano(this),
  18074. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18075. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18076. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18077. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18078. }
  18079. ,
  18080. r.prototype.build2 = function() {
  18081. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18082. this.height = this.position.distanceTo(this.floorPosition),
  18083. this.placeMarker()
  18084. }
  18085. ,
  18086. r.prototype.interpolateFloorPosition = function() {
  18087. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18088. return !!e.floorPosition
  18089. }).sort(function(e, t) {
  18090. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18091. }
  18092. .bind(this))
  18093. , t = this.position.clone();
  18094. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18095. t
  18096. }
  18097. ,
  18098. r.prototype.raycastFloorPosition = function() {
  18099. I.warn("Performance warning: Raycasting to find floor position");
  18100. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18101. return e.length ? e[0].point : null
  18102. }
  18103. ,
  18104. 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)],
  18105. function() {
  18106. I.warn("Performance warning: Raycasting to find floor index");
  18107. for (var e = 0; e < i.length; e++) {
  18108. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18109. if (t.length)
  18110. return t[0].object.parent.parent
  18111. }
  18112. return null
  18113. }
  18114. ),
  18115. r.prototype.placeMarker = function() {
  18116. this.marker && (this.marker.position.copy(this.floorPosition),
  18117. this.marker.position.y += .05,
  18118. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18119. }
  18120. ,
  18121. r.prototype.translate = function(e) {
  18122. this.position.add(e),
  18123. this.floorPosition.add(e)
  18124. }
  18125. ,
  18126. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18127. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18128. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18129. }
  18130. ,
  18131. r.prototype.attachToPanoRenderer = function(e) {
  18132. this.panoRenderer = e,
  18133. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18134. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18135. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18136. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18137. }
  18138. ;
  18139. var w, T, x = {};
  18140. r.prototype.getWaitDeferred = function(e) {
  18141. var t = x[this.id];
  18142. t || (t = {},
  18143. x[this.id] = t);
  18144. var i = t[e];
  18145. return i || (i = {
  18146. deferred: $.Deferred(),
  18147. active: !1
  18148. },
  18149. t[e] = i),
  18150. i
  18151. }
  18152. ,
  18153. r.prototype.resetWaitDeferred = function(e) {
  18154. var t = this.getWaitDeferred(e);
  18155. t.active = !1,
  18156. t.deferred = $.Deferred()
  18157. }
  18158. ,
  18159. r.prototype.clearWaitDeferreds = function() {
  18160. var e = x[this.id];
  18161. for (var t in e || (e = {},
  18162. x[this.id] = e),
  18163. e)
  18164. if (e.hasOwnProperty(t)) {
  18165. var i = e[t];
  18166. i.active = !1,
  18167. i.deferred = $.Deferred()
  18168. }
  18169. }
  18170. ,
  18171. r.prototype.loadTiledPano = (new s.Vector3,
  18172. w = [],
  18173. T = [],
  18174. function(e, t, i, n, r, o) {
  18175. null != n || (n = !0),
  18176. null != r || (r = !0);
  18177. var a = this.getWaitDeferred(e)
  18178. , s = a.deferred
  18179. , l = null
  18180. , c = null;
  18181. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18182. c = i.vFov)),
  18183. !this.isLoaded(e)) {
  18184. if (!a.active) {
  18185. if (a.active = !0,
  18186. i) {
  18187. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18188. w[this.id + ":" + e] = {
  18189. tileCount: 0,
  18190. targetTileCount: h
  18191. },
  18192. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18193. }
  18194. T[this.id] || (T[this.id] = !0,
  18195. this.on(f.LoadComplete, function(e, t) {
  18196. var i = this.getWaitDeferred(e).deferred;
  18197. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18198. this.resetWaitDeferred(e))
  18199. }
  18200. .bind(this)),
  18201. this.on(f.LoadFailed, function(e) {
  18202. var t = this.getWaitDeferred(e).deferred;
  18203. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18204. this.resetWaitDeferred(e))
  18205. }
  18206. .bind(this)),
  18207. this.on(f.TileLoaded, function(e, t, i) {
  18208. var n = this.getWaitDeferred(e).deferred;
  18209. if (n && "pending" === n.state()) {
  18210. n.notify(e, t, i);
  18211. var r = w[this.id + ":" + e];
  18212. r && (r.tileCount++,
  18213. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18214. n.resolve(e, i),
  18215. this.resetWaitDeferred(e)))
  18216. }
  18217. }
  18218. .bind(this)))
  18219. }
  18220. this.tileDownloader.clearForceQueue(),
  18221. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18222. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18223. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18224. }
  18225. return s.promise()
  18226. }
  18227. ),
  18228. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18229. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18230. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18231. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18232. }
  18233. ,
  18234. r.prototype.onTileRendered = function(e, t, i, n) {
  18235. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18236. }
  18237. ,
  18238. r.prototype.onPanoRendered = function(e, t, i, n) {
  18239. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18240. this.updateSkyboxForZoomLevel(),
  18241. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18242. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18243. this.emit("load", t),
  18244. this.model.emit("load", this),
  18245. this.emit(f.LoadComplete, t, i))
  18246. }
  18247. ,
  18248. r.prototype.setZoomed = function(e) {
  18249. this.zoomed = e,
  18250. this.updateSkyboxForZoomLevel()
  18251. }
  18252. ,
  18253. r.prototype.ensureSkyboxReadyForRender = function() {
  18254. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18255. this.solidSkybox.loaded = !0)
  18256. }
  18257. ,
  18258. r.prototype.updateSkyboxForZoomLevel = function() {
  18259. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18260. }
  18261. ,
  18262. r.prototype.getSkyboxTexture = function() {
  18263. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18264. }
  18265. ,
  18266. r.prototype.onTileRenderFail = function(e, t, i) {
  18267. e === this.id && this.emit(f.LoadFailed, t)
  18268. }
  18269. ,
  18270. r.prototype.isLoaded = function(e) {
  18271. if (this.tiled) {
  18272. if (e && "string" == typeof e)
  18273. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18274. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18275. }
  18276. if (e && "number" == typeof e)
  18277. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18278. return !!this.solidSkybox.high || e in this.solidSkybox
  18279. }
  18280. ,
  18281. r.prototype.loadCube = function(a) {
  18282. if (this.isLoaded(a))
  18283. return I.info("Skipping load of pano, already loaded"),
  18284. $.when();
  18285. this.emit("loading", a),
  18286. this.model.emit("loading", this);
  18287. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18288. , e = n.filter(function(e) {
  18289. return !e
  18290. });
  18291. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18292. a = "high",
  18293. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18294. var t = 0
  18295. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18296. return u.getImage(n[t])
  18297. }
  18298. .bind(this));
  18299. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18300. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18301. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18302. this.solidSkybox.low = null),
  18303. this.solidSkybox.needsUpdate = !0,
  18304. this.emit("load", a),
  18305. this.model.emit("load", this),
  18306. this
  18307. }
  18308. .bind(this), function() {
  18309. I.error("Downloading cubemap for pano", this.id, "failed"),
  18310. this.failedLoadingAt = Date.now()
  18311. }
  18312. .bind(this), function() {
  18313. return $.when(++t, 6)
  18314. })
  18315. }
  18316. ,
  18317. r.raycastsSkipped = 0,
  18318. r.raycastsDone = 0,
  18319. r.prototype.findNeighourPanos = function() {
  18320. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18321. this.model.panos.forEach(function(e) {
  18322. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18323. var t = this.position.distanceTo(e.position);
  18324. if (t > a.panoramaNeighbourMaxDistance)
  18325. return this.model.panos.setNeighbour(this, e, !1),
  18326. void r.raycastsSkipped++;
  18327. var i = e.position.clone().sub(this.position).normalize()
  18328. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18329. r.raycastsDone++,
  18330. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18331. 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)))
  18332. }
  18333. }
  18334. .bind(this)),
  18335. this.model.panos.neighbourMap[this.id]
  18336. }
  18337. ,
  18338. r.prototype.worldPosition = function() {
  18339. return this.position
  18340. }
  18341. ,
  18342. r.prototype.addTextSprite = function(e, t) {
  18343. this.removeTextSprite();
  18344. var i = document.createElement("canvas")
  18345. , n = i.getContext("2d");
  18346. i.width = 256,
  18347. i.height = 256;
  18348. n.font = "bold 60px Arial",
  18349. n.fillStyle = "white";
  18350. var r = n.measureText(e).width;
  18351. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18352. var o = new s.Texture(i);
  18353. o.needsUpdate = !0;
  18354. var a = new s.SpriteMaterial({
  18355. map: o,
  18356. color: t || 16428055
  18357. });
  18358. this.text3d = new s.Sprite(a),
  18359. this.text3d.position.copy(this.skyboxMesh.position),
  18360. this.floor.add(this.text3d)
  18361. }
  18362. ,
  18363. r.prototype.removeTextSprite = function() {
  18364. this.text3d && (this.floor.remove(this.text3d),
  18365. this.text3d = null)
  18366. }
  18367. ,
  18368. r.prototype.isAligned = function() {
  18369. return this.alignmentType === c.ALIGNED
  18370. }
  18371. ,
  18372. r.filters = {
  18373. inDirection: function(t, i, n) {
  18374. return function(e) {
  18375. return e.position.clone().sub(t).normalize().dot(i) > n
  18376. }
  18377. },
  18378. inFloorDirection: function(t, i, n) {
  18379. return function(e) {
  18380. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18381. }
  18382. },
  18383. inPanoDirection: function(n, r, o) {
  18384. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18385. function(e) {
  18386. var t = e.floorPosition.clone().sub(n).normalize()
  18387. , i = e.position.clone().sub(n).normalize();
  18388. return t.dot(r) > o || i.dot(r) > o
  18389. }
  18390. },
  18391. atFloor: function(t) {
  18392. return function(e) {
  18393. return !t || e.floor === t
  18394. }
  18395. },
  18396. not: function(t) {
  18397. return function(e) {
  18398. return e !== t
  18399. }
  18400. },
  18401. notIn: function(t) {
  18402. return function(e) {
  18403. return -1 === t.indexOf(e)
  18404. }
  18405. },
  18406. isLoaded: function() {
  18407. return function(e) {
  18408. return e.isLoaded()
  18409. }
  18410. },
  18411. isNotLoaded: function() {
  18412. return function(e) {
  18413. return !e.isLoaded()
  18414. }
  18415. },
  18416. isCloseEnoughTo: function(t, i) {
  18417. return function(e) {
  18418. return t.distanceTo(e.floorPosition) < i
  18419. }
  18420. },
  18421. hasMinimumHeightDifferenceTo: function(t, i) {
  18422. return function(e) {
  18423. return Math.abs(e.position.y - t.y) > i
  18424. }
  18425. },
  18426. isNotBehindNormal: function(t, i) {
  18427. var n = new s.Vector3;
  18428. return i = i.clone(),
  18429. function(e) {
  18430. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18431. }
  18432. },
  18433. isNeighbourPanoTo: function(t) {
  18434. return function(e) {
  18435. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18436. }
  18437. },
  18438. isNeighbourOfNeighbourTo: function(n) {
  18439. return function(i) {
  18440. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18441. var t = n.model.panos.get(e);
  18442. return !!t && t.neighbourPanos[i.id]
  18443. })
  18444. }
  18445. },
  18446. isNotRecentlyFailed: function(t) {
  18447. return function(e) {
  18448. return Date.now() - e.failedLoadingAt > t
  18449. }
  18450. },
  18451. isOnVisibleFloor: function() {
  18452. return function(e) {
  18453. return !e.floor.hidden
  18454. }
  18455. },
  18456. isPanoAligned: function() {
  18457. return function(e) {
  18458. return e.isAligned()
  18459. }
  18460. }
  18461. },
  18462. r.sortFunctions = {
  18463. distanceToPoint: function(i) {
  18464. return function(e, t) {
  18465. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18466. }
  18467. },
  18468. floorDistanceToPoint: function(i) {
  18469. return function(e, t) {
  18470. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18471. }
  18472. },
  18473. choose: function(i) {
  18474. return function(e, t) {
  18475. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18476. }
  18477. }
  18478. },
  18479. r.scoreFunctions = {
  18480. distance: function(t, i) {
  18481. return i = i || a.navigation.distanceFactor,
  18482. function(e) {
  18483. return t ? t.position.distanceTo(e.position) * i : 0
  18484. }
  18485. },
  18486. distanceSquared: function(t, i) {
  18487. return i = i || a.navigation.distanceFactor,
  18488. function(e) {
  18489. return t ? t.position.distanceToSquared(e.position) * i : 0
  18490. }
  18491. },
  18492. direction: function(t, i) {
  18493. return function(e) {
  18494. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18495. }
  18496. },
  18497. angle: function(t, i) {
  18498. return function(e) {
  18499. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18500. }
  18501. },
  18502. inFieldOfView: function(t, i) {
  18503. return function(e) {
  18504. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18505. }
  18506. },
  18507. optionality: function(t) {
  18508. return function(e) {
  18509. return e.neighbourUUIDs.filter(function(e) {
  18510. return !(e in t.neighbourUUIDs) && e !== t.id
  18511. }).length * a.navigation.optionalityFactor
  18512. }
  18513. },
  18514. penalizeHeightDifferenceUnder: function(t, i) {
  18515. return function(e) {
  18516. return t.y - e.position.y < i ? -20 : 0
  18517. }
  18518. }
  18519. },
  18520. M.exports = r
  18521. }
  18522. ).call(this, "/js/objects/Panorama.js")
  18523. }
  18524. , {
  18525. "../enum/AlignmentType": 17,
  18526. "../enum/GLCubeFaces": 25,
  18527. "../enum/PanoRendererEvents": 35,
  18528. "../enum/PanoSizeClass": 36,
  18529. "../enum/PanoramaEvents": 37,
  18530. "../enum/RenderLayers": 41,
  18531. "../enum/RenderOrder": 42,
  18532. "../enum/TileDownloaderEvents": 45,
  18533. "../enum/Viewmode": 51,
  18534. "../exception/BasicException": 55,
  18535. "../scene/SceneRenderer": 158,
  18536. "../settings": 166,
  18537. "../tile/TileUtils": 174,
  18538. "../util/ajax": 181,
  18539. "../util/common": 185,
  18540. "../util/lerp": 188,
  18541. "../util/logger": 189,
  18542. "../util/panorama": 191,
  18543. "../util/texture": 194,
  18544. "../util/transitions": 195,
  18545. events: 202,
  18546. three: 217
  18547. }],
  18548. 149: [function(e, t, i) {
  18549. "use strict";
  18550. function n(e) {
  18551. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18552. t.map.value = d,
  18553. t.opacity.value = 0,
  18554. t.color.value.set(o.reticuleColor),
  18555. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18556. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18557. side: r.DoubleSide,
  18558. depthWrite: !1,
  18559. depthTest: !1,
  18560. transparent: !0,
  18561. vertexShader: c.waypoint.vertexShader,
  18562. fragmentShader: c.waypoint.fragmentShader,
  18563. uniforms: t,
  18564. name: "waypoint",
  18565. opacity: 0,
  18566. visible: t.showMouseMarker
  18567. })),
  18568. this.layers.set(h.RETICULE),
  18569. this.renderOrder = u.reticule,
  18570. this.player = e,
  18571. this.direction = new r.Vector3,
  18572. this.hidden = !0,
  18573. this.mouseLastMoveTime = Date.now()
  18574. }
  18575. var r = e("three")
  18576. , o = e("../settings")
  18577. , a = e("../util/transitions")
  18578. , s = e("../util/texture")
  18579. , l = e("../util/lerp")
  18580. , c = e("../shaders")
  18581. , h = e("../enum/RenderLayers")
  18582. , u = e("../enum/RenderOrder")
  18583. , d = s.load("images/reticule-256x256.png");
  18584. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18585. this.hidden = i,
  18586. this.mouseLastMoveTime = Date.now()
  18587. }
  18588. ,
  18589. n.prototype.hide = function() {
  18590. this.hidden || (this.hidden = !0,
  18591. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18592. }
  18593. ,
  18594. n.prototype.show = function() {
  18595. this.hidden = !1,
  18596. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18597. }
  18598. ,
  18599. n.prototype.update = function() {
  18600. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18601. }
  18602. ,
  18603. n.prototype.updatePosition = function(e, t) {
  18604. if (!this.hidden) {
  18605. if (!t)
  18606. return this.hide();
  18607. var i = t.point
  18608. , n = e.distanceTo(i)
  18609. , r = 1 + .01 * n;
  18610. n < 1 && (r -= 1 - n),
  18611. this.show(),
  18612. this.scale.set(r, r, r),
  18613. this.direction = this.direction.multiplyScalar(.8),
  18614. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18615. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18616. this.lookAt(this.position.clone().add(this.direction))
  18617. }
  18618. }
  18619. ,
  18620. n.prototype.writeAstag = function() {
  18621. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18622. , t = new Date;
  18623. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18624. var i = {
  18625. enabled: !0,
  18626. version: "0",
  18627. created: t.toISOString(),
  18628. created_by: "APITest",
  18629. position: this.position.clone(),
  18630. stem: {
  18631. enabled: o.tags.pole.enabled,
  18632. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18633. },
  18634. label: "tag " + this.tagCount,
  18635. description: "Description " + e,
  18636. floor: function(e) {
  18637. if (e.currentFloor) {
  18638. var t = e.floors.indexOf(e.currentFloor);
  18639. return -1 < t ? t : void 0
  18640. }
  18641. }(this.player.model),
  18642. type: "info",
  18643. metadata: {
  18644. preferred_camera: {
  18645. mode: this.player.mode
  18646. }
  18647. }
  18648. };
  18649. console.log("--------------------------"),
  18650. console.log(JSON.stringify(i));
  18651. var n = this.player.model.addtag(e, i).build();
  18652. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18653. n.visible || n.show(o.tags.startup.fadeInDuration))
  18654. }
  18655. ,
  18656. t.exports = n
  18657. }
  18658. , {
  18659. "../enum/RenderLayers": 41,
  18660. "../enum/RenderOrder": 42,
  18661. "../settings": 166,
  18662. "../shaders": 167,
  18663. "../util/lerp": 188,
  18664. "../util/texture": 194,
  18665. "../util/transitions": 195,
  18666. three: 217
  18667. }],
  18668. 150: [function(e, t, i) {
  18669. "use strict";
  18670. function n(e, t) {
  18671. this.chunks = [],
  18672. this.floorId = e,
  18673. this.roomId = t,
  18674. this.position = new l.Vector3
  18675. }
  18676. var l = e("three");
  18677. n.prototype.addChunk = function(e) {
  18678. this.chunks.push(e)
  18679. }
  18680. ,
  18681. n.prototype.calcBoundaries = function() {
  18682. 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++) {
  18683. var a = this.chunks[o].geometry.attributes.position;
  18684. if (a)
  18685. for (var s = 0; s < a.array.length; s += 3)
  18686. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18687. t.add(e),
  18688. 0 === s ? (i.copy(e),
  18689. n.copy(e)) : (i.max(e),
  18690. n.min(e)),
  18691. r++
  18692. }
  18693. 0 < r ? (t.multiplyScalar(1 / r),
  18694. this.average = t) : this.average = null,
  18695. this.boundsMax = i,
  18696. this.boundsMin = n,
  18697. this.center = new l.Vector3,
  18698. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18699. }
  18700. ,
  18701. t.exports = n
  18702. }
  18703. , {
  18704. three: 217
  18705. }],
  18706. 151: [function(o, v, e) {
  18707. (function(e) {
  18708. "use strict";
  18709. function t(e, t, i) {
  18710. this.obj3d = null,
  18711. this.nodes = [],
  18712. this.colorHull = [],
  18713. this.shortPaths = {},
  18714. this.floorHull = null,
  18715. this.cameraHull = null,
  18716. this.floorPathDistance = 0,
  18717. this.floorCurvePoints = null,
  18718. this.floorCurveColors = null,
  18719. this.camCurvePoints = null,
  18720. this.warpDestHeroLoc = null,
  18721. this.warpDestPano = null,
  18722. this.warpPathPoints = null,
  18723. this.warpPathLengths = [0],
  18724. this.warpLength = 0,
  18725. this.closeWarpDistance = 4,
  18726. this.UP = U.UP.clone(),
  18727. this.longestStep = 0,
  18728. this.upcomingTransType = null,
  18729. this.burnsDir = 1,
  18730. this.prevNextDist = 0,
  18731. this.nextI = 0,
  18732. this.activeTransType = null,
  18733. this.lastTransType = null,
  18734. this.bunnyObj = null,
  18735. this.director = e,
  18736. this.player = t,
  18737. this.playerControls = i,
  18738. this.modelManager = t.modelManager,
  18739. this.updateModel(),
  18740. this.updateDefaultsFromModelData(),
  18741. this.bindEvents(),
  18742. this.warping = !1,
  18743. this.waitingToWarp = !1,
  18744. this.warpInterrupted = !1,
  18745. this.warpInterruptionBlackoutStyle = null,
  18746. this.warpInterruptionTravelTime = null
  18747. }
  18748. 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"),
  18749. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18750. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18751. 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"),
  18752. pathEnd: n.load("images/End.png"),
  18753. 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==")
  18754. };
  18755. t.prototype.setScene = function(e) {
  18756. this.createCpm(e),
  18757. this.createBunnyObj(e)
  18758. }
  18759. ,
  18760. t.prototype.updateModel = function() {
  18761. this.model = this.modelManager.getActiveModel()
  18762. }
  18763. ,
  18764. t.prototype.bindEvents = function() {
  18765. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18766. }
  18767. ,
  18768. t.prototype.updateDefaultsFromModelData = function() {
  18769. this.model.data
  18770. }
  18771. ,
  18772. t.prototype.pointPathDistance = function(e) {
  18773. for (var t = 0, i = 1; i < e.length; i += 1)
  18774. t += e[i - 1].distanceTo(e[i]);
  18775. return t
  18776. }
  18777. ,
  18778. t.prototype.pointPathLengths = function(e) {
  18779. for (var t = [0], i = 1; i < e.length; i += 1)
  18780. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18781. return t
  18782. }
  18783. ,
  18784. t.prototype.interpAlongPath = function(e, t, i) {
  18785. var n, r = new P.Vector3, o = t[t.length - 1];
  18786. if (i < 1) {
  18787. n = i * o;
  18788. for (var a = 1; a < t.length; a += 1)
  18789. if (t[a] > n) {
  18790. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18791. return r.copy(e[a]),
  18792. r.sub(e[a - 1]),
  18793. r.multiplyScalar(s),
  18794. r.add(e[a - 1]),
  18795. r
  18796. }
  18797. } else
  18798. r.copy(e[e.length - 1]);
  18799. return r
  18800. }
  18801. ,
  18802. t.prototype.pathHeight = function() {
  18803. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18804. }
  18805. ,
  18806. t.prototype.createBunnyObj = function(e) {
  18807. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18808. this.bunnyObj.visible = D.warp.showBunny),
  18809. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18810. e.add(this.bunnyObj)
  18811. }
  18812. ,
  18813. t.prototype.createCpm = function(e) {
  18814. if (!this.currentPanoMarker) {
  18815. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18816. t.material.uniforms.opacity.value = 0,
  18817. this.currentPanoMarker = {
  18818. mesh: t,
  18819. placed: !1
  18820. }
  18821. }
  18822. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18823. this.placeCpm(),
  18824. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18825. }
  18826. ,
  18827. t.prototype.placeCpm = function() {
  18828. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18829. var e = this.player.currentPano.floor;
  18830. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18831. e.add(this.currentPanoMarker.mesh)),
  18832. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18833. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18834. this.currentPanoMarker.placed = !0
  18835. } else
  18836. this.popOutCpm()
  18837. }
  18838. ,
  18839. t.prototype.fadeInCpm = function(e) {
  18840. 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)
  18841. }
  18842. ,
  18843. t.prototype.fadeOutCpm = function(e) {
  18844. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18845. }
  18846. ,
  18847. t.prototype.popInCpm = function() {
  18848. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18849. }
  18850. ,
  18851. t.prototype.popOutCpm = function() {
  18852. this.fadeOutCpm(2)
  18853. }
  18854. ,
  18855. t.prototype.brushPrefs = {
  18856. linewidth: 7,
  18857. strokeWidth: 15,
  18858. cvSegments: 48,
  18859. paveStep: .1,
  18860. paveWidth: .2,
  18861. lookBlendDist: 3,
  18862. maxTurn: P.Math.degToRad(2)
  18863. },
  18864. t.prototype.panoPathDistance = function(e) {
  18865. var t = this.model.panos;
  18866. if (!e || e.length < 2)
  18867. return 0;
  18868. for (var i = [], n = 0; n < e.length; n += 1)
  18869. i.push(t.get(e[n]).floorPosition);
  18870. return this.pointPathDistance(i)
  18871. }
  18872. ,
  18873. t.prototype.loadTileTexture = function(t) {
  18874. var e = n.load(t, function(e) {
  18875. e.wrapS = P.RepeatWrapping,
  18876. e.wrapT = P.RepeatWrapping,
  18877. e.needsUpdate = !0,
  18878. H.debug('path texture "' + t + '" is ready')
  18879. }, function() {
  18880. H.error('path texture "' + t + '" failed')
  18881. });
  18882. return e.mapping = P.UVMapping,
  18883. e
  18884. }
  18885. ,
  18886. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18887. return new l({
  18888. cameraMode: n,
  18889. position: e,
  18890. quaternion: t,
  18891. panoId: i,
  18892. orthoZoom: o,
  18893. floorVisibility: r,
  18894. thumbUrl: null,
  18895. name: null
  18896. })
  18897. }
  18898. ,
  18899. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18900. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18901. }
  18902. ,
  18903. t.prototype.setWarpDestination = function(e) {
  18904. this.warpDestHeroLoc = e
  18905. }
  18906. ,
  18907. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18908. var t = this.getHeroDescriptorByHeroIndex(e);
  18909. return null !== t && (this.setWarpDestination(t),
  18910. !0)
  18911. }
  18912. ,
  18913. t.prototype.setWarpDestinationByPano = function(e, t) {
  18914. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18915. }
  18916. ,
  18917. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18918. var i = this.model.panos.get(e);
  18919. if (i) {
  18920. t = t || new P.Quaternion;
  18921. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18922. return this.setWarpDestination(n),
  18923. !0
  18924. }
  18925. return !1
  18926. }
  18927. ,
  18928. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18929. var t = this.model.heroCount();
  18930. if (null !== this.warpDestHeroLoc && t < 2)
  18931. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18932. this.model.getHeroDescriptorByIndex(0);
  18933. var i = this.model.getHeroDescriptorByIndex(e);
  18934. if (i) {
  18935. var n = i.isPano() ? i.panoId : i.cameraMode;
  18936. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18937. }
  18938. return i
  18939. }
  18940. ,
  18941. t.prototype.getHeroDescriptorByPano = function(e) {
  18942. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18943. }
  18944. ,
  18945. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18946. var t = this.getHeroIndexFromPanoId(e);
  18947. return this.getHeroDescriptorByHeroIndex(t)
  18948. }
  18949. ,
  18950. t.prototype.getHeroIndexFromPanoId = function(e) {
  18951. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18952. var i = this.model.heroLocations[t]
  18953. , n = this.getHeroId(i);
  18954. if (n && n === e)
  18955. return t
  18956. }
  18957. return -1
  18958. }
  18959. ,
  18960. t.prototype.getHeroPano = function(e) {
  18961. if (null === e)
  18962. return H.warn("getHeroPano(): no destination"),
  18963. null;
  18964. var t = this.getHeroId(e)
  18965. , i = this.model.panos.get(t);
  18966. return void 0 === i && (i = null,
  18967. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18968. i
  18969. }
  18970. ,
  18971. t.prototype.getHeroId = function(e) {
  18972. return e.panoId
  18973. }
  18974. ,
  18975. t.prototype.setWarpDestPano = function() {
  18976. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18977. this.warpDestPano
  18978. }
  18979. ,
  18980. t.prototype.brushToWarpPano = function(e, t) {
  18981. if (this.discardPathObject(),
  18982. !this.setWarpDestPano())
  18983. return !1;
  18984. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18985. !this.warpDestPano)
  18986. return H.info("No brush"),
  18987. !1;
  18988. if (!this.player.currentPano)
  18989. return H.debug("No current pano, visibility undefined"),
  18990. !1;
  18991. if (!this.warpDestPano)
  18992. return H.info("No wPano, visibility undefined"),
  18993. !1;
  18994. if (!this.warpDestPano.isAligned())
  18995. return H.debug("Cannot brush to unaligned pano"),
  18996. !1;
  18997. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18998. , n = !0;
  18999. if (this.player.currentPano.id === this.warpDestPano.id)
  19000. H.debug("Already at destination pano");
  19001. else {
  19002. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19003. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19004. this.obj3d = new P.Object3D,
  19005. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19006. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  19007. e = t) : (this.setPathHulls(this.nodes),
  19008. this.setFloorCurves(),
  19009. 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)))),
  19010. this.player.currentPano.floor.add(this.obj3d);
  19011. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  19012. , o = e === L.STD;
  19013. if (!n && (i || o)) {
  19014. if (r) {
  19015. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19016. this.obj3d.add(a)
  19017. }
  19018. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19019. this.obj3d.add(s)
  19020. }
  19021. this.appearSlow()
  19022. }
  19023. return this.upcomingTransType = e,
  19024. !n
  19025. }
  19026. ,
  19027. t.prototype.findShortestPath = function(e, t) {
  19028. if (!e || !t)
  19029. return null;
  19030. var i = D.warp.walkExtraPanosDistance
  19031. , n = e.id + ":" + t.id + ":" + i;
  19032. if (this.shortPaths.hasOwnProperty(n))
  19033. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19034. var r = t.id + ":" + e.id + ":" + i;
  19035. if (this.shortPaths.hasOwnProperty(r))
  19036. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19037. var o = this.model.panos.aStarSearch(e, t);
  19038. return this.model.panos.includeNodesNearPath(o, i),
  19039. this.shortPaths[n] = o ? o.slice() : null,
  19040. o
  19041. }
  19042. ,
  19043. t.prototype.makePathHulls = function(e) {
  19044. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19045. r = (t = h.get(e[0])).floor.floorIndex;
  19046. for (var u = 0; u < e.length; u += 1)
  19047. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19048. s.push(i),
  19049. l.push(t.position.clone()),
  19050. n = t.floor.floorIndex,
  19051. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19052. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19053. return a > this.longestStep && (this.longestStep = a,
  19054. H.debug("path contains " + a + " meter segment")),
  19055. {
  19056. floor: s,
  19057. camera: l,
  19058. color: c
  19059. }
  19060. }
  19061. ,
  19062. t.prototype.makeFloorCurves = function(e, t, i) {
  19063. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19064. , r = this.pointPathDistance(e) - 2 * n
  19065. , o = e.slice(0)
  19066. , a = o[1].clone().sub(o[0]);
  19067. a.y = 0,
  19068. a.normalize().multiplyScalar(n),
  19069. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19070. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19071. a.normalize().multiplyScalar(n),
  19072. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19073. var s = new P.CatmullRomCurve3(o)
  19074. , l = Math.floor(r / i);
  19075. l = 4 * Math.floor(l / 4),
  19076. l = Math.max(4, l);
  19077. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19078. h = 0,
  19079. c = u[f].distanceTo(e[0]);
  19080. for (var g = 1; g < e.length; g += 1)
  19081. p.copy(u[f]).sub(e[g]),
  19082. p.y *= 4,
  19083. p.length() < c && (h = g);
  19084. d.push(t[h])
  19085. }
  19086. return {
  19087. distance: r,
  19088. points: u,
  19089. colors: d
  19090. }
  19091. }
  19092. ,
  19093. t.prototype.makeCameraCurvePoints = function(e, t) {
  19094. var i = this.pointPathDistance(e);
  19095. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19096. }
  19097. ,
  19098. t.prototype.makeCameraCurveTangents = function(e, t) {
  19099. var i = this.pointPathDistance(e)
  19100. , n = new P.CatmullRomCurve3(e)
  19101. , r = Math.max(2, Math.floor(i / t));
  19102. r = r || 5;
  19103. for (var o = [], a = 0; a <= r; a++)
  19104. o.push(n.getTangentAt(a / r));
  19105. return o
  19106. }
  19107. ,
  19108. t.prototype.setPathHulls = function(e) {
  19109. var t = this.makePathHulls(e);
  19110. this.floorHull = t.floor,
  19111. this.cameraHull = t.camera,
  19112. this.colorHull = t.color
  19113. }
  19114. ,
  19115. t.prototype.setFloorCurves = function() {
  19116. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19117. this.floorPathDistance = e.distance,
  19118. this.floorCurvePoints = e.points,
  19119. this.floorCurveColors = e.colors
  19120. }
  19121. ,
  19122. t.prototype.setCameraCurvePoints = function() {
  19123. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19124. }
  19125. ,
  19126. t.prototype.chooseWarpPath = function(e) {
  19127. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19128. if (this.player.currentPano === this.warpDestPano || !e)
  19129. return this.warpPathPoints = null,
  19130. this.warpLength = 0,
  19131. !1;
  19132. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19133. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19134. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19135. t.multiplyScalar(.15).add(r.position),
  19136. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19137. t.y = r.position.y,
  19138. i.y = this.warpDestPano.position.y,
  19139. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19140. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19141. this.setCameraCurvePoints(),
  19142. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19143. this.warpLength = 0,
  19144. this.warpPathLengths = [0];
  19145. 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) {
  19146. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19147. var h = o.length();
  19148. o.y *= D.warp.climbEffort;
  19149. var u = o.length() / h;
  19150. if (1 < c) {
  19151. o.setY(0).normalize(),
  19152. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19153. var d = Math.min(1, o.dot(a))
  19154. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19155. u = Math.max(p, u)
  19156. }
  19157. this.warpLength += h * u,
  19158. this.warpPathLengths[c] = this.warpLength
  19159. }
  19160. return !0
  19161. }
  19162. ,
  19163. t.prototype.drawPathRibbon = function(e, t) {
  19164. this.bunnyObj.visible = D.warp.showBunny;
  19165. 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) {
  19166. a.copy(e[s]),
  19167. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19168. a.normalize(),
  19169. n.crossVectors(a, U.UP),
  19170. n.multiplyScalar(i);
  19171. var l = (new P.Vector3).copy(e[s]).add(r);
  19172. l.sub(n),
  19173. o.vertices.push(l),
  19174. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19175. o.vertices.push(l)
  19176. }
  19177. var c, h, u, d = 0;
  19178. for (s = 0; s < e.length - 1; s += 1) {
  19179. var p = 2 * s
  19180. , f = d
  19181. , g = d += e[s + 1].distanceTo(e[s])
  19182. , m = t[s]
  19183. , v = t[s + 1];
  19184. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19185. o.faces.push(c),
  19186. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19187. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19188. o.faces.push(c),
  19189. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19190. }
  19191. o.computeFaceNormals(),
  19192. o.computeVertexNormals(),
  19193. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19194. u.opacity.value = 0,
  19195. u.color.value.set(D.path.color),
  19196. new P.RawShaderMaterial({
  19197. side: P.DoubleSide,
  19198. depthWrite: !1,
  19199. transparent: !0,
  19200. vertexShader: C.ribbon.vertexShader,
  19201. fragmentShader: C.ribbon.fragmentShader,
  19202. uniforms: u,
  19203. name: "ribbonT",
  19204. opacity: 0
  19205. })) : new P.MeshBasicMaterial({
  19206. color: 16777215,
  19207. side: P.DoubleSide,
  19208. name: "ribbonOut",
  19209. vertexColors: P.VertexColors
  19210. });
  19211. var y = new P.Mesh(o,h);
  19212. return y.name = "ribbon",
  19213. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19214. y
  19215. }
  19216. ,
  19217. t.prototype.drawPathPavement = function(e) {
  19218. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19219. r.copy(e[o]),
  19220. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19221. r.normalize(),
  19222. i.crossVectors(r, U.UP),
  19223. i.multiplyScalar(this.brushPrefs.paveWidth),
  19224. (t = (new P.Vector3).copy(e[o])).sub(i),
  19225. n.vertices.push(t),
  19226. n.vertices.push((new P.Vector3).copy(e[o])),
  19227. (t = (new P.Vector3).copy(e[o])).add(i),
  19228. n.vertices.push(t);
  19229. var a, s, l;
  19230. for (o = 0; o < e.length - 1; o += 1)
  19231. a = 3 * o + 1,
  19232. l = .25 + (s = .25 * o),
  19233. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19234. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19235. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19236. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19237. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19238. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19239. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19240. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19241. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19242. color: D.path.color,
  19243. side: P.DoubleSide,
  19244. transparent: !0,
  19245. depthWrite: !1,
  19246. opacity: 0,
  19247. name: "paveT",
  19248. map: I.path
  19249. }) : new P.MeshBasicMaterial({
  19250. color: D.path.color,
  19251. side: P.DoubleSide,
  19252. transparent: !0,
  19253. depthWrite: !1,
  19254. opacity: 1,
  19255. name: "paveO",
  19256. map: I.path
  19257. });
  19258. return new P.Mesh(n,c)
  19259. }
  19260. ,
  19261. t.prototype.hintPrefs = {
  19262. rad: .18,
  19263. width: .0125,
  19264. depth: .0625,
  19265. setBack: -.04,
  19266. markRad: .25,
  19267. markInnerRad: .16
  19268. },
  19269. t.prototype.makeWaypointObj = function(e, t) {
  19270. var i = new P.Geometry
  19271. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19272. , r = this.pathHeight();
  19273. 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)),
  19274. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19275. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19276. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19277. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19278. o.map.value = e,
  19279. o.opacity.value = 0,
  19280. o.color.value.set(D.path.color);
  19281. var a = {
  19282. side: P.DoubleSide,
  19283. depthWrite: !1,
  19284. transparent: !0,
  19285. vertexShader: C.waypoint.vertexShader,
  19286. fragmentShader: C.waypoint.fragmentShader,
  19287. uniforms: o,
  19288. name: "waypoint",
  19289. opacity: 0
  19290. };
  19291. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19292. a.name = "wayPtOut");
  19293. var s = new P.RawShaderMaterial(a)
  19294. , l = new P.Mesh(i,s);
  19295. return l.name = t,
  19296. l
  19297. }
  19298. ,
  19299. t.prototype.makeStartMarker = function(e, t) {
  19300. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19301. i.y = 0,
  19302. i.normalize();
  19303. var n = Math.acos(i.x)
  19304. , r = this.makeWaypointObj(I.pathStart, "Start");
  19305. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19306. r.position.copy(e),
  19307. r
  19308. }
  19309. ,
  19310. t.prototype.makeEndMarker = function(e) {
  19311. var t = this.makeWaypointObj(I.pathEnd, "End")
  19312. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19313. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19314. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19315. t.position.copy(e),
  19316. t
  19317. }
  19318. ,
  19319. t.prototype.pathClean = function(e) {
  19320. if (e) {
  19321. for (var t in e.children)
  19322. this.pathClean(e.children[t]);
  19323. e.geometry && e.geometry.dispose(),
  19324. e.material && e.material.dispose()
  19325. }
  19326. }
  19327. ,
  19328. t.prototype.discardPathObject = function() {
  19329. if (this.obj3d) {
  19330. var e = this.obj3d.parent;
  19331. e && e.remove(this.obj3d),
  19332. this.pathClean(this.obj3d)
  19333. }
  19334. this.obj3d = null,
  19335. this.popInCpm()
  19336. }
  19337. ,
  19338. t.prototype.discardSlow = function() {
  19339. if (this.obj3d) {
  19340. if (this.player.mode !== O.PANORAMA)
  19341. return void this.discardPathObject();
  19342. for (var e, t = 0, i = function() {
  19343. this.discardPathObject()
  19344. }
  19345. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19346. 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]),
  19347. t += 1,
  19348. i = null);
  19349. 0 === t && this.discardPathObject(),
  19350. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19351. }
  19352. }
  19353. ,
  19354. t.prototype.appearSlow = function() {
  19355. var e;
  19356. this.fadeOutCpm(D.path.fadeInTime);
  19357. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19358. 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]))
  19359. }
  19360. ,
  19361. t.prototype.update = function() {
  19362. this.obj3d && this.obj3d.updateMatrixWorld()
  19363. }
  19364. ,
  19365. t.prototype.calcBurnsAmount = function(e) {
  19366. var n = P.Math.degToRad(D.warp.burnsAngle);
  19367. if (this.player.mode !== O.PANORAMA)
  19368. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19369. var t = this.burnsDir * n;
  19370. if (this.upcomingTransType === L.BLACK)
  19371. return t;
  19372. var i = e;
  19373. if (null === i)
  19374. return H.warn("Transition request for non-highlight"),
  19375. t;
  19376. var r = this.getHeroDescriptorByHeroIndex(i);
  19377. if (null === r)
  19378. return t;
  19379. if (!r.isPano())
  19380. return t;
  19381. function o(e) {
  19382. var t = Math.acos(Math.min(1, e.dot(l)))
  19383. , i = (new P.Vector3).crossVectors(l, e);
  19384. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19385. }
  19386. var a = this.getHeroPano(r)
  19387. , s = this.playerControls.cameras[O.PANORAMA]
  19388. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19389. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19390. if (a === this.player.currentPano)
  19391. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19392. var h = this.findShortestPath(this.player.currentPano, a);
  19393. if (null == h || h.length < 1)
  19394. return H.debug("Empty path ahead..."),
  19395. t;
  19396. var u = this.makePathHulls(h)
  19397. , d = new P.CatmullRomCurve3(u.camera)
  19398. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19399. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19400. }
  19401. ,
  19402. t.prototype.waitNextStep = function(e, t, i) {
  19403. var o = null == i ? D.warp.tourStepDelay : i;
  19404. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19405. var a = new P.Euler
  19406. , s = new P.Vector3;
  19407. H.debug("Starting wait: " + (void 0 !== t));
  19408. var l = this.calcBurnsAmount(e)
  19409. , c = function() {
  19410. this.endWarpState(),
  19411. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19412. t && t()
  19413. }
  19414. .bind(this)
  19415. , n = function(e, t) {
  19416. if (this.warpInterrupted)
  19417. return c(),
  19418. !0;
  19419. var i = t || 1e3 / 60;
  19420. if (D.warp.doBurns)
  19421. if (this.player.mode === O.PANORAMA) {
  19422. var n = this.playerControls.cameras[O.PANORAMA];
  19423. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19424. var r = i * l / o;
  19425. a.y += r,
  19426. s.set(0, 0, -1),
  19427. s.applyEuler(a),
  19428. s.add(n.position),
  19429. n.controls.lookAt(s),
  19430. n.controls.lookVector.copy(s),
  19431. n.lookAt(s)
  19432. } else
  19433. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19434. }
  19435. .bind(this);
  19436. this.startWarpState(),
  19437. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19438. //zoom动画 方奕卓 相机缩放
  19439. var currentGuide = player.model.getHeroDescriptorByIndex(player.director.currentItem)
  19440. if(currentGuide.zoom && currentGuide.zoom != this.player.zoomLevel){
  19441. this.player.zoomEnabled = true;
  19442. var startZoom = this.player.zoomLevel
  19443. var zoom = function(e, d) {
  19444. var zoomLevel = currentGuide.zoom.toFixed(2) * e + startZoom * (1-e);
  19445. this.player.zoomTo( zoomLevel, true)
  19446. }.bind(this)
  19447. V.start(zoom, 2000, null, 0, B.easeOutQuad, "zoom")
  19448. }
  19449. }
  19450. ,
  19451. t.prototype.warpToNonPano = function(e) {
  19452. if (this.discardPathObject(),
  19453. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19454. var t = function() {
  19455. e && e()
  19456. }
  19457. .bind(this);
  19458. this.player.flyToNewMode({
  19459. mode: this.warpDestHeroLoc.cameraMode,
  19460. duration: D.warp.outsideTime,
  19461. warpDest: this.warpDestHeroLoc,
  19462. callback: t,
  19463. force: !0
  19464. })
  19465. } else
  19466. H.warn("no warp destination!!!"),
  19467. e && e()
  19468. }
  19469. ,
  19470. t.prototype._resetWarpShaderParams = function(e) {
  19471. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19472. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19473. }
  19474. ,
  19475. t.prototype._clearWarpShading = function() {
  19476. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19477. this._resetWarpShaderParams(e[t]),
  19478. e[t].visible = !0;
  19479. this._resetWarpShaderParams(this.model.skybox)
  19480. }
  19481. ,
  19482. t.prototype._warpStopFlying = function() {
  19483. this.activeTransType = null,
  19484. this.placeCpm()
  19485. }
  19486. ,
  19487. t.prototype._wrapupTravelOnlyBits = function() {
  19488. this._warpStopFlying(),
  19489. this.warpPathPoints && (this.player.currentPano.exit(),
  19490. this.warpDestPano.enter(),
  19491. this.player.currentPano = this.warpDestPano),
  19492. this.player.spider.draw(),
  19493. this.placeCpm()
  19494. }
  19495. ,
  19496. t.prototype._wrapupTravel = function(e) {
  19497. this._wrapupTravelOnlyBits(),
  19498. this.warpCameraAim(e)
  19499. }
  19500. ,
  19501. t.prototype._wrapupWarpShading = function(e) {
  19502. this._clearWarpShading(),
  19503. this._wrapupTravel(e)
  19504. }
  19505. ,
  19506. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19507. t !== z.END && this._clearWarpShading(),
  19508. this._wrapupTravelOnlyBits(),
  19509. this.upcomingTransType = null,
  19510. e && e()
  19511. }
  19512. ,
  19513. t.prototype._warpCameraAim = function(e, t) {
  19514. var i = this.warpDestHeroLoc.quaternion
  19515. , n = this.playerControls.cameras[O.PANORAMA]
  19516. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19517. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19518. , a = P.Math.radToDeg(Math.acos(o))
  19519. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19520. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19521. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19522. c.y = N.constrainedTurn(c.y),
  19523. this.burnsDir = Math.sign(c.y);
  19524. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19525. , u = new P.Vector3
  19526. , d = function(e, t) {
  19527. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19528. h.y = l.y + e * c.y,
  19529. h.z = l.z + e * c.z,
  19530. u.set(0, 0, -1),
  19531. u.applyEuler(h),
  19532. u.add(n.position),
  19533. n.controls.lookAt(u),
  19534. n.controls.lookVector.copy(u),
  19535. void n.lookAt(u))
  19536. }
  19537. .bind(this);
  19538. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19539. void (t && t()))
  19540. }
  19541. ,
  19542. t.prototype._warpBendAim = function(e, t, i, n) {
  19543. var r = n || 0
  19544. , o = this.playerControls.cameras[O.PANORAMA]
  19545. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19546. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19547. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19548. l.y = N.constrainedTurn(l.y);
  19549. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19550. l.x = c * Math.sign(l.x),
  19551. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19552. this.burnsDir = Math.sign(l.y),
  19553. c *= Math.sign(l.y),
  19554. l.y = c;
  19555. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19556. , u = new P.Vector3
  19557. , d = function(e, t) {
  19558. if (e < .5)
  19559. h.x = s.x + e * l.x,
  19560. h.y = s.y + e * l.y,
  19561. h.z = s.z + e * l.z;
  19562. else {
  19563. var i = (1 - e) * D.warp.softBendEnd;
  19564. h.x = a.x - i * l.x,
  19565. h.y = a.y - i * l.y,
  19566. h.z = a.z - i * l.z
  19567. }
  19568. u.set(0, 0, -1),
  19569. u.applyEuler(h),
  19570. u.add(o.position),
  19571. o.controls.lookAt(u),
  19572. o.controls.lookVector.copy(u),
  19573. o.lookAt(u)
  19574. }
  19575. .bind(this);
  19576. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19577. }
  19578. ,
  19579. t.prototype._warpStepCameraAim = function(e, t, i) {
  19580. var n = this.playerControls.cameras[O.PANORAMA]
  19581. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19582. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19583. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19584. a.y = N.constrainedTurn(a.y),
  19585. this.burnsDir = Math.sign(a.y);
  19586. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19587. , l = new P.Vector3
  19588. , c = function(e, t) {
  19589. e < .5 ? s.copy(o) : s.copy(r),
  19590. l.set(0, 0, -1),
  19591. l.applyEuler(s),
  19592. l.add(n.position),
  19593. n.controls.lookAt(l),
  19594. n.controls.lookVector.copy(l),
  19595. n.lookAt(l)
  19596. }
  19597. .bind(this);
  19598. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19599. }
  19600. ,
  19601. t.prototype.setBurnsDir = function() {
  19602. var e = this.playerControls.cameras[O.PANORAMA]
  19603. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19604. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19605. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19606. n.y = N.constrainedTurn(n.y),
  19607. this.burnsDir = Math.sign(n.y)
  19608. }
  19609. ,
  19610. t.prototype.stepWarpPath = function(e, t) {
  19611. var i = this.playerControls.cameras[O.PANORAMA];
  19612. if (!this.warpPathPoints)
  19613. return i.position.copy(this.warpDestPano.position),
  19614. !0;
  19615. var n = this.warpPathPoints[0]
  19616. , r = this.warpDestPano.position;
  19617. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19618. var o = new P.Vector3;
  19619. 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),
  19620. i.position.copy(o)
  19621. } else
  19622. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19623. }
  19624. ,
  19625. t.prototype.interruptAndFastForward = function(e, t) {
  19626. this.warping && (this.warpInterrupted = !0,
  19627. this.warpInterruptionBlackoutStyle = e,
  19628. this.warpInterruptionTravelTime = t,
  19629. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19630. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19631. }
  19632. ,
  19633. t.prototype.warpCameraAim = function(e) {
  19634. var t = D.warp.minWarpTime;
  19635. if (this.upcomingTransType === L.BLACK)
  19636. t = D.warp.teleportTime;
  19637. else {
  19638. var i = this.playerControls.cameras[O.PANORAMA]
  19639. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19640. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19641. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19642. o.y = N.constrainedTurn(o.y);
  19643. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19644. t = Math.max(t, a)
  19645. }
  19646. var s = function() {
  19647. this._warpStopFlying(),
  19648. this.discardSlow(),
  19649. e && e()
  19650. }
  19651. .bind(this);
  19652. this._warpCameraAim(t, s)
  19653. }
  19654. ,
  19655. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19656. this.model.skybox.material.uniforms.blackout.value = n;
  19657. var r = F.uniform(this.model.skybox, "progress", 1)
  19658. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19659. , a = !1
  19660. , s = function() {
  19661. if (this.warpInterrupted)
  19662. return a = !0
  19663. }
  19664. .bind(this)
  19665. , l = function(e, t) {
  19666. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19667. }
  19668. .bind(this)
  19669. , c = function(e, t) {
  19670. return i && a ? (o(0),
  19671. !0) : void o(e, t)
  19672. }
  19673. .bind(this);
  19674. V.start(s, e, null, t, null, "safeHaltWatch"),
  19675. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19676. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19677. }
  19678. ,
  19679. t.prototype.warpTravel_STD = function(e) {
  19680. 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),
  19681. 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;
  19682. t += this.warpLength * D.warp.timePerMeter,
  19683. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19684. function n(e) {
  19685. var t = i;
  19686. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19687. }
  19688. var y = !1
  19689. , r = this.warpDestHeroLoc.quaternion
  19690. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19691. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19692. , a = A.dot(o)
  19693. , C = P.Math.radToDeg(Math.acos(a))
  19694. , s = function() {
  19695. return m.lookAt(g, l, U.UP),
  19696. u.setFromRotationMatrix(m, D.warp.eOrder),
  19697. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19698. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19699. N.constrainedTurn(v.y)
  19700. }
  19701. .bind(this)
  19702. , I = function(e, t) {
  19703. if (this.warpInterrupted)
  19704. return y = !0
  19705. }
  19706. .bind(this)
  19707. , E = function(e, t) {
  19708. return y || !this.warpPathPoints ? (k.blur(0),
  19709. !0) : void k.blur(e)
  19710. }
  19711. .bind(this)
  19712. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19713. , b = function(e, t) {
  19714. return y || !this.warpPathPoints ? (_(0),
  19715. !0) : void _(e, t)
  19716. }
  19717. .bind(this)
  19718. , w = function(e, t) {
  19719. if (!this.warpPathPoints)
  19720. return h.position.copy(this.warpDestPano.position),
  19721. !0;
  19722. if (y)
  19723. return !0;
  19724. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19725. h.position.copy(i),
  19726. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19727. }
  19728. .bind(this)
  19729. , T = function(e, t) {
  19730. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19731. !0)
  19732. }
  19733. .bind(this)
  19734. , x = function(e, t) {
  19735. if (y)
  19736. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19737. !0;
  19738. if (!this.warpPathPoints)
  19739. return !0;
  19740. var i = this.warpLength * e
  19741. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19742. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19743. D.warp.matchCam && (n *= 1 - r),
  19744. m.lookAt(g, l, U.UP),
  19745. u.setFromRotationMatrix(m, D.warp.eOrder),
  19746. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19747. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19748. v.y = N.constrainedTurn(v.y),
  19749. u.x = p.x + n * v.x,
  19750. u.y = p.y + n * v.y,
  19751. u.z = p.z + n * v.z,
  19752. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19753. v.y = N.constrainedTurn(v.y);
  19754. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19755. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19756. f.x = f.x + v.x * D.warp.turnFriction,
  19757. f.y = f.y + v.y * D.warp.turnFriction,
  19758. f.z = f.z + v.z * D.warp.turnFriction,
  19759. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19760. var a = l.clone().sub(g).normalize();
  19761. if (C < D.warp.maxAimRotation && 0 < r) {
  19762. var s = 1 - r;
  19763. a.x = a.x * s + r * A.x,
  19764. a.y = a.y * s + r * A.y,
  19765. a.z = a.z * s + r * A.z,
  19766. a.normalize()
  19767. }
  19768. this.bunnyObj.position.copy(h.position).add(a),
  19769. d.set(0, 0, -1).applyEuler(f).normalize(),
  19770. d.multiplyScalar(8),
  19771. d.add(h.position),
  19772. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19773. h.controls.lookVector.copy(d),
  19774. h.lookAt(d))
  19775. }
  19776. .bind(this)
  19777. , S = function() {
  19778. y ? (this.discardSlow(),
  19779. this.upcomingTransType = L.BLACK,
  19780. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19781. }
  19782. .bind(this);
  19783. T(0);
  19784. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19785. , R = M / (t += M);
  19786. this.warpCommonParameters(t, R, !0, z.NONE),
  19787. V.start(I, t, null, 0, null, "_haltWatcher"),
  19788. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19789. V.start(E, t, null, R, n, "blurring")),
  19790. V.start(b, t, null, R, n, "modelAlpha"),
  19791. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19792. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19793. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19794. }
  19795. ,
  19796. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19797. var r = e || 0;
  19798. null != t || (t = D.warp.teleportTime),
  19799. this.warpCommonParameters(t, r, !1, i),
  19800. this.model.chunks.forEach(function(e) {
  19801. e.material.uniforms.blackout.value = i
  19802. }),
  19803. this._warpBendAim(null, t, null, r);
  19804. var o = function() {
  19805. this.wrapupWarpShadingOnly(n, i)
  19806. }
  19807. .bind(this);
  19808. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19809. }
  19810. ,
  19811. t.prototype.flightStepWalk = (a = new P.Vector3,
  19812. s = new P.Vector3,
  19813. function(e, t, i) {
  19814. if (this.warpInterrupted)
  19815. i && i();
  19816. else if (this.activeTransType !== L.WALK)
  19817. this._clearWarpShading(),
  19818. this._warpStopFlying(),
  19819. this.player.spider.draw(),
  19820. this.placeCpm(),
  19821. i && i();
  19822. else if (this.player.currentPano !== e) {
  19823. var n = {
  19824. pano: e,
  19825. lookAtPoint: t,
  19826. duration: null,
  19827. maxDistanceOverride: D.warp.walkMaxDist,
  19828. skipWarpingCheck: !1,
  19829. constantMoveSpeed: !0
  19830. };
  19831. n.duration = function(e, t) {
  19832. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19833. s.copy(U.FORWARD),
  19834. this.player.getDirection(s),
  19835. a.copy(t).sub(e.position).normalize();
  19836. var n = a.dot(s)
  19837. , r = Math.acos(n)
  19838. , o = r / i;
  19839. return .001 < o && (i *= o / .001,
  19840. r < 1 && (i *= 1.2)),
  19841. i
  19842. }
  19843. .call(this, e, t),
  19844. this.player.nonInterruptingFlyToPano(n, i)
  19845. } else
  19846. i && i()
  19847. }
  19848. ),
  19849. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19850. return this.flightStepWalk.bind(this, e, t, i)
  19851. }
  19852. ,
  19853. t.prototype.warpTravel_WALK = (f = [],
  19854. function(e) {
  19855. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19856. var o = this.nodes[r]
  19857. , a = t.get(o);
  19858. this.nodes.length,
  19859. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19860. i && n || (f.push(o),
  19861. i = a)
  19862. }
  19863. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19864. var s = f.length
  19865. , l = t.get(f[s - 1])
  19866. , c = new Array(s + 1);
  19867. c[c.length - 1] = function() {
  19868. e && e()
  19869. }
  19870. .bind(this);
  19871. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19872. var d = f[h];
  19873. l = t.get(d);
  19874. var p = new P.Vector3;
  19875. this.getLookAtForWalkingTourNode(f, h, p),
  19876. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19877. h--
  19878. }
  19879. c[0]()
  19880. }
  19881. ),
  19882. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19883. h = new P.Vector3,
  19884. u = new P.Vector3,
  19885. d = new P.Vector3,
  19886. p = new P.Vector3,
  19887. function(e, t, i) {
  19888. var n = e.length;
  19889. if (n <= t)
  19890. return !1;
  19891. var r = 1
  19892. , o = 1;
  19893. h.set(0, 0, 0),
  19894. p.set(0, 0, 0);
  19895. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19896. if (a = this.player.model.panos.get(e[s]),
  19897. this.getOrientationForWalkingTourNode(e, s, u),
  19898. s === t && c.copy(u),
  19899. d.copy(u),
  19900. t < s) {
  19901. var l = d.dot(c) < .65;
  19902. r *= l ? .2 : .75,
  19903. o *= l ? .2 : .4
  19904. }
  19905. u.multiplyScalar(r),
  19906. h.add(u),
  19907. p.lerp(a.position, o)
  19908. }
  19909. return h.normalize(),
  19910. i.copy(p),
  19911. i.add(h),
  19912. !0
  19913. }
  19914. ),
  19915. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19916. var n = e.length;
  19917. if (n <= t)
  19918. return !1;
  19919. if (t === n - 1)
  19920. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19921. else {
  19922. var r = this.player.model.panos.get(e[t])
  19923. , o = this.player.model.panos.get(e[t + 1]);
  19924. i.copy(o.position).sub(r.position)
  19925. }
  19926. return i.normalize(),
  19927. !0
  19928. }
  19929. ,
  19930. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19931. if (this.activeTransType = this.upcomingTransType,
  19932. this.lastTransType = this.activeTransType,
  19933. this.upcomingTransType = null,
  19934. e)
  19935. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19936. this._clearWarpShading(),
  19937. this._warpStopFlying(),
  19938. this.player.spider.draw(),
  19939. this.placeCpm(),
  19940. n && n()
  19941. }
  19942. .bind(this)) : this.warpTravel_STD(n);
  19943. else {
  19944. var r = function() {
  19945. this._wrapupTravel(n)
  19946. }
  19947. .bind(this)
  19948. , o = {
  19949. pano: this.warpDestPano,
  19950. lookAtPoint: null,
  19951. duration: null,
  19952. maxDistanceOverride: null,
  19953. skipWarpingCheck: !1
  19954. };
  19955. this.player.flyToPano(o, r)
  19956. }
  19957. }
  19958. ,
  19959. t.prototype.startWarpState = function() {
  19960. this.warping = !0,
  19961. this.warpInterrupted = !1,
  19962. this.warpInterruptionBlackoutStyle = null,
  19963. this.warpInterruptionTravelTime = null
  19964. }
  19965. ,
  19966. t.prototype.endWarpState = function() {
  19967. this.warping = !1
  19968. }
  19969. ,
  19970. t.prototype.warpToPano = function(e, t, i, n) {
  19971. if (this.warping)
  19972. H.warn("Cannot warp when already warping");
  19973. else {
  19974. if (this.upcomingTransType = e,
  19975. this.activeTransType = null,
  19976. !this.setWarpDestPano())
  19977. return this.upcomingTransType = null,
  19978. void this.warpToNonPano(n);
  19979. if (this.player.mode !== O.PANORAMA)
  19980. return this.upcomingTransType = null,
  19981. this.discardSlow(),
  19982. void this.player.flyToNewMode({
  19983. mode: O.PANORAMA,
  19984. pano: this.warpDestPano,
  19985. duration: D.warp.outsideTime,
  19986. warpDest: this.warpDestHeroLoc,
  19987. callback: n,
  19988. force: !0
  19989. });
  19990. if (!this.warpDestPano)
  19991. return H.warn("no warp destination, callback dropped"),
  19992. void (this.upcomingTransType = null);
  19993. 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)
  19994. , o = this.chooseWarpPath(r);
  19995. if (o && this.upcomingTransType !== L.WALK) {
  19996. var a = function() {
  19997. this.waitingToWarp = !1,
  19998. this.warpToPano(e, t, i, n)
  19999. }
  20000. .bind(this);
  20001. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  20002. return void (this.waitingToWarp = !0)
  20003. }
  20004. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  20005. this.player.currentPano = this.warpDestPano,
  20006. this.placeCpm(),
  20007. this.fadeOutCpm(D.path.fadeOutTime),
  20008. this.player.spider.draw()),
  20009. H.debug("Warping to pano ", this.warpDestPano.position),
  20010. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20011. this.startWarpState();
  20012. var s = function() {
  20013. this.endWarpState(),
  20014. n && n()
  20015. }
  20016. .bind(this);
  20017. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20018. }
  20019. }
  20020. ,
  20021. v.exports = t
  20022. }
  20023. ).call(this, "/js/objects/ShowPath.js")
  20024. }
  20025. , {
  20026. "../constants": 8,
  20027. "../effects": 16,
  20028. "../enum/BlackoutStyle": 18,
  20029. "../enum/ModelManagerEvents": 33,
  20030. "../enum/PlayerEvents": 40,
  20031. "../enum/RenderOrder": 42,
  20032. "../enum/Vectors": 50,
  20033. "../enum/Viewmode": 51,
  20034. "../enum/WarpStyle": 52,
  20035. "../gui/gui": 65,
  20036. "../model/ModelManager": 140,
  20037. "../objects/Snapshot": 153,
  20038. "../settings": 166,
  20039. "../shaders": 167,
  20040. "../util/easing": 186,
  20041. "../util/lerp": 188,
  20042. "../util/logger": 189,
  20043. "../util/math": 190,
  20044. "../util/texture": 194,
  20045. "../util/transitions": 195,
  20046. three: 217
  20047. }],
  20048. 152: [function(e, t, i) {
  20049. "use strict";
  20050. function n() {
  20051. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20052. , t = new r.RawShaderMaterial({
  20053. fragmentShader: o.skysphere.fragmentShader,
  20054. vertexShader: o.skysphere.vertexShader,
  20055. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20056. side: r.BackSide,
  20057. name: "skysphere"
  20058. });
  20059. t.uniforms.radius.value = e.parameters.radius,
  20060. r.Mesh.call(this, e, t)
  20061. }
  20062. var r = e("three")
  20063. , o = e("../shaders")
  20064. , a = e("../settings");
  20065. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20066. t.exports = n
  20067. }
  20068. , {
  20069. "../settings": 166,
  20070. "../shaders": 167,
  20071. three: 217
  20072. }],
  20073. 153: [function(r, o, e) {
  20074. (function(e) {
  20075. "use strict";
  20076. function t(e) {
  20077. n.call(this, e),
  20078. this.sid = e.sid,
  20079. this.panoId = e.panoId,
  20080. this.orthoZoom = e.orthoZoom,
  20081. this.floorVisibility = e.floorVisibility,
  20082. this.thumbUrl = e.thumbUrl,
  20083. this.name = e.name,
  20084. this.zoom = e.zoom
  20085. }
  20086. var i = (r("three"),
  20087. r("../util/logger"))
  20088. , n = (r("../settings"),
  20089. r("../enum/Viewmode"),
  20090. r("../util/common"),
  20091. r("../util/transitions"),
  20092. r("../util/lerp"),
  20093. r("../util/ajax"),
  20094. r("../util/texture"),
  20095. r("./View"));
  20096. r("events").EventEmitter,
  20097. new i(e),
  20098. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20099. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20100. }
  20101. ,
  20102. o.exports = t
  20103. }
  20104. ).call(this, "/js/objects/Snapshot.js")
  20105. }
  20106. , {
  20107. "../enum/Viewmode": 51,
  20108. "../settings": 166,
  20109. "../util/ajax": 181,
  20110. "../util/common": 185,
  20111. "../util/lerp": 188,
  20112. "../util/logger": 189,
  20113. "../util/texture": 194,
  20114. "../util/transitions": 195,
  20115. "./View": 154,
  20116. events: 202,
  20117. three: 217
  20118. }],
  20119. 154: [function(o, a, e) {
  20120. (function(e) {
  20121. "use strict";
  20122. function t(e) {
  20123. e = e || {},
  20124. this.position = new i.Vector3,
  20125. this.quaternion = new i.Quaternion,
  20126. this.update(e)
  20127. }
  20128. var i = o("three")
  20129. , n = o("../util/logger")
  20130. , r = (o("../settings"),
  20131. o("../enum/Viewmode"),
  20132. o("../util/common"),
  20133. o("../util/transitions"),
  20134. o("../util/lerp"),
  20135. o("../util/ajax"),
  20136. o("../util/texture"),
  20137. o("events").EventEmitter);
  20138. new n(e),
  20139. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20140. return !!this.cameraMode
  20141. }
  20142. ,
  20143. t.prototype.update = function(e) {
  20144. return this.cameraMode = e.cameraMode || this.cameraMode,
  20145. this.pano = e.pano || this.pano,
  20146. e.position && this.position.copy(e.position),
  20147. e.quaternion && this.quaternion.copy(e.quaternion),
  20148. this
  20149. }
  20150. ,
  20151. a.exports = t
  20152. }
  20153. ).call(this, "/js/objects/View.js")
  20154. }
  20155. , {
  20156. "../enum/Viewmode": 51,
  20157. "../settings": 166,
  20158. "../util/ajax": 181,
  20159. "../util/common": 185,
  20160. "../util/lerp": 188,
  20161. "../util/logger": 189,
  20162. "../util/texture": 194,
  20163. "../util/transitions": 195,
  20164. events: 202,
  20165. three: 217
  20166. }],
  20167. 155: [function(J, ee, e) {
  20168. (function(e) {
  20169. "use strict";
  20170. function t(e) {
  20171. this.currentPano = null,
  20172. this.nextPano = null,
  20173. this.camera = null,
  20174. this.paused = !1,
  20175. this.flying = !1,
  20176. this.sceneIntersectionPlane = null,
  20177. this.target = new B.Vector3,
  20178. this.mouse = new B.Vector3(1.1,1.1,.5),
  20179. this.mouseAtMouseDown = new B.Vector2,
  20180. this.mouseCouldBeClickToMove = !1,
  20181. this.mouseLastMoveTime = Date.now(),
  20182. this.mouseDown = !1,
  20183. this.mouseDownTimer = null,
  20184. this.couldBeLongTap = !1,
  20185. this.containsMouse = !0,
  20186. this.isTouchEvent = !1,
  20187. this.isPanoHover = !1,
  20188. this.reticule = new n(this),
  20189. this.panoMarkers = [],
  20190. this.spider = new s(this),
  20191. this.quaternion = new B.Quaternion,
  20192. this.position = new B.Vector3(15,10,15),
  20193. this.previousState = null,
  20194. this.lastInsideView = new o,
  20195. this.last360View = new o,
  20196. this.raycaster = new B.Raycaster,
  20197. this.intersect = null,
  20198. this.lastChangeTime = Date.now(),
  20199. this.history = new h,
  20200. this.cameraControls = null,
  20201. this.path = null,
  20202. this.model = null,
  20203. this.domElement = null,
  20204. this.cachedPanoCandidates = null,
  20205. this.basePanoSize = 0,
  20206. this.standardPanoSize = 0,
  20207. this.highPanoSize = 0,
  20208. this.ultraHighPanoSize = 0,
  20209. this.zoomLevel = 1,
  20210. this.zooming = 0,
  20211. this.zoomSpeed = .5,
  20212. this.scrollZoomSpeed = .06,
  20213. this.zoomSpeedAdjust = .05,
  20214. this.defaultZoomIncrement = .2,
  20215. this.baseFov = k.insideFOV,
  20216. this.zoomFov = this.baseFov,
  20217. this.zoomEnabled = !0,
  20218. this.preRenderingEnabled = !1,
  20219. this.setupCustomProperties(e),
  20220. this.zoomStats = new v,
  20221. this.modeTran = 'dollhouse-panorama'
  20222. this.currentCursor = '';
  20223. }
  20224. var B = J("three")
  20225. , i = J("./util/logger")
  20226. , n = J("./objects/Reticule")
  20227. , a = J("./objects/Panorama")
  20228. , r = J("./objects/ShowPath")
  20229. , o = J("./objects/View")
  20230. , s = (J("./objects/Snapshot"),
  20231. J("./objects/NSpider"))
  20232. , V = J("./enum/Viewmode")
  20233. , T = (J("./enum/TagStates"),
  20234. J("./enum/Vectors"))
  20235. , l = J("./enum/Keys")
  20236. , k = (J("./enum/AlignmentType"),
  20237. J("./settings"))
  20238. , x = J("./util/common")
  20239. , U = (J("./util/browser"),
  20240. J("./util/math"))
  20241. , H = J("./util/lerp")
  20242. , z = J("./util/easing")
  20243. , G = J("./util/transitions")
  20244. , c = J("events").EventEmitter
  20245. , h = (J("./shaders"),
  20246. J("./util/history"))
  20247. , S = (J("./util/camera"),
  20248. J("./model/ModelManager"),
  20249. J("./enum/PathDiscardMode"))
  20250. , M = J("./enum/PathDisplayMode")
  20251. , W = J("./enum/PlayerEvents")
  20252. , u = J("./enum/ControlEvents")
  20253. , d = J("./enum/ModelManagerEvents")
  20254. , R = J("./enum/WarpStyle")
  20255. , P = J("./enum/BlackoutStyle")
  20256. , p = J("./exception/BasicException")
  20257. , f = J("./enum/PanoSizeClass")
  20258. , g = (J("./tile/TileDownloader"),
  20259. J("./tile/TilePrioritizer"))
  20260. , m = (J("./enum/PanoramaEvents"),
  20261. J("./enum/ZoomEvents"))
  20262. , v = J("./util/ZoomStats")
  20263. , y = J("./constants")
  20264. , j = J("./util/common")
  20265. , A = J("./util/cameraLight")
  20266. , C = J("hot")
  20267. , Y = new i(e)
  20268. , q = Object.freeze({
  20269. FlyToPano: G.getUniqueId(),
  20270. FlyToNewMode: G.getUniqueId(),
  20271. FlyToSameMode: G.getUniqueId(),
  20272. FlyToViewFloor: G.getUniqueId(),
  20273. LookTransition: G.getUniqueId(),
  20274. ZoomTransition: G.getUniqueId()
  20275. });
  20276. function I(e) {
  20277. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20278. o[r] = n.charCodeAt(r);
  20279. return new Blob([o],{
  20280. type: i
  20281. })
  20282. }
  20283. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20284. (window.player = this).modelManager = e.modelManager,
  20285. this.tileDownloader = e.tileDownloader,
  20286. this.panoRenderer = e.panoRenderer,
  20287. this.qualityManager = e.qualityManager,
  20288. this.domElement = e.container,
  20289. this.camera = e.camera,
  20290. this.tagManager = e.tagManager,
  20291. this.cameraControls = e.controls,
  20292. this.path = new r(e.director,this,e.controls),
  20293. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20294. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20295. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20296. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20297. this.tileDownloader.processPriorityQueue = !1,
  20298. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20299. this.bindEvents(e.container),
  20300. this.updateModel()
  20301. }
  20302. ,
  20303. t.prototype.screenShot = function(i) {
  20304. if (!this.flying && !this.flyingToTag) {
  20305. var n = this.sceneRenderer;
  20306. for (var e in n.updateScreenSize(i),
  20307. this.model.panos.index)
  20308. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20309. this.model.panos.index[e].marker.visible = !1);
  20310. for (var e in this.model.hots)
  20311. this.model.hots[e].mesh.visible = !1;
  20312. this.reticule.visible = !1,
  20313. this.reticule.forceUnvisible = !0,
  20314. this.path.currentPanoMarker.mesh.visible = !1,
  20315. setTimeout(function() {
  20316. n.renderer.clear(!0, !0, !0),
  20317. n.renderer.render(n.scene, n.camera);
  20318. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20319. for (var t in i.f && i.f(e),
  20320. n.updateScreenSize({
  20321. resize: !0
  20322. }),
  20323. this.reticule.visible = !0,
  20324. this.model.hots)
  20325. this.model.hots[t].mesh.visible = !0;
  20326. for (var t in this.model.panos.index)
  20327. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20328. this.path.currentPanoMarker.mesh.visible = !0,
  20329. n.renderer.render(n.scene, n.camera)
  20330. }
  20331. .bind(this), 30)
  20332. }
  20333. }
  20334. ;
  20335. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20336. t.prototype.getWrapShot = function() {
  20337. var i = this.getSnapAngleInfo()
  20338. , n = ",{\r\t" + i
  20339. , r = arguments[0];
  20340. this.screenShot({
  20341. width: g_snapShotWidth,
  20342. height: g_snapShotHeight,
  20343. type: "image/jpeg",
  20344. f: function(e) {
  20345. if (r && r.__callback)
  20346. return r.__callback(e, i);
  20347. var t = new Image;
  20348. t.src = e,
  20349. t.onload = function() {
  20350. var e = function(r, i) {
  20351. function n(e, t) {
  20352. var i = o || r
  20353. , n = document.createElement("canvas");
  20354. n.width = i.width,
  20355. n.height = i.height,
  20356. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20357. o = Q(e, n, t)
  20358. }
  20359. function e() {
  20360. var e = o || r
  20361. , t = I(e.src);
  20362. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20363. t = I(e.src)),
  20364. (o = o || new Image).base64Src = e.src,
  20365. o.src = window.URL.createObjectURL(t)
  20366. }
  20367. var o, t = Math.max(r.width, r.height);
  20368. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20369. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20370. e())),
  20371. o || r
  20372. }(this, {
  20373. maxSize: g_snapShotWidth,
  20374. oldType: "jpeg"
  20375. });
  20376. e.src.replace(function(e) {
  20377. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20378. }("image/jpeg"), "image/octet-stream");
  20379. var t = "snap" + (new Date).getTime();
  20380. !function(e, t) {
  20381. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20382. i.href = e,
  20383. i.download = t;
  20384. var n = document.createEvent("MouseEvents");
  20385. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20386. i.dispatchEvent(n)
  20387. }(e.src, t + ".jpg"),
  20388. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20389. n += '\r\t"sid":"' + t + '",',
  20390. n += '\r\t"name":"' + t + '"\r}',
  20391. logData(n)
  20392. }
  20393. }
  20394. })
  20395. }
  20396. /* ,
  20397. t.prototype.getSnapAngleInfo = function() {
  20398. var e = {}
  20399. , t = '"metadata":{'
  20400. , i = this.camera.quaternion.clone();
  20401. switch (this.mode) {
  20402. case "panorama":
  20403. e.scan_id = this.currentPano.id,
  20404. t += '"scan_id":"' + this.currentPano.id + '",';
  20405. break;
  20406. case "floorplan":
  20407. e.camera_mode = 1,
  20408. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20409. t += '"camera_mode":1,',
  20410. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20411. break;
  20412. case "dollhouse":
  20413. e.camera_mode = 2,
  20414. t += '"camera_mode":2,'
  20415. }
  20416. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20417. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20418. n.x *= -1,
  20419. n.w *= -1,
  20420. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20421. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20422. e.zoom = this.zoomLevel,
  20423. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20424. }
  20425. , */
  20426. t.prototype.getSnapAngleInfo = function(){
  20427. var info = {};
  20428. var str = '"metadata":{';
  20429. var q = this.camera.quaternion.clone();
  20430. switch (this.mode) {
  20431. case "panorama":
  20432. info.scan_id = this.currentPano.id;
  20433. str += ('"scan_id":"'+this.currentPano.id+'",');
  20434. break;
  20435. case "floorplan":
  20436. info.camera_mode = 1;
  20437. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20438. q.multiply(this.camera.quaternion);
  20439. str += ('"camera_mode":1,');
  20440. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20441. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20442. break;
  20443. case "dollhouse":
  20444. info.camera_mode = 2;
  20445. str += ('"camera_mode":2,');
  20446. break;
  20447. }
  20448. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20449. //console.log(info.camera_position)
  20450. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20451. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20452. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20453. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20454. out.x *= -1;
  20455. out.w *= -1;
  20456. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20457. }else{
  20458. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20459. } */
  20460. info.zoom = this.zoomLevel;
  20461. //console.log(info.camera_quaternion)
  20462. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20463. // fyz 扩展编辑页面, 加上导览点缩放值
  20464. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20465. console.log(str)
  20466. return str;
  20467. }
  20468. //------end
  20469. t.prototype.closePopup = function() {
  20470. if (g_currentHot) {
  20471. g_currentHot = null,
  20472. document.getElementById("popup").style.display = "none",
  20473. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20474. $("#popup iframe:last").remove();
  20475. document.getElementById("bgaudio");
  20476. if(g_bgAudio && g_bgAudio.pauseByHot){
  20477. manage.switchBgmState(true)
  20478. }
  20479. return false
  20480. }
  20481. }
  20482. ,
  20483. t.prototype.setupCustomProperties = function(e) {
  20484. var i = e || V.PANORAMA;
  20485. Object.defineProperty(this, "mode", {
  20486. get: function() {
  20487. return i
  20488. },
  20489. set: function(e) {
  20490. var t = i;
  20491. i = e,
  20492. this.onModeUpdated(t, i)
  20493. }
  20494. })
  20495. }
  20496. ,
  20497. t.prototype.isInMode = function() {
  20498. for (var e = 0; e < arguments.length; e++)
  20499. if (this.mode === arguments[e])
  20500. return !0;
  20501. return !1
  20502. }
  20503. ,
  20504. t.prototype.isOutsideMode = function(e) {
  20505. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20506. }
  20507. ,
  20508. t.prototype.is360View = function(e, t) {
  20509. return e === V.PANORAMA && t && !t.isAligned()
  20510. }
  20511. ,
  20512. t.prototype.setScene = function(e) {
  20513. this.sceneIntersectionPlane = e.plane,
  20514. this.path.setScene(e),
  20515. this.moveReticuleToScene(e)
  20516. }
  20517. ,
  20518. t.prototype.moveReticuleToScene = function(e) {
  20519. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20520. e.add(this.reticule)
  20521. }
  20522. ,
  20523. t.prototype.updateModel = function() {
  20524. function n(e) {
  20525. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20526. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20527. , n = t.position.y + (e - i.target.y)
  20528. , r = k.showFloorDuration + k.showFloorDelay;
  20529. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20530. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20531. }
  20532. this.model = this.modelManager.getActiveModel(),
  20533. this.model.on("floor.changed", function(e, t, i) {
  20534. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20535. }
  20536. .bind(this)),
  20537. this.model.on("allfloors.toggled", function(e, t) {
  20538. if (this.mode === V.DOLLHOUSE) {
  20539. var i = e ? this.model.center.y : i = t.center.y;
  20540. n.call(this, i)
  20541. }
  20542. }
  20543. .bind(this)),
  20544. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20545. var t = this;
  20546. this.model.panos.list.forEach(function(e) {
  20547. e.vrMarker.addEventListener("click", function() {
  20548. t.flyToPano({
  20549. pano: e
  20550. })
  20551. })
  20552. })
  20553. }
  20554. ,
  20555. t.prototype.updateModelDependentData = function() {
  20556. this.cameraControls.setModelForControls(this.model),
  20557. this.getPanoMarkersFromModel(this.model)
  20558. }
  20559. ,
  20560. t.prototype.onModelChanged = function() {
  20561. this.updateModel(),
  20562. this.updateModelDependentData()
  20563. }
  20564. ,
  20565. t.prototype.getPanoMarkersFromModel = function(e) {
  20566. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20567. return t.marker ? e.concat(t.marker) : e
  20568. }, [])
  20569. }
  20570. ,
  20571. t.prototype.handleControlMove = function(e) {
  20572. this.emit(W.Move, e)
  20573. }
  20574. ,
  20575. t.prototype.handleControlInputStart = function(e) {
  20576. this.emit(W.InputStart, e)
  20577. }
  20578. ,
  20579. t.prototype.onModeUpdated = function(e, t) {
  20580. this.cameraControls.activateControls(t),
  20581. this.emit(W.ModeChanged, e, t)
  20582. }
  20583. ,
  20584. t.prototype.isWarping = function() {
  20585. return this.path.warping
  20586. }
  20587. ,
  20588. t.prototype.isWaitingToWarp = function() {
  20589. return this.path.waitingToWarp
  20590. }
  20591. ,
  20592. t.prototype.getLabelScaleFactor = function() {
  20593. if (this.isOutsideMode()) {
  20594. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20595. }
  20596. return .5
  20597. }
  20598. ,
  20599. t.prototype.changeMusic = function() {
  20600. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20601. }
  20602. ,
  20603. t.prototype.bindEvents = function(e) {
  20604. e !== document && e.setAttribute("tabindex", -1),
  20605. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20606. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20607. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20608. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20609. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20610. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20611. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20612. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20613. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20614. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20615. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20616. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20617. document.addEventListener("pointerup", ()=>{//add
  20618. window.transformControls && transformControls.onPointerUp()
  20619. }),
  20620. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20621. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20622. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20623. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20624. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20625. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20626. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20627. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20628. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20629. window.getSeft && getSeft(this),
  20630. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20631. }
  20632. ,
  20633. t.prototype.onMouseDown = function(e) {
  20634. e.currentTarget !== document && e.currentTarget.focus(),
  20635. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20636. this.updateIntersect())
  20637. }
  20638. ,
  20639. t.prototype.onMouseMove = function(e) {
  20640. this.isTouchEvent = !1,
  20641. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20642. }
  20643. ,
  20644. t.prototype.onMouseOver = function(e) {
  20645. this.containsMouse = !0,
  20646. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20647. }
  20648. ,
  20649. t.prototype.onMouseOut = function(e) {
  20650. this.containsMouse = !1
  20651. }
  20652. ,
  20653. t.prototype.onMouseUp = function(e) {
  20654. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20655. }
  20656. ,
  20657. t.prototype.onTouchStart = function(e) {
  20658. if (e.currentTarget !== document && e.currentTarget.focus(),
  20659. !this.mouseDown) {
  20660. this.couldBeLongTap = !0;
  20661. var t = x.average(e.changedTouches, "clientX")
  20662. , i = x.average(e.changedTouches, "clientY");
  20663. this.handleInputStart.call(this, t, i, !0),
  20664. this.mouseDownTimer = setTimeout(function() {
  20665. this.updateIntersect(),
  20666. this.handleInputEnd.call(this, t, i, !0)
  20667. }
  20668. .bind(this), k.input.longTapThreshold)
  20669. }
  20670. }
  20671. ,
  20672. t.prototype.onTouchMove = function(e) {
  20673. var t = x.average(e.changedTouches, "clientX")
  20674. , i = x.average(e.changedTouches, "clientY");
  20675. this.handleInputMove.call(this, t, i, !0)
  20676. }
  20677. ,
  20678. t.prototype.onTouchEnd = function(e) {
  20679. if (clearTimeout(this.mouseDownTimer),
  20680. this.mouseDown) {
  20681. this.couldBeLongTap = !1,
  20682. this.updateIntersect();
  20683. var t = x.average(e.changedTouches, "clientX")
  20684. , i = x.average(e.changedTouches, "clientY");
  20685. this.handleInputEnd.call(this, t, i, !0)
  20686. }
  20687. }
  20688. ,
  20689. t.prototype.onPointerDown = function(e) {
  20690. return e.currentTarget !== document && e.currentTarget.focus(),
  20691. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20692. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20693. void (this.mouseDownTimer = setTimeout(function() {
  20694. this.updateIntersect(),
  20695. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20696. }
  20697. .bind(this), k.input.longTapThreshold)))
  20698. }
  20699. ,
  20700. t.prototype.onPointerMove = function(e) {
  20701. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20702. }
  20703. ,
  20704. t.prototype.onPointerUp = function(e) {
  20705. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20706. this.couldBeLongTap = !1,
  20707. this.updateIntersect(),
  20708. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20709. }
  20710. ,
  20711. t.prototype.onPointerOut = function(e) {
  20712. this.mouseDown = !1
  20713. }
  20714. ,
  20715. t.prototype.onPointerCancel = function(e) {
  20716. this.mouseDown = !1
  20717. }
  20718. ,
  20719. t.prototype.onKeyDown = function(e) {
  20720. var t = function() {
  20721. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20722. }
  20723. .bind(this)
  20724. , i = e.which;
  20725. switch (i) {
  20726. case l.F:
  20727. t(),
  20728. this.changeFloor(-1);
  20729. break;
  20730. case l.R:
  20731. t(),
  20732. this.changeFloor(1)
  20733. }
  20734. if (this.mode === V.PANORAMA)
  20735. switch (i) {
  20736. case l.UPARROW:
  20737. case l.W:
  20738. this.flyLocalDirection(T.FORWARD.clone());
  20739. break;
  20740. case l.DOWNARROW:
  20741. case l.S:
  20742. this.flyLocalDirection(T.BACK.clone());
  20743. break;
  20744. case l.A:
  20745. this.flyLocalDirection(T.LEFT.clone());
  20746. break;
  20747. case l.D:
  20748. this.flyLocalDirection(T.RIGHT.clone())
  20749. }
  20750. }
  20751. ,
  20752. t.prototype.handleScrollPinchZoom = function(e) {
  20753. var t = e
  20754. , i = this.zoomLevel;
  20755. this.zoomBy(t),
  20756. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20757. }
  20758. ,
  20759. t.prototype.handleControlPinch = function(e) {
  20760. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20761. }
  20762. ,
  20763. t.prototype.handleControlScroll = function(e) {
  20764. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20765. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20766. }
  20767. ,
  20768. t.prototype.handleInputStart = function(e, t, i) {
  20769. var n = this.handelPadding(e, t);
  20770. e = n.x,
  20771. t = n.y,
  20772. this.isTouchEvent = i,
  20773. U.convertScreenPositionToNDC(e, t, this.mouse),
  20774. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20775. this.mouseCouldBeClickToMove = !0,
  20776. this.mouseDown = !0,
  20777. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20778. window.transformControls && transformControls.onPointerDown()
  20779. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20780. try{
  20781. this.overlayGroup.children.forEach((overlay)=>{
  20782. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20783. })
  20784. }catch(e){}
  20785. this.overlayInitedPlay = true
  20786. }
  20787. }
  20788. ,
  20789. t.prototype.handelPadding = function(e, t) {
  20790. return this.pad || (this.pad = {
  20791. x: dom.getOffset("left", $("#player")[0]),
  20792. y: dom.getOffset("top", $("#player")[0])
  20793. }),
  20794. {
  20795. x: e - this.pad.x,
  20796. y: t - this.pad.y
  20797. }
  20798. }
  20799. ,
  20800. t.prototype.handleInputMove = function(e, t, i) {
  20801. var n = this.handelPadding(e, t);
  20802. e = n.x,
  20803. t = n.y,
  20804. this.isTouchEvent = i,
  20805. U.convertScreenPositionToNDC(e, t, this.mouse);
  20806. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20807. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20808. this.couldBeLongTap = !1,
  20809. clearTimeout(this.mouseDownTimer)),
  20810. this.mouseLastMoveTime = Date.now(),
  20811. this.reticule.move(e, t, i)
  20812. window.transformControls && transformControls.onPointerMove()
  20813. }
  20814. ,
  20815. t.prototype.handleInputEnd = function(e, t, i) {
  20816. if (this.isTouchEvent = i,
  20817. this.mouseDown = !1,
  20818. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20819. !i && this.couldBeLongTap)
  20820. return !0;
  20821. if (this.handleLongTap())
  20822. return !0;
  20823. window.transformControls && transformControls.onPointerUp()
  20824. if (this.mouseCouldBeClickToMove) {
  20825. if (this.flying)
  20826. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20827. !0;
  20828. //add----
  20829. if (this.checkHotClick())
  20830. return !0;
  20831. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20832. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20833. return;
  20834. }
  20835. if (window.VisiSet && VisiSet.setTagVisible ) {
  20836. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20837. return;
  20838. }
  20839. if(this.hoveringPlane){
  20840. this.clickOverlay(this.hoveringPlane)
  20841. return;
  20842. }
  20843. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20844. return EditOverlay.addPlane({intersect:this.intersect});
  20845. }
  20846. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20847. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20848. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20849. } */
  20850. //----------
  20851. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20852. this.history.invalidate(),
  20853. this.intersect)
  20854. return this.flyToPanoClosestToMouse();
  20855. if (this.mode === V.PANORAMA) {
  20856. var n = this.closestPanoInDirection(this.getMouseDirection());
  20857. return n ? this.flyToPano({
  20858. pano: n
  20859. }) : this.bump(this.getMouseDirection())
  20860. }
  20861. }
  20862. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20863. }
  20864. ,
  20865. t.prototype.handleLongTap = function() {
  20866. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20867. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20868. !0
  20869. }
  20870. ,
  20871. t.prototype.checktagClick = function() {
  20872. if (this.tagManager.intersectTag) {
  20873. var e = this.isTouchEvent
  20874. , t = this.tagManager.clickedOnTag(e, this);
  20875. return e || t || G.cancelById(q.LookTransition),
  20876. !0
  20877. }
  20878. if (this.tagManager.activeTag)
  20879. return this.tagManager.dismissActiveTag(),
  20880. !1
  20881. }
  20882. ,
  20883. t.prototype.rankedtagInDirection = function(e, t) {
  20884. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20885. }
  20886. ,
  20887. t.prototype.start = function(e) {
  20888. $(".toolLeft").removeClass("unable");
  20889. $(".toolTop").removeClass("unable");
  20890. //-------------------
  20891. window.initTransformCtl(B)
  20892. window.initOverlay(B)
  20893. this.model.loadOverlays()
  20894. window.EditOverlay && window.EditOverlay.init(B);
  20895. window.VisiSet && VisiSet.init()
  20896. //-------------------
  20897. var t = e.mode
  20898. , i = e.pano
  20899. , n = e.position
  20900. , r = e.quaternion
  20901. , o = e.tag
  20902. , a = e.quickstart
  20903. , s = $.Deferred();
  20904. this.updateModelDependentData(),
  20905. this.updateFromControls(),
  20906. this.findDefaultViews();
  20907. var l = this.is360View(t, i);
  20908. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20909. s.done(function(e) {
  20910. this.emit(W.Ready, l, e, o)
  20911. }
  20912. .bind(this)),
  20913. s.promise()
  20914. }
  20915. ,
  20916. t.prototype.startOutside = function(e, t) {
  20917. var i = e.mode
  20918. , n = e.pano
  20919. , r = e.position
  20920. , o = e.quaternion
  20921. , a = e.zoom
  20922. , s = e.floorVisibility
  20923. , l = e.tag;
  20924. this.emit(W.StartOutside, k[i].transitionTime),
  20925. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20926. G.cancelById(q.FlyToViewFloor),
  20927. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20928. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20929. }
  20930. ,
  20931. t.prototype.startInside = function(e, t, i, n, r) {
  20932. r = r || $.Deferred();
  20933. var o = (this.currentPano = e) && !e.isAligned();
  20934. if (t = o ? e.position : t || e.position,
  20935. i = i || e.quaternion,
  20936. e) {
  20937. var a = this.startInside.bind(this, e, t, i, n, r);
  20938. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20939. return
  20940. }
  20941. //add
  20942. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20943. return this.mode = V.PANORAMA,
  20944. e.floor.enter(this.mode),
  20945. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20946. this.switchCameraMode(this.mode, i),
  20947. this.emit(W.StartInside, o),
  20948. r.resolve(!0),
  20949. r
  20950. }
  20951. ,
  20952. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20953. if (r = r || $.Deferred(),
  20954. this.dollhouseMode(),
  20955. !i)
  20956. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20957. r.resolve(!1),
  20958. r;
  20959. e = e || i.position;
  20960. var o = n || this.cameraControls.activeControl.camera.quaternion
  20961. , a = i.position;
  20962. return this.fitDollhouse(a, e, o),
  20963. setTimeout(function(e) {
  20964. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20965. var t = {
  20966. mode: V.PANORAMA,
  20967. pano: i,
  20968. quaternion: n,
  20969. callback: function() {
  20970. this.emit(W.FlyinFinished),
  20971. r.resolve(!0)
  20972. }
  20973. .bind(this)
  20974. };
  20975. this.flyToNewMode(t)
  20976. }
  20977. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20978. r
  20979. }
  20980. ,
  20981. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20982. K = {},
  20983. function(t, e, i, n, r, o, a, s, l, c) {
  20984. if (function() {
  20985. for (var e in Z)
  20986. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20987. return !0;
  20988. return !1
  20989. }())
  20990. return !0;
  20991. var h = function(e, t, i) {
  20992. j.delayOneFrame(function() {
  20993. Z[e] = !1,
  20994. r && r(t, i)
  20995. }
  20996. .bind(this))
  20997. }
  20998. .bind(this, t.id)
  20999. , u = function(e, t) {
  21000. j.delayOneFrame(function() {
  21001. Z[e] = !1,
  21002. o && o(t)
  21003. }
  21004. .bind(this))
  21005. }
  21006. .bind(this, t.id);
  21007. try {
  21008. return null != s || (s = !0),
  21009. 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),
  21010. Z[t.id] && (K[t.id] = performance.now()),
  21011. Z[t.id]
  21012. } catch (e) {
  21013. throw Z[t.id] = !1,
  21014. K[t.id] = performance.now() - 5e3,
  21015. e
  21016. }
  21017. }
  21018. ),
  21019. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21020. if (!e)
  21021. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21022. return r && this.model.waitForLoad(e, function() {
  21023. return e.isLoaded(i)
  21024. }),
  21025. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21026. !0)
  21027. }
  21028. ,
  21029. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21030. function(e, t, i, n, r, o, a, s) {
  21031. if (!e)
  21032. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21033. return X.copy(T.FORWARD),
  21034. this.getDirection(X),
  21035. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21036. return e.isLoaded(t)
  21037. }),
  21038. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21039. i && i(e, t)
  21040. }
  21041. .bind(this)).fail(function(e) {
  21042. n && n(e)
  21043. }
  21044. .bind(this)).progress(function(e, t, i) {
  21045. r && r(e, t, i)
  21046. }
  21047. .bind(this)),
  21048. !0)
  21049. }
  21050. ),
  21051. t.prototype.switchCameraMode = function(e, t) {
  21052. var i = this.cameraControls.controls[e]
  21053. , n = i.camera;
  21054. switch (e) {
  21055. case V.PANORAMA:
  21056. n.position.copy(this.currentPano.position);
  21057. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21058. i.lookAt(r.add(n.position));
  21059. break;
  21060. case V.DOLLHOUSE:
  21061. /* var o = this.position.clone();
  21062. 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),
  21063. n.position.copy(o),
  21064. i.target.copy(this.target.clone().setY(this.model.center.y));
  21065. break; */
  21066. //for多楼层 且 让模型刚好适应屏幕
  21067. var box = this.model.boundingBox.clone();
  21068. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21069. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21070. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21071. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21072. console.log(boxSize.x,distance, boxSize.length() / 2)
  21073. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21074. if(this.mode === V.PANORAMA){
  21075. i.target.copy(this.model.center);
  21076. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21077. }else{
  21078. i.target.copy(this.target.clone().setY(this.model.center.y))
  21079. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21080. }
  21081. vec.multiplyScalar(distance )
  21082. n.position.copy(i.target.clone().add(vec))
  21083. break
  21084. case V.FLOORPLAN:
  21085. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21086. i.target.copy(this.model.center).setY(0),
  21087. i.zoomToContain(this.model.size),
  21088. i.rotateToView(this.model.size, this.getDirection())
  21089. }
  21090. i.update(0)
  21091. }
  21092. ,
  21093. t.prototype.update = (new B.Vector3,
  21094. N = {},
  21095. F = [],
  21096. function(e) {
  21097. this.updatePersistentZooming(e),
  21098. this.updateFromControls(e),
  21099. this.getCurrentNodePanos(F)
  21100. if(this.hasChanged(N)){
  21101. this.lastChangeTime = Date.now(),
  21102. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21103. this.emit(W.ViewChanged)
  21104. //add:
  21105. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  21106. this.intersectHot && this.intersectHot.showTitle()
  21107. for(var i in this.model.hots){
  21108. this.model.hots[i].update(this.camera)
  21109. }
  21110. }
  21111. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21112. this.model.supportsTiles && (this.updateTileDownloader(F),
  21113. this.updatePanoRenderer(F)),
  21114. this.updatePreRendering(F),
  21115. this.reticule.update(),
  21116. this.path.update(),
  21117. this.spider.update(),
  21118. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21119. this.updateControlLocks(),
  21120. this.model.supportsTiles && this.updateZoomPano()
  21121. }
  21122. ),
  21123. t.prototype.updatePersistentZooming = function(e) {
  21124. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21125. }
  21126. ,
  21127. t.prototype.updateControlLocks = function() {
  21128. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21129. }
  21130. ,
  21131. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21132. function(e) {
  21133. var t = this.nextPano || this.currentPano;
  21134. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21135. this.getDirection(D),
  21136. this.panoRenderer.updateDirection(D))
  21137. }
  21138. ),
  21139. t.prototype.cleanupInactivePanos = (O = [],
  21140. L = [],
  21141. function() {
  21142. O.length = 0,
  21143. O.push(this.currentPano),
  21144. this.nextPano && O.push(this.nextPano);
  21145. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21146. L.push(this.panoRenderer.activePanos[e]);
  21147. for (var t = 0; t < L.length; t++) {
  21148. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21149. i.id === O[r].id && (n = !1);
  21150. n && i.exit()
  21151. }
  21152. }
  21153. ),
  21154. t.prototype.updatePreRendering = (w = {},
  21155. function(e) {
  21156. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21157. var t = this.nextPano || this.currentPano;
  21158. if (t && e && 1 < e.length) {
  21159. var i = e.findIndex(function(e) {
  21160. if (e.id === t.id)
  21161. return !0
  21162. });
  21163. if (0 <= i && i + 1 < e.length) {
  21164. var n = e[i + 1];
  21165. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21166. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21167. window.setTimeout(function(e) {
  21168. w[e.id] = !1
  21169. }
  21170. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21171. }
  21172. .bind(this, n), k.tiling.panoPreRenderDelay),
  21173. w[n.id] = !0)
  21174. }
  21175. }
  21176. }
  21177. }
  21178. ),
  21179. t.prototype.enablePreRendering = function() {
  21180. this.preRenderingEnabled = !0
  21181. }
  21182. ,
  21183. t.prototype.disablePreRendering = function() {
  21184. this.preRenderingEnabled = !1,
  21185. this.cleanupInactivePanos()
  21186. }
  21187. ,
  21188. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21189. function(e) {
  21190. var t = this.nextPano || this.currentPano;
  21191. t && (b.copy(T.FORWARD),
  21192. this.getDirection(b),
  21193. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21194. this.tileDownloader.processPriorityQueue = !0)
  21195. }
  21196. ),
  21197. t.prototype.updateFromControls = function(e) {
  21198. null != e || (e = 0),
  21199. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21200. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21201. this.position.copy(this.cameraControls.activeControl.camera.position),
  21202. this.target.copy(this.cameraControls.activeControl.target),
  21203. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21204. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21205. this.camera.position.copy(this.position),
  21206. this.camera.quaternion.copy(this.quaternion),
  21207. this.camera.updateMatrix(),
  21208. this.camera.updateMatrixWorld()
  21209. }
  21210. ,
  21211. t.prototype.hasChanged = function(e) {
  21212. if (!this.previousState)
  21213. return this.previousState = {
  21214. allFloorsVisible: this.model.allFloorsVisible,
  21215. position: this.position.clone(),
  21216. quaternion: this.quaternion.clone(),
  21217. mouse: this.mouse.clone(),
  21218. labelScaleFactor: this.getLabelScaleFactor(),
  21219. currentFloor: this.model.currentFloor,
  21220. projectionMatrix: this.camera.projectionMatrix.clone(),
  21221. worldMatrix: this.camera.matrixWorld.clone(),
  21222. mode: this.mode,
  21223. modelPosition: this.model.position.clone(),
  21224. modelCenter: this.model.center.clone(),
  21225. zoomLevel: this.zoomLevel
  21226. },
  21227. !0;
  21228. 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;
  21229. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21230. e.moved = !this.position.equals(this.previousState.position),
  21231. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21232. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21233. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21234. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21235. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21236. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21237. e.modeChanged = this.mode !== this.previousState.mode,
  21238. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21239. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21240. e.nextPanoActive = null !== this.nextPano,
  21241. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21242. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21243. this.previousState.position.copy(this.position),
  21244. this.previousState.quaternion.copy(this.quaternion),
  21245. this.previousState.mouse.copy(this.mouse),
  21246. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21247. this.previousState.currentFloor = this.model.currentFloor,
  21248. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21249. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21250. this.previousState.mode = this.mode,
  21251. this.previousState.modelPosition.copy(this.model.position),
  21252. this.previousState.modelCenter.copy(this.model.center),
  21253. this.previousState.zoomLevel = this.zoomLevel,
  21254. !t
  21255. }
  21256. ,
  21257. t.prototype.updateIntersect = function() {
  21258. var e = this.flying || this.isWarping()
  21259. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21260. , i = G.getById(q.LookTransition);
  21261. e || t || this.isTouchEvent || i.length && i[0].running;
  21262. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21263. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21264. if (this.intersect && this.intersect.object.visible )
  21265. $("#player").css("cursor", "pointer");
  21266. else
  21267. $("#player").css("cursor", "")
  21268. return;
  21269. }
  21270. this.intersect = this.getMouseIntersect(),
  21271. this.intersect && this.updateClosestPano(this.intersect),
  21272. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21273. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21274. }
  21275. ,
  21276. t.prototype.checkHotClick = function() {
  21277. if (this.intersectHot){
  21278. if (window.VisiSet && VisiSet.setTagVisible ) {
  21279. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21280. return;
  21281. }
  21282. this.intersectHot.noAction || this.intersectHot.examine(this)
  21283. return !0
  21284. }
  21285. }
  21286. ,
  21287. t.prototype.getMouseDirection = function(e) {
  21288. e = e || this.mouse;
  21289. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21290. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21291. }
  21292. ,
  21293. t.prototype.hoverOverlay = function(mesh){
  21294. if(!mesh){
  21295. this.hoveringPlane = null;
  21296. $("#player").css("cursor",this.currentCursor || "" );
  21297. }else{
  21298. var overlay = mesh.parent;
  21299. $("#player").css("cursor","pointer");
  21300. this.hoveringPlane = overlay;
  21301. return true;
  21302. }
  21303. },
  21304. t.prototype.clickOverlay = function(overlay){
  21305. if(this.openOverlay && !overlay)return;
  21306. var plane = overlay.plane;
  21307. if(overlay.overlayType == "video"){
  21308. if(plane.material.map.image.paused)plane.material.map.image.play()
  21309. else plane.material.map.image.pause();
  21310. }
  21311. if(window.EditOverlay &&EditOverlay.editing){
  21312. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21313. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21314. EditOverlay.endAddPlane();
  21315. EditOverlay.updateOverlayPanel(overlay)
  21316. transformControls.attach(overlay)
  21317. return;
  21318. }
  21319. },
  21320. t.prototype.getMouseIntersect = function(e, t1) {
  21321. e = e || this.mouse.clone()
  21322. var t = t1 || this.model.floors.reduce(function(e, t) {
  21323. return t.hidden ? e : e.concat(t.collider.children)
  21324. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21325. t = t.slice(0)
  21326. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21327. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21328. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21329. this.raycaster.set(i, this.getMouseDirection(e));
  21330. var n = this.raycaster.intersectObjects(t, true);//add true
  21331. if ("add" == g_HotStatus) {
  21332. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21333. //console.log(r[0]),
  21334. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21335. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21336. window.hotIntersect = !1)
  21337. return;
  21338. }
  21339. this.intersectHot && this.intersectHot.hideTitle()
  21340. if (0 === n.length)
  21341. return this.intersectHot = null,
  21342. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21343. null;
  21344. var o = n[0];
  21345. if ("hotSprite" == o.object.type){
  21346. this.intersectHot = o.object.belongHot
  21347. this.intersectHot.showTitle()
  21348. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21349. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21350. return;
  21351. }
  21352. $(".toolRight .spotList ul li").removeClass("active")
  21353. this.intersectHot = null;
  21354. /* if(window.EditOverlay && n && n.length){
  21355. if(n[0].object.parent.parent == this.overlayGroup){
  21356. this.hoverOverlay(n[0].object);
  21357. }else()
  21358. } */
  21359. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21360. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21361. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21362. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21363. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21364. o.horizontal = .8 < o.normal.y);
  21365. return o
  21366. }
  21367. ,
  21368. t.prototype.updateClosestPano = function(e) {
  21369. var t = [a.filters.isPanoAligned()];
  21370. if (this.mode === V.PANORAMA) {
  21371. if (!this.currentPano)
  21372. return;
  21373. t.push(a.filters.not(this.currentPano)),
  21374. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21375. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21376. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21377. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21378. } else{
  21379. t.push((pano)=>{ // add
  21380. return this.checkHasNeighbor(pano)
  21381. })
  21382. t.push(a.filters.isOnVisibleFloor()),
  21383. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21384. }
  21385. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21386. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21387. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21388. this.closestPano = i) : this.isPanoHover = !1
  21389. }
  21390. ,
  21391. t.prototype.dollhouseMode = function(e, t) {
  21392. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21393. this.mode = V.DOLLHOUSE,
  21394. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21395. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21396. , n = new B.Vector3(15,10,15);
  21397. if (e && t) {
  21398. var r = T.FORWARD.clone().applyQuaternion(t)
  21399. , o = this.model.center.clone().sub(e).dot(r);
  21400. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21401. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21402. }
  21403. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21404. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21405. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21406. this.updateFromControls(),
  21407. this.model.alpha = 1,
  21408. this.model.skybox.material.uniforms.opacity.value = 0
  21409. }
  21410. ,
  21411. t.prototype.insideMode = function(e, t) {
  21412. var i = $.Deferred()
  21413. , n = t || null;
  21414. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21415. var r = [a.filters.isPanoAligned()];
  21416. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21417. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21418. this.flyToNewMode({
  21419. mode: V.PANORAMA,
  21420. pano: e,
  21421. callback: n
  21422. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21423. } else {
  21424. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21425. i.reject(o)
  21426. }
  21427. return i.promise()
  21428. }
  21429. ,
  21430. t.prototype.fitDollhouse = function(e, t, i) {
  21431. var maxY = this.model.boundingBox.max.y;//add
  21432. var n = T.FORWARD.clone().applyQuaternion(i);
  21433. i = n.clone().add(e);
  21434. this.cameraControls.activeControl.target.copy(i),
  21435. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21436. }
  21437. ,
  21438. t.prototype.floorplanMode = function(e, t, i) {
  21439. this.mode = V.FLOORPLAN;
  21440. var n = this.cameraControls.controls[V.FLOORPLAN];
  21441. n.reset();
  21442. var r = e || this.model.center;
  21443. if (n.target.copy(r).setY(0),
  21444. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21445. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21446. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21447. t) {
  21448. var o = T.LEFT.clone().applyQuaternion(t);
  21449. n.rotateLeft(-Math.atan2(o.x, o.z))
  21450. } else
  21451. n.rotateToView(this.model.size, this.getDirection());
  21452. n.update(0)
  21453. }
  21454. ,
  21455. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21456. return e.skipWarpingCheck = !0,
  21457. this.flyToPano(e, t)
  21458. }
  21459. ,
  21460. t.prototype.updateMarkerVisi = function() {//加
  21461. if(this.mode != "panorama")return;
  21462. this.model.panos.list.forEach((pano)=>{
  21463. if(!pano.marker)return;
  21464. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21465. })
  21466. }
  21467. ,
  21468. t.prototype.updateHotVisible = function(pano){
  21469. if (window.VisiSet && (VisiSet.setPanoVisible ))return
  21470. var hots = this.model.hots;
  21471. pano = pano || this.currentPano;
  21472. for (var index in hots){
  21473. var visible;
  21474. if(this.mode != "panorama"){
  21475. visible = true;
  21476. }else{
  21477. //hots[index].mesh.material.depthTest = false;
  21478. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21479. }
  21480. hots[index].mesh.visible = visible;
  21481. }
  21482. },
  21483. t.prototype.flyToPano = function(e, t) {
  21484. //e.duration = 100
  21485. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  21486. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21487. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21488. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21489. t && t(),
  21490. !1;
  21491. if (this.updateLastView(),
  21492. this.mode !== V.PANORAMA)
  21493. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21494. void this.flyToNewMode({
  21495. mode: V.PANORAMA,
  21496. pano: n,
  21497. duration: o,
  21498. quaternion: i,
  21499. callback: t
  21500. });
  21501. if (!n || (h = x.deepExtend(e),
  21502. u = function() {
  21503. j.delayOneFrame(function() {
  21504. this.flyToPano(h, t)
  21505. }
  21506. .bind(this))
  21507. }
  21508. .bind(this),
  21509. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21510. var d = function(e) {
  21511. t && t(e)
  21512. }
  21513. .bind(this);
  21514. this.currentPano || (this.currentPano = n,
  21515. this.path.placeCpm(),
  21516. this.path.fadeOutCpm(k.path.fadeOutTime),
  21517. this.spider.draw());
  21518. var p = o;
  21519. if ("number" != typeof o) {
  21520. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21521. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21522. }
  21523. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21524. 1 !== this.zoomLevel)
  21525. switch (k.zoom.transitionStyle) {
  21526. case 1:
  21527. this.smoothZoomToDefault(p / 2);
  21528. break;
  21529. case 2:
  21530. return h = x.deepExtend(e),
  21531. u = this.flyToPano.bind(this, h, t),
  21532. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21533. }
  21534. if (r) {
  21535. G.cancelById(q.LookTransition),
  21536. p *= k.transition.aimSlowFactor;
  21537. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21538. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21539. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21540. , y = g.clone()
  21541. , A = new B.Vector3;
  21542. if (n === this.currentPano) {
  21543. var C = T.FORWARD.clone().applyQuaternion(g)
  21544. , I = T.FORWARD.clone().applyQuaternion(v)
  21545. , E = C.angleTo(I);
  21546. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21547. void G.start(function(e) {
  21548. y.copy(g),
  21549. H.quaternion(y, v)(e),
  21550. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21551. this.cameraControls.activeControl.lookAt(A)
  21552. }
  21553. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21554. }
  21555. }
  21556. if (n === this.currentPano || this.flying)
  21557. return void d();
  21558. this.flying = !0;
  21559. var _ = this.position.clone()
  21560. , b = this.currentPano;
  21561. Y.debug("Flying to pano ", n.position);
  21562. this.emit(W.PanoChosen, this.currentPano, n);
  21563. this.emit(W.FlyingStarted, n.position, _, n, b);
  21564. this.updateHotVisible(n); //更新热点显示
  21565. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21566. Overlay.updateVisibles([this.currentPano, n])
  21567. r && G.start(function(e) {
  21568. y.copy(g),
  21569. H.quaternion(y, v)(e),
  21570. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21571. this.cameraControls.activeControl.lookAt(A)
  21572. }
  21573. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21574. var w = c ? null : z[k.transition.movementEasing];
  21575. this.nextPano = n;
  21576. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21577. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21578. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21579. this.flying = !1,
  21580. this.currentPano !== n && this.currentPano.exit(),
  21581. n.enter(),
  21582. this.currentPano = n,
  21583. this.nextPano = null,
  21584. this.path.placeCpm(),
  21585. this.path.fadeOutCpm(k.path.fadeOutTime),
  21586. this.spider.draw(),
  21587. this.emit(W.FlyingEnded, n.position, _, n, b),
  21588. this.updateMarkerVisi();//add
  21589. d(e)
  21590. if(this.mode == "panorama" && EditOverlay.editing){
  21591. EditOverlay.updatePano(this.currentPano)
  21592. Overlay.updateVisibles([this.currentPano])
  21593. }
  21594. }
  21595. .bind(this), 0, w, "camFly", q.FlyToPano)
  21596. }
  21597. }
  21598. ,
  21599. window._transitionPosId = 9999
  21600. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21601. G.cancelById(_transitionPosId)
  21602. var begin = function(object, pos, qua, scale){
  21603. if(pos){
  21604. if(!same(object.position, pos, 0.01)){
  21605. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21606. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21607. }
  21608. if(!same(object.quaternion, qua, 1e-6)){
  21609. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21610. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21611. }
  21612. if(!same(object.scale, scale, 0.001)){
  21613. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21614. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21615. }
  21616. }
  21617. }
  21618. var same = function(vec1, vec2, diff){
  21619. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21620. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21621. return s
  21622. }
  21623. this.overlayGroup.children.forEach(overlay=>{
  21624. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21625. var useCustom = o.type == "beforeFlyOut" || !panoData
  21626. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21627. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21628. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21629. overlay.getScaleBySize(panoData.width , panoData.height)
  21630. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21631. begin(overlay, pos, qua, scale )
  21632. })
  21633. }
  21634. t.prototype.fastForwardActivePanoFlight = function(e) {
  21635. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21636. G.adjustSpeed(q.FlyToPano, e),
  21637. G.adjustSpeed(q.LookTransition, e)
  21638. }
  21639. ,
  21640. t.prototype.flyToPanoClosestToMouse = function() {
  21641. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21642. this.intersect && this.updateClosestPano(this.intersect)),
  21643. this.closestPano)
  21644. return this.flyToPano({
  21645. pano: this.closestPano
  21646. });
  21647. var e = this.getMouseDirection();
  21648. this.flyDirection(e) || this.flyToPano({
  21649. pano: this.currentPano
  21650. })
  21651. }
  21652. ,
  21653. t.prototype.flyLocalDirection = function(e) {
  21654. var t = this.getDirection(e)
  21655. , i = 1 === e.z ? .4 : .75
  21656. , n = 1 === Math.abs(e.x);
  21657. return this.flyDirection(t, i, n)
  21658. }
  21659. ,
  21660. t.prototype.flyDirection = function(e, t, i) {
  21661. this.closePopup();
  21662. var n = $.Deferred();
  21663. this.history.invalidate();
  21664. var r = this.closestPanoInDirection(e, t, i);
  21665. return r ? this.flyToPano({
  21666. pano: r
  21667. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21668. n.resolve(!1)),
  21669. n.promise()
  21670. }
  21671. ,
  21672. t.prototype.closestPanoInDirection = function(e, t, i) {
  21673. return this.rankedPanoInDirection(0, e, t, i)
  21674. }
  21675. ,
  21676. t.prototype.rankedPanoInDirection = (_ = {
  21677. pano: null,
  21678. candidates: []
  21679. },
  21680. function(e, t, i, n) {
  21681. e = e || 0,
  21682. i = void 0 !== i ? i : .75;
  21683. var r = n ? "angle" : "direction";
  21684. 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)], _),
  21685. this.cachedPanoCandidates = _.candidates,
  21686. _.pano
  21687. }
  21688. ),
  21689. t.prototype.bump = function(e) {
  21690. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21691. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21692. if (.5 < Math.abs(a))
  21693. t = function() {
  21694. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21695. }
  21696. .bind(this),
  21697. i = function() {
  21698. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21699. }
  21700. .bind(this);
  21701. else {
  21702. var s = this.camera.position.clone()
  21703. , l = e.clone();
  21704. this.raycaster.set(s, l);
  21705. var c = this.model.floors.reduce(function(e, t) {
  21706. return e.concat(t.collider.children)
  21707. }, [])
  21708. , h = this.raycaster.intersectObjects(c)
  21709. , u = 0 < h.length ? h[0].distance / 25 : .04
  21710. , d = s.clone().add(l.multiplyScalar(u));
  21711. t = function() {
  21712. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21713. }
  21714. .bind(this),
  21715. i = function() {
  21716. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21717. }
  21718. .bind(this)
  21719. }
  21720. n = function() {
  21721. this.flying = !1
  21722. }
  21723. .bind(this),
  21724. this.flying = !0,
  21725. t()
  21726. }
  21727. }
  21728. ,
  21729. t.prototype.changeFloor = function(e) {
  21730. if (!this.is360View(this.mode, this.currentPano))
  21731. if (this.mode === V.PANORAMA) {
  21732. var t = this.history.reversePano(e);
  21733. t && t.isAligned() ? this.flyToPano({
  21734. pano: t
  21735. }) : this.changeFloorByScore(e)
  21736. } else
  21737. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21738. }
  21739. ,
  21740. t.prototype.changeFloorByScore = (E = {
  21741. pano: null,
  21742. candidates: []
  21743. },
  21744. function(e) {
  21745. var t = this.model.nextFloor(e);
  21746. 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),
  21747. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21748. this.history.push(e, this.currentPano),
  21749. this.flyToPano({
  21750. pano: E.pano
  21751. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21752. }
  21753. ),
  21754. t.prototype.gotoFloor = function(e) {
  21755. var t = e - this.model.currentFloor.floorIndex;
  21756. this.changeFloor(t)
  21757. }
  21758. ,
  21759. t.prototype.getDirection = function(e) {
  21760. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21761. }
  21762. ,
  21763. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21764. if (r = r || $.Deferred(),
  21765. this.mode === V.TRANSITIONING)
  21766. return Y.warn("should not be transitioning here"),
  21767. n && n(!1),
  21768. r.reject().promise();
  21769. var o = i || !1
  21770. , a = i ? i.position : this.position
  21771. , s = this.position.clone()
  21772. , l = this.currentPano;
  21773. if (Y.debug("New pose in mode " + this.mode),
  21774. !e || (retryCallback = function() {
  21775. j.delayOneFrame(function() {
  21776. this.flyToSameMode(e, t, i, n, r)
  21777. }
  21778. .bind(this))
  21779. }
  21780. .bind(this),
  21781. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21782. var c = function() {
  21783. this.emit(W.FlyingEnded, a, s, e, l),
  21784. n && n(!0)
  21785. }
  21786. .bind(this)
  21787. , h = k[this.mode]
  21788. , u = void 0 !== t ? t : h.transitionTime
  21789. , d = new B.Vector3
  21790. , p = new B.Vector3;
  21791. if (this.emit(W.FlyingStarted, a, s, e, l),
  21792. this.mode === V.PANORAMA)
  21793. Y.warn("we should not be here for panorama views");
  21794. else if (this.mode === V.DOLLHOUSE)
  21795. if (o) {
  21796. var f = new B.Vector3(0,1,0);
  21797. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21798. this.model.warpDestFloors(i.floorVisibility),
  21799. p.copy(i.position);
  21800. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21801. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21802. , v = 3;
  21803. m.length ? (d.copy(m[0].point),
  21804. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21805. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21806. var y = (new B.Matrix4).lookAt(p, d, f)
  21807. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21808. , C = d.distanceTo(p)
  21809. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21810. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21811. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21812. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21813. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21814. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21815. this.path.burnsDir = Math.sign(b.y);
  21816. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21817. , T = new B.Vector3;
  21818. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21819. G.start(function(e, t) {
  21820. w.x = E.x + e * b.x,
  21821. w.y = E.y + e * b.y,
  21822. w.z = E.z + e * b.z;
  21823. var i = _ + e * (C - _);
  21824. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21825. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21826. }
  21827. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21828. G.start(function(e, t) {
  21829. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21830. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21831. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21832. }
  21833. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21834. } else
  21835. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21836. else if (this.path.placeCpm(),
  21837. this.path.fadeInCpm(k.path.fadeInTime),
  21838. i) {
  21839. this.model.warpDestFloors(i.floorVisibility);
  21840. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21841. , S = this.cameraControls.controls[V.FLOORPLAN]
  21842. , M = S.target.clone()
  21843. , R = i.position.clone().sub(M)
  21844. , P = x.position.clone().sub(S.target).length()
  21845. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21846. , L = Math.atan2(S.offset.x, S.offset.z)
  21847. , D = Math.atan2(O.x, O.z)
  21848. , N = S.absoluteScale
  21849. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21850. G.start(function(e, t) {
  21851. S.target.copy(R).multiplyScalar(e).add(M);
  21852. var i = L + (D - L) * e;
  21853. S.offset.x = P * Math.sin(i),
  21854. S.offset.z = P * Math.cos(i),
  21855. x.position.copy(S.target).add(S.offset),
  21856. S.absoluteScale = N + e * (F - N),
  21857. S.update(),
  21858. this.quaternion.copy(x.quaternion),
  21859. this.position.copy(x.position),
  21860. this.target.copy(S.target),
  21861. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21862. }
  21863. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21864. } else
  21865. Y.info("flyToSameMode() funny floorplan view? skipping");
  21866. return G.setTimeout(function(e) {
  21867. this.mode = e,
  21868. c(),
  21869. r.resolve(!0)
  21870. }
  21871. .bind(this, this.mode), u, q.FlyToSameMode),
  21872. this.mode = V.TRANSITIONING,
  21873. r.promise()
  21874. }
  21875. }
  21876. ,
  21877. t.prototype.flyToNewMode = function(e, t) {
  21878. var i = (e = e || {}).mode
  21879. , n = e.pano
  21880. , r = e.duration
  21881. , o = e.warpDest
  21882. , a = e.callback
  21883. , s = e.force
  21884. , l = e.quaternion;
  21885. if (t = t || $.Deferred(),
  21886. this.isWarping())
  21887. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21888. a && a(!1),
  21889. t.reject("Cannot change mode during tour transition").promise();
  21890. if (this.mode === V.TRANSITIONING)
  21891. return a && a(!1),
  21892. t.reject("Cannot change mode during mode transition").promise();
  21893. if (i === this.mode)
  21894. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21895. t.promise()) : (a && a(!1),
  21896. t.reject("Already in " + i + " mode").promise());
  21897. var c = o || !1;
  21898. Y.debug("Switching mode to " + i);
  21899. var h = function() {
  21900. j.delayOneFrame(function() {
  21901. this.flyToNewMode(e, t)
  21902. }
  21903. .bind(this))
  21904. }
  21905. .bind(this);
  21906. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21907. return t.promise();
  21908. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21909. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21910. this.model.waitForLoad(this.model, function() {
  21911. return this.model.meshTexturesLoaded
  21912. }
  21913. .bind(this)),
  21914. this.model.loadMeshTextures().done(h),
  21915. t.promise();
  21916. this.history.invalidate(),
  21917. this.updateLastView();
  21918. var u = this.mode
  21919. , d = this.cameraControls.cameras[i];
  21920. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21921. var p = void 0 !== r ? r : e.transitionTime;
  21922. this.emit(W.ModeChanging, u, i, n),
  21923. n && (this.currentPano = n),
  21924. this.switchCameraMode(i, l),
  21925. G.cancelById(q.LookTransition);
  21926. var f = (new B.Vector3).copy(this.position);
  21927. this.modeTran = this.mode + "-" + i;
  21928. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21929. VisiSet.finishSetPanoVisible()
  21930. VisiSet.finishSetTagVisible()
  21931. }
  21932. if(editTool.atPanel == "screen"){
  21933. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21934. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21935. }
  21936. if(i == "panorama"){
  21937. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21938. }else{
  21939. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21940. }
  21941. if (i === V.PANORAMA)
  21942. this.emit(W.PanoChosen, n, n),
  21943. setTimeout(function() {
  21944. n.floor.enter(i)
  21945. }
  21946. .bind(this), p / 2),
  21947. this.path.fadeOutCpm(k.path.fadeOutTime);
  21948. else if (i === V.DOLLHOUSE) {
  21949. if (c && (this.model.stayPut = !0),
  21950. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21951. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21952. this.path.placeCpm(),
  21953. this.path.fadeInCpm(k.path.fadeInTime),
  21954. c) {
  21955. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21956. f.set(15, 10, 15);
  21957. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21958. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21959. v.length ? (g.copy(v[0].point),
  21960. f.copy(o.position),
  21961. 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),
  21962. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21963. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21964. f.add(this.model.position),
  21965. d.position.copy(f),
  21966. this.cameraControls.controls[V.DOLLHOUSE].update()
  21967. }
  21968. } else if (this.path.placeCpm(),
  21969. this.path.fadeInCpm(k.path.fadeInTime),
  21970. o) {
  21971. this.model.warpDestFloors(o.floorVisibility);
  21972. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21973. , A = this.cameraControls.controls[V.FLOORPLAN]
  21974. , C = y.position.clone().sub(A.target)
  21975. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21976. , E = Math.atan2(I.x, I.z);
  21977. A.target.copy(o.position);
  21978. var _ = C.length();
  21979. A.offset.x = _ * Math.sin(E),
  21980. A.offset.y = 0,
  21981. A.offset.z = _ * Math.cos(E),
  21982. y.position.copy(A.target).add(A.offset),
  21983. A.target.clone().sub(d.position),
  21984. d.quaternion.copy(o.quaternion),
  21985. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21986. A.absoluteScale = A.currentScale,
  21987. A.update()
  21988. } else
  21989. this.model.currentFloor.enter(i);
  21990. var b = this.currentPano
  21991. , w = this.position.clone();
  21992. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21993. this.flying = !0,
  21994. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21995. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21996. d.controls.update()),
  21997. e.blackoutStyle = P.FADEIN,
  21998. p = k.show360Views.transitionTime,
  21999. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22000. this.mode = i,
  22001. this.path && this.path.popOutCpm(),
  22002. e.blackoutStyle = P.END,
  22003. p = k.show360Views.transitionTime,
  22004. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22005. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22006. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22007. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22008. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22009. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22010. G.setTimeout(function() {
  22011. this.flying = !1,
  22012. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22013. this.currentPano.enter(),
  22014. this.path.placeCpm(),
  22015. this.path.fadeOutCpm(k.path.fadeOutTime),
  22016. this.spider.draw()),
  22017. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22018. this.mode = i,
  22019. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22020. if (this.afterCModeFuc) {
  22021. //手动加的函数
  22022. var cf = this.afterCModeFuc;
  22023. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22024. cf();
  22025. }
  22026. this.updateMarkerVisi();//add
  22027. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  22028. if(this.mode == "panorama" && EditOverlay.editing){
  22029. EditOverlay.updatePano(this.currentPano)
  22030. }
  22031. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22032. if(this.mode == V.PANORAMA){
  22033. Overlay.updateVisibles([this.currentPano])
  22034. }else{
  22035. Overlay.updateVisibles(true)
  22036. }
  22037. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22038. t.resolve())
  22039. }
  22040. .bind(this), p, q.FlyToNewMode),
  22041. this.mode = V.TRANSITIONING,
  22042. t.promise()
  22043. }
  22044. ,
  22045. t.prototype.fade360View = function(e, t, i) {
  22046. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22047. $(this.domElement).fadeOut(.5 * e, function() {
  22048. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22049. this.model.alpha = i.modelAlpha,
  22050. this.position.copy(t.position),
  22051. this.quaternion.copy(t.quaternion),
  22052. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22053. $(this.domElement).fadeIn(.5 * e)
  22054. }
  22055. .bind(this))
  22056. }
  22057. ,
  22058. t.prototype.findDefaultViews = function() {
  22059. this.findDefaultView(this.lastInsideView, !0),
  22060. this.findDefaultView(this.last360View, !1)
  22061. }
  22062. ,
  22063. t.prototype.findDefaultView = function(e, i) {
  22064. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22065. if (e.cameraMode !== V.PANORAMA)
  22066. return !1;
  22067. var t = r.get(e.panoId);
  22068. return t && t.isAligned() === i
  22069. });
  22070. 0 <= o ? (t = r.get(n[o].panoId),
  22071. e.update({
  22072. cameraMode: V.PANORAMA,
  22073. pano: t,
  22074. position: n[o].position,
  22075. quaternion: n[o].quaternion
  22076. })) : 0 <= (o = r.list.findIndex(function(e) {
  22077. return e.isAligned() === i
  22078. })) ? (t = r.list[o],
  22079. e.update({
  22080. cameraMode: V.PANORAMA,
  22081. pano: t,
  22082. position: t.position
  22083. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22084. }
  22085. ,
  22086. t.prototype.updateLastView = function() {
  22087. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22088. pano: this.currentPano,
  22089. position: this.position,
  22090. quaternion: this.quaternion
  22091. })
  22092. }
  22093. ,
  22094. t.prototype.goToLastView = function(e, t) {
  22095. var i = $.Deferred()
  22096. , n = i.resolve.bind(i)
  22097. , r = i.reject.bind(i)
  22098. , o = e ? this.lastInsideView : this.last360View;
  22099. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22100. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22101. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22102. mode: o.cameraMode,
  22103. pano: o.pano,
  22104. quaternion: o.quaternion,
  22105. callback: t
  22106. }).done(n).fail(r),
  22107. i.promise()
  22108. }
  22109. ,
  22110. t.prototype.fadeToView = function(e, t, i, n) {
  22111. var r = $.Deferred()
  22112. , o = r.resolve.bind(r)
  22113. , a = r.reject.bind(r);
  22114. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22115. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22116. a("Cannot go to illegal view"),
  22117. r.promise();
  22118. var s = (k[t.cameraMode],
  22119. function() {
  22120. $(this.domElement).fadeIn(.5 * i),
  22121. n && n(),
  22122. o()
  22123. }
  22124. .bind(this))
  22125. , l = e ? P.FADEIN : P.END;
  22126. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22127. $(this.domElement).fadeOut(.5 * i, function() {
  22128. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22129. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22130. pano: t.pano,
  22131. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22132. duration: 0
  22133. }, s) : this.flyToNewMode({
  22134. mode: t.cameraMode,
  22135. quaternion: t.quaternion,
  22136. duration: 0,
  22137. callback: s
  22138. })
  22139. }
  22140. .bind(this)),
  22141. r.promise()
  22142. }
  22143. ,
  22144. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22145. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22146. this.flying)
  22147. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22148. o && o(),
  22149. !1;
  22150. null != e || (e = M.Show),
  22151. this.history.invalidate(),
  22152. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22153. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22154. return this.emit(W.WarpStarted, a, i, n, r),
  22155. n = n || P.MIDDLE,
  22156. this.path.warpToPano(i, n, r, function() {
  22157. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22158. this.emit(W.WarpEnded, i),
  22159. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22160. o && o()
  22161. }
  22162. .bind(this)),
  22163. e === M.Hide && this.path.discardPathObject(),
  22164. !0
  22165. }
  22166. ,
  22167. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22168. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22169. s && s(),
  22170. !1)
  22171. }
  22172. ,
  22173. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22174. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22175. a && a(),
  22176. !1)
  22177. }
  22178. ,
  22179. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22180. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22181. }
  22182. ,
  22183. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22184. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22185. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22186. t && t(),
  22187. !1)
  22188. }
  22189. ,
  22190. t.prototype.aimTourCamera = function(e, t, i, n) {
  22191. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22192. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22193. }
  22194. ,
  22195. t.prototype.showPathToHeroLocation = function(e) {
  22196. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22197. }
  22198. ,
  22199. t.prototype.tourInterlude = function(e, t) {
  22200. this.history.invalidate(),
  22201. this.path.discardSlow();
  22202. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22203. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22204. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22205. var waitTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22206. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22207. var timeEachItem = 2000;//假设每个item飞的时间
  22208. var waitTime = (waitTime-timeEachItem*restChildCount) / (restChildCount+1);
  22209. }
  22210. waitTime = Math.max(0, waitTime)
  22211. console.log("waitTime "+waitTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22212. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22213. t && t()
  22214. }
  22215. .bind(this), waitTime)
  22216. }
  22217. ,
  22218. t.prototype.stopInterlude = function() {
  22219. this.interruptAndFastForward(null, 0)
  22220. }
  22221. ,
  22222. t.prototype.interruptAndFastForward = function(e, t) {
  22223. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22224. this.flying && this.emit(W.FlyingInterrupted),
  22225. this.path.interruptAndFastForward(e, t)
  22226. }
  22227. ,
  22228. t.prototype.setSize = function(e, t) {
  22229. var i = e / t;
  22230. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22231. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22232. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22233. this.cameraControls.cameras) {
  22234. var o = this.cameraControls.cameras[r];
  22235. o.fov = this.baseFov * (1 / this.zoomLevel),
  22236. o.updateAspect(i)
  22237. }
  22238. }
  22239. ,
  22240. t.prototype.toJSON = function() {
  22241. var e = {};
  22242. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22243. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22244. return e.hidden ? 0 : 1
  22245. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22246. e
  22247. }
  22248. ,
  22249. t.prototype.getCurrentNodePanos = function(e) {
  22250. if (this.model.panos.map,
  22251. e.length = 0,
  22252. this.path.nodes)
  22253. for (var t = 0; t < this.path.nodes.length; t++) {
  22254. var i = this.path.nodes[t];
  22255. e.push(this.model.panos.get(i))
  22256. }
  22257. }
  22258. ,
  22259. t.prototype.zoomIncrementally = function(e) {
  22260. var t = this.zoomLevel;
  22261. this.zoomTo(this.zoomLevel + e),
  22262. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22263. }
  22264. ,
  22265. t.prototype.zoomInIncrementally = function(e) {
  22266. e = e || this.defaultZoomIncrement,
  22267. this.zoomIncrementally(e)
  22268. }
  22269. ,
  22270. t.prototype.zoomOutIncrementally = function(e) {
  22271. e = e || -this.defaultZoomIncrement,
  22272. this.zoomIncrementally(e)
  22273. }
  22274. ,
  22275. t.prototype.zoomBy = function(e) {
  22276. this.zoomTo(this.zoomLevel * e)
  22277. }
  22278. ,
  22279. t.prototype.zoomIn = function() {
  22280. this.zoomBy(1 + this.zoomSpeed)
  22281. }
  22282. ,
  22283. t.prototype.zoomOut = function() {
  22284. this.zoomBy(1 - this.zoomSpeed)
  22285. }
  22286. ,
  22287. t.prototype.zoomTo = function(e, t) {
  22288. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22289. e > k.zoom.max && (e = k.zoom.max),
  22290. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22291. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22292. e === k.zoom.min && this.emit(m.ZoomMin)),
  22293. this.cameraControls.activeControl)) {
  22294. var i = this.cameraControls.activeControl.camera;
  22295. this.zoomLevel = e,
  22296. i.fov = this.baseFov * (1 / this.zoomLevel),
  22297. i.updateProjectionMatrix(),
  22298. this.zoomFov = i.fov
  22299. }
  22300. }
  22301. ,
  22302. t.prototype.increaseZoomSpeed = function() {
  22303. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22304. }
  22305. ,
  22306. t.prototype.decreaseZoomSpeed = function() {
  22307. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22308. }
  22309. ,
  22310. t.prototype.clampZoomSpeed = function(e) {
  22311. return e < 0 ? 0 : e
  22312. }
  22313. ,
  22314. t.prototype.activatePersistentZooming = function(e) {
  22315. this.zooming = e ? 1 : -1
  22316. }
  22317. ,
  22318. t.prototype.deactivatePersistentZooming = function() {
  22319. this.zooming = 0
  22320. }
  22321. ,
  22322. t.prototype.zoomDefault = function() {
  22323. this.zoomTo(1, !0)
  22324. }
  22325. ,
  22326. t.prototype.smoothZoomToDefault = function(e, t) {
  22327. var i, n = this.zoomLevel, r = function(e) {
  22328. 1 < e && (e = 1),
  22329. i = n * (1 - e) + e,
  22330. this.zoomTo(i, !0)
  22331. }
  22332. .bind(this), o = function() {
  22333. this.zoomDefault(),
  22334. t && window.setTimeout(t, 50)
  22335. }
  22336. .bind(this);
  22337. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22338. }
  22339. ,
  22340. t.prototype.updateZoomPano = function() {
  22341. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22342. var e = this.currentPano;
  22343. if (e) {
  22344. var t = this.zoomLevel > k.zoom.activationThreshold
  22345. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22346. t);
  22347. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22348. this.panoRenderer.setZoomingActive(i, e, !0);
  22349. var n = function(e, t) {
  22350. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22351. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22352. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22353. e.setZoomed(t)
  22354. }
  22355. .bind(this);
  22356. i && !e.zoomed ? (n(e, !0),
  22357. this.panoRenderer.enableUltraHighQualityMode(function() {
  22358. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22359. i && n(e, !0)
  22360. }
  22361. .bind(this))) : !t && e.zoomed && n(e, !1)
  22362. }
  22363. }
  22364. },
  22365. //--------
  22366. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22367. var f2;
  22368. if (this.mode == mode) {
  22369. f1 && f1()
  22370. } else {
  22371. f2 = f1;
  22372. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22373. this.afterCModeFuc = function() {
  22374. this.afterCModeFuc = f2
  22375. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22376. }.bind(this)
  22377. } else {
  22378. this.afterCModeFuc = f2;//飞入后执行
  22379. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22380. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22381. }catch(e){}
  22382. }
  22383. }
  22384. }
  22385. ,
  22386. t.prototype.checkHasNeighbor = function(pano){//add
  22387. for(var i in pano.neighbourPanos ){
  22388. if(i == pano.id)continue;
  22389. if(pano.neighbourPanos[i]){
  22390. return true;
  22391. }
  22392. }
  22393. }
  22394. ,
  22395. ee.exports = t
  22396. }
  22397. ).call(this, "/js/player.js")
  22398. }
  22399. , {
  22400. "./constants": 8,
  22401. "./enum/AlignmentType": 17,
  22402. "./enum/BlackoutStyle": 18,
  22403. "./enum/ControlEvents": 21,
  22404. "./enum/Keys": 30,
  22405. "./enum/ModelManagerEvents": 33,
  22406. "./enum/PanoSizeClass": 36,
  22407. "./enum/PanoramaEvents": 37,
  22408. "./enum/PathDiscardMode": 38,
  22409. "./enum/PathDisplayMode": 39,
  22410. "./enum/PlayerEvents": 40,
  22411. "./enum/TagStates": 44,
  22412. "./enum/Vectors": 50,
  22413. "./enum/Viewmode": 51,
  22414. "./enum/WarpStyle": 52,
  22415. "./enum/ZoomEvents": 53,
  22416. "./exception/BasicException": 55,
  22417. "./model/ModelManager": 140,
  22418. "./objects/NSpider": 147,
  22419. "./objects/Panorama": 148,
  22420. "./objects/Reticule": 149,
  22421. "./objects/ShowPath": 151,
  22422. "./objects/Snapshot": 153,
  22423. "./objects/View": 154,
  22424. "./settings": 166,
  22425. "./shaders": 167,
  22426. "./tile/TileDownloader": 171,
  22427. "./tile/TilePrioritizer": 172,
  22428. "./util/ZoomStats": 179,
  22429. "./util/browser": 182,
  22430. "./util/camera": 183,
  22431. "./util/cameraLight": 184,
  22432. "./util/common": 185,
  22433. "./util/easing": 186,
  22434. "./util/history": 187,
  22435. "./util/lerp": 188,
  22436. "./util/logger": 189,
  22437. "./util/math": 190,
  22438. "./util/transitions": 195,
  22439. hot: "hot",
  22440. scaleImg: "scaleImg",
  22441. events: 202,
  22442. three: 217
  22443. }],
  22444. scaleImg: [function(e, t) {
  22445. var i = t;
  22446. (function() {
  22447. function e(e, t, i, n) {
  22448. function r() {
  22449. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22450. U.height = p,
  22451. H = U.getContext("2d")
  22452. }
  22453. function o(e) {
  22454. if (e) {
  22455. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22456. for (t = 0; t < ie; t += 4)
  22457. n[t] = e[t] * ne | 0,
  22458. n[t + 1] = e[t + 1] * ne | 0,
  22459. n[t + 2] = e[t + 2] * ne | 0,
  22460. n[t + 3] = e[t + 3] * ne | 0;
  22461. return delete e,
  22462. i
  22463. }
  22464. return H.getImageData(0, 0, d, p)
  22465. }
  22466. function a(e, t, i, n, r) {
  22467. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22468. }
  22469. var s, l;
  22470. if (t || (t = e.input,
  22471. i = e.output,
  22472. n = e.inputRemovable,
  22473. e.scale && (e = e.scale)),
  22474. t.src)
  22475. if (s = document.createElement("canvas"),
  22476. null != t.naturalWidth)
  22477. s.width = t.naturalWidth,
  22478. s.height = t.naturalHeight;
  22479. else if (null != t.runtimeStyle) {
  22480. var c = t.runtimeStyle
  22481. , h = c.width
  22482. , u = c.height;
  22483. c.width = "auto",
  22484. c.height = "auto",
  22485. s.width = t.width,
  22486. s.height = t.height,
  22487. c.width = h,
  22488. c.height = u
  22489. } else {
  22490. h = t.width,
  22491. u = t.height;
  22492. t.removeAttribute && (t.removeAttribute("width"),
  22493. t.removeAttribute("height")),
  22494. s.width = t.width,
  22495. s.height = t.height,
  22496. t.width = h,
  22497. t.height = u
  22498. }
  22499. else
  22500. s = t;
  22501. l = s.getContext("2d"),
  22502. t.src && l.drawImage(t, 0, 0);
  22503. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22504. if (!f || !g)
  22505. return !1;
  22506. (t.src || n) && s.clearRect(0, 0, f, g),
  22507. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22508. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22509. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22510. e * g + .5 | 0);
  22511. 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;
  22512. if (1 < re || 1 < oe)
  22513. for (r(),
  22514. G = (z = o()).data,
  22515. C = 0; C < p; C++)
  22516. for (V = (y = C / oe) - (w = 0 | y),
  22517. j = w * $,
  22518. W = w < 1 ? j : j - $,
  22519. w < g - 2 ? (Y = j + $,
  22520. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22521. A = 0; A < d; A++,
  22522. te += 4)
  22523. Z = (b = 0 | (v = A / re)) << 2,
  22524. b < f - 2 ? (K = Z + 4,
  22525. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22526. 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,
  22527. ++Z,
  22528. ++K,
  22529. ++Q,
  22530. 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,
  22531. ++Z,
  22532. ++K,
  22533. ++Q,
  22534. 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,
  22535. ++Z,
  22536. ++K,
  22537. ++Q,
  22538. 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,
  22539. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22540. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22541. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22542. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22543. else {
  22544. if (le.Float32Array)
  22545. L = new Float32Array(ie);
  22546. else
  22547. for (L = [],
  22548. te = 0; te < ie; ++te)
  22549. L[te] = 0;
  22550. for (y = 0; y < g; y++)
  22551. for (I = (_ = 0 | (C = y * oe)) * J,
  22552. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22553. R = C + oe - _ - 1),
  22554. v = 0; v < f; v++,
  22555. ee += 4)
  22556. switch (A = v * re,
  22557. E = 0 | A,
  22558. te = I + (E << 2),
  22559. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22560. P && (x = 1 + E - A,
  22561. S = A + re - E - 1),
  22562. D = m[ee],
  22563. F = m[ee + 1],
  22564. B = m[ee + 2],
  22565. N = m[ee + 3],
  22566. P + O) {
  22567. case 0:
  22568. L[te] += D * ae,
  22569. L[te + 1] += F * ae,
  22570. L[te + 2] += B * ae,
  22571. L[te + 3] += N * ae;
  22572. break;
  22573. case 1:
  22574. T = x * oe,
  22575. L[te] += D * T,
  22576. L[te + 1] += F * T,
  22577. L[te + 2] += B * T,
  22578. L[te + 3] += N * T,
  22579. T = S * oe,
  22580. L[te + 4] += D * T,
  22581. L[te + 5] += F * T,
  22582. L[te + 6] += B * T,
  22583. L[te + 7] += N * T;
  22584. break;
  22585. case 2:
  22586. T = re * M,
  22587. L[te] += D * T,
  22588. L[te + 1] += F * T,
  22589. L[te + 2] += B * T,
  22590. L[te + 3] += N * T,
  22591. T = re * R,
  22592. L[te += J] += D * T,
  22593. L[te + 1] += F * T,
  22594. L[te + 2] += B * T,
  22595. L[te + 3] += N * T;
  22596. break;
  22597. default:
  22598. T = x * M,
  22599. L[te] += D * T,
  22600. L[te + 1] += F * T,
  22601. L[te + 2] += B * T,
  22602. L[te + 3] += N * T,
  22603. T = S * M,
  22604. L[te + 4] += D * T,
  22605. L[te + 5] += F * T,
  22606. L[te + 6] += B * T,
  22607. L[te + 7] += N * T,
  22608. T = x * R,
  22609. L[te += J] += D * T,
  22610. L[te + 1] += F * T,
  22611. L[te + 2] += B * T,
  22612. L[te + 3] += N * T,
  22613. T = S * R,
  22614. L[te + 4] += D * T,
  22615. L[te + 5] += F * T,
  22616. L[te + 6] += B * T,
  22617. L[te + 7] += N * T
  22618. }
  22619. delete m,
  22620. r(),
  22621. z = o(L)
  22622. }
  22623. if (H.putImageData(z, 0, 0),
  22624. "string" == typeof i) {
  22625. var se;
  22626. if ("png" === i || "jpeg" === i)
  22627. return (se = n && t.src ? t : new Image).width = d,
  22628. se.height = p,
  22629. se.src = U.toDataURL("image/" + i, .85),
  22630. se;
  22631. if ("png-src" === i || "jpeg-src" === i)
  22632. return U.toDataURL("image/" + i.split("-")[0], .85)
  22633. }
  22634. return U
  22635. }
  22636. var le = this;
  22637. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22638. exports.scale = e) : c = e
  22639. }
  22640. ).call(this),
  22641. i.exports = c
  22642. }
  22643. , {}],
  22644. 156: [function(i, n, e) {
  22645. (function(e) {
  22646. "use strict";
  22647. function t(e, t) {
  22648. this.model = e,
  22649. this.panos = e.panos,
  22650. this.player = t,
  22651. this.imagePanos = this.listImagePanos(),
  22652. this.retryMinimumTime = 1e4
  22653. }
  22654. var r = (i("three"),
  22655. i("./enum/Viewmode"))
  22656. , o = (i("./settings"),
  22657. i("./objects/Panorama"))
  22658. , a = new (i("./util/logger"))(e);
  22659. t.prototype.start = function() {
  22660. this.loadNextPano(function(e) {
  22661. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22662. setTimeout(function() {
  22663. this.start()
  22664. }
  22665. .bind(this), 1e3))
  22666. }
  22667. .bind(this))
  22668. }
  22669. ,
  22670. t.prototype.validLoadTarget = function(e) {
  22671. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22672. }
  22673. ,
  22674. t.prototype.listImagePanos = function() {
  22675. var i = []
  22676. , n = this;
  22677. return this.model.images.forEach(function(e) {
  22678. if (e.metadata && e.metadata.scan_id) {
  22679. var t = n.model.panos.get(e.metadata.scan_id);
  22680. t && !t.isLoaded("high") && i.push(t)
  22681. }
  22682. }),
  22683. i
  22684. }
  22685. ,
  22686. t.prototype.nextNotLoadedImage = function() {
  22687. for (; 0 < this.imagePanos.length; ) {
  22688. var e = this.imagePanos[0];
  22689. if (!e.isLoaded("high"))
  22690. return e;
  22691. this.imagePanos.shift()
  22692. }
  22693. return null
  22694. }
  22695. ,
  22696. t.prototype.loadNextPano = function(e) {
  22697. var t, i, n = this.model.waitQueue.filter(function(e) {
  22698. return e.object instanceof o
  22699. });
  22700. 0 < n.length ? (t = n[0].object,
  22701. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22702. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22703. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22704. t = this.imagePanos[0],
  22705. 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),
  22706. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22707. a.debug("Preloading " + i + "-res pano " + t.id),
  22708. t.loadCube(i).done(e).fail(function() {
  22709. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22710. e()
  22711. })) : e && e(null)
  22712. }
  22713. ,
  22714. n.exports = t
  22715. }
  22716. ).call(this, "/js/preloaders.js")
  22717. }
  22718. , {
  22719. "./enum/Viewmode": 51,
  22720. "./objects/Panorama": 148,
  22721. "./settings": 166,
  22722. "./util/logger": 189,
  22723. three: 217
  22724. }],
  22725. 157: [function(a, s, e) {
  22726. (function(e) {
  22727. "use strict";
  22728. function t(e, t, i, n, r) {
  22729. this.qualityManager = e,
  22730. this.scene = t,
  22731. this.camera = i,
  22732. this.container = r,
  22733. this.controls = n,
  22734. this.controls.enabled = !0,
  22735. this.controls.locked = !0,
  22736. this.quickstartCamera = n.camera,
  22737. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22738. this.skybox = null
  22739. }
  22740. var i = a("three")
  22741. , n = a("../util/logger")
  22742. , o = a("../constants")
  22743. , h = (a("../util/transitions"),
  22744. a("../util/lerp"),
  22745. a("../util/easing"),
  22746. a("../enum/Vectors"))
  22747. , u = a("../enum/PanoSizeClass")
  22748. , r = (a("../materials/ModelTextureMaterial"),
  22749. a("../materials/CubemapMaterial"))
  22750. , d = (a("../cameras/PanoramaCamera"),
  22751. a("../controls/PanoramaControls"),
  22752. a("../tile/TileUtils"),
  22753. a("../util/camera"),
  22754. a("../util/cameraLight"))
  22755. , p = (a("../util/browser"),
  22756. a("../settings"),
  22757. a("../gui/helpManager"),
  22758. new n(e));
  22759. t.prototype.load = function(e) {
  22760. e.pano.shouldRedrawOnBaseLoaded = !0;
  22761. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22762. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22763. var a = this.qualityManager.getPanoSize(u.BASE)
  22764. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22765. if (e.pano.tiled) {
  22766. p.warn("Loading startPano, TILED", e.pano.id);
  22767. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22768. , c = this.quickstartCamera.fov;
  22769. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22770. t = e.pano.loadTiledPano(s, r, {
  22771. hFov: l,
  22772. vFov: c
  22773. }, !1, !1, !0),
  22774. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22775. } else
  22776. p.warn("Loading startPano", e.pano.id),
  22777. t = e.pano.loadCube("high");
  22778. return $.when(t).then(function() {
  22779. n.init(e.pano, e.quaternion),
  22780. e.pano.tiled ? i.done(function() {
  22781. e.pano.lockUntilRenderingComplete = !1,
  22782. this.controls.locked = !1
  22783. }
  22784. .bind(this)) : this.controls.locked = !1
  22785. }
  22786. .bind(this))
  22787. }
  22788. ,
  22789. t.prototype.init = function(e, t) {
  22790. p.info("Quickstart done loading, adding scene objects"),
  22791. e.lockUntilRenderingComplete = !0,
  22792. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22793. side: i.BackSide
  22794. })),
  22795. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22796. this.skybox.quaternion.copy(e.quaternion),
  22797. this.scene.add(this.skybox),
  22798. $(this.container).show()
  22799. }
  22800. ,
  22801. t.prototype.update = function(e) {
  22802. this.controls.update(e),
  22803. this.camera.copy(this.quickstartCamera)
  22804. }
  22805. ,
  22806. t.prototype.setSize = function(e, t) {
  22807. this.quickstartCamera.updateAspect(e / t)
  22808. }
  22809. ,
  22810. t.prototype.destroy = function() {
  22811. this.scene.remove(this.skybox)
  22812. }
  22813. ,
  22814. s.exports = t
  22815. }
  22816. ).call(this, "/js/scene/QuickstartManager.js")
  22817. }
  22818. , {
  22819. "../cameras/PanoramaCamera": 7,
  22820. "../constants": 8,
  22821. "../controls/PanoramaControls": 13,
  22822. "../enum/PanoSizeClass": 36,
  22823. "../enum/Vectors": 50,
  22824. "../gui/helpManager": 68,
  22825. "../materials/CubemapMaterial": 117,
  22826. "../materials/ModelTextureMaterial": 118,
  22827. "../settings": 166,
  22828. "../tile/TileUtils": 174,
  22829. "../util/browser": 182,
  22830. "../util/camera": 183,
  22831. "../util/cameraLight": 184,
  22832. "../util/easing": 186,
  22833. "../util/lerp": 188,
  22834. "../util/logger": 189,
  22835. "../util/transitions": 195,
  22836. three: 217
  22837. }],
  22838. 158: [function(e, t, i) {
  22839. "use strict";
  22840. function h(e, t, i) {
  22841. this.scene = e,
  22842. this.camera = t,
  22843. this.renderer = null,
  22844. this.effects = i,
  22845. this.animateCallback = null,
  22846. this.composer = null,
  22847. this.qualityManager = null,
  22848. e.renderWidth = 0,
  22849. e.renderHeight = 0,
  22850. this.updateClock = new M.Clock,
  22851. this.components = [],
  22852. this.updateListeners = [],
  22853. this.resizeListeners = [],
  22854. this.forceUpdateSize = !1,
  22855. this.started = !1,
  22856. this.textures = {},
  22857. this.suspendedObjects = []
  22858. }
  22859. 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;
  22860. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22861. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22862. this.components.push(e),
  22863. e.update && this.updateListeners.push(e),
  22864. e.setSize && (this.resizeListeners.push(e),
  22865. this.forceUpdateSize = !0)
  22866. }
  22867. ,
  22868. h.prototype.removeComponent = function(t) {
  22869. function e(e) {
  22870. return e !== t
  22871. }
  22872. this.components = this.components.filter(e),
  22873. this.updateListeners = this.updateListeners.filter(e),
  22874. this.resizeListeners = this.resizeListeners.filter(e)
  22875. }
  22876. ,
  22877. h.prototype.start = function(e) {
  22878. if (this.started)
  22879. throw new l("Can't start SceneRenderer, already started");
  22880. this.createContext(e),
  22881. //u.isMobile() && this.boluoVrInit(),
  22882. this.initComposer(),
  22883. this.started = !0,
  22884. (b = b.bind(this))()
  22885. }
  22886. ,
  22887. h.prototype.createContext = function(e) {
  22888. try {
  22889. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22890. this.renderer.autoClear = !0,
  22891. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22892. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22893. this.emit(r.ContextCreated)
  22894. } catch (e) {
  22895. throw new c("Unable to create a WebGL rendering context")
  22896. }
  22897. d.profiling.enabled && this.overrideTextures(),
  22898. e.appendChild(this.renderer.domElement)
  22899. }
  22900. ,
  22901. h.prototype.overrideTextures = function() {
  22902. var d = this.renderer.context
  22903. , t = 0
  22904. , i = d.createTexture;
  22905. d.createTexture = function() {
  22906. var e = i.call(d);
  22907. return e.id = t++,
  22908. this.textures[e.id] = e
  22909. }
  22910. .bind(this);
  22911. var p = d.texImage2D;
  22912. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22913. var c, h = this.getTextureTypeFromTarget(d, e);
  22914. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22915. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22916. s = r,
  22917. n = (l = o).naturalWidth,
  22918. r = l.naturalHeight,
  22919. p.call(d, e, t, i, a, s, l));
  22920. var u = this.textures[c.id];
  22921. u.width = h === f.TextureCube ? 6 * n : n,
  22922. u.height = r
  22923. }
  22924. .bind(this);
  22925. var n = d.deleteTexture;
  22926. d.deleteTexture = function(e) {
  22927. delete this.textures[e.id],
  22928. n.call(d, e)
  22929. }
  22930. .bind(this)
  22931. }
  22932. ,
  22933. h.prototype.updateTextureMemory = (n = null,
  22934. function() {
  22935. var e = 0;
  22936. for (var t in this.textures) {
  22937. var i = this.textures[t];
  22938. i.width && i.height && (e += i.width * i.height * 4)
  22939. }
  22940. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22941. n = e
  22942. }
  22943. ),
  22944. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22945. switch (t) {
  22946. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22947. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22948. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22949. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22950. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22951. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22952. return f.TextureCube;
  22953. case e.TEXTURE_2D:
  22954. return f.Texture2D;
  22955. default:
  22956. return null
  22957. }
  22958. }
  22959. ,
  22960. h.prototype.initComposer = function() {
  22961. this.composer = new M.EffectComposer(this.renderer),
  22962. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22963. this.composer.addPass(this.effects.hblurPass),
  22964. this.composer.addPass(this.effects.vblurPass)
  22965. }
  22966. ,
  22967. h.prototype.setSize = function(e, t, i) {
  22968. this.renderWidth = e,
  22969. this.renderHeight = t,
  22970. this.effects.aspect = e / t,
  22971. this.renderer.setSize(e, t, !1, i),
  22972. this.composer.setSize(e, t);
  22973. for (var n = 0; n < this.resizeListeners.length; n++)
  22974. this.resizeListeners[n].setSize(e, t)
  22975. }
  22976. ,
  22977. h.prototype.render = function() {
  22978. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22979. }
  22980. ,
  22981. h.prototype.boluoVrInit = function() {
  22982. console.log("boluoVrInit"),
  22983. this.isHuawei5X = u.detectHUAWEI5X(),
  22984. this.oldRenderer = this.renderer,
  22985. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22986. window.panoCamera = this.camera;
  22987. var i = this;
  22988. window._vrEnabled = !1,
  22989. Object.defineProperty(window, "vrEnabled", {
  22990. get: function() {
  22991. return window._vrEnabled
  22992. },
  22993. set: function(e) {
  22994. (e = !!e) ? (i.renderer = i.newRenderer,
  22995. window.vrMarkers.forEach(function(e) {
  22996. e.visible = !0
  22997. })) : (i.renderer = i.oldRenderer,
  22998. window.vrMarkers.forEach(function(e) {
  22999. e.visible = !1
  23000. })),
  23001. i.cursor.visible = e,
  23002. i.setSize($("#player").width(), $("#player").height()),
  23003. window._vrEnabled = e,
  23004. setTimeout(function() {
  23005. console.log(player.cameraControls.activeControl.camera.fov)
  23006. }, 500)
  23007. }
  23008. }),
  23009. this.createCursor(.5, !1, 1, 16777215, 0);
  23010. var e = {
  23011. setSize: function(e, t) {
  23012. i.camera.aspect = e / t
  23013. }
  23014. };
  23015. this.resizeListeners.push(e),
  23016. this.vrLoadingInit()
  23017. }
  23018. ,
  23019. h.prototype.vrLoadingInit = function() {
  23020. var e = new (e = function(camera) {
  23021. var t = this
  23022. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23023. , i = new M.MeshBasicMaterial({
  23024. color: 4967932,
  23025. side: M.DoubleSide
  23026. })
  23027. , n = new M.Mesh(e,i);
  23028. (this.mesh = n).position.z = -2,
  23029. n.scale.set(.08, .08, .08),
  23030. n.visible = !1,
  23031. //window.player.camera.add(n),
  23032. camera.add(n),
  23033. t.enabled = !1,
  23034. this.update = function(e) {
  23035. 1 == t.enabled && (n.rotation.z += 15 * e)
  23036. }
  23037. }
  23038. )(this.camera);
  23039. window.Loading = e,
  23040. this.updateListeners.push(e)
  23041. }
  23042. ,
  23043. h.prototype.createCursor = function(e, t, i, n, r) {
  23044. var o, a = new M.SpriteMaterial({
  23045. opacity: i,
  23046. color: n,
  23047. transparent: t,
  23048. map: this.boluoGetTexture("images/cursor.png"),
  23049. needsUpdate: !0,
  23050. side: M.DoubleSide
  23051. });
  23052. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23053. a.map.repeat = new M.Vector2(1 / 17,1),
  23054. a.depthTest = !1,
  23055. a.blending = M.AdditiveBlending,
  23056. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23057. o.position.z = -2,
  23058. o.visible = !1,
  23059. o.name = "cursor",
  23060. this.camera.add(o),
  23061. this.scene.add(this.camera),
  23062. this.cursor = o;
  23063. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23064. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23065. this.updateListeners.push(s)
  23066. }
  23067. ,
  23068. h.prototype.CursorAnimation = function(e, t, o) {
  23069. this.cursor = t,
  23070. this.raycaster = new M.Raycaster,
  23071. this.targetEventObj = {},
  23072. this.type = 1,
  23073. this.tweenFlag = !0;
  23074. var s = this;
  23075. this.target = o,
  23076. console.log(o.uuid),
  23077. this.euler = new M.Euler,
  23078. this.q0 = new M.Quaternion,
  23079. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23080. this.zee = new M.Vector3(0,0,1),
  23081. this.alpha = -1e3,
  23082. this.beta = -1e3,
  23083. this.gamma = -1e3,
  23084. this.orient = M.Math.degToRad(window.orientation || 0),
  23085. window.addEventListener("orientationchange", function() {
  23086. s.orient = M.Math.degToRad(window.orientation || 0)
  23087. }),
  23088. window.addEventListener("deviceorientation", function(e) {
  23089. var t = M.Math.degToRad(e.alpha)
  23090. , i = M.Math.degToRad(e.beta)
  23091. , n = M.Math.degToRad(e.gamma);
  23092. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23093. -1e3 === s.beta && (s.beta = i),
  23094. -1e3 === s.gamma && (s.gamma = n),
  23095. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23096. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23097. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23098. s.beta = i,
  23099. s.gamma = n),
  23100. h.vrDebug) {
  23101. $("#info-device-orientation").css("display", "block");
  23102. var r = "";
  23103. r += "alpha=(" + s.alpha + ")<BR/>",
  23104. r += "beta=(" + s.beta + ")<BR/>",
  23105. r += "gamma=" + s.gamma + "<BR/>",
  23106. document.getElementById("info-device-orientation").innerHTML = r
  23107. }
  23108. }),
  23109. this.setObjectQuaternion = function(e, t, i, n, r) {
  23110. s.euler.set(i, t, -n, "YXZ"),
  23111. e.setFromEuler(s.euler),
  23112. e.multiply(s.q1),
  23113. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23114. o.updateMatrixWorld()
  23115. }
  23116. ,
  23117. parent !== window && window.addEventListener("message", function(e) {
  23118. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23119. o && o.alpha && o.beta && o.gamma && (t = a,
  23120. i = M.Math.degToRad(o.alpha),
  23121. n = M.Math.degToRad(o.beta),
  23122. r = M.Math.degToRad(o.gamma),
  23123. t ? (-1e3 === s.alpha && (s.alpha = i),
  23124. -1e3 === s.beta && (s.beta = n),
  23125. -1e3 === s.gamma && (s.gamma = r),
  23126. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23127. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23128. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23129. s.beta = n,
  23130. s.gamma = r))
  23131. }),
  23132. this.update = function(e) {
  23133. TWEEN.update(),
  23134. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23135. this.triggerTargetEvent())
  23136. }
  23137. ,
  23138. this.triggerTargetEvent = function() {
  23139. var e = this.choseObj()
  23140. , t = e ? e.object : void 0;
  23141. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23142. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23143. t && t.enabled && this.startAnimate(function() {
  23144. this.clickCallback(t)
  23145. }
  23146. .bind(this))) : this.type,
  23147. this.targetEventObj.lastObj = t)
  23148. }
  23149. ,
  23150. this.choseObj = function() {
  23151. this.raycaster.setFromCamera({
  23152. x: 0,
  23153. y: 0
  23154. }, o);
  23155. var e = (this.raycaster.ray,
  23156. window.vrMarkers)
  23157. , t = this.raycaster.intersectObjects(e);
  23158. if (0 < t.length)
  23159. return t[0]
  23160. }
  23161. ,
  23162. this.clickCallback = function(e) {
  23163. this.runTHREEAction(e, "onclick")
  23164. }
  23165. ,
  23166. this.runTHREEAction = function(e, t) {
  23167. switch (t) {
  23168. case "onclick":
  23169. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23170. e()
  23171. });
  23172. break;
  23173. case "onhover":
  23174. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23175. e()
  23176. });
  23177. break;
  23178. case "onout":
  23179. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23180. e()
  23181. })
  23182. }
  23183. }
  23184. ,
  23185. this.startAnimate = function(e) {
  23186. this.tweenFlag && this.initAnimation(e)
  23187. }
  23188. ,
  23189. this.initAnimation = function(e) {
  23190. var t = this
  23191. , i = this.cursor.material.map.offset;
  23192. t.tweenFlag = !1,
  23193. this.cursorAnimate = new TWEEN.Tween(i).to({
  23194. x: 1
  23195. }, 1e3).onStart(function() {
  23196. t.tweenFlag = !1
  23197. }).onStop(function() {
  23198. t.tweenFlag = !0,
  23199. this.x = 0,
  23200. i.x = 0
  23201. }).onUpdate(function() {}).onComplete(function() {
  23202. e(),
  23203. i.x = 0,
  23204. setTimeout(function() {
  23205. t.tweenFlag = !0
  23206. }, 1500)
  23207. }),
  23208. this.cursorAnimate.easing(function(e) {
  23209. return Math.floor(17 * e) / 17
  23210. }),
  23211. this.cursorAnimate.start()
  23212. }
  23213. ,
  23214. this.autoCursorPosition = function(e) {
  23215. this.cursor.scale.set(.3, .3, .3)
  23216. }
  23217. }
  23218. ,
  23219. h.prototype.vrRenderer = function(a, i, e) {
  23220. var s = new i.vrCamera(e);
  23221. s.bananaAspect = .8,
  23222. this.width,
  23223. this.height;
  23224. i = this;
  23225. this.setSize = function(e, t) {
  23226. a.setSize.call(this, e, t),
  23227. i.width = e,
  23228. i.height = t
  23229. }
  23230. ,
  23231. this.render = function(e, t, i, n) {
  23232. var r, o;
  23233. if (window.cameraQua = t.quaternion.clone(),
  23234. t.__RESS__SKIP__STEREO__)
  23235. return a.render(e, t, i, n);
  23236. if ("PerspectiveCamera" === t.type)
  23237. r = s.cameraL,
  23238. o = s.cameraR,
  23239. e.updateMatrixWorld(),
  23240. null === t.parent && t.updateMatrixWorld(),
  23241. s.vrCameraUpdate(t);
  23242. else {
  23243. if ("OrthographicCamera" !== t.type)
  23244. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23245. r = o = t
  23246. }
  23247. a.setScissorTest(!0),
  23248. a.setScissor(0, 0, this.width / 2, this.height),
  23249. a.setViewport(0, 0, this.width / 2, this.height),
  23250. a.render.call(this, e, r, i, n),
  23251. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23252. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23253. a.render.call(this, e, o, i, n),
  23254. a.setScissorTest(!1)
  23255. }
  23256. ,
  23257. this.__proto__ = {
  23258. __proto__: a
  23259. }
  23260. }
  23261. ,
  23262. h.prototype.vrCamera = function(e) {
  23263. this.type = "StereoCamera",
  23264. this._aspect = 1,
  23265. this._overlap = .064,
  23266. this.cameraL = new M.PerspectiveCamera,
  23267. this.cameraL.layers.enable(1),
  23268. this.cameraL.matrixAutoUpdate = !1,
  23269. this.cameraR = new M.PerspectiveCamera,
  23270. this.cameraR.layers.enable(2),
  23271. this.cameraR.matrixAutoUpdate = !1,
  23272. this.eyeRight = new M.Matrix4,
  23273. this.eyeLeft = new M.Matrix4,
  23274. this.vrCameraNeedsUpdate = !0,
  23275. window.vrCameraL = this.cameraL,
  23276. Object.defineProperty(this, "bananaAspect", {
  23277. get: function() {
  23278. return this._aspect
  23279. },
  23280. set: function(e) {
  23281. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23282. this._aspect = e
  23283. }
  23284. }),
  23285. Object.defineProperty(this, "overlap", {
  23286. get: function() {
  23287. return this._overlap
  23288. },
  23289. set: function(e) {
  23290. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23291. this._overlap = e
  23292. }
  23293. }),
  23294. this.vrCameraUpdate = function(e) {
  23295. if (this.vrCameraNeedsUpdate = !0,
  23296. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23297. this.vrCameraNeedsUpdate) {
  23298. this.vrCameraNeedsUpdate = !1,
  23299. console.debug("vrCameraUpdate"),
  23300. this.bananaFocus = e.focus,
  23301. this.bananaFov = e.fov,
  23302. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23303. this.bananaNear = e.near,
  23304. this.bananaFar = e.far,
  23305. console.debug(e.aspect),
  23306. this.bananaFocus = 10;
  23307. 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);
  23308. this.eyeLeft.elements[12] = -r,
  23309. this.eyeRight.elements[12] = r,
  23310. t = -a * this.bananaReal_aspect + o,
  23311. i = a * this.bananaReal_aspect + o,
  23312. n.elements[0] = 2 * this.bananaNear / (i - t),
  23313. n.elements[8] = (i + t) / (i - t),
  23314. this.cameraL.projectionMatrix.copy(n),
  23315. t = -a * this.bananaReal_aspect - o,
  23316. i = a * this.bananaReal_aspect - o,
  23317. n.elements[0] = 2 * this.bananaNear / (i - t),
  23318. n.elements[8] = (i + t) / (i - t),
  23319. this.cameraR.projectionMatrix.copy(n)
  23320. }
  23321. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23322. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23323. }
  23324. }
  23325. ,
  23326. h.prototype.boluoGetTexture = function(e) {
  23327. var t = new M.TextureLoader;
  23328. return t.crossOrigin = "anonymous",
  23329. t.load(e)
  23330. }
  23331. ,
  23332. h.prototype.updateScreenSize = function(e) {
  23333. var t, i, n, r = !1;
  23334. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23335. n = e.height,
  23336. r = !0,
  23337. t = 1) : (i = $("#player").width(),
  23338. n = $("#player").height(),
  23339. e && e.resize && (o = this.renderWidth,
  23340. a = this.renderHeight),
  23341. i === o && n === a && !this.forceUpdateSize || (o = i,
  23342. a = n,
  23343. r = !0,
  23344. t = window.devicePixelRatio)),
  23345. r && (this.setSize(i, n, t),
  23346. this.forceUpdateSize = !1)
  23347. }
  23348. ,
  23349. h.prototype.updateComponents = function() {
  23350. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23351. this.updateListeners[t].update(e)
  23352. }
  23353. ,
  23354. h.prototype.suspend = function() {
  23355. this.started = !1,
  23356. this.suspendedObjects = this.scene.children.map(function(e) {
  23357. return this.scene.remove(e),
  23358. e
  23359. }
  23360. .bind(this)),
  23361. this.render()
  23362. }
  23363. ,
  23364. h.prototype.resume = function() {
  23365. this.suspendedObjects.forEach(function(e) {
  23366. this.scene.add(e)
  23367. }
  23368. .bind(this)),
  23369. this.suspendedObjects = [],
  23370. this.started = !0,
  23371. b()
  23372. }
  23373. ;
  23374. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23375. this.started && (window.requestAnimationFrame(b),
  23376. this.updateScreenSize(),
  23377. this.updateComponents(),
  23378. this.updateTextureMemory(),
  23379. this.render(),
  23380. this.emit(r.AfterRender))
  23381. };
  23382. h.prototype.getImageData = (E = document.createElement("canvas"),
  23383. _ = E.getContext("2d"),
  23384. function(e, t, i) {
  23385. return E.width === t && E.height === i || (E.width = t,
  23386. E.height = i),
  23387. _.drawImage(e, 0, 0, t, i),
  23388. _.getImageData(0, 0, t, i)
  23389. }
  23390. ),
  23391. h.prototype.initSizedTexture2D = function(e, t, i) {
  23392. var n = this.renderer
  23393. , r = n.context
  23394. , o = n.state
  23395. , a = new M.Texture(null);
  23396. !(a.flipY = !1) !== i && (i = !1),
  23397. a.generateMipmaps = i;
  23398. var s = n.paramThreeToGL(a.format)
  23399. , l = n.paramThreeToGL(a.type)
  23400. , c = n.properties.get(a)
  23401. , h = r.createTexture();
  23402. o.bindTexture(r.TEXTURE_2D, h),
  23403. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23404. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23405. a.wrapS = t,
  23406. a.wrapT = t;
  23407. var u = n.paramThreeToGL(t);
  23408. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23409. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23410. i ? (a.magFilter = M.LinearFilter,
  23411. a.minFilter = M.LinearMipMapLinearFilter,
  23412. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23413. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23414. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23415. a.minFilter = M.LinearFilter,
  23416. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23417. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23418. o.bindTexture(r.TEXTURE_2D, null),
  23419. c.__webglTexture = h,
  23420. a
  23421. }
  23422. ,
  23423. h.prototype.initSizedCubeMap = function(e, t) {
  23424. var i = this.renderer
  23425. , n = i.context
  23426. , r = i.state
  23427. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23428. o.flipY = !1,
  23429. o.generateMipmaps = t;
  23430. var a = i.paramThreeToGL(o.format)
  23431. , s = i.paramThreeToGL(o.type)
  23432. , l = i.properties.get(o)
  23433. , c = n.createTexture();
  23434. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23435. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23436. for (var h = 0; h < 6; h++)
  23437. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23438. return t ? (o.magFilter = M.LinearFilter,
  23439. o.minFilter = M.LinearMipMapLinearFilter,
  23440. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23441. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23442. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23443. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23444. o.minFilter = M.LinearFilter,
  23445. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23446. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23447. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23448. l.__image__webglTextureCube = c,
  23449. o
  23450. }
  23451. ,
  23452. h.prototype.deallocateCubeTexture = function(e) {
  23453. var t = this.renderer
  23454. , i = t.context
  23455. , n = t.properties.get(e);
  23456. i.deleteTexture(n.__image__webglTextureCube)
  23457. }
  23458. ,
  23459. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23460. var a = this.renderer
  23461. , s = a.context
  23462. , l = a.state
  23463. , c = a.properties.get(t);
  23464. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23465. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23466. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23467. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23468. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23469. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23470. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23471. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23472. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23473. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23474. l.bindTexture(s.TEXTURE_2D, null)
  23475. }
  23476. ,
  23477. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23478. var s = this.renderer
  23479. , l = s.context
  23480. , c = s.state
  23481. , h = s.properties.get(t);
  23482. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23483. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23484. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23485. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23486. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23487. }
  23488. ,
  23489. h.prototype.rebuildMipMaps2D = function(e) {
  23490. var t = this.renderer
  23491. , i = t.context
  23492. , n = t.state;
  23493. t.properties.get(e),
  23494. i.generateMipmap(i.TEXTURE_2D),
  23495. n.bindTexture(i.TEXTURE_2D, null)
  23496. }
  23497. ,
  23498. h.prototype.rebuildMipMaps3D = function(e) {
  23499. var t = this.renderer
  23500. , i = t.context
  23501. , n = t.state
  23502. , r = t.properties.get(e);
  23503. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23504. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23505. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23506. }
  23507. ,
  23508. h.prototype.renderToCubeMap = (P = !1,
  23509. F = N = D = L = O = null,
  23510. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23511. this.renderer.context,
  23512. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23513. (O = new M.Scene).add(L),
  23514. D = new M.ShaderMaterial({
  23515. uniforms: {
  23516. tDiffuse: {
  23517. type: "t",
  23518. value: null
  23519. },
  23520. alpha: {
  23521. type: "f",
  23522. value: 1
  23523. }
  23524. },
  23525. vertexShader: R.basicTextured.vertexShader,
  23526. fragmentShader: R.basicTextured.fragmentShader,
  23527. depthWrite: !1,
  23528. depthTest: !1,
  23529. side: M.DoubleSide
  23530. }),
  23531. N = new M.PlaneBufferGeometry(1,1),
  23532. (F = new M.Mesh(N,D)).position.z = 0,
  23533. O.add(F),
  23534. P = !0);
  23535. var m = N.getAttribute("uv");
  23536. m.setDynamic(!0),
  23537. m.needsUpdate = !0;
  23538. var v = m.array
  23539. , y = r / i
  23540. , A = o / n
  23541. , C = a / i
  23542. , I = s / n;
  23543. v[0] = y,
  23544. v[1] = A + I,
  23545. v[2] = y + C,
  23546. v[3] = A + I,
  23547. v[4] = y,
  23548. v[5] = A,
  23549. v[6] = y + C,
  23550. v[7] = A;
  23551. var E = N.getAttribute("position");
  23552. E.setDynamic(!0),
  23553. E.needsUpdate = !0;
  23554. var _ = E.array
  23555. , b = l / t.width - .5
  23556. , w = c / t.height - .5
  23557. , T = h / t.width
  23558. , x = u / t.height;
  23559. _[0] = b,
  23560. _[1] = w + x,
  23561. _[3] = b + T,
  23562. _[4] = w + x,
  23563. _[6] = b,
  23564. _[7] = w,
  23565. _[9] = b + T,
  23566. _[10] = w,
  23567. this.renderer.properties.get(e),
  23568. D.uniforms.tDiffuse.value = e,
  23569. D.blending = p || M.NoBlending,
  23570. D.transparent = !!f,
  23571. null != g || (g = 1),
  23572. D.uniforms.alpha.value = g,
  23573. D.needUpdate = !0,
  23574. t.activeCubeFace = d,
  23575. t.viewport.set(0, 0, t.width, t.height);
  23576. var S = this.renderer.autoClear;
  23577. this.renderer.autoClear = !1,
  23578. this.renderer.render(O, L, t, !1),
  23579. this.renderer.autoClear = S
  23580. }
  23581. ),
  23582. h.prototype.copyCubeMap = (g = !1,
  23583. C = A = y = v = m = null,
  23584. I = new M.Euler,
  23585. new M.Vector3,
  23586. function(e, t, i, n, r, o, a, s, l) {
  23587. this.renderer,
  23588. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23589. (m = new M.Scene).add(v),
  23590. y = new M.ShaderMaterial({
  23591. uniforms: {
  23592. tDiffuse: {
  23593. type: "t",
  23594. value: null
  23595. },
  23596. alpha: {
  23597. type: "f",
  23598. value: 1
  23599. }
  23600. },
  23601. vertexShader: R.copyCubeMap.vertexShader,
  23602. fragmentShader: R.copyCubeMap.fragmentShader,
  23603. depthWrite: !1,
  23604. depthTest: !1,
  23605. side: M.DoubleSide
  23606. }),
  23607. A = new M.BoxGeometry(2,2,2),
  23608. C = new M.Mesh(A,y),
  23609. m.add(C),
  23610. g = !0);
  23611. for (var c = 0; c < 6; c++)
  23612. h.getCubeOrientationForCubeFace(c, I),
  23613. C.rotation.copy(I),
  23614. C.matrixWorldNeedsUpdate = !0,
  23615. C.updateMatrixWorld(),
  23616. y.uniforms.tDiffuse.value = e,
  23617. y.blending = a || M.NoBlending,
  23618. y.transparent = !!s,
  23619. null != l || (l = 1),
  23620. y.uniforms.alpha.value = l,
  23621. y.needUpdate = !0,
  23622. t.activeCubeFace = c,
  23623. t.viewport.set(0, 0, r, o),
  23624. this.renderer.render(m, v, t, !1)
  23625. }
  23626. ),
  23627. h.getLookAtForCubeFace = function(e, t) {
  23628. switch (e) {
  23629. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23630. t.set(1, 0, 0);
  23631. break;
  23632. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23633. t.set(-1, 0, 0);
  23634. break;
  23635. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23636. t.set(0, 1, 0);
  23637. break;
  23638. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23639. t.set(0, -1, 0);
  23640. break;
  23641. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23642. t.set(0, 0, 1);
  23643. break;
  23644. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23645. t.set(0, 0, -1)
  23646. }
  23647. }
  23648. ,
  23649. h.getCubeOrientationForCubeFace = function(e, t) {
  23650. switch (e) {
  23651. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23652. t.set(0, -Math.PI / 2, 0);
  23653. break;
  23654. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23655. t.set(0, Math.PI / 2, 0);
  23656. break;
  23657. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23658. t.set(Math.PI / 2, Math.PI, 0);
  23659. break;
  23660. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23661. t.set(-Math.PI / 2, Math.PI, 0);
  23662. break;
  23663. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23664. t.set(0, -Math.PI, 0);
  23665. break;
  23666. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23667. t.set(0, 0, 0)
  23668. }
  23669. }
  23670. ,
  23671. t.exports = h
  23672. }
  23673. , {
  23674. "../enum/GLCubeFaces": 25,
  23675. "../enum/GLTextureType": 26,
  23676. "../enum/SceneRendererEvents": 43,
  23677. "../exception/BasicException": 55,
  23678. "../exception/RendererCreationException": 57,
  23679. "../settings": 166,
  23680. "../shaders": 167,
  23681. "../util/browser": 182,
  23682. events: 202,
  23683. three: 217
  23684. }],
  23685. 159: [function(e, t, i) {
  23686. "use strict";
  23687. function n(e) {
  23688. this.messenger = new a(e),
  23689. this.clientKey = null
  23690. }
  23691. var o = e("../util/ajax")
  23692. , r = e("./PostMessageType")
  23693. , a = e("./postmessage")
  23694. , s = e("./VersionInfo")
  23695. , l = e("events").EventEmitter
  23696. , c = window.location.origin + "/api/v1/user/";
  23697. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23698. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23699. }
  23700. ,
  23701. n.prototype.waitForConnection = function() {
  23702. return new Promise(function(t, i) {
  23703. this.messenger.on(r.CONNECT, function(e) {
  23704. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23705. }
  23706. .bind(this))
  23707. }
  23708. .bind(this))
  23709. }
  23710. ,
  23711. n.prototype.onConnectionReceived = function(i) {
  23712. return this.messenger.setTarget(i.source, i.origin),
  23713. this.verifyConnection(i).then(function(e, t) {
  23714. this.messenger.send({
  23715. type: r.ACCEPT,
  23716. toId: i.fromId,
  23717. warning: t
  23718. }),
  23719. this.clientKey = e,
  23720. this.messenger.removeAllListeners(r.CONNECT),
  23721. this.bindEvents()
  23722. }
  23723. .bind(this), function(e) {
  23724. this.messenger.send({
  23725. type: r.REJECT,
  23726. toId: i.fromId,
  23727. reason: e
  23728. }),
  23729. this.messenger.setTarget()
  23730. }
  23731. .bind(this))
  23732. }
  23733. ,
  23734. n.prototype.verifyConnection = function(r) {
  23735. return new Promise(function(e, t) {
  23736. var i;
  23737. if (s.isDeprecated(r.sdkVersion))
  23738. i = "这个版本正在被弃用";
  23739. else if (!s.isSupported(r.sdkVersion))
  23740. return t("不支持此版本的SDK");
  23741. var n = {
  23742. cache: !1,
  23743. headers: {
  23744. "X-port-Application-Key": r.applicationKey,
  23745. "X-port-Referrer": r.origin
  23746. }
  23747. };
  23748. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23749. }
  23750. )
  23751. }
  23752. ,
  23753. n.prototype.onMessageReceived = function(t) {
  23754. if (this.validateClientApplicationKey(t.applicationKey)) {
  23755. var i = this;
  23756. t.onDone = function(e) {
  23757. e.toId = t.fromId,
  23758. e.uid = t.uid,
  23759. e.type = r.RESPONSE,
  23760. i.messenger.send(e)
  23761. }
  23762. ,
  23763. this.emit(r.ACTION, t)
  23764. }
  23765. }
  23766. ,
  23767. n.prototype.validateClientApplicationKey = function(e) {
  23768. return this.clientKey === e
  23769. }
  23770. ,
  23771. n.prototype.sendEvent = function(e, t) {
  23772. this.messenger.send({
  23773. type: r.EVENT,
  23774. eventType: e,
  23775. eventData: t
  23776. })
  23777. }
  23778. ,
  23779. t.exports = n
  23780. }
  23781. , {
  23782. "../util/ajax": 181,
  23783. "./PostMessageType": 160,
  23784. "./VersionInfo": 163,
  23785. "./postmessage": 165,
  23786. events: 202
  23787. }],
  23788. 160: [function(e, t, i) {
  23789. "use strict";
  23790. t.exports = Object.freeze({
  23791. CONNECT: "postmessage.connect",
  23792. ACCEPT: "postmessage.accept",
  23793. REJECT: "postmessage.reject",
  23794. ACTION: "postmessage.action",
  23795. RESPONSE: "postmessage.response",
  23796. EVENT: "postmessage.event"
  23797. })
  23798. }
  23799. , {}],
  23800. 161: [function(e, t, i) {
  23801. "use strict";
  23802. t.exports = Object.freeze({
  23803. MOVE: "sdk.move",
  23804. ENTER_PANO: "sdk.enterpano",
  23805. MODEL_LOADED: "sdk.modelloaded"
  23806. })
  23807. }
  23808. , {}],
  23809. 162: [function(e, t, i) {
  23810. "use strict";
  23811. t.exports = Object.freeze({
  23812. FLY: "transition.fly",
  23813. FADEOUT: "transition.fade",
  23814. INSTANT: "transition.instant"
  23815. })
  23816. }
  23817. , {}],
  23818. 163: [function(e, t, i) {
  23819. "use strict";
  23820. t.exports = {
  23821. current: "1.0",
  23822. supported: ["1.0"],
  23823. deprecated: [],
  23824. isSupported: function(e) {
  23825. return -1 !== this.supported.indexOf(e)
  23826. },
  23827. isDeprecated: function(e) {
  23828. return -1 !== this.deprecated.indexOf(e)
  23829. },
  23830. isValid: function(e) {
  23831. return this.isSupported(e) || this.isDeprecated(e)
  23832. }
  23833. }
  23834. }
  23835. , {}],
  23836. 164: [function(q, X, e) {
  23837. (function(e) {
  23838. "use strict";
  23839. function r(e, t, i) {
  23840. e = e && e.toLowerCase().trim();
  23841. var n = new C.UP.clone
  23842. , r = Math.PI / 3
  23843. , o = Math.PI / 2;
  23844. switch (e) {
  23845. case "left":
  23846. i.copy(t),
  23847. i.applyAxisAngle(n, o);
  23848. break;
  23849. case "right":
  23850. i.copy(t),
  23851. i.applyAxisAngle(n, -o);
  23852. break;
  23853. case "forwardleft":
  23854. i.copy(t),
  23855. i.applyAxisAngle(n, r);
  23856. break;
  23857. case "forwardright":
  23858. i.copy(t),
  23859. i.applyAxisAngle(n, -r);
  23860. break;
  23861. case "forward":
  23862. default:
  23863. i.copy(t)
  23864. }
  23865. return i
  23866. }
  23867. function o(e, t) {
  23868. if (e) {
  23869. var i = {
  23870. pano: e,
  23871. lookAtPoint: null,
  23872. duration: null,
  23873. maxDistanceOverride: null,
  23874. skipWarpingCheck: !1
  23875. };
  23876. this.player.flyToPano(i, function() {
  23877. t && t({
  23878. success: !0,
  23879. message: "Transition complete."
  23880. })
  23881. })
  23882. } else
  23883. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23884. t && t({
  23885. success: !1,
  23886. error: "Unable to find pano."
  23887. })
  23888. }
  23889. function a(e, t) {
  23890. t.copy(C.FORWARD),
  23891. e.getDirection(t)
  23892. }
  23893. function c(i) {
  23894. return {
  23895. panos: i.panos.list.map(function(e) {
  23896. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23897. return {
  23898. uuid: e.id,
  23899. aligned: e.alignmentType === g.ALIGNED,
  23900. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23901. position: function(e) {
  23902. return e.alignmentType !== g.ALIGNED ? null : {
  23903. x: e.position.x,
  23904. y: e.position.y,
  23905. z: e.position.z
  23906. }
  23907. }(e),
  23908. rotation: function(e) {
  23909. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23910. return {
  23911. x: h.Math.radToDeg(t._x),
  23912. y: h.Math.radToDeg(t._y),
  23913. z: h.Math.radToDeg(t._z)
  23914. }
  23915. }(e),
  23916. thumbnail: t
  23917. }
  23918. })
  23919. }
  23920. }
  23921. 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"),
  23922. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23923. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23924. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23925. N.angle = 0,
  23926. N.angleTravelled = 0,
  23927. N.playerDirection = new h.Vector3,
  23928. N.lastFacingDirection = new h.Vector3,
  23929. N.onDone = null,
  23930. N.player = null,
  23931. N.start = function(e, t, i, n) {
  23932. N.active = !0,
  23933. e && t && (t = 0),
  23934. N.angle = e || t,
  23935. N.xAngle = e,
  23936. N.yAngle = t,
  23937. N.angleTravelled = 0,
  23938. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23939. i.getDirection(N.playerDirection),
  23940. N.lastFacingDirection.copy(N.playerDirection),
  23941. N.projectVectors(),
  23942. N.onDone = n,
  23943. N.player = i,
  23944. N()
  23945. }
  23946. ,
  23947. N.projectVectors = function() {
  23948. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23949. N.lastFacingDirection.projectOnPlane(C.UP))
  23950. }
  23951. ,
  23952. N), P = (i = new h.Vector3,
  23953. function(e) {
  23954. e ? (i.copy(e.position),
  23955. i.add(e.discPosition),
  23956. s.projectPositionToCanvas(i, this.player.camera, i),
  23957. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23958. }
  23959. ), O = (l = new h.Vector3,
  23960. function(e) {
  23961. var t = this.player.getDirection();
  23962. l.copy(t);
  23963. var i = l.y;
  23964. l.y = 0,
  23965. l.normalize();
  23966. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23967. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23968. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23969. 0;
  23970. this.player.mode === I.DOLLHOUSE && (n = -n);
  23971. var r = function() {
  23972. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23973. }
  23974. .call(this) - .1
  23975. , o = function() {
  23976. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23977. }
  23978. .call(this) + .1
  23979. , a = n + e;
  23980. r < a ? a = r : a < o && (a = o);
  23981. var s = a - n;
  23982. return 0 < e && s < .01 && (s = 0),
  23983. e < 0 && -.01 < s && (s = 0),
  23984. s
  23985. }
  23986. ), L = (t = new h.Euler,
  23987. function(e) {
  23988. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23989. {
  23990. position: {
  23991. x: e.position.x,
  23992. y: e.position.y,
  23993. z: e.position.z
  23994. },
  23995. rotation: {
  23996. x: h.Math.radToDeg(t.x),
  23997. y: h.Math.radToDeg(t.y),
  23998. z: 0
  23999. },
  24000. pano: e.currentPano ? e.currentPano.id : null,
  24001. mode: e.mode
  24002. }
  24003. }
  24004. ), D = null;
  24005. function N() {
  24006. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24007. N.player.getDirection(N.playerDirection),
  24008. N.projectVectors();
  24009. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24010. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24011. N.onDone && (0,
  24012. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24013. window.setTimeout(N, 4))
  24014. }
  24015. X.exports = {
  24016. init: function(e, t, i, n, r) {
  24017. Y.init(e, t, i, r),
  24018. D = new Promise(function(e, t) {
  24019. i.on(_.Ready, function() {
  24020. e()
  24021. })
  24022. }
  24023. .bind(this));
  24024. var o = new u(window)
  24025. , a = o.waitForConnection();
  24026. a.then(function(e) {
  24027. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24028. });
  24029. var s, l = (s = Date.now(),
  24030. function() {
  24031. if (!(Date.now() - s < 100)) {
  24032. var e = L(i);
  24033. o.sendEvent(b.MOVE, {
  24034. state: e
  24035. }),
  24036. s = Date.now()
  24037. }
  24038. }
  24039. );
  24040. i.on(_.Move, l),
  24041. i.on(_.ViewChanged, l),
  24042. n.on(p.ActiveModelChanged, function(e) {
  24043. function t(e) {
  24044. var t, i = e.newPano.id;
  24045. e.oldPano && (t = e.oldPano.id),
  24046. i !== t && o.sendEvent(b.ENTER_PANO, {
  24047. oldPano: t,
  24048. newPano: i
  24049. })
  24050. }
  24051. var i = e.model
  24052. , n = e.oldModel;
  24053. Y.model = i,
  24054. a.then(function() {
  24055. o.sendEvent(b.MODEL_LOADED, {
  24056. metadata: c(i)
  24057. })
  24058. }),
  24059. n && n.panos.forEach(function(e) {
  24060. e.removeEventListener("enter", t)
  24061. }),
  24062. i.panos.forEach(function(e) {
  24063. e.on("enter", t)
  24064. })
  24065. })
  24066. }
  24067. };
  24068. var F, B, V, k, U, H, z, G, W, j, Y = {
  24069. director: null,
  24070. player: null,
  24071. controls: null,
  24072. sceneRenderer: null,
  24073. model: null,
  24074. init: function(e, t, i, n) {
  24075. this.director = e,
  24076. this.player = i,
  24077. this.controls = t,
  24078. this.sceneRenderer = n
  24079. },
  24080. handleToObject: {},
  24081. objectToHandle: {},
  24082. handleCount: 0,
  24083. onMessageReceive: function(e) {
  24084. if (e) {
  24085. var t = e.targetFunction
  24086. , i = e.params
  24087. , n = e.onDone;
  24088. t && this[t] && this[t](i, n)
  24089. }
  24090. },
  24091. waitForInit: function(e, t) {
  24092. D.then(t.bind({
  24093. success: !0,
  24094. message: "Init complete."
  24095. }))
  24096. },
  24097. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24098. j = new h.Quaternion,
  24099. function(e, t) {
  24100. var i = e.pano
  24101. , n = e.rotation
  24102. , r = e.transition;
  24103. if (!this.model)
  24104. return t({
  24105. success: !1,
  24106. error: "The model has not been loaded yet"
  24107. });
  24108. var o = this.model.panos.get(i);
  24109. if (!o)
  24110. return t({
  24111. success: !1,
  24112. error: i + " does not exist in this model"
  24113. });
  24114. if (!n)
  24115. return t({
  24116. sucess: !1,
  24117. erorr: n + " is not a valid rotation"
  24118. });
  24119. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24120. console.log(n.z);
  24121. var a = {
  24122. success: !0,
  24123. message: i
  24124. };
  24125. if (r === v.FADEOUT)
  24126. j.setFromEuler(W),
  24127. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24128. else {
  24129. var s, l;
  24130. r === v.INSTANT && (l = s = 0);
  24131. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24132. this.player.flyToPano({
  24133. pano: o,
  24134. lookAtPoint: c,
  24135. duration: s,
  24136. aimDuration: l
  24137. }, t.bind(this, a))
  24138. }
  24139. }
  24140. ),
  24141. moveInDirection: function(e, t) {
  24142. var i = e.direction;
  24143. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24144. void (t && t({
  24145. success: !1,
  24146. error: "Invalid direction."
  24147. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24148. t(e ? {
  24149. success: !0,
  24150. message: "moved " + i
  24151. } : {
  24152. success: !1,
  24153. error: "Cannot move in direction: " + i
  24154. })
  24155. })
  24156. },
  24157. getPose: function(e, t) {
  24158. return this.player.camera.position,
  24159. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24160. t({
  24161. success: !0,
  24162. message: L(this.player)
  24163. })
  24164. },
  24165. takeScreenShot: (z = new h.PerspectiveCamera,
  24166. G = new h.WebGLRenderTarget,
  24167. function(e, t) {
  24168. if (!e.resolution)
  24169. return t({
  24170. success: !1,
  24171. error: "An invalid resolution was specified"
  24172. });
  24173. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24174. var i = this.sceneRenderer.renderer.getSize();
  24175. e.resolution.width = i.width,
  24176. e.resolution.height = i.height
  24177. }
  24178. z.layers.set(T.DEFAULT),
  24179. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24180. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24181. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24182. var n = e.resolution.width
  24183. , r = e.resolution.height
  24184. , o = n / r;
  24185. z.position.copy(this.sceneRenderer.camera.position),
  24186. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24187. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24188. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24189. G.setSize(n, r),
  24190. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24191. var a = new Uint8Array(n * r * 4);
  24192. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24193. var s = S.encode({
  24194. data: a,
  24195. width: n,
  24196. height: r,
  24197. heading: 180,
  24198. pitch: 0
  24199. }, {
  24200. quality: 75,
  24201. flipY: !0
  24202. });
  24203. t({
  24204. success: !0,
  24205. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24206. })
  24207. }
  24208. ),
  24209. findRankedPano: (U = new h.Vector3,
  24210. H = new h.Vector3,
  24211. function(e, t) {
  24212. a(this.player, H),
  24213. r(t, H, U);
  24214. var i = this.player.rankedPanoInDirection(e, U);
  24215. if (i) {
  24216. var n = this.objectToHandle[i.id];
  24217. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24218. this.handleToObject[n] = i),
  24219. n
  24220. }
  24221. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24222. -1
  24223. }
  24224. ),
  24225. findRankedtag: (V = new h.Vector3,
  24226. k = new h.Vector3,
  24227. function(e, t) {
  24228. a(this.player, k),
  24229. r(t, k, V);
  24230. var i = this.player.rankedtagInDirection(e, V);
  24231. if (i) {
  24232. var n = this.objectToHandle[i.sid];
  24233. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24234. this.handleToObject[n] = i),
  24235. n
  24236. }
  24237. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24238. -1
  24239. }
  24240. ),
  24241. clickNearesttag: function(e) {
  24242. this.clickRankedtag(0, e)
  24243. },
  24244. clickRankedtag: function(e, t) {
  24245. var i = function(e, t) {
  24246. var i = this.findRankedtag(e, t);
  24247. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24248. null)
  24249. }
  24250. .call(this, e, t);
  24251. i && P.call(this, i)
  24252. },
  24253. clickNearestPano: function(e, t) {
  24254. this.clickRankedPano(0, e, t)
  24255. },
  24256. clickRankedPano: function(e, t, i) {
  24257. var n = function(e, t) {
  24258. var i = this.findRankedPano(e, t);
  24259. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24260. null)
  24261. }
  24262. .call(this, e, t);
  24263. n ? o.call(this, n, i) : i(null)
  24264. },
  24265. clickPano: function(e, t) {
  24266. var i = this.handleTable[e];
  24267. i ? o.call(this, i, t) : t(null)
  24268. },
  24269. rotateDirection: function(e, t) {
  24270. var i = e.direction
  24271. , n = e.angle;
  24272. if (!R.active) {
  24273. var r = 0
  24274. , o = 0
  24275. , a = 0
  24276. , s = 0;
  24277. if (!n || isNaN(n))
  24278. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24279. void (t && t({
  24280. success: !1,
  24281. error: "Invalid rotation angle."
  24282. }));
  24283. if (this.player.mode === I.TRANSITIONING)
  24284. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24285. void (t && t({
  24286. success: !1,
  24287. error: "Cannot rotate while transitioning"
  24288. }));
  24289. if (i === m.RIGHT || i === m.LEFT)
  24290. i === m.RIGHT && (n = -n),
  24291. r = 0 < n ? -1 : 1,
  24292. a = n;
  24293. else {
  24294. if (i !== m.UP && i !== m.DOWN)
  24295. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24296. void (t && t({
  24297. success: !1,
  24298. error: "Invalid direction for rotation."
  24299. }));
  24300. if (this.player.mode === I.FLOORPLAN)
  24301. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24302. void (t && t({
  24303. success: !1,
  24304. error: "Cannot rotate " + i + " in floorplan mode"
  24305. }));
  24306. if (i === m.DOWN && (n = -n),
  24307. 0 === (n = O.call(this, n)))
  24308. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24309. void (t && t({
  24310. success: !1,
  24311. error: "Already at maximum rotation in direction: " + i
  24312. }));
  24313. o = 0 < n ? 1 : -1,
  24314. s = n
  24315. }
  24316. var l = n;
  24317. n = h.Math.degToRad(n),
  24318. a = h.Math.degToRad(a),
  24319. s = h.Math.degToRad(s);
  24320. var c = this.controls.activeControl;
  24321. c.startRotating(r, o),
  24322. R.start(a, s, this.player, function() {
  24323. c.stopRotating(!0),
  24324. t && t({
  24325. success: !0,
  24326. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24327. })
  24328. })
  24329. }
  24330. },
  24331. rotate: (F = new h.Vector3,
  24332. B = new h.Vector3,
  24333. function(e, t) {
  24334. var i = e.xAngle
  24335. , n = e.yAngle;
  24336. if (!R.active) {
  24337. if (i = i || 0,
  24338. n = n || 0,
  24339. isNaN(i) || isNaN(n))
  24340. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24341. void (t && t({
  24342. success: !1,
  24343. error: "Invalid rotation angle."
  24344. }));
  24345. if (this.player.mode === I.TRANSITIONING)
  24346. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24347. void (t && t({
  24348. success: !1,
  24349. error: "Cannot rotate while transitioning"
  24350. }));
  24351. Math.abs(i) < .01 && (i = 0),
  24352. Math.abs(n) < .01 && (n = 0);
  24353. var r = n;
  24354. n = O.call(this, n);
  24355. var o = 0 < r ? "UP" : "DOWN";
  24356. if (!(i = -i) && r && !n)
  24357. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24358. void (t && t({
  24359. success: !1,
  24360. error: "Already at maximum rotation in direction: " + o
  24361. }));
  24362. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24363. var a = n;
  24364. n = h.Math.degToRad(n),
  24365. i = h.Math.degToRad(i),
  24366. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24367. this.player.getDirection(F),
  24368. B.copy(F).applyAxisAngle(C.UP, i),
  24369. B.applyAxisAngle(C.RIGHT, n);
  24370. var s = (F.angleTo(B),
  24371. 0 < i ? -1 : i < 0 ? 1 : 0)
  24372. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24373. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24374. var c = this.controls.activeControl;
  24375. c.startRotating(s, l),
  24376. R.start(i, n, this.player, function() {
  24377. c.stopRotating(!0),
  24378. t && t({
  24379. success: !0,
  24380. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24381. })
  24382. })
  24383. }
  24384. }
  24385. ),
  24386. panCamera: function(e, i) {
  24387. function t(e) {
  24388. switch (r.removeAllListeners(w.AutoPanComplete),
  24389. r.removeAllListeners(w.AutoPanInterrupt),
  24390. r.removeAllListeners(w.AutoPanClamped),
  24391. e) {
  24392. case w.AutoPanInterrupt:
  24393. i({
  24394. success: !0,
  24395. message: "Camera panning interrupted."
  24396. });
  24397. break;
  24398. case w.AutoPanClamped:
  24399. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24400. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24401. return void i({
  24402. success: !1,
  24403. error: "Already at edge of current model bounds."
  24404. });
  24405. var t = "The view point is outside the bounds for the current model. ";
  24406. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24407. console.warn(t)
  24408. }
  24409. case w.AutoPanComplete:
  24410. i({
  24411. success: !0,
  24412. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24413. })
  24414. }
  24415. }
  24416. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24417. return i({
  24418. success: !1,
  24419. error: "Camera panning is not available in the current mode: " + this.player.mode
  24420. });
  24421. var n = e.position
  24422. , r = this.player.control;
  24423. r.setAutoPanPosition(n.x, n.z),
  24424. r.autoPan = !0;
  24425. var o = function(e, t) {
  24426. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24427. };
  24428. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24429. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24430. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24431. },
  24432. click: function(e, t) {
  24433. var i = e.x
  24434. , n = e.y;
  24435. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24436. n = n / 100 * $("#player").height()),
  24437. this.player.handleInputStart(i, n),
  24438. this.player.updateIntersect(),
  24439. this.player.handleInputEnd(i, n)
  24440. },
  24441. mouseOver: function(e, t) {
  24442. var i = e.x
  24443. , n = e.y;
  24444. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24445. n = n / 100 * $("#player").height()),
  24446. this.player.handleInputMove(i, n),
  24447. this.player.updateIntersect()
  24448. },
  24449. moveToMode: function(e, t) {
  24450. function i(e) {
  24451. t(e ? {
  24452. success: !1,
  24453. error: "Failed to load new mode: " + e
  24454. } : {
  24455. success: !0,
  24456. message: "Moved to new mode: " + n
  24457. })
  24458. }
  24459. var n = e.mode;
  24460. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24461. i()
  24462. }, function(e) {
  24463. i(e)
  24464. }) : t({
  24465. success: !1,
  24466. error: "Invalid mode selection"
  24467. })
  24468. }
  24469. }
  24470. }
  24471. ).call(this, "/js/sdk/automation.js")
  24472. }
  24473. , {
  24474. "../constants": 8,
  24475. "../enum/AlignmentType": 17,
  24476. "../enum/ControlEvents": 21,
  24477. "../enum/Direction": 22,
  24478. "../enum/GLCubeFaces": 25,
  24479. "../enum/Keys": 30,
  24480. "../enum/ModelManagerEvents": 33,
  24481. "../enum/PlayerEvents": 40,
  24482. "../enum/RenderLayers": 41,
  24483. "../enum/Vectors": 50,
  24484. "../enum/Viewmode": 51,
  24485. "../enum/WarpStyle": 52,
  24486. "../lib/jpeg_encoder": 94,
  24487. "../sdk/SdkEvents": 161,
  24488. "../settings": 166,
  24489. "../util/common": 185,
  24490. "../util/logger": 189,
  24491. "../util/math": 190,
  24492. "../util/panorama": 191,
  24493. "./ApiHost": 159,
  24494. "./PostMessageType": 160,
  24495. "./TransitionStyles": 162,
  24496. three: 217
  24497. }],
  24498. 165: [function(e, t, i) {
  24499. "use strict";
  24500. function n(e) {
  24501. this.sourceWindow = e,
  24502. this.targetWindow = null,
  24503. this.targetOrigin = null,
  24504. this.id = Math.floor(1e5 * Math.random()),
  24505. this.bindEvents()
  24506. }
  24507. var r = e("./PostMessageType")
  24508. , o = e("events").EventEmitter;
  24509. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24510. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24511. }
  24512. ,
  24513. n.prototype.setTarget = function(e, t) {
  24514. this.targetWindow = e,
  24515. this.targetOrigin = t
  24516. }
  24517. ,
  24518. n.prototype.onPostmessageReceived = function(e) {
  24519. var t = e.origin || e.originalEvent.origin
  24520. , i = e.source;
  24521. switch (e.data.type) {
  24522. case r.CONNECT:
  24523. break;
  24524. case r.RESPONSE:
  24525. if (this.id !== e.data.toId)
  24526. return;
  24527. default:
  24528. if (!this.validateMessageOrigin(t))
  24529. return
  24530. }
  24531. var n = e.data;
  24532. n.source = i,
  24533. n.origin = t,
  24534. n.timestamp = Date.now(),
  24535. this.emit(e.data.type, n)
  24536. }
  24537. ,
  24538. n.prototype.validateMessageOrigin = function(e) {
  24539. return "*" === this.targetOrigin || e === this.targetOrigin
  24540. }
  24541. ,
  24542. n.prototype.send = function(e) {
  24543. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24544. this.targetWindow.postMessage(e, this.targetOrigin))
  24545. }
  24546. ,
  24547. t.exports = n
  24548. }
  24549. , {
  24550. "./PostMessageType": 160,
  24551. events: 202
  24552. }],
  24553. 166: [function(e, t, i) {
  24554. "use strict";
  24555. var n = e("three")
  24556. , r = e("./util/browser")
  24557. , o = e("./enum/Viewmode")
  24558. , a = e("./enum/VROption")
  24559. , s = e("./enum/Colors")
  24560. , l = e("./enum/WarpStyle")
  24561. , c = e("./util/easing")
  24562. , h = e("./util/common")
  24563. , u = e("./util/showcase")
  24564. , d = e("./constants")
  24565. , p = {
  24566. debug: !1,
  24567. version: "2.25.6-0-gd87e5b1",
  24568. languageTag: r.valueFromHash("lang", null),
  24569. pageTitle: "四维虚拟漫游",
  24570. authorizationHeader: u.getAuthorizationHeader(),
  24571. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24572. logLevel: r.valueFromHash("log", 2),
  24573. skyboxRadius: 2500,
  24574. modelBoundsPadding: 5,
  24575. showNeighbors: !1,
  24576. brand: r.valueFromHash("brand", !0),
  24577. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24578. startHighlights: r.valueFromHash("hl", -1),
  24579. specialEdition: r.valueFromHash("bn", 0),
  24580. useWheel: r.valueFromHash("wh", !0),
  24581. crossOrigin: "anonymous",
  24582. fancierTransition: !1,
  24583. wireframe: !1,
  24584. skyboxWireframe: !1,
  24585. modelAlpha: 1,
  24586. highlightPanoSelection: !1,
  24587. showSweeps: !0,
  24588. showSkyboxes: !1,
  24589. showMesh: !0,
  24590. showFloors: !1,
  24591. showFloorDuration: 300,
  24592. showFloorDelay: 300,
  24593. hideFloorDuration: 300,
  24594. hideFloorDelay: 0,
  24595. reticuleOpacityTransitionTime: 250,
  24596. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24597. markerOpacityTransitionTime: 500,
  24598. guiAnimationSpeed: 250,
  24599. highlightAnimationDuration: 500,
  24600. modelComponentLoadSpinnerDelay: 150,
  24601. captureErrors: !1,
  24602. maxMobileTextures: 6,
  24603. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24604. startupFlyinDelay: 3e3,
  24605. dollhouseDefault: {
  24606. minDistance: 1,//15, //编辑页面给近一些
  24607. maxDistance: 50,
  24608. minPolarAngle: n.Math.degToRad(10),
  24609. maxPolarAngle: n.Math.degToRad(90)
  24610. },
  24611. hideReticuleTimeout: 1e3,
  24612. analytics: {
  24613. inactivityThreshold: 30,
  24614. sessionTrackingRate: .15,
  24615. maxTrackedErrors: 20,
  24616. sessionDurationPingFrequency: 10,
  24617. sessionDurationTimeout: 15
  24618. },
  24619. flydown: {
  24620. movementEasing: "easeInOutQuad",
  24621. movementDelay: .001,
  24622. rotationEasing: "easeInOutQuad",
  24623. rotationDelay: .5,
  24624. modelTextureDelay: .75,
  24625. skyboxDelay: .75
  24626. },
  24627. transition: {
  24628. flySpeed: .001,
  24629. flyTime: 750,
  24630. flytimeMaxDistanceThreshold: 5,
  24631. flytimeDistanceMultiplier: 150,
  24632. aimTime: 1500,
  24633. aimSlowFactor: 1.5,
  24634. blur: .8,
  24635. movementEasing: "easeInOutQuad",
  24636. blendEasing: "easeInOutQuad",
  24637. fastForwardFactor: 3
  24638. },
  24639. show360Views: {
  24640. enabled: !0,
  24641. transitionTime: 1e3
  24642. },
  24643. quickstart: {
  24644. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24645. animation: 1400,
  24646. showTextDelay: 500,
  24647. fadeOutDelay: 3e3,
  24648. fovChange: 10
  24649. },
  24650. appConfig: {
  24651. webvr_version: null,
  24652. segment_key: null,
  24653. embedly_key: null,
  24654. branch_key: null,
  24655. keen_write_key: null,
  24656. keen_project_id: null
  24657. },
  24658. vr: {
  24659. enabled: !0,
  24660. allowWebVR: !1,
  24661. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24662. },
  24663. share: {
  24664. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24665. },
  24666. input: {
  24667. longTapThreshold: 200,
  24668. moveToleranceNDC: .08,
  24669. touchMoveThreshold: 25
  24670. },
  24671. help: {
  24672. modalStayDuration: 600
  24673. },
  24674. immersive: {
  24675. timeToShowAgain: 1250,
  24676. uiStayDuration: 600
  24677. },
  24678. tourInteraction: {
  24679. disabled: "0" === r.valueFromHash("tourcta", null),
  24680. showPauseButton: 1e3,
  24681. showModal: 1500,
  24682. allowNextClick: 200,
  24683. largeModal: "1" === r.valueFromHash("tourcta", null),
  24684. smallModal: "2" === r.valueFromHash("tourcta", null)
  24685. },
  24686. labels: {
  24687. enabled: !1,
  24688. hideUntilStart: !0,
  24689. fadeInDuration: 250,
  24690. fadeInDelay: 250,
  24691. fadeOutDuration: 250,
  24692. fadeOutDelay: 0,
  24693. zoomHideThreshhold: {
  24694. mobile: r.isSmallScreen() ? .45 : .6,
  24695. desktop: 2
  24696. },
  24697. zoomTruncateThreshhold: {
  24698. mobile: r.isSmallScreen() ? .35 : .45,
  24699. desktop: .85
  24700. },
  24701. minLengthForTruncate: 16,
  24702. truncateLength: 12,
  24703. truncateSuffix: "..."
  24704. },
  24705. tags: {
  24706. enabled: r.valueFromHash("mt", 1),
  24707. startup: {
  24708. hideUntilStart: !0,
  24709. fadeInDuration: 500,
  24710. fadeInDelay: 100
  24711. },
  24712. visibility: {
  24713. anyDistance: !0,
  24714. visibleDistance: 8,
  24715. cameraClearance: .1,
  24716. alphaTestLevel: .05,
  24717. hideViaFloor: !0,
  24718. hideOffScreenDisc: !1,
  24719. hideOffScreenObject: !1
  24720. },
  24721. disc: {
  24722. opacity: 1,
  24723. disabledOpacity: .5,
  24724. scale: {
  24725. nearBound: 1.5,
  24726. farBound: 4.8,
  24727. linkFarBound: !1,
  24728. linkPercent: 40,
  24729. maxSize: 80,
  24730. minSize: 40,
  24731. baseViewportSize: 800,
  24732. responsiveness: 100
  24733. }
  24734. },
  24735. pole: {
  24736. enabled: !0,
  24737. height: .5,
  24738. width: 2,
  24739. opacity: .5,
  24740. color: "white"
  24741. },
  24742. navigate: {
  24743. nearestPano: !0,
  24744. lineOfSight: !0,
  24745. reactivate: !0,
  24746. aimAt: "disc",
  24747. tiltTolerance: 25,
  24748. rotateSpeedFactor: .6
  24749. }
  24750. },
  24751. path: {
  24752. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24753. colorUp: s._desat(s.newBlue, .5),
  24754. colorDown: s._darken(s.newBlue, .35),
  24755. opacity: .5,
  24756. style: "ribbon",
  24757. height: .025,
  24758. ribbonWidth: .24,
  24759. outsideHeight: .5,
  24760. waypointRadius: .5,
  24761. waypointIndoorRadius: .24,
  24762. waypointPulse: 1e3,
  24763. typ: l.BLACK,
  24764. meshFree: r.valueFromHash("mf", 1),
  24765. mapGuides: r.valueFromHash("guides", !0),
  24766. fadeInTime: 400,
  24767. fadeOutTime: 300
  24768. },
  24769. warp: {
  24770. nearPanoDist: .1,
  24771. matchCam: !1,
  24772. blur: .33,
  24773. fastTime: 1500,
  24774. teleportTime: 1500,
  24775. outsideTime: 2e3,
  24776. lookAheadMax: .3,
  24777. lookAheadDist: 2.5,
  24778. softPushDist: .37,
  24779. softPushEnd: .3,
  24780. softBendAngle: 8,
  24781. softBendTilt: 4,
  24782. softBendEnd: .3,
  24783. doBurns: !0,
  24784. burnsAngle: 8,
  24785. minBurnsAngle: 35,
  24786. minDownAngle: -35,
  24787. maxTurnPerSec: 280,
  24788. maxAimPerSec: 35,
  24789. minRotation: 12,
  24790. maxAimRotation: 33.2,
  24791. turnFriction: .2,
  24792. flySpeed: .01,
  24793. minWarpTime: 1200,
  24794. warpInterruptionRedirectTime: 500,
  24795. tourStepDelay: r.valueFromHash("st", 0),
  24796. walkDelay: 0,
  24797. walkMaxDist: 50,
  24798. walkMinDist: .8,
  24799. walkSlideShowThreshhold: 3e3,
  24800. walkExtraPanosDistance: .4,
  24801. timePerMeter: 1200,
  24802. motionLeadTime: 5e3,
  24803. movementEasing: "easeInOutQuad",
  24804. blendEasing: "easeInOutQuad",
  24805. showBunny: !1,
  24806. loop: r.valueFromHash("lp", !1),
  24807. auto: r.valueFromHash("ts", -1),
  24808. eOrder: "YXZ",
  24809. stepFactor: .25,
  24810. brakeStrength: 2,
  24811. minBrakeAngle: .1,
  24812. maxBrakeAngle: 1.8,
  24813. climbEffort: 4
  24814. },
  24815. rotationFriction: .05,
  24816. rotationAccelerationInside: 4.5,
  24817. rotationAccelerationOutside: .15,
  24818. rotationAfterMoveMultiplier: 40,
  24819. rotationAfterMoveHistoryCount: 5,
  24820. panFriction: .09,
  24821. panAccelerationOutside: 60,
  24822. onload: r.valueFromHash("onload", o.PANORAMA),
  24823. zoomNearLimit: .1,
  24824. zoomFarLimit: 50,
  24825. navigation: {
  24826. panoScores: !1,
  24827. mouseDirection: !0,
  24828. filterStrictness: .75,
  24829. angleFactor: -30,
  24830. directionFactor: 10,
  24831. distanceFactor: -1,
  24832. optionalityFactor: 3
  24833. },
  24834. sdkInit: !1,
  24835. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24836. console: r.valueFromHash("console", !1),
  24837. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24838. panoramaNeighbourMaxDistance: 5,
  24839. panoFloorClickRadius: .35,
  24840. showScreenshotLocations: !1,
  24841. showAxis: !1,
  24842. showNeighbourRaycasts: !1,
  24843. colorMarkerOnLoad: !1,
  24844. colorMarkerByFloor: !1,
  24845. tiling: {
  24846. panoPreRenderRepeatDelay: 2500,
  24847. panoPreRenderDelay: 500,
  24848. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24849. tilingFlagNames: ["usetiles", "tiles"],
  24850. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24851. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24852. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24853. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24854. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24855. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24856. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24857. customCompression: r.valueFromHash("tilecustcomp", 0),
  24858. mobileHighQualityOverride: 1,
  24859. allowUltraHighResolution: !0
  24860. },
  24861. zoom: {
  24862. enabled: !0,
  24863. forceOff: r.valueFromHash("nozoom", 0),
  24864. overridemax: r.valueFromHash("maxzoom", null),
  24865. overridemin: r.valueFromHash("minzoom", null),
  24866. max: d.highQualityMaxZoom,
  24867. min: 1,
  24868. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24869. activationThreshold: 1.1,
  24870. restoreTime: 500
  24871. },
  24872. profiling: {
  24873. enabled: r.valueFromHash("mem", !1)
  24874. }
  24875. };
  24876. (p = h.deepExtend(p, d, {
  24877. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24878. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24879. panorama: {
  24880. transitionTime: 1e3,
  24881. modelAlpha: 0,
  24882. modelAlphaDelay: p.flydown.modelTextureDelay,
  24883. modelAlphaLength: 1,
  24884. skyboxOpacity: 1,
  24885. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24886. skyboxOpacityLength: .9,
  24887. fovLength: 1,
  24888. fovDelay: 0,
  24889. cameraMatrixDuration: .8,
  24890. cameraMatrixDelay: 0,
  24891. cameraMatrixEase: c.easeInCubic,
  24892. reticuleOpacity: 1,
  24893. markerOpacity: .3,
  24894. markerOpacityOnHover: 1
  24895. },
  24896. dollhouse: {
  24897. transitionTime: 1e3,
  24898. modelAlpha: 1,
  24899. modelAlphaDelay: 0,
  24900. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24901. skyboxOpacity: 0,
  24902. skyboxOpacityDelay: 0,
  24903. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24904. fovLength: 1,
  24905. fovDelay: 0,
  24906. cameraMatrixDuration: .8,
  24907. cameraMatrixDelay: .3,
  24908. cameraMatrixEase: c.easeInCubic,
  24909. reticuleOpacity: 1,
  24910. markerOpacity: 0,
  24911. markerOpacityOnHover: 0
  24912. },
  24913. floorplan: {
  24914. transitionTime: 1e3,
  24915. modelAlpha: 1,
  24916. modelAlphaDelay: 0,
  24917. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24918. skyboxOpacity: 0,
  24919. skyboxOpacityDelay: 0,
  24920. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24921. fovLength: 1,
  24922. fovDelay: 0,
  24923. cameraMatrixDuration: .5,
  24924. cameraMatrixDelay: 0,
  24925. cameraMatrixEase: c.easeOutCubic,
  24926. reticuleOpacity: 1,
  24927. markerOpacity: 0,
  24928. markerOpacityOnHover: 0,
  24929. cameraHeight: 50
  24930. },
  24931. transitioning: {
  24932. reticuleOpacity: 0,
  24933. markerOpacity: .3,
  24934. markerOpacityOnHover: 1
  24935. },
  24936. "floorplan-dollhouse": {
  24937. rotationDelay: 0,
  24938. rotationDuration: 1
  24939. },
  24940. "floorplan-panorama": {
  24941. rotationDelay: .5,
  24942. rotationDuration: 1
  24943. },
  24944. "dollhouse-panorama": {
  24945. rotationDelay: .5,
  24946. rotationDuration: 1
  24947. },
  24948. "dollhouse-floorplan": {
  24949. rotationDelay: 0,
  24950. rotationDuration: 1,
  24951. cameraMatrixDuration: 1.05,
  24952. cameraMatrixDelay: .5
  24953. },
  24954. "panorama-dollhouse": {
  24955. rotationDelay: 0,
  24956. rotationDuration: .5
  24957. },
  24958. "panorama-floorplan": {
  24959. transitionTime: 1500,
  24960. rotationDelay: 0,
  24961. rotationDuration: .5
  24962. }
  24963. })).path.meshFree && (p.path.typ = l.WALK),
  24964. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24965. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24966. t.exports = p
  24967. }
  24968. , {
  24969. "./constants": 8,
  24970. "./enum/Colors": 19,
  24971. "./enum/VROption": 47,
  24972. "./enum/Viewmode": 51,
  24973. "./enum/WarpStyle": 52,
  24974. "./util/browser": 182,
  24975. "./util/common": 185,
  24976. "./util/easing": 186,
  24977. "./util/showcase": 193,
  24978. three: 217
  24979. }],
  24980. 167: [function(e, t, i) {
  24981. "use strict";
  24982. var n = e("three")
  24983. , r = e("./settings")
  24984. , 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"
  24985. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24986. t.exports = {
  24987. basicTextured: {
  24988. uniforms: {
  24989. tDiffuse: {
  24990. type: "t",
  24991. value: null
  24992. },
  24993. alpha: {
  24994. type: "f",
  24995. value: 1
  24996. }
  24997. },
  24998. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24999. 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}"
  25000. },
  25001. copyCubeMap: {
  25002. uniforms: {
  25003. tDiffuse: {
  25004. type: "t",
  25005. value: null
  25006. },
  25007. alpha: {
  25008. type: "f",
  25009. value: 1
  25010. }
  25011. },
  25012. 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}",
  25013. 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}"
  25014. },
  25015. cube: {
  25016. uniforms: {
  25017. map: {
  25018. type: "t",
  25019. value: null
  25020. },
  25021. opacity: {
  25022. type: "f",
  25023. value: 1
  25024. }
  25025. },
  25026. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25027. 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"
  25028. },
  25029. model: {
  25030. uniforms: {
  25031. map: {
  25032. type: "t",
  25033. value: null
  25034. },
  25035. modelAlpha: {
  25036. type: "f",
  25037. value: r.modelAlpha
  25038. },
  25039. opacity: {
  25040. type: "f",
  25041. value: 1
  25042. },
  25043. progress: {
  25044. type: "f",
  25045. value: 0
  25046. },
  25047. blackout: {
  25048. type: "i",
  25049. value: 0
  25050. },
  25051. pano0Map: {
  25052. type: "t",
  25053. value: null
  25054. },
  25055. pano0Position: {
  25056. type: "v3",
  25057. value: new n.Vector3
  25058. },
  25059. pano0Matrix: {
  25060. type: "m4",
  25061. value: new n.Matrix4
  25062. },
  25063. pano1Map: {
  25064. type: "t",
  25065. value: null
  25066. },
  25067. pano1Position: {
  25068. type: "v3",
  25069. value: new n.Vector3
  25070. },
  25071. pano1Matrix: {
  25072. type: "m4",
  25073. value: new n.Matrix4
  25074. }
  25075. },
  25076. 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",
  25077. 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"
  25078. },
  25079. hot: {
  25080. uniforms: {
  25081. color: {
  25082. type: "c",
  25083. value: new n.Color(16720384)
  25084. },
  25085. opac: {
  25086. type: "f",
  25087. value: 0
  25088. },
  25089. texture1: {
  25090. type: "t",
  25091. value: null
  25092. },
  25093. texture2: {
  25094. type: "t",
  25095. value: null
  25096. }
  25097. },
  25098. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25099. 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"
  25100. },
  25101. modelOutside: {
  25102. uniforms: {
  25103. map: {
  25104. type: "t",
  25105. value: null
  25106. },
  25107. opacity: {
  25108. type: "f",
  25109. value: 1
  25110. }
  25111. },
  25112. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25113. 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"
  25114. },
  25115. ribbon: {
  25116. uniforms: {
  25117. map: {
  25118. type: "t",
  25119. value: null
  25120. },
  25121. opacity: {
  25122. type: "f",
  25123. value: 1
  25124. },
  25125. color: {
  25126. type: "c",
  25127. value: new n.Color(r.path.color)
  25128. }
  25129. },
  25130. 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",
  25131. 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"
  25132. },
  25133. waypoint: {
  25134. uniforms: {
  25135. map: {
  25136. type: "t",
  25137. value: null
  25138. },
  25139. opacity: {
  25140. type: "f",
  25141. value: 1
  25142. },
  25143. pulse: {
  25144. type: "f",
  25145. value: 1
  25146. },
  25147. nearFade: {
  25148. type: "v2",
  25149. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25150. },
  25151. color: {
  25152. type: "c",
  25153. value: new n.Color(r.reticuleColor)
  25154. }
  25155. },
  25156. 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",
  25157. 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"
  25158. },
  25159. modelDebug: {
  25160. uniforms: {
  25161. map: {
  25162. type: "t",
  25163. value: null
  25164. },
  25165. modelAlpha: {
  25166. type: "f",
  25167. value: r.modelAlpha
  25168. },
  25169. depthmapRatio: {
  25170. type: "f",
  25171. value: 0
  25172. },
  25173. opacity: {
  25174. type: "f",
  25175. value: 1
  25176. },
  25177. progress: {
  25178. type: "f",
  25179. value: 0
  25180. },
  25181. considerOcclusion: {
  25182. type: "i",
  25183. value: r.fancierTransition
  25184. },
  25185. highlightPanoSelection: {
  25186. type: "i",
  25187. value: 0
  25188. },
  25189. useThirdPano: {
  25190. type: "i",
  25191. value: r.useThirdPano
  25192. },
  25193. pano0Map: {
  25194. type: "t",
  25195. value: null
  25196. },
  25197. pano0Depth: {
  25198. type: "t",
  25199. value: null
  25200. },
  25201. pano0Position: {
  25202. type: "v3",
  25203. value: new n.Vector3
  25204. },
  25205. pano0Matrix: {
  25206. type: "m4",
  25207. value: new n.Matrix4
  25208. },
  25209. pano0Weight: {
  25210. type: "f",
  25211. value: r.transition.pano0Weight
  25212. },
  25213. pano1Map: {
  25214. type: "t",
  25215. value: null
  25216. },
  25217. pano1Depth: {
  25218. type: "t",
  25219. value: null
  25220. },
  25221. pano1Position: {
  25222. type: "v3",
  25223. value: new n.Vector3
  25224. },
  25225. pano1Matrix: {
  25226. type: "m4",
  25227. value: new n.Matrix4
  25228. },
  25229. pano1Weight: {
  25230. type: "f",
  25231. value: r.transition.pano1Weight
  25232. },
  25233. pano2Map: {
  25234. type: "t",
  25235. value: null
  25236. },
  25237. pano2Depth: {
  25238. type: "t",
  25239. value: null
  25240. },
  25241. pano2Position: {
  25242. type: "v3",
  25243. value: new n.Vector3
  25244. },
  25245. pano2Matrix: {
  25246. type: "m4",
  25247. value: new n.Matrix4
  25248. },
  25249. pano2Weight: {
  25250. type: "f",
  25251. value: r.transition.pano2Weight
  25252. }
  25253. },
  25254. 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",
  25255. 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"
  25256. },
  25257. customDepth: {
  25258. uniforms: {
  25259. panoPosition: {
  25260. type: "v3",
  25261. value: new n.Vector3
  25262. }
  25263. },
  25264. 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",
  25265. 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"
  25266. },
  25267. skysphere: {
  25268. uniforms: {
  25269. radius: {
  25270. type: "f",
  25271. value: 0
  25272. }
  25273. },
  25274. 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",
  25275. 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"
  25276. },
  25277. tagDisc: {
  25278. uniforms: {
  25279. opacity: {
  25280. type: "f",
  25281. value: 0
  25282. },
  25283. color: {
  25284. type: "c",
  25285. value: new n.Color
  25286. },
  25287. bg: {
  25288. type: "t",
  25289. value: null
  25290. },
  25291. mask: {
  25292. type: "t",
  25293. value: null
  25294. }
  25295. },
  25296. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25297. 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"
  25298. }
  25299. }
  25300. window.shaders = t.exports;
  25301. }
  25302. , {
  25303. "./settings": 166,
  25304. three: 217
  25305. }],
  25306. 168: [function(E, _, e) {
  25307. (function(e) {
  25308. "use strict";
  25309. var t = E("three")
  25310. , i = (E("url"),
  25311. E("./util/ajax"))
  25312. , n = E("./settings")
  25313. , r = E("./util/logger")
  25314. , o = E("./util/math")
  25315. , a = E("./util/showcase")
  25316. , s = E("./objects/Panorama")
  25317. , l = new r(e)
  25318. , c = E("./model/Model")
  25319. , h = E("./shaders")
  25320. , u = E("./util/transitions")
  25321. , d = E("./objects/Chunk")
  25322. , p = E("./objects/Reticule")
  25323. , f = E("./objects/Skybox")
  25324. , g = E("./objects/Floor")
  25325. , m = E("./cameras/DollhouseCamera")
  25326. , v = E("./cameras/FloorplanCamera")
  25327. , y = E("./cameras/PanoramaCamera")
  25328. , A = E("./controls/DollhouseControls")
  25329. , C = E("./controls/FloorplanControls")
  25330. , I = E("./controls/PanoramaControls");
  25331. t.ImageUtils.crossOrigin = n.crossOrigin,
  25332. _.exports = {
  25333. shaders: h,
  25334. transitions: u,
  25335. Model: c,
  25336. Chunk: d,
  25337. Floor: g,
  25338. Skybox: f,
  25339. Reticule: p,
  25340. Panorama: s,
  25341. DollhouseCamera: m,
  25342. FloorplanCamera: v,
  25343. PanoramaCamera: y,
  25344. DollhouseControls: A,
  25345. FloorplanControls: C,
  25346. PanoramaControls: I,
  25347. getModel: function(e) {
  25348. if (!e.url)
  25349. throw 'getModel(): missing parameter "url"';
  25350. e.autoload = void 0 === e.autoload || e.autoload;
  25351. var t = a.parseSidUrl(e.url);
  25352. e.urlBase = t.urlBase,
  25353. e.urlModel = t.urlModel,
  25354. e.urlFiles = t.urlFiles;
  25355. var i = this._getPlatformError();
  25356. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25357. this._loadModel().then(this._buildModel.bind(this)))
  25358. },
  25359. _getPlatformError: function() {
  25360. 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"
  25361. },
  25362. _loadModel: function() {
  25363. return i.get(this.options.urlModel, {
  25364. responseType: "json",
  25365. prefetchFrom: "model",
  25366. auth: a.getAuthorizationHeader()
  25367. }).then(null, function() {
  25368. return l.warn("Model loading failed at initial metadata load"),
  25369. "loading-failed"
  25370. })
  25371. },
  25372. _buildModel: function(e) {
  25373. e = a.normalizeModeldata(e, o);
  25374. var t = new c(this.options,e);
  25375. return this.options.autoload ? t.load(!0) : $.when(t)
  25376. }
  25377. }
  25378. }
  25379. ).call(this, "/js/showcase.js")
  25380. }
  25381. , {
  25382. "./cameras/DollhouseCamera": 5,
  25383. "./cameras/FloorplanCamera": 6,
  25384. "./cameras/PanoramaCamera": 7,
  25385. "./controls/DollhouseControls": 10,
  25386. "./controls/FloorplanControls": 11,
  25387. "./controls/PanoramaControls": 13,
  25388. "./model/Model": 139,
  25389. "./objects/Chunk": 144,
  25390. "./objects/Floor": 146,
  25391. "./objects/Panorama": 148,
  25392. "./objects/Reticule": 149,
  25393. "./objects/Skybox": 152,
  25394. "./settings": 166,
  25395. "./shaders": 167,
  25396. "./util/ajax": 181,
  25397. "./util/logger": 189,
  25398. "./util/math": 190,
  25399. "./util/showcase": 193,
  25400. "./util/transitions": 195,
  25401. three: 217,
  25402. url: 208
  25403. }],
  25404. 169: [function(e, t, i) {
  25405. "use strict";
  25406. function l(e) {
  25407. var t = {
  25408. renderTarget: null,
  25409. inUse: !1,
  25410. size: -1,
  25411. pano: null
  25412. };
  25413. return t.inUse = !0,
  25414. t.size = e,
  25415. function(e) {
  25416. O.push(e)
  25417. }(t),
  25418. t
  25419. }
  25420. function c(e) {
  25421. for (var t = 0; t < O.length; t++) {
  25422. var i = O[t];
  25423. if (i.renderTarget === e)
  25424. return !(i.inUse = !1)
  25425. }
  25426. return !1
  25427. }
  25428. function n() {
  25429. this.tileDirectory = {},
  25430. this.activeRenderTargetDescriptors = {},
  25431. this.activePanos = [],
  25432. this.panoLODDescriptors = {},
  25433. this.panoDescriptors = {},
  25434. this.tileTrees = {},
  25435. this.sceneRenderer = null,
  25436. this.tileDownloader = null,
  25437. this.forceQueue = [],
  25438. this.uploadQueues = {},
  25439. this.uploadInterval = null,
  25440. this.uploadIntervalCancelled = !1,
  25441. this.usingTileOverlay = !1,
  25442. this.overlayTilesLoaded = !1,
  25443. this.overlayTileBase = null,
  25444. this.overlayTilesBasic = {},
  25445. this.overlayTilesEnhanced = {},
  25446. this.zoomRenderTarget = null,
  25447. this.zoomPano = null,
  25448. this.zoomingActive = !1,
  25449. this.zoomPanoId = null,
  25450. this.zoomPanoRenderingDisabled = !1,
  25451. this.direction = new _.Vector3,
  25452. this.initTime = -1,
  25453. this.maxBaseUploadsPerFrame = R,
  25454. this.maxNonBaseUploadsPerFrame = M
  25455. }
  25456. 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"),
  25457. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25458. e("../objects/Panorama"),
  25459. e("./TileTree")), y = (e("./TileDownloader"),
  25460. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25461. e("../util/browser"),
  25462. 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 = {
  25463. Base: 0,
  25464. Remaining: 1
  25465. }, O = [];
  25466. function L(e) {
  25467. var t = e.shift();
  25468. return t.uploadQueued = !1,
  25469. t
  25470. }
  25471. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25472. this.sceneRenderer = e,
  25473. this.tileDownloader = t,
  25474. this.qualityManager = i,
  25475. this.bindEvents(),
  25476. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25477. this.initTime = performance.now()
  25478. }
  25479. ,
  25480. n.prototype.getActivePanoTextures = function(e) {
  25481. e = e || [];
  25482. for (var t = 0; t < O.length; t++) {
  25483. var i = O[t];
  25484. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25485. }
  25486. }
  25487. ,
  25488. n.prototype.hasQueuedTiles = function() {
  25489. var e = this.peekNextFromUploadQueue();
  25490. return null != e
  25491. }
  25492. ,
  25493. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25494. return this.activeRenderTargetDescriptors[e]
  25495. }
  25496. ,
  25497. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25498. this.activeRenderTargetDescriptors[e] = t
  25499. }
  25500. ,
  25501. n.prototype.loadOverlayTiles = function() {
  25502. if (0 !== d.tiling.overlayStyle) {
  25503. var n = 0
  25504. , e = function(e, t, i) {
  25505. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25506. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25507. ++n === r.length && (this.overlayTilesLoaded = !0)
  25508. }
  25509. .bind(this)
  25510. , 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)]];
  25511. r.forEach(function(e) {
  25512. this.tileDownloader.loadImage(e[0], 0, e[1])
  25513. }
  25514. .bind(this)),
  25515. this.usingTileOverlay = !0
  25516. } else
  25517. this.usingTileOverlay = !1
  25518. }
  25519. ,
  25520. n.prototype.bindEvents = function() {
  25521. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25522. }
  25523. ,
  25524. n.prototype.setupZoomRenderTarget = function() {
  25525. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25526. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25527. return;
  25528. var e = this.zoomRenderTarget;
  25529. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25530. e) {
  25531. var t = e.width
  25532. , i = this.zoomRenderTarget.width;
  25533. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25534. e.texture.dispose(),
  25535. e.texture.loaded = !1,
  25536. e.texture.version = 0,
  25537. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25538. e.texture = null
  25539. }
  25540. this.zoomPanoRenderingDisabled = !1
  25541. } else
  25542. this.zoomPanoRenderingDisabled = !0
  25543. }
  25544. ,
  25545. n.prototype.enableUltraHighQualityMode = function(t) {
  25546. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25547. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25548. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25549. e && (this.qualityManager.enableUltraHighQualityMode(),
  25550. this.setupZoomRenderTarget(),
  25551. t())
  25552. }
  25553. .bind(this))
  25554. }
  25555. }
  25556. ,
  25557. n.prototype.activateTiledPano = function(e, t, i) {
  25558. i && this.clearAllQueuedUploads();
  25559. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25560. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25561. this.linkAllTilesAndNodes(e);
  25562. var r = this.getActiveRenderTargetDescriptor(e.id)
  25563. , o = t;
  25564. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25565. !r || o !== r.size) {
  25566. if (r && c(r.renderTarget),
  25567. !(r = function(e) {
  25568. for (var t = 0; t < O.length; t++) {
  25569. var i = O[t];
  25570. if (!i.inUse && i.size === e)
  25571. return i.inUse = !0,
  25572. i
  25573. }
  25574. return null
  25575. }(o))) {
  25576. var a = this.initTiledPano(o, !1);
  25577. (r = l(a.width)).renderTarget = a
  25578. }
  25579. r.pano = e,
  25580. this.resetPanoDescriptor(e.id),
  25581. this.resetPanoLODDescriptors(e.id),
  25582. this.resetRenderStatus(e.id, !0, !0)
  25583. }
  25584. this.setActiveRenderTargetDescriptor(e.id, r);
  25585. var s = i ? 0 : 1;
  25586. return this.updateActivePanos(e, s),
  25587. r.renderTarget
  25588. }
  25589. ,
  25590. n.prototype.deactivateTiledPano = function(e) {
  25591. var t = this.getActiveRenderTargetDescriptor(e.id);
  25592. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25593. this.setActiveRenderTargetDescriptor(e.id, null);
  25594. var i = this.getUploadQueueForPano(e.id);
  25595. this.clearUploadQueue(i),
  25596. this.updateActivePanos()
  25597. }
  25598. ,
  25599. n.prototype.updateActivePanos = (s = [],
  25600. function(e, t) {
  25601. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25602. e && s.length === t && s.push(e);
  25603. var n = this.activePanos[i]
  25604. , r = this.getActiveRenderTargetDescriptor(n.id);
  25605. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25606. }
  25607. e && t >= s.length && s.push(e),
  25608. this.activePanos.length = 0,
  25609. this.activePanos.push.apply(this.activePanos, s)
  25610. }
  25611. ),
  25612. n.prototype.getActivePanoCount = function() {
  25613. return this.activePanos.length
  25614. }
  25615. ,
  25616. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25617. var i = null;
  25618. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25619. for (var n = function(e, t, i, n) {
  25620. o && (t.tile.zoomUploaded = !1),
  25621. r && (t.tile.uploaded = !1)
  25622. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25623. this.getTileTree(e, a).breadthFirst({
  25624. callback: n.bind(this, a),
  25625. minLevel: i
  25626. })
  25627. }
  25628. }
  25629. ,
  25630. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25631. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25632. t.tile.zoomUploaded = t.tile.uploaded,
  25633. t.zoomCovered = t.covered
  25634. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25635. this.getTileTree(e, n).breadthFirst({
  25636. callback: i.bind(this, n),
  25637. maxLevel: t
  25638. })
  25639. }
  25640. }
  25641. ,
  25642. n.prototype.renderPanoTiles = (h = [],
  25643. function(e, t, i, n) {
  25644. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25645. t = t || this.direction || m.FORWARD;
  25646. var r = this.getActiveRenderTargetDescriptor(e);
  25647. if (!this.isRenderTargetDescriptorValid(r))
  25648. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25649. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25650. var a = this.getTileTree(e, o);
  25651. h.length = 0,
  25652. a.breadthFirst({
  25653. saveVisited: h
  25654. });
  25655. for (var s = 0; s < h.length; s++) {
  25656. var l = h[s];
  25657. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25658. }
  25659. }
  25660. this.updateDirection(t)
  25661. }
  25662. ),
  25663. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25664. return e && e.renderTarget
  25665. }
  25666. ,
  25667. n.prototype.isPanoActive = function(e) {
  25668. var t = this.getActiveRenderTargetDescriptor(e);
  25669. return this.isRenderTargetDescriptorValid(t)
  25670. }
  25671. ,
  25672. n.prototype.isPanoZoomed = function(e) {
  25673. return this.zoomingActive && this.zoomPanoId === e
  25674. }
  25675. ,
  25676. n.prototype.initTileTree = function(e, t, i) {
  25677. var n = this.tileTrees[e];
  25678. n || (n = [],
  25679. this.tileTrees[e] = n);
  25680. var r = n[t];
  25681. if (!r) {
  25682. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25683. r = new v(A.TILE_SIZE,o),
  25684. n[t] = r
  25685. }
  25686. }
  25687. ,
  25688. n.prototype.getTileTree = function(e, t) {
  25689. var i = this.tileTrees[e];
  25690. if (!i)
  25691. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25692. var n = i[t];
  25693. if (!n)
  25694. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25695. return n
  25696. }
  25697. ,
  25698. n.prototype.initTiledPano = function(e, t) {
  25699. var i = this.sceneRenderer.renderer
  25700. , n = (i.context,
  25701. new _.WebGLRenderTargetCube(e,e,{
  25702. stencilBuffer: !1
  25703. }))
  25704. , r = new _.CubeTexture([]);
  25705. (n.texture = r).image = [null, null, null, null, null, null],
  25706. r.flipY = !0,
  25707. t ? (r.generateMipmaps = !0,
  25708. r.magFilter = _.LinearFilter,
  25709. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25710. r.magFilter = _.LinearFilter,
  25711. r.minFilter = _.LinearFilter),
  25712. r.format = _.RGBAFormat,
  25713. i.setRenderTarget(n),
  25714. i.setRenderTarget(null);
  25715. var o = i.properties.get(r);
  25716. return o.__image__webglTextureCube = o.__webglTexture,
  25717. n
  25718. }
  25719. ,
  25720. n.prototype.getUploadQueueForPano = function(e) {
  25721. var t = this.uploadQueues[e];
  25722. return t || (t = [],
  25723. this.uploadQueues[e] = t),
  25724. t
  25725. }
  25726. ,
  25727. n.prototype.isTileUploaded = function(e) {
  25728. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25729. }
  25730. ,
  25731. n.prototype.setUploaded = function(e, t) {
  25732. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25733. }
  25734. ,
  25735. n.prototype.queueTileUpload = function(e, t, i) {
  25736. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25737. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25738. var r = this.getUploadQueueForPano(e.panoId);
  25739. 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),
  25740. e.uploadQueued = !0,
  25741. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25742. }
  25743. }
  25744. ,
  25745. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25746. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25747. }
  25748. ,
  25749. n.prototype.getTopUploadQueue = function() {
  25750. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25751. for (var n = 0; n < this.activePanos.length; n++)
  25752. if (e = this.activePanos[n],
  25753. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25754. switch (i) {
  25755. case P.Base:
  25756. if (0 === t[0].level)
  25757. return t;
  25758. break;
  25759. case P.Remaining:
  25760. return t
  25761. }
  25762. return null
  25763. }
  25764. ,
  25765. n.prototype.getNextFromUploadQueue = function() {
  25766. if (0 < this.forceQueue.length)
  25767. return L(this.forceQueue);
  25768. var e = this.getTopUploadQueue();
  25769. return e && 0 < e.length ? L(e) : null
  25770. }
  25771. ,
  25772. n.prototype.peekNextFromUploadQueue = function() {
  25773. if (0 < this.forceQueue.length)
  25774. return this.forceQueue[0];
  25775. var e = this.getTopUploadQueue();
  25776. return e && 0 < e.length ? e[0] : null
  25777. }
  25778. ,
  25779. n.prototype.clearAllQueuedUploads = function() {
  25780. this.clearAllUploadQueues(null, 0)
  25781. }
  25782. ,
  25783. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25784. this.clearAllUploadQueues(e, 0)
  25785. }
  25786. ,
  25787. n.prototype.clearAllUploadQueues = function(e, t) {
  25788. if (e)
  25789. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25790. this.clearUploadQueue(this.forceQueue, t, e);
  25791. else {
  25792. for (var i = 0; i < this.activePanos.length; i++) {
  25793. var n = this.activePanos[i];
  25794. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25795. }
  25796. this.clearUploadQueue(this.forceQueue, t)
  25797. }
  25798. }
  25799. ,
  25800. n.prototype.clearUploadQueue = function(e, t, i) {
  25801. null != t || (t = 0);
  25802. for (var n = 0; n < e.length; ) {
  25803. var r = e[n];
  25804. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25805. e.splice(n, 1)) : n++
  25806. }
  25807. }
  25808. ,
  25809. n.prototype.refreshUploadInterval = (a = null,
  25810. function(e) {
  25811. this.uploadIntervalCancelled || (a = a || function() {
  25812. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25813. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25814. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25815. }
  25816. .bind(this),
  25817. null != e || (e = x),
  25818. T || (e = S),
  25819. this.uploadInterval = window.setTimeout(a, e),
  25820. this.uploadIntervalDelay = e)
  25821. }
  25822. ),
  25823. n.prototype.update = (r = performance.now(),
  25824. o = 0,
  25825. function() {
  25826. this.uploadIntervalCancelled = !0,
  25827. window.clearTimeout(this.uploadInterval),
  25828. this.uploadInterval = null;
  25829. var e = performance.now() - r;
  25830. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25831. r = performance.now()),
  25832. o++
  25833. }
  25834. ),
  25835. n.prototype.updateUploadQueue = function(e, t) {
  25836. e = e || 1;
  25837. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25838. var r = this.getNextFromUploadQueue();
  25839. if (!r)
  25840. break;
  25841. if (0 !== r.level ? i++ : n++,
  25842. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25843. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25844. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25845. }
  25846. }
  25847. }
  25848. ,
  25849. n.prototype.updateDirection = function(e) {
  25850. if (e = e || this.direction) {
  25851. this.direction = e;
  25852. for (var t = 0; t < this.activePanos.length; t++) {
  25853. var i = this.activePanos[t]
  25854. , n = this.getUploadQueueForPano(i.id);
  25855. y.sortPanoTiles(n, i, this.direction)
  25856. }
  25857. }
  25858. }
  25859. ,
  25860. n.prototype.uploadTile = (I = {},
  25861. new _.Vector4,
  25862. E = d.tiling.overlayStyle,
  25863. function(e, t) {
  25864. var i = e.panoId
  25865. , n = e.image
  25866. , r = e.tileSize
  25867. , o = e.panoSize
  25868. , a = e.tileIndex
  25869. , s = (e.faceTileIndex,
  25870. e.totalTiles)
  25871. , l = (e.face,
  25872. e.tileX)
  25873. , c = e.tileY
  25874. , h = !0
  25875. , u = !1
  25876. , d = (this.getPanoDescriptor(i),
  25877. this.getPanoLODDescriptor(i, o))
  25878. , p = this.getActiveRenderTargetDescriptor(i)
  25879. , f = p.renderTarget
  25880. , g = p.size;
  25881. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25882. g = this.qualityManager.getMaxZoomPanoSize()),
  25883. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25884. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25885. this.isTileUploaded(e) && (u = h = !1)),
  25886. h) {
  25887. var m = r / o * g
  25888. , v = l * r / o * g
  25889. , y = c * r / o * g;
  25890. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25891. var A = I[r];
  25892. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25893. 1 === E || 2 === E) {
  25894. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25895. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25896. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25897. } else
  25898. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25899. d.uploadCount++,
  25900. this.emit(b.TileRenderSuccess, i, o, a, s),
  25901. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25902. this.setUploaded(e, !0),
  25903. this.addCoverageForNode(e.node)
  25904. } else
  25905. this.setUploaded(e, !1);
  25906. return e.uploadAttempted || (d.uploadAttempts++,
  25907. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25908. e.uploadAttempted = !0,
  25909. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25910. u
  25911. }
  25912. ),
  25913. n.prototype.linkTileAndNode = function(e, t) {
  25914. (t.tile = e).node = t
  25915. }
  25916. ,
  25917. n.prototype.linkAllTilesAndNodes = function(a) {
  25918. for (var e = function(e, t, i, n, r) {
  25919. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25920. this.linkTileAndNode(o, i)
  25921. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25922. var i = this.getTileTree(a.id, t);
  25923. i.breadthFirst({
  25924. callback: e.bind(this, i, t)
  25925. })
  25926. }
  25927. }
  25928. ,
  25929. n.prototype.anyUploaded = function(e) {
  25930. if (!e)
  25931. return !1;
  25932. if (e.tile && this.isTileUploaded(e.tile))
  25933. return !0;
  25934. if (e.children)
  25935. for (var t = 0; t < e.children.length; t++) {
  25936. var i = e.children[t];
  25937. if (this.anyUploaded(i))
  25938. return !0
  25939. }
  25940. return !1
  25941. }
  25942. ,
  25943. n.prototype.setNodeCovered = function(e, t) {
  25944. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25945. }
  25946. ,
  25947. n.prototype.isNodeCovered = function(e) {
  25948. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25949. }
  25950. ,
  25951. n.prototype.addCoverageForNode = function(e) {
  25952. if (this.setNodeCovered(e, !0),
  25953. e.parent && e.covered) {
  25954. var t = e.parent;
  25955. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25956. }
  25957. }
  25958. ,
  25959. n.prototype.calcFullCoverage = function(e) {
  25960. var t = !1;
  25961. if (e.children)
  25962. for (var i = 0; i < e.children.length; i++) {
  25963. var n = e.children[i];
  25964. t = t || this.calcFullCoverage(n)
  25965. }
  25966. e.covered = e.tile.uploaded || t
  25967. }
  25968. ,
  25969. n.prototype.nodeSubcovered = function(e) {
  25970. if (!e.children)
  25971. return !1;
  25972. for (var t = 0; t < e.children.length; t++)
  25973. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25974. return !1;
  25975. return !0
  25976. }
  25977. ,
  25978. n.prototype.resetPanoDescriptor = function(e) {
  25979. this.getPanoDescriptor(e)
  25980. }
  25981. ,
  25982. n.prototype.getPanoDescriptor = function(e) {
  25983. var t = this.panoDescriptors[e];
  25984. return t || (t = {},
  25985. this.panoDescriptors[e] = t),
  25986. t
  25987. }
  25988. ,
  25989. n.prototype.resetPanoLODDescriptors = function(e) {
  25990. var t = this.getPanoLODDescriptors(e);
  25991. for (var i in t)
  25992. if (t.hasOwnProperty(i)) {
  25993. var n = t[i];
  25994. n.uploadCount = 0,
  25995. n.uploadAttempts = 0
  25996. }
  25997. }
  25998. ,
  25999. n.prototype.getPanoLODDescriptor = function(e, t) {
  26000. var i = this.getPanoLODDescriptors(e)
  26001. , n = i[t];
  26002. return n || (n = {
  26003. uploadCount: 0,
  26004. uploadAttempts: 0
  26005. },
  26006. i[t] = n),
  26007. n
  26008. }
  26009. ,
  26010. n.prototype.getPanoLODDescriptors = function(e) {
  26011. var t = this.panoLODDescriptors[e];
  26012. return t || (t = {},
  26013. this.panoLODDescriptors[e] = t),
  26014. t
  26015. }
  26016. ,
  26017. n.prototype.onTileDownloaded = function(e) {
  26018. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26019. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26020. if (i.downloaded = !0,
  26021. i.image = e.image,
  26022. i.panoSize = e.panoSize,
  26023. i.tileX = e.tileX,
  26024. i.tileY = e.tileY,
  26025. i.totalTiles = e.totalTiles,
  26026. i.tileIndex = e.tileIndex,
  26027. i.faceTileIndex = e.faceTileIndex,
  26028. i.face = e.face,
  26029. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26030. i.panoId = e.panoId,
  26031. i.tileSize = e.tileSize,
  26032. i.direction = (new _.Vector3).copy(e.direction),
  26033. i.node = null,
  26034. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26035. this.isPanoActive(i.panoId)) {
  26036. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26037. this.linkTileAndNode(i, n),
  26038. this.queueTileUpload(i, !0)
  26039. }
  26040. }
  26041. ,
  26042. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26043. var r = this.tileDirectory[e];
  26044. r || (r = {},
  26045. this.tileDirectory[e] = r);
  26046. var o = 16384 * t + 1024 * i + n
  26047. , a = r[o];
  26048. return a || (a = {
  26049. downloaded: !1,
  26050. uploaded: !1,
  26051. zoomUploaded: !1
  26052. },
  26053. r[o] = a),
  26054. a._key = e + ":" + t + ":" + i + ":" + n,
  26055. a._tileKey = o,
  26056. a
  26057. }
  26058. ,
  26059. n.prototype.setZoomingActive = function(e, t, i) {
  26060. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26061. this.zoomPanoId = t.id,
  26062. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26063. }
  26064. ,
  26065. n.prototype.updateZoomedPanoFromBase = function(e) {
  26066. if (!this.zoomPanoRenderingDisabled) {
  26067. var t = this.getActiveRenderTargetDescriptor(e.id);
  26068. if (t && t.renderTarget) {
  26069. var i = this.qualityManager.getMaxZoomPanoSize()
  26070. , n = t.renderTarget
  26071. , r = t.size;
  26072. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26073. this.copyBaseRenderStatusToZoomed(e.id)
  26074. }
  26075. }
  26076. }
  26077. ,
  26078. t.exports = n
  26079. }
  26080. , {
  26081. "../enum/GLCubeFaces": 25,
  26082. "../enum/PanoRendererEvents": 35,
  26083. "../enum/PanoSizeClass": 36,
  26084. "../enum/SceneRendererEvents": 43,
  26085. "../enum/TileDownloaderEvents": 45,
  26086. "../enum/Vectors": 50,
  26087. "../exception/BasicException": 55,
  26088. "../objects/Panorama": 148,
  26089. "../settings": 166,
  26090. "../util/browser": 182,
  26091. "../util/panorama": 191,
  26092. "./TileDownloader": 171,
  26093. "./TilePrioritizer": 172,
  26094. "./TileTree": 173,
  26095. "./TileUtils": 174,
  26096. events: 202,
  26097. three: 217
  26098. }],
  26099. 170: [function(e, t, i) {
  26100. "use strict";
  26101. function n(e, t, i) {
  26102. this.maxNavPanoSize = -1,
  26103. this.maxZoomPanoSize = -1,
  26104. this.devicePixelDensity = e,
  26105. this.deviceScreenSize = t,
  26106. this.clientBandwidth = i,
  26107. this.panoSizeClassMap = {},
  26108. this.useHighResolutionPanos = !0,
  26109. this.useUltraHighResolutionPanos = !1,
  26110. this.modelHasUltraHighPanos = !1
  26111. }
  26112. var r = e("../enum/PanoSizeClass")
  26113. , o = e("../settings")
  26114. , a = e("../util/browser")
  26115. , s = e("../constants")
  26116. , l = e("../util/showcase")
  26117. , c = e("../enum/ModelManagerEvents");
  26118. n.prototype.init = function(e) {
  26119. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26120. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26121. this.highSize = this.getPanoSize(r.HIGH),
  26122. this.standardSize = this.getPanoSize(r.STANDARD),
  26123. this.baseSize = this.getPanoSize(r.BASE),
  26124. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26125. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26126. this.updateMaximums(),
  26127. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26128. }
  26129. ,
  26130. n.prototype.updateFromModel = function(e) {
  26131. this.updateHighResolutionSettings(e),
  26132. this.updateUltraHighResolutionSettings(e)
  26133. }
  26134. ,
  26135. n.prototype.updateHighResolutionSettings = function(e) {
  26136. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26137. this.updateMaximums()
  26138. }
  26139. ,
  26140. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26141. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26142. this.updateMaximums()
  26143. }
  26144. ,
  26145. n.prototype.enableUltraHighQualityMode = function() {
  26146. this.modelHasUltraHighPanos = !0,
  26147. this.updateUltraHighResolutionSettings(null)
  26148. }
  26149. ,
  26150. n.prototype.ultraHighQualityModeEnabled = function() {
  26151. return this.modelHasUltraHighPanos
  26152. }
  26153. ,
  26154. n.prototype.onModelChanged = function(e) {
  26155. this.updateFromModel(e.model),
  26156. this.updateMaximums()
  26157. }
  26158. ,
  26159. n.prototype.updateMaximums = function() {
  26160. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26161. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26162. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26163. }
  26164. ,
  26165. n.prototype.buildPanoSizeClassMap = function() {
  26166. this.panoSizeClassMap[r.BASE] = 512,
  26167. this.panoSizeClassMap[r.STANDARD] = 1024,
  26168. this.panoSizeClassMap[r.HIGH] = 2048,
  26169. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26170. }
  26171. ,
  26172. n.prototype.getPanoSize = function(e) {
  26173. return this.panoSizeClassMap[e]
  26174. }
  26175. ,
  26176. n.prototype.getMaxPossiblePanoSize = function() {
  26177. return this.getPanoSize(r.ULTRAHIGH)
  26178. }
  26179. ,
  26180. n.prototype.getMaxPanoSize = function() {
  26181. return this.maxZoomPanoSize
  26182. }
  26183. ,
  26184. n.prototype.getMaxNavPanoSize = function() {
  26185. return this.maxNavPanoSize
  26186. }
  26187. ,
  26188. n.prototype.getMaxZoomPanoSize = function() {
  26189. return this.maxZoomPanoSize
  26190. }
  26191. ,
  26192. n.prototype.detectMaxNavPanoSizeClass = function() {
  26193. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26194. }
  26195. ,
  26196. n.prototype.detectMaxNavPanoSize = function() {
  26197. var e = this.detectMaxNavPanoSizeClass();
  26198. return this.getPanoSize(e)
  26199. }
  26200. ,
  26201. n.prototype.detectMaxZoomPanoSize = function() {
  26202. 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)
  26203. }
  26204. ,
  26205. t.exports = n
  26206. }
  26207. , {
  26208. "../constants": 8,
  26209. "../enum/ModelManagerEvents": 33,
  26210. "../enum/PanoSizeClass": 36,
  26211. "../settings": 166,
  26212. "../util/browser": 182,
  26213. "../util/showcase": 193
  26214. }],
  26215. 171: [function(A, C, e) {
  26216. (function(e) {
  26217. "use strict";
  26218. function i(e) {
  26219. this.panos = null,
  26220. this.retryMinimumTime = 1e4,
  26221. this.urls = null,
  26222. this.panoLoadCallbacks = {},
  26223. this.downloadDescriptors = {},
  26224. this.priorityQueue = [],
  26225. this.forceQueue = [],
  26226. this.activeDownloads = [],
  26227. this.qualityManager = null,
  26228. this.tilePrioritizer = null,
  26229. this.refreshInterval = null,
  26230. this.processPriorityQueue = !1,
  26231. this.concurrentDownloads = e.concurrentDownloads || 1,
  26232. this.downloadTestResults = {}
  26233. }
  26234. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26235. A("../settings")), r = (A("../objects/Panorama"),
  26236. A("../util/logger")), o = (A("../enum/Vectors"),
  26237. A("../enum/PanoSizeClass"),
  26238. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26239. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26240. Object.freeze({
  26241. Testing: 1,
  26242. Success: 2,
  26243. Fail: 3
  26244. }));
  26245. i.prototype = Object.create(l.prototype),
  26246. i.IDLE_REFRESH_DELAY = 500,
  26247. i.ACTIVE_REFRESH_DELAY = 16,
  26248. i.DOWNLOAD_RETRIES = 4,
  26249. i.prototype.init = function(e) {
  26250. this.qualityManager = e
  26251. }
  26252. ,
  26253. i.prototype.setUrls = function(e) {
  26254. this.urls = e
  26255. }
  26256. ,
  26257. i.prototype.setPanoData = function(e, t, i) {
  26258. this.panos = e,
  26259. this.imagePanos = t,
  26260. this.panoGroupId = i
  26261. }
  26262. ,
  26263. i.prototype.start = function() {
  26264. this.refreshUpdateInterval(0)
  26265. }
  26266. ,
  26267. i.prototype.stop = function() {
  26268. window.cancel(this.refreshInterval)
  26269. }
  26270. ,
  26271. i.prototype.refreshUpdateInterval = function(e) {
  26272. e = e || 0,
  26273. this.refreshInterval = window.setTimeout(function() {
  26274. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26275. }
  26276. .bind(this), e)
  26277. }
  26278. ,
  26279. i.prototype.update = function() {
  26280. var e = 0 < this.forceQueue.length;
  26281. return this.processQueueForDownloading(this.forceQueue),
  26282. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26283. 0 < this.priorityQueue.length && (e = !0),
  26284. this.processQueueForDownloading(this.priorityQueue)),
  26285. e
  26286. }
  26287. ,
  26288. i.prototype.forceQueueTilesForPano = (p = [],
  26289. f = [],
  26290. function(e, t, i, n, r, o) {
  26291. p.length = 0;
  26292. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26293. var l = a[s];
  26294. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26295. }
  26296. if (i && 0 < p.length) {
  26297. g.sortPanoTiles(p, e, i),
  26298. f.length = 0,
  26299. m.matchingTilesInDirection(e, t, i, n, r, f);
  26300. for (var c = 0, h = function(e) {
  26301. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26302. }; c < p.length; ) {
  26303. var u = p[c];
  26304. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26305. }
  26306. }
  26307. for (var d = 0; d < p.length; d++)
  26308. this.forceQueue.push(p[d]);
  26309. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26310. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26311. o && this.processQueueForDownloading(this.forceQueue, !0)
  26312. }
  26313. ),
  26314. i.prototype.clearForceQueue = function() {
  26315. this.clearQueue(this.forceQueue)
  26316. }
  26317. ,
  26318. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26319. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26320. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26321. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26322. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26323. }
  26324. ,
  26325. i.prototype.clearQueue = function(e) {
  26326. this.setStatusForAllDescriptors(e, v.None),
  26327. e.length = 0
  26328. }
  26329. ,
  26330. i.prototype.clearFromQueue = function(e, t, i) {
  26331. for (var n = 0; n < e.length; n++) {
  26332. var r = e[n];
  26333. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26334. }
  26335. }
  26336. ,
  26337. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26338. for (var i = 0; i < e.length; i++) {
  26339. var n = e[i];
  26340. n && (n.status = t)
  26341. }
  26342. }
  26343. ,
  26344. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26345. for (var i = 0; i < e.length; i++) {
  26346. var n = e[i];
  26347. n && (n.status !== t ? n.status = t : e[i] = null)
  26348. }
  26349. }
  26350. ,
  26351. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26352. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26353. , n = i[t];
  26354. return n || (n = this.buildDownloadDescriptorArray(t),
  26355. i[t] = n,
  26356. this.initTileDownloadDescriptors(n, e, t)),
  26357. n
  26358. }
  26359. ,
  26360. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26361. var t = this.downloadDescriptors[e.id];
  26362. return t || (t = {},
  26363. this.downloadDescriptors[e.id] = t),
  26364. t
  26365. }
  26366. ,
  26367. i.prototype.processQueueForDownloading = function(e, t) {
  26368. if (this.cleanupActiveDownloads(),
  26369. this.activeDownloads.length < this.concurrentDownloads || t)
  26370. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26371. var r = e.shift();
  26372. r && (this.startDownload(r),
  26373. n++)
  26374. }
  26375. }
  26376. ,
  26377. i.prototype.testDownload = function(t, e, i) {
  26378. var n = this.downloadTestResults[t];
  26379. if (n)
  26380. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26381. else {
  26382. this.downloadTestResults[t] = y.Testing;
  26383. var r = this.panos.list[0]
  26384. , o = this.getTileUrl(r.id, t, e, 0)
  26385. , a = function(e) {
  26386. this.downloadTestResults[t] = y.Success,
  26387. i(!0)
  26388. }
  26389. .bind(this)
  26390. , s = function() {
  26391. this.downloadTestResults[t] = y.Fail,
  26392. i(!1)
  26393. }
  26394. .bind(this);
  26395. this.loadImage(o, 0, a, s)
  26396. }
  26397. }
  26398. ,
  26399. i.prototype.startDownload = function(e) {
  26400. e.status = v.Downloading;
  26401. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26402. this.activeDownloads.push(e),
  26403. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26404. }
  26405. ,
  26406. i.prototype.downloadFailed = function(e, t) {}
  26407. ,
  26408. i.prototype.downloadComplete = function(e, t) {
  26409. if (e.panoGroupId === this.panoGroupId) {
  26410. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26411. e.status = v.Downloaded,
  26412. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26413. var n = {
  26414. panoId: e.pano.id,
  26415. image: t,
  26416. tileSize: e.tileSize,
  26417. panoSize: e.panoSize,
  26418. tileIndex: e.tileIndex,
  26419. faceTileIndex: e.faceTileIndex,
  26420. totalTiles: e.totalTiles,
  26421. face: e.face,
  26422. tileX: e.tileX,
  26423. tileY: e.tileY,
  26424. direction: e.direction
  26425. };
  26426. e.image = t,
  26427. this.emit(o.TileDownloadSuccess, n),
  26428. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26429. panoId: e.pano.id,
  26430. tileSize: e.tileSize,
  26431. panoSize: e.panoSize
  26432. },
  26433. this.emit(o.PanoDownloadComplete, n),
  26434. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26435. }
  26436. }
  26437. ,
  26438. i.prototype.cleanupActiveDownloads = (n = [],
  26439. function() {
  26440. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26441. var t = this.activeDownloads[e];
  26442. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26443. }
  26444. this.activeDownloads.length = 0,
  26445. this.activeDownloads.push.apply(this.activeDownloads, n)
  26446. }
  26447. ),
  26448. i.prototype.isPanoDownloaded = function(e, t) {
  26449. var i = this.getTileDownloadDescriptors(e, t);
  26450. if (i.length <= 0)
  26451. return !1;
  26452. for (var n = 0; n < i.length; n++) {
  26453. if (i[n].status !== v.Downloaded)
  26454. return !1
  26455. }
  26456. return !0
  26457. }
  26458. ,
  26459. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26460. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26461. this.panoLoadCallbacks[o] = {
  26462. onLoad: i,
  26463. onFail: n,
  26464. onProgress: r
  26465. }
  26466. }
  26467. ,
  26468. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26469. var i = e.id + ":" + t;
  26470. return this.panoLoadCallbacks[i]
  26471. }
  26472. ,
  26473. i.prototype.buildDownloadDescriptorArray = function(e) {
  26474. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26475. var r = this.buildDownloadDescriptor();
  26476. i.push(r)
  26477. }
  26478. return i
  26479. }
  26480. ,
  26481. i.prototype.buildDownloadDescriptor = function() {
  26482. return {
  26483. panoGroupId: null,
  26484. pano: null,
  26485. panoSize: -1,
  26486. tileSize: -1,
  26487. tileIndex: -1,
  26488. totalTiles: -1,
  26489. faceTileIndex: -1,
  26490. status: v.None,
  26491. url: null,
  26492. image: null,
  26493. direction: new t.Vector3,
  26494. face: -1,
  26495. cubeFace: -1,
  26496. tileX: -1,
  26497. tileY: -1
  26498. }
  26499. }
  26500. ,
  26501. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26502. for (var n = 0; n < e.length; n++) {
  26503. var r = e[n];
  26504. this.initTileDownloadDescriptor(r, t, i, n)
  26505. }
  26506. }
  26507. ,
  26508. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26509. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26510. e.face = m.getFaceForTile(i, n),
  26511. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26512. e.panoGroupId = this.panoGroupId,
  26513. e.pano = t,
  26514. e.panoSize = i,
  26515. e.tileSize = r,
  26516. e.tileIndex = n,
  26517. e.totalTiles = m.getTileCountForSize(i),
  26518. e.status = v.None,
  26519. e.image = null,
  26520. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26521. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26522. }
  26523. ,
  26524. i.prototype.getTileUrl = (c = {
  26525. 256: "256",
  26526. 512: "512",
  26527. 1024: "1k",
  26528. 2048: "2k",
  26529. 4096: "4k"
  26530. },
  26531. h = {
  26532. face: -1,
  26533. faceTileIndex: -1,
  26534. tileX: -1,
  26535. tileY: -1
  26536. },
  26537. function(e, t, i, n) {
  26538. m.getTileLocation(t, n, h);
  26539. var r = Math.floor(t / i)
  26540. , o = r * r
  26541. , a = Math.floor(n / o)
  26542. , s = "";
  26543. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26544. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26545. return d.changeIfTileGenerating(l)
  26546. }
  26547. ),
  26548. i.prototype.loadImage = function(e, t, i, n) {
  26549. s.getImage(e, t).then(function(e) {
  26550. i(e)
  26551. }).fail(n)
  26552. }
  26553. ,
  26554. C.exports = i
  26555. }
  26556. ).call(this, "/js/tile/TileDownloader.js")
  26557. }
  26558. , {
  26559. "../ab": 3,
  26560. "../enum/DownloadStatus": 24,
  26561. "../enum/GLCubeFaces": 25,
  26562. "../enum/PanoSizeClass": 36,
  26563. "../enum/TileDownloaderEvents": 45,
  26564. "../enum/Vectors": 50,
  26565. "../enum/Viewmode": 51,
  26566. "../objects/Panorama": 148,
  26567. "../settings": 166,
  26568. "../util/ajax": 181,
  26569. "../util/logger": 189,
  26570. "../util/panorama": 191,
  26571. "./TilePrioritizer": 172,
  26572. "./TileUtils": 174,
  26573. events: 202,
  26574. three: 217
  26575. }],
  26576. 172: [function(n, C, e) {
  26577. (function(e) {
  26578. "use strict";
  26579. function h(e, t, i, n, r) {
  26580. this.qualityManager = e,
  26581. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26582. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26583. this.baseSize = t,
  26584. this.standardSize = i,
  26585. this.highSize = n,
  26586. this.ultraHighSize = r,
  26587. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26588. }
  26589. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26590. n("../settings"),
  26591. n("../settings"),
  26592. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26593. n("../enum/PanoSizeClass"),
  26594. n("../enum/ModelManagerEvents"),
  26595. n("../enum/GLCubeFaces"),
  26596. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26597. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26598. new t(e),
  26599. Object.freeze({
  26600. None: 0,
  26601. DirectionalFOV: 1
  26602. }));
  26603. h.PriorityCriteria = function(e, t, i, n, r) {
  26604. this.pano = e,
  26605. this.cameraPosition = (new o.Vector3).copy(t),
  26606. this.cameraDir = (new o.Vector3).copy(i),
  26607. this.panoSpaceDir = (new o.Vector3).copy(n),
  26608. this.upcomingPanos = r,
  26609. this.copy = function(e) {
  26610. this.pano = e.pano,
  26611. this.cameraPosition.copy(e.cameraPosition),
  26612. this.cameraDir.copy(e.cameraDir),
  26613. this.panoSpaceDir.copy(e.panoSpaceDir),
  26614. this.upcomingPanos = r
  26615. }
  26616. ,
  26617. this.zoomingActive = !1
  26618. }
  26619. ,
  26620. h.DIRECTIONAL_FOV = 180,
  26621. h.DIRECTIONAL_FOV_NARROW = 120,
  26622. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26623. h.MAX_SCORED_PANOS_TOADD = 2,
  26624. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26625. h.DIRECTION_SCORE_STRICTNESS = .75,
  26626. h.appendQueue = function(e, t) {
  26627. if (e && t)
  26628. for (var i = 0; i < t.length; i++)
  26629. e.push(t[i])
  26630. }
  26631. ,
  26632. h.prototype.updateCriteria = function(e, t, i, n) {
  26633. this.priorityCriteria.pano = e,
  26634. this.priorityCriteria.cameraPosition.copy(t),
  26635. this.priorityCriteria.cameraDir.copy(i),
  26636. this.priorityCriteria.upcomingPanos = n,
  26637. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26638. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26639. }
  26640. ,
  26641. h.prototype.filterAndPrioritize = (u = [],
  26642. p = [],
  26643. f = [],
  26644. function(e, t, i) {
  26645. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26646. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26647. var n = this.baseSize
  26648. , r = this.standardSize
  26649. , o = this.highSize
  26650. , a = this.ultraHighSize;
  26651. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26652. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26653. f.length = 0,
  26654. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26655. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26656. h.appendQueue(e, f),
  26657. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26658. f.length = 0,
  26659. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26660. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26661. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26662. h.appendQueue(e, f),
  26663. f.length = 0,
  26664. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26665. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26666. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26667. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26668. h.appendQueue(e, f),
  26669. this.queueTilesForPanos(e, u, i, n)
  26670. }
  26671. ),
  26672. h.prototype.canDownloadSize = function(e) {
  26673. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26674. }
  26675. ,
  26676. h.prototype.populateNeighborPanos = function(e, t, i) {
  26677. (i = i || []).length = 0;
  26678. var n = t.getNeighbours(e);
  26679. for (var r in n)
  26680. if (n.hasOwnProperty(r)) {
  26681. var o = t.get(r);
  26682. i.push(o)
  26683. }
  26684. return i
  26685. }
  26686. ,
  26687. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26688. (i = i || []).length = 0;
  26689. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26690. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26691. , s = t.sortByScore(o, a);
  26692. if (s)
  26693. for (var l = 0; l < s.length && l < r; l++) {
  26694. var c = s[l].pano;
  26695. i.push(c)
  26696. }
  26697. return i
  26698. }
  26699. ,
  26700. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26701. for (var o = 0, a = 0; a < t.length; a++) {
  26702. var s = t[a];
  26703. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26704. r && r <= o)
  26705. break
  26706. }
  26707. return o
  26708. }
  26709. ,
  26710. h.prototype.queueTilesForPano = (r = {
  26711. filter: a.None
  26712. },
  26713. function(e, t, i, n) {
  26714. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26715. }
  26716. ),
  26717. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26718. function(e, t, i, n, r, o, a, s) {
  26719. for (var l = 0, c = 0; c < i.length; c++) {
  26720. var h = i[c];
  26721. d.copy(h.position),
  26722. d.sub(r),
  26723. d.normalize();
  26724. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26725. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26726. s && s <= l))
  26727. break
  26728. }
  26729. return l
  26730. }
  26731. ),
  26732. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26733. for (var l = 0, c = 0; c < i.length; c++) {
  26734. var h = i[c];
  26735. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26736. s && s <= l)
  26737. break
  26738. }
  26739. return l
  26740. }
  26741. ,
  26742. h.prototype.queueTilesInDirectionForPano = (s = {
  26743. filter: a.DirectionalFOV,
  26744. direction: new o.Vector3,
  26745. fov: 60
  26746. },
  26747. l = new o.Vector3,
  26748. function(e, t, i, n, r, o, a) {
  26749. return l.copy(o),
  26750. m.getRelativeDirection(i.quaternion, l),
  26751. s.direction.copy(l),
  26752. s.fov = a,
  26753. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26754. }
  26755. ),
  26756. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26757. function(e, t, i, n, r) {
  26758. var o = t.getTileDownloadDescriptors(i, n);
  26759. c.length = 0,
  26760. this.filterTileDownloadDescriptors(i, o, c, r);
  26761. for (var a = 0, s = 0; s < c.length; s++) {
  26762. var l = c[s];
  26763. l && (e.push(l),
  26764. a++)
  26765. }
  26766. return a
  26767. }
  26768. ),
  26769. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26770. function(e, t, i, n) {
  26771. var r, o;
  26772. switch (n.filter) {
  26773. case a.DirectionalFOV:
  26774. for (r = 0; r < t.length; r++)
  26775. o = t[r],
  26776. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26777. break;
  26778. default:
  26779. for (r = 0; r < t.length; r++)
  26780. o = t[r],
  26781. i.push(o)
  26782. }
  26783. for (r = 0; r < i.length; r++)
  26784. o = i[r],
  26785. this.canIncludeDescriptor(o) || (i[r] = null)
  26786. }
  26787. ),
  26788. h.prototype.canIncludeDescriptor = function(e) {
  26789. return e.status !== i.Downloading && e.status !== i.Downloaded
  26790. }
  26791. ,
  26792. h.prototype.canIncludePano = function(e, t) {
  26793. return !e.isLoaded(t)
  26794. }
  26795. ,
  26796. h.getFOVDotThreshold = function(e) {
  26797. return Math.cos(o.Math.degToRad(e / 2))
  26798. }
  26799. ;
  26800. var y = (A._panoSpaceDir = new o.Vector3,
  26801. A._fovThreshold = -1,
  26802. A._fovThresholdNarrow = -1,
  26803. A);
  26804. function A(e, t) {
  26805. var i = A._panoSpaceDir
  26806. , n = A._fovThreshold
  26807. , r = A._fovThresholdNarrow
  26808. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26809. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26810. return e._dot = o,
  26811. t._dot = a,
  26812. 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)
  26813. }
  26814. h.sortPanoTiles = function(e, t, i) {
  26815. y._panoSpaceDir.copy(i),
  26816. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26817. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26818. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26819. e.sort(y)
  26820. }
  26821. ,
  26822. h.insertSortedPanoTile = function(e, t, i, n) {
  26823. y._panoSpaceDir.copy(n),
  26824. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26825. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26826. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26827. for (var r = -1, o = 0; o < e.length; o++) {
  26828. if (y(t, e[o]) <= 0) {
  26829. r = o;
  26830. break
  26831. }
  26832. }
  26833. if (-1 === r)
  26834. e[e.length] = t;
  26835. else {
  26836. for (var a = e.length; r < a; a--)
  26837. e[a] = e[a - 1];
  26838. e[r] = t
  26839. }
  26840. }
  26841. ,
  26842. h.prototype.setZoomingActive = function(e) {
  26843. e !== this.zoomingActive && (this.zoomingActive = e)
  26844. }
  26845. ,
  26846. C.exports = h
  26847. }
  26848. ).call(this, "/js/tile/TilePrioritizer.js")
  26849. }
  26850. , {
  26851. "../enum/DownloadStatus": 24,
  26852. "../enum/GLCubeFaces": 25,
  26853. "../enum/ModelManagerEvents": 33,
  26854. "../enum/PanoSizeClass": 36,
  26855. "../enum/Vectors": 50,
  26856. "../enum/Viewmode": 51,
  26857. "../objects/Panorama": 148,
  26858. "../settings": 166,
  26859. "../util/browser": 182,
  26860. "../util/logger": 189,
  26861. "../util/math": 190,
  26862. "./TileUtils": 174,
  26863. events: 202,
  26864. three: 217
  26865. }],
  26866. 173: [function(e, t, i) {
  26867. "use strict";
  26868. function f(e, t) {
  26869. this.levels = t,
  26870. this.tileSize = e,
  26871. this.root = null,
  26872. this.allNodes = [],
  26873. function(e) {
  26874. e.root = function e(t, i, n) {
  26875. if (n > t.levels)
  26876. return null;
  26877. var r = new a(t,i);
  26878. t.allNodes.push(r);
  26879. for (var o = 0; o < s; o++)
  26880. r.children[o] = e(t, r, n + 1);
  26881. return r
  26882. }(e, null, 0)
  26883. }(this)
  26884. }
  26885. function a(e, t) {
  26886. this.tree = e,
  26887. this.parent = t,
  26888. this.children = [],
  26889. this.id = ++n
  26890. }
  26891. var g = (e("three"),
  26892. e("./TileUtils"),
  26893. e("../objects/Panorama"),
  26894. e("../util/panorama"),
  26895. e("events").EventEmitter,
  26896. 2)
  26897. , s = g * g;
  26898. f.TraversalType = Object.freeze({
  26899. PreOrder: 0,
  26900. PostOrder: 1
  26901. });
  26902. var n = 0;
  26903. f.getLevelCountForSize = function(e, t) {
  26904. var i = 0;
  26905. for (t < e && (t = e); !((t /= g) < e); )
  26906. i++;
  26907. return i
  26908. }
  26909. ,
  26910. f.getSizeForLevel = function(e, t) {
  26911. return Math.pow(g, t) * e
  26912. }
  26913. ,
  26914. f.prototype.getSubNode = function(e, t, i) {
  26915. (!t || e < this.tileSize) && (t = 0),
  26916. (!i || e < this.tileSize) && (i = 0),
  26917. e < this.tileSize && (e = this.tileSize);
  26918. var n = f.getLevelCountForSize(this.tileSize, e);
  26919. return function e(t, i, n, r, o) {
  26920. if (!t)
  26921. return null;
  26922. if (0 === n)
  26923. return t;
  26924. if (!t.children || 0 === t.children.length)
  26925. return null;
  26926. var a = Math.pow(g, n) / g
  26927. , s = r % a
  26928. , l = o % a
  26929. , c = Math.floor(o / a)
  26930. , h = Math.floor(r / a)
  26931. , u = c * g + h;
  26932. return e(t.children[u], i + 1, n - 1, s, l)
  26933. }(this.root, 0, n, t, i)
  26934. }
  26935. ,
  26936. f.prototype.breadthFirst = function(e) {
  26937. var t = !!(e = e || {}).nullLevelEnd
  26938. , i = e.maxLevel
  26939. , n = e.minLevel
  26940. , r = e.callback
  26941. , o = e.saveVisited
  26942. , a = []
  26943. , s = {}
  26944. , l = 0;
  26945. for (a.push(this.root),
  26946. a.push(s); 0 < a.length && !(i && i < l); ) {
  26947. var c = a.shift();
  26948. if (c === s)
  26949. (!n || n <= l) && (r && t && r(null),
  26950. o && t && o.push(null)),
  26951. 0 < a.length && a.push(s),
  26952. l++,
  26953. 0;
  26954. else {
  26955. if (c.children)
  26956. for (var h = 0; h < c.children.length; h++) {
  26957. c.children[h] && a.push(c.children[h])
  26958. }
  26959. var u = this.getFaceIndexFromNode(c);
  26960. (!n || n <= l) && (r && r(c, l, u),
  26961. o && o.push(c)),
  26962. 0
  26963. }
  26964. }
  26965. }
  26966. ,
  26967. f.prototype.getFaceIndexFromNode = function(e) {
  26968. if (!e)
  26969. return -1;
  26970. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26971. var o = i.parent;
  26972. if (!o)
  26973. break;
  26974. for (var a = -1, s = 0; s < o.children.length; s++)
  26975. o.children[s] === i && (a = s);
  26976. n = a % g * t + n,
  26977. r = Math.floor(a / g) * t + r,
  26978. t *= g,
  26979. i = o
  26980. }
  26981. return r * t + n
  26982. }
  26983. ,
  26984. f.prototype.depthFirst = function(e, t, i) {
  26985. !function e(t, i, n, r, o, a, s, l) {
  26986. if (t) {
  26987. s = s || f.TraversalType.PreOrder;
  26988. var c = r * g + n;
  26989. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26990. a && a.push(t)),
  26991. t.children && 0 !== t.children.length) {
  26992. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26993. for (var p = 0; p < g; p++)
  26994. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26995. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26996. a && a.push(t))
  26997. }
  26998. }
  26999. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27000. }
  27001. ,
  27002. t.exports = f
  27003. }
  27004. , {
  27005. "../objects/Panorama": 148,
  27006. "../util/panorama": 191,
  27007. "./TileUtils": 174,
  27008. events: 202,
  27009. three: 217
  27010. }],
  27011. 174: [function(e, t, i) {
  27012. "use strict";
  27013. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27014. b.TILE_SIZE = 512,
  27015. b.FACES_PER_PANO = 6,
  27016. b.LocationOnTile = {
  27017. Center: 0,
  27018. UpperLeft: 1,
  27019. UpperRight: 2,
  27020. LowerRight: 3,
  27021. LowerLeft: 4
  27022. },
  27023. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27024. var l = e / t
  27025. , c = t / e * 2
  27026. , h = c / 2
  27027. , u = n / l * 2 - 1 + h
  27028. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27029. switch (o = o || b.LocationOnTile.Center) {
  27030. case b.LocationOnTile.UpperLeft:
  27031. u -= h,
  27032. d += h,
  27033. u += a * c;
  27034. break;
  27035. case b.LocationOnTile.UpperRight:
  27036. u += h,
  27037. d += h,
  27038. d -= a * c;
  27039. break;
  27040. case b.LocationOnTile.LowerRight:
  27041. u += h,
  27042. d -= h,
  27043. u -= a * c;
  27044. break;
  27045. case b.LocationOnTile.LowerLeft:
  27046. u -= h,
  27047. d -= h,
  27048. d += a * c;
  27049. break;
  27050. case b.LocationOnTile.Center:
  27051. }
  27052. switch (i) {
  27053. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27054. _.setVector(s, -1, d, -u);
  27055. break;
  27056. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27057. _.setVector(s, 1, d, u);
  27058. break;
  27059. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27060. _.setVector(s, -u, 1, -d);
  27061. break;
  27062. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27063. _.setVector(s, -u, -1, d);
  27064. break;
  27065. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27066. _.setVector(s, -u, d, 1);
  27067. break;
  27068. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27069. _.setVector(s, u, d, -1)
  27070. }
  27071. _.normalize(s)
  27072. }
  27073. ,
  27074. b.getFaceForTile = function(e, t) {
  27075. var i = b.TILE_SIZE;
  27076. e < b.TILE_SIZE && (i = e);
  27077. var n = Math.floor(e / i)
  27078. , r = n * n;
  27079. return Math.floor(t / r)
  27080. }
  27081. ,
  27082. b.getTileLocation = function(e, t, i) {
  27083. var n = b.TILE_SIZE;
  27084. e < b.TILE_SIZE && (n = e);
  27085. var r = b.getFaceForTile(e, t)
  27086. , o = Math.floor(e / n)
  27087. , a = t - r * (o * o);
  27088. i.tileX = a % o,
  27089. i.tileY = Math.floor(a / o),
  27090. i.face = r,
  27091. i.faceTileIndex = a
  27092. }
  27093. ,
  27094. b.getTileCountForSize = function(e) {
  27095. if (e <= b.TILE_SIZE)
  27096. return b.FACES_PER_PANO;
  27097. var t = Math.floor(e / b.TILE_SIZE);
  27098. return t * t * b.FACES_PER_PANO
  27099. }
  27100. ,
  27101. b.getRelativeDirection = (r = new _.Matrix4,
  27102. o = new _.Quaternion,
  27103. function(e, t) {
  27104. o.copy(e),
  27105. o.inverse(),
  27106. r.makeRotationFromQuaternion(o),
  27107. r.applyToVector3(t),
  27108. _.normalize(t)
  27109. }
  27110. ),
  27111. b.matchingTilesInDirection = (c = new _.Vector3,
  27112. h = new _.Vector3(0,0,-1),
  27113. u = new _.Quaternion,
  27114. l = {
  27115. face: -1,
  27116. faceTileIndex: -1,
  27117. tileX: -1,
  27118. tileY: -1
  27119. },
  27120. d = function(e, t, i) {
  27121. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27122. b.getTileLocation(e, o, l),
  27123. t && !t(l) || (r++,
  27124. i && (a = l,
  27125. i.push({
  27126. face: a.face,
  27127. faceTileIndex: a.faceTileIndex,
  27128. tileX: a.tileX,
  27129. tileY: a.tileY
  27130. })));
  27131. var a;
  27132. return r
  27133. }
  27134. ,
  27135. function(e, t, i, n, r, o) {
  27136. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27137. if (b.getTileCountForSize(t),
  27138. !n && !r)
  27139. return d(t, null, o);
  27140. var s = !!r;
  27141. return r = r || n,
  27142. r = Math.max(0, Math.min(r, 360)),
  27143. n = Math.max(0, Math.min(n, 360)),
  27144. _.copyVector(i, c),
  27145. b.getRelativeDirection(e.quaternion, c),
  27146. s ? (u.setFromUnitVectors(c, h),
  27147. d(t, function(e) {
  27148. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27149. }, o)) : d(t, function(e) {
  27150. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27151. }, o)
  27152. }
  27153. ),
  27154. b.isTileWithinFrustum = (E = new _.Vector3,
  27155. function(e, t, i, n, r, o, a, s) {
  27156. 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++)
  27157. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27158. _.applyQuaternionToVector(o, E),
  27159. -1e-5 <= E.z)
  27160. ;
  27161. else {
  27162. var A = -1 / E.z
  27163. , C = E.x * A
  27164. , I = E.y * A;
  27165. l < I ? p++ : I < c && f++,
  27166. h < C ? g++ : C < u && m++,
  27167. v++
  27168. }
  27169. return f !== v && p !== v && g !== v && m !== v
  27170. }
  27171. ),
  27172. b.isTileWithinFOV = (p = new _.Vector3,
  27173. f = new _.Vector3(0,1,0),
  27174. g = new _.Vector3(1,0,0),
  27175. function(e, t, i, n, r, o, a) {
  27176. var s = b.mapFaceToCubemapFace(i);
  27177. if (_.cross(o, f, g),
  27178. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27179. b.isWithinFOV(p, o, a, null))
  27180. return !0;
  27181. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27182. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27183. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27184. b.isWithinFOV(p, o, a, null))
  27185. return !0;
  27186. h += l
  27187. }
  27188. return !1
  27189. }
  27190. ),
  27191. b.isWithinFOV = (a = new _.Vector3,
  27192. s = new _.Vector3,
  27193. function(e, t, i, n) {
  27194. if (_.copyVector(e, s),
  27195. n) {
  27196. _.copyVector(n, a),
  27197. _.normalize(a);
  27198. var r = _.dot(a, e);
  27199. a.x *= r,
  27200. a.y *= r,
  27201. a.z *= r,
  27202. _.subVector(s, a)
  27203. }
  27204. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27205. return Math.cos(o) <= _.dot(s, t)
  27206. }
  27207. ),
  27208. b.mapFaceToCubemapFace = (n = {
  27209. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27210. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27211. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27212. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27213. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27214. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27215. },
  27216. function(e) {
  27217. return n[e]
  27218. }
  27219. ),
  27220. t.exports = b
  27221. }
  27222. , {
  27223. "../enum/GLCubeFaces": 25,
  27224. "../util/MathLight": 176
  27225. }],
  27226. 175: [function(i, n, e) {
  27227. (function(e) {
  27228. "use strict";
  27229. function t() {
  27230. this.list = [],
  27231. this.index = {},
  27232. Object.defineProperty(this, "length", {
  27233. get: function() {
  27234. return this.list.length
  27235. }
  27236. })
  27237. }
  27238. new (i("./common"),
  27239. i("./logger"))(e),
  27240. t.prototype.forEach = function(e) {
  27241. this.list.forEach(e)
  27242. }
  27243. ,
  27244. t.prototype.add = function(e) {
  27245. this.list.push(e),
  27246. this.index[this.getIndex(e)] = e
  27247. }
  27248. ,
  27249. t.prototype.getIndex = function(e) {
  27250. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27251. }
  27252. ,
  27253. t.prototype.extend = function(e) {
  27254. for (var t = 0; t < e.length; t++)
  27255. this.add(e[t])
  27256. }
  27257. ,
  27258. t.prototype.get = function(e) {
  27259. return this.index[e]
  27260. }
  27261. ,
  27262. t.prototype.first = function() {
  27263. return this.list[0]
  27264. }
  27265. ,
  27266. t.prototype.last = function() {
  27267. return this.list[this.list.length - 1]
  27268. }
  27269. ,
  27270. t.prototype.reIndex = function() {
  27271. this.index = {};
  27272. var t = this;
  27273. this.forEach(function(e) {
  27274. t.index[t.getIndex(e)] = e
  27275. })
  27276. }
  27277. ,
  27278. t.prototype.filter = function(e) {
  27279. var t = this.list.filter(e);
  27280. return this.reIndex(),
  27281. t
  27282. }
  27283. ,
  27284. t.prototype.reduce = function(e, t) {
  27285. return this.list.reduce(e, t)
  27286. }
  27287. ,
  27288. t.prototype.sort = function(e) {
  27289. return this.list.sort(e)
  27290. }
  27291. ,
  27292. t.prototype.indexOf = function(e) {
  27293. for (var t = 0; t < this.list.length; ++t)
  27294. if (this.list[t] === e)
  27295. return t;
  27296. return -1
  27297. }
  27298. ,
  27299. n.exports = t
  27300. }
  27301. ).call(this, "/js/util/IndexedCollection.js")
  27302. }
  27303. , {
  27304. "./common": 185,
  27305. "./logger": 189
  27306. }],
  27307. 176: [function(e, t, i) {
  27308. "use strict";
  27309. e("../constants");
  27310. var n, r, o = {};
  27311. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27312. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27313. o.Vector3 = function(e, t, i) {
  27314. this.x = e || 0,
  27315. this.y = t || 0,
  27316. this.z = i || 0
  27317. }
  27318. ,
  27319. o.Matrix4 = function() {
  27320. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27321. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27322. }
  27323. ,
  27324. o.Matrix4.prototype = {
  27325. identity: function() {
  27326. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27327. this
  27328. },
  27329. copy: function(e) {
  27330. return this.elements.set(e.elements),
  27331. this
  27332. },
  27333. applyToVector3: function(e) {
  27334. var t = e.x
  27335. , i = e.y
  27336. , n = e.z
  27337. , r = this.elements;
  27338. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27339. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27340. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27341. this
  27342. },
  27343. getInverse: function(e, t) {
  27344. var i = this.elements
  27345. , n = e.elements
  27346. , r = n[0]
  27347. , o = n[1]
  27348. , a = n[2]
  27349. , s = n[3]
  27350. , l = n[4]
  27351. , c = n[5]
  27352. , h = n[6]
  27353. , u = n[7]
  27354. , d = n[8]
  27355. , p = n[9]
  27356. , f = n[10]
  27357. , g = n[11]
  27358. , m = n[12]
  27359. , v = n[13]
  27360. , y = n[14]
  27361. , A = n[15]
  27362. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27363. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27364. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27365. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27366. , b = r * C + o * I + a * E + s * _;
  27367. if (0 == b) {
  27368. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27369. if (t)
  27370. throw new Error(w);
  27371. return console.warn(w),
  27372. this.identity()
  27373. }
  27374. var T = 1 / b;
  27375. return i[0] = C * T,
  27376. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27377. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27378. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27379. i[4] = I * T,
  27380. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27381. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27382. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27383. i[8] = E * T,
  27384. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27385. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27386. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27387. i[12] = _ * T,
  27388. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27389. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27390. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27391. this
  27392. },
  27393. makeRotationFromQuaternion: function(e) {
  27394. var t = this.elements
  27395. , i = e.x
  27396. , n = e.y
  27397. , r = e.z
  27398. , o = e.w
  27399. , a = i + i
  27400. , s = n + n
  27401. , l = r + r
  27402. , c = i * a
  27403. , h = i * s
  27404. , u = i * l
  27405. , d = n * s
  27406. , p = n * l
  27407. , f = r * l
  27408. , g = o * a
  27409. , m = o * s
  27410. , v = o * l;
  27411. return t[0] = 1 - (d + f),
  27412. t[4] = h - v,
  27413. t[8] = u + m,
  27414. t[1] = h + v,
  27415. t[5] = 1 - (c + f),
  27416. t[9] = p - g,
  27417. t[2] = u - m,
  27418. t[6] = p + g,
  27419. t[10] = 1 - (c + d),
  27420. t[3] = 0,
  27421. t[7] = 0,
  27422. t[11] = 0,
  27423. t[12] = 0,
  27424. t[13] = 0,
  27425. t[14] = 0,
  27426. t[15] = 1,
  27427. this
  27428. }
  27429. },
  27430. o.Quaternion = function(e, t, i, n) {
  27431. this._x = e || 0,
  27432. this._y = t || 0,
  27433. this._z = i || 0,
  27434. this._w = void 0 !== n ? n : 1
  27435. }
  27436. ,
  27437. o.Quaternion.prototype = {
  27438. get x() {
  27439. return this._x
  27440. },
  27441. set x(e) {
  27442. this._x = e
  27443. },
  27444. get y() {
  27445. return this._y
  27446. },
  27447. set y(e) {
  27448. this._y = e
  27449. },
  27450. get z() {
  27451. return this._z
  27452. },
  27453. set z(e) {
  27454. this._z = e
  27455. },
  27456. get w() {
  27457. return this._w
  27458. },
  27459. set w(e) {
  27460. this._w = e
  27461. },
  27462. copy: function(e) {
  27463. this._x = e.x,
  27464. this._y = e.y,
  27465. this._z = e.z,
  27466. this._w = e.w
  27467. },
  27468. inverse: function() {
  27469. return this.conjugate().normalize()
  27470. },
  27471. conjugate: function() {
  27472. return this._x *= -1,
  27473. this._y *= -1,
  27474. this._z *= -1,
  27475. this
  27476. },
  27477. length: function() {
  27478. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27479. },
  27480. normalize: function() {
  27481. var e = this.length();
  27482. return 0 === e ? (this._x = 0,
  27483. this._y = 0,
  27484. this._z = 0,
  27485. this._w = 1) : (e = 1 / e,
  27486. this._x = this._x * e,
  27487. this._y = this._y * e,
  27488. this._z = this._z * e,
  27489. this._w = this._w * e),
  27490. this
  27491. },
  27492. setFromAxisAngle: function(e, t) {
  27493. var i = t / 2
  27494. , n = Math.sin(i);
  27495. return this._x = e.x * n,
  27496. this._y = e.y * n,
  27497. this._z = e.z * n,
  27498. this._w = Math.cos(i),
  27499. this
  27500. },
  27501. setFromUnitVectors: function(e, t) {
  27502. return void 0 === n && (n = new o.Vector3),
  27503. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27504. 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),
  27505. this._x = n.x,
  27506. this._y = n.y,
  27507. this._z = n.z,
  27508. this._w = r,
  27509. this.normalize()
  27510. },
  27511. multiply: function(e) {
  27512. return this.multiplyQuaternions(this, e)
  27513. },
  27514. premultiply: function(e) {
  27515. return this.multiplyQuaternions(e, this)
  27516. },
  27517. multiplyQuaternions: function(e, t) {
  27518. var i = e._x
  27519. , n = e._y
  27520. , r = e._z
  27521. , o = e._w
  27522. , a = t._x
  27523. , s = t._y
  27524. , l = t._z
  27525. , c = t._w;
  27526. return this._x = i * c + o * a + n * l - r * s,
  27527. this._y = n * c + o * s + r * a - i * l,
  27528. this._z = r * c + o * l + i * s - n * a,
  27529. this._w = o * c - i * a - n * s - r * l,
  27530. this
  27531. }
  27532. },
  27533. o.convertWorkshopVector = function(e) {
  27534. return new o.Vector3(-e.x,e.y,e.z)
  27535. }
  27536. ,
  27537. o.convertWorkshopQuaternion = function(e) {
  27538. 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))
  27539. }
  27540. ,
  27541. o.convertWorkshopOrthoZoom = function(e) {
  27542. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27543. }
  27544. ,
  27545. o.convertWorkshopPanoramaQuaternion = function(e) {
  27546. 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))
  27547. }
  27548. ,
  27549. o.normalize = function(e) {
  27550. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27551. , i = Math.sqrt(t);
  27552. e.x /= i,
  27553. e.y /= i,
  27554. e.z /= i
  27555. }
  27556. ,
  27557. o.dot = function(e, t) {
  27558. return e.x * t.x + e.y * t.y + e.z * t.z
  27559. }
  27560. ,
  27561. o.cross = function(e, t, i) {
  27562. var n = e.x
  27563. , r = e.y
  27564. , o = e.z;
  27565. i.x = r * t.z - o * t.y,
  27566. i.y = o * t.x - n * t.z,
  27567. i.z = n * t.y - r * t.x
  27568. }
  27569. ,
  27570. o.setVector = function(e, t, i, n) {
  27571. e.x = t,
  27572. e.y = i,
  27573. e.z = n
  27574. }
  27575. ,
  27576. o.copyVector = function(e, t) {
  27577. t.x = e.x,
  27578. t.y = e.y,
  27579. t.z = e.z
  27580. }
  27581. ,
  27582. o.addVector = function(e, t) {
  27583. e.x += t.x,
  27584. e.y += t.y,
  27585. e.z += t.z
  27586. }
  27587. ,
  27588. o.subVector = function(e, t) {
  27589. e.x -= t.x,
  27590. e.y -= t.y,
  27591. e.z -= t.z
  27592. }
  27593. ,
  27594. o.applyQuaternionToVector = function(e, t) {
  27595. var i = t.x
  27596. , n = t.y
  27597. , r = t.z
  27598. , o = e.x
  27599. , a = e.y
  27600. , s = e.z
  27601. , l = e.w
  27602. , c = l * i + a * r - s * n
  27603. , h = l * n + s * i - o * r
  27604. , u = l * r + o * n - a * i
  27605. , d = -o * i - a * n - s * r;
  27606. t.x = c * l + d * -o + h * -s - u * -a,
  27607. t.y = h * l + d * -a + u * -o - c * -s,
  27608. t.z = u * l + d * -s + c * -a - h * -o
  27609. }
  27610. ,
  27611. o.angleBetweenVectors = function(e, t) {
  27612. return Math.acos(o.dot(e, t))
  27613. }
  27614. ,
  27615. t.exports = o
  27616. }
  27617. , {
  27618. "../constants": 8
  27619. }],
  27620. 177: [function(c, h, e) {
  27621. (function(e) {
  27622. "use strict";
  27623. function t(e) {
  27624. this.cache = null,
  27625. this.expires = 0
  27626. }
  27627. function i() {
  27628. this.baseUrl = null,
  27629. this.cache = null,
  27630. this.expires = 0
  27631. }
  27632. function n() {
  27633. this.baseUrl = null,
  27634. this.expires = 0
  27635. }
  27636. function r(e) {
  27637. this.initialLoadingPromise = null,
  27638. this.endpoint = e + "?type=3",
  27639. this.urlContainer = null,
  27640. this.authorizationHeader = s.getAuthorizationHeader(),
  27641. this.containerClasses = [n, i, t]
  27642. }
  27643. c("./ajax");
  27644. var o = c("./logger")
  27645. , a = c("../constants")
  27646. , s = c("./showcase")
  27647. , l = (c("../ab"),
  27648. new o(e));
  27649. t.prototype = {
  27650. version: 1,
  27651. validate: function(e) {
  27652. return "catalog.json"in e && 0 < Object.keys(e).length
  27653. },
  27654. update: function(e) {
  27655. return this.cache = e,
  27656. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27657. $.when()
  27658. },
  27659. get: function(e) {
  27660. return this.cache[e]
  27661. }
  27662. },
  27663. i.prototype = {
  27664. version: 2,
  27665. validate: function(e) {
  27666. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27667. },
  27668. update: function(e) {
  27669. return this.baseUrl = e["base.url"],
  27670. this.cache = e,
  27671. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27672. $.when()
  27673. },
  27674. get: function(e) {
  27675. var t = this.cache[e];
  27676. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27677. }
  27678. },
  27679. n.prototype = {
  27680. version: 3,
  27681. validate: function(e) {
  27682. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27683. },
  27684. update: function(e) {
  27685. return this.baseUrl = e.templates[0],
  27686. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27687. $.when()
  27688. },
  27689. get: function(e) {
  27690. return this.baseUrl.replace("{{filename}}", e)
  27691. }
  27692. },
  27693. r.prototype = {
  27694. init: function() {
  27695. return this.initialLoadingPromise || (setInterval(function() {
  27696. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27697. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27698. this.refresh().done(function() {
  27699. l.debug("Refreshed")
  27700. }).fail(function() {
  27701. l.error("Failed url refresh, urls might go stale soon")
  27702. }))
  27703. }
  27704. .bind(this), a.signedUrlCheckInterval),
  27705. this.initialLoadingPromise = this.refresh()),
  27706. this.initialLoadingPromise
  27707. },
  27708. refresh: function(e) {
  27709. return {},
  27710. $.Deferred().resolve()
  27711. },
  27712. get: function(e) {
  27713. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27714. }
  27715. },
  27716. h.exports = r
  27717. }
  27718. ).call(this, "/js/util/ModelUrls.js")
  27719. }
  27720. , {
  27721. "../ab": 3,
  27722. "../constants": 8,
  27723. "./ajax": 181,
  27724. "./logger": 189,
  27725. "./showcase": 193
  27726. }],
  27727. 178: [function(l, c, e) {
  27728. (function(e) {
  27729. "use strict";
  27730. function t() {
  27731. i.call(this),
  27732. this.neighbourMap = {},
  27733. this.map = null
  27734. }
  27735. 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"),
  27736. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27737. n.inherit(t, i),
  27738. t.prototype.getIndex = function(e) {
  27739. return e.id
  27740. }
  27741. ,
  27742. t.prototype.find = function(e, t) {
  27743. var i = n.filterAll(this.list, e);
  27744. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27745. i = n.stableSort(i, e)
  27746. }),
  27747. i[0])
  27748. }
  27749. ,
  27750. t.prototype.sortByScore = function(e, t) {
  27751. var i = n.filterAll(this.list, e);
  27752. return 0 === i.length ? null : i = i.map(function(i) {
  27753. return {
  27754. pano: i,
  27755. score: t.reduce(function(e, t) {
  27756. return e + t(i)
  27757. }, 0)
  27758. }
  27759. }).sort(function(e, t) {
  27760. return t.score - e.score
  27761. })
  27762. }
  27763. ,
  27764. t.prototype.lowestByScore = function(e, t, i) {
  27765. return this.findRankedByScore(0, e, t, i)
  27766. }
  27767. ,
  27768. t.prototype.findRankedByScore = function(e, t, i, n) {
  27769. n && (n.candidates = null,
  27770. n.pano = null),
  27771. e = e || 0;
  27772. var r = this.sortByScore(t, i);
  27773. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27774. n.pano = r[e].pano),
  27775. r[e].pano)
  27776. }
  27777. ,
  27778. t.prototype.showPanoScores = function(e) {
  27779. this.list.forEach(function(e) {
  27780. e.removeTextSprite()
  27781. });
  27782. var t = 6344768;
  27783. e.forEach(function(e) {
  27784. e.pano.addTextSprite(e.score.toFixed(2), t),
  27785. t = 16428055
  27786. })
  27787. }
  27788. ,
  27789. t.prototype.isNeighbour = function(e, t) {
  27790. return this.neighbourMap[e.id][t.id]
  27791. }
  27792. ,
  27793. t.prototype.getNeighbours = function(e) {
  27794. return this.neighbourMap[e.id]
  27795. }
  27796. ,
  27797. t.prototype.setNeighbour = function(e, t, i) {
  27798. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27799. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27800. this.neighbourMap[e.id][e.id] = !0,
  27801. this.neighbourMap[t.id][t.id] = !0,
  27802. this.neighbourMap[e.id][t.id] = i,
  27803. this.neighbourMap[t.id][e.id] = i,
  27804. this.neighbourMap[e.id]
  27805. }
  27806. ,
  27807. t.prototype.findClosest = function(e, t) {
  27808. var i = [r.filters.isPanoAligned()];
  27809. return t && i.push(r.filters.inDirection(e, t, .75)),
  27810. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27811. }
  27812. ,
  27813. t.prototype.dualNeighbors = function(e, t) {
  27814. var i, n = [];
  27815. for (i in this.neighbourMap[e.id])
  27816. this.neighbourMap[t.id][i] && n.push(i);
  27817. return n
  27818. }
  27819. ,
  27820. t.prototype.populate_path_graph = function() {
  27821. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27822. for (e = 0; e < this.list.length; e += 1) {
  27823. for (t in s = !(a = {}),
  27824. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27825. if (i[t]) {
  27826. o = this.index[t],
  27827. u.copy(r.floorPosition),
  27828. u.sub(o.floorPosition);
  27829. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27830. , p = (Math.abs(u.y),
  27831. Math.max(d, .01),
  27832. Math.max(0, Math.abs(u.y) - .2));
  27833. n = 0 < p ? (1,
  27834. p = Math.pow(4 * p, 2),
  27835. d = Math.pow(d, 2),
  27836. Math.sqrt(p * p + d * d)) : (1,
  27837. u.length()),
  27838. a[o.id] = n,
  27839. s = !0
  27840. }
  27841. s ? c[r.id] = a : h += 1
  27842. }
  27843. this.map = c,
  27844. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27845. }
  27846. ,
  27847. t.prototype.aStarSearch = function(e, t) {
  27848. var i = Date.now()
  27849. , n = new o({
  27850. start: e,
  27851. isEnd: function(e) {
  27852. return e === t
  27853. },
  27854. neighbor: function(e) {
  27855. var t = e.neighbourPanos || e.findNeighourPanos()
  27856. , i = [];
  27857. for (var n in t)
  27858. i.push(this.index[n]);
  27859. return i
  27860. }
  27861. .bind(this),
  27862. distance: function(e, t) {
  27863. return this.map[e.id][t.id]
  27864. }
  27865. .bind(this),
  27866. heuristic: function(e, t) {
  27867. return 1
  27868. }
  27869. .bind(this),
  27870. hash: function(e) {
  27871. return e.id
  27872. },
  27873. timeout: 5e3
  27874. });
  27875. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27876. "success" !== n.status)
  27877. return T.debug("Did not find A* path from " + e + " to " + t),
  27878. null;
  27879. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27880. var r = [];
  27881. return n.path.forEach(function(e) {
  27882. r.push(e.id)
  27883. }),
  27884. r
  27885. }
  27886. ,
  27887. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27888. g = new w.Vector3,
  27889. m = new w.Vector3,
  27890. v = new w.Vector3,
  27891. y = new w.Vector3,
  27892. A = new w.Vector3,
  27893. C = new w.Vector3,
  27894. I = new w.Vector3,
  27895. E = [],
  27896. _ = new w.Vector3,
  27897. b = new w.Vector3,
  27898. function(e, t) {
  27899. if (e)
  27900. for (var i = function(e, t, i) {
  27901. return y.copy(t).sub(e),
  27902. y.dot(i)
  27903. }, n = function(e, t) {
  27904. return i(_, e.position, m) - i(_, t.position, m)
  27905. }, r = 0; r < e.length - 1; ) {
  27906. var o = e[r]
  27907. , a = e[r + 1]
  27908. , s = this.index[o]
  27909. , l = this.index[a];
  27910. _.copy(s.position),
  27911. b.copy(l.position),
  27912. E.length = 0,
  27913. f.copy(b).sub(_),
  27914. m.copy(f).normalize();
  27915. for (var c = 0; c < this.list.length; c++) {
  27916. var h = this.list[c];
  27917. y.copy(h.position).sub(_);
  27918. var u = y.dot(m);
  27919. 0 < u && (C.copy(m),
  27920. C.multiplyScalar(u),
  27921. A.copy(y),
  27922. A.sub(C),
  27923. A.length() < t && (g.copy(f).negate(),
  27924. v.copy(g).normalize(),
  27925. I.copy(h.position).sub(b),
  27926. 0 < I.dot(v) && E.push(h)))
  27927. }
  27928. if (0 < E.length) {
  27929. E.sort(n);
  27930. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27931. e[d] = e[d - E.length];
  27932. for (var p = 0; p < E.length; p++)
  27933. e[p + r + 1] = E[p].id
  27934. }
  27935. r += E.length + 1
  27936. }
  27937. }
  27938. ),
  27939. t.prototype.fadeMarkerOpacity = function(e, t) {
  27940. var i = void 0 === e ? a.panorama.markerOpacity : e
  27941. , n = this.list.findIndex(function(e) {
  27942. return e.marker
  27943. });
  27944. if (!(n < 0)) {
  27945. var r = this.list[n].marker.material.opacity;
  27946. if (r !== e) {
  27947. var o = i - r;
  27948. s.trigger({
  27949. func: function(e, t) {
  27950. var i = r + e * o;
  27951. this.forEach(function(e) {
  27952. e.marker && (e.marker.material.opacity = i)
  27953. })
  27954. }
  27955. .bind(this),
  27956. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27957. name: "_fpm"
  27958. })
  27959. }
  27960. }
  27961. }
  27962. ,
  27963. c.exports = t
  27964. }
  27965. ).call(this, "/js/util/PanoramaCollection.js")
  27966. }
  27967. , {
  27968. "../objects/Panorama": 148,
  27969. "../settings": 166,
  27970. "./IndexedCollection": 175,
  27971. "./aStar": 180,
  27972. "./common": 185,
  27973. "./logger": 189,
  27974. "./transitions": 195,
  27975. three: 217
  27976. }],
  27977. 179: [function(e, t, i) {
  27978. "use strict";
  27979. function n() {
  27980. this.actionSequence = [],
  27981. this.actionSequenceInProgress = !1
  27982. }
  27983. function r(e, t, i, n) {
  27984. c.trackAlways("zoom_" + e, {
  27985. from: t,
  27986. to: i,
  27987. pano: n
  27988. })
  27989. }
  27990. var o, a, s, l, c = e("../analytics");
  27991. n.prototype.reset = function(e) {
  27992. this.actionSequenceInProgress = !1,
  27993. this.actionSequence.length = 0
  27994. }
  27995. ,
  27996. n.prototype.addZoomAction = (a = o = null,
  27997. s = !1,
  27998. l = function() {
  27999. if (o = null,
  28000. 0 < this.actionSequence.length) {
  28001. var e = this.actionSequence[0].start
  28002. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28003. 1 === e ? function(e, t) {
  28004. r("initial", 1, e, t)
  28005. }(t, a) : function(e, t, i) {
  28006. r("followup", e, t, i)
  28007. }(e, t, a)
  28008. }
  28009. this.reset()
  28010. }
  28011. ,
  28012. function(e, t, i) {
  28013. if (e !== t) {
  28014. s || (l = l.bind(this),
  28015. s = !0),
  28016. o && (window.clearTimeout(o),
  28017. o = null),
  28018. i === a && this.actionSequenceInProgress || (this.reset(),
  28019. a = i),
  28020. this.actionSequenceInProgress = !0;
  28021. var n = {
  28022. start: e,
  28023. end: t
  28024. };
  28025. this.actionSequence.push(n),
  28026. o = window.setTimeout(l, 150)
  28027. }
  28028. }
  28029. ),
  28030. t.exports = n
  28031. }
  28032. , {
  28033. "../analytics": 4
  28034. }],
  28035. 180: [function(e, t, i) {
  28036. "use strict";
  28037. function g(e) {
  28038. if (void 0 === e.parent)
  28039. return [e.data];
  28040. var t = g(e.parent);
  28041. return t.push(e.data),
  28042. t
  28043. }
  28044. function m(e) {
  28045. return e.toString()
  28046. }
  28047. function v(e, t) {
  28048. return e.f - t.f
  28049. }
  28050. var y = e("Set")
  28051. , A = e("heap")
  28052. , C = e("dict");
  28053. t.exports = function(e) {
  28054. void 0 === e.timeout && (e.timeout = 1 / 0);
  28055. var t = e.hash || m
  28056. , i = {
  28057. data: e.start,
  28058. g: 0,
  28059. h: e.heuristic(e.start)
  28060. }
  28061. , n = i;
  28062. i.f = i.h;
  28063. var r = new y
  28064. , o = new A(v)
  28065. , a = C();
  28066. o.push(i),
  28067. a.set(t(i.data), i);
  28068. for (var s = new Date; o.size(); ) {
  28069. if (new Date - s > e.timeout)
  28070. return {
  28071. status: "timeout",
  28072. cost: n.g,
  28073. path: g(n)
  28074. };
  28075. var l = o.pop();
  28076. if (a.delete(t(l.data)),
  28077. e.isEnd(l.data))
  28078. return {
  28079. status: "success",
  28080. cost: l.g,
  28081. path: g(l)
  28082. };
  28083. r.add(t(l.data));
  28084. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28085. var u = c[h];
  28086. if (!r.contains(t(u))) {
  28087. var d = l.g + e.distance(l.data, u)
  28088. , p = a.get(t(u))
  28089. , f = !1;
  28090. if (void 0 === p)
  28091. p = {
  28092. data: u
  28093. },
  28094. a.set(t(u), p);
  28095. else {
  28096. if (p.g < d)
  28097. continue;
  28098. f = !0
  28099. }
  28100. p.parent = l,
  28101. p.g = d,
  28102. p.h = e.heuristic(u),
  28103. p.f = d + p.h,
  28104. p.h < n.h && (n = p),
  28105. f ? o.heapify() : o.push(p)
  28106. }
  28107. }
  28108. }
  28109. return {
  28110. status: "noPath",
  28111. cost: n.g,
  28112. path: g(n)
  28113. }
  28114. }
  28115. }
  28116. , {
  28117. Set: 196,
  28118. dict: 210,
  28119. heap: 211
  28120. }],
  28121. 181: [function(i, n, e) {
  28122. (function(e) {
  28123. "use strict";
  28124. function s(e, t, i) {
  28125. function n() {
  28126. l.warn("Retrying ", t),
  28127. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28128. }
  28129. var r = function(e, t, i) {
  28130. var n = new XMLHttpRequest;
  28131. if (i && "withCredentials"in n)
  28132. n.open(e, t, i);
  28133. else if ("undefined" != typeof XDomainRequest)
  28134. (n = new XDomainRequest).open(e, t);
  28135. else {
  28136. if (i)
  28137. throw "Browser does not support CORS!";
  28138. n.open(e, t)
  28139. }
  28140. return n
  28141. }(e, t, !1);
  28142. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28143. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28144. i.responseType)
  28145. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28146. r.responseType = i.responseType;
  28147. else {
  28148. if ("image/jpeg" !== i.responseType)
  28149. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28150. r.responseType = "arraybuffer"
  28151. }
  28152. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28153. i.auth && r.setRequestHeader("Authorization", i.auth),
  28154. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28155. r.setRequestHeader("Content-Type", "application/json")),
  28156. "object" == typeof i.headers)
  28157. for (var o in i.headers)
  28158. r.setRequestHeader(o, i.headers[o]);
  28159. var a = $.Deferred();
  28160. return r.onreadystatechange = function(e) {
  28161. if (4 === this.readyState)
  28162. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28163. i.retries++,
  28164. setTimeout(n, 1e3);
  28165. else if (200 === this.status) {
  28166. var t = function(e, t) {
  28167. var i = e.response;
  28168. if ("json" === t && "object" != typeof i)
  28169. try {
  28170. i = JSON.parse(e.responseText)
  28171. } catch (e) {
  28172. return void a.reject({
  28173. error: "Failed parsing JSON"
  28174. })
  28175. }
  28176. else if ("image/jpeg" === t) {
  28177. var n = new Uint8Array(e.response)
  28178. , r = new Blob([n],{
  28179. type: "image/jpeg"
  28180. })
  28181. , o = URL.createObjectURL(r);
  28182. (i = new Image).src = o,
  28183. i.crossOrigin = "Anonymous",
  28184. i.onload = function() {
  28185. URL.revokeObjectURL(o)
  28186. }
  28187. }
  28188. return i
  28189. }(this, i.responseType);
  28190. a.resolve(t)
  28191. } else
  28192. a.reject(this)
  28193. }
  28194. ,
  28195. r.onprogress = function(e) {
  28196. a.notify(e)
  28197. }
  28198. ,
  28199. r.send(i.data),
  28200. a.promise()
  28201. }
  28202. function o(e, t) {
  28203. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28204. return t.headers && function(t) {
  28205. return Object.keys(t).sort().map(function(e) {
  28206. return {
  28207. key: e,
  28208. value: t[e]
  28209. }
  28210. })
  28211. }(t.headers).forEach(function(e) {
  28212. i += "__" + e.key + ":" + e.value
  28213. }),
  28214. i
  28215. }
  28216. var t = i("./logger")
  28217. , a = i("../ab")
  28218. , l = new t(e);
  28219. window.URL = window.URL || window.webkitURL,
  28220. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28221. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28222. n.exports = {
  28223. get: function(e, t) {
  28224. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28225. if (n) {
  28226. var r = function(e, t) {
  28227. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28228. }(e, t);
  28229. if (r)
  28230. return r
  28231. }
  28232. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28233. n && function(e, t, i) {
  28234. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28235. }(e, t, i),
  28236. i
  28237. },
  28238. post: function(e, t) {
  28239. return s("POST", e, t)
  28240. },
  28241. patch: function(e, t) {
  28242. return s("PATCH", e, t)
  28243. },
  28244. getImage: function(e, t) {
  28245. function i() {
  28246. l.warn("Retrying ", e),
  28247. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28248. }
  28249. var n = $.Deferred()
  28250. , r = new Image
  28251. , o = this;
  28252. return e = a.changeIfImageOptimzing(e),
  28253. null != t || (t = 3),
  28254. r.onerror = function() {
  28255. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28256. }
  28257. ,
  28258. r.onload = function() {
  28259. n.resolve(r)
  28260. }
  28261. ,
  28262. r.crossOrigin = "anonymous",
  28263. r.src = e,
  28264. n
  28265. }
  28266. }
  28267. }
  28268. ).call(this, "/js/util/ajax.js")
  28269. }
  28270. , {
  28271. "../ab": 3,
  28272. "./logger": 189
  28273. }],
  28274. 182: [function(e, t, i) {
  28275. "use strict";
  28276. function n(e, t) {
  28277. var i = window.navigator.userAgent.match(e);
  28278. return i = i ? i[1].split(t) : [],
  28279. {
  28280. major: parseInt(i[0]) || 0,
  28281. minor: parseInt(i[1]) || 0,
  28282. patch: parseInt(i[2]) || 0
  28283. }
  28284. }
  28285. var r = e("../exception/DeviceMismatchException");
  28286. t.exports = {
  28287. isFullscreen: function() {
  28288. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28289. },
  28290. supportsFullscreen: function() {
  28291. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28292. },
  28293. isPointerLocked: function() {
  28294. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28295. },
  28296. requestFullscreen: function(e, t) {
  28297. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28298. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28299. },
  28300. requestPointerLock: function() {
  28301. var e;
  28302. if (document.fullscreenElement)
  28303. e = document.fullscreenElement();
  28304. else if (document.mozFullscreenElement)
  28305. e = document.mozFullscreenElement();
  28306. else if (document.mozFullScreenElement)
  28307. e = document.mozFullScreenElement();
  28308. else {
  28309. if (!document.webkitFullscreenElement)
  28310. return;
  28311. e = document.webkitFullscreenElement()
  28312. }
  28313. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28314. e.requestPointerLock(),
  28315. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28316. },
  28317. exitPointerLock: function() {
  28318. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28319. document.exitPointerLock()
  28320. },
  28321. exitFullscreen: function() {
  28322. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28323. },
  28324. details: function() {
  28325. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28326. return e ? {
  28327. name: e[1],
  28328. version: parseInt(e[2]),
  28329. platform: navigator.platform
  28330. } : {}
  28331. },
  28332. is: function(e) {
  28333. return this.details() && this.details().name === e
  28334. },
  28335. inIframe: function() {
  28336. return window.parent !== window
  28337. },
  28338. aspectRatio: function() {
  28339. var e = $("#player").width() / $("#player").height();
  28340. return isFinite(e) ? e : 0
  28341. },
  28342. userAgent: function() {
  28343. return window.navigator.userAgent
  28344. },
  28345. isMobile: function() {
  28346. var e = navigator.userAgent || navigator.vendor || window.opera;
  28347. 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))
  28348. },
  28349. isLandscape: function() {
  28350. return this.isMobile && 1 < this.aspectRatio()
  28351. },
  28352. isSmallScreen: function() {
  28353. return screen.width / window.devicePixelRatio < 240
  28354. },
  28355. detectIE: function() {
  28356. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28357. },
  28358. detectSafari: function() {
  28359. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28360. },
  28361. detectFirefox: function() {
  28362. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28363. },
  28364. detectChrome: function() {
  28365. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28366. },
  28367. detectOpera: function() {
  28368. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28369. },
  28370. detectIOS: function() {
  28371. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28372. },
  28373. detectIPad: function() {
  28374. var e = window.navigator.userAgent;
  28375. return /iPad/.test(e)
  28376. },
  28377. detectIPod: function() {
  28378. var e = window.navigator.userAgent;
  28379. return /iPod/.test(e)
  28380. },
  28381. detectIPhone: function() {
  28382. var e = window.navigator.userAgent;
  28383. return /iPhone/.test(e)
  28384. },
  28385. detectAndroid: function() {
  28386. return -1 !== window.navigator.userAgent.indexOf("Android")
  28387. },
  28388. detectAndroidMobile: function() {
  28389. var e = window.navigator.userAgent;
  28390. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28391. },
  28392. detectSamsungNative: function() {
  28393. var e = window.navigator.userAgent;
  28394. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28395. },
  28396. detectSamsungS6: function() {
  28397. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28398. },
  28399. detectHUAWEI5X: function() {
  28400. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28401. },
  28402. detectWebVR: function() {
  28403. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28404. },
  28405. getVRDisplay: function() {
  28406. var t = $.Deferred();
  28407. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28408. 1 <= e.length && t.resolve(e[0]),
  28409. t.reject(null)
  28410. }),
  28411. t) : t.reject(null)
  28412. },
  28413. iosVersion: function() {
  28414. if (!this.detectIOS())
  28415. throw new r("Did not detect an iDevice");
  28416. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28417. },
  28418. androidVersion: function() {
  28419. if (!this.detectAndroid())
  28420. throw new r("Did not detect an Android based device");
  28421. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28422. },
  28423. valueFromCookie: function(e, t) {
  28424. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28425. if (!i)
  28426. return t;
  28427. var n = i[1];
  28428. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28429. },
  28430. valueFromHash: function(e, t) {
  28431. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28432. if (!i)
  28433. return t;
  28434. var n = i[1];
  28435. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28436. }
  28437. }
  28438. }
  28439. , {
  28440. "../exception/DeviceMismatchException": 56
  28441. }],
  28442. 183: [function(i, n, e) {
  28443. (function(e) {
  28444. "use strict";
  28445. var o = i("../controls/serializer")
  28446. , a = i("../util/math")
  28447. , s = i("./browser")
  28448. , l = i("../enum/Viewmode")
  28449. , t = i("../util/logger")
  28450. , c = i("three")
  28451. , h = new t(e);
  28452. n.exports = {
  28453. getStartCameraOptions: function(e, t) {
  28454. var i = function(e) {
  28455. var t = s.valueFromHash("start", "")
  28456. , i = {};
  28457. if ("" !== t) {
  28458. h.debug("Start override found in parameters, trying to parse..."),
  28459. i = function(e) {
  28460. return o.deserialize(e)
  28461. }(t) || {};
  28462. var n = s.valueFromHash("tag", null);
  28463. n && (i.tag = n),
  28464. i.panoId && (i.pano = e.get(i.panoId))
  28465. }
  28466. return i
  28467. }(t);
  28468. if (0 < Object.keys(i).length)
  28469. return i;
  28470. if (e.heroImage)
  28471. i = function(e, t) {
  28472. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28473. return {};
  28474. var i = {}
  28475. , n = e.heroImage.metadata;
  28476. h.debug("Using start position from thumbnail image"),
  28477. i.position = n.camera_position,
  28478. i.quaternion = n.camera_quaternion;
  28479. try {
  28480. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28481. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28482. } catch (e) {
  28483. h.debug(e.message)
  28484. }
  28485. return i
  28486. }(e, t);
  28487. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28488. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28489. try {
  28490. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28491. i.position = (new c.Vector3).fromArray(n.camera.position),
  28492. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28493. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28494. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28495. h.debug("Using camera_start"),
  28496. h.debug("Modeldata pano: ", i.pano.quaternion),
  28497. h.debug("Camera start pano: ", n.pano.quaternion)),
  28498. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28499. } catch (e) {
  28500. h.warn(e.message)
  28501. if(i.mode == "panorama" && !i.pano){
  28502. i.pano = t.list[0]
  28503. }
  28504. }
  28505. }
  28506. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28507. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28508. i.pano = t.findClosest(i.position) ,
  28509. i.quaternion = i.pano.quaternion),
  28510. 0 === Object.keys(i).length) {
  28511. var r = t.list[0];
  28512. r && (i.mode = l.PANORAMA,
  28513. i.pano = r,
  28514. i.position = r.position,
  28515. i.quaternion = r.quaternion,
  28516. h.info("Starting at 1st pano " + r.id))
  28517. }
  28518. return i.mode = i.mode || l.DOLLHOUSE,
  28519. i
  28520. }
  28521. }
  28522. }
  28523. ).call(this, "/js/util/camera.js")
  28524. }
  28525. , {
  28526. "../controls/serializer": 14,
  28527. "../enum/Viewmode": 51,
  28528. "../util/logger": 189,
  28529. "../util/math": 190,
  28530. "./browser": 182,
  28531. three: 217
  28532. }],
  28533. 184: [function(e, t, i) {
  28534. "use strict";
  28535. function r(e, t, i) {
  28536. var n = t
  28537. , r = i;
  28538. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28539. }
  28540. function o(e, t, i) {
  28541. var n = t
  28542. , r = i;
  28543. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28544. }
  28545. var a = e("./MathLight");
  28546. t.exports = {
  28547. clampVFOV: function(e, t, i, n) {
  28548. return t < r(e, i, n) ? o(t, i, n) : e
  28549. },
  28550. getHFOVForCamera: function(e, t, i) {
  28551. return r(e.fov, t, i)
  28552. },
  28553. getHFOVFromVFOV: r,
  28554. getVFOVFromHFOV: o
  28555. }
  28556. window.MathLight = t.exports
  28557. }
  28558. , {
  28559. "./MathLight": 176
  28560. }],
  28561. 185: [function(e, t, i) {
  28562. "use strict";
  28563. var a = e("three");
  28564. t.exports = {
  28565. delayOneFrame: function(e) {
  28566. window.setTimeout(e, 1)
  28567. },
  28568. normalizeUrl: function(e) {
  28569. return e.replace("https://", "http://")
  28570. },
  28571. domainFromUrl: function(e) {
  28572. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28573. return t ? t[3] : e
  28574. },
  28575. average: function(e, t) {
  28576. if (0 === e.length)
  28577. return null;
  28578. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28579. i += t ? e[r][t] : e[r],
  28580. n++
  28581. }
  28582. return i / n
  28583. },
  28584. countUnique: function(e) {
  28585. for (var t = {}, i = 0; i < e.length; i++)
  28586. t[e[i]] = 1 + (t[e[i]] || 0);
  28587. return Object.keys(t).length
  28588. },
  28589. averageVectors: function(e, t) {
  28590. var i = new a.Vector3;
  28591. if (0 === e.length)
  28592. return i;
  28593. for (var n = 0, r = 0; r < e.length; r++) {
  28594. var o = t ? e[r][t] : e[r];
  28595. i.add(o),
  28596. n++
  28597. }
  28598. return i.divideScalar(n)
  28599. },
  28600. equalLists: function(e, t) {
  28601. if (e.length !== t.length)
  28602. return !1;
  28603. for (var i = 0; i < e.length; i++)
  28604. if (e[i] !== t[i])
  28605. return !1;
  28606. return !0
  28607. },
  28608. lowerMedian: function(e, t) {
  28609. return 0 === e.length ? null : (t = t || 2,
  28610. e.sort(function(e, t) {
  28611. return e - t
  28612. }),
  28613. e[Math.floor(e.length / t)])
  28614. },
  28615. stableSort: function(e, n) {
  28616. return e.map(function(e, t) {
  28617. return {
  28618. value: e,
  28619. index: t
  28620. }
  28621. }).sort(function(e, t) {
  28622. var i = n(e.value, t.value);
  28623. return 0 !== i ? i : e.index - t.index
  28624. }).map(function(e) {
  28625. return e.value
  28626. })
  28627. },
  28628. filterAll: function(e, i) {
  28629. return e.filter(function(t) {
  28630. return i.every(function(e) {
  28631. return e(t)
  28632. })
  28633. })
  28634. },
  28635. formatDate: function(e) {
  28636. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28637. },
  28638. formatDatetime: function(e) {
  28639. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28640. },
  28641. randomString: function(e) {
  28642. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28643. t += i.charAt(Math.floor(Math.random() * i.length));
  28644. return t
  28645. },
  28646. uint8ToBase64: function(e, t) {
  28647. t && "number" == typeof t || (t = 8192);
  28648. for (var i = [], n = 0; n < e.length; n += t)
  28649. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28650. return btoa(i.join(""))
  28651. },
  28652. uuid4: function e(t) {
  28653. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28654. },
  28655. nth: function(e) {
  28656. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28657. },
  28658. extendObject: function(t, i) {
  28659. return Object.keys(i).forEach(function(e) {
  28660. t[e] = i[e]
  28661. }),
  28662. t
  28663. },
  28664. deepExtend: function e(t) {
  28665. t = t || {};
  28666. for (var i = 1; i < arguments.length; i++) {
  28667. var n = arguments[i];
  28668. if (n)
  28669. for (var r in n)
  28670. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28671. }
  28672. return t
  28673. },
  28674. inherit: function(e, t) {
  28675. e.prototype = Object.create(t.prototype),
  28676. e.prototype.constructor = e
  28677. },
  28678. extend: function(e, t) {
  28679. for (var i in t.prototype)
  28680. e.prototype[i] = t.prototype[i]
  28681. },
  28682. getVisiblePano : function(position, options={}){//add
  28683. var visiblePanos = [];
  28684. var B = position.clone();
  28685. var panos = options.panos || player.model.panos.list;
  28686. panos.forEach((pano)=>{
  28687. if(!pano.isAligned())return;
  28688. var A = pano.position.clone();
  28689. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  28690. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  28691. if (!o || !o.length)visiblePanos.push(pano );
  28692. })
  28693. return visiblePanos
  28694. }
  28695. },
  28696. Math.sign = function(e) {
  28697. return e < 0 ? -1 : 1
  28698. }
  28699. window.common = t.exports
  28700. }
  28701. , {
  28702. three: 217
  28703. }],
  28704. 186: [function(e, t, i) {
  28705. "use strict";
  28706. var r = {
  28707. linearTween: function(e, t, i, n) {
  28708. return i * e / n + t
  28709. },
  28710. easeInQuad: function(e, t, i, n) {
  28711. return i * (e /= n) * e + t
  28712. },
  28713. easeOutQuad: function(e, t, i, n) {
  28714. return -i * (e /= n) * (e - 2) + t
  28715. },
  28716. easeInOutQuad: function(e, t, i, n) {
  28717. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28718. },
  28719. easeInCubic: function(e, t, i, n) {
  28720. return i * (e /= n) * e * e + t
  28721. },
  28722. easeOutCubic: function(e, t, i, n) {
  28723. return e /= n,
  28724. i * (--e * e * e + 1) + t
  28725. },
  28726. easeInOutCubic: function(e, t, i, n) {
  28727. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28728. },
  28729. easeInQuart: function(e, t, i, n) {
  28730. return i * (e /= n) * e * e * e + t
  28731. },
  28732. easeOutQuart: function(e, t, i, n) {
  28733. return e /= n,
  28734. -i * (--e * e * e * e - 1) + t
  28735. },
  28736. easeInOutQuart: function(e, t, i, n) {
  28737. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28738. },
  28739. easeInQuint: function(e, t, i, n) {
  28740. return i * (e /= n) * e * e * e * e + t
  28741. },
  28742. easeOutQuint: function(e, t, i, n) {
  28743. return e /= n,
  28744. i * (--e * e * e * e * e + 1) + t
  28745. },
  28746. easeInOutQuint: function(e, t, i, n) {
  28747. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28748. },
  28749. easeInSine: function(e, t, i, n) {
  28750. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28751. },
  28752. easeOutSine: function(e, t, i, n) {
  28753. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28754. },
  28755. easeInOutSine: function(e, t, i, n) {
  28756. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28757. },
  28758. easeInExpo: function(e, t, i, n) {
  28759. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28760. },
  28761. easeOutExpo: function(e, t, i, n) {
  28762. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28763. },
  28764. easeInOutExpo: function(e, t, i, n) {
  28765. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28766. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28767. },
  28768. easeInCirc: function(e, t, i, n) {
  28769. return e /= n,
  28770. -i * (Math.sqrt(1 - e * e) - 1) + t
  28771. },
  28772. easeOutCirc: function(e, t, i, n) {
  28773. return e /= n,
  28774. e--,
  28775. i * Math.sqrt(1 - e * e) + t
  28776. },
  28777. easeInOutCirc: function(e, t, i, n) {
  28778. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28779. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28780. },
  28781. easeInElastic: function(e, t, i, n) {
  28782. var r = 1.70158
  28783. , o = 0
  28784. , a = i;
  28785. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28786. r = a < Math.abs(i) ? (a = i,
  28787. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28788. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28789. },
  28790. easeOutElastic: function(e, t, i, n) {
  28791. var r = 1.70158
  28792. , o = 0
  28793. , a = i;
  28794. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28795. r = a < Math.abs(i) ? (a = i,
  28796. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28797. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28798. },
  28799. easeInOutElastic: function(e, t, i, n) {
  28800. var r = 1.70158
  28801. , o = 0
  28802. , a = i;
  28803. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28804. r = a < Math.abs(i) ? (a = i,
  28805. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28806. 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)
  28807. },
  28808. easeInBack: function(e, t, i, n, r) {
  28809. return void 0 === r && (r = 1.70158),
  28810. i * (e /= n) * e * ((r + 1) * e - r) + t
  28811. },
  28812. easeOutBack: function(e, t, i, n, r) {
  28813. return void 0 === r && (r = 1.70158),
  28814. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28815. },
  28816. easeInOutBack: function(e, t, i, n, r) {
  28817. return void 0 === r && (r = 1.70158),
  28818. (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
  28819. },
  28820. easeOutBounce: function(e, t, i, n) {
  28821. 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
  28822. },
  28823. easeInBounce: function(e, t, i, n) {
  28824. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28825. },
  28826. easeInOutBounce: function(e, t, i, n) {
  28827. 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
  28828. }
  28829. };
  28830. t.exports = r
  28831. }
  28832. , {}],
  28833. 187: [function(e, t, i) {
  28834. "use strict";
  28835. function n() {
  28836. this.events = [],
  28837. this.valid = !1
  28838. }
  28839. var r = e("../enum/Joystick");
  28840. n.prototype.push = function(e, t) {
  28841. this.events.push({
  28842. direction: e,
  28843. pano: t
  28844. }),
  28845. this.valid = !0
  28846. }
  28847. ,
  28848. n.prototype.pop = function(e) {
  28849. var t = this.events.pop();
  28850. return this.events.length < 1 && (this.valid = !1),
  28851. t
  28852. }
  28853. ,
  28854. n.prototype.peek = function() {
  28855. return this.events.length ? this.events[this.events.length - 1] : {
  28856. direction: null,
  28857. pano: null
  28858. }
  28859. }
  28860. ,
  28861. n.prototype.invalidate = function() {
  28862. this.events = [],
  28863. this.valid = !1
  28864. }
  28865. ,
  28866. n.prototype.reversePano = function(e) {
  28867. if (!this.valid)
  28868. return null;
  28869. var t = this.peek();
  28870. return r.opposite(e) === t.direction ? (this.pop(),
  28871. t.pano) : null
  28872. }
  28873. ,
  28874. t.exports = n
  28875. }
  28876. , {
  28877. "../enum/Joystick": 29
  28878. }],
  28879. 188: [function(e, t, i) {
  28880. "use strict";
  28881. t.exports = {
  28882. vector: function(t, i) {
  28883. var n = t.clone();
  28884. return i = i.clone(),
  28885. function(e) {
  28886. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28887. }
  28888. },
  28889. quaternion: function(t, i) {
  28890. var n = t.clone();
  28891. return function(e) {
  28892. t.copy(n).slerp(i, e)
  28893. }
  28894. },
  28895. property: function(t, i, n, r) {
  28896. var o = t[i];
  28897. return function(e) {
  28898. t[i] = o * (1 - e) + n * e,
  28899. r && r(t[i])
  28900. }
  28901. },
  28902. uniform: function(t, i, n) {
  28903. var r = t.material.uniforms[i].value;
  28904. return function(e) {
  28905. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28906. }
  28907. },
  28908. matrix4: function(o, a) {
  28909. var s = o.clone();
  28910. return function(e) {
  28911. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28912. t[r] = i[r] * (1 - e) + n[r] * e
  28913. }
  28914. },
  28915. allUniforms: function(e, t, i) {
  28916. var n = e.map(function(e) {
  28917. return this.uniform(e, t, i)
  28918. }
  28919. .bind(this));
  28920. return function(t) {
  28921. n.forEach(function(e) {
  28922. e(t)
  28923. })
  28924. }
  28925. }
  28926. }
  28927. }
  28928. , {}],
  28929. 189: [function(e, t, i) {
  28930. "use strict";
  28931. function h(n) {
  28932. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28933. if (h.consoleEnabled) {
  28934. var l = function(e) {
  28935. $("#debug-console").append("<p>" + e + "</p>"),
  28936. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28937. };
  28938. e = function(e) {
  28939. l(Array.prototype.slice.call(arguments).join(" "))
  28940. }
  28941. ,
  28942. t = function(e) {
  28943. l(Array.prototype.slice.call(arguments).join(" "))
  28944. }
  28945. ,
  28946. i = function(e) {
  28947. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28948. }
  28949. ,
  28950. r = function(e) {
  28951. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28952. }
  28953. } else
  28954. console.log ? (e = console.log,
  28955. t = console.info ? console.info : console.log,
  28956. i = console.warn ? console.warn : console.log,
  28957. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28958. ;
  28959. function c(e) {
  28960. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28961. }
  28962. return {
  28963. debug: function() {
  28964. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28965. },
  28966. info: function() {
  28967. h.level >= h.levels.info && t.apply(console, c(arguments))
  28968. },
  28969. warn: function() {
  28970. (function(e, t) {
  28971. if (u) {
  28972. var i = Array.prototype.slice.call(e).join(" ");
  28973. u.captureMessage(i, {
  28974. level: t,
  28975. path: n,
  28976. timestamp: h.timestamp()
  28977. })
  28978. }
  28979. }
  28980. )(arguments, "warn"),
  28981. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28982. },
  28983. error: function() {
  28984. (function(e, t) {
  28985. if (u) {
  28986. var i = Array.prototype.slice.call(e).join(" ");
  28987. u.captureException(new Error(i), {
  28988. level: t,
  28989. path: n,
  28990. timestamp: h.timestamp()
  28991. })
  28992. }
  28993. }
  28994. )(arguments, "error"),
  28995. h.level >= h.levels.error && r.apply(console, c(arguments))
  28996. },
  28997. v3str: function(e, t) {
  28998. var i = void 0 === t ? 2 : t;
  28999. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29000. },
  29001. eulstr: function(e, t) {
  29002. var i = void 0 === t ? 2 : t;
  29003. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29004. },
  29005. time: function(e) {
  29006. h.level >= h.levels.debug && (s[e] = Date.now())
  29007. },
  29008. timeEnd: function(e) {
  29009. if (h.level >= h.levels.debug) {
  29010. var t = s[e];
  29011. if (!t)
  29012. return;
  29013. var i = (Date.now() - t) / 1e3;
  29014. this.debug(e, i + "s")
  29015. }
  29016. }
  29017. }
  29018. }
  29019. var u = window.Raven;
  29020. h.timestamp = function() {
  29021. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29022. }
  29023. ,
  29024. h.level = (h.levels = {
  29025. debug: 3,
  29026. info: 2,
  29027. warn: 1,
  29028. error: 0
  29029. }).info,
  29030. t.exports = h
  29031. }
  29032. , {}],
  29033. 190: [function(e, t, i) {
  29034. "use strict";
  29035. var o = e("three")
  29036. , r = e("../enum/GLCubeFaces");
  29037. e("../constants");
  29038. t.exports = {
  29039. convertVisionVector: function(e) {
  29040. return new o.Vector3(e.x,e.z,-e.y)
  29041. },
  29042. convertVisionQuaternion: function(e) {
  29043. 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)))
  29044. },
  29045. convertWorkshopVector: function(e) {
  29046. return new o.Vector3(-e.x,e.y,e.z)
  29047. },
  29048. convertWorkshopQuaternion: function(e) {
  29049. 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))
  29050. },
  29051. convertWorkshopPanoramaQuaternion: function(e) {
  29052. 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)))
  29053. },
  29054. convertWorkshopOrthoZoom: function(e) {
  29055. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29056. },
  29057. toPrecision: function(e, t) {
  29058. function i(e, t) {
  29059. var i = Math.pow(10, t);
  29060. return Math.round(e * i) / i
  29061. }
  29062. if (e instanceof Array) {
  29063. for (var n = 0; n < e.length; n++)
  29064. e[n] = i(e[n], t);
  29065. return e
  29066. }
  29067. return i(e, t)
  29068. },
  29069. isEmptyQuaternion: function(e) {
  29070. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29071. },
  29072. projectPositionToCanvas: function(e, t, i) {
  29073. (i = i || new o.Vector3).copy(e);
  29074. var n = .5 * $("#player").width()
  29075. , r = .5 * $("#player").height();
  29076. return i.project(t),
  29077. i.x = i.x * n + n,
  29078. i.y = -i.y * r + r,
  29079. i
  29080. },
  29081. convertScreenPositionToNDC: function(e, t, i) {
  29082. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29083. i.y = -t / $("#player").height() * 2 + 1,
  29084. i
  29085. },
  29086. constrainedTurn: function(e) {
  29087. var t = e % (2 * Math.PI);
  29088. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29089. },
  29090. getFOVDotThreshold: function(e) {
  29091. return Math.cos(o.Math.degToRad(e / 2))
  29092. },
  29093. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29094. switch (e) {
  29095. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29096. i.set(1, t.y, t.x);
  29097. break;
  29098. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29099. i.set(-1, t.y, -t.x);
  29100. break;
  29101. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29102. i.set(-t.x, 1, -t.y);
  29103. break;
  29104. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29105. i.set(-t.x, -1, t.y);
  29106. break;
  29107. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29108. i.set(-t.x, t.y, 1);
  29109. break;
  29110. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29111. i.set(t.x, t.y, -1)
  29112. }
  29113. n && i.normalize()
  29114. },
  29115. //add:
  29116. getPos2d : function(point, camera, dom){
  29117. var camera = camera ;
  29118. var dom = dom;
  29119. 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);
  29120. var x,y;
  29121. x = (pos.x + 1) / 2 * dom.clientWidth;
  29122. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29123. var inSight = x <= dom.clientWidth && x >= 0
  29124. && y <= dom.clientHeight && y >= 0
  29125. return {
  29126. pos: new THREE.Vector2(x,y),
  29127. vector: pos,
  29128. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29129. inSight : inSight //在屏幕范围内可见
  29130. };
  29131. },
  29132. }
  29133. window.math = t.exports
  29134. }
  29135. , {
  29136. "../constants": 8,
  29137. "../enum/GLCubeFaces": 25,
  29138. three: 217
  29139. }],
  29140. 191: [function(e, t, i) {
  29141. "use strict";
  29142. function o(e) {
  29143. return r[e]
  29144. }
  29145. var n = e("../enum/GLCubeFaces")
  29146. , a = [0, 1, 2, 3, 4, 5]
  29147. , r = {
  29148. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29149. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29150. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29151. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29152. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29153. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29154. };
  29155. t.exports = {
  29156. mapFaceToCubemapFace: o,
  29157. getCubemapUrls: function(i, n, r) {
  29158. return a.map(function(e, t) {
  29159. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29160. }
  29161. .bind(this))
  29162. }
  29163. }
  29164. }
  29165. , {
  29166. "../enum/GLCubeFaces": 25
  29167. }],
  29168. 192: [function(e, t, i) {
  29169. "use strict";
  29170. t.exports = {
  29171. captureErrors: function(e, t, i) {
  29172. if ("Raven"in window) {
  29173. Raven.config(e, t).install(),
  29174. i && Raven.setTagsContext(i);
  29175. var n = console.warn
  29176. , r = console.error;
  29177. console.warn = function() {
  29178. var e = Array.prototype.slice.call(arguments);
  29179. Raven.captureMessage(e.join(" "), {
  29180. level: "warning"
  29181. }),
  29182. n.apply(console, e)
  29183. }
  29184. ,
  29185. console.error = function() {
  29186. var e = Array.prototype.slice.call(arguments);
  29187. Raven.captureException(new Error(e.join(" ")), {
  29188. level: "error"
  29189. }),
  29190. r.apply(console, e)
  29191. }
  29192. } else
  29193. console.error("Raven not found, not capturing errors.")
  29194. }
  29195. }
  29196. }
  29197. , {}],
  29198. 193: [function(c, h, e) {
  29199. (function(e) {
  29200. "use strict";
  29201. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29202. getAuthorizationHeader: function() {
  29203. var e = n.valueFromHash("auth");
  29204. if (e)
  29205. return e.replace(",", " ");
  29206. var t = n.valueFromCookie("token");
  29207. return t ? "Token " + t : null
  29208. },
  29209. parseSidUrl: function(e) {
  29210. var t, i;
  29211. if (t = g_Prefix,
  29212. (e = e || "").match(/^https?/)) {
  29213. o.parse(e);
  29214. t = g_Prefix,
  29215. i = e
  29216. } else
  29217. i = (t = g_Prefix) + "data/" + e;
  29218. return {
  29219. urlBase: t,
  29220. urlModel: i,
  29221. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29222. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29223. }
  29224. },
  29225. getModelIDFromQueryString: function() {
  29226. return n.valueFromHash("model") || n.valueFromHash("m")
  29227. },
  29228. /* normalizeModeldata: function(e, i) {
  29229. e = JSON.parse(JSON.stringify(e));
  29230. var n = null;
  29231. if (e.images.forEach(function(t) {
  29232. if (t.metadata) {
  29233. if ("string" == typeof t.metadata)
  29234. try {
  29235. t.metadata = JSON.parse(t.metadata)
  29236. } catch (e) {
  29237. s.warn("Unable to parse image metadata"),
  29238. t.metadata = null
  29239. }
  29240. else
  29241. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29242. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29243. 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)),
  29244. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29245. t.metadata.zoom = t.metadata.zoom || 1),
  29246. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29247. }
  29248. }),
  29249. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29250. var t = {};
  29251. t.pano = {
  29252. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29253. position: i.convertWorkshopVector(n.scan_position),
  29254. uuid: n.scan_id
  29255. },
  29256. t.camera = {
  29257. quaternion: n.camera_quaternion,
  29258. position: n.camera_position
  29259. },
  29260. e.startPano = t
  29261. }
  29262. return e
  29263. }, */
  29264. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29265. e = JSON.parse(JSON.stringify(e));
  29266. var i = null;
  29267. var deal = function(n) {
  29268. if(!n.metadata) return;
  29269. if ("string" == typeof n.metadata)
  29270. try {
  29271. n.metadata = JSON.parse(n.metadata)
  29272. } catch (e) {
  29273. s.warn("Unable to parse image metadata"),
  29274. n.metadata = null
  29275. }
  29276. else{
  29277. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29278. }
  29279. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29280. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29281. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29282. }else{
  29283. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29284. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29285. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29286. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29287. }
  29288. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29289. }
  29290. //改
  29291. e.images.forEach(info=>{
  29292. if(info.locations){
  29293. info.locations.forEach(a=>deal(a))
  29294. }else{
  29295. deal(info)
  29296. }
  29297. })
  29298. //icon初始视角的:
  29299. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29300. var n = {};
  29301. n.pano = {
  29302. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29303. position: t.convertWorkshopVector(i.scan_position),
  29304. uuid: i.scan_id
  29305. },
  29306. n.camera = {
  29307. quaternion: i.camera_quaternion,
  29308. position: i.camera_position
  29309. },
  29310. e.startPano = n
  29311. }
  29312. return e
  29313. },
  29314. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29315. function(e) {
  29316. if (!e)
  29317. throw new Error("Vision version is required");
  29318. var t = i.exec(e);
  29319. if (null === t)
  29320. throw new Error("String is not a vision version: " + e);
  29321. return parseInt(t[1])
  29322. }
  29323. ),
  29324. modelDataPromisesTiles: function(e) {
  29325. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29326. if (t)
  29327. try {
  29328. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29329. } catch (e) {
  29330. s.warn("Invalid vision version: " + t)
  29331. }
  29332. return !1
  29333. }
  29334. };
  29335. h.exports = l
  29336. }
  29337. ).call(this, "/js/util/showcase.js")
  29338. }
  29339. , {
  29340. "../constants": 8,
  29341. "./browser": 182,
  29342. "./logger": 189,
  29343. three: 217,
  29344. url: 208
  29345. }],
  29346. 194: [function(e, t, i) {
  29347. "use strict";
  29348. var r = e("../util/ajax")
  29349. , o = e("three")
  29350. , a = e("../settings")
  29351. , s = {};
  29352. t.exports = {
  29353. load: function(e, t, i) {
  29354. var n = s[e];
  29355. return n ? t && setTimeout(function() {
  29356. t(n)
  29357. }, 1) : (n = new o.Texture,
  29358. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29359. n.magFilter = o.LinearFilter,
  29360. n.generateMipmaps = !1),
  29361. n.sourceFile = e,
  29362. s[e] = n,
  29363. r.getImage(e).then(function(e) {
  29364. n.image = e,
  29365. n.needsUpdate = !0,
  29366. t && t(n)
  29367. }).fail(i)),
  29368. n
  29369. },
  29370. loadBase64: function(e, t) {
  29371. t = t || "png";
  29372. var i = new o.Texture;
  29373. return i.image = document.createElement("img"),
  29374. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29375. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29376. i.magFilter = o.LinearFilter,
  29377. i.generateMipmaps = !1),
  29378. i.needsUpdate = !0,
  29379. i
  29380. },
  29381. isLoaded: function(e) {
  29382. return !!s[e]
  29383. }
  29384. }
  29385. window.Texture = t.exports
  29386. }
  29387. , {
  29388. "../settings": 166,
  29389. "../util/ajax": 181,
  29390. three: 217
  29391. }],
  29392. 195: [function(e, t, i) {
  29393. "use strict";
  29394. var l = e("./easing");
  29395. t.exports = {
  29396. globalDone: null,
  29397. funcs: [],
  29398. counter: 0,
  29399. uniqueID: 0,
  29400. start: function(e, t, i, n, r, o, a) {
  29401. return n = n || 0,
  29402. this.funcs.push({
  29403. func: e,
  29404. current: -n * Math.abs(t),
  29405. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29406. done: i,
  29407. easing: r || l.linearTween,
  29408. cycling: t < 0,
  29409. running: !0,
  29410. debug: n < 0,
  29411. name: o || "T" + this.counter,
  29412. id: void 0 === a ? this.counter : a,
  29413. paused: !1
  29414. }),
  29415. e(0, 16),
  29416. this.counter += 1,
  29417. e
  29418. },
  29419. trigger: function(e) {
  29420. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29421. , i = e.func || function() {}
  29422. , n = void 0 === e.duration ? 0 : e.duration;
  29423. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29424. var r = e.done || null
  29425. , o = e.easing || l.linearTween
  29426. , a = e.name || "R" + this.counter
  29427. , s = void 0 === e.id ? this.counter : e.id;
  29428. return this.start(i, n, r, t, o, a, s)
  29429. },
  29430. setTimeout: function(e, t, i) {
  29431. var n = void 0 === i ? this.counter : i;
  29432. return this.trigger({
  29433. done: e,
  29434. duration: void 0 === t ? 0 : t,
  29435. name: "O" + this.counter,
  29436. id: n
  29437. })
  29438. },
  29439. pause: function() {
  29440. this.paused = !0
  29441. },
  29442. resume: function() {
  29443. this.paused = !1
  29444. },
  29445. update: function(n) {
  29446. this.funcs.forEach(function(e) {
  29447. if (!(e.paused || (e.current += 1e3 * n,
  29448. e.current < 0)))
  29449. if (e.current >= e.duration && !e.cycling) {
  29450. var t = e.easing(1, 0, 1, 1);
  29451. e.func(t, 1e3 * n),
  29452. e.done && e.done(),
  29453. e.running = !1
  29454. } else {
  29455. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29456. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29457. e.running = !1)
  29458. }
  29459. });
  29460. var e = this.funcs.length;
  29461. this.funcs = this.funcs.filter(function(e) {
  29462. return e.running
  29463. });
  29464. var t = this.funcs.length;
  29465. if (0 < e && 0 === t && this.globalDone) {
  29466. var i = this.globalDone;
  29467. this.globalDone = null,
  29468. i()
  29469. }
  29470. },
  29471. adjustSpeed: function(e, t) {
  29472. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29473. var r = i[n];
  29474. r.duration /= t,
  29475. r.current /= t
  29476. }
  29477. },
  29478. getById: function(t) {
  29479. return this.funcs.filter(function(e) {
  29480. return t === e.id
  29481. })
  29482. },
  29483. get: function(e) {
  29484. for (var t = 0; t < this.funcs.length; t += 1)
  29485. if (this.funcs[t].func === e)
  29486. return this.funcs[t];
  29487. return null
  29488. },
  29489. isRunning: function(e) {
  29490. var t = this.get(e);
  29491. return null !== t && t.running
  29492. },
  29493. countActive: function() {
  29494. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29495. e += this.funcs[t].running;
  29496. return e
  29497. },
  29498. listActive: function() {
  29499. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29500. this.funcs[t].running && e.push(this.funcs[t].name);
  29501. return e
  29502. },
  29503. done: function(e) {
  29504. this.globalDone = e
  29505. },
  29506. cancelById: function(e) {
  29507. var t = void 0 === e ? 0 : e;
  29508. this.funcs = this.funcs.filter(function(e) {
  29509. return e.id !== t
  29510. })
  29511. },
  29512. cancel: function(t) {
  29513. this.funcs = this.funcs.filter(function(e) {
  29514. return e.func !== t
  29515. })
  29516. },
  29517. getUniqueId: function() {
  29518. return this.uniqueID -= 1,
  29519. this.uniqueID
  29520. }
  29521. }
  29522. }
  29523. , {
  29524. "./easing": 186
  29525. }],
  29526. 196: [function(e, t, i) {
  29527. function n(e) {
  29528. if (this.set = {},
  29529. this.infContains = function() {
  29530. return !0
  29531. }
  29532. ,
  29533. "object" == typeof e)
  29534. if (e instanceof Array)
  29535. for (var t = 0; t < e.length; t++)
  29536. this.set[e[t]] = !0;
  29537. else
  29538. this.set = e;
  29539. else if ("function" == typeof e)
  29540. this.infContains = e;
  29541. else if (void 0 !== e)
  29542. throw new Error("set must be either an array or an object.")
  29543. }
  29544. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29545. return !!this.set[e]
  29546. }
  29547. ,
  29548. n.prototype.add = function(e) {
  29549. if (1 == arguments.length)
  29550. this.set[e] = !0;
  29551. else
  29552. for (var t = 0; t < arguments.length; t++)
  29553. this.set[arguments[t]] = !0
  29554. }
  29555. ,
  29556. n.prototype.addAll = function(e) {
  29557. if ("object" != typeof e && !(e instanceof Array))
  29558. throw new Error("arr must be an array.");
  29559. for (var t = 0; t < e.length; t++)
  29560. this.add(e[t])
  29561. }
  29562. ,
  29563. n.prototype.delete = n.prototype.remove = function(e) {
  29564. if (1 == arguments.length)
  29565. delete this.set[e];
  29566. else
  29567. for (var t = 0; t < arguments.length; t++)
  29568. delete this.set[arguments[t]]
  29569. }
  29570. ,
  29571. n.prototype.clear = function() {
  29572. this.set = {}
  29573. }
  29574. ,
  29575. n.prototype.size = function() {
  29576. return Object.keys(this.set).length
  29577. }
  29578. ,
  29579. n.prototype.toString = function() {
  29580. return "{" + Object.keys(this.set).toString() + "}"
  29581. }
  29582. ,
  29583. n.prototype["*values"] = n.prototype.toArray = function() {
  29584. return void 0 === this.set ? [] : Object.keys(this.set)
  29585. }
  29586. }
  29587. , {}],
  29588. 197: [function(e, t, i) {}
  29589. , {}],
  29590. 198: [function(N, e, F) {
  29591. (function(e) {
  29592. "use strict";
  29593. function i() {
  29594. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29595. }
  29596. function o(e, t) {
  29597. if (i() < t)
  29598. throw new RangeError("Invalid typed array length");
  29599. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29600. e.length = t),
  29601. e
  29602. }
  29603. function u(e, t, i) {
  29604. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29605. return new u(e,t,i);
  29606. if ("number" != typeof e)
  29607. return n(this, e, t, i);
  29608. if ("string" == typeof t)
  29609. throw new Error("If encoding is specified then the first argument must be a string");
  29610. return a(this, e)
  29611. }
  29612. function n(e, t, i, n) {
  29613. if ("number" == typeof t)
  29614. throw new TypeError('"value" argument must not be a number');
  29615. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29616. if (t.byteLength,
  29617. i < 0 || t.byteLength < i)
  29618. throw new RangeError("'offset' is out of bounds");
  29619. if (t.byteLength < i + (n || 0))
  29620. throw new RangeError("'length' is out of bounds");
  29621. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29622. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29623. e
  29624. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29625. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29626. !u.isEncoding(i))
  29627. throw new TypeError('"encoding" must be a valid string encoding');
  29628. var n = 0 | c(t, i)
  29629. , r = (e = o(e, n)).write(t, i);
  29630. return r !== n && (e = e.slice(0, r)),
  29631. e
  29632. }(e, t, i) : function(e, t) {
  29633. if (u.isBuffer(t)) {
  29634. var i = 0 | l(t.length);
  29635. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29636. e
  29637. }
  29638. if (t) {
  29639. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29640. return "number" != typeof t.length || function(e) {
  29641. return e != e
  29642. }(t.length) ? o(e, 0) : s(e, t);
  29643. if ("Buffer" === t.type && L(t.data))
  29644. return s(e, t.data)
  29645. }
  29646. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29647. }(e, t)
  29648. }
  29649. function r(e) {
  29650. if ("number" != typeof e)
  29651. throw new TypeError('"size" argument must be a number');
  29652. if (e < 0)
  29653. throw new RangeError('"size" argument must not be negative')
  29654. }
  29655. function a(e, t) {
  29656. if (r(t),
  29657. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29658. !u.TYPED_ARRAY_SUPPORT)
  29659. for (var i = 0; i < t; ++i)
  29660. e[i] = 0;
  29661. return e
  29662. }
  29663. function s(e, t) {
  29664. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29665. e = o(e, i);
  29666. for (var n = 0; n < i; n += 1)
  29667. e[n] = 255 & t[n];
  29668. return e
  29669. }
  29670. function l(e) {
  29671. if (e >= i())
  29672. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29673. return 0 | e
  29674. }
  29675. function c(e, t) {
  29676. if (u.isBuffer(e))
  29677. return e.length;
  29678. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29679. return e.byteLength;
  29680. "string" != typeof e && (e = "" + e);
  29681. var i = e.length;
  29682. if (0 === i)
  29683. return 0;
  29684. for (var n = !1; ; )
  29685. switch (t) {
  29686. case "ascii":
  29687. case "latin1":
  29688. case "binary":
  29689. return i;
  29690. case "utf8":
  29691. case "utf-8":
  29692. case void 0:
  29693. return S(e).length;
  29694. case "ucs2":
  29695. case "ucs-2":
  29696. case "utf16le":
  29697. case "utf-16le":
  29698. return 2 * i;
  29699. case "hex":
  29700. return i >>> 1;
  29701. case "base64":
  29702. return M(e).length;
  29703. default:
  29704. if (n)
  29705. return S(e).length;
  29706. t = ("" + t).toLowerCase(),
  29707. n = !0
  29708. }
  29709. }
  29710. function h(e, t, i) {
  29711. var n = e[t];
  29712. e[t] = e[i],
  29713. e[i] = n
  29714. }
  29715. function d(e, t, i, n, r) {
  29716. if (0 === e.length)
  29717. return -1;
  29718. if ("string" == typeof i ? (n = i,
  29719. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29720. i = +i,
  29721. isNaN(i) && (i = r ? 0 : e.length - 1),
  29722. i < 0 && (i = e.length + i),
  29723. i >= e.length) {
  29724. if (r)
  29725. return -1;
  29726. i = e.length - 1
  29727. } else if (i < 0) {
  29728. if (!r)
  29729. return -1;
  29730. i = 0
  29731. }
  29732. if ("string" == typeof t && (t = u.from(t, n)),
  29733. u.isBuffer(t))
  29734. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29735. if ("number" == typeof t)
  29736. return t &= 255,
  29737. 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);
  29738. throw new TypeError("val must be string, number or Buffer")
  29739. }
  29740. function p(e, t, i, n, r) {
  29741. function o(e, t) {
  29742. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29743. }
  29744. var a, s = 1, l = e.length, c = t.length;
  29745. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29746. if (e.length < 2 || t.length < 2)
  29747. return -1;
  29748. l /= s = 2,
  29749. c /= 2,
  29750. i /= 2
  29751. }
  29752. if (r) {
  29753. var h = -1;
  29754. for (a = i; a < l; a++)
  29755. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29756. if (-1 === h && (h = a),
  29757. a - h + 1 === c)
  29758. return h * s
  29759. } else
  29760. -1 !== h && (a -= a - h),
  29761. h = -1
  29762. } else
  29763. for (l < i + c && (i = l - c),
  29764. a = i; 0 <= a; a--) {
  29765. for (var u = !0, d = 0; d < c; d++)
  29766. if (o(e, a + d) !== o(t, d)) {
  29767. u = !1;
  29768. break
  29769. }
  29770. if (u)
  29771. return a
  29772. }
  29773. return -1
  29774. }
  29775. function g(e, t, i, n) {
  29776. i = Number(i) || 0;
  29777. var r = e.length - i;
  29778. n ? r < (n = Number(n)) && (n = r) : n = r;
  29779. var o = t.length;
  29780. if (o % 2 != 0)
  29781. throw new TypeError("Invalid hex string");
  29782. o / 2 < n && (n = o / 2);
  29783. for (var a = 0; a < n; ++a) {
  29784. var s = parseInt(t.substr(2 * a, 2), 16);
  29785. if (isNaN(s))
  29786. return a;
  29787. e[i + a] = s
  29788. }
  29789. return a
  29790. }
  29791. function m(e, t, i, n) {
  29792. return R(function(e) {
  29793. for (var t = [], i = 0; i < e.length; ++i)
  29794. t.push(255 & e.charCodeAt(i));
  29795. return t
  29796. }(t), e, i, n)
  29797. }
  29798. function f(e, t, i) {
  29799. i = Math.min(e.length, i);
  29800. for (var n = [], r = t; r < i; ) {
  29801. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29802. if (r + u <= i)
  29803. switch (u) {
  29804. case 1:
  29805. c < 128 && (h = c);
  29806. break;
  29807. case 2:
  29808. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29809. break;
  29810. case 3:
  29811. o = e[r + 1],
  29812. a = e[r + 2],
  29813. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29814. break;
  29815. case 4:
  29816. o = e[r + 1],
  29817. a = e[r + 2],
  29818. s = e[r + 3],
  29819. 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))
  29820. }
  29821. null === h ? (h = 65533,
  29822. u = 1) : 65535 < h && (h -= 65536,
  29823. n.push(h >>> 10 & 1023 | 55296),
  29824. h = 56320 | 1023 & h),
  29825. n.push(h),
  29826. r += u
  29827. }
  29828. return function(e) {
  29829. var t = e.length;
  29830. if (t <= D)
  29831. return String.fromCharCode.apply(String, e);
  29832. for (var i = "", n = 0; n < t; )
  29833. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29834. return i
  29835. }(n)
  29836. }
  29837. function v(e, t, i) {
  29838. var n = "";
  29839. i = Math.min(e.length, i);
  29840. for (var r = t; r < i; ++r)
  29841. n += String.fromCharCode(127 & e[r]);
  29842. return n
  29843. }
  29844. function y(e, t, i) {
  29845. var n = "";
  29846. i = Math.min(e.length, i);
  29847. for (var r = t; r < i; ++r)
  29848. n += String.fromCharCode(e[r]);
  29849. return n
  29850. }
  29851. function A(e, t, i) {
  29852. var n, r = e.length;
  29853. (!t || t < 0) && (t = 0),
  29854. (!i || i < 0 || r < i) && (i = r);
  29855. for (var o = "", a = t; a < i; ++a)
  29856. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29857. return o
  29858. }
  29859. function C(e, t, i) {
  29860. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29861. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29862. return r
  29863. }
  29864. function I(e, t, i) {
  29865. if (e % 1 != 0 || e < 0)
  29866. throw new RangeError("offset is not uint");
  29867. if (i < e + t)
  29868. throw new RangeError("Trying to access beyond buffer length")
  29869. }
  29870. function E(e, t, i, n, r, o) {
  29871. if (!u.isBuffer(e))
  29872. throw new TypeError('"buffer" argument must be a Buffer instance');
  29873. if (r < t || t < o)
  29874. throw new RangeError('"value" argument is out of bounds');
  29875. if (i + n > e.length)
  29876. throw new RangeError("Index out of range")
  29877. }
  29878. function _(e, t, i, n) {
  29879. t < 0 && (t = 65535 + t + 1);
  29880. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29881. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29882. }
  29883. function b(e, t, i, n) {
  29884. t < 0 && (t = 4294967295 + t + 1);
  29885. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29886. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29887. }
  29888. function w(e, t, i, n) {
  29889. if (i + n > e.length)
  29890. throw new RangeError("Index out of range");
  29891. if (i < 0)
  29892. throw new RangeError("Index out of range")
  29893. }
  29894. function T(e, t, i, n, r) {
  29895. return r || w(e, 0, i, 4),
  29896. O.write(e, t, i, n, 23, 4),
  29897. i + 4
  29898. }
  29899. function x(e, t, i, n, r) {
  29900. return r || w(e, 0, i, 8),
  29901. O.write(e, t, i, n, 52, 8),
  29902. i + 8
  29903. }
  29904. function S(e, t) {
  29905. t = t || 1 / 0;
  29906. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29907. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29908. if (!r) {
  29909. if (56319 < i) {
  29910. -1 < (t -= 3) && o.push(239, 191, 189);
  29911. continue
  29912. }
  29913. if (a + 1 === n) {
  29914. -1 < (t -= 3) && o.push(239, 191, 189);
  29915. continue
  29916. }
  29917. r = i;
  29918. continue
  29919. }
  29920. if (i < 56320) {
  29921. -1 < (t -= 3) && o.push(239, 191, 189),
  29922. r = i;
  29923. continue
  29924. }
  29925. i = 65536 + (r - 55296 << 10 | i - 56320)
  29926. } else
  29927. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29928. if (r = null,
  29929. i < 128) {
  29930. if ((t -= 1) < 0)
  29931. break;
  29932. o.push(i)
  29933. } else if (i < 2048) {
  29934. if ((t -= 2) < 0)
  29935. break;
  29936. o.push(i >> 6 | 192, 63 & i | 128)
  29937. } else if (i < 65536) {
  29938. if ((t -= 3) < 0)
  29939. break;
  29940. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29941. } else {
  29942. if (!(i < 1114112))
  29943. throw new Error("Invalid code point");
  29944. if ((t -= 4) < 0)
  29945. break;
  29946. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29947. }
  29948. }
  29949. return o
  29950. }
  29951. function M(e) {
  29952. return P.toByteArray(function(e) {
  29953. if ((e = function(e) {
  29954. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29955. }(e).replace(t, "")).length < 2)
  29956. return "";
  29957. for (; e.length % 4 != 0; )
  29958. e += "=";
  29959. return e
  29960. }(e))
  29961. }
  29962. function R(e, t, i, n) {
  29963. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29964. t[r + i] = e[r];
  29965. return r
  29966. }
  29967. var P = N("base64-js")
  29968. , O = N("ieee754")
  29969. , L = N("isarray");
  29970. F.Buffer = u,
  29971. F.SlowBuffer = function(e) {
  29972. return +e != e && (e = 0),
  29973. u.alloc(+e)
  29974. }
  29975. ,
  29976. F.INSPECT_MAX_BYTES = 50,
  29977. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29978. try {
  29979. var e = new Uint8Array(1);
  29980. return e.__proto__ = {
  29981. __proto__: Uint8Array.prototype,
  29982. foo: function() {
  29983. return 42
  29984. }
  29985. },
  29986. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29987. } catch (e) {
  29988. return !1
  29989. }
  29990. }(),
  29991. F.kMaxLength = i(),
  29992. u.poolSize = 8192,
  29993. u._augment = function(e) {
  29994. return e.__proto__ = u.prototype,
  29995. e
  29996. }
  29997. ,
  29998. u.from = function(e, t, i) {
  29999. return n(null, e, t, i)
  30000. }
  30001. ,
  30002. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30003. u.__proto__ = Uint8Array,
  30004. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30005. value: null,
  30006. configurable: !0
  30007. })),
  30008. u.alloc = function(e, t, i) {
  30009. return function(e, t, i, n) {
  30010. return r(t),
  30011. 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)
  30012. }(null, e, t, i)
  30013. }
  30014. ,
  30015. u.allocUnsafe = function(e) {
  30016. return a(null, e)
  30017. }
  30018. ,
  30019. u.allocUnsafeSlow = function(e) {
  30020. return a(null, e)
  30021. }
  30022. ,
  30023. u.isBuffer = function(e) {
  30024. return !(null == e || !e._isBuffer)
  30025. }
  30026. ,
  30027. u.compare = function(e, t) {
  30028. if (!u.isBuffer(e) || !u.isBuffer(t))
  30029. throw new TypeError("Arguments must be Buffers");
  30030. if (e === t)
  30031. return 0;
  30032. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30033. if (e[r] !== t[r]) {
  30034. i = e[r],
  30035. n = t[r];
  30036. break
  30037. }
  30038. return i < n ? -1 : n < i ? 1 : 0
  30039. }
  30040. ,
  30041. u.isEncoding = function(e) {
  30042. switch (String(e).toLowerCase()) {
  30043. case "hex":
  30044. case "utf8":
  30045. case "utf-8":
  30046. case "ascii":
  30047. case "latin1":
  30048. case "binary":
  30049. case "base64":
  30050. case "ucs2":
  30051. case "ucs-2":
  30052. case "utf16le":
  30053. case "utf-16le":
  30054. return !0;
  30055. default:
  30056. return !1
  30057. }
  30058. }
  30059. ,
  30060. u.concat = function(e, t) {
  30061. if (!L(e))
  30062. throw new TypeError('"list" argument must be an Array of Buffers');
  30063. if (0 === e.length)
  30064. return u.alloc(0);
  30065. var i;
  30066. if (void 0 === t)
  30067. for (i = t = 0; i < e.length; ++i)
  30068. t += e[i].length;
  30069. var n = u.allocUnsafe(t)
  30070. , r = 0;
  30071. for (i = 0; i < e.length; ++i) {
  30072. var o = e[i];
  30073. if (!u.isBuffer(o))
  30074. throw new TypeError('"list" argument must be an Array of Buffers');
  30075. o.copy(n, r),
  30076. r += o.length
  30077. }
  30078. return n
  30079. }
  30080. ,
  30081. u.byteLength = c,
  30082. u.prototype._isBuffer = !0,
  30083. u.prototype.swap16 = function() {
  30084. var e = this.length;
  30085. if (e % 2 != 0)
  30086. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30087. for (var t = 0; t < e; t += 2)
  30088. h(this, t, t + 1);
  30089. return this
  30090. }
  30091. ,
  30092. u.prototype.swap32 = function() {
  30093. var e = this.length;
  30094. if (e % 4 != 0)
  30095. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30096. for (var t = 0; t < e; t += 4)
  30097. h(this, t, t + 3),
  30098. h(this, t + 1, t + 2);
  30099. return this
  30100. }
  30101. ,
  30102. u.prototype.swap64 = function() {
  30103. var e = this.length;
  30104. if (e % 8 != 0)
  30105. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30106. for (var t = 0; t < e; t += 8)
  30107. h(this, t, t + 7),
  30108. h(this, t + 1, t + 6),
  30109. h(this, t + 2, t + 5),
  30110. h(this, t + 3, t + 4);
  30111. return this
  30112. }
  30113. ,
  30114. u.prototype.toString = function() {
  30115. var e = 0 | this.length;
  30116. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30117. var n, r, o, a = !1;
  30118. if ((void 0 === t || t < 0) && (t = 0),
  30119. t > this.length)
  30120. return "";
  30121. if ((void 0 === i || i > this.length) && (i = this.length),
  30122. i <= 0)
  30123. return "";
  30124. if ((i >>>= 0) <= (t >>>= 0))
  30125. return "";
  30126. for (e = e || "utf8"; ; )
  30127. switch (e) {
  30128. case "hex":
  30129. return A(this, t, i);
  30130. case "utf8":
  30131. case "utf-8":
  30132. return f(this, t, i);
  30133. case "ascii":
  30134. return v(this, t, i);
  30135. case "latin1":
  30136. case "binary":
  30137. return y(this, t, i);
  30138. case "base64":
  30139. return n = this,
  30140. o = i,
  30141. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30142. case "ucs2":
  30143. case "ucs-2":
  30144. case "utf16le":
  30145. case "utf-16le":
  30146. return C(this, t, i);
  30147. default:
  30148. if (a)
  30149. throw new TypeError("Unknown encoding: " + e);
  30150. e = (e + "").toLowerCase(),
  30151. a = !0
  30152. }
  30153. }
  30154. .apply(this, arguments)
  30155. }
  30156. ,
  30157. u.prototype.equals = function(e) {
  30158. if (!u.isBuffer(e))
  30159. throw new TypeError("Argument must be a Buffer");
  30160. return this === e || 0 === u.compare(this, e)
  30161. }
  30162. ,
  30163. u.prototype.inspect = function() {
  30164. var e = ""
  30165. , t = F.INSPECT_MAX_BYTES;
  30166. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30167. this.length > t && (e += " ... ")),
  30168. "<Buffer " + e + ">"
  30169. }
  30170. ,
  30171. u.prototype.compare = function(e, t, i, n, r) {
  30172. if (!u.isBuffer(e))
  30173. throw new TypeError("Argument must be a Buffer");
  30174. if (void 0 === t && (t = 0),
  30175. void 0 === i && (i = e ? e.length : 0),
  30176. void 0 === n && (n = 0),
  30177. void 0 === r && (r = this.length),
  30178. t < 0 || i > e.length || n < 0 || r > this.length)
  30179. throw new RangeError("out of range index");
  30180. if (r <= n && i <= t)
  30181. return 0;
  30182. if (r <= n)
  30183. return -1;
  30184. if (i <= t)
  30185. return 1;
  30186. if (this === e)
  30187. return 0;
  30188. 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)
  30189. if (l[h] !== c[h]) {
  30190. o = l[h],
  30191. a = c[h];
  30192. break
  30193. }
  30194. return o < a ? -1 : a < o ? 1 : 0
  30195. }
  30196. ,
  30197. u.prototype.includes = function(e, t, i) {
  30198. return -1 !== this.indexOf(e, t, i)
  30199. }
  30200. ,
  30201. u.prototype.indexOf = function(e, t, i) {
  30202. return d(this, e, t, i, !0)
  30203. }
  30204. ,
  30205. u.prototype.lastIndexOf = function(e, t, i) {
  30206. return d(this, e, t, i, !1)
  30207. }
  30208. ,
  30209. u.prototype.write = function(e, t, i, n) {
  30210. if (void 0 === t)
  30211. n = "utf8",
  30212. i = this.length,
  30213. t = 0;
  30214. else if (void 0 === i && "string" == typeof t)
  30215. n = t,
  30216. i = this.length,
  30217. t = 0;
  30218. else {
  30219. if (!isFinite(t))
  30220. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30221. t |= 0,
  30222. isFinite(i) ? (i |= 0,
  30223. void 0 === n && (n = "utf8")) : (n = i,
  30224. i = void 0)
  30225. }
  30226. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30227. if ((void 0 === i || p < i) && (i = p),
  30228. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30229. throw new RangeError("Attempt to write outside buffer bounds");
  30230. n = n || "utf8";
  30231. for (var f = !1; ; )
  30232. switch (n) {
  30233. case "hex":
  30234. return g(this, e, t, i);
  30235. case "utf8":
  30236. case "utf-8":
  30237. return u = t,
  30238. d = i,
  30239. R(S(e, (h = this).length - u), h, u, d);
  30240. case "ascii":
  30241. return m(this, e, t, i);
  30242. case "latin1":
  30243. case "binary":
  30244. return m(this, e, t, i);
  30245. case "base64":
  30246. return s = this,
  30247. l = t,
  30248. c = i,
  30249. R(M(e), s, l, c);
  30250. case "ucs2":
  30251. case "ucs-2":
  30252. case "utf16le":
  30253. case "utf-16le":
  30254. return o = t,
  30255. a = i,
  30256. R(function(e, t) {
  30257. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30258. i = e.charCodeAt(a),
  30259. n = i >> 8,
  30260. r = i % 256,
  30261. o.push(r),
  30262. o.push(n);
  30263. return o
  30264. }(e, (r = this).length - o), r, o, a);
  30265. default:
  30266. if (f)
  30267. throw new TypeError("Unknown encoding: " + n);
  30268. n = ("" + n).toLowerCase(),
  30269. f = !0
  30270. }
  30271. }
  30272. ,
  30273. u.prototype.toJSON = function() {
  30274. return {
  30275. type: "Buffer",
  30276. data: Array.prototype.slice.call(this._arr || this, 0)
  30277. }
  30278. }
  30279. ;
  30280. var D = 4096;
  30281. u.prototype.slice = function(e, t) {
  30282. var i, n = this.length;
  30283. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30284. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30285. t < e && (t = e),
  30286. u.TYPED_ARRAY_SUPPORT)
  30287. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30288. else {
  30289. var r = t - e;
  30290. i = new u(r,void 0);
  30291. for (var o = 0; o < r; ++o)
  30292. i[o] = this[o + e]
  30293. }
  30294. return i
  30295. }
  30296. ,
  30297. u.prototype.readUIntLE = function(e, t, i) {
  30298. e |= 0,
  30299. t |= 0,
  30300. i || I(e, t, this.length);
  30301. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30302. n += this[e + o] * r;
  30303. return n
  30304. }
  30305. ,
  30306. u.prototype.readUIntBE = function(e, t, i) {
  30307. e |= 0,
  30308. t |= 0,
  30309. i || I(e, t, this.length);
  30310. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30311. n += this[e + --t] * r;
  30312. return n
  30313. }
  30314. ,
  30315. u.prototype.readUInt8 = function(e, t) {
  30316. return t || I(e, 1, this.length),
  30317. this[e]
  30318. }
  30319. ,
  30320. u.prototype.readUInt16LE = function(e, t) {
  30321. return t || I(e, 2, this.length),
  30322. this[e] | this[e + 1] << 8
  30323. }
  30324. ,
  30325. u.prototype.readUInt16BE = function(e, t) {
  30326. return t || I(e, 2, this.length),
  30327. this[e] << 8 | this[e + 1]
  30328. }
  30329. ,
  30330. u.prototype.readUInt32LE = function(e, t) {
  30331. return t || I(e, 4, this.length),
  30332. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30333. }
  30334. ,
  30335. u.prototype.readUInt32BE = function(e, t) {
  30336. return t || I(e, 4, this.length),
  30337. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30338. }
  30339. ,
  30340. u.prototype.readIntLE = function(e, t, i) {
  30341. e |= 0,
  30342. t |= 0,
  30343. i || I(e, t, this.length);
  30344. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30345. n += this[e + o] * r;
  30346. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30347. n
  30348. }
  30349. ,
  30350. u.prototype.readIntBE = function(e, t, i) {
  30351. e |= 0,
  30352. t |= 0,
  30353. i || I(e, t, this.length);
  30354. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30355. o += this[e + --n] * r;
  30356. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30357. o
  30358. }
  30359. ,
  30360. u.prototype.readInt8 = function(e, t) {
  30361. return t || I(e, 1, this.length),
  30362. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30363. }
  30364. ,
  30365. u.prototype.readInt16LE = function(e, t) {
  30366. t || I(e, 2, this.length);
  30367. var i = this[e] | this[e + 1] << 8;
  30368. return 32768 & i ? 4294901760 | i : i
  30369. }
  30370. ,
  30371. u.prototype.readInt16BE = function(e, t) {
  30372. t || I(e, 2, this.length);
  30373. var i = this[e + 1] | this[e] << 8;
  30374. return 32768 & i ? 4294901760 | i : i
  30375. }
  30376. ,
  30377. u.prototype.readInt32LE = function(e, t) {
  30378. return t || I(e, 4, this.length),
  30379. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30380. }
  30381. ,
  30382. u.prototype.readInt32BE = function(e, t) {
  30383. return t || I(e, 4, this.length),
  30384. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30385. }
  30386. ,
  30387. u.prototype.readFloatLE = function(e, t) {
  30388. return t || I(e, 4, this.length),
  30389. O.read(this, e, !0, 23, 4)
  30390. }
  30391. ,
  30392. u.prototype.readFloatBE = function(e, t) {
  30393. return t || I(e, 4, this.length),
  30394. O.read(this, e, !1, 23, 4)
  30395. }
  30396. ,
  30397. u.prototype.readDoubleLE = function(e, t) {
  30398. return t || I(e, 8, this.length),
  30399. O.read(this, e, !0, 52, 8)
  30400. }
  30401. ,
  30402. u.prototype.readDoubleBE = function(e, t) {
  30403. return t || I(e, 8, this.length),
  30404. O.read(this, e, !1, 52, 8)
  30405. }
  30406. ,
  30407. u.prototype.writeUIntLE = function(e, t, i, n) {
  30408. e = +e,
  30409. t |= 0,
  30410. i |= 0,
  30411. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30412. var r = 1
  30413. , o = 0;
  30414. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30415. this[t + o] = e / r & 255;
  30416. return t + i
  30417. }
  30418. ,
  30419. u.prototype.writeUIntBE = function(e, t, i, n) {
  30420. e = +e,
  30421. t |= 0,
  30422. i |= 0,
  30423. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30424. var r = i - 1
  30425. , o = 1;
  30426. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30427. this[t + r] = e / o & 255;
  30428. return t + i
  30429. }
  30430. ,
  30431. u.prototype.writeUInt8 = function(e, t, i) {
  30432. return e = +e,
  30433. t |= 0,
  30434. i || E(this, e, t, 1, 255, 0),
  30435. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30436. this[t] = 255 & e,
  30437. t + 1
  30438. }
  30439. ,
  30440. u.prototype.writeUInt16LE = function(e, t, i) {
  30441. return e = +e,
  30442. t |= 0,
  30443. i || E(this, e, t, 2, 65535, 0),
  30444. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30445. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30446. t + 2
  30447. }
  30448. ,
  30449. u.prototype.writeUInt16BE = function(e, t, i) {
  30450. return e = +e,
  30451. t |= 0,
  30452. i || E(this, e, t, 2, 65535, 0),
  30453. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30454. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30455. t + 2
  30456. }
  30457. ,
  30458. u.prototype.writeUInt32LE = function(e, t, i) {
  30459. return e = +e,
  30460. t |= 0,
  30461. i || E(this, e, t, 4, 4294967295, 0),
  30462. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30463. this[t + 2] = e >>> 16,
  30464. this[t + 1] = e >>> 8,
  30465. this[t] = 255 & e) : b(this, e, t, !0),
  30466. t + 4
  30467. }
  30468. ,
  30469. u.prototype.writeUInt32BE = function(e, t, i) {
  30470. return e = +e,
  30471. t |= 0,
  30472. i || E(this, e, t, 4, 4294967295, 0),
  30473. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30474. this[t + 1] = e >>> 16,
  30475. this[t + 2] = e >>> 8,
  30476. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30477. t + 4
  30478. }
  30479. ,
  30480. u.prototype.writeIntLE = function(e, t, i, n) {
  30481. if (e = +e,
  30482. t |= 0,
  30483. !n) {
  30484. var r = Math.pow(2, 8 * i - 1);
  30485. E(this, e, t, i, r - 1, -r)
  30486. }
  30487. var o = 0
  30488. , a = 1
  30489. , s = 0;
  30490. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30491. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30492. this[t + o] = (e / a >> 0) - s & 255;
  30493. return t + i
  30494. }
  30495. ,
  30496. u.prototype.writeIntBE = function(e, t, i, n) {
  30497. if (e = +e,
  30498. t |= 0,
  30499. !n) {
  30500. var r = Math.pow(2, 8 * i - 1);
  30501. E(this, e, t, i, r - 1, -r)
  30502. }
  30503. var o = i - 1
  30504. , a = 1
  30505. , s = 0;
  30506. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30507. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30508. this[t + o] = (e / a >> 0) - s & 255;
  30509. return t + i
  30510. }
  30511. ,
  30512. u.prototype.writeInt8 = function(e, t, i) {
  30513. return e = +e,
  30514. t |= 0,
  30515. i || E(this, e, t, 1, 127, -128),
  30516. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30517. e < 0 && (e = 255 + e + 1),
  30518. this[t] = 255 & e,
  30519. t + 1
  30520. }
  30521. ,
  30522. u.prototype.writeInt16LE = function(e, t, i) {
  30523. return e = +e,
  30524. t |= 0,
  30525. i || E(this, e, t, 2, 32767, -32768),
  30526. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30527. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30528. t + 2
  30529. }
  30530. ,
  30531. u.prototype.writeInt16BE = function(e, t, i) {
  30532. return e = +e,
  30533. t |= 0,
  30534. i || E(this, e, t, 2, 32767, -32768),
  30535. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30536. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30537. t + 2
  30538. }
  30539. ,
  30540. u.prototype.writeInt32LE = function(e, t, i) {
  30541. return e = +e,
  30542. t |= 0,
  30543. i || E(this, e, t, 4, 2147483647, -2147483648),
  30544. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30545. this[t + 1] = e >>> 8,
  30546. this[t + 2] = e >>> 16,
  30547. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30548. t + 4
  30549. }
  30550. ,
  30551. u.prototype.writeInt32BE = function(e, t, i) {
  30552. return e = +e,
  30553. t |= 0,
  30554. i || E(this, e, t, 4, 2147483647, -2147483648),
  30555. e < 0 && (e = 4294967295 + e + 1),
  30556. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30557. this[t + 1] = e >>> 16,
  30558. this[t + 2] = e >>> 8,
  30559. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30560. t + 4
  30561. }
  30562. ,
  30563. u.prototype.writeFloatLE = function(e, t, i) {
  30564. return T(this, e, t, !0, i)
  30565. }
  30566. ,
  30567. u.prototype.writeFloatBE = function(e, t, i) {
  30568. return T(this, e, t, !1, i)
  30569. }
  30570. ,
  30571. u.prototype.writeDoubleLE = function(e, t, i) {
  30572. return x(this, e, t, !0, i)
  30573. }
  30574. ,
  30575. u.prototype.writeDoubleBE = function(e, t, i) {
  30576. return x(this, e, t, !1, i)
  30577. }
  30578. ,
  30579. u.prototype.copy = function(e, t, i, n) {
  30580. if (i = i || 0,
  30581. n || 0 === n || (n = this.length),
  30582. t >= e.length && (t = e.length),
  30583. t = t || 0,
  30584. 0 < n && n < i && (n = i),
  30585. n === i)
  30586. return 0;
  30587. if (0 === e.length || 0 === this.length)
  30588. return 0;
  30589. if (t < 0)
  30590. throw new RangeError("targetStart out of bounds");
  30591. if (i < 0 || i >= this.length)
  30592. throw new RangeError("sourceStart out of bounds");
  30593. if (n < 0)
  30594. throw new RangeError("sourceEnd out of bounds");
  30595. n > this.length && (n = this.length),
  30596. e.length - t < n - i && (n = e.length - t + i);
  30597. var r, o = n - i;
  30598. if (this === e && i < t && t < n)
  30599. for (r = o - 1; 0 <= r; --r)
  30600. e[r + t] = this[r + i];
  30601. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30602. for (r = 0; r < o; ++r)
  30603. e[r + t] = this[r + i];
  30604. else
  30605. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30606. return o
  30607. }
  30608. ,
  30609. u.prototype.fill = function(e, t, i, n) {
  30610. if ("string" == typeof e) {
  30611. if ("string" == typeof t ? (n = t,
  30612. t = 0,
  30613. i = this.length) : "string" == typeof i && (n = i,
  30614. i = this.length),
  30615. 1 === e.length) {
  30616. var r = e.charCodeAt(0);
  30617. r < 256 && (e = r)
  30618. }
  30619. if (void 0 !== n && "string" != typeof n)
  30620. throw new TypeError("encoding must be a string");
  30621. if ("string" == typeof n && !u.isEncoding(n))
  30622. throw new TypeError("Unknown encoding: " + n)
  30623. } else
  30624. "number" == typeof e && (e &= 255);
  30625. if (t < 0 || this.length < t || this.length < i)
  30626. throw new RangeError("Out of range index");
  30627. if (i <= t)
  30628. return this;
  30629. var o;
  30630. if (t >>>= 0,
  30631. i = void 0 === i ? this.length : i >>> 0,
  30632. "number" == typeof (e = e || 0))
  30633. for (o = t; o < i; ++o)
  30634. this[o] = e;
  30635. else {
  30636. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30637. , s = a.length;
  30638. for (o = 0; o < i - t; ++o)
  30639. this[o + t] = a[o % s]
  30640. }
  30641. return this
  30642. }
  30643. ;
  30644. var t = /[^+\/0-9A-Za-z-_]/g
  30645. }
  30646. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30647. }
  30648. , {
  30649. "base64-js": 199,
  30650. ieee754: 200,
  30651. isarray: 201
  30652. }],
  30653. 199: [function(e, t, i) {
  30654. "use strict";
  30655. function l(e) {
  30656. var t = e.length;
  30657. if (0 < t % 4)
  30658. throw new Error("Invalid string. Length must be a multiple of 4");
  30659. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30660. }
  30661. function c(e, t, i) {
  30662. for (var n, r = [], o = t; o < i; o += 3)
  30663. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30664. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30665. var a;
  30666. return r.join("")
  30667. }
  30668. i.byteLength = function(e) {
  30669. return 3 * e.length / 4 - l(e)
  30670. }
  30671. ,
  30672. i.toByteArray = function(e) {
  30673. var t, i, n, r, o, a = e.length;
  30674. r = l(e),
  30675. o = new d(3 * a / 4 - r),
  30676. i = 0 < r ? a - 4 : a;
  30677. var s = 0;
  30678. for (t = 0; t < i; t += 4,
  30679. 3)
  30680. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30681. o[s++] = n >> 16 & 255,
  30682. o[s++] = n >> 8 & 255,
  30683. o[s++] = 255 & n;
  30684. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30685. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30686. o[s++] = n >> 8 & 255,
  30687. o[s++] = 255 & n),
  30688. o
  30689. }
  30690. ,
  30691. i.fromByteArray = function(e) {
  30692. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30693. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30694. return 1 == n ? (t = e[i - 1],
  30695. r += h[t >> 2],
  30696. r += h[t << 4 & 63],
  30697. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30698. r += h[t >> 10],
  30699. r += h[t >> 4 & 63],
  30700. r += h[t << 2 & 63],
  30701. r += "="),
  30702. o.push(r),
  30703. o.join("")
  30704. }
  30705. ;
  30706. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30707. h[r] = n[r],
  30708. u[n.charCodeAt(r)] = r;
  30709. u["-".charCodeAt(0)] = 62,
  30710. u["_".charCodeAt(0)] = 63
  30711. }
  30712. , {}],
  30713. 200: [function(e, t, i) {
  30714. i.read = function(e, t, i, n, r) {
  30715. 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];
  30716. for (u += d,
  30717. o = p & (1 << -h) - 1,
  30718. p >>= -h,
  30719. h += s; 0 < h; o = 256 * o + e[t + u],
  30720. u += d,
  30721. h -= 8)
  30722. ;
  30723. for (a = o & (1 << -h) - 1,
  30724. o >>= -h,
  30725. h += n; 0 < h; a = 256 * a + e[t + u],
  30726. u += d,
  30727. h -= 8)
  30728. ;
  30729. if (0 === o)
  30730. o = 1 - c;
  30731. else {
  30732. if (o === l)
  30733. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30734. a += Math.pow(2, n),
  30735. o -= c
  30736. }
  30737. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30738. }
  30739. ,
  30740. i.write = function(e, t, i, n, r, o) {
  30741. 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;
  30742. for (t = Math.abs(t),
  30743. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30744. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30745. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30746. l *= 2),
  30747. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30748. l /= 2),
  30749. h <= a + u ? (s = 0,
  30750. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30751. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30752. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30753. p += f,
  30754. s /= 256,
  30755. r -= 8)
  30756. ;
  30757. for (a = a << r | s,
  30758. c += r; 0 < c; e[i + p] = 255 & a,
  30759. p += f,
  30760. a /= 256,
  30761. c -= 8)
  30762. ;
  30763. e[i + p - f] |= 128 * g
  30764. }
  30765. }
  30766. , {}],
  30767. 201: [function(e, t, i) {
  30768. var n = {}.toString;
  30769. t.exports = Array.isArray || function(e) {
  30770. return "[object Array]" == n.call(e)
  30771. }
  30772. }
  30773. , {}],
  30774. 202: [function(e, t, i) {
  30775. function n() {
  30776. this._events = this._events || {},
  30777. this._maxListeners = this._maxListeners || void 0
  30778. }
  30779. function l(e) {
  30780. return "function" == typeof e
  30781. }
  30782. function c(e) {
  30783. return "object" == typeof e && null !== e
  30784. }
  30785. function h(e) {
  30786. return void 0 === e
  30787. }
  30788. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30789. n.prototype._maxListeners = void 0,
  30790. n.defaultMaxListeners = 10,
  30791. n.prototype.setMaxListeners = function(e) {
  30792. if (!function(e) {
  30793. return "number" == typeof e
  30794. }(e) || e < 0 || isNaN(e))
  30795. throw TypeError("n must be a positive number");
  30796. return this._maxListeners = e,
  30797. this
  30798. }
  30799. ,
  30800. n.prototype.emit = function(e) {
  30801. var t, i, n, r, o, a;
  30802. if (this._events || (this._events = {}),
  30803. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30804. if ((t = arguments[1])instanceof Error)
  30805. throw t;
  30806. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30807. throw s.context = t,
  30808. s
  30809. }
  30810. if (h(i = this._events[e]))
  30811. return !1;
  30812. if (l(i))
  30813. switch (arguments.length) {
  30814. case 1:
  30815. i.call(this);
  30816. break;
  30817. case 2:
  30818. i.call(this, arguments[1]);
  30819. break;
  30820. case 3:
  30821. i.call(this, arguments[1], arguments[2]);
  30822. break;
  30823. default:
  30824. r = Array.prototype.slice.call(arguments, 1),
  30825. i.apply(this, r)
  30826. }
  30827. else if (c(i))
  30828. for (r = Array.prototype.slice.call(arguments, 1),
  30829. n = (a = i.slice()).length,
  30830. o = 0; o < n; o++)
  30831. a[o].apply(this, r);
  30832. return !0
  30833. }
  30834. ,
  30835. n.prototype.on = n.prototype.addListener = function(e, t) {
  30836. var i;
  30837. if (!l(t))
  30838. throw TypeError("listener must be a function");
  30839. return this._events || (this._events = {}),
  30840. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30841. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30842. 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,
  30843. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30844. "function" == typeof console.trace && console.trace())),
  30845. this
  30846. }
  30847. ,
  30848. n.prototype.once = function(e, t) {
  30849. function i() {
  30850. this.removeListener(e, i),
  30851. n || (n = !0,
  30852. t.apply(this, arguments))
  30853. }
  30854. if (!l(t))
  30855. throw TypeError("listener must be a function");
  30856. var n = !1;
  30857. return i.listener = t,
  30858. this.on(e, i),
  30859. this
  30860. }
  30861. ,
  30862. n.prototype.removeListener = function(e, t) {
  30863. var i, n, r, o;
  30864. if (!l(t))
  30865. throw TypeError("listener must be a function");
  30866. if (!this._events || !this._events[e])
  30867. return this;
  30868. if (r = (i = this._events[e]).length,
  30869. n = -1,
  30870. i === t || l(i.listener) && i.listener === t)
  30871. delete this._events[e],
  30872. this._events.removeListener && this.emit("removeListener", e, t);
  30873. else if (c(i)) {
  30874. for (o = r; 0 < o--; )
  30875. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30876. n = o;
  30877. break
  30878. }
  30879. if (n < 0)
  30880. return this;
  30881. 1 === i.length ? (i.length = 0,
  30882. delete this._events[e]) : i.splice(n, 1),
  30883. this._events.removeListener && this.emit("removeListener", e, t)
  30884. }
  30885. return this
  30886. }
  30887. ,
  30888. n.prototype.removeAllListeners = function(e) {
  30889. var t, i;
  30890. if (!this._events)
  30891. return this;
  30892. if (!this._events.removeListener)
  30893. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30894. this;
  30895. if (0 === arguments.length) {
  30896. for (t in this._events)
  30897. "removeListener" !== t && this.removeAllListeners(t);
  30898. return this.removeAllListeners("removeListener"),
  30899. this._events = {},
  30900. this
  30901. }
  30902. if (l(i = this._events[e]))
  30903. this.removeListener(e, i);
  30904. else if (i)
  30905. for (; i.length; )
  30906. this.removeListener(e, i[i.length - 1]);
  30907. return delete this._events[e],
  30908. this
  30909. }
  30910. ,
  30911. n.prototype.listeners = function(e) {
  30912. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30913. }
  30914. ,
  30915. n.prototype.listenerCount = function(e) {
  30916. if (this._events) {
  30917. var t = this._events[e];
  30918. if (l(t))
  30919. return 1;
  30920. if (t)
  30921. return t.length
  30922. }
  30923. return 0
  30924. }
  30925. ,
  30926. n.listenerCount = function(e, t) {
  30927. return e.listenerCount(t)
  30928. }
  30929. }
  30930. , {}],
  30931. 203: [function(e, t, i) {
  30932. function n() {
  30933. throw new Error("setTimeout has not been defined")
  30934. }
  30935. function r() {
  30936. throw new Error("clearTimeout has not been defined")
  30937. }
  30938. function o(t) {
  30939. if (h === setTimeout)
  30940. return setTimeout(t, 0);
  30941. if ((h === n || !h) && setTimeout)
  30942. return h = setTimeout,
  30943. setTimeout(t, 0);
  30944. try {
  30945. return h(t, 0)
  30946. } catch (e) {
  30947. try {
  30948. return h.call(null, t, 0)
  30949. } catch (e) {
  30950. return h.call(this, t, 0)
  30951. }
  30952. }
  30953. }
  30954. function a() {
  30955. g && p && (g = !1,
  30956. p.length ? f = p.concat(f) : m = -1,
  30957. f.length && s())
  30958. }
  30959. function s() {
  30960. if (!g) {
  30961. var e = o(a);
  30962. g = !0;
  30963. for (var t = f.length; t; ) {
  30964. for (p = f,
  30965. f = []; ++m < t; )
  30966. p && p[m].run();
  30967. m = -1,
  30968. t = f.length
  30969. }
  30970. p = null,
  30971. g = !1,
  30972. function(t) {
  30973. if (u === clearTimeout)
  30974. return clearTimeout(t);
  30975. if ((u === r || !u) && clearTimeout)
  30976. return u = clearTimeout,
  30977. clearTimeout(t);
  30978. try {
  30979. u(t)
  30980. } catch (e) {
  30981. try {
  30982. return u.call(null, t)
  30983. } catch (e) {
  30984. return u.call(this, t)
  30985. }
  30986. }
  30987. }(e)
  30988. }
  30989. }
  30990. function l(e, t) {
  30991. this.fun = e,
  30992. this.array = t
  30993. }
  30994. function c() {}
  30995. var h, u, d = t.exports = {};
  30996. !function() {
  30997. try {
  30998. h = "function" == typeof setTimeout ? setTimeout : n
  30999. } catch (e) {
  31000. h = n
  31001. }
  31002. try {
  31003. u = "function" == typeof clearTimeout ? clearTimeout : r
  31004. } catch (e) {
  31005. u = r
  31006. }
  31007. }();
  31008. var p, f = [], g = !1, m = -1;
  31009. d.nextTick = function(e) {
  31010. var t = new Array(arguments.length - 1);
  31011. if (1 < arguments.length)
  31012. for (var i = 1; i < arguments.length; i++)
  31013. t[i - 1] = arguments[i];
  31014. f.push(new l(e,t)),
  31015. 1 !== f.length || g || o(s)
  31016. }
  31017. ,
  31018. l.prototype.run = function() {
  31019. this.fun.apply(null, this.array)
  31020. }
  31021. ,
  31022. d.title = "browser",
  31023. d.browser = !0,
  31024. d.env = {},
  31025. d.argv = [],
  31026. d.version = "",
  31027. d.versions = {},
  31028. d.on = c,
  31029. d.addListener = c,
  31030. d.once = c,
  31031. d.off = c,
  31032. d.removeListener = c,
  31033. d.removeAllListeners = c,
  31034. d.emit = c,
  31035. d.binding = function(e) {
  31036. throw new Error("process.binding is not supported")
  31037. }
  31038. ,
  31039. d.cwd = function() {
  31040. return "/"
  31041. }
  31042. ,
  31043. d.chdir = function(e) {
  31044. throw new Error("process.chdir is not supported")
  31045. }
  31046. ,
  31047. d.umask = function() {
  31048. return 0
  31049. }
  31050. }
  31051. , {}],
  31052. 204: [function(e, O, L) {
  31053. (function(P) {
  31054. !function(e) {
  31055. function v(e) {
  31056. throw new RangeError(g[e])
  31057. }
  31058. function r(e, t) {
  31059. for (var i = e.length, n = []; i--; )
  31060. n[i] = t(e[i]);
  31061. return n
  31062. }
  31063. function t(e, t) {
  31064. var i = e.split("@")
  31065. , n = "";
  31066. return 1 < i.length && (n = i[0] + "@",
  31067. e = i[1]),
  31068. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31069. }
  31070. function y(e) {
  31071. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31072. 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),
  31073. r--) : n.push(t);
  31074. return n
  31075. }
  31076. function A(e) {
  31077. return r(e, function(e) {
  31078. var t = "";
  31079. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31080. e = 56320 | 1023 & e),
  31081. t + R(e)
  31082. }).join("")
  31083. }
  31084. function C(e, t) {
  31085. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31086. }
  31087. function I(e, t, i) {
  31088. var n = 0;
  31089. for (e = i ? M(e / u) : e >> 1,
  31090. e += M(e / t); m * w >> 1 < e; n += _)
  31091. e = M(e / m);
  31092. return M(n + (m + 1) * e / (e + h))
  31093. }
  31094. function i(e) {
  31095. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31096. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31097. n = 0; n < i; ++n)
  31098. 128 <= e.charCodeAt(n) && v("not-basic"),
  31099. d.push(e.charCodeAt(n));
  31100. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31101. for (o = f,
  31102. a = 1,
  31103. s = _; p <= r && v("invalid-input"),
  31104. u = e.charCodeAt(r++),
  31105. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31106. f += l * a,
  31107. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31108. a > M(E / (h = _ - c)) && v("overflow"),
  31109. a *= h;
  31110. m = I(f - o, t = d.length + 1, 0 == o),
  31111. M(f / t) > E - g && v("overflow"),
  31112. g += M(f / t),
  31113. f %= t,
  31114. d.splice(f++, 0, g)
  31115. }
  31116. return A(d)
  31117. }
  31118. function n(e) {
  31119. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31120. for (d = (e = y(e)).length,
  31121. t = x,
  31122. o = T,
  31123. a = i = 0; a < d; ++a)
  31124. (u = e[a]) < 128 && m.push(R(u));
  31125. for (n = r = m.length,
  31126. r && m.push(S); n < d; ) {
  31127. for (s = E,
  31128. a = 0; a < d; ++a)
  31129. t <= (u = e[a]) && u < s && (s = u);
  31130. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31131. i += (s - t) * p,
  31132. t = s,
  31133. a = 0; a < d; ++a)
  31134. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31135. u == t) {
  31136. for (l = i,
  31137. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31138. g = l - h,
  31139. f = _ - h,
  31140. m.push(R(C(h + g % f, 0))),
  31141. l = M(g / f);
  31142. m.push(R(C(l, 0))),
  31143. o = I(i, p, n == r),
  31144. i = 0,
  31145. ++n
  31146. }
  31147. ++i,
  31148. ++t
  31149. }
  31150. return m.join("")
  31151. }
  31152. var o = "object" == typeof L && L && !L.nodeType && L
  31153. , a = "object" == typeof O && O && !O.nodeType && O
  31154. , s = "object" == typeof P && P;
  31155. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31156. 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 = {
  31157. overflow: "Overflow: input needs wider integers to process",
  31158. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31159. "invalid-input": "Invalid input"
  31160. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31161. if (l = {
  31162. version: "1.4.1",
  31163. ucs2: {
  31164. decode: y,
  31165. encode: A
  31166. },
  31167. decode: i,
  31168. encode: n,
  31169. toASCII: function(e) {
  31170. return t(e, function(e) {
  31171. return p.test(e) ? "xn--" + n(e) : e
  31172. })
  31173. },
  31174. toUnicode: function(e) {
  31175. return t(e, function(e) {
  31176. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31177. })
  31178. }
  31179. },
  31180. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31181. define("punycode", function() {
  31182. return l
  31183. });
  31184. else if (o && a)
  31185. if (O.exports == o)
  31186. a.exports = l;
  31187. else
  31188. for (c in l)
  31189. l.hasOwnProperty(c) && (o[c] = l[c]);
  31190. else
  31191. e.punycode = l
  31192. }(this)
  31193. }
  31194. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31195. }
  31196. , {}],
  31197. 205: [function(e, t, i) {
  31198. "use strict";
  31199. t.exports = function(e, t, i, n) {
  31200. t = t || "&",
  31201. i = i || "=";
  31202. var r = {};
  31203. if ("string" != typeof e || 0 === e.length)
  31204. return r;
  31205. var o = /\+/g;
  31206. e = e.split(t);
  31207. var a = 1e3;
  31208. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31209. var s, l, c = e.length;
  31210. 0 < a && a < c && (c = a);
  31211. for (var h = 0; h < c; ++h) {
  31212. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31213. d = 0 <= m ? (u = g.substr(0, m),
  31214. g.substr(m + 1)) : (u = g,
  31215. ""),
  31216. p = decodeURIComponent(u),
  31217. f = decodeURIComponent(d),
  31218. s = r,
  31219. l = p,
  31220. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31221. }
  31222. return r
  31223. }
  31224. ;
  31225. var v = Array.isArray || function(e) {
  31226. return "[object Array]" === Object.prototype.toString.call(e)
  31227. }
  31228. }
  31229. , {}],
  31230. 206: [function(e, t, i) {
  31231. "use strict";
  31232. function o(e, t) {
  31233. if (e.map)
  31234. return e.map(t);
  31235. for (var i = [], n = 0; n < e.length; n++)
  31236. i.push(t(e[n], n));
  31237. return i
  31238. }
  31239. function a(e) {
  31240. switch (typeof e) {
  31241. case "string":
  31242. return e;
  31243. case "boolean":
  31244. return e ? "true" : "false";
  31245. case "number":
  31246. return isFinite(e) ? e : "";
  31247. default:
  31248. return ""
  31249. }
  31250. }
  31251. t.exports = function(i, n, r, e) {
  31252. return n = n || "&",
  31253. r = r || "=",
  31254. null === i && (i = void 0),
  31255. "object" == typeof i ? o(l(i), function(e) {
  31256. var t = encodeURIComponent(a(e)) + r;
  31257. return s(i[e]) ? o(i[e], function(e) {
  31258. return t + encodeURIComponent(a(e))
  31259. }).join(n) : t + encodeURIComponent(a(i[e]))
  31260. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31261. }
  31262. ;
  31263. var s = Array.isArray || function(e) {
  31264. return "[object Array]" === Object.prototype.toString.call(e)
  31265. }
  31266. , l = Object.keys || function(e) {
  31267. var t = [];
  31268. for (var i in e)
  31269. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31270. return t
  31271. }
  31272. }
  31273. , {}],
  31274. 207: [function(e, t, i) {
  31275. "use strict";
  31276. i.decode = i.parse = e("./decode"),
  31277. i.encode = i.stringify = e("./encode")
  31278. }
  31279. , {
  31280. "./decode": 205,
  31281. "./encode": 206
  31282. }],
  31283. 208: [function(e, t, i) {
  31284. "use strict";
  31285. function x() {
  31286. this.protocol = null,
  31287. this.slashes = null,
  31288. this.auth = null,
  31289. this.host = null,
  31290. this.port = null,
  31291. this.hostname = null,
  31292. this.hash = null,
  31293. this.search = null,
  31294. this.query = null,
  31295. this.pathname = null,
  31296. this.path = null,
  31297. this.href = null
  31298. }
  31299. function n(e, t, i) {
  31300. if (e && D.isObject(e) && e instanceof x)
  31301. return e;
  31302. var n = new x;
  31303. return n.parse(e, t, i),
  31304. n
  31305. }
  31306. var L = e("punycode")
  31307. , D = e("./util");
  31308. i.parse = n,
  31309. i.resolve = function(e, t) {
  31310. return n(e, !1, !0).resolve(t)
  31311. }
  31312. ,
  31313. i.resolveObject = function(e, t) {
  31314. return e ? n(e, !1, !0).resolveObject(t) : t
  31315. }
  31316. ,
  31317. i.format = function(e) {
  31318. return D.isString(e) && (e = n(e)),
  31319. e instanceof x ? e.format() : x.prototype.format.call(e)
  31320. }
  31321. ,
  31322. i.Url = x;
  31323. var N = /^([a-z0-9.+-]+:)/i
  31324. , r = /:[0-9]*$/
  31325. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31326. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31327. , B = ["'"].concat(o)
  31328. , V = ["%", "/", "?", ";", "#"].concat(B)
  31329. , k = ["/", "?", "#"]
  31330. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31331. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31332. , z = {
  31333. javascript: !0,
  31334. "javascript:": !0
  31335. }
  31336. , G = {
  31337. javascript: !0,
  31338. "javascript:": !0
  31339. }
  31340. , W = {
  31341. http: !0,
  31342. https: !0,
  31343. ftp: !0,
  31344. gopher: !0,
  31345. file: !0,
  31346. "http:": !0,
  31347. "https:": !0,
  31348. "ftp:": !0,
  31349. "gopher:": !0,
  31350. "file:": !0
  31351. }
  31352. , j = e("querystring");
  31353. x.prototype.parse = function(e, t, i) {
  31354. if (!D.isString(e))
  31355. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31356. var n = e.indexOf("?")
  31357. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31358. , o = e.split(r);
  31359. o[0] = o[0].replace(/\\/g, "/");
  31360. var a = e = o.join(r);
  31361. if (a = a.trim(),
  31362. !i && 1 === e.split("#").length) {
  31363. var s = F.exec(a);
  31364. if (s)
  31365. return this.path = a,
  31366. this.href = a,
  31367. this.pathname = s[1],
  31368. s[2] ? (this.search = s[2],
  31369. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31370. this.query = {}),
  31371. this
  31372. }
  31373. var l = N.exec(a);
  31374. if (l) {
  31375. var c = (l = l[0]).toLowerCase();
  31376. this.protocol = c,
  31377. a = a.substr(l.length)
  31378. }
  31379. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31380. var h = "//" === a.substr(0, 2);
  31381. !h || l && G[l] || (a = a.substr(2),
  31382. this.slashes = !0)
  31383. }
  31384. if (!G[l] && (h || l && !W[l])) {
  31385. for (var u = -1, d = 0; d < k.length; d++) {
  31386. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31387. }
  31388. var p, f;
  31389. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31390. a = a.slice(f + 1),
  31391. this.auth = decodeURIComponent(p)),
  31392. u = -1;
  31393. for (d = 0; d < V.length; d++) {
  31394. var g;
  31395. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31396. }
  31397. -1 === u && (u = a.length),
  31398. this.host = a.slice(0, u),
  31399. a = a.slice(u),
  31400. this.parseHost(),
  31401. this.hostname = this.hostname || "";
  31402. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31403. if (!m)
  31404. for (var v = this.hostname.split(/\./), y = (d = 0,
  31405. v.length); d < y; d++) {
  31406. var A = v[d];
  31407. if (A && !A.match(U)) {
  31408. for (var C = "", I = 0, E = A.length; I < E; I++)
  31409. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31410. if (!C.match(U)) {
  31411. var _ = v.slice(0, d)
  31412. , b = v.slice(d + 1)
  31413. , w = A.match(H);
  31414. w && (_.push(w[1]),
  31415. b.unshift(w[2])),
  31416. b.length && (a = "/" + b.join(".") + a),
  31417. this.hostname = _.join(".");
  31418. break
  31419. }
  31420. }
  31421. }
  31422. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31423. m || (this.hostname = L.toASCII(this.hostname));
  31424. var T = this.port ? ":" + this.port : ""
  31425. , x = this.hostname || "";
  31426. this.host = x + T,
  31427. this.href += this.host,
  31428. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31429. "/" !== a[0] && (a = "/" + a))
  31430. }
  31431. if (!z[c])
  31432. for (d = 0,
  31433. y = B.length; d < y; d++) {
  31434. var S = B[d];
  31435. if (-1 !== a.indexOf(S)) {
  31436. var M = encodeURIComponent(S);
  31437. M === S && (M = escape(S)),
  31438. a = a.split(S).join(M)
  31439. }
  31440. }
  31441. var R = a.indexOf("#");
  31442. -1 !== R && (this.hash = a.substr(R),
  31443. a = a.slice(0, R));
  31444. var P = a.indexOf("?");
  31445. if (-1 !== P ? (this.search = a.substr(P),
  31446. this.query = a.substr(P + 1),
  31447. t && (this.query = j.parse(this.query)),
  31448. a = a.slice(0, P)) : t && (this.search = "",
  31449. this.query = {}),
  31450. a && (this.pathname = a),
  31451. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31452. this.pathname || this.search) {
  31453. T = this.pathname || "";
  31454. var O = this.search || "";
  31455. this.path = T + O
  31456. }
  31457. return this.href = this.format(),
  31458. this
  31459. }
  31460. ,
  31461. x.prototype.format = function() {
  31462. var e = this.auth || "";
  31463. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31464. e += "@");
  31465. var t = this.protocol || ""
  31466. , i = this.pathname || ""
  31467. , n = this.hash || ""
  31468. , r = !1
  31469. , o = "";
  31470. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31471. this.port && (r += ":" + this.port)),
  31472. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31473. var a = this.search || o && "?" + o || "";
  31474. return t && ":" !== t.substr(-1) && (t += ":"),
  31475. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31476. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31477. n && "#" !== n.charAt(0) && (n = "#" + n),
  31478. a && "?" !== a.charAt(0) && (a = "?" + a),
  31479. t + r + (i = i.replace(/[?#]/g, function(e) {
  31480. return encodeURIComponent(e)
  31481. })) + (a = a.replace("#", "%23")) + n
  31482. }
  31483. ,
  31484. x.prototype.resolve = function(e) {
  31485. return this.resolveObject(n(e, !1, !0)).format()
  31486. }
  31487. ,
  31488. x.prototype.resolveObject = function(e) {
  31489. if (D.isString(e)) {
  31490. var t = new x;
  31491. t.parse(e, !1, !0),
  31492. e = t
  31493. }
  31494. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31495. var o = n[r];
  31496. i[o] = this[o]
  31497. }
  31498. if (i.hash = e.hash,
  31499. "" === e.href)
  31500. return i.href = i.format(),
  31501. i;
  31502. if (e.slashes && !e.protocol) {
  31503. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31504. var l = a[s];
  31505. "protocol" !== l && (i[l] = e[l])
  31506. }
  31507. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31508. i.href = i.format(),
  31509. i
  31510. }
  31511. if (e.protocol && e.protocol !== i.protocol) {
  31512. if (!W[e.protocol]) {
  31513. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31514. var u = c[h];
  31515. i[u] = e[u]
  31516. }
  31517. return i.href = i.format(),
  31518. i
  31519. }
  31520. if (i.protocol = e.protocol,
  31521. e.host || G[e.protocol])
  31522. i.pathname = e.pathname;
  31523. else {
  31524. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31525. ;
  31526. e.host || (e.host = ""),
  31527. e.hostname || (e.hostname = ""),
  31528. "" !== d[0] && d.unshift(""),
  31529. d.length < 2 && d.unshift(""),
  31530. i.pathname = d.join("/")
  31531. }
  31532. if (i.search = e.search,
  31533. i.query = e.query,
  31534. i.host = e.host || "",
  31535. i.auth = e.auth,
  31536. i.hostname = e.hostname || e.host,
  31537. i.port = e.port,
  31538. i.pathname || i.search) {
  31539. var p = i.pathname || ""
  31540. , f = i.search || "";
  31541. i.path = p + f
  31542. }
  31543. return i.slashes = i.slashes || e.slashes,
  31544. i.href = i.format(),
  31545. i
  31546. }
  31547. var g = i.pathname && "/" === i.pathname.charAt(0)
  31548. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31549. , v = m || g || i.host && e.pathname
  31550. , y = v
  31551. , A = i.pathname && i.pathname.split("/") || []
  31552. , C = (d = e.pathname && e.pathname.split("/") || [],
  31553. i.protocol && !W[i.protocol]);
  31554. if (C && (i.hostname = "",
  31555. i.port = null,
  31556. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31557. i.host = "",
  31558. e.protocol && (e.hostname = null,
  31559. e.port = null,
  31560. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31561. e.host = null),
  31562. v = v && ("" === d[0] || "" === A[0])),
  31563. m)
  31564. i.host = e.host || "" === e.host ? e.host : i.host,
  31565. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31566. i.search = e.search,
  31567. i.query = e.query,
  31568. A = d;
  31569. else if (d.length)
  31570. (A = A || []).pop(),
  31571. A = A.concat(d),
  31572. i.search = e.search,
  31573. i.query = e.query;
  31574. else if (!D.isNullOrUndefined(e.search)) {
  31575. if (C)
  31576. i.hostname = i.host = A.shift(),
  31577. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31578. i.host = i.hostname = w.shift());
  31579. return i.search = e.search,
  31580. i.query = e.query,
  31581. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31582. i.href = i.format(),
  31583. i
  31584. }
  31585. if (!A.length)
  31586. return i.pathname = null,
  31587. i.search ? i.path = "/" + i.search : i.path = null,
  31588. i.href = i.format(),
  31589. i;
  31590. 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--)
  31591. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31592. _++) : _ && (A.splice(b, 1),
  31593. _--);
  31594. if (!v && !y)
  31595. for (; _--; )
  31596. A.unshift("..");
  31597. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31598. E && "/" !== A.join("/").substr(-1) && A.push("");
  31599. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31600. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31601. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31602. i.host = i.hostname = w.shift()));
  31603. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31604. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31605. i.path = null),
  31606. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31607. i.auth = e.auth || i.auth,
  31608. i.slashes = i.slashes || e.slashes,
  31609. i.href = i.format(),
  31610. i
  31611. }
  31612. ,
  31613. x.prototype.parseHost = function() {
  31614. var e = this.host
  31615. , t = r.exec(e);
  31616. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31617. e = e.substr(0, e.length - t.length)),
  31618. e && (this.hostname = e)
  31619. }
  31620. }
  31621. , {
  31622. "./util": 209,
  31623. punycode: 204,
  31624. querystring: 207
  31625. }],
  31626. 209: [function(e, t, i) {
  31627. "use strict";
  31628. t.exports = {
  31629. isString: function(e) {
  31630. return "string" == typeof e
  31631. },
  31632. isObject: function(e) {
  31633. return "object" == typeof e && null !== e
  31634. },
  31635. isNull: function(e) {
  31636. return null === e
  31637. },
  31638. isNullOrUndefined: function(e) {
  31639. return null == e
  31640. }
  31641. }
  31642. }
  31643. , {}],
  31644. 210: [function(e, t, i) {
  31645. "use strict";
  31646. function r(e) {
  31647. return c + e
  31648. }
  31649. function s(e) {
  31650. if ("string" != typeof e)
  31651. throw new TypeError("key must be a string.")
  31652. }
  31653. var l = Object.prototype.hasOwnProperty
  31654. , c = "~";
  31655. t.exports = function(t) {
  31656. var o = Object.create(null)
  31657. , n = 0
  31658. , a = {};
  31659. return function(e, t) {
  31660. for (var i in t)
  31661. Object.defineProperty(e, i, {
  31662. value: t[i],
  31663. configurable: !0,
  31664. writable: !0
  31665. })
  31666. }(a, {
  31667. get: function(e, t) {
  31668. s(e);
  31669. var i = r(e);
  31670. return i in o ? o[i] : t
  31671. },
  31672. set: function(e, t) {
  31673. s(e);
  31674. var i = r(e);
  31675. return i in o || ++n,
  31676. o[i] = t
  31677. },
  31678. has: function(e) {
  31679. return s(e),
  31680. r(e)in o
  31681. },
  31682. delete: function(e) {
  31683. s(e);
  31684. var t = r(e);
  31685. return t in o && (--n,
  31686. delete o[t],
  31687. !0)
  31688. },
  31689. clear: function() {
  31690. o = Object.create(null),
  31691. n = 0
  31692. },
  31693. forEach: function(e, t) {
  31694. if ("function" != typeof e)
  31695. throw new TypeError("`callback` must be a function");
  31696. for (var i in o)
  31697. if (l.call(o, i)) {
  31698. var n = i.substring(c.length)
  31699. , r = o[i];
  31700. e.call(t, r, n, a)
  31701. }
  31702. }
  31703. }),
  31704. Object.defineProperty(a, "size", {
  31705. get: function() {
  31706. return n
  31707. },
  31708. configurable: !0
  31709. }),
  31710. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31711. a.set(e, t[e])
  31712. }),
  31713. a
  31714. }
  31715. }
  31716. , {}],
  31717. 211: [function(e, t, i) {
  31718. t.exports = e("./lib/heap")
  31719. }
  31720. , {
  31721. "./lib/heap": 212
  31722. }],
  31723. 212: [function(e, y, A) {
  31724. (function() {
  31725. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31726. function v(e) {
  31727. this.cmp = null != e ? e : d,
  31728. this.nodes = []
  31729. }
  31730. l = Math.floor,
  31731. m = Math.min,
  31732. d = function(e, t) {
  31733. return e < t ? -1 : t < e ? 1 : 0
  31734. }
  31735. ,
  31736. g = function(e, t, i, n, r) {
  31737. var o;
  31738. if (null == i && (i = 0),
  31739. null == r && (r = d),
  31740. i < 0)
  31741. throw new Error("lo must be non-negative");
  31742. for (null == n && (n = e.length); i < n; )
  31743. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31744. return [].splice.apply(e, [i, i - i].concat(t)),
  31745. t
  31746. }
  31747. ,
  31748. t = function(e, t, i) {
  31749. return null == i && (i = d),
  31750. e.push(t),
  31751. h(e, 0, e.length - 1, i)
  31752. }
  31753. ,
  31754. f = function(e, t) {
  31755. var i, n;
  31756. return null == t && (t = d),
  31757. i = e.pop(),
  31758. e.length ? (n = e[0],
  31759. e[0] = i,
  31760. u(e, 0, t)) : n = i,
  31761. n
  31762. }
  31763. ,
  31764. i = function(e, t, i) {
  31765. var n;
  31766. return null == i && (i = d),
  31767. n = e[0],
  31768. e[0] = t,
  31769. u(e, 0, i),
  31770. n
  31771. }
  31772. ,
  31773. c = function(e, t, i) {
  31774. var n;
  31775. return null == i && (i = d),
  31776. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31777. e[0] = n[1],
  31778. u(e, 0, i)),
  31779. t
  31780. }
  31781. ,
  31782. p = function(i, e) {
  31783. var t, n, r, o, a, s;
  31784. for (null == e && (e = d),
  31785. a = [],
  31786. n = 0,
  31787. r = (o = function() {
  31788. s = [];
  31789. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31790. s.push(e);
  31791. return s
  31792. }
  31793. .apply(this).reverse()).length; n < r; n++)
  31794. t = o[n],
  31795. a.push(u(i, t, e));
  31796. return a
  31797. }
  31798. ,
  31799. o = function(e, t, i) {
  31800. var n;
  31801. if (null == i && (i = d),
  31802. -1 !== (n = e.indexOf(t)))
  31803. return h(e, 0, n, i),
  31804. u(e, n, i)
  31805. }
  31806. ,
  31807. n = function(e, t, i) {
  31808. var n, r, o, a, s;
  31809. if (null == i && (i = d),
  31810. !(r = e.slice(0, t)).length)
  31811. return r;
  31812. for (p(r, i),
  31813. o = 0,
  31814. a = (s = e.slice(t)).length; o < a; o++)
  31815. n = s[o],
  31816. c(r, n, i);
  31817. return r.sort(i).reverse()
  31818. }
  31819. ,
  31820. r = function(e, t, i) {
  31821. var n, r, o, a, s, l, c, h, u;
  31822. if (null == i && (i = d),
  31823. 10 * t <= e.length) {
  31824. if (!(o = e.slice(0, t).sort(i)).length)
  31825. return o;
  31826. for (r = o[o.length - 1],
  31827. a = 0,
  31828. l = (c = e.slice(t)).length; a < l; a++)
  31829. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31830. o.pop(),
  31831. r = o[o.length - 1]);
  31832. return o
  31833. }
  31834. for (p(e, i),
  31835. u = [],
  31836. s = 0,
  31837. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31838. u.push(f(e, i));
  31839. return u
  31840. }
  31841. ,
  31842. h = function(e, t, i, n) {
  31843. var r, o, a;
  31844. for (null == n && (n = d),
  31845. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31846. e[i] = o,
  31847. i = a;
  31848. return e[i] = r
  31849. }
  31850. ,
  31851. u = function(e, t, i) {
  31852. var n, r, o, a, s;
  31853. for (null == i && (i = d),
  31854. r = e.length,
  31855. o = e[s = t],
  31856. n = 2 * t + 1; n < r; )
  31857. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31858. e[t] = e[n],
  31859. n = 2 * (t = n) + 1;
  31860. return e[t] = o,
  31861. h(e, s, t, i)
  31862. }
  31863. ,
  31864. v.push = t,
  31865. v.pop = f,
  31866. v.replace = i,
  31867. v.pushpop = c,
  31868. v.heapify = p,
  31869. v.updateItem = o,
  31870. v.nlargest = n,
  31871. v.nsmallest = r,
  31872. v.prototype.push = function(e) {
  31873. return t(this.nodes, e, this.cmp)
  31874. }
  31875. ,
  31876. v.prototype.pop = function() {
  31877. return f(this.nodes, this.cmp)
  31878. }
  31879. ,
  31880. v.prototype.peek = function() {
  31881. return this.nodes[0]
  31882. }
  31883. ,
  31884. v.prototype.contains = function(e) {
  31885. return -1 !== this.nodes.indexOf(e)
  31886. }
  31887. ,
  31888. v.prototype.replace = function(e) {
  31889. return i(this.nodes, e, this.cmp)
  31890. }
  31891. ,
  31892. v.prototype.pushpop = function(e) {
  31893. return c(this.nodes, e, this.cmp)
  31894. }
  31895. ,
  31896. v.prototype.heapify = function() {
  31897. return p(this.nodes, this.cmp)
  31898. }
  31899. ,
  31900. v.prototype.updateItem = function(e) {
  31901. return o(this.nodes, e, this.cmp)
  31902. }
  31903. ,
  31904. v.prototype.clear = function() {
  31905. return this.nodes = []
  31906. }
  31907. ,
  31908. v.prototype.empty = function() {
  31909. return 0 === this.nodes.length
  31910. }
  31911. ,
  31912. v.prototype.size = function() {
  31913. return this.nodes.length
  31914. }
  31915. ,
  31916. v.prototype.clone = function() {
  31917. var e;
  31918. return (e = new v).nodes = this.nodes.slice(0),
  31919. e
  31920. }
  31921. ,
  31922. v.prototype.toArray = function() {
  31923. return this.nodes.slice(0)
  31924. }
  31925. ,
  31926. v.prototype.insert = v.prototype.push,
  31927. v.prototype.top = v.prototype.peek,
  31928. v.prototype.front = v.prototype.peek,
  31929. v.prototype.has = v.prototype.contains,
  31930. v.prototype.copy = v.prototype.clone,
  31931. e = v,
  31932. a = this,
  31933. s = function() {
  31934. return e
  31935. }
  31936. ,
  31937. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31938. }
  31939. ).call(this)
  31940. }
  31941. , {}],
  31942. 213: [function(e, t, i) {
  31943. function n() {}
  31944. function o(e) {
  31945. if ("object" != typeof this)
  31946. throw new TypeError("Promises must be constructed via new");
  31947. if ("function" != typeof e)
  31948. throw new TypeError("not a function");
  31949. this._state = 0,
  31950. this._handled = !1,
  31951. this._value = void 0,
  31952. this._deferreds = [],
  31953. h(e, this)
  31954. }
  31955. function r(i, n) {
  31956. for (; 3 === i._state; )
  31957. i = i._value;
  31958. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31959. void o._immediateFn(function() {
  31960. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31961. if (null !== e) {
  31962. var t;
  31963. try {
  31964. t = e(i._value)
  31965. } catch (e) {
  31966. return void s(n.promise, e)
  31967. }
  31968. a(n.promise, t)
  31969. } else
  31970. (1 === i._state ? a : s)(n.promise, i._value)
  31971. }))
  31972. }
  31973. function a(e, t) {
  31974. try {
  31975. if (t === e)
  31976. throw new TypeError("A promise cannot be resolved with itself.");
  31977. if (t && ("object" == typeof t || "function" == typeof t)) {
  31978. var i = t.then;
  31979. if (t instanceof o)
  31980. return e._state = 3,
  31981. e._value = t,
  31982. void l(e);
  31983. if ("function" == typeof i)
  31984. return void h(function(e, t) {
  31985. return function() {
  31986. e.apply(t, arguments)
  31987. }
  31988. }(i, t), e)
  31989. }
  31990. e._state = 1,
  31991. e._value = t,
  31992. l(e)
  31993. } catch (t) {
  31994. s(e, t)
  31995. }
  31996. }
  31997. function s(e, t) {
  31998. e._state = 2,
  31999. e._value = t,
  32000. l(e)
  32001. }
  32002. function l(e) {
  32003. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32004. e._handled || o._unhandledRejectionFn(e._value)
  32005. });
  32006. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32007. r(e, e._deferreds[t]);
  32008. e._deferreds = null
  32009. }
  32010. function c(e, t, i) {
  32011. this.onFulfilled = "function" == typeof e ? e : null,
  32012. this.onRejected = "function" == typeof t ? t : null,
  32013. this.promise = i
  32014. }
  32015. function h(e, t) {
  32016. var i = !1;
  32017. try {
  32018. e(function(e) {
  32019. i || (i = !0,
  32020. a(t, e))
  32021. }, function(e) {
  32022. i || (i = !0,
  32023. s(t, e))
  32024. })
  32025. } catch (e) {
  32026. if (i)
  32027. return;
  32028. i = !0,
  32029. s(t, e)
  32030. }
  32031. }
  32032. var u, d;
  32033. u = this,
  32034. d = setTimeout,
  32035. o.prototype.catch = function(e) {
  32036. return this.then(null, e)
  32037. }
  32038. ,
  32039. o.prototype.then = function(e, t) {
  32040. var i = new this.constructor(n);
  32041. return r(this, new c(e,t,i)),
  32042. i
  32043. }
  32044. ,
  32045. o.all = function(e) {
  32046. var s = Array.prototype.slice.call(e);
  32047. return new o(function(n, r) {
  32048. function o(t, e) {
  32049. try {
  32050. if (e && ("object" == typeof e || "function" == typeof e)) {
  32051. var i = e.then;
  32052. if ("function" == typeof i)
  32053. return void i.call(e, function(e) {
  32054. o(t, e)
  32055. }, r)
  32056. }
  32057. s[t] = e,
  32058. 0 == --a && n(s)
  32059. } catch (e) {
  32060. r(e)
  32061. }
  32062. }
  32063. if (0 === s.length)
  32064. return n([]);
  32065. for (var a = s.length, e = 0; e < s.length; e++)
  32066. o(e, s[e])
  32067. }
  32068. )
  32069. }
  32070. ,
  32071. o.resolve = function(t) {
  32072. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32073. e(t)
  32074. }
  32075. )
  32076. }
  32077. ,
  32078. o.reject = function(i) {
  32079. return new o(function(e, t) {
  32080. t(i)
  32081. }
  32082. )
  32083. }
  32084. ,
  32085. o.race = function(r) {
  32086. return new o(function(e, t) {
  32087. for (var i = 0, n = r.length; i < n; i++)
  32088. r[i].then(e, t)
  32089. }
  32090. )
  32091. }
  32092. ,
  32093. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32094. setImmediate(e)
  32095. }
  32096. || function(e) {
  32097. d(e, 0)
  32098. }
  32099. ,
  32100. o._unhandledRejectionFn = function(e) {
  32101. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32102. }
  32103. ,
  32104. o._setImmediateFn = function(e) {
  32105. o._immediateFn = e
  32106. }
  32107. ,
  32108. o._setUnhandledRejectionFn = function(e) {
  32109. o._unhandledRejectionFn = e
  32110. }
  32111. ,
  32112. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32113. }
  32114. , {}],
  32115. 214: [function(p, i, e) {
  32116. (function(d) {
  32117. var e, t;
  32118. e = this,
  32119. t = function(I, e) {
  32120. "use strict";
  32121. var a, t, u, i, s, n, r, o = {};
  32122. return o.ByteBuffer = I,
  32123. o.Long = I.Long || null,
  32124. o.VERSION = "5.0.1",
  32125. o.WIRE_TYPES = {},
  32126. o.WIRE_TYPES.VARINT = 0,
  32127. o.WIRE_TYPES.BITS64 = 1,
  32128. o.WIRE_TYPES.LDELIM = 2,
  32129. o.WIRE_TYPES.STARTGROUP = 3,
  32130. o.WIRE_TYPES.ENDGROUP = 4,
  32131. o.WIRE_TYPES.BITS32 = 5,
  32132. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32133. o.TYPES = {
  32134. int32: {
  32135. name: "int32",
  32136. wireType: o.WIRE_TYPES.VARINT,
  32137. defaultValue: 0
  32138. },
  32139. uint32: {
  32140. name: "uint32",
  32141. wireType: o.WIRE_TYPES.VARINT,
  32142. defaultValue: 0
  32143. },
  32144. sint32: {
  32145. name: "sint32",
  32146. wireType: o.WIRE_TYPES.VARINT,
  32147. defaultValue: 0
  32148. },
  32149. int64: {
  32150. name: "int64",
  32151. wireType: o.WIRE_TYPES.VARINT,
  32152. defaultValue: o.Long ? o.Long.ZERO : void 0
  32153. },
  32154. uint64: {
  32155. name: "uint64",
  32156. wireType: o.WIRE_TYPES.VARINT,
  32157. defaultValue: o.Long ? o.Long.UZERO : void 0
  32158. },
  32159. sint64: {
  32160. name: "sint64",
  32161. wireType: o.WIRE_TYPES.VARINT,
  32162. defaultValue: o.Long ? o.Long.ZERO : void 0
  32163. },
  32164. bool: {
  32165. name: "bool",
  32166. wireType: o.WIRE_TYPES.VARINT,
  32167. defaultValue: !1
  32168. },
  32169. double: {
  32170. name: "double",
  32171. wireType: o.WIRE_TYPES.BITS64,
  32172. defaultValue: 0
  32173. },
  32174. string: {
  32175. name: "string",
  32176. wireType: o.WIRE_TYPES.LDELIM,
  32177. defaultValue: ""
  32178. },
  32179. bytes: {
  32180. name: "bytes",
  32181. wireType: o.WIRE_TYPES.LDELIM,
  32182. defaultValue: null
  32183. },
  32184. fixed32: {
  32185. name: "fixed32",
  32186. wireType: o.WIRE_TYPES.BITS32,
  32187. defaultValue: 0
  32188. },
  32189. sfixed32: {
  32190. name: "sfixed32",
  32191. wireType: o.WIRE_TYPES.BITS32,
  32192. defaultValue: 0
  32193. },
  32194. fixed64: {
  32195. name: "fixed64",
  32196. wireType: o.WIRE_TYPES.BITS64,
  32197. defaultValue: o.Long ? o.Long.UZERO : void 0
  32198. },
  32199. sfixed64: {
  32200. name: "sfixed64",
  32201. wireType: o.WIRE_TYPES.BITS64,
  32202. defaultValue: o.Long ? o.Long.ZERO : void 0
  32203. },
  32204. float: {
  32205. name: "float",
  32206. wireType: o.WIRE_TYPES.BITS32,
  32207. defaultValue: 0
  32208. },
  32209. enum: {
  32210. name: "enum",
  32211. wireType: o.WIRE_TYPES.VARINT,
  32212. defaultValue: 0
  32213. },
  32214. message: {
  32215. name: "message",
  32216. wireType: o.WIRE_TYPES.LDELIM,
  32217. defaultValue: null
  32218. },
  32219. group: {
  32220. name: "group",
  32221. wireType: o.WIRE_TYPES.STARTGROUP,
  32222. defaultValue: null
  32223. }
  32224. },
  32225. 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],
  32226. o.ID_MIN = 1,
  32227. o.ID_MAX = 536870911,
  32228. o.convertFieldsToCamelCase = !1,
  32229. o.populateAccessors = !0,
  32230. o.populateDefaults = !0,
  32231. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32232. r.XHR = function() {
  32233. for (var e = [function() {
  32234. return new XMLHttpRequest
  32235. }
  32236. , function() {
  32237. return new ActiveXObject("Msxml2.XMLHTTP")
  32238. }
  32239. , function() {
  32240. return new ActiveXObject("Msxml3.XMLHTTP")
  32241. }
  32242. , function() {
  32243. return new ActiveXObject("Microsoft.XMLHTTP")
  32244. }
  32245. ], t = null, i = 0; i < e.length; i++) {
  32246. try {
  32247. t = e[i]()
  32248. } catch (e) {
  32249. continue
  32250. }
  32251. break
  32252. }
  32253. if (!t)
  32254. throw Error("XMLHttpRequest is not supported");
  32255. return t
  32256. }
  32257. ,
  32258. r.fetch = function(e, i) {
  32259. if (i && "function" != typeof i && (i = null),
  32260. r.IS_NODE) {
  32261. var t = p("fs");
  32262. if (i)
  32263. t.readFile(e, function(e, t) {
  32264. i(e ? null : "" + t)
  32265. });
  32266. else
  32267. try {
  32268. return t.readFileSync(e)
  32269. } catch (e) {
  32270. return null
  32271. }
  32272. } else {
  32273. var n = r.XHR();
  32274. if (n.open("GET", e, !!i),
  32275. n.setRequestHeader("Accept", "text/plain"),
  32276. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32277. !i)
  32278. return n.send(null),
  32279. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32280. if (n.onreadystatechange = function() {
  32281. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32282. }
  32283. ,
  32284. 4 == n.readyState)
  32285. return;
  32286. n.send(null)
  32287. }
  32288. }
  32289. ,
  32290. r.toCamelCase = function(e) {
  32291. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32292. return t.toUpperCase()
  32293. })
  32294. }
  32295. ,
  32296. r),
  32297. o.Lang = {
  32298. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32299. RULE: /^(?:required|optional|repeated|map)$/,
  32300. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32301. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32302. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32303. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32304. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32305. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32306. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32307. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32308. NUMBER_OCT: /^0[0-7]+$/,
  32309. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32310. BOOL: /^(?:true|false)$/i,
  32311. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32312. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32313. WHITESPACE: /\s/,
  32314. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32315. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32316. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32317. },
  32318. o.DotProto = function(r, a) {
  32319. function s(e, t) {
  32320. var i = -1
  32321. , n = 1;
  32322. if ("-" == e.charAt(0) && (n = -1,
  32323. e = e.substring(1)),
  32324. a.NUMBER_DEC.test(e))
  32325. i = parseInt(e);
  32326. else if (a.NUMBER_HEX.test(e))
  32327. i = parseInt(e.substring(2), 16);
  32328. else {
  32329. if (!a.NUMBER_OCT.test(e))
  32330. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32331. i = parseInt(e.substring(1), 8)
  32332. }
  32333. if (i = n * i | 0,
  32334. !t && i < 0)
  32335. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32336. return i
  32337. }
  32338. function o(e) {
  32339. var t = 1;
  32340. if ("-" == e.charAt(0) && (t = -1,
  32341. e = e.substring(1)),
  32342. a.NUMBER_DEC.test(e))
  32343. return t * parseInt(e, 10);
  32344. if (a.NUMBER_HEX.test(e))
  32345. return t * parseInt(e.substring(2), 16);
  32346. if (a.NUMBER_OCT.test(e))
  32347. return t * parseInt(e.substring(1), 8);
  32348. if ("inf" === e)
  32349. return t * (1 / 0);
  32350. if ("nan" === e)
  32351. return NaN;
  32352. if (a.NUMBER_FLT.test(e))
  32353. return t * parseFloat(e);
  32354. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32355. }
  32356. function n(e, t, i) {
  32357. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32358. e[t].push(i))
  32359. }
  32360. function t(e) {
  32361. this.source = e + "",
  32362. this.index = 0,
  32363. this.line = 1,
  32364. this.stack = [],
  32365. this._stringOpen = null
  32366. }
  32367. var e = {}
  32368. , i = t.prototype;
  32369. i._readString = function() {
  32370. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32371. e.lastIndex = this.index - 1;
  32372. var t = e.exec(this.source);
  32373. if (!t)
  32374. throw Error("unterminated string");
  32375. return this.index = e.lastIndex,
  32376. this.stack.push(this._stringOpen),
  32377. this._stringOpen = null,
  32378. t[1]
  32379. }
  32380. ,
  32381. i.next = function() {
  32382. if (0 < this.stack.length)
  32383. return this.stack.shift();
  32384. if (this.index >= this.source.length)
  32385. return null;
  32386. if (null !== this._stringOpen)
  32387. return this._readString();
  32388. var e, t, i;
  32389. do {
  32390. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32391. if ("\n" === i && ++this.line,
  32392. ++this.index === this.source.length)
  32393. return null;
  32394. if ("/" === this.source.charAt(this.index))
  32395. if (++this.index,
  32396. "/" === this.source.charAt(this.index)) {
  32397. for (; "\n" !== this.source.charAt(++this.index); )
  32398. if (this.index == this.source.length)
  32399. return null;
  32400. ++this.index,
  32401. ++this.line,
  32402. e = !0
  32403. } else {
  32404. if ("*" !== (i = this.source.charAt(this.index)))
  32405. return "/";
  32406. do {
  32407. if ("\n" === i && ++this.line,
  32408. ++this.index === this.source.length)
  32409. return null;
  32410. t = i,
  32411. i = this.source.charAt(this.index)
  32412. } while ("*" !== t || "/" !== i);++this.index,
  32413. e = !0
  32414. }
  32415. } while (e);if (this.index === this.source.length)
  32416. return null;
  32417. var n = this.index;
  32418. if (a.DELIM.lastIndex = 0,
  32419. !a.DELIM.test(this.source.charAt(n++)))
  32420. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32421. ++n;
  32422. var r = this.source.substring(this.index, this.index = n);
  32423. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32424. r
  32425. }
  32426. ,
  32427. i.peek = function() {
  32428. if (0 === this.stack.length) {
  32429. var e = this.next();
  32430. if (null === e)
  32431. return null;
  32432. this.stack.push(e)
  32433. }
  32434. return this.stack[0]
  32435. }
  32436. ,
  32437. i.skip = function(e) {
  32438. var t = this.next();
  32439. if (t !== e)
  32440. throw Error("illegal '" + t + "', '" + e + "' expected")
  32441. }
  32442. ,
  32443. i.omit = function(e) {
  32444. return this.peek() === e && (this.next(),
  32445. !0)
  32446. }
  32447. ,
  32448. i.toString = function() {
  32449. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32450. }
  32451. ,
  32452. e.Tokenizer = t;
  32453. function l(e) {
  32454. this.tn = new t(e),
  32455. this.proto3 = !1
  32456. }
  32457. var c = l.prototype;
  32458. return c.parse = function() {
  32459. var e, t, i = {
  32460. name: "[ROOT]",
  32461. package: null,
  32462. messages: [],
  32463. enums: [],
  32464. imports: [],
  32465. options: {},
  32466. services: []
  32467. }, n = !0;
  32468. try {
  32469. for (; e = this.tn.next(); )
  32470. switch (e) {
  32471. case "package":
  32472. if (!n || null !== i.package)
  32473. throw Error("unexpected 'package'");
  32474. if (e = this.tn.next(),
  32475. !a.TYPEREF.test(e))
  32476. throw Error("illegal package name: " + e);
  32477. this.tn.skip(";"),
  32478. i.package = e;
  32479. break;
  32480. case "import":
  32481. if (!n)
  32482. throw Error("unexpected 'import'");
  32483. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32484. e = this._readString(),
  32485. this.tn.skip(";"),
  32486. t || i.imports.push(e);
  32487. break;
  32488. case "syntax":
  32489. if (!n)
  32490. throw Error("unexpected 'syntax'");
  32491. this.tn.skip("="),
  32492. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32493. this.tn.skip(";");
  32494. break;
  32495. case "message":
  32496. this._parseMessage(i, null),
  32497. n = !1;
  32498. break;
  32499. case "enum":
  32500. this._parseEnum(i),
  32501. n = !1;
  32502. break;
  32503. case "option":
  32504. this._parseOption(i);
  32505. break;
  32506. case "service":
  32507. this._parseService(i);
  32508. break;
  32509. case "extend":
  32510. this._parseExtend(i);
  32511. break;
  32512. default:
  32513. throw Error("unexpected '" + e + "'")
  32514. }
  32515. } catch (e) {
  32516. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32517. e
  32518. }
  32519. return delete i.name,
  32520. i
  32521. }
  32522. ,
  32523. l.parse = function(e) {
  32524. return new l(e).parse()
  32525. }
  32526. ,
  32527. c._readString = function() {
  32528. var e, t, i = "";
  32529. do {
  32530. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32531. throw Error("illegal string delimiter: " + t);
  32532. i += this.tn.next(),
  32533. this.tn.skip(t),
  32534. e = this.tn.peek()
  32535. } while ('"' === e || '"' === e);return i
  32536. }
  32537. ,
  32538. c._readValue = function(e) {
  32539. var t = this.tn.peek();
  32540. if ('"' === t || "'" === t)
  32541. return this._readString();
  32542. if (this.tn.next(),
  32543. a.NUMBER.test(t))
  32544. return o(t);
  32545. if (a.BOOL.test(t))
  32546. return "true" === t.toLowerCase();
  32547. if (e && a.TYPEREF.test(t))
  32548. return t;
  32549. throw Error("illegal value: " + t)
  32550. }
  32551. ,
  32552. c._parseOption = function(e, t) {
  32553. var i = this.tn.next()
  32554. , n = !1;
  32555. if ("(" === i && (n = !0,
  32556. i = this.tn.next()),
  32557. !a.TYPEREF.test(i))
  32558. throw Error("illegal option name: " + i);
  32559. var r = i;
  32560. n && (this.tn.skip(")"),
  32561. r = "(" + r + ")",
  32562. i = this.tn.peek(),
  32563. a.FQTYPEREF.test(i) && (r += i,
  32564. this.tn.next())),
  32565. this.tn.skip("="),
  32566. this._parseOptionValue(e, r),
  32567. t || this.tn.skip(";")
  32568. }
  32569. ,
  32570. c._parseOptionValue = function(e, t) {
  32571. var i = this.tn.peek();
  32572. if ("{" !== i)
  32573. n(e.options, t, this._readValue(!0));
  32574. else
  32575. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32576. if (!a.NAME.test(i))
  32577. throw Error("illegal option name: " + t + "." + i);
  32578. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32579. }
  32580. }
  32581. ,
  32582. c._parseService = function(e) {
  32583. var t = this.tn.next();
  32584. if (!a.NAME.test(t))
  32585. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32586. var i = {
  32587. name: t,
  32588. rpc: {},
  32589. options: {}
  32590. };
  32591. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32592. if ("option" === t)
  32593. this._parseOption(i);
  32594. else {
  32595. if ("rpc" !== t)
  32596. throw Error("illegal service token: " + t);
  32597. this._parseServiceRPC(i)
  32598. }
  32599. this.tn.omit(";"),
  32600. e.services.push(i)
  32601. }
  32602. ,
  32603. c._parseServiceRPC = function(e) {
  32604. var t = this.tn.next();
  32605. if (!a.NAME.test(t))
  32606. throw Error("illegal rpc service method name: " + t);
  32607. var i = t
  32608. , n = {
  32609. request: null,
  32610. response: null,
  32611. request_stream: !1,
  32612. response_stream: !1,
  32613. options: {}
  32614. };
  32615. if (this.tn.skip("("),
  32616. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32617. t = this.tn.next()),
  32618. !a.TYPEREF.test(t))
  32619. throw Error("illegal rpc service request type: " + t);
  32620. if (n.request = t,
  32621. this.tn.skip(")"),
  32622. "returns" !== (t = this.tn.next()).toLowerCase())
  32623. throw Error("illegal rpc service request type delimiter: " + t);
  32624. if (this.tn.skip("("),
  32625. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32626. t = this.tn.next()),
  32627. n.response = t,
  32628. this.tn.skip(")"),
  32629. "{" === (t = this.tn.peek())) {
  32630. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32631. if ("option" !== t)
  32632. throw Error("illegal rpc service token: " + t);
  32633. this._parseOption(n)
  32634. }
  32635. this.tn.omit(";")
  32636. } else
  32637. this.tn.skip(";");
  32638. void 0 === e.rpc && (e.rpc = {}),
  32639. e.rpc[i] = n
  32640. }
  32641. ,
  32642. c._parseMessage = function(e, t) {
  32643. var i = !!t
  32644. , n = this.tn.next()
  32645. , r = {
  32646. name: "",
  32647. fields: [],
  32648. enums: [],
  32649. messages: [],
  32650. options: {},
  32651. services: [],
  32652. oneofs: {}
  32653. };
  32654. if (!a.NAME.test(n))
  32655. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32656. for (r.name = n,
  32657. i && (this.tn.skip("="),
  32658. t.id = s(this.tn.next()),
  32659. r.isGroup = !0),
  32660. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32661. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32662. if (a.RULE.test(n))
  32663. this._parseMessageField(r, n);
  32664. else if ("oneof" === n)
  32665. this._parseMessageOneOf(r);
  32666. else if ("enum" === n)
  32667. this._parseEnum(r);
  32668. else if ("message" === n)
  32669. this._parseMessage(r);
  32670. else if ("option" === n)
  32671. this._parseOption(r);
  32672. else if ("service" === n)
  32673. this._parseService(r);
  32674. else if ("extensions" === n)
  32675. r.extensions = this._parseExtensionRanges();
  32676. else if ("reserved" === n)
  32677. this._parseIgnored();
  32678. else if ("extend" === n)
  32679. this._parseExtend(r);
  32680. else {
  32681. if (!a.TYPEREF.test(n))
  32682. throw Error("illegal message token: " + n);
  32683. if (!this.proto3)
  32684. throw Error("illegal field rule: " + n);
  32685. this._parseMessageField(r, "optional", n)
  32686. }
  32687. return this.tn.omit(";"),
  32688. e.messages.push(r),
  32689. r
  32690. }
  32691. ,
  32692. c._parseIgnored = function() {
  32693. for (; ";" !== this.tn.peek(); )
  32694. this.tn.next();
  32695. this.tn.skip(";")
  32696. }
  32697. ,
  32698. c._parseMessageField = function(e, t, i) {
  32699. if (!a.RULE.test(t))
  32700. throw Error("illegal message field rule: " + t);
  32701. var n, r = {
  32702. rule: t,
  32703. type: "",
  32704. name: "",
  32705. options: {},
  32706. id: 0
  32707. };
  32708. if ("map" === t) {
  32709. if (i)
  32710. throw Error("illegal type: " + i);
  32711. if (this.tn.skip("<"),
  32712. n = this.tn.next(),
  32713. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32714. throw Error("illegal message field type: " + n);
  32715. if (r.keytype = n,
  32716. this.tn.skip(","),
  32717. n = this.tn.next(),
  32718. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32719. throw Error("illegal message field: " + n);
  32720. if (r.type = n,
  32721. this.tn.skip(">"),
  32722. n = this.tn.next(),
  32723. !a.NAME.test(n))
  32724. throw Error("illegal message field name: " + n);
  32725. r.name = n,
  32726. this.tn.skip("="),
  32727. r.id = s(this.tn.next()),
  32728. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32729. this.tn.skip(";")
  32730. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32731. var o = this._parseMessage(e, r);
  32732. if (!/^[A-Z]/.test(o.name))
  32733. throw Error("illegal group name: " + o.name);
  32734. r.type = o.name,
  32735. r.name = o.name.toLowerCase(),
  32736. this.tn.omit(";")
  32737. } else {
  32738. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32739. throw Error("illegal message field type: " + i);
  32740. if (r.type = i,
  32741. n = this.tn.next(),
  32742. !a.NAME.test(n))
  32743. throw Error("illegal message field name: " + n);
  32744. r.name = n,
  32745. this.tn.skip("="),
  32746. r.id = s(this.tn.next()),
  32747. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32748. this.tn.skip(";")
  32749. }
  32750. return e.fields.push(r),
  32751. r
  32752. }
  32753. ,
  32754. c._parseMessageOneOf = function(e) {
  32755. var t = this.tn.next();
  32756. if (!a.NAME.test(t))
  32757. throw Error("illegal oneof name: " + t);
  32758. var i, n = t, r = [];
  32759. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32760. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32761. r.push(i.id);
  32762. this.tn.omit(";"),
  32763. e.oneofs[n] = r
  32764. }
  32765. ,
  32766. c._parseFieldOptions = function(e) {
  32767. this.tn.skip("[");
  32768. for (var t = !0; "]" !== this.tn.peek(); )
  32769. t || this.tn.skip(","),
  32770. this._parseOption(e, !0),
  32771. t = !1;
  32772. this.tn.next()
  32773. }
  32774. ,
  32775. c._parseEnum = function(e) {
  32776. var t = {
  32777. name: "",
  32778. values: [],
  32779. options: {}
  32780. }
  32781. , i = this.tn.next();
  32782. if (!a.NAME.test(i))
  32783. throw Error("illegal name: " + i);
  32784. for (t.name = i,
  32785. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32786. if ("option" === i)
  32787. this._parseOption(t);
  32788. else {
  32789. if (!a.NAME.test(i))
  32790. throw Error("illegal name: " + i);
  32791. this.tn.skip("=");
  32792. var n = {
  32793. name: i,
  32794. id: s(this.tn.next(), !0)
  32795. };
  32796. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32797. options: {}
  32798. }),
  32799. this.tn.skip(";"),
  32800. t.values.push(n)
  32801. }
  32802. this.tn.omit(";"),
  32803. e.enums.push(t)
  32804. }
  32805. ,
  32806. c._parseExtensionRanges = function() {
  32807. var e, t, i, n = [];
  32808. do {
  32809. for (t = []; ; ) {
  32810. switch (e = this.tn.next()) {
  32811. case "min":
  32812. i = r.ID_MIN;
  32813. break;
  32814. case "max":
  32815. i = r.ID_MAX;
  32816. break;
  32817. default:
  32818. i = o(e)
  32819. }
  32820. if (t.push(i),
  32821. 2 === t.length)
  32822. break;
  32823. if ("to" !== this.tn.peek()) {
  32824. t.push(i);
  32825. break
  32826. }
  32827. this.tn.next()
  32828. }
  32829. n.push(t)
  32830. } while (this.tn.omit(","));return this.tn.skip(";"),
  32831. n
  32832. }
  32833. ,
  32834. c._parseExtend = function(e) {
  32835. var t = this.tn.next();
  32836. if (!a.TYPEREF.test(t))
  32837. throw Error("illegal extend reference: " + t);
  32838. var i = {
  32839. ref: t,
  32840. fields: []
  32841. };
  32842. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32843. if (a.RULE.test(t))
  32844. this._parseMessageField(i, t);
  32845. else {
  32846. if (!a.TYPEREF.test(t))
  32847. throw Error("illegal extend token: " + t);
  32848. if (!this.proto3)
  32849. throw Error("illegal field rule: " + t);
  32850. this._parseMessageField(i, "optional", t)
  32851. }
  32852. return this.tn.omit(";"),
  32853. e.messages.push(i),
  32854. i
  32855. }
  32856. ,
  32857. c.toString = function() {
  32858. return "Parser at line " + this.tn.line
  32859. }
  32860. ,
  32861. e.Parser = l,
  32862. e
  32863. }(o, o.Lang),
  32864. o.Reflect = function(g) {
  32865. function a(e, t) {
  32866. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32867. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32868. if ("string" == typeof e)
  32869. return g.Long.fromString(e, t || !1, 10);
  32870. if ("number" == typeof e)
  32871. return g.Long.fromNumber(e, t || !1);
  32872. throw Error("not convertible to Long")
  32873. }
  32874. function m(e, t) {
  32875. var i = t.readVarint32()
  32876. , n = 7 & i
  32877. , r = i >>> 3;
  32878. switch (n) {
  32879. case g.WIRE_TYPES.VARINT:
  32880. for (; 128 == (128 & (i = t.readUint8())); )
  32881. ;
  32882. break;
  32883. case g.WIRE_TYPES.BITS64:
  32884. t.offset += 8;
  32885. break;
  32886. case g.WIRE_TYPES.LDELIM:
  32887. i = t.readVarint32(),
  32888. t.offset += i;
  32889. break;
  32890. case g.WIRE_TYPES.STARTGROUP:
  32891. m(r, t);
  32892. break;
  32893. case g.WIRE_TYPES.ENDGROUP:
  32894. if (r === e)
  32895. return !1;
  32896. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32897. case g.WIRE_TYPES.BITS32:
  32898. t.offset += 4;
  32899. break;
  32900. default:
  32901. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32902. }
  32903. return !0
  32904. }
  32905. function h(e, t, i) {
  32906. this.builder = e,
  32907. this.parent = t,
  32908. this.name = i,
  32909. this.className
  32910. }
  32911. var s = {}
  32912. , e = h.prototype;
  32913. e.fqn = function() {
  32914. for (var e = this.name, t = this; null != (t = t.parent); )
  32915. e = t.name + "." + e;
  32916. return e
  32917. }
  32918. ,
  32919. e.toString = function(e) {
  32920. return (e ? this.className + " " : "") + this.fqn()
  32921. }
  32922. ,
  32923. e.build = function() {
  32924. throw Error(this.toString(!0) + " cannot be built directly")
  32925. }
  32926. ,
  32927. s.T = h;
  32928. function l(e, t, i, n, r) {
  32929. h.call(this, e, t, i),
  32930. this.className = "Namespace",
  32931. this.children = [],
  32932. this.options = n || {},
  32933. this.syntax = r || "proto2"
  32934. }
  32935. var t = l.prototype = Object.create(h.prototype);
  32936. t.getChildren = function(e) {
  32937. if (null == (e = e || null))
  32938. return this.children.slice();
  32939. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32940. this.children[i]instanceof e && t.push(this.children[i]);
  32941. return t
  32942. }
  32943. ,
  32944. t.addChild = function(e) {
  32945. var t;
  32946. if (t = this.getChild(e.name))
  32947. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32948. t.name = t.originalName;
  32949. else {
  32950. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32951. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32952. e.name = e.originalName
  32953. }
  32954. this.children.push(e)
  32955. }
  32956. ,
  32957. t.getChild = function(e) {
  32958. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32959. if (this.children[i][t] === e)
  32960. return this.children[i];
  32961. return null
  32962. }
  32963. ,
  32964. t.resolve = function(e, t) {
  32965. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32966. if ("" === n[o]) {
  32967. for (; null !== r.parent; )
  32968. r = r.parent;
  32969. o++
  32970. }
  32971. do {
  32972. do {
  32973. if (!(r instanceof s.Namespace)) {
  32974. r = null;
  32975. break
  32976. }
  32977. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32978. r = null;
  32979. break
  32980. }
  32981. r = i,
  32982. o++
  32983. } while (o < n.length);if (null != r)
  32984. break;
  32985. if (null !== this.parent)
  32986. return this.parent.resolve(e, t)
  32987. } while (null != r);return r
  32988. }
  32989. ,
  32990. t.qn = function(e) {
  32991. for (var t = [], i = e; t.unshift(i.name),
  32992. null !== (i = i.parent); )
  32993. ;
  32994. for (var n = 1; n <= t.length; n++) {
  32995. var r = t.slice(t.length - n);
  32996. if (e === this.resolve(r, e instanceof s.Namespace))
  32997. return r.join(".")
  32998. }
  32999. return e.fqn()
  33000. }
  33001. ,
  33002. t.build = function() {
  33003. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33004. (e = i[n])instanceof l && (t[e.name] = e.build());
  33005. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33006. value: this.buildOpt()
  33007. }),
  33008. t
  33009. }
  33010. ,
  33011. t.buildOpt = function() {
  33012. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33013. var r = t[i]
  33014. , o = this.options[t[i]];
  33015. e[r] = o
  33016. }
  33017. return e
  33018. }
  33019. ,
  33020. t.getOption = function(e) {
  33021. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33022. }
  33023. ,
  33024. s.Namespace = l;
  33025. function u(e, t, i, n) {
  33026. if (this.type = e,
  33027. this.resolvedType = t,
  33028. this.isMapKey = i,
  33029. this.syntax = n,
  33030. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33031. throw Error("Invalid map key type: " + e.name)
  33032. }
  33033. var i = u.prototype;
  33034. u.defaultFieldValue = function(e) {
  33035. if ("string" == typeof e && (e = g.TYPES[e]),
  33036. void 0 === e.defaultValue)
  33037. throw Error("default value for type " + e.name + " is not supported");
  33038. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33039. }
  33040. ,
  33041. i.verifyValue = function(t) {
  33042. function i(e, t) {
  33043. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33044. }
  33045. var n = this;
  33046. switch (this.type) {
  33047. case g.TYPES.int32:
  33048. case g.TYPES.sint32:
  33049. case g.TYPES.sfixed32:
  33050. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33051. 4294967295 < t ? 0 | t : t;
  33052. case g.TYPES.uint32:
  33053. case g.TYPES.fixed32:
  33054. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33055. t < 0 ? t >>> 0 : t;
  33056. case g.TYPES.int64:
  33057. case g.TYPES.sint64:
  33058. case g.TYPES.sfixed64:
  33059. if (g.Long)
  33060. try {
  33061. return a(t, !1)
  33062. } catch (e) {
  33063. i(typeof t, e.message)
  33064. }
  33065. else
  33066. i(typeof t, "requires Long.js");
  33067. case g.TYPES.uint64:
  33068. case g.TYPES.fixed64:
  33069. if (g.Long)
  33070. try {
  33071. return a(t, !0)
  33072. } catch (e) {
  33073. i(typeof t, e.message)
  33074. }
  33075. else
  33076. i(typeof t, "requires Long.js");
  33077. case g.TYPES.bool:
  33078. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33079. t;
  33080. case g.TYPES.float:
  33081. case g.TYPES.double:
  33082. return "number" != typeof t && i(typeof t, "not a number"),
  33083. t;
  33084. case g.TYPES.string:
  33085. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33086. "" + t;
  33087. case g.TYPES.bytes:
  33088. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33089. case g.TYPES.enum:
  33090. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33091. for (o = 0; o < e.length; o++) {
  33092. if (e[o].name == t)
  33093. return e[o].id;
  33094. if (e[o].id == t)
  33095. return e[o].id
  33096. }
  33097. if ("proto3" === this.syntax)
  33098. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33099. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33100. t;
  33101. i(t, "not a valid enum value");
  33102. case g.TYPES.group:
  33103. case g.TYPES.message:
  33104. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33105. t instanceof this.resolvedType.clazz)
  33106. return t;
  33107. if (t instanceof g.Builder.Message) {
  33108. var r = {};
  33109. for (var o in t)
  33110. t.hasOwnProperty(o) && (r[o] = t[o]);
  33111. t = r
  33112. }
  33113. return new this.resolvedType.clazz(t)
  33114. }
  33115. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33116. }
  33117. ,
  33118. i.calculateLength = function(e, t) {
  33119. if (null === t)
  33120. return 0;
  33121. var i;
  33122. switch (this.type) {
  33123. case g.TYPES.int32:
  33124. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33125. case g.TYPES.uint32:
  33126. return I.calculateVarint32(t);
  33127. case g.TYPES.sint32:
  33128. return I.calculateVarint32(I.zigZagEncode32(t));
  33129. case g.TYPES.fixed32:
  33130. case g.TYPES.sfixed32:
  33131. case g.TYPES.float:
  33132. return 4;
  33133. case g.TYPES.int64:
  33134. case g.TYPES.uint64:
  33135. return I.calculateVarint64(t);
  33136. case g.TYPES.sint64:
  33137. return I.calculateVarint64(I.zigZagEncode64(t));
  33138. case g.TYPES.fixed64:
  33139. case g.TYPES.sfixed64:
  33140. return 8;
  33141. case g.TYPES.bool:
  33142. return 1;
  33143. case g.TYPES.enum:
  33144. return I.calculateVarint32(t);
  33145. case g.TYPES.double:
  33146. return 8;
  33147. case g.TYPES.string:
  33148. return i = I.calculateUTF8Bytes(t),
  33149. I.calculateVarint32(i) + i;
  33150. case g.TYPES.bytes:
  33151. if (t.remaining() < 0)
  33152. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33153. return I.calculateVarint32(t.remaining()) + t.remaining();
  33154. case g.TYPES.message:
  33155. return i = this.resolvedType.calculate(t),
  33156. I.calculateVarint32(i) + i;
  33157. case g.TYPES.group:
  33158. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33159. }
  33160. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33161. }
  33162. ,
  33163. i.encodeValue = function(e, t, i) {
  33164. if (null === t)
  33165. return i;
  33166. switch (this.type) {
  33167. case g.TYPES.int32:
  33168. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33169. break;
  33170. case g.TYPES.uint32:
  33171. i.writeVarint32(t);
  33172. break;
  33173. case g.TYPES.sint32:
  33174. i.writeVarint32ZigZag(t);
  33175. break;
  33176. case g.TYPES.fixed32:
  33177. i.writeUint32(t);
  33178. break;
  33179. case g.TYPES.sfixed32:
  33180. i.writeInt32(t);
  33181. break;
  33182. case g.TYPES.int64:
  33183. case g.TYPES.uint64:
  33184. i.writeVarint64(t);
  33185. break;
  33186. case g.TYPES.sint64:
  33187. i.writeVarint64ZigZag(t);
  33188. break;
  33189. case g.TYPES.fixed64:
  33190. i.writeUint64(t);
  33191. break;
  33192. case g.TYPES.sfixed64:
  33193. i.writeInt64(t);
  33194. break;
  33195. case g.TYPES.bool:
  33196. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33197. break;
  33198. case g.TYPES.enum:
  33199. i.writeVarint32(t);
  33200. break;
  33201. case g.TYPES.float:
  33202. i.writeFloat32(t);
  33203. break;
  33204. case g.TYPES.double:
  33205. i.writeFloat64(t);
  33206. break;
  33207. case g.TYPES.string:
  33208. i.writeVString(t);
  33209. break;
  33210. case g.TYPES.bytes:
  33211. if (t.remaining() < 0)
  33212. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33213. var n = t.offset;
  33214. i.writeVarint32(t.remaining()),
  33215. i.append(t),
  33216. t.offset = n;
  33217. break;
  33218. case g.TYPES.message:
  33219. var r = (new I).LE();
  33220. this.resolvedType.encode(t, r),
  33221. i.writeVarint32(r.offset),
  33222. i.append(r.flip());
  33223. break;
  33224. case g.TYPES.group:
  33225. this.resolvedType.encode(t, i),
  33226. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33227. break;
  33228. default:
  33229. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33230. }
  33231. return i
  33232. }
  33233. ,
  33234. i.decode = function(e, t, i) {
  33235. if (t != this.type.wireType)
  33236. throw Error("Unexpected wire type for element");
  33237. var n, r;
  33238. switch (this.type) {
  33239. case g.TYPES.int32:
  33240. return 0 | e.readVarint32();
  33241. case g.TYPES.uint32:
  33242. return e.readVarint32() >>> 0;
  33243. case g.TYPES.sint32:
  33244. return 0 | e.readVarint32ZigZag();
  33245. case g.TYPES.fixed32:
  33246. return e.readUint32() >>> 0;
  33247. case g.TYPES.sfixed32:
  33248. return 0 | e.readInt32();
  33249. case g.TYPES.int64:
  33250. return e.readVarint64();
  33251. case g.TYPES.uint64:
  33252. return e.readVarint64().toUnsigned();
  33253. case g.TYPES.sint64:
  33254. return e.readVarint64ZigZag();
  33255. case g.TYPES.fixed64:
  33256. return e.readUint64();
  33257. case g.TYPES.sfixed64:
  33258. return e.readInt64();
  33259. case g.TYPES.bool:
  33260. return !!e.readVarint32();
  33261. case g.TYPES.enum:
  33262. return e.readVarint32();
  33263. case g.TYPES.float:
  33264. return e.readFloat();
  33265. case g.TYPES.double:
  33266. return e.readDouble();
  33267. case g.TYPES.string:
  33268. return e.readVString();
  33269. case g.TYPES.bytes:
  33270. if (r = e.readVarint32(),
  33271. e.remaining() < r)
  33272. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33273. return (n = e.clone()).limit = n.offset + r,
  33274. e.offset += r,
  33275. n;
  33276. case g.TYPES.message:
  33277. return r = e.readVarint32(),
  33278. this.resolvedType.decode(e, r);
  33279. case g.TYPES.group:
  33280. return this.resolvedType.decode(e, -1, i)
  33281. }
  33282. throw Error("[INTERNAL] Illegal decode type")
  33283. }
  33284. ,
  33285. i.valueFromString = function(e) {
  33286. if (!this.isMapKey)
  33287. throw Error("valueFromString() called on non-map-key element");
  33288. switch (this.type) {
  33289. case g.TYPES.int32:
  33290. case g.TYPES.sint32:
  33291. case g.TYPES.sfixed32:
  33292. case g.TYPES.uint32:
  33293. case g.TYPES.fixed32:
  33294. return this.verifyValue(parseInt(e));
  33295. case g.TYPES.int64:
  33296. case g.TYPES.sint64:
  33297. case g.TYPES.sfixed64:
  33298. case g.TYPES.uint64:
  33299. case g.TYPES.fixed64:
  33300. return this.verifyValue(e);
  33301. case g.TYPES.bool:
  33302. return "true" === e;
  33303. case g.TYPES.string:
  33304. return this.verifyValue(e);
  33305. case g.TYPES.bytes:
  33306. return I.fromBinary(e)
  33307. }
  33308. }
  33309. ,
  33310. i.valueToString = function(e) {
  33311. if (!this.isMapKey)
  33312. throw Error("valueToString() called on non-map-key element");
  33313. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33314. }
  33315. ,
  33316. s.Element = u;
  33317. var d = function(e, t, i, n, r, o) {
  33318. l.call(this, e, t, i, n, o),
  33319. this.className = "Message",
  33320. this.extensions = void 0,
  33321. this.clazz = null,
  33322. this.isGroup = !!r,
  33323. this._fields = null,
  33324. this._fieldsById = null,
  33325. this._fieldsByName = null
  33326. }
  33327. , n = d.prototype = Object.create(l.prototype);
  33328. n.build = function(e) {
  33329. if (this.clazz && !e)
  33330. return this.clazz;
  33331. var t = function(u, a) {
  33332. function d(e, i, n, r) {
  33333. if (null === e || "object" != typeof e) {
  33334. if (r && r instanceof u.Reflect.Enum) {
  33335. var t = u.Reflect.Enum.getName(r.object, e);
  33336. if (null !== t)
  33337. return t
  33338. }
  33339. return e
  33340. }
  33341. if (I.isByteBuffer(e))
  33342. return i ? e.toBase64() : e.toBuffer();
  33343. if (u.Long.isLong(e))
  33344. return n ? e.toString() : u.Long.fromValue(e);
  33345. var o;
  33346. if (Array.isArray(e))
  33347. return o = [],
  33348. e.forEach(function(e, t) {
  33349. o[t] = d(e, i, n, r)
  33350. }),
  33351. o;
  33352. if (o = {},
  33353. e instanceof u.Map) {
  33354. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33355. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33356. return o
  33357. }
  33358. var l = e.$type
  33359. , c = void 0;
  33360. for (var h in e)
  33361. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33362. return o
  33363. }
  33364. var s = a.getChildren(u.Reflect.Message.Field)
  33365. , l = a.getChildren(u.Reflect.Message.OneOf)
  33366. , c = function(e, t) {
  33367. u.Builder.Message.call(this);
  33368. for (var i = 0, n = l.length; i < n; ++i)
  33369. this[l[i].name] = null;
  33370. for (i = 0,
  33371. n = s.length; i < n; ++i) {
  33372. var r = s[i];
  33373. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33374. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33375. }
  33376. var o;
  33377. if (0 < arguments.length)
  33378. 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)
  33379. for (i = 0,
  33380. n = arguments.length; i < n; ++i)
  33381. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33382. else
  33383. this.$set(e)
  33384. }
  33385. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33386. o.add = function(e, t, i) {
  33387. var n = a._fieldsByName[e];
  33388. if (!i) {
  33389. if (!n)
  33390. throw Error(this + "#" + e + " is undefined");
  33391. if (!(n instanceof u.Reflect.Message.Field))
  33392. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33393. if (!n.repeated)
  33394. throw Error(this + "#" + e + " is not a repeated field");
  33395. t = n.verifyValue(t, !0)
  33396. }
  33397. return null === this[e] && (this[e] = []),
  33398. this[e].push(t),
  33399. this
  33400. }
  33401. ,
  33402. o.$add = o.add,
  33403. o.set = function(e, t, i) {
  33404. if (e && "object" == typeof e) {
  33405. for (var n in i = t,
  33406. e)
  33407. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33408. return this
  33409. }
  33410. var r = a._fieldsByName[e];
  33411. if (i)
  33412. this[e] = t;
  33413. else {
  33414. if (!r)
  33415. throw Error(this + "#" + e + " is not a field: undefined");
  33416. if (!(r instanceof u.Reflect.Message.Field))
  33417. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33418. this[r.name] = t = r.verifyValue(t)
  33419. }
  33420. if (r && r.oneof) {
  33421. var o = this[r.oneof.name];
  33422. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33423. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33424. }
  33425. return this
  33426. }
  33427. ,
  33428. o.$set = o.set,
  33429. o.get = function(e, t) {
  33430. if (t)
  33431. return this[e];
  33432. var i = a._fieldsByName[e];
  33433. if (!(i && i instanceof u.Reflect.Message.Field))
  33434. throw Error(this + "#" + e + " is not a field: undefined");
  33435. if (!(i instanceof u.Reflect.Message.Field))
  33436. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33437. return this[i.name]
  33438. }
  33439. ,
  33440. o.$get = o.get;
  33441. for (var e = 0; e < s.length; e++) {
  33442. var t = s[e];
  33443. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33444. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33445. return e.toUpperCase().replace("_", "")
  33446. });
  33447. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33448. function t(e, t) {
  33449. return this[i.name] = t ? e : i.verifyValue(e),
  33450. this
  33451. }
  33452. function n() {
  33453. return this[i.name]
  33454. }
  33455. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33456. return "_" + e
  33457. });
  33458. null === a.getChild("set" + e) && (o["set" + e] = t),
  33459. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33460. null === a.getChild("get" + e) && (o["get" + e] = n),
  33461. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33462. }(t)
  33463. }
  33464. return o.encode = function(t, e) {
  33465. "boolean" == typeof t && (e = t,
  33466. t = void 0);
  33467. var i = !1;
  33468. t || (t = new I,
  33469. i = !0);
  33470. var n = t.littleEndian;
  33471. try {
  33472. return a.encode(this, t.LE(), e),
  33473. (i ? t.flip() : t).LE(n)
  33474. } catch (e) {
  33475. throw t.LE(n),
  33476. e
  33477. }
  33478. }
  33479. ,
  33480. c.encode = function(e, t, i) {
  33481. return new c(e).encode(t, i)
  33482. }
  33483. ,
  33484. o.calculate = function() {
  33485. return a.calculate(this)
  33486. }
  33487. ,
  33488. o.encodeDelimited = function(e, t) {
  33489. var i = !1;
  33490. e || (e = new I,
  33491. i = !0);
  33492. var n = (new I).LE();
  33493. return a.encode(this, n, t).flip(),
  33494. e.writeVarint32(n.remaining()),
  33495. e.append(n),
  33496. i ? e.flip() : e
  33497. }
  33498. ,
  33499. o.encodeAB = function() {
  33500. try {
  33501. return this.encode().toArrayBuffer()
  33502. } catch (e) {
  33503. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33504. e
  33505. }
  33506. }
  33507. ,
  33508. o.toArrayBuffer = o.encodeAB,
  33509. o.encodeNB = function() {
  33510. try {
  33511. return this.encode().toBuffer()
  33512. } catch (e) {
  33513. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33514. e
  33515. }
  33516. }
  33517. ,
  33518. o.toBuffer = o.encodeNB,
  33519. o.encode64 = function() {
  33520. try {
  33521. return this.encode().toBase64()
  33522. } catch (e) {
  33523. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33524. e
  33525. }
  33526. }
  33527. ,
  33528. o.toBase64 = o.encode64,
  33529. o.encodeHex = function() {
  33530. try {
  33531. return this.encode().toHex()
  33532. } catch (e) {
  33533. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33534. e
  33535. }
  33536. }
  33537. ,
  33538. o.toHex = o.encodeHex,
  33539. o.toRaw = function(e, t) {
  33540. return d(this, !!e, !!t, this.$type)
  33541. }
  33542. ,
  33543. o.encodeJSON = function() {
  33544. return JSON.stringify(d(this, !0, !0, this.$type))
  33545. }
  33546. ,
  33547. c.decode = function(t, e, i) {
  33548. "string" == typeof e && (i = e,
  33549. e = -1),
  33550. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33551. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33552. try {
  33553. var r = a.decode(t.LE());
  33554. return t.LE(n),
  33555. r
  33556. } catch (e) {
  33557. throw t.LE(n),
  33558. e
  33559. }
  33560. }
  33561. ,
  33562. c.decodeDelimited = function(t, e) {
  33563. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33564. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33565. return null;
  33566. var i = t.offset
  33567. , n = t.readVarint32();
  33568. if (t.remaining() < n)
  33569. return t.offset = i,
  33570. null;
  33571. try {
  33572. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33573. return t.offset += n,
  33574. r
  33575. } catch (e) {
  33576. throw t.offset += n,
  33577. e
  33578. }
  33579. }
  33580. ,
  33581. c.decode64 = function(e) {
  33582. return c.decode(e, "base64")
  33583. }
  33584. ,
  33585. c.decodeHex = function(e) {
  33586. return c.decode(e, "hex")
  33587. }
  33588. ,
  33589. c.decodeJSON = function(e) {
  33590. return new c(JSON.parse(e))
  33591. }
  33592. ,
  33593. o.toString = function() {
  33594. return a.toString()
  33595. }
  33596. ,
  33597. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33598. value: a.buildOpt()
  33599. }),
  33600. Object.defineProperty(o, "$options", {
  33601. value: c.$options
  33602. }),
  33603. Object.defineProperty(c, "$type", {
  33604. value: a
  33605. }),
  33606. Object.defineProperty(o, "$type", {
  33607. value: a
  33608. })),
  33609. c
  33610. }(g, this);
  33611. this._fields = [],
  33612. this._fieldsById = {},
  33613. this._fieldsByName = {};
  33614. for (var i, n = 0, r = this.children.length; n < r; n++)
  33615. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33616. if (t.hasOwnProperty(i.name))
  33617. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33618. t[i.name] = i.build()
  33619. } else if (i instanceof d.Field)
  33620. i.build(),
  33621. this._fields.push(i),
  33622. this._fieldsById[i.id] = i,
  33623. this._fieldsByName[i.name] = i;
  33624. else if (!(i instanceof d.OneOf || i instanceof v))
  33625. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33626. return this.clazz = t
  33627. }
  33628. ,
  33629. n.encode = function(e, t, i) {
  33630. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33631. r = e[(n = this._fields[a]).name],
  33632. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33633. if (null === o)
  33634. return t;
  33635. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33636. throw l.encoded = t,
  33637. l
  33638. }
  33639. ,
  33640. n.calculate = function(e) {
  33641. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33642. if (i = e[(t = this._fields[r]).name],
  33643. t.required && null === i)
  33644. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33645. n += t.calculate(i, e)
  33646. }
  33647. return n
  33648. }
  33649. ,
  33650. n.decode = function(e, t, i) {
  33651. t = "number" == typeof t ? t : -1;
  33652. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33653. if (o = (n = e.readVarint32()) >>> 3,
  33654. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33655. if (o !== i)
  33656. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33657. break
  33658. }
  33659. if (a = this._fieldsById[o]) {
  33660. if (a.repeated && !a.options.packed)
  33661. l[a.name].push(a.decode(r, e));
  33662. else if (a.map) {
  33663. var c = a.decode(r, e);
  33664. l[a.name].set(c[0], c[1])
  33665. } else if (l[a.name] = a.decode(r, e),
  33666. a.oneof) {
  33667. var h = l[a.oneof.name];
  33668. null !== h && h !== a.name && (l[h] = null),
  33669. l[a.oneof.name] = a.name
  33670. }
  33671. } else
  33672. switch (r) {
  33673. case g.WIRE_TYPES.VARINT:
  33674. e.readVarint32();
  33675. break;
  33676. case g.WIRE_TYPES.BITS32:
  33677. e.offset += 4;
  33678. break;
  33679. case g.WIRE_TYPES.BITS64:
  33680. e.offset += 8;
  33681. break;
  33682. case g.WIRE_TYPES.LDELIM:
  33683. var u = e.readVarint32();
  33684. e.offset += u;
  33685. break;
  33686. case g.WIRE_TYPES.STARTGROUP:
  33687. for (; m(o, e); )
  33688. ;
  33689. break;
  33690. default:
  33691. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33692. }
  33693. }
  33694. for (var d = 0, p = this._fields.length; d < p; ++d)
  33695. if (null === l[(a = this._fields[d]).name])
  33696. if ("proto3" === this.syntax)
  33697. l[a.name] = a.defaultValue;
  33698. else {
  33699. if (a.required) {
  33700. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33701. throw f.decoded = l,
  33702. f
  33703. }
  33704. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33705. }
  33706. return l
  33707. }
  33708. ,
  33709. s.Message = d;
  33710. function c(e, t, i, n, r, o, a, s, l, c) {
  33711. h.call(this, e, t, o),
  33712. this.className = "Message.Field",
  33713. this.required = "required" === i,
  33714. this.repeated = "repeated" === i,
  33715. this.map = "map" === i,
  33716. this.keyType = n || null,
  33717. this.type = r,
  33718. this.resolvedType = null,
  33719. this.id = a,
  33720. this.options = s || {},
  33721. this.defaultValue = null,
  33722. this.oneof = l || null,
  33723. this.syntax = c || "proto2",
  33724. this.originalName = this.name,
  33725. this.element = null,
  33726. this.keyElement = null,
  33727. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33728. }
  33729. var r = c.prototype = Object.create(h.prototype);
  33730. r.build = function() {
  33731. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33732. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33733. "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)
  33734. }
  33735. ,
  33736. r.verifyValue = function(e, t) {
  33737. function i(e, t) {
  33738. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33739. }
  33740. t = t || !1;
  33741. var n, r = this;
  33742. if (null === e)
  33743. return this.required && i(typeof e, "required"),
  33744. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33745. null;
  33746. if (!this.repeated || t)
  33747. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33748. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33749. this.element.verifyValue(e));
  33750. Array.isArray(e) || (e = [e]);
  33751. var o = [];
  33752. for (n = 0; n < e.length; n++)
  33753. o.push(this.element.verifyValue(e[n]));
  33754. return o
  33755. }
  33756. ,
  33757. r.hasWirePresence = function(e, t) {
  33758. if ("proto3" !== this.syntax)
  33759. return null !== e;
  33760. if (this.oneof && t[this.oneof.name] === this.name)
  33761. return !0;
  33762. switch (this.type) {
  33763. case g.TYPES.int32:
  33764. case g.TYPES.sint32:
  33765. case g.TYPES.sfixed32:
  33766. case g.TYPES.uint32:
  33767. case g.TYPES.fixed32:
  33768. return 0 !== e;
  33769. case g.TYPES.int64:
  33770. case g.TYPES.sint64:
  33771. case g.TYPES.sfixed64:
  33772. case g.TYPES.uint64:
  33773. case g.TYPES.fixed64:
  33774. return 0 !== e.low || 0 !== e.high;
  33775. case g.TYPES.bool:
  33776. return e;
  33777. case g.TYPES.float:
  33778. case g.TYPES.double:
  33779. return 0 !== e;
  33780. case g.TYPES.string:
  33781. return 0 < e.length;
  33782. case g.TYPES.bytes:
  33783. return 0 < e.remaining();
  33784. case g.TYPES.enum:
  33785. return 0 !== e;
  33786. case g.TYPES.message:
  33787. return null !== e;
  33788. default:
  33789. return !0
  33790. }
  33791. }
  33792. ,
  33793. r.encode = function(t, r, e) {
  33794. if (null === this.type || "object" != typeof this.type)
  33795. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33796. if (null === t || this.repeated && 0 == t.length)
  33797. return r;
  33798. try {
  33799. var i;
  33800. if (this.repeated)
  33801. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33802. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33803. r.ensureCapacity(r.offset += 1);
  33804. var n = r.offset;
  33805. for (i = 0; i < t.length; i++)
  33806. this.element.encodeValue(this.id, t[i], r);
  33807. var o = r.offset - n
  33808. , a = I.calculateVarint32(o);
  33809. if (1 < a) {
  33810. var s = r.slice(n, r.offset);
  33811. n += a - 1,
  33812. r.offset = n,
  33813. r.append(s)
  33814. }
  33815. r.writeVarint32(o, n - a)
  33816. } else
  33817. for (i = 0; i < t.length; i++)
  33818. r.writeVarint32(this.id << 3 | this.type.wireType),
  33819. this.element.encodeValue(this.id, t[i], r);
  33820. else
  33821. this.map ? t.forEach(function(e, t, i) {
  33822. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33823. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33824. r.writeVarint32(n),
  33825. r.writeVarint32(8 | this.keyType.wireType),
  33826. this.keyElement.encodeValue(1, t, r),
  33827. r.writeVarint32(16 | this.type.wireType),
  33828. this.element.encodeValue(2, e, r)
  33829. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33830. this.element.encodeValue(this.id, t, r))
  33831. } catch (e) {
  33832. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33833. }
  33834. return r
  33835. }
  33836. ,
  33837. r.calculate = function(t, e) {
  33838. if (t = this.verifyValue(t),
  33839. null === this.type || "object" != typeof this.type)
  33840. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33841. if (null === t || this.repeated && 0 == t.length)
  33842. return 0;
  33843. var r = 0;
  33844. try {
  33845. var i, n;
  33846. if (this.repeated)
  33847. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33848. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33849. i = n = 0; i < t.length; i++)
  33850. n += this.element.calculateLength(this.id, t[i]);
  33851. r += I.calculateVarint32(n),
  33852. r += n
  33853. } else
  33854. for (i = 0; i < t.length; i++)
  33855. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33856. r += this.element.calculateLength(this.id, t[i]);
  33857. else
  33858. this.map ? t.forEach(function(e, t, i) {
  33859. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33860. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33861. r += I.calculateVarint32(n),
  33862. r += n
  33863. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33864. r += this.element.calculateLength(this.id, t))
  33865. } catch (e) {
  33866. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33867. }
  33868. return r
  33869. }
  33870. ,
  33871. r.decode = function(e, t, i) {
  33872. var n, r;
  33873. 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))
  33874. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33875. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33876. r = t.readVarint32(),
  33877. r = t.offset + r;
  33878. for (var o = []; t.offset < r; )
  33879. o.push(this.decode(this.type.wireType, t, !0));
  33880. return o
  33881. }
  33882. if (this.map) {
  33883. var a = u.defaultFieldValue(this.keyType);
  33884. if (n = u.defaultFieldValue(this.type),
  33885. r = t.readVarint32(),
  33886. t.remaining() < r)
  33887. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33888. var s = t.clone();
  33889. for (s.limit = s.offset + r,
  33890. t.offset += r; 0 < s.remaining(); ) {
  33891. var l = s.readVarint32();
  33892. e = 7 & l;
  33893. var c = l >>> 3;
  33894. if (1 == c)
  33895. a = this.keyElement.decode(s, e, c);
  33896. else {
  33897. if (2 != c)
  33898. throw Error("Unexpected tag in map field key/value submessage");
  33899. n = this.element.decode(s, e, c)
  33900. }
  33901. }
  33902. return [a, n]
  33903. }
  33904. return this.element.decode(t, e, this.id)
  33905. }
  33906. ,
  33907. s.Message.Field = c;
  33908. function o(e, t, i, n, r, o, a) {
  33909. c.call(this, e, t, i, null, n, r, o, a),
  33910. this.extension
  33911. }
  33912. o.prototype = Object.create(c.prototype),
  33913. s.Message.ExtensionField = o;
  33914. s.Message.OneOf = function(e, t, i) {
  33915. h.call(this, e, t, i),
  33916. this.fields = []
  33917. }
  33918. ;
  33919. var p = function(e, t, i, n, r) {
  33920. l.call(this, e, t, i, n, r),
  33921. this.className = "Enum",
  33922. this.object = null
  33923. };
  33924. p.getName = function(e, t) {
  33925. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33926. if (e[i = n[r]] === t)
  33927. return i;
  33928. return null
  33929. }
  33930. ,
  33931. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33932. if (this.object && !e)
  33933. return this.object;
  33934. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33935. t[i[n].name] = i[n].id;
  33936. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33937. value: this.buildOpt(),
  33938. enumerable: !1
  33939. }),
  33940. this.object = t
  33941. }
  33942. ,
  33943. s.Enum = p;
  33944. function f(e, t, i, n) {
  33945. h.call(this, e, t, i),
  33946. this.className = "Enum.Value",
  33947. this.id = n
  33948. }
  33949. f.prototype = Object.create(h.prototype),
  33950. s.Enum.Value = f;
  33951. var v = function(e, t, i, n) {
  33952. h.call(this, e, t, i),
  33953. this.field = n
  33954. };
  33955. v.prototype = Object.create(h.prototype),
  33956. s.Extension = v;
  33957. var y = function(e, t, i, n) {
  33958. l.call(this, e, t, i, n),
  33959. this.className = "Service",
  33960. this.clazz = null
  33961. };
  33962. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33963. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33964. for (var o = function(e) {
  33965. t.Builder.Service.call(this),
  33966. this.rpcImpl = e || function(e, t, i) {
  33967. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33968. }
  33969. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33970. !function(n) {
  33971. e[n.name] = function(e, i) {
  33972. try {
  33973. try {
  33974. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33975. } catch (e) {
  33976. if (!(e instanceof TypeError))
  33977. throw e
  33978. }
  33979. if (null === e || "object" != typeof e)
  33980. throw Error("Illegal arguments");
  33981. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33982. this.rpcImpl(n.fqn(), e, function(e, t) {
  33983. if (!e) {
  33984. null === t && (t = "");
  33985. try {
  33986. t = n.resolvedResponseType.clazz.decode(t)
  33987. } catch (e) {}
  33988. 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))
  33989. }
  33990. i(e)
  33991. })
  33992. } catch (e) {
  33993. setTimeout(i.bind(this, e), 0)
  33994. }
  33995. }
  33996. ,
  33997. o[n.name] = function(e, t, i) {
  33998. new o(e)[n.name](t, i)
  33999. }
  34000. ,
  34001. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34002. value: n.buildOpt()
  34003. }),
  34004. Object.defineProperty(e[n.name], "$options", {
  34005. value: o[n.name].$options
  34006. }))
  34007. }(i[n]);
  34008. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34009. value: r.buildOpt()
  34010. }),
  34011. Object.defineProperty(e, "$options", {
  34012. value: o.$options
  34013. }),
  34014. Object.defineProperty(o, "$type", {
  34015. value: r
  34016. }),
  34017. Object.defineProperty(e, "$type", {
  34018. value: r
  34019. })),
  34020. o
  34021. }(g, this)
  34022. }
  34023. ,
  34024. s.Service = y;
  34025. function A(e, t, i, n) {
  34026. h.call(this, e, t, i),
  34027. this.className = "Service.Method",
  34028. this.options = n || {}
  34029. }
  34030. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34031. s.Service.Method = A;
  34032. function C(e, t, i, n, r, o, a, s) {
  34033. A.call(this, e, t, i, s),
  34034. this.className = "Service.RPCMethod",
  34035. this.requestName = n,
  34036. this.responseName = r,
  34037. this.requestStream = o,
  34038. this.responseStream = a,
  34039. this.resolvedRequestType = null,
  34040. this.resolvedResponseType = null
  34041. }
  34042. return C.prototype = Object.create(A.prototype),
  34043. s.Service.RPCMethod = C,
  34044. s
  34045. }(o),
  34046. o.Builder = (i = (u = o).Lang,
  34047. s = o.Reflect,
  34048. n = h.prototype,
  34049. h.isMessage = function(e) {
  34050. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34051. }
  34052. ,
  34053. h.isMessageField = function(e) {
  34054. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34055. }
  34056. ,
  34057. h.isEnum = function(e) {
  34058. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34059. }
  34060. ,
  34061. h.isService = function(e) {
  34062. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34063. }
  34064. ,
  34065. h.isExtend = function(e) {
  34066. return "string" == typeof e.ref
  34067. }
  34068. ,
  34069. n.reset = function() {
  34070. return this.ptr = this.ns,
  34071. this
  34072. }
  34073. ,
  34074. n.define = function(e) {
  34075. if ("string" != typeof e || !i.TYPEREF.test(e))
  34076. throw Error("illegal namespace: " + e);
  34077. return e.split(".").forEach(function(e) {
  34078. var t = this.ptr.getChild(e);
  34079. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34080. this.ptr = t
  34081. }, this),
  34082. this
  34083. }
  34084. ,
  34085. n.create = function(e) {
  34086. if (!e)
  34087. return this;
  34088. if (Array.isArray(e)) {
  34089. if (0 === e.length)
  34090. return this;
  34091. e = e.slice()
  34092. } else
  34093. e = [e];
  34094. for (var t = [e]; 0 < t.length; ) {
  34095. if (e = t.pop(),
  34096. !Array.isArray(e))
  34097. throw Error("not a valid namespace: " + JSON.stringify(e));
  34098. for (; 0 < e.length; ) {
  34099. var i = e.shift();
  34100. if (h.isMessage(i)) {
  34101. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34102. , n = {};
  34103. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34104. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34105. }, this),
  34106. i.fields && i.fields.forEach(function(e) {
  34107. if (null !== o.getChild(0 | e.id))
  34108. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34109. if (e.options && "object" != typeof e.options)
  34110. throw Error("illegal field options in " + o.name + "#" + e.name);
  34111. var t = null;
  34112. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34113. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34114. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34115. t && t.fields.push(e),
  34116. o.addChild(e)
  34117. }, this);
  34118. var r = [];
  34119. if (i.enums && i.enums.forEach(function(e) {
  34120. r.push(e)
  34121. }),
  34122. i.messages && i.messages.forEach(function(e) {
  34123. r.push(e)
  34124. }),
  34125. i.services && i.services.forEach(function(e) {
  34126. r.push(e)
  34127. }),
  34128. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34129. this.ptr.addChild(o),
  34130. 0 < r.length) {
  34131. t.push(e),
  34132. e = r,
  34133. r = null,
  34134. this.ptr = o,
  34135. o = null;
  34136. continue
  34137. }
  34138. r = null
  34139. } else if (h.isEnum(i))
  34140. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34141. i.values.forEach(function(e) {
  34142. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34143. }, this),
  34144. this.ptr.addChild(o);
  34145. else if (h.isService(i))
  34146. o = new s.Service(this,this.ptr,i.name,i.options),
  34147. Object.keys(i.rpc).forEach(function(e) {
  34148. var t = i.rpc[e];
  34149. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34150. }, this),
  34151. this.ptr.addChild(o);
  34152. else {
  34153. if (!h.isExtend(i))
  34154. throw Error("not a valid definition: " + JSON.stringify(i));
  34155. if (o = this.ptr.resolve(i.ref, !0))
  34156. i.fields.forEach(function(t) {
  34157. if (null !== o.getChild(0 | t.id))
  34158. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34159. if (o.extensions) {
  34160. var i = !1;
  34161. if (o.extensions.forEach(function(e) {
  34162. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34163. }),
  34164. !i)
  34165. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34166. }
  34167. var e = t.name;
  34168. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34169. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34170. , r = new s.Extension(this,this.ptr,t.name,n);
  34171. n.extension = r,
  34172. this.ptr.addChild(r),
  34173. o.addChild(n)
  34174. }, this);
  34175. else if (!/\.?google\.protobuf\./.test(i.ref))
  34176. throw Error("extended message " + i.ref + " is not defined")
  34177. }
  34178. o = i = null
  34179. }
  34180. e = null,
  34181. this.ptr = this.ptr.parent
  34182. }
  34183. return this.resolved = !1,
  34184. this.result = null,
  34185. this
  34186. }
  34187. ,
  34188. n.import = function(t, e) {
  34189. var i = "/";
  34190. if ("string" == typeof e) {
  34191. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34192. !0 === this.files[e])
  34193. return this.reset();
  34194. this.files[e] = !0
  34195. } else if ("object" == typeof e) {
  34196. var n = e.root;
  34197. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34198. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34199. var r = n + i + e.file;
  34200. if (!0 === this.files[r])
  34201. return this.reset();
  34202. this.files[r] = !0
  34203. }
  34204. if (t.imports && 0 < t.imports.length) {
  34205. var o, a = !1;
  34206. "object" == typeof e ? (this.importRoot = e.root,
  34207. a = !0,
  34208. o = this.importRoot,
  34209. e = e.file,
  34210. (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(/\\[^\\]*$/, ""),
  34211. i = "\\") : o = "." : o = null;
  34212. for (var s = 0; s < t.imports.length; s++)
  34213. if ("string" == typeof t.imports[s]) {
  34214. if (!o)
  34215. throw Error("cannot determine import root");
  34216. var l = t.imports[s];
  34217. if ("google/protobuf/descriptor.proto" === l)
  34218. continue;
  34219. if (l = o + i + l,
  34220. !0 === this.files[l])
  34221. continue;
  34222. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34223. var c = u.Util.fetch(l);
  34224. if (null === c)
  34225. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34226. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34227. } else
  34228. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34229. return t + "_import" + s + "." + i
  34230. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34231. a && (this.importRoot = null)
  34232. }
  34233. t.package && this.define(t.package),
  34234. t.syntax && function t(i) {
  34235. i.messages && i.messages.forEach(function(e) {
  34236. e.syntax = i.syntax,
  34237. t(e)
  34238. }),
  34239. i.enums && i.enums.forEach(function(e) {
  34240. e.syntax = i.syntax
  34241. })
  34242. }(t);
  34243. var h = this.ptr;
  34244. return t.options && Object.keys(t.options).forEach(function(e) {
  34245. h.options[e] = t.options[e]
  34246. }),
  34247. t.messages && (this.create(t.messages),
  34248. this.ptr = h),
  34249. t.enums && (this.create(t.enums),
  34250. this.ptr = h),
  34251. t.services && (this.create(t.services),
  34252. this.ptr = h),
  34253. t.extends && this.create(t.extends),
  34254. this.reset()
  34255. }
  34256. ,
  34257. n.resolveAll = function() {
  34258. var e;
  34259. if (null == this.ptr || "object" == typeof this.ptr.type)
  34260. return this;
  34261. if (this.ptr instanceof s.Namespace)
  34262. this.ptr.children.forEach(function(e) {
  34263. this.ptr = e,
  34264. this.resolveAll()
  34265. }, this);
  34266. else if (this.ptr instanceof s.Message.Field) {
  34267. if (i.TYPE.test(this.ptr.type))
  34268. this.ptr.type = u.TYPES[this.ptr.type];
  34269. else {
  34270. if (!i.TYPEREF.test(this.ptr.type))
  34271. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34272. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34273. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34274. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34275. if (this.ptr.type = u.TYPES.enum,
  34276. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34277. throw Error("proto3 message cannot reference proto2 enum")
  34278. } else {
  34279. if (!(e instanceof s.Message))
  34280. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34281. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34282. }
  34283. }
  34284. if (this.ptr.map) {
  34285. if (!i.TYPE.test(this.ptr.keyType))
  34286. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34287. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34288. }
  34289. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34290. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34291. throw Error("illegal service type in " + this.ptr.toString(!0));
  34292. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34293. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34294. if (this.ptr.resolvedRequestType = e,
  34295. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34296. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34297. this.ptr.resolvedResponseType = e
  34298. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34299. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34300. return this.reset()
  34301. }
  34302. ,
  34303. n.build = function(e) {
  34304. if (this.reset(),
  34305. this.resolved || (this.resolveAll(),
  34306. this.resolved = !0,
  34307. this.result = null),
  34308. null === this.result && (this.result = this.ns.build()),
  34309. !e)
  34310. return this.result;
  34311. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34312. if (!i[t[n]]) {
  34313. i = null;
  34314. break
  34315. }
  34316. i = i[t[n]]
  34317. }
  34318. return i
  34319. }
  34320. ,
  34321. n.lookup = function(e, t) {
  34322. return e ? this.ns.resolve(e, t) : this.ns
  34323. }
  34324. ,
  34325. n.toString = function() {
  34326. return "Builder"
  34327. }
  34328. ,
  34329. h.Message = function() {}
  34330. ,
  34331. h.Enum = function() {}
  34332. ,
  34333. h.Service = function() {}
  34334. ,
  34335. h),
  34336. o.Map = (a = o.Reflect,
  34337. (t = c.prototype).clear = function() {
  34338. this.map = {}
  34339. }
  34340. ,
  34341. t.delete = function(e) {
  34342. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34343. , i = t in this.map;
  34344. return delete this.map[t],
  34345. i
  34346. }
  34347. ,
  34348. t.entries = function() {
  34349. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34350. t.push([(e = this.map[i[n]]).key, e.value]);
  34351. return l(t)
  34352. }
  34353. ,
  34354. t.keys = function() {
  34355. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34356. e.push(this.map[t[i]].key);
  34357. return l(e)
  34358. }
  34359. ,
  34360. t.values = function() {
  34361. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34362. e.push(this.map[t[i]].value);
  34363. return l(e)
  34364. }
  34365. ,
  34366. t.forEach = function(e, t) {
  34367. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34368. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34369. }
  34370. ,
  34371. t.set = function(e, t) {
  34372. var i = this.keyElem.verifyValue(e)
  34373. , n = this.valueElem.verifyValue(t);
  34374. return this.map[this.keyElem.valueToString(i)] = {
  34375. key: i,
  34376. value: n
  34377. },
  34378. this
  34379. }
  34380. ,
  34381. t.get = function(e) {
  34382. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34383. if (t in this.map)
  34384. return this.map[t].value
  34385. }
  34386. ,
  34387. t.has = function(e) {
  34388. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34389. }
  34390. ,
  34391. c),
  34392. o.loadProto = function(e, t, i) {
  34393. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34394. t = void 0),
  34395. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34396. }
  34397. ,
  34398. o.protoFromString = o.loadProto,
  34399. o.loadProtoFile = function(t, i, n) {
  34400. if (i && "object" == typeof i ? (n = i,
  34401. i = null) : i && "function" == typeof i || (i = null),
  34402. i)
  34403. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34404. if (null !== e)
  34405. try {
  34406. i(null, o.loadProto(e, n, t))
  34407. } catch (e) {
  34408. i(e)
  34409. }
  34410. else
  34411. i(Error("Failed to fetch file"))
  34412. });
  34413. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34414. return null === e ? null : o.loadProto(e, n, t)
  34415. }
  34416. ,
  34417. o.protoFromFile = o.loadProtoFile,
  34418. o.newBuilder = function(e) {
  34419. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34420. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34421. new o.Builder(e)
  34422. }
  34423. ,
  34424. o.loadJson = function(e, t, i) {
  34425. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34426. t = null),
  34427. t && "object" == typeof t || (t = o.newBuilder()),
  34428. "string" == typeof e && (e = JSON.parse(e)),
  34429. t.import(e, i),
  34430. t.resolveAll(),
  34431. t
  34432. }
  34433. ,
  34434. o.loadJsonFile = function(t, i, n) {
  34435. if (i && "object" == typeof i ? (n = i,
  34436. i = null) : i && "function" == typeof i || (i = null),
  34437. i)
  34438. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34439. if (null !== e)
  34440. try {
  34441. i(null, o.loadJson(JSON.parse(e), n, t))
  34442. } catch (e) {
  34443. i(e)
  34444. }
  34445. else
  34446. i(Error("Failed to fetch file"))
  34447. });
  34448. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34449. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34450. }
  34451. ,
  34452. o;
  34453. function l(e) {
  34454. var t = 0;
  34455. return {
  34456. next: function() {
  34457. return t < e.length ? {
  34458. done: !1,
  34459. value: e[t++]
  34460. } : {
  34461. done: !0
  34462. }
  34463. }
  34464. }
  34465. }
  34466. function c(e, t) {
  34467. if (!e.map)
  34468. throw Error("field is not a map");
  34469. if (this.field = e,
  34470. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34471. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34472. this.map = {},
  34473. Object.defineProperty(this, "size", {
  34474. get: function() {
  34475. return Object.keys(this.map).length
  34476. }
  34477. }),
  34478. t)
  34479. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34480. var r = this.keyElem.valueFromString(i[n])
  34481. , o = this.valueElem.verifyValue(t[i[n]]);
  34482. this.map[this.keyElem.valueToString(r)] = {
  34483. key: r,
  34484. value: o
  34485. }
  34486. }
  34487. }
  34488. function h(e) {
  34489. this.ns = new s.Namespace(this,null,""),
  34490. this.ptr = this.ns,
  34491. this.resolved = !1,
  34492. this.result = null,
  34493. this.files = {},
  34494. this.importRoot = null,
  34495. this.options = e || {}
  34496. }
  34497. }
  34498. ,
  34499. "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)
  34500. }
  34501. ).call(this, p("_process"))
  34502. }
  34503. , {
  34504. _process: 203,
  34505. bytebuffer: 215,
  34506. fs: 197,
  34507. path: 197
  34508. }],
  34509. 215: [function(t, e, i) {
  34510. var n, r;
  34511. n = this,
  34512. r = function(l) {
  34513. "use strict";
  34514. function s(e) {
  34515. var t = 0;
  34516. return function() {
  34517. return t < e.length ? e.charCodeAt(t++) : null
  34518. }
  34519. }
  34520. function c() {
  34521. var e = []
  34522. , t = [];
  34523. return function() {
  34524. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34525. e.length = 0),
  34526. void Array.prototype.push.apply(e, arguments))
  34527. }
  34528. }
  34529. function n(e, t, i, n, r) {
  34530. 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];
  34531. for (u += d,
  34532. o = p & (1 << -h) - 1,
  34533. p >>= -h,
  34534. h += s; 0 < h; o = 256 * o + e[t + u],
  34535. u += d,
  34536. h -= 8)
  34537. ;
  34538. for (a = o & (1 << -h) - 1,
  34539. o >>= -h,
  34540. h += n; 0 < h; a = 256 * a + e[t + u],
  34541. u += d,
  34542. h -= 8)
  34543. ;
  34544. if (0 === o)
  34545. o = 1 - c;
  34546. else {
  34547. if (o === l)
  34548. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34549. a += Math.pow(2, n),
  34550. o -= c
  34551. }
  34552. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34553. }
  34554. function r(e, t, i, n, r, o) {
  34555. 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;
  34556. for (t = Math.abs(t),
  34557. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34558. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34559. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34560. l *= 2),
  34561. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34562. l /= 2),
  34563. h <= a + u ? (s = 0,
  34564. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34565. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34566. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34567. p += f,
  34568. s /= 256,
  34569. r -= 8)
  34570. ;
  34571. for (a = a << r | s,
  34572. c += r; 0 < c; e[i + p] = 255 & a,
  34573. p += f,
  34574. a /= 256,
  34575. c -= 8)
  34576. ;
  34577. e[i + p - f] |= 128 * g
  34578. }
  34579. var f = function(e, t, i) {
  34580. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34581. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34582. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34583. !i) {
  34584. if ((e |= 0) < 0)
  34585. throw RangeError("Illegal capacity");
  34586. t = !!t,
  34587. i = !!i
  34588. }
  34589. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34590. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34591. this.offset = 0,
  34592. this.markedOffset = -1,
  34593. this.limit = e,
  34594. this.littleEndian = t,
  34595. this.noAssert = i
  34596. };
  34597. f.VERSION = "5.0.1",
  34598. f.LITTLE_ENDIAN = !0,
  34599. f.BIG_ENDIAN = !1,
  34600. f.DEFAULT_CAPACITY = 16,
  34601. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34602. f.DEFAULT_NOASSERT = !1,
  34603. f.Long = l || null;
  34604. var a = f.prototype;
  34605. a.__isByteBuffer__,
  34606. Object.defineProperty(a, "__isByteBuffer__", {
  34607. value: !0,
  34608. enumerable: !1,
  34609. configurable: !1
  34610. });
  34611. var o = new ArrayBuffer(0)
  34612. , i = String.fromCharCode;
  34613. f.accessor = function() {
  34614. return Uint8Array
  34615. }
  34616. ,
  34617. f.allocate = function(e, t, i) {
  34618. return new f(e,t,i)
  34619. }
  34620. ,
  34621. f.concat = function(e, t, i, n) {
  34622. "boolean" != typeof t && "string" == typeof t || (n = i,
  34623. i = t,
  34624. t = void 0);
  34625. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34626. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34627. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34628. if (0 === o)
  34629. return new f(0,i,n);
  34630. var l, c = new f(o,i,n);
  34631. for (a = 0; a < s; )
  34632. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34633. c.offset += r);
  34634. return c.limit = c.offset,
  34635. c.offset = 0,
  34636. c
  34637. }
  34638. ,
  34639. f.isByteBuffer = function(e) {
  34640. return !0 === (e && e.__isByteBuffer__)
  34641. }
  34642. ,
  34643. f.type = function() {
  34644. return ArrayBuffer
  34645. }
  34646. ,
  34647. f.wrap = function(e, t, i, n) {
  34648. if ("string" != typeof t && (n = i,
  34649. i = t,
  34650. t = void 0),
  34651. "string" == typeof e)
  34652. switch (void 0 === t && (t = "utf8"),
  34653. t) {
  34654. case "base64":
  34655. return f.fromBase64(e, i);
  34656. case "hex":
  34657. return f.fromHex(e, i);
  34658. case "binary":
  34659. return f.fromBinary(e, i);
  34660. case "utf8":
  34661. return f.fromUTF8(e, i);
  34662. case "debug":
  34663. return f.fromDebug(e, i);
  34664. default:
  34665. throw Error("Unsupported encoding: " + t)
  34666. }
  34667. if (null === e || "object" != typeof e)
  34668. throw TypeError("Illegal buffer");
  34669. var r;
  34670. if (f.isByteBuffer(e))
  34671. return (r = a.clone.call(e)).markedOffset = -1,
  34672. r;
  34673. if (e instanceof Uint8Array)
  34674. r = new f(0,i,n),
  34675. 0 < e.length && (r.buffer = e.buffer,
  34676. r.offset = e.byteOffset,
  34677. r.limit = e.byteOffset + e.byteLength,
  34678. r.view = new Uint8Array(e.buffer));
  34679. else if (e instanceof ArrayBuffer)
  34680. r = new f(0,i,n),
  34681. 0 < e.byteLength && (r.buffer = e,
  34682. r.offset = 0,
  34683. r.limit = e.byteLength,
  34684. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34685. else {
  34686. if ("[object Array]" !== Object.prototype.toString.call(e))
  34687. throw TypeError("Illegal buffer");
  34688. (r = new f(e.length,i,n)).limit = e.length;
  34689. for (var o = 0; o < e.length; ++o)
  34690. r.view[o] = e[o]
  34691. }
  34692. return r
  34693. }
  34694. ,
  34695. a.writeBitSet = function(e, t) {
  34696. var i = void 0 === t;
  34697. if (i && (t = this.offset),
  34698. !this.noAssert) {
  34699. if (!(e instanceof Array))
  34700. throw TypeError("Illegal BitSet: Not an array");
  34701. if ("number" != typeof t || t % 1 != 0)
  34702. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34703. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34704. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34705. }
  34706. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34707. for (t += this.writeVarint32(o, t); a--; )
  34708. 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,
  34709. this.writeByte(n, t++);
  34710. if (s < o) {
  34711. var l = 0;
  34712. for (n = 0; s < o; )
  34713. n |= (1 & !!e[s++]) << l++;
  34714. this.writeByte(n, t++)
  34715. }
  34716. return i ? (this.offset = t,
  34717. this) : t - r
  34718. }
  34719. ,
  34720. a.readBitSet = function(e) {
  34721. var t = void 0 === e;
  34722. t && (e = this.offset);
  34723. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34724. for (e += n.length; o--; )
  34725. i = this.readByte(e++),
  34726. s[a++] = !!(1 & i),
  34727. s[a++] = !!(2 & i),
  34728. s[a++] = !!(4 & i),
  34729. s[a++] = !!(8 & i),
  34730. s[a++] = !!(16 & i),
  34731. s[a++] = !!(32 & i),
  34732. s[a++] = !!(64 & i),
  34733. s[a++] = !!(128 & i);
  34734. if (a < r) {
  34735. var l = 0;
  34736. for (i = this.readByte(e++); a < r; )
  34737. s[a++] = !!(i >> l++ & 1)
  34738. }
  34739. return t && (this.offset = e),
  34740. s
  34741. }
  34742. ,
  34743. a.readBytes = function(e, t) {
  34744. var i = void 0 === t;
  34745. if (i && (t = this.offset),
  34746. !this.noAssert) {
  34747. if ("number" != typeof t || t % 1 != 0)
  34748. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34749. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34750. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34751. }
  34752. var n = this.slice(t, t + e);
  34753. return i && (this.offset += e),
  34754. n
  34755. }
  34756. ,
  34757. a.writeBytes = a.append,
  34758. a.writeInt8 = function(e, t) {
  34759. var i = void 0 === t;
  34760. if (i && (t = this.offset),
  34761. !this.noAssert) {
  34762. if ("number" != typeof e || e % 1 != 0)
  34763. throw TypeError("Illegal value: " + e + " (not an integer)");
  34764. if (e |= 0,
  34765. "number" != typeof t || t % 1 != 0)
  34766. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34767. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34768. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34769. }
  34770. t += 1;
  34771. var n = this.buffer.byteLength;
  34772. return n < t && this.resize((n *= 2) > t ? n : t),
  34773. t -= 1,
  34774. this.view[t] = e,
  34775. i && (this.offset += 1),
  34776. this
  34777. }
  34778. ,
  34779. a.writeByte = a.writeInt8,
  34780. a.readInt8 = function(e) {
  34781. var t = void 0 === e;
  34782. if (t && (e = this.offset),
  34783. !this.noAssert) {
  34784. if ("number" != typeof e || e % 1 != 0)
  34785. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34786. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34787. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34788. }
  34789. var i = this.view[e];
  34790. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34791. t && (this.offset += 1),
  34792. i
  34793. }
  34794. ,
  34795. a.readByte = a.readInt8,
  34796. a.writeUint8 = function(e, t) {
  34797. var i = void 0 === t;
  34798. if (i && (t = this.offset),
  34799. !this.noAssert) {
  34800. if ("number" != typeof e || e % 1 != 0)
  34801. throw TypeError("Illegal value: " + e + " (not an integer)");
  34802. if (e >>>= 0,
  34803. "number" != typeof t || t % 1 != 0)
  34804. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34805. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34806. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34807. }
  34808. t += 1;
  34809. var n = this.buffer.byteLength;
  34810. return n < t && this.resize((n *= 2) > t ? n : t),
  34811. t -= 1,
  34812. this.view[t] = e,
  34813. i && (this.offset += 1),
  34814. this
  34815. }
  34816. ,
  34817. a.writeUInt8 = a.writeUint8,
  34818. a.readUint8 = function(e) {
  34819. var t = void 0 === e;
  34820. if (t && (e = this.offset),
  34821. !this.noAssert) {
  34822. if ("number" != typeof e || e % 1 != 0)
  34823. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34824. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34825. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34826. }
  34827. var i = this.view[e];
  34828. return t && (this.offset += 1),
  34829. i
  34830. }
  34831. ,
  34832. a.readUInt8 = a.readUint8,
  34833. a.writeInt16 = function(e, t) {
  34834. var i = void 0 === t;
  34835. if (i && (t = this.offset),
  34836. !this.noAssert) {
  34837. if ("number" != typeof e || e % 1 != 0)
  34838. throw TypeError("Illegal value: " + e + " (not an integer)");
  34839. if (e |= 0,
  34840. "number" != typeof t || t % 1 != 0)
  34841. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34842. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34843. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34844. }
  34845. t += 2;
  34846. var n = this.buffer.byteLength;
  34847. return n < t && this.resize((n *= 2) > t ? n : t),
  34848. t -= 2,
  34849. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34850. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34851. this.view[t + 1] = 255 & e),
  34852. i && (this.offset += 2),
  34853. this
  34854. }
  34855. ,
  34856. a.writeShort = a.writeInt16,
  34857. a.readInt16 = function(e) {
  34858. var t = void 0 === e;
  34859. if (t && (e = this.offset),
  34860. !this.noAssert) {
  34861. if ("number" != typeof e || e % 1 != 0)
  34862. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34863. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34864. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34865. }
  34866. var i = 0;
  34867. return this.littleEndian ? (i = this.view[e],
  34868. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34869. i |= this.view[e + 1]),
  34870. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34871. t && (this.offset += 2),
  34872. i
  34873. }
  34874. ,
  34875. a.readShort = a.readInt16,
  34876. a.writeUint16 = function(e, t) {
  34877. var i = void 0 === t;
  34878. if (i && (t = this.offset),
  34879. !this.noAssert) {
  34880. if ("number" != typeof e || e % 1 != 0)
  34881. throw TypeError("Illegal value: " + e + " (not an integer)");
  34882. if (e >>>= 0,
  34883. "number" != typeof t || t % 1 != 0)
  34884. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34885. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34886. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34887. }
  34888. t += 2;
  34889. var n = this.buffer.byteLength;
  34890. return n < t && this.resize((n *= 2) > t ? n : t),
  34891. t -= 2,
  34892. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34893. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34894. this.view[t + 1] = 255 & e),
  34895. i && (this.offset += 2),
  34896. this
  34897. }
  34898. ,
  34899. a.writeUInt16 = a.writeUint16,
  34900. a.readUint16 = function(e) {
  34901. var t = void 0 === e;
  34902. if (t && (e = this.offset),
  34903. !this.noAssert) {
  34904. if ("number" != typeof e || e % 1 != 0)
  34905. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34906. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34907. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34908. }
  34909. var i = 0;
  34910. return this.littleEndian ? (i = this.view[e],
  34911. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34912. i |= this.view[e + 1]),
  34913. t && (this.offset += 2),
  34914. i
  34915. }
  34916. ,
  34917. a.readUInt16 = a.readUint16,
  34918. a.writeInt32 = function(e, t) {
  34919. var i = void 0 === t;
  34920. if (i && (t = this.offset),
  34921. !this.noAssert) {
  34922. if ("number" != typeof e || e % 1 != 0)
  34923. throw TypeError("Illegal value: " + e + " (not an integer)");
  34924. if (e |= 0,
  34925. "number" != typeof t || t % 1 != 0)
  34926. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34927. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34928. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34929. }
  34930. t += 4;
  34931. var n = this.buffer.byteLength;
  34932. return n < t && this.resize((n *= 2) > t ? n : t),
  34933. t -= 4,
  34934. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34935. this.view[t + 2] = e >>> 16 & 255,
  34936. this.view[t + 1] = e >>> 8 & 255,
  34937. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34938. this.view[t + 1] = e >>> 16 & 255,
  34939. this.view[t + 2] = e >>> 8 & 255,
  34940. this.view[t + 3] = 255 & e),
  34941. i && (this.offset += 4),
  34942. this
  34943. }
  34944. ,
  34945. a.writeInt = a.writeInt32,
  34946. a.readInt32 = function(e) {
  34947. var t = void 0 === e;
  34948. if (t && (e = this.offset),
  34949. !this.noAssert) {
  34950. if ("number" != typeof e || e % 1 != 0)
  34951. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34952. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34953. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34954. }
  34955. var i = 0;
  34956. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34957. i |= this.view[e + 1] << 8,
  34958. i |= this.view[e],
  34959. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34960. i |= this.view[e + 2] << 8,
  34961. i |= this.view[e + 3],
  34962. i += this.view[e] << 24 >>> 0),
  34963. i |= 0,
  34964. t && (this.offset += 4),
  34965. i
  34966. }
  34967. ,
  34968. a.readInt = a.readInt32,
  34969. a.writeUint32 = function(e, t) {
  34970. var i = void 0 === t;
  34971. if (i && (t = this.offset),
  34972. !this.noAssert) {
  34973. if ("number" != typeof e || e % 1 != 0)
  34974. throw TypeError("Illegal value: " + e + " (not an integer)");
  34975. if (e >>>= 0,
  34976. "number" != typeof t || t % 1 != 0)
  34977. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34978. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34979. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34980. }
  34981. t += 4;
  34982. var n = this.buffer.byteLength;
  34983. return n < t && this.resize((n *= 2) > t ? n : t),
  34984. t -= 4,
  34985. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34986. this.view[t + 2] = e >>> 16 & 255,
  34987. this.view[t + 1] = e >>> 8 & 255,
  34988. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34989. this.view[t + 1] = e >>> 16 & 255,
  34990. this.view[t + 2] = e >>> 8 & 255,
  34991. this.view[t + 3] = 255 & e),
  34992. i && (this.offset += 4),
  34993. this
  34994. }
  34995. ,
  34996. a.writeUInt32 = a.writeUint32,
  34997. a.readUint32 = function(e) {
  34998. var t = void 0 === e;
  34999. if (t && (e = this.offset),
  35000. !this.noAssert) {
  35001. if ("number" != typeof e || e % 1 != 0)
  35002. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35003. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35004. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35005. }
  35006. var i = 0;
  35007. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35008. i |= this.view[e + 1] << 8,
  35009. i |= this.view[e],
  35010. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35011. i |= this.view[e + 2] << 8,
  35012. i |= this.view[e + 3],
  35013. i += this.view[e] << 24 >>> 0),
  35014. t && (this.offset += 4),
  35015. i
  35016. }
  35017. ,
  35018. a.readUInt32 = a.readUint32,
  35019. l && (a.writeInt64 = function(e, t) {
  35020. var i = void 0 === t;
  35021. if (i && (t = this.offset),
  35022. !this.noAssert) {
  35023. if ("number" == typeof e)
  35024. e = l.fromNumber(e);
  35025. else if ("string" == typeof e)
  35026. e = l.fromString(e);
  35027. else if (!(e && e instanceof l))
  35028. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35029. if ("number" != typeof t || t % 1 != 0)
  35030. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35031. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35032. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35033. }
  35034. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35035. t += 8;
  35036. var n = this.buffer.byteLength;
  35037. n < t && this.resize((n *= 2) > t ? n : t),
  35038. t -= 8;
  35039. var r = e.low
  35040. , o = e.high;
  35041. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35042. this.view[t + 2] = r >>> 16 & 255,
  35043. this.view[t + 1] = r >>> 8 & 255,
  35044. this.view[t] = 255 & r,
  35045. t += 4,
  35046. this.view[t + 3] = o >>> 24 & 255,
  35047. this.view[t + 2] = o >>> 16 & 255,
  35048. this.view[t + 1] = o >>> 8 & 255,
  35049. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35050. this.view[t + 1] = o >>> 16 & 255,
  35051. this.view[t + 2] = o >>> 8 & 255,
  35052. this.view[t + 3] = 255 & o,
  35053. t += 4,
  35054. this.view[t] = r >>> 24 & 255,
  35055. this.view[t + 1] = r >>> 16 & 255,
  35056. this.view[t + 2] = r >>> 8 & 255,
  35057. this.view[t + 3] = 255 & r),
  35058. i && (this.offset += 8),
  35059. this
  35060. }
  35061. ,
  35062. a.writeLong = a.writeInt64,
  35063. a.readInt64 = function(e) {
  35064. var t = void 0 === e;
  35065. if (t && (e = this.offset),
  35066. !this.noAssert) {
  35067. if ("number" != typeof e || e % 1 != 0)
  35068. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35069. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35070. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35071. }
  35072. var i = 0
  35073. , n = 0;
  35074. this.littleEndian ? (i = this.view[e + 2] << 16,
  35075. i |= this.view[e + 1] << 8,
  35076. i |= this.view[e],
  35077. i += this.view[e + 3] << 24 >>> 0,
  35078. e += 4,
  35079. n = this.view[e + 2] << 16,
  35080. n |= this.view[e + 1] << 8,
  35081. n |= this.view[e],
  35082. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35083. n |= this.view[e + 2] << 8,
  35084. n |= this.view[e + 3],
  35085. n += this.view[e] << 24 >>> 0,
  35086. e += 4,
  35087. i = this.view[e + 1] << 16,
  35088. i |= this.view[e + 2] << 8,
  35089. i |= this.view[e + 3],
  35090. i += this.view[e] << 24 >>> 0);
  35091. var r = new l(i,n,!1);
  35092. return t && (this.offset += 8),
  35093. r
  35094. }
  35095. ,
  35096. a.readLong = a.readInt64,
  35097. a.writeUint64 = function(e, t) {
  35098. var i = void 0 === t;
  35099. if (i && (t = this.offset),
  35100. !this.noAssert) {
  35101. if ("number" == typeof e)
  35102. e = l.fromNumber(e);
  35103. else if ("string" == typeof e)
  35104. e = l.fromString(e);
  35105. else if (!(e && e instanceof l))
  35106. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35107. if ("number" != typeof t || t % 1 != 0)
  35108. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35109. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35110. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35111. }
  35112. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35113. t += 8;
  35114. var n = this.buffer.byteLength;
  35115. n < t && this.resize((n *= 2) > t ? n : t),
  35116. t -= 8;
  35117. var r = e.low
  35118. , o = e.high;
  35119. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35120. this.view[t + 2] = r >>> 16 & 255,
  35121. this.view[t + 1] = r >>> 8 & 255,
  35122. this.view[t] = 255 & r,
  35123. t += 4,
  35124. this.view[t + 3] = o >>> 24 & 255,
  35125. this.view[t + 2] = o >>> 16 & 255,
  35126. this.view[t + 1] = o >>> 8 & 255,
  35127. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35128. this.view[t + 1] = o >>> 16 & 255,
  35129. this.view[t + 2] = o >>> 8 & 255,
  35130. this.view[t + 3] = 255 & o,
  35131. t += 4,
  35132. this.view[t] = r >>> 24 & 255,
  35133. this.view[t + 1] = r >>> 16 & 255,
  35134. this.view[t + 2] = r >>> 8 & 255,
  35135. this.view[t + 3] = 255 & r),
  35136. i && (this.offset += 8),
  35137. this
  35138. }
  35139. ,
  35140. a.writeUInt64 = a.writeUint64,
  35141. a.readUint64 = function(e) {
  35142. var t = void 0 === e;
  35143. if (t && (e = this.offset),
  35144. !this.noAssert) {
  35145. if ("number" != typeof e || e % 1 != 0)
  35146. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35147. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35148. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35149. }
  35150. var i = 0
  35151. , n = 0;
  35152. this.littleEndian ? (i = this.view[e + 2] << 16,
  35153. i |= this.view[e + 1] << 8,
  35154. i |= this.view[e],
  35155. i += this.view[e + 3] << 24 >>> 0,
  35156. e += 4,
  35157. n = this.view[e + 2] << 16,
  35158. n |= this.view[e + 1] << 8,
  35159. n |= this.view[e],
  35160. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35161. n |= this.view[e + 2] << 8,
  35162. n |= this.view[e + 3],
  35163. n += this.view[e] << 24 >>> 0,
  35164. e += 4,
  35165. i = this.view[e + 1] << 16,
  35166. i |= this.view[e + 2] << 8,
  35167. i |= this.view[e + 3],
  35168. i += this.view[e] << 24 >>> 0);
  35169. var r = new l(i,n,!0);
  35170. return t && (this.offset += 8),
  35171. r
  35172. }
  35173. ,
  35174. a.readUInt64 = a.readUint64),
  35175. a.writeFloat32 = function(e, t) {
  35176. var i = void 0 === t;
  35177. if (i && (t = this.offset),
  35178. !this.noAssert) {
  35179. if ("number" != typeof e)
  35180. throw TypeError("Illegal value: " + e + " (not a number)");
  35181. if ("number" != typeof t || t % 1 != 0)
  35182. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35183. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35184. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35185. }
  35186. t += 4;
  35187. var n = this.buffer.byteLength;
  35188. return n < t && this.resize((n *= 2) > t ? n : t),
  35189. t -= 4,
  35190. r(this.view, e, t, this.littleEndian, 23, 4),
  35191. i && (this.offset += 4),
  35192. this
  35193. }
  35194. ,
  35195. a.writeFloat = a.writeFloat32,
  35196. a.readFloat32 = function(e) {
  35197. var t = void 0 === e;
  35198. if (t && (e = this.offset),
  35199. !this.noAssert) {
  35200. if ("number" != typeof e || e % 1 != 0)
  35201. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35202. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35203. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35204. }
  35205. var i = n(this.view, e, this.littleEndian, 23, 4);
  35206. return t && (this.offset += 4),
  35207. i
  35208. }
  35209. ,
  35210. a.readFloat = a.readFloat32,
  35211. a.writeFloat64 = function(e, t) {
  35212. var i = void 0 === t;
  35213. if (i && (t = this.offset),
  35214. !this.noAssert) {
  35215. if ("number" != typeof e)
  35216. throw TypeError("Illegal value: " + e + " (not a number)");
  35217. if ("number" != typeof t || t % 1 != 0)
  35218. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35219. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35220. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35221. }
  35222. t += 8;
  35223. var n = this.buffer.byteLength;
  35224. return n < t && this.resize((n *= 2) > t ? n : t),
  35225. t -= 8,
  35226. r(this.view, e, t, this.littleEndian, 52, 8),
  35227. i && (this.offset += 8),
  35228. this
  35229. }
  35230. ,
  35231. a.writeDouble = a.writeFloat64,
  35232. a.readFloat64 = function(e) {
  35233. var t = void 0 === e;
  35234. if (t && (e = this.offset),
  35235. !this.noAssert) {
  35236. if ("number" != typeof e || e % 1 != 0)
  35237. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35238. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35239. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35240. }
  35241. var i = n(this.view, e, this.littleEndian, 52, 8);
  35242. return t && (this.offset += 8),
  35243. i
  35244. }
  35245. ,
  35246. a.readDouble = a.readFloat64,
  35247. f.MAX_VARINT32_BYTES = 5,
  35248. f.calculateVarint32 = function(e) {
  35249. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35250. }
  35251. ,
  35252. f.zigZagEncode32 = function(e) {
  35253. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35254. }
  35255. ,
  35256. f.zigZagDecode32 = function(e) {
  35257. return e >>> 1 ^ -(1 & e) | 0
  35258. }
  35259. ,
  35260. a.writeVarint32 = function(e, t) {
  35261. var i = void 0 === t;
  35262. if (i && (t = this.offset),
  35263. !this.noAssert) {
  35264. if ("number" != typeof e || e % 1 != 0)
  35265. throw TypeError("Illegal value: " + e + " (not an integer)");
  35266. if (e |= 0,
  35267. "number" != typeof t || t % 1 != 0)
  35268. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35269. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35270. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35271. }
  35272. var n, r = f.calculateVarint32(e);
  35273. t += r;
  35274. var o = this.buffer.byteLength;
  35275. for (o < t && this.resize((o *= 2) > t ? o : t),
  35276. t -= r,
  35277. e >>>= 0; 128 <= e; )
  35278. n = 127 & e | 128,
  35279. this.view[t++] = n,
  35280. e >>>= 7;
  35281. return this.view[t++] = e,
  35282. i ? (this.offset = t,
  35283. this) : r
  35284. }
  35285. ,
  35286. a.writeVarint32ZigZag = function(e, t) {
  35287. return this.writeVarint32(f.zigZagEncode32(e), t)
  35288. }
  35289. ,
  35290. a.readVarint32 = function(e) {
  35291. var t = void 0 === e;
  35292. if (t && (e = this.offset),
  35293. !this.noAssert) {
  35294. if ("number" != typeof e || e % 1 != 0)
  35295. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35296. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35297. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35298. }
  35299. var i, n = 0, r = 0;
  35300. do {
  35301. if (!this.noAssert && e > this.limit) {
  35302. var o = Error("Truncated");
  35303. throw o.truncated = !0,
  35304. o
  35305. }
  35306. i = this.view[e++],
  35307. n < 5 && (r |= (127 & i) << 7 * n),
  35308. ++n
  35309. } while (0 != (128 & i));return r |= 0,
  35310. t ? (this.offset = e,
  35311. r) : {
  35312. value: r,
  35313. length: n
  35314. }
  35315. }
  35316. ,
  35317. a.readVarint32ZigZag = function(e) {
  35318. var t = this.readVarint32(e);
  35319. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35320. t
  35321. }
  35322. ,
  35323. l && (f.MAX_VARINT64_BYTES = 10,
  35324. f.calculateVarint64 = function(e) {
  35325. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35326. var t = e.toInt() >>> 0
  35327. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35328. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35329. 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
  35330. }
  35331. ,
  35332. f.zigZagEncode64 = function(e) {
  35333. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35334. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35335. }
  35336. ,
  35337. f.zigZagDecode64 = function(e) {
  35338. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35339. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35340. }
  35341. ,
  35342. a.writeVarint64 = function(e, t) {
  35343. var i = void 0 === t;
  35344. if (i && (t = this.offset),
  35345. !this.noAssert) {
  35346. if ("number" == typeof e)
  35347. e = l.fromNumber(e);
  35348. else if ("string" == typeof e)
  35349. e = l.fromString(e);
  35350. else if (!(e && e instanceof l))
  35351. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35352. if ("number" != typeof t || t % 1 != 0)
  35353. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35354. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35355. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35356. }
  35357. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35358. var n = f.calculateVarint64(e)
  35359. , r = e.toInt() >>> 0
  35360. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35361. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35362. t += n;
  35363. var s = this.buffer.byteLength;
  35364. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35365. t -= n,
  35366. n) {
  35367. case 10:
  35368. this.view[t + 9] = a >>> 7 & 1;
  35369. case 9:
  35370. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35371. case 8:
  35372. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35373. case 7:
  35374. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35375. case 6:
  35376. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35377. case 5:
  35378. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35379. case 4:
  35380. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35381. case 3:
  35382. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35383. case 2:
  35384. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35385. case 1:
  35386. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35387. }
  35388. return i ? (this.offset += n,
  35389. this) : n
  35390. }
  35391. ,
  35392. a.writeVarint64ZigZag = function(e, t) {
  35393. return this.writeVarint64(f.zigZagEncode64(e), t)
  35394. }
  35395. ,
  35396. a.readVarint64 = function(e) {
  35397. var t = void 0 === e;
  35398. if (t && (e = this.offset),
  35399. !this.noAssert) {
  35400. if ("number" != typeof e || e % 1 != 0)
  35401. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35402. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35403. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35404. }
  35405. var i = e
  35406. , n = 0
  35407. , r = 0
  35408. , o = 0
  35409. , a = 0;
  35410. if (n = 127 & (a = this.view[e++]),
  35411. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35412. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35413. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35414. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35415. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35416. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35417. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35418. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35419. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35420. 128 & a || this.noAssert && void 0 === a))))))))))
  35421. throw Error("Buffer overrun");
  35422. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35423. return t ? (this.offset = e,
  35424. s) : {
  35425. value: s,
  35426. length: e - i
  35427. }
  35428. }
  35429. ,
  35430. a.readVarint64ZigZag = function(e) {
  35431. var t = this.readVarint64(e);
  35432. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35433. t
  35434. }
  35435. ),
  35436. a.writeCString = function(e, t) {
  35437. var i = void 0 === t;
  35438. i && (t = this.offset);
  35439. var n, r = e.length;
  35440. if (!this.noAssert) {
  35441. if ("string" != typeof e)
  35442. throw TypeError("Illegal str: Not a string");
  35443. for (n = 0; n < r; ++n)
  35444. if (0 === e.charCodeAt(n))
  35445. throw RangeError("Illegal str: Contains NULL-characters");
  35446. if ("number" != typeof t || t % 1 != 0)
  35447. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35448. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35449. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35450. }
  35451. r = d.calculateUTF16asUTF8(s(e))[1],
  35452. t += r + 1;
  35453. var o = this.buffer.byteLength;
  35454. return o < t && this.resize((o *= 2) > t ? o : t),
  35455. t -= r + 1,
  35456. d.encodeUTF16toUTF8(s(e), function(e) {
  35457. this.view[t++] = e
  35458. }
  35459. .bind(this)),
  35460. this.view[t++] = 0,
  35461. i ? (this.offset = t,
  35462. this) : r
  35463. }
  35464. ,
  35465. a.readCString = function(e) {
  35466. var t = void 0 === e;
  35467. if (t && (e = this.offset),
  35468. !this.noAssert) {
  35469. if ("number" != typeof e || e % 1 != 0)
  35470. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35471. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35472. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35473. }
  35474. var i, n = e, r = -1;
  35475. return d.decodeUTF8toUTF16(function() {
  35476. if (0 === r)
  35477. return null;
  35478. if (e >= this.limit)
  35479. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35480. return 0 === (r = this.view[e++]) ? null : r
  35481. }
  35482. .bind(this), i = c(), !0),
  35483. t ? (this.offset = e,
  35484. i()) : {
  35485. string: i(),
  35486. length: e - n
  35487. }
  35488. }
  35489. ,
  35490. a.writeIString = function(e, t) {
  35491. var i = void 0 === t;
  35492. if (i && (t = this.offset),
  35493. !this.noAssert) {
  35494. if ("string" != typeof e)
  35495. throw TypeError("Illegal str: Not a string");
  35496. if ("number" != typeof t || t % 1 != 0)
  35497. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35498. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35499. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35500. }
  35501. var n, r = t;
  35502. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35503. t += 4 + n;
  35504. var o = this.buffer.byteLength;
  35505. if (o < t && this.resize((o *= 2) > t ? o : t),
  35506. t -= 4 + n,
  35507. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35508. this.view[t + 2] = n >>> 16 & 255,
  35509. this.view[t + 1] = n >>> 8 & 255,
  35510. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35511. this.view[t + 1] = n >>> 16 & 255,
  35512. this.view[t + 2] = n >>> 8 & 255,
  35513. this.view[t + 3] = 255 & n),
  35514. t += 4,
  35515. d.encodeUTF16toUTF8(s(e), function(e) {
  35516. this.view[t++] = e
  35517. }
  35518. .bind(this)),
  35519. t !== r + 4 + n)
  35520. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35521. return i ? (this.offset = t,
  35522. this) : t - r
  35523. }
  35524. ,
  35525. a.readIString = function(e) {
  35526. var t = void 0 === e;
  35527. if (t && (e = this.offset),
  35528. !this.noAssert) {
  35529. if ("number" != typeof e || e % 1 != 0)
  35530. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35531. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35532. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35533. }
  35534. var i = e
  35535. , n = this.readUint32(e)
  35536. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35537. return e += r.length,
  35538. t ? (this.offset = e,
  35539. r.string) : {
  35540. string: r.string,
  35541. length: e - i
  35542. }
  35543. }
  35544. ,
  35545. f.METRICS_CHARS = "c",
  35546. f.METRICS_BYTES = "b",
  35547. a.writeUTF8String = function(e, t) {
  35548. var i = void 0 === t;
  35549. if (i && (t = this.offset),
  35550. !this.noAssert) {
  35551. if ("number" != typeof t || t % 1 != 0)
  35552. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35553. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35554. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35555. }
  35556. var n, r = t;
  35557. n = d.calculateUTF16asUTF8(s(e))[1],
  35558. t += n;
  35559. var o = this.buffer.byteLength;
  35560. return o < t && this.resize((o *= 2) > t ? o : t),
  35561. t -= n,
  35562. d.encodeUTF16toUTF8(s(e), function(e) {
  35563. this.view[t++] = e
  35564. }
  35565. .bind(this)),
  35566. i ? (this.offset = t,
  35567. this) : t - r
  35568. }
  35569. ,
  35570. a.writeString = a.writeUTF8String,
  35571. f.calculateUTF8Chars = function(e) {
  35572. return d.calculateUTF16asUTF8(s(e))[0]
  35573. }
  35574. ,
  35575. f.calculateUTF8Bytes = function(e) {
  35576. return d.calculateUTF16asUTF8(s(e))[1]
  35577. }
  35578. ,
  35579. f.calculateString = f.calculateUTF8Bytes,
  35580. a.readUTF8String = function(e, t, i) {
  35581. "number" == typeof t && (i = t,
  35582. t = void 0);
  35583. var n = void 0 === i;
  35584. if (n && (i = this.offset),
  35585. void 0 === t && (t = f.METRICS_CHARS),
  35586. !this.noAssert) {
  35587. if ("number" != typeof e || e % 1 != 0)
  35588. throw TypeError("Illegal length: " + e + " (not an integer)");
  35589. if (e |= 0,
  35590. "number" != typeof i || i % 1 != 0)
  35591. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35592. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35593. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35594. }
  35595. var r, o = 0, a = i;
  35596. if (t === f.METRICS_CHARS) {
  35597. if (r = c(),
  35598. d.decodeUTF8(function() {
  35599. return o < e && i < this.limit ? this.view[i++] : null
  35600. }
  35601. .bind(this), function(e) {
  35602. ++o,
  35603. d.UTF8toUTF16(e, r)
  35604. }),
  35605. o !== e)
  35606. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35607. return n ? (this.offset = i,
  35608. r()) : {
  35609. string: r(),
  35610. length: i - a
  35611. }
  35612. }
  35613. if (t !== f.METRICS_BYTES)
  35614. throw TypeError("Unsupported metrics: " + t);
  35615. if (!this.noAssert) {
  35616. if ("number" != typeof i || i % 1 != 0)
  35617. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35618. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35619. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35620. }
  35621. var s = i + e;
  35622. if (d.decodeUTF8toUTF16(function() {
  35623. return i < s ? this.view[i++] : null
  35624. }
  35625. .bind(this), r = c(), this.noAssert),
  35626. i !== s)
  35627. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35628. return n ? (this.offset = i,
  35629. r()) : {
  35630. string: r(),
  35631. length: i - a
  35632. }
  35633. }
  35634. ,
  35635. a.readString = a.readUTF8String,
  35636. a.writeVString = function(e, t) {
  35637. var i = void 0 === t;
  35638. if (i && (t = this.offset),
  35639. !this.noAssert) {
  35640. if ("string" != typeof e)
  35641. throw TypeError("Illegal str: Not a string");
  35642. if ("number" != typeof t || t % 1 != 0)
  35643. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35644. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35645. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35646. }
  35647. var n, r, o = t;
  35648. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35649. r = f.calculateVarint32(n),
  35650. t += r + n;
  35651. var a = this.buffer.byteLength;
  35652. if (a < t && this.resize((a *= 2) > t ? a : t),
  35653. t -= r + n,
  35654. t += this.writeVarint32(n, t),
  35655. d.encodeUTF16toUTF8(s(e), function(e) {
  35656. this.view[t++] = e
  35657. }
  35658. .bind(this)),
  35659. t !== o + n + r)
  35660. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35661. return i ? (this.offset = t,
  35662. this) : t - o
  35663. }
  35664. ,
  35665. a.readVString = function(e) {
  35666. var t = void 0 === e;
  35667. if (t && (e = this.offset),
  35668. !this.noAssert) {
  35669. if ("number" != typeof e || e % 1 != 0)
  35670. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35671. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35672. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35673. }
  35674. var i = e
  35675. , n = this.readVarint32(e)
  35676. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35677. return e += r.length,
  35678. t ? (this.offset = e,
  35679. r.string) : {
  35680. string: r.string,
  35681. length: e - i
  35682. }
  35683. }
  35684. ,
  35685. a.append = function(e, t, i) {
  35686. "number" != typeof t && "string" == typeof t || (i = t,
  35687. t = void 0);
  35688. var n = void 0 === i;
  35689. if (n && (i = this.offset),
  35690. !this.noAssert) {
  35691. if ("number" != typeof i || i % 1 != 0)
  35692. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35693. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35694. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35695. }
  35696. e instanceof f || (e = f.wrap(e, t));
  35697. var r = e.limit - e.offset;
  35698. if (r <= 0)
  35699. return this;
  35700. i += r;
  35701. var o = this.buffer.byteLength;
  35702. return o < i && this.resize((o *= 2) > i ? o : i),
  35703. i -= r,
  35704. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35705. e.offset += r,
  35706. n && (this.offset += r),
  35707. this
  35708. }
  35709. ,
  35710. a.appendTo = function(e, t) {
  35711. return e.append(this, t),
  35712. this
  35713. }
  35714. ,
  35715. a.assert = function(e) {
  35716. return this.noAssert = !e,
  35717. this
  35718. }
  35719. ,
  35720. a.capacity = function() {
  35721. return this.buffer.byteLength
  35722. }
  35723. ,
  35724. a.clear = function() {
  35725. return this.offset = 0,
  35726. this.limit = this.buffer.byteLength,
  35727. this.markedOffset = -1,
  35728. this
  35729. }
  35730. ,
  35731. a.clone = function(e) {
  35732. var t = new f(0,this.littleEndian,this.noAssert);
  35733. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35734. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35735. t.view = this.view),
  35736. t.offset = this.offset,
  35737. t.markedOffset = this.markedOffset,
  35738. t.limit = this.limit,
  35739. t
  35740. }
  35741. ,
  35742. a.compact = function(e, t) {
  35743. if (void 0 === e && (e = this.offset),
  35744. void 0 === t && (t = this.limit),
  35745. !this.noAssert) {
  35746. if ("number" != typeof e || e % 1 != 0)
  35747. throw TypeError("Illegal begin: Not an integer");
  35748. if (e >>>= 0,
  35749. "number" != typeof t || t % 1 != 0)
  35750. throw TypeError("Illegal end: Not an integer");
  35751. if (t >>>= 0,
  35752. e < 0 || t < e || t > this.buffer.byteLength)
  35753. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35754. }
  35755. if (0 === e && t === this.buffer.byteLength)
  35756. return this;
  35757. var i = t - e;
  35758. if (0 == i)
  35759. return this.buffer = o,
  35760. this.view = null,
  35761. 0 <= this.markedOffset && (this.markedOffset -= e),
  35762. this.offset = 0,
  35763. this.limit = 0,
  35764. this;
  35765. var n = new ArrayBuffer(i)
  35766. , r = new Uint8Array(n);
  35767. return r.set(this.view.subarray(e, t)),
  35768. this.buffer = n,
  35769. this.view = r,
  35770. 0 <= this.markedOffset && (this.markedOffset -= e),
  35771. this.offset = 0,
  35772. this.limit = i,
  35773. this
  35774. }
  35775. ,
  35776. a.copy = function(e, t) {
  35777. if (void 0 === e && (e = this.offset),
  35778. void 0 === t && (t = this.limit),
  35779. !this.noAssert) {
  35780. if ("number" != typeof e || e % 1 != 0)
  35781. throw TypeError("Illegal begin: Not an integer");
  35782. if (e >>>= 0,
  35783. "number" != typeof t || t % 1 != 0)
  35784. throw TypeError("Illegal end: Not an integer");
  35785. if (t >>>= 0,
  35786. e < 0 || t < e || t > this.buffer.byteLength)
  35787. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35788. }
  35789. if (e === t)
  35790. return new f(0,this.littleEndian,this.noAssert);
  35791. var i = t - e
  35792. , n = new f(i,this.littleEndian,this.noAssert);
  35793. return n.offset = 0,
  35794. n.limit = i,
  35795. 0 <= n.markedOffset && (n.markedOffset -= e),
  35796. this.copyTo(n, 0, e, t),
  35797. n
  35798. }
  35799. ,
  35800. a.copyTo = function(e, t, i, n) {
  35801. var r, o;
  35802. if (!this.noAssert && !f.isByteBuffer(e))
  35803. throw TypeError("Illegal target: Not a ByteBuffer");
  35804. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35805. i = (r = void 0 === i) ? this.offset : 0 | i,
  35806. n = void 0 === n ? this.limit : 0 | n,
  35807. t < 0 || t > e.buffer.byteLength)
  35808. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35809. if (i < 0 || n > this.buffer.byteLength)
  35810. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35811. var a = n - i;
  35812. return 0 == a ? e : (e.ensureCapacity(t + a),
  35813. e.view.set(this.view.subarray(i, n), t),
  35814. r && (this.offset += a),
  35815. o && (e.offset += a),
  35816. this)
  35817. }
  35818. ,
  35819. a.ensureCapacity = function(e) {
  35820. var t = this.buffer.byteLength;
  35821. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35822. }
  35823. ,
  35824. a.fill = function(e, t, i) {
  35825. var n = void 0 === t;
  35826. if (n && (t = this.offset),
  35827. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35828. void 0 === t && (t = this.offset),
  35829. void 0 === i && (i = this.limit),
  35830. !this.noAssert) {
  35831. if ("number" != typeof e || e % 1 != 0)
  35832. throw TypeError("Illegal value: " + e + " (not an integer)");
  35833. if (e |= 0,
  35834. "number" != typeof t || t % 1 != 0)
  35835. throw TypeError("Illegal begin: Not an integer");
  35836. if (t >>>= 0,
  35837. "number" != typeof i || i % 1 != 0)
  35838. throw TypeError("Illegal end: Not an integer");
  35839. if (i >>>= 0,
  35840. t < 0 || i < t || i > this.buffer.byteLength)
  35841. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35842. }
  35843. if (i <= t)
  35844. return this;
  35845. for (; t < i; )
  35846. this.view[t++] = e;
  35847. return n && (this.offset = t),
  35848. this
  35849. }
  35850. ,
  35851. a.flip = function() {
  35852. return this.limit = this.offset,
  35853. this.offset = 0,
  35854. this
  35855. }
  35856. ,
  35857. a.mark = function(e) {
  35858. if (e = void 0 === e ? this.offset : e,
  35859. !this.noAssert) {
  35860. if ("number" != typeof e || e % 1 != 0)
  35861. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35862. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35863. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35864. }
  35865. return this.markedOffset = e,
  35866. this
  35867. }
  35868. ,
  35869. a.order = function(e) {
  35870. if (!this.noAssert && "boolean" != typeof e)
  35871. throw TypeError("Illegal littleEndian: Not a boolean");
  35872. return this.littleEndian = !!e,
  35873. this
  35874. }
  35875. ,
  35876. a.LE = function(e) {
  35877. return this.littleEndian = void 0 === e || !!e,
  35878. this
  35879. }
  35880. ,
  35881. a.BE = function(e) {
  35882. return this.littleEndian = void 0 !== e && !e,
  35883. this
  35884. }
  35885. ,
  35886. a.prepend = function(e, t, i) {
  35887. "number" != typeof t && "string" == typeof t || (i = t,
  35888. t = void 0);
  35889. var n = void 0 === i;
  35890. if (n && (i = this.offset),
  35891. !this.noAssert) {
  35892. if ("number" != typeof i || i % 1 != 0)
  35893. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35894. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35895. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35896. }
  35897. e instanceof f || (e = f.wrap(e, t));
  35898. var r = e.limit - e.offset;
  35899. if (r <= 0)
  35900. return this;
  35901. var o = r - i;
  35902. if (0 < o) {
  35903. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35904. , s = new Uint8Array(a);
  35905. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35906. this.buffer = a,
  35907. this.view = s,
  35908. this.offset += o,
  35909. 0 <= this.markedOffset && (this.markedOffset += o),
  35910. this.limit += o,
  35911. i += o
  35912. } else
  35913. new Uint8Array(this.buffer);
  35914. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35915. e.offset = e.limit,
  35916. n && (this.offset -= r),
  35917. this
  35918. }
  35919. ,
  35920. a.prependTo = function(e, t) {
  35921. return e.prepend(this, t),
  35922. this
  35923. }
  35924. ,
  35925. a.printDebug = function(e) {
  35926. "function" != typeof e && (e = console.log.bind(console)),
  35927. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35928. }
  35929. ,
  35930. a.remaining = function() {
  35931. return this.limit - this.offset
  35932. }
  35933. ,
  35934. a.reset = function() {
  35935. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35936. this.markedOffset = -1) : this.offset = 0,
  35937. this
  35938. }
  35939. ,
  35940. a.resize = function(e) {
  35941. if (!this.noAssert) {
  35942. if ("number" != typeof e || e % 1 != 0)
  35943. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35944. if ((e |= 0) < 0)
  35945. throw RangeError("Illegal capacity: 0 <= " + e)
  35946. }
  35947. if (this.buffer.byteLength < e) {
  35948. var t = new ArrayBuffer(e)
  35949. , i = new Uint8Array(t);
  35950. i.set(this.view),
  35951. this.buffer = t,
  35952. this.view = i
  35953. }
  35954. return this
  35955. }
  35956. ,
  35957. a.reverse = function(e, t) {
  35958. if (void 0 === e && (e = this.offset),
  35959. void 0 === t && (t = this.limit),
  35960. !this.noAssert) {
  35961. if ("number" != typeof e || e % 1 != 0)
  35962. throw TypeError("Illegal begin: Not an integer");
  35963. if (e >>>= 0,
  35964. "number" != typeof t || t % 1 != 0)
  35965. throw TypeError("Illegal end: Not an integer");
  35966. if (t >>>= 0,
  35967. e < 0 || t < e || t > this.buffer.byteLength)
  35968. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35969. }
  35970. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35971. this
  35972. }
  35973. ,
  35974. a.skip = function(e) {
  35975. if (!this.noAssert) {
  35976. if ("number" != typeof e || e % 1 != 0)
  35977. throw TypeError("Illegal length: " + e + " (not an integer)");
  35978. e |= 0
  35979. }
  35980. var t = this.offset + e;
  35981. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35982. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35983. return this.offset = t,
  35984. this
  35985. }
  35986. ,
  35987. a.slice = function(e, t) {
  35988. if (void 0 === e && (e = this.offset),
  35989. void 0 === t && (t = this.limit),
  35990. !this.noAssert) {
  35991. if ("number" != typeof e || e % 1 != 0)
  35992. throw TypeError("Illegal begin: Not an integer");
  35993. if (e >>>= 0,
  35994. "number" != typeof t || t % 1 != 0)
  35995. throw TypeError("Illegal end: Not an integer");
  35996. if (t >>>= 0,
  35997. e < 0 || t < e || t > this.buffer.byteLength)
  35998. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35999. }
  36000. var i = this.clone();
  36001. return i.offset = e,
  36002. i.limit = t,
  36003. i
  36004. }
  36005. ,
  36006. a.toBuffer = function(e) {
  36007. var t = this.offset
  36008. , i = this.limit;
  36009. if (!this.noAssert) {
  36010. if ("number" != typeof t || t % 1 != 0)
  36011. throw TypeError("Illegal offset: Not an integer");
  36012. if (t >>>= 0,
  36013. "number" != typeof i || i % 1 != 0)
  36014. throw TypeError("Illegal limit: Not an integer");
  36015. if (i >>>= 0,
  36016. t < 0 || i < t || i > this.buffer.byteLength)
  36017. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36018. }
  36019. if (!e && 0 === t && i === this.buffer.byteLength)
  36020. return this.buffer;
  36021. if (t === i)
  36022. return o;
  36023. var n = new ArrayBuffer(i - t);
  36024. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36025. n
  36026. }
  36027. ,
  36028. a.toArrayBuffer = a.toBuffer,
  36029. a.toString = function(e, t, i) {
  36030. if (void 0 === e)
  36031. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36032. switch ("number" == typeof e && (i = t = e = "utf8"),
  36033. e) {
  36034. case "utf8":
  36035. return this.toUTF8(t, i);
  36036. case "base64":
  36037. return this.toBase64(t, i);
  36038. case "hex":
  36039. return this.toHex(t, i);
  36040. case "binary":
  36041. return this.toBinary(t, i);
  36042. case "debug":
  36043. return this.toDebug();
  36044. case "columns":
  36045. return this.toColumns();
  36046. default:
  36047. throw Error("Unsupported encoding: " + e)
  36048. }
  36049. }
  36050. ;
  36051. var h = function() {
  36052. 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)
  36053. a[r[t]] = t;
  36054. return e.encode = function(e, t) {
  36055. for (var i, n; null !== (i = e()); )
  36056. t(r[i >> 2 & 63]),
  36057. n = (3 & i) << 4,
  36058. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36059. n = (15 & i) << 2,
  36060. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36061. t(r[63 & i])) : (t(r[63 & n]),
  36062. t(61))) : (t(r[63 & n]),
  36063. t(61),
  36064. t(61))
  36065. }
  36066. ,
  36067. e.decode = function(e, t) {
  36068. function i(e) {
  36069. throw Error("Illegal character code: " + e)
  36070. }
  36071. for (var n, r, o; null !== (n = e()); )
  36072. if (void 0 === (r = a[n]) && i(n),
  36073. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36074. t(r << 2 >>> 0 | (48 & o) >> 4),
  36075. null !== (n = e()))) {
  36076. if (void 0 === (r = a[n])) {
  36077. if (61 === n)
  36078. break;
  36079. i(n)
  36080. }
  36081. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36082. null !== (n = e())) {
  36083. if (void 0 === (o = a[n])) {
  36084. if (61 === n)
  36085. break;
  36086. i(n)
  36087. }
  36088. t((3 & r) << 6 >>> 0 | o)
  36089. }
  36090. }
  36091. }
  36092. ,
  36093. e.test = function(e) {
  36094. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36095. }
  36096. ,
  36097. e
  36098. }();
  36099. a.toBase64 = function(e, t) {
  36100. if (void 0 === e && (e = this.offset),
  36101. void 0 === t && (t = this.limit),
  36102. t |= 0,
  36103. (e |= 0) < 0 || t > this.capacity || t < e)
  36104. throw RangeError("begin, end");
  36105. var i;
  36106. return h.encode(function() {
  36107. return e < t ? this.view[e++] : null
  36108. }
  36109. .bind(this), i = c()),
  36110. i()
  36111. }
  36112. ,
  36113. f.fromBase64 = function(e, t) {
  36114. if ("string" != typeof e)
  36115. throw TypeError("str");
  36116. var i = new f(e.length / 4 * 3,t)
  36117. , n = 0;
  36118. return h.decode(s(e), function(e) {
  36119. i.view[n++] = e
  36120. }),
  36121. i.limit = n,
  36122. i
  36123. }
  36124. ,
  36125. f.btoa = function(e) {
  36126. return f.fromBinary(e).toBase64()
  36127. }
  36128. ,
  36129. f.atob = function(e) {
  36130. return f.fromBase64(e).toBinary()
  36131. }
  36132. ,
  36133. a.toBinary = function(e, t) {
  36134. if (void 0 === e && (e = this.offset),
  36135. void 0 === t && (t = this.limit),
  36136. t |= 0,
  36137. (e |= 0) < 0 || t > this.capacity() || t < e)
  36138. throw RangeError("begin, end");
  36139. if (e === t)
  36140. return "";
  36141. for (var i = [], n = []; e < t; )
  36142. i.push(this.view[e++]),
  36143. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36144. i = []);
  36145. return n.join("") + String.fromCharCode.apply(String, i)
  36146. }
  36147. ,
  36148. f.fromBinary = function(e, t) {
  36149. if ("string" != typeof e)
  36150. throw TypeError("str");
  36151. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36152. if (255 < (i = e.charCodeAt(n)))
  36153. throw RangeError("illegal char code: " + i);
  36154. o.view[n++] = i
  36155. }
  36156. return o.limit = r,
  36157. o
  36158. }
  36159. ,
  36160. a.toDebug = function(e) {
  36161. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36162. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36163. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36164. ++i,
  36165. e && 0 < i && i % 16 == 0 && i !== n) {
  36166. for (; r.length < 51; )
  36167. r += " ";
  36168. a += r + o + "\n",
  36169. r = o = ""
  36170. }
  36171. 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 ? " " : ""
  36172. }
  36173. if (e && " " !== r) {
  36174. for (; r.length < 51; )
  36175. r += " ";
  36176. a += r + o + "\n"
  36177. }
  36178. return e ? a : r
  36179. }
  36180. ,
  36181. f.fromDebug = function(e, t, i) {
  36182. 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; ) {
  36183. switch (n = e.charAt(s++)) {
  36184. case "!":
  36185. if (!i) {
  36186. if (h || u || d) {
  36187. p = !0;
  36188. break
  36189. }
  36190. h = u = d = !0
  36191. }
  36192. a.offset = a.markedOffset = a.limit = l,
  36193. c = !1;
  36194. break;
  36195. case "|":
  36196. if (!i) {
  36197. if (h || d) {
  36198. p = !0;
  36199. break
  36200. }
  36201. h = d = !0
  36202. }
  36203. a.offset = a.limit = l,
  36204. c = !1;
  36205. break;
  36206. case "[":
  36207. if (!i) {
  36208. if (h || u) {
  36209. p = !0;
  36210. break
  36211. }
  36212. h = u = !0
  36213. }
  36214. a.offset = a.markedOffset = l,
  36215. c = !1;
  36216. break;
  36217. case "<":
  36218. if (!i) {
  36219. if (h) {
  36220. p = !0;
  36221. break
  36222. }
  36223. h = !0
  36224. }
  36225. a.offset = l,
  36226. c = !1;
  36227. break;
  36228. case "]":
  36229. if (!i) {
  36230. if (d || u) {
  36231. p = !0;
  36232. break
  36233. }
  36234. d = u = !0
  36235. }
  36236. a.limit = a.markedOffset = l,
  36237. c = !1;
  36238. break;
  36239. case ">":
  36240. if (!i) {
  36241. if (d) {
  36242. p = !0;
  36243. break
  36244. }
  36245. d = !0
  36246. }
  36247. a.limit = l,
  36248. c = !1;
  36249. break;
  36250. case "'":
  36251. if (!i) {
  36252. if (u) {
  36253. p = !0;
  36254. break
  36255. }
  36256. u = !0
  36257. }
  36258. a.markedOffset = l,
  36259. c = !1;
  36260. break;
  36261. case " ":
  36262. c = !1;
  36263. break;
  36264. default:
  36265. if (!i && c) {
  36266. p = !0;
  36267. break
  36268. }
  36269. if (r = parseInt(n + e.charAt(s++), 16),
  36270. !i && (isNaN(r) || r < 0 || 255 < r))
  36271. throw TypeError("Illegal str: Not a debug encoded string");
  36272. a.view[l++] = r,
  36273. c = !0
  36274. }
  36275. if (p)
  36276. throw TypeError("Illegal str: Invalid symbol at " + s)
  36277. }
  36278. if (!i) {
  36279. if (!h || !d)
  36280. throw TypeError("Illegal str: Missing offset or limit");
  36281. if (l < a.buffer.byteLength)
  36282. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36283. }
  36284. return a
  36285. }
  36286. ,
  36287. a.toHex = function(e, t) {
  36288. if (e = void 0 === e ? this.offset : e,
  36289. t = void 0 === t ? this.limit : t,
  36290. !this.noAssert) {
  36291. if ("number" != typeof e || e % 1 != 0)
  36292. throw TypeError("Illegal begin: Not an integer");
  36293. if (e >>>= 0,
  36294. "number" != typeof t || t % 1 != 0)
  36295. throw TypeError("Illegal end: Not an integer");
  36296. if (t >>>= 0,
  36297. e < 0 || t < e || t > this.buffer.byteLength)
  36298. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36299. }
  36300. for (var i, n = new Array(t - e); e < t; )
  36301. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36302. return n.join("")
  36303. }
  36304. ,
  36305. f.fromHex = function(e, t, i) {
  36306. if (!i) {
  36307. if ("string" != typeof e)
  36308. throw TypeError("Illegal str: Not a string");
  36309. if (e.length % 2 != 0)
  36310. throw TypeError("Illegal str: Length not a multiple of 2")
  36311. }
  36312. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36313. if (n = parseInt(e.substring(a, a + 2), 16),
  36314. !i && (!isFinite(n) || n < 0 || 255 < n))
  36315. throw TypeError("Illegal str: Contains non-hex characters");
  36316. o.view[s++] = n
  36317. }
  36318. return o.limit = s,
  36319. o
  36320. }
  36321. ;
  36322. var u, d = u = {
  36323. MAX_CODEPOINT: 1114111,
  36324. encodeUTF8: function(e, t) {
  36325. var i = null;
  36326. for ("number" == typeof e && (i = e,
  36327. e = function() {
  36328. return null
  36329. }
  36330. ); null !== i || null !== (i = e()); )
  36331. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36332. t(i >> 12 & 63 | 128)),
  36333. t(i >> 6 & 63 | 128)),
  36334. t(63 & i | 128)),
  36335. i = null
  36336. },
  36337. decodeUTF8: function(e, t) {
  36338. for (var i, n, r, o, a = function(e) {
  36339. e = e.slice(0, e.indexOf(null));
  36340. var t = Error(e.toString());
  36341. throw t.name = "TruncatedError",
  36342. t.bytes = e,
  36343. t
  36344. }; null !== (i = e()); )
  36345. if (0 == (128 & i))
  36346. t(i);
  36347. else if (192 == (224 & i))
  36348. null === (n = e()) && a([i, n]),
  36349. t((31 & i) << 6 | 63 & n);
  36350. else if (224 == (240 & i))
  36351. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36352. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36353. else {
  36354. if (240 != (248 & i))
  36355. throw RangeError("Illegal starting byte: " + i);
  36356. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36357. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36358. }
  36359. },
  36360. UTF16toUTF8: function(e, t) {
  36361. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36362. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36363. n = null) : t(i);
  36364. null !== n && t(n)
  36365. },
  36366. UTF8toUTF16: function(e, t) {
  36367. var i = null;
  36368. for ("number" == typeof e && (i = e,
  36369. e = function() {
  36370. return null
  36371. }
  36372. ); null !== i || null !== (i = e()); )
  36373. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36374. t(i % 1024 + 56320)),
  36375. i = null
  36376. },
  36377. encodeUTF16toUTF8: function(e, t) {
  36378. u.UTF16toUTF8(e, function(e) {
  36379. u.encodeUTF8(e, t)
  36380. })
  36381. },
  36382. decodeUTF8toUTF16: function(e, t) {
  36383. u.decodeUTF8(e, function(e) {
  36384. u.UTF8toUTF16(e, t)
  36385. })
  36386. },
  36387. calculateCodePoint: function(e) {
  36388. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36389. },
  36390. calculateUTF8: function(e) {
  36391. for (var t, i = 0; null !== (t = e()); )
  36392. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36393. return i
  36394. },
  36395. calculateUTF16asUTF8: function(e) {
  36396. var t = 0
  36397. , i = 0;
  36398. return u.UTF16toUTF8(e, function(e) {
  36399. ++t,
  36400. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36401. }),
  36402. [t, i]
  36403. }
  36404. };
  36405. return a.toUTF8 = function(t, i) {
  36406. if (void 0 === t && (t = this.offset),
  36407. void 0 === i && (i = this.limit),
  36408. !this.noAssert) {
  36409. if ("number" != typeof t || t % 1 != 0)
  36410. throw TypeError("Illegal begin: Not an integer");
  36411. if (t >>>= 0,
  36412. "number" != typeof i || i % 1 != 0)
  36413. throw TypeError("Illegal end: Not an integer");
  36414. if (i >>>= 0,
  36415. t < 0 || i < t || i > this.buffer.byteLength)
  36416. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36417. }
  36418. var e;
  36419. try {
  36420. d.decodeUTF8toUTF16(function() {
  36421. return t < i ? this.view[t++] : null
  36422. }
  36423. .bind(this), e = c())
  36424. } catch (e) {
  36425. if (t !== i)
  36426. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36427. }
  36428. return e()
  36429. }
  36430. ,
  36431. f.fromUTF8 = function(e, t, i) {
  36432. if (!i && "string" != typeof e)
  36433. throw TypeError("Illegal str: Not a string");
  36434. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36435. , r = 0;
  36436. return d.encodeUTF16toUTF8(s(e), function(e) {
  36437. n.view[r++] = e
  36438. }),
  36439. n.limit = r,
  36440. n
  36441. }
  36442. ,
  36443. f
  36444. }
  36445. ,
  36446. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36447. var e;
  36448. try {
  36449. e = t("long")
  36450. } catch (e) {}
  36451. return r(e)
  36452. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36453. }
  36454. , {
  36455. long: 216
  36456. }],
  36457. 216: [function(e, t, i) {
  36458. var n, r;
  36459. n = this,
  36460. r = function() {
  36461. "use strict";
  36462. function n(e, t, i) {
  36463. this.low = 0 | e,
  36464. this.high = 0 | t,
  36465. this.unsigned = !!i
  36466. }
  36467. function p(e) {
  36468. return !0 === (e && e.__isLong__)
  36469. }
  36470. function e(e, t) {
  36471. var i, n, r;
  36472. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36473. r && (a[e] = i),
  36474. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36475. r && (o[e] = i),
  36476. i)
  36477. }
  36478. function f(e, t) {
  36479. if (isNaN(e) || !isFinite(e))
  36480. return t ? l : y;
  36481. if (t) {
  36482. if (e < 0)
  36483. return l;
  36484. if (r <= e)
  36485. return I
  36486. } else {
  36487. if (e <= -s)
  36488. return E;
  36489. if (s <= e + 1)
  36490. return C
  36491. }
  36492. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36493. }
  36494. function g(e, t, i) {
  36495. return new n(e,t,i)
  36496. }
  36497. function h(e, t, i) {
  36498. if (0 === e.length)
  36499. throw Error("empty string");
  36500. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36501. return y;
  36502. if (t = "number" == typeof t ? (i = t,
  36503. !1) : !!t,
  36504. (i = i || 10) < 2 || 36 < i)
  36505. throw RangeError("radix");
  36506. var n;
  36507. if (0 < (n = e.indexOf("-")))
  36508. throw Error("interior hyphen");
  36509. if (0 === n)
  36510. return h(e.substring(1), t, i).neg();
  36511. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36512. var s = Math.min(8, e.length - a)
  36513. , l = parseInt(e.substring(a, a + s), i);
  36514. if (s < 8) {
  36515. var c = f(u(i, s));
  36516. o = o.mul(c).add(f(l))
  36517. } else
  36518. o = (o = o.mul(r)).add(f(l))
  36519. }
  36520. return o.unsigned = t,
  36521. o
  36522. }
  36523. function m(e) {
  36524. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36525. }
  36526. Object.defineProperty(n.prototype, "__isLong__", {
  36527. value: !0,
  36528. enumerable: !1,
  36529. configurable: !1
  36530. }),
  36531. n.isLong = p;
  36532. var o = {}
  36533. , a = {};
  36534. n.fromInt = e,
  36535. n.fromNumber = f,
  36536. n.fromBits = g;
  36537. var u = Math.pow;
  36538. n.fromString = h,
  36539. n.fromValue = m;
  36540. var i = 4294967296
  36541. , r = 0x10000000000000000
  36542. , s = r / 2
  36543. , v = e(1 << 24)
  36544. , y = e(0);
  36545. n.ZERO = y;
  36546. var l = e(0, !0);
  36547. n.UZERO = l;
  36548. var c = e(1);
  36549. n.ONE = c;
  36550. var d = e(1, !0);
  36551. n.UONE = d;
  36552. var A = e(-1);
  36553. n.NEG_ONE = A;
  36554. var C = g(-1, 2147483647, !1);
  36555. n.MAX_VALUE = C;
  36556. var I = g(-1, -1, !0);
  36557. n.MAX_UNSIGNED_VALUE = I;
  36558. var E = g(0, -2147483648, !1);
  36559. n.MIN_VALUE = E;
  36560. var t = n.prototype;
  36561. return t.toInt = function() {
  36562. return this.unsigned ? this.low >>> 0 : this.low
  36563. }
  36564. ,
  36565. t.toNumber = function() {
  36566. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36567. }
  36568. ,
  36569. t.toString = function(e) {
  36570. if ((e = e || 10) < 2 || 36 < e)
  36571. throw RangeError("radix");
  36572. if (this.isZero())
  36573. return "0";
  36574. if (this.isNegative()) {
  36575. if (this.eq(E)) {
  36576. var t = f(e)
  36577. , i = this.div(t)
  36578. , n = i.mul(t).sub(this);
  36579. return i.toString(e) + n.toInt().toString(e)
  36580. }
  36581. return "-" + this.neg().toString(e)
  36582. }
  36583. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36584. var s = o.div(r)
  36585. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36586. if ((o = s).isZero())
  36587. return l + a;
  36588. for (; l.length < 6; )
  36589. l = "0" + l;
  36590. a = "" + l + a
  36591. }
  36592. }
  36593. ,
  36594. t.getHighBits = function() {
  36595. return this.high
  36596. }
  36597. ,
  36598. t.getHighBitsUnsigned = function() {
  36599. return this.high >>> 0
  36600. }
  36601. ,
  36602. t.getLowBits = function() {
  36603. return this.low
  36604. }
  36605. ,
  36606. t.getLowBitsUnsigned = function() {
  36607. return this.low >>> 0
  36608. }
  36609. ,
  36610. t.getNumBitsAbs = function() {
  36611. if (this.isNegative())
  36612. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36613. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36614. ;
  36615. return 0 != this.high ? t + 33 : t + 1
  36616. }
  36617. ,
  36618. t.isZero = function() {
  36619. return 0 === this.high && 0 === this.low
  36620. }
  36621. ,
  36622. t.isNegative = function() {
  36623. return !this.unsigned && this.high < 0
  36624. }
  36625. ,
  36626. t.isPositive = function() {
  36627. return this.unsigned || 0 <= this.high
  36628. }
  36629. ,
  36630. t.isOdd = function() {
  36631. return 1 == (1 & this.low)
  36632. }
  36633. ,
  36634. t.isEven = function() {
  36635. return 0 == (1 & this.low)
  36636. }
  36637. ,
  36638. t.equals = function(e) {
  36639. return p(e) || (e = m(e)),
  36640. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36641. }
  36642. ,
  36643. t.eq = t.equals,
  36644. t.notEquals = function(e) {
  36645. return !this.eq(e)
  36646. }
  36647. ,
  36648. t.neq = t.notEquals,
  36649. t.lessThan = function(e) {
  36650. return this.comp(e) < 0
  36651. }
  36652. ,
  36653. t.lt = t.lessThan,
  36654. t.lessThanOrEqual = function(e) {
  36655. return this.comp(e) <= 0
  36656. }
  36657. ,
  36658. t.lte = t.lessThanOrEqual,
  36659. t.greaterThan = function(e) {
  36660. return 0 < this.comp(e)
  36661. }
  36662. ,
  36663. t.gt = t.greaterThan,
  36664. t.greaterThanOrEqual = function(e) {
  36665. return 0 <= this.comp(e)
  36666. }
  36667. ,
  36668. t.gte = t.greaterThanOrEqual,
  36669. t.compare = function(e) {
  36670. if (p(e) || (e = m(e)),
  36671. this.eq(e))
  36672. return 0;
  36673. var t = this.isNegative()
  36674. , i = e.isNegative();
  36675. 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
  36676. }
  36677. ,
  36678. t.comp = t.compare,
  36679. t.negate = function() {
  36680. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36681. }
  36682. ,
  36683. t.neg = t.negate,
  36684. t.add = function(e) {
  36685. p(e) || (e = m(e));
  36686. var t = this.high >>> 16
  36687. , i = 65535 & this.high
  36688. , n = this.low >>> 16
  36689. , r = 65535 & this.low
  36690. , o = e.high >>> 16
  36691. , a = 65535 & e.high
  36692. , s = e.low >>> 16
  36693. , l = 0
  36694. , c = 0
  36695. , h = 0
  36696. , u = 0;
  36697. return h += (u += r + (65535 & e.low)) >>> 16,
  36698. c += (h += n + s) >>> 16,
  36699. l += (c += i + a) >>> 16,
  36700. l += t + o,
  36701. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36702. }
  36703. ,
  36704. t.subtract = function(e) {
  36705. return p(e) || (e = m(e)),
  36706. this.add(e.neg())
  36707. }
  36708. ,
  36709. t.sub = t.subtract,
  36710. t.multiply = function(e) {
  36711. if (this.isZero())
  36712. return y;
  36713. if (p(e) || (e = m(e)),
  36714. e.isZero())
  36715. return y;
  36716. if (this.eq(E))
  36717. return e.isOdd() ? E : y;
  36718. if (e.eq(E))
  36719. return this.isOdd() ? E : y;
  36720. if (this.isNegative())
  36721. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36722. if (e.isNegative())
  36723. return this.mul(e.neg()).neg();
  36724. if (this.lt(v) && e.lt(v))
  36725. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36726. var t = this.high >>> 16
  36727. , i = 65535 & this.high
  36728. , n = this.low >>> 16
  36729. , r = 65535 & this.low
  36730. , o = e.high >>> 16
  36731. , a = 65535 & e.high
  36732. , s = e.low >>> 16
  36733. , l = 65535 & e.low
  36734. , c = 0
  36735. , h = 0
  36736. , u = 0
  36737. , d = 0;
  36738. return u += (d += r * l) >>> 16,
  36739. h += (u += n * l) >>> 16,
  36740. u &= 65535,
  36741. h += (u += r * s) >>> 16,
  36742. c += (h += i * l) >>> 16,
  36743. h &= 65535,
  36744. c += (h += n * s) >>> 16,
  36745. h &= 65535,
  36746. c += (h += r * a) >>> 16,
  36747. c += t * l + i * s + n * a + r * o,
  36748. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36749. }
  36750. ,
  36751. t.mul = t.multiply,
  36752. t.divide = function(e) {
  36753. if (p(e) || (e = m(e)),
  36754. e.isZero())
  36755. throw Error("division by zero");
  36756. if (this.isZero())
  36757. return this.unsigned ? l : y;
  36758. var t, i, n;
  36759. if (this.unsigned) {
  36760. if (e.unsigned || (e = e.toUnsigned()),
  36761. e.gt(this))
  36762. return l;
  36763. if (e.gt(this.shru(1)))
  36764. return d;
  36765. n = l
  36766. } else {
  36767. if (this.eq(E))
  36768. 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)),
  36769. n = t.add(i.div(e)));
  36770. if (e.eq(E))
  36771. return this.unsigned ? l : y;
  36772. if (this.isNegative())
  36773. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36774. if (e.isNegative())
  36775. return this.div(e.neg()).neg();
  36776. n = y
  36777. }
  36778. for (i = this; i.gte(e); ) {
  36779. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36780. 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); )
  36781. s = (a = f(t -= o, this.unsigned)).mul(e);
  36782. a.isZero() && (a = c),
  36783. n = n.add(a),
  36784. i = i.sub(s)
  36785. }
  36786. return n
  36787. }
  36788. ,
  36789. t.div = t.divide,
  36790. t.modulo = function(e) {
  36791. return p(e) || (e = m(e)),
  36792. this.sub(this.div(e).mul(e))
  36793. }
  36794. ,
  36795. t.mod = t.modulo,
  36796. t.not = function() {
  36797. return g(~this.low, ~this.high, this.unsigned)
  36798. }
  36799. ,
  36800. t.and = function(e) {
  36801. return p(e) || (e = m(e)),
  36802. g(this.low & e.low, this.high & e.high, this.unsigned)
  36803. }
  36804. ,
  36805. t.or = function(e) {
  36806. return p(e) || (e = m(e)),
  36807. g(this.low | e.low, this.high | e.high, this.unsigned)
  36808. }
  36809. ,
  36810. t.xor = function(e) {
  36811. return p(e) || (e = m(e)),
  36812. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36813. }
  36814. ,
  36815. t.shiftLeft = function(e) {
  36816. return p(e) && (e = e.toInt()),
  36817. 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)
  36818. }
  36819. ,
  36820. t.shl = t.shiftLeft,
  36821. t.shiftRight = function(e) {
  36822. return p(e) && (e = e.toInt()),
  36823. 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)
  36824. }
  36825. ,
  36826. t.shr = t.shiftRight,
  36827. t.shiftRightUnsigned = function(e) {
  36828. if (p(e) && (e = e.toInt()),
  36829. 0 === (e &= 63))
  36830. return this;
  36831. var t = this.high;
  36832. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36833. }
  36834. ,
  36835. t.shru = t.shiftRightUnsigned,
  36836. t.toSigned = function() {
  36837. return this.unsigned ? g(this.low, this.high, !1) : this
  36838. }
  36839. ,
  36840. t.toUnsigned = function() {
  36841. return this.unsigned ? this : g(this.low, this.high, !0)
  36842. }
  36843. ,
  36844. t.toBytes = function(e) {
  36845. return e ? this.toBytesLE() : this.toBytesBE()
  36846. }
  36847. ,
  36848. t.toBytesLE = function() {
  36849. var e = this.high
  36850. , t = this.low;
  36851. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36852. }
  36853. ,
  36854. t.toBytesBE = function() {
  36855. var e = this.high
  36856. , t = this.low;
  36857. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36858. }
  36859. ,
  36860. n
  36861. }
  36862. ,
  36863. "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()
  36864. }
  36865. , {}],
  36866. 217: [function(e, t, i) {
  36867. 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 = {
  36868. REVISION: "75"
  36869. };
  36870. function Ii(e, t) {
  36871. return e.distance - t.distance
  36872. }
  36873. function Ei(e, t, i, n) {
  36874. if (!1 !== e.visible && (e.raycast(t, i),
  36875. !0 === n))
  36876. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36877. Ei(r[o], t, i, !0)
  36878. }
  36879. function _i(e, t, i) {
  36880. return i < 0 && (i += 1),
  36881. 1 < i && (i -= 1),
  36882. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36883. }
  36884. function bi(e, t, i, n, r, o, a) {
  36885. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36886. r.multiplyScalar(Vt.x),
  36887. o.multiplyScalar(Vt.y),
  36888. a.multiplyScalar(Vt.z),
  36889. r.add(o).add(a),
  36890. r.clone()
  36891. }
  36892. function wi(e, t, i, n, r, o, a) {
  36893. var s = e.material;
  36894. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36895. return null;
  36896. Ut.copy(a),
  36897. Ut.applyMatrix4(e.matrixWorld);
  36898. var l = t.ray.origin.distanceTo(Ut);
  36899. return l < t.near || l > t.far ? null : {
  36900. distance: l,
  36901. point: Ut.clone(),
  36902. object: e
  36903. }
  36904. }
  36905. function Ti(e, t, i, n, r, o, a, s) {
  36906. Mt.fromArray(n, 3 * o),
  36907. Rt.fromArray(n, 3 * a),
  36908. Pt.fromArray(n, 3 * s);
  36909. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36910. return l && (r && (Nt.fromArray(r, 2 * o),
  36911. Ft.fromArray(r, 2 * a),
  36912. Bt.fromArray(r, 2 * s),
  36913. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36914. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36915. l.faceIndex = o),
  36916. l
  36917. }
  36918. function xi() {}
  36919. function Si(e, t, i, n, r, o) {
  36920. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36921. if (s = e[o[t]].x,
  36922. l = e[o[t]].y,
  36923. c = e[o[i]].x,
  36924. h = e[o[i]].y,
  36925. u = e[o[n]].x,
  36926. d = e[o[n]].y,
  36927. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36928. return !1;
  36929. for (g = u - c,
  36930. m = d - h,
  36931. v = s - u,
  36932. y = l - d,
  36933. A = c - s,
  36934. C = h - l,
  36935. a = 0; a < r; a++)
  36936. if (p = e[o[a]].x,
  36937. f = e[o[a]].y,
  36938. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36939. E = v * (f - d) - y * (p - u),
  36940. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36941. return !1;
  36942. return !0
  36943. }
  36944. function Mi(e) {
  36945. switch (e) {
  36946. case Ci.LinearEncoding:
  36947. return ["Linear", "( value )"];
  36948. case Ci.sRGBEncoding:
  36949. return ["sRGB", "( value )"];
  36950. case Ci.RGBEEncoding:
  36951. return ["RGBE", "( value )"];
  36952. case Ci.RGBM7Encoding:
  36953. return ["RGBM", "( value, 7.0 )"];
  36954. case Ci.RGBM16Encoding:
  36955. return ["RGBM", "( value, 16.0 )"];
  36956. case Ci.RGBDEncoding:
  36957. return ["RGBD", "( value, 256.0 )"];
  36958. case Ci.GammaEncoding:
  36959. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36960. default:
  36961. throw new Error("unsupported encoding: " + e)
  36962. }
  36963. }
  36964. function Ri(e, t) {
  36965. var i = Mi(t);
  36966. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36967. }
  36968. function Pi(e) {
  36969. return "" !== e
  36970. }
  36971. function Oi(e, t) {
  36972. 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)
  36973. }
  36974. function Li(e) {
  36975. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36976. var i = Ci.ShaderChunk[t];
  36977. if (void 0 === i)
  36978. throw new Error("Can not resolve #include <" + t + ">");
  36979. return Li(i)
  36980. })
  36981. }
  36982. function Di(e) {
  36983. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36984. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36985. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36986. return r
  36987. })
  36988. }
  36989. function Ni(e, t, i, n) {
  36990. gi.set(t, i, n).unproject(mi);
  36991. var r = fi[e];
  36992. if (void 0 !== r)
  36993. for (var o = 0, a = r.length; o < a; o++)
  36994. pi.vertices[r[o]].copy(gi)
  36995. }
  36996. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36997. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36998. void 0 === Math.sign && (Math.sign = function(e) {
  36999. return e < 0 ? -1 : 0 < e ? 1 : +e
  37000. }
  37001. ),
  37002. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37003. get: function() {
  37004. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37005. }
  37006. }),
  37007. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37008. writable: !0,
  37009. configurable: !0,
  37010. value: function(e) {
  37011. "use strict";
  37012. if (null == e)
  37013. throw new TypeError("Cannot convert first argument to object");
  37014. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37015. var r = arguments[i];
  37016. if (null != r) {
  37017. r = Object(r);
  37018. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37019. var l = o[a]
  37020. , c = Object.getOwnPropertyDescriptor(r, l);
  37021. void 0 !== c && c.enumerable && (t[l] = r[l])
  37022. }
  37023. }
  37024. }
  37025. return t
  37026. }
  37027. }),
  37028. Ci.MOUSE = {
  37029. LEFT: 0,
  37030. MIDDLE: 1,
  37031. RIGHT: 2
  37032. },
  37033. Ci.CullFaceNone = 0,
  37034. Ci.CullFaceBack = 1,
  37035. Ci.CullFaceFront = 2,
  37036. Ci.CullFaceFrontBack = 3,
  37037. Ci.FrontFaceDirectionCW = 0,
  37038. Ci.FrontFaceDirectionCCW = 1,
  37039. Ci.BasicShadowMap = 0,
  37040. Ci.PCFShadowMap = 1,
  37041. Ci.PCFSoftShadowMap = 2,
  37042. Ci.FrontSide = 0,
  37043. Ci.BackSide = 1,
  37044. Ci.DoubleSide = 2,
  37045. Ci.FlatShading = 1,
  37046. Ci.SmoothShading = 2,
  37047. Ci.NoColors = 0,
  37048. Ci.FaceColors = 1,
  37049. Ci.VertexColors = 2,
  37050. Ci.NoBlending = 0,
  37051. Ci.NormalBlending = 1,
  37052. Ci.AdditiveBlending = 2,
  37053. Ci.SubtractiveBlending = 3,
  37054. Ci.MultiplyBlending = 4,
  37055. Ci.CustomBlending = 5,
  37056. Ci.AddEquation = 100,
  37057. Ci.SubtractEquation = 101,
  37058. Ci.ReverseSubtractEquation = 102,
  37059. Ci.MinEquation = 103,
  37060. Ci.MaxEquation = 104,
  37061. Ci.ZeroFactor = 200,
  37062. Ci.OneFactor = 201,
  37063. Ci.SrcColorFactor = 202,
  37064. Ci.OneMinusSrcColorFactor = 203,
  37065. Ci.SrcAlphaFactor = 204,
  37066. Ci.OneMinusSrcAlphaFactor = 205,
  37067. Ci.DstAlphaFactor = 206,
  37068. Ci.OneMinusDstAlphaFactor = 207,
  37069. Ci.DstColorFactor = 208,
  37070. Ci.OneMinusDstColorFactor = 209,
  37071. Ci.SrcAlphaSaturateFactor = 210,
  37072. Ci.NeverDepth = 0,
  37073. Ci.AlwaysDepth = 1,
  37074. Ci.LessDepth = 2,
  37075. Ci.LessEqualDepth = 3,
  37076. Ci.EqualDepth = 4,
  37077. Ci.GreaterEqualDepth = 5,
  37078. Ci.GreaterDepth = 6,
  37079. Ci.NotEqualDepth = 7,
  37080. Ci.MultiplyOperation = 0,
  37081. Ci.MixOperation = 1,
  37082. Ci.AddOperation = 2,
  37083. Ci.NoToneMapping = 0,
  37084. Ci.LinearToneMapping = 1,
  37085. Ci.ReinhardToneMapping = 2,
  37086. Ci.Uncharted2ToneMapping = 3,
  37087. Ci.CineonToneMapping = 4,
  37088. Ci.UVMapping = 300,
  37089. Ci.CubeReflectionMapping = 301,
  37090. Ci.CubeRefractionMapping = 302,
  37091. Ci.EquirectangularReflectionMapping = 303,
  37092. Ci.EquirectangularRefractionMapping = 304,
  37093. Ci.SphericalReflectionMapping = 305,
  37094. Ci.CubeUVReflectionMapping = 306,
  37095. Ci.CubeUVRefractionMapping = 307,
  37096. Ci.RepeatWrapping = 1e3,
  37097. Ci.ClampToEdgeWrapping = 1001,
  37098. Ci.MirroredRepeatWrapping = 1002,
  37099. Ci.NearestFilter = 1003,
  37100. Ci.NearestMipMapNearestFilter = 1004,
  37101. Ci.NearestMipMapLinearFilter = 1005,
  37102. Ci.LinearFilter = 1006,
  37103. Ci.LinearMipMapNearestFilter = 1007,
  37104. Ci.LinearMipMapLinearFilter = 1008,
  37105. Ci.UnsignedByteType = 1009,
  37106. Ci.ByteType = 1010,
  37107. Ci.ShortType = 1011,
  37108. Ci.UnsignedShortType = 1012,
  37109. Ci.IntType = 1013,
  37110. Ci.UnsignedIntType = 1014,
  37111. Ci.FloatType = 1015,
  37112. Ci.HalfFloatType = 1025,
  37113. Ci.UnsignedShort4444Type = 1016,
  37114. Ci.UnsignedShort5551Type = 1017,
  37115. Ci.UnsignedShort565Type = 1018,
  37116. Ci.AlphaFormat = 1019,
  37117. Ci.RGBFormat = 1020,
  37118. Ci.RGBAFormat = 1021,
  37119. Ci.LuminanceFormat = 1022,
  37120. Ci.LuminanceAlphaFormat = 1023,
  37121. Ci.RGBEFormat = Ci.RGBAFormat,
  37122. Ci.RGB_S3TC_DXT1_Format = 2001,
  37123. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37124. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37125. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37126. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37127. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37128. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37129. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37130. Ci.RGB_ETC1_Format = 2151,
  37131. Ci.LoopOnce = 2200,
  37132. Ci.LoopRepeat = 2201,
  37133. Ci.LoopPingPong = 2202,
  37134. Ci.InterpolateDiscrete = 2300,
  37135. Ci.InterpolateLinear = 2301,
  37136. Ci.InterpolateSmooth = 2302,
  37137. Ci.ZeroCurvatureEnding = 2400,
  37138. Ci.ZeroSlopeEnding = 2401,
  37139. Ci.WrapAroundEnding = 2402,
  37140. Ci.TrianglesDrawMode = 0,
  37141. Ci.TriangleStripDrawMode = 1,
  37142. Ci.TriangleFanDrawMode = 2,
  37143. Ci.LinearEncoding = 3e3,
  37144. Ci.sRGBEncoding = 3001,
  37145. Ci.GammaEncoding = 3007,
  37146. Ci.RGBEEncoding = 3002,
  37147. Ci.LogLuvEncoding = 3003,
  37148. Ci.RGBM7Encoding = 3004,
  37149. Ci.RGBM16Encoding = 3005,
  37150. Ci.RGBDEncoding = 3006,
  37151. Ci.Color = function(e) {
  37152. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37153. }
  37154. ,
  37155. Ci.Color.prototype = {
  37156. constructor: Ci.Color,
  37157. r: 1,
  37158. g: 1,
  37159. b: 1,
  37160. set: function(e) {
  37161. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37162. this
  37163. },
  37164. setScalar: function(e) {
  37165. this.r = e,
  37166. this.g = e,
  37167. this.b = e
  37168. },
  37169. setHex: function(e) {
  37170. return e = Math.floor(e),
  37171. this.r = (e >> 16 & 255) / 255,
  37172. this.g = (e >> 8 & 255) / 255,
  37173. this.b = (255 & e) / 255,
  37174. this
  37175. },
  37176. setRGB: function(e, t, i) {
  37177. return this.r = e,
  37178. this.g = t,
  37179. this.b = i,
  37180. this
  37181. },
  37182. setHSL: function(e, t, i) {
  37183. if (e = Ci.Math.euclideanModulo(e, 1),
  37184. t = Ci.Math.clamp(t, 0, 1),
  37185. i = Ci.Math.clamp(i, 0, 1),
  37186. 0 === t)
  37187. this.r = this.g = this.b = i;
  37188. else {
  37189. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37190. , r = 2 * i - n;
  37191. this.r = _i(r, n, e + 1 / 3),
  37192. this.g = _i(r, n, e),
  37193. this.b = _i(r, n, e - 1 / 3)
  37194. }
  37195. return this
  37196. },
  37197. setStyle: function(t) {
  37198. function e(e) {
  37199. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37200. }
  37201. var i;
  37202. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37203. var n, r = i[1], o = i[2];
  37204. switch (r) {
  37205. case "rgb":
  37206. case "rgba":
  37207. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37208. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37209. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37210. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37211. e(n[5]),
  37212. this;
  37213. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37214. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37215. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37216. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37217. e(n[5]),
  37218. this;
  37219. break;
  37220. case "hsl":
  37221. case "hsla":
  37222. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37223. var a = parseFloat(n[1]) / 360
  37224. , s = parseInt(n[2], 10) / 100
  37225. , l = parseInt(n[3], 10) / 100;
  37226. return e(n[5]),
  37227. this.setHSL(a, s, l)
  37228. }
  37229. }
  37230. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37231. var c, h = (c = i[1]).length;
  37232. if (3 === h)
  37233. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37234. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37235. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37236. this;
  37237. if (6 === h)
  37238. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37239. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37240. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37241. this
  37242. }
  37243. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37244. return this
  37245. },
  37246. clone: function() {
  37247. return new this.constructor(this.r,this.g,this.b)
  37248. },
  37249. copy: function(e) {
  37250. return this.r = e.r,
  37251. this.g = e.g,
  37252. this.b = e.b,
  37253. this
  37254. },
  37255. copyGammaToLinear: function(e, t) {
  37256. return void 0 === t && (t = 2),
  37257. this.r = Math.pow(e.r, t),
  37258. this.g = Math.pow(e.g, t),
  37259. this.b = Math.pow(e.b, t),
  37260. this
  37261. },
  37262. copyLinearToGamma: function(e, t) {
  37263. void 0 === t && (t = 2);
  37264. var i = 0 < t ? 1 / t : 1;
  37265. return this.r = Math.pow(e.r, i),
  37266. this.g = Math.pow(e.g, i),
  37267. this.b = Math.pow(e.b, i),
  37268. this
  37269. },
  37270. convertGammaToLinear: function() {
  37271. var e = this.r
  37272. , t = this.g
  37273. , i = this.b;
  37274. return this.r = e * e,
  37275. this.g = t * t,
  37276. this.b = i * i,
  37277. this
  37278. },
  37279. convertLinearToGamma: function() {
  37280. return this.r = Math.sqrt(this.r),
  37281. this.g = Math.sqrt(this.g),
  37282. this.b = Math.sqrt(this.b),
  37283. this
  37284. },
  37285. getHex: function() {
  37286. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37287. },
  37288. getHexString: function() {
  37289. return ("000000" + this.getHex().toString(16)).slice(-6)
  37290. },
  37291. getHSL: function(e) {
  37292. var t, i, n = e || {
  37293. h: 0,
  37294. s: 0,
  37295. l: 0
  37296. }, 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;
  37297. if (l === s)
  37298. i = t = 0;
  37299. else {
  37300. var h = s - l;
  37301. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37302. s) {
  37303. case r:
  37304. t = (o - a) / h + (o < a ? 6 : 0);
  37305. break;
  37306. case o:
  37307. t = (a - r) / h + 2;
  37308. break;
  37309. case a:
  37310. t = (r - o) / h + 4
  37311. }
  37312. t /= 6
  37313. }
  37314. return n.h = t,
  37315. n.s = i,
  37316. n.l = c,
  37317. n
  37318. },
  37319. getStyle: function() {
  37320. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37321. },
  37322. offsetHSL: function(e, t, i) {
  37323. var n = this.getHSL();
  37324. return n.h += e,
  37325. n.s += t,
  37326. n.l += i,
  37327. this.setHSL(n.h, n.s, n.l),
  37328. this
  37329. },
  37330. add: function(e) {
  37331. return this.r += e.r,
  37332. this.g += e.g,
  37333. this.b += e.b,
  37334. this
  37335. },
  37336. addColors: function(e, t) {
  37337. return this.r = e.r + t.r,
  37338. this.g = e.g + t.g,
  37339. this.b = e.b + t.b,
  37340. this
  37341. },
  37342. addScalar: function(e) {
  37343. return this.r += e,
  37344. this.g += e,
  37345. this.b += e,
  37346. this
  37347. },
  37348. multiply: function(e) {
  37349. return this.r *= e.r,
  37350. this.g *= e.g,
  37351. this.b *= e.b,
  37352. this
  37353. },
  37354. multiplyScalar: function(e) {
  37355. return this.r *= e,
  37356. this.g *= e,
  37357. this.b *= e,
  37358. this
  37359. },
  37360. lerp: function(e, t) {
  37361. return this.r += (e.r - this.r) * t,
  37362. this.g += (e.g - this.g) * t,
  37363. this.b += (e.b - this.b) * t,
  37364. this
  37365. },
  37366. equals: function(e) {
  37367. return e.r === this.r && e.g === this.g && e.b === this.b
  37368. },
  37369. fromArray: function(e, t) {
  37370. return void 0 === t && (t = 0),
  37371. this.r = e[t],
  37372. this.g = e[t + 1],
  37373. this.b = e[t + 2],
  37374. this
  37375. },
  37376. toArray: function(e, t) {
  37377. return void 0 === e && (e = []),
  37378. void 0 === t && (t = 0),
  37379. e[t] = this.r,
  37380. e[t + 1] = this.g,
  37381. e[t + 2] = this.b,
  37382. e
  37383. }
  37384. },
  37385. Ci.ColorKeywords = {
  37386. aliceblue: 15792383,
  37387. antiquewhite: 16444375,
  37388. aqua: 65535,
  37389. aquamarine: 8388564,
  37390. azure: 15794175,
  37391. beige: 16119260,
  37392. bisque: 16770244,
  37393. black: 0,
  37394. blanchedalmond: 16772045,
  37395. blue: 255,
  37396. blueviolet: 9055202,
  37397. brown: 10824234,
  37398. burlywood: 14596231,
  37399. cadetblue: 6266528,
  37400. chartreuse: 8388352,
  37401. chocolate: 13789470,
  37402. coral: 16744272,
  37403. cornflowerblue: 6591981,
  37404. cornsilk: 16775388,
  37405. crimson: 14423100,
  37406. cyan: 65535,
  37407. darkblue: 139,
  37408. darkcyan: 35723,
  37409. darkgoldenrod: 12092939,
  37410. darkgray: 11119017,
  37411. darkgreen: 25600,
  37412. darkgrey: 11119017,
  37413. darkkhaki: 12433259,
  37414. darkmagenta: 9109643,
  37415. darkolivegreen: 5597999,
  37416. darkorange: 16747520,
  37417. darkorchid: 10040012,
  37418. darkred: 9109504,
  37419. darksalmon: 15308410,
  37420. darkseagreen: 9419919,
  37421. darkslateblue: 4734347,
  37422. darkslategray: 3100495,
  37423. darkslategrey: 3100495,
  37424. darkturquoise: 52945,
  37425. darkviolet: 9699539,
  37426. deeppink: 16716947,
  37427. deepskyblue: 49151,
  37428. dimgray: 6908265,
  37429. dimgrey: 6908265,
  37430. dodgerblue: 2003199,
  37431. firebrick: 11674146,
  37432. floralwhite: 16775920,
  37433. forestgreen: 2263842,
  37434. fuchsia: 16711935,
  37435. gainsboro: 14474460,
  37436. ghostwhite: 16316671,
  37437. gold: 16766720,
  37438. goldenrod: 14329120,
  37439. gray: 8421504,
  37440. green: 32768,
  37441. greenyellow: 11403055,
  37442. grey: 8421504,
  37443. honeydew: 15794160,
  37444. hotpink: 16738740,
  37445. indianred: 13458524,
  37446. indigo: 4915330,
  37447. ivory: 16777200,
  37448. khaki: 15787660,
  37449. lavender: 15132410,
  37450. lavenderblush: 16773365,
  37451. lawngreen: 8190976,
  37452. lemonchiffon: 16775885,
  37453. lightblue: 11393254,
  37454. lightcoral: 15761536,
  37455. lightcyan: 14745599,
  37456. lightgoldenrodyellow: 16448210,
  37457. lightgray: 13882323,
  37458. lightgreen: 9498256,
  37459. lightgrey: 13882323,
  37460. lightpink: 16758465,
  37461. lightsalmon: 16752762,
  37462. lightseagreen: 2142890,
  37463. lightskyblue: 8900346,
  37464. lightslategray: 7833753,
  37465. lightslategrey: 7833753,
  37466. lightsteelblue: 11584734,
  37467. lightyellow: 16777184,
  37468. lime: 65280,
  37469. limegreen: 3329330,
  37470. linen: 16445670,
  37471. magenta: 16711935,
  37472. maroon: 8388608,
  37473. mediumaquamarine: 6737322,
  37474. mediumblue: 205,
  37475. mediumorchid: 12211667,
  37476. mediumpurple: 9662683,
  37477. mediumseagreen: 3978097,
  37478. mediumslateblue: 8087790,
  37479. mediumspringgreen: 64154,
  37480. mediumturquoise: 4772300,
  37481. mediumvioletred: 13047173,
  37482. midnightblue: 1644912,
  37483. mintcream: 16121850,
  37484. mistyrose: 16770273,
  37485. moccasin: 16770229,
  37486. navajowhite: 16768685,
  37487. navy: 128,
  37488. oldlace: 16643558,
  37489. olive: 8421376,
  37490. olivedrab: 7048739,
  37491. orange: 16753920,
  37492. orangered: 16729344,
  37493. orchid: 14315734,
  37494. palegoldenrod: 15657130,
  37495. palegreen: 10025880,
  37496. paleturquoise: 11529966,
  37497. palevioletred: 14381203,
  37498. papayawhip: 16773077,
  37499. peachpuff: 16767673,
  37500. peru: 13468991,
  37501. pink: 16761035,
  37502. plum: 14524637,
  37503. powderblue: 11591910,
  37504. purple: 8388736,
  37505. red: 16711680,
  37506. rosybrown: 12357519,
  37507. royalblue: 4286945,
  37508. saddlebrown: 9127187,
  37509. salmon: 16416882,
  37510. sandybrown: 16032864,
  37511. seagreen: 3050327,
  37512. seashell: 16774638,
  37513. sienna: 10506797,
  37514. silver: 12632256,
  37515. skyblue: 8900331,
  37516. slateblue: 6970061,
  37517. slategray: 7372944,
  37518. slategrey: 7372944,
  37519. snow: 16775930,
  37520. springgreen: 65407,
  37521. steelblue: 4620980,
  37522. tan: 13808780,
  37523. teal: 32896,
  37524. thistle: 14204888,
  37525. tomato: 16737095,
  37526. turquoise: 4251856,
  37527. violet: 15631086,
  37528. wheat: 16113331,
  37529. white: 16777215,
  37530. whitesmoke: 16119285,
  37531. yellow: 16776960,
  37532. yellowgreen: 10145074
  37533. },
  37534. Ci.Quaternion = function(e, t, i, n) {
  37535. this._x = e || 0,
  37536. this._y = t || 0,
  37537. this._z = i || 0,
  37538. this._w = void 0 !== n ? n : 1
  37539. }
  37540. ,
  37541. Ci.Quaternion.prototype = {
  37542. constructor: Ci.Quaternion,
  37543. get x() {
  37544. return this._x
  37545. },
  37546. set x(e) {
  37547. this._x = e,
  37548. this.onChangeCallback()
  37549. },
  37550. get y() {
  37551. return this._y
  37552. },
  37553. set y(e) {
  37554. this._y = e,
  37555. this.onChangeCallback()
  37556. },
  37557. get z() {
  37558. return this._z
  37559. },
  37560. set z(e) {
  37561. this._z = e,
  37562. this.onChangeCallback()
  37563. },
  37564. get w() {
  37565. return this._w
  37566. },
  37567. set w(e) {
  37568. this._w = e,
  37569. this.onChangeCallback()
  37570. },
  37571. set: function(e, t, i, n) {
  37572. return this._x = e,
  37573. this._y = t,
  37574. this._z = i,
  37575. this._w = n,
  37576. this.onChangeCallback(),
  37577. this
  37578. },
  37579. clone: function() {
  37580. return new this.constructor(this._x,this._y,this._z,this._w)
  37581. },
  37582. toObject:function(){//add
  37583. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37584. },
  37585. copy: function(e) {
  37586. return this._x = e.x,
  37587. this._y = e.y,
  37588. this._z = e.z,
  37589. this._w = e.w,
  37590. this.onChangeCallback(),
  37591. this
  37592. },
  37593. setFromEuler: function(e, t) {
  37594. if (e instanceof Ci.Euler == 0)
  37595. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37596. var i = Math.cos(e._x / 2)
  37597. , n = Math.cos(e._y / 2)
  37598. , r = Math.cos(e._z / 2)
  37599. , o = Math.sin(e._x / 2)
  37600. , a = Math.sin(e._y / 2)
  37601. , s = Math.sin(e._z / 2)
  37602. , l = e.order;
  37603. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37604. this._y = i * a * r - o * n * s,
  37605. this._z = i * n * s + o * a * r,
  37606. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37607. this._y = i * a * r - o * n * s,
  37608. this._z = i * n * s - o * a * r,
  37609. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37610. this._y = i * a * r + o * n * s,
  37611. this._z = i * n * s + o * a * r,
  37612. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37613. this._y = i * a * r + o * n * s,
  37614. this._z = i * n * s - o * a * r,
  37615. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37616. this._y = i * a * r + o * n * s,
  37617. this._z = i * n * s - o * a * r,
  37618. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37619. this._y = i * a * r - o * n * s,
  37620. this._z = i * n * s + o * a * r,
  37621. this._w = i * n * r + o * a * s),
  37622. !1 !== t && this.onChangeCallback(),
  37623. this
  37624. },
  37625. setFromAxisAngle: function(e, t) {
  37626. var i = t / 2
  37627. , n = Math.sin(i);
  37628. return this._x = e.x * n,
  37629. this._y = e.y * n,
  37630. this._z = e.z * n,
  37631. this._w = Math.cos(i),
  37632. this.onChangeCallback(),
  37633. this
  37634. },
  37635. setFromRotationMatrix: function(e) {
  37636. 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;
  37637. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37638. this._w = .25 / t,
  37639. this._x = (h - l) * t,
  37640. this._y = (o - c) * t,
  37641. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37642. this._w = (h - l) / t,
  37643. this._x = .25 * t,
  37644. this._y = (r + a) / t,
  37645. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37646. this._w = (o - c) / t,
  37647. this._x = (r + a) / t,
  37648. this._y = .25 * t,
  37649. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37650. this._w = (a - r) / t,
  37651. this._x = (o + c) / t,
  37652. this._y = (l + h) / t,
  37653. this._z = .25 * t),
  37654. this.onChangeCallback(),
  37655. this
  37656. },
  37657. setFromUnitVectors: function(e, t) {
  37658. return void 0 === Be && (Be = new Ci.Vector3),
  37659. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37660. 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),
  37661. this._x = Be.x,
  37662. this._y = Be.y,
  37663. this._z = Be.z,
  37664. this._w = Ve,
  37665. this.normalize(),
  37666. this
  37667. },
  37668. inverse: function() {
  37669. return this.conjugate().normalize(),
  37670. this
  37671. },
  37672. conjugate: function() {
  37673. return this._x *= -1,
  37674. this._y *= -1,
  37675. this._z *= -1,
  37676. this.onChangeCallback(),
  37677. this
  37678. },
  37679. dot: function(e) {
  37680. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37681. },
  37682. lengthSq: function() {
  37683. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37684. },
  37685. length: function() {
  37686. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37687. },
  37688. normalize: function() {
  37689. var e = this.length();
  37690. return 0 === e ? (this._x = 0,
  37691. this._y = 0,
  37692. this._z = 0,
  37693. this._w = 1) : (e = 1 / e,
  37694. this._x = this._x * e,
  37695. this._y = this._y * e,
  37696. this._z = this._z * e,
  37697. this._w = this._w * e),
  37698. this.onChangeCallback(),
  37699. this
  37700. },
  37701. multiply: function(e, t) {
  37702. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37703. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37704. },
  37705. multiplyQuaternions: function(e, t) {
  37706. var i = e._x
  37707. , n = e._y
  37708. , r = e._z
  37709. , o = e._w
  37710. , a = t._x
  37711. , s = t._y
  37712. , l = t._z
  37713. , c = t._w;
  37714. return this._x = i * c + o * a + n * l - r * s,
  37715. this._y = n * c + o * s + r * a - i * l,
  37716. this._z = r * c + o * l + i * s - n * a,
  37717. this._w = o * c - i * a - n * s - r * l,
  37718. this.onChangeCallback(),
  37719. this
  37720. },
  37721. slerp: function(e, t) {
  37722. if (0 === t)
  37723. return this;
  37724. if (1 === t)
  37725. return this.copy(e);
  37726. var i = this._x
  37727. , n = this._y
  37728. , r = this._z
  37729. , o = this._w
  37730. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37731. if (a < 0 ? (this._w = -e._w,
  37732. this._x = -e._x,
  37733. this._y = -e._y,
  37734. this._z = -e._z,
  37735. a = -a) : this.copy(e),
  37736. 1 <= a)
  37737. return this._w = o,
  37738. this._x = i,
  37739. this._y = n,
  37740. this._z = r,
  37741. this;
  37742. var s = Math.sqrt(1 - a * a);
  37743. if (Math.abs(s) < .001)
  37744. return this._w = .5 * (o + this._w),
  37745. this._x = .5 * (i + this._x),
  37746. this._y = .5 * (n + this._y),
  37747. this._z = .5 * (r + this._z),
  37748. this;
  37749. var l = Math.atan2(s, a)
  37750. , c = Math.sin((1 - t) * l) / s
  37751. , h = Math.sin(t * l) / s;
  37752. return this._w = o * c + this._w * h,
  37753. this._x = i * c + this._x * h,
  37754. this._y = n * c + this._y * h,
  37755. this._z = r * c + this._z * h,
  37756. this.onChangeCallback(),
  37757. this
  37758. },
  37759. equals: function(e) {
  37760. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37761. },
  37762. fromArray: function(e, t) {
  37763. return void 0 === t && (t = 0),
  37764. this._x = e[t],
  37765. this._y = e[t + 1],
  37766. this._z = e[t + 2],
  37767. this._w = e[t + 3],
  37768. this.onChangeCallback(),
  37769. this
  37770. },
  37771. toArray: function(e, t) {
  37772. return void 0 === e && (e = []),
  37773. void 0 === t && (t = 0),
  37774. e[t] = this._x,
  37775. e[t + 1] = this._y,
  37776. e[t + 2] = this._z,
  37777. e[t + 3] = this._w,
  37778. e
  37779. },
  37780. onChange: function(e) {
  37781. return this.onChangeCallback = e,
  37782. this
  37783. },
  37784. onChangeCallback: function() {}
  37785. },
  37786. Object.assign(Ci.Quaternion, {
  37787. slerp: function(e, t, i, n) {
  37788. return i.copy(e).slerp(t, n)
  37789. },
  37790. slerpFlat: function(e, t, i, n, r, o, a) {
  37791. var s = i[n + 0]
  37792. , l = i[n + 1]
  37793. , c = i[n + 2]
  37794. , h = i[n + 3]
  37795. , u = r[o + 0]
  37796. , d = r[o + 1]
  37797. , p = r[o + 2]
  37798. , f = r[o + 3];
  37799. if (h !== f || s !== u || l !== d || c !== p) {
  37800. var g = 1 - a
  37801. , m = s * u + l * d + c * p + h * f
  37802. , v = 0 <= m ? 1 : -1
  37803. , y = 1 - m * m;
  37804. if (y > Number.EPSILON) {
  37805. var A = Math.sqrt(y)
  37806. , C = Math.atan2(A, m * v);
  37807. g = Math.sin(g * C) / A,
  37808. a = Math.sin(a * C) / A
  37809. }
  37810. var I = a * v;
  37811. if (s = s * g + u * I,
  37812. l = l * g + d * I,
  37813. c = c * g + p * I,
  37814. h = h * g + f * I,
  37815. g === 1 - a) {
  37816. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37817. s *= E,
  37818. l *= E,
  37819. c *= E,
  37820. h *= E
  37821. }
  37822. }
  37823. e[t] = s,
  37824. e[t + 1] = l,
  37825. e[t + 2] = c,
  37826. e[t + 3] = h
  37827. }
  37828. }),
  37829. Ci.Vector2 = function(e, t) {
  37830. this.x = e || 0,
  37831. this.y = t || 0
  37832. }
  37833. ,
  37834. Ci.Vector2.prototype = {
  37835. constructor: Ci.Vector2,
  37836. get width() {
  37837. return this.x
  37838. },
  37839. set width(e) {
  37840. this.x = e
  37841. },
  37842. get height() {
  37843. return this.y
  37844. },
  37845. set height(e) {
  37846. this.y = e
  37847. },
  37848. set: function(e, t) {
  37849. return this.x = e,
  37850. this.y = t,
  37851. this
  37852. },
  37853. setScalar: function(e) {
  37854. return this.x = e,
  37855. this.y = e,
  37856. this
  37857. },
  37858. setX: function(e) {
  37859. return this.x = e,
  37860. this
  37861. },
  37862. setY: function(e) {
  37863. return this.y = e,
  37864. this
  37865. },
  37866. setComponent: function(e, t) {
  37867. switch (e) {
  37868. case 0:
  37869. this.x = t;
  37870. break;
  37871. case 1:
  37872. this.y = t;
  37873. break;
  37874. default:
  37875. throw new Error("index is out of range: " + e)
  37876. }
  37877. },
  37878. getComponent: function(e) {
  37879. switch (e) {
  37880. case 0:
  37881. return this.x;
  37882. case 1:
  37883. return this.y;
  37884. default:
  37885. throw new Error("index is out of range: " + e)
  37886. }
  37887. },
  37888. clone: function() {
  37889. return new this.constructor(this.x,this.y)
  37890. },
  37891. copy: function(e) {
  37892. return this.x = e.x,
  37893. this.y = e.y,
  37894. this
  37895. },
  37896. add: function(e, t) {
  37897. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37898. this.addVectors(e, t)) : (this.x += e.x,
  37899. this.y += e.y,
  37900. this)
  37901. },
  37902. addScalar: function(e) {
  37903. return this.x += e,
  37904. this.y += e,
  37905. this
  37906. },
  37907. addVectors: function(e, t) {
  37908. return this.x = e.x + t.x,
  37909. this.y = e.y + t.y,
  37910. this
  37911. },
  37912. addScaledVector: function(e, t) {
  37913. return this.x += e.x * t,
  37914. this.y += e.y * t,
  37915. this
  37916. },
  37917. sub: function(e, t) {
  37918. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37919. this.subVectors(e, t)) : (this.x -= e.x,
  37920. this.y -= e.y,
  37921. this)
  37922. },
  37923. subScalar: function(e) {
  37924. return this.x -= e,
  37925. this.y -= e,
  37926. this
  37927. },
  37928. subVectors: function(e, t) {
  37929. return this.x = e.x - t.x,
  37930. this.y = e.y - t.y,
  37931. this
  37932. },
  37933. multiply: function(e) {
  37934. return this.x *= e.x,
  37935. this.y *= e.y,
  37936. this
  37937. },
  37938. multiplyScalar: function(e) {
  37939. return isFinite(e) ? (this.x *= e,
  37940. this.y *= e) : (this.x = 0,
  37941. this.y = 0),
  37942. this
  37943. },
  37944. divide: function(e) {
  37945. return this.x /= e.x,
  37946. this.y /= e.y,
  37947. this
  37948. },
  37949. divideScalar: function(e) {
  37950. return this.multiplyScalar(1 / e)
  37951. },
  37952. min: function(e) {
  37953. return this.x = Math.min(this.x, e.x),
  37954. this.y = Math.min(this.y, e.y),
  37955. this
  37956. },
  37957. max: function(e) {
  37958. return this.x = Math.max(this.x, e.x),
  37959. this.y = Math.max(this.y, e.y),
  37960. this
  37961. },
  37962. clamp: function(e, t) {
  37963. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37964. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37965. this
  37966. },
  37967. clampScalar: function(e, t) {
  37968. return void 0 === Ne && (Ne = new Ci.Vector2,
  37969. Fe = new Ci.Vector2),
  37970. Ne.set(e, e),
  37971. Fe.set(t, t),
  37972. this.clamp(Ne, Fe)
  37973. },
  37974. clampLength: function(e, t) {
  37975. var i = this.length();
  37976. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37977. this
  37978. },
  37979. floor: function() {
  37980. return this.x = Math.floor(this.x),
  37981. this.y = Math.floor(this.y),
  37982. this
  37983. },
  37984. ceil: function() {
  37985. return this.x = Math.ceil(this.x),
  37986. this.y = Math.ceil(this.y),
  37987. this
  37988. },
  37989. round: function() {
  37990. return this.x = Math.round(this.x),
  37991. this.y = Math.round(this.y),
  37992. this
  37993. },
  37994. roundToZero: function() {
  37995. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37996. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37997. this
  37998. },
  37999. negate: function() {
  38000. return this.x = -this.x,
  38001. this.y = -this.y,
  38002. this
  38003. },
  38004. dot: function(e) {
  38005. return this.x * e.x + this.y * e.y
  38006. },
  38007. lengthSq: function() {
  38008. return this.x * this.x + this.y * this.y
  38009. },
  38010. length: function() {
  38011. return Math.sqrt(this.x * this.x + this.y * this.y)
  38012. },
  38013. lengthManhattan: function() {
  38014. return Math.abs(this.x) + Math.abs(this.y)
  38015. },
  38016. normalize: function() {
  38017. return this.divideScalar(this.length())
  38018. },
  38019. angle: function() {
  38020. var e = Math.atan2(this.y, this.x);
  38021. return e < 0 && (e += 2 * Math.PI),
  38022. e
  38023. },
  38024. distanceTo: function(e) {
  38025. return Math.sqrt(this.distanceToSquared(e))
  38026. },
  38027. distanceToSquared: function(e) {
  38028. var t = this.x - e.x
  38029. , i = this.y - e.y;
  38030. return t * t + i * i
  38031. },
  38032. setLength: function(e) {
  38033. return this.multiplyScalar(e / this.length())
  38034. },
  38035. lerp: function(e, t) {
  38036. return this.x += (e.x - this.x) * t,
  38037. this.y += (e.y - this.y) * t,
  38038. this
  38039. },
  38040. lerpVectors: function(e, t, i) {
  38041. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38042. this
  38043. },
  38044. equals: function(e) {
  38045. return e.x === this.x && e.y === this.y
  38046. },
  38047. fromArray: function(e, t) {
  38048. return void 0 === t && (t = 0),
  38049. this.x = e[t],
  38050. this.y = e[t + 1],
  38051. this
  38052. },
  38053. toArray: function(e, t) {
  38054. return void 0 === e && (e = []),
  38055. void 0 === t && (t = 0),
  38056. e[t] = this.x,
  38057. e[t + 1] = this.y,
  38058. e
  38059. },
  38060. fromAttribute: function(e, t, i) {
  38061. return void 0 === i && (i = 0),
  38062. t = t * e.itemSize + i,
  38063. this.x = e.array[t],
  38064. this.y = e.array[t + 1],
  38065. this
  38066. },
  38067. rotateAround: function(e, t) {
  38068. var i = Math.cos(t)
  38069. , n = Math.sin(t)
  38070. , r = this.x - e.x
  38071. , o = this.y - e.y;
  38072. return this.x = r * i - o * n + e.x,
  38073. this.y = r * n + o * i + e.y,
  38074. this
  38075. }
  38076. },
  38077. Ci.Vector3 = function(e, t, i) {
  38078. this.x = e || 0,
  38079. this.y = t || 0,
  38080. this.z = i || 0
  38081. }
  38082. ,
  38083. Ci.Vector3.prototype = {
  38084. constructor: Ci.Vector3,
  38085. set: function(e, t, i) {
  38086. return this.x = e,
  38087. this.y = t,
  38088. this.z = i,
  38089. this
  38090. },
  38091. setScalar: function(e) {
  38092. return this.x = e,
  38093. this.y = e,
  38094. this.z = e,
  38095. this
  38096. },
  38097. setX: function(e) {
  38098. return this.x = e,
  38099. this
  38100. },
  38101. setY: function(e) {
  38102. return this.y = e,
  38103. this
  38104. },
  38105. setZ: function(e) {
  38106. return this.z = e,
  38107. this
  38108. },
  38109. setComponent: function(e, t) {
  38110. switch (e) {
  38111. case 0:
  38112. this.x = t;
  38113. break;
  38114. case 1:
  38115. this.y = t;
  38116. break;
  38117. case 2:
  38118. this.z = t;
  38119. break;
  38120. default:
  38121. throw new Error("index is out of range: " + e)
  38122. }
  38123. },
  38124. getComponent: function(e) {
  38125. switch (e) {
  38126. case 0:
  38127. return this.x;
  38128. case 1:
  38129. return this.y;
  38130. case 2:
  38131. return this.z;
  38132. default:
  38133. throw new Error("index is out of range: " + e)
  38134. }
  38135. },
  38136. clone: function() {
  38137. return new this.constructor(this.x,this.y,this.z)
  38138. },
  38139. copy: function(e) {
  38140. return this.x = e.x,
  38141. this.y = e.y,
  38142. this.z = e.z,
  38143. this
  38144. },
  38145. add: function(e, t) {
  38146. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38147. this.addVectors(e, t)) : (this.x += e.x,
  38148. this.y += e.y,
  38149. this.z += e.z,
  38150. this)
  38151. },
  38152. addScalar: function(e) {
  38153. return this.x += e,
  38154. this.y += e,
  38155. this.z += e,
  38156. this
  38157. },
  38158. addVectors: function(e, t) {
  38159. return this.x = e.x + t.x,
  38160. this.y = e.y + t.y,
  38161. this.z = e.z + t.z,
  38162. this
  38163. },
  38164. addScaledVector: function(e, t) {
  38165. return this.x += e.x * t,
  38166. this.y += e.y * t,
  38167. this.z += e.z * t,
  38168. this
  38169. },
  38170. sub: function(e, t) {
  38171. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38172. this.subVectors(e, t)) : (this.x -= e.x,
  38173. this.y -= e.y,
  38174. this.z -= e.z,
  38175. this)
  38176. },
  38177. subScalar: function(e) {
  38178. return this.x -= e,
  38179. this.y -= e,
  38180. this.z -= e,
  38181. this
  38182. },
  38183. subVectors: function(e, t) {
  38184. return this.x = e.x - t.x,
  38185. this.y = e.y - t.y,
  38186. this.z = e.z - t.z,
  38187. this
  38188. },
  38189. multiply: function(e, t) {
  38190. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38191. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38192. this.y *= e.y,
  38193. this.z *= e.z,
  38194. this)
  38195. },
  38196. multiplyScalar: function(e) {
  38197. return isFinite(e) ? (this.x *= e,
  38198. this.y *= e,
  38199. this.z *= e) : (this.x = 0,
  38200. this.y = 0,
  38201. this.z = 0),
  38202. this
  38203. },
  38204. multiplyVectors: function(e, t) {
  38205. return this.x = e.x * t.x,
  38206. this.y = e.y * t.y,
  38207. this.z = e.z * t.z,
  38208. this
  38209. },
  38210. applyEuler: function(e) {
  38211. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38212. void 0 === De && (De = new Ci.Quaternion),
  38213. this.applyQuaternion(De.setFromEuler(e)),
  38214. this
  38215. },
  38216. applyAxisAngle: function(e, t) {
  38217. return void 0 === Le && (Le = new Ci.Quaternion),
  38218. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38219. this
  38220. },
  38221. applyMatrix3: function(e) {
  38222. var t = this.x
  38223. , i = this.y
  38224. , n = this.z
  38225. , r = e.elements;
  38226. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38227. this.y = r[1] * t + r[4] * i + r[7] * n,
  38228. this.z = r[2] * t + r[5] * i + r[8] * n,
  38229. this
  38230. },
  38231. applyMatrix4: function(e) {
  38232. var t = this.x
  38233. , i = this.y
  38234. , n = this.z
  38235. , r = e.elements;
  38236. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38237. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38238. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38239. this
  38240. },
  38241. applyProjection: function(e) {
  38242. var t = this.x
  38243. , i = this.y
  38244. , n = this.z
  38245. , r = e.elements
  38246. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38247. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38248. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38249. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38250. this
  38251. },
  38252. applyQuaternion: function(e) {
  38253. var t = this.x
  38254. , i = this.y
  38255. , n = this.z
  38256. , r = e.x
  38257. , o = e.y
  38258. , a = e.z
  38259. , s = e.w
  38260. , l = s * t + o * n - a * i
  38261. , c = s * i + a * t - r * n
  38262. , h = s * n + r * i - o * t
  38263. , u = -r * t - o * i - a * n;
  38264. return this.x = l * s + u * -r + c * -a - h * -o,
  38265. this.y = c * s + u * -o + h * -r - l * -a,
  38266. this.z = h * s + u * -a + l * -o - c * -r,
  38267. this
  38268. },
  38269. project: function(e) {
  38270. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38271. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38272. this.applyProjection(Oe)
  38273. },
  38274. unproject: function(e) {
  38275. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38276. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38277. this.applyProjection(Pe)
  38278. },
  38279. transformDirection: function(e) {
  38280. var t = this.x
  38281. , i = this.y
  38282. , n = this.z
  38283. , r = e.elements;
  38284. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38285. this.y = r[1] * t + r[5] * i + r[9] * n,
  38286. this.z = r[2] * t + r[6] * i + r[10] * n,
  38287. this.normalize(),
  38288. this
  38289. },
  38290. divide: function(e) {
  38291. return this.x /= e.x,
  38292. this.y /= e.y,
  38293. this.z /= e.z,
  38294. this
  38295. },
  38296. divideScalar: function(e) {
  38297. return this.multiplyScalar(1 / e)
  38298. },
  38299. min: function(e) {
  38300. return this.x = Math.min(this.x, e.x),
  38301. this.y = Math.min(this.y, e.y),
  38302. this.z = Math.min(this.z, e.z),
  38303. this
  38304. },
  38305. max: function(e) {
  38306. return this.x = Math.max(this.x, e.x),
  38307. this.y = Math.max(this.y, e.y),
  38308. this.z = Math.max(this.z, e.z),
  38309. this
  38310. },
  38311. clamp: function(e, t) {
  38312. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38313. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38314. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38315. this
  38316. },
  38317. clampScalar: function(e, t) {
  38318. return void 0 === Me && (Me = new Ci.Vector3,
  38319. Re = new Ci.Vector3),
  38320. Me.set(e, e, e),
  38321. Re.set(t, t, t),
  38322. this.clamp(Me, Re)
  38323. },
  38324. clampLength: function(e, t) {
  38325. var i = this.length();
  38326. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38327. this
  38328. },
  38329. floor: function() {
  38330. return this.x = Math.floor(this.x),
  38331. this.y = Math.floor(this.y),
  38332. this.z = Math.floor(this.z),
  38333. this
  38334. },
  38335. ceil: function() {
  38336. return this.x = Math.ceil(this.x),
  38337. this.y = Math.ceil(this.y),
  38338. this.z = Math.ceil(this.z),
  38339. this
  38340. },
  38341. round: function() {
  38342. return this.x = Math.round(this.x),
  38343. this.y = Math.round(this.y),
  38344. this.z = Math.round(this.z),
  38345. this
  38346. },
  38347. roundToZero: function() {
  38348. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38349. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38350. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38351. this
  38352. },
  38353. negate: function() {
  38354. return this.x = -this.x,
  38355. this.y = -this.y,
  38356. this.z = -this.z,
  38357. this
  38358. },
  38359. dot: function(e) {
  38360. return this.x * e.x + this.y * e.y + this.z * e.z
  38361. },
  38362. lengthSq: function() {
  38363. return this.x * this.x + this.y * this.y + this.z * this.z
  38364. },
  38365. length: function() {
  38366. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38367. },
  38368. lengthManhattan: function() {
  38369. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38370. },
  38371. normalize: function() {
  38372. return this.divideScalar(this.length())
  38373. },
  38374. setLength: function(e) {
  38375. return this.multiplyScalar(e / this.length())
  38376. },
  38377. lerp: function(e, t) {
  38378. return this.x += (e.x - this.x) * t,
  38379. this.y += (e.y - this.y) * t,
  38380. this.z += (e.z - this.z) * t,
  38381. this
  38382. },
  38383. lerpVectors: function(e, t, i) {
  38384. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38385. this
  38386. },
  38387. cross: function(e, t) {
  38388. if (void 0 !== t)
  38389. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38390. this.crossVectors(e, t);
  38391. var i = this.x
  38392. , n = this.y
  38393. , r = this.z;
  38394. return this.x = n * e.z - r * e.y,
  38395. this.y = r * e.x - i * e.z,
  38396. this.z = i * e.y - n * e.x,
  38397. this
  38398. },
  38399. crossVectors: function(e, t) {
  38400. var i = e.x
  38401. , n = e.y
  38402. , r = e.z
  38403. , o = t.x
  38404. , a = t.y
  38405. , s = t.z;
  38406. return this.x = n * s - r * a,
  38407. this.y = r * o - i * s,
  38408. this.z = i * a - n * o,
  38409. this
  38410. },
  38411. projectOnVector: function(e) {
  38412. return void 0 === xe && (xe = new Ci.Vector3),
  38413. xe.copy(e).normalize(),
  38414. Se = this.dot(xe),
  38415. this.copy(xe).multiplyScalar(Se)
  38416. },
  38417. projectOnPlane: function(e) {
  38418. return void 0 === Te && (Te = new Ci.Vector3),
  38419. Te.copy(this).projectOnVector(e),
  38420. this.sub(Te)
  38421. },
  38422. reflect: function(e) {
  38423. return void 0 === we && (we = new Ci.Vector3),
  38424. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38425. },
  38426. angleTo: function(e) {
  38427. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38428. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38429. },
  38430. distanceTo: function(e) {
  38431. return Math.sqrt(this.distanceToSquared(e))
  38432. },
  38433. distanceToSquared: function(e) {
  38434. var t = this.x - e.x
  38435. , i = this.y - e.y
  38436. , n = this.z - e.z;
  38437. return t * t + i * i + n * n
  38438. },
  38439. setFromSpherical: function(e) {
  38440. var t = Math.sin(e.phi) * e.radius;
  38441. return this.x = t * Math.sin(e.theta),
  38442. this.y = Math.cos(e.phi) * e.radius,
  38443. this.z = t * Math.cos(e.theta),
  38444. this
  38445. },
  38446. setFromMatrixPosition: function(e) {
  38447. return this.setFromMatrixColumn(e, 3)
  38448. },
  38449. setFromMatrixScale: function(e) {
  38450. var t = this.setFromMatrixColumn(e, 0).length()
  38451. , i = this.setFromMatrixColumn(e, 1).length()
  38452. , n = this.setFromMatrixColumn(e, 2).length();
  38453. return this.x = t,
  38454. this.y = i,
  38455. this.z = n,
  38456. this
  38457. },
  38458. setFromMatrixColumn: function(e, t) {
  38459. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38460. t = e = t),
  38461. this.fromArray(e.elements, 4 * t)
  38462. },
  38463. equals: function(e) {
  38464. return e.x === this.x && e.y === this.y && e.z === this.z
  38465. },
  38466. fromArray: function(e, t) {
  38467. return void 0 === t && (t = 0),
  38468. this.x = e[t],
  38469. this.y = e[t + 1],
  38470. this.z = e[t + 2],
  38471. this
  38472. },
  38473. toArray: function(e, t) {
  38474. return void 0 === e && (e = []),
  38475. void 0 === t && (t = 0),
  38476. e[t] = this.x,
  38477. e[t + 1] = this.y,
  38478. e[t + 2] = this.z,
  38479. e
  38480. },
  38481. fromAttribute: function(e, t, i) {
  38482. return void 0 === i && (i = 0),
  38483. t = t * e.itemSize + i,
  38484. this.x = e.array[t],
  38485. this.y = e.array[t + 1],
  38486. this.z = e.array[t + 2],
  38487. this
  38488. }
  38489. },
  38490. Ci.Vector4 = function(e, t, i, n) {
  38491. this.x = e || 0,
  38492. this.y = t || 0,
  38493. this.z = i || 0,
  38494. this.w = void 0 !== n ? n : 1
  38495. }
  38496. ,
  38497. Ci.Vector4.prototype = {
  38498. constructor: Ci.Vector4,
  38499. set: function(e, t, i, n) {
  38500. return this.x = e,
  38501. this.y = t,
  38502. this.z = i,
  38503. this.w = n,
  38504. this
  38505. },
  38506. setScalar: function(e) {
  38507. return this.x = e,
  38508. this.y = e,
  38509. this.z = e,
  38510. this.w = e,
  38511. this
  38512. },
  38513. setX: function(e) {
  38514. return this.x = e,
  38515. this
  38516. },
  38517. setY: function(e) {
  38518. return this.y = e,
  38519. this
  38520. },
  38521. setZ: function(e) {
  38522. return this.z = e,
  38523. this
  38524. },
  38525. setW: function(e) {
  38526. return this.w = e,
  38527. this
  38528. },
  38529. setComponent: function(e, t) {
  38530. switch (e) {
  38531. case 0:
  38532. this.x = t;
  38533. break;
  38534. case 1:
  38535. this.y = t;
  38536. break;
  38537. case 2:
  38538. this.z = t;
  38539. break;
  38540. case 3:
  38541. this.w = t;
  38542. break;
  38543. default:
  38544. throw new Error("index is out of range: " + e)
  38545. }
  38546. },
  38547. getComponent: function(e) {
  38548. switch (e) {
  38549. case 0:
  38550. return this.x;
  38551. case 1:
  38552. return this.y;
  38553. case 2:
  38554. return this.z;
  38555. case 3:
  38556. return this.w;
  38557. default:
  38558. throw new Error("index is out of range: " + e)
  38559. }
  38560. },
  38561. clone: function() {
  38562. return new this.constructor(this.x,this.y,this.z,this.w)
  38563. },
  38564. copy: function(e) {
  38565. return this.x = e.x,
  38566. this.y = e.y,
  38567. this.z = e.z,
  38568. this.w = void 0 !== e.w ? e.w : 1,
  38569. this
  38570. },
  38571. add: function(e, t) {
  38572. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38573. this.addVectors(e, t)) : (this.x += e.x,
  38574. this.y += e.y,
  38575. this.z += e.z,
  38576. this.w += e.w,
  38577. this)
  38578. },
  38579. addScalar: function(e) {
  38580. return this.x += e,
  38581. this.y += e,
  38582. this.z += e,
  38583. this.w += e,
  38584. this
  38585. },
  38586. addVectors: function(e, t) {
  38587. return this.x = e.x + t.x,
  38588. this.y = e.y + t.y,
  38589. this.z = e.z + t.z,
  38590. this.w = e.w + t.w,
  38591. this
  38592. },
  38593. addScaledVector: function(e, t) {
  38594. return this.x += e.x * t,
  38595. this.y += e.y * t,
  38596. this.z += e.z * t,
  38597. this.w += e.w * t,
  38598. this
  38599. },
  38600. sub: function(e, t) {
  38601. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38602. this.subVectors(e, t)) : (this.x -= e.x,
  38603. this.y -= e.y,
  38604. this.z -= e.z,
  38605. this.w -= e.w,
  38606. this)
  38607. },
  38608. subScalar: function(e) {
  38609. return this.x -= e,
  38610. this.y -= e,
  38611. this.z -= e,
  38612. this.w -= e,
  38613. this
  38614. },
  38615. subVectors: function(e, t) {
  38616. return this.x = e.x - t.x,
  38617. this.y = e.y - t.y,
  38618. this.z = e.z - t.z,
  38619. this.w = e.w - t.w,
  38620. this
  38621. },
  38622. multiplyScalar: function(e) {
  38623. return isFinite(e) ? (this.x *= e,
  38624. this.y *= e,
  38625. this.z *= e,
  38626. this.w *= e) : (this.x = 0,
  38627. this.y = 0,
  38628. this.z = 0,
  38629. this.w = 0),
  38630. this
  38631. },
  38632. applyMatrix4: function(e) {
  38633. var t = this.x
  38634. , i = this.y
  38635. , n = this.z
  38636. , r = this.w
  38637. , o = e.elements;
  38638. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38639. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38640. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38641. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38642. this
  38643. },
  38644. divideScalar: function(e) {
  38645. return this.multiplyScalar(1 / e)
  38646. },
  38647. setAxisAngleFromQuaternion: function(e) {
  38648. this.w = 2 * Math.acos(e.w);
  38649. var t = Math.sqrt(1 - e.w * e.w);
  38650. return t < 1e-4 ? (this.x = 1,
  38651. this.y = 0,
  38652. this.z = 0) : (this.x = e.x / t,
  38653. this.y = e.y / t,
  38654. this.z = e.z / t),
  38655. this
  38656. },
  38657. setAxisAngleFromRotationMatrix: function(e) {
  38658. 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];
  38659. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38660. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38661. return this.set(1, 0, 0, 0),
  38662. this;
  38663. t = Math.PI;
  38664. var g = (a + 1) / 2
  38665. , m = (h + 1) / 2
  38666. , v = (f + 1) / 2
  38667. , y = (s + c) / 4
  38668. , A = (l + d) / 4
  38669. , C = (u + p) / 4;
  38670. return m < g && v < g ? r = g < .01 ? (i = 0,
  38671. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38672. A / i) : v < m ? r = m < .01 ? (n = 0,
  38673. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38674. C / n) : v < .01 ? (n = i = .707106781,
  38675. r = 0) : (i = A / (r = Math.sqrt(v)),
  38676. n = C / r),
  38677. this.set(i, n, r, t),
  38678. this
  38679. }
  38680. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38681. return Math.abs(I) < .001 && (I = 1),
  38682. this.x = (p - u) / I,
  38683. this.y = (l - d) / I,
  38684. this.z = (c - s) / I,
  38685. this.w = Math.acos((a + h + f - 1) / 2),
  38686. this
  38687. },
  38688. min: function(e) {
  38689. return this.x = Math.min(this.x, e.x),
  38690. this.y = Math.min(this.y, e.y),
  38691. this.z = Math.min(this.z, e.z),
  38692. this.w = Math.min(this.w, e.w),
  38693. this
  38694. },
  38695. max: function(e) {
  38696. return this.x = Math.max(this.x, e.x),
  38697. this.y = Math.max(this.y, e.y),
  38698. this.z = Math.max(this.z, e.z),
  38699. this.w = Math.max(this.w, e.w),
  38700. this
  38701. },
  38702. clamp: function(e, t) {
  38703. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38704. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38705. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38706. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38707. this
  38708. },
  38709. clampScalar: function(e, t) {
  38710. return void 0 === _e && (_e = new Ci.Vector4,
  38711. be = new Ci.Vector4),
  38712. _e.set(e, e, e, e),
  38713. be.set(t, t, t, t),
  38714. this.clamp(_e, be)
  38715. },
  38716. floor: function() {
  38717. return this.x = Math.floor(this.x),
  38718. this.y = Math.floor(this.y),
  38719. this.z = Math.floor(this.z),
  38720. this.w = Math.floor(this.w),
  38721. this
  38722. },
  38723. ceil: function() {
  38724. return this.x = Math.ceil(this.x),
  38725. this.y = Math.ceil(this.y),
  38726. this.z = Math.ceil(this.z),
  38727. this.w = Math.ceil(this.w),
  38728. this
  38729. },
  38730. round: function() {
  38731. return this.x = Math.round(this.x),
  38732. this.y = Math.round(this.y),
  38733. this.z = Math.round(this.z),
  38734. this.w = Math.round(this.w),
  38735. this
  38736. },
  38737. roundToZero: function() {
  38738. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38739. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38740. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38741. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38742. this
  38743. },
  38744. negate: function() {
  38745. return this.x = -this.x,
  38746. this.y = -this.y,
  38747. this.z = -this.z,
  38748. this.w = -this.w,
  38749. this
  38750. },
  38751. dot: function(e) {
  38752. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38753. },
  38754. lengthSq: function() {
  38755. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38756. },
  38757. length: function() {
  38758. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38759. },
  38760. lengthManhattan: function() {
  38761. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38762. },
  38763. normalize: function() {
  38764. return this.divideScalar(this.length())
  38765. },
  38766. setLength: function(e) {
  38767. return this.multiplyScalar(e / this.length())
  38768. },
  38769. lerp: function(e, t) {
  38770. return this.x += (e.x - this.x) * t,
  38771. this.y += (e.y - this.y) * t,
  38772. this.z += (e.z - this.z) * t,
  38773. this.w += (e.w - this.w) * t,
  38774. this
  38775. },
  38776. lerpVectors: function(e, t, i) {
  38777. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38778. this
  38779. },
  38780. equals: function(e) {
  38781. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38782. },
  38783. fromArray: function(e, t) {
  38784. return void 0 === t && (t = 0),
  38785. this.x = e[t],
  38786. this.y = e[t + 1],
  38787. this.z = e[t + 2],
  38788. this.w = e[t + 3],
  38789. this
  38790. },
  38791. toArray: function(e, t) {
  38792. return void 0 === e && (e = []),
  38793. void 0 === t && (t = 0),
  38794. e[t] = this.x,
  38795. e[t + 1] = this.y,
  38796. e[t + 2] = this.z,
  38797. e[t + 3] = this.w,
  38798. e
  38799. },
  38800. fromAttribute: function(e, t, i) {
  38801. return void 0 === i && (i = 0),
  38802. t = t * e.itemSize + i,
  38803. this.x = e.array[t],
  38804. this.y = e.array[t + 1],
  38805. this.z = e.array[t + 2],
  38806. this.w = e.array[t + 3],
  38807. this
  38808. }
  38809. },
  38810. Ci.Euler = function(e, t, i, n) {
  38811. this._x = e || 0,
  38812. this._y = t || 0,
  38813. this._z = i || 0,
  38814. this._order = n || Ci.Euler.DefaultOrder
  38815. }
  38816. ,
  38817. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38818. Ci.Euler.DefaultOrder = "XYZ",
  38819. Ci.Euler.prototype = {
  38820. constructor: Ci.Euler,
  38821. get x() {
  38822. return this._x
  38823. },
  38824. set x(e) {
  38825. this._x = e,
  38826. this.onChangeCallback()
  38827. },
  38828. get y() {
  38829. return this._y
  38830. },
  38831. set y(e) {
  38832. this._y = e,
  38833. this.onChangeCallback()
  38834. },
  38835. get z() {
  38836. return this._z
  38837. },
  38838. set z(e) {
  38839. this._z = e,
  38840. this.onChangeCallback()
  38841. },
  38842. get order() {
  38843. return this._order
  38844. },
  38845. set order(e) {
  38846. this._order = e,
  38847. this.onChangeCallback()
  38848. },
  38849. set: function(e, t, i, n) {
  38850. return this._x = e,
  38851. this._y = t,
  38852. this._z = i,
  38853. this._order = n || this._order,
  38854. this.onChangeCallback(),
  38855. this
  38856. },
  38857. clone: function() {
  38858. return new this.constructor(this._x,this._y,this._z,this._order)
  38859. },
  38860. copy: function(e) {
  38861. return this._x = e._x,
  38862. this._y = e._y,
  38863. this._z = e._z,
  38864. this._order = e._order,
  38865. this.onChangeCallback(),
  38866. this
  38867. },
  38868. toObject: function() {//xzw
  38869. return {x:this.x,y:this.y,z:this.z}
  38870. },
  38871. setFromRotationMatrix: function(e, t, i) {
  38872. var n = Ci.Math.clamp
  38873. , r = e.elements
  38874. , o = r[0]
  38875. , a = r[4]
  38876. , s = r[8]
  38877. , l = r[1]
  38878. , c = r[5]
  38879. , h = r[9]
  38880. , u = r[2]
  38881. , d = r[6]
  38882. , p = r[10];
  38883. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38884. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38885. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38886. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38887. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38888. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38889. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38890. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38891. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38892. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38893. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38894. this._z = Math.atan2(l, o)) : (this._x = 0,
  38895. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38896. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38897. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38898. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38899. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38900. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38901. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38902. this._order = t,
  38903. !1 !== i && this.onChangeCallback(),
  38904. this
  38905. },
  38906. setFromQuaternion: function(e, t, i) {
  38907. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38908. Ee.makeRotationFromQuaternion(e),
  38909. this.setFromRotationMatrix(Ee, t, i),
  38910. this
  38911. },
  38912. setFromVector3: function(e, t) {
  38913. return this.set(e.x, e.y, e.z, t || this._order)
  38914. },
  38915. reorder: (Ie = new Ci.Quaternion,
  38916. function(e) {
  38917. Ie.setFromEuler(this),
  38918. this.setFromQuaternion(Ie, e)
  38919. }
  38920. ),
  38921. equals: function(e) {
  38922. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38923. },
  38924. fromArray: function(e) {
  38925. return this._x = e[0],
  38926. this._y = e[1],
  38927. this._z = e[2],
  38928. void 0 !== e[3] && (this._order = e[3]),
  38929. this.onChangeCallback(),
  38930. this
  38931. },
  38932. toArray: function(e, t) {
  38933. return void 0 === e && (e = []),
  38934. void 0 === t && (t = 0),
  38935. e[t] = this._x,
  38936. e[t + 1] = this._y,
  38937. e[t + 2] = this._z,
  38938. e[t + 3] = this._order,
  38939. e
  38940. },
  38941. toVector3: function(e) {
  38942. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38943. },
  38944. onChange: function(e) {
  38945. return this.onChangeCallback = e,
  38946. this
  38947. },
  38948. onChangeCallback: function() {}
  38949. },
  38950. Ci.Line3 = function(e, t) {
  38951. this.start = void 0 !== e ? e : new Ci.Vector3,
  38952. this.end = void 0 !== t ? t : new Ci.Vector3
  38953. }
  38954. ,
  38955. Ci.Line3.prototype = {
  38956. constructor: Ci.Line3,
  38957. set: function(e, t) {
  38958. return this.start.copy(e),
  38959. this.end.copy(t),
  38960. this
  38961. },
  38962. clone: function() {
  38963. return (new this.constructor).copy(this)
  38964. },
  38965. copy: function(e) {
  38966. return this.start.copy(e.start),
  38967. this.end.copy(e.end),
  38968. this
  38969. },
  38970. center: function(e) {
  38971. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38972. },
  38973. delta: function(e) {
  38974. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38975. },
  38976. distanceSq: function() {
  38977. return this.start.distanceToSquared(this.end)
  38978. },
  38979. distance: function() {
  38980. return this.start.distanceTo(this.end)
  38981. },
  38982. at: function(e, t) {
  38983. var i = t || new Ci.Vector3;
  38984. return this.delta(i).multiplyScalar(e).add(this.start)
  38985. },
  38986. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38987. Ce = new Ci.Vector3,
  38988. function(e, t) {
  38989. Ae.subVectors(e, this.start),
  38990. Ce.subVectors(this.end, this.start);
  38991. var i = Ce.dot(Ce)
  38992. , n = Ce.dot(Ae) / i;
  38993. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38994. n
  38995. }
  38996. ),
  38997. closestPointToPoint: function(e, t, i) {
  38998. var n = this.closestPointToPointParameter(e, t)
  38999. , r = i || new Ci.Vector3;
  39000. return this.delta(r).multiplyScalar(n).add(this.start)
  39001. },
  39002. applyMatrix4: function(e) {
  39003. return this.start.applyMatrix4(e),
  39004. this.end.applyMatrix4(e),
  39005. this
  39006. },
  39007. equals: function(e) {
  39008. return e.start.equals(this.start) && e.end.equals(this.end)
  39009. }
  39010. },
  39011. Ci.Box2 = function(e, t) {
  39012. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39013. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39014. }
  39015. ,
  39016. Ci.Box2.prototype = {
  39017. constructor: Ci.Box2,
  39018. set: function(e, t) {
  39019. return this.min.copy(e),
  39020. this.max.copy(t),
  39021. this
  39022. },
  39023. setFromPoints: function(e) {
  39024. this.makeEmpty();
  39025. for (var t = 0, i = e.length; t < i; t++)
  39026. this.expandByPoint(e[t]);
  39027. return this
  39028. },
  39029. setFromCenterAndSize: (ye = new Ci.Vector2,
  39030. function(e, t) {
  39031. var i = ye.copy(t).multiplyScalar(.5);
  39032. return this.min.copy(e).sub(i),
  39033. this.max.copy(e).add(i),
  39034. this
  39035. }
  39036. ),
  39037. clone: function() {
  39038. return (new this.constructor).copy(this)
  39039. },
  39040. copy: function(e) {
  39041. return this.min.copy(e.min),
  39042. this.max.copy(e.max),
  39043. this
  39044. },
  39045. makeEmpty: function() {
  39046. return this.min.x = this.min.y = 1 / 0,
  39047. this.max.x = this.max.y = -1 / 0,
  39048. this
  39049. },
  39050. isEmpty: function() {
  39051. return this.max.x < this.min.x || this.max.y < this.min.y
  39052. },
  39053. center: function(e) {
  39054. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39055. },
  39056. size: function(e) {
  39057. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39058. },
  39059. expandByPoint: function(e) {
  39060. return this.min.min(e),
  39061. this.max.max(e),
  39062. this
  39063. },
  39064. expandByVector: function(e) {
  39065. return this.min.sub(e),
  39066. this.max.add(e),
  39067. this
  39068. },
  39069. expandByScalar: function(e) {
  39070. return this.min.addScalar(-e),
  39071. this.max.addScalar(e),
  39072. this
  39073. },
  39074. containsPoint: function(e) {
  39075. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39076. },
  39077. containsBox: function(e) {
  39078. 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
  39079. },
  39080. getParameter: function(e, t) {
  39081. 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))
  39082. },
  39083. intersectsBox: function(e) {
  39084. 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)
  39085. },
  39086. clampPoint: function(e, t) {
  39087. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39088. },
  39089. distanceToPoint: (ve = new Ci.Vector2,
  39090. function(e) {
  39091. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39092. }
  39093. ),
  39094. intersect: function(e) {
  39095. return this.min.max(e.min),
  39096. this.max.min(e.max),
  39097. this
  39098. },
  39099. union: function(e) {
  39100. return this.min.min(e.min),
  39101. this.max.max(e.max),
  39102. this
  39103. },
  39104. translate: function(e) {
  39105. return this.min.add(e),
  39106. this.max.add(e),
  39107. this
  39108. },
  39109. equals: function(e) {
  39110. return e.min.equals(this.min) && e.max.equals(this.max)
  39111. }
  39112. },
  39113. Ci.Box3 = function(e, t) {
  39114. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39115. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39116. }
  39117. ,
  39118. Ci.Box3.prototype = {
  39119. constructor: Ci.Box3,
  39120. set: function(e, t) {
  39121. return this.min.copy(e),
  39122. this.max.copy(t),
  39123. this
  39124. },
  39125. setFromArray: function(e) {
  39126. this.makeEmpty();
  39127. 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) {
  39128. var c = e[s]
  39129. , h = e[s + 1]
  39130. , u = e[s + 2];
  39131. c < t && (t = c),
  39132. h < i && (i = h),
  39133. u < n && (n = u),
  39134. r < c && (r = c),
  39135. o < h && (o = h),
  39136. a < u && (a = u)
  39137. }
  39138. this.min.set(t, i, n),
  39139. this.max.set(r, o, a)
  39140. },
  39141. setFromPoints: function(e) {
  39142. this.makeEmpty();
  39143. for (var t = 0, i = e.length; t < i; t++)
  39144. this.expandByPoint(e[t]);
  39145. return this
  39146. },
  39147. setFromCenterAndSize: (me = new Ci.Vector3,
  39148. function(e, t) {
  39149. var i = me.copy(t).multiplyScalar(.5);
  39150. return this.min.copy(e).sub(i),
  39151. this.max.copy(e).add(i),
  39152. this
  39153. }
  39154. ),
  39155. setFromObject: function(e) {
  39156. void 0 === ge && (ge = new Ci.Box3);
  39157. var i = this;
  39158. return this.makeEmpty(),
  39159. e.updateMatrixWorld(!0),
  39160. e.traverse(function(e) {
  39161. var t = e.geometry;
  39162. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39163. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39164. ge.applyMatrix4(e.matrixWorld),
  39165. i.union(ge)))
  39166. }),
  39167. this
  39168. },
  39169. clone: function() {
  39170. return (new this.constructor).copy(this)
  39171. },
  39172. copy: function(e) {
  39173. return this.min.copy(e.min),
  39174. this.max.copy(e.max),
  39175. this
  39176. },
  39177. makeEmpty: function() {
  39178. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39179. this.max.x = this.max.y = this.max.z = -1 / 0,
  39180. this
  39181. },
  39182. isEmpty: function() {
  39183. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39184. },
  39185. center: function(e) {
  39186. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39187. },
  39188. size: function(e) {
  39189. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39190. },
  39191. expandByPoint: function(e) {
  39192. return this.min.min(e),
  39193. this.max.max(e),
  39194. this
  39195. },
  39196. expandByVector: function(e) {
  39197. return this.min.sub(e),
  39198. this.max.add(e),
  39199. this
  39200. },
  39201. expandByScalar: function(e) {
  39202. return this.min.addScalar(-e),
  39203. this.max.addScalar(e),
  39204. this
  39205. },
  39206. containsPoint: function(e) {
  39207. 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)
  39208. },
  39209. containsBox: function(e) {
  39210. 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
  39211. },
  39212. getParameter: function(e, t) {
  39213. 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))
  39214. },
  39215. intersectsBox: function(e) {
  39216. 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)
  39217. },
  39218. intersectsSphere: function(e) {
  39219. return void 0 === fe && (fe = new Ci.Vector3),
  39220. this.clampPoint(e.center, fe),
  39221. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39222. },
  39223. intersectsPlane: function(e) {
  39224. var t, i;
  39225. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39226. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39227. e.normal.x * this.min.x),
  39228. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39229. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39230. i += e.normal.y * this.min.y),
  39231. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39232. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39233. i += e.normal.z * this.min.z),
  39234. t <= e.constant && i >= e.constant
  39235. },
  39236. clampPoint: function(e, t) {
  39237. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39238. },
  39239. distanceToPoint: (pe = new Ci.Vector3,
  39240. function(e) {
  39241. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39242. }
  39243. ),
  39244. getBoundingSphere: (de = new Ci.Vector3,
  39245. function(e) {
  39246. var t = e || new Ci.Sphere;
  39247. return t.center = this.center(),
  39248. t.radius = .5 * this.size(de).length(),
  39249. t
  39250. }
  39251. ),
  39252. intersect: function(e) {
  39253. return this.min.max(e.min),
  39254. this.max.min(e.max),
  39255. this
  39256. },
  39257. union: function(e) {
  39258. return this.min.min(e.min),
  39259. this.max.max(e.max),
  39260. this
  39261. },
  39262. 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],
  39263. function(e) {
  39264. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39265. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39266. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39267. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39268. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39269. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39270. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39271. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39272. this.makeEmpty(),
  39273. this.setFromPoints(ue),
  39274. this
  39275. }
  39276. ),
  39277. translate: function(e) {
  39278. return this.min.add(e),
  39279. this.max.add(e),
  39280. this
  39281. },
  39282. equals: function(e) {
  39283. return e.min.equals(this.min) && e.max.equals(this.max)
  39284. }
  39285. },
  39286. Ci.Matrix3 = function() {
  39287. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39288. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39289. }
  39290. ,
  39291. Ci.Matrix3.prototype = {
  39292. constructor: Ci.Matrix3,
  39293. set: function(e, t, i, n, r, o, a, s, l) {
  39294. var c = this.elements;
  39295. return c[0] = e,
  39296. c[1] = n,
  39297. c[2] = a,
  39298. c[3] = t,
  39299. c[4] = r,
  39300. c[5] = s,
  39301. c[6] = i,
  39302. c[7] = o,
  39303. c[8] = l,
  39304. this
  39305. },
  39306. identity: function() {
  39307. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39308. this
  39309. },
  39310. clone: function() {
  39311. return (new this.constructor).fromArray(this.elements)
  39312. },
  39313. copy: function(e) {
  39314. var t = e.elements;
  39315. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39316. this
  39317. },
  39318. setFromMatrix4: function(e) {
  39319. var t = e.elements;
  39320. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39321. this
  39322. },
  39323. applyToVector3Array: function(e, t, i) {
  39324. void 0 === he && (he = new Ci.Vector3),
  39325. void 0 === t && (t = 0),
  39326. void 0 === i && (i = e.length);
  39327. for (var n = 0, r = t; n < i; n += 3,
  39328. r += 3)
  39329. he.fromArray(e, r),
  39330. he.applyMatrix3(this),
  39331. he.toArray(e, r);
  39332. return e
  39333. },
  39334. applyToBuffer: function(e, t, i) {
  39335. void 0 === ce && (ce = new Ci.Vector3),
  39336. void 0 === t && (t = 0),
  39337. void 0 === i && (i = e.length / e.itemSize);
  39338. for (var n = 0, r = t; n < i; n++,
  39339. r++)
  39340. ce.x = e.getX(r),
  39341. ce.y = e.getY(r),
  39342. ce.z = e.getZ(r),
  39343. ce.applyMatrix3(this),
  39344. e.setXYZ(ce.x, ce.y, ce.z);
  39345. return e
  39346. },
  39347. multiplyScalar: function(e) {
  39348. var t = this.elements;
  39349. return t[0] *= e,
  39350. t[3] *= e,
  39351. t[6] *= e,
  39352. t[1] *= e,
  39353. t[4] *= e,
  39354. t[7] *= e,
  39355. t[2] *= e,
  39356. t[5] *= e,
  39357. t[8] *= e,
  39358. this
  39359. },
  39360. determinant: function() {
  39361. var e = this.elements
  39362. , t = e[0]
  39363. , i = e[1]
  39364. , n = e[2]
  39365. , r = e[3]
  39366. , o = e[4]
  39367. , a = e[5]
  39368. , s = e[6]
  39369. , l = e[7]
  39370. , c = e[8];
  39371. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39372. },
  39373. getInverse: function(e, t) {
  39374. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39375. var i = e.elements
  39376. , n = this.elements
  39377. , r = i[0]
  39378. , o = i[1]
  39379. , a = i[2]
  39380. , s = i[3]
  39381. , l = i[4]
  39382. , c = i[5]
  39383. , h = i[6]
  39384. , u = i[7]
  39385. , d = i[8]
  39386. , p = d * l - c * u
  39387. , f = c * h - d * s
  39388. , g = u * s - l * h
  39389. , m = r * p + o * f + a * g;
  39390. if (0 != m)
  39391. return n[0] = p,
  39392. n[1] = a * u - d * o,
  39393. n[2] = c * o - a * l,
  39394. n[3] = f,
  39395. n[4] = d * r - a * h,
  39396. n[5] = a * s - c * r,
  39397. n[6] = g,
  39398. n[7] = o * h - u * r,
  39399. n[8] = l * r - o * s,
  39400. this.multiplyScalar(1 / m);
  39401. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39402. if (t)
  39403. throw new Error(v);
  39404. return console.warn(v),
  39405. this.identity()
  39406. },
  39407. transpose: function() {
  39408. var e, t = this.elements;
  39409. return e = t[1],
  39410. t[1] = t[3],
  39411. t[3] = e,
  39412. e = t[2],
  39413. t[2] = t[6],
  39414. t[6] = e,
  39415. e = t[5],
  39416. t[5] = t[7],
  39417. t[7] = e,
  39418. this
  39419. },
  39420. flattenToArrayOffset: function(e, t) {
  39421. var i = this.elements;
  39422. return e[t] = i[0],
  39423. e[t + 1] = i[1],
  39424. e[t + 2] = i[2],
  39425. e[t + 3] = i[3],
  39426. e[t + 4] = i[4],
  39427. e[t + 5] = i[5],
  39428. e[t + 6] = i[6],
  39429. e[t + 7] = i[7],
  39430. e[t + 8] = i[8],
  39431. e
  39432. },
  39433. getNormalMatrix: function(e) {
  39434. return this.setFromMatrix4(e).getInverse(this).transpose()
  39435. },
  39436. transposeIntoArray: function(e) {
  39437. var t = this.elements;
  39438. return e[0] = t[0],
  39439. e[1] = t[3],
  39440. e[2] = t[6],
  39441. e[3] = t[1],
  39442. e[4] = t[4],
  39443. e[5] = t[7],
  39444. e[6] = t[2],
  39445. e[7] = t[5],
  39446. e[8] = t[8],
  39447. this
  39448. },
  39449. fromArray: function(e) {
  39450. return this.elements.set(e),
  39451. this
  39452. },
  39453. toArray: function() {
  39454. var e = this.elements;
  39455. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39456. }
  39457. },
  39458. Ci.Matrix4 = function() {
  39459. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39460. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39461. }
  39462. ,
  39463. Ci.Matrix4.prototype = {
  39464. constructor: Ci.Matrix4,
  39465. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39466. var m = this.elements;
  39467. return m[0] = e,
  39468. m[4] = t,
  39469. m[8] = i,
  39470. m[12] = n,
  39471. m[1] = r,
  39472. m[5] = o,
  39473. m[9] = a,
  39474. m[13] = s,
  39475. m[2] = l,
  39476. m[6] = c,
  39477. m[10] = h,
  39478. m[14] = u,
  39479. m[3] = d,
  39480. m[7] = p,
  39481. m[11] = f,
  39482. m[15] = g,
  39483. this
  39484. },
  39485. identity: function() {
  39486. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39487. this
  39488. },
  39489. clone: function() {
  39490. return (new Ci.Matrix4).fromArray(this.elements)
  39491. },
  39492. copy: function(e) {
  39493. return this.elements.set(e.elements),
  39494. this
  39495. },
  39496. copyPosition: function(e) {
  39497. var t = this.elements
  39498. , i = e.elements;
  39499. return t[12] = i[12],
  39500. t[13] = i[13],
  39501. t[14] = i[14],
  39502. this
  39503. },
  39504. extractBasis: function(e, t, i) {
  39505. return e.setFromMatrixColumn(this, 0),
  39506. t.setFromMatrixColumn(this, 1),
  39507. i.setFromMatrixColumn(this, 2),
  39508. this
  39509. },
  39510. makeBasis: function(e, t, i) {
  39511. 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),
  39512. this
  39513. },
  39514. extractRotation: function(e) {
  39515. void 0 === le && (le = new Ci.Vector3);
  39516. var t = this.elements
  39517. , i = e.elements
  39518. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39519. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39520. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39521. return t[0] = i[0] * n,
  39522. t[1] = i[1] * n,
  39523. t[2] = i[2] * n,
  39524. t[4] = i[4] * r,
  39525. t[5] = i[5] * r,
  39526. t[6] = i[6] * r,
  39527. t[8] = i[8] * o,
  39528. t[9] = i[9] * o,
  39529. t[10] = i[10] * o,
  39530. this
  39531. },
  39532. makeRotationFromEuler: function(e) {
  39533. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39534. var t = this.elements
  39535. , i = e.x
  39536. , n = e.y
  39537. , r = e.z
  39538. , o = Math.cos(i)
  39539. , a = Math.sin(i)
  39540. , s = Math.cos(n)
  39541. , l = Math.sin(n)
  39542. , c = Math.cos(r)
  39543. , h = Math.sin(r);
  39544. if ("XYZ" === e.order) {
  39545. var u = o * c
  39546. , d = o * h
  39547. , p = a * c
  39548. , f = a * h;
  39549. t[0] = s * c,
  39550. t[4] = -s * h,
  39551. t[8] = l,
  39552. t[1] = d + p * l,
  39553. t[5] = u - f * l,
  39554. t[9] = -a * s,
  39555. t[2] = f - u * l,
  39556. t[6] = p + d * l,
  39557. t[10] = o * s
  39558. } else if ("YXZ" === e.order) {
  39559. var g = s * c
  39560. , m = s * h
  39561. , v = l * c
  39562. , y = l * h;
  39563. t[0] = g + y * a,
  39564. t[4] = v * a - m,
  39565. t[8] = o * l,
  39566. t[1] = o * h,
  39567. t[5] = o * c,
  39568. t[9] = -a,
  39569. t[2] = m * a - v,
  39570. t[6] = y + g * a,
  39571. t[10] = o * s
  39572. } else if ("ZXY" === e.order) {
  39573. g = s * c,
  39574. m = s * h,
  39575. v = l * c,
  39576. y = l * h;
  39577. t[0] = g - y * a,
  39578. t[4] = -o * h,
  39579. t[8] = v + m * a,
  39580. t[1] = m + v * a,
  39581. t[5] = o * c,
  39582. t[9] = y - g * a,
  39583. t[2] = -o * l,
  39584. t[6] = a,
  39585. t[10] = o * s
  39586. } else if ("ZYX" === e.order) {
  39587. u = o * c,
  39588. d = o * h,
  39589. p = a * c,
  39590. f = a * h;
  39591. t[0] = s * c,
  39592. t[4] = p * l - d,
  39593. t[8] = u * l + f,
  39594. t[1] = s * h,
  39595. t[5] = f * l + u,
  39596. t[9] = d * l - p,
  39597. t[2] = -l,
  39598. t[6] = a * s,
  39599. t[10] = o * s
  39600. } else if ("YZX" === e.order) {
  39601. var A = o * s
  39602. , C = o * l
  39603. , I = a * s
  39604. , E = a * l;
  39605. t[0] = s * c,
  39606. t[4] = E - A * h,
  39607. t[8] = I * h + C,
  39608. t[1] = h,
  39609. t[5] = o * c,
  39610. t[9] = -a * c,
  39611. t[2] = -l * c,
  39612. t[6] = C * h + I,
  39613. t[10] = A - E * h
  39614. } else if ("XZY" === e.order) {
  39615. A = o * s,
  39616. C = o * l,
  39617. I = a * s,
  39618. E = a * l;
  39619. t[0] = s * c,
  39620. t[4] = -h,
  39621. t[8] = l * c,
  39622. t[1] = A * h + E,
  39623. t[5] = o * c,
  39624. t[9] = C * h - I,
  39625. t[2] = I * h - C,
  39626. t[6] = a * c,
  39627. t[10] = E * h + A
  39628. }
  39629. return t[3] = 0,
  39630. t[7] = 0,
  39631. t[11] = 0,
  39632. t[12] = 0,
  39633. t[13] = 0,
  39634. t[14] = 0,
  39635. t[15] = 1,
  39636. this
  39637. },
  39638. makeRotationFromQuaternion: function(e) {
  39639. var t = this.elements
  39640. , i = e.x
  39641. , n = e.y
  39642. , r = e.z
  39643. , o = e.w
  39644. , a = i + i
  39645. , s = n + n
  39646. , l = r + r
  39647. , c = i * a
  39648. , h = i * s
  39649. , u = i * l
  39650. , d = n * s
  39651. , p = n * l
  39652. , f = r * l
  39653. , g = o * a
  39654. , m = o * s
  39655. , v = o * l;
  39656. return t[0] = 1 - (d + f),
  39657. t[4] = h - v,
  39658. t[8] = u + m,
  39659. t[1] = h + v,
  39660. t[5] = 1 - (c + f),
  39661. t[9] = p - g,
  39662. t[2] = u - m,
  39663. t[6] = p + g,
  39664. t[10] = 1 - (c + d),
  39665. t[3] = 0,
  39666. t[7] = 0,
  39667. t[11] = 0,
  39668. t[12] = 0,
  39669. t[13] = 0,
  39670. t[14] = 0,
  39671. t[15] = 1,
  39672. this
  39673. },
  39674. lookAt: function(e, t, i) {
  39675. void 0 === oe && (oe = new Ci.Vector3),
  39676. void 0 === ae && (ae = new Ci.Vector3),
  39677. void 0 === se && (se = new Ci.Vector3);
  39678. var n = this.elements;
  39679. return se.subVectors(e, t).normalize(),
  39680. 0 === se.lengthSq() && (se.z = 1),
  39681. oe.crossVectors(i, se).normalize(),
  39682. 0 === oe.lengthSq() && (se.x += 1e-4,
  39683. oe.crossVectors(i, se).normalize()),
  39684. ae.crossVectors(se, oe),
  39685. n[0] = oe.x,
  39686. n[4] = ae.x,
  39687. n[8] = se.x,
  39688. n[1] = oe.y,
  39689. n[5] = ae.y,
  39690. n[9] = se.y,
  39691. n[2] = oe.z,
  39692. n[6] = ae.z,
  39693. n[10] = se.z,
  39694. this
  39695. },
  39696. multiply: function(e, t) {
  39697. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39698. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39699. },
  39700. multiplyMatrices: function(e, t) {
  39701. var i = e.elements
  39702. , n = t.elements
  39703. , r = this.elements
  39704. , o = i[0]
  39705. , a = i[4]
  39706. , s = i[8]
  39707. , l = i[12]
  39708. , c = i[1]
  39709. , h = i[5]
  39710. , u = i[9]
  39711. , d = i[13]
  39712. , p = i[2]
  39713. , f = i[6]
  39714. , g = i[10]
  39715. , m = i[14]
  39716. , v = i[3]
  39717. , y = i[7]
  39718. , A = i[11]
  39719. , C = i[15]
  39720. , I = n[0]
  39721. , E = n[4]
  39722. , _ = n[8]
  39723. , b = n[12]
  39724. , w = n[1]
  39725. , T = n[5]
  39726. , x = n[9]
  39727. , S = n[13]
  39728. , M = n[2]
  39729. , R = n[6]
  39730. , P = n[10]
  39731. , O = n[14]
  39732. , L = n[3]
  39733. , D = n[7]
  39734. , N = n[11]
  39735. , F = n[15];
  39736. return r[0] = o * I + a * w + s * M + l * L,
  39737. r[4] = o * E + a * T + s * R + l * D,
  39738. r[8] = o * _ + a * x + s * P + l * N,
  39739. r[12] = o * b + a * S + s * O + l * F,
  39740. r[1] = c * I + h * w + u * M + d * L,
  39741. r[5] = c * E + h * T + u * R + d * D,
  39742. r[9] = c * _ + h * x + u * P + d * N,
  39743. r[13] = c * b + h * S + u * O + d * F,
  39744. r[2] = p * I + f * w + g * M + m * L,
  39745. r[6] = p * E + f * T + g * R + m * D,
  39746. r[10] = p * _ + f * x + g * P + m * N,
  39747. r[14] = p * b + f * S + g * O + m * F,
  39748. r[3] = v * I + y * w + A * M + C * L,
  39749. r[7] = v * E + y * T + A * R + C * D,
  39750. r[11] = v * _ + y * x + A * P + C * N,
  39751. r[15] = v * b + y * S + A * O + C * F,
  39752. this
  39753. },
  39754. multiplyToArray: function(e, t, i) {
  39755. var n = this.elements;
  39756. return this.multiplyMatrices(e, t),
  39757. i[0] = n[0],
  39758. i[1] = n[1],
  39759. i[2] = n[2],
  39760. i[3] = n[3],
  39761. i[4] = n[4],
  39762. i[5] = n[5],
  39763. i[6] = n[6],
  39764. i[7] = n[7],
  39765. i[8] = n[8],
  39766. i[9] = n[9],
  39767. i[10] = n[10],
  39768. i[11] = n[11],
  39769. i[12] = n[12],
  39770. i[13] = n[13],
  39771. i[14] = n[14],
  39772. i[15] = n[15],
  39773. this
  39774. },
  39775. multiplyScalar: function(e) {
  39776. var t = this.elements;
  39777. return t[0] *= e,
  39778. t[4] *= e,
  39779. t[8] *= e,
  39780. t[12] *= e,
  39781. t[1] *= e,
  39782. t[5] *= e,
  39783. t[9] *= e,
  39784. t[13] *= e,
  39785. t[2] *= e,
  39786. t[6] *= e,
  39787. t[10] *= e,
  39788. t[14] *= e,
  39789. t[3] *= e,
  39790. t[7] *= e,
  39791. t[11] *= e,
  39792. t[15] *= e,
  39793. this
  39794. },
  39795. applyToVector3Array: function(e, t, i) {
  39796. void 0 === re && (re = new Ci.Vector3),
  39797. void 0 === t && (t = 0),
  39798. void 0 === i && (i = e.length);
  39799. for (var n = 0, r = t; n < i; n += 3,
  39800. r += 3)
  39801. re.fromArray(e, r),
  39802. re.applyMatrix4(this),
  39803. re.toArray(e, r);
  39804. return e
  39805. },
  39806. applyToBuffer: function(e, t, i) {
  39807. void 0 === ne && (ne = new Ci.Vector3),
  39808. void 0 === t && (t = 0),
  39809. void 0 === i && (i = e.length / e.itemSize);
  39810. for (var n = 0, r = t; n < i; n++,
  39811. r++)
  39812. ne.x = e.getX(r),
  39813. ne.y = e.getY(r),
  39814. ne.z = e.getZ(r),
  39815. ne.applyMatrix4(this),
  39816. e.setXYZ(ne.x, ne.y, ne.z);
  39817. return e
  39818. },
  39819. determinant: function() {
  39820. var e = this.elements
  39821. , t = e[0]
  39822. , i = e[4]
  39823. , n = e[8]
  39824. , r = e[12]
  39825. , o = e[1]
  39826. , a = e[5]
  39827. , s = e[9]
  39828. , l = e[13]
  39829. , c = e[2]
  39830. , h = e[6]
  39831. , u = e[10]
  39832. , d = e[14];
  39833. 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)
  39834. },
  39835. transpose: function() {
  39836. var e, t = this.elements;
  39837. return e = t[1],
  39838. t[1] = t[4],
  39839. t[4] = e,
  39840. e = t[2],
  39841. t[2] = t[8],
  39842. t[8] = e,
  39843. e = t[6],
  39844. t[6] = t[9],
  39845. t[9] = e,
  39846. e = t[3],
  39847. t[3] = t[12],
  39848. t[12] = e,
  39849. e = t[7],
  39850. t[7] = t[13],
  39851. t[13] = e,
  39852. e = t[11],
  39853. t[11] = t[14],
  39854. t[14] = e,
  39855. this
  39856. },
  39857. flattenToArrayOffset: function(e, t) {
  39858. var i = this.elements;
  39859. return e[t] = i[0],
  39860. e[t + 1] = i[1],
  39861. e[t + 2] = i[2],
  39862. e[t + 3] = i[3],
  39863. e[t + 4] = i[4],
  39864. e[t + 5] = i[5],
  39865. e[t + 6] = i[6],
  39866. e[t + 7] = i[7],
  39867. e[t + 8] = i[8],
  39868. e[t + 9] = i[9],
  39869. e[t + 10] = i[10],
  39870. e[t + 11] = i[11],
  39871. e[t + 12] = i[12],
  39872. e[t + 13] = i[13],
  39873. e[t + 14] = i[14],
  39874. e[t + 15] = i[15],
  39875. e
  39876. },
  39877. getPosition: function() {
  39878. return void 0 === ie && (ie = new Ci.Vector3),
  39879. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39880. ie.setFromMatrixColumn(this, 3)
  39881. },
  39882. setPosition: function(e) {
  39883. var t = this.elements;
  39884. return t[12] = e.x,
  39885. t[13] = e.y,
  39886. t[14] = e.z,
  39887. this
  39888. },
  39889. getInverse: function(e, t) {
  39890. var i = this.elements
  39891. , n = e.elements
  39892. , r = n[0]
  39893. , o = n[1]
  39894. , a = n[2]
  39895. , s = n[3]
  39896. , l = n[4]
  39897. , c = n[5]
  39898. , h = n[6]
  39899. , u = n[7]
  39900. , d = n[8]
  39901. , p = n[9]
  39902. , f = n[10]
  39903. , g = n[11]
  39904. , m = n[12]
  39905. , v = n[13]
  39906. , y = n[14]
  39907. , A = n[15]
  39908. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39909. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39910. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39911. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39912. , b = r * C + o * I + a * E + s * _;
  39913. if (0 != b)
  39914. return i[0] = C,
  39915. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39916. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39917. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39918. i[4] = I,
  39919. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39920. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39921. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39922. i[8] = E,
  39923. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39924. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39925. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39926. i[12] = _,
  39927. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39928. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39929. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39930. this.multiplyScalar(1 / b);
  39931. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39932. if (t)
  39933. throw new Error(w);
  39934. return console.warn(w),
  39935. this.identity()
  39936. },
  39937. scale: function(e) {
  39938. var t = this.elements
  39939. , i = e.x
  39940. , n = e.y
  39941. , r = e.z;
  39942. return t[0] *= i,
  39943. t[4] *= n,
  39944. t[8] *= r,
  39945. t[1] *= i,
  39946. t[5] *= n,
  39947. t[9] *= r,
  39948. t[2] *= i,
  39949. t[6] *= n,
  39950. t[10] *= r,
  39951. t[3] *= i,
  39952. t[7] *= n,
  39953. t[11] *= r,
  39954. this
  39955. },
  39956. getMaxScaleOnAxis: function() {
  39957. var e = this.elements
  39958. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39959. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39960. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39961. return Math.sqrt(Math.max(t, i, n))
  39962. },
  39963. makeTranslation: function(e, t, i) {
  39964. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39965. this
  39966. },
  39967. makeRotationX: function(e) {
  39968. var t = Math.cos(e)
  39969. , i = Math.sin(e);
  39970. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39971. this
  39972. },
  39973. makeRotationY: function(e) {
  39974. var t = Math.cos(e)
  39975. , i = Math.sin(e);
  39976. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39977. this
  39978. },
  39979. makeRotationZ: function(e) {
  39980. var t = Math.cos(e)
  39981. , i = Math.sin(e);
  39982. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39983. this
  39984. },
  39985. makeRotationAxis: function(e, t) {
  39986. var i = Math.cos(t)
  39987. , n = Math.sin(t)
  39988. , r = 1 - i
  39989. , o = e.x
  39990. , a = e.y
  39991. , s = e.z
  39992. , l = r * o
  39993. , c = r * a;
  39994. 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),
  39995. this
  39996. },
  39997. makeScale: function(e, t, i) {
  39998. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39999. this
  40000. },
  40001. compose: function(e, t, i) {
  40002. return this.makeRotationFromQuaternion(t),
  40003. this.scale(i),
  40004. this.setPosition(e),
  40005. this
  40006. },
  40007. decompose: function(e, t, i) {
  40008. void 0 === ee && (ee = new Ci.Vector3),
  40009. void 0 === te && (te = new Ci.Matrix4);
  40010. var n = this.elements
  40011. , r = ee.set(n[0], n[1], n[2]).length()
  40012. , o = ee.set(n[4], n[5], n[6]).length()
  40013. , a = ee.set(n[8], n[9], n[10]).length();
  40014. this.determinant() < 0 && (r = -r),
  40015. e.x = n[12],
  40016. e.y = n[13],
  40017. e.z = n[14],
  40018. te.elements.set(this.elements);
  40019. var s = 1 / r
  40020. , l = 1 / o
  40021. , c = 1 / a;
  40022. return te.elements[0] *= s,
  40023. te.elements[1] *= s,
  40024. te.elements[2] *= s,
  40025. te.elements[4] *= l,
  40026. te.elements[5] *= l,
  40027. te.elements[6] *= l,
  40028. te.elements[8] *= c,
  40029. te.elements[9] *= c,
  40030. te.elements[10] *= c,
  40031. t.setFromRotationMatrix(te),
  40032. i.x = r,
  40033. i.y = o,
  40034. i.z = a,
  40035. this
  40036. },
  40037. makeFrustum: function(e, t, i, n, r, o) {
  40038. var a = this.elements
  40039. , s = 2 * r / (t - e)
  40040. , l = 2 * r / (n - i)
  40041. , c = (t + e) / (t - e)
  40042. , h = (n + i) / (n - i)
  40043. , u = -(o + r) / (o - r)
  40044. , d = -2 * o * r / (o - r);
  40045. return a[0] = s,
  40046. a[4] = 0,
  40047. a[8] = c,
  40048. a[12] = 0,
  40049. a[1] = 0,
  40050. a[5] = l,
  40051. a[9] = h,
  40052. a[13] = 0,
  40053. a[2] = 0,
  40054. a[6] = 0,
  40055. a[10] = u,
  40056. a[14] = d,
  40057. a[3] = 0,
  40058. a[7] = 0,
  40059. a[11] = -1,
  40060. a[15] = 0,
  40061. this
  40062. },
  40063. makePerspective: function(e, t, i, n) {
  40064. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40065. , o = -r
  40066. , a = o * t
  40067. , s = r * t;
  40068. return this.makeFrustum(a, s, o, r, i, n)
  40069. },
  40070. makeOrthographic: function(e, t, i, n, r, o) {
  40071. var a = this.elements
  40072. , s = 1 / (t - e)
  40073. , l = 1 / (i - n)
  40074. , c = 1 / (o - r)
  40075. , h = (t + e) * s
  40076. , u = (i + n) * l
  40077. , d = (o + r) * c;
  40078. return a[0] = 2 * s,
  40079. a[4] = 0,
  40080. a[8] = 0,
  40081. a[12] = -h,
  40082. a[1] = 0,
  40083. a[5] = 2 * l,
  40084. a[9] = 0,
  40085. a[13] = -u,
  40086. a[2] = 0,
  40087. a[6] = 0,
  40088. a[10] = -2 * c,
  40089. a[14] = -d,
  40090. a[3] = 0,
  40091. a[7] = 0,
  40092. a[11] = 0,
  40093. a[15] = 1,
  40094. this
  40095. },
  40096. equals: function(e) {
  40097. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40098. if (t[n] !== i[n])
  40099. return !1;
  40100. return !0
  40101. },
  40102. fromArray: function(e) {
  40103. return this.elements.set(e),
  40104. this
  40105. },
  40106. toArray: function() {
  40107. var e = this.elements;
  40108. 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]]
  40109. }
  40110. },
  40111. Ci.Ray = function(e, t) {
  40112. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40113. this.direction = void 0 !== t ? t : new Ci.Vector3
  40114. }
  40115. ,
  40116. Ci.Ray.prototype = {
  40117. constructor: Ci.Ray,
  40118. set: function(e, t) {
  40119. return this.origin.copy(e),
  40120. this.direction.copy(t),
  40121. this
  40122. },
  40123. clone: function() {
  40124. return (new this.constructor).copy(this)
  40125. },
  40126. copy: function(e) {
  40127. return this.origin.copy(e.origin),
  40128. this.direction.copy(e.direction),
  40129. this
  40130. },
  40131. at: function(e, t) {
  40132. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40133. },
  40134. lookAt: function(e) {
  40135. this.direction.copy(e).sub(this.origin).normalize()
  40136. },
  40137. recast: ($ = new Ci.Vector3,
  40138. function(e) {
  40139. return this.origin.copy(this.at(e, $)),
  40140. this
  40141. }
  40142. ),
  40143. closestPointToPoint: function(e, t) {
  40144. var i = t || new Ci.Vector3;
  40145. i.subVectors(e, this.origin);
  40146. var n = i.dot(this.direction);
  40147. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40148. },
  40149. distanceToPoint: function(e) {
  40150. return Math.sqrt(this.distanceSqToPoint(e))
  40151. },
  40152. distanceSqToPoint: (J = new Ci.Vector3,
  40153. function(e) {
  40154. var t = J.subVectors(e, this.origin).dot(this.direction);
  40155. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40156. J.distanceToSquared(e))
  40157. }
  40158. ),
  40159. distanceSqToSegment: (Z = new Ci.Vector3,
  40160. K = new Ci.Vector3,
  40161. Q = new Ci.Vector3,
  40162. function(e, t, i, n) {
  40163. Z.copy(e).add(t).multiplyScalar(.5),
  40164. K.copy(t).sub(e).normalize(),
  40165. Q.copy(this.origin).sub(Z);
  40166. 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);
  40167. if (0 < p)
  40168. if (o = c * h - u,
  40169. s = l * p,
  40170. 0 <= (r = c * u - h))
  40171. if (-s <= o)
  40172. if (o <= s) {
  40173. var f = 1 / p;
  40174. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40175. } else
  40176. o = l,
  40177. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40178. else
  40179. o = -l,
  40180. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40181. else
  40182. 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,
  40183. (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;
  40184. else
  40185. o = 0 < c ? -l : l,
  40186. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40187. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40188. n && n.copy(K).multiplyScalar(o).add(Z),
  40189. a
  40190. }
  40191. ),
  40192. intersectSphere: (X = new Ci.Vector3,
  40193. function(e, t) {
  40194. X.subVectors(e.center, this.origin);
  40195. var i = X.dot(this.direction)
  40196. , n = X.dot(X) - i * i
  40197. , r = e.radius * e.radius;
  40198. if (r < n)
  40199. return null;
  40200. var o = Math.sqrt(r - n)
  40201. , a = i - o
  40202. , s = i + o;
  40203. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40204. }
  40205. ),
  40206. intersectsSphere: function(e) {
  40207. return this.distanceToPoint(e.center) <= e.radius
  40208. },
  40209. distanceToPlane: function(e) {
  40210. var t = e.normal.dot(this.direction);
  40211. if (0 === t)
  40212. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40213. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40214. return 0 <= i ? i : null
  40215. },
  40216. intersectPlane: function(e, t) {
  40217. var i = this.distanceToPlane(e);
  40218. return null === i ? null : this.at(i, t)
  40219. },
  40220. intersectsPlane: function(e) {
  40221. var t = e.distanceToPoint(this.origin);
  40222. return 0 === t || e.normal.dot(this.direction) * t < 0
  40223. },
  40224. intersectBox: function(e, t) {
  40225. 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;
  40226. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40227. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40228. (e.min.x - u.x) * l),
  40229. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40230. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40231. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40232. (o < n || n != n) && (n = o),
  40233. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40234. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40235. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40236. (s < n || n != n) && (n = s),
  40237. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40238. },
  40239. intersectsBox: (q = new Ci.Vector3,
  40240. function(e) {
  40241. return null !== this.intersectBox(e, q)
  40242. }
  40243. ),
  40244. intersectTriangle: (G = new Ci.Vector3,
  40245. W = new Ci.Vector3,
  40246. j = new Ci.Vector3,
  40247. Y = new Ci.Vector3,
  40248. function(e, t, i, n, r) {
  40249. W.subVectors(t, e),
  40250. j.subVectors(i, e),
  40251. Y.crossVectors(W, j);
  40252. var o, a = this.direction.dot(Y);
  40253. if (0 < a) {
  40254. if (n)
  40255. return null;
  40256. o = 1
  40257. } else {
  40258. if (!(a < 0))
  40259. return null;
  40260. o = -1,
  40261. a = -a
  40262. }
  40263. G.subVectors(this.origin, e);
  40264. var s = o * this.direction.dot(j.crossVectors(G, j));
  40265. if (s < 0)
  40266. return null;
  40267. var l = o * this.direction.dot(W.cross(G));
  40268. if (l < 0)
  40269. return null;
  40270. if (a < s + l)
  40271. return null;
  40272. var c = -o * G.dot(Y);
  40273. return c < 0 ? null : this.at(c / a, r)
  40274. }
  40275. ),
  40276. applyMatrix4: function(e) {
  40277. return this.direction.add(this.origin).applyMatrix4(e),
  40278. this.origin.applyMatrix4(e),
  40279. this.direction.sub(this.origin),
  40280. this.direction.normalize(),
  40281. this
  40282. },
  40283. equals: function(e) {
  40284. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40285. }
  40286. },
  40287. Ci.Sphere = function(e, t) {
  40288. this.center = void 0 !== e ? e : new Ci.Vector3,
  40289. this.radius = void 0 !== t ? t : 0
  40290. }
  40291. ,
  40292. Ci.Sphere.prototype = {
  40293. constructor: Ci.Sphere,
  40294. set: function(e, t) {
  40295. return this.center.copy(e),
  40296. this.radius = t,
  40297. this
  40298. },
  40299. setFromPoints: (z = new Ci.Box3,
  40300. function(e, t) {
  40301. var i = this.center;
  40302. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40303. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40304. n = Math.max(n, i.distanceToSquared(e[r]));
  40305. return this.radius = Math.sqrt(n),
  40306. this
  40307. }
  40308. ),
  40309. clone: function() {
  40310. return (new this.constructor).copy(this)
  40311. },
  40312. copy: function(e) {
  40313. return this.center.copy(e.center),
  40314. this.radius = e.radius,
  40315. this
  40316. },
  40317. empty: function() {
  40318. return this.radius <= 0
  40319. },
  40320. containsPoint: function(e) {
  40321. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40322. },
  40323. distanceToPoint: function(e) {
  40324. return e.distanceTo(this.center) - this.radius
  40325. },
  40326. intersectsSphere: function(e) {
  40327. var t = this.radius + e.radius;
  40328. return e.center.distanceToSquared(this.center) <= t * t
  40329. },
  40330. intersectsBox: function(e) {
  40331. return e.intersectsSphere(this)
  40332. },
  40333. intersectsPlane: function(e) {
  40334. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40335. },
  40336. clampPoint: function(e, t) {
  40337. var i = this.center.distanceToSquared(e)
  40338. , n = t || new Ci.Vector3;
  40339. return n.copy(e),
  40340. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40341. n.multiplyScalar(this.radius).add(this.center)),
  40342. n
  40343. },
  40344. getBoundingBox: function(e) {
  40345. var t = e || new Ci.Box3;
  40346. return t.set(this.center, this.center),
  40347. t.expandByScalar(this.radius),
  40348. t
  40349. },
  40350. applyMatrix4: function(e) {
  40351. return this.center.applyMatrix4(e),
  40352. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40353. this
  40354. },
  40355. translate: function(e) {
  40356. return this.center.add(e),
  40357. this
  40358. },
  40359. equals: function(e) {
  40360. return e.center.equals(this.center) && e.radius === this.radius
  40361. }
  40362. },
  40363. Ci.Frustum = function(e, t, i, n, r, o) {
  40364. 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]
  40365. }
  40366. ,
  40367. Ci.Frustum.prototype = {
  40368. constructor: Ci.Frustum,
  40369. set: function(e, t, i, n, r, o) {
  40370. var a = this.planes;
  40371. return a[0].copy(e),
  40372. a[1].copy(t),
  40373. a[2].copy(i),
  40374. a[3].copy(n),
  40375. a[4].copy(r),
  40376. a[5].copy(o),
  40377. this
  40378. },
  40379. clone: function() {
  40380. return (new this.constructor).copy(this)
  40381. },
  40382. copy: function(e) {
  40383. for (var t = this.planes, i = 0; i < 6; i++)
  40384. t[i].copy(e.planes[i]);
  40385. return this
  40386. },
  40387. setFromMatrix: function(e) {
  40388. var t = this.planes
  40389. , i = e.elements
  40390. , n = i[0]
  40391. , r = i[1]
  40392. , o = i[2]
  40393. , a = i[3]
  40394. , s = i[4]
  40395. , l = i[5]
  40396. , c = i[6]
  40397. , h = i[7]
  40398. , u = i[8]
  40399. , d = i[9]
  40400. , p = i[10]
  40401. , f = i[11]
  40402. , g = i[12]
  40403. , m = i[13]
  40404. , v = i[14]
  40405. , y = i[15];
  40406. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40407. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40408. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40409. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40410. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40411. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40412. this
  40413. },
  40414. intersectsObject: (H = new Ci.Sphere,
  40415. function(e) {
  40416. var t = e.geometry;
  40417. return null === t.boundingSphere && t.computeBoundingSphere(),
  40418. H.copy(t.boundingSphere),
  40419. H.applyMatrix4(e.matrixWorld),
  40420. this.intersectsSphere(H)
  40421. }
  40422. ),
  40423. intersectsSphere: function(e) {
  40424. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40425. if (t[r].distanceToPoint(i) < n)
  40426. return !1
  40427. }
  40428. return !0
  40429. },
  40430. intersectsBox: (k = new Ci.Vector3,
  40431. U = new Ci.Vector3,
  40432. function(e) {
  40433. for (var t = this.planes, i = 0; i < 6; i++) {
  40434. var n = t[i];
  40435. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40436. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40437. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40438. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40439. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40440. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40441. var r = n.distanceToPoint(k)
  40442. , o = n.distanceToPoint(U);
  40443. if (r < 0 && o < 0)
  40444. return !1
  40445. }
  40446. return !0
  40447. }
  40448. ),
  40449. containsPoint: function(e) {
  40450. for (var t = this.planes, i = 0; i < 6; i++)
  40451. if (t[i].distanceToPoint(e) < 0)
  40452. return !1;
  40453. return !0
  40454. }
  40455. },
  40456. Ci.Plane = function(e, t) {
  40457. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40458. this.constant = void 0 !== t ? t : 0
  40459. }
  40460. ,
  40461. Ci.Plane.prototype = {
  40462. constructor: Ci.Plane,
  40463. set: function(e, t) {
  40464. return this.normal.copy(e),
  40465. this.constant = t,
  40466. this
  40467. },
  40468. setComponents: function(e, t, i, n) {
  40469. return this.normal.set(e, t, i),
  40470. this.constant = n,
  40471. this
  40472. },
  40473. setFromNormalAndCoplanarPoint: function(e, t) {
  40474. return this.normal.copy(e),
  40475. this.constant = -t.dot(this.normal),
  40476. this
  40477. },
  40478. setFromCoplanarPoints: (B = new Ci.Vector3,
  40479. V = new Ci.Vector3,
  40480. function(e, t, i) {
  40481. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40482. return this.setFromNormalAndCoplanarPoint(n, e),
  40483. this
  40484. }
  40485. ),
  40486. clone: function() {
  40487. return (new this.constructor).copy(this)
  40488. },
  40489. copy: function(e) {
  40490. return this.normal.copy(e.normal),
  40491. this.constant = e.constant,
  40492. this
  40493. },
  40494. normalize: function() {
  40495. var e = 1 / this.normal.length();
  40496. return this.normal.multiplyScalar(e),
  40497. this.constant *= e,
  40498. this
  40499. },
  40500. negate: function() {
  40501. return this.constant *= -1,
  40502. this.normal.negate(),
  40503. this
  40504. },
  40505. distanceToPoint: function(e) {
  40506. return this.normal.dot(e) + this.constant
  40507. },
  40508. distanceToSphere: function(e) {
  40509. return this.distanceToPoint(e.center) - e.radius
  40510. },
  40511. projectPoint: function(e, t) {
  40512. return this.orthoPoint(e, t).sub(e).negate()
  40513. },
  40514. orthoPoint: function(e, t) {
  40515. var i = this.distanceToPoint(e);
  40516. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40517. },
  40518. intersectLine: (F = new Ci.Vector3,
  40519. function(e, t) {
  40520. var i = t || new Ci.Vector3
  40521. , n = e.delta(F)
  40522. , r = this.normal.dot(n);
  40523. if (0 !== r) {
  40524. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40525. if (!(o < 0 || 1 < o))
  40526. return i.copy(n).multiplyScalar(o).add(e.start)
  40527. } else if (0 === this.distanceToPoint(e.start))
  40528. return i.copy(e.start)
  40529. }
  40530. ),
  40531. intersectsLine: function(e) {
  40532. var t = this.distanceToPoint(e.start)
  40533. , i = this.distanceToPoint(e.end);
  40534. return t < 0 && 0 < i || i < 0 && 0 < t
  40535. },
  40536. intersectsBox: function(e) {
  40537. return e.intersectsPlane(this)
  40538. },
  40539. intersectsSphere: function(e) {
  40540. return e.intersectsPlane(this)
  40541. },
  40542. coplanarPoint: function(e) {
  40543. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40544. },
  40545. applyMatrix4: (L = new Ci.Vector3,
  40546. D = new Ci.Vector3,
  40547. N = new Ci.Matrix3,
  40548. function(e, t) {
  40549. var i = t || N.getNormalMatrix(e)
  40550. , n = L.copy(this.normal).applyMatrix3(i)
  40551. , r = this.coplanarPoint(D);
  40552. return r.applyMatrix4(e),
  40553. this.setFromNormalAndCoplanarPoint(n, r),
  40554. this
  40555. }
  40556. ),
  40557. translate: function(e) {
  40558. return this.constant = this.constant - e.dot(this.normal),
  40559. this
  40560. },
  40561. equals: function(e) {
  40562. return e.normal.equals(this.normal) && e.constant === this.constant
  40563. }
  40564. },
  40565. Ci.Spherical = function(e, t, i) {
  40566. return this.radius = void 0 !== e ? e : 1,
  40567. this.phi = void 0 !== t ? t : 0,
  40568. this.theta = void 0 !== i ? i : 0,
  40569. this
  40570. }
  40571. ,
  40572. Ci.Spherical.prototype = {
  40573. constructor: Ci.Spherical,
  40574. set: function(e, t, i) {
  40575. this.radius = e,
  40576. this.phi = t,
  40577. this.theta = i
  40578. },
  40579. clone: function() {
  40580. return (new this.constructor).copy(this)
  40581. },
  40582. copy: function(e) {
  40583. return this.radius.copy(e.radius),
  40584. this.phi.copy(e.phi),
  40585. this.theta.copy(e.theta),
  40586. this
  40587. },
  40588. makeSafe: function() {
  40589. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40590. },
  40591. setFromVector3: function(e) {
  40592. return this.radius = e.length(),
  40593. 0 === this.radius ? (this.theta = 0,
  40594. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40595. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40596. this
  40597. }
  40598. },
  40599. Ci.Math = {
  40600. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40601. P = new Array(36),
  40602. O = 0,
  40603. function() {
  40604. for (var e = 0; e < 36; e++)
  40605. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40606. M = 15 & O,
  40607. O >>= 4,
  40608. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40609. return P.join("")
  40610. }
  40611. ),
  40612. clamp: function(e, t, i) {
  40613. return Math.max(t, Math.min(i, e))
  40614. },
  40615. euclideanModulo: function(e, t) {
  40616. return (e % t + t) % t
  40617. },
  40618. mapLinear: function(e, t, i, n, r) {
  40619. return n + (e - t) * (r - n) / (i - t)
  40620. },
  40621. smoothstep: function(e, t, i) {
  40622. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40623. },
  40624. smootherstep: function(e, t, i) {
  40625. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40626. },
  40627. random16: function() {
  40628. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40629. Math.random()
  40630. },
  40631. randInt: function(e, t) {
  40632. return e + Math.floor(Math.random() * (t - e + 1))
  40633. },
  40634. randFloat: function(e, t) {
  40635. return e + Math.random() * (t - e)
  40636. },
  40637. randFloatSpread: function(e) {
  40638. return e * (.5 - Math.random())
  40639. },
  40640. degToRad: (S = Math.PI / 180,
  40641. function(e) {
  40642. return e * S
  40643. }
  40644. ),
  40645. radToDeg: (x = 180 / Math.PI,
  40646. function(e) {
  40647. return e * x
  40648. }
  40649. ),
  40650. isPowerOfTwo: function(e) {
  40651. return 0 == (e & e - 1) && 0 !== e
  40652. },
  40653. nearestPowerOfTwo: function(e) {
  40654. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40655. },
  40656. nextPowerOfTwo: function(e) {
  40657. return e--,
  40658. e |= e >> 1,
  40659. e |= e >> 2,
  40660. e |= e >> 4,
  40661. e |= e >> 8,
  40662. e |= e >> 16,
  40663. ++e
  40664. }
  40665. },
  40666. Ci.Spline = function(e) {
  40667. function t(e, t, i, n, r, o, a) {
  40668. var s = .5 * (i - e)
  40669. , l = .5 * (n - t);
  40670. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40671. }
  40672. this.points = e;
  40673. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40674. x: 0,
  40675. y: 0,
  40676. z: 0
  40677. };
  40678. this.initFromArray = function(e) {
  40679. this.points = [];
  40680. for (var t = 0; t < e.length; t++)
  40681. this.points[t] = {
  40682. x: e[t][0],
  40683. y: e[t][1],
  40684. z: e[t][2]
  40685. }
  40686. }
  40687. ,
  40688. this.getPoint = function(e) {
  40689. return i = (this.points.length - 1) * e,
  40690. n = Math.floor(i),
  40691. r = i - n,
  40692. u[0] = 0 === n ? n : n - 1,
  40693. u[1] = n,
  40694. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40695. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40696. s = this.points[u[0]],
  40697. l = this.points[u[1]],
  40698. c = this.points[u[2]],
  40699. h = this.points[u[3]],
  40700. a = r * (o = r * r),
  40701. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40702. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40703. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40704. d
  40705. }
  40706. ,
  40707. this.getControlPointsArray = function() {
  40708. var e, t, i = this.points.length, n = [];
  40709. for (e = 0; e < i; e++)
  40710. t = this.points[e],
  40711. n[e] = [t.x, t.y, t.z];
  40712. return n
  40713. }
  40714. ,
  40715. this.getLength = function(e) {
  40716. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40717. for (h[0] = 0,
  40718. e = e || 100,
  40719. n = this.points.length * e,
  40720. l.copy(this.points[0]),
  40721. t = 1; t < n; t++)
  40722. i = t / n,
  40723. r = this.getPoint(i),
  40724. c.copy(r),
  40725. u += c.distanceTo(l),
  40726. l.copy(r),
  40727. o = (this.points.length - 1) * i,
  40728. (a = Math.floor(o)) !== s && (h[a] = u,
  40729. s = a);
  40730. return h[h.length] = u,
  40731. {
  40732. chunks: h,
  40733. total: u
  40734. }
  40735. }
  40736. ,
  40737. this.reparametrizeByArcLength = function(e) {
  40738. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40739. for (c.push(h.copy(this.points[0]).clone()),
  40740. t = 1; t < this.points.length; t++) {
  40741. for (a = u.chunks[t] - u.chunks[t - 1],
  40742. s = Math.ceil(e * a / u.total),
  40743. r = (t - 1) / (this.points.length - 1),
  40744. o = t / (this.points.length - 1),
  40745. i = 1; i < s - 1; i++)
  40746. n = r + i * (1 / s) * (o - r),
  40747. l = this.getPoint(n),
  40748. c.push(h.copy(l).clone());
  40749. c.push(h.copy(this.points[t]).clone())
  40750. }
  40751. this.points = c
  40752. }
  40753. }
  40754. ,
  40755. Ci.Triangle = function(e, t, i) {
  40756. this.a = void 0 !== e ? e : new Ci.Vector3,
  40757. this.b = void 0 !== t ? t : new Ci.Vector3,
  40758. this.c = void 0 !== i ? i : new Ci.Vector3
  40759. }
  40760. ,
  40761. Ci.Triangle.normal = (T = new Ci.Vector3,
  40762. function(e, t, i, n) {
  40763. var r = n || new Ci.Vector3;
  40764. r.subVectors(i, t),
  40765. T.subVectors(e, t),
  40766. r.cross(T);
  40767. var o = r.lengthSq();
  40768. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40769. }
  40770. ),
  40771. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40772. b = new Ci.Vector3,
  40773. w = new Ci.Vector3,
  40774. function(e, t, i, n, r) {
  40775. _.subVectors(n, t),
  40776. b.subVectors(i, t),
  40777. w.subVectors(e, t);
  40778. var o = _.dot(_)
  40779. , a = _.dot(b)
  40780. , s = _.dot(w)
  40781. , l = b.dot(b)
  40782. , c = b.dot(w)
  40783. , h = o * l - a * a
  40784. , u = r || new Ci.Vector3;
  40785. if (0 == h)
  40786. return u.set(-2, -1, -1);
  40787. var d = 1 / h
  40788. , p = (l * s - a * c) * d
  40789. , f = (o * c - a * s) * d;
  40790. return u.set(1 - p - f, f, p)
  40791. }
  40792. ),
  40793. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40794. function(e, t, i, n) {
  40795. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40796. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40797. }
  40798. ),
  40799. Ci.Triangle.prototype = {
  40800. constructor: Ci.Triangle,
  40801. set: function(e, t, i) {
  40802. return this.a.copy(e),
  40803. this.b.copy(t),
  40804. this.c.copy(i),
  40805. this
  40806. },
  40807. setFromPointsAndIndices: function(e, t, i, n) {
  40808. return this.a.copy(e[t]),
  40809. this.b.copy(e[i]),
  40810. this.c.copy(e[n]),
  40811. this
  40812. },
  40813. clone: function() {
  40814. return (new this.constructor).copy(this)
  40815. },
  40816. copy: function(e) {
  40817. return this.a.copy(e.a),
  40818. this.b.copy(e.b),
  40819. this.c.copy(e.c),
  40820. this
  40821. },
  40822. area: (C = new Ci.Vector3,
  40823. I = new Ci.Vector3,
  40824. function() {
  40825. return C.subVectors(this.c, this.b),
  40826. I.subVectors(this.a, this.b),
  40827. .5 * C.cross(I).length()
  40828. }
  40829. ),
  40830. midpoint: function(e) {
  40831. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40832. },
  40833. normal: function(e) {
  40834. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40835. },
  40836. plane: function(e) {
  40837. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40838. },
  40839. barycoordFromPoint: function(e, t) {
  40840. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40841. },
  40842. containsPoint: function(e) {
  40843. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40844. },
  40845. equals: function(e) {
  40846. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40847. }
  40848. },
  40849. Ci.Interpolant = function(e, t, i, n) {
  40850. this.parameterPositions = e,
  40851. this._cachedIndex = 0,
  40852. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40853. this.sampleValues = t,
  40854. this.valueSize = i
  40855. }
  40856. ,
  40857. Ci.Interpolant.prototype = {
  40858. constructor: Ci.Interpolant,
  40859. evaluate: function(e) {
  40860. var t = this.parameterPositions
  40861. , i = this._cachedIndex
  40862. , n = t[i]
  40863. , r = t[i - 1];
  40864. e: {
  40865. t: {
  40866. var o;
  40867. i: {
  40868. n: if (!(e < n)) {
  40869. for (var a = i + 2; ; ) {
  40870. if (void 0 === n) {
  40871. if (e < r)
  40872. break n;
  40873. return i = t.length,
  40874. this._cachedIndex = i,
  40875. this.afterEnd_(i - 1, e, r)
  40876. }
  40877. if (i === a)
  40878. break;
  40879. if (r = n,
  40880. e < (n = t[++i]))
  40881. break t
  40882. }
  40883. o = t.length;
  40884. break i
  40885. }
  40886. if (r <= e)
  40887. break e;
  40888. var s = t[1];
  40889. e < s && (i = 2,
  40890. r = s);
  40891. for (a = i - 2; ; ) {
  40892. if (void 0 === r)
  40893. return this._cachedIndex = 0,
  40894. this.beforeStart_(0, e, n);
  40895. if (i === a)
  40896. break;
  40897. if (n = r,
  40898. (r = t[--i - 1]) <= e)
  40899. break t
  40900. }
  40901. o = i,
  40902. i = 0
  40903. }
  40904. for (; i < o; ) {
  40905. var l = i + o >>> 1;
  40906. e < t[l] ? o = l : i = 1 + l
  40907. }
  40908. if (n = t[i],
  40909. void 0 === (r = t[i - 1]))
  40910. return this._cachedIndex = 0,
  40911. this.beforeStart_(0, e, n);
  40912. if (void 0 === n)
  40913. return i = t.length,
  40914. this._cachedIndex = i,
  40915. this.afterEnd_(i - 1, r, e)
  40916. }
  40917. this._cachedIndex = i,
  40918. this.intervalChanged_(i, r, n)
  40919. }
  40920. return this.interpolate_(i, r, e, n)
  40921. },
  40922. settings: null,
  40923. DefaultSettings_: {},
  40924. getSettings_: function() {
  40925. return this.settings || this.DefaultSettings_
  40926. },
  40927. copySampleValue_: function(e) {
  40928. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40929. t[o] = i[r + o];
  40930. return t
  40931. },
  40932. interpolate_: function(e, t, i, n) {
  40933. throw new Error("call to abstract method")
  40934. },
  40935. intervalChanged_: function(e, t, i) {}
  40936. },
  40937. Object.assign(Ci.Interpolant.prototype, {
  40938. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40939. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40940. }),
  40941. Ci.CubicInterpolant = function(e, t, i, n) {
  40942. Ci.Interpolant.call(this, e, t, i, n),
  40943. this._weightPrev = -0,
  40944. this._offsetPrev = -0,
  40945. this._weightNext = -0,
  40946. this._offsetNext = -0
  40947. }
  40948. ,
  40949. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40950. constructor: Ci.CubicInterpolant,
  40951. DefaultSettings_: {
  40952. endingStart: Ci.ZeroCurvatureEnding,
  40953. endingEnd: Ci.ZeroCurvatureEnding
  40954. },
  40955. intervalChanged_: function(e, t, i) {
  40956. var n = this.parameterPositions
  40957. , r = e - 2
  40958. , o = e + 1
  40959. , a = n[r]
  40960. , s = n[o];
  40961. if (void 0 === a)
  40962. switch (this.getSettings_().endingStart) {
  40963. case Ci.ZeroSlopeEnding:
  40964. r = e,
  40965. a = 2 * t - i;
  40966. break;
  40967. case Ci.WrapAroundEnding:
  40968. a = t + n[r = n.length - 2] - n[r + 1];
  40969. break;
  40970. default:
  40971. r = e,
  40972. a = i
  40973. }
  40974. if (void 0 === s)
  40975. switch (this.getSettings_().endingEnd) {
  40976. case Ci.ZeroSlopeEnding:
  40977. o = e,
  40978. s = 2 * i - t;
  40979. break;
  40980. case Ci.WrapAroundEnding:
  40981. s = i + n[o = 1] - n[0];
  40982. break;
  40983. default:
  40984. o = e - 1,
  40985. s = t
  40986. }
  40987. var l = .5 * (i - t)
  40988. , c = this.valueSize;
  40989. this._weightPrev = l / (t - a),
  40990. this._weightNext = l / (s - i),
  40991. this._offsetPrev = r * c,
  40992. this._offsetNext = o * c
  40993. },
  40994. interpolate_: function(e, t, i, n) {
  40995. 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)
  40996. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40997. return r
  40998. }
  40999. }),
  41000. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41001. Ci.Interpolant.call(this, e, t, i, n)
  41002. }
  41003. ,
  41004. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41005. constructor: Ci.DiscreteInterpolant,
  41006. interpolate_: function(e, t, i, n) {
  41007. return this.copySampleValue_(e - 1)
  41008. }
  41009. }),
  41010. Ci.LinearInterpolant = function(e, t, i, n) {
  41011. Ci.Interpolant.call(this, e, t, i, n)
  41012. }
  41013. ,
  41014. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41015. constructor: Ci.LinearInterpolant,
  41016. interpolate_: function(e, t, i, n) {
  41017. 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)
  41018. r[u] = o[l + u] * h + o[s + u] * c;
  41019. return r
  41020. }
  41021. }),
  41022. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41023. Ci.Interpolant.call(this, e, t, i, n)
  41024. }
  41025. ,
  41026. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41027. constructor: Ci.QuaternionLinearInterpolant,
  41028. interpolate_: function(e, t, i, n) {
  41029. 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)
  41030. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41031. return r
  41032. }
  41033. }),
  41034. Ci.Clock = function(e) {
  41035. this.autoStart = void 0 === e || e,
  41036. this.startTime = 0,
  41037. this.oldTime = 0,
  41038. this.elapsedTime = 0,
  41039. this.running = !1
  41040. }
  41041. ,
  41042. Ci.Clock.prototype = {
  41043. constructor: Ci.Clock,
  41044. start: function() {
  41045. this.startTime = performance.now(),
  41046. this.oldTime = this.startTime,
  41047. this.running = !0
  41048. },
  41049. stop: function() {
  41050. this.getElapsedTime(),
  41051. this.running = !1
  41052. },
  41053. getElapsedTime: function() {
  41054. return this.getDelta(),
  41055. this.elapsedTime
  41056. },
  41057. getDelta: function() {
  41058. var e = 0;
  41059. if (this.autoStart && !this.running && this.start(),
  41060. this.running) {
  41061. var t = performance.now();
  41062. e = .001 * (t - this.oldTime),
  41063. this.oldTime = t,
  41064. this.elapsedTime += e
  41065. }
  41066. return e
  41067. }
  41068. },
  41069. Ci.EventDispatcher = function() {}
  41070. ,
  41071. Ci.EventDispatcher.prototype = {
  41072. constructor: Ci.EventDispatcher,
  41073. apply: function(e) {
  41074. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41075. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41076. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41077. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41078. },
  41079. addEventListener: function(e, t) {
  41080. void 0 === this._listeners && (this._listeners = {});
  41081. var i = this._listeners;
  41082. void 0 === i[e] && (i[e] = []),
  41083. -1 === i[e].indexOf(t) && i[e].push(t)
  41084. },
  41085. hasEventListener: function(e, t) {
  41086. if (void 0 === this._listeners)
  41087. return !1;
  41088. var i = this._listeners;
  41089. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41090. },
  41091. removeEventListener: function(e, t) {
  41092. if (void 0 !== this._listeners) {
  41093. var i = this._listeners[e];
  41094. if (void 0 !== i) {
  41095. var n = i.indexOf(t);
  41096. -1 !== n && i.splice(n, 1)
  41097. }
  41098. }
  41099. },
  41100. dispatchEvent: function(e) {
  41101. if (void 0 !== this._listeners) {
  41102. var t = this._listeners[e.type];
  41103. if (void 0 !== t) {
  41104. e.target = this;
  41105. for (var i = [], n = t.length, r = 0; r < n; r++)
  41106. i[r] = t[r];
  41107. for (r = 0; r < n; r++)
  41108. i[r].call(this, e)
  41109. }
  41110. }
  41111. }
  41112. },
  41113. Ci.Layers = function() {
  41114. this.mask = 1
  41115. }
  41116. ,
  41117. Ci.Layers.prototype = {
  41118. constructor: Ci.Layers,
  41119. set: function(e) {
  41120. this.mask = 1 << e
  41121. },
  41122. enable: function(e) {
  41123. this.mask |= 1 << e
  41124. },
  41125. toggle: function(e) {
  41126. this.mask ^= 1 << e
  41127. },
  41128. disable: function(e) {
  41129. this.mask &= ~(1 << e)
  41130. },
  41131. test: function(e) {
  41132. return 0 != (this.mask & e.mask)
  41133. }
  41134. },
  41135. (A = Ci).Raycaster = function(e, t, i, n) {
  41136. this.ray = new A.Ray(e,t),
  41137. this.near = i || 0,
  41138. this.far = n || 1 / 0,
  41139. this.params = {
  41140. Mesh: {},
  41141. Line: {},
  41142. LOD: {},
  41143. Points: {
  41144. threshold: 1
  41145. },
  41146. Sprite: {}
  41147. },
  41148. Object.defineProperties(this.params, {
  41149. PointCloud: {
  41150. get: function() {
  41151. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41152. this.Points
  41153. }
  41154. }
  41155. })
  41156. }
  41157. ,
  41158. A.Raycaster.prototype = {
  41159. constructor: A.Raycaster,
  41160. linePrecision: 1,
  41161. set: function(e, t) {
  41162. this.ray.set(e, t)
  41163. },
  41164. setFromCamera: function(e, t) {
  41165. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41166. 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),
  41167. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41168. },
  41169. intersectObject: function(e, t) {
  41170. var i = [];
  41171. return Ei(e, this, i, t),
  41172. i.sort(Ii),
  41173. i
  41174. },
  41175. intersectObjects: function(e, t) {
  41176. var i = [];
  41177. if (!1 === Array.isArray(e))
  41178. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41179. i;
  41180. for (var n = 0, r = e.length; n < r; n++)
  41181. Ei(e[n], this, i, t);
  41182. return i.sort(Ii),
  41183. i
  41184. }
  41185. },
  41186. Ci.Object3D = function() {
  41187. Object.defineProperty(this, "id", {
  41188. value: Ci.Object3DIdCount++
  41189. }),
  41190. this.uuid = Ci.Math.generateUUID(),
  41191. this.name = "",
  41192. this.type = "Object3D",
  41193. this.parent = null,
  41194. this.children = [],
  41195. this.up = Ci.Object3D.DefaultUp.clone();
  41196. var e = new Ci.Vector3
  41197. , t = new Ci.Euler
  41198. , i = new Ci.Quaternion
  41199. , n = new Ci.Vector3(1,1,1);
  41200. t.onChange(function() {
  41201. i.setFromEuler(t, !1)
  41202. }),
  41203. i.onChange(function() {
  41204. t.setFromQuaternion(i, void 0, !1)
  41205. }),
  41206. Object.defineProperties(this, {
  41207. position: {
  41208. enumerable: !0,
  41209. value: e
  41210. },
  41211. rotation: {
  41212. enumerable: !0,
  41213. value: t
  41214. },
  41215. quaternion: {
  41216. enumerable: !0,
  41217. value: i
  41218. },
  41219. scale: {
  41220. enumerable: !0,
  41221. value: n
  41222. },
  41223. modelViewMatrix: {
  41224. value: new Ci.Matrix4
  41225. },
  41226. normalMatrix: {
  41227. value: new Ci.Matrix3
  41228. }
  41229. }),
  41230. this.rotationAutoUpdate = !0,
  41231. this.matrix = new Ci.Matrix4,
  41232. this.matrixWorld = new Ci.Matrix4,
  41233. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41234. this.matrixWorldNeedsUpdate = !1,
  41235. this.layers = new Ci.Layers,
  41236. this.visible = !0,
  41237. this.castShadow = !1,
  41238. this.receiveShadow = !1,
  41239. this.frustumCulled = !0,
  41240. this.renderOrder = 0,
  41241. this.userData = {}
  41242. }
  41243. ,
  41244. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41245. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41246. Ci.Object3D.prototype = {
  41247. constructor: Ci.Object3D,
  41248. applyMatrix: function(e) {
  41249. this.matrix.multiplyMatrices(e, this.matrix),
  41250. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41251. },
  41252. setRotationFromAxisAngle: function(e, t) {
  41253. this.quaternion.setFromAxisAngle(e, t)
  41254. },
  41255. setRotationFromEuler: function(e) {
  41256. this.quaternion.setFromEuler(e, !0)
  41257. },
  41258. setRotationFromMatrix: function(e) {
  41259. this.quaternion.setFromRotationMatrix(e)
  41260. },
  41261. setRotationFromQuaternion: function(e) {
  41262. this.quaternion.copy(e)
  41263. },
  41264. rotateOnAxis: (y = new Ci.Quaternion,
  41265. function(e, t) {
  41266. return y.setFromAxisAngle(e, t),
  41267. this.quaternion.multiply(y),
  41268. this
  41269. }
  41270. ),
  41271. rotateX: (v = new Ci.Vector3(1,0,0),
  41272. function(e) {
  41273. return this.rotateOnAxis(v, e)
  41274. }
  41275. ),
  41276. rotateY: (m = new Ci.Vector3(0,1,0),
  41277. function(e) {
  41278. return this.rotateOnAxis(m, e)
  41279. }
  41280. ),
  41281. rotateZ: (g = new Ci.Vector3(0,0,1),
  41282. function(e) {
  41283. return this.rotateOnAxis(g, e)
  41284. }
  41285. ),
  41286. translateOnAxis: (f = new Ci.Vector3,
  41287. function(e, t) {
  41288. return f.copy(e).applyQuaternion(this.quaternion),
  41289. this.position.add(f.multiplyScalar(t)),
  41290. this
  41291. }
  41292. ),
  41293. translateX: (p = new Ci.Vector3(1,0,0),
  41294. function(e) {
  41295. return this.translateOnAxis(p, e)
  41296. }
  41297. ),
  41298. translateY: (d = new Ci.Vector3(0,1,0),
  41299. function(e) {
  41300. return this.translateOnAxis(d, e)
  41301. }
  41302. ),
  41303. translateZ: (u = new Ci.Vector3(0,0,1),
  41304. function(e) {
  41305. return this.translateOnAxis(u, e)
  41306. }
  41307. ),
  41308. localToWorld: function(e) {
  41309. return e.applyMatrix4(this.matrixWorld)
  41310. },
  41311. worldToLocal: (h = new Ci.Matrix4,
  41312. function(e) {
  41313. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41314. }
  41315. ),
  41316. lookAt: (c = new Ci.Matrix4,
  41317. function(e) {
  41318. c.lookAt(e, this.position, this.up),
  41319. this.quaternion.setFromRotationMatrix(c)
  41320. }
  41321. ),
  41322. add: function(e) {
  41323. if (1 < arguments.length) {
  41324. for (var t = 0; t < arguments.length; t++)
  41325. this.add(arguments[t]);
  41326. return this
  41327. }
  41328. 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),
  41329. e.parent = this,
  41330. e.dispatchEvent({
  41331. type: "added"
  41332. }),
  41333. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41334. this
  41335. },
  41336. remove: function(e) {
  41337. if (1 < arguments.length)
  41338. for (var t = 0; t < arguments.length; t++)
  41339. this.remove(arguments[t]);
  41340. var i = this.children.indexOf(e);
  41341. -1 !== i && (e.parent = null,
  41342. e.dispatchEvent({
  41343. type: "removed"
  41344. }),
  41345. this.children.splice(i, 1))
  41346. },
  41347. getObjectById: function(e) {
  41348. return this.getObjectByProperty("id", e)
  41349. },
  41350. getObjectByName: function(e) {
  41351. return this.getObjectByProperty("name", e)
  41352. },
  41353. getObjectByProperty: function(e, t) {
  41354. if (this[e] === t)
  41355. return this;
  41356. for (var i = 0, n = this.children.length; i < n; i++) {
  41357. var r = this.children[i].getObjectByProperty(e, t);
  41358. if (void 0 !== r)
  41359. return r
  41360. }
  41361. },
  41362. getWorldPosition: function(e) {
  41363. var t = e || new Ci.Vector3;
  41364. return this.updateMatrixWorld(!0),
  41365. t.setFromMatrixPosition(this.matrixWorld)
  41366. },
  41367. getWorldQuaternion: (s = new Ci.Vector3,
  41368. l = new Ci.Vector3,
  41369. function(e) {
  41370. var t = e || new Ci.Quaternion;
  41371. return this.updateMatrixWorld(!0),
  41372. this.matrixWorld.decompose(s, t, l),
  41373. t
  41374. }
  41375. ),
  41376. getWorldRotation: (a = new Ci.Quaternion,
  41377. function(e) {
  41378. var t = e || new Ci.Euler;
  41379. return this.getWorldQuaternion(a),
  41380. t.setFromQuaternion(a, this.rotation.order, !1)
  41381. }
  41382. ),
  41383. getWorldScale: (r = new Ci.Vector3,
  41384. o = new Ci.Quaternion,
  41385. function(e) {
  41386. var t = e || new Ci.Vector3;
  41387. return this.updateMatrixWorld(!0),
  41388. this.matrixWorld.decompose(r, o, t),
  41389. t
  41390. }
  41391. ),
  41392. getWorldDirection: (n = new Ci.Quaternion,
  41393. function(e) {
  41394. var t = e || new Ci.Vector3;
  41395. return this.getWorldQuaternion(n),
  41396. t.set(0, 0, 1).applyQuaternion(n)
  41397. }
  41398. ),
  41399. raycast: function() {},
  41400. traverse: function(e) {
  41401. e(this);
  41402. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41403. t[i].traverse(e)
  41404. },
  41405. traverseVisible: function(e) {
  41406. if (!1 !== this.visible) {
  41407. e(this);
  41408. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41409. t[i].traverseVisible(e)
  41410. }
  41411. },
  41412. traverseAncestors: function(e) {
  41413. var t = this.parent;
  41414. null !== t && (e(t),
  41415. t.traverseAncestors(e))
  41416. },
  41417. updateMatrix: function() {
  41418. this.matrix.compose(this.position, this.quaternion, this.scale),
  41419. this.matrixWorldNeedsUpdate = !0
  41420. },
  41421. updateMatrixWorld: function(e) {
  41422. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41423. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41424. e = !(this.matrixWorldNeedsUpdate = !1));
  41425. for (var t = 0, i = this.children.length; t < i; t++)
  41426. this.children[t].updateMatrixWorld(e)
  41427. },
  41428. toJSON: function(e) {
  41429. function t(e) {
  41430. var t = [];
  41431. for (var i in e) {
  41432. var n = e[i];
  41433. delete n.metadata,
  41434. t.push(n)
  41435. }
  41436. return t
  41437. }
  41438. var i = void 0 === e
  41439. , n = {};
  41440. i && (e = {
  41441. geometries: {},
  41442. materials: {},
  41443. textures: {},
  41444. images: {}
  41445. },
  41446. n.metadata = {
  41447. version: 4.4,
  41448. type: "Object",
  41449. generator: "Object3D.toJSON"
  41450. });
  41451. var r = {};
  41452. if (r.uuid = this.uuid,
  41453. r.type = this.type,
  41454. "" !== this.name && (r.name = this.name),
  41455. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41456. !0 === this.castShadow && (r.castShadow = !0),
  41457. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41458. !1 === this.visible && (r.visible = !1),
  41459. r.matrix = this.matrix.toArray(),
  41460. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41461. r.geometry = this.geometry.uuid),
  41462. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41463. r.material = this.material.uuid),
  41464. 0 < this.children.length) {
  41465. r.children = [];
  41466. for (var o = 0; o < this.children.length; o++)
  41467. r.children.push(this.children[o].toJSON(e).object)
  41468. }
  41469. if (i) {
  41470. var a = t(e.geometries)
  41471. , s = t(e.materials)
  41472. , l = t(e.textures)
  41473. , c = t(e.images);
  41474. 0 < a.length && (n.geometries = a),
  41475. 0 < s.length && (n.materials = s),
  41476. 0 < l.length && (n.textures = l),
  41477. 0 < c.length && (n.images = c)
  41478. }
  41479. return n.object = r,
  41480. n
  41481. },
  41482. clone: function(e) {
  41483. return (new this.constructor).copy(this, e)
  41484. },
  41485. copy: function(e, t) {
  41486. if (void 0 === t && (t = !0),
  41487. this.name = e.name,
  41488. this.up.copy(e.up),
  41489. this.position.copy(e.position),
  41490. this.quaternion.copy(e.quaternion),
  41491. this.scale.copy(e.scale),
  41492. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41493. this.matrix.copy(e.matrix),
  41494. this.matrixWorld.copy(e.matrixWorld),
  41495. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41496. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41497. this.visible = e.visible,
  41498. this.castShadow = e.castShadow,
  41499. this.receiveShadow = e.receiveShadow,
  41500. this.frustumCulled = e.frustumCulled,
  41501. this.renderOrder = e.renderOrder,
  41502. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41503. !0 === t)
  41504. for (var i = 0; i < e.children.length; i++) {
  41505. var n = e.children[i];
  41506. this.add(n.clone())
  41507. }
  41508. return this
  41509. }
  41510. },
  41511. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41512. Ci.Object3DIdCount = 0,
  41513. Ci.Face3 = function(e, t, i, n, r, o) {
  41514. this.a = e,
  41515. this.b = t,
  41516. this.c = i,
  41517. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41518. this.vertexNormals = Array.isArray(n) ? n : [],
  41519. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41520. this.vertexColors = Array.isArray(r) ? r : [],
  41521. this.materialIndex = void 0 !== o ? o : 0
  41522. }
  41523. ,
  41524. Ci.Face3.prototype = {
  41525. constructor: Ci.Face3,
  41526. clone: function() {
  41527. return (new this.constructor).copy(this)
  41528. },
  41529. copy: function(e) {
  41530. this.a = e.a,
  41531. this.b = e.b,
  41532. this.c = e.c,
  41533. this.normal.copy(e.normal),
  41534. this.color.copy(e.color),
  41535. this.materialIndex = e.materialIndex;
  41536. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41537. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41538. for (t = 0,
  41539. i = e.vertexColors.length; t < i; t++)
  41540. this.vertexColors[t] = e.vertexColors[t].clone();
  41541. return this
  41542. }
  41543. },
  41544. Ci.BufferAttribute = function(e, t) {
  41545. this.uuid = Ci.Math.generateUUID(),
  41546. this.array = e,
  41547. this.itemSize = t,
  41548. this.dynamic = !1,
  41549. this.updateRange = {
  41550. offset: 0,
  41551. count: -1
  41552. },
  41553. this.version = 0
  41554. }
  41555. ,
  41556. Ci.BufferAttribute.prototype = {
  41557. constructor: Ci.BufferAttribute,
  41558. get count() {
  41559. return this.array.length / this.itemSize
  41560. },
  41561. set needsUpdate(e) {
  41562. !0 === e && this.version++
  41563. },
  41564. setDynamic: function(e) {
  41565. return this.dynamic = e,
  41566. this
  41567. },
  41568. copy: function(e) {
  41569. return this.array = new e.array.constructor(e.array),
  41570. this.itemSize = e.itemSize,
  41571. this.dynamic = e.dynamic,
  41572. this
  41573. },
  41574. copyAt: function(e, t, i) {
  41575. e *= this.itemSize,
  41576. i *= t.itemSize;
  41577. for (var n = 0, r = this.itemSize; n < r; n++)
  41578. this.array[e + n] = t.array[i + n];
  41579. return this
  41580. },
  41581. copyArray: function(e) {
  41582. return this.array.set(e),
  41583. this
  41584. },
  41585. copyColorsArray: function(e) {
  41586. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41587. var o = e[n];
  41588. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41589. o = new Ci.Color),
  41590. t[i++] = o.r,
  41591. t[i++] = o.g,
  41592. t[i++] = o.b
  41593. }
  41594. return this
  41595. },
  41596. copyIndicesArray: function(e) {
  41597. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41598. var o = e[n];
  41599. t[i++] = o.a,
  41600. t[i++] = o.b,
  41601. t[i++] = o.c
  41602. }
  41603. return this
  41604. },
  41605. copyVector2sArray: function(e) {
  41606. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41607. var o = e[n];
  41608. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41609. o = new Ci.Vector2),
  41610. t[i++] = o.x,
  41611. t[i++] = o.y
  41612. }
  41613. return this
  41614. },
  41615. copyVector3sArray: function(e) {
  41616. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41617. var o = e[n];
  41618. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41619. o = new Ci.Vector3),
  41620. t[i++] = o.x,
  41621. t[i++] = o.y,
  41622. t[i++] = o.z
  41623. }
  41624. return this
  41625. },
  41626. copyVector4sArray: function(e) {
  41627. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41628. var o = e[n];
  41629. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41630. o = new Ci.Vector4),
  41631. t[i++] = o.x,
  41632. t[i++] = o.y,
  41633. t[i++] = o.z,
  41634. t[i++] = o.w
  41635. }
  41636. return this
  41637. },
  41638. set: function(e, t) {
  41639. return void 0 === t && (t = 0),
  41640. this.array.set(e, t),
  41641. this
  41642. },
  41643. getX: function(e) {
  41644. return this.array[e * this.itemSize]
  41645. },
  41646. setX: function(e, t) {
  41647. return this.array[e * this.itemSize] = t,
  41648. this
  41649. },
  41650. getY: function(e) {
  41651. return this.array[e * this.itemSize + 1]
  41652. },
  41653. setY: function(e, t) {
  41654. return this.array[e * this.itemSize + 1] = t,
  41655. this
  41656. },
  41657. getZ: function(e) {
  41658. return this.array[e * this.itemSize + 2]
  41659. },
  41660. setZ: function(e, t) {
  41661. return this.array[e * this.itemSize + 2] = t,
  41662. this
  41663. },
  41664. getW: function(e) {
  41665. return this.array[e * this.itemSize + 3]
  41666. },
  41667. setW: function(e, t) {
  41668. return this.array[e * this.itemSize + 3] = t,
  41669. this
  41670. },
  41671. setXY: function(e, t, i) {
  41672. return e *= this.itemSize,
  41673. this.array[e + 0] = t,
  41674. this.array[e + 1] = i,
  41675. this
  41676. },
  41677. setXYZ: function(e, t, i, n) {
  41678. return e *= this.itemSize,
  41679. this.array[e + 0] = t,
  41680. this.array[e + 1] = i,
  41681. this.array[e + 2] = n,
  41682. this
  41683. },
  41684. setXYZW: function(e, t, i, n, r) {
  41685. return e *= this.itemSize,
  41686. this.array[e + 0] = t,
  41687. this.array[e + 1] = i,
  41688. this.array[e + 2] = n,
  41689. this.array[e + 3] = r,
  41690. this
  41691. },
  41692. clone: function() {
  41693. return (new this.constructor).copy(this)
  41694. }
  41695. },
  41696. Ci.Int8Attribute = function(e, t) {
  41697. return new Ci.BufferAttribute(new Int8Array(e),t)
  41698. }
  41699. ,
  41700. Ci.Uint8Attribute = function(e, t) {
  41701. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41702. }
  41703. ,
  41704. Ci.Uint8ClampedAttribute = function(e, t) {
  41705. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41706. }
  41707. ,
  41708. Ci.Int16Attribute = function(e, t) {
  41709. return new Ci.BufferAttribute(new Int16Array(e),t)
  41710. }
  41711. ,
  41712. Ci.Uint16Attribute = function(e, t) {
  41713. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41714. }
  41715. ,
  41716. Ci.Int32Attribute = function(e, t) {
  41717. return new Ci.BufferAttribute(new Int32Array(e),t)
  41718. }
  41719. ,
  41720. Ci.Uint32Attribute = function(e, t) {
  41721. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41722. }
  41723. ,
  41724. Ci.Float32Attribute = function(e, t) {
  41725. return new Ci.BufferAttribute(new Float32Array(e),t)
  41726. }
  41727. ,
  41728. Ci.Float64Attribute = function(e, t) {
  41729. return new Ci.BufferAttribute(new Float64Array(e),t)
  41730. }
  41731. ,
  41732. Ci.DynamicBufferAttribute = function(e, t) {
  41733. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41734. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41735. }
  41736. ,
  41737. Ci.InstancedBufferAttribute = function(e, t, i) {
  41738. Ci.BufferAttribute.call(this, e, t),
  41739. this.meshPerAttribute = i || 1
  41740. }
  41741. ,
  41742. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41743. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41744. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41745. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41746. this.meshPerAttribute = e.meshPerAttribute,
  41747. this
  41748. }
  41749. ,
  41750. Ci.InterleavedBuffer = function(e, t) {
  41751. this.uuid = Ci.Math.generateUUID(),
  41752. this.array = e,
  41753. this.stride = t,
  41754. this.dynamic = !1,
  41755. this.updateRange = {
  41756. offset: 0,
  41757. count: -1
  41758. },
  41759. this.version = 0
  41760. }
  41761. ,
  41762. Ci.InterleavedBuffer.prototype = {
  41763. constructor: Ci.InterleavedBuffer,
  41764. get length() {
  41765. return this.array.length
  41766. },
  41767. get count() {
  41768. return this.array.length / this.stride
  41769. },
  41770. set needsUpdate(e) {
  41771. !0 === e && this.version++
  41772. },
  41773. setDynamic: function(e) {
  41774. return this.dynamic = e,
  41775. this
  41776. },
  41777. copy: function(e) {
  41778. return this.array = new e.array.constructor(e.array),
  41779. this.stride = e.stride,
  41780. this.dynamic = e.dynamic,
  41781. this
  41782. },
  41783. copyAt: function(e, t, i) {
  41784. e *= this.stride,
  41785. i *= t.stride;
  41786. for (var n = 0, r = this.stride; n < r; n++)
  41787. this.array[e + n] = t.array[i + n];
  41788. return this
  41789. },
  41790. set: function(e, t) {
  41791. return void 0 === t && (t = 0),
  41792. this.array.set(e, t),
  41793. this
  41794. },
  41795. clone: function() {
  41796. return (new this.constructor).copy(this)
  41797. }
  41798. },
  41799. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41800. Ci.InterleavedBuffer.call(this, e, t),
  41801. this.meshPerAttribute = i || 1
  41802. }
  41803. ,
  41804. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41805. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41806. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41807. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41808. this.meshPerAttribute = e.meshPerAttribute,
  41809. this
  41810. }
  41811. ,
  41812. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41813. this.uuid = Ci.Math.generateUUID(),
  41814. this.data = e,
  41815. this.itemSize = t,
  41816. this.offset = i
  41817. }
  41818. ,
  41819. Ci.InterleavedBufferAttribute.prototype = {
  41820. constructor: Ci.InterleavedBufferAttribute,
  41821. get length() {
  41822. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41823. this.array.length
  41824. },
  41825. get count() {
  41826. return this.data.count
  41827. },
  41828. setX: function(e, t) {
  41829. return this.data.array[e * this.data.stride + this.offset] = t,
  41830. this
  41831. },
  41832. setY: function(e, t) {
  41833. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41834. this
  41835. },
  41836. setZ: function(e, t) {
  41837. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41838. this
  41839. },
  41840. setW: function(e, t) {
  41841. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41842. this
  41843. },
  41844. getX: function(e) {
  41845. return this.data.array[e * this.data.stride + this.offset]
  41846. },
  41847. getY: function(e) {
  41848. return this.data.array[e * this.data.stride + this.offset + 1]
  41849. },
  41850. getZ: function(e) {
  41851. return this.data.array[e * this.data.stride + this.offset + 2]
  41852. },
  41853. getW: function(e) {
  41854. return this.data.array[e * this.data.stride + this.offset + 3]
  41855. },
  41856. setXY: function(e, t, i) {
  41857. return e = e * this.data.stride + this.offset,
  41858. this.data.array[e + 0] = t,
  41859. this.data.array[e + 1] = i,
  41860. this
  41861. },
  41862. setXYZ: function(e, t, i, n) {
  41863. return e = e * this.data.stride + this.offset,
  41864. this.data.array[e + 0] = t,
  41865. this.data.array[e + 1] = i,
  41866. this.data.array[e + 2] = n,
  41867. this
  41868. },
  41869. setXYZW: function(e, t, i, n, r) {
  41870. return e = e * this.data.stride + this.offset,
  41871. this.data.array[e + 0] = t,
  41872. this.data.array[e + 1] = i,
  41873. this.data.array[e + 2] = n,
  41874. this.data.array[e + 3] = r,
  41875. this
  41876. }
  41877. },
  41878. Ci.Geometry = function() {
  41879. Object.defineProperty(this, "id", {
  41880. value: Ci.GeometryIdCount++
  41881. }),
  41882. this.uuid = Ci.Math.generateUUID(),
  41883. this.name = "",
  41884. this.type = "Geometry",
  41885. this.vertices = [],
  41886. this.colors = [],
  41887. this.faces = [],
  41888. this.faceVertexUvs = [[]],
  41889. this.morphTargets = [],
  41890. this.morphNormals = [],
  41891. this.skinWeights = [],
  41892. this.skinIndices = [],
  41893. this.lineDistances = [],
  41894. this.boundingBox = null,
  41895. this.boundingSphere = null,
  41896. this.verticesNeedUpdate = !1,
  41897. this.elementsNeedUpdate = !1,
  41898. this.uvsNeedUpdate = !1,
  41899. this.normalsNeedUpdate = !1,
  41900. this.colorsNeedUpdate = !1,
  41901. this.lineDistancesNeedUpdate = !1,
  41902. this.groupsNeedUpdate = !1
  41903. }
  41904. ,
  41905. Ci.Geometry.prototype = {
  41906. constructor: Ci.Geometry,
  41907. applyMatrix: function(e) {
  41908. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41909. this.vertices[i].applyMatrix4(e)
  41910. }
  41911. for (i = 0,
  41912. n = this.faces.length; i < n; i++) {
  41913. var r = this.faces[i];
  41914. r.normal.applyMatrix3(t).normalize();
  41915. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41916. r.vertexNormals[o].applyMatrix3(t).normalize()
  41917. }
  41918. return null !== this.boundingBox && this.computeBoundingBox(),
  41919. null !== this.boundingSphere && this.computeBoundingSphere(),
  41920. this.verticesNeedUpdate = !0,
  41921. this.normalsNeedUpdate = !0,
  41922. this
  41923. },
  41924. rotateX: function(e) {
  41925. return void 0 === mt && (mt = new Ci.Matrix4),
  41926. mt.makeRotationX(e),
  41927. this.applyMatrix(mt),
  41928. this
  41929. },
  41930. rotateY: function(e) {
  41931. return void 0 === gt && (gt = new Ci.Matrix4),
  41932. gt.makeRotationY(e),
  41933. this.applyMatrix(gt),
  41934. this
  41935. },
  41936. rotateZ: function(e) {
  41937. return void 0 === ft && (ft = new Ci.Matrix4),
  41938. ft.makeRotationZ(e),
  41939. this.applyMatrix(ft),
  41940. this
  41941. },
  41942. translate: function(e, t, i) {
  41943. return void 0 === pt && (pt = new Ci.Matrix4),
  41944. pt.makeTranslation(e, t, i),
  41945. this.applyMatrix(pt),
  41946. this
  41947. },
  41948. scale: function(e, t, i) {
  41949. return void 0 === dt && (dt = new Ci.Matrix4),
  41950. dt.makeScale(e, t, i),
  41951. this.applyMatrix(dt),
  41952. this
  41953. },
  41954. lookAt: function(e) {
  41955. void 0 === ut && (ut = new Ci.Object3D),
  41956. ut.lookAt(e),
  41957. ut.updateMatrix(),
  41958. this.applyMatrix(ut.matrix)
  41959. },
  41960. fromBufferGeometry: function(e) {
  41961. function t(e, t, i, n) {
  41962. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41963. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41964. , a = new Ci.Face3(e,t,i,r,o,n);
  41965. s.faces.push(a),
  41966. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41967. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41968. }
  41969. var s = this
  41970. , i = null !== e.index ? e.index.array : void 0
  41971. , n = e.attributes
  41972. , r = n.position.array
  41973. , l = void 0 !== n.normal ? n.normal.array : void 0
  41974. , c = void 0 !== n.color ? n.color.array : void 0
  41975. , h = void 0 !== n.uv ? n.uv.array : void 0
  41976. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41977. void 0 !== u && (this.faceVertexUvs[1] = []);
  41978. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41979. a += 2)
  41980. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41981. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41982. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41983. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41984. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41985. if (void 0 !== i) {
  41986. var g = e.groups;
  41987. if (0 < g.length)
  41988. for (o = 0; o < g.length; o++)
  41989. for (var m = g[o], v = m.start, y = (a = v,
  41990. v + m.count); a < y; a += 3)
  41991. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41992. else
  41993. for (o = 0; o < i.length; o += 3)
  41994. t(i[o], i[o + 1], i[o + 2])
  41995. } else
  41996. for (o = 0; o < r.length / 3; o += 3)
  41997. t(o, o + 1, o + 2);
  41998. return this.computeFaceNormals(),
  41999. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42000. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42001. this
  42002. },
  42003. center: function() {
  42004. this.computeBoundingBox();
  42005. var e = this.boundingBox.center().negate();
  42006. return this.translate(e.x, e.y, e.z),
  42007. e
  42008. },
  42009. normalize: function() {
  42010. this.computeBoundingSphere();
  42011. var e = this.boundingSphere.center
  42012. , t = this.boundingSphere.radius
  42013. , i = 0 === t ? 1 : 1 / t
  42014. , n = new Ci.Matrix4;
  42015. 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),
  42016. this.applyMatrix(n),
  42017. this
  42018. },
  42019. computeFaceNormals: function() {
  42020. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42021. var r = this.faces[i]
  42022. , o = this.vertices[r.a]
  42023. , a = this.vertices[r.b]
  42024. , s = this.vertices[r.c];
  42025. e.subVectors(s, a),
  42026. t.subVectors(o, a),
  42027. e.cross(t),
  42028. e.normalize(),
  42029. r.normal.copy(e)
  42030. }
  42031. },
  42032. computeVertexNormals: function(e) {
  42033. var t, i, n, r, o, a;
  42034. for (void 0 === e && (e = !0),
  42035. a = new Array(this.vertices.length),
  42036. t = 0,
  42037. i = this.vertices.length; t < i; t++)
  42038. a[t] = new Ci.Vector3;
  42039. if (e) {
  42040. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42041. for (n = 0,
  42042. r = this.faces.length; n < r; n++)
  42043. o = this.faces[n],
  42044. s = this.vertices[o.a],
  42045. l = this.vertices[o.b],
  42046. c = this.vertices[o.c],
  42047. h.subVectors(c, l),
  42048. u.subVectors(s, l),
  42049. h.cross(u),
  42050. a[o.a].add(h),
  42051. a[o.b].add(h),
  42052. a[o.c].add(h)
  42053. } else
  42054. for (n = 0,
  42055. r = this.faces.length; n < r; n++)
  42056. a[(o = this.faces[n]).a].add(o.normal),
  42057. a[o.b].add(o.normal),
  42058. a[o.c].add(o.normal);
  42059. for (t = 0,
  42060. i = this.vertices.length; t < i; t++)
  42061. a[t].normalize();
  42062. for (n = 0,
  42063. r = this.faces.length; n < r; n++) {
  42064. var d = (o = this.faces[n]).vertexNormals;
  42065. 3 === d.length ? (d[0].copy(a[o.a]),
  42066. d[1].copy(a[o.b]),
  42067. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42068. d[1] = a[o.b].clone(),
  42069. d[2] = a[o.c].clone())
  42070. }
  42071. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42072. },
  42073. computeMorphNormals: function() {
  42074. var e, t, i, n, r;
  42075. for (i = 0,
  42076. n = this.faces.length; i < n; i++)
  42077. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42078. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42079. e = 0,
  42080. t = r.vertexNormals.length; e < t; e++)
  42081. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42082. var o = new Ci.Geometry;
  42083. for (o.faces = this.faces,
  42084. e = 0,
  42085. t = this.morphTargets.length; e < t; e++) {
  42086. if (!this.morphNormals[e]) {
  42087. this.morphNormals[e] = {},
  42088. this.morphNormals[e].faceNormals = [],
  42089. this.morphNormals[e].vertexNormals = [];
  42090. var a = this.morphNormals[e].faceNormals
  42091. , s = this.morphNormals[e].vertexNormals;
  42092. for (i = 0,
  42093. n = this.faces.length; i < n; i++)
  42094. l = new Ci.Vector3,
  42095. c = {
  42096. a: new Ci.Vector3,
  42097. b: new Ci.Vector3,
  42098. c: new Ci.Vector3
  42099. },
  42100. a.push(l),
  42101. s.push(c)
  42102. }
  42103. var l, c, h = this.morphNormals[e];
  42104. for (o.vertices = this.morphTargets[e].vertices,
  42105. o.computeFaceNormals(),
  42106. o.computeVertexNormals(),
  42107. i = 0,
  42108. n = this.faces.length; i < n; i++)
  42109. r = this.faces[i],
  42110. l = h.faceNormals[i],
  42111. c = h.vertexNormals[i],
  42112. l.copy(r.normal),
  42113. c.a.copy(r.vertexNormals[0]),
  42114. c.b.copy(r.vertexNormals[1]),
  42115. c.c.copy(r.vertexNormals[2])
  42116. }
  42117. for (i = 0,
  42118. n = this.faces.length; i < n; i++)
  42119. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42120. r.vertexNormals = r.__originalVertexNormals
  42121. },
  42122. computeTangents: function() {
  42123. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42124. },
  42125. computeLineDistances: function() {
  42126. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42127. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42128. this.lineDistances[i] = e
  42129. },
  42130. computeBoundingBox: function() {
  42131. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42132. this.boundingBox.setFromPoints(this.vertices)
  42133. },
  42134. computeBoundingSphere: function() {
  42135. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42136. this.boundingSphere.setFromPoints(this.vertices)
  42137. },
  42138. merge: function(e, t, i) {
  42139. if (e instanceof Ci.Geometry != 0) {
  42140. 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];
  42141. void 0 === i && (i = 0),
  42142. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42143. for (var u = 0, d = a.length; u < d; u++) {
  42144. var p = a[u].clone();
  42145. void 0 !== t && p.applyMatrix4(t),
  42146. o.push(p)
  42147. }
  42148. for (u = 0,
  42149. d = l.length; u < d; u++) {
  42150. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42151. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42152. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42153. for (var C = 0, I = y.length; C < I; C++)
  42154. g = y[C].clone(),
  42155. void 0 !== n && g.applyMatrix3(n).normalize(),
  42156. f.vertexNormals.push(g);
  42157. f.color.copy(v.color);
  42158. for (C = 0,
  42159. I = A.length; C < I; C++)
  42160. m = A[C],
  42161. f.vertexColors.push(m.clone());
  42162. f.materialIndex = v.materialIndex + i,
  42163. s.push(f)
  42164. }
  42165. for (u = 0,
  42166. d = h.length; u < d; u++) {
  42167. var E = h[u]
  42168. , _ = [];
  42169. if (void 0 !== E) {
  42170. for (C = 0,
  42171. I = E.length; C < I; C++)
  42172. _.push(E[C].clone());
  42173. c.push(_)
  42174. }
  42175. }
  42176. } else
  42177. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42178. },
  42179. mergeMesh: function(e) {
  42180. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42181. void this.merge(e.geometry, e.matrix))
  42182. },
  42183. mergeVertices: function() {
  42184. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42185. for (i = 0,
  42186. n = this.vertices.length; i < n; i++)
  42187. e = this.vertices[i],
  42188. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42189. c.push(this.vertices[i]),
  42190. h[i] = c.length - 1) : h[i] = h[l[t]];
  42191. var d = [];
  42192. for (i = 0,
  42193. n = this.faces.length; i < n; i++) {
  42194. (r = this.faces[i]).a = h[r.a],
  42195. r.b = h[r.b],
  42196. r.c = h[r.c],
  42197. o = [r.a, r.b, r.c];
  42198. for (var p = 0; p < 3; p++)
  42199. if (o[p] === o[(p + 1) % 3]) {
  42200. p,
  42201. d.push(i);
  42202. break
  42203. }
  42204. }
  42205. for (i = d.length - 1; 0 <= i; i--) {
  42206. var f = d[i];
  42207. for (this.faces.splice(f, 1),
  42208. a = 0,
  42209. s = this.faceVertexUvs.length; a < s; a++)
  42210. this.faceVertexUvs[a].splice(f, 1)
  42211. }
  42212. var g = this.vertices.length - c.length;
  42213. return this.vertices = c,
  42214. g
  42215. },
  42216. sortFacesByMaterialIndex: function() {
  42217. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42218. e[i]._id = i;
  42219. e.sort(function(e, t) {
  42220. return e.materialIndex - t.materialIndex
  42221. });
  42222. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42223. o && o.length === t && (n = []),
  42224. a && a.length === t && (r = []);
  42225. for (i = 0; i < t; i++) {
  42226. var s = e[i]._id;
  42227. n && n.push(o[s]),
  42228. r && r.push(a[s])
  42229. }
  42230. n && (this.faceVertexUvs[0] = n),
  42231. r && (this.faceVertexUvs[1] = r)
  42232. },
  42233. toJSON: function() {
  42234. function e(e, t, i) {
  42235. return i ? e | 1 << t : e & ~(1 << t)
  42236. }
  42237. function t(e) {
  42238. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42239. return void 0 !== d[t] || (d[t] = u.length / 3,
  42240. u.push(e.x, e.y, e.z)),
  42241. d[t]
  42242. }
  42243. function i(e) {
  42244. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42245. return void 0 !== f[t] || (f[t] = p.length,
  42246. p.push(e.getHex())),
  42247. f[t]
  42248. }
  42249. function n(e) {
  42250. var t = e.x.toString() + e.y.toString();
  42251. return void 0 !== m[t] || (m[t] = g.length / 2,
  42252. g.push(e.x, e.y)),
  42253. m[t]
  42254. }
  42255. var r = {
  42256. metadata: {
  42257. version: 4.4,
  42258. type: "Geometry",
  42259. generator: "Geometry.toJSON"
  42260. }
  42261. };
  42262. if (r.uuid = this.uuid,
  42263. r.type = this.type,
  42264. "" !== this.name && (r.name = this.name),
  42265. void 0 !== this.parameters) {
  42266. var o = this.parameters;
  42267. for (var a in o)
  42268. void 0 !== o[a] && (r[a] = o[a]);
  42269. return r
  42270. }
  42271. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42272. var c = this.vertices[l];
  42273. s.push(c.x, c.y, c.z)
  42274. }
  42275. var h = []
  42276. , u = []
  42277. , d = {}
  42278. , p = []
  42279. , f = {}
  42280. , g = []
  42281. , m = {};
  42282. for (l = 0; l < this.faces.length; l++) {
  42283. var v = this.faces[l]
  42284. , y = void 0 !== this.faceVertexUvs[0][l]
  42285. , A = 0 < v.normal.length()
  42286. , C = 0 < v.vertexNormals.length
  42287. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42288. , E = 0 < v.vertexColors.length
  42289. , _ = 0;
  42290. 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),
  42291. h.push(_),
  42292. h.push(v.a, v.b, v.c),
  42293. h.push(v.materialIndex),
  42294. y) {
  42295. var b = this.faceVertexUvs[0][l];
  42296. h.push(n(b[0]), n(b[1]), n(b[2]))
  42297. }
  42298. if (A && h.push(t(v.normal)),
  42299. C) {
  42300. var w = v.vertexNormals;
  42301. h.push(t(w[0]), t(w[1]), t(w[2]))
  42302. }
  42303. if (I && h.push(i(v.color)),
  42304. E) {
  42305. var T = v.vertexColors;
  42306. h.push(i(T[0]), i(T[1]), i(T[2]))
  42307. }
  42308. }
  42309. return r.data = {},
  42310. r.data.vertices = s,
  42311. r.data.normals = u,
  42312. 0 < p.length && (r.data.colors = p),
  42313. 0 < g.length && (r.data.uvs = [g]),
  42314. r.data.faces = h,
  42315. r
  42316. },
  42317. clone: function() {
  42318. return (new Ci.Geometry).copy(this)
  42319. },
  42320. copy: function(e) {
  42321. this.vertices = [],
  42322. this.faces = [],
  42323. this.faceVertexUvs = [[]];
  42324. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42325. this.vertices.push(t[i].clone());
  42326. var r = e.faces;
  42327. for (i = 0,
  42328. n = r.length; i < n; i++)
  42329. this.faces.push(r[i].clone());
  42330. for (i = 0,
  42331. n = e.faceVertexUvs.length; i < n; i++) {
  42332. var o = e.faceVertexUvs[i];
  42333. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42334. for (var a = 0, s = o.length; a < s; a++) {
  42335. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42336. var d = l[h];
  42337. c.push(d.clone())
  42338. }
  42339. this.faceVertexUvs[i].push(c)
  42340. }
  42341. }
  42342. return this
  42343. },
  42344. dispose: function() {
  42345. this.dispatchEvent({
  42346. type: "dispose"
  42347. })
  42348. }
  42349. },
  42350. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42351. Ci.GeometryIdCount = 0,
  42352. Ci.DirectGeometry = function() {
  42353. Object.defineProperty(this, "id", {
  42354. value: Ci.GeometryIdCount++
  42355. }),
  42356. this.uuid = Ci.Math.generateUUID(),
  42357. this.name = "",
  42358. this.type = "DirectGeometry",
  42359. this.indices = [],
  42360. this.vertices = [],
  42361. this.normals = [],
  42362. this.colors = [],
  42363. this.uvs = [],
  42364. this.uvs2 = [],
  42365. this.groups = [],
  42366. this.morphTargets = {},
  42367. this.skinWeights = [],
  42368. this.skinIndices = [],
  42369. this.boundingBox = null,
  42370. this.boundingSphere = null,
  42371. this.verticesNeedUpdate = !1,
  42372. this.normalsNeedUpdate = !1,
  42373. this.colorsNeedUpdate = !1,
  42374. this.uvsNeedUpdate = !1,
  42375. this.groupsNeedUpdate = !1
  42376. }
  42377. ,
  42378. Ci.DirectGeometry.prototype = {
  42379. constructor: Ci.DirectGeometry,
  42380. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42381. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42382. computeFaceNormals: function() {
  42383. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42384. },
  42385. computeVertexNormals: function() {
  42386. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42387. },
  42388. computeGroups: function(e) {
  42389. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42390. var a = r[o];
  42391. a.materialIndex !== i && (i = a.materialIndex,
  42392. void 0 !== t && (t.count = 3 * o - t.start,
  42393. n.push(t)),
  42394. t = {
  42395. start: 3 * o,
  42396. materialIndex: i
  42397. })
  42398. }
  42399. void 0 !== t && (t.count = 3 * o - t.start,
  42400. n.push(t)),
  42401. this.groups = n
  42402. },
  42403. fromGeometry: function(e) {
  42404. 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;
  42405. if (0 < l) {
  42406. t = [];
  42407. for (var c = 0; c < l; c++)
  42408. t[c] = [];
  42409. this.morphTargets.position = t
  42410. }
  42411. var h, u = e.morphNormals, d = u.length;
  42412. if (0 < d) {
  42413. h = [];
  42414. for (c = 0; c < d; c++)
  42415. h[c] = [];
  42416. this.morphTargets.normal = h
  42417. }
  42418. var p = e.skinIndices
  42419. , f = e.skinWeights
  42420. , g = p.length === n.length
  42421. , m = f.length === n.length;
  42422. for (c = 0; c < i.length; c++) {
  42423. var v = i[c];
  42424. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42425. var y = v.vertexNormals;
  42426. if (3 === y.length)
  42427. this.normals.push(y[0], y[1], y[2]);
  42428. else {
  42429. var A = v.normal;
  42430. this.normals.push(A, A, A)
  42431. }
  42432. var C, I = v.vertexColors;
  42433. if (3 === I.length)
  42434. this.colors.push(I[0], I[1], I[2]);
  42435. else {
  42436. var E = v.color;
  42437. this.colors.push(E, E, E)
  42438. }
  42439. if (!0 === o)
  42440. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42441. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42442. if (!0 === a)
  42443. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42444. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42445. for (var _ = 0; _ < l; _++) {
  42446. var b = s[_].vertices;
  42447. t[_].push(b[v.a], b[v.b], b[v.c])
  42448. }
  42449. for (_ = 0; _ < d; _++) {
  42450. var w = u[_].vertexNormals[c];
  42451. h[_].push(w.a, w.b, w.c)
  42452. }
  42453. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42454. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42455. }
  42456. return this.computeGroups(e),
  42457. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42458. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42459. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42460. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42461. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42462. this
  42463. },
  42464. dispose: function() {
  42465. this.dispatchEvent({
  42466. type: "dispose"
  42467. })
  42468. }
  42469. },
  42470. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42471. Ci.BufferGeometry = function() {
  42472. Object.defineProperty(this, "id", {
  42473. value: Ci.GeometryIdCount++
  42474. }),
  42475. this.uuid = Ci.Math.generateUUID(),
  42476. this.name = "",
  42477. this.type = "BufferGeometry",
  42478. this.index = null,
  42479. this.attributes = {},
  42480. this.morphAttributes = {},
  42481. this.groups = [],
  42482. this.boundingBox = null,
  42483. this.boundingSphere = null,
  42484. this.drawRange = {
  42485. start: 0,
  42486. count: 1 / 0
  42487. }
  42488. }
  42489. ,
  42490. Ci.BufferGeometry.prototype = {
  42491. constructor: Ci.BufferGeometry,
  42492. getIndex: function() {
  42493. return this.index
  42494. },
  42495. setIndex: function(e) {
  42496. this.index = e
  42497. },
  42498. addAttribute: function(e, t) {
  42499. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42500. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42501. void this.setIndex(t)) : (this.attributes[e] = t,
  42502. this)
  42503. },
  42504. getAttribute: function(e) {
  42505. return this.attributes[e]
  42506. },
  42507. removeAttribute: function(e) {
  42508. return delete this.attributes[e],
  42509. this
  42510. },
  42511. addGroup: function(e, t, i) {
  42512. this.groups.push({
  42513. start: e,
  42514. count: t,
  42515. materialIndex: void 0 !== i ? i : 0
  42516. })
  42517. },
  42518. clearGroups: function() {
  42519. this.groups = []
  42520. },
  42521. setDrawRange: function(e, t) {
  42522. this.drawRange.start = e,
  42523. this.drawRange.count = t
  42524. },
  42525. applyMatrix: function(e) {
  42526. var t = this.attributes.position;
  42527. void 0 !== t && (e.applyToVector3Array(t.array),
  42528. t.needsUpdate = !0);
  42529. var i = this.attributes.normal;
  42530. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42531. i.needsUpdate = !0);
  42532. return null !== this.boundingBox && this.computeBoundingBox(),
  42533. null !== this.boundingSphere && this.computeBoundingSphere(),
  42534. this
  42535. },
  42536. rotateX: function(e) {
  42537. return void 0 === ht && (ht = new Ci.Matrix4),
  42538. ht.makeRotationX(e),
  42539. this.applyMatrix(ht),
  42540. this
  42541. },
  42542. rotateY: function(e) {
  42543. return void 0 === ct && (ct = new Ci.Matrix4),
  42544. ct.makeRotationY(e),
  42545. this.applyMatrix(ct),
  42546. this
  42547. },
  42548. rotateZ: function(e) {
  42549. return void 0 === lt && (lt = new Ci.Matrix4),
  42550. lt.makeRotationZ(e),
  42551. this.applyMatrix(lt),
  42552. this
  42553. },
  42554. translate: function(e, t, i) {
  42555. return void 0 === st && (st = new Ci.Matrix4),
  42556. st.makeTranslation(e, t, i),
  42557. this.applyMatrix(st),
  42558. this
  42559. },
  42560. scale: function(e, t, i) {
  42561. return void 0 === at && (at = new Ci.Matrix4),
  42562. at.makeScale(e, t, i),
  42563. this.applyMatrix(at),
  42564. this
  42565. },
  42566. lookAt: function(e) {
  42567. void 0 === ot && (ot = new Ci.Object3D),
  42568. ot.lookAt(e),
  42569. ot.updateMatrix(),
  42570. this.applyMatrix(ot.matrix)
  42571. },
  42572. center: function() {
  42573. this.computeBoundingBox();
  42574. var e = this.boundingBox.center().negate();
  42575. return this.translate(e.x, e.y, e.z),
  42576. e
  42577. },
  42578. setFromObject: function(e) {
  42579. var t = e.geometry;
  42580. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42581. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42582. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42583. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42584. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42585. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42586. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42587. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42588. }
  42589. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42590. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42591. } else
  42592. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42593. return this
  42594. },
  42595. updateFromObject: function(e) {
  42596. var t, i = e.geometry;
  42597. if (e instanceof Ci.Mesh) {
  42598. var n = i.__directGeometry;
  42599. if (void 0 === n)
  42600. return this.fromGeometry(i);
  42601. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42602. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42603. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42604. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42605. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42606. i.verticesNeedUpdate = !1,
  42607. i.normalsNeedUpdate = !1,
  42608. i.colorsNeedUpdate = !1,
  42609. i.uvsNeedUpdate = !1,
  42610. i.groupsNeedUpdate = !1,
  42611. i = n
  42612. }
  42613. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42614. t.needsUpdate = !0),
  42615. i.verticesNeedUpdate = !1);
  42616. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42617. t.needsUpdate = !0),
  42618. i.normalsNeedUpdate = !1);
  42619. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42620. t.needsUpdate = !0),
  42621. i.colorsNeedUpdate = !1);
  42622. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42623. t.needsUpdate = !0),
  42624. i.uvsNeedUpdate = !1);
  42625. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42626. t.needsUpdate = !0),
  42627. i.lineDistancesNeedUpdate = !1);
  42628. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42629. this.groups = i.groups,
  42630. i.groupsNeedUpdate = !1),
  42631. this
  42632. },
  42633. fromGeometry: function(e) {
  42634. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42635. this.fromDirectGeometry(e.__directGeometry)
  42636. },
  42637. fromDirectGeometry: function(e) {
  42638. var t = new Float32Array(3 * e.vertices.length);
  42639. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42640. 0 < e.normals.length) {
  42641. var i = new Float32Array(3 * e.normals.length);
  42642. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42643. }
  42644. if (0 < e.colors.length) {
  42645. var n = new Float32Array(3 * e.colors.length);
  42646. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42647. }
  42648. if (0 < e.uvs.length) {
  42649. var r = new Float32Array(2 * e.uvs.length);
  42650. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42651. }
  42652. if (0 < e.uvs2.length) {
  42653. var o = new Float32Array(2 * e.uvs2.length);
  42654. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42655. }
  42656. if (0 < e.indices.length) {
  42657. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42658. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42659. }
  42660. for (var s in this.groups = e.groups,
  42661. e.morphTargets) {
  42662. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42663. var d = c[h]
  42664. , p = new Ci.Float32Attribute(3 * d.length,3);
  42665. l.push(p.copyVector3sArray(d))
  42666. }
  42667. this.morphAttributes[s] = l
  42668. }
  42669. if (0 < e.skinIndices.length) {
  42670. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42671. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42672. }
  42673. if (0 < e.skinWeights.length) {
  42674. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42675. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42676. }
  42677. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42678. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42679. this
  42680. },
  42681. computeBoundingBox: (new Ci.Vector3,
  42682. function() {
  42683. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42684. var e = this.attributes.position.array;
  42685. e && this.boundingBox.setFromArray(e),
  42686. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42687. this.boundingBox.max.set(0, 0, 0)),
  42688. (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)
  42689. }
  42690. ),
  42691. computeBoundingSphere: (nt = new Ci.Box3,
  42692. rt = new Ci.Vector3,
  42693. function() {
  42694. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42695. var e = this.attributes.position.array;
  42696. if (e) {
  42697. var t = this.boundingSphere.center;
  42698. nt.setFromArray(e),
  42699. nt.center(t);
  42700. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42701. rt.fromArray(e, n),
  42702. i = Math.max(i, t.distanceToSquared(rt));
  42703. this.boundingSphere.radius = Math.sqrt(i),
  42704. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42705. }
  42706. }
  42707. ),
  42708. computeFaceNormals: function() {},
  42709. computeVertexNormals: function() {
  42710. var e = this.index
  42711. , t = this.attributes
  42712. , i = this.groups;
  42713. if (t.position) {
  42714. var n = t.position.array;
  42715. if (void 0 === t.normal)
  42716. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42717. else
  42718. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42719. r[o] = 0;
  42720. 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;
  42721. if (e) {
  42722. var m = e.array;
  42723. 0 === i.length && this.addGroup(0, m.length);
  42724. for (var v = 0, y = i.length; v < y; ++v) {
  42725. var A = i[v]
  42726. , C = A.start;
  42727. for (o = C,
  42728. a = C + A.count; o < a; o += 3)
  42729. s = 3 * m[o + 0],
  42730. l = 3 * m[o + 1],
  42731. c = 3 * m[o + 2],
  42732. u.fromArray(n, s),
  42733. d.fromArray(n, l),
  42734. p.fromArray(n, c),
  42735. f.subVectors(p, d),
  42736. g.subVectors(u, d),
  42737. f.cross(g),
  42738. h[s] += f.x,
  42739. h[1 + s] += f.y,
  42740. h[2 + s] += f.z,
  42741. h[l] += f.x,
  42742. h[1 + l] += f.y,
  42743. h[2 + l] += f.z,
  42744. h[c] += f.x,
  42745. h[1 + c] += f.y,
  42746. h[2 + c] += f.z
  42747. }
  42748. } else
  42749. for (o = 0,
  42750. a = n.length; o < a; o += 9)
  42751. u.fromArray(n, o),
  42752. d.fromArray(n, o + 3),
  42753. p.fromArray(n, o + 6),
  42754. f.subVectors(p, d),
  42755. g.subVectors(u, d),
  42756. f.cross(g),
  42757. h[o] = f.x,
  42758. h[o + 1] = f.y,
  42759. h[o + 2] = f.z,
  42760. h[o + 3] = f.x,
  42761. h[o + 4] = f.y,
  42762. h[o + 5] = f.z,
  42763. h[o + 6] = f.x,
  42764. h[o + 7] = f.y,
  42765. h[o + 8] = f.z;
  42766. this.normalizeNormals(),
  42767. t.normal.needsUpdate = !0
  42768. }
  42769. },
  42770. merge: function(e, t) {
  42771. if (e instanceof Ci.BufferGeometry != 0) {
  42772. void 0 === t && (t = 0);
  42773. var i = this.attributes;
  42774. for (var n in i)
  42775. if (void 0 !== e.attributes[n])
  42776. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42777. l++)
  42778. r[l] = a[s];
  42779. return this
  42780. }
  42781. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42782. },
  42783. normalizeNormals: function() {
  42784. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42785. e = r[o],
  42786. t = r[o + 1],
  42787. i = r[o + 2],
  42788. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42789. r[o] *= n,
  42790. r[o + 1] *= n,
  42791. r[o + 2] *= n
  42792. },
  42793. toNonIndexed: function() {
  42794. if (null === this.index)
  42795. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42796. this;
  42797. var e = new Ci.BufferGeometry
  42798. , t = this.index.array
  42799. , i = this.attributes;
  42800. for (var n in i) {
  42801. 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++) {
  42802. l = t[h] * a;
  42803. for (var d = 0; d < a; d++)
  42804. s[c++] = o[l++]
  42805. }
  42806. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42807. }
  42808. return e
  42809. },
  42810. toJSON: function() {
  42811. var e = {
  42812. metadata: {
  42813. version: 4.4,
  42814. type: "BufferGeometry",
  42815. generator: "BufferGeometry.toJSON"
  42816. }
  42817. };
  42818. if (e.uuid = this.uuid,
  42819. e.type = this.type,
  42820. "" !== this.name && (e.name = this.name),
  42821. void 0 !== this.parameters) {
  42822. var t = this.parameters;
  42823. for (var i in t)
  42824. void 0 !== t[i] && (e[i] = t[i]);
  42825. return e
  42826. }
  42827. e.data = {
  42828. attributes: {}
  42829. };
  42830. var n = this.index;
  42831. if (null !== n) {
  42832. var r = Array.prototype.slice.call(n.array);
  42833. e.data.index = {
  42834. type: n.array.constructor.name,
  42835. array: r
  42836. }
  42837. }
  42838. var o = this.attributes;
  42839. for (var i in o) {
  42840. var a = o[i];
  42841. r = Array.prototype.slice.call(a.array);
  42842. e.data.attributes[i] = {
  42843. itemSize: a.itemSize,
  42844. type: a.array.constructor.name,
  42845. array: r
  42846. }
  42847. }
  42848. var s = this.groups;
  42849. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42850. var l = this.boundingSphere;
  42851. return null !== l && (e.data.boundingSphere = {
  42852. center: l.center.toArray(),
  42853. radius: l.radius
  42854. }),
  42855. e
  42856. },
  42857. clone: function() {
  42858. return (new Ci.BufferGeometry).copy(this)
  42859. },
  42860. copy: function(e) {
  42861. var t = e.index;
  42862. null !== t && this.setIndex(t.clone());
  42863. var i = e.attributes;
  42864. for (var n in i) {
  42865. var r = i[n];
  42866. this.addAttribute(n, r.clone())
  42867. }
  42868. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42869. var l = o[a];
  42870. this.addGroup(l.start, l.count)
  42871. }
  42872. return this
  42873. },
  42874. dispose: function() {
  42875. this.dispatchEvent({
  42876. type: "dispose"
  42877. })
  42878. }
  42879. },
  42880. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42881. Ci.BufferGeometry.MaxIndex = 65535,
  42882. Ci.InstancedBufferGeometry = function() {
  42883. Ci.BufferGeometry.call(this),
  42884. this.type = "InstancedBufferGeometry",
  42885. this.maxInstancedCount = void 0
  42886. }
  42887. ,
  42888. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42889. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42890. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42891. this.groups.push({
  42892. start: e,
  42893. count: t,
  42894. instances: i
  42895. })
  42896. }
  42897. ,
  42898. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42899. var t = e.index;
  42900. null !== t && this.setIndex(t.clone());
  42901. var i = e.attributes;
  42902. for (var n in i) {
  42903. var r = i[n];
  42904. this.addAttribute(n, r.clone())
  42905. }
  42906. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42907. var l = o[a];
  42908. this.addGroup(l.start, l.count, l.instances)
  42909. }
  42910. return this
  42911. }
  42912. ,
  42913. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42914. Ci.Uniform = function(e, t) {
  42915. this.type = e,
  42916. this.value = t,
  42917. this.dynamic = !1
  42918. }
  42919. ,
  42920. Ci.Uniform.prototype = {
  42921. constructor: Ci.Uniform,
  42922. onUpdate: function(e) {
  42923. return this.dynamic = !0,
  42924. this.onUpdateCallback = e,
  42925. this
  42926. }
  42927. },
  42928. Ci.AnimationClip = function(e, t, i) {
  42929. this.name = e || Ci.Math.generateUUID(),
  42930. this.tracks = i,
  42931. this.duration = void 0 !== t ? t : -1,
  42932. this.duration < 0 && this.resetDuration(),
  42933. this.trim(),
  42934. this.optimize()
  42935. }
  42936. ,
  42937. Ci.AnimationClip.prototype = {
  42938. constructor: Ci.AnimationClip,
  42939. resetDuration: function() {
  42940. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42941. var n = this.tracks[t];
  42942. e = Math.max(e, n.times[n.times.length - 1])
  42943. }
  42944. this.duration = e
  42945. },
  42946. trim: function() {
  42947. for (var e = 0; e < this.tracks.length; e++)
  42948. this.tracks[e].trim(0, this.duration);
  42949. return this
  42950. },
  42951. optimize: function() {
  42952. for (var e = 0; e < this.tracks.length; e++)
  42953. this.tracks[e].optimize();
  42954. return this
  42955. }
  42956. },
  42957. Object.assign(Ci.AnimationClip, {
  42958. parse: function(e) {
  42959. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42960. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42961. return new Ci.AnimationClip(e.name,e.duration,t)
  42962. },
  42963. toJSON: function(e) {
  42964. for (var t = [], i = e.tracks, n = {
  42965. name: e.name,
  42966. duration: e.duration,
  42967. tracks: t
  42968. }, r = 0, o = i.length; r !== o; ++r)
  42969. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42970. return n
  42971. },
  42972. CreateFromMorphTargetSequence: function(e, t, i) {
  42973. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42974. var a = []
  42975. , s = [];
  42976. a.push((o + n - 1) % n, o, (o + 1) % n),
  42977. s.push(0, 1, 0);
  42978. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42979. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42980. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42981. 0 === a[0] && (a.push(n),
  42982. s.push(s[0])),
  42983. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42984. }
  42985. return new Ci.AnimationClip(e,-1,r)
  42986. },
  42987. findByName: function(e, t) {
  42988. for (var i = 0; i < e.length; i++)
  42989. if (e[i].name === t)
  42990. return e[i];
  42991. return null
  42992. },
  42993. CreateClipsFromMorphTargetSequences: function(e, t) {
  42994. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42995. var a = e[r]
  42996. , s = a.name.match(n);
  42997. if (s && 1 < s.length) {
  42998. var l = i[h = s[1]];
  42999. l || (i[h] = l = []),
  43000. l.push(a)
  43001. }
  43002. }
  43003. var c = [];
  43004. for (var h in i)
  43005. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43006. return c
  43007. },
  43008. parseAnimation: function(e, t, i) {
  43009. if (!e)
  43010. return console.error(" no animation in JSONLoader data"),
  43011. null;
  43012. function n(e, t, i, n, r) {
  43013. if (0 !== i.length) {
  43014. var o = []
  43015. , a = [];
  43016. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43017. 0 !== o.length && r.push(new e(t,o,a))
  43018. }
  43019. }
  43020. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43021. var h = l[c].keys;
  43022. if (h && 0 != h.length)
  43023. if (h[0].morphTargets) {
  43024. for (var u = {}, d = 0; d < h.length; d++)
  43025. if (h[d].morphTargets)
  43026. for (var p = 0; p < h[d].morphTargets.length; p++)
  43027. u[h[d].morphTargets[p]] = -1;
  43028. for (var f in u) {
  43029. var g = []
  43030. , m = [];
  43031. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43032. var v = h[d];
  43033. g.push(v.time),
  43034. m.push(v.morphTarget === f ? 1 : 0)
  43035. }
  43036. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43037. }
  43038. a = u.length * (s || 1)
  43039. } else {
  43040. var y = ".bones[" + t[c].name + "]";
  43041. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43042. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43043. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43044. }
  43045. }
  43046. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43047. }
  43048. }),
  43049. Ci.AnimationMixer = function(e) {
  43050. this._root = e,
  43051. this._initMemoryManager(),
  43052. this._accuIndex = 0,
  43053. this.time = 0,
  43054. this.timeScale = 1
  43055. }
  43056. ,
  43057. Ci.AnimationMixer.prototype = {
  43058. constructor: Ci.AnimationMixer,
  43059. clipAction: function(e, t) {
  43060. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43061. if (void 0 !== a) {
  43062. var s = a.actionByRoot[n];
  43063. if (void 0 !== s)
  43064. return s;
  43065. if (o = (i = a.knownActions[0])._clip,
  43066. e !== r && e !== o)
  43067. throw new Error("Different clips with the same name detected!")
  43068. }
  43069. if (null === o)
  43070. return null;
  43071. var l = new Ci.AnimationMixer._Action(this,o,t);
  43072. return this._bindAction(l, i),
  43073. this._addInactiveAction(l, r, n),
  43074. l
  43075. },
  43076. existingAction: function(e, t) {
  43077. var i = (t || this._root).uuid
  43078. , n = "string" == typeof e ? e : e.name
  43079. , r = this._actionsByClip[n];
  43080. return void 0 !== r && r.actionByRoot[i] || null
  43081. },
  43082. stopAllAction: function() {
  43083. var e = this._actions
  43084. , t = this._nActiveActions
  43085. , i = this._bindings
  43086. , n = this._nActiveBindings;
  43087. this._nActiveActions = 0;
  43088. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43089. e[r].reset();
  43090. for (r = 0; r !== n; ++r)
  43091. i[r].useCount = 0;
  43092. return this
  43093. },
  43094. update: function(e) {
  43095. e *= this.timeScale;
  43096. 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) {
  43097. var s = t[a];
  43098. s.enabled && s._update(n, e, r, o)
  43099. }
  43100. var l = this._bindings
  43101. , c = this._nActiveBindings;
  43102. for (a = 0; a !== c; ++a)
  43103. l[a].apply(o);
  43104. return this
  43105. },
  43106. getRoot: function() {
  43107. return this._root
  43108. },
  43109. uncacheClip: function(e) {
  43110. var t = this._actions
  43111. , i = e.name
  43112. , n = this._actionsByClip
  43113. , r = n[i];
  43114. if (void 0 !== r) {
  43115. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43116. var l = o[a];
  43117. this._deactivateAction(l);
  43118. var c = l._cacheIndex
  43119. , h = t[t.length - 1];
  43120. l._cacheIndex = null,
  43121. l._byClipCacheIndex = null,
  43122. t[h._cacheIndex = c] = h,
  43123. t.pop(),
  43124. this._removeInactiveBindingsForAction(l)
  43125. }
  43126. delete n[i]
  43127. }
  43128. },
  43129. uncacheRoot: function(e) {
  43130. var t = e.uuid
  43131. , i = this._actionsByClip;
  43132. for (var n in i) {
  43133. var r = i[n].actionByRoot[t];
  43134. void 0 !== r && (this._deactivateAction(r),
  43135. this._removeInactiveAction(r))
  43136. }
  43137. var o = this._bindingsByRootAndName[t];
  43138. if (void 0 !== o)
  43139. for (var a in o) {
  43140. var s = o[a];
  43141. s.restoreOriginalState(),
  43142. this._removeInactiveBinding(s)
  43143. }
  43144. },
  43145. uncacheAction: function(e, t) {
  43146. var i = this.existingAction(e, t);
  43147. null !== i && (this._deactivateAction(i),
  43148. this._removeInactiveAction(i))
  43149. }
  43150. },
  43151. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43152. Ci.AnimationMixer._Action = function(e, t, i) {
  43153. this._mixer = e,
  43154. this._clip = t,
  43155. this._localRoot = i || null;
  43156. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43157. endingStart: Ci.ZeroCurvatureEnding,
  43158. endingEnd: Ci.ZeroCurvatureEnding
  43159. }, s = 0; s !== r; ++s) {
  43160. var l = n[s].createInterpolant(null);
  43161. (o[s] = l).settings = a
  43162. }
  43163. this._interpolantSettings = a,
  43164. this._interpolants = o,
  43165. this._propertyBindings = new Array(r),
  43166. this._cacheIndex = null,
  43167. this._byClipCacheIndex = null,
  43168. this._timeScaleInterpolant = null,
  43169. this._weightInterpolant = null,
  43170. this.loop = Ci.LoopRepeat,
  43171. this._loopCount = -1,
  43172. this._startTime = null,
  43173. this.time = 0,
  43174. this.timeScale = 1,
  43175. this._effectiveTimeScale = 1,
  43176. this.weight = 1,
  43177. this._effectiveWeight = 1,
  43178. this.repetitions = 1 / 0,
  43179. this.paused = !1,
  43180. this.enabled = !0,
  43181. this.clampWhenFinished = !1,
  43182. this.zeroSlopeAtStart = !0,
  43183. this.zeroSlopeAtEnd = !0
  43184. }
  43185. ,
  43186. Ci.AnimationMixer._Action.prototype = {
  43187. constructor: Ci.AnimationMixer._Action,
  43188. play: function() {
  43189. return this._mixer._activateAction(this),
  43190. this
  43191. },
  43192. stop: function() {
  43193. return this._mixer._deactivateAction(this),
  43194. this.reset()
  43195. },
  43196. reset: function() {
  43197. return this.paused = !1,
  43198. this.enabled = !0,
  43199. this.time = 0,
  43200. this._loopCount = -1,
  43201. this._startTime = null,
  43202. this.stopFading().stopWarping()
  43203. },
  43204. isRunning: function() {
  43205. return this._startTime,
  43206. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43207. },
  43208. isScheduled: function() {
  43209. return this._mixer._isActiveAction(this)
  43210. },
  43211. startAt: function(e) {
  43212. return this._startTime = e,
  43213. this
  43214. },
  43215. setLoop: function(e, t) {
  43216. return this.loop = e,
  43217. this.repetitions = t,
  43218. this
  43219. },
  43220. setEffectiveWeight: function(e) {
  43221. return this.weight = e,
  43222. this._effectiveWeight = this.enabled ? e : 0,
  43223. this.stopFading()
  43224. },
  43225. getEffectiveWeight: function() {
  43226. return this._effectiveWeight
  43227. },
  43228. fadeIn: function(e) {
  43229. return this._scheduleFading(e, 0, 1)
  43230. },
  43231. fadeOut: function(e) {
  43232. return this._scheduleFading(e, 1, 0)
  43233. },
  43234. crossFadeFrom: function(e, t, i) {
  43235. if (this._mixer,
  43236. e.fadeOut(t),
  43237. this.fadeIn(t),
  43238. i) {
  43239. var n = this._clip.duration
  43240. , r = e._clip.duration
  43241. , o = r / n
  43242. , a = n / r;
  43243. e.warp(1, o, t),
  43244. this.warp(a, 1, t)
  43245. }
  43246. return this
  43247. },
  43248. crossFadeTo: function(e, t, i) {
  43249. return e.crossFadeFrom(this, t, i)
  43250. },
  43251. stopFading: function() {
  43252. var e = this._weightInterpolant;
  43253. return null !== e && (this._weightInterpolant = null,
  43254. this._mixer._takeBackControlInterpolant(e)),
  43255. this
  43256. },
  43257. setEffectiveTimeScale: function(e) {
  43258. return this.timeScale = e,
  43259. this._effectiveTimeScale = this.paused ? 0 : e,
  43260. this.stopWarping()
  43261. },
  43262. getEffectiveTimeScale: function() {
  43263. return this._effectiveTimeScale
  43264. },
  43265. setDuration: function(e) {
  43266. return this.timeScale = this._clip.duration / e,
  43267. this.stopWarping()
  43268. },
  43269. syncWith: function(e) {
  43270. return this.time = e.time,
  43271. this.timeScale = e.timeScale,
  43272. this.stopWarping()
  43273. },
  43274. halt: function(e) {
  43275. return this.warp(this._currentTimeScale, 0, e)
  43276. },
  43277. warp: function(e, t, i) {
  43278. var n = this._mixer
  43279. , r = n.time
  43280. , o = this._timeScaleInterpolant
  43281. , a = this.timeScale;
  43282. null === o && (o = n._lendControlInterpolant(),
  43283. this._timeScaleInterpolant = o);
  43284. var s = o.parameterPositions
  43285. , l = o.sampleValues;
  43286. return s[0] = r,
  43287. s[1] = r + i,
  43288. l[0] = e / a,
  43289. l[1] = t / a,
  43290. this
  43291. },
  43292. stopWarping: function() {
  43293. var e = this._timeScaleInterpolant;
  43294. return null !== e && (this._timeScaleInterpolant = null,
  43295. this._mixer._takeBackControlInterpolant(e)),
  43296. this
  43297. },
  43298. getMixer: function() {
  43299. return this._mixer
  43300. },
  43301. getClip: function() {
  43302. return this._clip
  43303. },
  43304. getRoot: function() {
  43305. return this._localRoot || this._mixer._root
  43306. },
  43307. _update: function(e, t, i, n) {
  43308. var r = this._startTime;
  43309. if (null !== r) {
  43310. var o = (e - r) * i;
  43311. if (o < 0 || 0 === i)
  43312. return;
  43313. this._startTime = null,
  43314. t = i * o
  43315. }
  43316. t *= this._updateTimeScale(e);
  43317. var a = this._updateTime(t)
  43318. , s = this._updateWeight(e);
  43319. if (0 < s)
  43320. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43321. l[h].evaluate(a),
  43322. c[h].accumulate(n, s)
  43323. },
  43324. _updateWeight: function(e) {
  43325. var t = 0;
  43326. if (this.enabled) {
  43327. t = this.weight;
  43328. var i = this._weightInterpolant;
  43329. if (null !== i) {
  43330. var n = i.evaluate(e)[0];
  43331. t *= n,
  43332. e > i.parameterPositions[1] && (this.stopFading(),
  43333. 0 === n && (this.enabled = !1))
  43334. }
  43335. }
  43336. return this._effectiveWeight = t
  43337. },
  43338. _updateTimeScale: function(e) {
  43339. var t = 0;
  43340. if (!this.paused) {
  43341. t = this.timeScale;
  43342. var i = this._timeScaleInterpolant;
  43343. if (null !== i)
  43344. t *= i.evaluate(e)[0],
  43345. e > i.parameterPositions[1] && (this.stopWarping(),
  43346. 0 === t ? this.pause = !0 : this.timeScale = t)
  43347. }
  43348. return this._effectiveTimeScale = t
  43349. },
  43350. _updateTime: function(e) {
  43351. var t = this.time + e;
  43352. if (0 === e)
  43353. return t;
  43354. var i = this._clip.duration
  43355. , n = this.loop
  43356. , r = this._loopCount
  43357. , o = !1;
  43358. switch (n) {
  43359. case Ci.LoopOnce:
  43360. if (-1 === r && (this.loopCount = 0,
  43361. this._setEndings(!0, !0, !1)),
  43362. i <= t)
  43363. t = i;
  43364. else {
  43365. if (!(t < 0))
  43366. break;
  43367. t = 0
  43368. }
  43369. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43370. this._mixer.dispatchEvent({
  43371. type: "finished",
  43372. action: this,
  43373. direction: e < 0 ? -1 : 1
  43374. });
  43375. break;
  43376. case Ci.LoopPingPong:
  43377. o = !0;
  43378. case Ci.LoopRepeat:
  43379. if (-1 === r && (0 < e ? (r = 0,
  43380. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43381. i <= t || t < 0) {
  43382. var a = Math.floor(t / i);
  43383. t -= i * a,
  43384. r += Math.abs(a);
  43385. var s = this.repetitions - r;
  43386. if (s < 0) {
  43387. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43388. t = 0 < e ? i : 0,
  43389. this._mixer.dispatchEvent({
  43390. type: "finished",
  43391. action: this,
  43392. direction: 0 < e ? 1 : -1
  43393. });
  43394. break
  43395. }
  43396. if (0 == s) {
  43397. var l = e < 0;
  43398. this._setEndings(l, !l, o)
  43399. } else
  43400. this._setEndings(!1, !1, o);
  43401. this._loopCount = r,
  43402. this._mixer.dispatchEvent({
  43403. type: "loop",
  43404. action: this,
  43405. loopDelta: a
  43406. })
  43407. }
  43408. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43409. return i - (this.time = t)
  43410. }
  43411. return this.time = t
  43412. },
  43413. _setEndings: function(e, t, i) {
  43414. var n = this._interpolantSettings;
  43415. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43416. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43417. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43418. },
  43419. _scheduleFading: function(e, t, i) {
  43420. var n = this._mixer
  43421. , r = n.time
  43422. , o = this._weightInterpolant;
  43423. null === o && (o = n._lendControlInterpolant(),
  43424. this._weightInterpolant = o);
  43425. var a = o.parameterPositions
  43426. , s = o.sampleValues;
  43427. return a[0] = r,
  43428. s[0] = t,
  43429. a[1] = r + e,
  43430. s[1] = i,
  43431. this
  43432. }
  43433. },
  43434. Object.assign(Ci.AnimationMixer.prototype, {
  43435. _bindAction: function(e, t) {
  43436. var i = e._localRoot || this._root
  43437. , n = e._clip.tracks
  43438. , r = n.length
  43439. , o = e._propertyBindings
  43440. , a = e._interpolants
  43441. , s = i.uuid
  43442. , l = this._bindingsByRootAndName
  43443. , c = l[s];
  43444. void 0 === c && (c = {},
  43445. l[s] = c);
  43446. for (var h = 0; h !== r; ++h) {
  43447. var u = n[h]
  43448. , d = u.name
  43449. , p = c[d];
  43450. if (void 0 !== p)
  43451. o[h] = p;
  43452. else {
  43453. if (void 0 !== (p = o[h])) {
  43454. null === p._cacheIndex && (++p.referenceCount,
  43455. this._addInactiveBinding(p, s, d));
  43456. continue
  43457. }
  43458. var f = t && t._propertyBindings[h].binding.parsedPath;
  43459. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43460. this._addInactiveBinding(p, s, d),
  43461. o[h] = p
  43462. }
  43463. a[h].resultBuffer = p.buffer
  43464. }
  43465. },
  43466. _activateAction: function(e) {
  43467. if (!this._isActiveAction(e)) {
  43468. if (null === e._cacheIndex) {
  43469. var t = (e._localRoot || this._root).uuid
  43470. , i = e._clip.name
  43471. , n = this._actionsByClip[i];
  43472. this._bindAction(e, n && n.knownActions[0]),
  43473. this._addInactiveAction(e, i, t)
  43474. }
  43475. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43476. var s = r[o];
  43477. 0 == s.useCount++ && (this._lendBinding(s),
  43478. s.saveOriginalState())
  43479. }
  43480. this._lendAction(e)
  43481. }
  43482. },
  43483. _deactivateAction: function(e) {
  43484. if (this._isActiveAction(e)) {
  43485. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43486. var r = t[i];
  43487. 0 == --r.useCount && (r.restoreOriginalState(),
  43488. this._takeBackBinding(r))
  43489. }
  43490. this._takeBackAction(e)
  43491. }
  43492. },
  43493. _initMemoryManager: function() {
  43494. this._actions = [],
  43495. this._nActiveActions = 0,
  43496. this._actionsByClip = {},
  43497. this._bindings = [],
  43498. this._nActiveBindings = 0,
  43499. this._bindingsByRootAndName = {},
  43500. this._controlInterpolants = [],
  43501. this._nActiveControlInterpolants = 0;
  43502. var e = this;
  43503. this.stats = {
  43504. actions: {
  43505. get total() {
  43506. return e._actions.length
  43507. },
  43508. get inUse() {
  43509. return e._nActiveActions
  43510. }
  43511. },
  43512. bindings: {
  43513. get total() {
  43514. return e._bindings.length
  43515. },
  43516. get inUse() {
  43517. return e._nActiveBindings
  43518. }
  43519. },
  43520. controlInterpolants: {
  43521. get total() {
  43522. return e._controlInterpolants.length
  43523. },
  43524. get inUse() {
  43525. return e._nActiveControlInterpolants
  43526. }
  43527. }
  43528. }
  43529. },
  43530. _isActiveAction: function(e) {
  43531. var t = e._cacheIndex;
  43532. return null !== t && t < this._nActiveActions
  43533. },
  43534. _addInactiveAction: function(e, t, i) {
  43535. var n = this._actions
  43536. , r = this._actionsByClip
  43537. , o = r[t];
  43538. if (void 0 === o)
  43539. o = {
  43540. knownActions: [e],
  43541. actionByRoot: {}
  43542. },
  43543. e._byClipCacheIndex = 0,
  43544. r[t] = o;
  43545. else {
  43546. var a = o.knownActions;
  43547. e._byClipCacheIndex = a.length,
  43548. a.push(e)
  43549. }
  43550. e._cacheIndex = n.length,
  43551. n.push(e),
  43552. o.actionByRoot[i] = e
  43553. },
  43554. _removeInactiveAction: function(e) {
  43555. var t = this._actions
  43556. , i = t[t.length - 1]
  43557. , n = e._cacheIndex;
  43558. t[i._cacheIndex = n] = i,
  43559. t.pop(),
  43560. e._cacheIndex = null;
  43561. var r = e._clip.name
  43562. , o = this._actionsByClip
  43563. , a = o[r]
  43564. , s = a.knownActions
  43565. , l = s[s.length - 1]
  43566. , c = e._byClipCacheIndex;
  43567. s[l._byClipCacheIndex = c] = l,
  43568. s.pop(),
  43569. e._byClipCacheIndex = null,
  43570. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43571. 0 === s.length && delete o[r],
  43572. this._removeInactiveBindingsForAction(e)
  43573. },
  43574. _removeInactiveBindingsForAction: function(e) {
  43575. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43576. var r = t[i];
  43577. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43578. }
  43579. },
  43580. _lendAction: function(e) {
  43581. var t = this._actions
  43582. , i = e._cacheIndex
  43583. , n = this._nActiveActions++
  43584. , r = t[n];
  43585. t[e._cacheIndex = n] = e,
  43586. t[r._cacheIndex = i] = r
  43587. },
  43588. _takeBackAction: function(e) {
  43589. var t = this._actions
  43590. , i = e._cacheIndex
  43591. , n = --this._nActiveActions
  43592. , r = t[n];
  43593. t[e._cacheIndex = n] = e,
  43594. t[r._cacheIndex = i] = r
  43595. },
  43596. _addInactiveBinding: function(e, t, i) {
  43597. var n = this._bindingsByRootAndName
  43598. , r = n[t]
  43599. , o = this._bindings;
  43600. void 0 === r && (r = {},
  43601. n[t] = r),
  43602. (r[i] = e)._cacheIndex = o.length,
  43603. o.push(e)
  43604. },
  43605. _removeInactiveBinding: function(e) {
  43606. var t = this._bindings
  43607. , i = e.binding
  43608. , n = i.rootNode.uuid
  43609. , r = i.path
  43610. , o = this._bindingsByRootAndName
  43611. , a = o[n]
  43612. , s = t[t.length - 1]
  43613. , l = e._cacheIndex;
  43614. t[s._cacheIndex = l] = s,
  43615. t.pop(),
  43616. delete a[r];
  43617. e: {
  43618. for (var c in a)
  43619. break e;
  43620. delete o[n]
  43621. }
  43622. },
  43623. _lendBinding: function(e) {
  43624. var t = this._bindings
  43625. , i = e._cacheIndex
  43626. , n = this._nActiveBindings++
  43627. , r = t[n];
  43628. t[e._cacheIndex = n] = e,
  43629. t[r._cacheIndex = i] = r
  43630. },
  43631. _takeBackBinding: function(e) {
  43632. var t = this._bindings
  43633. , i = e._cacheIndex
  43634. , n = --this._nActiveBindings
  43635. , r = t[n];
  43636. t[e._cacheIndex = n] = e,
  43637. t[r._cacheIndex = i] = r
  43638. },
  43639. _lendControlInterpolant: function() {
  43640. var e = this._controlInterpolants
  43641. , t = this._nActiveControlInterpolants++
  43642. , i = e[t];
  43643. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43644. i
  43645. },
  43646. _takeBackControlInterpolant: function(e) {
  43647. var t = this._controlInterpolants
  43648. , i = e.__cacheIndex
  43649. , n = --this._nActiveControlInterpolants
  43650. , r = t[n];
  43651. t[e.__cacheIndex = n] = e,
  43652. t[r.__cacheIndex = i] = r
  43653. },
  43654. _controlInterpolantsResultBuffer: new Float32Array(1)
  43655. }),
  43656. Ci.AnimationObjectGroup = function(e) {
  43657. this.uuid = Ci.Math.generateUUID(),
  43658. this._objects = Array.prototype.slice.call(arguments),
  43659. this.nCachedObjects_ = 0;
  43660. var t = {};
  43661. this._indicesByUUID = t;
  43662. for (var i = 0, n = arguments.length; i !== n; ++i)
  43663. t[arguments[i].uuid] = i;
  43664. this._paths = [],
  43665. this._parsedPaths = [],
  43666. this._bindings = [],
  43667. this._bindingsIndicesByPath = {};
  43668. var r = this;
  43669. this.stats = {
  43670. objects: {
  43671. get total() {
  43672. return r._objects.length
  43673. },
  43674. get inUse() {
  43675. return this.total - r.nCachedObjects_
  43676. }
  43677. },
  43678. get bindingsPerObject() {
  43679. return r._bindings.length
  43680. }
  43681. }
  43682. }
  43683. ,
  43684. Ci.AnimationObjectGroup.prototype = {
  43685. constructor: Ci.AnimationObjectGroup,
  43686. add: function(e) {
  43687. 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) {
  43688. var u = arguments[c]
  43689. , d = u.uuid
  43690. , p = r[d];
  43691. if (void 0 === p) {
  43692. p = i++,
  43693. r[d] = p,
  43694. t.push(u);
  43695. for (var f = 0, g = l; f !== g; ++f)
  43696. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43697. } else if (p < n) {
  43698. var m = t[p]
  43699. , v = --n
  43700. , y = t[v];
  43701. t[r[y.uuid] = p] = y,
  43702. t[r[d] = v] = u;
  43703. for (f = 0,
  43704. g = l; f !== g; ++f) {
  43705. var A = s[f]
  43706. , C = A[v]
  43707. , I = A[p];
  43708. A[p] = C,
  43709. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43710. A[v] = I
  43711. }
  43712. } else
  43713. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43714. }
  43715. this.nCachedObjects_ = n
  43716. },
  43717. remove: function(e) {
  43718. for (var t = this._objects, i = (t.length,
  43719. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43720. var l = arguments[a]
  43721. , c = l.uuid
  43722. , h = n[c];
  43723. if (void 0 !== h && i <= h) {
  43724. var u = i++
  43725. , d = t[u];
  43726. t[n[d.uuid] = h] = d,
  43727. t[n[c] = u] = l;
  43728. for (var p = 0, f = o; p !== f; ++p) {
  43729. var g = r[p]
  43730. , m = g[u]
  43731. , v = g[h];
  43732. g[h] = m,
  43733. g[u] = v
  43734. }
  43735. }
  43736. }
  43737. this.nCachedObjects_ = i
  43738. },
  43739. uncache: function(e) {
  43740. 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) {
  43741. var c = arguments[s].uuid
  43742. , h = r[c];
  43743. if (void 0 !== h)
  43744. if (delete r[c],
  43745. h < n) {
  43746. var u = --n
  43747. , d = t[u]
  43748. , p = t[y = --i];
  43749. t[r[d.uuid] = h] = d,
  43750. t[r[p.uuid] = u] = p,
  43751. t.pop();
  43752. for (var f = 0, g = a; f !== g; ++f) {
  43753. var m = (A = o[f])[u]
  43754. , v = A[y];
  43755. A[h] = m,
  43756. A[u] = v,
  43757. A.pop()
  43758. }
  43759. } else {
  43760. var y;
  43761. t[r[(p = t[y = --i]).uuid] = h] = p,
  43762. t.pop();
  43763. for (f = 0,
  43764. g = a; f !== g; ++f) {
  43765. var A;
  43766. (A = o[f])[h] = A[y],
  43767. A.pop()
  43768. }
  43769. }
  43770. }
  43771. this.nCachedObjects_ = n
  43772. },
  43773. subscribe_: function(e, t) {
  43774. var i = this._bindingsIndicesByPath
  43775. , n = i[e]
  43776. , r = this._bindings;
  43777. if (void 0 !== n)
  43778. return r[n];
  43779. var o = this._paths
  43780. , a = this._parsedPaths
  43781. , s = this._objects
  43782. , l = s.length
  43783. , c = this.nCachedObjects_
  43784. , h = new Array(l);
  43785. n = r.length,
  43786. i[e] = n,
  43787. o.push(e),
  43788. a.push(t),
  43789. r.push(h);
  43790. for (var u = c, d = s.length; u !== d; ++u) {
  43791. var p = s[u];
  43792. h[u] = new Ci.PropertyBinding(p,e,t)
  43793. }
  43794. return h
  43795. },
  43796. unsubscribe_: function(e) {
  43797. var t = this._bindingsIndicesByPath
  43798. , i = t[e];
  43799. if (void 0 !== i) {
  43800. var n = this._paths
  43801. , r = this._parsedPaths
  43802. , o = this._bindings
  43803. , a = o.length - 1
  43804. , s = o[a];
  43805. o[t[e[a]] = i] = s,
  43806. o.pop(),
  43807. r[i] = r[a],
  43808. r.pop(),
  43809. n[i] = n[a],
  43810. n.pop()
  43811. }
  43812. }
  43813. },
  43814. Ci.AnimationUtils = {
  43815. arraySlice: function(e, t, i) {
  43816. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43817. },
  43818. convertArray: function(e, t, i) {
  43819. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43820. },
  43821. isTypedArray: function(e) {
  43822. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43823. },
  43824. getKeyframeOrder: function(i) {
  43825. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43826. t[n] = n;
  43827. return t.sort(function(e, t) {
  43828. return i[e] - i[t]
  43829. }),
  43830. t
  43831. },
  43832. sortedArray: function(e, t, i) {
  43833. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43834. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43835. r[a++] = e[s + l];
  43836. return r
  43837. },
  43838. flattenJSON: function(e, t, i, n) {
  43839. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43840. o = e[r++];
  43841. if (void 0 !== o) {
  43842. var a = o[n];
  43843. if (void 0 !== a)
  43844. if (Array.isArray(a))
  43845. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43846. i.push.apply(i, a)),
  43847. void 0 !== (o = e[r++]); )
  43848. ;
  43849. else if (void 0 !== a.toArray)
  43850. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43851. a.toArray(i, i.length)),
  43852. void 0 !== (o = e[r++]); )
  43853. ;
  43854. else
  43855. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43856. i.push(a)),
  43857. void 0 !== (o = e[r++]); )
  43858. ;
  43859. }
  43860. }
  43861. },
  43862. Ci.KeyframeTrack = function(e, t, i, n) {
  43863. if (void 0 === e)
  43864. throw new Error("track name is undefined");
  43865. if (void 0 === t || 0 === t.length)
  43866. throw new Error("no keyframes in track named " + e);
  43867. this.name = e,
  43868. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43869. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43870. this.setInterpolation(n || this.DefaultInterpolation),
  43871. this.validate(),
  43872. this.optimize()
  43873. }
  43874. ,
  43875. Ci.KeyframeTrack.prototype = {
  43876. constructor: Ci.KeyframeTrack,
  43877. TimeBufferType: Float32Array,
  43878. ValueBufferType: Float32Array,
  43879. DefaultInterpolation: Ci.InterpolateLinear,
  43880. InterpolantFactoryMethodDiscrete: function(e) {
  43881. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43882. },
  43883. InterpolantFactoryMethodLinear: function(e) {
  43884. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43885. },
  43886. InterpolantFactoryMethodSmooth: function(e) {
  43887. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43888. },
  43889. setInterpolation: function(e) {
  43890. var t = void 0;
  43891. switch (e) {
  43892. case Ci.InterpolateDiscrete:
  43893. t = this.InterpolantFactoryMethodDiscrete;
  43894. break;
  43895. case Ci.InterpolateLinear:
  43896. t = this.InterpolantFactoryMethodLinear;
  43897. break;
  43898. case Ci.InterpolateSmooth:
  43899. t = this.InterpolantFactoryMethodSmooth
  43900. }
  43901. if (void 0 !== t)
  43902. this.createInterpolant = t;
  43903. else {
  43904. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43905. if (void 0 === this.createInterpolant) {
  43906. if (e === this.DefaultInterpolation)
  43907. throw new Error(i);
  43908. this.setInterpolation(this.DefaultInterpolation)
  43909. }
  43910. console.warn(i)
  43911. }
  43912. },
  43913. getInterpolation: function() {
  43914. switch (this.createInterpolant) {
  43915. case this.InterpolantFactoryMethodDiscrete:
  43916. return Ci.InterpolateDiscrete;
  43917. case this.InterpolantFactoryMethodLinear:
  43918. return Ci.InterpolateLinear;
  43919. case this.InterpolantFactoryMethodSmooth:
  43920. return Ci.InterpolateSmooth
  43921. }
  43922. },
  43923. getValueSize: function() {
  43924. return this.values.length / this.times.length
  43925. },
  43926. shift: function(e) {
  43927. if (0 !== e)
  43928. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43929. t[i] += e;
  43930. return this
  43931. },
  43932. scale: function(e) {
  43933. if (1 !== e)
  43934. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43935. t[i] *= e;
  43936. return this
  43937. },
  43938. trim: function(e, t) {
  43939. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43940. ++r;
  43941. for (; -1 !== o && i[o] > t; )
  43942. --o;
  43943. if (++o,
  43944. 0 !== r || o !== n) {
  43945. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43946. var a = this.getValueSize();
  43947. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43948. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43949. }
  43950. return this
  43951. },
  43952. validate: function() {
  43953. var e = !0
  43954. , t = this.getValueSize();
  43955. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43956. e = !1);
  43957. var i = this.times
  43958. , n = this.values
  43959. , r = i.length;
  43960. 0 === r && (console.error("track is empty", this),
  43961. e = !1);
  43962. for (var o = null, a = 0; a !== r; a++) {
  43963. var s = i[a];
  43964. if ("number" == typeof s && isNaN(s)) {
  43965. console.error("time is not a valid number", this, a, s),
  43966. e = !1;
  43967. break
  43968. }
  43969. if (null !== o && s < o) {
  43970. console.error("out of order keys", this, a, s, o),
  43971. e = !1;
  43972. break
  43973. }
  43974. o = s
  43975. }
  43976. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43977. a = 0;
  43978. for (var l = n.length; a !== l; ++a) {
  43979. var c = n[a];
  43980. if (isNaN(c)) {
  43981. console.error("value is not a valid number", this, a, c),
  43982. e = !1;
  43983. break
  43984. }
  43985. }
  43986. }
  43987. return e
  43988. },
  43989. optimize: function() {
  43990. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43991. var a = !1
  43992. , s = e[r];
  43993. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43994. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43995. var d = t[l + u];
  43996. if (d !== t[c + u] || d !== t[h + u]) {
  43997. a = !0;
  43998. break
  43999. }
  44000. }
  44001. if (a) {
  44002. if (r !== n) {
  44003. e[n] = e[r];
  44004. var p = r * i
  44005. , f = n * i;
  44006. for (u = 0; u !== i; ++u)
  44007. t[f + u] = t[p + u]
  44008. }
  44009. ++n
  44010. }
  44011. }
  44012. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44013. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44014. this
  44015. }
  44016. },
  44017. Object.assign(Ci.KeyframeTrack, {
  44018. parse: function(e) {
  44019. if (void 0 === e.type)
  44020. throw new Error("track type undefined, can not parse");
  44021. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44022. if (void 0 === e.times) {
  44023. console.warn("legacy JSON format detected, converting");
  44024. var i = []
  44025. , n = [];
  44026. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44027. e.times = i,
  44028. e.values = n
  44029. }
  44030. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44031. },
  44032. toJSON: function(e) {
  44033. var t, i = e.constructor;
  44034. if (void 0 !== i.toJSON)
  44035. t = i.toJSON(e);
  44036. else {
  44037. t = {
  44038. name: e.name,
  44039. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44040. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44041. };
  44042. var n = e.getInterpolation();
  44043. n !== e.DefaultInterpolation && (t.interpolation = n)
  44044. }
  44045. return t.type = e.ValueTypeName,
  44046. t
  44047. },
  44048. _getTrackTypeForValueTypeName: function(e) {
  44049. switch (e.toLowerCase()) {
  44050. case "scalar":
  44051. case "double":
  44052. case "float":
  44053. case "number":
  44054. case "integer":
  44055. return Ci.NumberKeyframeTrack;
  44056. case "vector":
  44057. case "vector2":
  44058. case "vector3":
  44059. case "vector4":
  44060. return Ci.VectorKeyframeTrack;
  44061. case "color":
  44062. return Ci.ColorKeyframeTrack;
  44063. case "quaternion":
  44064. return Ci.QuaternionKeyframeTrack;
  44065. case "bool":
  44066. case "boolean":
  44067. return Ci.BooleanKeyframeTrack;
  44068. case "string":
  44069. return Ci.StringKeyframeTrack
  44070. }
  44071. throw new Error("Unsupported typeName: " + e)
  44072. }
  44073. }),
  44074. Ci.PropertyBinding = function(e, t, i) {
  44075. this.path = t,
  44076. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44077. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44078. this.rootNode = e
  44079. }
  44080. ,
  44081. Ci.PropertyBinding.prototype = {
  44082. constructor: Ci.PropertyBinding,
  44083. getValue: function(e, t) {
  44084. this.bind(),
  44085. this.getValue(e, t)
  44086. },
  44087. setValue: function(e, t) {
  44088. this.bind(),
  44089. this.setValue(e, t)
  44090. },
  44091. bind: function() {
  44092. var e = this.node
  44093. , t = this.parsedPath
  44094. , i = t.objectName
  44095. , n = t.propertyName
  44096. , r = t.propertyIndex;
  44097. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44098. this.node = e),
  44099. this.getValue = this._getValue_unavailable,
  44100. this.setValue = this._setValue_unavailable,
  44101. e) {
  44102. if (i) {
  44103. var o = t.objectIndex;
  44104. switch (i) {
  44105. case "materials":
  44106. if (!e.material)
  44107. return void console.error(" can not bind to material as node does not have a material", this);
  44108. if (!e.material.materials)
  44109. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44110. e = e.material.materials;
  44111. break;
  44112. case "bones":
  44113. if (!e.skeleton)
  44114. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44115. e = e.skeleton.bones;
  44116. for (var a = 0; a < e.length; a++)
  44117. if (e[a].name === o) {
  44118. o = a;
  44119. break
  44120. }
  44121. break;
  44122. default:
  44123. if (void 0 === e[i])
  44124. return void console.error(" can not bind to objectName of node, undefined", this);
  44125. e = e[i]
  44126. }
  44127. if (void 0 !== o) {
  44128. if (void 0 === e[o])
  44129. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44130. e = e[o]
  44131. }
  44132. }
  44133. var s = e[n];
  44134. if (s) {
  44135. var l = this.Versioning.None;
  44136. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44137. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44138. this.targetObject = e);
  44139. var c = this.BindingType.Direct;
  44140. if (void 0 !== r) {
  44141. if ("morphTargetInfluences" === n) {
  44142. if (!e.geometry)
  44143. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44144. if (!e.geometry.morphTargets)
  44145. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44146. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44147. if (e.geometry.morphTargets[a].name === r) {
  44148. r = a;
  44149. break
  44150. }
  44151. }
  44152. c = this.BindingType.ArrayElement,
  44153. this.resolvedProperty = s,
  44154. this.propertyIndex = r
  44155. } else
  44156. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44157. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44158. this.resolvedProperty = s) : this.propertyName = n;
  44159. this.getValue = this.GetterByBindingType[c],
  44160. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44161. } else {
  44162. var h = t.nodeName;
  44163. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44164. }
  44165. } else
  44166. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44167. },
  44168. unbind: function() {
  44169. this.node = null,
  44170. this.getValue = this._getValue_unbound,
  44171. this.setValue = this._setValue_unbound
  44172. }
  44173. },
  44174. Object.assign(Ci.PropertyBinding.prototype, {
  44175. _getValue_unavailable: function() {},
  44176. _setValue_unavailable: function() {},
  44177. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44178. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44179. BindingType: {
  44180. Direct: 0,
  44181. EntireArray: 1,
  44182. ArrayElement: 2,
  44183. HasFromToArray: 3
  44184. },
  44185. Versioning: {
  44186. None: 0,
  44187. NeedsUpdate: 1,
  44188. MatrixWorldNeedsUpdate: 2
  44189. },
  44190. GetterByBindingType: [function(e, t) {
  44191. e[t] = this.node[this.propertyName]
  44192. }
  44193. , function(e, t) {
  44194. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44195. e[t++] = i[n]
  44196. }
  44197. , function(e, t) {
  44198. e[t] = this.resolvedProperty[this.propertyIndex]
  44199. }
  44200. , function(e, t) {
  44201. this.resolvedProperty.toArray(e, t)
  44202. }
  44203. ],
  44204. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44205. this.node[this.propertyName] = e[t]
  44206. }
  44207. , function(e, t) {
  44208. this.node[this.propertyName] = e[t],
  44209. this.targetObject.needsUpdate = !0
  44210. }
  44211. , function(e, t) {
  44212. this.node[this.propertyName] = e[t],
  44213. this.targetObject.matrixWorldNeedsUpdate = !0
  44214. }
  44215. ], [function(e, t) {
  44216. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44217. i[n] = e[t++]
  44218. }
  44219. , function(e, t) {
  44220. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44221. i[n] = e[t++];
  44222. this.targetObject.needsUpdate = !0
  44223. }
  44224. , function(e, t) {
  44225. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44226. i[n] = e[t++];
  44227. this.targetObject.matrixWorldNeedsUpdate = !0
  44228. }
  44229. ], [function(e, t) {
  44230. this.resolvedProperty[this.propertyIndex] = e[t]
  44231. }
  44232. , function(e, t) {
  44233. this.resolvedProperty[this.propertyIndex] = e[t],
  44234. this.targetObject.needsUpdate = !0
  44235. }
  44236. , function(e, t) {
  44237. this.resolvedProperty[this.propertyIndex] = e[t],
  44238. this.targetObject.matrixWorldNeedsUpdate = !0
  44239. }
  44240. ], [function(e, t) {
  44241. this.resolvedProperty.fromArray(e, t)
  44242. }
  44243. , function(e, t) {
  44244. this.resolvedProperty.fromArray(e, t),
  44245. this.targetObject.needsUpdate = !0
  44246. }
  44247. , function(e, t) {
  44248. this.resolvedProperty.fromArray(e, t),
  44249. this.targetObject.matrixWorldNeedsUpdate = !0
  44250. }
  44251. ]]
  44252. }),
  44253. Ci.PropertyBinding.Composite = function(e, t, i) {
  44254. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44255. this._targetGroup = e,
  44256. this._bindings = e.subscribe_(t, n)
  44257. }
  44258. ,
  44259. Ci.PropertyBinding.Composite.prototype = {
  44260. constructor: Ci.PropertyBinding.Composite,
  44261. getValue: function(e, t) {
  44262. this.bind();
  44263. var i = this._targetGroup.nCachedObjects_
  44264. , n = this._bindings[i];
  44265. void 0 !== n && n.getValue(e, t)
  44266. },
  44267. setValue: function(e, t) {
  44268. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44269. i[n].setValue(e, t)
  44270. },
  44271. bind: function() {
  44272. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44273. e[t].bind()
  44274. },
  44275. unbind: function() {
  44276. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44277. e[t].unbind()
  44278. }
  44279. },
  44280. Ci.PropertyBinding.create = function(e, t, i) {
  44281. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44282. }
  44283. ,
  44284. Ci.PropertyBinding.parseTrackName = function(e) {
  44285. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44286. , i = t.exec(e);
  44287. if (!i)
  44288. throw new Error("cannot parse trackName at all: " + e);
  44289. i.index === t.lastIndex && t.lastIndex++;
  44290. var n = {
  44291. nodeName: i[3],
  44292. objectName: i[5],
  44293. objectIndex: i[7],
  44294. propertyName: i[9],
  44295. propertyIndex: i[11]
  44296. };
  44297. if (null === n.propertyName || 0 === n.propertyName.length)
  44298. throw new Error("can not parse propertyName from trackName: " + e);
  44299. return n
  44300. }
  44301. ,
  44302. Ci.PropertyBinding.findNode = function(e, r) {
  44303. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44304. return e;
  44305. if (e.skeleton) {
  44306. var t = function(e) {
  44307. for (var t = 0; t < e.bones.length; t++) {
  44308. var i = e.bones[t];
  44309. if (i.name === r)
  44310. return i
  44311. }
  44312. return null
  44313. }(e.skeleton);
  44314. if (t)
  44315. return t
  44316. }
  44317. if (e.children) {
  44318. var o = function(e) {
  44319. for (var t = 0; t < e.length; t++) {
  44320. var i = e[t];
  44321. if (i.name === r || i.uuid === r)
  44322. return i;
  44323. var n = o(i.children);
  44324. if (n)
  44325. return n
  44326. }
  44327. return null
  44328. }
  44329. , i = o(e.children);
  44330. if (i)
  44331. return i
  44332. }
  44333. return null
  44334. }
  44335. ,
  44336. Ci.PropertyMixer = function(e, t, i) {
  44337. this.binding = e,
  44338. this.valueSize = i;
  44339. var n, r = Float64Array;
  44340. switch (t) {
  44341. case "quaternion":
  44342. n = this._slerp;
  44343. break;
  44344. case "string":
  44345. case "bool":
  44346. r = Array,
  44347. n = this._select;
  44348. break;
  44349. default:
  44350. n = this._lerp
  44351. }
  44352. this.buffer = new r(4 * i),
  44353. this._mixBufferRegion = n,
  44354. this.cumulativeWeight = 0,
  44355. this.useCount = 0,
  44356. this.referenceCount = 0
  44357. }
  44358. ,
  44359. Ci.PropertyMixer.prototype = {
  44360. constructor: Ci.PropertyMixer,
  44361. accumulate: function(e, t) {
  44362. var i = this.buffer
  44363. , n = this.valueSize
  44364. , r = e * n + n
  44365. , o = this.cumulativeWeight;
  44366. if (0 === o) {
  44367. for (var a = 0; a !== n; ++a)
  44368. i[r + a] = i[a];
  44369. o = t
  44370. } else {
  44371. var s = t / (o += t);
  44372. this._mixBufferRegion(i, r, 0, s, n)
  44373. }
  44374. this.cumulativeWeight = o
  44375. },
  44376. apply: function(e) {
  44377. var t = this.valueSize
  44378. , i = this.buffer
  44379. , n = e * t + t
  44380. , r = this.cumulativeWeight
  44381. , o = this.binding;
  44382. if (this.cumulativeWeight = 0,
  44383. r < 1) {
  44384. var a = 3 * t;
  44385. this._mixBufferRegion(i, n, a, 1 - r, t)
  44386. }
  44387. for (var s = t, l = t + t; s !== l; ++s)
  44388. if (i[s] !== i[s + t]) {
  44389. o.setValue(i, n);
  44390. break
  44391. }
  44392. },
  44393. saveOriginalState: function() {
  44394. var e = this.binding
  44395. , t = this.buffer
  44396. , i = this.valueSize
  44397. , n = 3 * i;
  44398. e.getValue(t, n);
  44399. for (var r = i, o = n; r !== o; ++r)
  44400. t[r] = t[n + r % i];
  44401. this.cumulativeWeight = 0
  44402. },
  44403. restoreOriginalState: function() {
  44404. var e = 3 * this.valueSize;
  44405. this.binding.setValue(this.buffer, e)
  44406. },
  44407. _select: function(e, t, i, n, r) {
  44408. if (.5 <= n)
  44409. for (var o = 0; o !== r; ++o)
  44410. e[t + o] = e[i + o]
  44411. },
  44412. _slerp: function(e, t, i, n, r) {
  44413. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44414. },
  44415. _lerp: function(e, t, i, n, r) {
  44416. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44417. var s = t + a;
  44418. e[s] = e[s] * o + e[i + a] * n
  44419. }
  44420. }
  44421. },
  44422. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44423. Ci.KeyframeTrack.call(this, e, t, i)
  44424. }
  44425. ,
  44426. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44427. constructor: Ci.BooleanKeyframeTrack,
  44428. ValueTypeName: "bool",
  44429. ValueBufferType: Array,
  44430. DefaultInterpolation: Ci.IntepolateDiscrete,
  44431. InterpolantFactoryMethodLinear: void 0,
  44432. InterpolantFactoryMethodSmooth: void 0
  44433. }),
  44434. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44435. Ci.KeyframeTrack.call(this, e, t, i, n)
  44436. }
  44437. ,
  44438. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44439. constructor: Ci.NumberKeyframeTrack,
  44440. ValueTypeName: "number"
  44441. }),
  44442. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44443. Ci.KeyframeTrack.call(this, e, t, i, n)
  44444. }
  44445. ,
  44446. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44447. constructor: Ci.QuaternionKeyframeTrack,
  44448. ValueTypeName: "quaternion",
  44449. DefaultInterpolation: Ci.InterpolateLinear,
  44450. InterpolantFactoryMethodLinear: function(e) {
  44451. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44452. },
  44453. InterpolantFactoryMethodSmooth: void 0
  44454. }),
  44455. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44456. Ci.KeyframeTrack.call(this, e, t, i, n)
  44457. }
  44458. ,
  44459. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44460. constructor: Ci.StringKeyframeTrack,
  44461. ValueTypeName: "string",
  44462. ValueBufferType: Array,
  44463. DefaultInterpolation: Ci.IntepolateDiscrete,
  44464. InterpolantFactoryMethodLinear: void 0,
  44465. InterpolantFactoryMethodSmooth: void 0
  44466. }),
  44467. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44468. Ci.KeyframeTrack.call(this, e, t, i, n)
  44469. }
  44470. ,
  44471. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44472. constructor: Ci.VectorKeyframeTrack,
  44473. ValueTypeName: "vector"
  44474. }),
  44475. Ci.Audio = function(e) {
  44476. Ci.Object3D.call(this),
  44477. this.type = "Audio",
  44478. this.context = e.context,
  44479. this.source = this.context.createBufferSource(),
  44480. this.source.onended = this.onEnded.bind(this),
  44481. this.gain = this.context.createGain(),
  44482. this.gain.connect(e.getInput()),
  44483. this.autoplay = !1,
  44484. this.startTime = 0,
  44485. this.playbackRate = 1,
  44486. this.isPlaying = !1,
  44487. this.hasPlaybackControl = !0,
  44488. this.sourceType = "empty",
  44489. this.filter = null
  44490. }
  44491. ,
  44492. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44493. Ci.Audio.prototype.constructor = Ci.Audio,
  44494. Ci.Audio.prototype.getOutput = function() {
  44495. return this.gain
  44496. }
  44497. ,
  44498. Ci.Audio.prototype.load = function(e) {
  44499. var t = new Ci.AudioBuffer(this.context);
  44500. return t.load(e),
  44501. this.setBuffer(t),
  44502. this
  44503. }
  44504. ,
  44505. Ci.Audio.prototype.setNodeSource = function(e) {
  44506. return this.hasPlaybackControl = !1,
  44507. this.sourceType = "audioNode",
  44508. this.source = e,
  44509. this.connect(),
  44510. this
  44511. }
  44512. ,
  44513. Ci.Audio.prototype.setBuffer = function(e) {
  44514. var t = this;
  44515. return e.onReady(function(e) {
  44516. t.source.buffer = e,
  44517. t.sourceType = "buffer",
  44518. t.autoplay && t.play()
  44519. }),
  44520. this
  44521. }
  44522. ,
  44523. Ci.Audio.prototype.play = function() {
  44524. if (!0 !== this.isPlaying)
  44525. if (!1 !== this.hasPlaybackControl) {
  44526. var e = this.context.createBufferSource();
  44527. e.buffer = this.source.buffer,
  44528. e.loop = this.source.loop,
  44529. e.onended = this.source.onended,
  44530. e.start(0, this.startTime),
  44531. e.playbackRate.value = this.playbackRate,
  44532. this.isPlaying = !0,
  44533. this.source = e,
  44534. this.connect()
  44535. } else
  44536. console.warn("THREE.Audio: this Audio has no playback control.");
  44537. else
  44538. console.warn("THREE.Audio: Audio is already playing.")
  44539. }
  44540. ,
  44541. Ci.Audio.prototype.pause = function() {
  44542. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44543. void (this.startTime = this.context.currentTime))
  44544. }
  44545. ,
  44546. Ci.Audio.prototype.stop = function() {
  44547. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44548. void (this.startTime = 0))
  44549. }
  44550. ,
  44551. Ci.Audio.prototype.connect = function() {
  44552. null !== this.filter ? (this.source.connect(this.filter),
  44553. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44554. }
  44555. ,
  44556. Ci.Audio.prototype.disconnect = function() {
  44557. null !== this.filter ? (this.source.disconnect(this.filter),
  44558. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44559. }
  44560. ,
  44561. Ci.Audio.prototype.getFilter = function() {
  44562. return this.filter
  44563. }
  44564. ,
  44565. Ci.Audio.prototype.setFilter = function(e) {
  44566. void 0 === e && (e = null),
  44567. !0 === this.isPlaying ? (this.disconnect(),
  44568. this.filter = e,
  44569. this.connect()) : this.filter = e
  44570. }
  44571. ,
  44572. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44573. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44574. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44575. }
  44576. ,
  44577. Ci.Audio.prototype.getPlaybackRate = function() {
  44578. return this.playbackRate
  44579. }
  44580. ,
  44581. Ci.Audio.prototype.onEnded = function() {
  44582. this.isPlaying = !1
  44583. }
  44584. ,
  44585. Ci.Audio.prototype.setLoop = function(e) {
  44586. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44587. }
  44588. ,
  44589. Ci.Audio.prototype.getLoop = function() {
  44590. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44591. !1) : this.source.loop
  44592. }
  44593. ,
  44594. Ci.Audio.prototype.setVolume = function(e) {
  44595. this.gain.gain.value = e
  44596. }
  44597. ,
  44598. Ci.Audio.prototype.getVolume = function() {
  44599. return this.gain.gain.value
  44600. }
  44601. ,
  44602. Ci.AudioAnalyser = function(e, t) {
  44603. this.analyser = e.context.createAnalyser(),
  44604. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44605. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44606. e.getOutput().connect(this.analyser)
  44607. }
  44608. ,
  44609. Ci.AudioAnalyser.prototype = {
  44610. constructor: Ci.AudioAnalyser,
  44611. getData: function() {
  44612. return this.analyser.getByteFrequencyData(this.data),
  44613. this.data
  44614. }
  44615. },
  44616. Ci.AudioBuffer = function(e) {
  44617. this.context = e,
  44618. this.ready = !1,
  44619. this.readyCallbacks = []
  44620. }
  44621. ,
  44622. Ci.AudioBuffer.prototype.load = function(e) {
  44623. var i = this
  44624. , t = new XMLHttpRequest;
  44625. return t.open("GET", e, !0),
  44626. t.responseType = "arraybuffer",
  44627. t.onload = function(e) {
  44628. i.context.decodeAudioData(this.response, function(e) {
  44629. i.buffer = e,
  44630. i.ready = !0;
  44631. for (var t = 0; t < i.readyCallbacks.length; t++)
  44632. i.readyCallbacks[t](i.buffer);
  44633. i.readyCallbacks = []
  44634. })
  44635. }
  44636. ,
  44637. t.send(),
  44638. this
  44639. }
  44640. ,
  44641. Ci.AudioBuffer.prototype.onReady = function(e) {
  44642. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44643. }
  44644. ,
  44645. Ci.PositionalAudio = function(e) {
  44646. Ci.Audio.call(this, e),
  44647. this.panner = this.context.createPanner(),
  44648. this.panner.connect(this.gain)
  44649. }
  44650. ,
  44651. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44652. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44653. Ci.PositionalAudio.prototype.getOutput = function() {
  44654. return this.panner
  44655. }
  44656. ,
  44657. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44658. this.panner.refDistance = e
  44659. }
  44660. ,
  44661. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44662. return this.panner.refDistance
  44663. }
  44664. ,
  44665. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44666. this.panner.rolloffFactor = e
  44667. }
  44668. ,
  44669. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44670. return this.panner.rolloffFactor
  44671. }
  44672. ,
  44673. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44674. this.panner.distanceModel = e
  44675. }
  44676. ,
  44677. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44678. return this.panner.distanceModel
  44679. }
  44680. ,
  44681. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44682. this.panner.maxDistance = e
  44683. }
  44684. ,
  44685. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44686. return this.panner.maxDistance
  44687. }
  44688. ,
  44689. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44690. function(e) {
  44691. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44692. it.setFromMatrixPosition(this.matrixWorld),
  44693. this.panner.setPosition(it.x, it.y, it.z)
  44694. }
  44695. ),
  44696. Ci.AudioListener = function() {
  44697. Ci.Object3D.call(this),
  44698. this.type = "AudioListener",
  44699. this.context = new (window.AudioContext || window.webkitAudioContext),
  44700. this.gain = this.context.createGain(),
  44701. this.gain.connect(this.context.destination),
  44702. this.filter = null
  44703. }
  44704. ,
  44705. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44706. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44707. Ci.AudioListener.prototype.getInput = function() {
  44708. return this.gain
  44709. }
  44710. ,
  44711. Ci.AudioListener.prototype.removeFilter = function() {
  44712. null !== this.filter && (this.gain.disconnect(this.filter),
  44713. this.filter.disconnect(this.context.destination),
  44714. this.gain.connect(this.context.destination),
  44715. this.filter = null)
  44716. }
  44717. ,
  44718. Ci.AudioListener.prototype.setFilter = function(e) {
  44719. null !== this.filter ? (this.gain.disconnect(this.filter),
  44720. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44721. this.filter = e,
  44722. this.gain.connect(this.filter),
  44723. this.filter.connect(this.context.destination)
  44724. }
  44725. ,
  44726. Ci.AudioListener.prototype.getFilter = function() {
  44727. return this.filter
  44728. }
  44729. ,
  44730. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44731. this.gain.gain.value = e
  44732. }
  44733. ,
  44734. Ci.AudioListener.prototype.getMasterVolume = function() {
  44735. return this.gain.gain.value
  44736. }
  44737. ,
  44738. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44739. $e = new Ci.Quaternion,
  44740. et = new Ci.Vector3,
  44741. tt = new Ci.Vector3,
  44742. function(e) {
  44743. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44744. var t = this.context.listener
  44745. , i = this.up;
  44746. this.matrixWorld.decompose(Je, $e, et),
  44747. tt.set(0, 0, -1).applyQuaternion($e),
  44748. t.setPosition(Je.x, Je.y, Je.z),
  44749. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44750. }
  44751. ),
  44752. Ci.Camera = function() {
  44753. Ci.Object3D.call(this),
  44754. this.type = "Camera",
  44755. this.matrixWorldInverse = new Ci.Matrix4,
  44756. this.projectionMatrix = new Ci.Matrix4
  44757. }
  44758. ,
  44759. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44760. Ci.Camera.prototype.constructor = Ci.Camera,
  44761. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44762. function(e) {
  44763. var t = e || new Ci.Vector3;
  44764. return this.getWorldQuaternion(Qe),
  44765. t.set(0, 0, -1).applyQuaternion(Qe)
  44766. }
  44767. ),
  44768. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44769. function(e) {
  44770. Ke.lookAt(this.position, e, this.up),
  44771. this.quaternion.setFromRotationMatrix(Ke)
  44772. }
  44773. ),
  44774. Ci.Camera.prototype.clone = function() {
  44775. return (new this.constructor).copy(this)
  44776. }
  44777. ,
  44778. Ci.Camera.prototype.copy = function(e) {
  44779. return Ci.Object3D.prototype.copy.call(this, e),
  44780. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44781. this.projectionMatrix.copy(e.projectionMatrix),
  44782. this
  44783. }
  44784. ,
  44785. Ci.CubeCamera = function(e, t, i) {
  44786. Ci.Object3D.call(this),
  44787. this.type = "CubeCamera";
  44788. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44789. r.up.set(0, -1, 0),
  44790. r.lookAt(new Ci.Vector3(1,0,0)),
  44791. this.add(r);
  44792. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44793. o.up.set(0, -1, 0),
  44794. o.lookAt(new Ci.Vector3(-1,0,0)),
  44795. this.add(o);
  44796. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44797. a.up.set(0, 0, 1),
  44798. a.lookAt(new Ci.Vector3(0,1,0)),
  44799. this.add(a);
  44800. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44801. s.up.set(0, 0, -1),
  44802. s.lookAt(new Ci.Vector3(0,-1,0)),
  44803. this.add(s);
  44804. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44805. l.up.set(0, -1, 0),
  44806. l.lookAt(new Ci.Vector3(0,0,1)),
  44807. this.add(l);
  44808. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44809. c.up.set(0, -1, 0),
  44810. c.lookAt(new Ci.Vector3(0,0,-1)),
  44811. this.add(c);
  44812. var n = {
  44813. format: Ci.RGBFormat,
  44814. magFilter: Ci.LinearFilter,
  44815. minFilter: Ci.LinearFilter
  44816. };
  44817. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44818. this.updateCubeMap = function(e, t) {
  44819. null === this.parent && this.updateMatrixWorld();
  44820. var i = this.renderTarget
  44821. , n = i.texture.generateMipmaps;
  44822. i.texture.generateMipmaps = !1,
  44823. i.activeCubeFace = 0,
  44824. e.render(t, r, i),
  44825. i.activeCubeFace = 1,
  44826. e.render(t, o, i),
  44827. i.activeCubeFace = 2,
  44828. e.render(t, a, i),
  44829. i.activeCubeFace = 3,
  44830. e.render(t, s, i),
  44831. i.activeCubeFace = 4,
  44832. e.render(t, l, i),
  44833. i.texture.generateMipmaps = n,
  44834. i.activeCubeFace = 5,
  44835. e.render(t, c, i),
  44836. e.setRenderTarget(null)
  44837. }
  44838. }
  44839. ,
  44840. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44841. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44842. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44843. Ci.Camera.call(this),
  44844. this.type = "OrthographicCamera",
  44845. this.zoom = 1,
  44846. this.left = e,
  44847. this.right = t,
  44848. this.top = i,
  44849. this.bottom = n,
  44850. this.near = void 0 !== r ? r : .1,
  44851. this.far = void 0 !== o ? o : 2e3,
  44852. this.updateProjectionMatrix()
  44853. }
  44854. ,
  44855. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44856. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44857. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44858. var e = (this.right - this.left) / (2 * this.zoom)
  44859. , t = (this.top - this.bottom) / (2 * this.zoom)
  44860. , i = (this.right + this.left) / 2
  44861. , n = (this.top + this.bottom) / 2;
  44862. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44863. }
  44864. ,
  44865. Ci.OrthographicCamera.prototype.copy = function(e) {
  44866. return Ci.Camera.prototype.copy.call(this, e),
  44867. this.left = e.left,
  44868. this.right = e.right,
  44869. this.top = e.top,
  44870. this.bottom = e.bottom,
  44871. this.near = e.near,
  44872. this.far = e.far,
  44873. this.zoom = e.zoom,
  44874. this
  44875. }
  44876. ,
  44877. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44878. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44879. return t.object.zoom = this.zoom,
  44880. t.object.left = this.left,
  44881. t.object.right = this.right,
  44882. t.object.top = this.top,
  44883. t.object.bottom = this.bottom,
  44884. t.object.near = this.near,
  44885. t.object.far = this.far,
  44886. t
  44887. }
  44888. ,
  44889. Ci.PerspectiveCamera = function(e, t, i, n) {
  44890. Ci.Camera.call(this),
  44891. this.type = "PerspectiveCamera",
  44892. this.focalLength = 10,
  44893. this.zoom = 1,
  44894. this.fov = void 0 !== e ? e : 50,
  44895. this.aspect = void 0 !== t ? t : 1,
  44896. this.near = void 0 !== i ? i : .1,
  44897. this.far = void 0 !== n ? n : 2e3,
  44898. this.updateProjectionMatrix()
  44899. }
  44900. ,
  44901. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44902. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44903. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44904. void 0 === t && (t = 24),
  44905. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44906. this.updateProjectionMatrix()
  44907. }
  44908. ,
  44909. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44910. this.fullWidth = e,
  44911. this.fullHeight = t,
  44912. this.x = i,
  44913. this.y = n,
  44914. this.width = r,
  44915. this.height = o,
  44916. this.updateProjectionMatrix()
  44917. }
  44918. ,
  44919. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44920. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44921. if (this.fullWidth) {
  44922. var t = this.fullWidth / this.fullHeight
  44923. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44924. , n = -i
  44925. , r = t * n
  44926. , o = t * i
  44927. , a = Math.abs(o - r)
  44928. , s = Math.abs(i - n);
  44929. 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)
  44930. } else
  44931. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44932. }
  44933. ,
  44934. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44935. return Ci.Camera.prototype.copy.call(this, e),
  44936. this.focalLength = e.focalLength,
  44937. this.zoom = e.zoom,
  44938. this.fov = e.fov,
  44939. this.aspect = e.aspect,
  44940. this.near = e.near,
  44941. this.far = e.far,
  44942. this
  44943. }
  44944. ,
  44945. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44946. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44947. return t.object.focalLength = this.focalLength,
  44948. t.object.zoom = this.zoom,
  44949. t.object.fov = this.fov,
  44950. t.object.aspect = this.aspect,
  44951. t.object.near = this.near,
  44952. t.object.far = this.far,
  44953. t
  44954. }
  44955. ,
  44956. Ci.StereoCamera = function() {
  44957. this.type = "StereoCamera",
  44958. this.aspect = 1,
  44959. this.cameraL = new Ci.PerspectiveCamera,
  44960. this.cameraL.layers.enable(1),
  44961. this.cameraL.matrixAutoUpdate = !1,
  44962. this.cameraR = new Ci.PerspectiveCamera,
  44963. this.cameraR.layers.enable(2),
  44964. this.cameraR.matrixAutoUpdate = !1
  44965. }
  44966. ,
  44967. Ci.StereoCamera.prototype = {
  44968. constructor: Ci.StereoCamera,
  44969. update: (Xe = new Ci.Matrix4,
  44970. Ze = new Ci.Matrix4,
  44971. function(e) {
  44972. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44973. Ge = e.focalLength,
  44974. We = e.fov,
  44975. je = e.aspect * this.aspect,
  44976. Ye = e.near,
  44977. qe = e.far;
  44978. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44979. Ze.elements[12] = -.032,
  44980. Xe.elements[12] = .032,
  44981. t = -o * je + r,
  44982. i = o * je + r,
  44983. n.elements[0] = 2 * Ye / (i - t),
  44984. n.elements[8] = (i + t) / (i - t),
  44985. this.cameraL.projectionMatrix.copy(n),
  44986. t = -o * je - r,
  44987. i = o * je - r,
  44988. n.elements[0] = 2 * Ye / (i - t),
  44989. n.elements[8] = (i + t) / (i - t),
  44990. this.cameraR.projectionMatrix.copy(n)
  44991. }
  44992. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44993. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44994. }
  44995. )
  44996. },
  44997. Ci.Light = function(e, t) {
  44998. Ci.Object3D.call(this),
  44999. this.type = "Light",
  45000. this.color = new Ci.Color(e),
  45001. this.intensity = void 0 !== t ? t : 1,
  45002. this.receiveShadow = void 0
  45003. }
  45004. ,
  45005. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45006. Ci.Light.prototype.constructor = Ci.Light,
  45007. Ci.Light.prototype.copy = function(e) {
  45008. return Ci.Object3D.prototype.copy.call(this, e),
  45009. this.color.copy(e.color),
  45010. this.intensity = e.intensity,
  45011. this
  45012. }
  45013. ,
  45014. Ci.Light.prototype.toJSON = function(e) {
  45015. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45016. return t.object.color = this.color.getHex(),
  45017. t.object.intensity = this.intensity,
  45018. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45019. void 0 !== this.distance && (t.object.distance = this.distance),
  45020. void 0 !== this.angle && (t.object.angle = this.angle),
  45021. void 0 !== this.decay && (t.object.decay = this.decay),
  45022. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45023. t
  45024. }
  45025. ,
  45026. Ci.LightShadow = function(e) {
  45027. this.camera = e,
  45028. this.bias = 0,
  45029. this.radius = 1,
  45030. this.mapSize = new Ci.Vector2(512,512),
  45031. this.map = null,
  45032. this.matrix = new Ci.Matrix4
  45033. }
  45034. ,
  45035. Ci.LightShadow.prototype = {
  45036. constructor: Ci.LightShadow,
  45037. copy: function(e) {
  45038. return this.camera = e.camera.clone(),
  45039. this.bias = e.bias,
  45040. this.radius = e.radius,
  45041. this.mapSize.copy(e.mapSize),
  45042. this
  45043. },
  45044. clone: function() {
  45045. return (new this.constructor).copy(this)
  45046. }
  45047. },
  45048. Ci.AmbientLight = function(e, t) {
  45049. Ci.Light.call(this, e, t),
  45050. this.type = "AmbientLight",
  45051. this.castShadow = void 0
  45052. }
  45053. ,
  45054. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45055. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45056. Ci.DirectionalLight = function(e, t) {
  45057. Ci.Light.call(this, e, t),
  45058. this.type = "DirectionalLight",
  45059. this.position.set(0, 1, 0),
  45060. this.updateMatrix(),
  45061. this.target = new Ci.Object3D,
  45062. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45063. }
  45064. ,
  45065. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45066. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45067. Ci.DirectionalLight.prototype.copy = function(e) {
  45068. return Ci.Light.prototype.copy.call(this, e),
  45069. this.target = e.target.clone(),
  45070. this.shadow = e.shadow.clone(),
  45071. this
  45072. }
  45073. ,
  45074. Ci.HemisphereLight = function(e, t, i) {
  45075. Ci.Light.call(this, e, i),
  45076. this.type = "HemisphereLight",
  45077. this.castShadow = void 0,
  45078. this.position.set(0, 1, 0),
  45079. this.updateMatrix(),
  45080. this.groundColor = new Ci.Color(t)
  45081. }
  45082. ,
  45083. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45084. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45085. Ci.HemisphereLight.prototype.copy = function(e) {
  45086. return Ci.Light.prototype.copy.call(this, e),
  45087. this.groundColor.copy(e.groundColor),
  45088. this
  45089. }
  45090. ,
  45091. Ci.PointLight = function(e, t, i, n) {
  45092. Ci.Light.call(this, e, t),
  45093. this.type = "PointLight",
  45094. this.distance = void 0 !== i ? i : 0,
  45095. this.decay = void 0 !== n ? n : 1,
  45096. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45097. }
  45098. ,
  45099. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45100. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45101. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45102. get: function() {
  45103. return 4 * this.intensity * Math.PI
  45104. },
  45105. set: function(e) {
  45106. this.intensity = e / (4 * Math.PI)
  45107. }
  45108. }),
  45109. Ci.PointLight.prototype.copy = function(e) {
  45110. return Ci.Light.prototype.copy.call(this, e),
  45111. this.distance = e.distance,
  45112. this.decay = e.decay,
  45113. this.shadow = e.shadow.clone(),
  45114. this
  45115. }
  45116. ,
  45117. Ci.SpotLight = function(e, t, i, n, r, o) {
  45118. Ci.Light.call(this, e, t),
  45119. this.type = "SpotLight",
  45120. this.position.set(0, 1, 0),
  45121. this.updateMatrix(),
  45122. this.target = new Ci.Object3D,
  45123. this.distance = void 0 !== i ? i : 0,
  45124. this.angle = void 0 !== n ? n : Math.PI / 3,
  45125. this.penumbra = void 0 !== r ? r : 0,
  45126. this.decay = void 0 !== o ? o : 1,
  45127. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45128. }
  45129. ,
  45130. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45131. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45132. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45133. get: function() {
  45134. return this.intensity * Math.PI
  45135. },
  45136. set: function(e) {
  45137. this.intensity = e / Math.PI
  45138. }
  45139. }),
  45140. Ci.SpotLight.prototype.copy = function(e) {
  45141. return Ci.Light.prototype.copy.call(this, e),
  45142. this.distance = e.distance,
  45143. this.angle = e.angle,
  45144. this.penumbra = e.penumbra,
  45145. this.decay = e.decay,
  45146. this.target = e.target.clone(),
  45147. this.shadow = e.shadow.clone(),
  45148. this
  45149. }
  45150. ,
  45151. Ci.Cache = {
  45152. enabled: !1,
  45153. files: {},
  45154. add: function(e, t) {
  45155. !1 !== this.enabled && (this.files[e] = t)
  45156. },
  45157. get: function(e) {
  45158. if (!1 !== this.enabled)
  45159. return this.files[e]
  45160. },
  45161. remove: function(e) {
  45162. delete this.files[e]
  45163. },
  45164. clear: function() {
  45165. this.files = {}
  45166. }
  45167. },
  45168. Ci.Loader = function() {
  45169. this.onLoadStart = function() {}
  45170. ,
  45171. this.onLoadProgress = function() {}
  45172. ,
  45173. this.onLoadComplete = function() {}
  45174. }
  45175. ,
  45176. Ci.Loader.prototype = {
  45177. constructor: Ci.Loader,
  45178. crossOrigin: void 0,
  45179. extractUrlBase: function(e) {
  45180. var t = e.split("/");
  45181. return 1 === t.length ? "./" : (t.pop(),
  45182. t.join("/") + "/")
  45183. },
  45184. initMaterials: function(e, t, i) {
  45185. for (var n = [], r = 0; r < e.length; ++r)
  45186. n[r] = this.createMaterial(e[r], t, i);
  45187. return n
  45188. },
  45189. createMaterial: function(e, c, h) {
  45190. function t(e, t, i, n, r) {
  45191. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45192. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45193. He.load(a)),
  45194. void 0 !== t && (o.repeat.fromArray(t),
  45195. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45196. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45197. void 0 !== i && o.offset.fromArray(i),
  45198. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45199. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45200. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45201. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45202. void 0 !== r && (o.anisotropy = r);
  45203. var l = Ci.Math.generateUUID();
  45204. return u[l] = o,
  45205. l
  45206. }
  45207. void 0 === Ue && (Ue = new Ci.Color),
  45208. void 0 === He && (He = new Ci.TextureLoader),
  45209. void 0 === ze && (ze = new Ci.MaterialLoader);
  45210. var u = {}
  45211. , i = {
  45212. uuid: Ci.Math.generateUUID(),
  45213. type: "MeshLambertMaterial"
  45214. };
  45215. for (var n in e) {
  45216. var r = e[n];
  45217. switch (n) {
  45218. case "DbgColor":
  45219. case "DbgIndex":
  45220. case "opticalDensity":
  45221. case "illumination":
  45222. break;
  45223. case "DbgName":
  45224. i.name = r;
  45225. break;
  45226. case "blending":
  45227. i.blending = Ci[r];
  45228. break;
  45229. case "colorAmbient":
  45230. case "mapAmbient":
  45231. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45232. break;
  45233. case "colorDiffuse":
  45234. i.color = Ue.fromArray(r).getHex();
  45235. break;
  45236. case "colorSpecular":
  45237. i.specular = Ue.fromArray(r).getHex();
  45238. break;
  45239. case "colorEmissive":
  45240. i.emissive = Ue.fromArray(r).getHex();
  45241. break;
  45242. case "specularCoef":
  45243. i.shininess = r;
  45244. break;
  45245. case "shading":
  45246. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45247. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45248. break;
  45249. case "mapDiffuse":
  45250. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45251. break;
  45252. case "mapDiffuseRepeat":
  45253. case "mapDiffuseOffset":
  45254. case "mapDiffuseWrap":
  45255. case "mapDiffuseAnisotropy":
  45256. break;
  45257. case "mapLight":
  45258. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45259. break;
  45260. case "mapLightRepeat":
  45261. case "mapLightOffset":
  45262. case "mapLightWrap":
  45263. case "mapLightAnisotropy":
  45264. break;
  45265. case "mapAO":
  45266. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45267. break;
  45268. case "mapAORepeat":
  45269. case "mapAOOffset":
  45270. case "mapAOWrap":
  45271. case "mapAOAnisotropy":
  45272. break;
  45273. case "mapBump":
  45274. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45275. break;
  45276. case "mapBumpScale":
  45277. i.bumpScale = r;
  45278. break;
  45279. case "mapBumpRepeat":
  45280. case "mapBumpOffset":
  45281. case "mapBumpWrap":
  45282. case "mapBumpAnisotropy":
  45283. break;
  45284. case "mapNormal":
  45285. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45286. break;
  45287. case "mapNormalFactor":
  45288. i.normalScale = [r, r];
  45289. break;
  45290. case "mapNormalRepeat":
  45291. case "mapNormalOffset":
  45292. case "mapNormalWrap":
  45293. case "mapNormalAnisotropy":
  45294. break;
  45295. case "mapSpecular":
  45296. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45297. break;
  45298. case "mapSpecularRepeat":
  45299. case "mapSpecularOffset":
  45300. case "mapSpecularWrap":
  45301. case "mapSpecularAnisotropy":
  45302. break;
  45303. case "mapAlpha":
  45304. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45305. break;
  45306. case "mapAlphaRepeat":
  45307. case "mapAlphaOffset":
  45308. case "mapAlphaWrap":
  45309. case "mapAlphaAnisotropy":
  45310. break;
  45311. case "flipSided":
  45312. i.side = Ci.BackSide;
  45313. break;
  45314. case "doubleSided":
  45315. i.side = Ci.DoubleSide;
  45316. break;
  45317. case "transparency":
  45318. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45319. i.opacity = r;
  45320. break;
  45321. case "depthTest":
  45322. case "depthWrite":
  45323. case "colorWrite":
  45324. case "opacity":
  45325. case "reflectivity":
  45326. case "transparent":
  45327. case "visible":
  45328. case "wireframe":
  45329. i[n] = r;
  45330. break;
  45331. case "vertexColors":
  45332. !0 === r && (i.vertexColors = Ci.VertexColors),
  45333. "face" === r && (i.vertexColors = Ci.FaceColors);
  45334. break;
  45335. default:
  45336. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45337. }
  45338. }
  45339. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45340. "MeshPhongMaterial" !== i.type && delete i.specular,
  45341. i.opacity < 1 && (i.transparent = !0),
  45342. ze.setTextures(u),
  45343. ze.parse(i)
  45344. }
  45345. },
  45346. Ci.Loader.Handlers = {
  45347. handlers: [],
  45348. add: function(e, t) {
  45349. this.handlers.push(e, t)
  45350. },
  45351. get: function(e) {
  45352. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45353. var r = t[i]
  45354. , o = t[i + 1];
  45355. if (r.test(e))
  45356. return o
  45357. }
  45358. return null
  45359. }
  45360. },
  45361. Ci.XHRLoader = function(e) {
  45362. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45363. }
  45364. ,
  45365. Ci.XHRLoader.prototype = {
  45366. constructor: Ci.XHRLoader,
  45367. load: function(i, n, t, r) {
  45368. void 0 !== this.path && (i = this.path + i);
  45369. var o = this
  45370. , e = Ci.Cache.get(i);
  45371. if (void 0 !== e)
  45372. return n && setTimeout(function() {
  45373. n(e)
  45374. }, 0),
  45375. e;
  45376. var a = new XMLHttpRequest;
  45377. return a.overrideMimeType("text/plain"),
  45378. a.open("GET", i, !0),
  45379. a.addEventListener("load", function(e) {
  45380. var t = e.target.response;
  45381. Ci.Cache.add(i, t),
  45382. 200 === this.status ? (n && n(t),
  45383. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45384. n && n(t),
  45385. o.manager.itemEnd(i)) : (r && r(e),
  45386. o.manager.itemError(i))
  45387. }, !1),
  45388. void 0 !== t && a.addEventListener("progress", function(e) {
  45389. t(e)
  45390. }, !1),
  45391. a.addEventListener("error", function(e) {
  45392. r && r(e),
  45393. o.manager.itemError(i)
  45394. }, !1),
  45395. void 0 !== this.responseType && (a.responseType = this.responseType),
  45396. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45397. a.send(null),
  45398. o.manager.itemStart(i),
  45399. a
  45400. },
  45401. setPath: function(e) {
  45402. this.path = e
  45403. },
  45404. setResponseType: function(e) {
  45405. this.responseType = e
  45406. },
  45407. setWithCredentials: function(e) {
  45408. this.withCredentials = e
  45409. }
  45410. },
  45411. Ci.FontLoader = function(e) {
  45412. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45413. }
  45414. ,
  45415. Ci.FontLoader.prototype = {
  45416. constructor: Ci.FontLoader,
  45417. load: function(e, t, i, n) {
  45418. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45419. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45420. }, i, n)
  45421. }
  45422. },
  45423. Ci.ImageLoader = function(e) {
  45424. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45425. }
  45426. ,
  45427. Ci.ImageLoader.prototype = {
  45428. constructor: Ci.ImageLoader,
  45429. load: function(t, i, n, r) {
  45430. void 0 !== this.path && (t = this.path + t);
  45431. var o = this
  45432. , e = Ci.Cache.get(t);
  45433. if (void 0 !== e)
  45434. return o.manager.itemStart(t),
  45435. i ? setTimeout(function() {
  45436. i(e),
  45437. o.manager.itemEnd(t)
  45438. }, 0) : o.manager.itemEnd(t),
  45439. e;
  45440. var a = document.createElement("img");
  45441. return a.addEventListener("load", function(e) {
  45442. Ci.Cache.add(t, this),
  45443. i && i(this),
  45444. o.manager.itemEnd(t)
  45445. }, !1),
  45446. void 0 !== n && a.addEventListener("progress", function(e) {
  45447. n(e)
  45448. }, !1),
  45449. a.addEventListener("error", function(e) {
  45450. r && r(e),
  45451. o.manager.itemError(t)
  45452. }, !1),
  45453. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45454. o.manager.itemStart(t),
  45455. a.src = t,
  45456. a
  45457. },
  45458. setCrossOrigin: function(e) {
  45459. this.crossOrigin = e
  45460. },
  45461. setPath: function(e) {
  45462. this.path = e
  45463. }
  45464. },
  45465. Ci.JSONLoader = function(e) {
  45466. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45467. e = void 0),
  45468. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45469. this.withCredentials = !1
  45470. }
  45471. ,
  45472. Ci.JSONLoader.prototype = {
  45473. constructor: Ci.JSONLoader,
  45474. get statusDomElement() {
  45475. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45476. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45477. this._statusDomElement
  45478. },
  45479. load: function(o, a, e, t) {
  45480. var s = this
  45481. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45482. , i = new Ci.XHRLoader(this.manager);
  45483. i.setWithCredentials(this.withCredentials),
  45484. i.load(o, function(e) {
  45485. var t = JSON.parse(e)
  45486. , i = t.metadata;
  45487. if (void 0 !== i) {
  45488. var n = i.type;
  45489. if (void 0 !== n) {
  45490. if ("object" === n.toLowerCase())
  45491. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45492. if ("scene" === n.toLowerCase())
  45493. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45494. }
  45495. }
  45496. var r = s.parse(t, l);
  45497. a(r.geometry, r.materials)
  45498. }, e, t)
  45499. },
  45500. setTexturePath: function(e) {
  45501. this.texturePath = e
  45502. },
  45503. parse: function(D, e) {
  45504. var N = new Ci.Geometry
  45505. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45506. if (function(e) {
  45507. function t(e, t) {
  45508. return e & 1 << t
  45509. }
  45510. 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;
  45511. if (void 0 !== D.uvs) {
  45512. for (i = 0; i < D.uvs.length; i++)
  45513. D.uvs[i].length && L++;
  45514. for (i = 0; i < L; i++)
  45515. N.faceVertexUvs[i] = []
  45516. }
  45517. for (o = 0,
  45518. a = R.length; o < a; )
  45519. (A = new Ci.Vector3).x = R[o++] * e,
  45520. A.y = R[o++] * e,
  45521. A.z = R[o++] * e,
  45522. N.vertices.push(A);
  45523. for (o = 0,
  45524. a = M.length; o < a; )
  45525. if (d = t(u = M[o++], 0),
  45526. p = t(u, 1),
  45527. f = t(u, 3),
  45528. g = t(u, 4),
  45529. m = t(u, 5),
  45530. v = t(u, 6),
  45531. y = t(u, 7),
  45532. d) {
  45533. if ((I = new Ci.Face3).a = M[o],
  45534. I.b = M[o + 1],
  45535. I.c = M[o + 3],
  45536. (E = new Ci.Face3).a = M[o + 1],
  45537. E.b = M[o + 2],
  45538. E.c = M[o + 3],
  45539. o += 4,
  45540. p && (h = M[o++],
  45541. I.materialIndex = h,
  45542. E.materialIndex = h),
  45543. r = N.faces.length,
  45544. f)
  45545. for (i = 0; i < L; i++)
  45546. for (w = D.uvs[i],
  45547. N.faceVertexUvs[i][r] = [],
  45548. N.faceVertexUvs[i][r + 1] = [],
  45549. n = 0; n < 4; n++)
  45550. x = w[2 * (c = M[o++])],
  45551. S = w[2 * c + 1],
  45552. T = new Ci.Vector2(x,S),
  45553. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45554. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45555. if (g && (l = 3 * M[o++],
  45556. I.normal.set(P[l++], P[l++], P[l]),
  45557. E.normal.copy(I.normal)),
  45558. m)
  45559. for (i = 0; i < 4; i++)
  45560. l = 3 * M[o++],
  45561. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45562. 2 !== i && I.vertexNormals.push(b),
  45563. 0 !== i && E.vertexNormals.push(b);
  45564. if (v && (_ = O[s = M[o++]],
  45565. I.color.setHex(_),
  45566. E.color.setHex(_)),
  45567. y)
  45568. for (i = 0; i < 4; i++)
  45569. _ = O[s = M[o++]],
  45570. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45571. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45572. N.faces.push(I),
  45573. N.faces.push(E)
  45574. } else {
  45575. if ((C = new Ci.Face3).a = M[o++],
  45576. C.b = M[o++],
  45577. C.c = M[o++],
  45578. p && (h = M[o++],
  45579. C.materialIndex = h),
  45580. r = N.faces.length,
  45581. f)
  45582. for (i = 0; i < L; i++)
  45583. for (w = D.uvs[i],
  45584. N.faceVertexUvs[i][r] = [],
  45585. n = 0; n < 3; n++)
  45586. x = w[2 * (c = M[o++])],
  45587. S = w[2 * c + 1],
  45588. T = new Ci.Vector2(x,S),
  45589. N.faceVertexUvs[i][r].push(T);
  45590. if (g && (l = 3 * M[o++],
  45591. C.normal.set(P[l++], P[l++], P[l])),
  45592. m)
  45593. for (i = 0; i < 3; i++)
  45594. l = 3 * M[o++],
  45595. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45596. C.vertexNormals.push(b);
  45597. if (v && (s = M[o++],
  45598. C.color.setHex(O[s])),
  45599. y)
  45600. for (i = 0; i < 3; i++)
  45601. s = M[o++],
  45602. C.vertexColors.push(new Ci.Color(O[s]));
  45603. N.faces.push(C)
  45604. }
  45605. }(t),
  45606. function() {
  45607. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45608. if (D.skinWeights)
  45609. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45610. var n = D.skinWeights[t]
  45611. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45612. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45613. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45614. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45615. }
  45616. if (D.skinIndices)
  45617. for (t = 0,
  45618. i = D.skinIndices.length; t < i; t += e) {
  45619. var s = D.skinIndices[t]
  45620. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45621. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45622. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45623. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45624. }
  45625. N.bones = D.bones,
  45626. 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.")
  45627. }(),
  45628. function(e) {
  45629. if (void 0 !== D.morphTargets)
  45630. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45631. N.morphTargets[t] = {},
  45632. N.morphTargets[t].name = D.morphTargets[t].name,
  45633. N.morphTargets[t].vertices = [];
  45634. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45635. var s = new Ci.Vector3;
  45636. s.x = r[o] * e,
  45637. s.y = r[o + 1] * e,
  45638. s.z = r[o + 2] * e,
  45639. n.push(s)
  45640. }
  45641. }
  45642. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45643. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45644. var l = N.faces
  45645. , c = D.morphColors[0].colors;
  45646. for (t = 0,
  45647. i = l.length; t < i; t++)
  45648. l[t].color.fromArray(c, 3 * t)
  45649. }
  45650. }(t),
  45651. function() {
  45652. var e = []
  45653. , t = [];
  45654. void 0 !== D.animation && t.push(D.animation),
  45655. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45656. for (var i = 0; i < t.length; i++) {
  45657. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45658. n && e.push(n)
  45659. }
  45660. if (N.morphTargets) {
  45661. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45662. e = e.concat(r)
  45663. }
  45664. 0 < e.length && (N.animations = e)
  45665. }(),
  45666. N.computeFaceNormals(),
  45667. N.computeBoundingSphere(),
  45668. void 0 === D.materials || 0 === D.materials.length)
  45669. return {
  45670. geometry: N
  45671. };
  45672. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45673. return {
  45674. geometry: N,
  45675. materials: i
  45676. }
  45677. }
  45678. },
  45679. Ci.LoadingManager = function(e, t, i) {
  45680. var n = this
  45681. , r = !1
  45682. , o = 0
  45683. , a = 0;
  45684. this.onStart = void 0,
  45685. this.onLoad = e,
  45686. this.onProgress = t,
  45687. this.onError = i,
  45688. this.itemStart = function(e) {
  45689. a++,
  45690. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45691. r = !0
  45692. }
  45693. ,
  45694. this.itemEnd = function(e) {
  45695. o++,
  45696. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45697. o === a && (r = !1,
  45698. void 0 !== n.onLoad && n.onLoad())
  45699. }
  45700. ,
  45701. this.itemError = function(e) {
  45702. void 0 !== n.onError && n.onError(e)
  45703. }
  45704. }
  45705. ,
  45706. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45707. Ci.BufferGeometryLoader = function(e) {
  45708. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45709. }
  45710. ,
  45711. Ci.BufferGeometryLoader.prototype = {
  45712. constructor: Ci.BufferGeometryLoader,
  45713. load: function(e, t, i, n) {
  45714. var r = this;
  45715. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45716. t(r.parse(JSON.parse(e)))
  45717. }, i, n)
  45718. },
  45719. parse: function(e) {
  45720. var t = new Ci.BufferGeometry
  45721. , i = e.data.index
  45722. , n = {
  45723. Int8Array: Int8Array,
  45724. Uint8Array: Uint8Array,
  45725. Uint8ClampedArray: Uint8ClampedArray,
  45726. Int16Array: Int16Array,
  45727. Uint16Array: Uint16Array,
  45728. Int32Array: Int32Array,
  45729. Uint32Array: Uint32Array,
  45730. Float32Array: Float32Array,
  45731. Float64Array: Float64Array
  45732. };
  45733. if (void 0 !== i) {
  45734. var r = new n[i.type](i.array);
  45735. t.setIndex(new Ci.BufferAttribute(r,1))
  45736. }
  45737. var o = e.data.attributes;
  45738. for (var a in o) {
  45739. var s = o[a];
  45740. r = new n[s.type](s.array);
  45741. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45742. }
  45743. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45744. if (void 0 !== l)
  45745. for (var c = 0, h = l.length; c !== h; ++c) {
  45746. var u = l[c];
  45747. t.addGroup(u.start, u.count, u.materialIndex)
  45748. }
  45749. var d = e.data.boundingSphere;
  45750. if (void 0 !== d) {
  45751. var p = new Ci.Vector3;
  45752. void 0 !== d.center && p.fromArray(d.center),
  45753. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45754. }
  45755. return t
  45756. }
  45757. },
  45758. Ci.MaterialLoader = function(e) {
  45759. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45760. this.textures = {}
  45761. }
  45762. ,
  45763. Ci.MaterialLoader.prototype = {
  45764. constructor: Ci.MaterialLoader,
  45765. load: function(e, t, i, n) {
  45766. var r = this;
  45767. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45768. t(r.parse(JSON.parse(e)))
  45769. }, i, n)
  45770. },
  45771. setTextures: function(e) {
  45772. this.textures = e
  45773. },
  45774. getTexture: function(e) {
  45775. var t = this.textures;
  45776. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45777. t[e]
  45778. },
  45779. parse: function(e) {
  45780. var t = new Ci[e.type];
  45781. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45782. void 0 !== e.name && (t.name = e.name),
  45783. void 0 !== e.color && t.color.setHex(e.color),
  45784. void 0 !== e.roughness && (t.roughness = e.roughness),
  45785. void 0 !== e.metalness && (t.metalness = e.metalness),
  45786. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45787. void 0 !== e.specular && t.specular.setHex(e.specular),
  45788. void 0 !== e.shininess && (t.shininess = e.shininess),
  45789. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45790. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45791. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45792. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45793. void 0 !== e.shading && (t.shading = e.shading),
  45794. void 0 !== e.blending && (t.blending = e.blending),
  45795. void 0 !== e.side && (t.side = e.side),
  45796. void 0 !== e.opacity && (t.opacity = e.opacity),
  45797. void 0 !== e.transparent && (t.transparent = e.transparent),
  45798. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45799. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45800. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45801. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45802. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45803. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45804. void 0 !== e.size && (t.size = e.size),
  45805. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45806. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45807. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45808. t.transparent = !0),
  45809. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45810. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45811. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45812. void 0 !== e.normalScale) {
  45813. var i = e.normalScale;
  45814. !1 === Array.isArray(i) && (i = [i, i]),
  45815. t.normalScale = (new Ci.Vector2).fromArray(i)
  45816. }
  45817. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45818. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45819. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45820. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45821. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45822. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45823. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45824. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45825. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45826. t.combine = Ci.MultiplyOperation),
  45827. e.reflectivity && (t.reflectivity = e.reflectivity),
  45828. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45829. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45830. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45831. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45832. void 0 !== e.materials)
  45833. for (var n = 0, r = e.materials.length; n < r; n++)
  45834. t.materials.push(this.parse(e.materials[n]));
  45835. return t
  45836. }
  45837. },
  45838. Ci.ObjectLoader = function(e) {
  45839. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45840. this.texturePath = ""
  45841. }
  45842. ,
  45843. Ci.ObjectLoader.prototype = {
  45844. constructor: Ci.ObjectLoader,
  45845. load: function(e, t, i, n) {
  45846. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45847. var r = this;
  45848. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45849. r.parse(JSON.parse(e), t)
  45850. }, i, n)
  45851. },
  45852. setTexturePath: function(e) {
  45853. this.texturePath = e
  45854. },
  45855. setCrossOrigin: function(e) {
  45856. this.crossOrigin = e
  45857. },
  45858. parse: function(e, t) {
  45859. var i = this.parseGeometries(e.geometries)
  45860. , n = this.parseImages(e.images, function() {
  45861. void 0 !== t && t(a)
  45862. })
  45863. , r = this.parseTextures(e.textures, n)
  45864. , o = this.parseMaterials(e.materials, r)
  45865. , a = this.parseObject(e.object, i, o);
  45866. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45867. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45868. a
  45869. },
  45870. parseGeometries: function(e) {
  45871. var t = {};
  45872. if (void 0 !== e)
  45873. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45874. var a, s = e[r];
  45875. switch (s.type) {
  45876. case "PlaneGeometry":
  45877. case "PlaneBufferGeometry":
  45878. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45879. break;
  45880. case "BoxGeometry":
  45881. case "BoxBufferGeometry":
  45882. case "CubeGeometry":
  45883. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45884. break;
  45885. case "CircleGeometry":
  45886. case "CircleBufferGeometry":
  45887. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45888. break;
  45889. case "CylinderGeometry":
  45890. case "CylinderBufferGeometry":
  45891. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45892. break;
  45893. case "SphereGeometry":
  45894. case "SphereBufferGeometry":
  45895. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45896. break;
  45897. case "DodecahedronGeometry":
  45898. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45899. break;
  45900. case "IcosahedronGeometry":
  45901. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45902. break;
  45903. case "OctahedronGeometry":
  45904. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45905. break;
  45906. case "TetrahedronGeometry":
  45907. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45908. break;
  45909. case "RingGeometry":
  45910. case "RingBufferGeometry":
  45911. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45912. break;
  45913. case "TorusGeometry":
  45914. case "TorusBufferGeometry":
  45915. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45916. break;
  45917. case "TorusKnotGeometry":
  45918. case "TorusKnotBufferGeometry":
  45919. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45920. break;
  45921. case "LatheGeometry":
  45922. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45923. break;
  45924. case "BufferGeometry":
  45925. a = n.parse(s);
  45926. break;
  45927. case "Geometry":
  45928. a = i.parse(s.data, this.texturePath).geometry;
  45929. break;
  45930. default:
  45931. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45932. continue
  45933. }
  45934. a.uuid = s.uuid,
  45935. void 0 !== s.name && (a.name = s.name),
  45936. t[s.uuid] = a
  45937. }
  45938. return t
  45939. },
  45940. parseMaterials: function(e, t) {
  45941. var i = {};
  45942. if (void 0 !== e) {
  45943. var n = new Ci.MaterialLoader;
  45944. n.setTextures(t);
  45945. for (var r = 0, o = e.length; r < o; r++) {
  45946. var a = n.parse(e[r]);
  45947. i[a.uuid] = a
  45948. }
  45949. }
  45950. return i
  45951. },
  45952. parseAnimations: function(e) {
  45953. for (var t = [], i = 0; i < e.length; i++) {
  45954. var n = Ci.AnimationClip.parse(e[i]);
  45955. t.push(n)
  45956. }
  45957. return t
  45958. },
  45959. parseImages: function(e, t) {
  45960. function i(e) {
  45961. return n.manager.itemStart(e),
  45962. a.load(e, function() {
  45963. n.manager.itemEnd(e)
  45964. })
  45965. }
  45966. var n = this
  45967. , r = {};
  45968. if (void 0 !== e && 0 < e.length) {
  45969. var o = new Ci.LoadingManager(t)
  45970. , a = new Ci.ImageLoader(o);
  45971. a.setCrossOrigin(this.crossOrigin);
  45972. for (var s = 0, l = e.length; s < l; s++) {
  45973. var c = e[s]
  45974. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45975. r[c.uuid] = i(h)
  45976. }
  45977. }
  45978. return r
  45979. },
  45980. parseTextures: function(e, t) {
  45981. function i(e) {
  45982. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45983. Ci[e])
  45984. }
  45985. var n = {};
  45986. if (void 0 !== e)
  45987. for (var r = 0, o = e.length; r < o; r++) {
  45988. var a = e[r];
  45989. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45990. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45991. var s = new Ci.Texture(t[a.image]);
  45992. s.needsUpdate = !0,
  45993. s.uuid = a.uuid,
  45994. void 0 !== a.name && (s.name = a.name),
  45995. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45996. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45997. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45998. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45999. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46000. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46001. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46002. s.wrapT = i(a.wrap[1])),
  46003. n[a.uuid] = s
  46004. }
  46005. return n
  46006. },
  46007. parseObject: (ke = new Ci.Matrix4,
  46008. function(e, t, i) {
  46009. function n(e) {
  46010. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46011. t[e]
  46012. }
  46013. function r(e) {
  46014. if (void 0 !== e)
  46015. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46016. i[e]
  46017. }
  46018. var o;
  46019. switch (e.type) {
  46020. case "Scene":
  46021. o = new Ci.Scene;
  46022. break;
  46023. case "PerspectiveCamera":
  46024. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46025. break;
  46026. case "OrthographicCamera":
  46027. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46028. break;
  46029. case "AmbientLight":
  46030. o = new Ci.AmbientLight(e.color,e.intensity);
  46031. break;
  46032. case "DirectionalLight":
  46033. o = new Ci.DirectionalLight(e.color,e.intensity);
  46034. break;
  46035. case "PointLight":
  46036. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46037. break;
  46038. case "SpotLight":
  46039. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46040. break;
  46041. case "HemisphereLight":
  46042. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46043. break;
  46044. case "Mesh":
  46045. var a = n(e.geometry)
  46046. , s = r(e.material);
  46047. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46048. break;
  46049. case "LOD":
  46050. o = new Ci.LOD;
  46051. break;
  46052. case "Line":
  46053. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46054. break;
  46055. case "PointCloud":
  46056. case "Points":
  46057. o = new Ci.Points(n(e.geometry),r(e.material));
  46058. break;
  46059. case "Sprite":
  46060. o = new Ci.Sprite(r(e.material));
  46061. break;
  46062. case "Group":
  46063. o = new Ci.Group;
  46064. break;
  46065. default:
  46066. o = new Ci.Object3D
  46067. }
  46068. if (o.uuid = e.uuid,
  46069. void 0 !== e.name && (o.name = e.name),
  46070. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46071. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46072. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46073. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46074. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46075. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46076. void 0 !== e.visible && (o.visible = e.visible),
  46077. void 0 !== e.userData && (o.userData = e.userData),
  46078. void 0 !== e.children)
  46079. for (var l in e.children)
  46080. o.add(this.parseObject(e.children[l], t, i));
  46081. if ("LOD" === e.type)
  46082. for (var c = e.levels, h = 0; h < c.length; h++) {
  46083. var u = c[h];
  46084. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46085. }
  46086. return o
  46087. }
  46088. )
  46089. },
  46090. Ci.TextureLoader = function(e) {
  46091. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46092. }
  46093. ,
  46094. Ci.TextureLoader.prototype = {
  46095. constructor: Ci.TextureLoader,
  46096. load: function(e, t, i, n) {
  46097. var r = new Ci.Texture
  46098. , o = new Ci.ImageLoader(this.manager);
  46099. return o.setCrossOrigin(this.crossOrigin),
  46100. o.setPath(this.path),
  46101. o.load(e, function(e) {
  46102. r.image = e,
  46103. r.needsUpdate = !0,
  46104. void 0 !== t && t(r)
  46105. }, i, n),
  46106. r
  46107. },
  46108. setCrossOrigin: function(e) {
  46109. this.crossOrigin = e
  46110. },
  46111. setPath: function(e) {
  46112. this.path = e
  46113. }
  46114. },
  46115. Ci.CubeTextureLoader = function(e) {
  46116. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46117. }
  46118. ,
  46119. Ci.CubeTextureLoader.prototype = {
  46120. constructor: Ci.CubeTextureLoader,
  46121. load: function(e, i, t, n) {
  46122. function r(t) {
  46123. a.load(e[t], function(e) {
  46124. o.images[t] = e,
  46125. 6 === ++s && (o.needsUpdate = !0,
  46126. i && i(o))
  46127. }, void 0, n)
  46128. }
  46129. var o = new Ci.CubeTexture
  46130. , a = new Ci.ImageLoader(this.manager);
  46131. a.setCrossOrigin(this.crossOrigin),
  46132. a.setPath(this.path);
  46133. for (var s = 0, l = 0; l < e.length; ++l)
  46134. r(l);
  46135. return o
  46136. },
  46137. setCrossOrigin: function(e) {
  46138. this.crossOrigin = e
  46139. },
  46140. setPath: function(e) {
  46141. this.path = e
  46142. }
  46143. },
  46144. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46145. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46146. this._parser = null
  46147. }
  46148. ,
  46149. Ci.BinaryTextureLoader.prototype = {
  46150. constructor: Ci.BinaryTextureLoader,
  46151. load: function(e, i, t, n) {
  46152. var r = this
  46153. , o = new Ci.DataTexture
  46154. , a = new Ci.XHRLoader(this.manager);
  46155. return a.setResponseType("arraybuffer"),
  46156. a.load(e, function(e) {
  46157. var t = r._parser(e);
  46158. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46159. o.image.height = t.height,
  46160. o.image.data = t.data),
  46161. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46162. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46163. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46164. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46165. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46166. void 0 !== t.format && (o.format = t.format),
  46167. void 0 !== t.type && (o.type = t.type),
  46168. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46169. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46170. o.needsUpdate = !0,
  46171. i && i(o, t))
  46172. }, t, n),
  46173. o
  46174. }
  46175. },
  46176. Ci.CompressedTextureLoader = function(e) {
  46177. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46178. this._parser = null
  46179. }
  46180. ,
  46181. Ci.CompressedTextureLoader.prototype = {
  46182. constructor: Ci.CompressedTextureLoader,
  46183. load: function(e, o, t, n) {
  46184. function i(i) {
  46185. r.load(e[i], function(e) {
  46186. var t = a._parser(e, !0);
  46187. s[i] = {
  46188. width: t.width,
  46189. height: t.height,
  46190. format: t.format,
  46191. mipmaps: t.mipmaps
  46192. },
  46193. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46194. l.format = t.format,
  46195. l.needsUpdate = !0,
  46196. o && o(l))
  46197. }, t, n)
  46198. }
  46199. var a = this
  46200. , s = []
  46201. , l = new Ci.CompressedTexture;
  46202. l.image = s;
  46203. var r = new Ci.XHRLoader(this.manager);
  46204. if (r.setPath(this.path),
  46205. r.setResponseType("arraybuffer"),
  46206. Array.isArray(e))
  46207. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46208. i(h);
  46209. else
  46210. r.load(e, function(e) {
  46211. var t = a._parser(e, !0);
  46212. if (t.isCubemap)
  46213. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46214. s[n] = {
  46215. mipmaps: []
  46216. };
  46217. for (var r = 0; r < t.mipmapCount; r++)
  46218. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46219. s[n].format = t.format,
  46220. s[n].width = t.width,
  46221. s[n].height = t.height
  46222. }
  46223. else
  46224. l.image.width = t.width,
  46225. l.image.height = t.height,
  46226. l.mipmaps = t.mipmaps;
  46227. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46228. l.format = t.format,
  46229. l.needsUpdate = !0,
  46230. o && o(l)
  46231. }, t, n);
  46232. return l
  46233. },
  46234. setPath: function(e) {
  46235. this.path = e
  46236. }
  46237. },
  46238. Ci.Material = function() {
  46239. Object.defineProperty(this, "id", {
  46240. value: Ci.MaterialIdCount++
  46241. }),
  46242. this.uuid = Ci.Math.generateUUID(),
  46243. this.name = "",
  46244. this.type = "Material",
  46245. this.side = Ci.FrontSide,
  46246. this.opacity = 1,
  46247. this.transparent = !1,
  46248. this.blending = Ci.NormalBlending,
  46249. this.blendSrc = Ci.SrcAlphaFactor,
  46250. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46251. this.blendEquation = Ci.AddEquation,
  46252. this.blendSrcAlpha = null,
  46253. this.blendDstAlpha = null,
  46254. this.blendEquationAlpha = null,
  46255. this.depthFunc = Ci.LessEqualDepth,
  46256. this.depthTest = !0,
  46257. this.depthWrite = !0,
  46258. this.colorWrite = !0,
  46259. this.precision = null,
  46260. this.polygonOffset = !1,
  46261. this.polygonOffsetFactor = 0,
  46262. this.polygonOffsetUnits = 0,
  46263. this.alphaTest = 0,
  46264. this.premultipliedAlpha = !1,
  46265. this.overdraw = 0,
  46266. this.visible = !0,
  46267. this._needsUpdate = !0
  46268. }
  46269. ,
  46270. Ci.Material.prototype = {
  46271. constructor: Ci.Material,
  46272. get needsUpdate() {
  46273. return this._needsUpdate
  46274. },
  46275. set needsUpdate(e) {
  46276. !0 === e && this.update(),
  46277. this._needsUpdate = e
  46278. },
  46279. setValues: function(e) {
  46280. if (void 0 !== e)
  46281. for (var t in e) {
  46282. var i = e[t];
  46283. if (void 0 !== i) {
  46284. var n = this[t];
  46285. 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.")
  46286. } else
  46287. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46288. }
  46289. },
  46290. toJSON: function(e) {
  46291. function t(e) {
  46292. var t = [];
  46293. for (var i in e) {
  46294. var n = e[i];
  46295. delete n.metadata,
  46296. t.push(n)
  46297. }
  46298. return t
  46299. }
  46300. var i = void 0 === e;
  46301. i && (e = {
  46302. textures: {},
  46303. images: {}
  46304. });
  46305. var n = {
  46306. metadata: {
  46307. version: 4.4,
  46308. type: "Material",
  46309. generator: "Material.toJSON"
  46310. }
  46311. };
  46312. if (n.uuid = this.uuid,
  46313. n.type = this.type,
  46314. "" !== this.name && (n.name = this.name),
  46315. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46316. .5 !== this.roughness && (n.roughness = this.roughness),
  46317. .5 !== this.metalness && (n.metalness = this.metalness),
  46318. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46319. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46320. void 0 !== this.shininess && (n.shininess = this.shininess),
  46321. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46322. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46323. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46324. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46325. n.bumpScale = this.bumpScale),
  46326. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46327. n.normalScale = this.normalScale.toArray()),
  46328. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46329. n.displacementScale = this.displacementScale,
  46330. n.displacementBias = this.displacementBias),
  46331. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46332. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46333. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46334. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46335. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46336. n.reflectivity = this.reflectivity),
  46337. void 0 !== this.size && (n.size = this.size),
  46338. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46339. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46340. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46341. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46342. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46343. this.opacity < 1 && (n.opacity = this.opacity),
  46344. !0 === this.transparent && (n.transparent = this.transparent),
  46345. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46346. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46347. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46348. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46349. i) {
  46350. var r = t(e.textures)
  46351. , o = t(e.images);
  46352. 0 < r.length && (n.textures = r),
  46353. 0 < o.length && (n.images = o)
  46354. }
  46355. return n
  46356. },
  46357. clone: function() {
  46358. return (new this.constructor).copy(this)
  46359. },
  46360. copy: function(e) {
  46361. return this.name = e.name,
  46362. this.side = e.side,
  46363. this.opacity = e.opacity,
  46364. this.transparent = e.transparent,
  46365. this.blending = e.blending,
  46366. this.blendSrc = e.blendSrc,
  46367. this.blendDst = e.blendDst,
  46368. this.blendEquation = e.blendEquation,
  46369. this.blendSrcAlpha = e.blendSrcAlpha,
  46370. this.blendDstAlpha = e.blendDstAlpha,
  46371. this.blendEquationAlpha = e.blendEquationAlpha,
  46372. this.depthFunc = e.depthFunc,
  46373. this.depthTest = e.depthTest,
  46374. this.depthWrite = e.depthWrite,
  46375. this.colorWrite = e.colorWrite,
  46376. this.precision = e.precision,
  46377. this.polygonOffset = e.polygonOffset,
  46378. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46379. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46380. this.alphaTest = e.alphaTest,
  46381. this.premultipliedAlpha = e.premultipliedAlpha,
  46382. this.overdraw = e.overdraw,
  46383. this.visible = e.visible,
  46384. this
  46385. },
  46386. update: function() {
  46387. this.dispatchEvent({
  46388. type: "update"
  46389. })
  46390. },
  46391. dispose: function() {
  46392. this.dispatchEvent({
  46393. type: "dispose"
  46394. })
  46395. }
  46396. },
  46397. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46398. Ci.MaterialIdCount = 0,
  46399. Ci.LineBasicMaterial = function(e) {
  46400. Ci.Material.call(this),
  46401. this.type = "LineBasicMaterial",
  46402. this.color = new Ci.Color(16777215),
  46403. this.linewidth = 1,
  46404. this.linecap = "round",
  46405. this.linejoin = "round",
  46406. this.blending = Ci.NormalBlending,
  46407. this.vertexColors = Ci.NoColors,
  46408. this.fog = !0,
  46409. this.setValues(e)
  46410. }
  46411. ,
  46412. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46413. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46414. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46415. return Ci.Material.prototype.copy.call(this, e),
  46416. this.color.copy(e.color),
  46417. this.linewidth = e.linewidth,
  46418. this.linecap = e.linecap,
  46419. this.linejoin = e.linejoin,
  46420. this.vertexColors = e.vertexColors,
  46421. this.fog = e.fog,
  46422. this
  46423. }
  46424. ,
  46425. Ci.LineDashedMaterial = function(e) {
  46426. Ci.Material.call(this),
  46427. this.type = "LineDashedMaterial",
  46428. this.color = new Ci.Color(16777215),
  46429. this.linewidth = 1,
  46430. this.scale = 1,
  46431. this.dashSize = 3,
  46432. this.gapSize = 1,
  46433. this.blending = Ci.NormalBlending,
  46434. this.vertexColors = Ci.NoColors,
  46435. this.fog = !0,
  46436. this.setValues(e)
  46437. }
  46438. ,
  46439. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46440. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46441. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46442. return Ci.Material.prototype.copy.call(this, e),
  46443. this.color.copy(e.color),
  46444. this.linewidth = e.linewidth,
  46445. this.scale = e.scale,
  46446. this.dashSize = e.dashSize,
  46447. this.gapSize = e.gapSize,
  46448. this.vertexColors = e.vertexColors,
  46449. this.fog = e.fog,
  46450. this
  46451. }
  46452. ,
  46453. Ci.MeshBasicMaterial = function(e) {
  46454. Ci.Material.call(this),
  46455. this.type = "MeshBasicMaterial",
  46456. this.color = new Ci.Color(16777215),
  46457. this.map = null,
  46458. this.aoMap = null,
  46459. this.aoMapIntensity = 1,
  46460. this.specularMap = null,
  46461. this.alphaMap = null,
  46462. this.envMap = null,
  46463. this.combine = Ci.MultiplyOperation,
  46464. this.reflectivity = 1,
  46465. this.refractionRatio = .98,
  46466. this.fog = !0,
  46467. this.shading = Ci.SmoothShading,
  46468. this.blending = Ci.NormalBlending,
  46469. this.wireframe = !1,
  46470. this.wireframeLinewidth = 1,
  46471. this.wireframeLinecap = "round",
  46472. this.wireframeLinejoin = "round",
  46473. this.vertexColors = Ci.NoColors,
  46474. this.skinning = !1,
  46475. this.morphTargets = !1,
  46476. this.setValues(e)
  46477. }
  46478. ,
  46479. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46480. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46481. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46482. return Ci.Material.prototype.copy.call(this, e),
  46483. this.color.copy(e.color),
  46484. this.map = e.map,
  46485. this.aoMap = e.aoMap,
  46486. this.aoMapIntensity = e.aoMapIntensity,
  46487. this.specularMap = e.specularMap,
  46488. this.alphaMap = e.alphaMap,
  46489. this.envMap = e.envMap,
  46490. this.combine = e.combine,
  46491. this.reflectivity = e.reflectivity,
  46492. this.refractionRatio = e.refractionRatio,
  46493. this.fog = e.fog,
  46494. this.shading = e.shading,
  46495. this.wireframe = e.wireframe,
  46496. this.wireframeLinewidth = e.wireframeLinewidth,
  46497. this.wireframeLinecap = e.wireframeLinecap,
  46498. this.wireframeLinejoin = e.wireframeLinejoin,
  46499. this.vertexColors = e.vertexColors,
  46500. this.skinning = e.skinning,
  46501. this.morphTargets = e.morphTargets,
  46502. this
  46503. }
  46504. ,
  46505. Ci.MeshLambertMaterial = function(e) {
  46506. Ci.Material.call(this),
  46507. this.type = "MeshLambertMaterial",
  46508. this.color = new Ci.Color(16777215),
  46509. this.map = null,
  46510. this.lightMap = null,
  46511. this.lightMapIntensity = 1,
  46512. this.aoMap = null,
  46513. this.aoMapIntensity = 1,
  46514. this.emissive = new Ci.Color(0),
  46515. this.emissiveIntensity = 1,
  46516. this.emissiveMap = null,
  46517. this.specularMap = null,
  46518. this.alphaMap = null,
  46519. this.envMap = null,
  46520. this.combine = Ci.MultiplyOperation,
  46521. this.reflectivity = 1,
  46522. this.refractionRatio = .98,
  46523. this.fog = !0,
  46524. this.blending = Ci.NormalBlending,
  46525. this.wireframe = !1,
  46526. this.wireframeLinewidth = 1,
  46527. this.wireframeLinecap = "round",
  46528. this.wireframeLinejoin = "round",
  46529. this.vertexColors = Ci.NoColors,
  46530. this.skinning = !1,
  46531. this.morphTargets = !1,
  46532. this.morphNormals = !1,
  46533. this.setValues(e)
  46534. }
  46535. ,
  46536. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46537. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46538. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46539. return Ci.Material.prototype.copy.call(this, e),
  46540. this.color.copy(e.color),
  46541. this.map = e.map,
  46542. this.lightMap = e.lightMap,
  46543. this.lightMapIntensity = e.lightMapIntensity,
  46544. this.aoMap = e.aoMap,
  46545. this.aoMapIntensity = e.aoMapIntensity,
  46546. this.emissive.copy(e.emissive),
  46547. this.emissiveMap = e.emissiveMap,
  46548. this.emissiveIntensity = e.emissiveIntensity,
  46549. this.specularMap = e.specularMap,
  46550. this.alphaMap = e.alphaMap,
  46551. this.envMap = e.envMap,
  46552. this.combine = e.combine,
  46553. this.reflectivity = e.reflectivity,
  46554. this.refractionRatio = e.refractionRatio,
  46555. this.fog = e.fog,
  46556. this.wireframe = e.wireframe,
  46557. this.wireframeLinewidth = e.wireframeLinewidth,
  46558. this.wireframeLinecap = e.wireframeLinecap,
  46559. this.wireframeLinejoin = e.wireframeLinejoin,
  46560. this.vertexColors = e.vertexColors,
  46561. this.skinning = e.skinning,
  46562. this.morphTargets = e.morphTargets,
  46563. this.morphNormals = e.morphNormals,
  46564. this
  46565. }
  46566. ,
  46567. Ci.MeshPhongMaterial = function(e) {
  46568. Ci.Material.call(this),
  46569. this.type = "MeshPhongMaterial",
  46570. this.color = new Ci.Color(16777215),
  46571. this.specular = new Ci.Color(1118481),
  46572. this.shininess = 30,
  46573. this.map = null,
  46574. this.lightMap = null,
  46575. this.lightMapIntensity = 1,
  46576. this.aoMap = null,
  46577. this.aoMapIntensity = 1,
  46578. this.emissive = new Ci.Color(0),
  46579. this.emissiveIntensity = 1,
  46580. this.emissiveMap = null,
  46581. this.bumpMap = null,
  46582. this.bumpScale = 1,
  46583. this.normalMap = null,
  46584. this.normalScale = new Ci.Vector2(1,1),
  46585. this.displacementMap = null,
  46586. this.displacementScale = 1,
  46587. this.displacementBias = 0,
  46588. this.specularMap = null,
  46589. this.alphaMap = null,
  46590. this.envMap = null,
  46591. this.combine = Ci.MultiplyOperation,
  46592. this.reflectivity = 1,
  46593. this.refractionRatio = .98,
  46594. this.fog = !0,
  46595. this.shading = Ci.SmoothShading,
  46596. this.blending = Ci.NormalBlending,
  46597. this.wireframe = !1,
  46598. this.wireframeLinewidth = 1,
  46599. this.wireframeLinecap = "round",
  46600. this.wireframeLinejoin = "round",
  46601. this.vertexColors = Ci.NoColors,
  46602. this.skinning = !1,
  46603. this.morphTargets = !1,
  46604. this.morphNormals = !1,
  46605. this.setValues(e)
  46606. }
  46607. ,
  46608. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46609. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46610. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46611. return Ci.Material.prototype.copy.call(this, e),
  46612. this.color.copy(e.color),
  46613. this.specular.copy(e.specular),
  46614. this.shininess = e.shininess,
  46615. this.map = e.map,
  46616. this.lightMap = e.lightMap,
  46617. this.lightMapIntensity = e.lightMapIntensity,
  46618. this.aoMap = e.aoMap,
  46619. this.aoMapIntensity = e.aoMapIntensity,
  46620. this.emissive.copy(e.emissive),
  46621. this.emissiveMap = e.emissiveMap,
  46622. this.emissiveIntensity = e.emissiveIntensity,
  46623. this.bumpMap = e.bumpMap,
  46624. this.bumpScale = e.bumpScale,
  46625. this.normalMap = e.normalMap,
  46626. this.normalScale.copy(e.normalScale),
  46627. this.displacementMap = e.displacementMap,
  46628. this.displacementScale = e.displacementScale,
  46629. this.displacementBias = e.displacementBias,
  46630. this.specularMap = e.specularMap,
  46631. this.alphaMap = e.alphaMap,
  46632. this.envMap = e.envMap,
  46633. this.combine = e.combine,
  46634. this.reflectivity = e.reflectivity,
  46635. this.refractionRatio = e.refractionRatio,
  46636. this.fog = e.fog,
  46637. this.shading = e.shading,
  46638. this.wireframe = e.wireframe,
  46639. this.wireframeLinewidth = e.wireframeLinewidth,
  46640. this.wireframeLinecap = e.wireframeLinecap,
  46641. this.wireframeLinejoin = e.wireframeLinejoin,
  46642. this.vertexColors = e.vertexColors,
  46643. this.skinning = e.skinning,
  46644. this.morphTargets = e.morphTargets,
  46645. this.morphNormals = e.morphNormals,
  46646. this
  46647. }
  46648. ,
  46649. Ci.MeshStandardMaterial = function(e) {
  46650. Ci.Material.call(this),
  46651. this.type = "MeshStandardMaterial",
  46652. this.color = new Ci.Color(16777215),
  46653. this.roughness = .5,
  46654. this.metalness = .5,
  46655. this.map = null,
  46656. this.lightMap = null,
  46657. this.lightMapIntensity = 1,
  46658. this.aoMap = null,
  46659. this.aoMapIntensity = 1,
  46660. this.emissive = new Ci.Color(0),
  46661. this.emissiveIntensity = 1,
  46662. this.emissiveMap = null,
  46663. this.bumpMap = null,
  46664. this.bumpScale = 1,
  46665. this.normalMap = null,
  46666. this.normalScale = new Ci.Vector2(1,1),
  46667. this.displacementMap = null,
  46668. this.displacementScale = 1,
  46669. this.displacementBias = 0,
  46670. this.roughnessMap = null,
  46671. this.metalnessMap = null,
  46672. this.alphaMap = null,
  46673. this.envMap = null,
  46674. this.envMapIntensity = 1,
  46675. this.refractionRatio = .98,
  46676. this.fog = !0,
  46677. this.shading = Ci.SmoothShading,
  46678. this.blending = Ci.NormalBlending,
  46679. this.wireframe = !1,
  46680. this.wireframeLinewidth = 1,
  46681. this.wireframeLinecap = "round",
  46682. this.wireframeLinejoin = "round",
  46683. this.vertexColors = Ci.NoColors,
  46684. this.skinning = !1,
  46685. this.morphTargets = !1,
  46686. this.morphNormals = !1,
  46687. this.setValues(e)
  46688. }
  46689. ,
  46690. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46691. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46692. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46693. return Ci.Material.prototype.copy.call(this, e),
  46694. this.color.copy(e.color),
  46695. this.roughness = e.roughness,
  46696. this.metalness = e.metalness,
  46697. this.map = e.map,
  46698. this.lightMap = e.lightMap,
  46699. this.lightMapIntensity = e.lightMapIntensity,
  46700. this.aoMap = e.aoMap,
  46701. this.aoMapIntensity = e.aoMapIntensity,
  46702. this.emissive.copy(e.emissive),
  46703. this.emissiveMap = e.emissiveMap,
  46704. this.emissiveIntensity = e.emissiveIntensity,
  46705. this.bumpMap = e.bumpMap,
  46706. this.bumpScale = e.bumpScale,
  46707. this.normalMap = e.normalMap,
  46708. this.normalScale.copy(e.normalScale),
  46709. this.displacementMap = e.displacementMap,
  46710. this.displacementScale = e.displacementScale,
  46711. this.displacementBias = e.displacementBias,
  46712. this.roughnessMap = e.roughnessMap,
  46713. this.metalnessMap = e.metalnessMap,
  46714. this.alphaMap = e.alphaMap,
  46715. this.envMap = e.envMap,
  46716. this.envMapIntensity = e.envMapIntensity,
  46717. this.refractionRatio = e.refractionRatio,
  46718. this.fog = e.fog,
  46719. this.shading = e.shading,
  46720. this.wireframe = e.wireframe,
  46721. this.wireframeLinewidth = e.wireframeLinewidth,
  46722. this.wireframeLinecap = e.wireframeLinecap,
  46723. this.wireframeLinejoin = e.wireframeLinejoin,
  46724. this.vertexColors = e.vertexColors,
  46725. this.skinning = e.skinning,
  46726. this.morphTargets = e.morphTargets,
  46727. this.morphNormals = e.morphNormals,
  46728. this
  46729. }
  46730. ,
  46731. Ci.MeshDepthMaterial = function(e) {
  46732. Ci.Material.call(this),
  46733. this.type = "MeshDepthMaterial",
  46734. this.morphTargets = !1,
  46735. this.wireframe = !1,
  46736. this.wireframeLinewidth = 1,
  46737. this.setValues(e)
  46738. }
  46739. ,
  46740. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46741. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46742. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46743. return Ci.Material.prototype.copy.call(this, e),
  46744. this.wireframe = e.wireframe,
  46745. this.wireframeLinewidth = e.wireframeLinewidth,
  46746. this
  46747. }
  46748. ,
  46749. Ci.MeshNormalMaterial = function(e) {
  46750. Ci.Material.call(this, e),
  46751. this.type = "MeshNormalMaterial",
  46752. this.wireframe = !1,
  46753. this.wireframeLinewidth = 1,
  46754. this.morphTargets = !1,
  46755. this.setValues(e)
  46756. }
  46757. ,
  46758. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46759. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46760. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46761. return Ci.Material.prototype.copy.call(this, e),
  46762. this.wireframe = e.wireframe,
  46763. this.wireframeLinewidth = e.wireframeLinewidth,
  46764. this
  46765. }
  46766. ,
  46767. Ci.MultiMaterial = function(e) {
  46768. this.uuid = Ci.Math.generateUUID(),
  46769. this.type = "MultiMaterial",
  46770. this.materials = e instanceof Array ? e : [],
  46771. this.visible = !0
  46772. }
  46773. ,
  46774. Ci.MultiMaterial.prototype = {
  46775. constructor: Ci.MultiMaterial,
  46776. toJSON: function(e) {
  46777. for (var t = {
  46778. metadata: {
  46779. version: 4.2,
  46780. type: "material",
  46781. generator: "MaterialExporter"
  46782. },
  46783. uuid: this.uuid,
  46784. type: this.type,
  46785. materials: []
  46786. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46787. var o = i[n].toJSON(e);
  46788. delete o.metadata,
  46789. t.materials.push(o)
  46790. }
  46791. return t.visible = this.visible,
  46792. t
  46793. },
  46794. clone: function() {
  46795. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46796. e.materials.push(this.materials[t].clone());
  46797. return e.visible = this.visible,
  46798. e
  46799. }
  46800. },
  46801. Ci.PointsMaterial = function(e) {
  46802. Ci.Material.call(this),
  46803. this.type = "PointsMaterial",
  46804. this.color = new Ci.Color(16777215),
  46805. this.map = null,
  46806. this.size = 1,
  46807. this.sizeAttenuation = !0,
  46808. this.blending = Ci.NormalBlending,
  46809. this.vertexColors = Ci.NoColors,
  46810. this.fog = !0,
  46811. this.setValues(e)
  46812. }
  46813. ,
  46814. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46815. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46816. Ci.PointsMaterial.prototype.copy = function(e) {
  46817. return Ci.Material.prototype.copy.call(this, e),
  46818. this.color.copy(e.color),
  46819. this.map = e.map,
  46820. this.size = e.size,
  46821. this.sizeAttenuation = e.sizeAttenuation,
  46822. this.vertexColors = e.vertexColors,
  46823. this.fog = e.fog,
  46824. this
  46825. }
  46826. ,
  46827. Ci.ShaderMaterial = function(e) {
  46828. Ci.Material.call(this),
  46829. this.type = "ShaderMaterial",
  46830. this.defines = {},
  46831. this.uniforms = {},
  46832. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46833. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46834. this.shading = Ci.SmoothShading,
  46835. this.linewidth = 1,
  46836. this.wireframe = !1,
  46837. this.wireframeLinewidth = 1,
  46838. this.fog = !1,
  46839. this.lights = !1,
  46840. this.vertexColors = Ci.NoColors,
  46841. this.skinning = !1,
  46842. this.morphTargets = !1,
  46843. this.morphNormals = !1,
  46844. this.extensions = {
  46845. derivatives: !1,
  46846. fragDepth: !1,
  46847. drawBuffers: !1,
  46848. shaderTextureLOD: !1
  46849. },
  46850. this.defaultAttributeValues = {
  46851. color: [1, 1, 1],
  46852. uv: [0, 0],
  46853. uv2: [0, 0]
  46854. },
  46855. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46856. this.setValues(e))
  46857. }
  46858. ,
  46859. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46860. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46861. Ci.ShaderMaterial.prototype.copy = function(e) {
  46862. return Ci.Material.prototype.copy.call(this, e),
  46863. this.fragmentShader = e.fragmentShader,
  46864. this.vertexShader = e.vertexShader,
  46865. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46866. this.defines = e.defines,
  46867. this.shading = e.shading,
  46868. this.wireframe = e.wireframe,
  46869. this.wireframeLinewidth = e.wireframeLinewidth,
  46870. this.fog = e.fog,
  46871. this.lights = e.lights,
  46872. this.vertexColors = e.vertexColors,
  46873. this.skinning = e.skinning,
  46874. this.morphTargets = e.morphTargets,
  46875. this.morphNormals = e.morphNormals,
  46876. this.extensions = e.extensions,
  46877. this
  46878. }
  46879. ,
  46880. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46881. var t = Ci.Material.prototype.toJSON.call(this, e);
  46882. return t.uniforms = this.uniforms,
  46883. t.vertexShader = this.vertexShader,
  46884. t.fragmentShader = this.fragmentShader,
  46885. t
  46886. }
  46887. ,
  46888. Ci.RawShaderMaterial = function(e) {
  46889. Ci.ShaderMaterial.call(this, e),
  46890. this.type = "RawShaderMaterial"
  46891. }
  46892. ,
  46893. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46894. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46895. Ci.SpriteMaterial = function(e) {
  46896. Ci.Material.call(this),
  46897. this.type = "SpriteMaterial",
  46898. this.color = new Ci.Color(16777215),
  46899. this.map = null,
  46900. this.rotation = 0,
  46901. this.fog = !1,
  46902. this.setValues(e)
  46903. }
  46904. ,
  46905. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46906. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46907. Ci.SpriteMaterial.prototype.copy = function(e) {
  46908. return Ci.Material.prototype.copy.call(this, e),
  46909. this.color.copy(e.color),
  46910. this.map = e.map,
  46911. this.rotation = e.rotation,
  46912. this.fog = e.fog,
  46913. this
  46914. }
  46915. ,
  46916. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46917. Object.defineProperty(this, "id", {
  46918. value: Ci.TextureIdCount++
  46919. }),
  46920. this.uuid = Ci.Math.generateUUID(),
  46921. this.name = "",
  46922. this.sourceFile = "",
  46923. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46924. this.mipmaps = [],
  46925. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46926. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46927. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46928. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46929. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46930. this.anisotropy = void 0 !== l ? l : 1,
  46931. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46932. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46933. this.offset = new Ci.Vector2(0,0),
  46934. this.repeat = new Ci.Vector2(1,1),
  46935. this.generateMipmaps = !0,
  46936. this.premultiplyAlpha = !1,
  46937. this.flipY = !0,
  46938. this.unpackAlignment = 4,
  46939. this.encoding = Ci.LinearEncoding,
  46940. this.version = 0,
  46941. this.onUpdate = null
  46942. }
  46943. ,
  46944. Ci.Texture.DEFAULT_IMAGE = void 0,
  46945. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46946. Ci.Texture.prototype = {
  46947. constructor: Ci.Texture,
  46948. set needsUpdate(e) {
  46949. !0 === e && this.version++
  46950. },
  46951. clone: function() {
  46952. return (new this.constructor).copy(this)
  46953. },
  46954. copy: function(e) {
  46955. return this.image = e.image,
  46956. this.mipmaps = e.mipmaps.slice(0),
  46957. this.mapping = e.mapping,
  46958. this.wrapS = e.wrapS,
  46959. this.wrapT = e.wrapT,
  46960. this.magFilter = e.magFilter,
  46961. this.minFilter = e.minFilter,
  46962. this.anisotropy = e.anisotropy,
  46963. this.format = e.format,
  46964. this.type = e.type,
  46965. this.offset.copy(e.offset),
  46966. this.repeat.copy(e.repeat),
  46967. this.generateMipmaps = e.generateMipmaps,
  46968. this.premultiplyAlpha = e.premultiplyAlpha,
  46969. this.flipY = e.flipY,
  46970. this.unpackAlignment = e.unpackAlignment,
  46971. this.encoding = e.encoding,
  46972. this
  46973. },
  46974. toJSON: function(e) {
  46975. if (void 0 !== e.textures[this.uuid])
  46976. return e.textures[this.uuid];
  46977. var t, i, n = {
  46978. metadata: {
  46979. version: 4.4,
  46980. type: "Texture",
  46981. generator: "Texture.toJSON"
  46982. },
  46983. uuid: this.uuid,
  46984. name: this.name,
  46985. mapping: this.mapping,
  46986. repeat: [this.repeat.x, this.repeat.y],
  46987. offset: [this.offset.x, this.offset.y],
  46988. wrap: [this.wrapS, this.wrapT],
  46989. minFilter: this.minFilter,
  46990. magFilter: this.magFilter,
  46991. anisotropy: this.anisotropy
  46992. };
  46993. if (void 0 !== this.image) {
  46994. var r = this.image;
  46995. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46996. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46997. uuid: r.uuid,
  46998. url: (t = r,
  46999. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47000. i.height = t.height,
  47001. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47002. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47003. }),
  47004. n.image = r.uuid
  47005. }
  47006. return e.textures[this.uuid] = n
  47007. },
  47008. dispose: function() {
  47009. this.dispatchEvent({
  47010. type: "dispose"
  47011. })
  47012. },
  47013. transformUv: function(e) {
  47014. if (this.mapping === Ci.UVMapping) {
  47015. if (e.multiply(this.repeat),
  47016. e.add(this.offset),
  47017. e.x < 0 || 1 < e.x)
  47018. switch (this.wrapS) {
  47019. case Ci.RepeatWrapping:
  47020. e.x = e.x - Math.floor(e.x);
  47021. break;
  47022. case Ci.ClampToEdgeWrapping:
  47023. e.x = e.x < 0 ? 0 : 1;
  47024. break;
  47025. case Ci.MirroredRepeatWrapping:
  47026. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47027. }
  47028. if (e.y < 0 || 1 < e.y)
  47029. switch (this.wrapT) {
  47030. case Ci.RepeatWrapping:
  47031. e.y = e.y - Math.floor(e.y);
  47032. break;
  47033. case Ci.ClampToEdgeWrapping:
  47034. e.y = e.y < 0 ? 0 : 1;
  47035. break;
  47036. case Ci.MirroredRepeatWrapping:
  47037. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47038. }
  47039. this.flipY && (e.y = 1 - e.y)
  47040. }
  47041. }
  47042. },
  47043. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47044. Ci.TextureIdCount = 0,
  47045. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47046. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47047. this.needsUpdate = !0
  47048. }
  47049. ,
  47050. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47051. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47052. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47053. e = void 0 !== e ? e : [],
  47054. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47055. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47056. this.flipY = !1
  47057. }
  47058. ,
  47059. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47060. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47061. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47062. get: function() {
  47063. return this.image
  47064. },
  47065. set: function(e) {
  47066. this.image = e
  47067. }
  47068. }),
  47069. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47070. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47071. this.image = {
  47072. width: t,
  47073. height: i
  47074. },
  47075. this.mipmaps = e,
  47076. this.flipY = !1,
  47077. this.generateMipmaps = !1
  47078. }
  47079. ,
  47080. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47081. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47082. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47083. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47084. this.image = {
  47085. data: e,
  47086. width: t,
  47087. height: i
  47088. },
  47089. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47090. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47091. this.flipY = !1,
  47092. this.generateMipmaps = !1
  47093. }
  47094. ,
  47095. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47096. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47097. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47098. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47099. this.generateMipmaps = !1;
  47100. var c = this;
  47101. !function e() {
  47102. requestAnimationFrame(e),
  47103. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47104. }()
  47105. }
  47106. ,
  47107. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47108. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47109. Ci.Group = function() {
  47110. Ci.Object3D.call(this),
  47111. this.type = "Group"
  47112. }
  47113. ,
  47114. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47115. Ci.Group.prototype.constructor = Ci.Group,
  47116. Ci.Points = function(e, t) {
  47117. Ci.Object3D.call(this),
  47118. this.type = "Points",
  47119. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47120. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47121. color: 16777215 * Math.random()
  47122. })
  47123. }
  47124. ,
  47125. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47126. Ci.Points.prototype.constructor = Ci.Points,
  47127. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47128. jt = new Ci.Ray,
  47129. Yt = new Ci.Sphere,
  47130. function(o, a) {
  47131. function e(e, t) {
  47132. var i = jt.distanceSqToPoint(e);
  47133. if (i < c) {
  47134. var n = jt.closestPointToPoint(e);
  47135. n.applyMatrix4(l);
  47136. var r = o.ray.origin.distanceTo(n);
  47137. if (r < o.near || r > o.far)
  47138. return;
  47139. a.push({
  47140. distance: r,
  47141. distanceToRay: Math.sqrt(i),
  47142. point: n.clone(),
  47143. index: t,
  47144. face: null,
  47145. object: s
  47146. })
  47147. }
  47148. }
  47149. var s = this
  47150. , t = this.geometry
  47151. , l = this.matrixWorld
  47152. , i = o.params.Points.threshold;
  47153. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47154. Yt.copy(t.boundingSphere),
  47155. Yt.applyMatrix4(l),
  47156. !1 !== o.ray.intersectsSphere(Yt)) {
  47157. Wt.getInverse(l),
  47158. jt.copy(o.ray).applyMatrix4(Wt);
  47159. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47160. , c = n * n
  47161. , r = new Ci.Vector3;
  47162. if (t instanceof Ci.BufferGeometry) {
  47163. var h = t.index
  47164. , u = t.attributes.position.array;
  47165. if (null !== h)
  47166. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47167. var g = d[p];
  47168. r.fromArray(u, 3 * g),
  47169. e(r, g)
  47170. }
  47171. else {
  47172. p = 0;
  47173. for (var m = u.length / 3; p < m; p++)
  47174. r.fromArray(u, 3 * p),
  47175. e(r, p)
  47176. }
  47177. } else {
  47178. var v = t.vertices;
  47179. for (p = 0,
  47180. m = v.length; p < m; p++)
  47181. e(v[p], p)
  47182. }
  47183. }
  47184. }
  47185. ),
  47186. Ci.Points.prototype.clone = function() {
  47187. return new this.constructor(this.geometry,this.material).copy(this)
  47188. }
  47189. ,
  47190. Ci.Line = function(e, t, i) {
  47191. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47192. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47193. this.type = "Line",
  47194. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47195. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47196. color: 16777215 * Math.random()
  47197. })))
  47198. }
  47199. ,
  47200. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47201. Ci.Line.prototype.constructor = Ci.Line,
  47202. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47203. zt = new Ci.Ray,
  47204. Gt = new Ci.Sphere,
  47205. function(e, t) {
  47206. var i = e.linePrecision
  47207. , n = i * i
  47208. , r = this.geometry
  47209. , o = this.matrixWorld;
  47210. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47211. Gt.copy(r.boundingSphere),
  47212. Gt.applyMatrix4(o),
  47213. !1 !== e.ray.intersectsSphere(Gt)) {
  47214. Ht.getInverse(o),
  47215. zt.copy(e.ray).applyMatrix4(Ht);
  47216. var a = new Ci.Vector3
  47217. , s = new Ci.Vector3
  47218. , l = new Ci.Vector3
  47219. , c = new Ci.Vector3
  47220. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47221. if (r instanceof Ci.BufferGeometry) {
  47222. var u = r.index
  47223. , d = r.attributes.position.array;
  47224. if (null !== u)
  47225. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47226. var m = p[f]
  47227. , v = p[f + 1];
  47228. a.fromArray(d, 3 * m),
  47229. s.fromArray(d, 3 * v),
  47230. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47231. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47232. distance: C,
  47233. point: l.clone().applyMatrix4(this.matrixWorld),
  47234. index: f,
  47235. face: null,
  47236. faceIndex: null,
  47237. object: this
  47238. }))
  47239. }
  47240. else
  47241. for (f = 0,
  47242. g = d.length / 3 - 1; f < g; f += h)
  47243. a.fromArray(d, 3 * f),
  47244. s.fromArray(d, 3 * f + 3),
  47245. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47246. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47247. distance: C,
  47248. point: l.clone().applyMatrix4(this.matrixWorld),
  47249. index: f,
  47250. face: null,
  47251. faceIndex: null,
  47252. object: this
  47253. }))
  47254. } else if (r instanceof Ci.Geometry) {
  47255. var y = r.vertices
  47256. , A = y.length;
  47257. for (f = 0; f < A - 1; f += h) {
  47258. var C;
  47259. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47260. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47261. distance: C,
  47262. point: l.clone().applyMatrix4(this.matrixWorld),
  47263. index: f,
  47264. face: null,
  47265. faceIndex: null,
  47266. object: this
  47267. }))
  47268. }
  47269. }
  47270. }
  47271. }
  47272. ),
  47273. Ci.Line.prototype.clone = function() {
  47274. return new this.constructor(this.geometry,this.material).copy(this)
  47275. }
  47276. ,
  47277. Ci.LineStrip = 0,
  47278. Ci.LinePieces = 1,
  47279. Ci.LineSegments = function(e, t) {
  47280. Ci.Line.call(this, e, t),
  47281. this.type = "LineSegments"
  47282. }
  47283. ,
  47284. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47285. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47286. Ci.Mesh = function(e, t) {
  47287. Ci.Object3D.call(this),
  47288. this.type = "Mesh",
  47289. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47290. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47291. color: 16777215 * Math.random()
  47292. }),
  47293. this.drawMode = Ci.TrianglesDrawMode,
  47294. this.updateMorphTargets()
  47295. }
  47296. ,
  47297. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47298. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47299. Ci.Mesh.prototype.setDrawMode = function(e) {
  47300. this.drawMode = e
  47301. }
  47302. ,
  47303. Ci.Mesh.prototype.updateMorphTargets = function() {
  47304. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47305. this.morphTargetBase = -1,
  47306. this.morphTargetInfluences = [],
  47307. this.morphTargetDictionary = {};
  47308. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47309. this.morphTargetInfluences.push(0),
  47310. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47311. }
  47312. }
  47313. ,
  47314. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47315. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47316. 0)
  47317. }
  47318. ,
  47319. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47320. xt = new Ci.Ray,
  47321. St = new Ci.Sphere,
  47322. Mt = new Ci.Vector3,
  47323. Rt = new Ci.Vector3,
  47324. Pt = new Ci.Vector3,
  47325. Ot = new Ci.Vector3,
  47326. Lt = new Ci.Vector3,
  47327. Dt = new Ci.Vector3,
  47328. Nt = new Ci.Vector2,
  47329. Ft = new Ci.Vector2,
  47330. Bt = new Ci.Vector2,
  47331. Vt = new Ci.Vector3,
  47332. kt = new Ci.Vector3,
  47333. Ut = new Ci.Vector3,
  47334. function(e, t) {
  47335. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47336. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47337. St.copy(r.boundingSphere),
  47338. St.applyMatrix4(a),
  47339. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47340. xt.copy(e.ray).applyMatrix4(Tt),
  47341. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47342. if (r instanceof Ci.BufferGeometry) {
  47343. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47344. if (void 0 !== u.uv && (i = u.uv.array),
  47345. null !== h)
  47346. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47347. s = p[f],
  47348. l = p[f + 1],
  47349. c = p[f + 2],
  47350. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47351. t.push(n));
  47352. else
  47353. for (f = 0,
  47354. g = d.length; f < g; f += 9)
  47355. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47356. t.push(n))
  47357. } else if (r instanceof Ci.Geometry) {
  47358. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47359. 0 < _.length && (i = _);
  47360. for (var b = 0, w = E.length; b < w; b++) {
  47361. var T = E[b]
  47362. , x = 1 == A ? C[T.materialIndex] : o;
  47363. if (void 0 !== x) {
  47364. if (m = I[T.a],
  47365. v = I[T.b],
  47366. y = I[T.c],
  47367. !0 === x.morphTargets) {
  47368. var S = r.morphTargets
  47369. , M = this.morphTargetInfluences;
  47370. Mt.set(0, 0, 0),
  47371. Rt.set(0, 0, 0),
  47372. Pt.set(0, 0, 0);
  47373. for (var R = 0, P = S.length; R < P; R++) {
  47374. var O = M[R];
  47375. if (0 !== O) {
  47376. var L = S[R].vertices;
  47377. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47378. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47379. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47380. }
  47381. }
  47382. Mt.add(m),
  47383. Rt.add(v),
  47384. Pt.add(y),
  47385. m = Mt,
  47386. v = Rt,
  47387. y = Pt
  47388. }
  47389. if (n = wi(this, e, xt, m, v, y, kt)) {
  47390. if (i) {
  47391. var D = i[b];
  47392. Nt.copy(D[0]),
  47393. Ft.copy(D[1]),
  47394. Bt.copy(D[2]),
  47395. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47396. }
  47397. n.face = T,
  47398. n.faceIndex = b,
  47399. t.push(n)
  47400. }
  47401. }
  47402. }
  47403. }
  47404. }
  47405. ),
  47406. Ci.Mesh.prototype.clone = function() {
  47407. return new this.constructor(this.geometry,this.material).copy(this)
  47408. }
  47409. ,
  47410. Ci.Bone = function(e) {
  47411. Ci.Object3D.call(this),
  47412. this.type = "Bone",
  47413. this.skin = e
  47414. }
  47415. ,
  47416. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47417. Ci.Bone.prototype.constructor = Ci.Bone,
  47418. Ci.Bone.prototype.copy = function(e) {
  47419. return Ci.Object3D.prototype.copy.call(this, e),
  47420. this.skin = e.skin,
  47421. this
  47422. }
  47423. ,
  47424. Ci.Skeleton = function(e, t, i) {
  47425. if (this.useVertexTexture = void 0 === i || i,
  47426. this.identityMatrix = new Ci.Matrix4,
  47427. e = e || [],
  47428. this.bones = e.slice(0),
  47429. this.useVertexTexture) {
  47430. var n = Math.sqrt(4 * this.bones.length);
  47431. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47432. n = Math.max(n, 4),
  47433. this.boneTextureWidth = n,
  47434. this.boneTextureHeight = n,
  47435. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47436. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47437. } else
  47438. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47439. if (void 0 === t)
  47440. this.calculateInverses();
  47441. else if (this.bones.length === t.length)
  47442. this.boneInverses = t.slice(0);
  47443. else {
  47444. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47445. this.boneInverses = [];
  47446. for (var r = 0, o = this.bones.length; r < o; r++)
  47447. this.boneInverses.push(new Ci.Matrix4)
  47448. }
  47449. }
  47450. ,
  47451. Ci.Skeleton.prototype.calculateInverses = function() {
  47452. this.boneInverses = [];
  47453. for (var e = 0, t = this.bones.length; e < t; e++) {
  47454. var i = new Ci.Matrix4;
  47455. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47456. this.boneInverses.push(i)
  47457. }
  47458. }
  47459. ,
  47460. Ci.Skeleton.prototype.pose = function() {
  47461. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47462. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47463. for (t = 0,
  47464. i = this.bones.length; t < i; t++)
  47465. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47466. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47467. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47468. }
  47469. ,
  47470. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47471. function() {
  47472. for (var e = 0, t = this.bones.length; e < t; e++) {
  47473. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47474. wt.multiplyMatrices(i, this.boneInverses[e]),
  47475. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47476. }
  47477. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47478. }
  47479. ),
  47480. Ci.Skeleton.prototype.clone = function() {
  47481. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47482. }
  47483. ,
  47484. Ci.SkinnedMesh = function(e, t, i) {
  47485. Ci.Mesh.call(this, e, t),
  47486. this.type = "SkinnedMesh",
  47487. this.bindMode = "attached",
  47488. this.bindMatrix = new Ci.Matrix4,
  47489. this.bindMatrixInverse = new Ci.Matrix4;
  47490. var n = [];
  47491. if (this.geometry && void 0 !== this.geometry.bones) {
  47492. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47493. o = this.geometry.bones[a],
  47494. r = new Ci.Bone(this),
  47495. n.push(r),
  47496. r.name = o.name,
  47497. r.position.fromArray(o.pos),
  47498. r.quaternion.fromArray(o.rotq),
  47499. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47500. for (a = 0,
  47501. s = this.geometry.bones.length; a < s; ++a)
  47502. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47503. }
  47504. this.normalizeSkinWeights(),
  47505. this.updateMatrixWorld(!0),
  47506. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47507. }
  47508. ,
  47509. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47510. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47511. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47512. this.skeleton = e,
  47513. void 0 === t && (this.updateMatrixWorld(!0),
  47514. this.skeleton.calculateInverses(),
  47515. t = this.matrixWorld),
  47516. this.bindMatrix.copy(t),
  47517. this.bindMatrixInverse.getInverse(t)
  47518. }
  47519. ,
  47520. Ci.SkinnedMesh.prototype.pose = function() {
  47521. this.skeleton.pose()
  47522. }
  47523. ,
  47524. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47525. if (this.geometry instanceof Ci.Geometry)
  47526. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47527. var t = this.geometry.skinWeights[e];
  47528. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47529. }
  47530. else if (this.geometry instanceof Ci.BufferGeometry) {
  47531. var i = new Ci.Vector4
  47532. , n = this.geometry.attributes.skinWeight;
  47533. for (e = 0; e < n.count; e++) {
  47534. var r;
  47535. i.x = n.getX(e),
  47536. i.y = n.getY(e),
  47537. i.z = n.getZ(e),
  47538. i.w = n.getW(e),
  47539. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47540. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47541. }
  47542. }
  47543. }
  47544. ,
  47545. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47546. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47547. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47548. }
  47549. ,
  47550. Ci.SkinnedMesh.prototype.clone = function() {
  47551. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47552. }
  47553. ,
  47554. Ci.LOD = function() {
  47555. Ci.Object3D.call(this),
  47556. this.type = "LOD",
  47557. Object.defineProperties(this, {
  47558. levels: {
  47559. enumerable: !0,
  47560. value: []
  47561. },
  47562. objects: {
  47563. get: function() {
  47564. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47565. this.levels
  47566. }
  47567. }
  47568. })
  47569. }
  47570. ,
  47571. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47572. Ci.LOD.prototype.constructor = Ci.LOD,
  47573. Ci.LOD.prototype.addLevel = function(e, t) {
  47574. void 0 === t && (t = 0),
  47575. t = Math.abs(t);
  47576. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47577. ;
  47578. i.splice(n, 0, {
  47579. distance: t,
  47580. object: e
  47581. }),
  47582. this.add(e)
  47583. }
  47584. ,
  47585. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47586. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47587. ;
  47588. return t[i - 1].object
  47589. }
  47590. ,
  47591. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47592. function(e, t) {
  47593. bt.setFromMatrixPosition(this.matrixWorld);
  47594. var i = e.ray.origin.distanceTo(bt);
  47595. this.getObjectForDistance(i).raycast(e, t)
  47596. }
  47597. ),
  47598. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47599. _t = new Ci.Vector3,
  47600. function(e) {
  47601. var t = this.levels;
  47602. if (1 < t.length) {
  47603. Et.setFromMatrixPosition(e.matrixWorld),
  47604. _t.setFromMatrixPosition(this.matrixWorld);
  47605. var i = Et.distanceTo(_t);
  47606. t[0].object.visible = !0;
  47607. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47608. t[n - 1].object.visible = !1,
  47609. t[n].object.visible = !0;
  47610. for (; n < r; n++)
  47611. t[n].object.visible = !1
  47612. }
  47613. }
  47614. ),
  47615. Ci.LOD.prototype.copy = function(e) {
  47616. Ci.Object3D.prototype.copy.call(this, e, !1);
  47617. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47618. var r = t[i];
  47619. this.addLevel(r.object.clone(), r.distance)
  47620. }
  47621. return this
  47622. }
  47623. ,
  47624. Ci.LOD.prototype.toJSON = function(e) {
  47625. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47626. t.object.levels = [];
  47627. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47628. var o = i[n];
  47629. t.object.levels.push({
  47630. object: o.object.uuid,
  47631. distance: o.distance
  47632. })
  47633. }
  47634. return t
  47635. }
  47636. ,
  47637. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47638. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47639. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47640. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47641. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47642. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47643. function(e) {
  47644. Ci.Object3D.call(this),
  47645. this.type = "Sprite",
  47646. this.geometry = It,
  47647. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47648. }
  47649. ),
  47650. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47651. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47652. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47653. function(e, t) {
  47654. vt.setFromMatrixPosition(this.matrixWorld);
  47655. var i = e.ray.distanceSqToPoint(vt);
  47656. this.scale.x * this.scale.y < i || t.push({
  47657. distance: Math.sqrt(i),
  47658. point: this.position,
  47659. face: null,
  47660. object: this
  47661. })
  47662. }
  47663. ),
  47664. Ci.Sprite.prototype.clone = function() {
  47665. return new this.constructor(this.material).copy(this)
  47666. }
  47667. ,
  47668. Ci.Particle = Ci.Sprite,
  47669. Ci.LensFlare = function(e, t, i, n, r) {
  47670. Ci.Object3D.call(this),
  47671. this.lensFlares = [],
  47672. this.positionScreen = new Ci.Vector3,
  47673. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47674. }
  47675. ,
  47676. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47677. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47678. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47679. void 0 === t && (t = -1),
  47680. void 0 === i && (i = 0),
  47681. void 0 === o && (o = 1),
  47682. void 0 === r && (r = new Ci.Color(16777215)),
  47683. void 0 === n && (n = Ci.NormalBlending),
  47684. i = Math.min(i, Math.max(0, i)),
  47685. this.lensFlares.push({
  47686. texture: e,
  47687. size: t,
  47688. distance: i,
  47689. x: 0,
  47690. y: 0,
  47691. z: 0,
  47692. scale: 1,
  47693. rotation: 0,
  47694. opacity: o,
  47695. color: r,
  47696. blending: n
  47697. })
  47698. }
  47699. ,
  47700. Ci.LensFlare.prototype.updateLensFlares = function() {
  47701. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47702. for (e = 0; e < i; e++)
  47703. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47704. t.y = this.positionScreen.y + r * t.distance,
  47705. t.wantedRotation = t.x * Math.PI * .25,
  47706. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47707. }
  47708. ,
  47709. Ci.LensFlare.prototype.copy = function(e) {
  47710. Ci.Object3D.prototype.copy.call(this, e),
  47711. this.positionScreen.copy(e.positionScreen),
  47712. this.customUpdateCallback = e.customUpdateCallback;
  47713. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47714. this.lensFlares.push(e.lensFlares[t]);
  47715. return this
  47716. }
  47717. ,
  47718. Ci.Scene = function() {
  47719. Ci.Object3D.call(this),
  47720. this.type = "Scene",
  47721. this.fog = null,
  47722. this.overrideMaterial = null,
  47723. this.autoUpdate = !0
  47724. }
  47725. ,
  47726. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47727. Ci.Scene.prototype.constructor = Ci.Scene,
  47728. Ci.Scene.prototype.copy = function(e, t) {
  47729. return Ci.Object3D.prototype.copy.call(this, e, t),
  47730. null !== e.fog && (this.fog = e.fog.clone()),
  47731. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47732. this.autoUpdate = e.autoUpdate,
  47733. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47734. this
  47735. }
  47736. ,
  47737. Ci.Fog = function(e, t, i) {
  47738. this.name = "",
  47739. this.color = new Ci.Color(e),
  47740. this.near = void 0 !== t ? t : 1,
  47741. this.far = void 0 !== i ? i : 1e3
  47742. }
  47743. ,
  47744. Ci.Fog.prototype.clone = function() {
  47745. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47746. }
  47747. ,
  47748. Ci.FogExp2 = function(e, t) {
  47749. this.name = "",
  47750. this.color = new Ci.Color(e),
  47751. this.density = void 0 !== t ? t : 25e-5
  47752. }
  47753. ,
  47754. Ci.FogExp2.prototype.clone = function() {
  47755. return new Ci.FogExp2(this.color.getHex(),this.density)
  47756. }
  47757. ,
  47758. Ci.ShaderChunk = {},
  47759. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47760. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47761. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47762. 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",
  47763. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47764. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47765. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47766. 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",
  47767. 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",
  47768. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47769. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47770. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47771. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47772. 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",
  47773. 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",
  47774. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47775. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47776. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47777. 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",
  47778. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47779. 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",
  47780. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47781. 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",
  47782. 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",
  47783. 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",
  47784. 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",
  47785. 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",
  47786. 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",
  47787. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47788. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47789. 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",
  47790. 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",
  47791. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47792. 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",
  47793. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47794. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47795. 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",
  47796. 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",
  47797. 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",
  47798. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47799. 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",
  47800. 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",
  47801. 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",
  47802. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47803. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47804. 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",
  47805. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47806. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47807. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47808. 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",
  47809. 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",
  47810. 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",
  47811. 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",
  47812. 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",
  47813. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47814. 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",
  47815. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47816. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47817. 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",
  47818. 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",
  47819. 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",
  47820. 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",
  47821. 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",
  47822. 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",
  47823. 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",
  47824. 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",
  47825. 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",
  47826. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47827. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47828. 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",
  47829. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47830. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47831. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47832. 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",
  47833. 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",
  47834. 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",
  47835. 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",
  47836. Ci.UniformsUtils = {
  47837. merge: function(e) {
  47838. for (var t = {}, i = 0; i < e.length; i++) {
  47839. var n = this.clone(e[i]);
  47840. for (var r in n)
  47841. t[r] = n[r]
  47842. }
  47843. return t
  47844. },
  47845. clone: function(e) {
  47846. var t = {};
  47847. for (var i in e)
  47848. for (var n in t[i] = {},
  47849. e[i]) {
  47850. var r = e[i][n];
  47851. 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
  47852. }
  47853. return t
  47854. }
  47855. },
  47856. Ci.UniformsLib = {
  47857. common: {
  47858. diffuse: {
  47859. type: "c",
  47860. value: new Ci.Color(15658734)
  47861. },
  47862. opacity: {
  47863. type: "f",
  47864. value: 1
  47865. },
  47866. map: {
  47867. type: "t",
  47868. value: null
  47869. },
  47870. offsetRepeat: {
  47871. type: "v4",
  47872. value: new Ci.Vector4(0,0,1,1)
  47873. },
  47874. specularMap: {
  47875. type: "t",
  47876. value: null
  47877. },
  47878. alphaMap: {
  47879. type: "t",
  47880. value: null
  47881. },
  47882. envMap: {
  47883. type: "t",
  47884. value: null
  47885. },
  47886. flipEnvMap: {
  47887. type: "f",
  47888. value: -1
  47889. },
  47890. reflectivity: {
  47891. type: "f",
  47892. value: 1
  47893. },
  47894. refractionRatio: {
  47895. type: "f",
  47896. value: .98
  47897. }
  47898. },
  47899. aomap: {
  47900. aoMap: {
  47901. type: "t",
  47902. value: null
  47903. },
  47904. aoMapIntensity: {
  47905. type: "f",
  47906. value: 1
  47907. }
  47908. },
  47909. lightmap: {
  47910. lightMap: {
  47911. type: "t",
  47912. value: null
  47913. },
  47914. lightMapIntensity: {
  47915. type: "f",
  47916. value: 1
  47917. }
  47918. },
  47919. emissivemap: {
  47920. emissiveMap: {
  47921. type: "t",
  47922. value: null
  47923. }
  47924. },
  47925. bumpmap: {
  47926. bumpMap: {
  47927. type: "t",
  47928. value: null
  47929. },
  47930. bumpScale: {
  47931. type: "f",
  47932. value: 1
  47933. }
  47934. },
  47935. normalmap: {
  47936. normalMap: {
  47937. type: "t",
  47938. value: null
  47939. },
  47940. normalScale: {
  47941. type: "v2",
  47942. value: new Ci.Vector2(1,1)
  47943. }
  47944. },
  47945. displacementmap: {
  47946. displacementMap: {
  47947. type: "t",
  47948. value: null
  47949. },
  47950. displacementScale: {
  47951. type: "f",
  47952. value: 1
  47953. },
  47954. displacementBias: {
  47955. type: "f",
  47956. value: 0
  47957. }
  47958. },
  47959. roughnessmap: {
  47960. roughnessMap: {
  47961. type: "t",
  47962. value: null
  47963. }
  47964. },
  47965. metalnessmap: {
  47966. metalnessMap: {
  47967. type: "t",
  47968. value: null
  47969. }
  47970. },
  47971. fog: {
  47972. fogDensity: {
  47973. type: "f",
  47974. value: 25e-5
  47975. },
  47976. fogNear: {
  47977. type: "f",
  47978. value: 1
  47979. },
  47980. fogFar: {
  47981. type: "f",
  47982. value: 2e3
  47983. },
  47984. fogColor: {
  47985. type: "c",
  47986. value: new Ci.Color(16777215)
  47987. }
  47988. },
  47989. lights: {
  47990. ambientLightColor: {
  47991. type: "fv",
  47992. value: []
  47993. },
  47994. directionalLights: {
  47995. type: "sa",
  47996. value: [],
  47997. properties: {
  47998. direction: {
  47999. type: "v3"
  48000. },
  48001. color: {
  48002. type: "c"
  48003. },
  48004. shadow: {
  48005. type: "i"
  48006. },
  48007. shadowBias: {
  48008. type: "f"
  48009. },
  48010. shadowRadius: {
  48011. type: "f"
  48012. },
  48013. shadowMapSize: {
  48014. type: "v2"
  48015. }
  48016. }
  48017. },
  48018. directionalShadowMap: {
  48019. type: "tv",
  48020. value: []
  48021. },
  48022. directionalShadowMatrix: {
  48023. type: "m4v",
  48024. value: []
  48025. },
  48026. spotLights: {
  48027. type: "sa",
  48028. value: [],
  48029. properties: {
  48030. color: {
  48031. type: "c"
  48032. },
  48033. position: {
  48034. type: "v3"
  48035. },
  48036. direction: {
  48037. type: "v3"
  48038. },
  48039. distance: {
  48040. type: "f"
  48041. },
  48042. coneCos: {
  48043. type: "f"
  48044. },
  48045. penumbraCos: {
  48046. type: "f"
  48047. },
  48048. decay: {
  48049. type: "f"
  48050. },
  48051. shadow: {
  48052. type: "i"
  48053. },
  48054. shadowBias: {
  48055. type: "f"
  48056. },
  48057. shadowRadius: {
  48058. type: "f"
  48059. },
  48060. shadowMapSize: {
  48061. type: "v2"
  48062. }
  48063. }
  48064. },
  48065. spotShadowMap: {
  48066. type: "tv",
  48067. value: []
  48068. },
  48069. spotShadowMatrix: {
  48070. type: "m4v",
  48071. value: []
  48072. },
  48073. pointLights: {
  48074. type: "sa",
  48075. value: [],
  48076. properties: {
  48077. color: {
  48078. type: "c"
  48079. },
  48080. position: {
  48081. type: "v3"
  48082. },
  48083. decay: {
  48084. type: "f"
  48085. },
  48086. distance: {
  48087. type: "f"
  48088. },
  48089. shadow: {
  48090. type: "i"
  48091. },
  48092. shadowBias: {
  48093. type: "f"
  48094. },
  48095. shadowRadius: {
  48096. type: "f"
  48097. },
  48098. shadowMapSize: {
  48099. type: "v2"
  48100. }
  48101. }
  48102. },
  48103. pointShadowMap: {
  48104. type: "tv",
  48105. value: []
  48106. },
  48107. pointShadowMatrix: {
  48108. type: "m4v",
  48109. value: []
  48110. },
  48111. hemisphereLights: {
  48112. type: "sa",
  48113. value: [],
  48114. properties: {
  48115. direction: {
  48116. type: "v3"
  48117. },
  48118. skyColor: {
  48119. type: "c"
  48120. },
  48121. groundColor: {
  48122. type: "c"
  48123. }
  48124. }
  48125. }
  48126. },
  48127. points: {
  48128. diffuse: {
  48129. type: "c",
  48130. value: new Ci.Color(15658734)
  48131. },
  48132. opacity: {
  48133. type: "f",
  48134. value: 1
  48135. },
  48136. size: {
  48137. type: "f",
  48138. value: 1
  48139. },
  48140. scale: {
  48141. type: "f",
  48142. value: 1
  48143. },
  48144. map: {
  48145. type: "t",
  48146. value: null
  48147. },
  48148. offsetRepeat: {
  48149. type: "v4",
  48150. value: new Ci.Vector4(0,0,1,1)
  48151. }
  48152. }
  48153. },
  48154. 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",
  48155. 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",
  48156. 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",
  48157. 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",
  48158. 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",
  48159. 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",
  48160. 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",
  48161. 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",
  48162. 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",
  48163. 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",
  48164. 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",
  48165. 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",
  48166. 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",
  48167. 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",
  48168. 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",
  48169. 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",
  48170. 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",
  48171. 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",
  48172. 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",
  48173. 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",
  48174. 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",
  48175. 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",
  48176. 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",
  48177. 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",
  48178. Ci.ShaderLib = {
  48179. basic: {
  48180. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48181. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48182. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48183. },
  48184. lambert: {
  48185. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48186. emissive: {
  48187. type: "c",
  48188. value: new Ci.Color(0)
  48189. }
  48190. }]),
  48191. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48192. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48193. },
  48194. phong: {
  48195. 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, {
  48196. emissive: {
  48197. type: "c",
  48198. value: new Ci.Color(0)
  48199. },
  48200. specular: {
  48201. type: "c",
  48202. value: new Ci.Color(1118481)
  48203. },
  48204. shininess: {
  48205. type: "f",
  48206. value: 30
  48207. }
  48208. }]),
  48209. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48210. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48211. },
  48212. standard: {
  48213. 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, {
  48214. emissive: {
  48215. type: "c",
  48216. value: new Ci.Color(0)
  48217. },
  48218. roughness: {
  48219. type: "f",
  48220. value: .5
  48221. },
  48222. metalness: {
  48223. type: "f",
  48224. value: 0
  48225. },
  48226. envMapIntensity: {
  48227. type: "f",
  48228. value: 1
  48229. }
  48230. }]),
  48231. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48232. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48233. },
  48234. points: {
  48235. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48236. vertexShader: Ci.ShaderChunk.points_vert,
  48237. fragmentShader: Ci.ShaderChunk.points_frag
  48238. },
  48239. dashed: {
  48240. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48241. scale: {
  48242. type: "f",
  48243. value: 1
  48244. },
  48245. dashSize: {
  48246. type: "f",
  48247. value: 1
  48248. },
  48249. totalSize: {
  48250. type: "f",
  48251. value: 2
  48252. }
  48253. }]),
  48254. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48255. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48256. },
  48257. depth: {
  48258. uniforms: {
  48259. mNear: {
  48260. type: "f",
  48261. value: 1
  48262. },
  48263. mFar: {
  48264. type: "f",
  48265. value: 2e3
  48266. },
  48267. opacity: {
  48268. type: "f",
  48269. value: 1
  48270. }
  48271. },
  48272. vertexShader: Ci.ShaderChunk.depth_vert,
  48273. fragmentShader: Ci.ShaderChunk.depth_frag
  48274. },
  48275. normal: {
  48276. uniforms: {
  48277. opacity: {
  48278. type: "f",
  48279. value: 1
  48280. }
  48281. },
  48282. vertexShader: Ci.ShaderChunk.normal_vert,
  48283. fragmentShader: Ci.ShaderChunk.normal_frag
  48284. },
  48285. cube: {
  48286. uniforms: {
  48287. tCube: {
  48288. type: "t",
  48289. value: null
  48290. },
  48291. tFlip: {
  48292. type: "f",
  48293. value: -1
  48294. }
  48295. },
  48296. vertexShader: Ci.ShaderChunk.cube_vert,
  48297. fragmentShader: Ci.ShaderChunk.cube_frag
  48298. },
  48299. equirect: {
  48300. uniforms: {
  48301. tEquirect: {
  48302. type: "t",
  48303. value: null
  48304. },
  48305. tFlip: {
  48306. type: "f",
  48307. value: -1
  48308. }
  48309. },
  48310. vertexShader: Ci.ShaderChunk.equirect_vert,
  48311. fragmentShader: Ci.ShaderChunk.equirect_frag
  48312. },
  48313. depthRGBA: {
  48314. uniforms: {},
  48315. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48316. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48317. },
  48318. distanceRGBA: {
  48319. uniforms: {
  48320. lightPos: {
  48321. type: "v3",
  48322. value: new Ci.Vector3(0,0,0)
  48323. }
  48324. },
  48325. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48326. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48327. }
  48328. },
  48329. Ci.WebGLRenderer = function(e) {
  48330. function S() {
  48331. return null === Q ? he : 1
  48332. }
  48333. function i(e, t, i, n) {
  48334. !0 === V && (e *= n,
  48335. t *= n,
  48336. i *= n),
  48337. _e.clearColor(e, t, i, n)
  48338. }
  48339. function t() {
  48340. _e.init(),
  48341. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48342. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48343. i(ae.r, ae.g, ae.b, se)
  48344. }
  48345. function n() {
  48346. te = K = null,
  48347. ee = "",
  48348. $ = -1,
  48349. _e.reset()
  48350. }
  48351. function r(e) {
  48352. e.preventDefault(),
  48353. n(),
  48354. t(),
  48355. be.clear()
  48356. }
  48357. function f(e) {
  48358. var t = e.target;
  48359. t.removeEventListener("dispose", f),
  48360. function(e) {
  48361. var t = be.get(e);
  48362. if (e.image && t.__image__webglTextureCube)
  48363. X.deleteTexture(t.__image__webglTextureCube);
  48364. else {
  48365. if (void 0 === t.__webglInit)
  48366. return;
  48367. X.deleteTexture(t.__webglTexture)
  48368. }
  48369. be.delete(e)
  48370. }(t),
  48371. ye.textures--
  48372. }
  48373. function a(e) {
  48374. var t = e.target;
  48375. t.removeEventListener("dispose", a),
  48376. function(e) {
  48377. var t = be.get(e)
  48378. , i = be.get(e.texture);
  48379. if (e && void 0 !== i.__webglTexture) {
  48380. if (X.deleteTexture(i.__webglTexture),
  48381. e instanceof Ci.WebGLRenderTargetCube)
  48382. for (var n = 0; n < 6; n++)
  48383. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48384. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48385. else
  48386. X.deleteFramebuffer(t.__webglFramebuffer),
  48387. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48388. be.delete(e.texture),
  48389. be.delete(e)
  48390. }
  48391. }(t),
  48392. ye.textures--
  48393. }
  48394. function v(e) {
  48395. var t = e.target;
  48396. t.removeEventListener("dispose", v),
  48397. function(e) {
  48398. y(e),
  48399. be.delete(e)
  48400. }(t)
  48401. }
  48402. function y(e) {
  48403. var t = be.get(e).program;
  48404. (e.program = void 0) !== t && Te.releaseProgram(t)
  48405. }
  48406. function M(e, t) {
  48407. return Math.abs(t[0]) - Math.abs(e[0])
  48408. }
  48409. function s(e, t) {
  48410. 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
  48411. }
  48412. function l(e, t) {
  48413. 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
  48414. }
  48415. function d(e, t, i, n, r) {
  48416. var o, a;
  48417. a = i.transparent ? (o = G,
  48418. ++W) : (o = H,
  48419. ++z);
  48420. var s = o[a];
  48421. void 0 !== s ? (s.id = e.id,
  48422. s.object = e,
  48423. s.geometry = t,
  48424. s.material = i,
  48425. s.z = me.z,
  48426. s.group = r) : (s = {
  48427. id: e.id,
  48428. object: e,
  48429. geometry: t,
  48430. material: i,
  48431. z: me.z,
  48432. group: r
  48433. },
  48434. o.push(s))
  48435. }
  48436. function c(e, t, i, n) {
  48437. for (var r = 0, o = e.length; r < o; r++) {
  48438. var a = e[r]
  48439. , s = a.object
  48440. , l = a.geometry
  48441. , c = void 0 === n ? a.material : n
  48442. , h = a.group;
  48443. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48444. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48445. s instanceof Ci.ImmediateRenderObject) {
  48446. R(c);
  48447. var u = P(t, i, c, s);
  48448. ee = "",
  48449. s.render(function(e) {
  48450. Z.renderBufferImmediate(e, u, c)
  48451. })
  48452. } else
  48453. Z.renderBufferDirect(t, i, l, c, s, h)
  48454. }
  48455. }
  48456. function R(e) {
  48457. (function(e) {
  48458. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48459. _e.setFlipSided(e.side === Ci.BackSide)
  48460. }
  48461. )(e),
  48462. !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),
  48463. _e.setDepthFunc(e.depthFunc),
  48464. _e.setDepthTest(e.depthTest),
  48465. _e.setDepthWrite(e.depthWrite),
  48466. _e.setColorWrite(e.colorWrite),
  48467. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48468. }
  48469. function P(e, t, i, n) {
  48470. oe = 0;
  48471. var r = be.get(i);
  48472. void 0 === r.program && (i.needsUpdate = !0),
  48473. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48474. i.needsUpdate && (function(e, t, i) {
  48475. var n = be.get(e)
  48476. , r = Te.getParameters(e, ve, t, i)
  48477. , o = Te.getProgramCode(e, r)
  48478. , a = n.program
  48479. , s = !0;
  48480. if (void 0 === a)
  48481. e.addEventListener("dispose", v);
  48482. else if (a.code !== o)
  48483. y(e);
  48484. else {
  48485. if (void 0 !== r.shaderID)
  48486. return;
  48487. s = !1
  48488. }
  48489. if (s) {
  48490. if (r.shaderID) {
  48491. var l = Ci.ShaderLib[r.shaderID];
  48492. n.__webglShader = {
  48493. name: e.type,
  48494. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48495. vertexShader: l.vertexShader,
  48496. fragmentShader: l.fragmentShader
  48497. }
  48498. } else
  48499. n.__webglShader = {
  48500. name: e.type,
  48501. uniforms: e.uniforms,
  48502. vertexShader: e.vertexShader,
  48503. fragmentShader: e.fragmentShader
  48504. };
  48505. e.__webglShader = n.__webglShader,
  48506. a = Te.acquireProgram(e, r, o),
  48507. n.program = a,
  48508. e.program = a
  48509. }
  48510. var c = a.getAttributes();
  48511. if (e.morphTargets)
  48512. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48513. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48514. if (e.morphNormals)
  48515. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48516. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48517. n.uniformsList = [];
  48518. var u = n.__webglShader.uniforms
  48519. , d = n.program.getUniforms();
  48520. for (var p in u) {
  48521. var f = d[p];
  48522. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48523. }
  48524. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48525. u.ambientLightColor.value = ve.ambient,
  48526. u.directionalLights.value = ve.directional,
  48527. u.spotLights.value = ve.spot,
  48528. u.pointLights.value = ve.point,
  48529. u.hemisphereLights.value = ve.hemi,
  48530. u.directionalShadowMap.value = ve.directionalShadowMap,
  48531. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48532. u.spotShadowMap.value = ve.spotShadowMap,
  48533. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48534. u.pointShadowMap.value = ve.pointShadowMap,
  48535. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48536. n.hasDynamicUniforms = !1;
  48537. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48538. if (!0 === n.uniformsList[g][0].dynamic) {
  48539. n.hasDynamicUniforms = !0;
  48540. break
  48541. }
  48542. }
  48543. }(i, t, n),
  48544. i.needsUpdate = !1);
  48545. var o = !1
  48546. , a = !1
  48547. , s = !1
  48548. , l = r.program
  48549. , c = l.getUniforms()
  48550. , h = r.__webglShader.uniforms;
  48551. if (l.id !== K && (X.useProgram(l.program),
  48552. K = l.id,
  48553. s = a = o = !0),
  48554. i.id !== $ && ($ = i.id,
  48555. a = !0),
  48556. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48557. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48558. e !== te && (te = e,
  48559. s = a = !0),
  48560. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48561. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48562. (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),
  48563. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48564. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48565. i.skinning)
  48566. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48567. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48568. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48569. if (void 0 !== c.boneTexture) {
  48570. var u = A();
  48571. X.uniform1i(c.boneTexture, u),
  48572. Z.setTexture(n.skeleton.boneTexture, u)
  48573. }
  48574. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48575. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48576. } else
  48577. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48578. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48579. e.ambientLightColor.needsUpdate = t,
  48580. e.directionalLights.needsUpdate = t,
  48581. e.pointLights.needsUpdate = t,
  48582. e.spotLights.needsUpdate = t,
  48583. e.hemisphereLights.needsUpdate = t
  48584. }(h, s),
  48585. t && i.fog && function(e, t) {
  48586. e.fogColor.value = t.color,
  48587. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48588. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48589. }(h, t),
  48590. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48591. var i;
  48592. if (e.opacity.value = t.opacity,
  48593. e.diffuse.value = t.color,
  48594. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48595. e.map.value = t.map,
  48596. e.specularMap.value = t.specularMap,
  48597. e.alphaMap.value = t.alphaMap,
  48598. t.aoMap && (e.aoMap.value = t.aoMap,
  48599. e.aoMapIntensity.value = t.aoMapIntensity),
  48600. 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),
  48601. void 0 !== i) {
  48602. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48603. var n = i.offset
  48604. , r = i.repeat;
  48605. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48606. }
  48607. e.envMap.value = t.envMap,
  48608. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48609. e.reflectivity.value = t.reflectivity,
  48610. e.refractionRatio.value = t.refractionRatio
  48611. }(h, i),
  48612. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48613. function(e, t) {
  48614. e.dashSize.value = t.dashSize,
  48615. e.totalSize.value = t.dashSize + t.gapSize,
  48616. e.scale.value = t.scale
  48617. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48618. if (e.diffuse.value = t.color,
  48619. e.opacity.value = t.opacity,
  48620. e.size.value = t.size * he,
  48621. e.scale.value = O.clientHeight / 2,
  48622. e.map.value = t.map,
  48623. null !== t.map) {
  48624. var i = t.map.offset
  48625. , n = t.map.repeat;
  48626. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48627. }
  48628. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48629. t.lightMap && (e.lightMap.value = t.lightMap,
  48630. e.lightMapIntensity.value = t.lightMapIntensity),
  48631. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48632. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48633. e.specular.value = t.specular,
  48634. e.shininess.value = Math.max(t.shininess, 1e-4),
  48635. t.lightMap && (e.lightMap.value = t.lightMap,
  48636. e.lightMapIntensity.value = t.lightMapIntensity),
  48637. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48638. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48639. e.bumpScale.value = t.bumpScale),
  48640. t.normalMap && (e.normalMap.value = t.normalMap,
  48641. e.normalScale.value.copy(t.normalScale)),
  48642. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48643. e.displacementScale.value = t.displacementScale,
  48644. e.displacementBias.value = t.displacementBias)
  48645. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48646. e.roughness.value = t.roughness,
  48647. e.metalness.value = t.metalness,
  48648. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48649. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48650. t.lightMap && (e.lightMap.value = t.lightMap,
  48651. e.lightMapIntensity.value = t.lightMapIntensity),
  48652. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48653. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48654. e.bumpScale.value = t.bumpScale),
  48655. t.normalMap && (e.normalMap.value = t.normalMap,
  48656. e.normalScale.value.copy(t.normalScale)),
  48657. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48658. e.displacementScale.value = t.displacementScale,
  48659. e.displacementBias.value = t.displacementBias),
  48660. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48661. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48662. h.mFar.value = e.far,
  48663. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48664. g(r.uniformsList)),
  48665. function(e, t) {
  48666. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48667. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48668. }(c, n),
  48669. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48670. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48671. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48672. var a = e[r][0]
  48673. , s = a.onUpdateCallback;
  48674. void 0 !== s && (s.bind(a)(t, i),
  48675. n.push(e[r]))
  48676. }
  48677. g(n)
  48678. }(r.uniformsList, n, e),
  48679. l
  48680. }
  48681. function p(e, t) {
  48682. e.diffuse.value = t.color,
  48683. e.opacity.value = t.opacity
  48684. }
  48685. function A() {
  48686. var e = oe;
  48687. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48688. oe += 1,
  48689. e
  48690. }
  48691. function C(e, t, i, n) {
  48692. var r, o;
  48693. if ("1i" === t)
  48694. X.uniform1i(i, n);
  48695. else if ("1f" === t)
  48696. X.uniform1f(i, n);
  48697. else if ("2f" === t)
  48698. X.uniform2f(i, n[0], n[1]);
  48699. else if ("3f" === t)
  48700. X.uniform3f(i, n[0], n[1], n[2]);
  48701. else if ("4f" === t)
  48702. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48703. else if ("1iv" === t)
  48704. X.uniform1iv(i, n);
  48705. else if ("3iv" === t)
  48706. X.uniform3iv(i, n);
  48707. else if ("1fv" === t)
  48708. X.uniform1fv(i, n);
  48709. else if ("2fv" === t)
  48710. X.uniform2fv(i, n);
  48711. else if ("3fv" === t)
  48712. X.uniform3fv(i, n);
  48713. else if ("4fv" === t)
  48714. X.uniform4fv(i, n);
  48715. else if ("Matrix2fv" === t)
  48716. X.uniformMatrix2fv(i, !1, n);
  48717. else if ("Matrix3fv" === t)
  48718. X.uniformMatrix3fv(i, !1, n);
  48719. else if ("Matrix4fv" === t)
  48720. X.uniformMatrix4fv(i, !1, n);
  48721. else if ("i" === t)
  48722. X.uniform1i(i, n);
  48723. else if ("f" === t)
  48724. X.uniform1f(i, n);
  48725. else if ("v2" === t)
  48726. X.uniform2f(i, n.x, n.y);
  48727. else if ("v3" === t)
  48728. X.uniform3f(i, n.x, n.y, n.z);
  48729. else if ("v4" === t)
  48730. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48731. else if ("c" === t)
  48732. X.uniform3f(i, n.r, n.g, n.b);
  48733. else if ("s" === t) {
  48734. var a = e.properties;
  48735. for (var s in a) {
  48736. var l = a[s]
  48737. , c = i[s]
  48738. , h = n[s];
  48739. C(l, l.type, c, h)
  48740. }
  48741. } else if ("sa" === t) {
  48742. a = e.properties;
  48743. for (var u = 0, d = n.length; u < d; u++)
  48744. for (var s in a) {
  48745. l = a[s],
  48746. c = i[u][s],
  48747. h = n[u][s];
  48748. C(l, l.type, c, h)
  48749. }
  48750. } else if ("iv1" === t)
  48751. X.uniform1iv(i, n);
  48752. else if ("iv" === t)
  48753. X.uniform3iv(i, n);
  48754. else if ("fv1" === t)
  48755. X.uniform1fv(i, n);
  48756. else if ("fv" === t)
  48757. X.uniform3fv(i, n);
  48758. else if ("v2v" === t) {
  48759. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48760. u = 0;
  48761. for (var p = 0, f = n.length; u < f; u++,
  48762. p += 2)
  48763. e._array[p + 0] = n[u].x,
  48764. e._array[p + 1] = n[u].y;
  48765. X.uniform2fv(i, e._array)
  48766. } else if ("v3v" === t) {
  48767. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48768. u = 0;
  48769. var g = 0;
  48770. for (f = n.length; u < f; u++,
  48771. g += 3)
  48772. e._array[g + 0] = n[u].x,
  48773. e._array[g + 1] = n[u].y,
  48774. e._array[g + 2] = n[u].z;
  48775. X.uniform3fv(i, e._array)
  48776. } else if ("v4v" === t) {
  48777. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48778. u = 0;
  48779. var m = 0;
  48780. for (f = n.length; u < f; u++,
  48781. m += 4)
  48782. e._array[m + 0] = n[u].x,
  48783. e._array[m + 1] = n[u].y,
  48784. e._array[m + 2] = n[u].z,
  48785. e._array[m + 3] = n[u].w;
  48786. X.uniform4fv(i, e._array)
  48787. } else if ("m2" === t)
  48788. X.uniformMatrix2fv(i, !1, n.elements);
  48789. else if ("m3" === t)
  48790. X.uniformMatrix3fv(i, !1, n.elements);
  48791. else if ("m3v" === t) {
  48792. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48793. for (u = 0,
  48794. f = n.length; u < f; u++)
  48795. n[u].flattenToArrayOffset(e._array, 9 * u);
  48796. X.uniformMatrix3fv(i, !1, e._array)
  48797. } else if ("m4" === t)
  48798. X.uniformMatrix4fv(i, !1, n.elements);
  48799. else if ("m4v" === t) {
  48800. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48801. for (u = 0,
  48802. f = n.length; u < f; u++)
  48803. n[u].flattenToArrayOffset(e._array, 16 * u);
  48804. X.uniformMatrix4fv(i, !1, e._array)
  48805. } else if ("t" === t) {
  48806. if (r = n,
  48807. o = A(),
  48808. X.uniform1i(i, o),
  48809. !r)
  48810. return;
  48811. 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)
  48812. } else if ("tv" === t) {
  48813. void 0 === e._array && (e._array = []);
  48814. for (u = 0,
  48815. f = e.value.length; u < f; u++)
  48816. e._array[u] = A();
  48817. X.uniform1iv(i, e._array);
  48818. for (u = 0,
  48819. f = e.value.length; u < f; u++)
  48820. r = e.value[u],
  48821. o = e._array[u],
  48822. 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))
  48823. } else
  48824. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48825. }
  48826. function g(e) {
  48827. for (var t = 0, i = e.length; t < i; t++) {
  48828. var n = e[t][0];
  48829. if (!1 !== n.needsUpdate)
  48830. C(n, n.type, e[t][1], n.value)
  48831. }
  48832. }
  48833. function m(e, t, i) {
  48834. var n;
  48835. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48836. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48837. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48838. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48839. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48840. 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),
  48841. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48842. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48843. 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)),
  48844. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48845. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48846. return;
  48847. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48848. return;
  48849. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48850. be.get(t).__currentAnisotropy = t.anisotropy)
  48851. }
  48852. }
  48853. function o(e, t, i) {
  48854. void 0 === e.__webglInit && (e.__webglInit = !0,
  48855. t.addEventListener("dispose", f),
  48856. e.__webglTexture = X.createTexture(),
  48857. ye.textures++),
  48858. _e.activeTexture(X.TEXTURE0 + i),
  48859. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48860. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48861. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48862. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48863. var n = I(t.image, Ee.maxTextureSize);
  48864. !function(e) {
  48865. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48866. }(t) || !1 !== E(n) || (n = function(e) {
  48867. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48868. var t = document.createElement("canvas");
  48869. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48870. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48871. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48872. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48873. t
  48874. }
  48875. return e
  48876. }(n));
  48877. var r = E(n)
  48878. , o = x(t.format)
  48879. , a = x(t.type);
  48880. m(X.TEXTURE_2D, t, r);
  48881. var s, l = t.mipmaps;
  48882. if (t instanceof Ci.DataTexture)
  48883. if (0 < l.length && r) {
  48884. for (var c = 0, h = l.length; c < h; c++)
  48885. s = l[c],
  48886. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48887. t.generateMipmaps = !1
  48888. } else
  48889. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48890. else if (t instanceof Ci.CompressedTexture)
  48891. for (c = 0,
  48892. h = l.length; c < h; c++)
  48893. s = l[c],
  48894. 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);
  48895. else if (0 < l.length && r) {
  48896. for (c = 0,
  48897. h = l.length; c < h; c++)
  48898. s = l[c],
  48899. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48900. t.generateMipmaps = !1
  48901. } else
  48902. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48903. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48904. e.__version = t.version,
  48905. t.onUpdate && t.onUpdate(t)
  48906. }
  48907. function I(e, t) {
  48908. if (e.width > t || e.height > t) {
  48909. var i = t / Math.max(e.width, e.height)
  48910. , n = document.createElement("canvas");
  48911. return n.width = Math.floor(e.width * i),
  48912. n.height = Math.floor(e.height * i),
  48913. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48914. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48915. n
  48916. }
  48917. return e
  48918. }
  48919. function E(e) {
  48920. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48921. }
  48922. function _(e, t) {
  48923. var i = be.get(e);
  48924. if (6 === e.image.length)
  48925. if (0 < e.version && i.__version !== e.version) {
  48926. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48927. i.__image__webglTextureCube = X.createTexture(),
  48928. ye.textures++),
  48929. _e.activeTexture(X.TEXTURE0 + t),
  48930. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48931. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48932. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48933. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48934. var s = E(o[0])
  48935. , l = x(e.format)
  48936. , c = x(e.type);
  48937. m(X.TEXTURE_CUBE_MAP, e, s);
  48938. for (a = 0; a < 6; a++)
  48939. if (n)
  48940. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48941. h = u[d],
  48942. 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);
  48943. else
  48944. 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]);
  48945. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48946. i.__version = e.version,
  48947. e.onUpdate && e.onUpdate(e)
  48948. } else
  48949. _e.activeTexture(X.TEXTURE0 + t),
  48950. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48951. }
  48952. function b(e, t) {
  48953. _e.activeTexture(X.TEXTURE0 + t),
  48954. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48955. }
  48956. function h(e, t, i, n) {
  48957. var r = x(t.texture.format)
  48958. , o = x(t.texture.type);
  48959. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48960. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48961. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48962. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48963. }
  48964. function u(e, t) {
  48965. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48966. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48967. 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),
  48968. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48969. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48970. }
  48971. function w(e) {
  48972. var t = be.get(e)
  48973. , i = be.get(e.texture);
  48974. e.addEventListener("dispose", a),
  48975. i.__webglTexture = X.createTexture(),
  48976. ye.textures++;
  48977. var n = e instanceof Ci.WebGLRenderTargetCube
  48978. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48979. if (n) {
  48980. t.__webglFramebuffer = [];
  48981. for (var o = 0; o < 6; o++)
  48982. t.__webglFramebuffer[o] = X.createFramebuffer()
  48983. } else
  48984. t.__webglFramebuffer = X.createFramebuffer();
  48985. if (n) {
  48986. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48987. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48988. for (o = 0; o < 6; o++)
  48989. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48990. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48991. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48992. } else
  48993. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48994. m(X.TEXTURE_2D, e.texture, r),
  48995. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48996. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48997. _e.bindTexture(X.TEXTURE_2D, null);
  48998. e.depthBuffer && function(e) {
  48999. var t = be.get(e);
  49000. if (e instanceof Ci.WebGLRenderTargetCube) {
  49001. t.__webglDepthbuffer = [];
  49002. for (var i = 0; i < 6; i++)
  49003. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49004. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49005. u(t.__webglDepthbuffer[i], e)
  49006. } else
  49007. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49008. t.__webglDepthbuffer = X.createRenderbuffer(),
  49009. u(t.__webglDepthbuffer, e);
  49010. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49011. }(e)
  49012. }
  49013. function T(e) {
  49014. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49015. }
  49016. function x(e) {
  49017. var t;
  49018. if (e === Ci.RepeatWrapping)
  49019. return X.REPEAT;
  49020. if (e === Ci.ClampToEdgeWrapping)
  49021. return X.CLAMP_TO_EDGE;
  49022. if (e === Ci.MirroredRepeatWrapping)
  49023. return X.MIRRORED_REPEAT;
  49024. if (e === Ci.NearestFilter)
  49025. return X.NEAREST;
  49026. if (e === Ci.NearestMipMapNearestFilter)
  49027. return X.NEAREST_MIPMAP_NEAREST;
  49028. if (e === Ci.NearestMipMapLinearFilter)
  49029. return X.NEAREST_MIPMAP_LINEAR;
  49030. if (e === Ci.LinearFilter)
  49031. return X.LINEAR;
  49032. if (e === Ci.LinearMipMapNearestFilter)
  49033. return X.LINEAR_MIPMAP_NEAREST;
  49034. if (e === Ci.LinearMipMapLinearFilter)
  49035. return X.LINEAR_MIPMAP_LINEAR;
  49036. if (e === Ci.UnsignedByteType)
  49037. return X.UNSIGNED_BYTE;
  49038. if (e === Ci.UnsignedShort4444Type)
  49039. return X.UNSIGNED_SHORT_4_4_4_4;
  49040. if (e === Ci.UnsignedShort5551Type)
  49041. return X.UNSIGNED_SHORT_5_5_5_1;
  49042. if (e === Ci.UnsignedShort565Type)
  49043. return X.UNSIGNED_SHORT_5_6_5;
  49044. if (e === Ci.ByteType)
  49045. return X.BYTE;
  49046. if (e === Ci.ShortType)
  49047. return X.SHORT;
  49048. if (e === Ci.UnsignedShortType)
  49049. return X.UNSIGNED_SHORT;
  49050. if (e === Ci.IntType)
  49051. return X.INT;
  49052. if (e === Ci.UnsignedIntType)
  49053. return X.UNSIGNED_INT;
  49054. if (e === Ci.FloatType)
  49055. return X.FLOAT;
  49056. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49057. return t.HALF_FLOAT_OES;
  49058. if (e === Ci.AlphaFormat)
  49059. return X.ALPHA;
  49060. if (e === Ci.RGBFormat)
  49061. return X.RGB;
  49062. if (e === Ci.RGBAFormat)
  49063. return X.RGBA;
  49064. if (e === Ci.LuminanceFormat)
  49065. return X.LUMINANCE;
  49066. if (e === Ci.LuminanceAlphaFormat)
  49067. return X.LUMINANCE_ALPHA;
  49068. if (e === Ci.AddEquation)
  49069. return X.FUNC_ADD;
  49070. if (e === Ci.SubtractEquation)
  49071. return X.FUNC_SUBTRACT;
  49072. if (e === Ci.ReverseSubtractEquation)
  49073. return X.FUNC_REVERSE_SUBTRACT;
  49074. if (e === Ci.ZeroFactor)
  49075. return X.ZERO;
  49076. if (e === Ci.OneFactor)
  49077. return X.ONE;
  49078. if (e === Ci.SrcColorFactor)
  49079. return X.SRC_COLOR;
  49080. if (e === Ci.OneMinusSrcColorFactor)
  49081. return X.ONE_MINUS_SRC_COLOR;
  49082. if (e === Ci.SrcAlphaFactor)
  49083. return X.SRC_ALPHA;
  49084. if (e === Ci.OneMinusSrcAlphaFactor)
  49085. return X.ONE_MINUS_SRC_ALPHA;
  49086. if (e === Ci.DstAlphaFactor)
  49087. return X.DST_ALPHA;
  49088. if (e === Ci.OneMinusDstAlphaFactor)
  49089. return X.ONE_MINUS_DST_ALPHA;
  49090. if (e === Ci.DstColorFactor)
  49091. return X.DST_COLOR;
  49092. if (e === Ci.OneMinusDstColorFactor)
  49093. return X.ONE_MINUS_DST_COLOR;
  49094. if (e === Ci.SrcAlphaSaturateFactor)
  49095. return X.SRC_ALPHA_SATURATE;
  49096. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49097. if (e === Ci.RGB_S3TC_DXT1_Format)
  49098. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49099. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49100. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49101. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49102. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49103. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49104. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49105. }
  49106. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49107. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49108. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49109. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49110. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49111. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49112. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49113. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49114. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49115. }
  49116. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49117. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49118. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49119. if (e === Ci.MinEquation)
  49120. return t.MIN_EXT;
  49121. if (e === Ci.MaxEquation)
  49122. return t.MAX_EXT
  49123. }
  49124. return 0
  49125. }
  49126. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49127. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49128. , L = void 0 !== e.context ? e.context : null
  49129. , D = void 0 !== e.alpha && e.alpha
  49130. , N = void 0 === e.depth || e.depth
  49131. , F = void 0 === e.stencil || e.stencil
  49132. , B = void 0 !== e.antialias && e.antialias
  49133. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49134. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49135. , U = []
  49136. , H = []
  49137. , z = -1
  49138. , G = []
  49139. , W = -1
  49140. , j = new Float32Array(8)
  49141. , Y = []
  49142. , q = [];
  49143. this.domElement = O,
  49144. this.context = null,
  49145. this.autoClear = !0,
  49146. this.autoClearColor = !0,
  49147. this.autoClearDepth = !0,
  49148. this.autoClearStencil = !0,
  49149. this.sortObjects = !0,
  49150. this.gammaFactor = 2,
  49151. this.gammaInput = !1,
  49152. this.gammaOutput = !1,
  49153. this.physicallyCorrectLights = !1,
  49154. this.toneMapping = Ci.LinearToneMapping,
  49155. this.toneMappingExposure = 1,
  49156. this.toneMappingWhitePoint = 1,
  49157. this.maxMorphTargets = 8,
  49158. this.maxMorphNormals = 4,
  49159. this.autoScaleCubemaps = !0;
  49160. 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 = {
  49161. hash: "",
  49162. ambient: [0, 0, 0],
  49163. directional: [],
  49164. directionalShadowMap: [],
  49165. directionalShadowMatrix: [],
  49166. spot: [],
  49167. spotShadowMap: [],
  49168. spotShadowMatrix: [],
  49169. point: [],
  49170. pointShadowMap: [],
  49171. pointShadowMatrix: [],
  49172. hemi: [],
  49173. shadows: [],
  49174. shadowsPointLight: 0
  49175. }, ye = {
  49176. geometries: 0,
  49177. textures: 0
  49178. }, Ae = {
  49179. calls: 0,
  49180. vertices: 0,
  49181. faces: 0,
  49182. points: 0
  49183. };
  49184. this.info = {
  49185. render: Ae,
  49186. memory: ye,
  49187. programs: null
  49188. };
  49189. try {
  49190. var Ce = {
  49191. alpha: D,
  49192. depth: N,
  49193. stencil: F,
  49194. antialias: B,
  49195. premultipliedAlpha: V,
  49196. preserveDrawingBuffer: k
  49197. };
  49198. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49199. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49200. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49201. return {
  49202. rangeMin: 1,
  49203. rangeMax: 1,
  49204. precision: 1
  49205. }
  49206. }
  49207. ),
  49208. O.addEventListener("webglcontextlost", r, !1)
  49209. } catch (e) {
  49210. console.error("THREE.WebGLRenderer: " + e)
  49211. }
  49212. var Ie = new Ci.WebGLExtensions(X);
  49213. Ie.get("OES_texture_float"),
  49214. Ie.get("OES_texture_float_linear"),
  49215. Ie.get("OES_texture_half_float"),
  49216. Ie.get("OES_texture_half_float_linear"),
  49217. Ie.get("OES_standard_derivatives"),
  49218. Ie.get("ANGLE_instanced_arrays"),
  49219. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49220. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49221. , _e = new Ci.WebGLState(X,Ie,x)
  49222. , be = new Ci.WebGLProperties
  49223. , we = new Ci.WebGLObjects(X,be,this.info)
  49224. , Te = new Ci.WebGLPrograms(this,Ee)
  49225. , xe = new Ci.WebGLLights;
  49226. this.info.programs = Te.programs;
  49227. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49228. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49229. t(),
  49230. this.context = X,
  49231. this.capabilities = Ee,
  49232. this.extensions = Ie,
  49233. this.properties = be,
  49234. this.state = _e;
  49235. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49236. this.shadowMap = Re;
  49237. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49238. this.getContext = function() {
  49239. return X
  49240. }
  49241. ,
  49242. this.getContextAttributes = function() {
  49243. return X.getContextAttributes()
  49244. }
  49245. ,
  49246. this.forceContextLoss = function() {
  49247. Ie.get("WEBGL_lose_context").loseContext()
  49248. }
  49249. ,
  49250. this.getMaxAnisotropy = function() {
  49251. if (void 0 !== Pe)
  49252. return Pe;
  49253. var e = Ie.get("EXT_texture_filter_anisotropic");
  49254. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49255. }
  49256. ,
  49257. this.getPrecision = function() {
  49258. return Ee.precision
  49259. }
  49260. ,
  49261. this.getPixelRatio = function() {
  49262. return he
  49263. }
  49264. ,
  49265. this.setPixelRatio = function(e) {
  49266. void 0 !== e && (he = e,
  49267. this.setSize(pe.z, pe.w, !1))
  49268. }
  49269. ,
  49270. this.getSize = function() {
  49271. return {
  49272. width: le,
  49273. height: ce
  49274. }
  49275. }
  49276. ,
  49277. this.setSize = function(e, t, i, n) {
  49278. null != n && (he = n),
  49279. le = e,
  49280. ce = t,
  49281. O.width = e * he,
  49282. O.height = t * he,
  49283. !1 !== i && (O.style.width = e + "px",
  49284. O.style.height = t + "px"),
  49285. this.setViewport(0, 0, e, t)
  49286. }
  49287. ,
  49288. this.setViewport = function(e, t, i, n) {
  49289. _e.viewport(pe.set(e, t, i, n))
  49290. }
  49291. ,
  49292. this.setScissor = function(e, t, i, n) {
  49293. _e.scissor(ue.set(e, t, i, n))
  49294. }
  49295. ,
  49296. this.setScissorTest = function(e) {
  49297. _e.setScissorTest(de = e)
  49298. }
  49299. ,
  49300. this.getClearColor = function() {
  49301. return ae
  49302. }
  49303. ,
  49304. this.setClearColor = function(e, t) {
  49305. ae.set(e),
  49306. se = void 0 !== t ? t : 1,
  49307. i(ae.r, ae.g, ae.b, se)
  49308. }
  49309. ,
  49310. this.getClearAlpha = function() {
  49311. return se
  49312. }
  49313. ,
  49314. this.setClearAlpha = function(e) {
  49315. se = e,
  49316. i(ae.r, ae.g, ae.b, se)
  49317. }
  49318. ,
  49319. this.clear = function(e, t, i) {
  49320. var n = 0;
  49321. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49322. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49323. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49324. X.clear(n)
  49325. }
  49326. ,
  49327. this.clearColor = function() {
  49328. this.clear(!0, !1, !1)
  49329. }
  49330. ,
  49331. this.clearDepth = function() {
  49332. this.clear(!1, !0, !1)
  49333. }
  49334. ,
  49335. this.clearStencil = function() {
  49336. this.clear(!1, !1, !0)
  49337. }
  49338. ,
  49339. this.clearTarget = function(e, t, i, n) {
  49340. this.setRenderTarget(e),
  49341. this.clear(t, i, n)
  49342. }
  49343. ,
  49344. this.resetGLState = n,
  49345. this.dispose = function() {
  49346. O.removeEventListener("webglcontextlost", r, !1)
  49347. }
  49348. ,
  49349. this.renderBufferImmediate = function(e, t, i) {
  49350. _e.initAttributes();
  49351. var n = be.get(e);
  49352. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49353. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49354. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49355. e.hasColors && !n.color && (n.color = X.createBuffer());
  49356. var r = t.getAttributes();
  49357. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49358. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49359. _e.enableAttribute(r.position),
  49360. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49361. e.hasNormals) {
  49362. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49363. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49364. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49365. var s = e.normalArray
  49366. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49367. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49368. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49369. s[o + 0] = l,
  49370. s[o + 1] = c,
  49371. s[o + 2] = h,
  49372. s[o + 3] = l,
  49373. s[o + 4] = c,
  49374. s[o + 5] = h,
  49375. s[o + 6] = l,
  49376. s[o + 7] = c,
  49377. s[o + 8] = h
  49378. }
  49379. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49380. _e.enableAttribute(r.normal),
  49381. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49382. }
  49383. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49384. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49385. _e.enableAttribute(r.uv),
  49386. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49387. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49388. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49389. _e.enableAttribute(r.color),
  49390. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49391. _e.disableUnusedAttributes(),
  49392. X.drawArrays(X.TRIANGLES, 0, e.count),
  49393. e.count = 0
  49394. }
  49395. ,
  49396. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49397. R(n);
  49398. var a = P(e, t, n, r)
  49399. , s = !1
  49400. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49401. l !== ee && (ee = l,
  49402. s = !0);
  49403. var c = r.morphTargetInfluences;
  49404. if (void 0 !== c) {
  49405. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49406. var p = c[u];
  49407. h.push([p, u])
  49408. }
  49409. h.sort(M),
  49410. 8 < h.length && (h.length = 8);
  49411. var f = i.morphAttributes;
  49412. for (u = 0,
  49413. d = h.length; u < d; u++) {
  49414. p = h[u];
  49415. if (j[u] = p[0],
  49416. 0 !== p[0]) {
  49417. var g = p[1];
  49418. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49419. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49420. } else
  49421. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49422. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49423. }
  49424. var m = a.getUniforms();
  49425. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49426. s = !0
  49427. }
  49428. g = i.index;
  49429. var v, y = i.attributes.position;
  49430. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49431. null !== g ? (v = Me).setIndex(g) : v = Se,
  49432. s && (function(e, t, i, n) {
  49433. var r;
  49434. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49435. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49436. else {
  49437. void 0 === n && (n = 0),
  49438. _e.initAttributes();
  49439. var o = i.attributes
  49440. , a = t.getAttributes()
  49441. , s = e.defaultAttributeValues;
  49442. for (var l in a) {
  49443. var c = a[l];
  49444. if (0 <= c) {
  49445. var h = o[l];
  49446. if (void 0 !== h) {
  49447. var u = h.itemSize
  49448. , d = we.getAttributeBuffer(h);
  49449. if (h instanceof Ci.InterleavedBufferAttribute) {
  49450. var p = h.data
  49451. , f = p.stride
  49452. , g = h.offset;
  49453. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49454. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49455. X.bindBuffer(X.ARRAY_BUFFER, d),
  49456. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49457. } else
  49458. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49459. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49460. X.bindBuffer(X.ARRAY_BUFFER, d),
  49461. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49462. } else if (void 0 !== s) {
  49463. var m = s[l];
  49464. if (void 0 !== m)
  49465. switch (m.length) {
  49466. case 2:
  49467. X.vertexAttrib2fv(c, m);
  49468. break;
  49469. case 3:
  49470. X.vertexAttrib3fv(c, m);
  49471. break;
  49472. case 4:
  49473. X.vertexAttrib4fv(c, m);
  49474. break;
  49475. default:
  49476. X.vertexAttrib1fv(c, m)
  49477. }
  49478. }
  49479. }
  49480. }
  49481. _e.disableUnusedAttributes()
  49482. }
  49483. }(n, a, i),
  49484. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49485. var A = 1 / 0;
  49486. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49487. var C = i.drawRange.start
  49488. , I = i.drawRange.count
  49489. , E = null !== o ? o.start : 0
  49490. , _ = null !== o ? o.count : 1 / 0
  49491. , b = Math.max(0, C, E)
  49492. , w = Math.min(0 + A, C + I, E + _) - 1
  49493. , T = Math.max(0, w - b + 1);
  49494. if (r instanceof Ci.Mesh)
  49495. if (!0 === n.wireframe)
  49496. _e.setLineWidth(n.wireframeLinewidth * S()),
  49497. v.setMode(X.LINES);
  49498. else
  49499. switch (r.drawMode) {
  49500. case Ci.TrianglesDrawMode:
  49501. v.setMode(X.TRIANGLES);
  49502. break;
  49503. case Ci.TriangleStripDrawMode:
  49504. v.setMode(X.TRIANGLE_STRIP);
  49505. break;
  49506. case Ci.TriangleFanDrawMode:
  49507. v.setMode(X.TRIANGLE_FAN)
  49508. }
  49509. else if (r instanceof Ci.Line) {
  49510. var x = n.linewidth;
  49511. void 0 === x && (x = 1),
  49512. _e.setLineWidth(x * S()),
  49513. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49514. } else
  49515. r instanceof Ci.Points && v.setMode(X.POINTS);
  49516. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49517. }
  49518. ,
  49519. this.render = function(e, t, i, n) {
  49520. if (t instanceof Ci.Camera != 0) {
  49521. var r = e.fog;
  49522. if (ee = "",
  49523. $ = -1,
  49524. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49525. null === t.parent && t.updateMatrixWorld(),
  49526. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49527. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49528. fe.setFromMatrix(ge),
  49529. U.length = 0,
  49530. W = z = -1,
  49531. Y.length = 0,
  49532. q.length = 0,
  49533. function e(t, i) {
  49534. if (!1 !== t.visible) {
  49535. if (t.layers.test(i.layers))
  49536. if (t instanceof Ci.Light)
  49537. U.push(t);
  49538. else if (t instanceof Ci.Sprite)
  49539. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49540. else if (t instanceof Ci.LensFlare)
  49541. q.push(t);
  49542. else if (t instanceof Ci.ImmediateRenderObject)
  49543. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49544. me.applyProjection(ge)),
  49545. d(t, null, t.material, me.z, null);
  49546. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49547. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49548. var n = t.material;
  49549. if (!0 === n.visible) {
  49550. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49551. me.applyProjection(ge));
  49552. var r = we.update(t);
  49553. if (n instanceof Ci.MultiMaterial)
  49554. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49555. var c = o[s]
  49556. , h = a[c.materialIndex];
  49557. !0 === h.visible && d(t, r, h, me.z, c)
  49558. }
  49559. else
  49560. d(t, r, n, me.z, null)
  49561. }
  49562. }
  49563. var u = t.children;
  49564. for (s = 0,
  49565. l = u.length; s < l; s++)
  49566. e(u[s], i)
  49567. }
  49568. }(e, t),
  49569. H.length = z + 1,
  49570. G.length = W + 1,
  49571. !0 === Z.sortObjects && (H.sort(s),
  49572. G.sort(l)),
  49573. function(e, t) {
  49574. 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;
  49575. for (i = ve.shadowsPointLight = 0,
  49576. n = e.length; i < n; i++)
  49577. if (o = (r = e[i]).color,
  49578. a = r.intensity,
  49579. s = r.distance,
  49580. r instanceof Ci.AmbientLight)
  49581. l += o.r * a,
  49582. c += o.g * a,
  49583. h += o.b * a;
  49584. else if (r instanceof Ci.DirectionalLight) {
  49585. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49586. v.direction.setFromMatrixPosition(r.matrixWorld),
  49587. me.setFromMatrixPosition(r.target.matrixWorld),
  49588. v.direction.sub(me),
  49589. v.direction.transformDirection(u),
  49590. v.shadow = r.castShadow,
  49591. r.castShadow && (v.shadowBias = r.shadow.bias,
  49592. v.shadowRadius = r.shadow.radius,
  49593. v.shadowMapSize = r.shadow.mapSize,
  49594. ve.shadows[m++] = r),
  49595. ve.directionalShadowMap[d] = r.shadow.map,
  49596. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49597. ve.directional[d++] = v
  49598. } else if (r instanceof Ci.SpotLight) {
  49599. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49600. v.position.applyMatrix4(u),
  49601. v.color.copy(o).multiplyScalar(a),
  49602. v.distance = s,
  49603. v.direction.setFromMatrixPosition(r.matrixWorld),
  49604. me.setFromMatrixPosition(r.target.matrixWorld),
  49605. v.direction.sub(me),
  49606. v.direction.transformDirection(u),
  49607. v.coneCos = Math.cos(r.angle),
  49608. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49609. v.decay = 0 === r.distance ? 0 : r.decay,
  49610. v.shadow = r.castShadow,
  49611. r.castShadow && (v.shadowBias = r.shadow.bias,
  49612. v.shadowRadius = r.shadow.radius,
  49613. v.shadowMapSize = r.shadow.mapSize,
  49614. ve.shadows[m++] = r),
  49615. ve.spotShadowMap[f] = r.shadow.map,
  49616. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49617. ve.spot[f++] = v
  49618. } else if (r instanceof Ci.PointLight) {
  49619. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49620. v.position.applyMatrix4(u),
  49621. v.color.copy(r.color).multiplyScalar(r.intensity),
  49622. v.distance = r.distance,
  49623. v.decay = 0 === r.distance ? 0 : r.decay,
  49624. v.shadow = r.castShadow,
  49625. r.castShadow && (v.shadowBias = r.shadow.bias,
  49626. v.shadowRadius = r.shadow.radius,
  49627. v.shadowMapSize = r.shadow.mapSize,
  49628. ve.shadows[m++] = r),
  49629. ve.pointShadowMap[p] = r.shadow.map,
  49630. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49631. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49632. ve.pointShadowMatrix[p].identity().setPosition(me),
  49633. ve.point[p++] = v
  49634. } else if (r instanceof Ci.HemisphereLight) {
  49635. var v;
  49636. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49637. v.direction.transformDirection(u),
  49638. v.direction.normalize(),
  49639. v.skyColor.copy(r.color).multiplyScalar(a),
  49640. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49641. ve.hemi[g++] = v
  49642. }
  49643. ve.ambient[0] = l,
  49644. ve.ambient[1] = c,
  49645. ve.ambient[2] = h,
  49646. ve.directional.length = d,
  49647. ve.spot.length = f,
  49648. ve.point.length = p,
  49649. ve.hemi.length = g,
  49650. ve.shadows.length = m,
  49651. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49652. }(U, t),
  49653. Re.render(e, t),
  49654. Ae.calls = 0,
  49655. Ae.vertices = 0,
  49656. Ae.faces = 0,
  49657. void (Ae.points = 0) === i && (i = null),
  49658. this.setRenderTarget(i),
  49659. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49660. e.overrideMaterial) {
  49661. var o = e.overrideMaterial;
  49662. c(H, t, r, o),
  49663. c(G, t, r, o)
  49664. } else
  49665. _e.setBlending(Ci.NoBlending),
  49666. c(H, t, r),
  49667. c(G, t, r);
  49668. if (Oe.render(e, t),
  49669. Le.render(e, t, re),
  49670. i) {
  49671. var a = i.texture;
  49672. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49673. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49674. , i = be.get(e.texture).__webglTexture;
  49675. _e.bindTexture(t, i),
  49676. X.generateMipmap(t),
  49677. _e.bindTexture(t, null)
  49678. }(i)
  49679. }
  49680. _e.setDepthTest(!0),
  49681. _e.setDepthWrite(!0),
  49682. _e.setColorWrite(!0)
  49683. } else
  49684. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49685. }
  49686. ,
  49687. this.setFaceCulling = function(e, t) {
  49688. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49689. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49690. _e.enable(X.CULL_FACE))
  49691. }
  49692. ,
  49693. this.setTexture = function(e, t) {
  49694. var i = be.get(e);
  49695. if (0 < e.version && i.__version !== e.version) {
  49696. var n = e.image;
  49697. 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)
  49698. }
  49699. _e.activeTexture(X.TEXTURE0 + t),
  49700. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49701. }
  49702. ,
  49703. this.getCurrentRenderTarget = function() {
  49704. return Q
  49705. }
  49706. ,
  49707. this.setRenderTarget = function(e) {
  49708. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49709. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49710. if (e) {
  49711. var n = be.get(e);
  49712. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49713. ie.copy(e.scissor),
  49714. ne = e.scissorTest,
  49715. re.copy(e.viewport)
  49716. } else
  49717. t = null,
  49718. ie.copy(ue).multiplyScalar(he),
  49719. ne = de,
  49720. re.copy(pe).multiplyScalar(he);
  49721. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49722. J = t),
  49723. _e.scissor(ie),
  49724. _e.setScissorTest(ne),
  49725. _e.viewport(re),
  49726. i) {
  49727. var r = be.get(e.texture);
  49728. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49729. }
  49730. }
  49731. ,
  49732. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49733. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49734. var a = be.get(e).__webglFramebuffer;
  49735. if (a) {
  49736. var s = !1;
  49737. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49738. s = !0);
  49739. try {
  49740. var l = e.texture;
  49741. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49742. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49743. 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")))
  49744. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49745. 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.")
  49746. } finally {
  49747. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49748. }
  49749. }
  49750. } else
  49751. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49752. }
  49753. }
  49754. ,
  49755. Ci.WebGLRenderTarget = function(e, t, i) {
  49756. this.uuid = Ci.Math.generateUUID(),
  49757. this.width = e,
  49758. this.height = t,
  49759. this.scissor = new Ci.Vector4(0,0,e,t),
  49760. this.scissorTest = !1,
  49761. this.viewport = new Ci.Vector4(0,0,e,t),
  49762. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49763. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49764. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49765. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49766. }
  49767. ,
  49768. Ci.WebGLRenderTarget.prototype = {
  49769. constructor: Ci.WebGLRenderTarget,
  49770. setSize: function(e, t) {
  49771. this.width === e && this.height === t || (this.width = e,
  49772. this.height = t,
  49773. this.dispose()),
  49774. this.viewport.set(0, 0, e, t),
  49775. this.scissor.set(0, 0, e, t)
  49776. },
  49777. clone: function() {
  49778. return (new this.constructor).copy(this)
  49779. },
  49780. copy: function(e) {
  49781. return this.width = e.width,
  49782. this.height = e.height,
  49783. this.viewport.copy(e.viewport),
  49784. this.texture = e.texture.clone(),
  49785. this.depthBuffer = e.depthBuffer,
  49786. this.stencilBuffer = e.stencilBuffer,
  49787. this
  49788. },
  49789. dispose: function() {
  49790. this.dispatchEvent({
  49791. type: "dispose"
  49792. })
  49793. }
  49794. },
  49795. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49796. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49797. Ci.WebGLRenderTarget.call(this, e, t, i),
  49798. this.activeCubeFace = 0,
  49799. this.activeMipMapLevel = 0
  49800. }
  49801. ,
  49802. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49803. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49804. Ci.WebGLBufferRenderer = function(r, o, a) {
  49805. var s;
  49806. this.setMode = function(e) {
  49807. s = e
  49808. }
  49809. ,
  49810. this.render = function(e, t) {
  49811. r.drawArrays(s, e, t),
  49812. a.calls++,
  49813. a.vertices += t,
  49814. s === r.TRIANGLES && (a.faces += t / 3)
  49815. }
  49816. ,
  49817. this.renderInstances = function(e) {
  49818. var t = o.get("ANGLE_instanced_arrays");
  49819. if (null !== t) {
  49820. var i = e.attributes.position
  49821. , n = 0;
  49822. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49823. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49824. a.calls++,
  49825. a.vertices += n * e.maxInstancedCount,
  49826. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49827. } else
  49828. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49829. }
  49830. }
  49831. ,
  49832. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49833. var s, l, c;
  49834. this.setMode = function(e) {
  49835. s = e
  49836. }
  49837. ,
  49838. this.setIndex = function(e) {
  49839. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49840. 4) : (l = r.UNSIGNED_SHORT,
  49841. 2)
  49842. }
  49843. ,
  49844. this.render = function(e, t) {
  49845. r.drawElements(s, t, l, e * c),
  49846. a.calls++,
  49847. a.vertices += t,
  49848. s === r.TRIANGLES && (a.faces += t / 3)
  49849. }
  49850. ,
  49851. this.renderInstances = function(e, t, i) {
  49852. var n = o.get("ANGLE_instanced_arrays");
  49853. 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),
  49854. a.calls++,
  49855. a.vertices += i * e.maxInstancedCount,
  49856. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49857. }
  49858. }
  49859. ,
  49860. Ci.WebGLExtensions = function(i) {
  49861. var n = {};
  49862. this.get = function(e) {
  49863. if (void 0 !== n[e])
  49864. return n[e];
  49865. var t;
  49866. switch (e) {
  49867. case "EXT_texture_filter_anisotropic":
  49868. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49869. break;
  49870. case "WEBGL_compressed_texture_s3tc":
  49871. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49872. break;
  49873. case "WEBGL_compressed_texture_pvrtc":
  49874. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49875. break;
  49876. case "WEBGL_compressed_texture_etc1":
  49877. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49878. break;
  49879. default:
  49880. t = i.getExtension(e)
  49881. }
  49882. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49883. n[e] = t
  49884. }
  49885. }
  49886. ,
  49887. Ci.WebGLCapabilities = function(t, e, i) {
  49888. function n(e) {
  49889. if ("highp" === e) {
  49890. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49891. return "highp";
  49892. e = "mediump"
  49893. }
  49894. 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"
  49895. }
  49896. this.getMaxPrecision = n,
  49897. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49898. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49899. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49900. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49901. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49902. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49903. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49904. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49905. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49906. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49907. this.vertexTextures = 0 < this.maxVertexTextures,
  49908. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49909. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49910. var r = n(this.precision);
  49911. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49912. this.precision = r),
  49913. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49914. }
  49915. ,
  49916. Ci.WebGLGeometries = function(i, o, a) {
  49917. function s(e) {
  49918. var t = e.target
  49919. , i = c[t.id];
  49920. null !== i.index && l(i.index),
  49921. function(e) {
  49922. for (var t in e)
  49923. l(e[t])
  49924. }(i.attributes),
  49925. t.removeEventListener("dispose", s),
  49926. delete c[t.id];
  49927. var n = o.get(t);
  49928. n.wireframe && l(n.wireframe),
  49929. o.delete(t);
  49930. var r = o.get(i);
  49931. r.wireframe && l(r.wireframe),
  49932. o.delete(i),
  49933. a.memory.geometries--
  49934. }
  49935. function l(e) {
  49936. var t = function(e) {
  49937. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49938. }(e);
  49939. void 0 !== t && (i.deleteBuffer(t),
  49940. function(e) {
  49941. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49942. }(e))
  49943. }
  49944. var c = {};
  49945. this.get = function(e) {
  49946. var t, i = e.geometry;
  49947. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49948. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49949. t = i._bufferGeometry),
  49950. c[i.id] = t,
  49951. a.memory.geometries++,
  49952. t)
  49953. }
  49954. }
  49955. ,
  49956. Ci.WebGLLights = function() {
  49957. var i = {};
  49958. this.get = function(e) {
  49959. if (void 0 !== i[e.id])
  49960. return i[e.id];
  49961. var t;
  49962. switch (e.type) {
  49963. case "DirectionalLight":
  49964. t = {
  49965. direction: new Ci.Vector3,
  49966. color: new Ci.Color,
  49967. shadow: !1,
  49968. shadowBias: 0,
  49969. shadowRadius: 1,
  49970. shadowMapSize: new Ci.Vector2
  49971. };
  49972. break;
  49973. case "SpotLight":
  49974. t = {
  49975. position: new Ci.Vector3,
  49976. direction: new Ci.Vector3,
  49977. color: new Ci.Color,
  49978. distance: 0,
  49979. coneCos: 0,
  49980. penumbraCos: 0,
  49981. decay: 0,
  49982. shadow: !1,
  49983. shadowBias: 0,
  49984. shadowRadius: 1,
  49985. shadowMapSize: new Ci.Vector2
  49986. };
  49987. break;
  49988. case "PointLight":
  49989. t = {
  49990. position: new Ci.Vector3,
  49991. color: new Ci.Color,
  49992. distance: 0,
  49993. decay: 0,
  49994. shadow: !1,
  49995. shadowBias: 0,
  49996. shadowRadius: 1,
  49997. shadowMapSize: new Ci.Vector2
  49998. };
  49999. break;
  50000. case "HemisphereLight":
  50001. t = {
  50002. direction: new Ci.Vector3,
  50003. skyColor: new Ci.Color,
  50004. groundColor: new Ci.Color
  50005. }
  50006. }
  50007. return i[e.id] = t
  50008. }
  50009. }
  50010. ,
  50011. Ci.WebGLObjects = function(g, m, e) {
  50012. function v(e, t) {
  50013. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50014. , n = m.get(i);
  50015. void 0 === n.__webglBuffer ? function(e, t, i) {
  50016. e.__webglBuffer = g.createBuffer(),
  50017. g.bindBuffer(i, e.__webglBuffer);
  50018. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50019. g.bufferData(i, t.array, n),
  50020. e.version = t.version
  50021. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50022. g.bindBuffer(i, e.__webglBuffer),
  50023. !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)),
  50024. t.updateRange.count = 0),
  50025. e.version = t.version
  50026. }(n, i, t)
  50027. }
  50028. function y(e, t, i) {
  50029. if (i < t) {
  50030. var n = t;
  50031. t = i,
  50032. i = n
  50033. }
  50034. var r = e[t];
  50035. return void 0 === r ? (e[t] = [i],
  50036. !0) : -1 === r.indexOf(i) && (r.push(i),
  50037. !0)
  50038. }
  50039. var c = new Ci.WebGLGeometries(g,m,e);
  50040. this.getAttributeBuffer = function(e) {
  50041. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50042. }
  50043. ,
  50044. this.getWireframeAttribute = function(e) {
  50045. var t = m.get(e);
  50046. if (void 0 !== t.wireframe)
  50047. return t.wireframe;
  50048. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50049. if (null !== r)
  50050. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50051. var h = i[l + 0]
  50052. , u = i[l + 1]
  50053. , d = i[l + 2];
  50054. y(s, h, u) && n.push(h, u),
  50055. y(s, u, d) && n.push(u, d),
  50056. y(s, d, h) && n.push(d, h)
  50057. }
  50058. else
  50059. for (l = 0,
  50060. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50061. h = l + 0,
  50062. u = l + 1,
  50063. d = l + 2;
  50064. n.push(h, u, u, d, d, h)
  50065. }
  50066. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50067. , f = new Ci.BufferAttribute(new p(n),1);
  50068. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50069. t.wireframe = f
  50070. }
  50071. ,
  50072. this.update = function(e) {
  50073. var t = c.get(e);
  50074. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50075. var i = t.index
  50076. , n = t.attributes;
  50077. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50078. n)
  50079. v(n[r], g.ARRAY_BUFFER);
  50080. var o = t.morphAttributes;
  50081. for (var r in o)
  50082. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50083. v(a[s], g.ARRAY_BUFFER);
  50084. return t
  50085. }
  50086. }
  50087. ,
  50088. Ci.WebGLProgram = (Qt = 0,
  50089. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50090. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50091. ei = /^([\w\d_]+)\[0\]$/,
  50092. function(e, t, i, n) {
  50093. var r = e.context
  50094. , o = i.extensions
  50095. , a = i.defines
  50096. , s = i.__webglShader.vertexShader
  50097. , l = i.__webglShader.fragmentShader
  50098. , c = "SHADOWMAP_TYPE_BASIC";
  50099. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50100. var h = "ENVMAP_TYPE_CUBE"
  50101. , u = "ENVMAP_MODE_REFLECTION"
  50102. , d = "ENVMAP_BLENDING_MULTIPLY";
  50103. if (n.envMap) {
  50104. switch (i.envMap.mapping) {
  50105. case Ci.CubeReflectionMapping:
  50106. case Ci.CubeRefractionMapping:
  50107. h = "ENVMAP_TYPE_CUBE";
  50108. break;
  50109. case Ci.CubeUVReflectionMapping:
  50110. case Ci.CubeUVRefractionMapping:
  50111. h = "ENVMAP_TYPE_CUBE_UV";
  50112. break;
  50113. case Ci.EquirectangularReflectionMapping:
  50114. case Ci.EquirectangularRefractionMapping:
  50115. h = "ENVMAP_TYPE_EQUIREC";
  50116. break;
  50117. case Ci.SphericalReflectionMapping:
  50118. h = "ENVMAP_TYPE_SPHERE"
  50119. }
  50120. switch (i.envMap.mapping) {
  50121. case Ci.CubeRefractionMapping:
  50122. case Ci.EquirectangularRefractionMapping:
  50123. u = "ENVMAP_MODE_REFRACTION"
  50124. }
  50125. switch (i.combine) {
  50126. case Ci.MultiplyOperation:
  50127. d = "ENVMAP_BLENDING_MULTIPLY";
  50128. break;
  50129. case Ci.MixOperation:
  50130. d = "ENVMAP_BLENDING_MIX";
  50131. break;
  50132. case Ci.AddOperation:
  50133. d = "ENVMAP_BLENDING_ADD"
  50134. }
  50135. }
  50136. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50137. 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")
  50138. }(o, n, e.extensions), v = function(e) {
  50139. var t = [];
  50140. for (var i in e) {
  50141. var n = e[i];
  50142. !1 !== n && t.push("#define " + i + " " + n)
  50143. }
  50144. return t.join("\n")
  50145. }(a), y = r.createProgram();
  50146. 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"),
  50147. [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) {
  50148. var i;
  50149. switch (t) {
  50150. case Ci.LinearToneMapping:
  50151. i = "Linear";
  50152. break;
  50153. case Ci.ReinhardToneMapping:
  50154. i = "Reinhard";
  50155. break;
  50156. case Ci.Uncharted2ToneMapping:
  50157. i = "Uncharted2";
  50158. break;
  50159. case Ci.CineonToneMapping:
  50160. i = "OptimizedCineon";
  50161. break;
  50162. default:
  50163. throw new Error("unsupported toneMapping: " + t)
  50164. }
  50165. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50166. }("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) {
  50167. var i = Mi(t);
  50168. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50169. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50170. s = Oi(s = Li(s), n),
  50171. l = Oi(l = Li(l), n),
  50172. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50173. l = Di(l));
  50174. var A = p + s
  50175. , C = f + l
  50176. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50177. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50178. r.attachShader(y, I),
  50179. r.attachShader(y, E),
  50180. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50181. r.linkProgram(y);
  50182. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50183. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50184. 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),
  50185. M && (this.diagnostics = {
  50186. runnable: S,
  50187. material: i,
  50188. programLog: w,
  50189. vertexShader: {
  50190. log: T,
  50191. prefix: p
  50192. },
  50193. fragmentShader: {
  50194. log: x,
  50195. prefix: f
  50196. }
  50197. }),
  50198. r.deleteShader(I),
  50199. r.deleteShader(E),
  50200. this.getUniforms = function() {
  50201. return void 0 === _ && (_ = function(e, t) {
  50202. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50203. var o = e.getActiveUniform(t, r).name
  50204. , a = e.getUniformLocation(t, o)
  50205. , s = Jt.exec(o);
  50206. if (s) {
  50207. var l = s[1]
  50208. , c = s[2]
  50209. , h = i[l];
  50210. (h = h || (i[l] = {}))[c] = a
  50211. } else if (s = $t.exec(o)) {
  50212. var u = s[1]
  50213. , d = s[2]
  50214. , p = s[3]
  50215. , f = i[u]
  50216. , g = (f = f || (i[u] = []))[d];
  50217. (g = g || (f[d] = {}))[p] = a
  50218. } else
  50219. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50220. }
  50221. return i
  50222. }(r, y)),
  50223. _
  50224. }
  50225. ,
  50226. this.getAttributes = function() {
  50227. return void 0 === b && (b = function(e, t) {
  50228. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50229. var o = e.getActiveAttrib(t, r).name;
  50230. i[o] = e.getAttribLocation(t, o)
  50231. }
  50232. return i
  50233. }(r, y)),
  50234. b
  50235. }
  50236. ,
  50237. this.destroy = function() {
  50238. r.deleteProgram(y),
  50239. this.program = void 0
  50240. }
  50241. ,
  50242. Object.defineProperties(this, {
  50243. uniforms: {
  50244. get: function() {
  50245. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50246. this.getUniforms()
  50247. }
  50248. },
  50249. attributes: {
  50250. get: function() {
  50251. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50252. this.getAttributes()
  50253. }
  50254. }
  50255. }),
  50256. this.id = Qt++,
  50257. this.code = t,
  50258. this.usedTimes = 1,
  50259. this.program = y,
  50260. this.vertexShader = I,
  50261. this.fragmentShader = E,
  50262. this
  50263. }
  50264. ),
  50265. Ci.WebGLPrograms = function(s, l) {
  50266. function c(e, t) {
  50267. var i;
  50268. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50269. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50270. i
  50271. }
  50272. var h = []
  50273. , u = {
  50274. MeshDepthMaterial: "depth",
  50275. MeshNormalMaterial: "normal",
  50276. MeshBasicMaterial: "basic",
  50277. MeshLambertMaterial: "lambert",
  50278. MeshPhongMaterial: "phong",
  50279. MeshStandardMaterial: "standard",
  50280. LineBasicMaterial: "basic",
  50281. LineDashedMaterial: "dashed",
  50282. PointsMaterial: "points"
  50283. }
  50284. , 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"];
  50285. this.getParameters = function(e, t, i, n) {
  50286. var r = u[e.type]
  50287. , o = function(e) {
  50288. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50289. return 1024;
  50290. var t = l.maxVertexUniforms
  50291. , i = Math.floor((t - 20) / 4);
  50292. 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)")),
  50293. i
  50294. }(n)
  50295. , a = s.getPrecision();
  50296. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50297. {
  50298. shaderID: r,
  50299. precision: a,
  50300. supportsVertexTextures: l.vertexTextures,
  50301. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50302. map: !!e.map,
  50303. mapEncoding: c(e.map, s.gammaInput),
  50304. envMap: !!e.envMap,
  50305. envMapMode: e.envMap && e.envMap.mapping,
  50306. envMapEncoding: c(e.envMap, s.gammaInput),
  50307. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50308. lightMap: !!e.lightMap,
  50309. aoMap: !!e.aoMap,
  50310. emissiveMap: !!e.emissiveMap,
  50311. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50312. bumpMap: !!e.bumpMap,
  50313. normalMap: !!e.normalMap,
  50314. displacementMap: !!e.displacementMap,
  50315. roughnessMap: !!e.roughnessMap,
  50316. metalnessMap: !!e.metalnessMap,
  50317. specularMap: !!e.specularMap,
  50318. alphaMap: !!e.alphaMap,
  50319. combine: e.combine,
  50320. vertexColors: e.vertexColors,
  50321. fog: i,
  50322. useFog: e.fog,
  50323. fogExp: i instanceof Ci.FogExp2,
  50324. flatShading: e.shading === Ci.FlatShading,
  50325. sizeAttenuation: e.sizeAttenuation,
  50326. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50327. skinning: e.skinning,
  50328. maxBones: o,
  50329. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50330. morphTargets: e.morphTargets,
  50331. morphNormals: e.morphNormals,
  50332. maxMorphTargets: s.maxMorphTargets,
  50333. maxMorphNormals: s.maxMorphNormals,
  50334. numDirLights: t.directional.length,
  50335. numPointLights: t.point.length,
  50336. numSpotLights: t.spot.length,
  50337. numHemiLights: t.hemi.length,
  50338. pointLightShadows: t.shadowsPointLight,
  50339. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50340. shadowMapType: s.shadowMap.type,
  50341. toneMapping: s.toneMapping,
  50342. physicallyCorrectLights: s.physicallyCorrectLights,
  50343. premultipliedAlpha: e.premultipliedAlpha,
  50344. alphaTest: e.alphaTest,
  50345. doubleSided: e.side === Ci.DoubleSide,
  50346. flipSided: e.side === Ci.BackSide
  50347. }
  50348. }
  50349. ,
  50350. this.getProgramCode = function(e, t) {
  50351. var i = [];
  50352. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50353. i.push(e.vertexShader)),
  50354. void 0 !== e.defines)
  50355. for (var n in e.defines)
  50356. i.push(n),
  50357. i.push(e.defines[n]);
  50358. for (var r = 0; r < a.length; r++) {
  50359. var o = a[r];
  50360. i.push(o),
  50361. i.push(t[o])
  50362. }
  50363. return i.join()
  50364. }
  50365. ,
  50366. this.acquireProgram = function(e, t, i) {
  50367. for (var n, r = 0, o = h.length; r < o; r++) {
  50368. var a = h[r];
  50369. if (a.code === i) {
  50370. ++(n = a).usedTimes;
  50371. break
  50372. }
  50373. }
  50374. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50375. h.push(n)),
  50376. n
  50377. }
  50378. ,
  50379. this.releaseProgram = function(e) {
  50380. if (0 == --e.usedTimes) {
  50381. var t = h.indexOf(e);
  50382. h[t] = h[h.length - 1],
  50383. h.pop(),
  50384. e.destroy()
  50385. }
  50386. }
  50387. ,
  50388. this.programs = h
  50389. }
  50390. ,
  50391. Ci.WebGLProperties = function() {
  50392. var n = {};
  50393. this.get = function(e) {
  50394. var t = e.uuid
  50395. , i = n[t];
  50396. return void 0 === i && (i = {},
  50397. n[t] = i),
  50398. i
  50399. }
  50400. ,
  50401. this.delete = function(e) {
  50402. delete n[e.uuid]
  50403. }
  50404. ,
  50405. this.clear = function() {
  50406. n = {}
  50407. }
  50408. }
  50409. ,
  50410. Ci.WebGLShader = function(e, t, i) {
  50411. var n = e.createShader(t);
  50412. return e.shaderSource(n, i),
  50413. e.compileShader(n),
  50414. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50415. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50416. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50417. t[i] = i + 1 + ": " + t[i];
  50418. return t.join("\n")
  50419. }(i)),
  50420. n
  50421. }
  50422. ,
  50423. Ci.WebGLShadowMap = function(P, O, L) {
  50424. function D(e, t, i, n) {
  50425. var r = e.geometry
  50426. , o = null
  50427. , a = p
  50428. , s = e.customDepthMaterial;
  50429. if (i && (a = f,
  50430. s = e.customDistanceMaterial),
  50431. s)
  50432. o = s;
  50433. else {
  50434. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50435. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50436. , h = 0;
  50437. l && (h |= u),
  50438. c && (h |= d),
  50439. o = a[h]
  50440. }
  50441. return o.visible = t.visible,
  50442. o.wireframe = t.wireframe,
  50443. o.wireframeLinewidth = t.wireframeLinewidth,
  50444. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50445. o
  50446. }
  50447. function N(e, t, i) {
  50448. if (!1 !== e.visible) {
  50449. 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)))
  50450. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50451. G.push(e));
  50452. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50453. N(n[r], t, i)
  50454. }
  50455. }
  50456. 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) {
  50457. var a = 0 != (o & u)
  50458. , s = 0 != (o & d)
  50459. , l = new Ci.ShaderMaterial({
  50460. uniforms: i,
  50461. vertexShader: t.vertexShader,
  50462. fragmentShader: t.fragmentShader,
  50463. morphTargets: a,
  50464. skinning: s
  50465. });
  50466. p[o] = l;
  50467. var c = new Ci.ShaderMaterial({
  50468. defines: {
  50469. USE_SHADOWMAP: ""
  50470. },
  50471. uniforms: r,
  50472. vertexShader: n.vertexShader,
  50473. fragmentShader: n.fragmentShader,
  50474. morphTargets: a,
  50475. skinning: s
  50476. });
  50477. f[o] = c
  50478. }
  50479. var q = this;
  50480. this.enabled = !1,
  50481. this.autoUpdate = !0,
  50482. this.needsUpdate = !1,
  50483. this.type = Ci.PCFShadowMap,
  50484. this.cullFace = Ci.CullFaceFront,
  50485. this.render = function(e, t) {
  50486. var i, n, r = O.shadows;
  50487. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50488. B.clearColor(1, 1, 1, 1),
  50489. B.disable(F.BLEND),
  50490. B.enable(F.CULL_FACE),
  50491. F.frontFace(F.CCW),
  50492. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50493. B.setDepthTest(!0),
  50494. B.setScissorTest(!1);
  50495. for (var o = 0, a = r.length; o < a; o++) {
  50496. var s = r[o]
  50497. , l = s.shadow
  50498. , c = l.camera;
  50499. if (U.copy(l.mapSize),
  50500. s instanceof Ci.PointLight) {
  50501. i = 6,
  50502. n = !0;
  50503. var h = U.x
  50504. , u = U.y;
  50505. Y[0].set(2 * h, u, h, u),
  50506. Y[1].set(0, u, h, u),
  50507. Y[2].set(3 * h, u, h, u),
  50508. Y[3].set(h, u, h, u),
  50509. Y[4].set(3 * h, 0, h, u),
  50510. Y[5].set(h, 0, h, u),
  50511. U.x *= 4,
  50512. U.y *= 2
  50513. } else
  50514. n = !(i = 1);
  50515. if (null === l.map) {
  50516. var d = {
  50517. minFilter: Ci.NearestFilter,
  50518. magFilter: Ci.NearestFilter,
  50519. format: Ci.RGBAFormat
  50520. };
  50521. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50522. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50523. c.updateProjectionMatrix()
  50524. }
  50525. var p = l.map
  50526. , f = l.matrix;
  50527. z.setFromMatrixPosition(s.matrixWorld),
  50528. c.position.copy(z),
  50529. P.setRenderTarget(p),
  50530. P.clear();
  50531. for (var g = 0; g < i; g++) {
  50532. if (n) {
  50533. H.copy(c.position),
  50534. H.add(W[g]),
  50535. c.up.copy(j[g]),
  50536. c.lookAt(H);
  50537. var m = Y[g];
  50538. B.viewport(m)
  50539. } else
  50540. H.setFromMatrixPosition(s.target.matrixWorld),
  50541. c.lookAt(H);
  50542. c.updateMatrixWorld(),
  50543. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50544. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50545. f.multiply(c.projectionMatrix),
  50546. f.multiply(c.matrixWorldInverse),
  50547. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50548. V.setFromMatrix(k),
  50549. G.length = 0,
  50550. N(e, t, c);
  50551. for (var v = 0, y = G.length; v < y; v++) {
  50552. var A = G[v]
  50553. , C = L.update(A)
  50554. , I = A.material;
  50555. if (I instanceof Ci.MultiMaterial)
  50556. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50557. var T = E[b]
  50558. , x = _[T.materialIndex];
  50559. if (!0 === x.visible) {
  50560. var S = D(A, x, n, z);
  50561. P.renderBufferDirect(c, null, C, S, A, T)
  50562. }
  50563. }
  50564. else {
  50565. S = D(A, I, n, z);
  50566. P.renderBufferDirect(c, null, C, S, A, null)
  50567. }
  50568. }
  50569. }
  50570. }
  50571. var M = P.getClearColor()
  50572. , R = P.getClearAlpha();
  50573. P.setClearColor(M, R),
  50574. B.enable(F.BLEND),
  50575. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50576. q.needsUpdate = !1
  50577. }
  50578. }
  50579. }
  50580. ,
  50581. Ci.WebGLState = function(l, i, c) {
  50582. var n = this
  50583. , r = new Ci.Vector4
  50584. , o = new Uint8Array(16)
  50585. , a = new Uint8Array(16)
  50586. , s = new Uint8Array(16)
  50587. , t = {}
  50588. , h = null
  50589. , u = null
  50590. , d = null
  50591. , p = null
  50592. , f = null
  50593. , g = null
  50594. , m = null
  50595. , v = null
  50596. , y = !1
  50597. , A = null
  50598. , C = null
  50599. , I = null
  50600. , E = null
  50601. , _ = null
  50602. , b = null
  50603. , w = null
  50604. , T = null
  50605. , x = null
  50606. , S = null
  50607. , M = null
  50608. , R = null
  50609. , P = null
  50610. , O = null
  50611. , L = null
  50612. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50613. , N = void 0
  50614. , F = {}
  50615. , B = new Ci.Vector4
  50616. , V = null
  50617. , k = null
  50618. , U = new Ci.Vector4
  50619. , H = new Ci.Vector4
  50620. , z = l.createTexture();
  50621. l.bindTexture(l.TEXTURE_2D, z),
  50622. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50623. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50624. this.init = function() {
  50625. this.clearColor(0, 0, 0, 1),
  50626. this.clearDepth(1),
  50627. this.clearStencil(0),
  50628. this.enable(l.DEPTH_TEST),
  50629. l.depthFunc(l.LEQUAL),
  50630. l.frontFace(l.CCW),
  50631. l.cullFace(l.BACK),
  50632. this.enable(l.CULL_FACE),
  50633. this.enable(l.BLEND),
  50634. l.blendEquation(l.FUNC_ADD),
  50635. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50636. }
  50637. ,
  50638. this.initAttributes = function() {
  50639. for (var e = 0, t = o.length; e < t; e++)
  50640. o[e] = 0
  50641. }
  50642. ,
  50643. this.enableAttribute = function(e) {
  50644. o[e] = 1,
  50645. 0 === a[e] && (l.enableVertexAttribArray(e),
  50646. a[e] = 1),
  50647. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50648. s[e] = 0)
  50649. }
  50650. ,
  50651. this.enableAttributeAndDivisor = function(e, t, i) {
  50652. o[e] = 1,
  50653. 0 === a[e] && (l.enableVertexAttribArray(e),
  50654. a[e] = 1),
  50655. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50656. s[e] = t)
  50657. }
  50658. ,
  50659. this.disableUnusedAttributes = function() {
  50660. for (var e = 0, t = a.length; e < t; e++)
  50661. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50662. a[e] = 0)
  50663. }
  50664. ,
  50665. this.enable = function(e) {
  50666. !0 !== t[e] && (l.enable(e),
  50667. t[e] = !0)
  50668. }
  50669. ,
  50670. this.disable = function(e) {
  50671. !1 !== t[e] && (l.disable(e),
  50672. t[e] = !1)
  50673. }
  50674. ,
  50675. this.getCompressedTextureFormats = function() {
  50676. if (null === h && (h = [],
  50677. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50678. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50679. h.push(e[t]);
  50680. return h
  50681. }
  50682. ,
  50683. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50684. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50685. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50686. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50687. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50688. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50689. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50690. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50691. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50692. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50693. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50694. u = e,
  50695. y = s),
  50696. e === Ci.CustomBlending ? (r = r || t,
  50697. o = o || i,
  50698. a = a || n,
  50699. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50700. d = t,
  50701. g = r),
  50702. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50703. p = i,
  50704. f = n,
  50705. m = o,
  50706. v = a)) : v = m = g = f = p = d = null
  50707. }
  50708. ,
  50709. this.setDepthFunc = function(e) {
  50710. if (A !== e) {
  50711. if (e)
  50712. switch (e) {
  50713. case Ci.NeverDepth:
  50714. l.depthFunc(l.NEVER);
  50715. break;
  50716. case Ci.AlwaysDepth:
  50717. l.depthFunc(l.ALWAYS);
  50718. break;
  50719. case Ci.LessDepth:
  50720. l.depthFunc(l.LESS);
  50721. break;
  50722. case Ci.LessEqualDepth:
  50723. l.depthFunc(l.LEQUAL);
  50724. break;
  50725. case Ci.EqualDepth:
  50726. l.depthFunc(l.EQUAL);
  50727. break;
  50728. case Ci.GreaterEqualDepth:
  50729. l.depthFunc(l.GEQUAL);
  50730. break;
  50731. case Ci.GreaterDepth:
  50732. l.depthFunc(l.GREATER);
  50733. break;
  50734. case Ci.NotEqualDepth:
  50735. l.depthFunc(l.NOTEQUAL);
  50736. break;
  50737. default:
  50738. l.depthFunc(l.LEQUAL)
  50739. }
  50740. else
  50741. l.depthFunc(l.LEQUAL);
  50742. A = e
  50743. }
  50744. }
  50745. ,
  50746. this.setDepthTest = function(e) {
  50747. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50748. }
  50749. ,
  50750. this.setDepthWrite = function(e) {
  50751. C !== e && (l.depthMask(e),
  50752. C = e)
  50753. }
  50754. ,
  50755. this.setColorWrite = function(e) {
  50756. I !== e && (l.colorMask(e, e, e, e),
  50757. I = e)
  50758. }
  50759. ,
  50760. this.setStencilFunc = function(e, t, i) {
  50761. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50762. _ = e,
  50763. b = t,
  50764. w = i)
  50765. }
  50766. ,
  50767. this.setStencilOp = function(e, t, i) {
  50768. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50769. T = e,
  50770. x = t,
  50771. S = i)
  50772. }
  50773. ,
  50774. this.setStencilTest = function(e) {
  50775. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50776. }
  50777. ,
  50778. this.setStencilWrite = function(e) {
  50779. E !== e && (l.stencilMask(e),
  50780. E = e)
  50781. }
  50782. ,
  50783. this.setFlipSided = function(e) {
  50784. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50785. M = e)
  50786. }
  50787. ,
  50788. this.setLineWidth = function(e) {
  50789. e !== R && (l.lineWidth(e),
  50790. R = e)
  50791. }
  50792. ,
  50793. this.setPolygonOffset = function(e, t, i) {
  50794. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50795. !e || P === t && O === i || (l.polygonOffset(t, i),
  50796. P = t,
  50797. O = i)
  50798. }
  50799. ,
  50800. this.getScissorTest = function() {
  50801. return L
  50802. }
  50803. ,
  50804. this.setScissorTest = function(e) {
  50805. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50806. }
  50807. ,
  50808. this.activeTexture = function(e) {
  50809. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50810. N !== e && (l.activeTexture(e),
  50811. N = e)
  50812. }
  50813. ,
  50814. this.bindTexture = function(e, t) {
  50815. void 0 === N && n.activeTexture();
  50816. var i = F[N];
  50817. void 0 === i && (i = {
  50818. type: void 0,
  50819. texture: void 0
  50820. },
  50821. F[N] = i),
  50822. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50823. i.type = e,
  50824. i.texture = t)
  50825. }
  50826. ,
  50827. this.compressedTexImage2D = function() {
  50828. try {
  50829. l.compressedTexImage2D.apply(l, arguments)
  50830. } catch (e) {
  50831. console.error(e)
  50832. }
  50833. }
  50834. ,
  50835. this.texImage2D = function() {
  50836. try {
  50837. l.texImage2D.apply(l, arguments)
  50838. } catch (e) {
  50839. console.error(e)
  50840. }
  50841. }
  50842. ,
  50843. this.clearColor = function(e, t, i, n) {
  50844. r.set(e, t, i, n),
  50845. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50846. B.copy(r))
  50847. }
  50848. ,
  50849. this.clearDepth = function(e) {
  50850. V !== e && (l.clearDepth(e),
  50851. V = e)
  50852. }
  50853. ,
  50854. this.clearStencil = function(e) {
  50855. k !== e && (l.clearStencil(e),
  50856. k = e)
  50857. }
  50858. ,
  50859. this.scissor = function(e) {
  50860. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50861. U.copy(e))
  50862. }
  50863. ,
  50864. this.viewport = function(e) {
  50865. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50866. H.copy(e))
  50867. }
  50868. ,
  50869. this.reset = function() {
  50870. for (var e = 0; e < a.length; e++)
  50871. 1 === a[e] && (l.disableVertexAttribArray(e),
  50872. a[e] = 0);
  50873. t = {},
  50874. N = void 0,
  50875. F = {},
  50876. M = E = C = I = u = h = null
  50877. }
  50878. }
  50879. ,
  50880. Ci.LensFlarePlugin = function(v, y) {
  50881. function A() {
  50882. 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]);
  50883. C = S.createBuffer(),
  50884. I = S.createBuffer(),
  50885. S.bindBuffer(S.ARRAY_BUFFER, C),
  50886. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50887. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50888. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50889. T = S.createTexture(),
  50890. x = S.createTexture(),
  50891. M.bindTexture(S.TEXTURE_2D, T),
  50892. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50893. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50894. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50895. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50896. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50897. M.bindTexture(S.TEXTURE_2D, x),
  50898. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50899. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50900. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50901. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50902. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50903. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50904. 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"),
  50905. 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")
  50906. } : {
  50907. 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"),
  50908. 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")
  50909. },
  50910. E = function(e) {
  50911. var t = S.createProgram()
  50912. , i = S.createShader(S.FRAGMENT_SHADER)
  50913. , n = S.createShader(S.VERTEX_SHADER)
  50914. , r = "precision " + v.getPrecision() + " float;\n";
  50915. return S.shaderSource(i, r + e.fragmentShader),
  50916. S.shaderSource(n, r + e.vertexShader),
  50917. S.compileShader(i),
  50918. S.compileShader(n),
  50919. S.attachShader(t, i),
  50920. S.attachShader(t, n),
  50921. S.linkProgram(t),
  50922. t
  50923. }(e),
  50924. _ = {
  50925. vertex: S.getAttribLocation(E, "position"),
  50926. uv: S.getAttribLocation(E, "uv")
  50927. },
  50928. b = {
  50929. renderType: S.getUniformLocation(E, "renderType"),
  50930. map: S.getUniformLocation(E, "map"),
  50931. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50932. opacity: S.getUniformLocation(E, "opacity"),
  50933. color: S.getUniformLocation(E, "color"),
  50934. scale: S.getUniformLocation(E, "scale"),
  50935. rotation: S.getUniformLocation(E, "rotation"),
  50936. screenPosition: S.getUniformLocation(E, "screenPosition")
  50937. }
  50938. }
  50939. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50940. this.render = function(e, t, i) {
  50941. if (0 !== y.length) {
  50942. var n = new Ci.Vector3
  50943. , r = i.w / i.z
  50944. , o = .5 * i.z
  50945. , a = .5 * i.w
  50946. , s = 16 / i.w
  50947. , l = new Ci.Vector2(s * r,s)
  50948. , c = new Ci.Vector3(1,1,0)
  50949. , h = new Ci.Vector2(1,1);
  50950. void 0 === E && A(),
  50951. S.useProgram(E),
  50952. M.initAttributes(),
  50953. M.enableAttribute(_.vertex),
  50954. M.enableAttribute(_.uv),
  50955. M.disableUnusedAttributes(),
  50956. S.uniform1i(b.occlusionMap, 0),
  50957. S.uniform1i(b.map, 1),
  50958. S.bindBuffer(S.ARRAY_BUFFER, C),
  50959. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50960. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50961. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50962. M.disable(S.CULL_FACE),
  50963. M.setDepthWrite(!1);
  50964. for (var u = 0, d = y.length; u < d; u++) {
  50965. s = 16 / i.w,
  50966. l.set(s * r, s);
  50967. var p = y[u];
  50968. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50969. n.applyMatrix4(t.matrixWorldInverse),
  50970. n.applyProjection(t.projectionMatrix),
  50971. c.copy(n),
  50972. h.x = c.x * o + o,
  50973. h.y = c.y * a + a,
  50974. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50975. M.activeTexture(S.TEXTURE0),
  50976. M.bindTexture(S.TEXTURE_2D, null),
  50977. M.activeTexture(S.TEXTURE1),
  50978. M.bindTexture(S.TEXTURE_2D, T),
  50979. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50980. S.uniform1i(b.renderType, 0),
  50981. S.uniform2f(b.scale, l.x, l.y),
  50982. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50983. M.disable(S.BLEND),
  50984. M.enable(S.DEPTH_TEST),
  50985. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50986. M.activeTexture(S.TEXTURE0),
  50987. M.bindTexture(S.TEXTURE_2D, x),
  50988. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50989. S.uniform1i(b.renderType, 1),
  50990. M.disable(S.DEPTH_TEST),
  50991. M.activeTexture(S.TEXTURE1),
  50992. M.bindTexture(S.TEXTURE_2D, T),
  50993. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50994. p.positionScreen.copy(c),
  50995. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50996. S.uniform1i(b.renderType, 2),
  50997. M.enable(S.BLEND);
  50998. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50999. var m = p.lensFlares[f];
  51000. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51001. c.y = m.y,
  51002. c.z = m.z,
  51003. s = m.size * m.scale / i.w,
  51004. l.x = s * r,
  51005. l.y = s,
  51006. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51007. S.uniform2f(b.scale, l.x, l.y),
  51008. S.uniform1f(b.rotation, m.rotation),
  51009. S.uniform1f(b.opacity, m.opacity),
  51010. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51011. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51012. v.setTexture(m.texture, 1),
  51013. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51014. }
  51015. }
  51016. }
  51017. M.enable(S.CULL_FACE),
  51018. M.enable(S.DEPTH_TEST),
  51019. M.setDepthWrite(!0),
  51020. v.resetGLState()
  51021. }
  51022. }
  51023. }
  51024. ,
  51025. Ci.SpritePlugin = function(u, d) {
  51026. function p() {
  51027. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51028. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51029. g = I.createBuffer(),
  51030. m = I.createBuffer(),
  51031. I.bindBuffer(I.ARRAY_BUFFER, g),
  51032. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51033. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51034. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51035. v = function() {
  51036. var e = I.createProgram()
  51037. , t = I.createShader(I.VERTEX_SHADER)
  51038. , i = I.createShader(I.FRAGMENT_SHADER);
  51039. 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")),
  51040. 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")),
  51041. I.compileShader(t),
  51042. I.compileShader(i),
  51043. I.attachShader(e, t),
  51044. I.attachShader(e, i),
  51045. I.linkProgram(e),
  51046. e
  51047. }(),
  51048. y = {
  51049. position: I.getAttribLocation(v, "position"),
  51050. uv: I.getAttribLocation(v, "uv")
  51051. },
  51052. A = {
  51053. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51054. uvScale: I.getUniformLocation(v, "uvScale"),
  51055. rotation: I.getUniformLocation(v, "rotation"),
  51056. scale: I.getUniformLocation(v, "scale"),
  51057. color: I.getUniformLocation(v, "color"),
  51058. map: I.getUniformLocation(v, "map"),
  51059. opacity: I.getUniformLocation(v, "opacity"),
  51060. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51061. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51062. fogType: I.getUniformLocation(v, "fogType"),
  51063. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51064. fogNear: I.getUniformLocation(v, "fogNear"),
  51065. fogFar: I.getUniformLocation(v, "fogFar"),
  51066. fogColor: I.getUniformLocation(v, "fogColor"),
  51067. alphaTest: I.getUniformLocation(v, "alphaTest")
  51068. };
  51069. var i = document.createElement("canvas");
  51070. i.width = 8,
  51071. i.height = 8;
  51072. var n = i.getContext("2d");
  51073. n.fillStyle = "white",
  51074. n.fillRect(0, 0, 8, 8),
  51075. (C = new Ci.Texture(i)).needsUpdate = !0
  51076. }
  51077. function f(e, t) {
  51078. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51079. }
  51080. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51081. this.render = function(e, t) {
  51082. if (0 !== d.length) {
  51083. void 0 === v && p(),
  51084. I.useProgram(v),
  51085. E.initAttributes(),
  51086. E.enableAttribute(y.position),
  51087. E.enableAttribute(y.uv),
  51088. E.disableUnusedAttributes(),
  51089. E.disable(I.CULL_FACE),
  51090. E.enable(I.BLEND),
  51091. I.bindBuffer(I.ARRAY_BUFFER, g),
  51092. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51093. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51094. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51095. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51096. E.activeTexture(I.TEXTURE0),
  51097. I.uniform1i(A.map, 0);
  51098. var i = 0
  51099. , n = 0
  51100. , r = e.fog;
  51101. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51102. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51103. I.uniform1f(A.fogFar, r.far),
  51104. I.uniform1i(A.fogType, 1),
  51105. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51106. I.uniform1i(A.fogType, 2),
  51107. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51108. n = i = 0);
  51109. for (var o = 0, a = d.length; o < a; o++) {
  51110. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51111. l.z = -l.modelViewMatrix.elements[14]
  51112. }
  51113. d.sort(f);
  51114. var s = [];
  51115. for (o = 0,
  51116. a = d.length; o < a; o++) {
  51117. var l, c = (l = d[o]).material;
  51118. I.uniform1f(A.alphaTest, c.alphaTest),
  51119. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51120. l.matrixWorld.decompose(_, b, w),
  51121. s[0] = w.x,
  51122. s[1] = w.y;
  51123. var h = 0;
  51124. e.fog && c.fog && (h = n),
  51125. i !== h && (I.uniform1i(A.fogType, h),
  51126. i = h),
  51127. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51128. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51129. I.uniform2f(A.uvScale, 1, 1)),
  51130. I.uniform1f(A.opacity, c.opacity),
  51131. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51132. I.uniform1f(A.rotation, c.rotation),
  51133. I.uniform2fv(A.scale, s),
  51134. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51135. E.setDepthTest(c.depthTest),
  51136. E.setDepthWrite(c.depthWrite),
  51137. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51138. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51139. }
  51140. E.enable(I.CULL_FACE),
  51141. u.resetGLState()
  51142. }
  51143. }
  51144. }
  51145. ,
  51146. Object.defineProperties(Ci.Box2.prototype, {
  51147. empty: {
  51148. value: function() {
  51149. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51150. this.isEmpty()
  51151. }
  51152. },
  51153. isIntersectionBox: {
  51154. value: function(e) {
  51155. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51156. this.intersectsBox(e)
  51157. }
  51158. }
  51159. }),
  51160. Object.defineProperties(Ci.Box3.prototype, {
  51161. empty: {
  51162. value: function() {
  51163. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51164. this.isEmpty()
  51165. }
  51166. },
  51167. isIntersectionBox: {
  51168. value: function(e) {
  51169. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51170. this.intersectsBox(e)
  51171. }
  51172. },
  51173. isIntersectionSphere: {
  51174. value: function(e) {
  51175. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51176. this.intersectsSphere(e)
  51177. }
  51178. }
  51179. }),
  51180. Object.defineProperties(Ci.Matrix3.prototype, {
  51181. multiplyVector3: {
  51182. value: function(e) {
  51183. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51184. e.applyMatrix3(this)
  51185. }
  51186. },
  51187. multiplyVector3Array: {
  51188. value: function(e) {
  51189. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51190. this.applyToVector3Array(e)
  51191. }
  51192. }
  51193. }),
  51194. Object.defineProperties(Ci.Matrix4.prototype, {
  51195. extractPosition: {
  51196. value: function(e) {
  51197. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51198. this.copyPosition(e)
  51199. }
  51200. },
  51201. setRotationFromQuaternion: {
  51202. value: function(e) {
  51203. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51204. this.makeRotationFromQuaternion(e)
  51205. }
  51206. },
  51207. multiplyVector3: {
  51208. value: function(e) {
  51209. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51210. e.applyProjection(this)
  51211. }
  51212. },
  51213. multiplyVector4: {
  51214. value: function(e) {
  51215. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51216. e.applyMatrix4(this)
  51217. }
  51218. },
  51219. multiplyVector3Array: {
  51220. value: function(e) {
  51221. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51222. this.applyToVector3Array(e)
  51223. }
  51224. },
  51225. rotateAxis: {
  51226. value: function(e) {
  51227. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51228. e.transformDirection(this)
  51229. }
  51230. },
  51231. crossVector: {
  51232. value: function(e) {
  51233. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51234. e.applyMatrix4(this)
  51235. }
  51236. },
  51237. translate: {
  51238. value: function(e) {
  51239. console.error("THREE.Matrix4: .translate() has been removed.")
  51240. }
  51241. },
  51242. rotateX: {
  51243. value: function(e) {
  51244. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51245. }
  51246. },
  51247. rotateY: {
  51248. value: function(e) {
  51249. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51250. }
  51251. },
  51252. rotateZ: {
  51253. value: function(e) {
  51254. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51255. }
  51256. },
  51257. rotateByAxis: {
  51258. value: function(e, t) {
  51259. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51260. }
  51261. }
  51262. }),
  51263. Object.defineProperties(Ci.Plane.prototype, {
  51264. isIntersectionLine: {
  51265. value: function(e) {
  51266. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51267. this.intersectsLine(e)
  51268. }
  51269. }
  51270. }),
  51271. Object.defineProperties(Ci.Quaternion.prototype, {
  51272. multiplyVector3: {
  51273. value: function(e) {
  51274. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51275. e.applyQuaternion(this)
  51276. }
  51277. }
  51278. }),
  51279. Object.defineProperties(Ci.Ray.prototype, {
  51280. isIntersectionBox: {
  51281. value: function(e) {
  51282. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51283. this.intersectsBox(e)
  51284. }
  51285. },
  51286. isIntersectionPlane: {
  51287. value: function(e) {
  51288. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51289. this.intersectsPlane(e)
  51290. }
  51291. },
  51292. isIntersectionSphere: {
  51293. value: function(e) {
  51294. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51295. this.intersectsSphere(e)
  51296. }
  51297. }
  51298. }),
  51299. Object.defineProperties(Ci.Vector3.prototype, {
  51300. setEulerFromRotationMatrix: {
  51301. value: function() {
  51302. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51303. }
  51304. },
  51305. setEulerFromQuaternion: {
  51306. value: function() {
  51307. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51308. }
  51309. },
  51310. getPositionFromMatrix: {
  51311. value: function(e) {
  51312. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51313. this.setFromMatrixPosition(e)
  51314. }
  51315. },
  51316. getScaleFromMatrix: {
  51317. value: function(e) {
  51318. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51319. this.setFromMatrixScale(e)
  51320. }
  51321. },
  51322. getColumnFromMatrix: {
  51323. value: function(e, t) {
  51324. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51325. this.setFromMatrixColumn(e, t)
  51326. }
  51327. }
  51328. }),
  51329. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51330. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51331. new Ci.Face3(e,t,i,r,o,a)
  51332. }
  51333. ,
  51334. Ci.Vertex = function(e, t, i) {
  51335. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51336. new Ci.Vector3(e,t,i)
  51337. }
  51338. ,
  51339. Object.defineProperties(Ci.Object3D.prototype, {
  51340. eulerOrder: {
  51341. get: function() {
  51342. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51343. this.rotation.order
  51344. },
  51345. set: function(e) {
  51346. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51347. this.rotation.order = e
  51348. }
  51349. },
  51350. getChildByName: {
  51351. value: function(e) {
  51352. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51353. this.getObjectByName(e)
  51354. }
  51355. },
  51356. renderDepth: {
  51357. set: function(e) {
  51358. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51359. }
  51360. },
  51361. translate: {
  51362. value: function(e, t) {
  51363. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51364. this.translateOnAxis(t, e)
  51365. }
  51366. },
  51367. useQuaternion: {
  51368. get: function() {
  51369. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51370. },
  51371. set: function(e) {
  51372. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51373. }
  51374. }
  51375. }),
  51376. Object.defineProperties(Ci, {
  51377. PointCloud: {
  51378. value: function(e, t) {
  51379. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51380. new Ci.Points(e,t)
  51381. }
  51382. },
  51383. ParticleSystem: {
  51384. value: function(e, t) {
  51385. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51386. new Ci.Points(e,t)
  51387. }
  51388. }
  51389. }),
  51390. Object.defineProperties(Ci.Light.prototype, {
  51391. onlyShadow: {
  51392. set: function(e) {
  51393. console.warn("THREE.Light: .onlyShadow has been removed.")
  51394. }
  51395. },
  51396. shadowCameraFov: {
  51397. set: function(e) {
  51398. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51399. this.shadow.camera.fov = e
  51400. }
  51401. },
  51402. shadowCameraLeft: {
  51403. set: function(e) {
  51404. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51405. this.shadow.camera.left = e
  51406. }
  51407. },
  51408. shadowCameraRight: {
  51409. set: function(e) {
  51410. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51411. this.shadow.camera.right = e
  51412. }
  51413. },
  51414. shadowCameraTop: {
  51415. set: function(e) {
  51416. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51417. this.shadow.camera.top = e
  51418. }
  51419. },
  51420. shadowCameraBottom: {
  51421. set: function(e) {
  51422. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51423. this.shadow.camera.bottom = e
  51424. }
  51425. },
  51426. shadowCameraNear: {
  51427. set: function(e) {
  51428. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51429. this.shadow.camera.near = e
  51430. }
  51431. },
  51432. shadowCameraFar: {
  51433. set: function(e) {
  51434. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51435. this.shadow.camera.far = e
  51436. }
  51437. },
  51438. shadowCameraVisible: {
  51439. set: function(e) {
  51440. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51441. }
  51442. },
  51443. shadowBias: {
  51444. set: function(e) {
  51445. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51446. this.shadow.bias = e
  51447. }
  51448. },
  51449. shadowDarkness: {
  51450. set: function(e) {
  51451. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51452. }
  51453. },
  51454. shadowMapWidth: {
  51455. set: function(e) {
  51456. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51457. this.shadow.mapSize.width = e
  51458. }
  51459. },
  51460. shadowMapHeight: {
  51461. set: function(e) {
  51462. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51463. this.shadow.mapSize.height = e
  51464. }
  51465. }
  51466. }),
  51467. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51468. length: {
  51469. get: function() {
  51470. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51471. this.array.length
  51472. }
  51473. }
  51474. }),
  51475. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51476. drawcalls: {
  51477. get: function() {
  51478. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51479. this.groups
  51480. }
  51481. },
  51482. offsets: {
  51483. get: function() {
  51484. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51485. this.groups
  51486. }
  51487. },
  51488. addIndex: {
  51489. value: function(e) {
  51490. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51491. this.setIndex(e)
  51492. }
  51493. },
  51494. addDrawCall: {
  51495. value: function(e, t, i) {
  51496. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51497. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51498. this.addGroup(e, t)
  51499. }
  51500. },
  51501. clearDrawCalls: {
  51502. value: function() {
  51503. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51504. this.clearGroups()
  51505. }
  51506. },
  51507. computeTangents: {
  51508. value: function() {
  51509. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51510. }
  51511. },
  51512. computeOffsets: {
  51513. value: function() {
  51514. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51515. }
  51516. }
  51517. }),
  51518. Object.defineProperties(Ci.Material.prototype, {
  51519. wrapAround: {
  51520. get: function() {
  51521. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51522. },
  51523. set: function(e) {
  51524. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51525. }
  51526. },
  51527. wrapRGB: {
  51528. get: function() {
  51529. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51530. new Ci.Color
  51531. }
  51532. }
  51533. }),
  51534. Object.defineProperties(Ci, {
  51535. PointCloudMaterial: {
  51536. value: function(e) {
  51537. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51538. new Ci.PointsMaterial(e)
  51539. }
  51540. },
  51541. ParticleBasicMaterial: {
  51542. value: function(e) {
  51543. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51544. new Ci.PointsMaterial(e)
  51545. }
  51546. },
  51547. ParticleSystemMaterial: {
  51548. value: function(e) {
  51549. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51550. new Ci.PointsMaterial(e)
  51551. }
  51552. }
  51553. }),
  51554. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51555. metal: {
  51556. get: function() {
  51557. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51558. !1
  51559. },
  51560. set: function(e) {
  51561. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51562. }
  51563. }
  51564. }),
  51565. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51566. derivatives: {
  51567. get: function() {
  51568. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51569. this.extensions.derivatives
  51570. },
  51571. set: function(e) {
  51572. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51573. this.extensions.derivatives = e
  51574. }
  51575. }
  51576. }),
  51577. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51578. supportsFloatTextures: {
  51579. value: function() {
  51580. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51581. this.extensions.get("OES_texture_float")
  51582. }
  51583. },
  51584. supportsHalfFloatTextures: {
  51585. value: function() {
  51586. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51587. this.extensions.get("OES_texture_half_float")
  51588. }
  51589. },
  51590. supportsStandardDerivatives: {
  51591. value: function() {
  51592. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51593. this.extensions.get("OES_standard_derivatives")
  51594. }
  51595. },
  51596. supportsCompressedTextureS3TC: {
  51597. value: function() {
  51598. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51599. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51600. }
  51601. },
  51602. supportsCompressedTexturePVRTC: {
  51603. value: function() {
  51604. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51605. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51606. }
  51607. },
  51608. supportsBlendMinMax: {
  51609. value: function() {
  51610. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51611. this.extensions.get("EXT_blend_minmax")
  51612. }
  51613. },
  51614. supportsVertexTextures: {
  51615. value: function() {
  51616. return this.capabilities.vertexTextures
  51617. }
  51618. },
  51619. supportsInstancedArrays: {
  51620. value: function() {
  51621. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51622. this.extensions.get("ANGLE_instanced_arrays")
  51623. }
  51624. },
  51625. enableScissorTest: {
  51626. value: function(e) {
  51627. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51628. this.setScissorTest(e)
  51629. }
  51630. },
  51631. initMaterial: {
  51632. value: function() {
  51633. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51634. }
  51635. },
  51636. addPrePlugin: {
  51637. value: function() {
  51638. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51639. }
  51640. },
  51641. addPostPlugin: {
  51642. value: function() {
  51643. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51644. }
  51645. },
  51646. updateShadowMap: {
  51647. value: function() {
  51648. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51649. }
  51650. },
  51651. shadowMapEnabled: {
  51652. get: function() {
  51653. return this.shadowMap.enabled
  51654. },
  51655. set: function(e) {
  51656. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51657. this.shadowMap.enabled = e
  51658. }
  51659. },
  51660. shadowMapType: {
  51661. get: function() {
  51662. return this.shadowMap.type
  51663. },
  51664. set: function(e) {
  51665. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51666. this.shadowMap.type = e
  51667. }
  51668. },
  51669. shadowMapCullFace: {
  51670. get: function() {
  51671. return this.shadowMap.cullFace
  51672. },
  51673. set: function(e) {
  51674. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51675. this.shadowMap.cullFace = e
  51676. }
  51677. }
  51678. }),
  51679. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51680. wrapS: {
  51681. get: function() {
  51682. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51683. this.texture.wrapS
  51684. },
  51685. set: function(e) {
  51686. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51687. this.texture.wrapS = e
  51688. }
  51689. },
  51690. wrapT: {
  51691. get: function() {
  51692. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51693. this.texture.wrapT
  51694. },
  51695. set: function(e) {
  51696. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51697. this.texture.wrapT = e
  51698. }
  51699. },
  51700. magFilter: {
  51701. get: function() {
  51702. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51703. this.texture.magFilter
  51704. },
  51705. set: function(e) {
  51706. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51707. this.texture.magFilter = e
  51708. }
  51709. },
  51710. minFilter: {
  51711. get: function() {
  51712. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51713. this.texture.minFilter
  51714. },
  51715. set: function(e) {
  51716. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51717. this.texture.minFilter = e
  51718. }
  51719. },
  51720. anisotropy: {
  51721. get: function() {
  51722. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51723. this.texture.anisotropy
  51724. },
  51725. set: function(e) {
  51726. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51727. this.texture.anisotropy = e
  51728. }
  51729. },
  51730. offset: {
  51731. get: function() {
  51732. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51733. this.texture.offset
  51734. },
  51735. set: function(e) {
  51736. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51737. this.texture.offset = e
  51738. }
  51739. },
  51740. repeat: {
  51741. get: function() {
  51742. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51743. this.texture.repeat
  51744. },
  51745. set: function(e) {
  51746. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51747. this.texture.repeat = e
  51748. }
  51749. },
  51750. format: {
  51751. get: function() {
  51752. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51753. this.texture.format
  51754. },
  51755. set: function(e) {
  51756. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51757. this.texture.format = e
  51758. }
  51759. },
  51760. type: {
  51761. get: function() {
  51762. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51763. this.texture.type
  51764. },
  51765. set: function(e) {
  51766. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51767. this.texture.type = e
  51768. }
  51769. },
  51770. generateMipmaps: {
  51771. get: function() {
  51772. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51773. this.texture.generateMipmaps
  51774. },
  51775. set: function(e) {
  51776. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51777. this.texture.generateMipmaps = e
  51778. }
  51779. }
  51780. }),
  51781. Ci.GeometryUtils = {
  51782. merge: function(e, t, i) {
  51783. var n;
  51784. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51785. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51786. n = t.matrix,
  51787. t = t.geometry),
  51788. e.merge(t, n, i)
  51789. },
  51790. center: function(e) {
  51791. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51792. e.center()
  51793. }
  51794. },
  51795. Ci.ImageUtils = {
  51796. crossOrigin: void 0,
  51797. loadTexture: function(e, t, i, n) {
  51798. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51799. var r = new Ci.TextureLoader;
  51800. r.setCrossOrigin(this.crossOrigin);
  51801. var o = r.load(e, i, void 0, n);
  51802. return t && (o.mapping = t),
  51803. o
  51804. },
  51805. loadTextureCube: function(e, t, i, n) {
  51806. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51807. var r = new Ci.CubeTextureLoader;
  51808. r.setCrossOrigin(this.crossOrigin);
  51809. var o = r.load(e, i, void 0, n);
  51810. return t && (o.mapping = t),
  51811. o
  51812. },
  51813. loadCompressedTexture: function() {
  51814. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51815. },
  51816. loadCompressedTextureCube: function() {
  51817. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51818. }
  51819. },
  51820. Ci.Projector = function() {
  51821. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51822. this.projectVector = function(e, t) {
  51823. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51824. e.project(t)
  51825. }
  51826. ,
  51827. this.unprojectVector = function(e, t) {
  51828. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51829. e.unproject(t)
  51830. }
  51831. ,
  51832. this.pickingRay = function(e, t) {
  51833. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51834. }
  51835. }
  51836. ,
  51837. Ci.CanvasRenderer = function() {
  51838. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51839. this.domElement = document.createElement("canvas"),
  51840. this.clear = function() {}
  51841. ,
  51842. this.render = function() {}
  51843. ,
  51844. this.setClearColor = function() {}
  51845. ,
  51846. this.setSize = function() {}
  51847. }
  51848. ,
  51849. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51850. Ci.CurveUtils = {
  51851. tangentQuadraticBezier: function(e, t, i, n) {
  51852. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51853. },
  51854. tangentCubicBezier: function(e, t, i, n, r) {
  51855. 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
  51856. },
  51857. tangentSpline: function(e, t, i, n, r) {
  51858. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51859. },
  51860. interpolate: function(e, t, i, n, r) {
  51861. var o = .5 * (i - e)
  51862. , a = .5 * (n - t)
  51863. , s = r * r;
  51864. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51865. }
  51866. },
  51867. Ci.SceneUtils = {
  51868. createMultiMaterialObject: function(e, t) {
  51869. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51870. i.add(new Ci.Mesh(e,t[n]));
  51871. return i
  51872. },
  51873. detach: function(e, t, i) {
  51874. e.applyMatrix(t.matrixWorld),
  51875. t.remove(e),
  51876. i.add(e)
  51877. },
  51878. attach: function(e, t, i) {
  51879. var n = new Ci.Matrix4;
  51880. n.getInverse(i.matrixWorld),
  51881. e.applyMatrix(n),
  51882. t.remove(e),
  51883. i.add(e)
  51884. }
  51885. },
  51886. Ci.ShapeUtils = {
  51887. area: function(e) {
  51888. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51889. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51890. return .5 * i
  51891. },
  51892. triangulate: function(e, t) {
  51893. var i = e.length;
  51894. if (i < 3)
  51895. return null;
  51896. var n, r, o, a = [], s = [], l = [];
  51897. if (0 < Ci.ShapeUtils.area(e))
  51898. for (r = 0; r < i; r++)
  51899. s[r] = r;
  51900. else
  51901. for (r = 0; r < i; r++)
  51902. s[r] = i - 1 - r;
  51903. var c = i
  51904. , h = 2 * c;
  51905. for (r = c - 1; 2 < c; ) {
  51906. if (h-- <= 0)
  51907. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51908. t ? l : a;
  51909. if (c <= (n = r) && (n = 0),
  51910. c <= (r = n + 1) && (r = 0),
  51911. c <= (o = r + 1) && (o = 0),
  51912. Si(e, n, r, o, c, s)) {
  51913. var u, d, p, f, g;
  51914. for (u = s[n],
  51915. d = s[r],
  51916. p = s[o],
  51917. a.push([e[u], e[d], e[p]]),
  51918. l.push([s[n], s[r], s[o]]),
  51919. g = (f = r) + 1; g < c; f++,
  51920. g++)
  51921. s[f] = s[g];
  51922. h = 2 * --c
  51923. }
  51924. }
  51925. return t ? l : a
  51926. },
  51927. triangulateShape: function(e, t) {
  51928. function w(e, t, i) {
  51929. 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
  51930. }
  51931. function b(e, t, i, n, r) {
  51932. var o = t.x - e.x
  51933. , a = t.y - e.y
  51934. , s = n.x - i.x
  51935. , l = n.y - i.y
  51936. , c = e.x - i.x
  51937. , h = e.y - i.y
  51938. , u = a * s - o * l
  51939. , d = a * c - o * h;
  51940. if (Math.abs(u) > Number.EPSILON) {
  51941. var p;
  51942. if (0 < u) {
  51943. if (d < 0 || u < d)
  51944. return [];
  51945. if ((p = l * c - s * h) < 0 || u < p)
  51946. return []
  51947. } else {
  51948. if (0 < d || d < u)
  51949. return [];
  51950. if (0 < (p = l * c - s * h) || p < u)
  51951. return []
  51952. }
  51953. if (0 === p)
  51954. return !r || 0 != d && d != u ? [e] : [];
  51955. if (p === u)
  51956. return !r || 0 != d && d != u ? [t] : [];
  51957. if (0 == d)
  51958. return [i];
  51959. if (d == u)
  51960. return [n];
  51961. var f = p / u;
  51962. return [{
  51963. x: e.x + f * o,
  51964. y: e.y + f * a
  51965. }]
  51966. }
  51967. if (0 != d || l * c != s * h)
  51968. return [];
  51969. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51970. 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,
  51971. (m = t).x) : (v = (g = t).x,
  51972. (m = e).x),
  51973. i.x < n.x ? (I = (A = i).x,
  51974. (C = n).x) : (I = (A = n).x,
  51975. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51976. (m = t).y) : (v = (g = t).y,
  51977. (m = e).y),
  51978. i.y < n.y ? (I = (A = i).y,
  51979. (C = n).y) : (I = (A = n).y,
  51980. (C = i).y)),
  51981. 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])
  51982. }
  51983. function T(e, t, i, n) {
  51984. var r = t.x - e.x
  51985. , o = t.y - e.y
  51986. , a = i.x - e.x
  51987. , s = i.y - e.y
  51988. , l = n.x - e.x
  51989. , c = n.y - e.y
  51990. , h = r * s - o * a
  51991. , u = r * c - o * l;
  51992. if (Math.abs(h) > Number.EPSILON) {
  51993. var d = l * s - c * a;
  51994. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51995. }
  51996. return 0 < u
  51997. }
  51998. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51999. Array.prototype.push.apply(c, t[h]);
  52000. for (i = 0,
  52001. n = c.length; i < n; i++)
  52002. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52003. l[a] = i;
  52004. var d = function(e, a) {
  52005. function t(e, t) {
  52006. var i = m.length - 1
  52007. , n = e - 1;
  52008. n < 0 && (n = i);
  52009. var r = e + 1;
  52010. i < r && (r = 0);
  52011. var o = T(m[e], m[n], m[r], c[t]);
  52012. if (!o)
  52013. return !1;
  52014. var a = c.length - 1
  52015. , s = t - 1;
  52016. s < 0 && (s = a);
  52017. var l = t + 1;
  52018. return a < l && (l = 0),
  52019. !!(o = T(c[t], c[s], c[l], m[e]))
  52020. }
  52021. function i(e, t) {
  52022. var i, n;
  52023. for (i = 0; i < m.length; i++)
  52024. if (n = i + 1,
  52025. n %= m.length,
  52026. 0 < b(e, t, m[i], m[n], !0).length)
  52027. return !0;
  52028. return !1
  52029. }
  52030. function n(e, t) {
  52031. var i, n, r, o;
  52032. for (i = 0; i < v.length; i++)
  52033. for (n = a[v[i]],
  52034. r = 0; r < n.length; r++)
  52035. if (o = r + 1,
  52036. o %= n.length,
  52037. 0 < b(e, t, n[r], n[o], !0).length)
  52038. return !0;
  52039. return !1
  52040. }
  52041. 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++)
  52042. v.push(A);
  52043. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52044. if (--E < 0) {
  52045. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52046. break
  52047. }
  52048. for (o = I; o < m.length; o++) {
  52049. s = m[o],
  52050. r = -1;
  52051. for (A = 0; A < v.length; A++)
  52052. if (h = v[A],
  52053. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52054. c = a[h];
  52055. for (var _ = 0; _ < c.length; _++)
  52056. if (l = c[_],
  52057. t(o, _) && !i(s, l) && !n(s, l)) {
  52058. r = _,
  52059. v.splice(A, 1),
  52060. d = m.slice(0, o + 1),
  52061. p = m.slice(o),
  52062. f = c.slice(r),
  52063. g = c.slice(0, r + 1),
  52064. m = d.concat(f).concat(g).concat(p),
  52065. I = o;
  52066. break
  52067. }
  52068. if (0 <= r)
  52069. break;
  52070. y[u] = !0
  52071. }
  52072. if (0 <= r)
  52073. break
  52074. }
  52075. }
  52076. return m
  52077. }(e, t)
  52078. , p = Ci.ShapeUtils.triangulate(d, !1);
  52079. for (i = 0,
  52080. n = p.length; i < n; i++)
  52081. for (o = p[i],
  52082. r = 0; r < 3; r++)
  52083. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52084. return p.concat()
  52085. },
  52086. isClockWise: function(e) {
  52087. return Ci.ShapeUtils.area(e) < 0
  52088. },
  52089. b2: function(e, t, i, n) {
  52090. return function(e, t) {
  52091. var i = 1 - e;
  52092. return i * i * t
  52093. }(e, t) + function(e, t) {
  52094. return 2 * (1 - e) * e * t
  52095. }(e, i) + function(e, t) {
  52096. return e * e * t
  52097. }(e, n)
  52098. },
  52099. b3: function(e, t, i, n, r) {
  52100. return function(e, t) {
  52101. var i = 1 - e;
  52102. return i * i * i * t
  52103. }(e, t) + function(e, t) {
  52104. var i = 1 - e;
  52105. return 3 * i * i * e * t
  52106. }(e, i) + function(e, t) {
  52107. return 3 * (1 - e) * e * e * t
  52108. }(e, n) + function(e, t) {
  52109. return e * e * e * t
  52110. }(e, r)
  52111. }
  52112. },
  52113. Ci.Curve = function() {}
  52114. ,
  52115. Ci.Curve.prototype = {
  52116. constructor: Ci.Curve,
  52117. getPoint: function(e) {
  52118. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52119. null
  52120. },
  52121. getPointAt: function(e) {
  52122. var t = this.getUtoTmapping(e);
  52123. return this.getPoint(t)
  52124. },
  52125. getPoints: function(e) {
  52126. e = e || 5;
  52127. var t, i = [];
  52128. for (t = 0; t <= e; t++)
  52129. i.push(this.getPoint(t / e));
  52130. return i
  52131. },
  52132. getSpacedPoints: function(e) {
  52133. e = e || 5;
  52134. var t, i = [];
  52135. for (t = 0; t <= e; t++)
  52136. i.push(this.getPointAt(t / e));
  52137. return i
  52138. },
  52139. getLength: function() {
  52140. var e = this.getLengths();
  52141. return e[e.length - 1]
  52142. },
  52143. getLengths: function(e) {
  52144. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52145. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52146. return this.cacheArcLengths;
  52147. this.needsUpdate = !1;
  52148. var t, i, n = [], r = this.getPoint(0), o = 0;
  52149. for (n.push(0),
  52150. i = 1; i <= e; i++)
  52151. o += (t = this.getPoint(i / e)).distanceTo(r),
  52152. n.push(o),
  52153. r = t;
  52154. return this.cacheArcLengths = n
  52155. },
  52156. updateArcLengths: function() {
  52157. this.needsUpdate = !0,
  52158. this.getLengths()
  52159. },
  52160. getUtoTmapping: function(e, t) {
  52161. var i, n = this.getLengths(), r = 0, o = n.length;
  52162. i = t || e * n[o - 1];
  52163. for (var a, s = 0, l = o - 1; s <= l; )
  52164. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52165. s = r + 1;
  52166. else {
  52167. if (!(0 < a)) {
  52168. l = r;
  52169. break
  52170. }
  52171. l = r - 1
  52172. }
  52173. if (n[r = l] === i)
  52174. return r / (o - 1);
  52175. var c = n[r];
  52176. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52177. },
  52178. getTangent: function(e) {
  52179. var t = e - 1e-4
  52180. , i = e + 1e-4;
  52181. t < 0 && (t = 0),
  52182. 1 < i && (i = 1);
  52183. var n = this.getPoint(t);
  52184. return this.getPoint(i).clone().sub(n).normalize()
  52185. },
  52186. getTangentAt: function(e) {
  52187. var t = this.getUtoTmapping(e);
  52188. return this.getTangent(t)
  52189. }
  52190. },
  52191. Ci.Curve.create = function(e, t) {
  52192. return e.prototype = Object.create(Ci.Curve.prototype),
  52193. (e.prototype.constructor = e).prototype.getPoint = t,
  52194. e
  52195. }
  52196. ,
  52197. Ci.CurvePath = function() {
  52198. this.curves = [],
  52199. this.autoClose = !1
  52200. }
  52201. ,
  52202. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52203. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52204. Ci.CurvePath.prototype.add = function(e) {
  52205. this.curves.push(e)
  52206. }
  52207. ,
  52208. Ci.CurvePath.prototype.closePath = function() {
  52209. var e = this.curves[0].getPoint(0)
  52210. , t = this.curves[this.curves.length - 1].getPoint(1);
  52211. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52212. }
  52213. ,
  52214. Ci.CurvePath.prototype.getPoint = function(e) {
  52215. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52216. if (i[n] >= t) {
  52217. var r = i[n] - t
  52218. , o = this.curves[n]
  52219. , a = 1 - r / o.getLength();
  52220. return o.getPointAt(a)
  52221. }
  52222. n++
  52223. }
  52224. return null
  52225. }
  52226. ,
  52227. Ci.CurvePath.prototype.getLength = function() {
  52228. var e = this.getCurveLengths();
  52229. return e[e.length - 1]
  52230. }
  52231. ,
  52232. Ci.CurvePath.prototype.getCurveLengths = function() {
  52233. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52234. return this.cacheLengths;
  52235. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52236. t += this.curves[i].getLength(),
  52237. e.push(t);
  52238. return this.cacheLengths = e
  52239. }
  52240. ,
  52241. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52242. var t = this.getPoints(e);
  52243. return this.createGeometry(t)
  52244. }
  52245. ,
  52246. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52247. var t = this.getSpacedPoints(e);
  52248. return this.createGeometry(t)
  52249. }
  52250. ,
  52251. Ci.CurvePath.prototype.createGeometry = function(e) {
  52252. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52253. var r = e[i];
  52254. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52255. }
  52256. return t
  52257. }
  52258. ,
  52259. Ci.Font = function(e) {
  52260. this.data = e
  52261. }
  52262. ,
  52263. Ci.Font.prototype = {
  52264. constructor: Ci.Font,
  52265. generateShapes: function(e, s, b) {
  52266. function l(e, t, i) {
  52267. var n = w.glyphs[e] || w.glyphs["?"];
  52268. if (n) {
  52269. 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;
  52270. if (n.o)
  52271. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52272. switch (A[C++]) {
  52273. case "m":
  52274. r = A[C++] * t + i,
  52275. o = A[C++] * t,
  52276. g.moveTo(r, o);
  52277. break;
  52278. case "l":
  52279. r = A[C++] * t + i,
  52280. o = A[C++] * t,
  52281. g.lineTo(r, o);
  52282. break;
  52283. case "q":
  52284. if (a = A[C++] * t + i,
  52285. s = A[C++] * t,
  52286. h = A[C++] * t + i,
  52287. u = A[C++] * t,
  52288. g.quadraticCurveTo(h, u, a, s),
  52289. f = m[m.length - 1]) {
  52290. l = f.x,
  52291. c = f.y;
  52292. for (var E = 1; E <= b; E++) {
  52293. v(_ = E / b, l, h, a),
  52294. v(_, c, u, s)
  52295. }
  52296. }
  52297. break;
  52298. case "b":
  52299. if (a = A[C++] * t + i,
  52300. s = A[C++] * t,
  52301. h = A[C++] * t + i,
  52302. u = A[C++] * t,
  52303. d = A[C++] * t + i,
  52304. p = A[C++] * t,
  52305. g.bezierCurveTo(h, u, d, p, a, s),
  52306. f = m[m.length - 1]) {
  52307. l = f.x,
  52308. c = f.y;
  52309. for (E = 1; E <= b; E++) {
  52310. var _;
  52311. y(_ = E / b, l, h, d, a),
  52312. y(_, c, u, p, s)
  52313. }
  52314. }
  52315. }
  52316. }
  52317. return {
  52318. offset: n.ha * t,
  52319. path: g
  52320. }
  52321. }
  52322. }
  52323. void 0 === s && (s = 100),
  52324. void 0 === b && (b = 4);
  52325. for (var w = this.data, t = function(e) {
  52326. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52327. var a = l(t[o], i, n);
  52328. n += a.offset,
  52329. r.push(a.path)
  52330. }
  52331. return r
  52332. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52333. Array.prototype.push.apply(i, t[n].toShapes());
  52334. return i
  52335. }
  52336. },
  52337. Ci.Path = function(e) {
  52338. Ci.CurvePath.call(this),
  52339. this.actions = [],
  52340. e && this.fromPoints(e)
  52341. }
  52342. ,
  52343. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52344. Ci.Path.prototype.constructor = Ci.Path,
  52345. Ci.Path.prototype.fromPoints = function(e) {
  52346. this.moveTo(e[0].x, e[0].y);
  52347. for (var t = 1, i = e.length; t < i; t++)
  52348. this.lineTo(e[t].x, e[t].y)
  52349. }
  52350. ,
  52351. Ci.Path.prototype.moveTo = function(e, t) {
  52352. this.actions.push({
  52353. action: "moveTo",
  52354. args: [e, t]
  52355. })
  52356. }
  52357. ,
  52358. Ci.Path.prototype.lineTo = function(e, t) {
  52359. var i = this.actions[this.actions.length - 1].args
  52360. , n = i[i.length - 2]
  52361. , r = i[i.length - 1]
  52362. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52363. this.curves.push(o),
  52364. this.actions.push({
  52365. action: "lineTo",
  52366. args: [e, t]
  52367. })
  52368. }
  52369. ,
  52370. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52371. var r = this.actions[this.actions.length - 1].args
  52372. , o = r[r.length - 2]
  52373. , a = r[r.length - 1]
  52374. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52375. this.curves.push(s),
  52376. this.actions.push({
  52377. action: "quadraticCurveTo",
  52378. args: [e, t, i, n]
  52379. })
  52380. }
  52381. ,
  52382. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52383. var a = this.actions[this.actions.length - 1].args
  52384. , s = a[a.length - 2]
  52385. , l = a[a.length - 1]
  52386. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52387. this.curves.push(c),
  52388. this.actions.push({
  52389. action: "bezierCurveTo",
  52390. args: [e, t, i, n, r, o]
  52391. })
  52392. }
  52393. ,
  52394. Ci.Path.prototype.splineThru = function(e) {
  52395. var t = Array.prototype.slice.call(arguments)
  52396. , i = this.actions[this.actions.length - 1].args
  52397. , n = i[i.length - 2]
  52398. , r = i[i.length - 1]
  52399. , o = [new Ci.Vector2(n,r)];
  52400. Array.prototype.push.apply(o, e);
  52401. var a = new Ci.SplineCurve(o);
  52402. this.curves.push(a),
  52403. this.actions.push({
  52404. action: "splineThru",
  52405. args: t
  52406. })
  52407. }
  52408. ,
  52409. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52410. var a = this.actions[this.actions.length - 1].args
  52411. , s = a[a.length - 2]
  52412. , l = a[a.length - 1];
  52413. this.absarc(e + s, t + l, i, n, r, o)
  52414. }
  52415. ,
  52416. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52417. this.absellipse(e, t, i, i, n, r, o)
  52418. }
  52419. ,
  52420. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52421. var l = this.actions[this.actions.length - 1].args
  52422. , c = l[l.length - 2]
  52423. , h = l[l.length - 1];
  52424. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52425. }
  52426. ,
  52427. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52428. var l = [e, t, i, n, r, o, a, s || 0]
  52429. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52430. this.curves.push(c);
  52431. var h = c.getPoint(1);
  52432. l.push(h.x),
  52433. l.push(h.y),
  52434. this.actions.push({
  52435. action: "ellipse",
  52436. args: l
  52437. })
  52438. }
  52439. ,
  52440. Ci.Path.prototype.getSpacedPoints = function(e) {
  52441. e = e || 40;
  52442. for (var t = [], i = 0; i < e; i++)
  52443. t.push(this.getPoint(i / e));
  52444. return this.autoClose && t.push(t[0]),
  52445. t
  52446. }
  52447. ,
  52448. Ci.Path.prototype.getPoints = function(e) {
  52449. e = e || 12;
  52450. 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++) {
  52451. var v = this.actions[g]
  52452. , y = v.action
  52453. , A = v.args;
  52454. switch (y) {
  52455. case "moveTo":
  52456. case "lineTo":
  52457. f.push(new Ci.Vector2(A[0],A[1]));
  52458. break;
  52459. case "quadraticCurveTo":
  52460. t = A[2],
  52461. i = A[3],
  52462. o = A[0],
  52463. a = A[1],
  52464. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52465. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52466. c[c.length - 1]);
  52467. for (var C = 1; C <= e; C++) {
  52468. h = d(O = C / e, s, o, t),
  52469. u = d(O, l, a, i),
  52470. f.push(new Ci.Vector2(h,u))
  52471. }
  52472. break;
  52473. case "bezierCurveTo":
  52474. t = A[4],
  52475. i = A[5],
  52476. o = A[0],
  52477. a = A[1],
  52478. n = A[2],
  52479. r = A[3],
  52480. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52481. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52482. c[c.length - 1]);
  52483. for (C = 1; C <= e; C++) {
  52484. h = p(O = C / e, s, o, n, t),
  52485. u = p(O, l, a, r, i),
  52486. f.push(new Ci.Vector2(h,u))
  52487. }
  52488. break;
  52489. case "splineThru":
  52490. c = this.actions[g - 1].args;
  52491. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52492. , E = e * A[0].length;
  52493. I = I.concat(A[0]);
  52494. var _ = new Ci.SplineCurve(I);
  52495. for (C = 1; C <= E; C++)
  52496. f.push(_.getPointAt(C / E));
  52497. break;
  52498. case "arc":
  52499. var b = A[0]
  52500. , w = A[1]
  52501. , T = A[2]
  52502. , x = A[3]
  52503. , S = A[4]
  52504. , M = !!A[5]
  52505. , R = S - x
  52506. , P = 2 * e;
  52507. for (C = 1; C <= P; C++) {
  52508. var O = C / P;
  52509. M || (O = 1 - O),
  52510. L = x + O * R,
  52511. h = b + T * Math.cos(L),
  52512. u = w + T * Math.sin(L),
  52513. f.push(new Ci.Vector2(h,u))
  52514. }
  52515. break;
  52516. case "ellipse":
  52517. b = A[0],
  52518. w = A[1];
  52519. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52520. S = A[5],
  52521. M = !!A[6],
  52522. A[7]);
  52523. R = S - x,
  52524. P = 2 * e;
  52525. 0 !== V && (D = Math.cos(V),
  52526. N = Math.sin(V));
  52527. for (C = 1; C <= P; C++) {
  52528. O = C / P;
  52529. if (M || (O = 1 - O),
  52530. L = x + O * R,
  52531. h = b + F * Math.cos(L),
  52532. u = w + B * Math.sin(L),
  52533. 0 !== V) {
  52534. var k = h;
  52535. h = (k - b) * D - (u - w) * N + b,
  52536. u = (k - b) * N + (u - w) * D + w
  52537. }
  52538. f.push(new Ci.Vector2(h,u))
  52539. }
  52540. }
  52541. }
  52542. var U = f[f.length - 1];
  52543. 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),
  52544. this.autoClose && f.push(f[0]),
  52545. f
  52546. }
  52547. ,
  52548. Ci.Path.prototype.toShapes = function(e, t) {
  52549. function i(e) {
  52550. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52551. var r = e[i]
  52552. , o = new Ci.Shape;
  52553. o.actions = r.actions,
  52554. o.curves = r.curves,
  52555. t.push(o)
  52556. }
  52557. return t
  52558. }
  52559. function n(e, t) {
  52560. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52561. var a = t[r]
  52562. , s = t[o]
  52563. , l = s.x - a.x
  52564. , c = s.y - a.y;
  52565. if (Math.abs(c) > Number.EPSILON) {
  52566. if (c < 0 && (a = t[o],
  52567. l = -l,
  52568. s = t[r],
  52569. c = -c),
  52570. e.y < a.y || e.y > s.y)
  52571. continue;
  52572. if (e.y === a.y) {
  52573. if (e.x === a.x)
  52574. return !0
  52575. } else {
  52576. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52577. if (0 == h)
  52578. return !0;
  52579. if (h < 0)
  52580. continue;
  52581. n = !n
  52582. }
  52583. } else {
  52584. if (e.y !== a.y)
  52585. continue;
  52586. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52587. return !0
  52588. }
  52589. }
  52590. return n
  52591. }
  52592. var r = Ci.ShapeUtils.isClockWise
  52593. , o = function(e) {
  52594. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52595. var o = e[n]
  52596. , a = o.args
  52597. , s = o.action;
  52598. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52599. i = new Ci.Path),
  52600. i[s].apply(i, a)
  52601. }
  52602. return 0 !== i.actions.length && t.push(i),
  52603. t
  52604. }(this.actions);
  52605. if (0 === o.length)
  52606. return [];
  52607. if (!0 === t)
  52608. return i(o);
  52609. var a, s, l, c = [];
  52610. if (1 === o.length)
  52611. return s = o[0],
  52612. (l = new Ci.Shape).actions = s.actions,
  52613. l.curves = s.curves,
  52614. c.push(l),
  52615. c;
  52616. var h = !r(o[0].getPoints());
  52617. h = e ? !h : h;
  52618. var u, d = [], p = [], f = [], g = 0;
  52619. p[g] = void 0,
  52620. f[g] = [];
  52621. for (var m = 0, v = o.length; m < v; m++)
  52622. a = r(u = (s = o[m]).getPoints()),
  52623. (a = e ? !a : a) ? (!h && p[g] && g++,
  52624. p[g] = {
  52625. s: new Ci.Shape,
  52626. p: u
  52627. },
  52628. p[g].s.actions = s.actions,
  52629. p[g].s.curves = s.curves,
  52630. h && g++,
  52631. f[g] = []) : f[g].push({
  52632. h: s,
  52633. p: u[0]
  52634. });
  52635. if (!p[0])
  52636. return i(o);
  52637. if (1 < p.length) {
  52638. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52639. d[C] = [];
  52640. for (C = 0,
  52641. I = p.length; C < I; C++)
  52642. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52643. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52644. n(b.p, p[T].p) && (C !== T && A.push({
  52645. froms: C,
  52646. tos: T,
  52647. hole: _
  52648. }),
  52649. w ? (w = !1,
  52650. d[T].push(b)) : y = !0);
  52651. w && d[C].push(b)
  52652. }
  52653. 0 < A.length && (y || (f = d))
  52654. }
  52655. m = 0;
  52656. for (var x, S = p.length; m < S; m++) {
  52657. l = p[m].s,
  52658. c.push(l);
  52659. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52660. l.holes.push(x[M].h)
  52661. }
  52662. return c
  52663. }
  52664. ,
  52665. Ci.Shape = function() {
  52666. Ci.Path.apply(this, arguments),
  52667. this.holes = []
  52668. }
  52669. ,
  52670. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52671. Ci.Shape.prototype.constructor = Ci.Shape,
  52672. Ci.Shape.prototype.extrude = function(e) {
  52673. return new Ci.ExtrudeGeometry(this,e)
  52674. }
  52675. ,
  52676. Ci.Shape.prototype.makeGeometry = function(e) {
  52677. return new Ci.ShapeGeometry(this,e)
  52678. }
  52679. ,
  52680. Ci.Shape.prototype.getPointsHoles = function(e) {
  52681. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52682. t[i] = this.holes[i].getPoints(e);
  52683. return t
  52684. }
  52685. ,
  52686. Ci.Shape.prototype.extractAllPoints = function(e) {
  52687. return {
  52688. shape: this.getPoints(e),
  52689. holes: this.getPointsHoles(e)
  52690. }
  52691. }
  52692. ,
  52693. Ci.Shape.prototype.extractPoints = function(e) {
  52694. return this.extractAllPoints(e)
  52695. }
  52696. ,
  52697. Ci.LineCurve = function(e, t) {
  52698. this.v1 = e,
  52699. this.v2 = t
  52700. }
  52701. ,
  52702. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52703. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52704. Ci.LineCurve.prototype.getPoint = function(e) {
  52705. var t = this.v2.clone().sub(this.v1);
  52706. return t.multiplyScalar(e).add(this.v1),
  52707. t
  52708. }
  52709. ,
  52710. Ci.LineCurve.prototype.getPointAt = function(e) {
  52711. return this.getPoint(e)
  52712. }
  52713. ,
  52714. Ci.LineCurve.prototype.getTangent = function(e) {
  52715. return this.v2.clone().sub(this.v1).normalize()
  52716. }
  52717. ,
  52718. Ci.QuadraticBezierCurve = function(e, t, i) {
  52719. this.v0 = e,
  52720. this.v1 = t,
  52721. this.v2 = i
  52722. }
  52723. ,
  52724. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52725. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52726. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52727. var t = Ci.ShapeUtils.b2;
  52728. 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))
  52729. }
  52730. ,
  52731. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52732. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52733. 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()
  52734. }
  52735. ,
  52736. Ci.CubicBezierCurve = function(e, t, i, n) {
  52737. this.v0 = e,
  52738. this.v1 = t,
  52739. this.v2 = i,
  52740. this.v3 = n
  52741. }
  52742. ,
  52743. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52744. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52745. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52746. var t = Ci.ShapeUtils.b3;
  52747. 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))
  52748. }
  52749. ,
  52750. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52751. var t = Ci.CurveUtils.tangentCubicBezier;
  52752. 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()
  52753. }
  52754. ,
  52755. Ci.SplineCurve = function(e) {
  52756. this.points = null == e ? [] : e
  52757. }
  52758. ,
  52759. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52760. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52761. Ci.SplineCurve.prototype.getPoint = function(e) {
  52762. var t = this.points
  52763. , i = (t.length - 1) * e
  52764. , n = Math.floor(i)
  52765. , r = i - n
  52766. , o = t[0 === n ? n : n - 1]
  52767. , a = t[n]
  52768. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52769. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52770. , c = Ci.CurveUtils.interpolate;
  52771. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52772. }
  52773. ,
  52774. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52775. this.aX = e,
  52776. this.aY = t,
  52777. this.xRadius = i,
  52778. this.yRadius = n,
  52779. this.aStartAngle = r,
  52780. this.aEndAngle = o,
  52781. this.aClockwise = a,
  52782. this.aRotation = s || 0
  52783. }
  52784. ,
  52785. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52786. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52787. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52788. var t, i = this.aEndAngle - this.aStartAngle;
  52789. i < 0 && (i += 2 * Math.PI),
  52790. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52791. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52792. var n = this.aX + this.xRadius * Math.cos(t)
  52793. , r = this.aY + this.yRadius * Math.sin(t);
  52794. if (0 !== this.aRotation) {
  52795. var o = Math.cos(this.aRotation)
  52796. , a = Math.sin(this.aRotation)
  52797. , s = n
  52798. , l = r;
  52799. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52800. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52801. }
  52802. return new Ci.Vector2(n,r)
  52803. }
  52804. ,
  52805. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52806. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52807. }
  52808. ,
  52809. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52810. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52811. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52812. this.v1 = e,
  52813. this.v2 = t
  52814. }, function(e) {
  52815. var t = new Ci.Vector3;
  52816. return t.subVectors(this.v2, this.v1),
  52817. t.multiplyScalar(e),
  52818. t.add(this.v1),
  52819. t
  52820. }),
  52821. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52822. this.v0 = e,
  52823. this.v1 = t,
  52824. this.v2 = i
  52825. }, function(e) {
  52826. var t = Ci.ShapeUtils.b2;
  52827. 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))
  52828. }),
  52829. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52830. this.v0 = e,
  52831. this.v1 = t,
  52832. this.v2 = i,
  52833. this.v3 = n
  52834. }, function(e) {
  52835. var t = Ci.ShapeUtils.b3;
  52836. 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))
  52837. }),
  52838. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52839. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52840. this.points = null == e ? [] : e
  52841. }, function(e) {
  52842. var t = this.points
  52843. , i = (t.length - 1) * e
  52844. , n = Math.floor(i)
  52845. , r = i - n
  52846. , o = t[0 == n ? n : n - 1]
  52847. , a = t[n]
  52848. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52849. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52850. , c = Ci.CurveUtils.interpolate;
  52851. 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))
  52852. }),
  52853. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52854. Xt = new xi,
  52855. Zt = new xi,
  52856. Kt = new xi,
  52857. xi.prototype.init = function(e, t, i, n) {
  52858. this.c0 = e,
  52859. this.c1 = i,
  52860. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52861. this.c3 = 2 * e - 2 * t + i + n
  52862. }
  52863. ,
  52864. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52865. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52866. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52867. s *= o,
  52868. l *= o,
  52869. this.init(t, i, s, l)
  52870. }
  52871. ,
  52872. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52873. this.init(t, i, r * (i - e), r * (n - t))
  52874. }
  52875. ,
  52876. xi.prototype.calc = function(e) {
  52877. var t = e * e
  52878. , i = t * e;
  52879. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52880. }
  52881. ,
  52882. Ci.Curve.create(function(e) {
  52883. this.points = e || [],
  52884. this.closed = !1
  52885. }, function(e) {
  52886. var t, i, n, r, o, a, s, l, c = this.points;
  52887. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52888. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52889. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52890. n = 1),
  52891. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52892. qt),
  52893. a = c[i % r],
  52894. s = c[(i + 1) % r],
  52895. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52896. qt),
  52897. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52898. var h = "chordal" === this.type ? .5 : .25
  52899. , u = Math.pow(o.distanceToSquared(a), h)
  52900. , d = Math.pow(a.distanceToSquared(s), h)
  52901. , p = Math.pow(s.distanceToSquared(l), h);
  52902. d < 1e-4 && (d = 1),
  52903. u < 1e-4 && (u = d),
  52904. p < 1e-4 && (p = d),
  52905. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52906. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52907. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52908. } else if ("catmullrom" === this.type) {
  52909. var f = void 0 !== this.tension ? this.tension : .5;
  52910. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52911. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52912. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52913. }
  52914. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52915. })),
  52916. Ci.ClosedSplineCurve3 = function(e) {
  52917. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52918. Ci.CatmullRomCurve3.call(this, e),
  52919. this.type = "catmullrom",
  52920. this.closed = !0
  52921. }
  52922. ,
  52923. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52924. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52925. Ci.Geometry.call(this),
  52926. this.type = "BoxGeometry",
  52927. this.parameters = {
  52928. width: e,
  52929. height: t,
  52930. depth: i,
  52931. widthSegments: n,
  52932. heightSegments: r,
  52933. depthSegments: o
  52934. },
  52935. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52936. this.mergeVertices()
  52937. }
  52938. ,
  52939. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52940. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52941. Ci.CubeGeometry = Ci.BoxGeometry,
  52942. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52943. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52944. 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++)
  52945. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52946. var b = _ * u - p;
  52947. C[e] = b * n,
  52948. C[t] = E * r,
  52949. C[i] = g,
  52950. P[D] = C.x,
  52951. P[D + 1] = C.y,
  52952. P[D + 2] = C.z,
  52953. C[e] = 0,
  52954. C[t] = 0,
  52955. C[i] = 0 < s ? 1 : -1,
  52956. O[D] = C.x,
  52957. O[D + 1] = C.y,
  52958. O[D + 2] = C.z,
  52959. L[N] = _ / l,
  52960. L[N + 1] = 1 - I / c,
  52961. D += 3,
  52962. N += 2,
  52963. y += 1
  52964. }
  52965. for (I = 0; I < c; I++)
  52966. for (_ = 0; _ < l; _++) {
  52967. var w = B + _ + m * I
  52968. , T = B + _ + m * (I + 1)
  52969. , x = B + (_ + 1) + m * (I + 1)
  52970. , S = B + (_ + 1) + m * I;
  52971. R[F] = w,
  52972. R[F + 1] = T,
  52973. R[F + 2] = S,
  52974. R[F + 3] = T,
  52975. R[F + 4] = x,
  52976. R[F + 5] = S,
  52977. F += 6,
  52978. A += 6
  52979. }
  52980. M.addGroup(V, A, h),
  52981. V += A,
  52982. B += y
  52983. }
  52984. Ci.BufferGeometry.call(this),
  52985. this.type = "BoxBufferGeometry",
  52986. this.parameters = {
  52987. width: e,
  52988. height: t,
  52989. depth: i,
  52990. widthSegments: n,
  52991. heightSegments: r,
  52992. depthSegments: o
  52993. };
  52994. var M = this;
  52995. n = Math.floor(n) || 1,
  52996. r = Math.floor(r) || 1,
  52997. o = Math.floor(o) || 1;
  52998. var s, l, c, h, u = (h = 0,
  52999. h += (s = n) * (l = r) * 2,
  53000. h += s * (c = o) * 2,
  53001. 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;
  53002. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53003. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53004. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53005. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53006. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53007. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53008. this.setIndex(new Ci.BufferAttribute(R,1)),
  53009. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53010. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53011. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53012. }
  53013. ,
  53014. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53015. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53016. Ci.CircleGeometry = function(e, t, i, n) {
  53017. Ci.Geometry.call(this),
  53018. this.type = "CircleGeometry",
  53019. this.parameters = {
  53020. radius: e,
  53021. segments: t,
  53022. thetaStart: i,
  53023. thetaLength: n
  53024. },
  53025. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53026. }
  53027. ,
  53028. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53029. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53030. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53031. Ci.BufferGeometry.call(this),
  53032. this.type = "CircleBufferGeometry",
  53033. this.parameters = {
  53034. radius: e,
  53035. segments: t,
  53036. thetaStart: i,
  53037. thetaLength: n
  53038. },
  53039. e = e || 50,
  53040. t = void 0 !== t ? Math.max(3, t) : 8,
  53041. i = void 0 !== i ? i : 0,
  53042. n = void 0 !== n ? n : 2 * Math.PI;
  53043. var r = t + 2
  53044. , o = new Float32Array(3 * r)
  53045. , a = new Float32Array(3 * r)
  53046. , s = new Float32Array(2 * r);
  53047. a[2] = 1,
  53048. s[0] = .5,
  53049. s[1] = .5;
  53050. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53051. c += 3,
  53052. h += 2) {
  53053. var u = i + l / t * n;
  53054. o[c] = e * Math.cos(u),
  53055. o[c + 1] = e * Math.sin(u),
  53056. a[c + 2] = 1,
  53057. s[h] = (o[c] / e + 1) / 2,
  53058. s[h + 1] = (o[c + 1] / e + 1) / 2
  53059. }
  53060. var d = [];
  53061. for (c = 1; c <= t; c++)
  53062. d.push(c, c + 1, 0);
  53063. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53064. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53065. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53066. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53067. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53068. }
  53069. ,
  53070. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53071. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53072. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53073. function t(e) {
  53074. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53075. for (i = b,
  53076. t = 1; t <= m; t++)
  53077. I.setXYZ(b, 0, x * s, 0),
  53078. E.setXYZ(b, 0, s, 0),
  53079. !0 === e ? (r.x = t / m,
  53080. r.y = 0) : (r.x = (t - 1) / m,
  53081. r.y = 1),
  53082. _.setXY(b, r.x, r.y),
  53083. b++;
  53084. for (n = b,
  53085. t = 0; t <= m; t++) {
  53086. var l = t / m;
  53087. o.x = a * Math.sin(l * A + y),
  53088. o.y = x * s,
  53089. o.z = a * Math.cos(l * A + y),
  53090. I.setXYZ(b, o.x, o.y, o.z),
  53091. E.setXYZ(b, 0, s, 0),
  53092. _.setXY(b, l, !0 === e ? 1 : 0),
  53093. b++
  53094. }
  53095. for (t = 0; t < m; t++) {
  53096. var c = i + t
  53097. , h = n + t;
  53098. !0 === e ? (C.setX(w, h),
  53099. w++,
  53100. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53101. w++,
  53102. C.setX(w, h)),
  53103. w++,
  53104. C.setX(w, c),
  53105. w++
  53106. }
  53107. }
  53108. Ci.BufferGeometry.call(this),
  53109. this.type = "CylinderBufferGeometry",
  53110. this.parameters = {
  53111. radiusTop: p,
  53112. radiusBottom: f,
  53113. height: g,
  53114. radialSegments: m,
  53115. heightSegments: v,
  53116. openEnded: e,
  53117. thetaStart: y,
  53118. thetaLength: A
  53119. },
  53120. p = void 0 !== p ? p : 20,
  53121. f = void 0 !== f ? f : 20,
  53122. g = void 0 !== g ? g : 100,
  53123. m = Math.floor(m) || 8,
  53124. v = Math.floor(v) || 1,
  53125. e = void 0 !== e && e,
  53126. y = void 0 !== y ? y : 0,
  53127. A = void 0 !== A ? A : 2 * Math.PI;
  53128. var i, n, r = (n = (m + 1) * (v + 1),
  53129. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53130. n), o = (i = m * v * 2 * 3,
  53131. !1 === e && (i += 2 * m * 3),
  53132. 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;
  53133. (function() {
  53134. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53135. for (t = 0; t <= v; t++) {
  53136. var o = []
  53137. , a = t / v
  53138. , s = a * (f - p) + p;
  53139. for (e = 0; e <= m; e++) {
  53140. var l = e / m;
  53141. n.x = s * Math.sin(l * A + y),
  53142. n.y = -a * g + x,
  53143. n.z = s * Math.cos(l * A + y),
  53144. I.setXYZ(b, n.x, n.y, n.z),
  53145. i.copy(n),
  53146. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53147. i.z = Math.cos(l * A + y)),
  53148. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53149. E.setXYZ(b, i.x, i.y, i.z),
  53150. _.setXY(b, l, 1 - a),
  53151. o.push(b),
  53152. b++
  53153. }
  53154. T.push(o)
  53155. }
  53156. for (e = 0; e < m; e++)
  53157. for (t = 0; t < v; t++) {
  53158. var c = T[t][e]
  53159. , h = T[t + 1][e]
  53160. , u = T[t + 1][e + 1]
  53161. , d = T[t][e + 1];
  53162. C.setX(w, c),
  53163. w++,
  53164. C.setX(w, h),
  53165. w++,
  53166. C.setX(w, d),
  53167. w++,
  53168. C.setX(w, h),
  53169. w++,
  53170. C.setX(w, u),
  53171. w++,
  53172. C.setX(w, d),
  53173. w++
  53174. }
  53175. }
  53176. )(),
  53177. !1 === e && (0 < p && t(!0),
  53178. 0 < f && t(!1)),
  53179. this.setIndex(C),
  53180. this.addAttribute("position", I),
  53181. this.addAttribute("normal", E),
  53182. this.addAttribute("uv", _)
  53183. }
  53184. ,
  53185. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53186. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53187. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53188. Ci.Geometry.call(this),
  53189. this.type = "CylinderGeometry",
  53190. this.parameters = {
  53191. radiusTop: e,
  53192. radiusBottom: t,
  53193. height: i,
  53194. radialSegments: n,
  53195. heightSegments: r,
  53196. openEnded: o,
  53197. thetaStart: a,
  53198. thetaLength: s
  53199. },
  53200. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53201. this.mergeVertices()
  53202. }
  53203. ,
  53204. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53205. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53206. Ci.EdgesGeometry = function(e, t) {
  53207. function i(e, t) {
  53208. return e - t
  53209. }
  53210. Ci.BufferGeometry.call(this),
  53211. t = void 0 !== t ? t : 1;
  53212. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53213. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53214. n.mergeVertices(),
  53215. n.computeFaceNormals();
  53216. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53217. for (var d = c[h], p = 0; p < 3; p++) {
  53218. o[0] = d[s[p]],
  53219. o[1] = d[s[(p + 1) % 3]],
  53220. o.sort(i),
  53221. void 0 === a[g = o.toString()] ? a[g] = {
  53222. vert1: o[0],
  53223. vert2: o[1],
  53224. face1: h,
  53225. face2: void 0
  53226. } : a[g].face2 = h
  53227. }
  53228. var f = [];
  53229. for (var g in a) {
  53230. var m = a[g];
  53231. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53232. var v = l[m.vert1];
  53233. f.push(v.x),
  53234. f.push(v.y),
  53235. f.push(v.z),
  53236. v = l[m.vert2],
  53237. f.push(v.x),
  53238. f.push(v.y),
  53239. f.push(v.z)
  53240. }
  53241. }
  53242. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53243. }
  53244. ,
  53245. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53246. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53247. Ci.ExtrudeGeometry = function(e, t) {
  53248. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53249. this.type = "ExtrudeGeometry",
  53250. e = Array.isArray(e) ? e : [e],
  53251. this.addShapeList(e, t),
  53252. void this.computeFaceNormals())
  53253. }
  53254. ;
  53255. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53256. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53257. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53258. for (var i = e.length, n = 0; n < i; n++) {
  53259. var r = e[n];
  53260. this.addShape(r, t)
  53261. }
  53262. }
  53263. ,
  53264. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53265. function i(e, t, i) {
  53266. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53267. t.clone().multiplyScalar(i).add(e)
  53268. }
  53269. function n(e, t, i) {
  53270. 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;
  53271. if (Math.abs(u) > Number.EPSILON) {
  53272. var d = Math.sqrt(h)
  53273. , p = Math.sqrt(l * l + c * c)
  53274. , f = t.x - s / d
  53275. , g = t.y + a / d
  53276. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53277. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53278. if (v <= 2)
  53279. return new Ci.Vector2(n,r);
  53280. o = Math.sqrt(v / 2)
  53281. } else {
  53282. var y = !1;
  53283. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53284. o = y ? (n = -s,
  53285. r = a,
  53286. Math.sqrt(h)) : (n = a,
  53287. r = s,
  53288. Math.sqrt(h / 2))
  53289. }
  53290. return new Ci.Vector2(n / o,r / o)
  53291. }
  53292. function r(e, t) {
  53293. var i, n;
  53294. for (G = e.length; 0 <= --G; ) {
  53295. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53296. var r = 0
  53297. , o = A + 2 * m;
  53298. for (r = 0; r < o; r++) {
  53299. var a = U * r
  53300. , s = U * (r + 1);
  53301. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53302. }
  53303. }
  53304. }
  53305. function o(e, t, i) {
  53306. T.vertices.push(new Ci.Vector3(e,t,i))
  53307. }
  53308. function a(e, t, i) {
  53309. e += x,
  53310. t += x,
  53311. i += x,
  53312. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53313. var n = E.generateTopUV(T, e, t, i);
  53314. T.faceVertexUvs[0].push(n)
  53315. }
  53316. function l(e, t, i, n) {
  53317. e += x,
  53318. t += x,
  53319. i += x,
  53320. n += x,
  53321. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53322. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53323. var r = E.generateSideWallUV(T, e, t, i, n);
  53324. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53325. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53326. }
  53327. 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;
  53328. C && (s = C.getSpacedPoints(A),
  53329. v = !(I = !0),
  53330. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53331. h = new Ci.Vector3,
  53332. u = new Ci.Vector3,
  53333. d = new Ci.Vector3),
  53334. v || (g = f = m = 0);
  53335. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53336. if (P) {
  53337. for (M = M.reverse(),
  53338. b = 0,
  53339. w = R.length; b < w; b++)
  53340. _ = R[b],
  53341. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53342. P = !1
  53343. }
  53344. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53345. , L = M;
  53346. for (b = 0,
  53347. w = R.length; b < w; b++)
  53348. _ = R[b],
  53349. M = M.concat(_);
  53350. 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++,
  53351. j++,
  53352. Y++)
  53353. j === W && (j = 0),
  53354. Y === W && (Y = 0),
  53355. z[G] = n(L[G], L[j], L[Y]);
  53356. var q, X, Z = [], K = z.concat();
  53357. for (b = 0,
  53358. w = R.length; b < w; b++) {
  53359. for (_ = R[b],
  53360. q = [],
  53361. G = 0,
  53362. j = (W = _.length) - 1,
  53363. Y = G + 1; G < W; G++,
  53364. j++,
  53365. Y++)
  53366. j === W && (j = 0),
  53367. Y === W && (Y = 0),
  53368. q[G] = n(_[G], _[j], _[Y]);
  53369. Z.push(q),
  53370. K = K.concat(q)
  53371. }
  53372. for (D = 0; D < m; D++) {
  53373. for (B = f * (1 - (F = D / m)),
  53374. N = g * Math.sin(F * Math.PI / 2),
  53375. G = 0,
  53376. W = L.length; G < W; G++)
  53377. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53378. for (b = 0,
  53379. w = R.length; b < w; b++)
  53380. for (_ = R[b],
  53381. q = Z[b],
  53382. G = 0,
  53383. W = _.length; G < W; G++)
  53384. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53385. }
  53386. for (N = g,
  53387. G = 0; G < U; G++)
  53388. V = v ? i(M[G], K[G], N) : M[G],
  53389. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53390. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53391. d.copy(s[0]).add(u).add(h),
  53392. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53393. for (X = 1; X <= A; X++)
  53394. for (G = 0; G < U; G++)
  53395. V = v ? i(M[G], K[G], N) : M[G],
  53396. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53397. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53398. d.copy(s[X]).add(u).add(h),
  53399. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53400. for (D = m - 1; 0 <= D; D--) {
  53401. for (B = f * (1 - (F = D / m)),
  53402. N = g * Math.sin(F * Math.PI / 2),
  53403. G = 0,
  53404. W = L.length; G < W; G++)
  53405. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53406. for (b = 0,
  53407. w = R.length; b < w; b++)
  53408. for (_ = R[b],
  53409. q = Z[b],
  53410. G = 0,
  53411. W = _.length; G < W; G++)
  53412. V = i(_[G], q[G], N),
  53413. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53414. }
  53415. (function() {
  53416. if (v) {
  53417. var e = 0
  53418. , t = U * e;
  53419. for (G = 0; G < H; G++)
  53420. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53421. for (t = U * (e = A + 2 * m),
  53422. G = 0; G < H; G++)
  53423. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53424. } else {
  53425. for (G = 0; G < H; G++)
  53426. a((k = O[G])[2], k[1], k[0]);
  53427. for (G = 0; G < H; G++)
  53428. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53429. }
  53430. }
  53431. )(),
  53432. function() {
  53433. var e = 0;
  53434. for (r(L, e),
  53435. e += L.length,
  53436. b = 0,
  53437. w = R.length; b < w; b++)
  53438. r(_ = R[b], e),
  53439. e += _.length
  53440. }()
  53441. }
  53442. ,
  53443. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53444. generateTopUV: function(e, t, i, n) {
  53445. var r = e.vertices
  53446. , o = r[t]
  53447. , a = r[i]
  53448. , s = r[n];
  53449. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53450. },
  53451. generateSideWallUV: function(e, t, i, n, r) {
  53452. var o = e.vertices
  53453. , a = o[t]
  53454. , s = o[i]
  53455. , l = o[n]
  53456. , c = o[r];
  53457. 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)]
  53458. }
  53459. },
  53460. Ci.ShapeGeometry = function(e, t) {
  53461. Ci.Geometry.call(this),
  53462. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53463. this.addShapeList(e, t),
  53464. this.computeFaceNormals()
  53465. }
  53466. ,
  53467. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53468. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53469. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53470. for (var i = 0, n = e.length; i < n; i++)
  53471. this.addShape(e[i], t);
  53472. return this
  53473. }
  53474. ,
  53475. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53476. void 0 === t && (t = {});
  53477. 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);
  53478. if (d) {
  53479. for (h = h.reverse(),
  53480. i = 0,
  53481. n = u.length; i < n; i++)
  53482. r = u[i],
  53483. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53484. d = !1
  53485. }
  53486. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53487. for (i = 0,
  53488. n = u.length; i < n; i++)
  53489. r = u[i],
  53490. h = h.concat(r);
  53491. var f, g, m = h.length, v = p.length;
  53492. for (i = 0; i < m; i++)
  53493. f = h[i],
  53494. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53495. for (i = 0; i < v; i++) {
  53496. var y = (g = p[i])[0] + l
  53497. , A = g[1] + l
  53498. , C = g[2] + l;
  53499. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53500. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53501. }
  53502. }
  53503. ,
  53504. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53505. Ci.BufferGeometry.call(this),
  53506. this.type = "LatheBufferGeometry",
  53507. this.parameters = {
  53508. points: e,
  53509. segments: t,
  53510. phiStart: i,
  53511. phiLength: n
  53512. },
  53513. t = Math.floor(t) || 12,
  53514. i = i || 0,
  53515. n = n || 2 * Math.PI,
  53516. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53517. 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,
  53518. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53519. for (o = 0; o <= t; o++) {
  53520. var v = i + o * f * n
  53521. , y = Math.sin(v)
  53522. , A = Math.cos(v);
  53523. for (a = 0; a <= e.length - 1; a++)
  53524. g.x = e[a].x * y,
  53525. g.y = e[a].y,
  53526. g.z = e[a].x * A,
  53527. h.setXYZ(d, g.x, g.y, g.z),
  53528. m.x = o / t,
  53529. m.y = a / (e.length - 1),
  53530. u.setXY(d, m.x, m.y),
  53531. d++
  53532. }
  53533. for (o = 0; o < t; o++)
  53534. for (a = 0; a < e.length - 1; a++) {
  53535. var C = r = a + o * e.length
  53536. , I = r + e.length
  53537. , E = r + e.length + 1
  53538. , _ = r + 1;
  53539. c.setX(p, C),
  53540. p++,
  53541. c.setX(p, I),
  53542. p++,
  53543. c.setX(p, _),
  53544. p++,
  53545. c.setX(p, I),
  53546. p++,
  53547. c.setX(p, E),
  53548. p++,
  53549. c.setX(p, _),
  53550. p++
  53551. }
  53552. if (this.setIndex(c),
  53553. this.addAttribute("position", h),
  53554. this.addAttribute("uv", u),
  53555. this.computeVertexNormals(),
  53556. n === 2 * Math.PI) {
  53557. var b = this.attributes.normal.array
  53558. , w = new Ci.Vector3
  53559. , T = new Ci.Vector3
  53560. , x = new Ci.Vector3;
  53561. for (r = t * e.length * 3,
  53562. a = o = 0; o < e.length; o++,
  53563. a += 3)
  53564. w.x = b[a + 0],
  53565. w.y = b[a + 1],
  53566. w.z = b[a + 2],
  53567. T.x = b[r + a + 0],
  53568. T.y = b[r + a + 1],
  53569. T.z = b[r + a + 2],
  53570. x.addVectors(w, T).normalize(),
  53571. b[a + 0] = b[r + a + 0] = x.x,
  53572. b[a + 1] = b[r + a + 1] = x.y,
  53573. b[a + 2] = b[r + a + 2] = x.z
  53574. }
  53575. }
  53576. ,
  53577. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53578. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53579. Ci.LatheGeometry = function(e, t, i, n) {
  53580. Ci.Geometry.call(this),
  53581. this.type = "LatheGeometry",
  53582. this.parameters = {
  53583. points: e,
  53584. segments: t,
  53585. phiStart: i,
  53586. phiLength: n
  53587. },
  53588. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53589. this.mergeVertices()
  53590. }
  53591. ,
  53592. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53593. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53594. Ci.PlaneGeometry = function(e, t, i, n) {
  53595. Ci.Geometry.call(this),
  53596. this.type = "PlaneGeometry",
  53597. this.parameters = {
  53598. width: e,
  53599. height: t,
  53600. widthSegments: i,
  53601. heightSegments: n
  53602. },
  53603. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53604. }
  53605. ,
  53606. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53607. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53608. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53609. Ci.BufferGeometry.call(this),
  53610. this.type = "PlaneBufferGeometry",
  53611. this.parameters = {
  53612. width: e,
  53613. height: t,
  53614. widthSegments: i,
  53615. heightSegments: n
  53616. };
  53617. 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++)
  53618. for (var y = v * u - o, A = 0; A < l; A++) {
  53619. var C = A * h - r;
  53620. d[g] = C,
  53621. d[g + 1] = -y,
  53622. p[g + 2] = 1,
  53623. f[m] = A / a,
  53624. f[m + 1] = 1 - v / s,
  53625. g += 3,
  53626. m += 2
  53627. }
  53628. g = 0;
  53629. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53630. for (v = 0; v < s; v++)
  53631. for (A = 0; A < a; A++) {
  53632. var E = A + l * v
  53633. , _ = A + l * (v + 1)
  53634. , b = A + 1 + l * (v + 1)
  53635. , w = A + 1 + l * v;
  53636. I[g] = E,
  53637. I[g + 1] = _,
  53638. I[g + 2] = w,
  53639. I[g + 3] = _,
  53640. I[g + 4] = b,
  53641. I[g + 5] = w,
  53642. g += 6
  53643. }
  53644. this.setIndex(new Ci.BufferAttribute(I,1)),
  53645. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53646. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53647. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53648. }
  53649. ,
  53650. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53651. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53652. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53653. Ci.BufferGeometry.call(this),
  53654. this.type = "RingBufferGeometry",
  53655. this.parameters = {
  53656. innerRadius: e,
  53657. outerRadius: t,
  53658. thetaSegments: i,
  53659. phiSegments: n,
  53660. thetaStart: r,
  53661. thetaLength: o
  53662. },
  53663. e = e || 20,
  53664. t = t || 50,
  53665. r = void 0 !== r ? r : 0,
  53666. o = void 0 !== o ? o : 2 * Math.PI;
  53667. 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;
  53668. for (s = 0; s <= n; s++) {
  53669. for (l = 0; l <= i; l++)
  53670. a = r + l / i * o,
  53671. A.x = v * Math.cos(a),
  53672. A.y = v * Math.sin(a),
  53673. d.setXYZ(g, A.x, A.y, A.z),
  53674. p.setXYZ(g, 0, 0, 1),
  53675. C.x = (A.x / t + 1) / 2,
  53676. C.y = (A.y / t + 1) / 2,
  53677. f.setXY(g, C.x, C.y),
  53678. g++;
  53679. v += y
  53680. }
  53681. for (s = 0; s < n; s++) {
  53682. var I = s * (i + 1);
  53683. for (l = 0; l < i; l++) {
  53684. var E = a = l + I
  53685. , _ = a + i + 1
  53686. , b = a + i + 2
  53687. , w = a + 1;
  53688. u.setX(m, E),
  53689. m++,
  53690. u.setX(m, _),
  53691. m++,
  53692. u.setX(m, b),
  53693. m++,
  53694. u.setX(m, E),
  53695. m++,
  53696. u.setX(m, b),
  53697. m++,
  53698. u.setX(m, w),
  53699. m++
  53700. }
  53701. }
  53702. this.setIndex(u),
  53703. this.addAttribute("position", d),
  53704. this.addAttribute("normal", p),
  53705. this.addAttribute("uv", f)
  53706. }
  53707. ,
  53708. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53709. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53710. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53711. Ci.Geometry.call(this),
  53712. this.type = "RingGeometry",
  53713. this.parameters = {
  53714. innerRadius: e,
  53715. outerRadius: t,
  53716. thetaSegments: i,
  53717. phiSegments: n,
  53718. thetaStart: r,
  53719. thetaLength: o
  53720. },
  53721. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53722. }
  53723. ,
  53724. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53725. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53726. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53727. Ci.Geometry.call(this),
  53728. this.type = "SphereGeometry",
  53729. this.parameters = {
  53730. radius: e,
  53731. widthSegments: t,
  53732. heightSegments: i,
  53733. phiStart: n,
  53734. phiLength: r,
  53735. thetaStart: o,
  53736. thetaLength: a
  53737. },
  53738. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53739. }
  53740. ,
  53741. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53742. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53743. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53744. Ci.BufferGeometry.call(this),
  53745. this.type = "SphereBufferGeometry",
  53746. this.parameters = {
  53747. radius: e,
  53748. widthSegments: t,
  53749. heightSegments: i,
  53750. phiStart: n,
  53751. phiLength: r,
  53752. thetaStart: o,
  53753. thetaLength: a
  53754. },
  53755. e = e || 50,
  53756. t = Math.max(3, Math.floor(t) || 8),
  53757. i = Math.max(2, Math.floor(i) || 6),
  53758. n = void 0 !== n ? n : 0,
  53759. r = void 0 !== r ? r : 2 * Math.PI;
  53760. 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++) {
  53761. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53762. var A = y / t
  53763. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53764. , I = e * Math.cos(o + v * a)
  53765. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53766. f.set(C, I, E).normalize(),
  53767. c.setXYZ(d, C, I, E),
  53768. h.setXYZ(d, f.x, f.y, f.z),
  53769. u.setXY(d, A, 1 - v),
  53770. m.push(d),
  53771. d++
  53772. }
  53773. p.push(m)
  53774. }
  53775. var _ = [];
  53776. for (g = 0; g < i; g++)
  53777. for (y = 0; y < t; y++) {
  53778. var b = p[g][y + 1]
  53779. , w = p[g][y]
  53780. , T = p[g + 1][y]
  53781. , x = p[g + 1][y + 1];
  53782. (0 !== g || 0 < o) && _.push(b, w, x),
  53783. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53784. }
  53785. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53786. this.addAttribute("position", c),
  53787. this.addAttribute("normal", h),
  53788. this.addAttribute("uv", u),
  53789. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53790. }
  53791. ,
  53792. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53793. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53794. Ci.TextGeometry = function(e, t) {
  53795. var i = (t = t || {}).font;
  53796. if (i instanceof Ci.Font == 0)
  53797. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53798. new Ci.Geometry;
  53799. var n = i.generateShapes(e, t.size, t.curveSegments);
  53800. t.amount = void 0 !== t.height ? t.height : 50,
  53801. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53802. void 0 === t.bevelSize && (t.bevelSize = 8),
  53803. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53804. Ci.ExtrudeGeometry.call(this, n, t),
  53805. this.type = "TextGeometry"
  53806. }
  53807. ,
  53808. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53809. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53810. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53811. Ci.BufferGeometry.call(this),
  53812. this.type = "TorusBufferGeometry",
  53813. this.parameters = {
  53814. radius: e,
  53815. tube: t,
  53816. radialSegments: i,
  53817. tubularSegments: n,
  53818. arc: r
  53819. },
  53820. e = e || 100,
  53821. t = t || 40,
  53822. i = Math.floor(i) || 8,
  53823. n = Math.floor(n) || 6,
  53824. r = r || 2 * Math.PI;
  53825. 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;
  53826. for (o = 0; o <= i; o++)
  53827. for (a = 0; a <= n; a++) {
  53828. var A = a / n * r
  53829. , C = o / i * Math.PI * 2;
  53830. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53831. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53832. v.z = t * Math.sin(C),
  53833. h[p] = v.x,
  53834. h[p + 1] = v.y,
  53835. h[p + 2] = v.z,
  53836. m.x = e * Math.cos(A),
  53837. m.y = e * Math.sin(A),
  53838. y.subVectors(v, m).normalize(),
  53839. u[p] = y.x,
  53840. u[p + 1] = y.y,
  53841. u[p + 2] = y.z,
  53842. d[f] = a / n,
  53843. d[f + 1] = o / i,
  53844. p += 3,
  53845. f += 2
  53846. }
  53847. for (o = 1; o <= i; o++)
  53848. for (a = 1; a <= n; a++) {
  53849. var I = (n + 1) * o + a - 1
  53850. , E = (n + 1) * (o - 1) + a - 1
  53851. , _ = (n + 1) * (o - 1) + a
  53852. , b = (n + 1) * o + a;
  53853. c[g] = I,
  53854. c[g + 1] = E,
  53855. c[g + 2] = b,
  53856. c[g + 3] = E,
  53857. c[g + 4] = _,
  53858. c[g + 5] = b,
  53859. g += 6
  53860. }
  53861. this.setIndex(new Ci.BufferAttribute(c,1)),
  53862. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53863. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53864. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53865. }
  53866. ,
  53867. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53868. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53869. Ci.TorusGeometry = function(e, t, i, n, r) {
  53870. Ci.Geometry.call(this),
  53871. this.type = "TorusGeometry",
  53872. this.parameters = {
  53873. radius: e,
  53874. tube: t,
  53875. radialSegments: i,
  53876. tubularSegments: n,
  53877. arc: r
  53878. },
  53879. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53880. }
  53881. ,
  53882. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53883. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53884. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53885. function a(e, t, i, n, r) {
  53886. var o = Math.cos(e)
  53887. , a = Math.sin(e)
  53888. , s = i / t * e
  53889. , l = Math.cos(s);
  53890. r.x = n * (2 + l) * .5 * o,
  53891. r.y = n * (2 + l) * a * .5,
  53892. r.z = n * Math.sin(s) * .5
  53893. }
  53894. Ci.BufferGeometry.call(this),
  53895. this.type = "TorusKnotBufferGeometry",
  53896. this.parameters = {
  53897. radius: e,
  53898. tube: t,
  53899. tubularSegments: i,
  53900. radialSegments: n,
  53901. p: r,
  53902. q: o
  53903. },
  53904. e = e || 100,
  53905. t = t || 40,
  53906. i = Math.floor(i) || 64,
  53907. r = r || 2,
  53908. o = o || 3;
  53909. 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;
  53910. for (s = 0; s <= i; ++s) {
  53911. var w = s / i * r * Math.PI * 2;
  53912. for (a(w, r, o, e, C),
  53913. a(.01 + w, r, o, e, I),
  53914. _.subVectors(I, C),
  53915. b.addVectors(I, C),
  53916. E.crossVectors(_, b),
  53917. b.crossVectors(E, _),
  53918. E.normalize(),
  53919. b.normalize(),
  53920. l = 0; l <= n; ++l) {
  53921. var T = l / n * Math.PI * 2
  53922. , x = -t * Math.cos(T)
  53923. , S = t * Math.sin(T);
  53924. v.x = C.x + (x * b.x + S * E.x),
  53925. v.y = C.y + (x * b.y + S * E.y),
  53926. v.z = C.z + (x * b.z + S * E.z),
  53927. d.setXYZ(g, v.x, v.y, v.z),
  53928. y.subVectors(v, C).normalize(),
  53929. p.setXYZ(g, y.x, y.y, y.z),
  53930. A.x = s / i,
  53931. A.y = l / n,
  53932. f.setXY(g, A.x, A.y),
  53933. g++
  53934. }
  53935. }
  53936. for (l = 1; l <= i; l++)
  53937. for (s = 1; s <= n; s++) {
  53938. var M = (n + 1) * (l - 1) + (s - 1)
  53939. , R = (n + 1) * l + (s - 1)
  53940. , P = (n + 1) * l + s
  53941. , O = (n + 1) * (l - 1) + s;
  53942. u.setX(m, M),
  53943. m++,
  53944. u.setX(m, R),
  53945. m++,
  53946. u.setX(m, O),
  53947. m++,
  53948. u.setX(m, R),
  53949. m++,
  53950. u.setX(m, P),
  53951. m++,
  53952. u.setX(m, O),
  53953. m++
  53954. }
  53955. this.setIndex(u),
  53956. this.addAttribute("position", d),
  53957. this.addAttribute("normal", p),
  53958. this.addAttribute("uv", f)
  53959. }
  53960. ,
  53961. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53962. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53963. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53964. Ci.Geometry.call(this),
  53965. this.type = "TorusKnotGeometry",
  53966. this.parameters = {
  53967. radius: e,
  53968. tube: t,
  53969. tubularSegments: i,
  53970. radialSegments: n,
  53971. p: r,
  53972. q: o
  53973. },
  53974. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53975. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53976. this.mergeVertices()
  53977. }
  53978. ,
  53979. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53980. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53981. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53982. Ci.Geometry.call(this),
  53983. this.type = "TubeGeometry",
  53984. this.parameters = {
  53985. path: e,
  53986. segments: t,
  53987. radius: i,
  53988. radialSegments: n,
  53989. closed: r,
  53990. taper: o
  53991. },
  53992. t = t || 64,
  53993. i = i || 1,
  53994. n = n || 8,
  53995. r = r || !1,
  53996. o = o || Ci.TubeGeometry.NoTaper;
  53997. 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;
  53998. for (this.tangents = D,
  53999. this.normals = N,
  54000. this.binormals = F,
  54001. f = 0; f < P; f++)
  54002. for (M[f] = [],
  54003. l = f / (P - 1),
  54004. p = e.getPointAt(l),
  54005. D[f],
  54006. a = N[f],
  54007. s = F[f],
  54008. h = i * o(l),
  54009. g = 0; g < n; g++)
  54010. c = g / n * 2 * Math.PI,
  54011. u = -h * Math.cos(c),
  54012. d = h * Math.sin(c),
  54013. O.copy(p),
  54014. O.x += u * a.x + d * s.x,
  54015. O.y += u * a.y + d * s.y,
  54016. O.z += u * a.z + d * s.z,
  54017. M[f][g] = (T = O.x,
  54018. x = O.y,
  54019. S = O.z,
  54020. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54021. for (f = 0; f < t; f++)
  54022. for (g = 0; g < n; g++)
  54023. m = r ? (f + 1) % t : f + 1,
  54024. v = (g + 1) % n,
  54025. y = M[f][g],
  54026. A = M[m][g],
  54027. C = M[m][v],
  54028. I = M[f][v],
  54029. E = new Ci.Vector2(f / t,g / n),
  54030. _ = new Ci.Vector2((f + 1) / t,g / n),
  54031. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54032. w = new Ci.Vector2(f / t,(g + 1) / n),
  54033. this.faces.push(new Ci.Face3(y,A,I)),
  54034. this.faceVertexUvs[0].push([E, _, w]),
  54035. this.faces.push(new Ci.Face3(A,C,I)),
  54036. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54037. this.computeFaceNormals(),
  54038. this.computeVertexNormals()
  54039. }
  54040. ,
  54041. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54042. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54043. Ci.TubeGeometry.NoTaper = function(e) {
  54044. return 1
  54045. }
  54046. ,
  54047. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54048. return Math.sin(Math.PI * e)
  54049. }
  54050. ,
  54051. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54052. 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;
  54053. for (this.tangents = u,
  54054. this.normals = d,
  54055. this.binormals = p,
  54056. l = 0; l < m; l++)
  54057. c = l / (m - 1),
  54058. u[l] = e.getTangentAt(c),
  54059. u[l].normalize();
  54060. for (d[0] = new Ci.Vector3,
  54061. p[0] = new Ci.Vector3,
  54062. r = Number.MAX_VALUE,
  54063. o = Math.abs(u[0].x),
  54064. a = Math.abs(u[0].y),
  54065. s = Math.abs(u[0].z),
  54066. o <= r && (r = o,
  54067. h.set(1, 0, 0)),
  54068. a <= r && (r = a,
  54069. h.set(0, 1, 0)),
  54070. s <= r && h.set(0, 0, 1),
  54071. f.crossVectors(u[0], h).normalize(),
  54072. d[0].crossVectors(u[0], f),
  54073. p[0].crossVectors(u[0], d[0]),
  54074. l = 1; l < m; l++)
  54075. d[l] = d[l - 1].clone(),
  54076. p[l] = p[l - 1].clone(),
  54077. f.crossVectors(u[l - 1], u[l]),
  54078. f.length() > Number.EPSILON && (f.normalize(),
  54079. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54080. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54081. p[l].crossVectors(u[l], d[l]);
  54082. if (i)
  54083. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54084. n /= m - 1,
  54085. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54086. l = 1; l < m; l++)
  54087. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54088. p[l].crossVectors(u[l], d[l])
  54089. }
  54090. ,
  54091. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54092. function f(e) {
  54093. var t = e.normalize().clone();
  54094. t.index = m.vertices.push(t) - 1;
  54095. var i = a(e) / 2 / Math.PI + .5
  54096. , n = function(e) {
  54097. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54098. }(e) / Math.PI + .5;
  54099. return t.uv = new Ci.Vector2(i,1 - n),
  54100. t
  54101. }
  54102. function g(e, t, i, n) {
  54103. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54104. m.faces.push(r),
  54105. y.copy(e).add(t).add(i).divideScalar(3);
  54106. var o = a(y);
  54107. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54108. }
  54109. function r(e, t) {
  54110. 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++) {
  54111. a[l] = [];
  54112. 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++)
  54113. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54114. }
  54115. for (l = 0; l < i; l++)
  54116. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54117. var p = Math.floor(d / 2);
  54118. 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)
  54119. }
  54120. }
  54121. function a(e) {
  54122. return Math.atan2(e.z, -e.x)
  54123. }
  54124. function s(e, t, i) {
  54125. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54126. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54127. e.clone()
  54128. }
  54129. Ci.Geometry.call(this),
  54130. this.type = "PolyhedronGeometry",
  54131. this.parameters = {
  54132. vertices: e,
  54133. indices: t,
  54134. radius: i,
  54135. detail: n
  54136. },
  54137. i = i || 1,
  54138. n = n || 0;
  54139. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54140. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54141. var c = this.vertices
  54142. , h = []
  54143. , u = (o = 0,
  54144. 0);
  54145. for (l = t.length; o < l; o += 3,
  54146. u++) {
  54147. var d = c[t[o]]
  54148. , p = c[t[o + 1]]
  54149. , v = c[t[o + 2]];
  54150. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54151. }
  54152. var y = new Ci.Vector3;
  54153. for (o = 0,
  54154. l = h.length; o < l; o++)
  54155. r(h[o], n);
  54156. for (o = 0,
  54157. l = this.faceVertexUvs[0].length; o < l; o++) {
  54158. var A = this.faceVertexUvs[0][o]
  54159. , C = A[0].x
  54160. , I = A[1].x
  54161. , E = A[2].x
  54162. , _ = Math.max(C, I, E)
  54163. , b = Math.min(C, I, E);
  54164. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54165. I < .2 && (A[1].x += 1),
  54166. E < .2 && (A[2].x += 1))
  54167. }
  54168. for (o = 0,
  54169. l = this.vertices.length; o < l; o++)
  54170. this.vertices[o].multiplyScalar(i);
  54171. this.mergeVertices(),
  54172. this.computeFaceNormals(),
  54173. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54174. }
  54175. ,
  54176. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54177. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54178. Ci.DodecahedronGeometry = function(e, t) {
  54179. var i = (1 + Math.sqrt(5)) / 2
  54180. , n = 1 / i
  54181. , 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];
  54182. 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),
  54183. this.type = "DodecahedronGeometry",
  54184. this.parameters = {
  54185. radius: e,
  54186. detail: t
  54187. }
  54188. }
  54189. ,
  54190. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54191. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54192. Ci.IcosahedronGeometry = function(e, t) {
  54193. var i = (1 + Math.sqrt(5)) / 2
  54194. , 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];
  54195. 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),
  54196. this.type = "IcosahedronGeometry",
  54197. this.parameters = {
  54198. radius: e,
  54199. detail: t
  54200. }
  54201. }
  54202. ,
  54203. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54204. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54205. Ci.OctahedronGeometry = function(e, t) {
  54206. 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),
  54207. this.type = "OctahedronGeometry",
  54208. this.parameters = {
  54209. radius: e,
  54210. detail: t
  54211. }
  54212. }
  54213. ,
  54214. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54215. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54216. Ci.TetrahedronGeometry = function(e, t) {
  54217. 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),
  54218. this.type = "TetrahedronGeometry",
  54219. this.parameters = {
  54220. radius: e,
  54221. detail: t
  54222. }
  54223. }
  54224. ,
  54225. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54226. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54227. Ci.ParametricGeometry = function(e, t, i) {
  54228. Ci.Geometry.call(this),
  54229. this.type = "ParametricGeometry",
  54230. this.parameters = {
  54231. func: e,
  54232. slices: t,
  54233. stacks: i
  54234. };
  54235. 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;
  54236. for (n = 0; n <= i; n++)
  54237. for (a = n / i,
  54238. r = 0; r <= t; r++)
  54239. o = e(r / t, a),
  54240. g.push(o);
  54241. for (n = 0; n < i; n++)
  54242. for (r = 0; r < t; r++)
  54243. l = (s = n * y + r) + 1,
  54244. c = (n + 1) * y + r + 1,
  54245. h = (n + 1) * y + r,
  54246. u = new Ci.Vector2(r / t,n / i),
  54247. d = new Ci.Vector2((r + 1) / t,n / i),
  54248. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54249. f = new Ci.Vector2(r / t,(n + 1) / i),
  54250. m.push(new Ci.Face3(s,l,h)),
  54251. v.push([u, d, f]),
  54252. m.push(new Ci.Face3(l,c,h)),
  54253. v.push([d.clone(), p, f.clone()]);
  54254. this.computeFaceNormals(),
  54255. this.computeVertexNormals()
  54256. }
  54257. ,
  54258. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54259. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54260. Ci.WireframeGeometry = function(e) {
  54261. function t(e, t) {
  54262. return e - t
  54263. }
  54264. Ci.BufferGeometry.call(this);
  54265. var i = [0, 0]
  54266. , n = {}
  54267. , r = ["a", "b", "c"];
  54268. if (e instanceof Ci.Geometry) {
  54269. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54270. for (var u = a[c], d = 0; d < 3; d++) {
  54271. i[0] = u[r[d]],
  54272. i[1] = u[r[(d + 1) % 3]],
  54273. i.sort(t),
  54274. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54275. l[2 * s + 1] = i[1],
  54276. n[E] = !0,
  54277. s++)
  54278. }
  54279. var p = new Float32Array(2 * s * 3);
  54280. for (c = 0,
  54281. h = s; c < h; c++)
  54282. for (d = 0; d < 2; d++) {
  54283. var f = o[l[2 * c + d]];
  54284. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54285. p[_ + 1] = f.y,
  54286. p[_ + 2] = f.z
  54287. }
  54288. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54289. } else if (e instanceof Ci.BufferGeometry)
  54290. if (null !== e.index) {
  54291. var g = e.index.array
  54292. , m = (o = e.attributes.position,
  54293. e.groups);
  54294. s = 0;
  54295. 0 === m.length && e.addGroup(0, g.length);
  54296. l = new Uint32Array(2 * g.length);
  54297. for (var v = 0, y = m.length; v < y; ++v)
  54298. for (var A = m[v], C = A.start, I = (c = C,
  54299. C + A.count); c < I; c += 3)
  54300. for (d = 0; d < 3; d++) {
  54301. var E;
  54302. i[0] = g[c + d],
  54303. i[1] = g[c + (d + 1) % 3],
  54304. i.sort(t),
  54305. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54306. l[2 * s + 1] = i[1],
  54307. n[E] = !0,
  54308. s++)
  54309. }
  54310. for (p = new Float32Array(2 * s * 3),
  54311. c = 0,
  54312. h = s; c < h; c++)
  54313. for (d = 0; d < 2; d++) {
  54314. var _ = 6 * c + 3 * d
  54315. , b = l[2 * c + d];
  54316. p[_ + 0] = o.getX(b),
  54317. p[_ + 1] = o.getY(b),
  54318. p[_ + 2] = o.getZ(b)
  54319. }
  54320. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54321. } else {
  54322. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54323. for (p = new Float32Array(2 * s * 3),
  54324. c = 0,
  54325. h = w; c < h; c++)
  54326. for (d = 0; d < 3; d++) {
  54327. var T = 9 * c + 3 * d;
  54328. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54329. p[_ + 1] = o[1 + T],
  54330. p[_ + 2] = o[2 + T];
  54331. b = 9 * c + (d + 1) % 3 * 3;
  54332. p[_ + 3] = o[b],
  54333. p[_ + 4] = o[b + 1],
  54334. p[_ + 5] = o[b + 2]
  54335. }
  54336. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54337. }
  54338. }
  54339. ,
  54340. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54341. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54342. Ci.AxisHelper = function(e) {
  54343. e = e || 1;
  54344. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54345. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54346. , n = new Ci.BufferGeometry;
  54347. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54348. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54349. var r = new Ci.LineBasicMaterial({
  54350. vertexColors: Ci.VertexColors
  54351. });
  54352. Ci.LineSegments.call(this, n, r)
  54353. }
  54354. ,
  54355. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54356. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54357. Ci.ArrowHelper = function() {
  54358. var a = new Ci.Geometry;
  54359. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54360. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54361. return s.translate(0, -.5, 0),
  54362. function(e, t, i, n, r, o) {
  54363. Ci.Object3D.call(this),
  54364. void 0 === n && (n = 16776960),
  54365. void 0 === i && (i = 1),
  54366. void 0 === r && (r = .2 * i),
  54367. void 0 === o && (o = .2 * r),
  54368. this.position.copy(t),
  54369. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54370. color: n
  54371. })),
  54372. this.line.matrixAutoUpdate = !1,
  54373. this.add(this.line),
  54374. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54375. color: n
  54376. })),
  54377. this.cone.matrixAutoUpdate = !1,
  54378. this.add(this.cone),
  54379. this.setDirection(e),
  54380. this.setLength(i, r, o)
  54381. }
  54382. }(),
  54383. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54384. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54385. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54386. function(e) {
  54387. .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(),
  54388. yi = Math.acos(e.y),
  54389. this.quaternion.setFromAxisAngle(Ai, yi))
  54390. }
  54391. ),
  54392. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54393. void 0 === t && (t = .2 * e),
  54394. void 0 === i && (i = .2 * t),
  54395. this.line.scale.set(1, Math.max(0, e - t), 1),
  54396. this.line.updateMatrix(),
  54397. this.cone.scale.set(i, t, i),
  54398. this.cone.position.y = e,
  54399. this.cone.updateMatrix()
  54400. }
  54401. ,
  54402. Ci.ArrowHelper.prototype.setColor = function(e) {
  54403. this.line.material.color.set(e),
  54404. this.cone.material.color.set(e)
  54405. }
  54406. ,
  54407. Ci.BoxHelper = function(e) {
  54408. 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])
  54409. , i = new Float32Array(24)
  54410. , n = new Ci.BufferGeometry;
  54411. n.setIndex(new Ci.BufferAttribute(t,1)),
  54412. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54413. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54414. color: 16776960
  54415. })),
  54416. void 0 !== e && this.update(e)
  54417. }
  54418. ,
  54419. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54420. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54421. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54422. function(e) {
  54423. if (vi.setFromObject(e),
  54424. !vi.isEmpty()) {
  54425. var t = vi.min
  54426. , i = vi.max
  54427. , n = this.geometry.attributes.position
  54428. , r = n.array;
  54429. r[0] = i.x,
  54430. r[1] = i.y,
  54431. r[2] = i.z,
  54432. r[3] = t.x,
  54433. r[4] = i.y,
  54434. r[5] = i.z,
  54435. r[6] = t.x,
  54436. r[7] = t.y,
  54437. r[8] = i.z,
  54438. r[9] = i.x,
  54439. r[10] = t.y,
  54440. r[11] = i.z,
  54441. r[12] = i.x,
  54442. r[13] = i.y,
  54443. r[14] = t.z,
  54444. r[15] = t.x,
  54445. r[16] = i.y,
  54446. r[17] = t.z,
  54447. r[18] = t.x,
  54448. r[19] = t.y,
  54449. r[20] = t.z,
  54450. r[21] = i.x,
  54451. r[22] = t.y,
  54452. r[23] = t.z,
  54453. n.needsUpdate = !0,
  54454. this.geometry.computeBoundingSphere()
  54455. }
  54456. }
  54457. ),
  54458. Ci.BoundingBoxHelper = function(e, t) {
  54459. var i = void 0 !== t ? t : 8947848;
  54460. this.object = e,
  54461. this.box = new Ci.Box3,
  54462. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54463. color: i,
  54464. wireframe: !0
  54465. }))
  54466. }
  54467. ,
  54468. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54469. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54470. Ci.BoundingBoxHelper.prototype.update = function() {
  54471. this.box.setFromObject(this.object),
  54472. this.box.size(this.scale),
  54473. this.box.center(this.position)
  54474. }
  54475. ,
  54476. Ci.CameraHelper = function(e) {
  54477. function t(e, t, i) {
  54478. n(e, i),
  54479. n(t, i)
  54480. }
  54481. function n(e, t) {
  54482. i.vertices.push(new Ci.Vector3),
  54483. i.colors.push(new Ci.Color(t)),
  54484. void 0 === o[e] && (o[e] = []),
  54485. o[e].push(i.vertices.length - 1)
  54486. }
  54487. var i = new Ci.Geometry
  54488. , r = new Ci.LineBasicMaterial({
  54489. color: 16777215,
  54490. vertexColors: Ci.FaceColors
  54491. })
  54492. , o = {}
  54493. , a = 16755200
  54494. , s = 16711680
  54495. , l = 3355443;
  54496. t("n1", "n2", a),
  54497. t("n2", "n4", a),
  54498. t("n4", "n3", a),
  54499. t("n3", "n1", a),
  54500. t("f1", "f2", a),
  54501. t("f2", "f4", a),
  54502. t("f4", "f3", a),
  54503. t("f3", "f1", a),
  54504. t("n1", "f1", a),
  54505. t("n2", "f2", a),
  54506. t("n3", "f3", a),
  54507. t("n4", "f4", a),
  54508. t("p", "n1", s),
  54509. t("p", "n2", s),
  54510. t("p", "n3", s),
  54511. t("p", "n4", s),
  54512. t("u1", "u2", 43775),
  54513. t("u2", "u3", 43775),
  54514. t("u3", "u1", 43775),
  54515. t("c", "t", 16777215),
  54516. t("p", "c", l),
  54517. t("cn1", "cn2", l),
  54518. t("cn3", "cn4", l),
  54519. t("cf1", "cf2", l),
  54520. t("cf3", "cf4", l),
  54521. Ci.LineSegments.call(this, i, r),
  54522. this.camera = e,
  54523. this.camera.updateProjectionMatrix(),
  54524. this.matrix = e.matrixWorld,
  54525. this.matrixAutoUpdate = !1,
  54526. this.pointMap = o,
  54527. this.update()
  54528. }
  54529. ,
  54530. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54531. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54532. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54533. mi = new Ci.Camera,
  54534. function() {
  54535. pi = this.geometry,
  54536. fi = this.pointMap,
  54537. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54538. Ni("c", 0, 0, -1),
  54539. Ni("t", 0, 0, 1),
  54540. Ni("n1", -1, -1, -1),
  54541. Ni("n2", 1, -1, -1),
  54542. Ni("n3", -1, 1, -1),
  54543. Ni("n4", 1, 1, -1),
  54544. Ni("f1", -1, -1, 1),
  54545. Ni("f2", 1, -1, 1),
  54546. Ni("f3", -1, 1, 1),
  54547. Ni("f4", 1, 1, 1),
  54548. Ni("u1", .7, 1.1, -1),
  54549. Ni("u2", -.7, 1.1, -1),
  54550. Ni("u3", 0, 2, -1),
  54551. Ni("cf1", -1, 0, 1),
  54552. Ni("cf2", 1, 0, 1),
  54553. Ni("cf3", 0, -1, 1),
  54554. Ni("cf4", 0, 1, 1),
  54555. Ni("cn1", -1, 0, -1),
  54556. Ni("cn2", 1, 0, -1),
  54557. Ni("cn3", 0, -1, -1),
  54558. Ni("cn4", 0, 1, -1),
  54559. pi.verticesNeedUpdate = !0
  54560. }
  54561. ),
  54562. Ci.DirectionalLightHelper = function(e, t) {
  54563. Ci.Object3D.call(this),
  54564. this.light = e,
  54565. this.light.updateMatrixWorld(),
  54566. this.matrix = e.matrixWorld,
  54567. this.matrixAutoUpdate = !1,
  54568. t = t || 1;
  54569. var i = new Ci.Geometry;
  54570. 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));
  54571. var n = new Ci.LineBasicMaterial({
  54572. fog: !1
  54573. });
  54574. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54575. this.lightPlane = new Ci.Line(i,n),
  54576. this.add(this.lightPlane),
  54577. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54578. (n = new Ci.LineBasicMaterial({
  54579. fog: !1
  54580. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54581. this.targetLine = new Ci.Line(i,n),
  54582. this.add(this.targetLine),
  54583. this.update()
  54584. }
  54585. ,
  54586. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54587. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54588. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54589. this.lightPlane.geometry.dispose(),
  54590. this.lightPlane.material.dispose(),
  54591. this.targetLine.geometry.dispose(),
  54592. this.targetLine.material.dispose()
  54593. }
  54594. ,
  54595. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54596. ui = new Ci.Vector3,
  54597. di = new Ci.Vector3,
  54598. function() {
  54599. hi.setFromMatrixPosition(this.light.matrixWorld),
  54600. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54601. di.subVectors(ui, hi),
  54602. this.lightPlane.lookAt(di),
  54603. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54604. this.targetLine.geometry.vertices[1].copy(di),
  54605. this.targetLine.geometry.verticesNeedUpdate = !0,
  54606. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54607. }
  54608. ),
  54609. Ci.EdgesHelper = function(e, t, i) {
  54610. var n = void 0 !== t ? t : 16777215;
  54611. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54612. color: n
  54613. })),
  54614. this.matrix = e.matrixWorld,
  54615. this.matrixAutoUpdate = !1
  54616. }
  54617. ,
  54618. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54619. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54620. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54621. this.object = e,
  54622. this.size = void 0 !== t ? t : 1;
  54623. var r = void 0 !== i ? i : 16776960
  54624. , o = void 0 !== n ? n : 1
  54625. , a = 0
  54626. , s = this.object.geometry;
  54627. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54628. var l = new Ci.BufferGeometry
  54629. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54630. l.addAttribute("position", c),
  54631. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54632. color: r,
  54633. linewidth: o
  54634. })),
  54635. this.matrixAutoUpdate = !1,
  54636. this.update()
  54637. }
  54638. ,
  54639. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54640. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54641. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54642. li = new Ci.Vector3,
  54643. ci = new Ci.Matrix3,
  54644. function() {
  54645. this.object.updateMatrixWorld(!0),
  54646. ci.getNormalMatrix(this.object.matrixWorld);
  54647. 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++) {
  54648. var l = r[a]
  54649. , c = l.normal;
  54650. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54651. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54652. t.setXYZ(o, si.x, si.y, si.z),
  54653. o += 1,
  54654. t.setXYZ(o, li.x, li.y, li.z),
  54655. o += 1
  54656. }
  54657. return t.needsUpdate = !0,
  54658. this
  54659. }
  54660. ),
  54661. Ci.GridHelper = function(e, t) {
  54662. var i = new Ci.Geometry
  54663. , n = new Ci.LineBasicMaterial({
  54664. vertexColors: Ci.VertexColors
  54665. });
  54666. this.color1 = new Ci.Color(4473924),
  54667. this.color2 = new Ci.Color(8947848);
  54668. for (var r = -e; r <= e; r += t) {
  54669. 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));
  54670. var o = 0 === r ? this.color1 : this.color2;
  54671. i.colors.push(o, o, o, o)
  54672. }
  54673. Ci.LineSegments.call(this, i, n)
  54674. }
  54675. ,
  54676. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54677. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54678. Ci.GridHelper.prototype.setColors = function(e, t) {
  54679. this.color1.set(e),
  54680. this.color2.set(t),
  54681. this.geometry.colorsNeedUpdate = !0
  54682. }
  54683. ,
  54684. Ci.HemisphereLightHelper = function(e, t) {
  54685. Ci.Object3D.call(this),
  54686. this.light = e,
  54687. this.light.updateMatrixWorld(),
  54688. this.matrix = e.matrixWorld,
  54689. this.matrixAutoUpdate = !1,
  54690. this.colors = [new Ci.Color, new Ci.Color];
  54691. var i = new Ci.SphereGeometry(t,4,2);
  54692. i.rotateX(-Math.PI / 2);
  54693. for (var n = 0; n < 8; n++)
  54694. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54695. var r = new Ci.MeshBasicMaterial({
  54696. vertexColors: Ci.FaceColors,
  54697. wireframe: !0
  54698. });
  54699. this.lightSphere = new Ci.Mesh(i,r),
  54700. this.add(this.lightSphere),
  54701. this.update()
  54702. }
  54703. ,
  54704. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54705. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54706. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54707. this.lightSphere.geometry.dispose(),
  54708. this.lightSphere.material.dispose()
  54709. }
  54710. ,
  54711. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54712. function() {
  54713. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54714. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54715. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54716. this.lightSphere.geometry.colorsNeedUpdate = !0
  54717. }
  54718. ),
  54719. Ci.PointLightHelper = function(e, t) {
  54720. this.light = e,
  54721. this.light.updateMatrixWorld();
  54722. var i = new Ci.SphereGeometry(t,4,2)
  54723. , n = new Ci.MeshBasicMaterial({
  54724. wireframe: !0,
  54725. fog: !1
  54726. });
  54727. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54728. Ci.Mesh.call(this, i, n),
  54729. this.matrix = this.light.matrixWorld,
  54730. this.matrixAutoUpdate = !1
  54731. }
  54732. ,
  54733. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54734. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54735. Ci.PointLightHelper.prototype.dispose = function() {
  54736. this.geometry.dispose(),
  54737. this.material.dispose()
  54738. }
  54739. ,
  54740. Ci.PointLightHelper.prototype.update = function() {
  54741. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54742. }
  54743. ,
  54744. Ci.SkeletonHelper = function(e) {
  54745. this.bones = this.getBoneList(e);
  54746. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54747. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54748. t.vertices.push(new Ci.Vector3),
  54749. t.colors.push(new Ci.Color(0,0,1)),
  54750. t.colors.push(new Ci.Color(0,1,0)))
  54751. }
  54752. t.dynamic = !0;
  54753. var n = new Ci.LineBasicMaterial({
  54754. vertexColors: Ci.VertexColors,
  54755. depthTest: !1,
  54756. depthWrite: !1,
  54757. transparent: !0
  54758. });
  54759. Ci.LineSegments.call(this, t, n),
  54760. this.root = e,
  54761. this.matrix = e.matrixWorld,
  54762. this.matrixAutoUpdate = !1,
  54763. this.update()
  54764. }
  54765. ,
  54766. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54767. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54768. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54769. var t = [];
  54770. e instanceof Ci.Bone && t.push(e);
  54771. for (var i = 0; i < e.children.length; i++)
  54772. t.push.apply(t, this.getBoneList(e.children[i]));
  54773. return t
  54774. }
  54775. ,
  54776. Ci.SkeletonHelper.prototype.update = function() {
  54777. 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++) {
  54778. var o = this.bones[r];
  54779. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54780. e.vertices[n].setFromMatrixPosition(i),
  54781. i.multiplyMatrices(t, o.parent.matrixWorld),
  54782. e.vertices[n + 1].setFromMatrixPosition(i),
  54783. n += 2)
  54784. }
  54785. e.verticesNeedUpdate = !0,
  54786. e.computeBoundingSphere()
  54787. }
  54788. ,
  54789. Ci.SpotLightHelper = function(e) {
  54790. Ci.Object3D.call(this),
  54791. this.light = e,
  54792. this.light.updateMatrixWorld(),
  54793. this.matrix = e.matrixWorld,
  54794. this.matrixAutoUpdate = !1;
  54795. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54796. t.translate(0, -.5, 0),
  54797. t.rotateX(-Math.PI / 2);
  54798. var i = new Ci.MeshBasicMaterial({
  54799. wireframe: !0,
  54800. fog: !1
  54801. });
  54802. this.cone = new Ci.Mesh(t,i),
  54803. this.add(this.cone),
  54804. this.update()
  54805. }
  54806. ,
  54807. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54808. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54809. Ci.SpotLightHelper.prototype.dispose = function() {
  54810. this.cone.geometry.dispose(),
  54811. this.cone.material.dispose()
  54812. }
  54813. ,
  54814. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54815. oi = new Ci.Vector3,
  54816. function() {
  54817. var e = this.light.distance ? this.light.distance : 1e4
  54818. , t = e * Math.tan(this.light.angle);
  54819. this.cone.scale.set(t, t, e),
  54820. ri.setFromMatrixPosition(this.light.matrixWorld),
  54821. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54822. this.cone.lookAt(oi.sub(ri)),
  54823. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54824. }
  54825. ),
  54826. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54827. this.object = e,
  54828. this.size = void 0 !== t ? t : 1;
  54829. var r = void 0 !== i ? i : 16711680
  54830. , o = void 0 !== n ? n : 1
  54831. , a = 0
  54832. , s = this.object.geometry;
  54833. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54834. var l = new Ci.BufferGeometry
  54835. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54836. l.addAttribute("position", c),
  54837. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54838. color: r,
  54839. linewidth: o
  54840. })),
  54841. this.matrixAutoUpdate = !1,
  54842. this.update()
  54843. }
  54844. ,
  54845. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54846. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54847. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54848. ii = new Ci.Vector3,
  54849. ni = new Ci.Matrix3,
  54850. function() {
  54851. var e = ["a", "b", "c"];
  54852. this.object.updateMatrixWorld(!0),
  54853. ni.getNormalMatrix(this.object.matrixWorld);
  54854. var t = this.object.matrixWorld
  54855. , i = this.geometry.attributes.position
  54856. , n = this.object.geometry;
  54857. if (n instanceof Ci.Geometry)
  54858. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54859. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54860. var d = r[c[e[h]]]
  54861. , p = c.vertexNormals[h];
  54862. ti.copy(d).applyMatrix4(t),
  54863. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54864. i.setXYZ(a, ti.x, ti.y, ti.z),
  54865. a += 1,
  54866. i.setXYZ(a, ii.x, ii.y, ii.z),
  54867. a += 1
  54868. }
  54869. else if (n instanceof Ci.BufferGeometry) {
  54870. var f = n.attributes.position
  54871. , g = n.attributes.normal;
  54872. for (h = a = 0,
  54873. u = f.count; h < u; h++)
  54874. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54875. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54876. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54877. i.setXYZ(a, ti.x, ti.y, ti.z),
  54878. a += 1,
  54879. i.setXYZ(a, ii.x, ii.y, ii.z),
  54880. a += 1
  54881. }
  54882. return i.needsUpdate = !0,
  54883. this
  54884. }
  54885. ),
  54886. Ci.WireframeHelper = function(e, t) {
  54887. var i = void 0 !== t ? t : 16777215;
  54888. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54889. color: i
  54890. })),
  54891. this.matrix = e.matrixWorld,
  54892. this.matrixAutoUpdate = !1
  54893. }
  54894. ,
  54895. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54896. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54897. Ci.ImmediateRenderObject = function(e) {
  54898. Ci.Object3D.call(this),
  54899. this.material = e,
  54900. this.render = function(e) {}
  54901. }
  54902. ,
  54903. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54904. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54905. Ci.MorphBlendMesh = function(e, t) {
  54906. Ci.Mesh.call(this, e, t),
  54907. this.animationsMap = {},
  54908. this.animationsList = [];
  54909. var i = this.geometry.morphTargets.length
  54910. , n = i - 1
  54911. , r = i / 1;
  54912. this.createAnimation("__default", 0, n, r),
  54913. this.setAnimationWeight("__default", 1)
  54914. }
  54915. ,
  54916. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54917. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54918. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54919. var r = {
  54920. start: t,
  54921. end: i,
  54922. length: i - t + 1,
  54923. fps: n,
  54924. duration: (i - t) / n,
  54925. lastFrame: 0,
  54926. currentFrame: 0,
  54927. active: !1,
  54928. time: 0,
  54929. direction: 1,
  54930. weight: 1,
  54931. directionBackwards: !1,
  54932. mirroredLoop: !1
  54933. };
  54934. this.animationsMap[e] = r,
  54935. this.animationsList.push(r)
  54936. }
  54937. ,
  54938. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54939. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54940. var s = r.morphTargets[o].name.match(i);
  54941. if (s && 1 < s.length)
  54942. n[l = s[1]] || (n[l] = {
  54943. start: 1 / 0,
  54944. end: -1 / 0
  54945. }),
  54946. o < (c = n[l]).start && (c.start = o),
  54947. o > c.end && (c.end = o),
  54948. t = t || l
  54949. }
  54950. for (var l in n) {
  54951. var c = n[l];
  54952. this.createAnimation(l, c.start, c.end, e)
  54953. }
  54954. this.firstAnimation = t
  54955. }
  54956. ,
  54957. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54958. var t = this.animationsMap[e];
  54959. t && (t.direction = 1,
  54960. t.directionBackwards = !1)
  54961. }
  54962. ,
  54963. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54964. var t = this.animationsMap[e];
  54965. t && (t.direction = -1,
  54966. t.directionBackwards = !0)
  54967. }
  54968. ,
  54969. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54970. var i = this.animationsMap[e];
  54971. i && (i.fps = t,
  54972. i.duration = (i.end - i.start) / i.fps)
  54973. }
  54974. ,
  54975. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54976. var i = this.animationsMap[e];
  54977. i && (i.duration = t,
  54978. i.fps = (i.end - i.start) / i.duration)
  54979. }
  54980. ,
  54981. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54982. var i = this.animationsMap[e];
  54983. i && (i.weight = t)
  54984. }
  54985. ,
  54986. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54987. var i = this.animationsMap[e];
  54988. i && (i.time = t)
  54989. }
  54990. ,
  54991. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54992. var t = 0
  54993. , i = this.animationsMap[e];
  54994. return i && (t = i.time),
  54995. t
  54996. }
  54997. ,
  54998. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54999. var t = -1
  55000. , i = this.animationsMap[e];
  55001. return i && (t = i.duration),
  55002. t
  55003. }
  55004. ,
  55005. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55006. var t = this.animationsMap[e];
  55007. t ? (t.time = 0,
  55008. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55009. }
  55010. ,
  55011. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55012. var t = this.animationsMap[e];
  55013. t && (t.active = !1)
  55014. }
  55015. ,
  55016. Ci.MorphBlendMesh.prototype.update = function(e) {
  55017. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55018. var n = this.animationsList[t];
  55019. if (n.active) {
  55020. var r = n.duration / n.length;
  55021. n.time += n.direction * e,
  55022. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55023. n.time > n.duration && (n.time = n.duration,
  55024. n.directionBackwards = !0),
  55025. n.time < 0 && (n.time = 0,
  55026. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55027. n.time < 0 && (n.time += n.duration));
  55028. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55029. , a = n.weight;
  55030. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55031. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55032. this.morphTargetInfluences[o] = 0,
  55033. n.lastFrame = n.currentFrame,
  55034. n.currentFrame = o);
  55035. var s = n.time % r / r;
  55036. n.directionBackwards && (s = 1 - s),
  55037. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55038. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55039. }
  55040. }
  55041. }
  55042. ,
  55043. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55044. i.THREE = Ci) : this.THREE = Ci
  55045. }
  55046. , {}]
  55047. }, {}, [116]);