main_2020_edit.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054
  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 dealMap = (map)=>{//使不resize when image is not power of two
  22. map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
  23. map.minFilter = THREE.LinearFilter;
  24. map.magFilter = THREE.LinearFilter;
  25. map.generateMipmaps = true;
  26. }
  27. var sortByScore = function(list, request, rank) {
  28. var i = common.filterAll(list, request);
  29. return 0 === i.length ? null : i = i.map(function(e) {
  30. return {
  31. item: e,
  32. score: rank.reduce(function(t, i) {
  33. return t + i(e);
  34. }, 0)
  35. };
  36. }).sort(function(e, t) {
  37. return t.score - e.score;
  38. });
  39. };
  40. var getTransformSid = function(){
  41. var name
  42. if(player.mode == 'panorama'){
  43. name = player.currentPano ? player.currentPano.id : 'outside'
  44. }else{
  45. name = 'outside'
  46. }
  47. return name
  48. }
  49. var convertTool = {
  50. getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
  51. var camera = camera || player.camera;
  52. var dom = dom || player.domElement;
  53. 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);
  54. var x,y;
  55. x = (pos.x + 1) / 2 * dom.clientWidth;
  56. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  57. var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
  58. && y <= dom.clientHeight && y >= 0
  59. return {
  60. pos: new THREE.Vector2(x,y), // 屏幕像素坐标
  61. vector: pos, //(范围 -1 ~ 1)
  62. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  63. inSight : inSight //在屏幕范围内可见
  64. };
  65. },
  66. ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
  67. var ori = player.position
  68. var dir = pos3d.clone().sub(ori).normalize()
  69. var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
  70. /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
  71. var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
  72. }else{ */
  73. var o = ray.intersectObjects(player.model.colliders);
  74. //}
  75. var len = pos3d.distanceTo(ori);
  76. if (o && o.length) {
  77. for(var i=0;i<o.length;i++){
  78. if(o[i].distance < len){ return true; }//有遮挡
  79. }
  80. }
  81. },
  82. /*
  83. 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
  84. 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
  85. */
  86. getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
  87. var A = pos;
  88. var player = player;
  89. var mouse = player.mouse;
  90. var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
  91. if(info.y != void 0){//地面线的
  92. var y = info.y;
  93. if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
  94. //intersectPlane和地面平行,无交点
  95. var x = pos.x, z = pos.z;
  96. }else{
  97. if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
  98. if(O.y == A.y){console.log('一样??');return;}
  99. if(A.y == y){console.log('一样2??');return;}
  100. var r = (O.y-y)/(A.y-y);
  101. var x = (r*A.x-O.x)/(r-1);
  102. var z = (r*A.z-O.z)/(r-1);
  103. }
  104. }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
  105. var N = info.normalVec;
  106. var P = info.pullPos;
  107. if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
  108. if(O.z==A.z){console.log('O.z==A.z?');return;}
  109. if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
  110. //console.log('N.z==0 && N.x == 0?');
  111. var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
  112. if(c == 0){console.log("分母为0?? return;");return;}
  113. var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
  114. var x = t * (A.x - O.x) + O.x;
  115. var y = t * (A.y - O.y) + O.y;
  116. var z = t * (A.z - O.z) + O.z;
  117. /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
  118. 求直线L与平面π的交点的坐标。
  119. 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
  120. 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
  121. A(mt+a)+B(nt+b)+C(pt+c)+D=0
  122. 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
  123. 再代入参数方程即得交点的坐标(x,y,z). */
  124. }else if(N.x ==0 ){ //z与pullPos相等
  125. var z = P.z;
  126. if(O.y == A.y){console.log('一样??');return;}
  127. if(A.y == y){console.log('一样2??');return;}
  128. if(A.z == z){console.log('一样3??');return;}
  129. var r = (O.z-z)/(A.z-z);
  130. var x = (r*A.x-O.x)/(r-1);
  131. var y = (r*A.y-O.y)/(r-1);
  132. }else if(N.z == 0){//x与pullPos相等
  133. var x = P.x;
  134. if(O.y == A.y){console.log('一样??');return;}
  135. if(A.y == y){console.log('一样2??');return;}
  136. if(A.x == x){console.log('一样3??');return;}
  137. var r = (O.x-x)/(A.x-x);
  138. var y = (r*A.y-O.y)/(r-1);
  139. var z = (r*A.z-O.z)/(r-1);
  140. }
  141. }
  142. return new THREE.Vector3(x,y,z);
  143. },
  144. getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
  145. var raycaster = new THREE.Raycaster;
  146. camera.updateMatrixWorld();
  147. var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
  148. , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
  149. var dir = end.sub(origin).normalize()
  150. raycaster.set(origin, dir);
  151. var n = raycaster.intersectObjects(meshes);
  152. if (0 === n.length)
  153. return null;
  154. return n[0];
  155. },
  156. ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
  157. var dir = B.clone().sub(A).normalize();
  158. var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
  159. var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
  160. var o = ray.intersectObjects(options.model || player.model.colliders);
  161. if (o && o.length)return o;
  162. if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
  163. var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
  164. normal.multiplyScalar(options.throughWidth)
  165. var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
  166. var A2 = A.clone().add(normalVec3)
  167. ray.set(A2, dir);
  168. var o2 = ray.intersectObjects(options.model || player.model.colliders);
  169. ray.set(A.clone().add(normalVec3.negate()), dir);
  170. if (o2 && o2.length)return o2;
  171. var o3 = ray.intersectObjects(options.model || player.model.colliders);
  172. if (o3 && o3.length)return o3;
  173. }
  174. return null;
  175. },
  176. getPosAtSphere : function(pos3d, toPanoPos){
  177. var dir = pos3d.clone().sub(toPanoPos);
  178. dir.normalize();//然后计算在球中
  179. dir.multiplyScalar(Constants.skyRadius);
  180. dir.add(toPanoPos);
  181. return dir;
  182. }
  183. }
  184. var dom = {
  185. getOffset: function(e, t, i) {
  186. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  187. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  188. left += "left" == e ? t.offsetLeft : t.offsetTop;
  189. return left
  190. }
  191. };
  192. if (function() {
  193. "use strict";
  194. function o(e, t) {
  195. return typeof e === t
  196. }
  197. function a(e, t) {
  198. return e instanceof t
  199. }
  200. function s(e) {
  201. return e && e.nodeType
  202. }
  203. function l(e) {
  204. return s(e) ? e : a(e, y) ? e[0] : void 0
  205. }
  206. function e(e, i, n) {
  207. return y.each(e, function(e, t) {
  208. n = i.call(t, n, e, t)
  209. }),
  210. n
  211. }
  212. function t(e, t, i) {
  213. var n, r, o;
  214. if (e === t)
  215. return !0;
  216. if (!e || !t || e.constructor !== t.constructor)
  217. return !1;
  218. for (n = 0,
  219. r = i.length; n < r; n += 1) {
  220. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  221. return !1;
  222. if (e[o] !== t[o])
  223. return !1
  224. }
  225. return !0
  226. }
  227. function c(e, t, i, n) {
  228. this.left = w(e),
  229. this.top = w(t),
  230. this.width = w(i),
  231. this.height = w(n),
  232. this.right = this.left + this.width,
  233. this.bottom = this.top + this.height
  234. }
  235. function h(e, t, i, n) {
  236. this.visible = e || 0,
  237. this.viewport = t || 0,
  238. this.possible = i || 0,
  239. this.rects = n && I({}, n) || null
  240. }
  241. function r(e, t) {
  242. this.els = e,
  243. this.viewport = t
  244. }
  245. function n(e, t) {
  246. return e.val - t.val
  247. }
  248. function u(e, t) {
  249. return t.val - e.val
  250. }
  251. function d(e) {
  252. var t = c.ofContent(e, !0)
  253. , i = c.ofViewport(e, !0)
  254. , n = t.width - i.width
  255. , r = t.height - i.height;
  256. this.content = t,
  257. this.viewport = i,
  258. this.width = n <= 0 ? null : i.left / n,
  259. this.height = r <= 0 ? null : i.top / r,
  260. this.left = i.left,
  261. this.top = i.top,
  262. this.right = t.right - i.right,
  263. this.bottom = t.bottom - i.bottom
  264. }
  265. function p(e) {
  266. this.el = e || window
  267. }
  268. function f(e, t) {
  269. this.context = e,
  270. this.viewport = t,
  271. this.init()
  272. }
  273. function g(e, t, i, n) {
  274. this.context = new r(e,t),
  275. this.property = i,
  276. this.descending = n,
  277. this.init()
  278. }
  279. function m(e) {
  280. e && e !== window && e !== document ? (this.context = e,
  281. this.$autoTarget = y(e)) : this.context = window,
  282. this.init()
  283. }
  284. 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 = {},
  285. v = 1,
  286. function(e) {
  287. return e ? (i[e] || (i[e] = v,
  288. v += 1),
  289. i[e]) : 0
  290. }
  291. );
  292. I(c.prototype, {
  293. equals: function(e) {
  294. return t(this, e, ["left", "top", "width", "height"])
  295. },
  296. area: function() {
  297. return this.width * this.height
  298. },
  299. relativeTo: function(e) {
  300. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  301. },
  302. intersection: function(e) {
  303. if (!a(e, c))
  304. return null;
  305. var t = _(this.left, e.left)
  306. , i = b(this.right, e.right)
  307. , n = _(this.top, e.top)
  308. , r = i - t
  309. , o = b(this.bottom, e.bottom) - n;
  310. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  311. },
  312. envelope: function(e) {
  313. if (!a(e, c))
  314. return this;
  315. var t = b(this.left, e.left)
  316. , i = _(this.right, e.right)
  317. , n = b(this.top, e.top);
  318. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  319. }
  320. }),
  321. I(c, {
  322. ofContent: function(e, t) {
  323. 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())
  324. },
  325. ofViewport: function(e, t) {
  326. 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())
  327. },
  328. ofElement: function(e) {
  329. var t = y(e);
  330. if (!t.is(":visible"))
  331. return null;
  332. var i = t.offset();
  333. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  334. }
  335. }),
  336. I(h.prototype, {
  337. equals: function(e) {
  338. return this.fracsEqual(e) && this.rectsEqual(e)
  339. },
  340. fracsEqual: function(e) {
  341. return t(this, e, ["visible", "viewport", "possible"])
  342. },
  343. rectsEqual: function(e) {
  344. return t(this.rects, e.rects, ["document", "element", "viewport"])
  345. }
  346. }),
  347. I(h, {
  348. of: function(e, t) {
  349. var i, n, r;
  350. return e = s(e) && c.ofElement(e) || e,
  351. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  352. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  353. r = b(e.width, t.width) * b(e.height, t.height),
  354. new h(n / e.area(),n / t.area(),n / r,{
  355. document: i,
  356. element: i.relativeTo(e),
  357. viewport: i.relativeTo(t)
  358. })) : new h
  359. }
  360. });
  361. var x = ["width", "height", "left", "right", "top", "bottom"]
  362. , S = ["possible", "visible", "viewport"];
  363. I(r.prototype, {
  364. sorted: function(t, e) {
  365. var i = this.viewport;
  366. return y.map(this.els, function(e) {
  367. return {
  368. el: e,
  369. val: function(e, t, i) {
  370. var n;
  371. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  372. n ? n[i] : 0
  373. }(e, i, t)
  374. }
  375. }).sort(e ? u : n)
  376. },
  377. best: function(e, t) {
  378. return this.els.length ? this.sorted(e, t)[0] : null
  379. }
  380. }),
  381. I(d.prototype, {
  382. equals: function(e) {
  383. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  384. }
  385. }),
  386. I(p.prototype, {
  387. equals: function(e) {
  388. return t(this, e, ["el"])
  389. },
  390. scrollState: function() {
  391. return new d(this.el)
  392. },
  393. scrollTo: function(e, t, i) {
  394. var n = y(this.el === window ? "html,body" : this.el);
  395. e = e || 0,
  396. t = t || 0,
  397. i = isNaN(i) ? 1e3 : i,
  398. n.stop(!0).animate({
  399. scrollLeft: e,
  400. scrollTop: t
  401. }, i)
  402. },
  403. scroll: function(e, t, i) {
  404. var n = this.el === window ? A : y(this.el);
  405. e = e || 0,
  406. t = t || 0,
  407. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  408. },
  409. scrollToRect: function(e, t, i, n) {
  410. t = t || 0,
  411. i = i || 0,
  412. this.scrollTo(e.left - t, e.top - i, n)
  413. },
  414. scrollToElement: function(e, t, i, n) {
  415. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  416. this.scrollToRect(r, t, i, n)
  417. }
  418. });
  419. var M = {
  420. init: function() {
  421. this.callbacks = y.Callbacks("memory unique"),
  422. this.currVal = null,
  423. this.prevVal = null,
  424. this.checkProxy = y.proxy(this.check, this),
  425. this.autoCheck()
  426. },
  427. bind: function(e) {
  428. this.callbacks.add(e)
  429. },
  430. unbind: function(e) {
  431. e ? this.callbacks.remove(e) : this.callbacks.empty()
  432. },
  433. trigger: function() {
  434. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  435. },
  436. check: function(e) {
  437. var t = this.updatedValue(e);
  438. return void 0 !== t && (this.prevVal = this.currVal,
  439. this.currVal = t,
  440. this.trigger(),
  441. !0)
  442. },
  443. $autoTarget: A,
  444. autoEvents: "load resize scroll",
  445. autoCheck: function(e) {
  446. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  447. }
  448. };
  449. I(f.prototype, M, {
  450. updatedValue: function() {
  451. var e = h.of(this.context, this.viewport);
  452. return this.currVal && this.currVal.equals(e) ? void 0 : e
  453. }
  454. }),
  455. I(g.prototype, M, {
  456. updatedValue: function() {
  457. var e = this.context.best(this.property, this.descending);
  458. return e && (e = 0 < e.val ? e.el : null,
  459. this.currVal !== e) ? e : void 0
  460. }
  461. }),
  462. I(m.prototype, M, {
  463. updatedValue: function() {
  464. var e = new d(this.context);
  465. return this.currVal && this.currVal.equals(e) ? void 0 : e
  466. }
  467. });
  468. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  469. function H(e, t, i, n) {
  470. return i = N(i) ? i.apply(e, t) : i,
  471. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  472. }
  473. R = U,
  474. P = {
  475. statics: {
  476. version: "0.15.0",
  477. Rect: c,
  478. Fractions: h,
  479. Group: r,
  480. ScrollState: d,
  481. Viewport: p,
  482. FracsCallbacks: f,
  483. GroupCallbacks: g,
  484. ScrollStateCallbacks: m,
  485. fracs: function(e, t) {
  486. return h.of(e, t)
  487. }
  488. },
  489. methods: {
  490. content: function(e) {
  491. return this.length ? c.ofContent(this[0], e) : null
  492. },
  493. envelope: function() {
  494. return e(this, function(e) {
  495. var t = c.ofElement(this);
  496. return e ? e.envelope(t) : t
  497. })
  498. },
  499. fracs: function(e, i, n) {
  500. o(e, "string") || (n = i,
  501. i = e,
  502. e = null),
  503. E(i) || (n = i,
  504. i = null),
  505. n = l(n);
  506. var r = U + ".fracs." + T(n);
  507. return "unbind" === e ? this.each(function() {
  508. var e = y(this).data(r);
  509. e && e.unbind(i)
  510. }) : "check" === e ? this.each(function() {
  511. var e = y(this).data(r);
  512. e && e.check()
  513. }) : E(i) ? this.each(function() {
  514. var e = y(this)
  515. , t = e.data(r);
  516. t || (t = new f(this,n),
  517. e.data(r, t)),
  518. t.bind(i)
  519. }) : this.length ? h.of(this[0], n) : null
  520. },
  521. intersection: function() {
  522. return e(this, function(e) {
  523. var t = c.ofElement(this);
  524. return e ? e.intersection(t) : t
  525. })
  526. },
  527. max: function(e, t, i) {
  528. return E(t) || (i = t,
  529. t = null),
  530. i = l(i),
  531. t ? (new g(this,i,e,!0).bind(t),
  532. this) : this.pushStack(new r(this,i).best(e, !0).el)
  533. },
  534. min: function(e, t, i) {
  535. return E(t) || (i = t,
  536. t = null),
  537. i = l(i),
  538. t ? (new g(this,i,e).bind(t),
  539. this) : this.pushStack(new r(this,i).best(e).el)
  540. },
  541. rect: function() {
  542. return this.length ? c.ofElement(this[0]) : null
  543. },
  544. scrollState: function(e, i) {
  545. var n = U + ".scrollState";
  546. return o(e, "string") || (i = e,
  547. e = null),
  548. "unbind" === e ? this.each(function() {
  549. var e = y(this).data(n);
  550. e && e.unbind(i)
  551. }) : "check" === e ? this.each(function() {
  552. var e = y(this).data(n);
  553. e && e.check()
  554. }) : E(i) ? this.each(function() {
  555. var e = y(this)
  556. , t = e.data(n);
  557. t || (t = new m(this),
  558. e.data(n, t)),
  559. t.bind(i)
  560. }) : this.length ? new d(this[0]) : null
  561. },
  562. scroll: function(e, t, i) {
  563. return this.each(function() {
  564. new p(this).scroll(e, t, i)
  565. })
  566. },
  567. scrollTo: function(e, t, i, n) {
  568. return y.isNumeric(e) && (n = i,
  569. i = t,
  570. t = e,
  571. e = null),
  572. e = l(e),
  573. this.each(function() {
  574. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  575. })
  576. },
  577. scrollToThis: function(e, t, i, n) {
  578. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  579. this
  580. },
  581. softLink: function(t, i, n, r) {
  582. return r = new p(l(r)),
  583. this.filter("a[href^=#]").each(function() {
  584. var e = y(this);
  585. e.on("click", function() {
  586. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  587. })
  588. })
  589. },
  590. sort: function(e, t, i) {
  591. return o(t, "boolean") || (i = t,
  592. t = null),
  593. i = l(i),
  594. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  595. return e.el
  596. }))
  597. },
  598. viewport: function(e) {
  599. return this.length ? c.ofViewport(this[0], e) : null
  600. }
  601. },
  602. defaultStatic: "fracs",
  603. defaultMethod: "fracs"
  604. },
  605. O = [].slice,
  606. L = jQuery,
  607. D = L.extend,
  608. N = L.isFunction,
  609. F = D({}, P),
  610. B = function() {
  611. return H(this, O.call(arguments), F.defaultStatic, B)
  612. }
  613. ,
  614. V = function(e) {
  615. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  616. }
  617. ,
  618. (k = function(e) {
  619. e && (D(B, e.statics),
  620. D(V, e.methods)),
  621. B.modplug = k
  622. }
  623. ).prev = {
  624. statics: L[R],
  625. methods: L.fn[R]
  626. },
  627. k(P),
  628. L[R] = B,
  629. L.fn[R] = V
  630. }(),
  631. "undefined" == typeof jQuery)
  632. throw new Error("Bootstrap's JavaScript requires jQuery");
  633. !function(m) {
  634. "use strict";
  635. function r(e, t) {
  636. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  637. this.init("tooltip", e, t)
  638. }
  639. r.VERSION = "3.2.0",
  640. r.DEFAULTS = {
  641. animation: !0,
  642. placement: "top",
  643. selector: !1,
  644. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  645. trigger: "hover focus",
  646. title: "",
  647. delay: 0,
  648. html: !1,
  649. container: !1,
  650. viewport: {
  651. selector: "body",
  652. padding: 0
  653. }
  654. },
  655. r.prototype.init = function(e, t, i) {
  656. this.enabled = !0,
  657. this.type = e,
  658. this.$element = m(t),
  659. this.options = this.getOptions(i),
  660. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  661. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  662. var o = n[r];
  663. if ("click" == o)
  664. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  665. else if ("manual" != o) {
  666. var a = "hover" == o ? "mouseenter" : "focusin"
  667. , s = "hover" == o ? "mouseleave" : "focusout";
  668. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  669. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  670. }
  671. }
  672. this.options.selector ? this._options = m.extend({}, this.options, {
  673. trigger: "manual",
  674. selector: ""
  675. }) : this.fixTitle()
  676. }
  677. ,
  678. r.prototype.getDefaults = function() {
  679. return r.DEFAULTS
  680. }
  681. ,
  682. r.prototype.getOptions = function(e) {
  683. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  684. show: e.delay,
  685. hide: e.delay
  686. }),
  687. e
  688. }
  689. ,
  690. r.prototype.getDelegateOptions = function() {
  691. var i = {}
  692. , n = this.getDefaults();
  693. return this._options && m.each(this._options, function(e, t) {
  694. n[e] != t && (i[e] = t)
  695. }),
  696. i
  697. }
  698. ,
  699. r.prototype.enter = function(e) {
  700. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  701. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  702. m(e.currentTarget).data("bs." + this.type, t)),
  703. clearTimeout(t.timeout),
  704. t.hoverState = "in",
  705. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  706. }
  707. ,
  708. r.prototype.leave = function(e) {
  709. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  710. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  711. m(e.currentTarget).data("bs." + this.type, t)),
  712. clearTimeout(t.timeout),
  713. t.hoverState = "out",
  714. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  715. "out" == t.hoverState && t.hide()
  716. }, t.options.delay.hide)) : t.hide()
  717. }
  718. ,
  719. r.prototype.show = function() {
  720. var e = m.Event("show.bs." + this.type);
  721. if (this.hasContent() && this.enabled) {
  722. this.$element.trigger(e);
  723. var t = m.contains(document.documentElement, this.$element[0]);
  724. if (e.isDefaultPrevented() || !t)
  725. return;
  726. var i = this
  727. , n = this.tip()
  728. , r = this.getUID(this.type);
  729. this.setContent(),
  730. n.attr("id", r),
  731. this.$element.attr("aria-describedby", r),
  732. this.options.animation && n.addClass("fade");
  733. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  734. , a = /\s?auto?\s?/i
  735. , s = a.test(o);
  736. s && (o = o.replace(a, "") || "top"),
  737. n.detach().css({
  738. top: 0,
  739. left: 0,
  740. display: "block"
  741. }).addClass(o).data("bs." + this.type, this),
  742. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  743. var l = this.getPosition()
  744. , c = n[0].offsetWidth
  745. , h = n[0].offsetHeight;
  746. if (s) {
  747. var u = o
  748. , d = this.$element.parent()
  749. , p = this.getPosition(d);
  750. 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,
  751. n.removeClass(u).addClass(o)
  752. }
  753. var f = this.getCalculatedOffset(o, l, c, h);
  754. this.applyPlacement(f, o);
  755. var g = function() {
  756. i.$element.trigger("shown.bs." + i.type),
  757. i.hoverState = null
  758. };
  759. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  760. }
  761. }
  762. ,
  763. r.prototype.applyPlacement = function(e, t) {
  764. var i = this.tip()
  765. , n = i[0].offsetWidth
  766. , r = i[0].offsetHeight
  767. , o = parseInt(i.css("margin-top"), 10)
  768. , a = parseInt(i.css("margin-left"), 10);
  769. isNaN(o) && (o = 0),
  770. isNaN(a) && (a = 0),
  771. e.top = e.top + o,
  772. e.left = e.left + a,
  773. m.offset.setOffset(i[0], m.extend({
  774. using: function(e) {
  775. i.css({
  776. top: Math.round(e.top),
  777. left: Math.round(e.left)
  778. })
  779. }
  780. }, e), 0),
  781. i.addClass("in");
  782. var s = i[0].offsetWidth
  783. , l = i[0].offsetHeight;
  784. "top" == t && l != r && (e.top = e.top + r - l);
  785. var c = this.getViewportAdjustedDelta(t, e, s, l);
  786. c.left ? e.left += c.left : e.top += c.top;
  787. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  788. , u = c.left ? "left" : "top"
  789. , d = c.left ? "offsetWidth" : "offsetHeight";
  790. i.offset(e),
  791. this.replaceArrow(h, i[0][d], u)
  792. }
  793. ,
  794. r.prototype.replaceArrow = function(e, t, i) {
  795. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  796. }
  797. ,
  798. r.prototype.setContent = function() {
  799. var e = this.tip()
  800. , t = this.getTitle();
  801. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  802. e.removeClass("fade in top bottom left right")
  803. }
  804. ,
  805. r.prototype.hide = function() {
  806. function e() {
  807. "in" != t.hoverState && i.detach(),
  808. t.$element.trigger("hidden.bs." + t.type)
  809. }
  810. var t = this
  811. , i = this.tip()
  812. , n = m.Event("hide.bs." + this.type);
  813. if (this.$element.removeAttr("aria-describedby"),
  814. this.$element.trigger(n),
  815. !n.isDefaultPrevented())
  816. return i.removeClass("in"),
  817. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  818. this.hoverState = null,
  819. this
  820. }
  821. ,
  822. r.prototype.fixTitle = function() {
  823. var e = this.$element;
  824. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  825. }
  826. ,
  827. r.prototype.hasContent = function() {
  828. return this.getTitle()
  829. }
  830. ,
  831. r.prototype.getPosition = function(e) {
  832. var t = (e = e || this.$element)[0]
  833. , i = "BODY" == t.tagName;
  834. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  835. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  836. width: i ? m(window).width() : e.outerWidth(),
  837. height: i ? m(window).height() : e.outerHeight()
  838. }, i ? {
  839. top: 0,
  840. left: 0
  841. } : e.offset())
  842. }
  843. ,
  844. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  845. return "bottom" == e ? {
  846. top: t.top + t.height,
  847. left: t.left + t.width / 2 - i / 2
  848. } : "top" == e ? {
  849. top: t.top - n,
  850. left: t.left + t.width / 2 - i / 2
  851. } : "left" == e ? {
  852. top: t.top + t.height / 2 - n / 2,
  853. left: t.left - i
  854. } : {
  855. top: t.top + t.height / 2 - n / 2,
  856. left: t.left + t.width
  857. }
  858. }
  859. ,
  860. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  861. var r = {
  862. top: 0,
  863. left: 0
  864. };
  865. if (!this.$viewport)
  866. return r;
  867. var o = this.options.viewport && this.options.viewport.padding || 0
  868. , a = this.getPosition(this.$viewport);
  869. if (/right|left/.test(e)) {
  870. var s = t.top - o - a.scroll
  871. , l = t.top + o - a.scroll + n;
  872. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  873. } else {
  874. var c = t.left - o
  875. , h = t.left + o + i;
  876. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  877. }
  878. return r
  879. }
  880. ,
  881. r.prototype.getTitle = function() {
  882. var e = this.$element
  883. , t = this.options;
  884. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  885. }
  886. ,
  887. r.prototype.getUID = function(e) {
  888. for (; e += ~~(1e6 * Math.random()),
  889. document.getElementById(e); )
  890. ;
  891. return e
  892. }
  893. ,
  894. r.prototype.tip = function() {
  895. return this.$tip = this.$tip || m(this.options.template)
  896. }
  897. ,
  898. r.prototype.arrow = function() {
  899. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  900. }
  901. ,
  902. r.prototype.validate = function() {
  903. this.$element[0].parentNode || (this.hide(),
  904. this.$element = null,
  905. this.options = null)
  906. }
  907. ,
  908. r.prototype.enable = function() {
  909. this.enabled = !0
  910. }
  911. ,
  912. r.prototype.disable = function() {
  913. this.enabled = !1
  914. }
  915. ,
  916. r.prototype.toggleEnabled = function() {
  917. this.enabled = !this.enabled
  918. }
  919. ,
  920. r.prototype.toggle = function(e) {
  921. var t = this;
  922. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  923. m(e.currentTarget).data("bs." + this.type, t))),
  924. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  925. }
  926. ,
  927. r.prototype.destroy = function() {
  928. clearTimeout(this.timeout),
  929. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  930. }
  931. ;
  932. var e = m.fn.tooltip;
  933. m.fn.tooltip = function(n) {
  934. return this.each(function() {
  935. var e = m(this)
  936. , t = e.data("bs.tooltip")
  937. , i = "object" == typeof n && n;
  938. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  939. "string" == typeof n && t[n]())
  940. })
  941. }
  942. ,
  943. m.fn.tooltip.Constructor = r,
  944. m.fn.tooltip.noConflict = function() {
  945. return m.fn.tooltip = e,
  946. this
  947. }
  948. }(jQuery),
  949. function(e, t, i) {
  950. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  951. }(0, this, function() {
  952. "use strict";
  953. function Keen() {
  954. return _init.apply(this, arguments)
  955. }
  956. function _init(e) {
  957. if (_isUndefined(e))
  958. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  959. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  960. throw new Error("Please provide a projectId");
  961. this.configure(e)
  962. }
  963. function _extend(e) {
  964. for (var t = 1; t < arguments.length; t++)
  965. for (var i in arguments[t])
  966. e[i] = arguments[t][i];
  967. return e
  968. }
  969. function _isUndefined(e) {
  970. return void 0 === e
  971. }
  972. function _type(e) {
  973. var t = e && e.constructor ? e.constructor.toString() : void 0;
  974. return t ? t.match(/function (.*)\(/)[1] : "Null"
  975. }
  976. function _each(e, t, i) {
  977. var n;
  978. if (!e)
  979. return 0;
  980. if (i = i || e,
  981. "array" === _type(e)) {
  982. for (n = 0; n < e.length; n++)
  983. if (!1 === t.call(i, e[n], n, e))
  984. return 0
  985. } else
  986. for (n in e)
  987. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  988. return 0;
  989. return 1
  990. }
  991. function _parse_params(e) {
  992. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  993. return decodeURIComponent(e.replace(n, " "))
  994. }, a = e.split("?")[1]; t = r.exec(a); )
  995. i[o(t[1])] = o(t[2]);
  996. return i
  997. }
  998. function _set_protocol(e) {
  999. switch (e) {
  1000. case "http":
  1001. return "http";
  1002. case "auto":
  1003. return location.protocol.replace(/:/g, "");
  1004. case "https":
  1005. case void 0:
  1006. default:
  1007. return "https"
  1008. }
  1009. }
  1010. function _set_request_type(e) {
  1011. var t = e || "jsonp"
  1012. , i = !1;
  1013. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  1014. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  1015. }
  1016. function _build_url(e) {
  1017. return this.client.endpoint + "/projects/" + this.client.projectId + e
  1018. }
  1019. function _uploadEvent(e, t, i, n, r) {
  1020. var o = _build_url.apply(this, ["/events/" + e])
  1021. , a = {};
  1022. for (var s in i = !1 !== i,
  1023. this.client.globalProperties && (a = this.client.globalProperties(e)),
  1024. t)
  1025. t.hasOwnProperty(s) && (a[s] = t[s]);
  1026. switch (this.client.requestType) {
  1027. case "xhr":
  1028. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  1029. break;
  1030. case "jsonp":
  1031. var l = JSON.stringify(a)
  1032. , c = Keen.Base64.encode(l);
  1033. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  1034. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  1035. break;
  1036. case "beacon":
  1037. l = JSON.stringify(a),
  1038. c = Keen.Base64.encode(l);
  1039. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  1040. o += "&c=clv1",
  1041. _request.beacon.apply(this, [o, null, n, r])
  1042. }
  1043. }
  1044. Keen.prototype.configure = function(e) {
  1045. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  1046. e.protocol = _set_protocol(e.protocol),
  1047. e.requestType = _set_request_type(e.requestType),
  1048. this.client = {
  1049. projectId: e.projectId,
  1050. writeKey: e.writeKey,
  1051. readKey: e.readKey,
  1052. globalProperties: null,
  1053. endpoint: e.protocol + "://" + e.host,
  1054. requestType: e.requestType
  1055. },
  1056. Keen.trigger("client", this, e),
  1057. this.trigger("ready"),
  1058. this
  1059. }
  1060. ;
  1061. var _request = {
  1062. xhr: function(e, t, i, n, r, o, a, s) {
  1063. if (!r)
  1064. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1065. var l = new XMLHttpRequest;
  1066. if (l.onreadystatechange = function() {
  1067. if (4 == l.readyState)
  1068. if (200 <= l.status && l.status < 300) {
  1069. var e;
  1070. try {
  1071. e = JSON.parse(l.responseText)
  1072. } catch (e) {
  1073. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  1074. s && s(l, e)
  1075. }
  1076. a && e && a(e)
  1077. } else
  1078. Keen.log("HTTP request failed."),
  1079. s && s(l, null)
  1080. }
  1081. ,
  1082. l.open(e, t, o),
  1083. r && l.setRequestHeader("Authorization", r),
  1084. n && l.setRequestHeader("Content-Type", "application/json"),
  1085. i)
  1086. for (var c in i)
  1087. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  1088. var h = n ? JSON.stringify(n) : null;
  1089. l.send(h)
  1090. },
  1091. jsonp: function(e, t, i, n) {
  1092. if (!t)
  1093. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  1094. if (t && e.indexOf("api_key") < 0) {
  1095. var r = 0 < e.indexOf("?") ? "&" : "?";
  1096. e = e + r + "api_key=" + t
  1097. }
  1098. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  1099. o += "a";
  1100. var a = !1;
  1101. window[o] = function(e) {
  1102. a = !0,
  1103. i && e && i(e),
  1104. window[o] = void 0
  1105. }
  1106. ,
  1107. e = e + "&jsonp=" + o;
  1108. var s = document.createElement("script");
  1109. s.id = "keen-jsonp",
  1110. s.src = e,
  1111. document.getElementsByTagName("head")[0].appendChild(s),
  1112. s.onreadystatechange = function() {
  1113. !1 === a && "loaded" === this.readyState && (a = !0,
  1114. n && n())
  1115. }
  1116. ,
  1117. s.onerror = function() {
  1118. !1 === a && (a = !0,
  1119. n && n())
  1120. }
  1121. },
  1122. beacon: function(e, t, i, n) {
  1123. if (t && e.indexOf("api_key") < 0) {
  1124. var r = 0 < e.indexOf("?") ? "&" : "?";
  1125. e = e + r + "api_key=" + t
  1126. }
  1127. var o = document.createElement("img");
  1128. o.onload = function() {
  1129. if (!0,
  1130. "naturalHeight"in this) {
  1131. if (this.naturalHeight + this.naturalWidth === 0)
  1132. return void this.onerror()
  1133. } else if (this.width + this.height === 0)
  1134. return void this.onerror();
  1135. i && i({
  1136. created: !0
  1137. })
  1138. }
  1139. ,
  1140. o.onerror = function() {
  1141. !0,
  1142. n && n()
  1143. }
  1144. ,
  1145. o.src = e
  1146. }
  1147. }
  1148. , Events = Keen.Events = {
  1149. on: function(e, t) {
  1150. return this.listeners || (this.listeners = {}),
  1151. (this.listeners[e] || (this.listeners[e] = [])).push({
  1152. callback: t
  1153. }),
  1154. this
  1155. },
  1156. off: function(e, t) {
  1157. if (!e && !t)
  1158. return this.listeners = void 0,
  1159. delete this.listeners,
  1160. this;
  1161. for (var i = this.listeners[e] || [], n = i.length; n--; )
  1162. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  1163. t && 0 != i.length || (this.listeners[e] = void 0,
  1164. delete this.listeners[e]);
  1165. return this
  1166. },
  1167. trigger: function(e) {
  1168. if (!this.listeners)
  1169. return this;
  1170. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1171. i[n].callback.apply(this, t);
  1172. return this
  1173. }
  1174. };
  1175. _extend(Keen.prototype, Events),
  1176. _extend(Keen, Events),
  1177. Keen.loaded = !0,
  1178. Keen.utils = {
  1179. each: _each,
  1180. extend: _extend,
  1181. parseParams: _parse_params
  1182. },
  1183. Keen.ready = function(e) {
  1184. Keen.loaded ? e() : Keen.on("ready", e)
  1185. }
  1186. ,
  1187. Keen.log = function(e) {
  1188. "object" == typeof console && console.log("[Keen IO]", e)
  1189. }
  1190. ;
  1191. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1192. Keen.prototype.addEvent = function() {
  1193. _uploadEvent.apply(this, arguments)
  1194. }
  1195. ,
  1196. Keen.prototype.addEventSync = function(e, t, i, n) {
  1197. _uploadEvent.apply(this, [e, t, !1, i, n])
  1198. }
  1199. ,
  1200. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1201. var o = e
  1202. , a = o.metaKey
  1203. , s = o.target
  1204. , l = !1
  1205. , c = function() {};
  1206. return void 0 === n && (n = 500),
  1207. "A" === s.nodeName ? c = function() {
  1208. a || l || (l = !0,
  1209. window.location = s.href)
  1210. }
  1211. : "FORM" === s.nodeName && (c = function() {
  1212. l || (l = !0,
  1213. s.submit())
  1214. }
  1215. ),
  1216. r && (c = function() {
  1217. l || (l = !0,
  1218. r())
  1219. }
  1220. ),
  1221. _uploadEvent.call(this, t, i, c, c),
  1222. setTimeout(function() {
  1223. c()
  1224. }, n),
  1225. !!a && void 0
  1226. }
  1227. ,
  1228. Keen.prototype.setGlobalProperties = function(e) {
  1229. if (!this.client)
  1230. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1231. if (!e || "function" != typeof e)
  1232. throw new Error("Invalid value for global properties: " + e);
  1233. this.client.globalProperties = e
  1234. }
  1235. ,
  1236. Keen.Base64 = {
  1237. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1238. encode: function(e) {
  1239. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1240. for (e = this.utf8.encode(e); c < e.length; )
  1241. t = e.charCodeAt(c++),
  1242. i = e.charCodeAt(c++),
  1243. n = e.charCodeAt(c++),
  1244. r = t >> 2,
  1245. o = (3 & t) << 4 | i >> 4,
  1246. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1247. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1248. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1249. return l
  1250. },
  1251. decode: function(e) {
  1252. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1253. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1254. t = c.indexOf(e.charAt(l++)),
  1255. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1256. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1257. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1258. return this.utf8.decode(s)
  1259. },
  1260. utf8: {
  1261. encode: function(e) {
  1262. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1263. 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);
  1264. return i
  1265. },
  1266. decode: function(e) {
  1267. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1268. 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];
  1269. return i
  1270. }
  1271. }
  1272. },
  1273. "object" != typeof JSON && (JSON = {}),
  1274. function() {
  1275. function f(e) {
  1276. return e < 10 ? "0" + e : e
  1277. }
  1278. function quote(e) {
  1279. return escapable.lastIndex = 0,
  1280. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1281. var t = meta[e];
  1282. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1283. }) + '"' : '"' + e + '"'
  1284. }
  1285. function str(e, t) {
  1286. var i, n, r, o, a, s = gap, l = t[e];
  1287. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1288. "function" == typeof rep && (l = rep.call(t, e, l)),
  1289. typeof l) {
  1290. case "string":
  1291. return quote(l);
  1292. case "number":
  1293. return isFinite(l) ? String(l) : "null";
  1294. case "boolean":
  1295. case "null":
  1296. return String(l);
  1297. case "object":
  1298. if (!l)
  1299. return "null";
  1300. if (gap += indent,
  1301. a = [],
  1302. "[object Array]" === Object.prototype.toString.apply(l)) {
  1303. for (o = l.length,
  1304. i = 0; i < o; i += 1)
  1305. a[i] = str(i, l) || "null";
  1306. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1307. gap = s,
  1308. r
  1309. }
  1310. if (rep && "object" == typeof rep)
  1311. for (o = rep.length,
  1312. i = 0; i < o; i += 1)
  1313. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1314. else
  1315. for (n in l)
  1316. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1317. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1318. gap = s,
  1319. r
  1320. }
  1321. }
  1322. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1323. 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
  1324. }
  1325. ,
  1326. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1327. return this.valueOf()
  1328. }
  1329. );
  1330. 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 = {
  1331. "\b": "\\b",
  1332. "\t": "\\t",
  1333. "\n": "\\n",
  1334. "\f": "\\f",
  1335. "\r": "\\r",
  1336. '"': '\\"',
  1337. "\\": "\\\\"
  1338. }, rep;
  1339. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1340. var n;
  1341. if (indent = gap = "",
  1342. "number" == typeof i)
  1343. for (n = 0; n < i; n += 1)
  1344. indent += " ";
  1345. else
  1346. "string" == typeof i && (indent = i);
  1347. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1348. throw new Error("JSON.stringify");
  1349. return str("", {
  1350. "": e
  1351. })
  1352. }
  1353. ),
  1354. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1355. function walk(e, t) {
  1356. var i, n, r = e[t];
  1357. if (r && "object" == typeof r)
  1358. for (i in r)
  1359. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1360. return reviver.call(e, t, r)
  1361. }
  1362. var j;
  1363. if (text = String(text),
  1364. cx.lastIndex = 0,
  1365. cx.test(text) && (text = text.replace(cx, function(e) {
  1366. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1367. })),
  1368. /^[\],:{}\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, "")))
  1369. return j = eval("(" + text + ")"),
  1370. "function" == typeof reviver ? walk({
  1371. "": j
  1372. }, "") : j;
  1373. throw new SyntaxError("JSON.parse")
  1374. }
  1375. )
  1376. }(),
  1377. Hh = Keen.utils,
  1378. Ih = function(i) {
  1379. function e(e) {
  1380. for (u = 1; e = n.shift(); )
  1381. e()
  1382. }
  1383. 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]);
  1384. return r[l] && r[l](s, t = function() {
  1385. r.removeEventListener(s, t, !1),
  1386. e()
  1387. }
  1388. , !1),
  1389. a && r.attachEvent(c, t = function() {
  1390. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1391. e())
  1392. }
  1393. ),
  1394. i = a ? function(t) {
  1395. self != top ? u ? t() : n.push(t) : function() {
  1396. try {
  1397. o.doScroll("left")
  1398. } catch (e) {
  1399. return setTimeout(function() {
  1400. i(t)
  1401. }, 50)
  1402. }
  1403. t()
  1404. }()
  1405. }
  1406. : function(e) {
  1407. u ? e() : n.push(e)
  1408. }
  1409. }
  1410. ,
  1411. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1412. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1413. if (loaded && cached) {
  1414. for (var instance in clients = cached.clients || {},
  1415. ready = cached.ready || [],
  1416. clients)
  1417. if (clients.hasOwnProperty(instance)) {
  1418. var client = clients[instance];
  1419. for (var method in Keen.prototype)
  1420. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1421. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1422. ,
  1423. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1424. ,
  1425. client._config && (client.configure.call(client, client._config),
  1426. delete client._config),
  1427. client._setGlobalProperties) {
  1428. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1429. client.setGlobalProperties.apply(client, globals[i]);
  1430. delete client._setGlobalProperties
  1431. }
  1432. if (client._addEvent) {
  1433. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1434. client.addEvent.apply(client, queue[i]);
  1435. delete client._addEvent
  1436. }
  1437. var callback = client._on || [];
  1438. if (client._on) {
  1439. for (var i = 0; i < callback.length; i++)
  1440. client.on.apply(client, callback[i]);
  1441. client.trigger("ready"),
  1442. delete client._on
  1443. }
  1444. }
  1445. for (var i = 0; i < ready.length; i++) {
  1446. var callback = ready[i];
  1447. Keen.on("ready", function() {
  1448. callback()
  1449. })
  1450. }
  1451. }
  1452. return Keen.loaded && setTimeout(function() {
  1453. Keen.utils.domready(function() {
  1454. Keen.trigger("ready")
  1455. })
  1456. }, 0),
  1457. Keen
  1458. }),
  1459. function() {
  1460. var i = window.analytics = window.analytics || [];
  1461. if (!i.initialize) {
  1462. if (i.invoked)
  1463. return window.console && console.error && console.error("Segment snippet included twice.");
  1464. i.invoked = !0,
  1465. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1466. i.factory = function(t) {
  1467. return function() {
  1468. var e = Array.prototype.slice.call(arguments);
  1469. return e.unshift(t),
  1470. i.push(e),
  1471. i
  1472. }
  1473. }
  1474. ;
  1475. for (var e = 0; e < i.methods.length; e++) {
  1476. var t = i.methods[e];
  1477. i[t] = i.factory(t)
  1478. }
  1479. i.load = function(e) {
  1480. var t = document.createElement("script");
  1481. t.type = "text/javascript",
  1482. t.async = !0,
  1483. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1484. var i = document.getElementsByTagName("script")[0];
  1485. i.parentNode.insertBefore(t, i)
  1486. }
  1487. ,
  1488. i.SNIPPET_VERSION = "4.0.0"
  1489. }
  1490. }(),
  1491. function(i, u) {
  1492. "use strict";
  1493. var d = "function"
  1494. , p = "undefined"
  1495. , f = "object"
  1496. , e = "major"
  1497. , t = "model"
  1498. , n = "name"
  1499. , r = "type"
  1500. , o = "vendor"
  1501. , a = "version"
  1502. , s = "architecture"
  1503. , l = "console"
  1504. , c = "mobile"
  1505. , h = "tablet"
  1506. , g = {
  1507. has: function(e, t) {
  1508. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1509. },
  1510. lowerize: function(e) {
  1511. return e.toLowerCase()
  1512. }
  1513. }
  1514. , m = {
  1515. rgx: function() {
  1516. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1517. var c = l[s]
  1518. , h = l[s + 1];
  1519. if (typeof e == p)
  1520. for (n in e = {},
  1521. h)
  1522. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1523. for (t = i = 0; t < c.length; t++)
  1524. if (o = c[t].exec(this.getUA())) {
  1525. for (n = 0; n < h.length; n++)
  1526. a = o[++i],
  1527. 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;
  1528. break
  1529. }
  1530. if (o)
  1531. break
  1532. }
  1533. return e
  1534. },
  1535. str: function(e, t) {
  1536. for (var i in t)
  1537. if (typeof t[i] == f && 0 < t[i].length) {
  1538. for (var n = 0; n < t[i].length; n++)
  1539. if (g.has(t[i][n], e))
  1540. return "?" === i ? u : i
  1541. } else if (g.has(t[i], e))
  1542. return "?" === i ? u : i;
  1543. return e
  1544. }
  1545. }
  1546. , v = {
  1547. browser: {
  1548. oldsafari: {
  1549. major: {
  1550. 1: ["/8", "/1", "/3"],
  1551. 2: "/4",
  1552. "?": "/"
  1553. },
  1554. version: {
  1555. "1.0": "/8",
  1556. 1.2: "/1",
  1557. 1.3: "/3",
  1558. "2.0": "/412",
  1559. "2.0.2": "/416",
  1560. "2.0.3": "/417",
  1561. "2.0.4": "/419",
  1562. "?": "/"
  1563. }
  1564. }
  1565. },
  1566. device: {
  1567. sprint: {
  1568. model: {
  1569. "Evo Shift 4G": "7373KT"
  1570. },
  1571. vendor: {
  1572. HTC: "APA",
  1573. Sprint: "Sprint"
  1574. }
  1575. }
  1576. },
  1577. os: {
  1578. windows: {
  1579. version: {
  1580. ME: "4.90",
  1581. "NT 3.11": "NT3.51",
  1582. "NT 4.0": "NT4.0",
  1583. 2e3: "NT 5.0",
  1584. XP: ["NT 5.1", "NT 5.2"],
  1585. Vista: "NT 6.0",
  1586. 7: "NT 6.1",
  1587. 8: "NT 6.2",
  1588. 8.1: "NT 6.3",
  1589. RT: "ARM"
  1590. }
  1591. }
  1592. }
  1593. }
  1594. , y = {
  1595. 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]],
  1596. 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]],
  1597. 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]],
  1598. 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]],
  1599. 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]]
  1600. }
  1601. , A = function(e) {
  1602. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1603. return this instanceof A ? (this.getBrowser = function() {
  1604. return m.rgx.apply(this, y.browser)
  1605. }
  1606. ,
  1607. this.getCPU = function() {
  1608. return m.rgx.apply(this, y.cpu)
  1609. }
  1610. ,
  1611. this.getDevice = function() {
  1612. return m.rgx.apply(this, y.device)
  1613. }
  1614. ,
  1615. this.getEngine = function() {
  1616. return m.rgx.apply(this, y.engine)
  1617. }
  1618. ,
  1619. this.getOS = function() {
  1620. return m.rgx.apply(this, y.os)
  1621. }
  1622. ,
  1623. this.getResult = function() {
  1624. return {
  1625. ua: this.getUA(),
  1626. browser: this.getBrowser(),
  1627. engine: this.getEngine(),
  1628. os: this.getOS(),
  1629. device: this.getDevice(),
  1630. cpu: this.getCPU()
  1631. }
  1632. }
  1633. ,
  1634. this.getUA = function() {
  1635. return t
  1636. }
  1637. ,
  1638. this.setUA = function(e) {
  1639. return t = e,
  1640. this
  1641. }
  1642. ,
  1643. void this.setUA(t)) : new A(e).getResult()
  1644. };
  1645. if (typeof exports != p)
  1646. typeof module != p && module.exports && (exports = module.exports = A),
  1647. exports.UAParser = A;
  1648. else if (i.UAParser = A,
  1649. typeof define == d && define.amd && define(function() {
  1650. return A
  1651. }),
  1652. typeof i.jQuery != p) {
  1653. var C = i.jQuery
  1654. , I = new A;
  1655. C.ua = I.getResult(),
  1656. C.ua.get = function() {
  1657. return I.getUA()
  1658. }
  1659. ,
  1660. C.ua.set = function(e) {
  1661. I.setUA(e);
  1662. var t = I.getResult();
  1663. for (var i in t)
  1664. C.ua[i] = t[i]
  1665. }
  1666. }
  1667. }(this),
  1668. window.Modernizr = function(e, t) {
  1669. function i(e, t) {
  1670. return typeof e === t
  1671. }
  1672. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1673. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1674. return t in e && i(e.constructor.prototype[t], "undefined")
  1675. }
  1676. : function(e, t) {
  1677. return p.call(e, t)
  1678. }
  1679. ,
  1680. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1681. var r = this;
  1682. if ("function" != typeof r)
  1683. throw new TypeError;
  1684. var o = d.call(arguments, 1)
  1685. , a = function() {
  1686. if (this instanceof a) {
  1687. function e() {}
  1688. e.prototype = r.prototype;
  1689. var t = new e
  1690. , i = r.apply(t, o.concat(d.call(arguments)));
  1691. return Object(i) === i ? i : t
  1692. }
  1693. return r.apply(n, o.concat(d.call(arguments)))
  1694. };
  1695. return a
  1696. }
  1697. ),
  1698. h.webgl = function() {
  1699. return !!e.WebGLRenderingContext
  1700. }
  1701. ,
  1702. h)
  1703. r(h, f) && (n = f.toLowerCase(),
  1704. a[n] = h[f](),
  1705. u.push((a[n] ? "" : "no-") + n));
  1706. return a.addTest = function(e, t) {
  1707. if ("object" == typeof e)
  1708. for (var i in e)
  1709. r(e, i) && a.addTest(i, e[i]);
  1710. else {
  1711. if (e = e.toLowerCase(),
  1712. void 0 !== a[e])
  1713. return a;
  1714. t = "function" == typeof t ? t() : t,
  1715. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1716. a[e] = t
  1717. }
  1718. return a
  1719. }
  1720. ,
  1721. o = "",
  1722. c.cssText = o,
  1723. l = null,
  1724. a._version = "2.8.2",
  1725. a
  1726. }(this, this.document),
  1727. function(xe, e, Se) {
  1728. "use strict";
  1729. function Me(s, e, n) {
  1730. function a(e) {
  1731. var t = Q.length;
  1732. if (G.old = xe.extend({}, G),
  1733. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1734. Y = W[F.horizontal ? "width" : "height"](),
  1735. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1736. Q.length = 0,
  1737. G.start = 0,
  1738. G.end = nt(z - H, 0),
  1739. le) {
  1740. $.length,
  1741. J = U.children(F.itemSelector),
  1742. $.length = 0;
  1743. 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;
  1744. z = 0,
  1745. J.each(function(e, t) {
  1746. var i = xe(t)
  1747. , n = t.getBoundingClientRect()
  1748. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1749. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1750. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1751. , s = r + o + a
  1752. , l = !o || !a
  1753. , c = {};
  1754. c.el = t,
  1755. c.size = l ? r : s,
  1756. c.half = c.size / 2,
  1757. c.start = z + (l ? o : 0),
  1758. c.center = c.start - it(H / 2 - c.size / 2),
  1759. c.end = c.start - H + c.size,
  1760. e || (z += u),
  1761. z += s,
  1762. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1763. e === g && (c.end += d,
  1764. z += d,
  1765. f = l ? a : 0),
  1766. $.push(c),
  1767. h = c
  1768. }),
  1769. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1770. z -= f,
  1771. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1772. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1773. }
  1774. if (G.center = it(G.end / 2 + G.start / 2),
  1775. v(),
  1776. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1777. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1778. X.end = Y - q,
  1779. _e || c()),
  1780. !V && 0 < H) {
  1781. var n = G.start
  1782. , r = "";
  1783. if (le)
  1784. xe.each($, function(e, t) {
  1785. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1786. Q.push(n),
  1787. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1788. });
  1789. else
  1790. for (; n - H < G.end; )
  1791. Q.push(n),
  1792. n += H;
  1793. if (Z[0] && t !== Q.length) {
  1794. for (var o = 0; o < Q.length; o++)
  1795. r += F.pageBuilder.call(B, o);
  1796. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1797. }
  1798. }
  1799. if (ee.slideeSize = z,
  1800. ee.frameSize = H,
  1801. ee.sbSize = Y,
  1802. ee.handleSize = q,
  1803. le) {
  1804. e && null != F.startAt && (m(F.startAt),
  1805. B[se ? "toCenter" : "toStart"](F.startAt));
  1806. var a = $[ee.activeItem];
  1807. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1808. } else
  1809. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1810. L("load")
  1811. }
  1812. function l(e, t, i) {
  1813. if (le && Ie.released && !i) {
  1814. var n = d(e)
  1815. , r = e > G.start && e < G.end;
  1816. se ? (r && (e = $[n.centerItem].center),
  1817. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1818. }
  1819. 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),
  1820. Ae.start = +new Date,
  1821. Ae.time = 0,
  1822. Ae.from = G.cur,
  1823. Ae.to = e,
  1824. Ae.delta = e - G.cur,
  1825. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1826. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1827. Ie.tweese = 0,
  1828. e !== G.dest && (G.dest = e,
  1829. L("change"),
  1830. _e || o()),
  1831. g(),
  1832. v(),
  1833. p(),
  1834. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1835. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1836. L("activePage", ye.page))
  1837. }
  1838. function o() {
  1839. if (B.initialized) {
  1840. if (!_e)
  1841. return _e = Ge(o),
  1842. void (Ie.released && L("moveStart"));
  1843. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1844. $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),
  1845. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1846. Ae.to === G.cur ? (G.cur = Ae.to,
  1847. Ie.tweese = _e = 0) : _e = Ge(o),
  1848. L("move"),
  1849. 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"),
  1850. !_e && Ie.released && L("moveEnd"),
  1851. c()
  1852. }
  1853. }
  1854. function c() {
  1855. 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,
  1856. X.cur = Fe(it(X.cur), X.start, X.end),
  1857. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1858. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1859. }
  1860. function t() {
  1861. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1862. Te = Ie.init ? Ge(t) : 0,
  1863. Ce.now = +new Date,
  1864. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1865. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1866. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1867. Ce.lastTime = Ce.now
  1868. }
  1869. function i(e, t, i) {
  1870. if ("boolean" === Re(t) && (i = t,
  1871. t = Se),
  1872. t === Se)
  1873. l(G[e], i);
  1874. else {
  1875. if (se && "center" !== e)
  1876. return;
  1877. var n = B.getPos(t);
  1878. n && l(n[e], i, !se)
  1879. }
  1880. }
  1881. function h(e) {
  1882. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1883. }
  1884. function u(e) {
  1885. return h(De(e) && e < 0 ? e + $.length : e)
  1886. }
  1887. function m(e, t) {
  1888. var i = h(e);
  1889. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1890. J.eq(i).addClass(F.activeClass),
  1891. ye.active = ee.activeItem = i,
  1892. p(),
  1893. L("active", i)),
  1894. i)
  1895. }
  1896. function d(e) {
  1897. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1898. var t = {}
  1899. , i = ae ? 0 : H / 2;
  1900. if (!V)
  1901. for (var n = 0, r = Q.length; n < r; n++) {
  1902. if (e >= G.end || n === Q.length - 1) {
  1903. t.activePage = Q.length - 1;
  1904. break
  1905. }
  1906. if (e <= Q[n] + i) {
  1907. t.activePage = n;
  1908. break
  1909. }
  1910. }
  1911. if (le) {
  1912. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1913. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1914. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1915. l === c - 1 || e <= $[l].end + $[l].half) {
  1916. a = l;
  1917. break
  1918. }
  1919. t.firstItem = De(o) ? o : 0,
  1920. t.centerItem = De(s) ? s : t.firstItem,
  1921. t.lastItem = De(a) ? a : t.centerItem
  1922. }
  1923. return t
  1924. }
  1925. function v(e) {
  1926. xe.extend(ee, d(e))
  1927. }
  1928. function p() {
  1929. var e = G.dest <= G.start
  1930. , t = G.dest >= G.end
  1931. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1932. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1933. ge.is("button,input") && ge.prop("disabled", e),
  1934. me.is("button,input") && me.prop("disabled", t),
  1935. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1936. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1937. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1938. de.is("button,input") && de.prop("disabled", e),
  1939. ue.is("button,input") && ue.prop("disabled", t)),
  1940. le && null != ee.activeItem) {
  1941. var n = 0 === ee.activeItem
  1942. , r = ee.activeItem >= $.length - 1
  1943. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1944. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1945. pe.is("button,input") && pe.prop("disabled", n),
  1946. fe.is("button,input") && fe.prop("disabled", r),
  1947. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1948. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1949. }
  1950. }
  1951. function r(e, t, i) {
  1952. if (e = u(e),
  1953. t = u(t),
  1954. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1955. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1956. var n = e < t ? e : i ? t : t - 1
  1957. , r = t < e ? e : i ? t + 1 : t
  1958. , o = t < e;
  1959. 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)),
  1960. a()
  1961. }
  1962. }
  1963. function f(e, t) {
  1964. for (var i = 0, n = ve[e].length; i < n; i++)
  1965. if (ve[e][i] === t)
  1966. return i;
  1967. return -1
  1968. }
  1969. function g() {
  1970. Ie.released && !B.isPaused && B.resume()
  1971. }
  1972. function y(e) {
  1973. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1974. }
  1975. function A() {
  1976. Ie.history[0] = Ie.history[1],
  1977. Ie.history[1] = Ie.history[2],
  1978. Ie.history[2] = Ie.history[3],
  1979. Ie.history[3] = Ie.delta
  1980. }
  1981. function C(e) {
  1982. Ie.released = 0,
  1983. Ie.source = e,
  1984. Ie.slidee = "slidee" === e
  1985. }
  1986. function I(e) {
  1987. var t = "touchstart" === e.type
  1988. , i = e.data.source
  1989. , n = "slidee" === i;
  1990. 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),
  1991. C(i),
  1992. Ie.init = 0,
  1993. Ie.$source = xe(e.target),
  1994. Ie.touch = t,
  1995. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1996. Ie.initX = Ie.pointer.pageX,
  1997. Ie.initY = Ie.pointer.pageY,
  1998. Ie.initPos = n ? G.cur : X.cur,
  1999. Ie.start = +new Date,
  2000. Ie.time = 0,
  2001. Ie.path = 0,
  2002. Ie.delta = 0,
  2003. Ie.locked = 0,
  2004. Ie.history = [0, 0, 0, 0],
  2005. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  2006. We.on(t ? qe : Ye, E),
  2007. B.pause(1),
  2008. (n ? U : j).addClass(F.draggedClass),
  2009. L("moveStart"),
  2010. n && (be = setInterval(A, 10)))
  2011. }
  2012. function E(e) {
  2013. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  2014. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  2015. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  2016. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  2017. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  2018. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  2019. Ie.released || !(Ie.path < 1)) {
  2020. if (!Ie.init) {
  2021. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  2022. return _();
  2023. Ie.init = 1
  2024. }
  2025. Pe(e),
  2026. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  2027. Ie.$source.on(Ze, Oe)),
  2028. Ie.released && (_(),
  2029. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  2030. Ie.delta += Ie.swing,
  2031. Ie.tweese = 10 < $e(Ie.swing))),
  2032. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  2033. }
  2034. }
  2035. function _() {
  2036. clearInterval(be),
  2037. Ie.released = !0,
  2038. We.off(Ie.touch ? qe : Ye, E),
  2039. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  2040. setTimeout(function() {
  2041. Ie.$source.off(Ze, Oe)
  2042. }),
  2043. G.cur === G.dest && Ie.init && L("moveEnd"),
  2044. B.resume(1),
  2045. Ie.init = 0
  2046. }
  2047. function b(e) {
  2048. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  2049. }
  2050. function w() {
  2051. B.stop(),
  2052. We.off("mouseup", w)
  2053. }
  2054. function T(e) {
  2055. switch (Pe(e),
  2056. this) {
  2057. case ue[0]:
  2058. case de[0]:
  2059. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  2060. We.on("mouseup", w);
  2061. break;
  2062. case pe[0]:
  2063. B.prev();
  2064. break;
  2065. case fe[0]:
  2066. B.next();
  2067. break;
  2068. case ge[0]:
  2069. B.prevPage();
  2070. break;
  2071. case me[0]:
  2072. B.nextPage()
  2073. }
  2074. }
  2075. function x(e) {
  2076. e.originalEvent[He] = B;
  2077. var t = +new Date;
  2078. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  2079. ot = t;
  2080. else if (F.scrollBy && G.start !== G.end) {
  2081. var i = function(e) {
  2082. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  2083. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  2084. le ? (Ue = +new Date,
  2085. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  2086. Ee.last = Ue,
  2087. Ee.delta += Ee.curDelta,
  2088. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  2089. Ee.delta %= 1),
  2090. Ee.finalDelta) : Ee.curDelta
  2091. }(e.originalEvent);
  2092. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  2093. B.slideBy(F.scrollBy * i)
  2094. }
  2095. }
  2096. function S(e) {
  2097. F.clickBar && e.target === W[0] && (Pe(e),
  2098. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  2099. }
  2100. function M(e) {
  2101. if (F.keyboardNavBy)
  2102. switch (e.which) {
  2103. case F.horizontal ? 37 : 38:
  2104. Pe(e),
  2105. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  2106. break;
  2107. case F.horizontal ? 39 : 40:
  2108. Pe(e),
  2109. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  2110. }
  2111. }
  2112. function R(e) {
  2113. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  2114. }
  2115. function P() {
  2116. this.parentNode === Z[0] && B.activatePage(K.index(this))
  2117. }
  2118. function O(e) {
  2119. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  2120. }
  2121. function L(e, t) {
  2122. if (ve[e]) {
  2123. for (N = ve[e].length,
  2124. Je.length = 0,
  2125. D = 0; D < N; D++)
  2126. Je.push(ve[e][D]);
  2127. for (D = 0; D < N; D++)
  2128. Je[D].call(B, e, t)
  2129. }
  2130. }
  2131. 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 = {
  2132. start: 0,
  2133. center: 0,
  2134. end: 0,
  2135. cur: 0,
  2136. dest: 0
  2137. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  2138. start: 0,
  2139. end: 0,
  2140. cur: 0
  2141. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  2142. firstItem: 0,
  2143. lastItem: 0,
  2144. centerItem: 0,
  2145. activeItem: null,
  2146. activePage: 0
  2147. }, 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 = {
  2148. released: 1
  2149. }, Ee = {
  2150. last: 0,
  2151. delta: 0,
  2152. resetTime: 200
  2153. }, _e = 0, be = 0, we = 0, Te = 0;
  2154. V || (s = k[0]),
  2155. B.initialized = 0,
  2156. B.frame = s,
  2157. B.slidee = U[0],
  2158. B.pos = G,
  2159. B.rel = ee,
  2160. B.items = $,
  2161. B.pages = Q,
  2162. B.isPaused = 0,
  2163. B.options = F,
  2164. B.dragging = Ie,
  2165. B.reload = function() {
  2166. a()
  2167. }
  2168. ,
  2169. B.getPos = function(e) {
  2170. if (le) {
  2171. var t = h(e);
  2172. return -1 !== t && $[t]
  2173. }
  2174. var i = U.find(e).eq(0);
  2175. if (i[0]) {
  2176. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2177. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2178. return {
  2179. start: n,
  2180. center: n - H / 2 + r / 2,
  2181. end: n - H + r,
  2182. size: r
  2183. }
  2184. }
  2185. return !1
  2186. }
  2187. ,
  2188. B.moveBy = function(e) {
  2189. Ce.speed = e,
  2190. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2191. Ce.startPos = G.cur,
  2192. C("button"),
  2193. Ie.init = 1,
  2194. L("moveStart"),
  2195. ze(Te),
  2196. t())
  2197. }
  2198. ,
  2199. B.stop = function() {
  2200. "button" === Ie.source && (Ie.init = 0,
  2201. Ie.released = 1)
  2202. }
  2203. ,
  2204. B.prev = function() {
  2205. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2206. }
  2207. ,
  2208. B.next = function() {
  2209. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2210. }
  2211. ,
  2212. B.prevPage = function() {
  2213. B.activatePage(ee.activePage - 1)
  2214. }
  2215. ,
  2216. B.nextPage = function() {
  2217. B.activatePage(ee.activePage + 1)
  2218. }
  2219. ,
  2220. B.slideBy = function(e, t) {
  2221. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2222. }
  2223. ,
  2224. B.slideTo = function(e, t) {
  2225. l(e, t)
  2226. }
  2227. ,
  2228. B.toStart = function(e, t) {
  2229. i("start", e, t)
  2230. }
  2231. ,
  2232. B.toEnd = function(e, t) {
  2233. i("end", e, t)
  2234. }
  2235. ,
  2236. B.toCenter = function(e, t) {
  2237. i("center", e, t)
  2238. }
  2239. ,
  2240. B.getIndex = h,
  2241. B.activate = function(e, t) {
  2242. var i = m(e);
  2243. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2244. }
  2245. ,
  2246. B.activatePage = function(e, t) {
  2247. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2248. }
  2249. ,
  2250. B.resume = function(e) {
  2251. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2252. we ? we = clearTimeout(we) : L("resume"),
  2253. we = setTimeout(function() {
  2254. switch (L("cycle"),
  2255. F.cycleBy) {
  2256. case "items":
  2257. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2258. break;
  2259. case "pages":
  2260. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2261. }
  2262. }, F.cycleInterval))
  2263. }
  2264. ,
  2265. B.pause = function(e) {
  2266. e < B.isPaused || (B.isPaused = e || 100,
  2267. we && (we = clearTimeout(we),
  2268. L("pause")))
  2269. }
  2270. ,
  2271. B.toggle = function() {
  2272. B[we ? "pause" : "resume"]()
  2273. }
  2274. ,
  2275. B.set = function(e, t) {
  2276. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2277. }
  2278. ,
  2279. B.add = function(e, t) {
  2280. var i = xe(e);
  2281. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2282. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2283. a()
  2284. }
  2285. ,
  2286. B.remove = function(e) {
  2287. if (le) {
  2288. var t = u(e);
  2289. if (-1 < t) {
  2290. J.eq(t).remove();
  2291. var i = t === ee.activeItem;
  2292. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2293. a(),
  2294. i && (ye.active = null,
  2295. B.activate(ee.activeItem))
  2296. }
  2297. } else
  2298. xe(e).remove(),
  2299. a()
  2300. }
  2301. ,
  2302. B.moveAfter = function(e, t) {
  2303. r(e, t, 1)
  2304. }
  2305. ,
  2306. B.moveBefore = function(e, t) {
  2307. r(e, t)
  2308. }
  2309. ,
  2310. B.on = function(e, t) {
  2311. if ("object" === Re(e))
  2312. for (var i in e)
  2313. e.hasOwnProperty(i) && B.on(i, e[i]);
  2314. else if ("function" === Re(t))
  2315. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2316. ve[n[r]] = ve[n[r]] || [],
  2317. -1 === f(n[r], t) && ve[n[r]].push(t);
  2318. else if ("array" === Re(t))
  2319. for (var a = 0, s = t.length; a < s; a++)
  2320. B.on(e, t[a])
  2321. }
  2322. ,
  2323. B.one = function(t, i) {
  2324. B.on(t, function e() {
  2325. i.apply(B, arguments),
  2326. B.off(t, e)
  2327. })
  2328. }
  2329. ,
  2330. B.off = function(e, t) {
  2331. if (t instanceof Array)
  2332. for (var i = 0, n = t.length; i < n; i++)
  2333. B.off(e, t[i]);
  2334. else
  2335. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2336. if (ve[r[o]] = ve[r[o]] || [],
  2337. null == t)
  2338. ve[r[o]].length = 0;
  2339. else {
  2340. var s = f(r[o], t);
  2341. -1 !== s && ve[r[o]].splice(s, 1)
  2342. }
  2343. }
  2344. ,
  2345. B.destroy = function() {
  2346. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2347. We.off("keydown", M),
  2348. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2349. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2350. Z.empty(),
  2351. V || (k.off("." + He),
  2352. te.restore(),
  2353. ie.restore(),
  2354. ne.restore(),
  2355. re.restore(),
  2356. xe.removeData(s, He)),
  2357. $.length = Q.length = 0,
  2358. ye = {},
  2359. B.initialized = 0,
  2360. B
  2361. }
  2362. ,
  2363. B.init = function() {
  2364. if (!B.initialized) {
  2365. B.on(n);
  2366. var e = ["overflow", "position"]
  2367. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2368. te.save.apply(te, e),
  2369. ne.save.apply(ne, e),
  2370. ie.save.apply(ie, t),
  2371. re.save.apply(re, t);
  2372. var i = j;
  2373. return V || (i = i.add(U),
  2374. k.css("overflow", "hidden"),
  2375. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2376. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2377. i.css({
  2378. position: "absolute"
  2379. })),
  2380. F.forward && ue.on(Ke, T),
  2381. F.backward && de.on(Ke, T),
  2382. F.prev && pe.on(Ze, T),
  2383. F.next && fe.on(Ze, T),
  2384. F.prevPage && ge.on(Ze, T),
  2385. F.nextPage && me.on(Ze, T),
  2386. ce.on(Xe, x),
  2387. W[0] && W.on(Ze, S),
  2388. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2389. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2390. he.on(je, {
  2391. source: "slidee"
  2392. }, I),
  2393. j && j.on(je, {
  2394. source: "handle"
  2395. }, I),
  2396. We.on("keydown", M),
  2397. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2398. k.on("scroll." + He, Le)),
  2399. B.initialized = 1,
  2400. a(!0),
  2401. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2402. B
  2403. }
  2404. }
  2405. }
  2406. function Re(e) {
  2407. 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
  2408. }
  2409. function Pe(e, t) {
  2410. e.preventDefault(),
  2411. t && e.stopPropagation()
  2412. }
  2413. function Oe(e) {
  2414. Pe(e, 1),
  2415. xe(this).off(e.type, Oe)
  2416. }
  2417. function Le() {
  2418. this.scrollLeft = 0,
  2419. this.scrollTop = 0
  2420. }
  2421. function De(e) {
  2422. return !isNaN(parseFloat(e)) && isFinite(e)
  2423. }
  2424. function Ne(e, t) {
  2425. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2426. }
  2427. function Fe(e, t, i) {
  2428. return e < t ? t : i < e ? i : e
  2429. }
  2430. function Be(t) {
  2431. var i = {
  2432. style: {},
  2433. save: function() {
  2434. if (t && t.nodeType) {
  2435. for (var e = 0; e < arguments.length; e++)
  2436. i.style[arguments[e]] = t.style[arguments[e]];
  2437. return i
  2438. }
  2439. },
  2440. restore: function() {
  2441. if (t && t.nodeType) {
  2442. for (var e in i.style)
  2443. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2444. return i
  2445. }
  2446. }
  2447. };
  2448. return i
  2449. }
  2450. 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;
  2451. function t(e) {
  2452. for (var t = 0, i = r.length; t < i; t++) {
  2453. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2454. if (null != o.style[n])
  2455. return n
  2456. }
  2457. }
  2458. We.on(Xe, function(e) {
  2459. var t = e.originalEvent[He]
  2460. , i = +new Date;
  2461. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2462. }),
  2463. function(t) {
  2464. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2465. var t = (new Date).getTime()
  2466. , i = Math.max(0, 16 - (t - r))
  2467. , n = setTimeout(e, i);
  2468. return r = t,
  2469. n
  2470. }
  2471. ;
  2472. var r = (new Date).getTime()
  2473. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2474. ze = function(e) {
  2475. i.call(t, e)
  2476. }
  2477. }(window),
  2478. r = ["", "webkit", "moz", "ms", "o"],
  2479. o = document.createElement("div"),
  2480. Ve = t("transform"),
  2481. ke = t("perspective") ? "translateZ(0) " : "",
  2482. e.Sly = Me,
  2483. xe.fn.sly = function(n, r) {
  2484. var o, a;
  2485. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2486. a = Array.prototype.slice.call(arguments, 1)),
  2487. n = {}),
  2488. this.each(function(e, t) {
  2489. var i = xe.data(t, He);
  2490. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2491. })
  2492. }
  2493. ,
  2494. Me.defaults = {
  2495. slidee: null,
  2496. horizontal: !1,
  2497. itemNav: null,
  2498. itemSelector: null,
  2499. smart: !1,
  2500. activateOn: null,
  2501. activateMiddle: !1,
  2502. scrollSource: null,
  2503. scrollBy: 0,
  2504. scrollHijack: 300,
  2505. scrollTrap: !1,
  2506. dragSource: null,
  2507. mouseDragging: !1,
  2508. touchDragging: !1,
  2509. releaseSwing: !1,
  2510. swingSpeed: .2,
  2511. elasticBounds: !1,
  2512. interactive: null,
  2513. scrollBar: null,
  2514. dragHandle: !1,
  2515. dynamicHandle: !1,
  2516. minHandleSize: 50,
  2517. clickBar: !1,
  2518. syncSpeed: .5,
  2519. pagesBar: null,
  2520. activatePageOn: null,
  2521. pageBuilder: function(e) {
  2522. return "<li>" + (e + 1) + "</li>"
  2523. },
  2524. forward: null,
  2525. backward: null,
  2526. prev: null,
  2527. next: null,
  2528. prevPage: null,
  2529. nextPage: null,
  2530. cycleBy: null,
  2531. cycleInterval: 5e3,
  2532. pauseOnHover: !1,
  2533. startPaused: !1,
  2534. moveBy: 300,
  2535. speed: 0,
  2536. easing: "swing",
  2537. startAt: null,
  2538. keyboardNavBy: null,
  2539. draggedClass: "dragged",
  2540. activeClass: "active",
  2541. disabledClass: "disabled"
  2542. }
  2543. }(jQuery, window),
  2544. function o(a, s, l) {
  2545. function c(i, e) {
  2546. if (!s[i]) {
  2547. if (!a[i]) {
  2548. var t = "function" == typeof require && require;
  2549. if (!e && t)
  2550. return t(i, !0);
  2551. if (h)
  2552. return h(i, !0);
  2553. var n = new Error("Cannot find module '" + i + "'");
  2554. throw n.code = "MODULE_NOT_FOUND",
  2555. n
  2556. }
  2557. var r = s[i] = {
  2558. exports: {}
  2559. };
  2560. a[i][0].call(r.exports, function(e) {
  2561. var t = a[i][1][e];
  2562. return c(t || e)
  2563. }, r, r.exports, o, a, s, l)
  2564. }
  2565. return s[i].exports
  2566. }
  2567. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2568. c(l[e]);
  2569. return c
  2570. }({
  2571. 1: [function(p, f, e) {
  2572. (function(e) {
  2573. "use strict";
  2574. function t(e) {
  2575. this.player = null,
  2576. this.director = null,
  2577. this.modelManager = null,
  2578. this.container = null,
  2579. this.tagManager = null,
  2580. this.fadeInSpeed = e,
  2581. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2582. }
  2583. var r = p("three")
  2584. , i = p("./util/logger")
  2585. , n = (p("./util/common"),
  2586. p("./enum/PlayerEvents"))
  2587. , o = p("./enum/DirectorEvents")
  2588. , a = p("./settings")
  2589. , s = p("./enum/Viewmode")
  2590. , l = (p("./enum/WarpStyle"),
  2591. p("./enum/BlackoutStyle"),
  2592. p("./enum/ModelManagerEvents"))
  2593. , c = p("./enum/tagEvents")
  2594. , h = p("./util/transitions")
  2595. , u = p("./util/lerp")
  2596. , d = new i(e);
  2597. t.prototype.init = function(e, t, i, n, r) {
  2598. (window.app = this).player = t,
  2599. this.director = e,
  2600. this.modelManager = i,
  2601. this.tagManager = n,
  2602. this.container = r,
  2603. this.updateModel(),
  2604. this.bindEvents()
  2605. }
  2606. ,
  2607. t.prototype.bindEvents = function() {
  2608. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2609. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2610. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2611. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2612. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2613. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2614. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2615. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2616. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2617. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2618. }
  2619. ,
  2620. t.prototype.updateModel = function() {
  2621. this.model = this.modelManager.getActiveModel()
  2622. }
  2623. ,
  2624. t.prototype.handleWarpStarted = function() {
  2625. this.hidePlayerReticule()
  2626. }
  2627. ,
  2628. t.prototype.ontagActivated = function() {
  2629. this.hidePlayerReticule()
  2630. }
  2631. ,
  2632. t.prototype.onNavigationTotag = function() {
  2633. this.hidePlayerReticule()
  2634. }
  2635. ,
  2636. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2637. var n = this.modelManager.getActiveModel()
  2638. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2639. n.fadePanoMarkers(r),
  2640. n.setMode(t)
  2641. }
  2642. ,
  2643. t.prototype.handlePlayerModeChanged = function(e, t) {
  2644. var i = this.modelManager.getActiveModel()
  2645. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2646. i.setSide(n),
  2647. i.setMode(t)
  2648. }
  2649. ,
  2650. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2651. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2652. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2653. }
  2654. ,
  2655. t.prototype.handleActionInterruption = function() {}
  2656. ,
  2657. t.prototype.handleStartInside = function(e) {
  2658. var t = a[this.player.mode]
  2659. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2660. this.fadeIn(this.fadeInSpeed),
  2661. this.model.alpha = 0,
  2662. this.model.skybox.material.uniforms.opacity.value = 1,
  2663. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2664. var n = this.player.reticule;
  2665. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2666. }
  2667. ,
  2668. t.prototype.handleStartOutside = function(e) {
  2669. this.fadeIn(e)
  2670. }
  2671. ,
  2672. t.prototype.fadeIn = function(e) {
  2673. null != e || (e = 2e3,
  2674. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2675. $(this.container).fadeIn(e)
  2676. }
  2677. ,
  2678. t.prototype.hidePlayerReticule = function() {
  2679. this.player.reticule.hide()
  2680. }
  2681. ,
  2682. f.exports = t
  2683. }
  2684. ).call(this, "/js/DisplayController.js")
  2685. }
  2686. , {
  2687. "./enum/BlackoutStyle": 18,
  2688. "./enum/DirectorEvents": 23,
  2689. "./enum/tagEvents": 32,
  2690. "./enum/ModelManagerEvents": 33,
  2691. "./enum/PlayerEvents": 40,
  2692. "./enum/Viewmode": 51,
  2693. "./enum/WarpStyle": 52,
  2694. "./settings": 166,
  2695. "./util/common": 185,
  2696. "./util/lerp": 188,
  2697. "./util/logger": 189,
  2698. "./util/transitions": 195,
  2699. three: 217
  2700. }],
  2701. 2: [function(e, t, i) {
  2702. "use strict";
  2703. function n() {
  2704. this.baseStartTime = performance.timing.navigationStart,
  2705. this.loadingStartTime = null,
  2706. this.waitingStartTime = null,
  2707. this.appReadyTime = null
  2708. }
  2709. n.prototype.setBaseStartTime = function(e) {
  2710. this.baseStartTime = e || Date.now()
  2711. }
  2712. ,
  2713. n.prototype.setWaitingStartTime = function(e) {
  2714. this.waitingStartTime = e || Date.now()
  2715. }
  2716. ,
  2717. n.prototype.setLoadingStartTime = function(e) {
  2718. this.loadingStartTime = e || Date.now()
  2719. }
  2720. ,
  2721. n.prototype.setAppReadyTime = function(e) {
  2722. this.appReadyTime = e || Date.now()
  2723. }
  2724. ,
  2725. n.prototype.calcFullLoadingTime = function() {
  2726. var e = this.appReadyTime - this.baseStartTime;
  2727. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2728. e
  2729. }
  2730. ,
  2731. t.exports = n
  2732. }
  2733. , {}],
  2734. 3: [function(i, n, e) {
  2735. (function(e) {
  2736. "use strict";
  2737. function a() {
  2738. return 100 * Math.random()
  2739. }
  2740. var t = i("./util/logger")
  2741. , s = i("./util/browser")
  2742. , l = new t(e)
  2743. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2744. initialized: !1,
  2745. init: function(e, t) {
  2746. if (t = t || {},
  2747. !this.initialized) {
  2748. for (var i in this.initialized = !0,
  2749. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2750. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2751. e) {
  2752. var n = i.match("^sc_tilegen_([0-9]+)$");
  2753. n && (c.tilegen = a() < parseInt(n[1]));
  2754. var r = i.match("^sc_imgopt_([0-9]+)$");
  2755. r && (c.imgopt = a() < parseInt(r[1]))
  2756. }
  2757. for (var o in t)
  2758. c[o] = t[o],
  2759. l.debug("A/B override:", o, c[o])
  2760. }
  2761. },
  2762. changeIfTileGenerating: function(e) {
  2763. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2764. e += ""),
  2765. e
  2766. },
  2767. changeIfImageOptimzing: function(e) {
  2768. if(e.includes("blob:http"))return e;//add
  2769. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2770. e += ""),
  2771. e
  2772. },
  2773. tilegen: !1,
  2774. imgopt: !1
  2775. };
  2776. n.exports = c
  2777. }
  2778. ).call(this, "/js/ab.js")
  2779. }
  2780. , {
  2781. "./util/browser": 182,
  2782. "./util/logger": 189
  2783. }],
  2784. 4: [function(u, d, e) {
  2785. (function(e) {
  2786. "use strict";
  2787. function r(n, e, t, i) {
  2788. function r(e) {
  2789. a[e.sid] = !0;
  2790. var t = e.billboard.media && e.billboard.media.type
  2791. , i = {
  2792. tag_id: e.sid,
  2793. tags_visited: Object.keys(a).length,
  2794. tag_count: Object.keys(n.tags).length,
  2795. tag_view_count: ++d,
  2796. has_media: !!t
  2797. };
  2798. t && (i.media_type = t),
  2799. g("tag_opened", i)
  2800. }
  2801. var o, a = {}, s = Date.now() - P, l = null;
  2802. i && (l = Date.now() - window.navigationStart);
  2803. try {
  2804. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2805. } catch (n) {
  2806. o = !1
  2807. }
  2808. var c, h = n.supportsVR;
  2809. h || (c = "VR disabled at the model/account level",
  2810. 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"))),
  2811. g("model_loaded", {
  2812. duration: s,
  2813. duration_from_navigation_start: l,
  2814. has_hlr: o,
  2815. has_vr: h,
  2816. vr_reason: c
  2817. });
  2818. var u = 0;
  2819. n.panos.forEach(function(e) {
  2820. e.on("enter", function() {
  2821. f("pano_viewed", {
  2822. pano_id: e.id,
  2823. pano_view_count: ++u,
  2824. alignment_type: e.alignmentType,
  2825. interaction_source: R,
  2826. navigation_source: v
  2827. })
  2828. })
  2829. });
  2830. var d = 0;
  2831. for (var p in n.tags)
  2832. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2833. e.on("tour_auto", function(e) {
  2834. v = "tour_" + e
  2835. }),
  2836. e.on("tour_manual", function(e) {
  2837. R = "gui-" + e,
  2838. v = "tour_manual"
  2839. }),
  2840. t.on(C.InteractionKey, function() {
  2841. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2842. }),
  2843. t.on(C.InteractionDirect, function() {
  2844. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2845. }),
  2846. function(t) {
  2847. I.on(T.OPENED, function() {
  2848. f("showcase_share_intent", {
  2849. pano_id: t.currentPano && t.currentPano.id
  2850. })
  2851. }),
  2852. I.on(T.LINK_CLICKED, function(e) {
  2853. f("showcase_share_action", {
  2854. channel: e.channel,
  2855. pano_id: t.currentPano && t.currentPano.id
  2856. })
  2857. }),
  2858. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2859. f("showcase_share_origin_link_clicked")
  2860. })
  2861. }(e),
  2862. function() {
  2863. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2864. gui_action: "click_vr_button"
  2865. })),
  2866. _.on(S.LAUNCH, function(e) {
  2867. f("showcase_gui", {
  2868. gui_action: "launch_vr",
  2869. vr_platform: e.vr_platform,
  2870. vr_app: e.vr_app
  2871. })
  2872. }),
  2873. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2874. gui_action: "vr_modal_prev"
  2875. })),
  2876. _.on(S.NEXT, function(e) {
  2877. f("showcase_gui", {
  2878. gui_action: e.nextAction
  2879. })
  2880. }),
  2881. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2882. gui_action: "vr_modal_close"
  2883. })),
  2884. _.on(S.falseICECHOSEN, function(e) {
  2885. f("showcase_gui", {
  2886. gui_action: e.name + " "
  2887. })
  2888. }),
  2889. _.on(S.STORE, function(e) {
  2890. f("showcase_gui", {
  2891. gui_action: "launch_store",
  2892. store: e
  2893. })
  2894. })
  2895. }()
  2896. }
  2897. function f(e, t) {
  2898. if (t = t || {},
  2899. i)
  2900. try {
  2901. window.analytics.track(e, s.extendObject(t, c), {
  2902. context: {
  2903. app: {
  2904. name: "showcase",
  2905. version: "2.25.6-0-gd87e5b1"
  2906. },
  2907. screen: {
  2908. width: window.screen.width,
  2909. height: window.screen.height,
  2910. density: window.devicePixelRatio
  2911. }
  2912. }
  2913. })
  2914. } catch (t) {
  2915. console.warn("Failed to send data to segment for " + e)
  2916. }
  2917. }
  2918. function g(e, t) {
  2919. f(e, t = t || {})
  2920. }
  2921. function m(e, t) {
  2922. R = e === C.InteractionGui ? "gui-" + t : e,
  2923. v = "self_guided"
  2924. }
  2925. var v, o, a = (u("three"),
  2926. u("./util/ajax"),
  2927. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2928. 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"),
  2929. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2930. d.exports = {
  2931. report: function(e, t, i, n) {
  2932. !function(e, t) {
  2933. if (o)
  2934. try {
  2935. o.addEvent(e, s.extendObject({
  2936. host: window.location.host,
  2937. keen: {
  2938. addons: [{
  2939. name: "keen:ua_parser",
  2940. input: {
  2941. ua_string: "user_agent"
  2942. },
  2943. output: "parsed_user_agent"
  2944. }]
  2945. },
  2946. user_agent: "${keen.user_agent}",
  2947. referrer: {
  2948. url: s.normalizeUrl(document.referrer),
  2949. domain: s.domainFromUrl(document.referrer),
  2950. url_original: document.referrer
  2951. },
  2952. embedded: y.inIframe(),
  2953. is_mobile: y.isMobile(),
  2954. version: "2.25.6-0-gd87e5b1"
  2955. }, t))
  2956. } catch (e) {
  2957. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2958. }
  2959. }("Session starts", {
  2960. model: e,
  2961. status: t,
  2962. loadtime: Date.now() - (P || Date.now()),
  2963. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2964. autoplay: i,
  2965. quickstart: n,
  2966. ab_tilegen: a.tilegen,
  2967. ab_imgopt: a.imgopt
  2968. })
  2969. },
  2970. impression: function(e) {
  2971. g("impression", {
  2972. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2973. url_params: (void 0 !== e.immediate && e.immediate,
  2974. window.location.search.substr(1).split("&"))
  2975. })
  2976. },
  2977. initKeen: function(e) {
  2978. return e.token && e.appId ? void (o = new Keen({
  2979. projectId: e.appId,
  2980. writeKey: e.token,
  2981. readKey: "",
  2982. requestType: "xhr"
  2983. })) : void l.warn("no keen token/appId")
  2984. },
  2985. initSegment: function(e) {
  2986. return e.token ? (i = e.token,
  2987. window.analytics.load(e.token),
  2988. c = {
  2989. model_id: e.model,
  2990. start_source: e.startSource,
  2991. autoplay: e.autoplay,
  2992. quickstart: e.quickstart,
  2993. language_tag: t.languageTag,
  2994. is_mobile: y.isMobile(),
  2995. iframe: y.inIframe(),
  2996. aspect_ratio: y.aspectRatio(),
  2997. session_id: h,
  2998. window: {
  2999. width: $("#player").width(),
  3000. height: $("#player").height()
  3001. },
  3002. platform: {
  3003. browser: {
  3004. name: $.ua.browser.name,
  3005. major: $.ua.browser.major,
  3006. version: $.ua.browser.version
  3007. },
  3008. os: {
  3009. name: $.ua.os.name,
  3010. version: $.ua.os.version
  3011. },
  3012. device: {
  3013. vendor: $.ua.device.vendor,
  3014. model: $.ua.device.model,
  3015. type: $.ua.device.type
  3016. }
  3017. }
  3018. },
  3019. n = Math.random() < t.analytics.sessionTrackingRate,
  3020. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  3021. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  3022. },
  3023. sessionStart: function(e) {
  3024. l.debug("analytics user_session_start"),
  3025. f("session_started"),
  3026. P = Date.now(),
  3027. window.addEventListener("unload", function() {
  3028. !function(e, t) {
  3029. if (t = t || {},
  3030. navigator.sendBeacon && i)
  3031. try {
  3032. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  3033. event: e,
  3034. anonymousId: window.analytics.user().anonymousId(),
  3035. properties: s.extendObject(t, c),
  3036. writeKey: i,
  3037. sentAt: Date.now(),
  3038. type: "track",
  3039. context: {
  3040. userAgent: y.userAgent(),
  3041. library: {
  3042. name: "showcase-beacon",
  3043. version: "2.25.6-0-gd87e5b1"
  3044. },
  3045. app: {
  3046. name: "showcase",
  3047. version: "2.25.6-0-gd87e5b1"
  3048. }
  3049. }
  3050. }))
  3051. } catch (e) {
  3052. console.warn("Failed to send async segment request")
  3053. }
  3054. }("session_ended", {
  3055. duration: Date.now() - P
  3056. })
  3057. })
  3058. },
  3059. modelLoaded: function(e, t, i, n) {
  3060. r(e, t, i, n)
  3061. },
  3062. loadComplete: function(e) {
  3063. f("load_times", {
  3064. time_to_app_start: e
  3065. })
  3066. },
  3067. track: function(e, t) {
  3068. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  3069. f(e, t))
  3070. },
  3071. trackAlways: function(e, t) {
  3072. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  3073. f(e, t)
  3074. },
  3075. getSessionId: function() {
  3076. return h
  3077. },
  3078. updateInteraction: m
  3079. }
  3080. }
  3081. ).call(this, "/js/analytics.js")
  3082. }
  3083. , {
  3084. "./ab": 3,
  3085. "./enum/ControlEvents": 21,
  3086. "./enum/PlayerEvents": 40,
  3087. "./enum/VROption": 47,
  3088. "./enum/VRPlatforms": 49,
  3089. "./enum/Viewmode": 51,
  3090. "./gui/sharing/ShareEvents": 76,
  3091. "./gui/sharing/modal": 77,
  3092. "./gui/title/TitleEvents": 80,
  3093. "./gui/title/titleBar": 82,
  3094. "./gui/vr/vrEvent": 85,
  3095. "./gui/vr/vrModal": 87,
  3096. "./localization/localize": 108,
  3097. "./tag/Billboard/BillboardEvent": 120,
  3098. "./settings": 166,
  3099. "./util/ajax": 181,
  3100. "./util/browser": 182,
  3101. "./util/common": 185,
  3102. "./util/logger": 189,
  3103. three: 217
  3104. }],
  3105. 5: [function(e, t, i) {
  3106. "use strict";
  3107. function n() {
  3108. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3109. this.controls = null
  3110. }
  3111. var r = e("three")
  3112. , o = e("../constants")
  3113. , a = e("../util/cameraLight");
  3114. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3115. this.aspect = e,
  3116. this.updateProjectionMatrix()
  3117. }
  3118. ,
  3119. t.exports = n
  3120. }
  3121. , {
  3122. "../constants": 8,
  3123. "../util/cameraLight": 184,
  3124. three: 217
  3125. }],
  3126. 6: [function(e, t, i) {
  3127. "use strict";
  3128. function n() {
  3129. var e = $("#player").width() / $("#player").height();
  3130. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3131. this.controls = null,
  3132. this.updateAspect(e)
  3133. }
  3134. var r = e("three")
  3135. , o = e("../constants");
  3136. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  3137. this.aspect = e,
  3138. this.top = o.orthoBase / e,
  3139. this.bottom = -o.orthoBase / e,
  3140. this.updateProjectionMatrix()
  3141. }
  3142. ,
  3143. t.exports = n
  3144. }
  3145. , {
  3146. "../constants": 8,
  3147. three: 217
  3148. }],
  3149. 7: [function(e, t, i) {
  3150. "use strict";
  3151. function n() {
  3152. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3153. this.controls = null
  3154. }
  3155. var r = e("three")
  3156. , o = e("../settings")
  3157. , a = e("../util/cameraLight");
  3158. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  3159. this.aspect = e,
  3160. this.updateProjectionMatrix()
  3161. }
  3162. ,
  3163. t.exports = n
  3164. }
  3165. , {
  3166. "../settings": 166,
  3167. "../util/cameraLight": 184,
  3168. three: 217
  3169. }],
  3170. 8: [function(e, t, i) {
  3171. "use strict";
  3172. t.exports = {
  3173. signedUrlDefaultExpireTime: 24e4,
  3174. signedUrlCheckInterval: 1e4,
  3175. signedUrlRefreshBuffer: 15e3,
  3176. dollhouseFOV: 70,
  3177. dollhouseNear: .1,//1,
  3178. dollhouseFar: 5e3,
  3179. insideFOV: 70,
  3180. insideFOVMax: 120,
  3181. insideNear: .1,
  3182. insideFar: 5e3,
  3183. insideLookSpeed: .12,
  3184. insideLookLimitUp: 40,
  3185. insideLookLimitDown: -40,
  3186. orthoNear: 1,
  3187. orthoFar: 5e3,
  3188. orthoBase: 10,
  3189. narrowLandscapeHeight: 290,
  3190. reallyNarrowLandscapeHeight: 250,
  3191. visionTilingStartDate: new Date("8/26/2016"),
  3192. visionTilingStartVersion: "1.1.407.13667",
  3193. windowHeightHighQualityThreshold: 900,
  3194. tourStepDelayDefault: 3500,
  3195. tourStepDelaySlideShow: 5e3,
  3196. workshopApsect: 9 / 16,
  3197. highQualityMaxZoom: 2,
  3198. ultraHighQualityMaxZoom: 3
  3199. }
  3200. }
  3201. , {}],
  3202. 9: [function(e, t, i) {
  3203. "use strict";
  3204. function n() {
  3205. this.activeControl = null,
  3206. this.controls = {},
  3207. this.cameras = {}
  3208. }
  3209. var a = e("./PanoramaControls")
  3210. , s = e("./DollhouseControls")
  3211. , l = e("./FloorplanControls")
  3212. , c = e("../cameras/PanoramaCamera")
  3213. , h = e("../cameras/DollhouseCamera")
  3214. , u = e("../cameras/FloorplanCamera")
  3215. , r = e("events").EventEmitter
  3216. , d = e("../enum/ControlEvents")
  3217. , o = e("../enum/ModelManagerEvents")
  3218. , p = e("../enum/Viewmode")
  3219. , f = e("../settings");
  3220. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3221. this.setUpControls(),
  3222. this.bindEvents(e, t)
  3223. }
  3224. ,
  3225. n.prototype.activateControls = function(e) {
  3226. this.activeControl && (this.activeControl.reset(),
  3227. this.activeControl.enabled = !1),
  3228. this.controls[e] && (this.controls[e].enabled = !0),
  3229. this.activeControl = this.controls[e]
  3230. }
  3231. ,
  3232. n.prototype.setUpControls = function() {
  3233. var i = {}
  3234. , n = {}
  3235. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3236. , r = [c, h, u]
  3237. , o = [a, s, l];
  3238. e.forEach(function(e, t) {
  3239. i[e] = new r[t],
  3240. n[e] = new o[t](i[e]),
  3241. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3242. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3243. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3244. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3245. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3246. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3247. }
  3248. .bind(this)),
  3249. this.controls = n,
  3250. this.cameras = i
  3251. }
  3252. ,
  3253. n.prototype.bindEvents = function(e, t) {
  3254. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3255. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3256. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3257. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3258. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3259. passive: !1
  3260. }),
  3261. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3262. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3263. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3264. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3265. e.addEventListener("contextmenu", function(e) {
  3266. e.preventDefault()
  3267. }),
  3268. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3269. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3270. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3271. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3272. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3273. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3274. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3275. t.on(o.ActiveModelChanged, function(e) {
  3276. this.setModelForControls(e.model)
  3277. }
  3278. .bind(this))
  3279. }
  3280. ,
  3281. n.prototype.setModelForControls = function(e) {
  3282. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3283. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3284. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3285. this.controls[e].setBounds(t)
  3286. }
  3287. .bind(this))
  3288. }
  3289. ,
  3290. n.prototype.onMouseDown = function(e) {
  3291. e.preventDefault(),
  3292. this.activeControl && this.activeControl.onMouseDown(e)
  3293. }
  3294. ,
  3295. n.prototype.onMouseMove = function(e) {
  3296. e.preventDefault(),
  3297. this.activeControl && this.activeControl.onMouseMove(e)
  3298. }
  3299. ,
  3300. n.prototype.onMouseUp = function(e) {
  3301. e.preventDefault(),
  3302. this.activeControl && this.activeControl.onMouseUp(e)
  3303. }
  3304. ,
  3305. n.prototype.onMouseOver = function(e) {
  3306. e.preventDefault(),
  3307. this.activeControl && this.activeControl.onMouseOver(e)
  3308. }
  3309. ,
  3310. n.prototype.onMouseWheel = function(e) {
  3311. e.preventDefault(),
  3312. this.activeControl && this.activeControl.onMouseWheel(e)
  3313. }
  3314. ,
  3315. n.prototype.onTouchStart = function(e) {
  3316. e.preventDefault(),
  3317. this.activeControl && this.activeControl.onTouchStart(e),
  3318. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3319. $("#hotListContent ul .active").removeClass("active"),
  3320. $("#hotList")[0].classList.remove("active")
  3321. }
  3322. ,
  3323. n.prototype.onTouchMove = function(e) {
  3324. e.preventDefault(),
  3325. this.activeControl && this.activeControl.onTouchMove(e)
  3326. }
  3327. ,
  3328. n.prototype.onTouchEnd = function(e) {
  3329. e.preventDefault(),
  3330. this.activeControl && this.activeControl.onTouchEnd(e)
  3331. }
  3332. ,
  3333. n.prototype.onPointerDown = function(e) {
  3334. if (e.preventDefault(),
  3335. this.activeControl)
  3336. switch (e.pointerType) {
  3337. case "mouse":
  3338. this.activeControl.onMouseDown(e);
  3339. break;
  3340. default:
  3341. this.activeControl.onPointerDown(e)
  3342. }
  3343. }
  3344. ,
  3345. n.prototype.onPointerMove = function(e) {
  3346. if (e.preventDefault(),
  3347. this.activeControl)
  3348. switch (e.pointerType) {
  3349. case "mouse":
  3350. this.activeControl.onMouseMove(e);
  3351. break;
  3352. default:
  3353. this.activeControl.onPointerMove(e)
  3354. }
  3355. }
  3356. ,
  3357. n.prototype.onPointerUp = function(e) {
  3358. if (e.preventDefault(),
  3359. this.activeControl)
  3360. switch (e.pointerType) {
  3361. case "mouse":
  3362. this.activeControl.onMouseUp(e);
  3363. break;
  3364. default:
  3365. this.activeControl.onPointerUp(e)
  3366. }
  3367. }
  3368. ,
  3369. n.prototype.onPointerCancel = function(e) {
  3370. e.preventDefault(),
  3371. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3372. }
  3373. ,
  3374. n.prototype.onKeyDown = function(e) {
  3375. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3376. this.activeControl && this.activeControl.onKeyDown(e))
  3377. }
  3378. ,
  3379. n.prototype.onKeyUp = function(e) {
  3380. e.preventDefault(),
  3381. this.activeControl && this.activeControl.onKeyUp(e)
  3382. }
  3383. ,
  3384. t.exports = n
  3385. }
  3386. , {
  3387. "../cameras/DollhouseCamera": 5,
  3388. "../cameras/FloorplanCamera": 6,
  3389. "../cameras/PanoramaCamera": 7,
  3390. "../enum/ControlEvents": 21,
  3391. "../enum/ModelManagerEvents": 33,
  3392. "../enum/Viewmode": 51,
  3393. "../settings": 166,
  3394. "./DollhouseControls": 10,
  3395. "./FloorplanControls": 11,
  3396. "./PanoramaControls": 13,
  3397. events: 202
  3398. }],
  3399. 10: [function(e, t, i) {
  3400. "use strict";
  3401. function n(e) {
  3402. a.call(this, e),
  3403. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3404. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3405. this.minDistance = o.dollhouseDefault.minDistance,
  3406. this.maxDistance = o.dollhouseDefault.maxDistance,
  3407. this.adjustedMinDistance = this.minDistance,
  3408. this.adjustedMaxDistance = this.maxDistance
  3409. }
  3410. var r = e("three")
  3411. , o = e("../settings")
  3412. , a = e("./OutsideControls");
  3413. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3414. this.camera.updateMatrix();
  3415. var i = this.camera.position.clone().sub(this.target).length();
  3416. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3417. this.panLeft(2 * e * i / $("#player").height()),
  3418. this.panUp(-2 * t * i / $("#player").height())
  3419. }
  3420. ,
  3421. n.prototype.updateZoom = function() {
  3422. return this.offset.length() * this.scale
  3423. }
  3424. ,
  3425. n.prototype.setZoomBounds = function(e) {
  3426. var t = e.min.distanceTo(e.max);
  3427. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3428. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3429. this.minDistance = this.adjustedMinDistance,
  3430. this.maxDistance = this.adjustedMaxDistance
  3431. }
  3432. ,
  3433. n.prototype.resetRanges = function(e, t) {
  3434. e ? (this.minDistance = Math.min(e, this.minDistance),
  3435. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3436. this.maxDistance = this.adjustedMaxDistance),
  3437. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3438. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3439. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3440. }
  3441. ,
  3442. n.prototype.toJSON = function() {
  3443. return a.prototype.toJSON.call(this)
  3444. }
  3445. ,
  3446. t.exports = n
  3447. }
  3448. , {
  3449. "../settings": 166,
  3450. "./OutsideControls": 12,
  3451. three: 217
  3452. }],
  3453. 11: [function(e, t, i) {
  3454. "use strict";
  3455. function n(e) {
  3456. c.call(this, e),
  3457. this.minDistance = 15,
  3458. this.maxDistance = 50,
  3459. this.noRotateUpDown = !0,
  3460. this.minPolarAngle = 0,
  3461. this.maxPolarAngle = 0,
  3462. this.mouseActions[u.LEFT] = h.PAN,
  3463. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3464. this.mouseActions[u.RIGHT] = h.ROTATE,
  3465. this.touchActions[1] = h.PAN,
  3466. this.touchActions[2] = h.ROTATE_DOLLY,
  3467. this.absoluteScale = 1,
  3468. this.currentScale = 1
  3469. }
  3470. 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");
  3471. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3472. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3473. this.currentScale = this.absoluteScale
  3474. }
  3475. ,
  3476. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3477. var t = Math.max(modelSize.x, modelSize.z)
  3478. , i = Math.min(modelSize.x, modelSize.z)
  3479. , n = Math.max(t, i * this.camera.aspect)
  3480. , r = Math.max(i, t * this.camera.aspect);
  3481. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3482. return absoluteScale
  3483. },
  3484. n.prototype.rotateToView = function(e, t) {
  3485. var i = 0;
  3486. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3487. this.rotateLeft(i),
  3488. this.update(0)
  3489. }
  3490. ,
  3491. n.prototype.pan = function(e, t) {
  3492. this.camera.updateMatrix(),
  3493. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3494. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3495. }
  3496. ,
  3497. n.prototype.updateZoom = function() {
  3498. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3499. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3500. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3501. this.camera.left = -l.orthoBase * this.currentScale,
  3502. this.camera.right = l.orthoBase * this.currentScale,
  3503. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3504. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3505. this.camera.updateProjectionMatrix(),
  3506. this.offset.length()
  3507. }
  3508. ,
  3509. n.prototype.toJSON = (r = new s.Quaternion,
  3510. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3511. a = new s.Quaternion,
  3512. function() {
  3513. var e = c.prototype.toJSON.call(this);
  3514. return r.copy(e.camera_quaternion),
  3515. a.copy(o),
  3516. a.multiply(r),
  3517. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3518. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3519. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3520. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3521. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3522. e
  3523. }
  3524. ),
  3525. t.exports = n
  3526. }
  3527. , {
  3528. "../enum/ControlActions": 20,
  3529. "../enum/MouseButton": 34,
  3530. "../settings": 166,
  3531. "../util/browser": 182,
  3532. "../util/math": 190,
  3533. "./OutsideControls": 12,
  3534. three: 217
  3535. }],
  3536. 12: [function(e, t, i) {
  3537. "use strict";
  3538. function n(e) {
  3539. this.camera = e,
  3540. (this.camera.controls = this).enabled = !1,
  3541. this.target = new a.Vector3,
  3542. this.targetBounds = new a.Box3,
  3543. this.zoomSpeed = 2,//编辑时缩放快一些
  3544. this.minDistance = 0,
  3545. this.maxDistance = 1 / 0,
  3546. this.noRotateUpDown = !1,
  3547. this.rotateSpeed = 1,
  3548. this.keyboardZoomSpeed = 0,
  3549. this.keyPanSpeed = 7,
  3550. this.autoRotate = !1,
  3551. this.autoRotateSpeed = 2,
  3552. this.autoPan = !1,
  3553. this.autoPanPosition = new a.Vector3,
  3554. this.minPolarAngle = a.Math.degToRad(25),
  3555. this.maxPolarAngle = a.Math.degToRad(65),
  3556. this.rotationAcceleration = new a.Vector2,
  3557. this.rotationSpeed = new a.Vector2,
  3558. this.panAcceleration = new a.Vector2,
  3559. this.panSpeed = new a.Vector2,
  3560. this.rotateStart = new a.Vector2,
  3561. this.rotateEnd = new a.Vector2,
  3562. this.rotateDelta = new a.Vector2,
  3563. this.panStart = new a.Vector2,
  3564. this.panEnd = new a.Vector2,
  3565. this.panDelta = new a.Vector2,
  3566. this.panOffset = new a.Vector3,
  3567. this.offset = new a.Vector3,
  3568. this.dollyStart = new a.Vector2,
  3569. this.dollyEnd = new a.Vector2,
  3570. this.dollyDelta = new a.Vector2,
  3571. this.phiDelta = 0,
  3572. this.thetaDelta = 0,
  3573. this.scale = 1,
  3574. this.panVector = new a.Vector3,
  3575. this.lastPosition = new a.Vector3,
  3576. this.state = u.NONE,
  3577. this.mouseActions = {},
  3578. this.mouseActions[d.LEFT] = u.ROTATE,
  3579. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3580. this.mouseActions[d.RIGHT] = u.PAN,
  3581. this.touchActions = {},
  3582. this.touchActions[1] = u.ROTATE,
  3583. this.touchActions[2] = u.PAN_DOLLY,
  3584. this.lastMoveTime = 0,
  3585. this.pointersLimit = 2,
  3586. this.pointers = []
  3587. }
  3588. 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;
  3589. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3590. this.targetBounds = e
  3591. }
  3592. ,
  3593. n.prototype.isEngaged = function() {
  3594. return this.state !== u.NONE
  3595. }
  3596. ,
  3597. n.prototype.rotateLeft = function(e) {
  3598. void 0 === e && (e = this.getAutoRotationAngle()),
  3599. this.thetaDelta -= e
  3600. }
  3601. ,
  3602. n.prototype.rotateUp = function(e) {
  3603. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3604. this.phiDelta -= e)
  3605. }
  3606. ,
  3607. n.prototype.panLeft = function(e) {
  3608. var t = this.camera.matrix.elements;
  3609. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3610. this.panOffset.multiplyScalar(-e),
  3611. this.panVector.add(this.panOffset)
  3612. }
  3613. ,
  3614. n.prototype.panUp = function(e) {
  3615. var t = this.camera.matrix.elements;
  3616. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3617. this.panOffset.multiplyScalar(-e),
  3618. this.panVector.add(this.panOffset)
  3619. }
  3620. ,
  3621. n.prototype.startRotating = function(e, t) {
  3622. e && this.navRotationAcc("x", e),
  3623. t && this.navRotationAcc("y", t)
  3624. }
  3625. ,
  3626. n.prototype.stopRotating = function(e) {
  3627. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3628. this.navRotationAcc("x", 0),
  3629. this.navRotationAcc("y", 0)
  3630. }
  3631. ,
  3632. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3633. o = new a.Vector3,
  3634. function(e, t) {
  3635. r.copy(this.camera.position),
  3636. void 0 === e && null === e || r.setX(e),
  3637. void 0 === t && null === t || r.setZ(t);
  3638. var i = this.camera.position.distanceTo(this.target)
  3639. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3640. this.targetClamped = !1,
  3641. o.copy(r).addScaledVector(n, i),
  3642. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3643. r.copy(o).addScaledVector(n, -i),
  3644. this.targetClamped = !0),
  3645. this.autoPanPosition.x = r.x,
  3646. this.autoPanPosition.z = r.z,
  3647. this.autoPan && this.stopAutoPanning()
  3648. }
  3649. ),
  3650. n.prototype.stopAutoPanning = function() {
  3651. var e = this.autoPan;
  3652. this.autoPan = !1,
  3653. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3654. }
  3655. ,
  3656. n.prototype.dollyIn = function(e) {
  3657. void 0 === e && (e = this.getZoomScale()),
  3658. this.scale /= e
  3659. }
  3660. ,
  3661. n.prototype.dollyOut = function(e) {
  3662. void 0 === e && (e = this.getZoomScale()),
  3663. this.scale *= e
  3664. }
  3665. ,
  3666. n.prototype.updatePan = function(e) {
  3667. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3668. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3669. this.autoPan) {
  3670. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3671. t.setY(0).clampLength(0, 50 * e),
  3672. this.target.add(t),
  3673. this.camera.position.add(t),
  3674. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3675. this.stopAutoPanning())
  3676. }
  3677. }
  3678. ,
  3679. n.prototype.update = function(e) {
  3680. e = e || 1 / 60,
  3681. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3682. this.rotateLeft(-this.rotationSpeed.x),
  3683. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3684. this.updatePan(e);
  3685. var t = this.camera.position;
  3686. this.offset.copy(t).sub(this.target);
  3687. var i = Math.atan2(this.offset.x, this.offset.z)
  3688. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3689. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3690. i += this.thetaDelta,
  3691. n += this.phiDelta,
  3692. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3693. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3694. var r = this.updateZoom();
  3695. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3696. this.target.add(this.panVector),
  3697. this.targetBounds.clampPoint(this.target, this.target),
  3698. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3699. this.offset.y = r * Math.cos(n),
  3700. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3701. t.copy(this.target).add(this.offset),
  3702. this.camera.lookAt(this.target),
  3703. this.thetaDelta = 0,
  3704. this.phiDelta = 0,
  3705. this.scale = 1,
  3706. this.panVector.set(0, 0, 0),
  3707. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3708. }
  3709. ,
  3710. n.prototype.getAutoRotationAngle = function() {
  3711. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3712. }
  3713. ,
  3714. n.prototype.getZoomScale = function() {
  3715. return Math.pow(.95, this.zoomSpeed)
  3716. }
  3717. ,
  3718. n.prototype.onMouseDown = function(e) {
  3719. if (this.enabled) {
  3720. switch (e.preventDefault(),
  3721. this.stopAutoPanning(),
  3722. this.mouseDown = !0,
  3723. this.state = this.mouseActions[e.button],
  3724. this.state) {
  3725. case u.ROTATE:
  3726. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3727. this.rotationSpeed.set(0, 0);
  3728. break;
  3729. case u.DOLLY:
  3730. this.dollyStart.set(e.clientX, e.clientY);
  3731. break;
  3732. case u.PAN:
  3733. this.panStart.set(e.clientX, e.clientY)
  3734. }
  3735. this.emit(f.InputStart, "mouse")
  3736. }
  3737. }
  3738. ,
  3739. n.prototype.onMouseMove = function(e) {
  3740. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3741. switch (e.preventDefault(),
  3742. this.state) {
  3743. case u.ROTATE:
  3744. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd);
  3749. break;
  3750. case u.DOLLY:
  3751. this.dollyEnd.set(e.clientX, e.clientY),
  3752. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3753. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3754. this.dollyStart.copy(this.dollyEnd);
  3755. break;
  3756. case u.PAN:
  3757. this.panEnd.set(e.clientX, e.clientY),
  3758. this.panDelta.subVectors(this.panEnd, this.panStart),
  3759. this.pan(this.panDelta.x, this.panDelta.y),
  3760. this.panStart.copy(this.panEnd)
  3761. }
  3762. this.emit(f.Move, "mouse"),
  3763. this.lastMoveTime = e.timeStamp,
  3764. this.update()
  3765. }
  3766. }
  3767. ,
  3768. n.prototype.onMouseUp = function(e) {
  3769. this.enabled && (this.mouseDown = !1,
  3770. this.state = u.NONE,
  3771. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3772. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3773. this.update(),
  3774. this.rotationAcceleration.set(0, 0),
  3775. this.rotateDelta.set(0, 0)))
  3776. }
  3777. ,
  3778. n.prototype.onMouseOver = function(e) {
  3779. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3780. }
  3781. ,
  3782. n.prototype.onMouseWheel = function(e) {
  3783. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3784. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3785. this.update())
  3786. }
  3787. ,
  3788. n.prototype.onKeyDown = function(e) {
  3789. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3790. this.handleKeyDown(e.which)))
  3791. }
  3792. ,
  3793. n.prototype.navRotationAcc = function(e, t) {
  3794. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3795. }
  3796. ,
  3797. n.prototype.navPanAcc = function(e, t) {
  3798. this.stopAutoPanning(),
  3799. this.panAcceleration[e] = t
  3800. }
  3801. ,
  3802. n.prototype.handleKeyDown = function(e) {
  3803. var t = !0;
  3804. switch (e) {
  3805. case p.UPARROW:
  3806. case p.I:
  3807. this.navRotationAcc("y", 1);
  3808. break;
  3809. case p.DOWNARROW:
  3810. case p.K:
  3811. this.navRotationAcc("y", -1);
  3812. break;
  3813. case p.LEFTARROW:
  3814. case p.J:
  3815. this.navRotationAcc("x", -1);
  3816. break;
  3817. case p.RIGHTARROW:
  3818. case p.L:
  3819. this.navRotationAcc("x", 1);
  3820. break;
  3821. case p.W:
  3822. this.navPanAcc("y", 1);
  3823. break;
  3824. case p.S:
  3825. this.navPanAcc("y", -1);
  3826. break;
  3827. case p.A:
  3828. this.navPanAcc("x", -1);
  3829. break;
  3830. case p.D:
  3831. this.navPanAcc("x", 1);
  3832. break;
  3833. default:
  3834. t = !1
  3835. }
  3836. t && this.emit(f.Move, "key")
  3837. }
  3838. ,
  3839. n.prototype.onKeyUp = function(e) {
  3840. this.enabled && (e.preventDefault(),
  3841. e.stopPropagation(),
  3842. this.handleKeyUp(e.which))
  3843. }
  3844. ,
  3845. n.prototype.handleKeyUp = function(e) {
  3846. switch (e) {
  3847. case p.I:
  3848. case p.K:
  3849. case p.UPARROW:
  3850. case p.DOWNARROW:
  3851. this.keyboardZoomSpeed = 0,
  3852. this.rotationAcceleration.y = 0;
  3853. break;
  3854. case p.J:
  3855. case p.L:
  3856. case p.LEFTARROW:
  3857. case p.RIGHTARROW:
  3858. this.rotationAcceleration.x = 0;
  3859. break;
  3860. case p.S:
  3861. case p.W:
  3862. this.panAcceleration.y = 0;
  3863. break;
  3864. case p.A:
  3865. case p.D:
  3866. this.panAcceleration.x = 0
  3867. }
  3868. }
  3869. ,
  3870. n.prototype.onTouchStart = function(i) {
  3871. if (this.enabled || this.state === u.NONE) {
  3872. i.preventDefault(),
  3873. i.stopPropagation(),
  3874. this.stopAutoPanning();
  3875. var e = function() {
  3876. if (2 === i.touches.length) {
  3877. var e = i.touches[0].pageX - i.touches[1].pageX
  3878. , t = i.touches[0].pageY - i.touches[1].pageY;
  3879. this.dollyStart.set(e, t)
  3880. }
  3881. }
  3882. .bind(this)
  3883. , t = function() {
  3884. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3885. }
  3886. .bind(this)
  3887. , n = function() {
  3888. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3889. }
  3890. .bind(this);
  3891. switch (this.state = this.touchActions[i.touches.length],
  3892. this.state) {
  3893. case u.PAN_DOLLY:
  3894. e();
  3895. case u.PAN:
  3896. t();
  3897. break;
  3898. case u.ROTATE_DOLLY:
  3899. e();
  3900. case u.ROTATE:
  3901. n()
  3902. }
  3903. this.rotationSpeed.set(0, 0),
  3904. this.emit(f.InputStart, "touch")
  3905. }
  3906. }
  3907. ,
  3908. n.prototype.onTouchMove = function(a) {
  3909. if (this.enabled && this.state !== u.NONE) {
  3910. a.preventDefault(),
  3911. a.stopPropagation();
  3912. var s = function() {
  3913. var e = a.touches[0].pageX - a.touches[1].pageX
  3914. , t = a.touches[0].pageY - a.touches[1].pageY;
  3915. this.dollyEnd.set(e, t);
  3916. var i = this.dollyStart.length() - this.dollyEnd.length();
  3917. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3918. this.dollyStart.copy(this.dollyEnd)
  3919. }
  3920. .bind(this)
  3921. , e = function() {
  3922. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3923. this.panDelta.subVectors(this.panEnd, this.panStart),
  3924. this.pan(this.panDelta.x, this.panDelta.y),
  3925. this.panStart.copy(this.panEnd),
  3926. this.rotateDelta.set(0, 0)
  3927. }
  3928. .bind(this)
  3929. , l = function() {
  3930. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3931. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3932. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3933. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3934. this.rotateStart.copy(this.rotateEnd)
  3935. }
  3936. .bind(this)
  3937. , t = function() {
  3938. if (2 === a.touches.length) {
  3939. var e = window.devicePixelRatio || 1
  3940. , t = a.touches[1].pageX - a.touches[0].pageX
  3941. , i = a.touches[1].pageY - a.touches[0].pageY
  3942. , n = Math.sqrt(t * t + i * i);
  3943. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3944. this.state = u.DOLLY,
  3945. s();
  3946. else {
  3947. var r = h.average(a.touches, "pageX")
  3948. , o = h.average(a.touches, "pageY");
  3949. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3950. this.rotateStart.set(r, o),
  3951. l())
  3952. }
  3953. }
  3954. }
  3955. .bind(this);
  3956. switch (this.state) {
  3957. case u.PAN_DOLLY:
  3958. s();
  3959. case u.PAN:
  3960. e();
  3961. break;
  3962. case u.ROTATE_DOLLY:
  3963. t();
  3964. break;
  3965. case u.DOLLY:
  3966. s();
  3967. break;
  3968. case u.ROTATE:
  3969. l();
  3970. break;
  3971. default:
  3972. this.state = u.NONE
  3973. }
  3974. this.lastMoveTime = a.timeStamp,
  3975. this.emit(f.Move, "touch")
  3976. }
  3977. }
  3978. ,
  3979. n.prototype.onTouchEnd = function(e) {
  3980. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3981. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3982. this.state = u.NONE,
  3983. this.update(),
  3984. this.rotationAcceleration.set(0, 0),
  3985. this.rotateDelta.set(0, 0))
  3986. }
  3987. ,
  3988. n.prototype.onPointerDown = function(e) {
  3989. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3990. id: e.pointerId,
  3991. pageX: e.pageX,
  3992. pageY: e.pageY
  3993. }),
  3994. e.touches = this.pointers,
  3995. this.onTouchStart(e)),
  3996. this.emit(f.InputStart, "pointer"))
  3997. }
  3998. ,
  3999. n.prototype.onPointerMove = function(t) {
  4000. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4001. t.pointerId === e.id && (e.pageX = t.pageX,
  4002. e.pageY = t.pageY)
  4003. }),
  4004. t.touches = this.pointers,
  4005. this.onTouchMove(t))
  4006. }
  4007. ,
  4008. n.prototype.onPointerUp = function(i) {
  4009. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4010. i.pointerId === e.id && this.pointers.splice(t, 1)
  4011. }
  4012. .bind(this)),
  4013. i.touches = this.pointers,
  4014. this.onTouchEnd(i))
  4015. }
  4016. ,
  4017. n.prototype.reset = function() {
  4018. this.state = u.NONE,
  4019. this.stopAutoPanning(),
  4020. this.rotationSpeed.set(0, 0),
  4021. this.rotationAcceleration.set(0, 0),
  4022. this.panSpeed.set(0, 0),
  4023. this.panAcceleration.set(0, 0)
  4024. }
  4025. ,
  4026. n.prototype.toJSON = function() {
  4027. return {
  4028. camera_position: {
  4029. x: s.toPrecision(this.camera.position.x, 4),
  4030. y: s.toPrecision(this.camera.position.y, 4),
  4031. z: s.toPrecision(this.camera.position.z, 4)
  4032. },
  4033. camera_quaternion: {
  4034. x: s.toPrecision(this.camera.quaternion.x, 4),
  4035. y: s.toPrecision(this.camera.quaternion.y, 4),
  4036. z: s.toPrecision(this.camera.quaternion.z, 4),
  4037. w: s.toPrecision(this.camera.quaternion.w, 4)
  4038. }
  4039. }
  4040. }
  4041. ,
  4042. t.exports = n
  4043. }
  4044. , {
  4045. "../enum/ControlActions": 20,
  4046. "../enum/ControlEvents": 21,
  4047. "../enum/Keys": 30,
  4048. "../enum/MouseButton": 34,
  4049. "../enum/Vectors": 50,
  4050. "../settings": 166,
  4051. "../util/common": 185,
  4052. "../util/math": 190,
  4053. events: 202,
  4054. three: 217
  4055. }],
  4056. 13: [function(u, d, e) {
  4057. (function(e) {
  4058. "use strict";
  4059. function t(e) {
  4060. this.camera = e,
  4061. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  4062. this.lookVector = new s.Vector3,
  4063. this.lookSpeed = .05,
  4064. this.rotationAcc = new s.Vector2,
  4065. this.rotationSpeed = new s.Vector2,
  4066. this.lat = 0,
  4067. this.lon = 0,
  4068. this.phi = 0,
  4069. this.theta = 0,
  4070. this.enabled = !1,
  4071. this.locked = !1,
  4072. this.pointer = new s.Vector2(0,0),
  4073. this.rotationHistory = [],
  4074. this.rotationDifference = new s.Vector2,
  4075. this.pointerDragOn = !1,
  4076. this.pointerDragStart = new s.Vector2(0,0),
  4077. this.pinchDistance = 0,
  4078. this.moveStart = new s.Vector2,
  4079. this.moveTolerance = .01,
  4080. this.pointersLimit = 2,
  4081. this.pointers = []
  4082. }
  4083. var s = u("three")
  4084. , i = u("../util/logger")
  4085. , n = u("../settings")
  4086. , r = u("../util/common")
  4087. , o = u("../util/math")
  4088. , a = (u("../enum/Vectors"),
  4089. u("../enum/MouseButton"))
  4090. , l = u("../enum/Keys")
  4091. , c = u("../enum/ControlEvents")
  4092. , h = u("events").EventEmitter;
  4093. new i(e),
  4094. (t.prototype = Object.create(h.prototype)).usable = function() {
  4095. return this.enabled && !this.locked
  4096. }
  4097. ,
  4098. /* t.prototype.lookAt = function(e) {
  4099. var t = this.camera.position.clone().sub(e)
  4100. , i = Math.atan(t.z / t.x);
  4101. i += t.x < 0 ? Math.PI : 0,
  4102. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  4103. this.lon = s.Math.radToDeg(i) + 180;
  4104. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4105. , r = Math.atan(t.y / n);
  4106. this.lat = -s.Math.radToDeg(r)
  4107. } */
  4108. t.prototype.lookAt = function(aim, dir) {
  4109. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4110. var i = Math.atan(t.z / t.x);
  4111. i += t.x < 0 ? Math.PI : 0;
  4112. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4113. this.lon = s.Math.radToDeg(i) + 180;
  4114. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4115. o = Math.atan(t.y / n);
  4116. this.lat = -s.Math.radToDeg(o);
  4117. }
  4118. ,
  4119. t.prototype.startRotationFrom = function(e, t) {
  4120. o.convertScreenPositionToNDC(e, t, this.pointer),
  4121. this.pointerDragOn = !0,
  4122. this.pointerDragStart.copy(this.pointer),
  4123. this.moveStart.copy(this.pointer),
  4124. this.rotationHistory = [],
  4125. this.rotationSpeed.set(0, 0)
  4126. }
  4127. ,
  4128. t.prototype.onMouseOver = function(e) {
  4129. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4130. }
  4131. ,
  4132. t.prototype.onTouchStart = function(e) {
  4133. if (this.usable()) {
  4134. switch (e.preventDefault(),
  4135. e.stopPropagation(),
  4136. e.touches.length) {
  4137. case 1:
  4138. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4139. break;
  4140. case 2:
  4141. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4142. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4143. this.pinchDistance = Math.sqrt(t * t + i * i)
  4144. }
  4145. this.emit(c.InputStart, "touch")
  4146. }
  4147. }
  4148. ,
  4149. t.prototype.onPointerDown = function(e) {
  4150. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4151. id: e.pointerId,
  4152. clientX: e.clientX,
  4153. clientY: e.clientY
  4154. }),
  4155. e.touches = this.pointers,
  4156. this.onTouchStart(e),
  4157. this.emit(c.InputStart, "pointer"))
  4158. }
  4159. ,
  4160. t.prototype.onMouseDown = function(e) {
  4161. if (this.usable()) {
  4162. switch (e.preventDefault(),
  4163. e.stopPropagation(),
  4164. e.button) {
  4165. case a.LEFT:
  4166. this.startRotationFrom(e.clientX, e.clientY)
  4167. }
  4168. this.emit(c.InputStart, "mouse")
  4169. }
  4170. }
  4171. ,
  4172. t.prototype.updateRotation = function() {
  4173. if (this.usable() && this.pointerDragOn) {
  4174. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4175. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4176. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4177. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4178. , r = Math.atan2(e.y, i)
  4179. , o = Math.atan2(t.y, n);
  4180. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4181. e.y = 0,
  4182. t.y = 0;
  4183. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4184. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4185. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4186. this.pointerDragStart.copy(this.pointer)
  4187. }
  4188. }
  4189. ,
  4190. t.prototype.onMouseMove = function(e) {
  4191. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4192. 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"))
  4193. }
  4194. ,
  4195. t.prototype.onTouchMove = function(e) {
  4196. if (this.usable())
  4197. switch (this.emit(c.Move, "touch"),
  4198. e.touches.length) {
  4199. case 1:
  4200. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4201. break;
  4202. case 2:
  4203. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4204. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4205. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4206. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4207. this.emit(c.Pinch, n),
  4208. this.pinchDistance -= n)
  4209. }
  4210. }
  4211. ,
  4212. t.prototype.onPointerMove = function(t) {
  4213. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4214. t.pointerId === e.id && (e.clientX = t.clientX,
  4215. e.clientY = t.clientY)
  4216. }),
  4217. t.touches = this.pointers,
  4218. this.onTouchMove(t))
  4219. }
  4220. ,
  4221. t.prototype.endRotation = function() {
  4222. this.pointerDragOn = !1;
  4223. var e = r.averageVectors(this.rotationHistory);
  4224. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4225. }
  4226. ,
  4227. t.prototype.onTouchEnd = function(e) {
  4228. this.usable() && (e.preventDefault(),
  4229. e.stopPropagation(),
  4230. this.endRotation())
  4231. }
  4232. ,
  4233. t.prototype.onMouseUp = function(e) {
  4234. this.usable() && (e.preventDefault(),
  4235. e.stopPropagation(),
  4236. this.endRotation())
  4237. }
  4238. ,
  4239. t.prototype.onPointerUp = function(i) {
  4240. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4241. i.pointerId === e.id && this.pointers.splice(t, 1)
  4242. }
  4243. .bind(this)),
  4244. i.touches = this.pointers,
  4245. this.onTouchEnd(i))
  4246. }
  4247. ,
  4248. t.prototype.update = function(e) {
  4249. for (this.lon,
  4250. this.lat,
  4251. this.updateRotation(),
  4252. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4253. this.rotationHistory.shift();
  4254. this.lon += this.rotationDifference.x,
  4255. this.lat += this.rotationDifference.y,
  4256. this.rotationDifference.set(0, 0),
  4257. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4258. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4259. this.lon += this.rotationSpeed.x * e,
  4260. this.lat += this.rotationSpeed.y * e
  4261. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4262. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4263. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4264. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4265. this.phi = s.Math.degToRad(90 - this.lat),
  4266. this.theta = s.Math.degToRad(this.lon),
  4267. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4268. this.lookVector.y = Math.cos(this.phi),
  4269. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4270. this.target.copy(this.lookVector).add(this.camera.position),
  4271. this.camera.lookAt(this.target)
  4272. }
  4273. ,
  4274. t.prototype.onMouseWheel = function(e) {
  4275. if (this.usable()) {
  4276. var t = e.wheelDelta || -e.detail;
  4277. this.emit(c.InteractionDirect),
  4278. this.emit(c.Scroll, t)
  4279. }
  4280. }
  4281. ,
  4282. t.prototype.onKeyDown = function(e) {
  4283. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4284. this.handleKeyDown(e.which)))
  4285. }
  4286. ,
  4287. t.prototype.handleKeyDown = function(e) {
  4288. var t = function(e, t) {
  4289. this.rotationAcc[e] = t
  4290. }
  4291. .bind(this);
  4292. this.emit(c.InteractionKey);
  4293. var i = !0;
  4294. switch (e) {
  4295. case l.LEFTARROW:
  4296. case l.J:
  4297. t("x", -1);
  4298. break;
  4299. case l.RIGHTARROW:
  4300. case l.L:
  4301. t("x", 1);
  4302. break;
  4303. case l.I:
  4304. t("y", 1);
  4305. break;
  4306. case l.K:
  4307. t("y", -1);
  4308. break;
  4309. default:
  4310. i = !1
  4311. }
  4312. i && this.emit(c.Move, "key")
  4313. }
  4314. ,
  4315. t.prototype.onKeyUp = function(e) {
  4316. this.usable() && (e.preventDefault(),
  4317. e.stopPropagation(),
  4318. this.handleKeyUp(e.which))
  4319. }
  4320. ,
  4321. t.prototype.handleKeyUp = function(e) {
  4322. switch (e) {
  4323. case l.LEFTARROW:
  4324. case l.J:
  4325. case l.RIGHTARROW:
  4326. case l.L:
  4327. this.rotationAcc.x = 0;
  4328. break;
  4329. case l.I:
  4330. case l.K:
  4331. this.rotationAcc.y = 0
  4332. }
  4333. }
  4334. ,
  4335. t.prototype.startRotating = function(e, t) {
  4336. e && (this.rotationAcc.x = e),
  4337. t && (this.rotationAcc.y = t)
  4338. }
  4339. ,
  4340. t.prototype.stopRotating = function(e) {
  4341. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4342. this.rotationAcc.set(0, 0)
  4343. }
  4344. ,
  4345. t.prototype.reset = function() {
  4346. this.pointerDragOn = !1,
  4347. this.rotationAcc.set(0, 0),
  4348. this.rotationSpeed.set(0, 0),
  4349. this.pointers = []
  4350. }
  4351. ,
  4352. t.prototype.toJSON = function() {
  4353. return {
  4354. camera_position: {
  4355. x: o.toPrecision(this.camera.position.x, 4),
  4356. y: o.toPrecision(this.camera.position.y, 4),
  4357. z: o.toPrecision(this.camera.position.z, 4)
  4358. },
  4359. camera_quaternion: {
  4360. x: o.toPrecision(this.camera.quaternion.x, 4),
  4361. y: o.toPrecision(this.camera.quaternion.y, 4),
  4362. z: o.toPrecision(this.camera.quaternion.z, 4),
  4363. w: o.toPrecision(this.camera.quaternion.w, 4)
  4364. }
  4365. }
  4366. }
  4367. ,
  4368. t.prototype.setStateFromJSON = function(e) {
  4369. this.camera.position.copy(e.camera_position),
  4370. this.camera.quaternion.copy(e.camera_quaternion)
  4371. }
  4372. ,
  4373. d.exports = t
  4374. }
  4375. ).call(this, "/js/controls/PanoramaControls.js")
  4376. }
  4377. , {
  4378. "../enum/ControlEvents": 21,
  4379. "../enum/Keys": 30,
  4380. "../enum/MouseButton": 34,
  4381. "../enum/Vectors": 50,
  4382. "../settings": 166,
  4383. "../util/common": 185,
  4384. "../util/logger": 189,
  4385. "../util/math": 190,
  4386. events: 202,
  4387. three: 217
  4388. }],
  4389. 14: [function(t, i, e) {
  4390. (function(e) {
  4391. "use strict";
  4392. var c = t("three")
  4393. , h = t("../enum/Viewmode")
  4394. , u = new (t("../util/logger"))(e);
  4395. i.exports = {
  4396. serialize: function(e) {
  4397. return encodeURI(JSON.stringify(e))
  4398. },
  4399. deserialize: function(e) {
  4400. function t(e) {
  4401. return e.reduce(function(e, t) {
  4402. return e && "number" == typeof t && !isNaN(t)
  4403. }, !0)
  4404. }
  4405. try {
  4406. var i = JSON.parse(decodeURI(e))
  4407. , n = {
  4408. mode: h.fromInt(i.camera_mode),
  4409. panoId: i.scan_id,
  4410. position: (new c.Vector3).copy(i.camera_position),
  4411. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4412. zoom: i.ortho_zoom,
  4413. floorVisibility: i.floor_visibility
  4414. }
  4415. , r = n.position;
  4416. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4417. var o = n.quaternion;
  4418. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4419. n
  4420. } catch (i) {
  4421. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4422. try {
  4423. var a = e.split(",")
  4424. , s = {
  4425. x: parseFloat(a[2]),
  4426. y: parseFloat(a[3]),
  4427. z: parseFloat(a[4])
  4428. }
  4429. , l = {
  4430. x: parseFloat(a[5]),
  4431. y: parseFloat(a[6]),
  4432. z: parseFloat(a[7]),
  4433. w: parseFloat(a[8])
  4434. };
  4435. return t([s.x, s.y, s.z]) || (s.x = 0,
  4436. s.y = 0,
  4437. s.z = 0),
  4438. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4439. l.y = 0,
  4440. l.z = 0,
  4441. l.w = 1),
  4442. {
  4443. mode: h.fromInt(a[0]),
  4444. panoId: a[1],
  4445. position: (new c.Vector3).copy(s),
  4446. quaternion: (new c.Quaternion).copy(l)
  4447. }
  4448. } catch (t) {
  4449. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4450. }
  4451. }
  4452. return null
  4453. }
  4454. }
  4455. }
  4456. ).call(this, "/js/controls/serializer.js")
  4457. }
  4458. , {
  4459. "../enum/Viewmode": 51,
  4460. "../util/logger": 189,
  4461. three: 217
  4462. }],
  4463. 15: [function(C, I, e) {
  4464. (function(e) {
  4465. "use strict";
  4466. function t() {
  4467. this.endlessLoop = r.warp.loop,
  4468. this.clock = new i.Clock(!0),
  4469. this.model = null,
  4470. this.player = null,
  4471. this.currentItem = null,
  4472. this.destinationItem = null,
  4473. this.tourIsPlaying = !1,
  4474. this.transitionStage = v.None,
  4475. this.nextFunc = null,
  4476. this.onTheBus = !1,
  4477. this.tourInProgress = !1,
  4478. this.reachSource = null,
  4479. this.interrupted = !1,
  4480. this.nItems = 0,
  4481. this.walkingSectionPaused = !1
  4482. }
  4483. var i = C("three")
  4484. , n = C("./util/logger")
  4485. , r = C("./settings")
  4486. , o = C("./util/transitions")
  4487. , a = C("events").EventEmitter
  4488. , s = C("./enum/Viewmode")
  4489. , l = C("./analytics")
  4490. , c = C("./enum/WarpStyle")
  4491. , h = (o = C("./util/transitions"),
  4492. C("./model/ModelManager"),
  4493. C("./enum/ModelManagerEvents"))
  4494. , u = C("./enum/DirectorEvents")
  4495. , d = C("./enum/PlayerEvents")
  4496. , p = (C("./enum/ControlEvents"),
  4497. C("./enum/BlackoutStyle"))
  4498. , f = C("./enum/PathDiscardMode")
  4499. , g = C("./enum/PathDisplayMode")
  4500. , m = (C("./player"),
  4501. new n(e))
  4502. , v = Object.freeze({
  4503. None: 0,
  4504. Moving: 1,
  4505. Aiming: 2,
  4506. Interlude: 3
  4507. })
  4508. , y = Object.freeze({
  4509. Forward: 1,
  4510. NoChange: 0,
  4511. Backwards: -1
  4512. })
  4513. , A = o.getUniqueId();
  4514. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4515. this.player = e,
  4516. this.modelManager = t,
  4517. this.updateModel(),
  4518. this.resetAll(),
  4519. this.bindEvents()
  4520. }
  4521. ,
  4522. t.prototype.resetAll = function() {
  4523. if (this.currentItem = null,
  4524. this.destinationItem = null,
  4525. this.tourIsPlaying = !1,
  4526. this.bgmReplay(),
  4527. this.transitionStage = v.None,
  4528. this.nextFunc = null,
  4529. this.onTheBus = !1,
  4530. this.reachSource = null,
  4531. this.interrupted = !1,
  4532. this.model) {
  4533. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4534. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4535. } else
  4536. this.defaultWarpStyle = c.BLACK,
  4537. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4538. this.resetSpecialTransition()
  4539. }
  4540. ,
  4541. t.prototype.updateModel = function() {
  4542. this.model = this.modelManager.getActiveModel(),
  4543. this.nItems = this.model.heroLocations.length
  4544. }
  4545. ,
  4546. t.prototype.bindEvents = function() {
  4547. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4548. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4549. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4550. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4551. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4552. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4553. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4554. this.player.once(d.Move, function() {
  4555. o.cancelById(A)
  4556. })
  4557. }
  4558. ,
  4559. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4560. return e === c.WALK && (this.interrupt(p.NONE),
  4561. this.pauseWalkingSection(),
  4562. this.player.fastForwardActivePanoFlight(),
  4563. !0)
  4564. }
  4565. ,
  4566. t.prototype.handlePlayerMove = function(e) {
  4567. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4568. this.emit("update.controls")
  4569. }
  4570. ,
  4571. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4572. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4573. this.emit("update.controls"))
  4574. }
  4575. ,
  4576. t.prototype.handlePlayerModeChanged = function(e, t) {
  4577. this.intermediateState() || e === t || (this.onTheBus = !1,
  4578. this.emit("update.controls"))
  4579. }
  4580. ,
  4581. t.prototype.handlePlayerInputStart = function(e) {
  4582. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4583. }
  4584. ,
  4585. t.prototype.handlePlayerFlyingStarted = function() {
  4586. this.clearWalkingSectionPaused()
  4587. }
  4588. ,
  4589. t.prototype.describe = function() {
  4590. return {
  4591. nItems: this.nItems,
  4592. currentItem: this.currentItem,
  4593. destinationItem: this.destinationItem,
  4594. tourIsPlaying: this.tourIsPlaying,
  4595. onTheBus: this.onTheBus,
  4596. endlessLoop: this.endlessLoop,
  4597. viewMode: this.player.mode,
  4598. inTransition: this._inTransition(),
  4599. transitionStage: this.transitionStage,
  4600. tourInProgress: this.tourInProgress
  4601. }
  4602. }
  4603. ,
  4604. t.prototype._inTransition = function() {
  4605. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4606. }
  4607. ,
  4608. t.prototype.bounceable = function() {
  4609. var e = this.clock.getDelta();
  4610. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4611. }
  4612. ,
  4613. t.prototype.itemCompare = function(item1, item2, type){//add
  4614. if(type == 'equal'){//==
  4615. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4616. }else if(type == 'less'){//<
  4617. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4618. }
  4619. }
  4620. t.prototype.currentMoveDirection = function() {
  4621. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4622. 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
  4623. }
  4624. ,
  4625. t.prototype.clearPath = function() {
  4626. this._inTransition() || this.player.path.discardPathObject()
  4627. }
  4628. ,
  4629. t.prototype.allFloors = function() {
  4630. this.model.toggleAllFloors()
  4631. }
  4632. ,
  4633. t.prototype.actionComplete = function(e) {
  4634. if (this.interrupted = !1,
  4635. this.transitionStage = v.None,
  4636. this.resetSpecialTransition(),
  4637. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4638. this.tourIsPlaying || (this.player.disablePreRendering(),
  4639. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4640. this.emit("update.controls"),
  4641. this.nextFunc) {
  4642. var t = this.nextFunc;
  4643. this.nextFunc = null,
  4644. t()
  4645. }
  4646. }
  4647. ,
  4648. t.prototype.awaitCompletion = function(e, t) {
  4649. this.nextFunc = t,
  4650. e()
  4651. }
  4652. ,
  4653. t.prototype.updateSuccessFunction = function(e) {
  4654. this.nextFunc = e
  4655. }
  4656. ,
  4657. t.prototype.interrupt = function(e, t) {
  4658. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4659. this.tourIsPlaying = !1,
  4660. this.bgmReplay(),
  4661. this.interrupted = !0,
  4662. this.nextFunc = null,
  4663. this.emit(u.ActionInterrupted),
  4664. null != e || (e = p.BEGINNING),
  4665. this.player.interruptAndFastForward(e, t),
  4666. !0)
  4667. }
  4668. ,
  4669. t.prototype.wouldInterrupt = function() {
  4670. return this.transitionStage !== v.None
  4671. }
  4672. ,
  4673. t.prototype.intermediateState = function() {
  4674. return this.transitionStage !== v.None
  4675. }
  4676. ,
  4677. t.prototype.isInterrupted = function() {
  4678. return this.interrupted
  4679. }
  4680. ,
  4681. t.prototype.pauseWalkingSection = function() {
  4682. this.walkingSectionPaused = !0
  4683. }
  4684. ,
  4685. t.prototype.clearWalkingSectionPaused = function() {
  4686. this.walkingSectionPaused = !1
  4687. }
  4688. ,
  4689. t.prototype.autoTour = function() {
  4690. var i = Date.now();
  4691. this.model.auxDataPromise.then(function() {
  4692. i = Date.now() - i;
  4693. var e = r.warp.auto
  4694. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4695. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4696. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4697. done: function() {
  4698. this.playTour()
  4699. }
  4700. .bind(this),
  4701. name: "_atr",
  4702. id: A
  4703. })
  4704. }
  4705. .bind(this))
  4706. }
  4707. ,
  4708. t.prototype.atDestinationPano = function() {
  4709. if (!this.player.currentPano || null === this.destinationItem)
  4710. return !1;
  4711. var e = this.player.currentPano.id;
  4712. if (void 0 === e)
  4713. return !1;
  4714. var t = this.model.heroLocations;
  4715. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4716. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4717. return destination && destination.panoId == e
  4718. }
  4719. ,
  4720. t.prototype.redirectToItem = function(e, t) {
  4721. if (null != e)
  4722. if (this.wouldInterrupt())
  4723. if (this.player.mode !== s.TRANSITIONING) {
  4724. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4725. var i = function() {
  4726. o.setTimeout(function() {
  4727. this.setDestinationItem(e),
  4728. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4729. }
  4730. .bind(this), 0)
  4731. }
  4732. .bind(this);
  4733. this.interrupt(p.END, 0),
  4734. this.updateSuccessFunction(i)
  4735. } else
  4736. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4737. else
  4738. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4739. else
  4740. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4741. }
  4742. ,
  4743. t.prototype.useSpecialTransition = function(e) {
  4744. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4745. this.nextWarpStyle = c.BLACK
  4746. }
  4747. ,
  4748. t.prototype.resetSpecialTransition = function() {
  4749. this.nextWarpStyle = this.defaultWarpStyle
  4750. }
  4751. ,
  4752. t.prototype.arrivedAtDestination = function(e) {
  4753. if (this.player.flying || this.player.isWarping())
  4754. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4755. else {
  4756. this.transitionStage = v.Aiming;
  4757. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4758. this.player.model.fadePanoMarkers(0),
  4759. this.awaitCompletion(function() {
  4760. this.resetSpecialTransition(),
  4761. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4762. }
  4763. .bind(this), t)
  4764. }
  4765. }
  4766. ,
  4767. t.prototype.goToDestination = function(e, t, i, n) {
  4768. //音频
  4769. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4770. if(musicInfo && musicInfo.music){
  4771. var o1 = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4772. let audioSrc1 = g_tourAudio.src.split('/').pop();
  4773. let audioSrc2 = o1.split('/').pop();
  4774. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4775. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4776. g_tourAudio.currentTime = 0; g_tourAudio.play();
  4777. }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
  4778. g_tourAudio.play()
  4779. }
  4780. }else{//很可能是该folder的起始
  4781. g_tourAudio.src = manage.dealURL(o1);
  4782. g_tourAudio.load()
  4783. }
  4784. if(g_bgAudio && !g_bgAudio.paused){
  4785. manage.switchBgmState(false);
  4786. g_bgAudio.pauseByTour = true
  4787. }
  4788. }
  4789. if (this.onTheBus = !0,
  4790. this.emit("update.controls"),
  4791. this.player.updateLastView(),
  4792. n || !this.atDestinationPano()){
  4793. if (this.player.flying || this.player.isWarping())
  4794. m.warn("Cannot go to new destination while player is flying or warping.");
  4795. else {
  4796. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4797. , s = null
  4798. , l = null;
  4799. if (a.isPano()) {
  4800. o1 = this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4801. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4802. s = this.arrivedAtDestination.bind(this, !0)
  4803. //add
  4804. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4805. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4806. }
  4807. } else{
  4808. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4809. s = this.arrivedAtDestination.bind(this, !1);
  4810. }
  4811. this.transitionStage = v.Moving,
  4812. this.model.fadePanoMarkers(0),
  4813. this.awaitCompletion(function() {
  4814. l()
  4815. }
  4816. .bind(this), s),
  4817. this.emit("update.controls")
  4818. }
  4819. }else{
  4820. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4821. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4822. if(a.zoom && a.zoom != this.player.zoomLevel){
  4823. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4824. } */
  4825. this.arrivedAtDestination(!0)
  4826. }
  4827. }
  4828. ,
  4829. t.prototype.tourInterlude = function() {
  4830. if (l.trackAlways("reach_highlight", {
  4831. reach_source: this.reachSource
  4832. }),
  4833. this.model.fadePanoMarkers(0),
  4834. this.emit("update.controls"),
  4835. this.tourIsPlaying)
  4836. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4837. this.stopTour(),
  4838. this.emit(u.TourEnd),
  4839. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4840. this.transitionStage = v.Interlude,
  4841. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4842. }
  4843. .bind(this), this.goNext.bind(this))
  4844. }
  4845. ,
  4846. t.prototype.playTour = function() {
  4847. if (!this.bounceable())
  4848. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4849. this.tourInProgress = !0,
  4850. this.reachSource = "play",
  4851. this.tourIsPlaying = !0,
  4852. this.wasZoomEnabled = this.player.zoomEnabled,
  4853. this.player.zoomEnabled = !1,
  4854. this.resetSpecialTransition(),
  4855. this.emit("update.controls"),
  4856. this.emit(u.TourStart),
  4857. this.player.enablePreRendering(),
  4858. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4859. this.goToDestination()) : this.goNext()))
  4860. }
  4861. ,
  4862. t.prototype.bgmReplay = function() {
  4863. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4864. g_playAudio = g_bgAudio;
  4865. g_tourAudio && g_tourAudio.pause();
  4866. //window.tourAudio && window.tourAudio.pause();
  4867. manage.switchBgmState(true);
  4868. }
  4869. }
  4870. ,
  4871. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4872. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4873. this.tourIsPlaying = !1,
  4874. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4875. this.interrupt(),
  4876. this.clearWalkingSectionPaused(),
  4877. this.resetSpecialTransition(),
  4878. this.emit("update.controls"))
  4879. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4880. {
  4881. g_tourAudio.pause();
  4882. g_tourAudio.src = ""
  4883. }
  4884. }
  4885. ,
  4886. t.prototype.endTourProgress = function() {
  4887. this.tourInProgress = !1,
  4888. this.emit("update.controls"),
  4889. this.emit(u.TourEnd)
  4890. }
  4891. ,
  4892. t.prototype.goToHighlight = function(e) {
  4893. if (this.wouldInterrupt())
  4894. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4895. else {
  4896. if (m.debug("<tour.goto " + e + ">"),
  4897. this.isInterrupted())
  4898. return;
  4899. this.clearWalkingSectionPaused(),
  4900. this.setDestinationItem(e),
  4901. this.useSpecialTransition("Hilight"),
  4902. this.goToDestination(),
  4903. l.trackAlways("reach_highlight", {
  4904. reach_source: "thumb"
  4905. })
  4906. }
  4907. }
  4908. ,
  4909. t.prototype.prevHighlight = function() {
  4910. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4911. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4912. this.reachSource = "prev",
  4913. this.goPrev()))
  4914. }
  4915. ,
  4916. t.prototype.nextHighlight = function() {
  4917. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4918. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4919. this.reachSource = "next",
  4920. this.goNext()))
  4921. }
  4922. ,
  4923. t.prototype.changeMode = function(e) {
  4924. var t = $.Deferred()
  4925. , i = t.resolve.bind(t)
  4926. , n = t.reject.bind(t);
  4927. if (this.emit(u.StartModeChange),
  4928. !function() {
  4929. return this.clearWalkingSectionPaused(),
  4930. !!this.wouldInterrupt() && (this.interrupt(),
  4931. !0)
  4932. }
  4933. .bind(this)()) {
  4934. switch (e) {
  4935. case s.PANORAMA:
  4936. 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);
  4937. break;
  4938. case s.DOLLHOUSE:
  4939. case s.FLOORPLAN:
  4940. this.player.flyToNewMode({
  4941. mode: e
  4942. }).done(i).fail(n);
  4943. break;
  4944. case s.OUTDOOR:
  4945. 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)
  4946. }
  4947. return t.promise()
  4948. }
  4949. }
  4950. ,
  4951. t.prototype.atEndOfTour = function(item) {
  4952. //return this.currentItem >= this.nItems - 1
  4953. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4954. if(end){
  4955. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4956. if(heroLocations){
  4957. end = this.currentItem[1] >= heroLocations.length - 1
  4958. }
  4959. }
  4960. return end;
  4961. }
  4962. ,
  4963. t.prototype.firstDestination = function() {
  4964. //return 0 < this.nItems ? 0 : null
  4965. return 0 < this.nItems ? [0,0]: null
  4966. }
  4967. ,
  4968. t.prototype.finalDestination = function() {
  4969. //return 0 < this.nItems ? this.nItems - 1 : null
  4970. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4971. }
  4972. ,
  4973. t.prototype.goPrev = function() {
  4974. this.tourAdvance(-1)
  4975. }
  4976. ,
  4977. t.prototype.goNext = function() {
  4978. this.tourAdvance(1)
  4979. }
  4980. ,
  4981. t.prototype.setDestinationItem = function(e) {
  4982. this.destinationItem = e,
  4983. this.emit("update.controls")
  4984. }
  4985. ,
  4986. t.prototype.setCurrentItem = function(e) {
  4987. this.currentItem = e,
  4988. this.emit("update.controls")
  4989. }
  4990. ,
  4991. t.prototype.nextItem = function(currentItem) {
  4992. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4993. if(currentItem == void 0)return this.firstDestination()
  4994. var currentLocation = this.model.heroLocations[currentItem[0]];
  4995. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4996. var item;
  4997. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4998. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4999. }else{
  5000. item = [currentItem[0] , currentItem[1]+1]
  5001. }
  5002. if(item[0] >= this.nItems ){
  5003. item = this.firstDestination()
  5004. }
  5005. return item;
  5006. //暂时不理会endlessLoop,默认为false
  5007. }
  5008. ,
  5009. t.prototype.prevItem = function(currentItem) {
  5010. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5011. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  5012. var item;
  5013. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5014. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5015. else{
  5016. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5017. if(this.currentItem[1] == 0){//子目录中第一个
  5018. return [currentItem[0] - 1, lastChildNum-1]
  5019. }else{
  5020. return [currentItem[0], currentItem[1]-1]
  5021. }
  5022. }
  5023. }
  5024. ,
  5025. t.prototype.tourAdvance = function(e) {//e是1或-1
  5026. m.debug("tourAdvance(" + e + ")")
  5027. if(null === this.currentItem || void 0 === this.currentItem){
  5028. this.setDestinationItem(this.firstDestination())
  5029. }else{
  5030. var item
  5031. if(e == 1){
  5032. item = this.nextItem(this.currentItem)
  5033. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  5034. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5035. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5036. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  5037. }else{
  5038. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  5039. } */
  5040. }else if(e == -1){
  5041. item = this.prevItem(this.currentItem)
  5042. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  5043. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  5044. else{
  5045. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5046. if(this.currentItem[1] == 0){//子目录中第一个
  5047. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  5048. }else{
  5049. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  5050. }
  5051. } */
  5052. }
  5053. //this.setDestinationItem(this.currentItem + e)
  5054. this.setDestinationItem(item)
  5055. }
  5056. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5057. this.useSpecialTransition("reverse-looping to end")
  5058. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5059. this.useSpecialTransition("looping back to start")
  5060. }
  5061. /* if(this.destinationItem[0] < 0 ){
  5062. this.setDestinationItem(this.finalDestination())
  5063. this.useSpecialTransition("reverse-looping to end")
  5064. }else{
  5065. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  5066. this.useSpecialTransition("looping back to start"))
  5067. } */
  5068. /* var momentTour = this.getMomentTour(this.destinationItem);
  5069. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5070. var i = this.player.zoomLevel;
  5071. this.player.zoomEnabled = !0;
  5072. var t = function(e, t) {
  5073. this.player.zoomTo((1 - e) * i, !0)
  5074. }
  5075. .bind(this);
  5076. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  5077. } */
  5078. this.goToDestination()
  5079. }
  5080. ,
  5081. t.prototype.getMomentTour = function(destinationItem) {//add
  5082. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5083. if(!destinationItem) return wholeMomentTour
  5084. else{
  5085. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5086. if(currentLocation.momentTour)return currentLocation.momentTour;
  5087. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5088. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5089. }
  5090. }
  5091. ,
  5092. I.exports = t
  5093. }
  5094. ).call(this, "/js/director.js")
  5095. }
  5096. , {
  5097. "./analytics": 4,
  5098. "./enum/BlackoutStyle": 18,
  5099. "./enum/ControlEvents": 21,
  5100. "./enum/DirectorEvents": 23,
  5101. "./enum/ModelManagerEvents": 33,
  5102. "./enum/PathDiscardMode": 38,
  5103. "./enum/PathDisplayMode": 39,
  5104. "./enum/PlayerEvents": 40,
  5105. "./enum/Viewmode": 51,
  5106. "./enum/WarpStyle": 52,
  5107. "./model/ModelManager": 140,
  5108. "./player": 155,
  5109. "./settings": 166,
  5110. "./util/logger": 189,
  5111. "./util/transitions": 195,
  5112. events: 202,
  5113. three: 217
  5114. }],
  5115. 16: [function(e, t, i) {
  5116. "use strict";
  5117. var n = e("three")
  5118. , r = e("./enum/Viewmode")
  5119. , o = (e("./settings"),
  5120. e("./util/transitions"))
  5121. , a = e("./enum/PlayerEvents")
  5122. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5123. , l = new n.ShaderPass(n.VerticalBlurShader);
  5124. l.renderToScreen = !0;
  5125. var c = $("#player").width() / $("#player").height();
  5126. isNaN(c) && (c = 1);
  5127. var h = {
  5128. currentBlur: 0,
  5129. aspect: c,
  5130. blurStrength: 1,
  5131. hblurPass: s,
  5132. vblurPass: l,
  5133. bindEvents: function(e) {
  5134. e.on(a.ModeChanged, function(e, t) {
  5135. e === r.PANORAMA && (o.cancel(h.blur),
  5136. o.cancel(h.addBlur),
  5137. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5138. })
  5139. },
  5140. blur: function(e) {
  5141. var t = (h.currentBlur = e) * h.blurStrength;
  5142. l.uniforms.v.value = t / 512 * h.aspect,
  5143. s.uniforms.h.value = t / 512
  5144. },
  5145. addBlur: function(e) {
  5146. e = Math.max(e, h.currentBlur),
  5147. h.blur(e)
  5148. },
  5149. removeBlur: function(e) {
  5150. e = Math.min(1 - e, h.currentBlur),
  5151. h.blur(e)
  5152. }
  5153. };
  5154. h.blur(0),
  5155. t.exports = h
  5156. }
  5157. , {
  5158. "./enum/PlayerEvents": 40,
  5159. "./enum/Viewmode": 51,
  5160. "./settings": 166,
  5161. "./util/transitions": 195,
  5162. three: 217
  5163. }],
  5164. 17: [function(e, t, i) {
  5165. "use strict";
  5166. t.exports = {
  5167. UNKNOWN: 0,
  5168. ALIGNED: 1,
  5169. UNALIGNED: 2,
  5170. PLACED: 3
  5171. }
  5172. }
  5173. , {}],
  5174. 18: [function(e, t, i) {
  5175. "use strict";
  5176. t.exports = {
  5177. NONE: 0,
  5178. MIDDLE: 1,
  5179. END: 2,
  5180. BEGINNING: 3,
  5181. FADEIN: 4
  5182. }
  5183. }
  5184. , {}],
  5185. 19: [function(e, t, i) {
  5186. "use strict";
  5187. var r = e("three");
  5188. t.exports = {
  5189. newBlue: new r.Color(4967932),
  5190. altBlue: new r.Color(47355),
  5191. tagDefault: new r.Color(223357),
  5192. classicBlue: new r.Color(53759),
  5193. mpYellow: new r.Color(16502016),
  5194. mpOrange: new r.Color(16428055),
  5195. mpBlue: new r.Color(12096),
  5196. mpLtGrey: new r.Color(13751252),
  5197. mpDkGrey: new r.Color(10000019),
  5198. mpRed: new r.Color(12525854),
  5199. mpOrangeDesat: new r.Color(16764529),
  5200. mpBlueDesat: new r.Color(4034734),
  5201. mpRedDesat: new r.Color(14705505),
  5202. white: new r.Color(16777215),
  5203. black: new r.Color(0),
  5204. _desat: function(e, t) {
  5205. var i = t || .3
  5206. , n = (new r.Color).copy(e).getHSL();
  5207. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5208. },
  5209. _darken: function(e, t) {
  5210. var i = t || .2
  5211. , n = e.getHSL();
  5212. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5213. }
  5214. }
  5215. }
  5216. , {
  5217. three: 217
  5218. }],
  5219. 20: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. NONE: -1,
  5223. ROTATE: 0,
  5224. DOLLY: 1,
  5225. PAN: 2,
  5226. ROTATE_DOLLY: 3,
  5227. PAN_DOLLY: 4
  5228. }
  5229. }
  5230. , {}],
  5231. 21: [function(e, t, i) {
  5232. "use strict";
  5233. t.exports = {
  5234. Move: "move",
  5235. InteractionDirect: "interaction.direct",
  5236. InteractionKey: "interaction.key",
  5237. InteractionGui: "interaction.gui",
  5238. FlyInDirection: "fly.direction",
  5239. InputStart: "input.start",
  5240. Pinch: "input.pinch",
  5241. Scroll: "input.scroll",
  5242. AutoPanInterrupt: "autopan.interrupt",
  5243. AutoPanComplete: "autopan.complete",
  5244. AutoPanClamped: "autopan.clamped",
  5245. LongTap: "longtap"
  5246. }
  5247. }
  5248. , {}],
  5249. 22: [function(e, t, i) {
  5250. "use strict";
  5251. t.exports = Object.freeze({
  5252. FORWARD: "FORWARD",
  5253. LEFT: "LEFT",
  5254. RIGHT: "RIGHT",
  5255. BACK: "BACK",
  5256. UP: "UP",
  5257. DOWN: "DOWN"
  5258. })
  5259. }
  5260. , {}],
  5261. 23: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. ActionInterrupted: "action.interrupted",
  5265. TourStart: "tour.start",
  5266. TourEnd: "tour.end",
  5267. StartModeChange: "mode.startChange"
  5268. }
  5269. }
  5270. , {}],
  5271. 24: [function(e, t, i) {
  5272. "use strict";
  5273. t.exports = Object.freeze({
  5274. None: 0,
  5275. Queued: 1,
  5276. ForceQueued: 2,
  5277. Downloading: 3,
  5278. Downloaded: 4,
  5279. DownloadFailed: 5
  5280. })
  5281. }
  5282. , {}],
  5283. 25: [function(e, t, i) {
  5284. "use strict";
  5285. t.exports = {
  5286. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5287. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5288. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5289. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5290. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5291. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5292. }
  5293. }
  5294. , {}],
  5295. 26: [function(e, t, i) {
  5296. "use strict";
  5297. t.exports = {
  5298. Texture2D: 0,
  5299. TextureCube: 1
  5300. }
  5301. }
  5302. , {}],
  5303. 27: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. SMALL: "small",
  5307. LARGE: "large"
  5308. }
  5309. }
  5310. , {}],
  5311. 28: [function(e, t, i) {
  5312. "use strict";
  5313. var n = e("./Viewmode")
  5314. , r = {
  5315. LANDING: {},
  5316. NAVIGATION: "navigation",
  5317. MORE_HELP: "moreHelp",
  5318. TOUR_INTERACTION: {}
  5319. };
  5320. r.LANDING[n.PANORAMA] = "panorama.landing",
  5321. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5322. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5323. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5324. r.TOUR_INTERACTION.standard = "standard.tour",
  5325. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5326. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5327. t.exports = r
  5328. }
  5329. , {
  5330. "./Viewmode": 51
  5331. }],
  5332. 29: [function(e, t, i) {
  5333. "use strict";
  5334. var n = {
  5335. UP: 1,
  5336. DOWN: -1,
  5337. LEFT: "L",
  5338. RIGHT: "R",
  5339. FORWARD: "F",
  5340. BACK: "B",
  5341. reverse: {},
  5342. opposite: function(e) {
  5343. return this.reverse[e.toString()]
  5344. }
  5345. };
  5346. n.reverse[n.UP] = n.DOWN,
  5347. n.reverse[n.DOWN] = n.UP,
  5348. n.reverse[n.LEFT] = n.RIGHT,
  5349. n.reverse[n.RIGHT] = n.LEFT,
  5350. n.reverse[n.FORWARD] = n.BACK,
  5351. n.reverse[n.BACK] = n.FORWARD,
  5352. t.exports = n
  5353. }
  5354. , {}],
  5355. 30: [function(e, t, i) {
  5356. "use strict";
  5357. var n = {
  5358. ZERO: 48,
  5359. ONE: 49,
  5360. TWO: 50,
  5361. THREE: 51,
  5362. FOUR: 52,
  5363. FIVE: 53,
  5364. SIX: 54,
  5365. SEVEN: 55,
  5366. EIGHT: 56,
  5367. NINE: 57,
  5368. LEFTARROW: 37,
  5369. UPARROW: 38,
  5370. RIGHTARROW: 39,
  5371. DOWNARROW: 40,
  5372. A: 65,
  5373. B: 66,
  5374. C: 67,
  5375. D: 68,
  5376. E: 69,
  5377. F: 70,
  5378. G: 71,
  5379. H: 72,
  5380. I: 73,
  5381. J: 74,
  5382. K: 75,
  5383. L: 76,
  5384. M: 77,
  5385. N: 78,
  5386. O: 79,
  5387. P: 80,
  5388. Q: 81,
  5389. R: 82,
  5390. S: 83,
  5391. T: 84,
  5392. U: 85,
  5393. V: 86,
  5394. W: 87,
  5395. X: 88,
  5396. Y: 89,
  5397. Z: 90,
  5398. SPACE: 32,
  5399. RETURN: 13,
  5400. SEMICOLON: 186,
  5401. PLUSEQUALS: 187,
  5402. DASHUNDERSCORE: 189,
  5403. OPENBRACKET: 219
  5404. };
  5405. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5406. n.PLUSEQUALS = 61,
  5407. n.DASHUNDERSCORE = 173),
  5408. t.exports = n
  5409. }
  5410. , {
  5411. "../util/browser": 182
  5412. }],
  5413. 31: [function(e, t, i) {
  5414. "use strict";
  5415. t.exports = {
  5416. EN_US: "en-US",
  5417. ES_MX: "es-MX",
  5418. FR_FR: "fr-FR",
  5419. DE_DE: "de-DE",
  5420. RU_RU: "ru-RU",
  5421. CN_CN: "cn-CN",
  5422. JP_JP: "jp-JP"
  5423. }
  5424. }
  5425. , {}],
  5426. 32: [function(e, t, i) {
  5427. "use strict";
  5428. t.exports = {
  5429. TagActivated: "tag.activated",
  5430. TagDismissed: "tag.dismissed",
  5431. TagNavigation: "tag.navigation"
  5432. }
  5433. }
  5434. , {}],
  5435. 33: [function(e, t, i) {
  5436. "use strict";
  5437. t.exports = {
  5438. ModelAdded: "model-added",
  5439. ActiveModelChanged: "active-model-changed"
  5440. }
  5441. }
  5442. , {}],
  5443. 34: [function(e, t, i) {
  5444. "use strict";
  5445. t.exports = {
  5446. LEFT: 0,
  5447. MIDDLE: 1,
  5448. RIGHT: 2
  5449. }
  5450. }
  5451. , {}],
  5452. 35: [function(e, t, i) {
  5453. "use strict";
  5454. t.exports = {
  5455. PanoRenderComplete: "panorama.render.complete",
  5456. TileRenderFailure: "panorama.tile.render.failed",
  5457. TileRenderSuccess: "panorama.tile.render.success",
  5458. TileUploadAttempted: "panorama.tile.upload.attempted",
  5459. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5460. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5461. }
  5462. }
  5463. , {}],
  5464. 36: [function(e, t, i) {
  5465. "use strict";
  5466. t.exports = {
  5467. BASE: 1,
  5468. STANDARD: 2,
  5469. HIGH: 3,
  5470. ULTRAHIGH: 4
  5471. }
  5472. }
  5473. , {}],
  5474. 37: [function(e, t, i) {
  5475. "use strict";
  5476. t.exports = {
  5477. LoadComplete: "panorama.load.complete",
  5478. LoadFailed: "panorama.load.failed",
  5479. TileLoaded: "panorama.tile.loaded"
  5480. }
  5481. }
  5482. , {}],
  5483. 38: [function(e, t, i) {
  5484. "use strict";
  5485. t.exports = Object.freeze({
  5486. Standard: 0,
  5487. Slow: 1,
  5488. Retain: 2
  5489. })
  5490. }
  5491. , {}],
  5492. 39: [function(e, t, i) {
  5493. "use strict";
  5494. t.exports = Object.freeze({
  5495. Show: 0,
  5496. Hide: 1,
  5497. Retain: 2
  5498. })
  5499. }
  5500. , {}],
  5501. 40: [function(e, t, i) {
  5502. "use strict";
  5503. t.exports = {
  5504. Move: "move",
  5505. MoveComplete: "move.complete",
  5506. ModeChanged: "mode.changed",
  5507. ModeChanging: "mode.changing",
  5508. PanoChosen: "pano.chosen",
  5509. ClosestPanoChanging: "closest.pano.changing",
  5510. WarpStarted: "warp.started",
  5511. WarpInterrupted: "warp.interrupted",
  5512. WarpEnded: "warp.ended",
  5513. FlyinFinished: "flyin.finished",
  5514. FlyingStarted: "flying.started",
  5515. FlyingInterrupted: "flying.interrupted",
  5516. FlyingEnded: "flying.ended",
  5517. Ready: "ready",
  5518. StartInside: "start.inside",
  5519. StartOutside: "start.outside",
  5520. ViewChanged: "view.changed",
  5521. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5522. InputStart: "input.start"
  5523. }
  5524. }
  5525. , {}],
  5526. 41: [function(e, t, i) {
  5527. "use strict";
  5528. t.exports = Object.freeze({
  5529. DEFAULT: 0,
  5530. PANOMARKERS: 1,
  5531. RETICULE: 2,
  5532. TAG: 3
  5533. })
  5534. }
  5535. , {}],
  5536. 42: [function(e, t, i) {
  5537. "use strict";
  5538. t.exports = {
  5539. visibleFloor: 1,
  5540. ghostFloor: 3,
  5541. boundingSkybox: 1,
  5542. panoMarker: 2,
  5543. reticule: 3,
  5544. tagStem: 4,
  5545. tagDisc: 5,
  5546. ribbon: 100
  5547. }
  5548. }
  5549. , {}],
  5550. 43: [function(e, t, i) {
  5551. "use strict";
  5552. t.exports = {
  5553. ContextCreated: "scene-renderer-context-created",
  5554. AfterRender: "after-render",
  5555. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5556. }
  5557. }
  5558. , {}],
  5559. 44: [function(e, t, i) {
  5560. "use strict";
  5561. t.exports = {
  5562. IDLE: "idle",
  5563. BROWSE: "browse",
  5564. EXAMINE: "examine"
  5565. }
  5566. }
  5567. , {}],
  5568. 45: [function(e, t, i) {
  5569. "use strict";
  5570. t.exports = {
  5571. TileDownloadSuccess: "tiledownloader.download.success",
  5572. TileDownloadFailure: "tiledownloader.download.failure",
  5573. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5574. }
  5575. }
  5576. , {}],
  5577. 46: [function(e, t, i) {
  5578. "use strict";
  5579. t.exports = {
  5580. CardboardAndroid: "googlevr",
  5581. GearVR: "gearvr",
  5582. CardboardIOS: "googlevrios",
  5583. Cardboard: "googlevr"
  5584. }
  5585. }
  5586. , {}],
  5587. 47: [function(e, t, i) {
  5588. "use strict";
  5589. t.exports = {
  5590. NONE: 0,
  5591. CONTEXTUAL: 1,
  5592. ANDROID: 2
  5593. }
  5594. }
  5595. , {}],
  5596. 48: [function(e, t, i) {
  5597. "use strict";
  5598. var n = {
  5599. Title: 0,
  5600. Cardboard: 1
  5601. }
  5602. , r = {
  5603. Title: 0,
  5604. Cardboard: 1,
  5605. Gear: 2
  5606. };
  5607. [n, r].forEach(function(e) {
  5608. e.pageCount = Object.keys(e).length
  5609. }),
  5610. t.exports.ios = n,
  5611. t.exports.standard = r
  5612. }
  5613. , {}],
  5614. 49: [function(e, t, i) {
  5615. "use strict";
  5616. t.exports = {
  5617. Android: "android",
  5618. IOS: "ios",
  5619. Desktop: "desktop",
  5620. UnsupportedAndroid: "android-unsupported"
  5621. }
  5622. }
  5623. , {}],
  5624. 50: [function(e, t, i) {
  5625. "use strict";
  5626. var n = e("three");
  5627. t.exports = {
  5628. UP: new n.Vector3(0,1,0),
  5629. DOWN: new n.Vector3(0,-1,0),
  5630. LEFT: new n.Vector3(-1,0,0),
  5631. RIGHT: new n.Vector3(1,0,0),
  5632. FORWARD: new n.Vector3(0,0,-1),
  5633. BACK: new n.Vector3(0,0,1)
  5634. }
  5635. }
  5636. , {
  5637. three: 217
  5638. }],
  5639. 51: [function(e, t, i) {
  5640. "use strict";
  5641. var n = e("../exception/ViewmodeConvertException")
  5642. , r = e("./coreViewmodes")
  5643. , o = {
  5644. MESH: "mesh",
  5645. OUTDOOR: "outdoor",
  5646. TRANSITIONING: "transitioning",
  5647. toInt: function(e) {
  5648. switch (e) {
  5649. case this.PANORAMA:
  5650. return 1;
  5651. case this.DOLLHOUSE:
  5652. return 2;
  5653. case this.FLOORPLAN:
  5654. return 3;
  5655. case this.OUTDOOR:
  5656. return 4;
  5657. case this.TRANSITIONING:
  5658. return -1
  5659. }
  5660. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5661. },
  5662. fromInt: function(e) {
  5663. switch (e) {
  5664. case "1":
  5665. case 1:
  5666. return this.PANORAMA;
  5667. case "2":
  5668. case 2:
  5669. return this.DOLLHOUSE;
  5670. case "3":
  5671. case 3:
  5672. return this.FLOORPLAN;
  5673. case "4":
  5674. case 4:
  5675. return this.OUTDOOR
  5676. }
  5677. throw new n("No known conversion for int to viewmode for int: " + e)
  5678. },
  5679. convertWorkshopModeInt: function(e) {
  5680. switch (e) {
  5681. case "0":
  5682. case 0:
  5683. case void 0:
  5684. return this.PANORAMA;
  5685. case "1":
  5686. case 1:
  5687. return this.FLOORPLAN;
  5688. case "2":
  5689. case 2:
  5690. return this.DOLLHOUSE;
  5691. case "3":
  5692. case 3:
  5693. return this.MESH
  5694. }
  5695. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5696. }
  5697. };
  5698. e("../util/common").extendObject(o, r),
  5699. t.exports = o
  5700. }
  5701. , {
  5702. "../exception/ViewmodeConvertException": 58,
  5703. "../util/common": 185,
  5704. "./coreViewmodes": 54
  5705. }],
  5706. 52: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. BLACK: "black",
  5710. STD: "std",
  5711. WALK: "walk"
  5712. }
  5713. }
  5714. , {}],
  5715. 53: [function(e, t, i) {
  5716. "use strict";
  5717. t.exports = {
  5718. ZoomIn: "zoom.in",
  5719. ZoomOut: "zoom.out",
  5720. ZoomMax: "zoom.max",
  5721. ZoomMin: "zoom.min"
  5722. }
  5723. }
  5724. , {}],
  5725. 54: [function(e, t, i) {
  5726. "use strict";
  5727. t.exports = {
  5728. PANORAMA: "panorama",
  5729. DOLLHOUSE: "dollhouse",
  5730. FLOORPLAN: "floorplan"
  5731. }
  5732. }
  5733. , {}],
  5734. 55: [function(e, t, i) {
  5735. "use strict";
  5736. t.exports = function(e) {
  5737. this.message = e
  5738. }
  5739. }
  5740. , {}],
  5741. 56: [function(e, t, i) {
  5742. "use strict";
  5743. function n(e) {
  5744. r.call(this, e)
  5745. }
  5746. var r = e("./BasicException");
  5747. n.prototype = Object.create(r.prototype),
  5748. t.exports = n
  5749. }
  5750. , {
  5751. "./BasicException": 55
  5752. }],
  5753. 57: [function(e, t, i) {
  5754. "use strict";
  5755. function n(e) {
  5756. r.call(this, e)
  5757. }
  5758. var r = e("./BasicException");
  5759. n.prototype = Object.create(r.prototype),
  5760. t.exports = n
  5761. }
  5762. , {
  5763. "./BasicException": 55
  5764. }],
  5765. 58: [function(e, t, i) {
  5766. "use strict";
  5767. function n(e) {
  5768. r.call(this, e)
  5769. }
  5770. var r = e("./BasicException");
  5771. n.prototype = Object.create(r.prototype),
  5772. t.exports = n
  5773. }
  5774. , {
  5775. "./BasicException": 55
  5776. }],
  5777. 59: [function(a, s, e) {
  5778. (function(e) {
  5779. "use strict";
  5780. var i = a("./util/ajax")
  5781. , n = a("./util/showcase")
  5782. , t = a("./util/logger")
  5783. , r = new t(e)
  5784. , o = {};
  5785. s.exports = {
  5786. loadFeatureFlags: function(e) {
  5787. var t = $.Deferred();
  5788. return i.get(e.urlBase + "", {
  5789. responseType: "json",
  5790. prefetchFrom: "user",
  5791. auth: n.getAuthorizationHeader()
  5792. }).done(function(e) {
  5793. (o = function(e) {
  5794. var t = {};
  5795. if (e) {
  5796. var i = e.flags;
  5797. if (i)
  5798. for (var n in i)
  5799. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5800. return t
  5801. }
  5802. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5803. null
  5804. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5805. }).fail(function() {
  5806. r.debug("Retrieval of feature flags failed."),
  5807. t.reject("loading-failed")
  5808. }),
  5809. t.promise()
  5810. },
  5811. getFlags: function() {
  5812. return o
  5813. },
  5814. updateDependentSettings: function(e, t) {
  5815. (e = e || o).labels && (t.labels.enabled = !0),
  5816. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5817. e.showcase_sdk && (t.sdkInit = !0),
  5818. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5819. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5820. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5821. e.hide_sc_sharing && (t.share.enabled = !1)
  5822. }
  5823. }
  5824. }
  5825. ).call(this, "/js/featureflags.js")
  5826. }
  5827. , {
  5828. "./util/ajax": 181,
  5829. "./util/logger": 189,
  5830. "./util/showcase": 193
  5831. }],
  5832. 60: [function(e, t, i) {
  5833. "use strict";
  5834. var n = (e("../util/common"),
  5835. {
  5836. status: 0,
  5837. set: function(e) {
  5838. if (isNaN(e))
  5839. return !1;
  5840. var t = $(".progressbar");
  5841. e < 0 && (e = 0),
  5842. 100 < e && (e = 100);
  5843. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5844. , n = Math.round(e)
  5845. , r = parseInt(i) - 15;
  5846. t.find(".bar").css("width", i),
  5847. t.find(".label").css("left", r),
  5848. t.find(".perc").text(n + "%"),
  5849. this.status = e
  5850. },
  5851. done: function(e) {
  5852. return e || this.status ? (this.status = null,
  5853. this.set(100)) : this
  5854. }
  5855. });
  5856. t.exports.circleLoader = n
  5857. }
  5858. , {
  5859. "../util/common": 185
  5860. }],
  5861. 61: [function(e, t, i) {
  5862. "use strict";
  5863. t.exports = Object.freeze({
  5864. CLOSE: "modal.closer.close"
  5865. })
  5866. }
  5867. , {}],
  5868. 62: [function(e, t, i) {
  5869. "use strict";
  5870. function n(t, e) {
  5871. function i() {
  5872. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5873. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5874. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5875. c.classList.remove("closeByFooter")))
  5876. }
  5877. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5878. }
  5879. var r = e("../../settings")
  5880. , o = (e("../../tag/Media/MediaEvent"),
  5881. e("../../util/browser"))
  5882. , a = e("../../util/common")
  5883. , s = e("./ModalCloserEvent")
  5884. , l = e("events").EventEmitter
  5885. , c = document.getElementsByClassName("footer")[0]
  5886. , h = c.querySelectorAll(".close")[0]
  5887. , u = null
  5888. , d = null
  5889. , p = null
  5890. , f = (o.isMobile(),
  5891. {
  5892. open: function(e) {
  5893. e && (n(e),
  5894. u && h.removeEventListener("click", u, !0),
  5895. u = function(e, t) {
  5896. t && (t.stopPropagation(),
  5897. t.preventDefault()),
  5898. e && this.emit(s.CLOSE, e),
  5899. f.reset()
  5900. }
  5901. .bind(this, e.id),
  5902. h.addEventListener("click", u, !0),
  5903. d && window.removeEventListener("resize", d, !0),
  5904. d = n.bind(this, e),
  5905. window.addEventListener("resize", d, !0))
  5906. },
  5907. reset: function() {
  5908. c.classList.remove("closeByFooter"),
  5909. h.removeEventListener("click", u, !0),
  5910. window.removeEventListener("resize", d, !0),
  5911. u = d = p = null
  5912. }
  5913. });
  5914. a.extendObject(f, l.prototype),
  5915. t.exports = f
  5916. }
  5917. , {
  5918. "../../tag/Media/MediaEvent": 131,
  5919. "../../settings": 166,
  5920. "../../util/browser": 182,
  5921. "../../util/common": 185,
  5922. "./ModalCloserEvent": 61,
  5923. events: 202
  5924. }],
  5925. 63: [function(e, t, i) {
  5926. "use strict";
  5927. var A = e("../lib/dat.gui")
  5928. , C = e("three")
  5929. , I = e("../util/easing")
  5930. , E = e("../enum/Viewmode")
  5931. , _ = e("../enum/Colors")
  5932. , b = e("../enum/WarpStyle")
  5933. , w = e("../settings");
  5934. e("../tag/tag"),
  5935. A.GUI.prototype.removeFolder = function(e) {
  5936. var t = this.__folders[e];
  5937. t && (t.close(),
  5938. this.__ul.removeChild(t.domElement.parentNode),
  5939. delete this.__folders[e],
  5940. this.onResize())
  5941. }
  5942. ,
  5943. t.exports.toggle = function(t, e, i) {
  5944. var n = new A.GUI({
  5945. width: 400
  5946. })
  5947. , r = n.addFolder("Flydown from Dollhouse");
  5948. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5949. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5950. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5951. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5952. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5953. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5954. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5955. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5956. var o = n.addFolder("Transition between panos");
  5957. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5958. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5959. w.transition.flyTime = 0,
  5960. o.__controllers.forEach(function(e) {
  5961. e.updateDisplay()
  5962. })
  5963. }),
  5964. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5965. w.transition.flySpeed = 0,
  5966. o.__controllers.forEach(function(e) {
  5967. e.updateDisplay()
  5968. })
  5969. }),
  5970. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5971. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5972. o.add(w.transition, "movementEasing", Object.keys(I));
  5973. var a = n.addFolder("Path Display");
  5974. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5975. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5976. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5977. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5978. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5979. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5980. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5981. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5982. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5983. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5984. w.path.color = _[w.path.color],
  5985. w.path.colorUp = _._desat(w.path.color),
  5986. w.path.colorDown = _.darken(w.path.color)
  5987. }),
  5988. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5989. w.reticuleColor = _[w.reticuleColor]
  5990. });
  5991. var s = n.addFolder("Warping")
  5992. , l = s.addFolder("Warp/Teleport");
  5993. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5994. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5995. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5996. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5997. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5998. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5999. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6000. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6001. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6002. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6003. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  6004. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6005. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6006. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  6007. w.path.typ = b[w.path.typ]
  6008. }),
  6009. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6010. e.endlessLoop = w.warp.loop
  6011. }),
  6012. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6013. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6014. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6015. var c = s.addFolder("Long Warp Only");
  6016. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6017. w.warp.flySpeed = 0,
  6018. c.__controllers.forEach(function(e) {
  6019. e.updateDisplay()
  6020. })
  6021. }),
  6022. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6023. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6024. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6025. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6026. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6027. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6028. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6029. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6030. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6031. var h = n.addFolder("Warp Esoterica");
  6032. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6033. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  6034. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6035. w.warp.minWarpTime = 0,
  6036. h.__controllers.forEach(function(e) {
  6037. e.updateDisplay()
  6038. })
  6039. }),
  6040. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  6041. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6042. h.add(w.warp, "movementEasing", Object.keys(I));
  6043. var u = n.addFolder("Misc");
  6044. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  6045. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  6046. }),
  6047. u.add(w, "insideFOV", 10, 180).onChange(function() {
  6048. i.cameras[E.PANORAMA].fov = w.insideFOV
  6049. }),
  6050. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6051. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6052. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6053. var d = n.addFolder("Navigation");
  6054. d.add(w.navigation, "panoScores").onFinishChange(function() {
  6055. w.navigation.panoScores || t.panos.forEach(function(e) {
  6056. e.floor.remove(e.text3d),
  6057. e.text3d = null
  6058. })
  6059. }),
  6060. d.add(w.navigation, "mouseDirection"),
  6061. d.add(w.navigation, "filterStrictness", 0, 1),
  6062. d.add(w.navigation, "angleFactor", -60, 0),
  6063. d.add(w.navigation, "directionFactor", 1, 20),
  6064. d.add(w.navigation, "distanceFactor", -5, 5),
  6065. d.add(w.navigation, "optionalityFactor", .1, 10);
  6066. var p = n.addFolder("tags")
  6067. , f = p.addFolder("Tag Creation");
  6068. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  6069. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6070. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6071. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6072. var g = p.addFolder("Visibility");
  6073. g.add(w.tags.visibility, "anyDistance"),
  6074. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6075. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6076. g.add(w.tags.visibility, "hideViaFloor"),
  6077. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6078. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6079. var m = p.addFolder("Disc Parameters");
  6080. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6081. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6082. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6083. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  6084. }),
  6085. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6086. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  6087. }),
  6088. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  6089. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  6090. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6091. var v = p.addFolder("Navigate");
  6092. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  6093. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  6094. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  6095. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6096. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6097. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6098. var y = n.addFolder("Debug");
  6099. y.add(w, "wireframe").onFinishChange(function() {
  6100. t.chunks.forEach(function(e) {
  6101. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  6102. e.wireframeTwin.material.depthWrite = !1,
  6103. e.wireframeTwin.material.depthTest = !1,
  6104. e.wireframeTwin.material.opacity = .5,
  6105. e.wireframeTwin.material.transparent = !0),
  6106. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  6107. })
  6108. }),
  6109. y.add(w, "skyboxWireframe").onFinishChange(function() {
  6110. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  6111. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  6112. t.skybox.wireframe = null)
  6113. }),
  6114. y.add(w, "showSweeps").onFinishChange(function() {
  6115. t.setSweepVisibility(w.showSweeps)
  6116. }),
  6117. y.add(w, "showMesh").onFinishChange(function() {
  6118. t.chunks.forEach(function(e) {
  6119. e.visible = w.showMesh
  6120. })
  6121. }),
  6122. y.add(w, "showFloors").onFinishChange(function() {
  6123. t.floors.forEach(function(e) {
  6124. e.collider.children.forEach(function(e) {
  6125. e.material.visible = w.showFloors
  6126. })
  6127. })
  6128. }),
  6129. y.add(w, "showSkyboxes").onFinishChange(function() {
  6130. t.panos.forEach(function(e) {
  6131. e.skyboxMesh.visible = w.showSkyboxes
  6132. })
  6133. }),
  6134. y.add(w, "showNeighbors").onChange(function() {}),
  6135. y.add(t, "alpha", 0, 1)
  6136. }
  6137. }
  6138. , {
  6139. "../enum/Colors": 19,
  6140. "../enum/Viewmode": 51,
  6141. "../enum/WarpStyle": 52,
  6142. "../lib/dat.gui": 93,
  6143. "../tag/tag": 123,
  6144. "../settings": 166,
  6145. "../util/easing": 186,
  6146. three: 217
  6147. }],
  6148. 64: [function(c, h, e) {
  6149. (function(e) {
  6150. "use strict";
  6151. function i(e, t, i, n) {
  6152. $(".gui-error .error-problem-text").text(e),
  6153. $(".gui-error .error-solution-text").text(t),
  6154. $(".gui-error .error-explanation").text(i),
  6155. $(".gui-error .error-actions").html(n),
  6156. $(window).resize(),
  6157. $(".gui-error").fadeIn(),
  6158. $("#bottom-logo").fadeIn()
  6159. }
  6160. function n(e) {
  6161. 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("");
  6162. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  6163. r.isMobile() || $("[rel=tiletip]").tooltip({
  6164. placement: "bottom",
  6165. delay: {
  6166. show: 50,
  6167. hide: 0
  6168. },
  6169. trigger: "hover",
  6170. viewport: {
  6171. selector: "body",
  6172. padding: 10
  6173. }
  6174. })
  6175. }
  6176. function t() {
  6177. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  6178. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  6179. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  6180. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6181. e.preventDefault(),
  6182. e.stopPropagation(),
  6183. n(" ")
  6184. })
  6185. }
  6186. var r = c("./../util/browser")
  6187. , o = c("./../analytics")
  6188. , a = c("./../settings")
  6189. , s = c("../localization/localize")
  6190. , l = new (c("./../util/logger"))(e);
  6191. h.exports.error = function(e) {
  6192. if ($("head title").text(a.pageTitle),
  6193. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6194. $("#gui-loading").fadeOut(250),
  6195. $("#quick-blackout").hide(),
  6196. o.track("showcase_error", {
  6197. error_key: e
  6198. }),
  6199. s.locale || s.init(),
  6200. "webgl-unsupported" === e)
  6201. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6202. else if ("webgl-ios" === e)
  6203. 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>.");
  6204. else if ("webgl-safari" === e)
  6205. 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>.");
  6206. else if ("webgl-generic" === e)
  6207. t();
  6208. else if ("missing-urls" === e)
  6209. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6210. else if ("loading-failed" === e)
  6211. 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>.");
  6212. else {
  6213. if ("loading-failed-maintenance" !== e)
  6214. return void l.error("Unhandled error: " + e);
  6215. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6216. }
  6217. }
  6218. }
  6219. ).call(this, "/js/gui/error.js")
  6220. }
  6221. , {
  6222. "../localization/localize": 108,
  6223. "./../analytics": 4,
  6224. "./../settings": 166,
  6225. "./../util/browser": 182,
  6226. "./../util/logger": 189
  6227. }],
  6228. 65: [function(Oe, Le, e) {
  6229. (function(e) {
  6230. "use strict";
  6231. function c() {
  6232. for (var e in Ce)
  6233. if (Ce.hasOwnProperty(e)) {
  6234. var t = Ce[e];
  6235. if (!t.visible)
  6236. for (var i = 0; i < t.elements.length; i++)
  6237. $(t.elements[i]).hide()
  6238. }
  6239. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6240. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6241. ge = [],
  6242. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6243. ge.push(".hideTarget", ".pinTop.right")
  6244. }
  6245. function v(e, t) {
  6246. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6247. $("#gui-zoomin").toggle(i),
  6248. $("#gui-zoomout").toggle(i)
  6249. }
  6250. function l() {
  6251. n(),
  6252. $(".pinBottom").toggleClass("open"),
  6253. $("#drawer").toggleClass("open"),
  6254. $(".footer").toggleClass("open"),
  6255. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6256. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6257. O.resetDrawer()),
  6258. setTimeout(function() {
  6259. $("#pullTab").toggleClass("opened")
  6260. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6261. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6262. }
  6263. function t(e) {
  6264. var t;
  6265. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6266. t = e.position().top + e.outerHeight(),
  6267. e.attr("style", "display: none")),
  6268. $("#player").outerHeight() - 130 < t + 25
  6269. }
  6270. function y(e) {
  6271. "touchstart" === e.type && e.preventDefault(),
  6272. e.stopPropagation()
  6273. }
  6274. function n() {
  6275. w && (w.reload(),
  6276. w.init())
  6277. }
  6278. function r() {
  6279. $("#gui-spinner").stop(!0, !0),
  6280. $("#gui-spinner").fadeOut(1e3),
  6281. !(Ae = !0)
  6282. }
  6283. function A(e, t) {
  6284. var i = e.mode
  6285. , n = t || e.currentPano;
  6286. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6287. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6288. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6289. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6290. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6291. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6292. $("#gui-modes-outside").removeClass("desktop-only")),
  6293. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6294. pe = i,
  6295. $("#gui-modes-outside").addClass("hidden"),
  6296. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6297. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6298. }
  6299. function C(t, i) {
  6300. function e() {
  6301. document.getElementById("vr").classList.remove("hidden"),
  6302. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6303. S.supportsFullscreen() ? function(e) {
  6304. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6305. Q.init(t.data, i, e, x),
  6306. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6307. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6308. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6309. $(".improper-embed").toggleClass("hidden", !1),
  6310. n())
  6311. }, function(e) {
  6312. n()
  6313. }) : n()
  6314. }
  6315. function n() {
  6316. var e;
  6317. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6318. X.init(t.data, x),
  6319. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6320. function() {
  6321. _e("vr"),
  6322. V.open(e)
  6323. }
  6324. )),
  6325. X.on(Z.CLOSED, V.reset)
  6326. }
  6327. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6328. switch (M.vr.option) {
  6329. case le.CONTEXTUAL:
  6330. e();
  6331. break;
  6332. case le.ANDROID:
  6333. S.detectAndroid() && e();
  6334. break;
  6335. case le.NONE:
  6336. }
  6337. }
  6338. function h(e, i) {
  6339. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6340. if ("372" !== getQueryVariable("m")) {
  6341. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6342. $(".gui-floor").find(".container").prepend(r)
  6343. }
  6344. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6345. n.on("click", function(e) {
  6346. y(e),
  6347. _e("floor"),
  6348. n.toggleClass("open")
  6349. }),
  6350. $(".floorChoice").on("click", function(e) {
  6351. y(e);
  6352. var t = $(this).data("index");
  6353. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6354. i.player.gotoFloor(t),
  6355. R.track("showcase_gui", {
  6356. gui_action: "click_floor_select_button",
  6357. interaction_source: "gui"
  6358. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6359. _e("move"),
  6360. i.allFloors(),
  6361. R.track("showcase_gui", {
  6362. gui_action: "click_toggle_all_floors_button",
  6363. interaction_source: "gui"
  6364. })),
  6365. n.removeClass("open")
  6366. })
  6367. }
  6368. function I(e, t) {
  6369. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6370. $(".gui-floor-icon").hide(),
  6371. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6372. $(".gui-floor-icon").show(),
  6373. $(".gui-floor-title").hide()),
  6374. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6375. $(".gui-floor-number").text(se.FLOOR_ALL),
  6376. $(".floorChoice").removeClass("active"),
  6377. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6378. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6379. $(".floorChoice").removeClass("active"),
  6380. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6381. }
  6382. function E() {
  6383. var e = $("#player").width() - 20
  6384. , t = $("#scroller")
  6385. , i = $("#drawer")
  6386. , n = $(".pinBottom");
  6387. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6388. i.addClass("noScroll"),
  6389. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6390. i.toggleClass("noScroll"),
  6391. n.toggleClass("noScroll"))
  6392. }
  6393. function _(e) {
  6394. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6395. e = e || 0,
  6396. Ae = !1,
  6397. window.setTimeout(function() {
  6398. Ae || (!0,
  6399. $("#gui-spinner").stop(!0, !0).show())
  6400. }
  6401. .bind(this), e)
  6402. }(M.modelComponentLoadSpinnerDelay)
  6403. }
  6404. function b(e, t) {
  6405. for (var i = []; e; )
  6406. i.push(e),
  6407. e = e.parentNode;
  6408. for (; t && -1 === i.indexOf(t); )
  6409. t = t.parentNode;
  6410. return t
  6411. }
  6412. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6413. Oe("../util/ajax"),
  6414. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6415. Oe("../util/camera"),
  6416. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6417. 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"),
  6418. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6419. Oe("../enum/PathDisplayMode"),
  6420. Oe("../enum/DirectorEvents"),
  6421. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6422. Oe("../enum/WarpStyle"),
  6423. Oe("../enum/AlignmentType"),
  6424. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6425. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6426. coBrand: {
  6427. visible: !0,
  6428. elements: [".co-brand", "#loaderCoBrand"]
  6429. },
  6430. help: {
  6431. visible: !0,
  6432. elements: [".nav-help", "#nav-help"]
  6433. },
  6434. tourControls: {
  6435. visible: !0,
  6436. elements: [".next", ".previous", "#play"]
  6437. },
  6438. highlight: {
  6439. visible: !0,
  6440. elements: ["#drawer", "#pullTab"]
  6441. },
  6442. share: {
  6443. visible: !0,
  6444. elements: [".socialButton", "#share"]
  6445. },
  6446. fullScreen: {
  6447. visible: !0,
  6448. elements: ["#gui-fullscreen"]
  6449. },
  6450. floors: {
  6451. visible: !0,
  6452. elements: [".gui-floor"]
  6453. }
  6454. }, Ie = (g = document.getElementById("drawer"),
  6455. function() {
  6456. $("#player").height() < 400 && g.classList.contains("open") && l()
  6457. }
  6458. ), Ee = (f = document.getElementById("meta-info"),
  6459. function() {
  6460. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6461. }
  6462. ), _e = (i = document.getElementById("meta-info"),
  6463. s = document.getElementById("interaction-modal"),
  6464. u = $("#drawer").eq(0),
  6465. d = $(".gui-floor").eq(0),
  6466. p = $(".vr-popup").eq(0),
  6467. function(e) {
  6468. switch (e) {
  6469. case "info":
  6470. we(),
  6471. Te(),
  6472. Ie(),
  6473. Me(),
  6474. Re(),
  6475. xe(),
  6476. Pe();
  6477. break;
  6478. case "terms":
  6479. be(),
  6480. Te(),
  6481. Se(),
  6482. Me(),
  6483. Re(),
  6484. xe(),
  6485. Pe();
  6486. break;
  6487. case "help":
  6488. be(),
  6489. we(),
  6490. Me(),
  6491. Re(),
  6492. xe(),
  6493. Pe();
  6494. break;
  6495. case "vr":
  6496. be(),
  6497. we(),
  6498. Me(),
  6499. Re(),
  6500. Te(),
  6501. Pe(),
  6502. t(p) && Se();
  6503. break;
  6504. case "highlights":
  6505. Ee(),
  6506. we(),
  6507. Me(),
  6508. Re();
  6509. break;
  6510. case "share":
  6511. be(),
  6512. we(),
  6513. Te(),
  6514. Re(),
  6515. xe(),
  6516. Pe();
  6517. break;
  6518. case "floor":
  6519. we(),
  6520. Me(),
  6521. xe();
  6522. break;
  6523. case "view":
  6524. Re(),
  6525. Me(),
  6526. we(),
  6527. xe();
  6528. break;
  6529. case "tour":
  6530. case "move":
  6531. we(),
  6532. Me(),
  6533. Re(),
  6534. xe();
  6535. break;
  6536. case "resize":
  6537. be(),
  6538. Ie(),
  6539. Re();
  6540. break;
  6541. case "tag":
  6542. we(),
  6543. Te(),
  6544. Me(),
  6545. Re(),
  6546. xe()
  6547. }
  6548. }
  6549. );
  6550. function be() {
  6551. i.classList.contains("expand") && z.toggleMeta(!0)
  6552. }
  6553. function we() {
  6554. W.hide()
  6555. }
  6556. function Te() {
  6557. U.close()
  6558. }
  6559. function xe() {
  6560. X.dismiss()
  6561. }
  6562. function Se() {
  6563. u.hasClass("open") && l()
  6564. }
  6565. function Me() {
  6566. K.hide()
  6567. }
  6568. function Re() {
  6569. d.hasClass("open") && d.removeClass("open")
  6570. }
  6571. function Pe() {
  6572. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6573. }
  6574. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6575. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6576. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6577. setTimeout(function() {
  6578. $(".icon:visible").hide().show(0)
  6579. }, 100)
  6580. }),
  6581. $("#gui-fullscreen").find("a").on("click", function(e) {
  6582. y(e),
  6583. S.requestFullscreen($("body")[0]),
  6584. R.track("showcase_gui", {
  6585. gui_action: "click_enter_fullscreen",
  6586. interaction_source: "gui"
  6587. })
  6588. }),
  6589. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6590. y(e),
  6591. S.exitFullscreen(),
  6592. R.track("showcase_gui", {
  6593. gui_action: "click_exit_fullscreen",
  6594. interaction_source: "gui"
  6595. })
  6596. }),
  6597. $(window).on("resize", function(e) {
  6598. var t = e.target.innerHeight
  6599. , i = e.target.innerWidth;
  6600. t === o && i === a || (Ce.highlight.visible && E(),
  6601. _e("resize"),
  6602. $(".pinTop.right").removeClass("hideUnderMeta"),
  6603. n(),
  6604. o = t,
  6605. a = i)
  6606. }).resize(),
  6607. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6608. $("#pullTab").on("click", function(e) {
  6609. y(e),
  6610. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6611. gui_action: "hide_highlight_reel"
  6612. }),
  6613. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6614. gui_action: "show_highlight_reel"
  6615. }),
  6616. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6617. l()
  6618. }),
  6619. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6620. $("#hotList").on("click", function(e) {
  6621. y(e);
  6622. var t = $("#hotListWrap")[0];
  6623. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6624. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6625. this.classList.add("active"))
  6626. }),
  6627. $("#hotListContent ul").on("mouseover", function(e) {
  6628. y(e);
  6629. var t = e.target
  6630. , i = document.getElementById("hotListWrap");
  6631. if ("SPAN" === t.tagName) {
  6632. var n = t.parentElement.parentElement;
  6633. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6634. } else if ("LI" === t.tagName) {
  6635. n = t.parentElement;
  6636. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6637. } else
  6638. i.style.width = ""
  6639. }),
  6640. $("#hotListContent ul").on("click", function(e) {
  6641. y(e),
  6642. this.preElem && this.preElem.classList.remove("active"),
  6643. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6644. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6645. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6646. e.target.hot && e.target.hot.examine(!0),
  6647. this.preElem = e.target)
  6648. }),
  6649. $("#hotListClose").on("click", function(e) {
  6650. y(e),
  6651. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6652. $("#hotListContent ul .active").removeClass("active"),
  6653. $("#hotList")[0].classList.remove("active")
  6654. })),
  6655. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6656. $("#more-menu-button").on("click", function(e) {
  6657. y(e),
  6658. $("#more-menu").toggleClass("open")
  6659. }),
  6660. Le.exports.init = function(s, l, c, e, t, i, n) {
  6661. var r;
  6662. x = n,
  6663. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6664. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6665. F.init(),
  6666. D.init(s, i),
  6667. ce.init(s, l, e),
  6668. $(".icon").on("mouseover", function() {
  6669. l.player && l.player.reticule.hide()
  6670. }),
  6671. function(e, t) {
  6672. var i = t.player;
  6673. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6674. y(e),
  6675. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6676. R.track("USER", {
  6677. event_type: "showcase_gui",
  6678. gui_action: "click_inside_mode_button"
  6679. }),
  6680. t.changeMode(ie.PANORAMA)
  6681. }),
  6682. $("#gui-modes-outside").find("a").on("click", function(e) {
  6683. y(e),
  6684. R.track("showcase_gui", {
  6685. gui_action: "click_outside_mode_button"
  6686. }),
  6687. t.changeMode(pe)
  6688. }),
  6689. $("#gui-modes-floorplan").on("click", function(e) {
  6690. y(e),
  6691. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6692. gui_action: "click_floorplan_mode_button"
  6693. }),
  6694. t.changeMode(ie.FLOORPLAN))
  6695. }),
  6696. $("#gui-modes-dollhouse").on("click", function(e) {
  6697. y(e),
  6698. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6699. gui_action: "click_dollhouse_mode_button"
  6700. }),
  6701. t.changeMode(ie.DOLLHOUSE))
  6702. })
  6703. }(0, l),
  6704. function(e, t) {
  6705. $("#play").on("mousedown touchstart", function(e) {
  6706. y(e),
  6707. _e("tour"),
  6708. q.play(),
  6709. R.trackAlways("showcase_gui", {
  6710. gui_action: "play_highlights"
  6711. })
  6712. }),
  6713. window.startAndPlay = function(e) {
  6714. _e("tour"),
  6715. q.play(),
  6716. R.trackAlways("showcase_gui", {
  6717. gui_action: "play_highlights"
  6718. })
  6719. }
  6720. ,
  6721. $("#pause").on("mousedown touchstart", function(e) {
  6722. y(e),
  6723. q.pause(),
  6724. R.trackAlways("showcase_gui", {
  6725. gui_action: "pause_highlights"
  6726. })
  6727. }),
  6728. $("#gui-zoomin").find("a").on("click", function(e) {
  6729. y(e),
  6730. t.player.zoomInIncrementally()
  6731. }),
  6732. $("#gui-zoomout").find("a").on("click", function(e) {
  6733. y(e),
  6734. t.player.zoomOutIncrementally()
  6735. })
  6736. }(0, l),
  6737. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6738. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6739. function() {
  6740. _e("share"),
  6741. V.open(r)
  6742. }
  6743. )),
  6744. K.on(ae.CLOSED, V.reset)),
  6745. 0 < s.heroLocations.length ? function(e, i, t) {
  6746. var n = 100 / (fe = e.heroLocations.length) + "%"
  6747. , r = $("#thumb-container")
  6748. , o = $("#progressBar");
  6749. $("#status").find(".totalSteps").text(fe);
  6750. for (var a = 0; a < fe; a++) {
  6751. var s = e.heroLocations[a]
  6752. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6753. if(s.heroLocations){//有子项,选第一张截图
  6754. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6755. }else{
  6756. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6757. }
  6758. if (l.attr("data-index", a),
  6759. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6760. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6761. s.name) {
  6762. var c = $('<div class="overlay"></div>').text(s.name);
  6763. l.prepend(c)
  6764. }
  6765. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6766. var h = e.panos.get(s.panoId)
  6767. , 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>';
  6768. l.prepend(u)
  6769. }
  6770. r.append(l),
  6771. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6772. }
  6773. T = 144 * fe,
  6774. 111 * fe,
  6775. $(".thumbImg").on("mouseover", function() {
  6776. !function(e) {
  6777. return e.describe().inTransition
  6778. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6779. }),
  6780. $(".thumbImg").on("mouseout", function() {
  6781. i.clearPath()
  6782. }),
  6783. $(".thumbImg").on("click", function(e) {
  6784. y(e);
  6785. var t = $(this);
  6786. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6787. R.trackAlways("showcase_gui", {
  6788. gui_action: "click_highlight"
  6789. }),
  6790. i.goToHighlight([t.data("index"),0])//改
  6791. }),
  6792. $(".previous").find("a").on("click", function(e) {
  6793. y(e),
  6794. R.trackAlways("showcase_gui", {
  6795. gui_action: "prev_highlight"
  6796. }),
  6797. i.prevHighlight()
  6798. }),
  6799. $(".next").find("a").on("click", function(e) {
  6800. y(e),
  6801. R.trackAlways("showcase_gui", {
  6802. gui_action: "next_highlight"
  6803. }),
  6804. i.nextHighlight()
  6805. }),
  6806. $("#drawer").on("mouseleave", function(t) {
  6807. var i;
  6808. y(t);
  6809. try {
  6810. i = new MouseEvent("mouseup",{
  6811. clientX: t.clientX,
  6812. clientY: t.clientY,
  6813. screenX: t.screenX,
  6814. screenY: t.screenY
  6815. })
  6816. } catch (e) {
  6817. (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)
  6818. }
  6819. document.dispatchEvent(i)
  6820. }),
  6821. (w = new Sly($("#scrollFrame"),{
  6822. horizontal: !0,
  6823. itemNav: "centered",
  6824. smart: !0,
  6825. scrollTrap: !0,
  6826. scrollBy: 1,
  6827. mouseDragging: !0,
  6828. touchDragging: !0,
  6829. speed: 300,
  6830. dragHandle: !0,
  6831. dynamicHandle: !0,
  6832. clickBar: !0,
  6833. scrollBar: $("#scroller"),
  6834. activateOn: null
  6835. }).init()).on("active", function(e, t) {
  6836. t,
  6837. _e("tour"),
  6838. $(".step").removeClass("active"),
  6839. $("#status").find(".curIdx").text(t + 1);
  6840. for (var i = 0; i <= t; i++)
  6841. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6842. }),
  6843. E()
  6844. }(s, l, c) : (Ce.highlight.visible = !1,
  6845. Ce.tourControls.visible = !1),
  6846. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6847. function() {
  6848. var n;
  6849. document.body.addEventListener("mousedown", function(e) {
  6850. n = 0 === e.button || 1 === e.which ? e.target : null
  6851. }, !0),
  6852. document.body.addEventListener("mouseup", function(t) {
  6853. n !== t.target && (n = b(n, t.target));
  6854. var e = document.getElementById("gui-parent");
  6855. if (b(e, n) !== e && (n = null),
  6856. n) {
  6857. var i;
  6858. try {
  6859. i = new MouseEvent("click",t)
  6860. } catch (e) {
  6861. (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)
  6862. }
  6863. i.syntheticClick = !0,
  6864. n.dispatchEvent(i),
  6865. n = null
  6866. }
  6867. }, !0),
  6868. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6869. e.syntheticClick || (e.stopPropagation(),
  6870. "A" === e.target.nodeName && e.preventDefault())
  6871. }, !0)
  6872. }(),
  6873. A(c),
  6874. C(s, t),
  6875. s.on("floor.changed", I),
  6876. s.on("waiting", function(e) {
  6877. _(e)
  6878. }
  6879. .bind(this, s)),
  6880. s.on("waiting-done", function(e) {
  6881. _(e)
  6882. }
  6883. .bind(this, s)),
  6884. c.on(re.ModeChanged, function(e, t) {
  6885. A(c),
  6886. v(l, c),
  6887. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6888. U.updateMode(t)
  6889. }),
  6890. e.on(oe.Move, _e.bind(this, "move")),
  6891. c.on(re.Ready, function() {
  6892. O.init(e, c, c.tagManager, l),
  6893. c.on(re.ModeChanged, function(e, t) {
  6894. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6895. })
  6896. }),
  6897. c.on(re.PanoChosen, function(e, t) {
  6898. A(c, t),
  6899. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6900. }),
  6901. V.on(k.CLOSE, function(e) {
  6902. switch (e) {
  6903. case "vr-modal":
  6904. X.dismiss();
  6905. break;
  6906. case "share-modal":
  6907. K.hide();
  6908. break;
  6909. case "terms-modal":
  6910. W.hide()
  6911. }
  6912. });
  6913. 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();
  6914. l.on("update.controls", function() {
  6915. var e, t, i, n = l.describe();
  6916. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6917. u.show()),
  6918. n.tourInProgress && (d.forEach(function(e) {
  6919. e.classList.add("playing")
  6920. }),
  6921. p.addClass("playing"),
  6922. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6923. u.hide()),
  6924. n.tourInProgress || (q.stopTour(),
  6925. d.forEach(function(e) {
  6926. e.classList.remove("playing")
  6927. }),
  6928. p.removeClass("playing"),
  6929. f.removeClass("playing"))),
  6930. null !== n.currentItem) {
  6931. var r, o;
  6932. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6933. n.onTheBus ? (r = "active",
  6934. o = "recent") : (o = "active",
  6935. r = "recent");
  6936. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6937. for (e = 0; e < s.heroLocations.length; e += 1)
  6938. i = g.eq(e),
  6939. t = m.eq(e),
  6940. i.removeClass(o),
  6941. t.removeClass(o),
  6942. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6943. t.addClass(r),
  6944. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6945. t.addClass(r)) : (i.removeClass(r),
  6946. t.removeClass(r))
  6947. } else
  6948. for (e = 0; e < s.heroLocations.length; e += 1)
  6949. i = g.eq(e),
  6950. t = m.eq(e),
  6951. i.removeClass("active recent"),
  6952. t.removeClass("active recent");
  6953. v(l, c)
  6954. }),
  6955. document.addEventListener("keydown", function(e) {
  6956. switch (R.updateInteraction(oe.InteractionKey),
  6957. e.which) {
  6958. case te.ZERO:
  6959. M.debug && s.toggleAlpha();
  6960. break;
  6961. case te.NINE:
  6962. M.debug && B.toggle();
  6963. break;
  6964. case te.ONE:
  6965. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6966. break;
  6967. case te.TWO:
  6968. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6969. break;
  6970. case te.THREE:
  6971. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6972. break;
  6973. case te.FOUR:
  6974. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6975. break;
  6976. case te.SPACE:
  6977. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6978. break;
  6979. case te.RETURN:
  6980. M.debug && s.toggleExplodeUp();
  6981. break;
  6982. case te.P:
  6983. !function(e) {
  6984. me.gui || (me.gui = function(e) {
  6985. var t = new he.GUI;
  6986. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6987. e.setSweepVisibility(M.showSweeps)
  6988. }),
  6989. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6990. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6991. M.transition.flySpeed = 0,
  6992. t.__controllers.forEach(function(e) {
  6993. e.updateDisplay()
  6994. })
  6995. }),
  6996. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6997. $(t.__closeButton).hide(),
  6998. t
  6999. }(me.model)),
  7000. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  7001. }(!me.visible);
  7002. break;
  7003. case te.U:
  7004. !function(e) {
  7005. ve.gui || (ve.gui = function(t, i) {
  7006. function e() {
  7007. var e = i.toJSON();
  7008. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  7009. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  7010. }
  7011. var n = {}
  7012. , r = new he.GUI({
  7013. autoPlace: !0,
  7014. width: "60%"
  7015. });
  7016. return e(),
  7017. i.on(re.ViewChanged, e),
  7018. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  7019. r.domElement.id = "datLinks",
  7020. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  7021. if (!S.detectSafari()) {
  7022. var t = document.createElement("button");
  7023. t.classList.add("btn-deep-link"),
  7024. t.innerText = se.MENU_COPY,
  7025. e.nextSibling.appendChild(t);
  7026. var n = function() {
  7027. alert(se.LINK_ALERT_COPY),
  7028. t.hide()
  7029. };
  7030. t.addEventListener("click", function(e) {
  7031. try {
  7032. var t = e.target.parentNode.childNodes[0];
  7033. t.select();
  7034. var i = document.execCommand("copy");
  7035. t.blur(),
  7036. i || n()
  7037. } catch (e) {
  7038. n()
  7039. }
  7040. })
  7041. }
  7042. }),
  7043. $(r.__closeButton).hide(),
  7044. r
  7045. }(ve.model, ve.player)),
  7046. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  7047. }(!ve.visible);
  7048. break;
  7049. case te.X:
  7050. M.debug && s.toggleExplode();
  7051. break;
  7052. case te.PLUSEQUALS:
  7053. l.player.activatePersistentZooming(!0),
  7054. O.hideUi();
  7055. break;
  7056. case te.DASHUNDERSCORE:
  7057. l.player.activatePersistentZooming(!1),
  7058. O.hideUi();
  7059. break;
  7060. case te.SEVEN:
  7061. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  7062. break;
  7063. case te.EIGHT:
  7064. l.player.decreaseZoomSpeed();
  7065. break;
  7066. case te.NINE:
  7067. l.player.increaseZoomSpeed()
  7068. }
  7069. return c && c.reticule.hide(),
  7070. !0
  7071. }
  7072. .bind(this)),
  7073. document.addEventListener("keyup", function(e) {
  7074. switch (e.which) {
  7075. case te.PLUSEQUALS:
  7076. l.player.deactivatePersistentZooming();
  7077. break;
  7078. case te.DASHUNDERSCORE:
  7079. l.player.deactivatePersistentZooming()
  7080. }
  7081. }
  7082. .bind(this)),
  7083. function(e) {
  7084. me = {
  7085. gui: null,
  7086. visible: !1,
  7087. model: e
  7088. }
  7089. }(s),
  7090. function(e, t) {
  7091. ve = {
  7092. gui: null,
  7093. visible: !1,
  7094. model: e,
  7095. player: t
  7096. }
  7097. }(s, l.player),
  7098. function(e) {
  7099. function t(e, i) {
  7100. $(e).find("a").each(function(e, t) {
  7101. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7102. t.style.pointerEvents = i ? "auto" : "none"
  7103. })
  7104. }
  7105. e.on(de.ZoomMax, function() {
  7106. t("#gui-zoomin", !1),
  7107. t("#gui-zoomout", !0)
  7108. }),
  7109. e.on(de.ZoomMin, function() {
  7110. t("#gui-zoomin", !0),
  7111. t("#gui-zoomout", !1)
  7112. }),
  7113. e.on(de.ZoomIn, function() {
  7114. t("#gui-zoomout", !0)
  7115. }),
  7116. e.on(de.ZoomOut, function() {
  7117. t("#gui-zoomin", !0)
  7118. }),
  7119. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7120. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7121. }(c),
  7122. P.setAutoPlay(s.heroCount()),
  7123. U.init(c, i.mode),
  7124. U.on(H.OPENED, _e.bind(this, "help")),
  7125. W.init(),
  7126. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  7127. function() {
  7128. _e("terms"),
  7129. V.open(o)
  7130. }
  7131. )),
  7132. W.on(j.CLOSED, V.reset),
  7133. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  7134. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  7135. M.profiling.enabled && B.show(),
  7136. q.init(l)
  7137. }
  7138. ,
  7139. Le.exports.startLoading = function(e, t, i, n, r, o) {
  7140. function a() {
  7141. o.setLoadingStartTime(),
  7142. function() {
  7143. function e(e) {
  7144. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  7145. }
  7146. $("body").css("touch-action", "none"),
  7147. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  7148. var t = document.getElementById("terms-text")
  7149. , i = document.getElementById("more-help-wrapper")
  7150. , n = (document.getElementById("navigation-help-wrapper"),
  7151. document.getElementById("help-dialog"),
  7152. document.getElementById("tag-billboards"));
  7153. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  7154. passive: !1
  7155. }),
  7156. document.body.addEventListener("DOMMouseScroll", e)),
  7157. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7158. e.stopPropagation()
  7159. })
  7160. }(),
  7161. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  7162. l()) : function(e) {
  7163. L.show(e),
  7164. c()
  7165. }(l)
  7166. }
  7167. var s = $.Deferred()
  7168. , l = s.resolve.bind(s);
  7169. ye = !0,
  7170. _(e);
  7171. e.data.player_options && function(e) {
  7172. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  7173. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  7174. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  7175. }(e.data.player_options),
  7176. 1 === M.specialEdition && $("body").addClass("specialEdition");
  7177. se.localizeGUI();
  7178. !function(i) {
  7179. function e(e, t) {
  7180. return !!i.player_options[e] && i[t || e]
  7181. }
  7182. $(".model-title").text(i.name);
  7183. var t = M.pageTitle;
  7184. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  7185. document.title = t,
  7186. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  7187. delay: {
  7188. show: 50,
  7189. hide: 0
  7190. },
  7191. trigger: "hover",
  7192. html: !1,
  7193. viewport: {
  7194. selector: "body",
  7195. padding: 10
  7196. }
  7197. }),
  7198. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7199. z.populate({
  7200. name: e("model_name", "name"),
  7201. coBrand: e("presented_by"),
  7202. description: e("model_summary", "summary") || "暂无内容",
  7203. contactName: e("contact_name"),
  7204. address: e("address"),
  7205. phone: e("contact_phone"),
  7206. formattedPhone: i.formatted_contact_phone,
  7207. email: e("contact_email"),
  7208. url: e("external_url"),
  7209. socialSharing: i.enable_social_sharing && i.is_public
  7210. })
  7211. }(e.data);
  7212. r || $(".quick").addClass("hidden");
  7213. n ? (R.impression(),
  7214. a()) : (o.setWaitingStartTime(),
  7215. N.show(r, a))
  7216. return s
  7217. }
  7218. ,
  7219. Le.exports.endLoading = function(e, t, i) {
  7220. var n = t.player;
  7221. function r() {
  7222. i.dismissExaminedTag(),
  7223. i.disableHovering()
  7224. }
  7225. $("#gui-thumb").fadeOut(2500),
  7226. L.hide(function() {
  7227. ye = !1
  7228. }),
  7229. Y.init(e, i),
  7230. z.finishSetup(Object.keys(e.tags).length),
  7231. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7232. X.on(Z.OPENED, r),
  7233. K.on(ae.OPENED, r),
  7234. U.on(H.OPENED, r),
  7235. W.on(j.OPENED, r);
  7236. var o = i.enableHovering.bind(i);
  7237. if (X.on(Z.CLOSED, o),
  7238. K.on(ae.CLOSED, o),
  7239. U.on(H.CLOSED, o),
  7240. W.on(j.CLOSED, o),
  7241. M.labels.enabled && Object.keys(e.labels).length,
  7242. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7243. I(e.currentFloor, n.mode)),
  7244. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7245. h(e, t)),
  7246. c(),
  7247. v(t, t.player),
  7248. $("#gui").fadeIn(1500),
  7249. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7250. l(),
  7251. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7252. }, 2e3),
  7253. !S.isMobile())
  7254. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7255. $(a[s]).addClass("hasHover");
  7256. _(e),
  7257. z.setupToggling(),
  7258. window.editHotPanel && editHotPanel(),
  7259. function() {
  7260. var i = $("#pullTab")
  7261. , e = {
  7262. bottom: {
  7263. "border-bottom-left-radius": "10px",
  7264. "border-bottom-right-radius": "10px"
  7265. },
  7266. top: {
  7267. "border-top-left-radius": "10px",
  7268. "border-top-right-radius": "10px"
  7269. }
  7270. }
  7271. , t = {
  7272. bottom: {
  7273. "border-top-right-radius": "10px",
  7274. "border-bottom-right-radius": "10px"
  7275. },
  7276. top: {
  7277. "border-bottom-left-radius": "10px",
  7278. "border-top-left-radius": "10px"
  7279. }
  7280. };
  7281. function n(e, t) {
  7282. $("#gui-modes-map > div:visible:last").css(e),
  7283. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7284. }
  7285. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7286. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7287. }()
  7288. $(".toolRight a").removeClass('hasHover')
  7289. }
  7290. ,
  7291. Le.exports.onProgress = function(e) {
  7292. L.progress(e)
  7293. }
  7294. }
  7295. ).call(this, "/js/gui/gui.js")
  7296. }
  7297. , {
  7298. "../analytics": 4,
  7299. "../controls/serializer": 14,
  7300. "../enum/AlignmentType": 17,
  7301. "../enum/BlackoutStyle": 18,
  7302. "../enum/ControlEvents": 21,
  7303. "../enum/DirectorEvents": 23,
  7304. "../enum/Keys": 30,
  7305. "../enum/PathDiscardMode": 38,
  7306. "../enum/PathDisplayMode": 39,
  7307. "../enum/PlayerEvents": 40,
  7308. "../enum/VROption": 47,
  7309. "../enum/Vectors": 50,
  7310. "../enum/Viewmode": 51,
  7311. "../enum/WarpStyle": 52,
  7312. "../enum/ZoomEvents": 53,
  7313. "../lib/dat.gui": 93,
  7314. "../localization/localize": 108,
  7315. "../tag/Media/MediaEvent": 131,
  7316. "../objects/Snapshot": 153,
  7317. "../settings": 166,
  7318. "../util/ajax": 181,
  7319. "../util/browser": 182,
  7320. "../util/camera": 183,
  7321. "../util/logger": 189,
  7322. "../util/showcase": 193,
  7323. "../util/transitions": 195,
  7324. "./closer/ModalCloserEvent": 61,
  7325. "./closer/modalCloser": 62,
  7326. "./help/HelpEvent": 66,
  7327. "./help/help": 67,
  7328. "./helpManager": 68,
  7329. "./immersiveMode": 69,
  7330. "./konami": 70,
  7331. "./landingScreen": 71,
  7332. "./loadingScreen": 72,
  7333. "./memoryUsage": 73,
  7334. "./playButton": 74,
  7335. "./populateModal": 75,
  7336. "./sharing/ShareEvents": 76,
  7337. "./sharing/modal": 77,
  7338. "./terms/TermsEvent": 78,
  7339. "./terms/terms": 79,
  7340. "./title/TitleEvents": 80,
  7341. "./title/tagToggle": 81,
  7342. "./title/titleBar": 82,
  7343. "./tourInteraction": 84,
  7344. "./vr/vrEvent": 85,
  7345. "./vr/vrModal": 87,
  7346. "./webvr/WebVrEvent": 88,
  7347. "./webvr/webVRgui": 89,
  7348. three: 217
  7349. }],
  7350. 66: [function(e, t, i) {
  7351. "use strict";
  7352. t.exports = Object.freeze({
  7353. OPENED: "help.opened",
  7354. CLOSED: "help.closed"
  7355. })
  7356. }
  7357. , {}],
  7358. 67: [function(e, t, i) {
  7359. "use strict";
  7360. function n() {
  7361. p.on("click", function(e) {
  7362. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7363. setTimeout(function() {
  7364. x = !1
  7365. }, h.help.modalStayDuration),
  7366. S.emit(l.OPENED),
  7367. f.addClass("open " + T),
  7368. p.addClass("open"),
  7369. o(),
  7370. r(),
  7371. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7372. v.classList.add("fadeIn")))
  7373. }),
  7374. E.on("click", function(e) {
  7375. S.close()
  7376. }),
  7377. C.on("click", function(e) {
  7378. T && T !== a.TRANSITIONING && (o(),
  7379. r())
  7380. }),
  7381. I.on("click", function(e) {
  7382. o(),
  7383. I.addClass("underline-tab"),
  7384. c.fill(b, s.MORE_HELP),
  7385. f.addClass("more-help")
  7386. })
  7387. }
  7388. function r() {
  7389. C.addClass("underline-tab"),
  7390. c.fill(_, s.NAVIGATION, T),
  7391. f.addClass(T)
  7392. }
  7393. function o() {
  7394. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7395. A.forEach(function(e) {
  7396. e.classList.remove("underline-tab")
  7397. })
  7398. }
  7399. var a = e("../../enum/Viewmode")
  7400. , s = e("../../enum/HelpModalType")
  7401. , l = e("./HelpEvent")
  7402. , c = (e("../helpManager"),
  7403. e("./../populateModal"))
  7404. , h = e("../../settings")
  7405. , u = e("../../util/common")
  7406. , d = e("events").EventEmitter
  7407. , p = $(".footer-help").eq(0)
  7408. , f = $("#help-dialog").eq(0)
  7409. , g = document.querySelector("#quick-logo")
  7410. , m = document.querySelector("#loaderCoBrand")
  7411. , v = document.querySelector("#help-dialog")
  7412. , y = document.querySelector(".footer")
  7413. , A = $(".help-tabs").children().toArray()
  7414. , C = $(".navigation-tab").eq(0)
  7415. , I = $(".more-help-tab").eq(0)
  7416. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7417. f.find(".close").eq(0))
  7418. , _ = f.find(".interactions").toArray()
  7419. , b = f.find(".ui-instructions").toArray()
  7420. , w = a.PANORAMA
  7421. , T = a.PANORAMA
  7422. , x = !1
  7423. , S = {
  7424. init: function(e, t) {
  7425. w = T = t,
  7426. [v, m, g, y].forEach(function(e) {
  7427. e.classList.add(c.deviceType)
  7428. }),
  7429. n()
  7430. },
  7431. close: function() {
  7432. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7433. p.removeClass("open"),
  7434. f.removeClass("open"),
  7435. v.classList.contains("fadeIn"))) {
  7436. v.classList.remove("fadeIn");
  7437. var e = T === a.TRANSITIONING ? w : T;
  7438. c.clear(_, s.NAVIGATION, e)
  7439. }
  7440. },
  7441. updateMode: function(e) {
  7442. w = T,
  7443. T = e
  7444. }
  7445. };
  7446. u.extendObject(S, d.prototype),
  7447. t.exports = S
  7448. }
  7449. , {
  7450. "../../enum/HelpModalType": 28,
  7451. "../../enum/Viewmode": 51,
  7452. "../../settings": 166,
  7453. "../../util/common": 185,
  7454. "../helpManager": 68,
  7455. "./../populateModal": 75,
  7456. "./HelpEvent": 66,
  7457. events: 202
  7458. }],
  7459. 68: [function(s, l, e) {
  7460. (function(e) {
  7461. "use strict";
  7462. var t = s("../util/browser")
  7463. , i = s("./../util/logger")
  7464. , n = s("./../settings")
  7465. , r = new i(e)
  7466. , o = function() {
  7467. var t;
  7468. try {
  7469. return t = window.localStorage.getItem("visitCount") || "0",
  7470. t = (parseFloat(t) + 1).toString(),
  7471. window.localStorage.setItem("visitCount", t),
  7472. r.debug("visitCount = " + t),
  7473. t
  7474. } catch (e) {
  7475. t = "1",
  7476. r.debug("couldn't set local storage")
  7477. }
  7478. }()
  7479. , a = !1;
  7480. l.exports = {
  7481. isHelpDisabled: function() {
  7482. return "0" === t.valueFromHash("help", null) || a
  7483. },
  7484. isLargeHelpEnabled: function() {
  7485. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7486. },
  7487. isSmallHelpEnabled: function() {
  7488. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7489. },
  7490. isHelpEnabled: function() {
  7491. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7492. },
  7493. setAutoPlay: function(e) {
  7494. a = 0 <= n.warp.auto && 1 < e
  7495. }
  7496. }
  7497. }
  7498. ).call(this, "/js/gui/helpManager.js")
  7499. }
  7500. , {
  7501. "../util/browser": 182,
  7502. "./../settings": 166,
  7503. "./../util/logger": 189
  7504. }],
  7505. 69: [function(e, t, i) {
  7506. "use strict";
  7507. function r(e) {
  7508. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7509. T = !0,
  7510. h.close(),
  7511. function(e) {
  7512. !n(e) && S ? v.forEach(function(e) {
  7513. e.classList.remove("drawerOpen"),
  7514. e.classList.add("duringTour")
  7515. }) : C.hasClass("open") ? v.forEach(function(e) {
  7516. e.classList.remove("duringTour"),
  7517. e.classList.add("drawerOpen")
  7518. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7519. e.classList.add("fadeOut")
  7520. })
  7521. }(e),
  7522. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7523. C.hasClass("playing") || (y.forEach(function(e) {
  7524. e.classList.add("detectHover")
  7525. }),
  7526. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7527. }
  7528. function o() {
  7529. C.hasClass("playing") || (clearTimeout(x),
  7530. x = setTimeout(a, c.immersive.timeToShowAgain))
  7531. }
  7532. function a() {
  7533. clearTimeout(x),
  7534. T = !1,
  7535. m.forEach(function(e) {
  7536. e.classList.remove("drawerOpen")
  7537. }),
  7538. S || v.forEach(function(e) {
  7539. e.classList.remove("duringTour")
  7540. }),
  7541. y.forEach(function(e) {
  7542. e.classList.remove("detectHover")
  7543. })
  7544. }
  7545. function s() {
  7546. T ? a() : r(),
  7547. M = !0,
  7548. setTimeout(function() {
  7549. M = !1
  7550. }, c.immersive.uiStayDuration)
  7551. }
  7552. function n(e) {
  7553. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7554. }
  7555. var l = e("../util/browser")
  7556. , c = e("../settings")
  7557. , h = e("./help/help")
  7558. , u = e("../enum/tagEvents")
  7559. , d = e("../enum/ControlEvents")
  7560. , p = e("../enum/PlayerEvents")
  7561. , f = e("../enum/DirectorEvents")
  7562. , g = (p = e("../enum/PlayerEvents"),
  7563. e("../enum/Viewmode"))
  7564. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7565. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7566. , y = $("#hover-bottom, #hover-top").toArray()
  7567. , A = ($("#pullTab").eq(0),
  7568. $("#playHead").eq(0),
  7569. $(".pinBottom-container").eq(0))
  7570. , C = $("#drawer").eq(0)
  7571. , I = $("#drawer-container").eq(0)
  7572. , E = $("#meta-info").eq(0)
  7573. , _ = $(".pinTop.left").eq(0)
  7574. , b = $("#player").eq(0)
  7575. , w = document.getElementById("pullTab")
  7576. , T = !1
  7577. , x = null
  7578. , S = !1
  7579. , M = !1
  7580. , R = null
  7581. , P = !1;
  7582. t.exports.init = function(e, t, i, n) {
  7583. (function(t, i, e, n) {
  7584. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7585. t.controls[e].on(d.Move, r),
  7586. t.controls[e].on(d.LongTap, s)
  7587. }),
  7588. b.on("mousewheel DOMMouseScroll", r),
  7589. e.on(u.TagActivated, r),
  7590. e.on(u.TagNavigation, r),
  7591. i.on(p.FlyingEnded, o),
  7592. i.on(p.ModeChanging, function(e, t) {
  7593. P = t !== g.PANORAMA && e !== g.PANORAMA
  7594. }),
  7595. i.on(p.ModeChanged, function(e, t) {
  7596. R = i.mode,
  7597. t !== g.TRANSITIONING ? a() : r("modeChange")
  7598. }),
  7599. n.on(f.TourStart, function() {
  7600. S = !0,
  7601. r()
  7602. }),
  7603. n.on(f.TourEnd, function() {
  7604. S = !1,
  7605. a()
  7606. }),
  7607. n.on(f.ActionInterrupted, function() {
  7608. S = !1
  7609. }),
  7610. w.addEventListener("touchend", function() {
  7611. $("#pullTab").hasClass("opened") && !S && a()
  7612. }, !0)
  7613. }
  7614. )(e, t, i, n),
  7615. l.isMobile() ? (y.forEach(function(e) {
  7616. e.classList.add("mobile")
  7617. }),
  7618. A.click(a)) : (y.forEach(function(e) {
  7619. e.addEventListener("mouseleave", function() {
  7620. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7621. }, !0)
  7622. }),
  7623. b.mouseleave(function() {
  7624. y[0].classList.contains("detectHover") && a()
  7625. })),
  7626. R = t.mode
  7627. }
  7628. ,
  7629. t.exports.hideUi = r,
  7630. t.exports.resetDrawer = function() {
  7631. I.hasClass("duringTour") || (S = !1,
  7632. r("gui"),
  7633. a())
  7634. }
  7635. }
  7636. , {
  7637. "../enum/ControlEvents": 21,
  7638. "../enum/DirectorEvents": 23,
  7639. "../enum/tagEvents": 32,
  7640. "../enum/PlayerEvents": 40,
  7641. "../enum/Viewmode": 51,
  7642. "../settings": 166,
  7643. "../util/browser": 182,
  7644. "./help/help": 67
  7645. }],
  7646. 70: [function(i, n, e) {
  7647. (function(e) {
  7648. "use strict";
  7649. var t = i("./../util/logger")
  7650. , o = i("./../settings")
  7651. , a = i("./debug")
  7652. , s = i("./../util/common")
  7653. , l = (i("./gui"),
  7654. new t(e));
  7655. o.console && $("body").append('<div id="debug-console"></div>'),
  7656. n.exports.init = function(i, n, r) {
  7657. l.debug("konami has the modelInstance");
  7658. var t = [];
  7659. $(window).on("keydown", function(e) {
  7660. t.push(e.which),
  7661. t.length > o.secretPanelWord.length && t.shift(),
  7662. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7663. o.debug = !0)
  7664. }),
  7665. $(window).on("keydown", function e(t) {
  7666. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7667. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7668. })
  7669. }
  7670. }
  7671. ).call(this, "/js/gui/konami.js")
  7672. }
  7673. , {
  7674. "./../settings": 166,
  7675. "./../util/common": 185,
  7676. "./../util/logger": 189,
  7677. "./debug": 63,
  7678. "./gui": 65
  7679. }],
  7680. 71: [function(e, t, i) {
  7681. "use strict";
  7682. function r() {
  7683. s.clear(m, l.LANDING[v]),
  7684. g.removeClass("fadeIn")
  7685. }
  7686. var o = e("../settings")
  7687. , a = (e("./help/help"),
  7688. e("./helpManager"))
  7689. , s = e("./populateModal")
  7690. , l = e("../enum/HelpModalType")
  7691. , n = e("../enum/Viewmode")
  7692. , c = e("../enum/DirectorEvents")
  7693. , h = e("../enum/PlayerEvents")
  7694. , u = $("#quick-blackout").eq(0)
  7695. , d = $("#quick-logo").eq(0)
  7696. , p = $(".quick-brand").toArray()
  7697. , f = $("#loaderCoBrand").eq(0)
  7698. , g = $("#interaction-modal").eq(0)
  7699. , m = g.find(".interaction").toArray()
  7700. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7701. "");
  7702. t.exports.delayLanding = function(e) {
  7703. var t = $.Deferred();
  7704. e || t.resolve();
  7705. var i = o.startupFlyinDelay;
  7706. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7707. setTimeout(t.resolve.bind(t), i),
  7708. t
  7709. }
  7710. ,
  7711. t.exports.showMessage = function(e, t, i) {
  7712. var n = 0;
  7713. o.quickstart.enabled && (function(e) {
  7714. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7715. d.before(f),
  7716. p = $(".quick-brand").toArray()), */
  7717. u.addClass("fadeOut")
  7718. /* setTimeout(function() {
  7719. p.forEach(function(e) {
  7720. e.classList.add("fadeIn")
  7721. })
  7722. }, o.quickstart.showTextDelay),
  7723. setTimeout(function() {
  7724. p.forEach(function(e) {
  7725. e.classList.add("fadeOut")
  7726. })
  7727. }, o.quickstart.fadeOutDelay) */
  7728. }(i),
  7729. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7730. function(e, t) {
  7731. setTimeout(function() {
  7732. if (a.isHelpEnabled()) {
  7733. if (t(),
  7734. s.init(),
  7735. g.addClass("fadeIn landing " + s.deviceType),
  7736. a.isSmallHelpEnabled())
  7737. return void g.addClass("small");
  7738. s.fill(m, l.LANDING[v]),
  7739. g.addClass(v)
  7740. }
  7741. }, e);
  7742. var i = {
  7743. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7744. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7745. }
  7746. , n = $(".nav-icon .icon");
  7747. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7748. function r(e) {
  7749. e.on("click", function() {
  7750. var e = null;
  7751. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7752. i.length < e || e < 1)
  7753. return !1;
  7754. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7755. "data-page": e,
  7756. src: i.mobile[e - 1]
  7757. }) : n.attr({
  7758. "data-page": e,
  7759. src: i.pc[e - 1]
  7760. })
  7761. })
  7762. }
  7763. r($(".next-button")),
  7764. r($(".prev-button"))
  7765. }(n, function() {
  7766. e.once(h.Move, r),
  7767. t.once(c.TourStart, r)
  7768. })
  7769. }
  7770. ,
  7771. t.exports.init = function(e, t) {
  7772. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7773. }
  7774. ,
  7775. t.exports.dismissModal = r
  7776. }
  7777. , {
  7778. "../enum/DirectorEvents": 23,
  7779. "../enum/HelpModalType": 28,
  7780. "../enum/PlayerEvents": 40,
  7781. "../enum/Viewmode": 51,
  7782. "../settings": 166,
  7783. "./help/help": 67,
  7784. "./helpManager": 68,
  7785. "./populateModal": 75
  7786. }],
  7787. 72: [function(e, t, i) {
  7788. "use strict";
  7789. var n = e("./circleLoader").circleLoader;
  7790. t.exports = {
  7791. element: $("#gui-loading"),
  7792. hide: function(e) {
  7793. n.done(),
  7794. this.element.fadeOut(1500, e)
  7795. },
  7796. show: function(e) {
  7797. this.element.fadeIn(500, function() {
  7798. this.element.css("display", "table"),
  7799. e && e()
  7800. }
  7801. .bind(this))
  7802. },
  7803. progress: function(e) {
  7804. n.set(e)
  7805. }
  7806. }
  7807. }
  7808. , {
  7809. "./circleLoader": 60
  7810. }],
  7811. 73: [function(e, t, i) {
  7812. "use strict";
  7813. var n = e("../settings")
  7814. , r = $("#memory-info")
  7815. , o = r.find("#memory-gpu")
  7816. , a = !1;
  7817. t.exports = {
  7818. show: function() {
  7819. n.profiling.enabled && (r.show(),
  7820. a = !0)
  7821. },
  7822. hide: function() {
  7823. r.hide(),
  7824. a = !1
  7825. },
  7826. toggle: function() {
  7827. a ? this.hide() : this.show()
  7828. },
  7829. update: function(e) {
  7830. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7831. }
  7832. }
  7833. }
  7834. , {
  7835. "../settings": 166
  7836. }],
  7837. 74: [function(e, t, i) {
  7838. "use strict";
  7839. e("../util/browser"),
  7840. e("../analytics");
  7841. e("../settings"),
  7842. t.exports = {
  7843. show: function(e, t) {
  7844. $("#gui-message").fadeOut(500, function() {
  7845. t()
  7846. })
  7847. }
  7848. }
  7849. }
  7850. , {
  7851. "../analytics": 4,
  7852. "../settings": 166,
  7853. "../util/browser": 182
  7854. }],
  7855. 75: [function(e, t, i) {
  7856. "use strict";
  7857. function n(e, t, i, n) {
  7858. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7859. }
  7860. var r = e("../util/browser")
  7861. , o = e("../localization/localize")
  7862. , a = e("../enum/HelpModalType")
  7863. , s = (e("../enum/HelpModalSize"),
  7864. e("../enum/Viewmode"));
  7865. t.exports = {
  7866. init: function() {
  7867. if (!this.hasInitialized) {
  7868. this.hasInitialized = !0,
  7869. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7870. this.assets = {},
  7871. this.assets[a.LANDING[s.PANORAMA]] = {
  7872. desktop: {
  7873. left: {
  7874. "top-info": o.ROTATE,
  7875. "big-image": "images/nav_help_mouse_drag_left.png",
  7876. keyboard: "images/nav_help_keyboard_left_right.png"
  7877. },
  7878. middle: {
  7879. "top-info": o.MOVE,
  7880. "big-image": "images/nav_help_mouse_click.png",
  7881. keyboard: "images/nav_help_keyboard_up_down.png"
  7882. },
  7883. right: {
  7884. "top-info": o.ZOOM,
  7885. "big-image": "images/nav_help_mouse_zoom.png",
  7886. keyboard: "images/nav_help_zoom_keys.png"
  7887. }
  7888. },
  7889. mobile: {
  7890. left: {
  7891. "top-info": o.ROTATE,
  7892. "big-image": "images/nav_help_gesture_drag.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.MOVE,
  7896. "big-image": "images/nav_help_gesture_tap.png"
  7897. },
  7898. right: {
  7899. "top-info": o.ZOOM,
  7900. "big-image": "images/nav_help_gesture_pinch.png"
  7901. }
  7902. }
  7903. },
  7904. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7905. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7906. desktop: {
  7907. left: {
  7908. "top-info": o.ROTATE,
  7909. "big-image": "images/nav_help_mouse_drag_left.png",
  7910. keyboard: "images/nav_help_keyboard_left_right.png"
  7911. },
  7912. middle: {
  7913. "top-info": o.MOVE,
  7914. "big-image": "images/nav_help_mouse_position_right.png"
  7915. }
  7916. },
  7917. mobile: {
  7918. left: {
  7919. "top-info": o.ROTATE,
  7920. "big-image": "images/nav_help_gesture_drag.png"
  7921. },
  7922. middle: {
  7923. "top-info": o.MOVE,
  7924. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7925. }
  7926. }
  7927. },
  7928. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7929. desktop: {
  7930. left: {
  7931. "top-info": o.MOVE,
  7932. "big-image": "images/nav_help_mouse_position_left.png"
  7933. },
  7934. middle: {
  7935. "top-info": o.ROTATE,
  7936. "big-image": "images/nav_help_mouse_drag_right.png",
  7937. keyboard: "images/nav_help_keyboard_left_right.png"
  7938. }
  7939. },
  7940. mobile: {
  7941. left: {
  7942. "top-info": o.MOVE,
  7943. "big-image": "images/nav_help_gesture_position.png"
  7944. },
  7945. middle: {
  7946. "top-info": o.ROTATE,
  7947. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7948. }
  7949. }
  7950. };
  7951. var e = {
  7952. "top-info": o.INSIDE,
  7953. "big-image": "images/nav_help_click_inside.png",
  7954. keyboard: "images/nav_help_inside_key.png"
  7955. };
  7956. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7957. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7958. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7959. var t = {
  7960. "top-info": o.INSIDE,
  7961. "big-image": "images/nav_help_tap_inside.png"
  7962. };
  7963. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7964. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7965. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7966. this.assets[a.NAVIGATION] = {},
  7967. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7968. desktop: {
  7969. left: {
  7970. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7971. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7972. "big-image": "images/nav_help_mouse_drag_left.png",
  7973. keyboard: "images/nav_help_keyboard_left_right.png"
  7974. },
  7975. middle: {
  7976. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7977. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7978. "big-image": "images/nav_help_mouse_click.png",
  7979. keyboard: "images/nav_help_keyboard_up_down.png"
  7980. },
  7981. right: {
  7982. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7983. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7984. "big-image": "images/nav_help_mouse_zoom.png",
  7985. keyboard: "images/nav_help_zoom_keys.png"
  7986. }
  7987. },
  7988. mobile: {
  7989. left: {
  7990. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7991. "big-image": "images/nav_help_gesture_drag.png"
  7992. },
  7993. middle: {
  7994. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7995. "big-image": "images/nav_help_gesture_tap.png"
  7996. },
  7997. right: {
  7998. "top-info": o.HELP_MOBILE_3,
  7999. "big-image": "images/nav_help_gesture_pinch.png"
  8000. }
  8001. }
  8002. },
  8003. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8004. desktop: {
  8005. left: {
  8006. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8007. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8008. "big-image": "images/nav_help_mouse_drag_left.png",
  8009. keyboard: "images/nav_help_keyboard_all.png"
  8010. },
  8011. middle: {
  8012. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8013. "big-image": "images/nav_help_mouse_position_right.png"
  8014. },
  8015. right: {
  8016. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8017. "big-image": "images/nav_help_mouse_zoom.png"
  8018. }
  8019. },
  8020. mobile: {
  8021. left: {
  8022. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8023. "big-image": "images/nav_help_gesture_drag.png"
  8024. },
  8025. middle: {
  8026. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8027. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8028. },
  8029. right: {
  8030. "top-info": o.HELP_MOBILE_3,
  8031. "big-image": "images/nav_help_gesture_pinch.png"
  8032. }
  8033. }
  8034. },
  8035. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8036. desktop: {
  8037. left: {
  8038. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8039. "big-image": "images/nav_help_mouse_position_left.png"
  8040. },
  8041. middle: {
  8042. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8043. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8044. "big-image": "images/nav_help_mouse_drag_right.png",
  8045. keyboard: "images/nav_help_keyboard_left_right.png"
  8046. },
  8047. right: {
  8048. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8049. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8050. "big-image": "images/nav_help_mouse_zoom.png",
  8051. keyboard: "images/nav_help_keyboard_up_down.png"
  8052. }
  8053. },
  8054. mobile: {
  8055. left: {
  8056. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8057. "big-image": "images/nav_help_gesture_position.png"
  8058. },
  8059. middle: {
  8060. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8061. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8062. },
  8063. right: {
  8064. "top-info": o.HELP_MOBILE_3,
  8065. "big-image": "images/nav_help_gesture_pinch.png"
  8066. }
  8067. }
  8068. },
  8069. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8070. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8071. "top-info": o.HELP_DESKTOP_360_2A,
  8072. "bottom-info": o.HELP_DESKTOP_360_2B,
  8073. "big-image": "images/nav_help_click_inside.png",
  8074. keyboard: "images/nav_help_inside_key.png"
  8075. },
  8076. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8077. "top-info": o.HELP_MOBILE_360_2,
  8078. "big-image": "images/nav_help_tap_inside.png"
  8079. },
  8080. this.assets[a.MORE_HELP] = {
  8081. desktop: {
  8082. "more-help-hlr": {
  8083. "top-info": o.HELP_MORE_HLR_A,
  8084. "big-image": "images/nav_help_expand.svg",
  8085. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8086. },
  8087. "more-help-dollhouse": {
  8088. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8089. "big-image": "images/nav_help_dollhouse.svg",
  8090. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8091. },
  8092. "more-help-floors": {
  8093. "top-info": o.HELP_MORE_FLOORS_A,
  8094. "big-image": "images/nav_help_floor picker.svg",
  8095. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8096. },
  8097. "more-help-tag": {
  8098. "top-info": o.HELP_MORE_TAG_A,
  8099. "big-image": "images/nav_help_tag.svg",
  8100. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8101. },
  8102. "more-help-zoom": {
  8103. "top-info": o.HELP_MORE_ZOOM_A,
  8104. "big-image": "images/nav_help_zoom.svg",
  8105. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8106. },
  8107. "more-help-tour": {
  8108. "top-info": o.HELP_MORE_TOUR_A,
  8109. "big-image": "images/nav_help_play.png",
  8110. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8111. },
  8112. "more-help-inside": {
  8113. "top-info": o.HELP_MORE_INSIDE_A,
  8114. "big-image": "images/nav_help_inside.svg",
  8115. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8116. },
  8117. "more-help-vr": {
  8118. "top-info": o.HELP_MORE_VR_A,
  8119. "big-image": "images/nav_help_vr.svg",
  8120. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8121. },
  8122. "more-help-360": {
  8123. "top-info": o.HELP_MORE_360_A,
  8124. "big-image": "images/nav_help_360.svg",
  8125. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8126. },
  8127. "more-help-fullscreen": {
  8128. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8129. "big-image": "images/nav_help_fullscreen.svg",
  8130. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8131. }
  8132. },
  8133. mobile: {
  8134. "more-help-hlr": {
  8135. "top-info": o.HELP_MORE_HLR_A,
  8136. "big-image": "images/nav_help_expand.svg",
  8137. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8138. },
  8139. "more-help-dollhouse": {
  8140. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8141. "big-image": "images/nav_help_dollhouse.svg",
  8142. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8143. },
  8144. "more-help-floors": {
  8145. "top-info": o.HELP_MORE_FLOORS_A,
  8146. "big-image": "images/nav_help_floor picker.svg",
  8147. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8148. },
  8149. "more-help-tag": {
  8150. "top-info": o.HELP_MORE_TAG_A,
  8151. "big-image": "images/nav_help_tag.svg",
  8152. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8153. },
  8154. "more-help-tour": {
  8155. "top-info": o.HELP_MORE_TOUR_A,
  8156. "big-image": "images/nav_help_play.png",
  8157. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8158. },
  8159. "more-help-inside": {
  8160. "top-info": o.HELP_MORE_INSIDE_A,
  8161. "big-image": "images/nav_help_inside.svg",
  8162. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8163. },
  8164. "more-help-vr": {
  8165. "top-info": o.HELP_MORE_VR_A,
  8166. "big-image": "images/webvr.svg",
  8167. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8168. },
  8169. "more-help-360": {
  8170. "top-info": o.HELP_MORE_360_A,
  8171. "big-image": "images/nav_help_360.svg",
  8172. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8173. }
  8174. }
  8175. },
  8176. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8177. desktop: {
  8178. left: {
  8179. "top-info": o.ROTATE,
  8180. "big-image": "images/nav_help_mouse_drag_left.png",
  8181. keyboard: "images/nav_help_keyboard_left_right.png"
  8182. },
  8183. middle: {
  8184. "top-info": o.MOVE,
  8185. "big-image": "images/nav_help_mouse_click.png",
  8186. keyboard: "images/nav_help_keyboard_up_down.png"
  8187. },
  8188. right: {
  8189. "top-info": o.PLAY,
  8190. "big-image": "images/Desktop-help-play-button.svg",
  8191. keyboard: "images/Desktop-help-spacebar-2.svg"
  8192. }
  8193. },
  8194. mobile: {
  8195. left: {
  8196. "top-info": o.ROTATE,
  8197. "big-image": "images/nav_help_gesture_drag.png"
  8198. },
  8199. middle: {
  8200. "top-info": o.MOVE,
  8201. "big-image": "images/nav_help_gesture_tap.png"
  8202. },
  8203. right: {
  8204. "top-info": o.PLAY,
  8205. "big-image": "images/mobile-help-play-button.svg"
  8206. }
  8207. }
  8208. },
  8209. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8210. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8211. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8212. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8213. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8214. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8215. }
  8216. },
  8217. fill: function(e, t, i) {
  8218. n.call(this, e, t, i, !0)
  8219. },
  8220. clear: function(e, t, i) {
  8221. n.call(this, e, t, i, !1)
  8222. }
  8223. }
  8224. }
  8225. , {
  8226. "../enum/HelpModalSize": 27,
  8227. "../enum/HelpModalType": 28,
  8228. "../enum/Viewmode": 51,
  8229. "../localization/localize": 108,
  8230. "../util/browser": 182
  8231. }],
  8232. 76: [function(e, t, i) {
  8233. "use strict";
  8234. t.exports = Object.freeze({
  8235. OPENED: "share.open",
  8236. CLOSED: "share.closed",
  8237. LINK_CLICKED: "share.linked"
  8238. })
  8239. }
  8240. , {}],
  8241. 77: [function(e, t, i) {
  8242. "use strict";
  8243. function n(n) {
  8244. function e(e, t) {
  8245. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8246. I.emit(l.LINK_CLICKED, {
  8247. channel: n
  8248. }),
  8249. window.open(C[n], "shareWindow", i)
  8250. }
  8251. switch (n) {
  8252. case A.FACEBOOK:
  8253. e(580, 420);
  8254. break;
  8255. case A.TWITTER:
  8256. e(550, 440);
  8257. break;
  8258. case A.MAIL:
  8259. I.emit(l.LINK_CLICKED, {
  8260. channel: "email"
  8261. }),
  8262. window.open(C[n], "_blank");
  8263. break;
  8264. case A.LINKEDIN:
  8265. }
  8266. }
  8267. function r(e) {
  8268. I.emit(l.LINK_CLICKED, {
  8269. channel: "copylink"
  8270. });
  8271. var t = document.createRange();
  8272. t.selectNodeContents(v);
  8273. var i = window.getSelection();
  8274. i.removeAllRanges(),
  8275. i.addRange(t),
  8276. document.execCommand("copy"),
  8277. y.classList.remove("hidden"),
  8278. v.classList.add("highlighted")
  8279. }
  8280. function o(e) {
  8281. e && (e.stopPropagation(),
  8282. e.target === v) || (window.getSelection().removeAllRanges(),
  8283. v.classList.remove("highlighted"),
  8284. y.classList.add("hidden"))
  8285. }
  8286. var a = e("../../util/browser")
  8287. , s = e("../../localization/localize")
  8288. , l = e("./ShareEvents")
  8289. , c = e("../../util/common")
  8290. , h = e("events").EventEmitter
  8291. , u = document.getElementById("sharing")
  8292. , d = document.getElementById("share-modal")
  8293. , p = document.getElementById("share-close")
  8294. , f = document.getElementById("facebook-share")
  8295. , g = document.getElementById("twitter-share")
  8296. , m = document.getElementById("mail-share")
  8297. , v = document.getElementById("share-url-text")
  8298. , y = document.getElementById("copy-success")
  8299. , A = Object.freeze({
  8300. FACEBOOK: "facebook",
  8301. TWITTER: "twitter",
  8302. MAIL: "mail",
  8303. LINKEDIN: "linkedin"
  8304. })
  8305. , C = {};
  8306. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8307. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8308. C[A.MAIL] = "mailto:?subject=";
  8309. var I = {
  8310. init: function(e) {
  8311. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8312. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8313. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8314. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8315. u.addEventListener("click", this.toggle.bind(this)),
  8316. p.addEventListener("click", this.hide.bind(this)),
  8317. v.addEventListener("click", r),
  8318. d.addEventListener("click", o),
  8319. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8320. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8321. m.addEventListener("click", n.bind(this, A.MAIL)),
  8322. v.textContent = window.location.href + "&utm_source=4",
  8323. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8324. u.classList.remove("hidden")
  8325. },
  8326. show: function() {
  8327. this.emit(l.OPENED),
  8328. d.classList.add("fadeIn")
  8329. },
  8330. hide: function() {
  8331. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8332. document.selection && document.selection.empty(),
  8333. window.getSelection().removeAllRanges(),
  8334. o(),
  8335. d.classList.remove("fadeIn"))
  8336. },
  8337. toggle: function() {
  8338. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8339. }
  8340. };
  8341. c.extendObject(I, h.prototype),
  8342. t.exports = I
  8343. }
  8344. , {
  8345. "../../localization/localize": 108,
  8346. "../../util/browser": 182,
  8347. "../../util/common": 185,
  8348. "./ShareEvents": 76,
  8349. events: 202
  8350. }],
  8351. 78: [function(e, t, i) {
  8352. "use strict";
  8353. t.exports = Object.freeze({
  8354. OPENED: "terms.opened",
  8355. CLOSED: "terms.closed"
  8356. })
  8357. }
  8358. , {}],
  8359. 79: [function(e, t, i) {
  8360. "use strict";
  8361. var n = e("./TermsEvent")
  8362. , r = e("../../localization/localize")
  8363. , o = e("../../analytics")
  8364. , a = e("../../util/ajax")
  8365. , s = e("../../util/common")
  8366. , l = e("events").EventEmitter
  8367. , c = document.getElementById("terms-modal")
  8368. , h = {
  8369. init: function() {
  8370. $(".footer-terms").on("click", function(e) {
  8371. e.preventDefault(),
  8372. this.show()
  8373. }
  8374. .bind(this)),
  8375. $("#terms-modal .close").on("click", this.hide.bind(this))
  8376. },
  8377. show: function() {
  8378. this.emit(n.OPENED),
  8379. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8380. var t = $("#terms-text").html(e);
  8381. o.track("showcase_gui", {
  8382. gui_action: "click_terms_button",
  8383. interaction_source: "gui"
  8384. }),
  8385. t.find("a").attr("target", "_blank")
  8386. }).fail(function() {
  8387. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8388. }),
  8389. c.classList.add("fadeIn")
  8390. },
  8391. hide: function(e) {
  8392. e && e.preventDefault(),
  8393. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8394. c.classList.remove("fadeIn")
  8395. }
  8396. };
  8397. s.extendObject(h, l.prototype),
  8398. t.exports = h
  8399. }
  8400. , {
  8401. "../../analytics": 4,
  8402. "../../localization/localize": 108,
  8403. "../../util/ajax": 181,
  8404. "../../util/common": 185,
  8405. "./TermsEvent": 78,
  8406. events: 202
  8407. }],
  8408. 80: [function(e, t, i) {
  8409. "use strict";
  8410. t.exports = Object.freeze({
  8411. OPEN_INFO: "title.open.info",
  8412. CLOSE_INFO: "title.close.info",
  8413. SHOW_INFO: "title.show.info",
  8414. HIDE_INFO: "title.hide.info",
  8415. LINK_CLICKED: "title.link.click",
  8416. CONTACT_LINK_CLICKED: "title.contact.click",
  8417. ORIGIN_LINK_CLICKED: "title.origin.click"
  8418. })
  8419. }
  8420. , {}],
  8421. 81: [function(e, t, i) {
  8422. "use strict";
  8423. var o = e("../../settings");
  8424. t.exports.init = function(e, t) {
  8425. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8426. function e(e) {
  8427. t.shouldShowtags = "show" === this.value,
  8428. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8429. }
  8430. document.getElementById("tag-toggles").classList.remove("hidden"),
  8431. document.getElementById("radio-tag-show").checked = !0;
  8432. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8433. n[r].addEventListener("change", e)
  8434. }(e, t)
  8435. }
  8436. }
  8437. , {
  8438. "../../settings": 166
  8439. }],
  8440. 82: [function(S, M, e) {
  8441. (function(e) {
  8442. "use strict";
  8443. function i(e) {
  8444. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8445. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8446. _.appendChild(function(e) {
  8447. var t = document.createElement("a");
  8448. return t.id = "url",
  8449. t.target = "_blank",
  8450. t.href = e,
  8451. t.innerText = e,
  8452. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8453. t
  8454. }(e)),
  8455. b.forEach(function(e) {
  8456. e.classList.add("share-link")
  8457. }),
  8458. 0))
  8459. }
  8460. function s(e, t) {
  8461. var i = e
  8462. , n = t;
  8463. return function(e, t) {
  8464. i.push(t || n, e)
  8465. }
  8466. }
  8467. var l = S("../../util/browser")
  8468. , t = S("../../util/common")
  8469. , n = S("../../util/logger")
  8470. , r = S("../../localization/localize")
  8471. , o = S("./titleBarSettings")
  8472. , c = S("../../settings")
  8473. , a = S("./TitleEvents")
  8474. , h = S("events").EventEmitter
  8475. , u = new n(e)
  8476. , d = document.querySelector(".pinTop.left")
  8477. , p = document.getElementsByClassName("title-container")[0]
  8478. , f = document.getElementById("title-toggle").querySelector("i")
  8479. , g = document.getElementById("meta-info-wrapper")
  8480. , m = document.getElementById("meta-info")
  8481. , v = document.getElementById("meta-description")
  8482. , y = document.getElementsByClassName("contact-info")[0]
  8483. , A = document.getElementById("contact-data")
  8484. , C = document.getElementById("addressTxt")
  8485. , I = document.getElementById("tag-toggles")
  8486. , E = document.getElementById("share-origin")
  8487. , _ = document.getElementById("share-link-wrapper")
  8488. , b = [m, g, p]
  8489. , w = !1
  8490. , T = !1
  8491. , x = {
  8492. populate: function(e) {
  8493. if (function(e, t) {
  8494. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8495. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8496. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8497. document.getElementById("gui-name").classList.add("noCoBrand"),
  8498. document.getElementById("cobrandTitle").classList.add("hidden")),
  8499. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8500. !1)
  8501. }(DATA.name, e.coBrand)) {
  8502. if (function(e) {
  8503. e ? (w = !0,
  8504. v.innerHTML = e) : v.classList.add("hidden")
  8505. }(e.description),
  8506. function(e, t, i, n) {
  8507. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8508. w = !0;
  8509. var r = []
  8510. , o = s(r, "<br>");
  8511. if (e && o('<span id="contactName">' + e + "</span>"),
  8512. t) {
  8513. var a = n || t;
  8514. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8515. }
  8516. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8517. r[0] = "",
  8518. A.innerHTML = r.join("")
  8519. } else
  8520. y.classList.add("hidden")
  8521. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8522. function(e) {
  8523. if ("string" == typeof e)
  8524. try {
  8525. e = JSON.parse(e)
  8526. } catch (e) {
  8527. return u.warn("Unable to parse address data"),
  8528. C.parentElement.classList.add("hidden")
  8529. }
  8530. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8531. w = !0;
  8532. var t = []
  8533. , i = s(t, " ");
  8534. e.address_1 && i(e.address_1),
  8535. e.address_2 && i(e.address_2),
  8536. e.city && i(e.city, ", "),
  8537. e.state && i(e.state, ", "),
  8538. e.zip && i(e.zip, e.state ? " " : ", "),
  8539. t[0] = "",
  8540. C.innerText = t.join("")
  8541. } else
  8542. C.parentElement.classList.add("hidden")
  8543. }(e.address),
  8544. w) {
  8545. var t = document.createElement("br");
  8546. I.insertBefore(t, I.firstElementChild)
  8547. }
  8548. e.socialSharing && c.share.enabled && (T = i(e.url))
  8549. }
  8550. },
  8551. finishSetup: function(e) {
  8552. w = w || !!e,
  8553. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8554. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8555. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8556. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8557. }),
  8558. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8559. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8560. contact_type: e.getAttribute("id")
  8561. }))
  8562. }),
  8563. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8564. },
  8565. toggleMeta: function(e, t) {
  8566. var i = document.getElementById("model-title");
  8567. t && t.preventDefault();
  8568. var n = m.classList.contains("expand");
  8569. e && !n || (n ? (b.forEach(function(e) {
  8570. e.classList.remove("expand")
  8571. }),
  8572. this.emit(a.CLOSE_INFO),
  8573. i.classList.remove("expand")) : (b.forEach(function(e) {
  8574. e.classList.add("expand")
  8575. }),
  8576. i.classList.add("expand"),
  8577. this.emit(a.OPEN_INFO)))
  8578. },
  8579. setupToggling: function() {
  8580. g.style.height = m.offsetHeight + "px",
  8581. m.addEventListener("transitionend", function() {
  8582. g.style.height = m.offsetHeight + "px"
  8583. })
  8584. },
  8585. toggleTitle: function(e) {
  8586. e && e.preventDefault(),
  8587. d.classList.contains("closed") ? (d.classList.add("open"),
  8588. f.classList.remove("icon-dpad-right"),
  8589. f.classList.add("icon-dpad-left"),
  8590. this.emit(a.SHOW_INFO),
  8591. setTimeout(function() {
  8592. d.classList.remove("closed"),
  8593. d.classList.remove("open")
  8594. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8595. f.classList.remove("icon-dpad-left"),
  8596. f.classList.add("icon-dpad-right"),
  8597. this.emit(a.HIDE_INFO))
  8598. }
  8599. };
  8600. t.extendObject(x, h.prototype),
  8601. M.exports = x
  8602. }
  8603. ).call(this, "/js/gui/title/titleBar.js")
  8604. }
  8605. , {
  8606. "../../localization/localize": 108,
  8607. "../../settings": 166,
  8608. "../../util/browser": 182,
  8609. "../../util/common": 185,
  8610. "../../util/logger": 189,
  8611. "./TitleEvents": 80,
  8612. "./titleBarSettings": 83,
  8613. events: 202
  8614. }],
  8615. 83: [function(e, t, i) {
  8616. "use strict";
  8617. t.exports = Object.freeze({
  8618. minTooltipCharacters: 19,
  8619. removeAnimationClasses: 500
  8620. })
  8621. }
  8622. , {}],
  8623. 84: [function(e, t, i) {
  8624. "use strict";
  8625. function n() {
  8626. v.playTour(),
  8627. y && clearTimeout(y),
  8628. c(),
  8629. E.removeClass("fadeIn")
  8630. }
  8631. function r() {
  8632. A.classList.contains("playing") && (v.stopTour(),
  8633. E.addClass("fadeIn"),
  8634. setTimeout(function() {
  8635. E.removeClass("fadeIn")
  8636. }, h.tourInteraction.showPauseButton),
  8637. M || (clearTimeout(y),
  8638. y = setTimeout(s, h.tourInteraction.showModal)),
  8639. setTimeout(function() {
  8640. A.classList.remove("playing")
  8641. }, h.tourInteraction.allowNextClick))
  8642. }
  8643. function o() {
  8644. v.tourInProgress && (v.stopTour(),
  8645. v.endTourProgress(),
  8646. A.classList.remove("playing"))
  8647. }
  8648. function a() {
  8649. _.is(":visible") ? n() : r()
  8650. }
  8651. function s() {//去掉导览结束时的提示
  8652. /* if (!h.tourInteraction.disabled) {
  8653. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8654. T.addClass("fadeIn tour " + p.deviceType);
  8655. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8656. if (!h.tourInteraction.smallModal)
  8657. 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,
  8658. p.fill(x, g.TOUR_INTERACTION[e]),
  8659. T.addClass(e);
  8660. T.addClass(t)
  8661. } */
  8662. }
  8663. function l(e, t) {
  8664. if (t) {
  8665. var i = "keydown" === t.type
  8666. , n = t.which === u.SPACE || v.tourIsPlaying;
  8667. i && n || e || (M = !0),
  8668. v.atEndOfTour() && c(),
  8669. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8670. c(),
  8671. t.which !== u.SPACE && o()),
  8672. i && n && a()
  8673. }
  8674. }
  8675. function c() {
  8676. T.removeClass("fadeIn")
  8677. }
  8678. var h = (e("../util/browser"),
  8679. e("../settings"))
  8680. , u = e("../enum/Keys")
  8681. , d = e("../enum/Viewmode")
  8682. , p = (e("./helpManager"),
  8683. e("./populateModal"))
  8684. , f = e("../enum/DirectorEvents")
  8685. , g = e("../enum/HelpModalType")
  8686. , m = e("../enum/HelpModalSize")
  8687. , v = null
  8688. , y = null
  8689. , A = document.getElementById("pause-overlay")
  8690. , C = document.getElementById("player")
  8691. , I = document.getElementById("gui")
  8692. , E = $("#pause-icon").eq(0)
  8693. , _ = $("#play").eq(0)
  8694. , b = $("#playHead").eq(0)
  8695. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8696. , T = $("#interaction-modal").eq(0)
  8697. , x = $("#interaction-modal .interaction").toArray()
  8698. , S = ["touchstart", "mousedown", "pointerdown"]
  8699. , M = !1;
  8700. t.exports.init = function(e) {
  8701. v = e,
  8702. S.forEach(function(t) {
  8703. C.addEventListener(t, l.bind(this, !1), !0),
  8704. I.addEventListener(t, l.bind(this, !0), !0),
  8705. A.addEventListener(t, r, !0),
  8706. w.forEach(function(e) {
  8707. e.addEventListener(t, o, !0)
  8708. }),
  8709. $("#drawer img").on(t, o)
  8710. }),
  8711. document.addEventListener("keydown", l.bind(this, !1), !0),
  8712. v.on(f.TourStart, function() {
  8713. A.classList.add("playing")
  8714. })
  8715. }
  8716. ,
  8717. t.exports.play = n,
  8718. t.exports.pause = r,
  8719. t.exports.pauseWithoutCTA = o,
  8720. t.exports.togglePlay = a,
  8721. t.exports.stopTour = function() {
  8722. b.hasClass("playing") && (clearTimeout(y),
  8723. v.atEndOfTour() ? (A.classList.remove("playing"),
  8724. s()) : E.removeClass("fadeIn"))
  8725. }
  8726. ,
  8727. t.exports.dismissModal = c
  8728. }
  8729. , {
  8730. "../enum/DirectorEvents": 23,
  8731. "../enum/HelpModalSize": 27,
  8732. "../enum/HelpModalType": 28,
  8733. "../enum/Keys": 30,
  8734. "../enum/Viewmode": 51,
  8735. "../settings": 166,
  8736. "../util/browser": 182,
  8737. "./helpManager": 68,
  8738. "./populateModal": 75
  8739. }],
  8740. 85: [function(e, t, i) {
  8741. "use strict";
  8742. t.exports = Object.freeze({
  8743. OPENED: "vr.modal.opened",
  8744. LAUNCH: "vr.modal.launch",
  8745. CLOSED: "vr.modal.closed",
  8746. NEXT: "vr.modal.next",
  8747. PREV: "vr.modal.prev",
  8748. STORE: "vr.modal.store",
  8749. falseICECHOSEN: "vr.modal.device"
  8750. })
  8751. }
  8752. , {}],
  8753. 86: [function(e, t, i) {
  8754. "use strict";
  8755. var h = e("../../util/browser")
  8756. , u = e("../../enum/VRApps")
  8757. , n = e("../../enum/VRPlatforms")
  8758. , d = e("../../util/ajax")
  8759. , p = e("../../settings")
  8760. , r = {};
  8761. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8762. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8763. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8764. u) {
  8765. var a = u[o];
  8766. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8767. }
  8768. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8769. "https://" + s);
  8770. t.exports.init = function(e, t, o) {
  8771. function a(e, t, i, n) {
  8772. function r() {
  8773. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8774. }
  8775. 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()
  8776. }
  8777. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8778. , l = g + "/vr/dlist/?ret=" + s
  8779. , c = g + "/vr/show/?ret=" + s;
  8780. switch (e) {
  8781. case n.IOS:
  8782. !function(t, e, i, n) {
  8783. var r = a(t, e, i, n)
  8784. , o = {
  8785. responseType: "json",
  8786. data: {
  8787. branch_key: p.appConfig.branch_key,
  8788. data: {
  8789. m: e,
  8790. full_url: r,
  8791. $desktop_url: "",
  8792. $og_app_id: "331853976762864119",
  8793. $og_title: i,
  8794. $og_description: n,
  8795. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8796. $canonical_url: window.location.href
  8797. }
  8798. }
  8799. };
  8800. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8801. f[t] = e.url
  8802. }).fail(function(e) {
  8803. f[t] = e
  8804. }
  8805. .bind(this, r))
  8806. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8807. break;
  8808. default:
  8809. !function(e, t, i) {
  8810. for (var n in u) {
  8811. var r = u[n]
  8812. , o = a(r, e, t, i);
  8813. f[r] = o
  8814. }
  8815. }(t.sid, t.name, t.summary)
  8816. }
  8817. }
  8818. ,
  8819. t.exports.launch = function(e) {
  8820. var t = f[e];
  8821. window.open(t, "_blank")
  8822. }
  8823. ,
  8824. t.exports.launchStore = function(e) {
  8825. var t = r[e];
  8826. window.open(t, "_blank")
  8827. }
  8828. }
  8829. , {
  8830. "../../enum/VRApps": 46,
  8831. "../../enum/VRPlatforms": 49,
  8832. "../../settings": 166,
  8833. "../../util/ajax": 181,
  8834. "../../util/browser": 182
  8835. }],
  8836. 87: [function(e, t, i) {
  8837. "use strict";
  8838. function c(e) {
  8839. var t;
  8840. switch (e) {
  8841. case y.IOS:
  8842. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8843. case y.Android:
  8844. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8845. }
  8846. return !1
  8847. }
  8848. function h(e) {
  8849. switch (e) {
  8850. case y.Android:
  8851. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8852. x.filter(".gearvr").off().on("click", q.gear),
  8853. n(k, U, "logo-button", "same-line");
  8854. break;
  8855. case y.UnsupportedAndroid:
  8856. n("", H, "", "");
  8857. break;
  8858. case y.IOS:
  8859. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8860. n(k, "", "logo-button", "");
  8861. break;
  8862. case y.Desktop:
  8863. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8864. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8865. n(k, U, "logo-button", "same-line"),
  8866. Q.cardboard()
  8867. }
  8868. }
  8869. function u(e) {
  8870. $(".p1, .p2, .p3").hide(),
  8871. l.insertAfter(T),
  8872. w.removeClass("front-page"),
  8873. w.removeClass("details-page"),
  8874. w.removeClass("lastPage"),
  8875. x.removeClass("logo-button"),
  8876. x.removeClass("same-line"),
  8877. T.removeClass("headsetOptions"),
  8878. S.attr("src", ""),
  8879. S.filter(".second").removeClass("gear"),
  8880. S.css("display", "inline-block"),
  8881. S.off(),
  8882. M.filter(".second").css("display", ""),
  8883. O.css("display", "none"),
  8884. $(".p" + (e + 1) + _).show(),
  8885. S.filter(".third").insertBefore(M.filter(".third"))
  8886. }
  8887. function n(e, t, i, n) {
  8888. w.addClass("front-page"),
  8889. S.filter(".first").attr("src", e),
  8890. S.filter(".second").attr("src", t),
  8891. x.filter(".first").addClass(i),
  8892. x.filter(".second").addClass(i),
  8893. x.addClass(n),
  8894. ".show-desktop" === _ && T.insertAfter(l)
  8895. }
  8896. function r(e, t, i) {
  8897. T.addClass("headsetOptions"),
  8898. x.off(),
  8899. S.filter(".second").attr("src", t),
  8900. O.css("display", "block"),
  8901. M.filter(".second").css("display", "none"),
  8902. O.on("click", function() {
  8903. u(b.Title),
  8904. h(y.Desktop)
  8905. }),
  8906. e && (X.emit(C.falseICECHOSEN, {
  8907. name: v.GearVR
  8908. }),
  8909. S.filter(".first").attr("src", e),
  8910. S.filter(".second").addClass("gear"),
  8911. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8912. Q.gearvr()),
  8913. i && (X.emit(C.falseICECHOSEN, {
  8914. name: v.Cardboard
  8915. }),
  8916. S.filter(".third").attr("src", i),
  8917. S.filter(".third").show(),
  8918. S.filter(".third").insertAfter(S.filter(".second")),
  8919. S.filter(".third").addClass("link"),
  8920. S.filter(".second").addClass("link"),
  8921. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8922. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8923. Q.cardboard())
  8924. }
  8925. function d(e, t) {
  8926. switch (t) {
  8927. case y.IOS:
  8928. j = W,
  8929. Y = G;
  8930. break;
  8931. case y.Desktop:
  8932. e === b.Cardboard ? (j = N,
  8933. Y = B,
  8934. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8935. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8936. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8937. Y = "");
  8938. break;
  8939. default:
  8940. Y = e === b.Cardboard ? (j = H,
  8941. G) : (j = V,
  8942. z)
  8943. }
  8944. }
  8945. function p(e, t, i) {
  8946. w.find(".inner").addClass("details-page"),
  8947. w.addClass("details-page"),
  8948. S.filter(".first").attr("src", e),
  8949. S.filter(".second").attr("src", t),
  8950. S.filter(".third").attr("src", i)
  8951. }
  8952. function f() {
  8953. var e = 1 < g.aspectRatio() && g.isMobile();
  8954. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8955. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8956. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8957. }
  8958. var g = e("../../util/browser")
  8959. , m = e("./vrLink")
  8960. , v = e("../../enum/VRApps")
  8961. , y = e("../../enum/VRPlatforms")
  8962. , A = e("../../enum/VRPages")
  8963. , C = e("./vrEvent")
  8964. , o = (e("../../settings"),
  8965. e("../../constants"))
  8966. , I = e("../../localization/localize")
  8967. , a = e("../../util/common")
  8968. , s = e("events").EventEmitter
  8969. , E = 0
  8970. , _ = null
  8971. , b = A.standard
  8972. , w = $(".vr-popup")
  8973. , l = w.find(".vr-popup-body")
  8974. , T = w.find(".vr-images")
  8975. , x = w.find(".img-container")
  8976. , S = w.find(".vr-sm-image")
  8977. , M = x.find(".vr-img-caption")
  8978. , R = $(".vr-buttons").find(".prev-button")
  8979. , P = $(".vr-buttons").find(".next-button")
  8980. , O = T.find(".front-close")
  8981. , L = $(".vr-page")
  8982. , D = w.find("img")
  8983. , N = "images/apple-store.png"
  8984. , F = "images/badge-oculus.png"
  8985. , B = "images/badge-cardboard.png"
  8986. , V = "images/logo-samsung.png"
  8987. , k = "images/headset-cardboard.png"
  8988. , U = "images/headset-gearvr.png"
  8989. , H = "images/ico-android-robot.png"
  8990. , z = "images/ico-gearvr.png"
  8991. , G = "images/ico-vr.png"
  8992. , W = "images/apple-logo-white.svg"
  8993. , j = null
  8994. , Y = null
  8995. , q = {}
  8996. , X = {
  8997. init: function(e, t) {
  8998. function i(e) {
  8999. X.emit(C.STORE, {
  9000. type: e
  9001. }),
  9002. m.launchStore(e)
  9003. }
  9004. function n(e) {
  9005. switch (e !== b.pageCount && (u(e),
  9006. L.text(e + 1 + " / " + b.pageCount)),
  9007. e) {
  9008. case b.Title:
  9009. R.css("display", "none"),
  9010. P.text(a[e]),
  9011. h(r);
  9012. break;
  9013. case b.Cardboard:
  9014. R.css("display", "block"),
  9015. P.text(a[e]),
  9016. x.filter(".cardboard").off(),
  9017. x.filter(".gearvr").off(),
  9018. d(e, r),
  9019. p(k, j, Y);
  9020. break;
  9021. case b.Gear:
  9022. P.text(a[e]),
  9023. d(e, r),
  9024. w.addClass("lastPage"),
  9025. p(U, j, Y);
  9026. break;
  9027. case b.pageCount:
  9028. w.removeClass("fadeIn"),
  9029. X.emit(C.CLOSED)
  9030. }
  9031. D.filter("[src='']").hide()
  9032. }
  9033. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  9034. _ = ".show-supported",
  9035. y.Android) : (w.addClass("unsupported"),
  9036. _ = ".show-unsupported",
  9037. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  9038. _ = ".show-ios",
  9039. b = A.ios,
  9040. y.IOS) : (w.addClass("desktop"),
  9041. _ = ".show-desktop",
  9042. y.Desktop);
  9043. function o(e) {
  9044. X.emit(C.LAUNCH, {
  9045. vr_platform: r,
  9046. vr_app: e
  9047. }),
  9048. m.launch(e)
  9049. }
  9050. m.init(r, e, t),
  9051. r !== y.Desktop && w.addClass("mobile"),
  9052. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  9053. q.gear = o.bind(this, v.GearVR),
  9054. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  9055. f(),
  9056. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9057. $(_).show();
  9058. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  9059. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9060. r === y.IOS && (a.splice(1, 1),
  9061. s.splice(1, 1)),
  9062. $("#vr").on("click", function(e) {
  9063. e.preventDefault(),
  9064. window.vrEnabled || (window.vrEnabled = !0,
  9065. this.classList.add("active"),
  9066. $("#gui div").not("#vrOff").addClass("vrHide"),
  9067. $("#vrOffImg").css({
  9068. display: "inline-block"
  9069. }))
  9070. }),
  9071. $("#vrOff").on("click", function() {
  9072. window.vrEnabled = !1,
  9073. $("#gui div").not("#vrOff").removeClass("vrHide"),
  9074. $("#vrOffImg").css({
  9075. display: "none"
  9076. }),
  9077. $("#player canvas").css({
  9078. width: "",
  9079. height: ""
  9080. }),
  9081. $("#vr").removeClass("active")
  9082. });
  9083. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  9084. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  9085. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  9086. $("span.modelLink").text(l),
  9087. R.on("click", function(e) {
  9088. X.emit(C.PREV),
  9089. n(--E)
  9090. }),
  9091. P.on("click", function(e) {
  9092. P.text(),
  9093. X.emit(C.NEXT, {
  9094. nextAction: s[E]
  9095. }),
  9096. n(++E)
  9097. }),
  9098. w.find(".close").on("click", X.dismiss)
  9099. },
  9100. dismiss: function() {
  9101. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  9102. X.emit(C.CLOSED))
  9103. },
  9104. isDeviceSupported: c
  9105. };
  9106. a.extendObject(X, s.prototype),
  9107. $(window).resize(f);
  9108. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  9109. K = M.filter(".first").find(".gearvr"),
  9110. {
  9111. cardboard: function() {
  9112. K.addClass("hidden"),
  9113. Z.removeClass("hidden")
  9114. },
  9115. gearvr: function() {
  9116. Z.addClass("hidden"),
  9117. K.removeClass("hidden")
  9118. }
  9119. });
  9120. t.exports = X
  9121. }
  9122. , {
  9123. "../../constants": 8,
  9124. "../../enum/VRApps": 46,
  9125. "../../enum/VRPages": 48,
  9126. "../../enum/VRPlatforms": 49,
  9127. "../../localization/localize": 108,
  9128. "../../settings": 166,
  9129. "../../util/browser": 182,
  9130. "../../util/common": 185,
  9131. "./vrEvent": 85,
  9132. "./vrLink": 86,
  9133. events: 202
  9134. }],
  9135. 88: [function(e, t, i) {
  9136. "use strict";
  9137. t.exports = Object.freeze({
  9138. OPENED: "webvr.modal.opened",
  9139. SHOW_TERMS: "webvr.footer.show.terms"
  9140. })
  9141. }
  9142. , {}],
  9143. 89: [function(B, V, e) {
  9144. (function(e) {
  9145. "use strict";
  9146. function a() {
  9147. function t() {
  9148. p.isPresenting || (r.info("exiting webVR"),
  9149. c("webvr_exit_app"),
  9150. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  9151. window.removeEventListener("vrdisplaypresentchange", t))
  9152. }
  9153. r.info("Headset mounted"),
  9154. u.suspend();
  9155. var e = document.createElement("canvas");
  9156. for (e.getContext("webgl"),
  9157. e.className = "webvr-canvas",
  9158. document.bgColor = "#000",
  9159. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9160. document.body.removeChild(document.body.firstChild);
  9161. document.body.appendChild(e),
  9162. c("webvr_enter_app"),
  9163. p.requestPresent([{
  9164. source: e,
  9165. predistorted: !0
  9166. }]).catch(function(e) {
  9167. r.error("Failed to present: " + e),
  9168. c("webvr_exit_calibrate"),
  9169. t()
  9170. }),
  9171. d.then(function() {
  9172. window.dispatchEvent(new Event("vrapp-start"))
  9173. }),
  9174. window.addEventListener("vrdisplaypresentchange", t)
  9175. }
  9176. function s() {
  9177. c("webvr_modal_close"),
  9178. _.find(".enter-button").off("click", a),
  9179. E.fadeOut(g.guiAnimationSpeed, function() {
  9180. _.toggleClass("hidden", !1),
  9181. b.toggleClass("hidden", !0),
  9182. f.exitFullscreen()
  9183. }),
  9184. I.fadeIn(g.guiAnimationSpeed)
  9185. }
  9186. function t() {
  9187. M.toggleClass("hidden", !0),
  9188. S.toggleClass("hidden", !1)
  9189. }
  9190. function l() {
  9191. _.toggleClass("hidden"),
  9192. b.toggleClass("hidden")
  9193. }
  9194. function c(e) {
  9195. var t = f.isLandscape() ? "landscape" : "portrait";
  9196. i.trackAlways("showcase_gui", {
  9197. gui_action: e,
  9198. orientation: t
  9199. })
  9200. }
  9201. function h() {
  9202. var e = f.isLandscape();
  9203. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9204. }
  9205. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9206. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9207. 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 = {
  9208. init: function(e, t, i, n) {
  9209. function r(e) {
  9210. e.preventDefault(),
  9211. o(e.currentTarget.id)
  9212. }
  9213. function o(i) {
  9214. F[i](),
  9215. Object.keys(F).map(function(e, t) {
  9216. $("#" + e).toggleClass("tabs-underlined", e === i)
  9217. })
  9218. }
  9219. p = i,
  9220. u = t,
  9221. y.init(m.Android, e, n),
  9222. h(),
  9223. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9224. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9225. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9226. w.filter(".device-headset-side").attr("src", R),
  9227. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9228. $("#vr").on("click", function(e) {
  9229. e.preventDefault(),
  9230. c("click_webvr_button"),
  9231. E.is(":hidden") && (N.emit(A.OPENED),
  9232. I.fadeOut(g.guiAnimationSpeed),
  9233. E.fadeIn(g.guiAnimationSpeed),
  9234. function() {
  9235. if (!d) {
  9236. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9237. d = new Promise(function(e, t) {
  9238. var i = document.createElement("script");
  9239. i.type = "text/javascript",
  9240. i.src = n,
  9241. i.onload = e,
  9242. document.head.appendChild(i)
  9243. }
  9244. )
  9245. }
  9246. _.find(".enter-button").on("click", a)
  9247. }())
  9248. }),
  9249. $(".webvr-popup .close").on("click", function(e) {
  9250. e.preventDefault(),
  9251. _.hasClass("hidden") ? (c("webvr_help_close"),
  9252. l()) : s()
  9253. }),
  9254. $("#tabcardboard").on("click", r),
  9255. $("#tabdaydream").on("click", r),
  9256. $("#tabnative").on("click", r),
  9257. $(".webvr-popup .open-with-app").on("click", function(e) {
  9258. e.preventDefault(),
  9259. c("webvr_learn_more"),
  9260. o("tabnative"),
  9261. l()
  9262. }),
  9263. $(".webvr-popup .help").on("click", function(e) {
  9264. e.preventDefault(),
  9265. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9266. l()
  9267. }),
  9268. $(".webvr-popup .terms").on("click", function(e) {
  9269. e.preventDefault(),
  9270. c("webvr_click_terms"),
  9271. s(),
  9272. N.emit(A.SHOW_TERMS)
  9273. }),
  9274. T.on("click", function(e) {
  9275. e.preventDefault(),
  9276. c(D),
  9277. window.open(L, "_blank")
  9278. }),
  9279. x.on("click", function(e) {
  9280. e.preventDefault(),
  9281. c("webvr_phone_link"),
  9282. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9283. }),
  9284. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9285. e.preventDefault(),
  9286. c("webvr_cardboard_link"),
  9287. y.launch(v.CardboardAndroid)
  9288. }),
  9289. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9290. e.preventDefault(),
  9291. c("webvr_oculus_link"),
  9292. y.launch(v.GearVR)
  9293. })
  9294. }
  9295. }, F = {
  9296. tabcardboard: function() {
  9297. w.filter(".device-headset").attr("src", R),
  9298. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9299. L = "https://vr.google.com/cardboard/get-cardboard/",
  9300. D = "webvr_cardboard_link",
  9301. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9302. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9303. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9304. t()
  9305. },
  9306. tabdaydream: function() {
  9307. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9308. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9309. L = P,
  9310. D = O,
  9311. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9312. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9313. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9314. t()
  9315. },
  9316. tabnative: function() {
  9317. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9318. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9319. M.toggleClass("hidden", !1),
  9320. S.toggleClass("hidden", !0)
  9321. }
  9322. };
  9323. n.extendObject(N, o.prototype),
  9324. $(window).resize(h),
  9325. V.exports = N
  9326. }
  9327. ).call(this, "/js/gui/webvr/webVRgui.js")
  9328. }
  9329. , {
  9330. "../../analytics": 4,
  9331. "../../constants": 8,
  9332. "../../enum/VRApps": 46,
  9333. "../../enum/VRPlatforms": 49,
  9334. "../../localization/localize": 108,
  9335. "../../settings": 166,
  9336. "../../util/browser": 182,
  9337. "../../util/common": 185,
  9338. "../../util/logger": 189,
  9339. "./../gui": 65,
  9340. "./../vr/vrLink": 86,
  9341. "./WebVrEvent": 88,
  9342. events: 202
  9343. }],
  9344. 90: [function(e, t, i) {
  9345. "use strict";
  9346. function n(e, t, i, n, r) {
  9347. this.floorId = n || 0 === n ? n : -1,
  9348. this.roomId = r || "",
  9349. this.labelId = e,
  9350. this.position = (new o.Vector3).copy(t),
  9351. this.text = i
  9352. }
  9353. var o = e("three")
  9354. , r = e("../util/browser");
  9355. n.prototype.build = function() {
  9356. var e = window.document.createElement("div");
  9357. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9358. var t = window.document.createElement("div");
  9359. t.setAttribute("class", "gui-floorplan-label-text");
  9360. var i = window.document.createTextNode(this.text);
  9361. t.appendChild(i),
  9362. e.appendChild(t),
  9363. window.document.body.appendChild(e),
  9364. this.labelGui = e,
  9365. this.textBlock = t,
  9366. $(this.labelGui).hide();
  9367. var n = window.getComputedStyle(this.labelGui);
  9368. this.initialTransform = n.transform || n.webkitTransform
  9369. }
  9370. ,
  9371. t.exports = n
  9372. }
  9373. , {
  9374. "../util/browser": 182,
  9375. three: 217
  9376. }],
  9377. 91: [function(e, t, i) {
  9378. "use strict";
  9379. function n() {
  9380. this.player = null,
  9381. this.modelManager = null,
  9382. this.container = null
  9383. }
  9384. var c, o, r = e("three"), a = (e("../util/common"),
  9385. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9386. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9387. e("../util/transitions"),
  9388. e("../util/lerp"),
  9389. e("../util/browser"));
  9390. n.prototype.init = function(e, t, i) {
  9391. this.player = e,
  9392. this.modelManager = t,
  9393. this.container = i,
  9394. this.updateModel(),
  9395. this.bindEvents()
  9396. }
  9397. ,
  9398. n.prototype.bindEvents = function() {
  9399. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9400. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9401. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9402. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9403. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9404. }
  9405. ,
  9406. n.prototype.updateModel = function() {
  9407. this.model = this.modelManager.getActiveModel()
  9408. }
  9409. ,
  9410. n.prototype.handlePlayerViewChanged = function() {
  9411. this.updateLabelVisibility(),
  9412. this.updateLabelDisplay()
  9413. }
  9414. ,
  9415. n.prototype.getLabelsForFloor = function(t, i) {
  9416. return (i = i || []).length = 0,
  9417. this.model.labels.forEach(function(e) {
  9418. this.labelVisibleForFloor(e, t) && i.push(e)
  9419. }
  9420. .bind(this)),
  9421. i
  9422. }
  9423. ,
  9424. n.prototype.getLabelsForCurrentFloor = function(e) {
  9425. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9426. }
  9427. ,
  9428. n.prototype.labelVisibleForFloor = function(e, t) {
  9429. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9430. if (!this.model.showingLabels || !e.labelGui || !i)
  9431. return !1;
  9432. var n = e.floorId === this.model.floors.size() - 1;
  9433. return this.model.allFloorsVisible ? n : e.floorId === t
  9434. }
  9435. ,
  9436. n.prototype.updateLabelVisibility = function(e) {
  9437. this.model.labels.forEach(function(e) {
  9438. 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)
  9439. }
  9440. .bind(this))
  9441. }
  9442. ,
  9443. n.prototype.showAllLabels = function(t, i) {
  9444. this.model.labels.forEach(function(e) {
  9445. this.showLabel(e, t, i)
  9446. }
  9447. .bind(this))
  9448. }
  9449. ,
  9450. n.prototype.hideAllLabels = function(t, i) {
  9451. this.model.labels.forEach(function(e) {
  9452. this.hideLabel(e, t, i)
  9453. }
  9454. .bind(this))
  9455. }
  9456. ,
  9457. n.prototype.showLabel = function(e, t, i) {
  9458. this.model.showingLabels && (e.visible || (e.visible = !0,
  9459. e.labelGui.style.display = "block",
  9460. e.labelGui.style.opacity = 0,
  9461. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9462. }
  9463. ,
  9464. n.prototype.hideLabel = function(e, t, i) {
  9465. e.visible && (e.visible = !1,
  9466. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9467. }
  9468. ,
  9469. n.prototype.supportedMode = function() {
  9470. return this.player.mode === h.FLOORPLAN
  9471. }
  9472. ,
  9473. n.prototype.updateLabelDisplay = (new r.Vector3,
  9474. new r.Vector3,
  9475. o = [],
  9476. function() {
  9477. var e = this.player.getLabelScaleFactor()
  9478. , t = 1.2 * (1 - e) + .6
  9479. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9480. this.getLabelsForCurrentFloor(o);
  9481. for (var n = 0; n < o.length; n++) {
  9482. var r = o[n];
  9483. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9484. 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)
  9485. }
  9486. }
  9487. ),
  9488. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9489. new r.Vector3,
  9490. function(e, t, i, n, r) {
  9491. t.style.fontSize = 100 * r + "%";
  9492. var o = .5 * $("#player").width()
  9493. , a = .5 * $("#player").height();
  9494. c.copy(i),
  9495. c.project(this.player.camera);
  9496. var s = c.x * o + o
  9497. , l = -c.y * a + a;
  9498. s -= e.offsetWidth / 2,
  9499. l -= e.offsetHeight / 2,
  9500. e.style.left = s + "px",
  9501. e.style.top = l + "px"
  9502. }
  9503. ),
  9504. n.prototype.handleStartInside = function(e) {
  9505. this.updateLabelVisibility()
  9506. }
  9507. ,
  9508. n.prototype.handleStartOutside = function() {
  9509. this.updateLabelVisibility()
  9510. }
  9511. ,
  9512. t.exports = n
  9513. }
  9514. , {
  9515. "../enum/DirectorEvents": 23,
  9516. "../enum/ModelManagerEvents": 33,
  9517. "../enum/PlayerEvents": 40,
  9518. "../enum/Viewmode": 51,
  9519. "../enum/WarpStyle": 52,
  9520. "../settings": 166,
  9521. "../util/browser": 182,
  9522. "../util/common": 185,
  9523. "../util/lerp": 188,
  9524. "../util/transitions": 195,
  9525. three: 217
  9526. }],
  9527. 92: [function(e, t, i) {
  9528. "use strict";
  9529. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9530. if (null == this)
  9531. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9532. if ("function" != typeof e)
  9533. throw new TypeError("predicate must be a function");
  9534. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9535. if (t = i[o],
  9536. e.call(r, t, o, i))
  9537. return o;
  9538. return -1
  9539. }
  9540. ),
  9541. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9542. value: function(e) {
  9543. if (null == this)
  9544. throw new TypeError('"this" is null or not defined');
  9545. var t = Object(this)
  9546. , i = t.length >>> 0;
  9547. if ("function" != typeof e)
  9548. throw new TypeError("predicate must be a function");
  9549. for (var n = arguments[1], r = 0; r < i; ) {
  9550. var o = t[r];
  9551. if (e.call(n, o, r, t))
  9552. return o;
  9553. r++
  9554. }
  9555. }
  9556. })
  9557. }
  9558. , {}],
  9559. 93: [function(e, t, i) {
  9560. "use strict";
  9561. 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 || {};
  9562. function te() {
  9563. this.backgroundElement = document.createElement("div"),
  9564. r.extend(this.backgroundElement.style, {
  9565. backgroundColor: "rgba(0,0,0,0.8)",
  9566. top: 0,
  9567. left: 0,
  9568. display: "none",
  9569. zIndex: "1000",
  9570. opacity: 0,
  9571. WebkitTransition: "opacity 0.2s linear"
  9572. }),
  9573. n.makeFullscreen(this.backgroundElement),
  9574. this.backgroundElement.style.position = "fixed",
  9575. this.domElement = document.createElement("div"),
  9576. r.extend(this.domElement.style, {
  9577. position: "fixed",
  9578. display: "none",
  9579. zIndex: "1001",
  9580. opacity: 0,
  9581. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9582. }),
  9583. document.body.appendChild(this.backgroundElement),
  9584. document.body.appendChild(this.domElement);
  9585. var e = this;
  9586. n.bind(this.backgroundElement, "click", function() {
  9587. e.hide()
  9588. })
  9589. }
  9590. function ie(e, t, i) {
  9591. Object.defineProperty(e, t, {
  9592. get: function() {
  9593. return "RGB" === this.__state.space || re(this, t, i),
  9594. this.__state[t]
  9595. },
  9596. set: function(e) {
  9597. "RGB" !== this.__state.space && (re(this, t, i),
  9598. this.__state.space = "RGB"),
  9599. this.__state[t] = e
  9600. }
  9601. })
  9602. }
  9603. function ne(e, t) {
  9604. Object.defineProperty(e, t, {
  9605. get: function() {
  9606. return "HSV" === this.__state.space || oe(this),
  9607. this.__state[t]
  9608. },
  9609. set: function(e) {
  9610. "HSV" !== this.__state.space && (oe(this),
  9611. this.__state.space = "HSV"),
  9612. this.__state[t] = e
  9613. }
  9614. })
  9615. }
  9616. function re(e, t, i) {
  9617. if ("HEX" === e.__state.space)
  9618. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9619. else {
  9620. if ("HSV" !== e.__state.space)
  9621. throw "Corrupted color state";
  9622. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9623. }
  9624. }
  9625. function oe(e) {
  9626. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9627. l.extend(e.__state, {
  9628. s: t.s,
  9629. v: t.v
  9630. }),
  9631. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9632. }
  9633. function ae() {
  9634. if (this.__state = o.apply(this, arguments),
  9635. !1 === this.__state)
  9636. throw "Failed to interpret color arguments";
  9637. this.__state.a = this.__state.a || 1
  9638. }
  9639. function se(e) {
  9640. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9641. }
  9642. function le(e, t) {
  9643. this.initialValue = e[t],
  9644. this.domElement = document.createElement("div"),
  9645. this.object = e,
  9646. this.property = t,
  9647. this.__onChange = void 0,
  9648. this.__onFinishChange = void 0
  9649. }
  9650. (t.exports = ee).gui = ee.gui || {},
  9651. ee.utils = ee.utils || {},
  9652. ee.controllers = ee.controllers || {},
  9653. ee.dom = ee.dom || {},
  9654. ee.color = ee.color || {},
  9655. ee.utils.css = {
  9656. load: function(e, t) {
  9657. var i = (t = t || document).createElement("link");
  9658. i.type = "text/css",
  9659. i.rel = "stylesheet",
  9660. i.href = e,
  9661. t.getElementsByTagName("head")[0].appendChild(i)
  9662. },
  9663. inject: function(e, t) {
  9664. t = t || document;
  9665. var i = document.createElement("style");
  9666. i.type = "text/css",
  9667. i.innerHTML = e,
  9668. t.getElementsByTagName("head")[0].appendChild(i)
  9669. }
  9670. },
  9671. ee.utils.common = (Q = Array.prototype.forEach,
  9672. J = Array.prototype.slice,
  9673. {
  9674. BREAK: {},
  9675. extend: function(i) {
  9676. return this.each(J.call(arguments, 1), function(e) {
  9677. for (var t in e)
  9678. this.isUndefined(e[t]) || (i[t] = e[t])
  9679. }, this),
  9680. i
  9681. },
  9682. defaults: function(i) {
  9683. return this.each(J.call(arguments, 1), function(e) {
  9684. for (var t in e)
  9685. this.isUndefined(i[t]) && (i[t] = e[t])
  9686. }, this),
  9687. i
  9688. },
  9689. compose: function() {
  9690. var i = J.call(arguments);
  9691. return function() {
  9692. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9693. e = [i[t].apply(this, e)];
  9694. return e[0]
  9695. }
  9696. },
  9697. each: function(e, t, i) {
  9698. if (e)
  9699. if (Q && e.forEach && e.forEach === Q)
  9700. e.forEach(t, i);
  9701. else if (e.length === e.length + 0) {
  9702. for (var n = 0, r = e.length; n < r; n++)
  9703. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9704. return
  9705. } else
  9706. for (var n in e)
  9707. if (t.call(i, e[n], n) === this.BREAK)
  9708. return
  9709. },
  9710. defer: function(e) {
  9711. setTimeout(e, 0)
  9712. },
  9713. toArray: function(e) {
  9714. return e.toArray ? e.toArray() : J.call(e)
  9715. },
  9716. isUndefined: function(e) {
  9717. return void 0 === e
  9718. },
  9719. isNull: function(e) {
  9720. return null === e
  9721. },
  9722. isNaN: function(e) {
  9723. return e != e
  9724. },
  9725. isArray: Array.isArray || function(e) {
  9726. return e.constructor === Array
  9727. }
  9728. ,
  9729. isObject: function(e) {
  9730. return e === Object(e)
  9731. },
  9732. isNumber: function(e) {
  9733. return e === e + 0
  9734. },
  9735. isString: function(e) {
  9736. return e === e + ""
  9737. },
  9738. isBoolean: function(e) {
  9739. return !1 === e || !0 === e
  9740. },
  9741. isFunction: function(e) {
  9742. return "[object Function]" === Object.prototype.toString.call(e)
  9743. }
  9744. }),
  9745. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9746. onChange: function(e) {
  9747. return this.__onChange = e,
  9748. this
  9749. },
  9750. onFinishChange: function(e) {
  9751. return this.__onFinishChange = e,
  9752. this
  9753. },
  9754. setValue: function(e) {
  9755. return this.object[this.property] = e,
  9756. this.__onChange && this.__onChange.call(this, e),
  9757. this.updateDisplay(),
  9758. this
  9759. },
  9760. getValue: function() {
  9761. return this.object[this.property]
  9762. },
  9763. updateDisplay: function() {
  9764. return this
  9765. },
  9766. isModified: function() {
  9767. return this.initialValue !== this.getValue()
  9768. }
  9769. }),
  9770. le),
  9771. ee.dom.dom = function(c) {
  9772. function i(e) {
  9773. if ("0" === e || c.isUndefined(e))
  9774. return 0;
  9775. var t = e.match(n);
  9776. return c.isNull(t) ? 0 : parseFloat(t[1])
  9777. }
  9778. var h = {};
  9779. c.each({
  9780. HTMLEvents: ["change"],
  9781. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9782. KeyboardEvents: ["keydown"]
  9783. }, function(e, t) {
  9784. c.each(e, function(e) {
  9785. h[e] = t
  9786. })
  9787. });
  9788. var n = /(\d+(\.\d+)?)px/
  9789. , r = {
  9790. makeSelectable: function(e, t) {
  9791. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9792. return !1
  9793. }
  9794. : function() {}
  9795. ,
  9796. e.style.MozUserSelect = t ? "auto" : "none",
  9797. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9798. e.unselectable = t ? "on" : "off")
  9799. },
  9800. makeFullscreen: function(e, t, i) {
  9801. c.isUndefined(t) && (t = !0),
  9802. c.isUndefined(i) && (i = !0),
  9803. e.style.position = "absolute",
  9804. t && (e.style.left = 0,
  9805. e.style.right = 0),
  9806. i && (e.style.top = 0,
  9807. e.style.bottom = 0)
  9808. },
  9809. fakeEvent: function(e, t, i, n) {
  9810. i = i || {};
  9811. var r = h[t];
  9812. if (!r)
  9813. throw new Error("Event type " + t + " not supported.");
  9814. var o = document.createEvent(r);
  9815. switch (r) {
  9816. case "MouseEvents":
  9817. var a = i.x || i.clientX || 0
  9818. , s = i.y || i.clientY || 0;
  9819. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9820. break;
  9821. case "KeyboardEvents":
  9822. var l = o.initKeyboardEvent || o.initKeyEvent;
  9823. c.defaults(i, {
  9824. cancelable: !0,
  9825. ctrlKey: !1,
  9826. altKey: !1,
  9827. shiftKey: !1,
  9828. metaKey: !1,
  9829. keyCode: void 0,
  9830. charCode: void 0
  9831. }),
  9832. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9833. break;
  9834. default:
  9835. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9836. }
  9837. c.defaults(o, n),
  9838. e.dispatchEvent(o)
  9839. },
  9840. bind: function(e, t, i, n) {
  9841. return n = n || !1,
  9842. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9843. r
  9844. },
  9845. unbind: function(e, t, i, n) {
  9846. return n = n || !1,
  9847. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9848. r
  9849. },
  9850. addClass: function(e, t) {
  9851. if (void 0 === e.className)
  9852. e.className = t;
  9853. else if (e.className !== t) {
  9854. var i = e.className.split(/ +/);
  9855. -1 == i.indexOf(t) && (i.push(t),
  9856. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9857. }
  9858. return r
  9859. },
  9860. removeClass: function(e, t) {
  9861. if (t)
  9862. if (void 0 === e.className)
  9863. ;
  9864. else if (e.className === t)
  9865. e.removeAttribute("class");
  9866. else {
  9867. var i = e.className.split(/ +/)
  9868. , n = i.indexOf(t);
  9869. -1 != n && (i.splice(n, 1),
  9870. e.className = i.join(" "))
  9871. }
  9872. else
  9873. e.className = void 0;
  9874. return r
  9875. },
  9876. hasClass: function(e, t) {
  9877. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9878. },
  9879. getWidth: function(e) {
  9880. var t = getComputedStyle(e);
  9881. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9882. },
  9883. getHeight: function(e) {
  9884. var t = getComputedStyle(e);
  9885. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9886. },
  9887. getOffset: function(e) {
  9888. var t = {
  9889. left: 0,
  9890. top: 0
  9891. };
  9892. if (e.offsetParent)
  9893. for (; t.left += e.offsetLeft,
  9894. t.top += e.offsetTop,
  9895. e = e.offsetParent; )
  9896. ;
  9897. return t
  9898. },
  9899. isActive: function(e) {
  9900. return e === document.activeElement && (e.type || e.href)
  9901. }
  9902. };
  9903. return r
  9904. }(ee.utils.common),
  9905. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9906. X = ee.dom.dom,
  9907. Z = ee.utils.common,
  9908. (K = function(e, t, i) {
  9909. K.superclass.call(this, e, t);
  9910. var n = this;
  9911. if (this.__select = document.createElement("select"),
  9912. Z.isArray(i)) {
  9913. var r = {};
  9914. Z.each(i, function(e) {
  9915. r[e] = e
  9916. }),
  9917. i = r
  9918. }
  9919. Z.each(i, function(e, t) {
  9920. var i = document.createElement("option");
  9921. i.innerHTML = t,
  9922. i.setAttribute("value", e),
  9923. n.__select.appendChild(i)
  9924. }),
  9925. this.updateDisplay(),
  9926. X.bind(this.__select, "change", function() {
  9927. var e = this.options[this.selectedIndex].value;
  9928. n.setValue(e)
  9929. }),
  9930. this.domElement.appendChild(this.__select)
  9931. }
  9932. ).superclass = q,
  9933. Z.extend(K.prototype, q.prototype, {
  9934. setValue: function(e) {
  9935. var t = K.superclass.prototype.setValue.call(this, e);
  9936. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9937. t
  9938. },
  9939. updateDisplay: function() {
  9940. return this.__select.value = this.getValue(),
  9941. K.superclass.prototype.updateDisplay.call(this)
  9942. }
  9943. }),
  9944. K),
  9945. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9946. j = ee.utils.common,
  9947. (Y = function(e, t, i) {
  9948. Y.superclass.call(this, e, t),
  9949. i = i || {},
  9950. this.__min = i.min,
  9951. this.__max = i.max,
  9952. this.__step = i.step,
  9953. 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,
  9954. this.__precision = se(this.__impliedStep)
  9955. }
  9956. ).superclass = W,
  9957. j.extend(Y.prototype, W.prototype, {
  9958. setValue: function(e) {
  9959. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9960. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9961. Y.superclass.prototype.setValue.call(this, e)
  9962. },
  9963. min: function(e) {
  9964. return this.__min = e,
  9965. this
  9966. },
  9967. max: function(e) {
  9968. return this.__max = e,
  9969. this
  9970. },
  9971. step: function(e) {
  9972. return this.__step = e,
  9973. this.__impliedStep = e,
  9974. this.__precision = se(e),
  9975. this
  9976. }
  9977. }),
  9978. Y),
  9979. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9980. H = ee.dom.dom,
  9981. z = ee.utils.common,
  9982. (G = function(e, t, i) {
  9983. function n() {
  9984. var e = parseFloat(s.__input.value);
  9985. z.isNaN(e) || s.setValue(e)
  9986. }
  9987. function r(e) {
  9988. var t = a - e.clientY;
  9989. s.setValue(s.getValue() + t * s.__impliedStep),
  9990. a = e.clientY
  9991. }
  9992. function o() {
  9993. H.unbind(window, "mousemove", r),
  9994. H.unbind(window, "mouseup", o)
  9995. }
  9996. this.__truncationSuspended = !1,
  9997. G.superclass.call(this, e, t, i);
  9998. var a, s = this;
  9999. this.__input = document.createElement("input"),
  10000. this.__input.setAttribute("type", "text"),
  10001. H.bind(this.__input, "change", n),
  10002. H.bind(this.__input, "blur", function() {
  10003. n(),
  10004. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10005. }),
  10006. H.bind(this.__input, "mousedown", function(e) {
  10007. H.bind(window, "mousemove", r),
  10008. H.bind(window, "mouseup", o),
  10009. a = e.clientY
  10010. }),
  10011. H.bind(this.__input, "keydown", function(e) {
  10012. 13 === e.keyCode && (s.__truncationSuspended = !0,
  10013. this.blur(),
  10014. s.__truncationSuspended = !1)
  10015. }),
  10016. this.updateDisplay(),
  10017. this.domElement.appendChild(this.__input)
  10018. }
  10019. ).superclass = U,
  10020. z.extend(G.prototype, U.prototype, {
  10021. updateDisplay: function() {
  10022. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  10023. var i = Math.pow(10, t);
  10024. return Math.round(e * i) / i
  10025. }(this.getValue(), this.__precision),
  10026. G.superclass.prototype.updateDisplay.call(this)
  10027. }
  10028. }),
  10029. G),
  10030. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  10031. F = ee.dom.dom,
  10032. B = ee.utils.css,
  10033. V = ee.utils.common,
  10034. (k = function(e, t, i, n, r) {
  10035. function o(e) {
  10036. e.preventDefault();
  10037. var t = F.getOffset(s.__background)
  10038. , i = F.getWidth(s.__background);
  10039. return s.setValue(function(e, t, i, n, r) {
  10040. return n + (e - t) / (i - t) * (r - n)
  10041. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  10042. !1
  10043. }
  10044. function a() {
  10045. F.unbind(window, "mousemove", o),
  10046. F.unbind(window, "mouseup", a),
  10047. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  10048. }
  10049. k.superclass.call(this, e, t, {
  10050. min: i,
  10051. max: n,
  10052. step: r
  10053. });
  10054. var s = this;
  10055. this.__background = document.createElement("div"),
  10056. this.__foreground = document.createElement("div"),
  10057. F.bind(this.__background, "mousedown", function(e) {
  10058. F.bind(window, "mousemove", o),
  10059. F.bind(window, "mouseup", a),
  10060. o(e)
  10061. }),
  10062. F.addClass(this.__background, "slider"),
  10063. F.addClass(this.__foreground, "slider-fg"),
  10064. this.updateDisplay(),
  10065. this.__background.appendChild(this.__foreground),
  10066. this.domElement.appendChild(this.__background)
  10067. }
  10068. ).superclass = N,
  10069. k.useDefaultStyles = function() {
  10070. 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}")
  10071. }
  10072. ,
  10073. V.extend(k.prototype, N.prototype, {
  10074. updateDisplay: function() {
  10075. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10076. return this.__foreground.style.width = 100 * e + "%",
  10077. k.superclass.prototype.updateDisplay.call(this)
  10078. }
  10079. }),
  10080. k),
  10081. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  10082. O = ee.dom.dom,
  10083. L = ee.utils.common,
  10084. (D = function(e, t, i) {
  10085. D.superclass.call(this, e, t);
  10086. var n = this;
  10087. this.__button = document.createElement("div"),
  10088. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  10089. O.bind(this.__button, "click", function(e) {
  10090. return e.preventDefault(),
  10091. n.fire(),
  10092. !1
  10093. }),
  10094. O.addClass(this.__button, "button"),
  10095. this.domElement.appendChild(this.__button)
  10096. }
  10097. ).superclass = P,
  10098. L.extend(D.prototype, P.prototype, {
  10099. fire: function() {
  10100. this.__onChange && this.__onChange.call(this),
  10101. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10102. this.getValue().call(this.object)
  10103. }
  10104. }),
  10105. D),
  10106. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  10107. S = ee.dom.dom,
  10108. M = ee.utils.common,
  10109. (R = function(e, t) {
  10110. R.superclass.call(this, e, t);
  10111. var i = this;
  10112. this.__prev = this.getValue(),
  10113. this.__checkbox = document.createElement("input"),
  10114. this.__checkbox.setAttribute("type", "checkbox"),
  10115. S.bind(this.__checkbox, "change", function() {
  10116. i.setValue(!i.__prev)
  10117. }, !1),
  10118. this.domElement.appendChild(this.__checkbox),
  10119. this.updateDisplay()
  10120. }
  10121. ).superclass = x,
  10122. M.extend(R.prototype, x.prototype, {
  10123. setValue: function(e) {
  10124. var t = R.superclass.prototype.setValue.call(this, e);
  10125. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10126. this.__prev = this.getValue(),
  10127. t
  10128. },
  10129. updateDisplay: function() {
  10130. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  10131. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10132. R.superclass.prototype.updateDisplay.call(this)
  10133. }
  10134. }),
  10135. R),
  10136. ee.color.toString = (T = ee.utils.common,
  10137. function(e) {
  10138. if (1 == e.a || T.isUndefined(e.a)) {
  10139. for (var t = e.hex.toString(16); t.length < 6; )
  10140. t = "0" + t;
  10141. return "#" + t
  10142. }
  10143. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  10144. }
  10145. ),
  10146. ee.color.interpret = (I = ee.color.toString,
  10147. E = ee.utils.common,
  10148. w = [{
  10149. litmus: E.isString,
  10150. conversions: {
  10151. THREE_CHAR_HEX: {
  10152. read: function(e) {
  10153. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10154. return null !== t && {
  10155. space: "HEX",
  10156. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10157. }
  10158. },
  10159. write: I
  10160. },
  10161. SIX_CHAR_HEX: {
  10162. read: function(e) {
  10163. var t = e.match(/^#([A-F0-9]{6})$/i);
  10164. return null !== t && {
  10165. space: "HEX",
  10166. hex: parseInt("0x" + t[1].toString())
  10167. }
  10168. },
  10169. write: I
  10170. },
  10171. CSS_RGB: {
  10172. read: function(e) {
  10173. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10174. return null !== t && {
  10175. space: "RGB",
  10176. r: parseFloat(t[1]),
  10177. g: parseFloat(t[2]),
  10178. b: parseFloat(t[3])
  10179. }
  10180. },
  10181. write: I
  10182. },
  10183. CSS_RGBA: {
  10184. read: function(e) {
  10185. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10186. return null !== t && {
  10187. space: "RGB",
  10188. r: parseFloat(t[1]),
  10189. g: parseFloat(t[2]),
  10190. b: parseFloat(t[3]),
  10191. a: parseFloat(t[4])
  10192. }
  10193. },
  10194. write: I
  10195. }
  10196. }
  10197. }, {
  10198. litmus: E.isNumber,
  10199. conversions: {
  10200. HEX: {
  10201. read: function(e) {
  10202. return {
  10203. space: "HEX",
  10204. hex: e,
  10205. conversionName: "HEX"
  10206. }
  10207. },
  10208. write: function(e) {
  10209. return e.hex
  10210. }
  10211. }
  10212. }
  10213. }, {
  10214. litmus: E.isArray,
  10215. conversions: {
  10216. RGB_ARRAY: {
  10217. read: function(e) {
  10218. return 3 == e.length && {
  10219. space: "RGB",
  10220. r: e[0],
  10221. g: e[1],
  10222. b: e[2]
  10223. }
  10224. },
  10225. write: function(e) {
  10226. return [e.r, e.g, e.b]
  10227. }
  10228. },
  10229. RGBA_ARRAY: {
  10230. read: function(e) {
  10231. return 4 == e.length && {
  10232. space: "RGB",
  10233. r: e[0],
  10234. g: e[1],
  10235. b: e[2],
  10236. a: e[3]
  10237. }
  10238. },
  10239. write: function(e) {
  10240. return [e.r, e.g, e.b, e.a]
  10241. }
  10242. }
  10243. }
  10244. }, {
  10245. litmus: E.isObject,
  10246. conversions: {
  10247. RGBA_OBJ: {
  10248. read: function(e) {
  10249. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10250. space: "RGB",
  10251. r: e.r,
  10252. g: e.g,
  10253. b: e.b,
  10254. a: e.a
  10255. }
  10256. },
  10257. write: function(e) {
  10258. return {
  10259. r: e.r,
  10260. g: e.g,
  10261. b: e.b,
  10262. a: e.a
  10263. }
  10264. }
  10265. },
  10266. RGB_OBJ: {
  10267. read: function(e) {
  10268. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10269. space: "RGB",
  10270. r: e.r,
  10271. g: e.g,
  10272. b: e.b
  10273. }
  10274. },
  10275. write: function(e) {
  10276. return {
  10277. r: e.r,
  10278. g: e.g,
  10279. b: e.b
  10280. }
  10281. }
  10282. },
  10283. HSVA_OBJ: {
  10284. read: function(e) {
  10285. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10286. space: "HSV",
  10287. h: e.h,
  10288. s: e.s,
  10289. v: e.v,
  10290. a: e.a
  10291. }
  10292. },
  10293. write: function(e) {
  10294. return {
  10295. h: e.h,
  10296. s: e.s,
  10297. v: e.v,
  10298. a: e.a
  10299. }
  10300. }
  10301. },
  10302. HSV_OBJ: {
  10303. read: function(e) {
  10304. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10305. space: "HSV",
  10306. h: e.h,
  10307. s: e.s,
  10308. v: e.v
  10309. }
  10310. },
  10311. write: function(e) {
  10312. return {
  10313. h: e.h,
  10314. s: e.s,
  10315. v: e.v
  10316. }
  10317. }
  10318. }
  10319. }
  10320. }],
  10321. function() {
  10322. b = !1;
  10323. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10324. return E.each(w, function(e) {
  10325. if (e.litmus(i))
  10326. return E.each(e.conversions, function(e, t) {
  10327. if (_ = e.read(i),
  10328. !1 === b && !1 !== _)
  10329. return (b = _).conversionName = t,
  10330. _.conversion = e,
  10331. E.BREAK
  10332. }),
  10333. E.BREAK
  10334. }),
  10335. b
  10336. }
  10337. ),
  10338. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10339. function y(e, t, i, n) {
  10340. if (void 0 === t[i])
  10341. throw new Error("Object " + t + ' has no property "' + i + '"');
  10342. var r;
  10343. if (n.color)
  10344. r = new g(t,i);
  10345. else {
  10346. var o = [t, i].concat(n.factoryArgs);
  10347. r = c.apply(e, o)
  10348. }
  10349. n.before instanceof h && (n.before = n.before.__li),
  10350. C(e, r),
  10351. m.addClass(r.domElement, "c");
  10352. var a = document.createElement("span");
  10353. m.addClass(a, "property-name"),
  10354. a.innerHTML = r.property;
  10355. var s = document.createElement("div");
  10356. s.appendChild(a),
  10357. s.appendChild(r.domElement);
  10358. var l = A(e, s, n.before);
  10359. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10360. m.addClass(l, typeof r.getValue()),
  10361. function(t, i, n) {
  10362. if (n.__li = i,
  10363. n.__gui = t,
  10364. v.extend(n, {
  10365. options: function(e) {
  10366. return 1 < arguments.length ? (n.remove(),
  10367. y(t, n.object, n.property, {
  10368. before: n.__li.nextElementSibling,
  10369. factoryArgs: [v.toArray(arguments)]
  10370. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10371. y(t, n.object, n.property, {
  10372. before: n.__li.nextElementSibling,
  10373. factoryArgs: [e]
  10374. })) : void 0
  10375. },
  10376. name: function(e) {
  10377. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10378. n
  10379. },
  10380. listen: function() {
  10381. return n.__gui.listen(n),
  10382. n
  10383. },
  10384. remove: function() {
  10385. return n.__gui.remove(n),
  10386. n
  10387. }
  10388. }),
  10389. n instanceof f) {
  10390. var r = new p(n.object,n.property,{
  10391. min: n.__min,
  10392. max: n.__max,
  10393. step: n.__step
  10394. });
  10395. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10396. var t = n[e]
  10397. , i = r[e];
  10398. n[e] = r[e] = function() {
  10399. var e = Array.prototype.slice.call(arguments);
  10400. return t.apply(n, e),
  10401. i.apply(r, e)
  10402. }
  10403. }),
  10404. m.addClass(i, "has-slider"),
  10405. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10406. } else if (n instanceof p) {
  10407. var e = function(e) {
  10408. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10409. y(t, n.object, n.property, {
  10410. before: n.__li.nextElementSibling,
  10411. factoryArgs: [n.__min, n.__max, n.__step]
  10412. })) : e
  10413. };
  10414. n.min = v.compose(e, n.min),
  10415. n.max = v.compose(e, n.max)
  10416. } else
  10417. n instanceof u ? (m.bind(i, "click", function() {
  10418. m.fakeEvent(n.__checkbox, "click")
  10419. }),
  10420. m.bind(n.__checkbox, "click", function(e) {
  10421. e.stopPropagation()
  10422. })) : n instanceof d ? (m.bind(i, "click", function() {
  10423. m.fakeEvent(n.__button, "click")
  10424. }),
  10425. m.bind(i, "mouseover", function() {
  10426. m.addClass(n.__button, "hover")
  10427. }),
  10428. m.bind(i, "mouseout", function() {
  10429. m.removeClass(n.__button, "hover")
  10430. })) : n instanceof g && (m.addClass(i, "color"),
  10431. n.updateDisplay = v.compose(function(e) {
  10432. return i.style.borderLeftColor = n.__color.toString(),
  10433. e
  10434. }, n.updateDisplay),
  10435. n.updateDisplay());
  10436. n.setValue = v.compose(function(e) {
  10437. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10438. e
  10439. }, n.setValue)
  10440. }(e, l, r),
  10441. e.__controllers.push(r),
  10442. r
  10443. }
  10444. function A(e, t, i) {
  10445. var n = document.createElement("li");
  10446. return t && n.appendChild(t),
  10447. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10448. e.onResize(),
  10449. n
  10450. }
  10451. function C(e, t) {
  10452. var i = e.getRoot()
  10453. , n = i.__rememberedObjects.indexOf(t.object);
  10454. if (-1 != n) {
  10455. var r = i.__rememberedObjectIndecesToControllers[n];
  10456. if (void 0 === r && (r = {},
  10457. i.__rememberedObjectIndecesToControllers[n] = r),
  10458. r[t.property] = t,
  10459. i.load && i.load.remembered) {
  10460. var o, a = i.load.remembered;
  10461. if (a[e.preset])
  10462. o = a[e.preset];
  10463. else {
  10464. if (!a[T])
  10465. return;
  10466. o = a[T]
  10467. }
  10468. if (o[n] && void 0 !== o[n][t.property]) {
  10469. var s = o[n][t.property];
  10470. t.initialValue = s,
  10471. t.setValue(s)
  10472. }
  10473. }
  10474. }
  10475. }
  10476. function I(e, t) {
  10477. return document.location.href + "." + t
  10478. }
  10479. function l(e, t) {
  10480. e.domElement.style.width = t + "px",
  10481. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10482. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10483. }
  10484. function a(r, o) {
  10485. var a = {};
  10486. return v.each(r.__rememberedObjects, function(e, t) {
  10487. var i = {}
  10488. , n = r.__rememberedObjectIndecesToControllers[t];
  10489. v.each(n, function(e, t) {
  10490. i[t] = o ? e.initialValue : e.getValue()
  10491. }),
  10492. a[t] = i
  10493. }),
  10494. a
  10495. }
  10496. function E(e, t, i) {
  10497. var n = document.createElement("option");
  10498. n.innerHTML = t,
  10499. n.value = t,
  10500. e.__preset_select.appendChild(n),
  10501. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10502. }
  10503. function _(e, t) {
  10504. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10505. i.innerHTML = t ? i.value + "*" : i.value
  10506. }
  10507. 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");
  10508. var b, w, T = "Default", x = function() {
  10509. try {
  10510. return "localStorage"in window && null !== window.localStorage
  10511. } catch (e) {
  10512. return !1
  10513. }
  10514. }(), S = !0, s = !1, M = [], R = function(t) {
  10515. var i = this;
  10516. this.domElement = document.createElement("div"),
  10517. this.__ul = document.createElement("ul"),
  10518. this.domElement.appendChild(this.__ul),
  10519. m.addClass(this.domElement, "dg"),
  10520. this.__folders = {},
  10521. this.__controllers = [],
  10522. this.__rememberedObjects = [],
  10523. this.__rememberedObjectIndecesToControllers = [],
  10524. this.__listening = [],
  10525. t = t || {},
  10526. t = v.defaults(t, {
  10527. autoPlace: !0,
  10528. width: R.DEFAULT_WIDTH
  10529. }),
  10530. t = v.defaults(t, {
  10531. resizable: t.autoPlace,
  10532. hideable: t.autoPlace
  10533. }),
  10534. v.isUndefined(t.load) ? t.load = {
  10535. preset: T
  10536. } : t.preset && (t.load.preset = t.preset),
  10537. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10538. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10539. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10540. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10541. if (Object.defineProperties(this, {
  10542. parent: {
  10543. get: function() {
  10544. return t.parent
  10545. }
  10546. },
  10547. scrollable: {
  10548. get: function() {
  10549. return t.scrollable
  10550. }
  10551. },
  10552. autoPlace: {
  10553. get: function() {
  10554. return t.autoPlace
  10555. }
  10556. },
  10557. preset: {
  10558. get: function() {
  10559. return i.parent ? i.getRoot().preset : t.load.preset
  10560. },
  10561. set: function(e) {
  10562. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10563. function(e) {
  10564. for (var t = 0; t < e.__preset_select.length; t++)
  10565. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10566. }(this),
  10567. i.revert()
  10568. }
  10569. },
  10570. width: {
  10571. get: function() {
  10572. return t.width
  10573. },
  10574. set: function(e) {
  10575. t.width = e,
  10576. l(i, e)
  10577. }
  10578. },
  10579. name: {
  10580. get: function() {
  10581. return t.name
  10582. },
  10583. set: function(e) {
  10584. t.name = e,
  10585. a && (a.innerHTML = t.name)
  10586. }
  10587. },
  10588. closed: {
  10589. get: function() {
  10590. return t.closed
  10591. },
  10592. set: function(e) {
  10593. t.closed = e,
  10594. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10595. this.onResize(),
  10596. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10597. }
  10598. },
  10599. load: {
  10600. get: function() {
  10601. return t.load
  10602. }
  10603. },
  10604. useLocalStorage: {
  10605. get: function() {
  10606. return r
  10607. },
  10608. set: function(e) {
  10609. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10610. localStorage.setItem(I(0, "isLocal"), e))
  10611. }
  10612. }
  10613. }),
  10614. v.isUndefined(t.parent)) {
  10615. if (t.closed = !1,
  10616. m.addClass(this.domElement, R.CLASS_MAIN),
  10617. m.makeSelectable(this.domElement, !1),
  10618. x && r) {
  10619. i.useLocalStorage = !0;
  10620. var o = localStorage.getItem(I(0, "gui"));
  10621. o && (t.load = JSON.parse(o))
  10622. }
  10623. this.__closeButton = document.createElement("div"),
  10624. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10625. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10626. this.domElement.appendChild(this.__closeButton),
  10627. m.bind(this.__closeButton, "click", function() {
  10628. i.closed = !i.closed
  10629. })
  10630. } else {
  10631. void 0 === t.closed && (t.closed = !0);
  10632. var a = document.createTextNode(t.name);
  10633. m.addClass(a, "controller-name");
  10634. var s = A(i, a);
  10635. m.addClass(this.__ul, R.CLASS_CLOSED),
  10636. m.addClass(s, "title"),
  10637. m.bind(s, "click", function(e) {
  10638. return e.preventDefault(),
  10639. i.closed = !i.closed,
  10640. !1
  10641. }),
  10642. t.closed || (this.closed = !1)
  10643. }
  10644. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10645. m.addClass(w, "dg"),
  10646. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10647. document.body.appendChild(w),
  10648. S = !1),
  10649. w.appendChild(this.domElement),
  10650. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10651. this.parent || l(i, t.width)),
  10652. m.bind(window, "resize", function() {
  10653. i.onResize()
  10654. }),
  10655. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10656. i.onResize()
  10657. }),
  10658. m.bind(this.__ul, "transitionend", function() {
  10659. i.onResize()
  10660. }),
  10661. m.bind(this.__ul, "oTransitionEnd", function() {
  10662. i.onResize()
  10663. }),
  10664. this.onResize(),
  10665. t.resizable && function(t) {
  10666. function e(e) {
  10667. return e.preventDefault(),
  10668. r = e.clientX,
  10669. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10670. m.bind(window, "mousemove", i),
  10671. m.bind(window, "mouseup", n),
  10672. !1
  10673. }
  10674. function i(e) {
  10675. return e.preventDefault(),
  10676. t.width += r - e.clientX,
  10677. t.onResize(),
  10678. r = e.clientX,
  10679. !1
  10680. }
  10681. function n() {
  10682. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10683. m.unbind(window, "mousemove", i),
  10684. m.unbind(window, "mouseup", n)
  10685. }
  10686. var r;
  10687. t.__resize_handle = document.createElement("div"),
  10688. v.extend(t.__resize_handle.style, {
  10689. width: "6px",
  10690. marginLeft: "-3px",
  10691. height: "200px",
  10692. cursor: "ew-resize",
  10693. position: "absolute"
  10694. }),
  10695. m.bind(t.__resize_handle, "mousedown", e),
  10696. m.bind(t.__closeButton, "mousedown", e),
  10697. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10698. }(this),
  10699. n = function() {
  10700. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10701. }
  10702. ,
  10703. this.saveToLocalStorageIfPossible = n,
  10704. i.getRoot(),
  10705. t.parent || ((e = i.getRoot()).width += 1,
  10706. v.defer(function() {
  10707. e.width -= 1
  10708. }))
  10709. };
  10710. return R.toggleHide = function() {
  10711. s = !s,
  10712. v.each(M, function(e) {
  10713. e.domElement.style.zIndex = s ? -999 : 999,
  10714. e.domElement.style.opacity = s ? 0 : 1
  10715. })
  10716. }
  10717. ,
  10718. R.CLASS_AUTO_PLACE = "a",
  10719. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10720. R.CLASS_MAIN = "main",
  10721. R.CLASS_CONTROLLER_ROW = "cr",
  10722. R.CLASS_TOO_TALL = "taller-than-window",
  10723. R.CLASS_CLOSED = "closed",
  10724. R.CLASS_CLOSE_BUTTON = "close-button",
  10725. R.CLASS_DRAG = "drag",
  10726. R.DEFAULT_WIDTH = 245,
  10727. R.TEXT_CLOSED = "Close Controls",
  10728. R.TEXT_OPEN = "Open Controls",
  10729. m.bind(window, "keydown", function(e) {
  10730. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10731. }, !1),
  10732. v.extend(R.prototype, {
  10733. add: function(e, t) {
  10734. return y(this, e, t, {
  10735. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10736. })
  10737. },
  10738. addColor: function(e, t) {
  10739. return y(this, e, t, {
  10740. color: !0
  10741. })
  10742. },
  10743. remove: function(e) {
  10744. this.__ul.removeChild(e.__li),
  10745. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10746. var t = this;
  10747. v.defer(function() {
  10748. t.onResize()
  10749. })
  10750. },
  10751. destroy: function() {
  10752. this.autoPlace && w.removeChild(this.domElement)
  10753. },
  10754. addFolder: function(e) {
  10755. if (void 0 !== this.__folders[e])
  10756. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10757. var t = {
  10758. name: e,
  10759. parent: this
  10760. };
  10761. t.autoPlace = this.autoPlace,
  10762. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10763. t.load = this.load.folders[e]);
  10764. var i = new R(t);
  10765. this.__folders[e] = i;
  10766. var n = A(this, i.domElement);
  10767. return m.addClass(n, "folder"),
  10768. i
  10769. },
  10770. open: function() {
  10771. this.closed = !1
  10772. },
  10773. close: function() {
  10774. this.closed = !0
  10775. },
  10776. onResize: function() {
  10777. var t = this.getRoot();
  10778. if (t.scrollable) {
  10779. var e = m.getOffset(t.__ul).top
  10780. , i = 0;
  10781. v.each(t.__ul.childNodes, function(e) {
  10782. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10783. }),
  10784. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10785. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10786. t.__ul.style.height = "auto")
  10787. }
  10788. t.__resize_handle && v.defer(function() {
  10789. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10790. }),
  10791. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10792. },
  10793. remember: function() {
  10794. 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>'),
  10795. this.parent)
  10796. throw new Error("You can only call remember on a top level GUI.");
  10797. var t = this;
  10798. v.each(Array.prototype.slice.call(arguments), function(e) {
  10799. 0 == t.__rememberedObjects.length && function(i) {
  10800. var e = i.__save_row = document.createElement("li");
  10801. m.addClass(i.domElement, "has-save"),
  10802. i.__ul.insertBefore(e, i.__ul.firstChild),
  10803. m.addClass(e, "save-row");
  10804. var t = document.createElement("span");
  10805. t.innerHTML = "&nbsp;",
  10806. m.addClass(t, "button gears");
  10807. var n = document.createElement("span");
  10808. n.innerHTML = "Save",
  10809. m.addClass(n, "button"),
  10810. m.addClass(n, "save");
  10811. var r = document.createElement("span");
  10812. r.innerHTML = "New",
  10813. m.addClass(r, "button"),
  10814. m.addClass(r, "save-as");
  10815. var o = document.createElement("span");
  10816. o.innerHTML = "Revert",
  10817. m.addClass(o, "button"),
  10818. m.addClass(o, "revert");
  10819. var a = i.__preset_select = document.createElement("select");
  10820. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10821. E(i, t, t == i.preset)
  10822. }) : E(i, T, !1),
  10823. m.bind(a, "change", function() {
  10824. for (var e = 0; e < i.__preset_select.length; e++)
  10825. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10826. i.preset = this.value
  10827. }),
  10828. e.appendChild(a),
  10829. e.appendChild(t),
  10830. e.appendChild(n),
  10831. e.appendChild(r),
  10832. e.appendChild(o),
  10833. x) {
  10834. var s = document.getElementById("dg-save-locally")
  10835. , l = document.getElementById("dg-local-explain");
  10836. s.style.display = "block";
  10837. var c = document.getElementById("dg-local-storage");
  10838. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10839. var h = function() {
  10840. l.style.display = i.useLocalStorage ? "block" : "none"
  10841. };
  10842. h(),
  10843. m.bind(c, "change", function() {
  10844. i.useLocalStorage = !i.useLocalStorage,
  10845. h()
  10846. })
  10847. }
  10848. var u = document.getElementById("dg-new-constructor");
  10849. m.bind(u, "keydown", function(e) {
  10850. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10851. }),
  10852. m.bind(t, "click", function() {
  10853. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10854. b.show(),
  10855. u.focus(),
  10856. u.select()
  10857. }),
  10858. m.bind(n, "click", function() {
  10859. i.save()
  10860. }),
  10861. m.bind(r, "click", function() {
  10862. var e = prompt("Enter a new preset name.");
  10863. e && i.saveAs(e)
  10864. }),
  10865. m.bind(o, "click", function() {
  10866. i.revert()
  10867. })
  10868. }(t),
  10869. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10870. }),
  10871. this.autoPlace && l(this, this.width)
  10872. },
  10873. getRoot: function() {
  10874. for (var e = this; e.parent; )
  10875. e = e.parent;
  10876. return e
  10877. },
  10878. getSaveObject: function() {
  10879. var i = this.load;
  10880. return i.closed = this.closed,
  10881. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10882. i.remembered || (i.remembered = {}),
  10883. i.remembered[this.preset] = a(this)),
  10884. i.folders = {},
  10885. v.each(this.__folders, function(e, t) {
  10886. i.folders[t] = e.getSaveObject()
  10887. }),
  10888. i
  10889. },
  10890. save: function() {
  10891. this.load.remembered || (this.load.remembered = {}),
  10892. this.load.remembered[this.preset] = a(this),
  10893. _(this, !1),
  10894. this.saveToLocalStorageIfPossible()
  10895. },
  10896. saveAs: function(e) {
  10897. this.load.remembered || (this.load.remembered = {},
  10898. this.load.remembered[T] = a(this, !0)),
  10899. this.load.remembered[e] = a(this),
  10900. this.preset = e,
  10901. E(this, e, !0),
  10902. this.saveToLocalStorageIfPossible()
  10903. },
  10904. revert: function(t) {
  10905. v.each(this.__controllers, function(e) {
  10906. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10907. }, this),
  10908. v.each(this.__folders, function(e) {
  10909. e.revert(e)
  10910. }),
  10911. t || _(this.getRoot(), !1)
  10912. },
  10913. listen: function(e) {
  10914. var t = 0 == this.__listening.length;
  10915. this.__listening.push(e),
  10916. t && function e(t) {
  10917. 0 != t.length && r(function() {
  10918. e(t)
  10919. }),
  10920. v.each(t, function(e) {
  10921. e.updateDisplay()
  10922. })
  10923. }(this.__listening)
  10924. }
  10925. }),
  10926. R
  10927. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10928. u = ee.controllers.NumberControllerBox,
  10929. d = ee.controllers.NumberControllerSlider,
  10930. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10931. y = ee.dom.dom,
  10932. A = ee.utils.common,
  10933. (C = function(e, t) {
  10934. function i() {
  10935. n.setValue(n.__input.value)
  10936. }
  10937. C.superclass.call(this, e, t);
  10938. var n = this;
  10939. this.__input = document.createElement("input"),
  10940. this.__input.setAttribute("type", "text"),
  10941. y.bind(this.__input, "keyup", i),
  10942. y.bind(this.__input, "change", i),
  10943. y.bind(this.__input, "blur", function() {
  10944. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10945. }),
  10946. y.bind(this.__input, "keydown", function(e) {
  10947. 13 === e.keyCode && this.blur()
  10948. }),
  10949. this.updateDisplay(),
  10950. this.domElement.appendChild(this.__input)
  10951. }
  10952. ).superclass = v,
  10953. A.extend(C.prototype, v.prototype, {
  10954. updateDisplay: function() {
  10955. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10956. C.superclass.prototype.updateDisplay.call(this)
  10957. }
  10958. }),
  10959. C),
  10960. f = ee.controllers.FunctionController,
  10961. g = ee.controllers.BooleanController,
  10962. m = ee.utils.common,
  10963. function(e, t) {
  10964. var i = e[t];
  10965. 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,{
  10966. min: arguments[2],
  10967. max: arguments[3]
  10968. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10969. }
  10970. ), 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) {
  10971. function f(t, i, n, r) {
  10972. t.style.background = "",
  10973. p.each(o, function(e) {
  10974. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10975. })
  10976. }
  10977. var g = function(e, t) {
  10978. function i(e) {
  10979. a(e),
  10980. h.bind(window, "mousemove", a),
  10981. h.bind(window, "mouseup", n)
  10982. }
  10983. function n() {
  10984. h.unbind(window, "mousemove", a),
  10985. h.unbind(window, "mouseup", n)
  10986. }
  10987. function r() {
  10988. var e = d(this.value);
  10989. !1 !== e ? (l.__color.__state = e,
  10990. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10991. }
  10992. function o() {
  10993. h.unbind(window, "mousemove", s),
  10994. h.unbind(window, "mouseup", o)
  10995. }
  10996. function a(e) {
  10997. e.preventDefault();
  10998. var t = h.getWidth(l.__saturation_field)
  10999. , i = h.getOffset(l.__saturation_field)
  11000. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  11001. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11002. return 1 < r ? r = 1 : r < 0 && (r = 0),
  11003. 1 < n ? n = 1 : n < 0 && (n = 0),
  11004. l.__color.v = r,
  11005. l.__color.s = n,
  11006. l.setValue(l.__color.toOriginal()),
  11007. !1
  11008. }
  11009. function s(e) {
  11010. e.preventDefault();
  11011. var t = h.getHeight(l.__hue_field)
  11012. , i = h.getOffset(l.__hue_field)
  11013. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  11014. return 1 < n ? n = 1 : n < 0 && (n = 0),
  11015. l.__color.h = 360 * n,
  11016. l.setValue(l.__color.toOriginal()),
  11017. !1
  11018. }
  11019. g.superclass.call(this, e, t),
  11020. this.__color = new u(this.getValue()),
  11021. this.__temp = new u(0);
  11022. var l = this;
  11023. this.domElement = document.createElement("div"),
  11024. h.makeSelectable(this.domElement, !1),
  11025. this.__selector = document.createElement("div"),
  11026. this.__selector.className = "selector",
  11027. this.__saturation_field = document.createElement("div"),
  11028. this.__saturation_field.className = "saturation-field",
  11029. this.__field_knob = document.createElement("div"),
  11030. this.__field_knob.className = "field-knob",
  11031. this.__field_knob_border = "2px solid ",
  11032. this.__hue_knob = document.createElement("div"),
  11033. this.__hue_knob.className = "hue-knob",
  11034. this.__hue_field = document.createElement("div"),
  11035. this.__hue_field.className = "hue-field",
  11036. this.__input = document.createElement("input"),
  11037. this.__input.type = "text",
  11038. this.__input_textShadow = "0 1px 1px ",
  11039. h.bind(this.__input, "keydown", function(e) {
  11040. 13 === e.keyCode && r.call(this)
  11041. }),
  11042. h.bind(this.__input, "blur", r),
  11043. h.bind(this.__selector, "mousedown", function(e) {
  11044. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11045. h.removeClass(l.__selector, "drag")
  11046. })
  11047. });
  11048. var c = document.createElement("div");
  11049. p.extend(this.__selector.style, {
  11050. width: "122px",
  11051. height: "102px",
  11052. padding: "3px",
  11053. backgroundColor: "#222",
  11054. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11055. }),
  11056. p.extend(this.__field_knob.style, {
  11057. position: "absolute",
  11058. width: "12px",
  11059. height: "12px",
  11060. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11061. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11062. borderRadius: "12px",
  11063. zIndex: 1
  11064. }),
  11065. p.extend(this.__hue_knob.style, {
  11066. position: "absolute",
  11067. width: "15px",
  11068. height: "2px",
  11069. borderRight: "4px solid #fff",
  11070. zIndex: 1
  11071. }),
  11072. p.extend(this.__saturation_field.style, {
  11073. width: "100px",
  11074. height: "100px",
  11075. border: "1px solid #555",
  11076. marginRight: "3px",
  11077. display: "inline-block",
  11078. cursor: "pointer"
  11079. }),
  11080. p.extend(c.style, {
  11081. width: "100%",
  11082. height: "100%",
  11083. background: "none"
  11084. }),
  11085. f(c, "top", "rgba(0,0,0,0)", "#000"),
  11086. p.extend(this.__hue_field.style, {
  11087. width: "15px",
  11088. height: "100px",
  11089. display: "inline-block",
  11090. border: "1px solid #555",
  11091. cursor: "ns-resize"
  11092. }),
  11093. function(e) {
  11094. e.style.background = "",
  11095. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11096. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11097. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11098. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11099. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11100. }(this.__hue_field),
  11101. p.extend(this.__input.style, {
  11102. outline: "none",
  11103. textAlign: "center",
  11104. color: "#fff",
  11105. border: 0,
  11106. fontWeight: "bold",
  11107. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11108. }),
  11109. h.bind(this.__saturation_field, "mousedown", i),
  11110. h.bind(this.__field_knob, "mousedown", i),
  11111. h.bind(this.__hue_field, "mousedown", function(e) {
  11112. s(e),
  11113. h.bind(window, "mousemove", s),
  11114. h.bind(window, "mouseup", o)
  11115. }),
  11116. this.__saturation_field.appendChild(c),
  11117. this.__selector.appendChild(this.__field_knob),
  11118. this.__selector.appendChild(this.__saturation_field),
  11119. this.__selector.appendChild(this.__hue_field),
  11120. this.__hue_field.appendChild(this.__hue_knob),
  11121. this.domElement.appendChild(this.__input),
  11122. this.domElement.appendChild(this.__selector),
  11123. this.updateDisplay()
  11124. };
  11125. g.superclass = e,
  11126. p.extend(g.prototype, e.prototype, {
  11127. updateDisplay: function() {
  11128. var t = d(this.getValue());
  11129. if (!1 !== t) {
  11130. var i = !1;
  11131. p.each(u.COMPONENTS, function(e) {
  11132. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  11133. return i = !0,
  11134. {}
  11135. }, this),
  11136. i && p.extend(this.__color.__state, t)
  11137. }
  11138. p.extend(this.__temp.__state, this.__color.__state),
  11139. this.__temp.a = 1;
  11140. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  11141. , n = 255 - e;
  11142. p.extend(this.__field_knob.style, {
  11143. marginLeft: 100 * this.__color.s - 7 + "px",
  11144. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11145. backgroundColor: this.__temp.toString(),
  11146. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  11147. }),
  11148. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11149. this.__temp.s = 1,
  11150. this.__temp.v = 1,
  11151. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11152. p.extend(this.__input.style, {
  11153. backgroundColor: this.__input.value = this.__color.toString(),
  11154. color: "rgb(" + e + "," + e + "," + e + ")",
  11155. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  11156. })
  11157. }
  11158. });
  11159. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11160. return g
  11161. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  11162. a = ee.color.math = {
  11163. hsv_to_rgb: function(e, t, i) {
  11164. var n = Math.floor(e / 60) % 6
  11165. , r = e / 60 - Math.floor(e / 60)
  11166. , o = i * (1 - t)
  11167. , a = i * (1 - r * t)
  11168. , s = i * (1 - (1 - r) * t)
  11169. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11170. return {
  11171. r: 255 * l[0],
  11172. g: 255 * l[1],
  11173. b: 255 * l[2]
  11174. }
  11175. },
  11176. rgb_to_hsv: function(e, t, i) {
  11177. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  11178. return 0 == o ? {
  11179. h: NaN,
  11180. s: 0,
  11181. v: 0
  11182. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  11183. (n /= 6) < 0 && (n += 1),
  11184. {
  11185. h: 360 * n,
  11186. s: a / o,
  11187. v: o / 255
  11188. })
  11189. },
  11190. rgb_to_hex: function(e, t, i) {
  11191. var n = this.hex_with_component(0, 2, e);
  11192. return n = this.hex_with_component(n, 1, t),
  11193. this.hex_with_component(n, 0, i)
  11194. },
  11195. component_from_hex: function(e, t) {
  11196. return e >> 8 * t & 255
  11197. },
  11198. hex_with_component: function(e, t, i) {
  11199. return i << (c = 8 * t) | e & ~(255 << c)
  11200. }
  11201. },
  11202. s = ee.color.toString,
  11203. l = ee.utils.common,
  11204. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11205. l.extend(ae.prototype, {
  11206. toString: function() {
  11207. return s(this)
  11208. },
  11209. toOriginal: function() {
  11210. return this.__state.conversion.write(this)
  11211. }
  11212. }),
  11213. ie(ae.prototype, "r", 2),
  11214. ie(ae.prototype, "g", 1),
  11215. ie(ae.prototype, "b", 0),
  11216. ne(ae.prototype, "h"),
  11217. ne(ae.prototype, "s"),
  11218. ne(ae.prototype, "v"),
  11219. Object.defineProperty(ae.prototype, "a", {
  11220. get: function() {
  11221. return this.__state.a
  11222. },
  11223. set: function(e) {
  11224. this.__state.a = e
  11225. }
  11226. }),
  11227. Object.defineProperty(ae.prototype, "hex", {
  11228. get: function() {
  11229. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11230. this.__state.hex
  11231. },
  11232. set: function(e) {
  11233. this.__state.space = "HEX",
  11234. this.__state.hex = e
  11235. }
  11236. }),
  11237. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11238. window.setTimeout(e, 1e3 / 60)
  11239. }
  11240. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11241. r = ee.utils.common,
  11242. te.prototype.show = function() {
  11243. var e = this;
  11244. this.backgroundElement.style.display = "block",
  11245. this.domElement.style.display = "block",
  11246. this.domElement.style.opacity = 0,
  11247. this.domElement.style.webkitTransform = "scale(1.1)",
  11248. this.layout(),
  11249. r.defer(function() {
  11250. e.backgroundElement.style.opacity = 1,
  11251. e.domElement.style.opacity = 1,
  11252. e.domElement.style.webkitTransform = "scale(1)"
  11253. })
  11254. }
  11255. ,
  11256. te.prototype.hide = function() {
  11257. var e = this
  11258. , t = function() {
  11259. e.domElement.style.display = "none",
  11260. e.backgroundElement.style.display = "none",
  11261. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11262. n.unbind(e.domElement, "transitionend", t),
  11263. n.unbind(e.domElement, "oTransitionEnd", t)
  11264. };
  11265. n.bind(this.domElement, "webkitTransitionEnd", t),
  11266. n.bind(this.domElement, "transitionend", t),
  11267. n.bind(this.domElement, "oTransitionEnd", t),
  11268. this.backgroundElement.style.opacity = 0,
  11269. this.domElement.style.opacity = 0,
  11270. this.domElement.style.webkitTransform = "scale(1.1)"
  11271. }
  11272. ,
  11273. te.prototype.layout = function() {
  11274. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11275. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11276. }
  11277. ,
  11278. te), ee.dom.dom, ee.utils.common)
  11279. }
  11280. , {}],
  11281. 94: [function(e, t, i) {
  11282. (function(J) {
  11283. "use strict";
  11284. function i(e) {
  11285. function t(e, t) {
  11286. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11287. for (var a = 1; a <= e[o]; a++)
  11288. r[t[n]] = [],
  11289. r[t[n]][0] = i,
  11290. r[t[n]][1] = o,
  11291. n++,
  11292. i++;
  11293. i *= 2
  11294. }
  11295. return r
  11296. }
  11297. function _(e) {
  11298. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11299. t & 1 << i && (B |= 1 << V),
  11300. i--,
  11301. --V < 0 && (255 == B ? (b(255),
  11302. b(0)) : b(B),
  11303. V = 7,
  11304. B = 0)
  11305. }
  11306. function b(e) {
  11307. F.push(e)
  11308. }
  11309. function w(e) {
  11310. b(e >> 8 & 255),
  11311. b(255 & e)
  11312. }
  11313. function T(e, t, i, n, r) {
  11314. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11315. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11316. for (h = 0; h < 8; ++h) {
  11317. i = e[d],
  11318. n = e[d + 1],
  11319. r = e[d + 2],
  11320. o = e[d + 3],
  11321. a = e[d + 4],
  11322. s = e[d + 5],
  11323. l = e[d + 6];
  11324. var p = i + (c = e[d + 7])
  11325. , f = i - c
  11326. , g = n + l
  11327. , m = n - l
  11328. , v = r + s
  11329. , y = r - s
  11330. , A = o + a
  11331. , C = o - a
  11332. , I = p + A
  11333. , E = p - A
  11334. , _ = g + v
  11335. , b = g - v;
  11336. e[d] = I + _,
  11337. e[d + 4] = I - _;
  11338. var w = .707106781 * (b + E);
  11339. e[d + 2] = E + w,
  11340. e[d + 6] = E - w;
  11341. var T = .382683433 * ((I = C + y) - (b = m + f))
  11342. , x = .5411961 * I + T
  11343. , S = 1.306562965 * b + T
  11344. , M = .707106781 * (_ = y + m)
  11345. , R = f + M
  11346. , P = f - M;
  11347. e[d + 5] = P + x,
  11348. e[d + 3] = P - x,
  11349. e[d + 1] = R + S,
  11350. e[d + 7] = R - S,
  11351. d += 8
  11352. }
  11353. for (h = d = 0; h < 8; ++h) {
  11354. i = e[d],
  11355. n = e[d + 8],
  11356. r = e[d + 16],
  11357. o = e[d + 24],
  11358. a = e[d + 32],
  11359. s = e[d + 40],
  11360. l = e[d + 48];
  11361. var O = i + (c = e[d + 56])
  11362. , L = i - c
  11363. , D = n + l
  11364. , N = n - l
  11365. , F = r + s
  11366. , B = r - s
  11367. , V = o + a
  11368. , k = o - a
  11369. , U = O + V
  11370. , H = O - V
  11371. , z = D + F
  11372. , G = D - F;
  11373. e[d] = U + z,
  11374. e[d + 32] = U - z;
  11375. var W = .707106781 * (G + H);
  11376. e[d + 16] = H + W,
  11377. e[d + 48] = H - W;
  11378. var j = .382683433 * ((U = k + B) - (G = N + L))
  11379. , Y = .5411961 * U + j
  11380. , q = 1.306562965 * G + j
  11381. , X = .707106781 * (z = B + N)
  11382. , Z = L + X
  11383. , K = L - X;
  11384. e[d + 40] = K + Y,
  11385. e[d + 24] = K - Y,
  11386. e[d + 8] = Z + q,
  11387. e[d + 56] = Z - q,
  11388. d++
  11389. }
  11390. for (h = 0; h < 64; ++h)
  11391. u = e[h] * t[h],
  11392. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11393. return Q
  11394. }(e, t), c = 0; c < 64; ++c)
  11395. A[C[c]] = l[c];
  11396. var h = A[0] - i;
  11397. i = A[0],
  11398. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11399. _(v[o]));
  11400. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11401. ;
  11402. if (0 == u)
  11403. return _(a),
  11404. i;
  11405. for (var d, p = 1; p <= u; ) {
  11406. for (var f = p; 0 == A[p] && p <= u; ++p)
  11407. ;
  11408. var g = p - f;
  11409. if (16 <= g) {
  11410. d = g >> 4;
  11411. for (var m = 1; m <= d; ++m)
  11412. _(s);
  11413. g &= 15
  11414. }
  11415. o = 32767 + A[p],
  11416. _(r[(g << 4) + y[o]]),
  11417. _(v[o]),
  11418. p++
  11419. }
  11420. return 63 != u && _(a),
  11421. i
  11422. }
  11423. function x(e) {
  11424. if (e <= 0 && (e = 1),
  11425. 100 < e && (e = 100),
  11426. i != e) {
  11427. (function(e) {
  11428. 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++) {
  11429. var n = u((t[i] * e + 50) / 100);
  11430. n < 1 ? n = 1 : 255 < n && (n = 255),
  11431. O[C[i]] = n
  11432. }
  11433. 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++) {
  11434. var a = u((r[o] * e + 50) / 100);
  11435. a < 1 ? a = 1 : 255 < a && (a = 255),
  11436. L[C[o]] = a
  11437. }
  11438. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11439. for (var h = 0; h < 8; h++)
  11440. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11441. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11442. l++
  11443. }
  11444. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11445. i = e
  11446. }
  11447. }
  11448. var S, M, R, P, i, u = (Math.round,
  11449. 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];
  11450. this.encode = function(e, t) {
  11451. var i = ((new Date).getTime(),
  11452. t.quality);
  11453. i && x(i),
  11454. F = new Array,
  11455. B = 0,
  11456. V = 7,
  11457. w(65496),
  11458. w(65504),
  11459. w(16),
  11460. b(74),
  11461. b(70),
  11462. b(73),
  11463. b(70),
  11464. b(0),
  11465. b(1),
  11466. b(1),
  11467. b(0),
  11468. w(1),
  11469. w(1),
  11470. b(0),
  11471. b(0),
  11472. function() {
  11473. w(65499),
  11474. w(132),
  11475. b(0);
  11476. for (var e = 0; e < 64; e++)
  11477. b(O[e]);
  11478. b(1);
  11479. for (var t = 0; t < 64; t++)
  11480. b(L[t])
  11481. }(),
  11482. function(e, t) {
  11483. w(65472),
  11484. w(17),
  11485. b(8),
  11486. w(t),
  11487. w(e),
  11488. b(3),
  11489. b(1),
  11490. b(17),
  11491. b(0),
  11492. b(2),
  11493. b(17),
  11494. b(1),
  11495. b(3),
  11496. b(17),
  11497. b(1)
  11498. }(e.width, e.height),
  11499. function() {
  11500. w(65476),
  11501. w(418),
  11502. b(0);
  11503. for (var e = 0; e < 16; e++)
  11504. b(G[e + 1]);
  11505. for (var t = 0; t <= 11; t++)
  11506. b(W[t]);
  11507. b(16);
  11508. for (var i = 0; i < 16; i++)
  11509. b(j[i + 1]);
  11510. for (var n = 0; n <= 161; n++)
  11511. b(Y[n]);
  11512. b(1);
  11513. for (var r = 0; r < 16; r++)
  11514. b(q[r + 1]);
  11515. for (var o = 0; o <= 11; o++)
  11516. b(X[o]);
  11517. b(17);
  11518. for (var a = 0; a < 16; a++)
  11519. b(Z[a + 1]);
  11520. for (var s = 0; s <= 161; s++)
  11521. b(K[s])
  11522. }(),
  11523. w(65498),
  11524. w(12),
  11525. b(3),
  11526. b(1),
  11527. b(0),
  11528. b(2),
  11529. b(17),
  11530. b(3),
  11531. b(17),
  11532. b(0),
  11533. b(63),
  11534. b(0);
  11535. var n = 0
  11536. , r = 0
  11537. , o = 0;
  11538. B = 0,
  11539. V = 7,
  11540. this.encode.displayName = "_encode_";
  11541. 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; ) {
  11542. for (a = 0; a < A; ) {
  11543. for (u = h = A * C + a,
  11544. d = -1,
  11545. f = p = 0; f < 64; f++)
  11546. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11547. v <= C + p && (u -= A * (C + 1 + p - v)),
  11548. A <= a + d && (u -= a + d - A + 4),
  11549. s = g[u++],
  11550. l = g[u++],
  11551. c = g[u++],
  11552. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11553. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11554. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11555. n = T(k, D, n, S, R),
  11556. r = T(U, N, r, M, P),
  11557. o = T(H, N, o, M, P),
  11558. a += 32
  11559. }
  11560. C += I
  11561. }
  11562. if (0 <= V) {
  11563. var E = [];
  11564. E[1] = V + 1,
  11565. E[0] = (1 << V + 1) - 1,
  11566. _(E)
  11567. }
  11568. return w(65497),
  11569. new J(F)
  11570. }
  11571. ,
  11572. (new Date).getTime(),
  11573. e = e || 50,
  11574. function() {
  11575. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11576. n[t] = e(t)
  11577. }(),
  11578. S = t(G, W),
  11579. M = t(q, X),
  11580. R = t(j, Y),
  11581. P = t(Z, K),
  11582. function() {
  11583. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11584. for (var n = e; n < t; n++)
  11585. y[32767 + n] = i,
  11586. v[32767 + n] = [],
  11587. v[32767 + n][1] = i,
  11588. v[32767 + n][0] = n;
  11589. for (var r = -(t - 1); r <= -e; r++)
  11590. y[32767 + r] = i,
  11591. v[32767 + r] = [],
  11592. v[32767 + r][1] = i,
  11593. v[32767 + r][0] = t - 1 + r;
  11594. e <<= 1,
  11595. t <<= 1
  11596. }
  11597. }(),
  11598. function() {
  11599. for (var e = 0; e < 256; e++)
  11600. z[e] = 19595 * e,
  11601. z[e + 256 >> 0] = 38470 * e,
  11602. z[e + 512 >> 0] = 7471 * e + 32768,
  11603. z[e + 768 >> 0] = -11059 * e,
  11604. z[e + 1024 >> 0] = -21709 * e,
  11605. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11606. z[e + 1536 >> 0] = -27439 * e,
  11607. z[e + 1792 >> 0] = -5329 * e
  11608. }(),
  11609. x(e),
  11610. (new Date).getTime()
  11611. }
  11612. t.exports.encode = function(e, t) {
  11613. return (t = t || {}).quality = t.quality || 50,
  11614. {
  11615. data: new i(t.quality).encode(e, t),
  11616. width: e.width,
  11617. height: e.height
  11618. }
  11619. }
  11620. }
  11621. ).call(this, e("buffer").Buffer)
  11622. }
  11623. , {
  11624. buffer: 198
  11625. }],
  11626. 95: [function(e, t, i) {
  11627. "use strict";
  11628. !function() {
  11629. if ("performance"in window == 0 && (window.performance = {}),
  11630. Date.now = Date.now || function() {
  11631. return (new Date).getTime()
  11632. }
  11633. ,
  11634. "now"in window.performance == 0) {
  11635. var e = Date.now();
  11636. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11637. window.performance.now = function() {
  11638. return Date.now() - e
  11639. }
  11640. }
  11641. }()
  11642. }
  11643. , {}],
  11644. 96: [function(e, t, i) {
  11645. "use strict";
  11646. var a = e("three");
  11647. a.EffectComposer = function(e, t) {
  11648. if (this.renderer = e,
  11649. void 0 === t) {
  11650. var i = {
  11651. minFilter: a.LinearFilter,
  11652. magFilter: a.LinearFilter,
  11653. format: a.RGBAFormat,
  11654. stencilBuffer: !1
  11655. }
  11656. , n = e.getSize();
  11657. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11658. }
  11659. this.renderTarget1 = t,
  11660. this.renderTarget2 = t.clone(),
  11661. this.writeBuffer = this.renderTarget1,
  11662. this.readBuffer = this.renderTarget2,
  11663. this.passes = [],
  11664. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11665. this.copyPass = new a.ShaderPass(a.CopyShader)
  11666. }
  11667. ,
  11668. a.EffectComposer.prototype = {
  11669. swapBuffers: function() {
  11670. var e = this.readBuffer;
  11671. this.readBuffer = this.writeBuffer,
  11672. this.writeBuffer = e
  11673. },
  11674. addPass: function(e) {
  11675. this.passes.push(e)
  11676. },
  11677. insertPass: function(e, t) {
  11678. this.passes.splice(t, 0, e)
  11679. },
  11680. render: function(e) {
  11681. this.writeBuffer = this.renderTarget1,
  11682. this.readBuffer = this.renderTarget2;
  11683. var t, i, n = !1, r = this.passes.length;
  11684. for (i = 0; i < r; i++)
  11685. if ((t = this.passes[i]).enabled) {
  11686. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11687. t.needsSwap) {
  11688. if (n) {
  11689. var o = this.renderer.context;
  11690. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11691. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11692. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11693. }
  11694. this.swapBuffers()
  11695. }
  11696. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11697. }
  11698. },
  11699. reset: function(e) {
  11700. if (void 0 === e) {
  11701. var t = this.renderer.getSize();
  11702. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11703. }
  11704. this.renderTarget1.dispose(),
  11705. this.renderTarget2.dispose(),
  11706. this.renderTarget1 = e,
  11707. this.renderTarget2 = e.clone(),
  11708. this.writeBuffer = this.renderTarget1,
  11709. this.readBuffer = this.renderTarget2
  11710. },
  11711. setSize: function(e, t) {
  11712. this.renderTarget1.setSize(e, t),
  11713. this.renderTarget2.setSize(e, t)
  11714. }
  11715. }
  11716. }
  11717. , {
  11718. three: 217
  11719. }],
  11720. 97: [function(e, t, i) {
  11721. "use strict";
  11722. var n = e("three");
  11723. n.MaskPass = function(e, t) {
  11724. this.scene = e,
  11725. this.camera = t,
  11726. this.enabled = !0,
  11727. this.clear = !0,
  11728. this.needsSwap = !1,
  11729. this.inverse = !1
  11730. }
  11731. ,
  11732. n.MaskPass.prototype = {
  11733. render: function(e, t, i, n) {
  11734. var r, o, a = e.context;
  11735. a.colorMask(!1, !1, !1, !1),
  11736. a.depthMask(!1),
  11737. o = this.inverse ? (r = 0,
  11738. 1) : (r = 1,
  11739. 0),
  11740. a.enable(a.STENCIL_TEST),
  11741. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11742. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11743. a.clearStencil(o),
  11744. e.render(this.scene, this.camera, i, this.clear),
  11745. e.render(this.scene, this.camera, t, this.clear),
  11746. a.colorMask(!0, !0, !0, !0),
  11747. a.depthMask(!0),
  11748. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11749. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11750. }
  11751. },
  11752. n.ClearMaskPass = function() {
  11753. this.enabled = !0
  11754. }
  11755. ,
  11756. n.ClearMaskPass.prototype = {
  11757. render: function(e, t, i, n) {
  11758. var r = e.context;
  11759. r.disable(r.STENCIL_TEST)
  11760. }
  11761. }
  11762. }
  11763. , {
  11764. three: 217
  11765. }],
  11766. 98: [function(e, t, i) {
  11767. "use strict";
  11768. var o = e("three");
  11769. o.RenderPass = function(e, t, i, n, r) {
  11770. this.scene = e,
  11771. this.camera = t,
  11772. this.overrideMaterial = i,
  11773. this.clearColor = n,
  11774. this.clearAlpha = void 0 !== r ? r : 1,
  11775. this.oldClearColor = new o.Color,
  11776. this.oldClearAlpha = 1,
  11777. this.enabled = !0,
  11778. this.clear = !0,
  11779. this.needsSwap = !1
  11780. }
  11781. ,
  11782. o.RenderPass.prototype = {
  11783. render: function(e, t, i, n) {
  11784. this.scene.overrideMaterial = this.overrideMaterial,
  11785. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11786. this.oldClearAlpha = e.getClearAlpha(),
  11787. e.setClearColor(this.clearColor, this.clearAlpha)),
  11788. e.render(this.scene, this.camera, i, this.clear),
  11789. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11790. this.scene.overrideMaterial = null
  11791. }
  11792. }
  11793. }
  11794. , {
  11795. three: 217
  11796. }],
  11797. 99: [function(e, t, i) {
  11798. "use strict";
  11799. var n = e("three");
  11800. n.ShaderPass = function(e, t) {
  11801. this.textureID = void 0 !== t ? t : "tDiffuse",
  11802. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11803. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11804. this.material = new n.ShaderMaterial({
  11805. defines: e.defines || {},
  11806. uniforms: this.uniforms,
  11807. vertexShader: e.vertexShader,
  11808. fragmentShader: e.fragmentShader
  11809. })),
  11810. this.renderToScreen = !1,
  11811. this.enabled = !0,
  11812. this.needsSwap = !0,
  11813. this.clear = !1,
  11814. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11815. this.scene = new n.Scene,
  11816. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11817. this.scene.add(this.quad)
  11818. }
  11819. ,
  11820. n.ShaderPass.prototype = {
  11821. render: function(e, t, i, n) {
  11822. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11823. this.quad.material = this.material,
  11824. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11825. }
  11826. }
  11827. }
  11828. , {
  11829. three: 217
  11830. }],
  11831. 100: [function(e, t, i) {
  11832. "use strict";
  11833. e("three").CopyShader = {
  11834. uniforms: {
  11835. tDiffuse: {
  11836. type: "t",
  11837. value: null
  11838. },
  11839. opacity: {
  11840. type: "f",
  11841. value: 1
  11842. }
  11843. },
  11844. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11845. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11846. }
  11847. }
  11848. , {
  11849. three: 217
  11850. }],
  11851. 101: [function(e, t, i) {
  11852. "use strict";
  11853. e("three").HorizontalBlurShader = {
  11854. uniforms: {
  11855. tDiffuse: {
  11856. type: "t",
  11857. value: null
  11858. },
  11859. h: {
  11860. type: "f",
  11861. value: 1 / 512
  11862. }
  11863. },
  11864. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11865. 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")
  11866. }
  11867. }
  11868. , {
  11869. three: 217
  11870. }],
  11871. 102: [function(e, t, i) {
  11872. "use strict";
  11873. e("three").VerticalBlurShader = {
  11874. uniforms: {
  11875. tDiffuse: {
  11876. type: "t",
  11877. value: null
  11878. },
  11879. v: {
  11880. type: "f",
  11881. value: 1 / 512
  11882. }
  11883. },
  11884. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11885. 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")
  11886. }
  11887. }
  11888. , {
  11889. three: 217
  11890. }],
  11891. 103: [function(e, t, i) {
  11892. "use strict";
  11893. var z = e("three");
  11894. !function() {
  11895. if ("performance"in window == 0 && (window.performance = {}),
  11896. "now"in window.performance == 0) {
  11897. var e = Date.now();
  11898. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11899. window.performance.now = function() {
  11900. return Date.now() - e
  11901. }
  11902. }
  11903. }(),
  11904. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11905. var t, i = this.extensions, n = this.context;
  11906. if (e === z.RepeatWrapping)
  11907. return n.REPEAT;
  11908. if (e === z.ClampToEdgeWrapping)
  11909. return n.CLAMP_TO_EDGE;
  11910. if (e === z.MirroredRepeatWrapping)
  11911. return n.MIRRORED_REPEAT;
  11912. if (e === z.NearestFilter)
  11913. return n.NEAREST;
  11914. if (e === z.NearestMipMapNearestFilter)
  11915. return n.NEAREST_MIPMAP_NEAREST;
  11916. if (e === z.NearestMipMapLinearFilter)
  11917. return n.NEAREST_MIPMAP_LINEAR;
  11918. if (e === z.LinearFilter)
  11919. return n.LINEAR;
  11920. if (e === z.LinearMipMapNearestFilter)
  11921. return n.LINEAR_MIPMAP_NEAREST;
  11922. if (e === z.LinearMipMapLinearFilter)
  11923. return n.LINEAR_MIPMAP_LINEAR;
  11924. if (e === z.UnsignedByteType)
  11925. return n.UNSIGNED_BYTE;
  11926. if (e === z.UnsignedShort4444Type)
  11927. return n.UNSIGNED_SHORT_4_4_4_4;
  11928. if (e === z.UnsignedShort5551Type)
  11929. return n.UNSIGNED_SHORT_5_5_5_1;
  11930. if (e === z.UnsignedShort565Type)
  11931. return n.UNSIGNED_SHORT_5_6_5;
  11932. if (e === z.ByteType)
  11933. return n.BYTE;
  11934. if (e === z.ShortType)
  11935. return n.SHORT;
  11936. if (e === z.UnsignedShortType)
  11937. return n.UNSIGNED_SHORT;
  11938. if (e === z.IntType)
  11939. return n.INT;
  11940. if (e === z.UnsignedIntType)
  11941. return n.UNSIGNED_INT;
  11942. if (e === z.FloatType)
  11943. return n.FLOAT;
  11944. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11945. return t.HALF_FLOAT_OES;
  11946. if (e === z.AlphaFormat)
  11947. return n.ALPHA;
  11948. if (e === z.RGBFormat)
  11949. return n.RGB;
  11950. if (e === z.RGBAFormat)
  11951. return n.RGBA;
  11952. if (e === z.LuminanceFormat)
  11953. return n.LUMINANCE;
  11954. if (e === z.LuminanceAlphaFormat)
  11955. return n.LUMINANCE_ALPHA;
  11956. if (e === z.AddEquation)
  11957. return n.FUNC_ADD;
  11958. if (e === z.SubtractEquation)
  11959. return n.FUNC_SUBTRACT;
  11960. if (e === z.ReverseSubtractEquation)
  11961. return n.FUNC_REVERSE_SUBTRACT;
  11962. if (e === z.ZeroFactor)
  11963. return n.ZERO;
  11964. if (e === z.OneFactor)
  11965. return n.ONE;
  11966. if (e === z.SrcColorFactor)
  11967. return n.SRC_COLOR;
  11968. if (e === z.OneMinusSrcColorFactor)
  11969. return n.ONE_MINUS_SRC_COLOR;
  11970. if (e === z.SrcAlphaFactor)
  11971. return n.SRC_ALPHA;
  11972. if (e === z.OneMinusSrcAlphaFactor)
  11973. return n.ONE_MINUS_SRC_ALPHA;
  11974. if (e === z.DstAlphaFactor)
  11975. return n.DST_ALPHA;
  11976. if (e === z.OneMinusDstAlphaFactor)
  11977. return n.ONE_MINUS_DST_ALPHA;
  11978. if (e === z.DstColorFactor)
  11979. return n.DST_COLOR;
  11980. if (e === z.OneMinusDstColorFactor)
  11981. return n.ONE_MINUS_DST_COLOR;
  11982. if (e === z.SrcAlphaSaturateFactor)
  11983. return n.SRC_ALPHA_SATURATE;
  11984. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11985. if (e === z.RGB_S3TC_DXT1_Format)
  11986. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11987. if (e === z.RGBA_S3TC_DXT1_Format)
  11988. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11989. if (e === z.RGBA_S3TC_DXT3_Format)
  11990. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11991. if (e === z.RGBA_S3TC_DXT5_Format)
  11992. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11993. }
  11994. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11995. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11996. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11997. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11998. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11999. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  12000. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12001. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  12002. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12003. }
  12004. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  12005. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12006. if (null !== (t = i.get("EXT_blend_minmax"))) {
  12007. if (e === z.MinEquation)
  12008. return t.MIN_EXT;
  12009. if (e === z.MaxEquation)
  12010. return t.MAX_EXT
  12011. }
  12012. return 0
  12013. }
  12014. ,
  12015. z.WebGLState = function(l, i, c) {
  12016. var n = this
  12017. , r = new z.Vector4
  12018. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  12019. , o = new Uint8Array(e)
  12020. , a = new Uint8Array(e)
  12021. , s = new Uint8Array(e)
  12022. , t = {}
  12023. , h = null
  12024. , u = null
  12025. , d = null
  12026. , p = null
  12027. , f = null
  12028. , g = null
  12029. , m = null
  12030. , v = null
  12031. , y = !1
  12032. , A = null
  12033. , C = null
  12034. , I = null
  12035. , E = null
  12036. , _ = null
  12037. , b = null
  12038. , w = null
  12039. , T = null
  12040. , x = null
  12041. , S = null
  12042. , M = null
  12043. , R = null
  12044. , P = null
  12045. , O = null
  12046. , L = null
  12047. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  12048. , N = void 0
  12049. , F = {}
  12050. , B = new z.Vector4
  12051. , V = null
  12052. , k = null
  12053. , U = new z.Vector4
  12054. , H = new z.Vector4;
  12055. this.init = function() {
  12056. this.clearColor(0, 0, 0, 1),
  12057. this.clearDepth(1),
  12058. this.clearStencil(0),
  12059. this.enable(l.DEPTH_TEST),
  12060. l.depthFunc(l.LEQUAL),
  12061. l.frontFace(l.CCW),
  12062. l.cullFace(l.BACK),
  12063. this.enable(l.CULL_FACE),
  12064. this.enable(l.BLEND),
  12065. l.blendEquation(l.FUNC_ADD),
  12066. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  12067. }
  12068. ,
  12069. this.initAttributes = function() {
  12070. for (var e = 0, t = o.length; e < t; e++)
  12071. o[e] = 0
  12072. }
  12073. ,
  12074. this.enableAttribute = function(e) {
  12075. o[e] = 1,
  12076. 0 === a[e] && (l.enableVertexAttribArray(e),
  12077. a[e] = 1),
  12078. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  12079. s[e] = 0)
  12080. }
  12081. ,
  12082. this.enableAttributeAndDivisor = function(e, t, i) {
  12083. o[e] = 1,
  12084. 0 === a[e] && (l.enableVertexAttribArray(e),
  12085. a[e] = 1),
  12086. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  12087. s[e] = t)
  12088. }
  12089. ,
  12090. this.disableUnusedAttributes = function() {
  12091. for (var e = 0, t = a.length; e < t; e++)
  12092. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  12093. a[e] = 0)
  12094. }
  12095. ,
  12096. this.enable = function(e) {
  12097. !0 !== t[e] && (l.enable(e),
  12098. t[e] = !0)
  12099. }
  12100. ,
  12101. this.disable = function(e) {
  12102. !1 !== t[e] && (l.disable(e),
  12103. t[e] = !1)
  12104. }
  12105. ,
  12106. this.getCompressedTextureFormats = function() {
  12107. if (null === h && (h = [],
  12108. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  12109. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  12110. h.push(e[t]);
  12111. return h
  12112. }
  12113. ,
  12114. this.setBlending = function(e, t, i, n, r, o, a, s) {
  12115. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  12116. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12117. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  12118. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12119. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12120. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12121. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  12122. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12123. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  12124. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  12125. u = e,
  12126. y = s),
  12127. e === z.CustomBlending ? (r = r || t,
  12128. o = o || i,
  12129. a = a || n,
  12130. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  12131. d = t,
  12132. g = r),
  12133. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  12134. p = i,
  12135. f = n,
  12136. m = o,
  12137. v = a)) : v = m = g = f = p = d = null
  12138. }
  12139. ,
  12140. this.setDepthFunc = function(e) {
  12141. if (A !== e) {
  12142. if (e)
  12143. switch (e) {
  12144. case z.NeverDepth:
  12145. l.depthFunc(l.NEVER);
  12146. break;
  12147. case z.AlwaysDepth:
  12148. l.depthFunc(l.ALWAYS);
  12149. break;
  12150. case z.LessDepth:
  12151. l.depthFunc(l.LESS);
  12152. break;
  12153. case z.LessEqualDepth:
  12154. l.depthFunc(l.LEQUAL);
  12155. break;
  12156. case z.EqualDepth:
  12157. l.depthFunc(l.EQUAL);
  12158. break;
  12159. case z.GreaterEqualDepth:
  12160. l.depthFunc(l.GEQUAL);
  12161. break;
  12162. case z.GreaterDepth:
  12163. l.depthFunc(l.GREATER);
  12164. break;
  12165. case z.NotEqualDepth:
  12166. l.depthFunc(l.NOTEQUAL);
  12167. break;
  12168. default:
  12169. l.depthFunc(l.LEQUAL)
  12170. }
  12171. else
  12172. l.depthFunc(l.LEQUAL);
  12173. A = e
  12174. }
  12175. }
  12176. ,
  12177. this.setDepthTest = function(e) {
  12178. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  12179. }
  12180. ,
  12181. this.setDepthWrite = function(e) {
  12182. C !== e && (l.depthMask(e),
  12183. C = e)
  12184. }
  12185. ,
  12186. this.setColorWrite = function(e) {
  12187. I !== e && (l.colorMask(e, e, e, e),
  12188. I = e)
  12189. }
  12190. ,
  12191. this.setStencilFunc = function(e, t, i) {
  12192. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  12193. _ = e,
  12194. b = t,
  12195. w = i)
  12196. }
  12197. ,
  12198. this.setStencilOp = function(e, t, i) {
  12199. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12200. T = e,
  12201. x = t,
  12202. S = i)
  12203. }
  12204. ,
  12205. this.setStencilTest = function(e) {
  12206. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12207. }
  12208. ,
  12209. this.setStencilWrite = function(e) {
  12210. E !== e && (l.stencilMask(e),
  12211. E = e)
  12212. }
  12213. ,
  12214. this.setFlipSided = function(e) {
  12215. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12216. M = e)
  12217. }
  12218. ,
  12219. this.setLineWidth = function(e) {
  12220. e !== R && (l.lineWidth(e),
  12221. R = e)
  12222. }
  12223. ,
  12224. this.setPolygonOffset = function(e, t, i) {
  12225. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12226. !e || P === t && O === i || (l.polygonOffset(t, i),
  12227. P = t,
  12228. O = i)
  12229. }
  12230. ,
  12231. this.getScissorTest = function() {
  12232. return L
  12233. }
  12234. ,
  12235. this.setScissorTest = function(e) {
  12236. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12237. }
  12238. ,
  12239. this.activeTexture = function(e) {
  12240. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12241. N !== e && (l.activeTexture(e),
  12242. N = e)
  12243. }
  12244. ,
  12245. this.bindTexture = function(e, t) {
  12246. void 0 === N && n.activeTexture();
  12247. var i = F[N];
  12248. void 0 === i && (i = {
  12249. type: void 0,
  12250. texture: void 0
  12251. },
  12252. F[N] = i),
  12253. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12254. i.type = e,
  12255. i.texture = t)
  12256. }
  12257. ,
  12258. this.compressedTexImage2D = function() {
  12259. try {
  12260. l.compressedTexImage2D.apply(l, arguments)
  12261. } catch (e) {
  12262. console.error(e)
  12263. }
  12264. }
  12265. ,
  12266. this.texImage2D = function() {
  12267. try {
  12268. l.texImage2D.apply(l, arguments)
  12269. } catch (e) {
  12270. console.error(e)
  12271. }
  12272. }
  12273. ,
  12274. this.clearColor = function(e, t, i, n) {
  12275. r.set(e, t, i, n),
  12276. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12277. B.copy(r))
  12278. }
  12279. ,
  12280. this.clearDepth = function(e) {
  12281. V !== e && (l.clearDepth(e),
  12282. V = e)
  12283. }
  12284. ,
  12285. this.clearStencil = function(e) {
  12286. k !== e && (l.clearStencil(e),
  12287. k = e)
  12288. }
  12289. ,
  12290. this.scissor = function(e) {
  12291. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12292. U.copy(e))
  12293. }
  12294. ,
  12295. this.viewport = function(e) {
  12296. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12297. H.copy(e))
  12298. }
  12299. ,
  12300. this.reset = function() {
  12301. for (var e = 0; e < a.length; e++)
  12302. 1 === a[e] && (l.disableVertexAttribArray(e),
  12303. a[e] = 0);
  12304. t = {},
  12305. N = void 0,
  12306. F = {},
  12307. M = E = C = I = u = h = null
  12308. }
  12309. }
  12310. }
  12311. , {
  12312. three: 217
  12313. }],
  12314. 104: [function(a, h, e) {
  12315. (function(i, e) {
  12316. "use strict";
  12317. function t(e) {
  12318. this.urls = e;
  12319. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12320. this.builder = n.loadProto(t),
  12321. this.decoder = this.builder.build("binary_mesh")
  12322. }
  12323. var s = a("three")
  12324. , n = a("protobufjs")
  12325. , r = a("../util/logger")
  12326. , o = (a("../util/common"),
  12327. a("../util/ajax"))
  12328. , l = a("../objects/Chunk")
  12329. , c = new r(e);
  12330. t.prototype = {
  12331. constructor: t,
  12332. load: function(t, i, n, r) {
  12333. return c.time("download"),
  12334. o.get(t, {
  12335. responseType: "arraybuffer"
  12336. }).done(function(e) {
  12337. c.timeEnd("download"),
  12338. this.parse(e, t, i, n, r)
  12339. }
  12340. .bind(this)).fail(r)
  12341. },
  12342. parse: function(e, t, i, n, r) {
  12343. var o = this.readProtobuf(e);
  12344. if (!o)
  12345. return r();
  12346. try {
  12347. c.time("convert to webgl"),
  12348. this.convertProtobufToSceneObject(o, t, i, n, r),
  12349. c.timeEnd("convert to webgl")
  12350. } catch (e) {
  12351. return c.error("failed parsing .dam"),
  12352. c.error(e.message),
  12353. r()
  12354. }
  12355. },
  12356. readProtobuf: function(e) {
  12357. var t;
  12358. try {
  12359. c.time("parse proto"),
  12360. t = this.decoder.decode(e),
  12361. c.timeEnd("parse proto")
  12362. } catch (e) {
  12363. return c.error("failed parsing proto for .dam"),
  12364. c.error(e.message),
  12365. null
  12366. }
  12367. return t
  12368. },
  12369. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12370. if (0 === e.chunk.length)
  12371. return c.warn("No chunks in damfile..."),
  12372. t([]);
  12373. var o = new s.Matrix4;
  12374. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12375. var a = e.chunk.map(function(e) {
  12376. var t = new s.BufferGeometry;
  12377. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12378. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12379. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12380. t.applyMatrix(o),
  12381. t.computeBoundingBox(),
  12382. new l({
  12383. geometry: t,
  12384. textureName: e.material_name,
  12385. name: e.chunk_name,
  12386. meshUrl: i
  12387. })
  12388. });
  12389. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12390. r())
  12391. }
  12392. },
  12393. h.exports = t
  12394. }
  12395. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12396. }
  12397. , {
  12398. "../objects/Chunk": 144,
  12399. "../util/ajax": 181,
  12400. "../util/common": 185,
  12401. "../util/logger": 189,
  12402. buffer: 198,
  12403. protobufjs: 214,
  12404. three: 217
  12405. }],
  12406. 105: [function(n, r, e) {
  12407. (function(e) {
  12408. "use strict";
  12409. var t = (n("three"),
  12410. n("../settings"),
  12411. n("../util/browser"),
  12412. n("./DamLoader"))
  12413. , i = n("../util/logger")
  12414. , u = (n("../ab"),
  12415. new i(e));
  12416. r.exports = {
  12417. getLoaders: function() {
  12418. return [["_50k", ".dam", t], ["", ".dam", t]]
  12419. },
  12420. load: function(e, t, i, n, r, o) {
  12421. var a = this.getLoaders()[o = o || 0];
  12422. if (a) {
  12423. var s = a[0]
  12424. , l = a[1]
  12425. , c = new a[2](t)
  12426. , h = t.get(e + s + l);
  12427. h ? (u.debug("Trying " + s + l),
  12428. c.load(h, i, n, function() {
  12429. this.load(e, t, i, n, r, ++o)
  12430. }
  12431. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12432. this.load(e, t, i, n, r, ++o))
  12433. } else
  12434. r && r("No suitable model file found...")
  12435. }
  12436. }
  12437. }
  12438. ).call(this, "/js/loaders/ModelLoader.js")
  12439. }
  12440. , {
  12441. "../ab": 3,
  12442. "../settings": 166,
  12443. "../util/browser": 182,
  12444. "../util/logger": 189,
  12445. "./DamLoader": 104,
  12446. three: 217
  12447. }],
  12448. 106: [function(i, n, e) {
  12449. (function(e) {
  12450. "use strict";
  12451. var l = i("../util/common")
  12452. , c = i("../util/texture")
  12453. , h = i("../util/browser")
  12454. , t = i("../util/logger")
  12455. , u = i("../settings")
  12456. , d = new t(e);
  12457. n.exports = {
  12458. load: function(i, n) {
  12459. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12460. return $.when();
  12461. var r = l.countUnique(i.chunks.map(function(e) {
  12462. return e.textureName
  12463. }))
  12464. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12465. , t = "_50k" == e ? "high" : "low";
  12466. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12467. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12468. t = "low"));
  12469. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12470. , a = $.Deferred()
  12471. , s = 0;
  12472. return i.chunks.forEach(function(e) {
  12473. if (!e.material.map && e.textureName) {
  12474. var t = i.urls.get(o + e.textureName);
  12475. e.setTextureMap(c.load(t, function(e, t) {
  12476. e || (n.push(t),
  12477. s++,
  12478. a.notify(s, r),
  12479. s === r && a.resolve())
  12480. }
  12481. .bind(this, c.isLoaded(t))))
  12482. }
  12483. }),
  12484. a.promise()
  12485. }
  12486. }
  12487. }
  12488. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12489. }
  12490. , {
  12491. "../settings": 166,
  12492. "../util/browser": 182,
  12493. "../util/common": 185,
  12494. "../util/logger": 189,
  12495. "../util/texture": 194
  12496. }],
  12497. 107: [function(s, l, e) {
  12498. (function(n, e) {
  12499. "use strict";
  12500. function t(e) {
  12501. this.model = e,
  12502. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12503. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12504. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12505. , i = r.loadProto(t);
  12506. this.decoder = i.build("VisionModeldata")
  12507. }
  12508. var r = s("protobufjs")
  12509. , i = s("../util/ajax")
  12510. , o = (s("../util/common"),
  12511. s("../util/math"))
  12512. , a = new (s("../util/logger"))(e);
  12513. t.prototype.load = function() {
  12514. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12515. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12516. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12517. $.when([]))
  12518. }
  12519. ,
  12520. t.prototype.loadVisionModelData = function() {
  12521. return i.get(this.modelDataPath, {
  12522. responseType: "arraybuffer"
  12523. }).then(function(e) {
  12524. var t;
  12525. try {
  12526. t = this.decoder.decode(e)
  12527. } catch (e) {
  12528. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12529. this.loadSweepLocationsCSV()
  12530. }
  12531. var i = t.sweepLocations.map(function(e) {
  12532. return {
  12533. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12534. position: {
  12535. x: e.pose.translation.x,
  12536. y: e.pose.translation.y,
  12537. z: e.pose.translation.z
  12538. },
  12539. quaternion: {
  12540. x: e.pose.rotation.x,
  12541. y: e.pose.rotation.y,
  12542. z: e.pose.rotation.z,
  12543. w: e.pose.rotation.w
  12544. },
  12545. puck: {
  12546. x: e.puck.x,
  12547. y: e.puck.y,
  12548. z: e.puck.z
  12549. },
  12550. floor: e.group,
  12551. neighbours: e.visibles,
  12552. alignmentType: e.alignment_type
  12553. }
  12554. }).map(function(e) {
  12555. return e.position = o.convertVisionVector(e.position),
  12556. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12557. e.puck = o.convertVisionVector(e.puck),
  12558. e
  12559. });
  12560. return i.forEach(function(e) {
  12561. if(e.neighbours.find(a=>a==-1)){
  12562. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12563. }
  12564. e.neighbours = e.neighbours.filter(e=>i[e])
  12565. e.neighbours = e.neighbours.map(function(e) {
  12566. return i[e].uuid
  12567. })
  12568. }),
  12569. i
  12570. }
  12571. .bind(this), function() {
  12572. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12573. this.loadSweepLocationsCSV()
  12574. }
  12575. .bind(this))
  12576. }
  12577. ,
  12578. t.prototype.loadSweepLocationsCSV = function() {
  12579. return i.get(this.sweepLocationsPath).then(function(e) {
  12580. return e.split("\n").map(function(e) {
  12581. return e.split(", ")
  12582. }).filter(function(e) {
  12583. return 1 < e.length
  12584. }).map(function(e) {
  12585. return {
  12586. uuid: e[0],
  12587. position: {
  12588. x: parseFloat(e[1]),
  12589. y: parseFloat(e[2]),
  12590. z: parseFloat(e[3])
  12591. },
  12592. quaternion: {
  12593. x: parseFloat(e[4]),
  12594. y: parseFloat(e[5]),
  12595. z: parseFloat(e[6]),
  12596. w: parseFloat(e[7])
  12597. }
  12598. }
  12599. }).map(function(e) {
  12600. return e.position = o.convertVisionVector(e.position),
  12601. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12602. e
  12603. })
  12604. }).fail(function() {
  12605. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12606. })
  12607. }
  12608. ,
  12609. l.exports = t
  12610. }
  12611. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12612. }
  12613. , {
  12614. "../util/ajax": 181,
  12615. "../util/common": 185,
  12616. "../util/logger": 189,
  12617. "../util/math": 190,
  12618. buffer: 198,
  12619. protobufjs: 214
  12620. }],
  12621. 108: [function(s, l, e) {
  12622. (function(e) {
  12623. "use strict";
  12624. function t() {
  12625. this.locale = null
  12626. }
  12627. var i = s("../settings")
  12628. , n = s("../util/common")
  12629. , r = s("../util/logger")
  12630. , o = s("../enum/Locale")
  12631. , a = new r(e);
  12632. t.prototype.init = function() {
  12633. var e;
  12634. switch (i.languageTag) {
  12635. case null:
  12636. case "en":
  12637. case o.EN_US:
  12638. this.locale = o.EN_US,
  12639. e = s("./strings-en-US");
  12640. break;
  12641. case "es":
  12642. case o.ES_MX:
  12643. this.locale = o.ES_MX,
  12644. e = s("./strings-es-MX");
  12645. break;
  12646. case "fr":
  12647. case o.FR_FR:
  12648. this.locale = o.FR_FR,
  12649. e = s("./strings-fr-FR");
  12650. break;
  12651. case "de":
  12652. case o.DE_DE:
  12653. this.locale = o.DE_DE,
  12654. e = s("./strings-de-DE");
  12655. break;
  12656. case "ru":
  12657. case o.RU_RU:
  12658. this.locale = o.RU_RU,
  12659. e = s("./strings-ru-RU");
  12660. break;
  12661. case "cn":
  12662. case o.CN_CN:
  12663. this.locale = o.CN_CN,
  12664. e = s("./strings-cn-CN");
  12665. break;
  12666. case "jp":
  12667. case o.JP_JP:
  12668. this.locale = o.JP_JP,
  12669. e = s("./strings-jp-JP");
  12670. break;
  12671. default:
  12672. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12673. this.locale = o.EN_US,
  12674. e = s("./strings-en-US")
  12675. }
  12676. a.info("Using locale '" + this.locale + "'"),
  12677. n.extendObject(this, e)
  12678. }
  12679. ,
  12680. t.prototype.localizeGUI = function() {
  12681. var e = document.querySelector("#gui-parent");
  12682. this.localizeTree(e),
  12683. this.localizeLoadingText()
  12684. }
  12685. ,
  12686. t.prototype.localizeLoadingText = function() {
  12687. document.querySelector("#help-dialog").classList.add(this.locale),
  12688. document.querySelector("#interaction-modal").classList.add(this.locale),
  12689. document.querySelector("#gui").classList.add(this.locale)
  12690. }
  12691. ,
  12692. t.prototype.localizeTree = function(e) {
  12693. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12694. if (e.nodeType === Node.TEXT_NODE)
  12695. (t = e.data.match(n)) && (i = t[1],
  12696. e.data = this.localizeText(i) || i);
  12697. else if (e.nodeType === Node.ELEMENT_NODE) {
  12698. var r = e.getAttribute("title");
  12699. r && ((t = r.match(n)) && (i = t[1],
  12700. e.setAttribute("title", this.localizeText(i) || i)))
  12701. }
  12702. for (e = e.firstChild; e; )
  12703. this.localizeTree(e),
  12704. e = e.nextSibling
  12705. }
  12706. ,
  12707. t.prototype.localizeText = function(e) {
  12708. var t = this[e];
  12709. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12710. t = s("./strings-en-US")[e]),
  12711. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12712. t
  12713. }
  12714. ,
  12715. l.exports = new t
  12716. }
  12717. ).call(this, "/js/localization/localize.js")
  12718. }
  12719. , {
  12720. "../enum/Locale": 31,
  12721. "../settings": 166,
  12722. "../util/common": 185,
  12723. "../util/logger": 189,
  12724. "./strings-cn-CN": 109,
  12725. "./strings-de-DE": 110,
  12726. "./strings-en-US": 111,
  12727. "./strings-es-MX": 112,
  12728. "./strings-fr-FR": 113,
  12729. "./strings-jp-JP": 114,
  12730. "./strings-ru-RU": 115
  12731. }],
  12732. 109: [function(e, t, i) {
  12733. "use strict";
  12734. t.exports = {
  12735. PAGE_TITLE: "",
  12736. LOADING: "正在加载",
  12737. PRESENTED_BY_CAPS: "呈现者:",
  12738. POWERED_BY: "技术支持:",
  12739. POWERED_BY_CAPS: "技术支持:",
  12740. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12741. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12742. PRESENTED_BY: "呈现者:",
  12743. MORE: "更多 ",
  12744. LESS: "更少 ",
  12745. TAG_CONTENT: "tag™ 内容",
  12746. SHOW: "显示",
  12747. HIDE: "隐藏",
  12748. DOLLHOUSE: "场景屋",
  12749. FLOOR_PLAN: "楼层平面图",
  12750. OPEN_HIGHLIGHTS: "打开精彩片段",
  12751. CLOSE_HIGHLIGHTS: "关闭",
  12752. PREVIOUS: "上一个",
  12753. PLAY: "播放",
  12754. PAUSE: "暂停",
  12755. NEXT: "下一个",
  12756. EXPLORE_3D_SPACE: "探索 3D 空间",
  12757. VIEW_DOLLHOUSE: "观看场景屋",
  12758. SOCIAL_SHARING: "分享这个空间",
  12759. VIEW_IN_VR: "以 VR 观看",
  12760. VIEW_FULLSCREEN: "全屏观看",
  12761. EXIT_FULLSCREEN: " 退出全屏",
  12762. ZOOM_IN: "放大",
  12763. ZOOM_OUT: "缩小",
  12764. FLOOR_NAME: "楼层",
  12765. FLOOR_ALL: "ALL",
  12766. FLOOR_Lang: ["Floor", ""],
  12767. TERMS: "条款",
  12768. PORT_TERMS: "port 条款",
  12769. TERMS_OF_USE: "使用条款",
  12770. CLOSE_TERMS: "关闭",
  12771. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12772. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12773. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12774. WEBVR_ENTER_WEBVR: "进入 VR",
  12775. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12776. WEBVR_LEARN_MORE: "了解更多",
  12777. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12778. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12779. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12780. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12781. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12782. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12783. VR_LEARN_MORE_CAPS: "了解更多",
  12784. VR_PREVIOUS_CAPS: "上一个’,",
  12785. VR_NEXT_CAPS: "下一个",
  12786. VR_GOT_IT_CAPS: "明白了",
  12787. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12788. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12789. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12790. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12791. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12792. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12793. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12794. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12795. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12796. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12797. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12798. VR_APP: "port VR 应用程序",
  12799. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12800. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12801. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12802. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12803. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12804. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12805. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12806. VR_ANDROID_DVICES: "Android 设备",
  12807. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12808. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12809. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12810. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12811. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12812. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12813. VR_DOWNLOAD_HERE: "在此下载",
  12814. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12815. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12816. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12817. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12818. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12819. SHARE_TO: "分享到",
  12820. SHARE_LINK: "直接链接",
  12821. SHARE_EXPLORE: "探索",
  12822. SHARE_AT: "在",
  12823. SHARE_WITH: "使用",
  12824. SHARE_3D: "以 3D",
  12825. SHARE_COPIED: "已复制!",
  12826. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12827. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12828. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12829. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12830. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12831. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12832. ERROR_GENERIC_ACTIONS_3: " 或",
  12833. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12834. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12835. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12836. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12837. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12838. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12839. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12840. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12841. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12842. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12843. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12844. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12845. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12846. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12847. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12848. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12849. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12850. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12851. LINK_TO_LOCATION: "地点链接",
  12852. MENU_COPY: "复制",
  12853. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12854. ROTATE: "旋转",
  12855. MOVE: "移动",
  12856. INSIDE: "内部",
  12857. ZOOM: "缩放",
  12858. HELP: "小帮手",
  12859. HELP_NAVIGATION_TAB: "导航",
  12860. HELP_MORE_HELP_TAB: "更多帮助",
  12861. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12862. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12863. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12864. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12865. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12866. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12867. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12868. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12869. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12870. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12871. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12872. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12873. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12874. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12875. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12876. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12877. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12878. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12879. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12880. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12881. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12882. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12883. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12884. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12885. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12886. HELP_MORE_HLR_A: "精彩片段集锦",
  12887. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12888. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12889. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12890. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12891. HELP_MORE_FLOORS_A: "楼层选择器",
  12892. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12893. HELP_MORE_TAG_A: "tag™ 贴文",
  12894. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12895. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12896. HELP_MORE_ZOOM_A: "缩放控件",
  12897. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12898. HELP_MORE_TOUR_A: "导览控件",
  12899. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12900. HELP_MORE_INSIDE_A: "内部视图",
  12901. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12902. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12903. HELP_MORE_VR_A: "VR 模式",
  12904. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12905. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12906. HELP_MORE_360_A: "360° 视图",
  12907. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12908. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12909. HELP_MORE_FULLSCREEN_A: "全屏",
  12910. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12911. CLOSE: "关闭"
  12912. }
  12913. }
  12914. , {}],
  12915. 110: [function(e, t, i) {
  12916. "use strict";
  12917. t.exports = {
  12918. PAGE_TITLE: "",
  12919. LOADING: "Lädt",
  12920. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12921. POWERED_BY: "Angetrieben von",
  12922. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12923. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12924. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12925. PRESENTED_BY: "Präsentiert von ",
  12926. MORE: "Mehr ",
  12927. LESS: "Weniger ",
  12928. TAG_CONTENT: "tag™ Inhalt",
  12929. SHOW: "Anzeigen",
  12930. HIDE: "Verbergen",
  12931. DOLLHOUSE: "Puppenhaus",
  12932. FLOOR_PLAN: "Grundriss",
  12933. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12934. CLOSE_HIGHLIGHTS: "Schließen",
  12935. PREVIOUS: "Vorheriges",
  12936. PLAY: "Abspielen",
  12937. PAUSE: "Pausieren",
  12938. NEXT: "Nächstes",
  12939. EXPLORE_3D_SPACE: "Innenraum betreten",
  12940. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12941. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12942. VIEW_IN_VR: "In VR ansehen",
  12943. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12944. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12945. ZOOM_IN: "Vergrößern",
  12946. ZOOM_OUT: "Verkleinern",
  12947. FLOOR_NAME: "Etage ",
  12948. FLOOR_ALL: "Alle",
  12949. TERMS: "Bedingungen",
  12950. PORT_TERMS: "port Bedingungen",
  12951. TERMS_OF_USE: "Nutzungsbedingungen",
  12952. TERMS_TEXT_FILE: "terms-de-DE.html",
  12953. CLOSE_TERMS: "Schließen",
  12954. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12955. HELP: "Hilfe",
  12956. HELP_NAVIGATION_TAB: "Navigation",
  12957. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12958. CLOSE: "Schließen",
  12959. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12960. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12961. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12962. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12963. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12964. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12965. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12966. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12967. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12968. 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.",
  12969. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12970. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12971. 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.",
  12972. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12973. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12974. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12975. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12976. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12977. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12978. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12979. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12980. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12981. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12982. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12983. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12984. HELP_MORE_HLR_A: "Liste das Highlight",
  12985. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12986. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12987. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12988. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12989. HELP_MORE_FLOORS_A: "Etage auswählen",
  12990. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12991. HELP_MORE_TAG_A: "tag™ Posts",
  12992. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12993. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12994. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12995. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12996. HELP_MORE_TOUR_A: "Tour Steuerung",
  12997. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12998. HELP_MORE_INSIDE_A: "Innenansicht",
  12999. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13000. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13001. HELP_MORE_VR_A: "VR Modus",
  13002. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13003. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13004. HELP_MORE_360_A: "360° Views Ansicht ",
  13005. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13006. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13007. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13008. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13009. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13010. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13011. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13012. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13013. WEBVR_LEARN_MORE: "Mehr Infos",
  13014. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13015. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13016. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13017. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13018. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13019. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13020. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13021. VR_APP: "port VR App",
  13022. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13023. 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",
  13024. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13025. VR_APP_FOR_ANDROID: "port VR app für Android",
  13026. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13027. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13028. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13029. VR_PREVIOUS_CAPS: "ZURÜCK",
  13030. VR_NEXT_CAPS: "WEITER",
  13031. VR_GOT_IT_CAPS: "VERSTANDEN",
  13032. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13033. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13034. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13035. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13036. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13037. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13038. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13039. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13040. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13041. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13042. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13043. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13044. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13045. VR_ANDROID_DVICES: "Android Geräte",
  13046. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13047. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13048. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13049. VR_DOWNLOAD_HERE: "Hier runterladen",
  13050. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13051. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13052. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13053. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13054. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13055. SHARE_TO: "Teilen auf",
  13056. SHARE_LINK: "Direkter Link",
  13057. SHARE_EXPLORE: "Umsehen",
  13058. SHARE_AT: "auf",
  13059. SHARE_WITH: "mit",
  13060. SHARE_3D: "in 3D",
  13061. SHARE_COPIED: "Kopiert!",
  13062. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13063. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13064. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13065. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13066. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13067. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13068. ERROR_GENERIC_ACTIONS_3: " oder ",
  13069. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13070. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13071. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13072. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13073. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13074. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13075. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13076. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13077. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13078. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13079. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13080. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13081. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13082. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13083. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13084. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13085. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13086. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13087. LINK_TO_LOCATION: "Link zu",
  13088. MENU_COPY: "Kopieren",
  13089. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13090. ROTATE: "Drehen",
  13091. INSIDE: "Drinnen",
  13092. MOVE: "Bewegen",
  13093. ZOOM: "Vergrößern"
  13094. }
  13095. }
  13096. , {}],
  13097. 111: [function(e, t, i) {
  13098. "use strict";
  13099. t.exports = {
  13100. PAGE_TITLE: "",
  13101. LOADING: "Loading",
  13102. PRESENTED_BY_CAPS: "PRESENTED BY",
  13103. POWERED_BY: "powered by ",
  13104. POWERED_BY_CAPS: "POWERED BY",
  13105. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13106. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13107. PRESENTED_BY: "Presented by ",
  13108. MORE: "More ",
  13109. LESS: "Less ",
  13110. TAG_CONTENT: "tag™ Content",
  13111. SHOW: "Show",
  13112. HIDE: "Hide",
  13113. DOLLHOUSE: "Dollhouse",
  13114. FLOOR_PLAN: "Floor plan",
  13115. OPEN_HIGHLIGHTS: "Open Highlights",
  13116. CLOSE_HIGHLIGHTS: "Close",
  13117. PREVIOUS: "Previous",
  13118. PLAY: "Play",
  13119. PAUSE: "Pause",
  13120. NEXT: "Next",
  13121. EXPLORE_3D_SPACE: "Explore 3D Space",
  13122. VIEW_DOLLHOUSE: "View dollhouse",
  13123. SOCIAL_SHARING: "Share this Space",
  13124. VIEW_IN_VR: "View in VR",
  13125. VIEW_FULLSCREEN: "全屏",
  13126. EXIT_FULLSCREEN: "退出全屏",
  13127. ZOOM_IN: "Zoom in",
  13128. ZOOM_OUT: "Zoom out",
  13129. FLOOR_NAME: "Floor ",
  13130. FLOOR_ALL: "全部",
  13131. TERMS: "Terms",
  13132. PORT_TERMS: "port terms",
  13133. TERMS_OF_USE: "Terms of Use",
  13134. TERMS_TEXT_FILE: "terms-en-US.html",
  13135. CLOSE_TERMS: "Close",
  13136. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13137. HELP: "Help",
  13138. HELP_NAVIGATION_TAB: "Navigation",
  13139. HELP_MORE_HELP_TAB: "More Help",
  13140. CLOSE: "Close",
  13141. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13142. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13143. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13144. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13145. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13146. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13147. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13148. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13149. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13150. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13151. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13152. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13153. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13154. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13155. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13156. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13157. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13158. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13159. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13160. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13161. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13162. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13163. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13164. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13165. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13166. HELP_MORE_HLR_A: "Highlight Reel",
  13167. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13168. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13169. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13170. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13171. HELP_MORE_FLOORS_A: "Floor Selector",
  13172. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13173. HELP_MORE_TAG_A: "tag™ Posts",
  13174. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13175. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13176. HELP_MORE_ZOOM_A: "Zoom Controls",
  13177. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13178. HELP_MORE_TOUR_A: "Tour Controls",
  13179. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13180. HELP_MORE_INSIDE_A: "Inside View",
  13181. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13182. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13183. HELP_MORE_VR_A: "VR Mode",
  13184. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13185. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13186. HELP_MORE_360_A: "360° Views",
  13187. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13188. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13189. HELP_MORE_FULLSCREEN_A: "Full screen",
  13190. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13191. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13192. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13193. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13194. WEBVR_ENTER_WEBVR: "ENTER VR",
  13195. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13196. WEBVR_LEARN_MORE: "Learn more",
  13197. WEBVR_VIEW_SPACE: "View Space in VR",
  13198. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13199. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13200. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13201. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13202. VR_PREVIOUS_CAPS: "PREVIOUS",
  13203. VR_NEXT_CAPS: "NEXT",
  13204. VR_GOT_IT_CAPS: "GOT IT",
  13205. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13206. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13207. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13208. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13209. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13210. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13211. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13212. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13213. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13214. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13215. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13216. VR_APP: "port VR App",
  13217. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13218. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13219. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13220. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13221. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13222. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13223. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13224. VR_ANDROID_DVICES: "Android Devices",
  13225. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13226. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13227. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13228. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13229. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13230. VR_APP_OPEN: "Open with the port VR app instead",
  13231. VR_DOWNLOAD_HERE: "Download here",
  13232. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13233. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13234. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13235. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13236. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13237. SHARE_TO: "Share to",
  13238. SHARE_LINK: "Direct Link",
  13239. SHARE_EXPLORE: "Explore ",
  13240. SHARE_AT: "at",
  13241. SHARE_WITH: "with",
  13242. SHARE_3D: " in 3D",
  13243. SHARE_COPIED: "Copied!",
  13244. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13245. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13246. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13247. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13248. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13249. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13250. ERROR_GENERIC_ACTIONS_3: " or ",
  13251. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13252. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13253. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13254. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13255. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13256. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13257. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13258. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13259. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13260. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13261. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13262. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13263. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13264. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13265. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13266. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13267. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13268. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13269. LINK_TO_LOCATION: "Link to location",
  13270. MENU_COPY: "Copy",
  13271. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13272. ROTATE: "Rotate",
  13273. INSIDE: "Inside",
  13274. MOVE: "Move",
  13275. ZOOM: "Zoom"
  13276. }
  13277. }
  13278. , {}],
  13279. 112: [function(e, t, i) {
  13280. "use strict";
  13281. t.exports = {
  13282. PAGE_TITLE: "",
  13283. LOADING: "Cargando",
  13284. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13285. POWERED_BY: "potenciando por ",
  13286. POWERED_BY_CAPS: "POTENCIADO POR ",
  13287. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13288. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13289. PRESENTED_BY: "Presentado por ",
  13290. MORE: "Más ",
  13291. LESS: "Menos ",
  13292. TAG_CONTENT: "Contenido de tag™",
  13293. SHOW: "Mostrar",
  13294. HIDE: "Ocultar",
  13295. DOLLHOUSE: "Dollhouse",
  13296. FLOOR_PLAN: "Planos",
  13297. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13298. CLOSE_HIGHLIGHTS: "Cerrar",
  13299. PREVIOUS: "Anterior",
  13300. PLAY: "Play",
  13301. PAUSE: "Pausa",
  13302. NEXT: "Siguiente",
  13303. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13304. VIEW_DOLLHOUSE: "Ver dollhouse",
  13305. SOCIAL_SHARING: "Compartir este espacio",
  13306. VIEW_IN_VR: "Ver en realidad virtual",
  13307. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13308. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13309. ZOOM_IN: "Acercar",
  13310. ZOOM_OUT: "Alejar",
  13311. FLOOR_NAME: "Piso ",
  13312. FLOOR_ALL: "Todas",
  13313. TERMS: "Condiciones",
  13314. PORT_TERMS: "port términos de uso",
  13315. TERMS_OF_USE: "Términos de uso",
  13316. TERMS_TEXT_FILE: "terms-es-MX.html",
  13317. CLOSE_TERMS: "Cerrar",
  13318. 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.",
  13319. HELP: "Ayuda",
  13320. HELP_NAVIGATION_TAB: "Navegación",
  13321. HELP_MORE_HELP_TAB: "Más Ayuda",
  13322. CLOSE: "Cerrar",
  13323. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13324. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13325. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13326. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13327. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13328. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13329. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13330. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13331. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13332. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13333. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13334. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13335. 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.",
  13336. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13337. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13338. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13339. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13340. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13341. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13342. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13343. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13344. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13345. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13346. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13347. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13348. HELP_MORE_HLR_A: "Galería destacada",
  13349. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13350. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13351. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13352. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13353. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13354. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13355. HELP_MORE_TAG_A: "tag™ Posts",
  13356. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13357. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13358. HELP_MORE_ZOOM_A: "Controles de zoom",
  13359. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13360. HELP_MORE_TOUR_A: "Controles de recorrido",
  13361. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13362. HELP_MORE_INSIDE_A: "Vista interior",
  13363. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13364. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13365. HELP_MORE_VR_A: "Modo de realidad virtual",
  13366. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13367. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13368. HELP_MORE_360_A: "360° Views",
  13369. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13370. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13371. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13372. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13373. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13374. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13375. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13376. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13377. WEBVR_LEARN_MORE: "Más información",
  13378. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13379. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13380. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13381. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13382. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13383. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13384. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13385. VR_APP: "port VR App",
  13386. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13387. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13388. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13389. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13390. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13391. VR_PREVIOUS_CAPS: "ANTERIOR",
  13392. VR_NEXT_CAPS: "SIGUIENTE",
  13393. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13394. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13395. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13396. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13397. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13398. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13399. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13400. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13401. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13402. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13403. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13404. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13405. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13406. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13407. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13408. VR_ANDROID_DVICES: "Dispositivos Android",
  13409. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13410. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13411. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13412. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13413. VR_DOWNLOAD_HERE: "Descargar aquí",
  13414. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13415. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13416. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13417. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13418. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13419. SHARE_TO: "Compartir en",
  13420. SHARE_LINK: "Enlace directo",
  13421. SHARE_EXPLORE: "Explorar ",
  13422. SHARE_AT: "en",
  13423. SHARE_WITH: "con",
  13424. SHARE_3D: " en 3D",
  13425. SHARE_COPIED: "¡Copiado!",
  13426. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13427. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13428. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13429. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13430. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13431. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13432. ERROR_GENERIC_ACTIONS_3: " o ",
  13433. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13434. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13435. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13436. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13437. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13438. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13439. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13440. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13441. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13442. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13443. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13444. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13445. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13446. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13447. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13448. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13449. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13450. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13451. LINK_TO_LOCATION: "Enlace a la ubicación",
  13452. MENU_COPY: "Copiar",
  13453. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13454. ROTATE: "Girar",
  13455. INSIDE: "Interior",
  13456. MOVE: "Moverse",
  13457. ZOOM: "Acercar o alejar"
  13458. }
  13459. }
  13460. , {}],
  13461. 113: [function(e, t, i) {
  13462. "use strict";
  13463. t.exports = {
  13464. PAGE_TITLE: "",
  13465. LOADING: "Chargement",
  13466. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13467. POWERED_BY: "alimenté par ",
  13468. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13469. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13470. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13471. PRESENTED_BY: "Présenté par ",
  13472. MORE: "Plus ",
  13473. LESS: "Moins ",
  13474. TAG_CONTENT: "Contenu tag™",
  13475. SHOW: "Montrer",
  13476. HIDE: "Cacher",
  13477. DOLLHOUSE: "Dollhouse",
  13478. FLOOR_PLAN: "Plan de sol",
  13479. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13480. CLOSE_HIGHLIGHTS: "Fermer",
  13481. PREVIOUS: "Précédent",
  13482. PLAY: "Lecture",
  13483. PAUSE: "Pause",
  13484. NEXT: "Suivant",
  13485. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13486. VIEW_DOLLHOUSE: "Voir dollhouse",
  13487. SOCIAL_SHARING: "Partager cet espace",
  13488. VIEW_IN_VR: "Voir en VR",
  13489. VIEW_FULLSCREEN: "Plein écran",
  13490. EXIT_FULLSCREEN: "Fermer plein écran",
  13491. ZOOM_IN: "Zoom avant",
  13492. ZOOM_OUT: "Zoom arrière",
  13493. FLOOR_NAME: "Étage ",
  13494. FLOOR_ALL: "Tous",
  13495. TERMS: "Mentions légales",
  13496. PORT_TERMS: "port mentions légales",
  13497. TERMS_OF_USE: "Conditions d'utilisation",
  13498. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13499. CLOSE_TERMS: "Fermer",
  13500. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13501. HELP: "Aide",
  13502. HELP_NAVIGATION_TAB: "Navigation",
  13503. HELP_MORE_HELP_TAB: "Aide",
  13504. CLOSE: "Fermer",
  13505. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13506. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13507. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13508. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13509. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13510. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13511. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13512. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13513. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13514. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13515. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13516. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13517. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13518. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13519. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13520. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13521. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13522. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13523. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13524. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13525. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13526. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13527. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13528. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13529. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13530. HELP_MORE_HLR_A: "Carrousel",
  13531. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13532. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13533. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13534. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13535. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13536. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13537. HELP_MORE_TAG_A: "tag™ Posts",
  13538. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13539. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13540. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13541. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13542. HELP_MORE_TOUR_A: "Commandes de la visite",
  13543. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13544. HELP_MORE_INSIDE_A: "Vue intérieure",
  13545. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13546. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13547. HELP_MORE_VR_A: "Mode RV",
  13548. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13549. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13550. HELP_MORE_360_A: "Vues 360°",
  13551. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13552. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13553. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13554. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13555. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13556. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13557. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13558. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13559. WEBVR_LEARN_MORE: "En savoir plus",
  13560. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13561. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13562. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13563. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13564. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13565. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13566. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13567. VR_NEXT_CAPS: "SUIVANT",
  13568. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13569. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13570. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13571. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13572. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13573. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13574. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13575. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13576. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13577. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13578. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13579. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13580. VR_APP: "port VR App",
  13581. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13582. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13583. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13584. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13585. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13586. 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",
  13587. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13588. VR_ANDROID_DVICES: "Appareils Android",
  13589. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13590. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13591. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13592. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13593. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13594. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13595. VR_DOWNLOAD_HERE: "Télécharger ici",
  13596. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13597. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13598. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13599. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13600. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13601. SHARE_TO: "Partager sur",
  13602. SHARE_LINK: "Lien direct",
  13603. SHARE_EXPLORE: "Explorer ",
  13604. SHARE_AT: "à",
  13605. SHARE_WITH: "avec",
  13606. SHARE_3D: " en 3D",
  13607. SHARE_COPIED: "Copié!",
  13608. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13609. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13610. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13611. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13612. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13613. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13614. ERROR_GENERIC_ACTIONS_3: " ou ",
  13615. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13616. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13617. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13618. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13619. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13620. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13621. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13622. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13623. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13624. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13625. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13626. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13627. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13628. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13629. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13630. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13631. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13632. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13633. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13634. MENU_COPY: "Copie",
  13635. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13636. ROTATE: "Faire pivoter",
  13637. INSIDE: "Intérieure",
  13638. MOVE: "Se déplacer",
  13639. ZOOM: "Zoom"
  13640. }
  13641. }
  13642. , {}],
  13643. 114: [function(e, t, i) {
  13644. "use strict";
  13645. t.exports = {
  13646. PAGE_TITLE: "",
  13647. LOADING: "読み込み中",
  13648. PRESENTED_BY_CAPS: "PRESENTED BY",
  13649. POWERED_BY: "powered by",
  13650. POWERED_BY_CAPS: "POWERED BY",
  13651. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13652. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13653. PRESENTED_BY: "Presented by ",
  13654. MORE: "全て表示 ",
  13655. LESS: "閉じる ",
  13656. TAG_CONTENT: "tag™コンテンツ ",
  13657. SHOW: "表示",
  13658. HIDE: "非表示",
  13659. DOLLHOUSE: "ドールハウス",
  13660. FLOOR_PLAN: "フロアプラン",
  13661. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13662. CLOSE_HIGHLIGHTS: "閉じる",
  13663. PREVIOUS: "前へ",
  13664. PLAY: "再生",
  13665. PAUSE: "一時停止",
  13666. NEXT: "次へ",
  13667. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13668. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13669. SOCIAL_SHARING: "このSpaceを共有する",
  13670. VIEW_IN_VR: "VRで表示",
  13671. VIEW_FULLSCREEN: "フルスクリーン表示",
  13672. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13673. ZOOM_IN: "ズームイン",
  13674. ZOOM_OUT: "ズームアウト",
  13675. FLOOR_NAME: "フロア ",
  13676. FLOOR_ALL: "すべて",
  13677. TERMS: "規約",
  13678. PORT_TERMS: "port規約",
  13679. TERMS_OF_USE: "利用規約",
  13680. CLOSE_TERMS: "閉じる",
  13681. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13682. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13683. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13684. WEBVR_ENTER_WEBVR: "VRに入る",
  13685. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13686. WEBVR_LEARN_MORE: "もっと詳しく",
  13687. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13688. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13689. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13690. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13691. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13692. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13693. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13694. VR_PREVIOUS_CAPS: "前へ",
  13695. VR_NEXT_CAPS: "次へ",
  13696. VR_GOT_IT_CAPS: "了解",
  13697. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13698. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13699. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13700. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13701. VR_WHAT_YOU_NEED: "必要なもの",
  13702. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13703. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13704. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13705. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13706. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13707. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13708. VR_APP: "port VRアプリ",
  13709. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13710. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13711. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13712. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13713. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13714. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13715. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13716. VR_ANDROID_DVICES: "Androidデバイス",
  13717. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13718. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13719. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13720. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13721. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13722. VR_APP_OPEN: "port VRアプリで開く",
  13723. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13724. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13725. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13726. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13727. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13728. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13729. SHARE_TO: "共有先",
  13730. SHARE_LINK: "ダイレクトリンク",
  13731. SHARE_EXPLORE: "探索",
  13732. SHARE_AT: "場所",
  13733. SHARE_WITH: "使用アプリ",
  13734. SHARE_3D: "3Dで",
  13735. SHARE_COPIED: "コピーされました!",
  13736. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13737. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13738. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13739. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13740. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13741. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13742. ERROR_GENERIC_ACTIONS_3: "または",
  13743. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13744. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13745. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13746. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13747. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13748. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13749. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13750. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13751. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13752. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13753. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13754. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13755. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13756. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13757. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13758. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13759. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13760. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13761. LINK_TO_LOCATION: "ロケーションへのリンク",
  13762. MENU_COPY: "コピー",
  13763. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13764. ROTATE: "回転",
  13765. MOVE: "移動",
  13766. INSIDE: "内側",
  13767. ZOOM: "ズーム",
  13768. HELP: "ヘルプ",
  13769. HELP_NAVIGATION_TAB: "ナビゲーション",
  13770. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13771. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13772. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13773. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13774. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13775. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13776. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13777. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13778. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13779. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13780. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13781. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13782. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13783. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13784. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13785. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13786. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13787. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13788. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13789. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13790. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13791. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13792. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13793. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13794. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13795. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13796. HELP_MORE_HLR_A: "ハイライト",
  13797. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13798. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13799. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13800. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13801. HELP_MORE_FLOORS_A: "フロアセレクター",
  13802. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13803. HELP_MORE_TAG_A: "tag™ Posts",
  13804. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13805. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13806. HELP_MORE_ZOOM_A: "ズームコントロール",
  13807. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13808. HELP_MORE_TOUR_A: "ツアーコントロール",
  13809. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13810. HELP_MORE_INSIDE_A: "内側ビュー",
  13811. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13812. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13813. HELP_MORE_VR_A: "VRモード",
  13814. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13815. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13816. HELP_MORE_360_A: "360° Views",
  13817. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13818. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13819. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13820. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13821. CLOSE: "閉じる"
  13822. }
  13823. }
  13824. , {}],
  13825. 115: [function(e, t, i) {
  13826. "use strict";
  13827. t.exports = {
  13828. PAGE_TITLE: "",
  13829. LOADING: "Загрузка",
  13830. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13831. POWERED_BY: "разработано на платформе ",
  13832. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13833. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13834. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13835. PRESENTED_BY: "Представлено ",
  13836. MORE: "Больше ",
  13837. LESS: "Меньше ",
  13838. TAG_CONTENT: "tag™ Контент",
  13839. SHOW: "Показать",
  13840. HIDE: "Скрыть",
  13841. DOLLHOUSE: "Dollhouse",
  13842. FLOOR_PLAN: "Планировка",
  13843. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13844. CLOSE_HIGHLIGHTS: "Закрыть",
  13845. PREVIOUS: "Предыдущий",
  13846. PLAY: "Воспроизвести",
  13847. PAUSE: "Пауза",
  13848. NEXT: "Следующий",
  13849. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13850. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13851. SOCIAL_SHARING: "Поделиться этой моделью",
  13852. VIEW_IN_VR: "Посмотреть в VR",
  13853. VIEW_FULLSCREEN: "Полный экран",
  13854. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13855. ZOOM_IN: "Увеличить",
  13856. ZOOM_OUT: "Уменьшить",
  13857. FLOOR_NAME: "Этаж ",
  13858. FLOOR_ALL: "Все",
  13859. TERMS: "Условия",
  13860. PORT_TERMS: "Правила пользования",
  13861. TERMS_OF_USE: "Условия использования",
  13862. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13863. CLOSE_TERMS: "Закрыть",
  13864. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13865. HELP: "Помощь",
  13866. HELP_NAVIGATION_TAB: "Навигация",
  13867. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13868. CLOSE: "Закрыть",
  13869. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13870. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13871. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13872. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13873. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13874. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13875. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13876. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13877. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13878. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13879. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13880. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13881. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13882. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13883. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13884. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13885. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13886. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13887. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13888. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13889. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13890. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13891. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13892. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13893. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13894. HELP_MORE_HLR_A: "Фотоколлаж",
  13895. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13896. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13897. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13898. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13899. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13900. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13901. HELP_MORE_TAG_A: "tag™ Posts",
  13902. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13903. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13904. HELP_MORE_ZOOM_A: "Масштаб",
  13905. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13906. HELP_MORE_TOUR_A: "Управление Туром",
  13907. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13908. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13909. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13910. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13911. HELP_MORE_VR_A: "Режим VR",
  13912. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13913. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13914. HELP_MORE_360_A: "360° Views",
  13915. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13916. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13917. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13918. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13919. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13920. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13921. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13922. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13923. WEBVR_LEARN_MORE: "Узнать больше",
  13924. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13925. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13926. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13927. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13928. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13929. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13930. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13931. VR_APP: "port VR App",
  13932. VR_APP_OPEN: "Или открыть через приложение port VR",
  13933. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13934. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13935. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13936. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13937. VR_VIEW_SPACE: "Запустить модель в VR",
  13938. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13939. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13940. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13941. VR_GOT_IT_CAPS: "ЯСНО",
  13942. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13943. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13944. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13945. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13946. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13947. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13948. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13949. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13950. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13951. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13952. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13953. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13954. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13955. VR_ANDROID_DVICES: "Android устройства",
  13956. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13957. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13958. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13959. VR_DOWNLOAD_HERE: "Скачать здесь",
  13960. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13961. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13962. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13963. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13964. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13965. SHARE_TO: "Поделиться",
  13966. SHARE_LINK: "Прямая ссылка",
  13967. SHARE_EXPLORE: "просмотреть",
  13968. SHARE_AT: "на",
  13969. SHARE_WITH: "с",
  13970. SHARE_3D: "в 3D",
  13971. SHARE_COPIED: "Скопировано!",
  13972. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13973. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13974. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13975. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13976. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13977. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13978. ERROR_GENERIC_ACTIONS_3: " или ",
  13979. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13980. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13981. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13982. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13983. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13984. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13985. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13986. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13987. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13988. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13989. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13990. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13991. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13992. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13993. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13994. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13995. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13996. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13997. LINK_TO_LOCATION: "Ссылка на местоположение",
  13998. MENU_COPY: "Копировать",
  13999. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14000. ROTATE: "Вращать",
  14001. MOVE: "Передвигаться",
  14002. INSIDE: "Вид изнутри",
  14003. ZOOM: "Масштаб"
  14004. }
  14005. }
  14006. , {}],
  14007. 116: [function(r, e, t) {
  14008. (function(i) {
  14009. "use strict";
  14010. function re(e) {
  14011. console.log("e1:" + e),
  14012. e = Math.round(.4 * e * 100),
  14013. console.log("e2:" + e);
  14014. var t = $(".progressbar");
  14015. t.find(".bar").css("width", e + "%"),
  14016. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  14017. t.find(".perc").text(e + "%")
  14018. }
  14019. $("#gui-loading").fadeIn(200),
  14020. re(.1);
  14021. var e = g_version ? "modeldata.js" : "someData.json";
  14022. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  14023. dataType: "json"
  14024. }).done(function(e) {
  14025. var t = matcher(e);
  14026. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  14027. t.user = {
  14028. is_authenticated: !1,
  14029. 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"]
  14030. }
  14031. /* t.model.images = [
  14032. {
  14033. "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}",
  14034. "name": "1",
  14035. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  14036. "sid": "20201210_175837426"
  14037. },
  14038. {
  14039. "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}",
  14040. "name": "2",
  14041. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  14042. "sid": "20201210_175835333"
  14043. },
  14044. {
  14045. "name": "区域1 hasmusic",
  14046. "momentTour": "black",
  14047. "musicInfo": {
  14048. "name": "一段音乐.mp3",
  14049. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  14050. "time": 7818
  14051. },
  14052. "locations": [
  14053. {
  14054. "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}",
  14055. "sid": "20210425_152818526",
  14056. "name": "20210425_152818526",
  14057. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  14058. }
  14059. ]
  14060. },
  14061. {
  14062. "name": "区域2",
  14063. "momentTour": "black",
  14064. "locations": [
  14065. {
  14066. "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}",
  14067. "sid": "20210425_152857293",
  14068. "name": "20210425_152857293",
  14069. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  14070. },
  14071. {
  14072. "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}",
  14073. "sid": "20210425_152900502",
  14074. "name": "20210425_152900502",
  14075. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  14076. }
  14077. ]
  14078. },
  14079. {
  14080. "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}",
  14081. "sid": "20210425_152929593",
  14082. "name": "5",
  14083. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  14084. }
  14085. ] */
  14086. try{//处理一下导览数据
  14087. t.model.images = t.model.images.filter(e=>{
  14088. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14089. if(e.locations)e.locations = e.locations.filter(e=>e)
  14090. if(e.locations && e.locations.length == 0)return;
  14091. return e
  14092. })
  14093. }catch(e){console.log(e) }
  14094. window.editTool = new EditTools()
  14095. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  14096. window.DATA = t
  14097. t.model.summary = t.summary
  14098. t.model.name = t.name
  14099. for(let i in t){
  14100. t[i] == "false" && (t[i] = false)
  14101. }
  14102. re(.7),
  14103. function() {
  14104. function y(e) {
  14105. t.update(e)
  14106. }
  14107. function A(e, t) {
  14108. ne.error(t),
  14109. n.error(t),
  14110. N.report(e, "error-" + t)
  14111. }
  14112. function C(e, t, i) {
  14113. try {
  14114. e.start(t)
  14115. } catch (e) {
  14116. throw ne.warn(e.message),
  14117. function(e) {
  14118. var t = O.details();
  14119. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  14120. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  14121. N.report(e, "error-webgl-generic"))
  14122. }(i.sid),
  14123. e
  14124. }
  14125. }
  14126. function I(e) {
  14127. e.stopPropagation(),
  14128. e.preventDefault()
  14129. }
  14130. window.DATA.hoticon && (g_HotImage = {
  14131. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14132. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14133. });
  14134. /* window.DATA.backgroundMusic ? (g_bgAudio.src = window.DATA.backgroundMusic,
  14135. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  14136. */
  14137. if (window.DATA.backgroundMusic) {
  14138. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.DATA.backgroundMusic) ;
  14139. else g_bgAudio.src = window.DATA.backgroundMusic
  14140. $("#volume").show();
  14141. }else if (g_version === "one"){
  14142. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14143. //g_bgAudio.src = manage.dealURL(src) ;
  14144. }
  14145. //隐藏公司logo
  14146. window.DATA.loadlogo && showLogo();
  14147. r("./lib/three75-shim"),
  14148. r("./lib/array-polyfill"),
  14149. r("./lib/performance-polyfill"),
  14150. r("./lib/shaders/CopyShader.js"),
  14151. r("./lib/shaders/HorizontalBlurShader.js"),
  14152. r("./lib/shaders/VerticalBlurShader.js"),
  14153. r("./lib/postprocessing/EffectComposer.js"),
  14154. r("./lib/postprocessing/RenderPass.js"),
  14155. r("./lib/postprocessing/MaskPass.js"),
  14156. r("./lib/postprocessing/ShaderPass.js"),
  14157. window.Promise || (window.Promise = r("promise-polyfill"));
  14158. var E = r("three")
  14159. , _ = r("three")
  14160. , b = (r("./util/sentry"),
  14161. r("./player"))
  14162. , w = r("./director")
  14163. , T = r("./controls/CameraControls")
  14164. , x = r("./model/ModelManager")
  14165. , S = r("./DisplayController")
  14166. , M = r("./label/LabelDisplayController")
  14167. , R = r("./enum/Viewmode")
  14168. , e = r("./util/logger")
  14169. , P = r("./showcase")
  14170. , O = r("./util/browser")
  14171. , L = r("./settings")
  14172. , D = r("./gui/gui")
  14173. , n = r("./gui/error")
  14174. , N = r("./analytics")
  14175. , F = r("./util/transitions")
  14176. , B = r("./effects")
  14177. , V = r("./objects/Skybox")
  14178. , k = (r("./util/common"),
  14179. r("./util/PanoramaCollection"),
  14180. r("./util/math"),
  14181. r("./util/showcase"))
  14182. , U = r("./util/camera")
  14183. , H = (r("./objects/Panorama"),
  14184. r("./cameras/PanoramaCamera"),
  14185. r("./preloaders"))
  14186. , z = r("events").EventEmitter
  14187. , G = r("./featureflags")
  14188. , W = (r("./util/lerp"),
  14189. r("./util/ajax"),
  14190. r("./ab"))
  14191. , j = r("./sdk/automation.js")
  14192. , Y = r("./scene/SceneRenderer")
  14193. , q = r("./scene/QuickstartManager")
  14194. , X = r("./tile/QualityManager.js")
  14195. , Z = r("./localization/localize")
  14196. , K = r("./tag/tagManager")
  14197. , Q = r("./tile/TileDownloader")
  14198. , J = r("./tile/PanoRenderer")
  14199. , ee = (r("./enum/PanoSizeClass"),
  14200. r("./enum/PanoramaEvents"),
  14201. r("./enum/SceneRendererEvents"))
  14202. , t = r("./gui/memoryUsage")
  14203. , te = r("./enum/RenderLayers")
  14204. , ie = r("./TimingData")
  14205. , ne = new e(i);
  14206. e.level = L.logLevel,
  14207. e.consoleEnabled = L.console,
  14208. function() {
  14209. var e = k.getModelIDFromQueryString();
  14210. if (!e)
  14211. return A(null, "loading-failed");
  14212. var t = k.parseSidUrl(e)
  14213. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14214. , n = {
  14215. panoElementsToLoad: 6,
  14216. modelElementsToLoad: 0,
  14217. totalElementsLoaded: 0,
  14218. totalElementsToLoad: 0,
  14219. totalPercentageLoaded: 0,
  14220. progressCallback: null
  14221. }
  14222. , r = document.getElementById("player")
  14223. , o = L.quickstart.enabled
  14224. , a = null
  14225. , s = null
  14226. , l = null
  14227. , c = null
  14228. , h = null
  14229. , u = null
  14230. , d = null
  14231. , p = null
  14232. , f = null
  14233. , g = null
  14234. , m = null
  14235. , v = new ie;
  14236. !function(e) {
  14237. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14238. z.defaultMaxListeners = 1e3,
  14239. function(e) {
  14240. e.addEventListener("dragenter", I, !1),
  14241. e.addEventListener("dragover", I, !1)
  14242. }(e),
  14243. O.valueFromHash("title", !0) || $(document).ready(function() {
  14244. $(".model-title").hide()
  14245. })
  14246. }(r),
  14247. function(e) {
  14248. return G.loadFeatureFlags(e).done(function(e) {
  14249. G.updateDependentSettings(e, L)
  14250. })
  14251. }({
  14252. urlBase: t.urlBase
  14253. }).then(function() {
  14254. return Z.init(),
  14255. function(e, t) {
  14256. var i = P.getModel({
  14257. url: t,
  14258. floors: O.valueFromHash("f", !0),
  14259. autoload: !1
  14260. });
  14261. return $.when(i, y).then(null, function(e) {
  14262. return this
  14263. })
  14264. }(0, e)
  14265. }).then(function(e) {
  14266. return re(.9),
  14267. function(e, t, i, n, r) {
  14268. ne.info("Model data loaded"),
  14269. ne.debug("UUID: " + e.data.job.uuid),
  14270. W.init(G.getFlags()),
  14271. i && N.initKeen({
  14272. token: i,
  14273. appId: n
  14274. }),
  14275. N.initSegment({
  14276. model: e.sid,
  14277. version: "2.25.6-0-gd87e5b1",
  14278. startSource: r.startSource,
  14279. token: t,
  14280. autoplay: r.autoplay,
  14281. quickstart: r.quickstart
  14282. })
  14283. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14284. startSource: i,
  14285. autoplay: L.autoplay,
  14286. quickstart: o
  14287. }),
  14288. g.urls.init()
  14289. }).then(function() {
  14290. return g.loadPanos()
  14291. }).then(function() {
  14292. s = U.getStartCameraOptions(g, g.panos);
  14293. //初始画面
  14294. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14295. $("<img/>").attr("src", e).on("load", function() {
  14296. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14297. $(this).remove()
  14298. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14299. })
  14300. }(window.DATA.camera_start.thumbImg);
  14301. d = function(e) {
  14302. var t = new E.PerspectiveCamera;
  14303. t.layers.enable(te.PANOMARKERS),
  14304. t.layers.enable(te.RETICULE),
  14305. t.layers.enable(te.TAG);
  14306. var o = new E.Scene
  14307. , i = new E.AmbientLight(16777215);
  14308. return o.add(i),
  14309. o.skybox = new V,
  14310. o.add(o.skybox),
  14311. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14312. side: E.DoubleSide
  14313. })),
  14314. o.plane.position.y = 0,
  14315. o.plane.rotateX(-Math.PI / 2),
  14316. o.plane.material.visible = !1,
  14317. o.add(o.plane),
  14318. o.updateMatrixWorld(),
  14319. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14320. if (e.metadata && e.metadata.camera_position) {
  14321. var t = e.metadata.camera_position
  14322. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14323. i.position = t.clone(),
  14324. o.add(i);
  14325. var n = e.metadata.camera_quaternion
  14326. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14327. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14328. }
  14329. }),
  14330. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14331. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14332. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14333. new Y(o,t,B)
  14334. }(g),
  14335. m = function(e, t) {
  14336. var i = e ? 1 : 1e3
  14337. , n = W.tilegen || W.imgopt ? 6 : 2;
  14338. n = O.valueFromHash("tileconc", n);
  14339. var r = new X
  14340. , o = new Q({
  14341. concurrentDownloads: n
  14342. })
  14343. , a = new J
  14344. , s = new x
  14345. , l = new w
  14346. , c = new b(t)
  14347. , h = new T
  14348. , u = new S(i)
  14349. , d = new M
  14350. , p = new K;
  14351. return {
  14352. qualityManager: r,
  14353. panoRenderer: a,
  14354. tileDownloader: o,
  14355. player: c,
  14356. director: l,
  14357. modelManager: s,
  14358. tagManager: p,
  14359. displayController: u,
  14360. labelDisplayController: d,
  14361. controls: h
  14362. }
  14363. }(o, s.mode),
  14364. l = m.controls,
  14365. c = m.player,
  14366. h = m.director,
  14367. u = m.tagManager,
  14368. p = m.tileDownloader,
  14369. f = m.qualityManager,
  14370. m.panoRenderer,
  14371. function(e, t, i, n) {
  14372. var r = i.controls
  14373. , o = i.qualityManager
  14374. , a = i.panoRenderer
  14375. , s = i.tileDownloader
  14376. , l = i.modelManager;
  14377. r.init(n, l),
  14378. j.init(i.director, r, i.player, l, t),
  14379. o.init(l),
  14380. s.init(o),
  14381. a.init(t, s, o),
  14382. l.init(s, a, o),
  14383. l.addModel(e),
  14384. t.addComponent(F)
  14385. }(g, d, m, r),
  14386. c.director = h,
  14387. g.supportsTiles && p.start(),
  14388. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14389. o = !1);
  14390. var e = null;
  14391. if (o) {
  14392. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14393. var t = l.controls[R.PANORAMA];
  14394. a = new q(f,d.scene,d.camera,t,r),
  14395. C(d, r, g),
  14396. e = a.load(s).then(function() {
  14397. d.addComponent(a),
  14398. d.once(ee.AfterRender, function() {
  14399. ne.warn("First render after quickstart load finished.")
  14400. })
  14401. })
  14402. }
  14403. return window.flyToFirst = function() {
  14404. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14405. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14406. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14407. c.flyToPano({
  14408. pano: e,
  14409. lookAtPoint: i
  14410. })
  14411. }
  14412. ,
  14413. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14414. }).then(function() {
  14415. return function(e, t, i, n, r) {
  14416. return r.progressCallback = t,
  14417. N.sessionStart(),
  14418. e.load(n).progress(function(e, t) {
  14419. e.modelElementsToLoad = t[1],
  14420. function(e) {
  14421. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14422. }(e),
  14423. function(e) {
  14424. e.totalElementsLoaded++,
  14425. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14426. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14427. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14428. console.log("pro:" + e.totalPercentageLoaded),
  14429. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14430. }(e)
  14431. }
  14432. .bind(this, r))
  14433. }(g, D.onProgress, 0, !o, n)
  14434. }).then(function() {
  14435. s.quickstart = o,
  14436. function(e, t, i, n) {
  14437. var r = i.qualityManager
  14438. , o = i.panoRenderer
  14439. , a = i.tileDownloader
  14440. , s = i.modelManager
  14441. , l = i.player
  14442. , c = i.director
  14443. , h = i.tagManager
  14444. , u = i.displayController
  14445. , d = i.labelDisplayController
  14446. , p = i.controls;
  14447. t.scene.add(e),
  14448. t.qualityManager = r;
  14449. var f = {
  14450. camera: t.camera,
  14451. director: c,
  14452. modelManager: s,
  14453. tileDownloader: a,
  14454. panoRenderer: o,
  14455. qualityManager: r,
  14456. tagManager: h,
  14457. container: n,
  14458. controls: p
  14459. };
  14460. l.init(f),
  14461. l.setScene(t.scene),
  14462. h.init(s, l),
  14463. c.init(l, s),
  14464. u.init(c, l, s, h, n),
  14465. d.init(l, s, n),
  14466. B.bindEvents(l),
  14467. t.addComponent(h),
  14468. t.addComponent(l),
  14469. t.addComponent(o),
  14470. l.sceneRenderer = t
  14471. }(g, d, m, r),
  14472. d.started || C(d, r, g),
  14473. N.modelLoaded(g, c, l, L.autoplay),
  14474. function(e, t, i, n) {
  14475. return ne.info("Starting player in " + i.mode),
  14476. N.report(t.sid, "started-playing", n, i.quickstart),
  14477. e.start(i)
  14478. }(c, g, s, L.autoplay).done(function() {
  14479. h.autoTour()
  14480. }),
  14481. g.supportsTiles || new H(g,c).start();
  14482. o && (d.removeComponent(a),
  14483. a.destroy(),
  14484. s.pano.enter()),
  14485. D.init(g, h, c, l, d, s, N.getSessionId()),
  14486. D.endLoading(g, h, u),
  14487. d.once(ee.AfterRender, function() {
  14488. v.setAppReadyTime();
  14489. var e = v.calcFullLoadingTime();
  14490. ne.warn("Total load time: " + e / 1e3),
  14491. N.loadComplete(e),
  14492. ne.warn("First render after model load finished.");
  14493. editTool.loadDone('data', window.DATA)
  14494. }),
  14495. d.on(ee.MemoryUsageUpdated, y)
  14496. }).fail(A.bind(this, e))
  14497. }()
  14498. }()
  14499. })
  14500. }
  14501. ).call(this, "/js/main.js")
  14502. }
  14503. , {
  14504. "./DisplayController": 1,
  14505. "./TimingData": 2,
  14506. "./ab": 3,
  14507. "./analytics": 4,
  14508. "./cameras/PanoramaCamera": 7,
  14509. "./controls/CameraControls": 9,
  14510. "./director": 15,
  14511. "./effects": 16,
  14512. "./enum/PanoSizeClass": 36,
  14513. "./enum/PanoramaEvents": 37,
  14514. "./enum/RenderLayers": 41,
  14515. "./enum/SceneRendererEvents": 43,
  14516. "./enum/Viewmode": 51,
  14517. "./featureflags": 59,
  14518. "./gui/error": 64,
  14519. "./gui/gui": 65,
  14520. "./gui/memoryUsage": 73,
  14521. "./label/LabelDisplayController": 91,
  14522. "./lib/array-polyfill": 92,
  14523. "./lib/performance-polyfill": 95,
  14524. "./lib/postprocessing/EffectComposer.js": 96,
  14525. "./lib/postprocessing/MaskPass.js": 97,
  14526. "./lib/postprocessing/RenderPass.js": 98,
  14527. "./lib/postprocessing/ShaderPass.js": 99,
  14528. "./lib/shaders/CopyShader.js": 100,
  14529. "./lib/shaders/HorizontalBlurShader.js": 101,
  14530. "./lib/shaders/VerticalBlurShader.js": 102,
  14531. "./lib/three75-shim": 103,
  14532. "./localization/localize": 108,
  14533. "./tag/tagManager": 124,
  14534. "./model/ModelManager": 140,
  14535. "./objects/Panorama": 148,
  14536. "./objects/Skybox": 152,
  14537. "./player": 155,
  14538. "./preloaders": 156,
  14539. "./scene/QuickstartManager": 157,
  14540. "./scene/SceneRenderer": 158,
  14541. "./sdk/automation.js": 164,
  14542. "./settings": 166,
  14543. "./showcase": 168,
  14544. "./tile/PanoRenderer": 169,
  14545. "./tile/QualityManager.js": 170,
  14546. "./tile/TileDownloader": 171,
  14547. "./util/PanoramaCollection": 178,
  14548. "./util/ajax": 181,
  14549. "./util/browser": 182,
  14550. "./util/camera": 183,
  14551. "./util/common": 185,
  14552. "./util/lerp": 188,
  14553. "./util/logger": 189,
  14554. "./util/math": 190,
  14555. "./util/sentry": 192,
  14556. "./util/showcase": 193,
  14557. "./util/transitions": 195,
  14558. events: 202,
  14559. "promise-polyfill": 213,
  14560. three: 217
  14561. }],
  14562. 117: [function(e, t, i) {
  14563. "use strict";
  14564. function n(e) {
  14565. e = e || {},
  14566. r.RawShaderMaterial.call(this, a.extendObject({
  14567. fragmentShader: o.cube.fragmentShader,
  14568. vertexShader: o.cube.vertexShader,
  14569. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14570. name: "CubemapMaterial"
  14571. }, e))
  14572. }
  14573. var r = e("three")
  14574. , o = e("../shaders")
  14575. , a = e("../util/common");
  14576. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14577. t.exports = n
  14578. }
  14579. , {
  14580. "../shaders": 167,
  14581. "../util/common": 185,
  14582. three: 217
  14583. }],
  14584. 118: [function(e, t, i) {
  14585. "use strict";
  14586. function n(e) {
  14587. e = e || {},
  14588. r.RawShaderMaterial.call(this, a.extendObject({
  14589. fragmentShader: o.model.fragmentShader,
  14590. vertexShader: o.model.vertexShader,
  14591. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14592. name: "ModelTextureMaterial"
  14593. }, e))
  14594. }
  14595. var r = e("three")
  14596. , o = e("../shaders")
  14597. , a = e("../util/common");
  14598. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14599. i && (this.uniforms.progress.value = 0),
  14600. e.ensureSkyboxReadyForRender(),
  14601. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14602. this.uniforms.pano0Position.value.copy(e.position),
  14603. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14604. t.ensureSkyboxReadyForRender(),
  14605. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14606. this.uniforms.pano1Position.value.copy(t.position),
  14607. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14608. }
  14609. ,
  14610. t.exports = n
  14611. }
  14612. , {
  14613. "../shaders": 167,
  14614. "../util/common": 185,
  14615. three: 217
  14616. }],
  14617. 119: [function(m, v, e) {
  14618. (function(e) {
  14619. "use strict";
  14620. function t(e, t, i, n) {
  14621. this.div = null,
  14622. this.body = null,
  14623. this.label = e,
  14624. this.description = t,
  14625. this.parsedDescription = [],
  14626. this.media = i || {
  14627. type: null
  14628. },
  14629. this.loadingSpinner = null,
  14630. this.parser = new r({
  14631. supportLinks: !c.valueFromHash("mls"),
  14632. keepLinkLabels: !0
  14633. }),
  14634. this.state = g.CLOSED,
  14635. this.orientation = "",
  14636. this.initialTransform = "",
  14637. this.hovering = !1,
  14638. this.openTransition = null,
  14639. this.closeTransition = null,
  14640. this.openPromise = null,
  14641. this.closePromise = null,
  14642. this.animationTransition = null,
  14643. this.animationScale = 0
  14644. }
  14645. var r = m("../Parser/DescriptionParser")
  14646. , i = m("../Media/Link")
  14647. , n = m("../Media/Image")
  14648. , o = m("../Media/EmbedlyPlayer")
  14649. , a = m("../Media/EmbedlyEmbed")
  14650. , s = m("../../util/transitions")
  14651. , l = m("../../util/lerp")
  14652. , c = m("../../util/browser")
  14653. , b = m("./BillboardEvent")
  14654. , w = m("../Media/MediaEvent")
  14655. , h = m("../Parser/DescriptionChunkType")
  14656. , u = m("events").EventEmitter
  14657. , d = m("./billboardSettings")
  14658. , T = m("./overlaySettings")
  14659. , p = new (m("../../util/logger"))(e)
  14660. , f = document.getElementById("tag-billboards");
  14661. f.addEventListener("touchend", function(e) {
  14662. f.style.pointerEvents = "none"
  14663. }),
  14664. f.addEventListener("touchcancel", function(e) {
  14665. f.style.pointerEvents = "none"
  14666. });
  14667. var g = {
  14668. CLOSED: "closed",
  14669. OPENING: "opening",
  14670. OPEN: "open",
  14671. CLOSING: "closing",
  14672. ACTIVE: "active"
  14673. };
  14674. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14675. this.parsedDescription = this.parser.parse(this.description);
  14676. var t = document.createElement("div");
  14677. t.className = "tag-container has-hotzone",
  14678. this.div = t,
  14679. this.body = document.createElement("div"),
  14680. this.body.className = "tag-body";
  14681. var i = document.createElement("div");
  14682. i.classList.add("tag-content");
  14683. var n = document.createElement("div");
  14684. n.classList.add("tag-text-content");
  14685. var r = document.createElement("div");
  14686. r.className = "tag-label",
  14687. r.textContent = this.label,
  14688. n.appendChild(r);
  14689. var o = document.createElement("div");
  14690. o.className = "tag-desc",
  14691. n.appendChild(o),
  14692. i.appendChild(n),
  14693. this.body.appendChild(i),
  14694. this.appendDescriptionElements(this.parsedDescription, o),
  14695. this.appendMedia(),
  14696. t.appendChild(this.body),
  14697. f.appendChild(t),
  14698. this.bindEvents(t, this.body)
  14699. }
  14700. ,
  14701. t.prototype.bindEvents = function(i, e) {
  14702. function t(n) {
  14703. return function(e) {
  14704. if (!this.div.classList.contains("overlay")) {
  14705. var t, i = document.getElementById("player");
  14706. try {
  14707. t = new MouseEvent(n,e)
  14708. } catch (i) {
  14709. (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)
  14710. }
  14711. i.dispatchEvent(t)
  14712. }
  14713. }
  14714. }
  14715. e.addEventListener("mousedown", function(e) {
  14716. e.stopPropagation()
  14717. }),
  14718. e.addEventListener("mouseup", function(e) {
  14719. e.stopPropagation()
  14720. }),
  14721. i.addEventListener("touchstart", function(e) {
  14722. f.style.pointerEvents = "auto"
  14723. }),
  14724. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14725. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14726. e.addEventListener("mouseover", function(e) {
  14727. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14728. }
  14729. .bind(this)),
  14730. i.addEventListener("mouseenter", function(e) {
  14731. this.state !== g.CLOSING && (this.hovering = !0,
  14732. this.emit(b.ENTER))
  14733. }
  14734. .bind(this)),
  14735. i.addEventListener("mouseleave", function(e) {
  14736. this.hovering = !1,
  14737. this.emit(b.LEAVE)
  14738. }
  14739. .bind(this)),
  14740. i.addEventListener("gesturestart", function(e) {
  14741. e.preventDefault()
  14742. });
  14743. var n = i.querySelector(".tag-text-content")
  14744. , r = 0;
  14745. n.addEventListener("touchstart", function(e) {
  14746. r = e.changedTouches[0].clientY
  14747. }),
  14748. n.addEventListener("touchmove", function(t) {
  14749. function e(e) {
  14750. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14751. }
  14752. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14753. }),
  14754. i.addEventListener("touchmove", function(e) {
  14755. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14756. })
  14757. }
  14758. ,
  14759. t.prototype.appendDescriptionElements = function(e, i) {
  14760. 0 < e.length && this.div.classList.add("has-text"),
  14761. e.forEach(function(e, t) {
  14762. switch (e.type) {
  14763. case h.TEXT:
  14764. i.appendChild(this.createTextElement(e.text));
  14765. break;
  14766. case h.LINK:
  14767. i.appendChild(this.createLinkElement(e.link))
  14768. }
  14769. }
  14770. .bind(this))
  14771. }
  14772. ,
  14773. t.prototype.appendLoadingSpinner = function() {
  14774. this.loadingSpinner = document.createElement("div"),
  14775. this.loadingSpinner.classList.add("loading-spinner");
  14776. var e = document.createElement("div");
  14777. e.classList.add("gui-spinner-icon"),
  14778. this.loadingSpinner.appendChild(e),
  14779. this.body.appendChild(this.loadingSpinner)
  14780. }
  14781. ,
  14782. t.prototype.onMediaLoadFinished = function() {
  14783. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14784. this.applyOrientation(this.orientation),
  14785. this.loadingSpinner = null)
  14786. }
  14787. ,
  14788. t.prototype.appendMedia = function() {
  14789. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14790. this.appendLoadingSpinner();
  14791. var e = document.createElement("div");
  14792. e.classList.add("tag-media-content");
  14793. var t = document.createElement("i");
  14794. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14795. t.classList.add(e)
  14796. }),
  14797. this.body.appendChild(t),
  14798. this.body.appendChild(e),
  14799. this.media.type) {
  14800. case h.IMAGE:
  14801. e.appendChild(this.createImageElement(this.media, this.body));
  14802. break;
  14803. case h.VIDEO:
  14804. e.appendChild(this.createVideoElement(this.media, this.body));
  14805. break;
  14806. case h.RICH:
  14807. e.appendChild(this.createEmbedElement(this.media, this.body))
  14808. }
  14809. }
  14810. }
  14811. ,
  14812. t.prototype.createTextElement = function(e) {
  14813. var t = document.createElement("span");
  14814. return t.textContent = e,
  14815. t
  14816. }
  14817. ,
  14818. t.prototype.createLinkElement = function(e) {
  14819. var t = new i(e);
  14820. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14821. t.createDomElement()
  14822. }
  14823. ,
  14824. t.prototype.createImageElement = function(t, C) {
  14825. function e() {
  14826. function e() {
  14827. p || (E.classList.remove("view-image"),
  14828. a.classList.add("overlay"),
  14829. t(),
  14830. window.addEventListener("resize", A),
  14831. a.addEventListener("click", i),
  14832. c.addEventListener("click", r),
  14833. o.addEventListener("click", n),
  14834. p = !0,
  14835. _.emit(w.IMAGE_OPENED))
  14836. }
  14837. function t() {
  14838. C.classList.add("show-info"),
  14839. s.classList.remove("collapsible"),
  14840. s.style.height = "";
  14841. var e = parseFloat(getComputedStyle(v).lineHeight)
  14842. , t = g + e
  14843. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14844. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14845. , r = n
  14846. , o = r * I.aspect;
  14847. i < o && (r = (o = i) / I.aspect),
  14848. n < r && (o = (r = n) * I.aspect),
  14849. o += m,
  14850. r += m + t,
  14851. C.style.width = o + "px",
  14852. C.style.height = r + "px",
  14853. l.style.paddingTop = e + m + "px",
  14854. 0 < _.description.length && (s.classList.add("collapsible"),
  14855. s.style.height = s.clientHeight + 12 + "px",
  14856. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14857. }
  14858. function i(e) {
  14859. e.target === a && n()
  14860. }
  14861. function n() {
  14862. p && (p = !1,
  14863. E.classList.add("view-image"),
  14864. a.classList.remove("overlay"),
  14865. s.style.height = "",
  14866. l.style.paddingTop = "",
  14867. C.style.width = "",
  14868. C.style.height = "",
  14869. window.removeEventListener("resize", A),
  14870. a.removeEventListener("click", i),
  14871. c.removeEventListener("click", r),
  14872. o.removeEventListener("click", n),
  14873. _.emit(w.IMAGE_CLOSED),
  14874. _.close(!0))
  14875. }
  14876. function r(e) {
  14877. C.classList.toggle("show-info")
  14878. }
  14879. var a = _.div
  14880. , s = a.getElementsByClassName("tag-content")[0]
  14881. , l = a.getElementsByClassName("tag-media-content")[0]
  14882. , o = C.getElementsByClassName("close")[0]
  14883. , c = s.getElementsByClassName("tag-label")[0];
  14884. a.classList.add("has-image"),
  14885. E.classList.add("view-image"),
  14886. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14887. _.applyOrientation(_.orientation);
  14888. 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,
  14889. function() {
  14890. clearInterval(h),
  14891. clearTimeout(u),
  14892. h = setInterval(function() {
  14893. var e = a.clientHeight;
  14894. d !== e && (t(),
  14895. d = e)
  14896. }, 100),
  14897. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14898. }
  14899. );
  14900. I.on(w.IMAGE_OPENING, e),
  14901. _.on(b.ACTIVATE, e),
  14902. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14903. _.on(b.CLOSING, n)
  14904. }
  14905. var I = new n
  14906. , E = I.createDomElement();
  14907. this.once(b.OPENED, function() {
  14908. I.load(t.src).then(e).catch(function(e) {
  14909. p.warn("Failed to load image:", t.src),
  14910. p.warn("with error:", e)
  14911. }).then(this.onMediaLoadFinished.bind(this))
  14912. });
  14913. var _ = this;
  14914. return E
  14915. }
  14916. ,
  14917. t.prototype.createVideoElement = function(t, e) {
  14918. var i = new o({
  14919. autoPlay: !0,
  14920. autoResume: !0,
  14921. startMuted: !1,
  14922. loop: !1
  14923. })
  14924. , n = i.createDomElement();
  14925. return this.once(b.OPENED, function() {
  14926. i.load(t.src).then(function() {
  14927. this.div.classList.add("has-video"),
  14928. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14929. i.play()),
  14930. this.on(b.OPENING, i.show.bind(i)),
  14931. this.on(b.OPENED, i.play.bind(i)),
  14932. this.on(b.CLOSING, i.pause.bind(i)),
  14933. this.on(b.CLOSED, i.hide.bind(i))
  14934. }
  14935. .bind(this)).catch(function(e) {
  14936. p.warn("Failed to embed video:", t.src),
  14937. p.warn("with error:", e)
  14938. }).then(this.onMediaLoadFinished.bind(this))
  14939. }
  14940. .bind(this)),
  14941. n
  14942. }
  14943. ,
  14944. t.prototype.createEmbedElement = function(t, e) {
  14945. var i = new a
  14946. , n = i.createDomElement();
  14947. return this.once(b.OPENED, function() {
  14948. i.load(t.src).then(function() {
  14949. this.div.classList.add("has-embed"),
  14950. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14951. this.applyOrientation(this.orientation),
  14952. this.on(b.OPENING, i.show.bind(i)),
  14953. this.on(b.CLOSED, i.hide.bind(i))
  14954. }
  14955. .bind(this)).catch(function(e) {
  14956. p.warn("Failed to embed:", t.src),
  14957. p.warn("with error:", e)
  14958. }).then(this.onMediaLoadFinished.bind(this))
  14959. }
  14960. .bind(this)),
  14961. n
  14962. }
  14963. ,
  14964. t.prototype.open = function(e) {
  14965. return this.openPromise = $.Deferred(),
  14966. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14967. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14968. this.state !== g.OPEN && (this.emit(b.OPENING),
  14969. e && this.emit(b.ACTIVATING),
  14970. this.state = g.OPENING,
  14971. this.animateOpen(function() {
  14972. e && this.setActiveState(),
  14973. this.openPromise.resolve()
  14974. }
  14975. .bind(this)))
  14976. }
  14977. .bind(this), d.animation.openDelay),
  14978. s.cancel(this.closeTransition),
  14979. this.closePromise && this.closePromise.reject(),
  14980. this.closeTransition = void 0,
  14981. this.openPromise.promise())
  14982. }
  14983. ,
  14984. t.prototype.close = function(e) {
  14985. return this.closePromise = $.Deferred(),
  14986. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14987. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14988. this.state = g.CLOSING,
  14989. this.animateClose())
  14990. }
  14991. .bind(this), d.animation.closeDelay)),
  14992. s.cancel(this.openTransition),
  14993. this.openPromise && this.openPromise.reject(),
  14994. this.openTransition = void 0,
  14995. this.closePromise.resolve(),
  14996. this.closePromise.promise())
  14997. }
  14998. ,
  14999. t.prototype.setActiveState = function() {
  15000. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  15001. this.emit(b.ACTIVATE),
  15002. this.div.classList.remove("has-hotzone"))
  15003. }
  15004. ,
  15005. t.prototype.animateOpen = function(e) {
  15006. if (this.state === g.OPENING) {
  15007. if (s.cancel(this.animationTransition),
  15008. c.detectSamsungNative())
  15009. return this.boardOrientation = null,
  15010. this.div.style.visibility = "visible",
  15011. this.emit(b.OPENED),
  15012. this.state = g.OPEN,
  15013. void (e && e());
  15014. this.div.style.webkitTransform = "scale(0)",
  15015. this.div.style.transform = "scale(0)",
  15016. this.div.style.visibility = "visible",
  15017. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  15018. this.emit(b.OPENED),
  15019. this.state = g.OPEN,
  15020. e && e()
  15021. }
  15022. .bind(this))
  15023. }
  15024. }
  15025. ,
  15026. t.prototype.animateClose = function(e) {
  15027. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  15028. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  15029. this.emit(b.CLOSED),
  15030. this.state = g.CLOSED,
  15031. this.div.style.visibility = "hidden",
  15032. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15033. e && e()
  15034. }
  15035. .bind(this)))
  15036. }
  15037. ,
  15038. t.prototype.needsUpdate = function() {
  15039. return this.state !== g.CLOSED
  15040. }
  15041. ,
  15042. t.prototype.update = function(e, t) {
  15043. if (this.needsUpdate()) {
  15044. var i = (this.updateOrientation(e),
  15045. this.calcScale(t))
  15046. , n = {
  15047. x: (e.x + 1) * $("#player").width() / 2,
  15048. y: (e.y + 1) * $("#player").height() / 2
  15049. };
  15050. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15051. this.div.style.webkitTransform = this.div.screenTransform,
  15052. this.div.style.transform = this.div.screenTransform
  15053. }
  15054. }
  15055. ,
  15056. t.prototype.getDimensions = function() {
  15057. return this.div.getBoundingClientRect()
  15058. }
  15059. ,
  15060. t.prototype.calcScale = function(e) {
  15061. return Math.sqrt(e / 40) * d.boardToDiscRatio
  15062. }
  15063. ,
  15064. t.prototype.updateOrientation = function(e) {
  15065. if (this.state !== g.ACTIVE) {
  15066. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  15067. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  15068. , n = "";
  15069. n += 0 == i ? "right" : 2 == i ? "left" : "",
  15070. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  15071. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  15072. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15073. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  15074. }
  15075. }
  15076. ,
  15077. t.prototype.applyOrientation = function(e) {
  15078. this.div.style.transform = this.div.style.webkitTransform = "",
  15079. this.div.classList.remove("tag-container-" + this.orientation),
  15080. this.div.classList.add("tag-container-" + e);
  15081. var t = window.getComputedStyle(this.div);
  15082. this.initialTransform = t.transform || t.webkitTransform,
  15083. "none" === this.initialTransform && (this.initialTransform = "");
  15084. var i = t.transform.slice(7, -1).split(",")
  15085. , n = -i[4]
  15086. , r = -i[5];
  15087. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15088. this.div.style.transformOrigin = n + "px " + r + "px",
  15089. this.orientation = e
  15090. }
  15091. ,
  15092. v.exports = t
  15093. }
  15094. ).call(this, "/js/tag/Billboard/Billboard.js")
  15095. }
  15096. , {
  15097. "../../util/browser": 182,
  15098. "../../util/lerp": 188,
  15099. "../../util/logger": 189,
  15100. "../../util/transitions": 195,
  15101. "../Media/EmbedlyEmbed": 125,
  15102. "../Media/EmbedlyPlayer": 126,
  15103. "../Media/Image": 128,
  15104. "../Media/Link": 129,
  15105. "../Media/MediaEvent": 131,
  15106. "../Parser/DescriptionChunkType": 133,
  15107. "../Parser/DescriptionParser": 134,
  15108. "./BillboardEvent": 120,
  15109. "./billboardSettings": 121,
  15110. "./overlaySettings": 122,
  15111. events: 202
  15112. }],
  15113. 120: [function(e, t, i) {
  15114. "use strict";
  15115. t.exports = Object.freeze({
  15116. ENTER: "billboard.enter",
  15117. LEAVE: "billboard.leave",
  15118. OPENING: "billboard.opening",
  15119. OPENED: "billboard.open",
  15120. CLOSING: "billboard.closing",
  15121. CLOSED: "billboard.closed",
  15122. ACTIVATING: "billboard.activating",
  15123. ACTIVATE: "billboard.activate"
  15124. })
  15125. }
  15126. , {}],
  15127. 121: [function(e, t, i) {
  15128. "use strict";
  15129. t.exports = Object.freeze({
  15130. animation: Object.freeze({
  15131. hoverOnClosing: !1,
  15132. openDelay: 100,
  15133. closeDelay: 50,
  15134. openDuration: 200,
  15135. closeDuration: 100
  15136. }),
  15137. boardToDiscRatio: 1.2
  15138. })
  15139. }
  15140. , {}],
  15141. 122: [function(e, t, i) {
  15142. "use strict";
  15143. t.exports = Object.freeze({
  15144. boundaryWidth: 30,
  15145. boundaryHeight: 0
  15146. })
  15147. }
  15148. , {}],
  15149. hot: [function(e, t, i) {
  15150. "use strict";
  15151. function n(e, t, i) {
  15152. this.sid = e,
  15153. this.position = this.convertValue(t.position, g.Vector3)
  15154. if(t.quaternion){
  15155. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  15156. }else{
  15157. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  15158. }
  15159. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  15160. this.isSprite = t.isSprite || 0
  15161. this.actionType = (t.noAction ? 'noAction' : t.actionType ) || "common"
  15162. this.linkType = t.linkType || "common"
  15163. this.link = t.link,
  15164. this.model = i,
  15165. this.size = t.size;
  15166. this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img,会经常改变
  15167. this.infoAttribute = t.infoAttribute || {};
  15168. this.transformAtPanos = t.transformAtPanos || {}
  15169. for (let i in this.transformAtPanos) {
  15170. this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
  15171. this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
  15172. }
  15173. this.build()
  15174. this.setFromInfo()
  15175. this.changeTex()
  15176. this.visibleData = t.visiblePanos
  15177. //this.setVisiblePanos(t.visiblePanos );
  15178. }
  15179. var g = e("three")
  15180. , r = e("../shaders")
  15181. , m = e("../settings")
  15182. , v = e("../enum/Viewmode")
  15183. , d = e("../objects/Panorama")
  15184. , o = e("../util/texture")
  15185. , math = e("../util/math")
  15186. , p = new g.Raycaster
  15187. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  15188. var defaultTex1 = o.load(g_HotImage.point);
  15189. var defaultTex2 = o.load(g_HotImage.point2)
  15190. //dealMap(defaultTex1)
  15191. //dealMap(defaultTex2)
  15192. n.prototype.setFromInfo = function(){ //初始化或恢复
  15193. var info = this.infoAttribute
  15194. this.setTitleElem(info.title)
  15195. this.transformAtPanos = info.transformAtPanos || this.transformAtPanos
  15196. var curPanoTransform = this.transformAtPanos[ getTransformSid()] || {}
  15197. var pos = curPanoTransform.pos || info.position
  15198. pos && this.mesh.position.copy(pos)
  15199. info.position && this.position.copy(info.position) //this.position记录全局position
  15200. var isSprite = info.isSprite != void 0 ? info.isSprite : this.isSprite
  15201. if(!isSprite){
  15202. var qua = curPanoTransform.qua || info.quaternion
  15203. qua && this.mesh.quaternion.copy(qua)
  15204. }
  15205. info.quaternion && this.quaternion.copy(info.quaternion) //this.quaternion记录全局quaternion
  15206. var s = parseFloat(info.hotIconScale || window.DATA.hotIconScale )
  15207. s && this.mesh.scale.set(s, s, s)
  15208. this.isSprite = isSprite
  15209. this.actionType = info.actionType != void 0 ? info.actionType : this.actionType
  15210. this.linkType = info.linkType != void 0 ? info.linkType : this.linkType
  15211. this.initStyleImg()
  15212. }
  15213. n.prototype.changeTex = function(styleImg){
  15214. var u = this.mesh.material.uniforms
  15215. var styleImg = styleImg || this.styleImg
  15216. if(styleImg.length){
  15217. u.texture1.value = o.load(styleImg[0].src);
  15218. u.texture2.value = o.load(styleImg[1]&&styleImg[1].src || styleImg[0].src);
  15219. }else{
  15220. u.texture1.value = defaultTex1;
  15221. u.texture2.value = defaultTex2;
  15222. }
  15223. this.styleImg = styleImg
  15224. }
  15225. n.prototype.initStyleImg = function(){
  15226. var t = this.infoAttribute;
  15227. this.styleImg = []
  15228. t.styleImg = t.styleImg || [];
  15229. t.styleImg.forEach((src)=>{
  15230. //src = src.src || src
  15231. this.styleImg.push({src:manage.dealURL(src)})
  15232. })
  15233. this.changeTex()
  15234. }
  15235. n.prototype.update = function(camera) {
  15236. if(this.isSprite){
  15237. this.mesh.quaternion.copy(camera.quaternion)
  15238. }
  15239. }
  15240. n.prototype.setVisiblePanos = function(visibleData ){
  15241. if(visibleData == "get"){
  15242. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15243. }else if(visibleData){
  15244. this.visiblePanos = visibleData;
  15245. }
  15246. /* this.visiblePanos = [];
  15247. this.model.panos.list.forEach((pano)=>{//考虑到热点可以移动,不好重新设置,还是不根据模型遮挡来初始化了,默认全部可见
  15248. if(visibleData && !visibleData.includes(pano.id))return;
  15249. var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
  15250. if(!isShelter){
  15251. this.visiblePanos.push(pano.id)
  15252. }
  15253. }) */
  15254. }
  15255. n.prototype.build = function() {
  15256. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15257. var e = new g.Mesh(a, new g.ShaderMaterial({
  15258. uniforms: t,
  15259. vertexShader: r.hot.vertexShader,
  15260. fragmentShader: r.hot.fragmentShader,
  15261. transparent: !0
  15262. }))
  15263. e.dynamic = !0, //?
  15264. e.position.copy(this.position);
  15265. e.quaternion.copy(this.quaternion)
  15266. e.name = this.sid,
  15267. e.type = "hotSprite",
  15268. (e.belongHot = this).link && (e.hotLink = this.link),
  15269. this.mesh = e,
  15270. this.model.add(e),
  15271. g_HotMeshes.push(e);
  15272. }
  15273. n.prototype.setTitleElem = function(){
  15274. var root = $("#hot");
  15275. var title = this.infoAttribute.title;
  15276. if(title){
  15277. if(!this.titleElem){
  15278. var elem = $(`<div></div>`)
  15279. root.append(elem);
  15280. this.titleElem = elem;
  15281. }
  15282. this.titleElem.text(title)
  15283. }else{
  15284. if(this.titleElem){
  15285. this.titleElem.remove()
  15286. this.titleElem = null;
  15287. }
  15288. }
  15289. }
  15290. n.prototype.showTitle = function(){
  15291. if(!this.titleElem)return;
  15292. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15293. if(pos.trueSide){//inSight
  15294. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15295. this.titleElem.css("display","block");
  15296. }else{
  15297. this.titleElem.css("display","none");
  15298. }
  15299. }
  15300. n.prototype.hideTitle = function(){
  15301. if(!this.titleElem)return;
  15302. this.titleElem.css("display","none");
  15303. }
  15304. ,
  15305. n.prototype.closestPanoTowardTag = function(e, t) {
  15306. var i = []
  15307. , n = []
  15308. , r = this.mesh.position;
  15309. if (e === v.PANORAMA) {
  15310. var o = t.position.clone().sub(r).normalize();
  15311. n.push(d.scoreFunctions.direction(r, o))
  15312. }
  15313. var a = new g.Vector3;
  15314. i.push(function(e) {
  15315. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15316. }, function(e) {
  15317. a.copy(r).sub(e.position);
  15318. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15319. , i = m.tags.navigate.tiltTolerance;
  15320. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15321. },
  15322. (pano)=>{ // add
  15323. return player.checkHasNeighbor(pano)
  15324. }
  15325. ),
  15326. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15327. var s = t.model.panos.sortByScore(i, n);
  15328. if (s && m.tags.navigate.lineOfSight) {
  15329. for (var l = 0; l < s.length; l++) {
  15330. var c = s[l].pano
  15331. , h = c.position.distanceTo(r);
  15332. p.set(c.position, r.clone().sub(c.position).normalize());
  15333. var u = p.intersectObjects(t.model.colliders);
  15334. if (0 === u.length || u[0].distance > h)
  15335. return console.log(l),
  15336. c
  15337. }
  15338. return null
  15339. }
  15340. return s && 0 < s.length && s[0].pano
  15341. }
  15342. var getLink = function(link){
  15343. var src = '';
  15344. var r = link.substring(link.indexOf("html") + 4)
  15345. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15346. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15347. return src
  15348. }
  15349. n.prototype.examine = function(e, options) {
  15350. options = options || {}
  15351. if(this.actionType == 'noAction')return
  15352. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15353. var src = getLink(this.infoAttribute.iframe[0]);
  15354. if(this.linkType=="jumpLink"){
  15355. var newPage = window.open(src, "_blank" );
  15356. newPage.focus();
  15357. }else if(this.linkType=="iframeDiv"){
  15358. var div = document.createElement("div");
  15359. $("body").append(div);
  15360. div.style.position = 'fixed';
  15361. div.style.width = div.style.height = "100%";
  15362. div.style.left = div.style.top = '0';
  15363. div.style["z-index"] = "999"
  15364. var exit = document.createElement("div");
  15365. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15366. exit.style.position = 'absolute';
  15367. exit.style.width = exit.style.height = "50px";
  15368. exit.style.left = '17px'; exit.style.top = "20px"
  15369. exit.style.cursor = "pointer";
  15370. exit.style["background-repeat"] = "no-repeat";
  15371. exit.style["background-size"] = "25%";
  15372. exit.style["background-position"] = "center center";
  15373. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15374. exit.style["border-radius"] = "50%";
  15375. exit.style["z-index"] = "3"
  15376. exit.onclick = ()=>{
  15377. $(div).remove()
  15378. if(g_bgAudio && g_bgAudio.pauseByHot){
  15379. manage.switchBgmState(true)
  15380. }
  15381. }
  15382. var myElement = document.createElement("iframe");
  15383. myElement.style.position = 'absolute';
  15384. myElement.style.width = myElement.style.height = "100%";
  15385. myElement.style.left = myElement.style.top = '0';
  15386. myElement.src = src
  15387. div.appendChild(exit);
  15388. div.appendChild(myElement)
  15389. if(g_bgAudio && !g_bgAudio.paused){
  15390. manage.switchBgmState(false);
  15391. g_bgAudio.pauseByHot = true
  15392. }
  15393. if(g_tourAudio)g_tourAudio.pause()
  15394. }
  15395. return;
  15396. }
  15397. if(settings.dontExamHot || this.actionType == 'dontExam'){
  15398. o();
  15399. return;
  15400. }
  15401. if(!player.currentPano)return;
  15402. var i = document.getElementById("popup");
  15403. if (this.link && !options.dontOpen) {
  15404. g_currentHot = this,
  15405. i.style.display = "block",
  15406. i.classList.add("wait");
  15407. var n = document.createElement("iframe");
  15408. if(g_bgAudio && !g_bgAudio.paused){
  15409. manage.switchBgmState(false);
  15410. g_bgAudio.pauseByHot = true
  15411. }
  15412. if(g_tourAudio)g_tourAudio.pause()
  15413. var src = getLink(this.link )
  15414. n.src = src;
  15415. n.id = "id1",
  15416. n.allowTransparency = "true";
  15417. var a = document.getElementById("id1");
  15418. if (void 0 === a || null == a) {
  15419. document.querySelector(".popup-content").appendChild(n);
  15420. var s = !1;
  15421. window.loaddingSuccess = function() {
  15422. s = !0
  15423. }
  15424. ,
  15425. setTimeout(function e() {
  15426. if (s) {
  15427. var t = document.querySelector("#id1").contentWindow.document;
  15428. t.querySelector("video") && (t.querySelector("video").play(),
  15429. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15430. t.querySelector("audio") && t.querySelector("audio").play()
  15431. } else
  15432. setTimeout(e, 300)
  15433. }, 800)
  15434. }
  15435. }
  15436. var l = e.mode
  15437. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15438. , h = this.mesh.position;
  15439. e.flyingToTag = !0;
  15440. var u = function() {
  15441. e.flyingToTag = !1;
  15442. options.dontOpen || this.link && i.classList.remove("wait")
  15443. }
  15444. .bind(this);
  15445. if (l === v.PANORAMA) {
  15446. var d = {
  15447. pano: c,
  15448. lookAtPoint: h,
  15449. duration: options.duration,
  15450. maxDistanceOverride: null,
  15451. skipWarpingCheck: !1,
  15452. aimDuration: options.aimDuration,
  15453. };
  15454. e.flyToPano(d, u)
  15455. } else {
  15456. var p = {
  15457. pano: c
  15458. };
  15459. if (h) {
  15460. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15461. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15462. }
  15463. p.callback = u,
  15464. p.duration = options.duration || 1500,
  15465. p.mode = v.PANORAMA,
  15466. p.aimDuration = options.aimDuration
  15467. e.flyToNewMode(p)
  15468. }
  15469. }
  15470. ,
  15471. n.prototype.dispose = function(){
  15472. this.mesh.parent.remove(this.mesh);
  15473. var index = g_HotMeshes.indexOf(this.mesh);
  15474. g_HotMeshes.splice(index,1)
  15475. }
  15476. /* n.prototype.conversionArray = function(e) {
  15477. if ("[object Array]" == Object.prototype.toString.call(e))
  15478. return e;
  15479. var t = [];
  15480. for (var i in e)
  15481. t.push(parseFloat(e[i]));
  15482. return t
  15483. } */
  15484. n.prototype.convertValue = function(v ,Type){
  15485. var value;
  15486. if(v instanceof Array){
  15487. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15488. value = new Type().fromArray(v);
  15489. }else{
  15490. for(let i in v){v[i] = parseFloat(v[i])}
  15491. value = new Type().copy(v);
  15492. }
  15493. return value
  15494. }
  15495. ,
  15496. t.exports = n
  15497. }
  15498. , {
  15499. three: 217,
  15500. "../shaders": 167,
  15501. "../enum/Viewmode": 51,
  15502. "../objects/Panorama": 148,
  15503. "../util/texture": 194,
  15504. "../settings": 166,
  15505. "../util/math": 190,
  15506. }],
  15507. 123: [function(M, R, e) {
  15508. (function(e) {
  15509. "use strict";
  15510. function d(e, t, i) {
  15511. var n = i.version || "0";
  15512. "0" !== n && w.info("tag defined using version " + n),
  15513. this.model = e,
  15514. this.sid = t,
  15515. this.color = (new f.Color).set(i.color || o.tagDefault),
  15516. this.hoverColor = o._darken(this.color, .2),
  15517. this.floor = null,
  15518. this.floorIndex = i.floor,
  15519. this.mode = m.PANORAMA,
  15520. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15521. this.obj3d = null,
  15522. this.disc = null,
  15523. this.materials = {
  15524. disc: null,
  15525. pole: null
  15526. },
  15527. this.position = (new f.Vector3).copy(i.position),
  15528. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15529. this.discWorldPosition = null,
  15530. this.discScale = .05,
  15531. this.poleEnabled = i.stem.enabled,
  15532. this.billboard = new r(i.label,i.description,i.media,this),
  15533. this.visibleTransition = null,
  15534. this.hoveringDisc = !1
  15535. }
  15536. 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"),
  15537. 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);
  15538. d.prototype = Object.create(b.prototype),
  15539. d.raycaster = new f.Raycaster,
  15540. d.prototype.bindEvents = function() {
  15541. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15542. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15543. }
  15544. ,
  15545. d.prototype.build = function() {
  15546. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15547. this.floor && (this.billboard.build(this.model.sid),
  15548. this.obj3d = this.buildObject3D(),
  15549. this.floor.add(this.obj3d)),
  15550. this
  15551. }
  15552. ,
  15553. d.prototype.buildObject3D = function() {
  15554. var e = new f.Object3D;
  15555. e.position.copy(this.position);
  15556. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15557. t.bg.value = x,
  15558. t.mask.value = T,
  15559. t.color.value.copy(this.color),
  15560. this.materials.disc = new f.RawShaderMaterial({
  15561. transparent: !0,
  15562. vertexShader: A.tagDisc.vertexShader,
  15563. fragmentShader: A.tagDisc.fragmentShader,
  15564. uniforms: t
  15565. }),
  15566. this.disc = new f.Mesh(S,this.materials.disc),
  15567. this.disc.layers.set(a.TAG),
  15568. this.disc.position.copy(this.discPosition),
  15569. this.disc.renderOrder = s.tagDisc;
  15570. var i = (this.disc.tag = this).buildPole();
  15571. return i.layers.set(a.TAG),
  15572. i.renderOrder = s.tagStem,
  15573. e.add(i),
  15574. e.layers.set(a.TAG),
  15575. e.add(this.disc)
  15576. }
  15577. ,
  15578. d.prototype.buildPole = function() {
  15579. var e = new f.BufferGeometry
  15580. , t = new Float32Array(6);
  15581. return t[0] = t[1] = t[2] = 0,
  15582. t[3] = this.discPosition.x,
  15583. t[4] = this.discPosition.y,
  15584. t[5] = this.discPosition.z,
  15585. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15586. this.materials.pole = new f.LineBasicMaterial({
  15587. linewidth: g.tags.pole.width,
  15588. color: g.tags.pole.color,
  15589. opacity: 0,
  15590. visible: this.poleEnabled,
  15591. transparent: !0,
  15592. depthWrite: !1
  15593. }),
  15594. new f.Line(e,this.materials.pole)
  15595. }
  15596. ,
  15597. d.prototype.setFreeState = function(e) {
  15598. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15599. this.materials.disc.uniforms.color.value = this.color
  15600. }
  15601. .bind(this))
  15602. }
  15603. ,
  15604. d.prototype.setHoverState = function(e) {
  15605. this.billboard.open(e),
  15606. this.materials.disc.uniforms.color.value = this.hoverColor
  15607. }
  15608. ,
  15609. d.prototype.hide = function(e, t) {
  15610. var i = $.Deferred();
  15611. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15612. return i.resolve().promise();
  15613. e = e || 0,
  15614. t = t || 0,
  15615. C.cancel(this.visibleTransition);
  15616. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15617. return this.visibleTransition = C.start((n = this,
  15618. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15619. o = I.property(n.materials.pole, "opacity", 0),
  15620. function(e) {
  15621. r(e),
  15622. n.materials.pole && o(e)
  15623. }
  15624. ), s * a, function() {
  15625. i.resolve()
  15626. }, l, E[g.warp.blendEasing]),
  15627. i.promise()
  15628. }
  15629. ,
  15630. d.prototype.show = function(e, t) {
  15631. var i = $.Deferred();
  15632. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15633. return i.resolve().promise();
  15634. e = e || 0,
  15635. t = t || 0,
  15636. C.cancel(this.visibleTransition);
  15637. 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;
  15638. return this.visibleTransition = C.start((n = this,
  15639. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15640. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15641. function(e) {
  15642. r(e),
  15643. n.materials.pole && o(e)
  15644. }
  15645. ), s * a, function() {
  15646. i.resolve()
  15647. }, l, E[g.warp.blendEasing]),
  15648. i.promise()
  15649. }
  15650. ,
  15651. d.prototype.closestPanoTowardTag = function(e, t) {
  15652. var i = []
  15653. , n = []
  15654. , r = this.disc.getWorldPosition();
  15655. if (e === m.PANORAMA) {
  15656. var o = t.position.clone().sub(r).normalize();
  15657. i.push(y.filters.isPanoAligned()),
  15658. i.push(y.filters.inPanoDirection(r, o, .5)),
  15659. i.push(y.filters.isNeighbourPanoTo(t)),
  15660. n.push(y.scoreFunctions.direction(r, o))
  15661. }
  15662. var a = new f.Vector3;
  15663. i.push(function(e) {
  15664. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15665. }, function(e) {
  15666. a.copy(r).sub(e.position);
  15667. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15668. , i = g.tags.navigate.tiltTolerance;
  15669. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15670. }),
  15671. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15672. var s = this.model.panos.sortByScore(i, n);
  15673. if (g.tags.navigate.lineOfSight) {
  15674. for (var l = 0; l < s.length; l++) {
  15675. var c = s[l].pano
  15676. , h = c.position.distanceTo(r);
  15677. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15678. return null;
  15679. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15680. var u = d.raycaster.intersectObjects(this.model.colliders);
  15681. if (0 === u.length || u[0].distance > h)
  15682. return c
  15683. }
  15684. return null
  15685. }
  15686. return 0 < s.length && s[0].pano
  15687. }
  15688. ,
  15689. d.prototype.examine = function(i) {
  15690. if(!player.currentPano)return;
  15691. var e = i.mode
  15692. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15693. , t = this.disc.getWorldPosition();
  15694. this.billboard.setActiveState();
  15695. var r = function() {
  15696. var e = this.billboard.getDimensions()
  15697. , t = new f.Vector3;
  15698. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15699. t.unproject(i.camera),
  15700. i.flyToPano({
  15701. pano: n,
  15702. lookAtPoint: t
  15703. })
  15704. }
  15705. .bind(this);
  15706. if (e === m.PANORAMA)
  15707. if (n !== i.currentPano) {
  15708. var o = {
  15709. pano: n,
  15710. lookAtPoint: t,
  15711. duration: null,
  15712. maxDistanceOverride: null,
  15713. skipWarpingCheck: !1
  15714. };
  15715. i.flyToPano(o, r)
  15716. } else
  15717. setTimeout(function() {
  15718. this.billboard.open().then(function() {
  15719. r()
  15720. })
  15721. }
  15722. .bind(this), 0);
  15723. else {
  15724. var a = {
  15725. pano: n
  15726. };
  15727. if (t) {
  15728. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15729. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15730. }
  15731. a.callback = r,
  15732. a.duration = 1500,
  15733. a.mode = m.PANORAMA,
  15734. i.flyToNewMode(a)
  15735. }
  15736. }
  15737. ,
  15738. d.prototype.update = (n = new f.Vector3,
  15739. function(e, t) {
  15740. this.discWorldPosition = this.disc.getWorldPosition(),
  15741. this.updateDisc(e, t),
  15742. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15743. n.z < 1 && (n.y *= -1,
  15744. this.billboard.update(n, this.getDiscRadius(n, t))))
  15745. }
  15746. ),
  15747. d.prototype.updateDisc = (l = new f.Vector3,
  15748. c = new f.Vector3,
  15749. h = new f.Vector3,
  15750. u = new f.Vector3,
  15751. p = new f.Vector3,
  15752. function(e, t) {
  15753. var i = g.tags.visibility
  15754. , n = g.tags.disc.scale
  15755. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15756. 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)),
  15757. this.obj3d.visible) {
  15758. this.disc.quaternion.copy(t.quaternion);
  15759. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15760. l.copy(this.discWorldPosition).project(t),
  15761. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15762. h.set(o / 2, 0, 0).add(c),
  15763. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15764. p.copy(u).unproject(t);
  15765. var a = p.distanceTo(this.discWorldPosition)
  15766. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15767. this.discScale = a * s,
  15768. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15769. }
  15770. }
  15771. ),
  15772. d.prototype.getDiscRadius = (i = new f.Vector3,
  15773. function(e, t) {
  15774. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15775. Math.abs(e.x - i.x) * $("#player").width()
  15776. }
  15777. ),
  15778. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15779. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15780. }
  15781. ,
  15782. d.prototype.offScreen = function(e, t) {
  15783. var i = e.getWorldPosition().project(t);
  15784. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15785. }
  15786. ,
  15787. d.viewportScale = function() {
  15788. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15789. d.viewportHeight = $("#player").height(),
  15790. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15791. d.currentViewportScale
  15792. }
  15793. ,
  15794. R.exports = d
  15795. }
  15796. ).call(this, "/js/tag/tag.js")
  15797. }
  15798. , {
  15799. "../enum/Colors": 19,
  15800. "../enum/RenderLayers": 41,
  15801. "../enum/RenderOrder": 42,
  15802. "../enum/Viewmode": 51,
  15803. "../objects/Panorama": 148,
  15804. "../settings": 166,
  15805. "../shaders": 167,
  15806. "../util/common": 185,
  15807. "../util/easing": 186,
  15808. "../util/lerp": 188,
  15809. "../util/logger": 189,
  15810. "../util/math": 190,
  15811. "../util/texture": 194,
  15812. "../util/transitions": 195,
  15813. "./Billboard/Billboard": 119,
  15814. "./Billboard/BillboardEvent": 120,
  15815. events: 202,
  15816. three: 217
  15817. }],
  15818. 124: [function(M, R, e) {
  15819. (function(e) {
  15820. "use strict";
  15821. function t() {
  15822. this.tagState = T.IDLE,
  15823. this.intersectTag = null,
  15824. this.hoveredTag = null,
  15825. this.activeTag = null,
  15826. this.tagDiscs = [],
  15827. this.raycaster = new i.Raycaster,
  15828. this.modelManager = null,
  15829. this.player = null,
  15830. this.totaltags = 0,
  15831. this.navigatingViaTag = !1,
  15832. this.enabled = !1
  15833. }
  15834. 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"),
  15835. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15836. r.extend(t, x),
  15837. t.prototype.init = function(e, t) {
  15838. this.modelManager = e,
  15839. this.player = t,
  15840. this.updateModel(),
  15841. this.bindEvents()
  15842. }
  15843. ,
  15844. t.prototype.update = function(e) {
  15845. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15846. }
  15847. ,
  15848. t.prototype.updateTags = function(e, t, i, n) {
  15849. for (var r in this.model.tags)
  15850. this.model.tags[r].update(e, t, i, n)
  15851. }
  15852. ,
  15853. t.prototype.updateModel = function() {
  15854. this.model = this.modelManager.getActiveModel(),
  15855. this.gettagsFromModel(),
  15856. this.totaltags = Object.keys(this.model.tags).length
  15857. }
  15858. ,
  15859. t.prototype.gettagsFromModel = function() {
  15860. for (var e in this.tagDiscs = [],
  15861. this.model.tags) {
  15862. var t = this.model.tags[e].disc;
  15863. t && this.tagDiscs.push(t)
  15864. }
  15865. }
  15866. ,
  15867. t.prototype.bindEvents = function() {
  15868. function e() {
  15869. Object.keys(this.model.tags).forEach(function(e) {
  15870. var t = this.model.tags[e];
  15871. t.bindEvents(),
  15872. t.billboard.on(y.LINK_CLICK, function(e) {
  15873. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15874. }
  15875. .bind(this)),
  15876. t.billboard.on(y.IMAGE_OPENED, function() {
  15877. this.tagState = T.EXAMINE,
  15878. this.emit(y.IMAGE_OPENED)
  15879. }
  15880. .bind(this)),
  15881. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15882. }
  15883. .bind(this))
  15884. }
  15885. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15886. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15887. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15888. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15889. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15890. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15891. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15892. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15893. e.call(this)
  15894. }
  15895. ,
  15896. t.prototype.navigateViaLink = function(e) {
  15897. var t = a.deserialize(e);
  15898. if (t)
  15899. if (t.mode === C.PANORAMA) {
  15900. try {
  15901. this.player.model.panos.get(t.panoId)
  15902. } catch (e) {
  15903. return void S.warn("Unable to find panorama location", t.panoId)
  15904. }
  15905. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15906. } else {
  15907. var i = {
  15908. cameraMode: t.mode,
  15909. position: t.position,
  15910. quaternion: t.quaternion,
  15911. scanId: t.panoId,
  15912. orthoZoom: t.zoom,
  15913. floorVisibility: t.floorVisibility,
  15914. thumbUrl: null,
  15915. name: null
  15916. };
  15917. this.player.flyToNewMode({
  15918. mode: t.mode,
  15919. duration: m.warp.outsideTime,
  15920. warpDest: new g(i),
  15921. force: !0
  15922. })
  15923. }
  15924. }
  15925. ,
  15926. t.prototype.handleWarpStart = function(e, t, i, n) {
  15927. this.dismissExaminedTag(),
  15928. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15929. e && (i = E.END),
  15930. this.hideShowTagsForBlackoutStyle(i, n))
  15931. }
  15932. ,
  15933. t.prototype.handleWarpInterruption = function(e, t, i) {
  15934. null != i || (i = m.warp.teleportTime),
  15935. this.hideShowTagsForBlackoutStyle(t, i)
  15936. }
  15937. ,
  15938. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15939. var i = 0
  15940. , n = 0
  15941. , r = t / 2;
  15942. switch (null != e || (e = E.MIDDLE),
  15943. e) {
  15944. case E.END:
  15945. this.hideAlltags(r);
  15946. break;
  15947. case E.BEGINNING:
  15948. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15949. break;
  15950. case E.NONE:
  15951. break;
  15952. case E.MIDDLE:
  15953. n = i = r,
  15954. this.hideAlltags(n),
  15955. setTimeout(function() {
  15956. this.showAlltags(i)
  15957. }
  15958. .bind(this), n);
  15959. break;
  15960. case E.FADEIN:
  15961. setTimeout(function() {
  15962. this.showAlltags(r)
  15963. }
  15964. .bind(this), r)
  15965. }
  15966. }
  15967. ,
  15968. t.prototype.onPlayerModeChanging = function(e, t) {
  15969. t !== C.PANORAMA && this.dismissExaminedTag(),
  15970. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15971. var i = t !== C.OUTDOOR;
  15972. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15973. }
  15974. ,
  15975. t.prototype.onPanoChange = function(e, t) {
  15976. var i = this.navigatingViaTag;
  15977. if (this.navigatingViaTag = !1,
  15978. !i) {
  15979. this.dismissExaminedTag();
  15980. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15981. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15982. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15983. }
  15984. }
  15985. ,
  15986. t.prototype.onPlayerReady = function(e, t, i) {
  15987. this.startAlltags(e, t ? i : null)
  15988. }
  15989. ,
  15990. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15991. this.updateClosestTags(e)
  15992. }
  15993. ,
  15994. t.prototype.dismissExaminedTag = function() {
  15995. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15996. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15997. this.hoveredTag = null)
  15998. }
  15999. ,
  16000. t.prototype.startAlltags = function(e, t) {
  16001. this.model.shouldShowtags = m.tags.enabled,
  16002. this.enabled = !0,
  16003. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  16004. t && setTimeout(function() {
  16005. this.activateTag(this.model.getTagBySid(t))
  16006. }
  16007. .bind(this), m.tags.startup.fadeInDuration / 2))
  16008. }
  16009. ,
  16010. t.prototype.showAlltags = function(e, t, i) {
  16011. function n() {
  16012. ++o === this.totaltags && (this.model.tagsShown = !0,
  16013. r.resolve())
  16014. }
  16015. var r = $.Deferred();
  16016. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16017. return r.resolve().promise();
  16018. var o = 0;
  16019. for (var a in this.model.tags) {
  16020. this.model.tags[a].show(e, t).done(n.bind(this))
  16021. }
  16022. return r.promise()
  16023. }
  16024. ,
  16025. t.prototype.hideAlltags = function(e, t) {
  16026. function i() {
  16027. ++r === this.totaltags && (this.model.tagsShown = !1,
  16028. n.resolve())
  16029. }
  16030. var n = $.Deferred()
  16031. , r = 0;
  16032. for (var o in this.model.tags) {
  16033. var a = this.model.tags[o];
  16034. a.hide(e, t).done(i.bind(this)),
  16035. a === this.activeTag && this.dismissActiveTag()
  16036. }
  16037. return n.promise()
  16038. }
  16039. ,
  16040. t.prototype.enableHovering = function() {
  16041. this.enabled = !0
  16042. }
  16043. ,
  16044. t.prototype.disableHovering = function() {
  16045. this.enabled = !1
  16046. }
  16047. ,
  16048. t.prototype.activateTag = function(e, t) {
  16049. t = t || T.EXAMINE,
  16050. this.activeTag = e,
  16051. this.activeTag.hoveringDisc = !0,
  16052. this.activeTag.setHoverState(t === T.EXAMINE),
  16053. this.tagState = t,
  16054. this.emit(b.TagActivated, e)
  16055. }
  16056. ,
  16057. t.prototype.dismissActiveTag = function() {
  16058. this.activeTag.hoveringDisc = !1,
  16059. this.activeTag.setFreeState(!0);
  16060. var e = this.activeTag;
  16061. this.activeTag = null,
  16062. this.tagState = T.IDLE,
  16063. this.emit(b.TagDismissed, e)
  16064. }
  16065. ,
  16066. t.prototype.clickedOnTag = function(e) {
  16067. var t = function() {
  16068. this.navigatingViaTag = !0,
  16069. this.activeTag.examine(this.player),
  16070. this.emit(b.TagNavigation, this.activeTag)
  16071. }
  16072. .bind(this);
  16073. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  16074. this.activeTag = this.intersectTag,
  16075. t(),
  16076. !0) : (this.dismissActiveTag(),
  16077. !1)
  16078. }
  16079. ,
  16080. t.prototype.intersecttag = (s = new i.Vector3,
  16081. l = new i.Vector3,
  16082. c = new i.Vector3,
  16083. function(e, t, i) {
  16084. if (!this.enabled)
  16085. return null;
  16086. var n = null
  16087. , r = this.tagDiscs.filter(function(e) {
  16088. return e.parent.visible
  16089. });
  16090. if (0 < r.length) {
  16091. var o = this.model.floors.reduce(function(e, t) {
  16092. return t.hidden ? e : e.concat(t.collider.children)
  16093. }, r);
  16094. s.set(e.x, e.y, -1).unproject(i),
  16095. l.set(e.x, e.y, 1).unproject(i),
  16096. c.copy(l).sub(s).normalize(),
  16097. this.raycaster.set(s, c);
  16098. var a = this.raycaster.intersectObjects(o);
  16099. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  16100. }
  16101. return this.intersectTag = n,
  16102. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  16103. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  16104. this.hoveredTag = n
  16105. }
  16106. .bind(this)),
  16107. n.billboard.on(v.LEAVE, function() {
  16108. this.hoveredTag = null
  16109. }
  16110. .bind(this))),
  16111. this.activateTag(n, T.BROWSE))),
  16112. n
  16113. }
  16114. ),
  16115. t.prototype.rankedtagInDirection = (h = [],
  16116. u = [],
  16117. d = new i.Vector3,
  16118. p = new i.Vector3,
  16119. f = new i.Vector3,
  16120. function(e, t, i, n) {
  16121. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  16122. var a = this.closesttags[o];
  16123. p.copy(a.position),
  16124. p.add(a.discPosition),
  16125. d.copy(t),
  16126. d.sub(p).negate(),
  16127. d.normalize();
  16128. var s = d.dot(n);
  16129. if (0 <= s && (f.copy(p),
  16130. f.project(i),
  16131. this.intersecttag(f, !1, i))) {
  16132. if (r >= h.length)
  16133. for (var l = 0; l < 64; l++)
  16134. h.push({
  16135. tag: a,
  16136. dot: s
  16137. });
  16138. var c = h[r];
  16139. c.tag = a,
  16140. c.dot = s,
  16141. c.position = math.projectPositionToCanvas(p, i),
  16142. u.push(c),
  16143. r++
  16144. }
  16145. }
  16146. return u.sort(function(e, t) {
  16147. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16148. }),
  16149. e < u.length ? u[e].tag : null
  16150. }
  16151. ),
  16152. t.prototype.updateClosestTags = (o = new i.Vector3,
  16153. function(e) {
  16154. this.closesttags || (this.closesttags = []),
  16155. this.closesttags.length = 0;
  16156. var t = this.model.tags;
  16157. if (t)
  16158. for (var i in t)
  16159. if (t.hasOwnProperty(i)) {
  16160. var n = t[i]
  16161. , r = n.position;
  16162. o.copy(e),
  16163. o.sub(r).negate(),
  16164. o.lengthSq() < 30 && this.closesttags.push(n)
  16165. }
  16166. }
  16167. ),
  16168. R.exports = t
  16169. }
  16170. ).call(this, "/js/tag/tagManager.js")
  16171. }
  16172. , {
  16173. "../controls/serializer": 14,
  16174. "../enum/BlackoutStyle": 18,
  16175. "../enum/tagEvents": 32,
  16176. "../enum/ModelManagerEvents": 33,
  16177. "../enum/PlayerEvents": 40,
  16178. "../enum/TagStates": 44,
  16179. "../enum/Viewmode": 51,
  16180. "../enum/WarpStyle": 52,
  16181. "../objects/Snapshot": 153,
  16182. "../settings": 166,
  16183. "../util/common": 185,
  16184. "../util/lerp": 188,
  16185. "../util/logger": 189,
  16186. "./Billboard/BillboardEvent": 120,
  16187. "./Media/LinkType": 130,
  16188. "./Media/MediaEvent": 131,
  16189. events: 202,
  16190. three: 217
  16191. }],
  16192. 125: [function(r, o, e) {
  16193. (function(e) {
  16194. "use strict";
  16195. function t() {
  16196. this.embedWrapper = null,
  16197. this.embedElement = null
  16198. }
  16199. var i = r("../../util/ajax")
  16200. , a = r("./mediaSettings")
  16201. , n = r("../../settings")
  16202. , s = new (r("../../util/logger"))(e);
  16203. t.prototype.createDomElement = function() {
  16204. return this.embedWrapper = document.createElement("div"),
  16205. this.embedWrapper.classList.add("tag-embed"),
  16206. this.embedWrapper.classList.add("hidden"),
  16207. this.embedWrapper
  16208. }
  16209. ,
  16210. t.prototype.load = function(e) {
  16211. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  16212. return new Promise(function(r, o) {
  16213. i.get(t).then(function(e) {
  16214. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  16215. this.embedWrapper.innerHTML = e.html;
  16216. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  16217. if (this.embedWrapper.style.width = t + "px",
  16218. e.height) {
  16219. var i = e.height / e.width;
  16220. this.embedWrapper.style.height = t * i + "px"
  16221. }
  16222. this.embedElement = this.embedWrapper.firstChild;
  16223. var n = [];
  16224. try {
  16225. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  16226. } catch (e) {
  16227. s.debug("Error getting `a` elements for embed; was it an iframe?")
  16228. }
  16229. n.forEach(function(e) {
  16230. e.setAttribute("target", "_blank")
  16231. }),
  16232. this.embedElement.classList.add("hidden"),
  16233. this.embedWrapper.classList.remove("hidden"),
  16234. r()
  16235. } else
  16236. o("Not a valid embed")
  16237. }
  16238. .bind(this), function(e) {
  16239. o(e.response)
  16240. })
  16241. }
  16242. .bind(this))
  16243. }
  16244. ,
  16245. t.prototype.show = function() {
  16246. this.embedElement && this.embedElement.classList.remove("hidden")
  16247. }
  16248. ,
  16249. t.prototype.hide = function() {
  16250. this.embedElement && this.embedElement.classList.add("hidden")
  16251. }
  16252. ,
  16253. o.exports = t
  16254. }
  16255. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16256. }
  16257. , {
  16258. "../../settings": 166,
  16259. "../../util/ajax": 181,
  16260. "../../util/logger": 189,
  16261. "./mediaSettings": 132
  16262. }],
  16263. 126: [function(a, s, e) {
  16264. (function(e) {
  16265. "use strict";
  16266. function t(e) {
  16267. r.call(this),
  16268. this.options = e,
  16269. this.playerControls = null,
  16270. this.state = o.NOT_READY
  16271. }
  16272. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16273. Object.freeze({
  16274. NOT_READY: "player.not.ready",
  16275. CUED: "player.cued",
  16276. PLAYING: "player.playing",
  16277. PAUSED: "player.paused"
  16278. }));
  16279. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16280. return this.embedWrapper = document.createElement("div"),
  16281. this.embedWrapper.classList.add("tag-video"),
  16282. this.embedWrapper.classList.add("hidden"),
  16283. this.embedWrapper
  16284. }
  16285. ,
  16286. t.prototype.load = function(e) {
  16287. var t = function() {
  16288. function e(e) {
  16289. this.playerState = e
  16290. }
  16291. this.playerControls = new playerjs.Player(this.embedElement),
  16292. this.playerControls.on("ready", function(e) {
  16293. this.playerState = o.CUED,
  16294. this.options.startMuted && this.playerControls.mute()
  16295. }
  16296. .bind(this)),
  16297. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16298. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16299. this.playerControls.on("ended", function(e) {
  16300. this.playerControls.setCurrentTime(0),
  16301. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16302. }
  16303. .bind(this))
  16304. }
  16305. .bind(this);
  16306. return r.prototype.load.call(this, e).then(t.bind(this))
  16307. }
  16308. ,
  16309. t.prototype.play = (i = n.isMobile(),
  16310. function() {
  16311. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16312. }
  16313. ),
  16314. t.prototype.pause = function() {
  16315. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16316. }
  16317. ,
  16318. s.exports = t
  16319. }
  16320. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16321. }
  16322. , {
  16323. "../../util/browser": 182,
  16324. "../../util/logger": 189,
  16325. "./EmbedlyEmbed": 125
  16326. }],
  16327. 127: [function(t, i, e) {
  16328. (function(e) {
  16329. "use strict";
  16330. var r = t("../../util/ajax")
  16331. , o = new (t("./mediaSettings"),
  16332. t("../../util/logger"))(e)
  16333. , a = Promise.resolve();
  16334. i.exports.enqueue = function(i) {
  16335. function n() {}
  16336. return a = new Promise(function(e, t) {
  16337. a.catch(n).then(function() {
  16338. (o.debug("requesting file from embedly:", i.href),
  16339. r.get(i.href, {
  16340. responseType: i.responseType
  16341. }).then(function(e) {
  16342. return o.debug("requesting file finished:", i.href),
  16343. e
  16344. })).then(e, t)
  16345. })
  16346. }
  16347. )
  16348. }
  16349. }
  16350. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16351. }
  16352. , {
  16353. "../../util/ajax": 181,
  16354. "../../util/logger": 189,
  16355. "./mediaSettings": 132
  16356. }],
  16357. 128: [function(s, l, e) {
  16358. (function(e) {
  16359. "use strict";
  16360. function t() {
  16361. this.imageWrapper = null,
  16362. this.width = 0,
  16363. this.height = 0,
  16364. this.aspect = 1
  16365. }
  16366. var i = s("./MediaEvent")
  16367. , n = s("./EmbedlyQueue")
  16368. , r = s("events").EventEmitter
  16369. , o = s("../../util/logger")
  16370. , a = s("../../settings");
  16371. new o(e),
  16372. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16373. return this.imageWrapper = document.createElement("div"),
  16374. this.imageWrapper.classList.add("tag-image"),
  16375. this.imageWrapper.classList.add("hidden"),
  16376. this.imageWrapper.addEventListener("click", function(e) {
  16377. e.stopPropagation(),
  16378. this.emit(i.IMAGE_OPENING),
  16379. this.imageWrapper.style.pointerEvents = "none"
  16380. }
  16381. .bind(this)),
  16382. this.imageWrapper
  16383. }
  16384. ,
  16385. t.prototype.onClosed = function() {
  16386. this.imageWrapper.style.pointerEvents = "auto"
  16387. }
  16388. ,
  16389. t.prototype.load = function(e) {
  16390. var t = Math.max(window.screen.height, window.screen.width)
  16391. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16392. return new Promise(function(o, e) {
  16393. n.enqueue({
  16394. href: i,
  16395. responseType: "arraybuffer"
  16396. }).then(function(e) {
  16397. var t = new Uint8Array(e)
  16398. , i = new Blob([t])
  16399. , n = new window.Image;
  16400. n.addEventListener("load", function(e) {
  16401. var t = e.target;
  16402. this.width = t.naturalWidth,
  16403. this.height = t.naturalHeight,
  16404. this.aspect = this.width / this.height;
  16405. var i = e.target.src;
  16406. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16407. this.imageWrapper.style.width = this.width + "px",
  16408. this.imageWrapper.style.height = this.height + "px",
  16409. this.imageWrapper.classList.remove("hidden"),
  16410. o()
  16411. }
  16412. .bind(this));
  16413. var r = URL.createObjectURL(i);
  16414. n.src = r
  16415. }
  16416. .bind(this), e)
  16417. }
  16418. .bind(this))
  16419. }
  16420. ,
  16421. l.exports = t
  16422. }
  16423. ).call(this, "/js/tag/Media/Image.js")
  16424. }
  16425. , {
  16426. "../../settings": 166,
  16427. "../../util/logger": 189,
  16428. "./EmbedlyQueue": 127,
  16429. "./MediaEvent": 131,
  16430. events: 202
  16431. }],
  16432. 129: [function(e, t, i) {
  16433. "use strict";
  16434. function n(e) {
  16435. this.label = e.label,
  16436. this.href = e.url,
  16437. this.type = this.updateLinkForType(),
  16438. this.domElement = null,
  16439. this.id = c++
  16440. }
  16441. var r = e("./LinkType")
  16442. , o = e("./MediaEvent")
  16443. , a = e("../../util/browser")
  16444. , s = e("../../analytics")
  16445. , l = e("events").EventEmitter
  16446. , c = 0;
  16447. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16448. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16449. 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,
  16450. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16451. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16452. r.MODEL) : r.EXT_LINK
  16453. }
  16454. ;
  16455. var h = {};
  16456. n.prototype.createDomElement = function() {
  16457. if (this.domElement = document.createElement("a"),
  16458. this.domElement.classList.add("tag-link"),
  16459. this.domElement.textContent = this.label,
  16460. this.type === r.EXT_LINK) {
  16461. this.domElement.textContent += " ";
  16462. var e = document.createElement("i");
  16463. e.classList.add("icon-ext-link"),
  16464. e.title = "Link to external web site",
  16465. this.domElement.appendChild(e)
  16466. }
  16467. return this.domElement.addEventListener("click", function(e) {
  16468. switch (e.stopPropagation(),
  16469. h[this.id] = !0,
  16470. s.trackAlways("click_tag_link", {
  16471. link_type: this.type,
  16472. link_count: c,
  16473. links_clicked: Object.keys(h).length
  16474. }),
  16475. this.type) {
  16476. case r.MODEL:
  16477. window.location.replace(this.href);
  16478. break;
  16479. case r.EXT_LINK:
  16480. window.open(this.href, "_blank")
  16481. }
  16482. this.emit(o.LINK_CLICK, {
  16483. type: this.type,
  16484. url: this.href
  16485. })
  16486. }
  16487. .bind(this)),
  16488. this.domElement
  16489. }
  16490. ,
  16491. t.exports = n
  16492. }
  16493. , {
  16494. "../../analytics": 4,
  16495. "../../util/browser": 182,
  16496. "./LinkType": 130,
  16497. "./MediaEvent": 131,
  16498. events: 202
  16499. }],
  16500. 130: [function(e, t, i) {
  16501. "use strict";
  16502. t.exports = {
  16503. NAVIGATION: "navigation",
  16504. MODEL: "model",
  16505. EXT_LINK: "ext-link"
  16506. }
  16507. }
  16508. , {}],
  16509. 131: [function(e, t, i) {
  16510. "use strict";
  16511. t.exports = Object.freeze({
  16512. LINK_CLICK: "mtmedia.link",
  16513. IMAGE_LOADED: "mtmedia.image.loaded",
  16514. IMAGE_OPENING: "mtmedia.image.opening",
  16515. IMAGE_OPENED: "mtmedia.image.opened",
  16516. IMAGE_CLOSING: "mtmedia.image.closing",
  16517. IMAGE_CLOSED: "mtmedia.image.closed",
  16518. VIDEO_START: "mtmedia.video.start",
  16519. VIDEO_PAUSE: "mtmedia.video.pause",
  16520. VIDEO_ENDED: "mtmedia.video.end"
  16521. })
  16522. }
  16523. , {}],
  16524. 132: [function(e, t, i) {
  16525. "use strict";
  16526. t.exports = Object.freeze({
  16527. maxEmbedWidth: 350,
  16528. defaultAspectRatio: .75
  16529. })
  16530. }
  16531. , {}],
  16532. 133: [function(e, t, i) {
  16533. "use strict";
  16534. t.exports = Object.freeze({
  16535. TEXT: "text",
  16536. LINK: "link",
  16537. IMAGE: "photo",
  16538. VIDEO: "video",
  16539. RICH: "rich"
  16540. })
  16541. }
  16542. , {}],
  16543. 134: [function(e, t, i) {
  16544. "use strict";
  16545. function n(e) {
  16546. this.capabilities = {
  16547. links: {
  16548. enable: e.supportLinks,
  16549. keepLabels: e.keepLinkLabels
  16550. }
  16551. }
  16552. }
  16553. var r = e("./DescriptionChunkType");
  16554. n.prototype.parse = function(e, i) {
  16555. var n = [];
  16556. return e.split("[").map(function(e, t) {
  16557. return 0 === t ? e : "[" + e
  16558. }).forEach(function(e) {
  16559. var t = this.findMarkdown(e);
  16560. if (t) {
  16561. if (-1 !== t.url.indexOf("javascript:"))
  16562. return;
  16563. this.addLinkChunk(n, t, i),
  16564. this.addTextChunk(n, e.slice(t.markdown.length))
  16565. } else
  16566. this.addTextChunk(n, e)
  16567. }
  16568. .bind(this)),
  16569. n
  16570. }
  16571. ,
  16572. n.prototype.findMarkdown = function(e) {
  16573. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16574. if (t) {
  16575. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16576. 0 !== n); )
  16577. r++;
  16578. var o = i.length - r;
  16579. return {
  16580. markdown: t[0].substring(0, t[0].length - o),
  16581. label: t[1],
  16582. url: t[2].substring(0, r)
  16583. }
  16584. }
  16585. }
  16586. ,
  16587. n.prototype.addTextChunk = function(e, t) {
  16588. 0 !== t.length && e.push({
  16589. type: r.TEXT,
  16590. text: t
  16591. })
  16592. }
  16593. ,
  16594. n.prototype.addLinkChunk = function(e, t) {
  16595. if (this.capabilities.links.enable) {
  16596. var i = {
  16597. label: t.label,
  16598. url: t.url
  16599. };
  16600. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16601. e.push({
  16602. type: r.LINK,
  16603. link: i
  16604. })
  16605. } else
  16606. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16607. }
  16608. ,
  16609. t.exports = n
  16610. }
  16611. , {
  16612. "./DescriptionChunkType": 133
  16613. }],
  16614. 135: [function(t, r, e) {
  16615. (function(e) {
  16616. "use strict";
  16617. var i = new (t("../util/logger"))(e)
  16618. , n = {
  16619. parseIdsFromChunkName: function(e, t) {
  16620. t.floorId = n.parseFloor(e),
  16621. t.roomId = n.parseRoom(e)
  16622. },
  16623. parseFloor: function(e) {
  16624. var t = e.match(/_group([0-9]+)/);
  16625. if (!t)
  16626. return 0;
  16627. try {
  16628. return parseInt(t[1], 10)
  16629. } catch (e) {
  16630. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16631. 0
  16632. }
  16633. },
  16634. parseRoom: function(e) {
  16635. var t = e.match(/_sub([0-9]+)/);
  16636. if (!t)
  16637. return -1;
  16638. try {
  16639. return parseInt(t[1], 10)
  16640. } catch (e) {
  16641. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16642. 0
  16643. }
  16644. }
  16645. };
  16646. r.exports = n
  16647. }
  16648. ).call(this, "/js/model/Chunks.js")
  16649. }
  16650. , {
  16651. "../util/logger": 189
  16652. }],
  16653. 136: [function(a, c, e) {
  16654. (function(e) {
  16655. "use strict";
  16656. function t(e) {
  16657. r.call(this),
  16658. this.model = e,
  16659. this.exploded = !1
  16660. }
  16661. var i = a("../objects/Floor")
  16662. , n = (a("../settings"),
  16663. a("../util/logger"))
  16664. , s = a("../util/transitions")
  16665. , r = a("../util/IndexedCollection")
  16666. , o = a("../util/common")
  16667. , l = a("../util/easing");
  16668. new n(e),
  16669. o.inherit(t, r),
  16670. t.prototype.add = function(e) {
  16671. r.prototype.add.call(this, e),
  16672. this.model.add(e)
  16673. }
  16674. ,
  16675. t.prototype.getIndex = function(e) {
  16676. return e.floorIndex
  16677. }
  16678. ,
  16679. t.prototype.build = function() {
  16680. this.list.forEach(function(e) {
  16681. e.build()
  16682. })
  16683. }
  16684. ,
  16685. t.prototype.size = function() {
  16686. return this.length
  16687. }
  16688. ,
  16689. t.prototype.sort = function() {
  16690. r.prototype.sort.call(this, function(e, t) {
  16691. return e.floorIndex - t.floorIndex
  16692. })
  16693. }
  16694. ,
  16695. t.prototype.nextFloor = function(e, t) {
  16696. return this.index[e.floorIndex + t] || null
  16697. }
  16698. ,
  16699. t.prototype.getFloorAtPoint = function(e) {
  16700. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16701. var r = this.list[n]
  16702. , o = r.distanceToPoint(e);
  16703. (!t || o < i) && (i = o,
  16704. t = r)
  16705. }
  16706. return t
  16707. }
  16708. ,
  16709. t.prototype.getOrMakeFloor = function(e) {
  16710. var t = this.index[e];
  16711. return t || (t = new i(this.model,e),
  16712. this.add(t)),
  16713. t
  16714. }
  16715. ,
  16716. t.prototype.hide = function() {
  16717. this.list.forEach(function(e) {
  16718. e.hide()
  16719. })
  16720. }
  16721. ,
  16722. t.prototype.show = function() {
  16723. this.list.forEach(function(e) {
  16724. e.show()
  16725. })
  16726. }
  16727. ,
  16728. t.prototype.names = function() {
  16729. return this.list.reduce(function(e, t) {
  16730. return e.concat(t.name)
  16731. }, [])
  16732. }
  16733. ,
  16734. t.prototype.toggleExplodeHorizontal = function() {
  16735. function i(e, t) {
  16736. a.copy(e.position),
  16737. e.position.x = r[e.floorIndex] * t,
  16738. e.position.y = 1 * e.floorIndex * t,
  16739. a.sub(e.position).multiplyScalar(-1),
  16740. e.panos.forEach(function(e) {
  16741. e.translate(a)
  16742. })
  16743. }
  16744. var n, r = [], o = 0;
  16745. this.list.forEach(function(e, t, i) {
  16746. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16747. o += n,
  16748. r[t] = o
  16749. }),
  16750. r = r.map(function(e) {
  16751. return e - o / 2
  16752. });
  16753. var a = this.list[0].position.clone();
  16754. this.exploded ? this.list.forEach(function(t) {
  16755. s.start(function(e) {
  16756. i(t, 1 - e)
  16757. }, 1500, null, 0, l.easeOutExpo)
  16758. }) : this.list.forEach(function(t) {
  16759. s.start(function(e) {
  16760. i(t, e)
  16761. }, 1500, null, 0, l.easeOutExpo)
  16762. }),
  16763. this.exploded = !this.exploded
  16764. }
  16765. ,
  16766. t.prototype.toggleExplodeVertical = function() {
  16767. function i(e, t) {
  16768. var i = i.copy(e.position);
  16769. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16770. i.sub(e.position).multiplyScalar(-1),
  16771. e.panos.forEach(function(e) {
  16772. e.translate(i)
  16773. })
  16774. }
  16775. var n = this.model.size;
  16776. this.list[0].position.clone(),
  16777. this.exploded ? this.list.forEach(function(t) {
  16778. s.start(function(e) {
  16779. i(t, 1 - e)
  16780. }, 1500, null, 0, l.easeOutExpo)
  16781. }) : this.list.forEach(function(t) {
  16782. s.start(function(e) {
  16783. i(t, e)
  16784. }, 1500, null, 0, l.easeOutExpo)
  16785. }),
  16786. this.exploded = !this.exploded
  16787. }
  16788. ,
  16789. c.exports = t
  16790. }
  16791. ).call(this, "/js/model/FloorCollection.js")
  16792. }
  16793. , {
  16794. "../objects/Floor": 146,
  16795. "../settings": 166,
  16796. "../util/IndexedCollection": 175,
  16797. "../util/common": 185,
  16798. "../util/easing": 186,
  16799. "../util/logger": 189,
  16800. "../util/transitions": 195
  16801. }],
  16802. 137: [function(r, o, e) {
  16803. (function(e) {
  16804. "use strict";
  16805. function h() {
  16806. n.call(this)
  16807. }
  16808. var u = r("../settings")
  16809. , t = r("../util/logger")
  16810. , d = r("../enum/Viewmode")
  16811. , p = r("../objects/Snapshot")
  16812. , i = (r("../util/math"),
  16813. r("../util/common"))
  16814. , n = r("../util/IndexedCollection")
  16815. , l = new t(e);
  16816. i.inherit(h, n),
  16817. h.prototype.getImage = function(e) {
  16818. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16819. }
  16820. ,
  16821. h.prototype.filterByModesAndReel = function(e, t) {
  16822. for (var i = [], n = 0; n < t.length; n += 1) {
  16823. var r = t[n]
  16824. , o = this.index[r.sid];
  16825. o && i.push(o)
  16826. }
  16827. var a = e[d.DOLLHOUSE]
  16828. , s = e[d.FLOORPLAN];
  16829. (i = i.filter(function(e) {
  16830. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16831. return !0;
  16832. var t;
  16833. try {
  16834. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16835. } catch (e) {
  16836. return l.debug(e.message),
  16837. !1
  16838. }
  16839. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16840. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16841. this.list = i,
  16842. this.reIndex()
  16843. }
  16844. ,
  16845. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16846. if (0 === this.list.length)
  16847. return [];
  16848. var locations = [];
  16849. var deal = (n, container)=>{
  16850. var r = n.thumbnail_signed_src,
  16851. o = n.name || "";
  16852. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16853. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16854. var a = panos.get(n.metadata.scan_id);
  16855. if (a && !a.isAligned()) return
  16856. }
  16857. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16858. if (s === d.MESH) return
  16859. if(window.isLocal)var src = manage.dealURL(r)
  16860. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16861. var l = {
  16862. cameraMode: s,
  16863. position: n.metadata.camera_position,
  16864. quaternion: n.metadata.camera_quaternion,
  16865. zoom: n.metadata.zoom,
  16866. panoId: n.metadata.scan_id,
  16867. orthoZoom: n.metadata.ortho_zoom,
  16868. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16869. thumbUrl: src,
  16870. name: h.filterImageName(o),
  16871. sid: n.sid
  16872. }
  16873. var item = new p(l);
  16874. item.momentTour = n.momentTour
  16875. container.push(item)
  16876. return item
  16877. }
  16878. }
  16879. this.list.forEach(image=>{
  16880. if(image.images){
  16881. var folder = $.extend({}, image )
  16882. folder.heroLocations = [];
  16883. image.images.list.forEach(child=>{
  16884. deal(child, folder.heroLocations);
  16885. })
  16886. folder.musicInfo = folder.musicInfo || {}
  16887. locations.push(folder)
  16888. delete folder.images;
  16889. delete folder.locations;
  16890. }else{
  16891. var item = deal(image, locations);
  16892. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16893. }
  16894. })
  16895. return locations
  16896. }
  16897. ,
  16898. h.prototype.getIndex = function(e) {
  16899. return e.sid
  16900. }
  16901. ,
  16902. h.filterImageName = function(e) {
  16903. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16904. }
  16905. ,
  16906. o.exports = h
  16907. }
  16908. ).call(this, "/js/model/ImageCollection.js")
  16909. }
  16910. , {
  16911. "../enum/Viewmode": 51,
  16912. "../objects/Snapshot": 153,
  16913. "../settings": 166,
  16914. "../util/IndexedCollection": 175,
  16915. "../util/common": 185,
  16916. "../util/logger": 189,
  16917. "../util/math": 190
  16918. }],
  16919. 138: [function(h, u, e) {
  16920. (function(e) {
  16921. "use strict";
  16922. function n() {
  16923. c.call(this)
  16924. }
  16925. var r = h("../label/Label")
  16926. , i = h("../settings")
  16927. , t = h("../util/logger")
  16928. , o = h("../util/math")
  16929. , a = h("../util/ajax")
  16930. , s = h("./RoomCollection")
  16931. , l = h("../util/common")
  16932. , c = h("../util/IndexedCollection");
  16933. new t(e),
  16934. l.inherit(n, c),
  16935. n.prototype.getIndex = function(e) {
  16936. return e.labelId
  16937. }
  16938. ,
  16939. n.prototype.associateWithRooms = function(e) {
  16940. this.forEach(function(t) {
  16941. e.forEach(function(e) {
  16942. e.roomId === t.roomId && (t.room = e)
  16943. })
  16944. })
  16945. }
  16946. ,
  16947. n.prototype.createFromLabelData = function(e) {
  16948. e.forEach(function(e) {
  16949. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16950. t = s.generateRoomId(e.floorId, t);
  16951. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16952. i.position = o.convertWorkshopVector(i.position),
  16953. this.add(i),
  16954. i.build()
  16955. }
  16956. .bind(this))
  16957. }
  16958. ,
  16959. n.prototype.load = function(e, t) {
  16960. return a.get(e, {
  16961. responseType: "json",
  16962. auth: t ? i.authorizationHeader : null
  16963. }).done(function(e) {
  16964. var t = [];
  16965. for (var i in e) {
  16966. var n = e[i];
  16967. t.push(n)
  16968. }
  16969. this.createFromLabelData(t)
  16970. }
  16971. .bind(this))
  16972. }
  16973. ,
  16974. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16975. var t = -1;
  16976. if (e) {
  16977. if(typeof e == 'number'){
  16978. t = parseInt(e)
  16979. }else{
  16980. var i = e.split("_");
  16981. t = parseInt(i[0])
  16982. }
  16983. }
  16984. return t
  16985. }
  16986. ,
  16987. u.exports = n
  16988. }
  16989. ).call(this, "/js/model/LabelCollection.js")
  16990. }
  16991. , {
  16992. "../label/Label": 90,
  16993. "../settings": 166,
  16994. "../util/IndexedCollection": 175,
  16995. "../util/ajax": 181,
  16996. "../util/common": 185,
  16997. "../util/logger": 189,
  16998. "../util/math": 190,
  16999. "./RoomCollection": 141
  17000. }],
  17001. 139: [function(P, O, e) {
  17002. (function(e) {
  17003. "use strict";
  17004. function t(e, t) {
  17005. o.Object3D.call(this),
  17006. this.sid = window.number;//t.sid,
  17007. this.data = t,
  17008. this.options = e,
  17009. this.urls = new i(e.urlFiles),
  17010. this.isPublic = void 0 !== t.is_public && t.is_public,
  17011. //创建heroLocations
  17012. this.images = new E(this),
  17013. this.images.extend(t.images),
  17014. this.images.forEach((info)=>{
  17015. if(info.locations){
  17016. info.images = new E(this);
  17017. info.images.extend(info.locations)
  17018. }
  17019. })
  17020. this.heroLocations = []
  17021. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17022. this.outdoorPanoLocations = [],
  17023. this.floors = new c(this),
  17024. this.floorsEnabled = void 0 === e.floors || e.floors,
  17025. this.changingFloor = !1,
  17026. this.chunks = [],
  17027. this.panos = new g,
  17028. this.colliders = [],
  17029. this.loadPanosPromise = null,
  17030. this.loadMeshTexturesPromise = null,
  17031. this.auxDataPromise = null,
  17032. this.meshTexturesLoaded = !1,
  17033. this.meshTextures = [],
  17034. this.tags = {},
  17035. this.tagsShown = !1,
  17036. this.shouldShowtags = !1,
  17037. this.has360Views = !1,
  17038. this.showingLabels = u.labels.enabled && t.player_options.labels,
  17039. this.supportedModes = {},
  17040. this.supportedModes[s.PANORAMA] = !0,
  17041. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  17042. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  17043. this.supportedModes[s.TRANSITIONING] = !0,
  17044. this.supportsTiles = this.configureTiling(),
  17045. this.supportsVR = window.DATA.supportsVR || false//!0,
  17046. this.mode = s.DOLLHOUSE,
  17047. this.size = null,
  17048. this.center = null,
  17049. this.boundingBox = new o.Box3,
  17050. this.currentFloor = null,
  17051. this.allFloorsVisible = !0,
  17052. this.projectedPano0 = null,
  17053. this.projectedPano1 = null,
  17054. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  17055. this.addFloor(new r(this,t,e.trim()))
  17056. }
  17057. .bind(this)),
  17058. this.waitQueue = [],
  17059. this.on("load", function(e) {
  17060. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17061. return !e.isLoadedCallback()
  17062. }),
  17063. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17064. }
  17065. .bind(this)),
  17066. this.setupCustomProperties(),
  17067. this.hots = {}
  17068. }
  17069. var o = P("three")
  17070. , a = P("../util/ajax")
  17071. , i = P("../util/ModelUrls")
  17072. , n = P("../objects/BoundingTextureSkybox")
  17073. , s = P("../enum/Viewmode")
  17074. , l = P("../enum/RenderOrder")
  17075. , r = (P("../enum/AlignmentType"),
  17076. P("../objects/Floor"))
  17077. , c = P("./FloorCollection")
  17078. , h = P("../objects/Chunk")
  17079. , u = (P("../objects/Room"),
  17080. P("../objects/Snapshot"),
  17081. P("../label/Label"),
  17082. P("../util/math"),
  17083. P("../settings"))
  17084. , d = P("../shaders")
  17085. , p = P("../util/logger")
  17086. , f = (P("../tag/tag"),
  17087. P("../tag/tagManager"),
  17088. P("../objects/Panorama"))
  17089. , g = P("../util/PanoramaCollection")
  17090. , m = P("../loaders/ModelLoader")
  17091. , v = P("../loaders/ModelTextureLoader")
  17092. , y = P("../loaders/SweepDataLoader")
  17093. , A = P("../util/transitions")
  17094. , C = (P("../util/easing"),
  17095. P("../util/lerp"),
  17096. P("../util/common"))
  17097. , I = (P("../util/texture"),
  17098. P("./../util/browser"))
  17099. , E = P("./ImageCollection")
  17100. , _ = P("./RoomCollection")
  17101. , b = P("./LabelCollection")
  17102. , w = P("./Chunks")
  17103. , T = P("./../util/showcase")
  17104. , x = P("../exception/BasicException")
  17105. , S = (P("../constants"),
  17106. P("events").EventEmitter)
  17107. , M = P("hot")
  17108. , R = new p(e);
  17109. t.prototype = Object.create(o.Object3D.prototype),
  17110. C.extend(t, S),
  17111. t.prototype.setupCustomProperties = function() {
  17112. var t = u.modelAlpha;
  17113. Object.defineProperty(this, "alpha", {
  17114. get: function() {
  17115. return t
  17116. },
  17117. set: function(e) {
  17118. t = e,
  17119. this.chunks.forEach(function(e) {
  17120. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  17121. })
  17122. }
  17123. })
  17124. }
  17125. ,
  17126. t.prototype.configureTiling = function() {
  17127. var e = function() {
  17128. try {
  17129. var e = document.createElement("canvas")
  17130. , t = e.getContext("webgl");
  17131. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17132. } catch (e) {
  17133. return 0
  17134. }
  17135. }();
  17136. if (e < 2048)
  17137. return !1;
  17138. R.warn("Max cube texture size: " + e);
  17139. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  17140. var i = u.tiling.tilingFlagNames[t];
  17141. if ("1" === I.valueFromHash(i, null))
  17142. return !0;
  17143. if ("0" === I.valueFromHash(i, null))
  17144. return !1
  17145. }
  17146. return !!T.modelDataPromisesTiles(this.data)
  17147. }
  17148. ,
  17149. t.prototype.toggleAlpha = function() {
  17150. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17151. }
  17152. ,
  17153. t.prototype.load = function(e) {
  17154. var t = this.urls.init().then(function() {
  17155. return $.when(this.loadPanos(), this.loadMesh())
  17156. }
  17157. .bind(this));
  17158. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  17159. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  17160. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  17161. }
  17162. ,
  17163. t.prototype.loadMesh = function() {
  17164. var n = $.Deferred()
  17165. , r = this;
  17166. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  17167. if (0 === e.length) {
  17168. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17169. r.supportedModes[s.DOLLHOUSE] = !1,
  17170. r.supportedModes[s.FLOORPLAN] = !1;
  17171. var i = new h({
  17172. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17173. });
  17174. i.material.visible = !1,
  17175. i.rotateX(-Math.PI / 2),
  17176. i.geometry.computeBoundingBox(),
  17177. e = [i]
  17178. }
  17179. e.forEach(function(e) {
  17180. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  17181. r.addChunk(t, e)
  17182. }),
  17183. r.floors.sort(),
  17184. n.resolve(r)
  17185. }, function(e, t) {
  17186. n.notify(e, t)
  17187. }, function(e) {
  17188. R.error(e),
  17189. n.reject("loading-failed")
  17190. }),
  17191. n.promise()
  17192. }
  17193. ,
  17194. t.prototype.loadMeshTextures = function() {
  17195. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  17196. this.meshTexturesLoaded = !0
  17197. }
  17198. .bind(this))),
  17199. this.loadTexturesPromise
  17200. }
  17201. /* t.prototype.shineHots = function() {
  17202. A.trigger({
  17203. func: function(e) {
  17204. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17205. for(var i in this.hots){
  17206. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17207. }
  17208. }
  17209. .bind(this),
  17210. cycling: !0,
  17211. duration: 3e3,
  17212. name: "hotShine"
  17213. })
  17214. } */
  17215. ,
  17216. /* t.prototype.createHotItem = function(e, t) {
  17217. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  17218. var o = document.createElement("li")
  17219. , a = document.createElement("span");
  17220. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute && e[n[r]].infoAttribute.title || "热点",
  17221. o.hot = t[n[r]],
  17222. o.appendChild(a),
  17223. i.appendChild(o)
  17224. }
  17225. document.querySelector("#hotListContent ul").appendChild(i),
  17226. console.log(i)
  17227. } */
  17228. t.prototype.createHotItem = function() {
  17229. var docFragment = document.createDocumentFragment();
  17230. this.hotGroup.children.forEach(hot=>{
  17231. if(hot.texType == 'shine'){
  17232. var li = document.createElement('li');
  17233. var span = document.createElement('span');
  17234. span.innerHTML = hot.info.title || '热点';
  17235. // console.log(span.innerHTML);
  17236. li.hot = hot; // 列表每一项对应一个热点
  17237. li.appendChild(span);
  17238. docFragment.appendChild(li);
  17239. }
  17240. })
  17241. var ul = document.querySelector('#hotListContent ul');
  17242. ul.appendChild(docFragment);
  17243. }
  17244. ,
  17245. /* t.prototype.loadOverlays = function(overlays){
  17246. var overlays = window.data2 && window.data2.overlays
  17247. overlays && overlays.forEach((info)=>{
  17248. new Overlay(info)
  17249. })
  17250. Overlay.load()
  17251. }
  17252. */
  17253. t.prototype.loadhots = function() {
  17254. initHot(this)
  17255. var r = $.Deferred()
  17256. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  17257. return a.get(e, {
  17258. responseType: "json",
  17259. auth: this.isPublic ? null : u.authorizationHeader
  17260. }).done(function(e) {
  17261. window.data2 = e;
  17262. editTool.loadDone('data2', e)
  17263. if(!e){
  17264. console.error("data2 is null")
  17265. }else{
  17266. g_data2 = hotMatcher(e)
  17267. this.hotsCount = 0;
  17268. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17269. //window.hotData = {}
  17270. /* if(e.hots){
  17271. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17272. sids.forEach((sid)=>{
  17273. this.hotsCount++,
  17274. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  17275. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  17276. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  17277. window.hotData[sid] = e.hots[sid];
  17278. })
  17279. }*/
  17280. if(e.hots){
  17281. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17282. sids.forEach((sid)=>{
  17283. e.hots[sid].sid = sid
  17284. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17285. })
  17286. }
  17287. if(e.overlays){
  17288. e.overlays.forEach((info)=>{
  17289. new Hot(info, 'byOverlay')
  17290. })
  17291. }
  17292. this.createHotItem();
  17293. /* if(e.multiOverlays){
  17294. e.multiOverlays.forEach((info)=>{
  17295. new Hot(info)
  17296. })
  17297. }) */
  17298. Hot.startLoad()
  17299. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17300. }
  17301. r.resolve()
  17302. }
  17303. .bind(this)).fail(function() {
  17304. console.log("没有热点"),
  17305. editTool.loadDone('data2', null)
  17306. r.resolve()
  17307. }),
  17308. r
  17309. }
  17310. ,
  17311. t.prototype.loadPanos = function() {
  17312. if (this.loadPanosPromise)
  17313. return this.loadPanosPromise;
  17314. var e = new y(this);
  17315. return this.loadPanosPromise = e.load().then(function(e) {
  17316. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  17317. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17318. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17319. else console.log(e.uuid)
  17320. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17321. }
  17322. .bind(this))),
  17323. this.panos.extend(e.map(function(e) {
  17324. return new f(this,e.uuid,e,this.supportsTiles)
  17325. }
  17326. .bind(this))),
  17327. this.panos.forEach(function(i) {
  17328. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17329. var t = this.panos.get(e);
  17330. t && this.panos.setNeighbour(i, t, !0)
  17331. }
  17332. .bind(this)),
  17333. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17334. }
  17335. .bind(this)),
  17336. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17337. this.supportedModes[s.PANORAMA] = !1),
  17338. $.when(this)
  17339. }
  17340. .bind(this)),
  17341. this.loadPanosPromise
  17342. }
  17343. ,
  17344. t.prototype.loadHighlightReel = function() {
  17345. var t = $.Deferred()
  17346. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17347. return a.get(e, {
  17348. responseType: "json",
  17349. auth: this.isPublic ? null : u.authorizationHeader
  17350. }).done(function(e) {
  17351. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17352. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17353. t.resolve()
  17354. }
  17355. .bind(this)).fail(function() {
  17356. R.warn("Getting highlight reel failed, no highlights available"),
  17357. t.resolve()
  17358. }),
  17359. t
  17360. }
  17361. ,
  17362. t.prototype.waitForLoad = function(e, t) {
  17363. t() || (this.waitQueue.push({
  17364. object: e,
  17365. isLoadedCallback: t
  17366. }),
  17367. 1 === this.waitQueue.length && this.emit("waiting"))
  17368. }
  17369. ,
  17370. t.prototype.hide = function() {
  17371. this.floors.hide()
  17372. }
  17373. ,
  17374. t.prototype.show = function() {
  17375. this.floors.show()
  17376. }
  17377. ,
  17378. t.prototype.floorNames = function() {
  17379. return this.floors.names()
  17380. }
  17381. ,
  17382. t.prototype.warpDestFloors = function(e, t) {
  17383. if (e && this.floors.length === e.length) {
  17384. var i = e.findIndex(function(e) {
  17385. return e
  17386. }
  17387. .bind(this));
  17388. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17389. } else
  17390. this.toggleAllFloors(!0)
  17391. }
  17392. ,
  17393. t.prototype.setFloor = function(e, t, i) {
  17394. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17395. this.allFloorsVisible = !1,
  17396. this._setFloor(e, t, i)
  17397. }
  17398. ,
  17399. t.prototype.toggleAllFloors = function(e) {
  17400. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17401. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17402. this._setFloor(this.currentFloor)
  17403. }
  17404. ,
  17405. t.prototype._setFloor = function(e, t, i) {
  17406. var n;
  17407. if (t = t || this.mode,
  17408. this.emit("floor.changed", e, t, this.currentFloor),
  17409. this.currentFloor = e,
  17410. t === s.PANORAMA) {
  17411. if (this.show(),
  17412. this.shouldShowtags && this.tagsShown)
  17413. for (n in this.tags)
  17414. this.tags[n].show(u.showFloorDuration)
  17415. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17416. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17417. }
  17418. .bind(this)),
  17419. this.shouldShowtags && this.tagsShown))
  17420. for (n in this.tags) {
  17421. var r = this.tags[n];
  17422. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17423. }
  17424. var o = this
  17425. , a = e;
  17426. A.start(function() {}, u.showFloorDelay, function() {
  17427. o.floors.forEach(function(t) {
  17428. t.chunks.forEach(function(e) {
  17429. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17430. })
  17431. })
  17432. }
  17433. .bind(this))
  17434. }
  17435. ,
  17436. t.prototype.toggleExplode = function() {
  17437. this.floors.toggleExplodeHorizontal()
  17438. }
  17439. ,
  17440. t.prototype.toggleExplodeUp = function() {
  17441. this.floors.toggleExplodeVertical()
  17442. }
  17443. ,
  17444. t.prototype.nextFloor = function(e) {
  17445. return this.floors.nextFloor(this.currentFloor, e)
  17446. }
  17447. ,
  17448. t.prototype.addFloor = function(e) {
  17449. this.floors.add(e)
  17450. }
  17451. ,
  17452. t.prototype.getFloorAtPoint = function(e) {
  17453. return this.floors.getFloorAtPoint(e)
  17454. }
  17455. ,
  17456. t.prototype.getTagBySid = function(e) {
  17457. return this.tags[e]
  17458. }
  17459. ,
  17460. t.prototype.addChunk = function(e, t) {
  17461. this.floors.getOrMakeFloor(e).addChunk(t),
  17462. this.chunks.push(t)
  17463. }
  17464. ,
  17465. t.prototype.setMode = function(t) {
  17466. if (!this.supportedModes[t])
  17467. throw new x("Mode not supported for this model: " + t);
  17468. this.mode = t
  17469. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17470. this.chunks.forEach(function(e) {
  17471. e.setMode(t)
  17472. })
  17473. }
  17474. ,
  17475. t.prototype.build = function() {
  17476. this.heroLocations = this.images.getHeroLocations(this.panos);
  17477. var e = function() {
  17478. 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()
  17479. }
  17480. .bind(this)();
  17481. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17482. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17483. }
  17484. .bind(this)) || e,
  17485. null === this.heroImage && R.warn("No hero image defined."),
  17486. this.currentFloor = this.floors.last(),
  17487. this.floors.build(),
  17488. this.colliders = this.floors.reduce(function(e, t) {
  17489. return e.concat(t.collider.children)
  17490. }, []),
  17491. this.panos.forEach(function(e) {
  17492. e.build1(),
  17493. e.on("enter", function() {
  17494. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17495. }
  17496. .bind(this))
  17497. }
  17498. .bind(this)),
  17499. this.panos.forEach(function(e) {
  17500. e.build2()
  17501. }),
  17502. this.floors.forEach(function(e) {
  17503. this.boundingBox.union(e.boundingBox)
  17504. }
  17505. .bind(this)),
  17506. this.size = this.boundingBox.size(),
  17507. this.center = this.boundingBox.center(),
  17508. this.floors.forEach(function(e) {
  17509. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17510. }
  17511. .bind(this)),
  17512. this.panos.populate_path_graph(),
  17513. this.skybox = new n(this.boundingBox),
  17514. this.skybox.matrixWorldNeedsUpdate = !0,
  17515. this.add(this.skybox),
  17516. setTimeout(function() {
  17517. //this.hotsCount && this.shineHots()
  17518. Hot.beginShineHot()
  17519. }
  17520. .bind(this), 1300),
  17521. this.tags)
  17522. this.tags[t].build();
  17523. //add-----
  17524. console.log('计算visiblePanos开始,可能需要一段时间')
  17525. for(let i in this.hots){
  17526. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  17527. }
  17528. console.log('计算visiblePanos完毕')
  17529. //---------
  17530. return R.debug("Done building model"),
  17531. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17532. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17533. this.buildRooms(),
  17534. this.labels.associateWithRooms(this.rooms),
  17535. $.when(this)
  17536. }
  17537. ,
  17538. t.prototype.loadLabels = function() {
  17539. this.labels = new b(this);
  17540. var e = $.Deferred();
  17541. window.DATA.showingLabels ? this.showingLabels = true : '';
  17542. if (!this.showingLabels)
  17543. return e.resolve();
  17544. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17545. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17546. R.warn("Getting labels failed, not displaying labels."),
  17547. e.resolve()
  17548. }),
  17549. e
  17550. }
  17551. ,
  17552. t.prototype.buildRooms = function() {
  17553. this.rooms = new _(this),
  17554. this.rooms.createFromChunks(this.chunks),
  17555. this.rooms.calcRoomBoundaries()
  17556. }
  17557. ,
  17558. t.prototype.updateProjectedPanos = function() {
  17559. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17560. }
  17561. ,
  17562. t.prototype.setProjectedPanos = function(t, i, n) {
  17563. null != n || (n = !0),
  17564. n = !!n,
  17565. this.projectedPano0 = t,
  17566. this.projectedPano1 = i,
  17567. this.skybox.material.setProjectedPanos(t, i, n),
  17568. this.chunks.forEach(function(e) {
  17569. e.materialInside.setProjectedPanos(t, i, n)
  17570. })
  17571. }
  17572. ,
  17573. t.prototype.setSide = function(t) {
  17574. this.floors.forEach(function(e) {
  17575. e.collider.material.side = t
  17576. })
  17577. }
  17578. ,
  17579. t.prototype.heroCount = function() {
  17580. return this.heroLocations ? this.heroLocations.length : 0
  17581. }
  17582. ,
  17583. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17584. if (e[0] < 0)
  17585. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17586. null;
  17587. if (this.heroCount() < 1)
  17588. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17589. null;
  17590. var t = this.heroLocations[e[0]];
  17591. if(t.heroLocations && e[1]!=void 0){
  17592. t = t.heroLocations[e[1]];
  17593. }
  17594. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17595. null) : t
  17596. }
  17597. ,
  17598. t.prototype.findPanoramicHero = function() {
  17599. for (var e in this.heroLocations)
  17600. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17601. return this.heroLocations[e];
  17602. return null
  17603. }
  17604. ,
  17605. t.prototype.listImagePanos = function() {
  17606. var i = []
  17607. , n = this;
  17608. return this.images.forEach(function(e) {
  17609. if (e.metadata && e.metadata.scan_id) {
  17610. var t = n.panos.get(e.metadata.scan_id);
  17611. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17612. }
  17613. }),
  17614. i
  17615. }
  17616. ,
  17617. t.prototype.fadePanoMarkers = function(e, t) {
  17618. this.panos.fadeMarkerOpacity(e, t)
  17619. }
  17620. ,
  17621. t.prototype.setSweepVisibility = function(t) {
  17622. this.panos.forEach(function(e) {
  17623. e.marker && (e.marker.visible = t)
  17624. })
  17625. }
  17626. ,
  17627. t.prototype.outsideAllowed = function() {
  17628. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17629. }
  17630. ,
  17631. O.exports = t
  17632. }
  17633. ).call(this, "/js/model/Model.js")
  17634. }
  17635. , {
  17636. "../constants": 8,
  17637. "../enum/AlignmentType": 17,
  17638. "../enum/RenderOrder": 42,
  17639. "../enum/Viewmode": 51,
  17640. "../exception/BasicException": 55,
  17641. "../label/Label": 90,
  17642. "../loaders/ModelLoader": 105,
  17643. "../loaders/ModelTextureLoader": 106,
  17644. "../loaders/SweepDataLoader": 107,
  17645. "../tag/tag": 123,
  17646. "../tag/tagManager": 124,
  17647. "../objects/BoundingTextureSkybox": 143,
  17648. "../objects/Chunk": 144,
  17649. "../objects/Floor": 146,
  17650. "../objects/Panorama": 148,
  17651. "../objects/Room": 150,
  17652. "../objects/Snapshot": 153,
  17653. "../settings": 166,
  17654. "../shaders": 167,
  17655. "../util/ModelUrls": 177,
  17656. "../util/PanoramaCollection": 178,
  17657. "../util/ajax": 181,
  17658. "../util/common": 185,
  17659. "../util/easing": 186,
  17660. "../util/lerp": 188,
  17661. "../util/logger": 189,
  17662. "../util/math": 190,
  17663. "../util/texture": 194,
  17664. "../util/transitions": 195,
  17665. "./../util/browser": 182,
  17666. "./../util/showcase": 193,
  17667. "./Chunks": 135,
  17668. "./FloorCollection": 136,
  17669. "./ImageCollection": 137,
  17670. "./LabelCollection": 138,
  17671. "./RoomCollection": 141,
  17672. events: 202,
  17673. three: 217,
  17674. hot: "hot"
  17675. }],
  17676. 140: [function(e, t, i) {
  17677. "use strict";
  17678. function n() {
  17679. this.modelMap = {},
  17680. this.activeModel = null,
  17681. this.modelCount = 0,
  17682. this.tileDownloader = null,
  17683. this.panoRenderer = null
  17684. }
  17685. var r = (e("three"),
  17686. e("../util/common"))
  17687. , o = e("../exception/BasicException")
  17688. , a = e("../enum/ModelManagerEvents")
  17689. , s = e("../enum/PanoRendererEvents")
  17690. , l = e("events").EventEmitter;
  17691. n.prototype.init = function(e, t, i) {
  17692. this.tileDownloader = e,
  17693. this.panoRenderer = t,
  17694. this.qualityManager = i,
  17695. this.bindEvents()
  17696. }
  17697. ,
  17698. n.prototype.bindEvents = function() {
  17699. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17700. }
  17701. ,
  17702. n.prototype.onTileRendered = function(e, t, i, n) {}
  17703. ,
  17704. n.prototype.addModel = function(e) {
  17705. this.modelMap[e.sid] = e,
  17706. 0 === this.modelCount && this.activateModel(e.sid),
  17707. this.modelCount++,
  17708. this.emit(a.ModelAdded)
  17709. }
  17710. ,
  17711. n.prototype.getModel = function(e) {
  17712. return this.modelMap[e]
  17713. }
  17714. ,
  17715. n.prototype.activateModel = function(e) {
  17716. var t = this.modelMap[e];
  17717. if (!t)
  17718. throw new o("Tried to activate invalid model!");
  17719. var i = this.activeModel;
  17720. this.activeModel = t,
  17721. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17722. this.tileDownloader.setUrls(t.urls),
  17723. t.panos.forEach(function(e) {
  17724. e.attachToPanoRenderer(this.panoRenderer),
  17725. e.tileDownloader = this.tileDownloader,
  17726. e.qualityManager = this.qualityManager
  17727. }
  17728. .bind(this)),
  17729. this.emit(a.ActiveModelChanged, {
  17730. oldModel: i,
  17731. model: t
  17732. })
  17733. }
  17734. ,
  17735. n.prototype.getActiveModel = function() {
  17736. return this.activeModel
  17737. }
  17738. ,
  17739. r.extend(n, l),
  17740. t.exports = n
  17741. }
  17742. , {
  17743. "../enum/ModelManagerEvents": 33,
  17744. "../enum/PanoRendererEvents": 35,
  17745. "../exception/BasicException": 55,
  17746. "../util/common": 185,
  17747. events: 202,
  17748. three: 217
  17749. }],
  17750. 141: [function(r, l, e) {
  17751. (function(e) {
  17752. "use strict";
  17753. function o() {
  17754. n.call(this)
  17755. }
  17756. var a = r("../objects/Room")
  17757. , t = (r("../settings"),
  17758. r("../util/logger"))
  17759. , i = (r("../util/transitions"),
  17760. r("../util/easing"),
  17761. r("../util/common"))
  17762. , n = r("../util/IndexedCollection")
  17763. , s = r("./Chunks");
  17764. new t(e),
  17765. i.inherit(o, n),
  17766. o.prototype.getIndex = function(e) {
  17767. return e.roomId
  17768. }
  17769. ,
  17770. o.prototype.calcRoomBoundaries = function() {
  17771. this.forEach(function(e) {
  17772. e.calcBoundaries()
  17773. })
  17774. }
  17775. ,
  17776. o.prototype.createFromChunks = function(e) {
  17777. var n = {
  17778. floorId: -1,
  17779. roomId: -1
  17780. }
  17781. , r = {};
  17782. e.forEach(function(e) {
  17783. s.parseIdsFromChunkName(e.name, n);
  17784. var t = r[n.roomId];
  17785. if (!t) {
  17786. var i = o.generateRoomId(n.floorId, n.roomId);
  17787. t = new a(n.floorId,i),
  17788. this.add(t),
  17789. r[n.roomId] = t
  17790. }
  17791. t.addChunk(e)
  17792. }
  17793. .bind(this)),
  17794. this.calcRoomBoundaries()
  17795. }
  17796. ,
  17797. o.generateRoomId = function(e, t) {
  17798. return e + "_" + t
  17799. }
  17800. ,
  17801. l.exports = o
  17802. }
  17803. ).call(this, "/js/model/RoomCollection.js")
  17804. }
  17805. , {
  17806. "../objects/Room": 150,
  17807. "../settings": 166,
  17808. "../util/IndexedCollection": 175,
  17809. "../util/common": 185,
  17810. "../util/easing": 186,
  17811. "../util/logger": 189,
  17812. "../util/transitions": 195,
  17813. "./Chunks": 135
  17814. }],
  17815. 142: [function(e, t, i) {
  17816. "use strict";
  17817. function n(e, t, i) {
  17818. var n = (e = e.clone().expandByScalar(0.01)).size()
  17819. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17820. r.boundingBox = e,
  17821. o.Mesh.call(this, r, t),
  17822. this.position.copy(e.center()),
  17823. this.frustumCulled = !1,
  17824. i && this.add(new o.WireframeHelper(this))
  17825. }
  17826. var o = e("three");
  17827. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17828. t.exports = n
  17829. }
  17830. , {
  17831. three: 217
  17832. }],
  17833. 143: [function(l, c, e) {
  17834. (function(e) {
  17835. "use strict";
  17836. function t(e) {
  17837. s.time("Computing a nice bounding cubemap");
  17838. var t = new r({
  17839. side: i.BackSide,
  17840. transparent: !0
  17841. });
  17842. t.uniforms.modelAlpha.value = 0,
  17843. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17844. this.renderOrder = a.boundingSkybox,
  17845. n.call(this, e, t),
  17846. s.timeEnd("Computing a nice bounding cubemap")
  17847. }
  17848. var i = l("three")
  17849. , n = (l("../enum/Viewmode"),
  17850. l("../shaders"),
  17851. l("./BoundingMesh"))
  17852. , r = l("../materials/ModelTextureMaterial")
  17853. , o = l("../settings")
  17854. , a = l("../enum/RenderOrder")
  17855. , s = new (l("../util/logger"))(e);
  17856. (t.prototype = Object.create(n.prototype)).constructor = t,
  17857. c.exports = t
  17858. }
  17859. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17860. }
  17861. , {
  17862. "../enum/RenderOrder": 42,
  17863. "../enum/Viewmode": 51,
  17864. "../materials/ModelTextureMaterial": 118,
  17865. "../settings": 166,
  17866. "../shaders": 167,
  17867. "../util/logger": 189,
  17868. "./BoundingMesh": 142,
  17869. three: 217
  17870. }],
  17871. 144: [function(e, t, i) {
  17872. "use strict";
  17873. function n(e) {
  17874. this.materialInside = new s({
  17875. side: r.DoubleSide
  17876. });
  17877. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17878. this.materialOutside = new r.RawShaderMaterial({
  17879. fragmentShader: o.modelOutside.fragmentShader,
  17880. vertexShader: o.modelOutside.vertexShader,
  17881. uniforms: t,
  17882. side: r.FrontSide,
  17883. name: "chunkOut"
  17884. }),
  17885. r.Mesh.call(this, e.geometry, this.materialInside),
  17886. this.name = e.name || "",
  17887. this.textureName = e.textureName,
  17888. this.meshUrl = e.meshUrl
  17889. }
  17890. var r = e("three")
  17891. , o = e("../shaders")
  17892. , a = e("../enum/Viewmode")
  17893. , s = e("../materials/ModelTextureMaterial");
  17894. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17895. this.materialInside.uniforms.map.value = e,
  17896. this.materialOutside.uniforms.map.value = e
  17897. }
  17898. ,
  17899. n.prototype.setMode = function(e) {
  17900. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17901. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17902. t.transparent = this.material.transparent,
  17903. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17904. this.material = t
  17905. }
  17906. ,
  17907. t.exports = n
  17908. }
  17909. , {
  17910. "../enum/Viewmode": 51,
  17911. "../materials/ModelTextureMaterial": 118,
  17912. "../shaders": 167,
  17913. three: 217
  17914. }],
  17915. 145: [function(e, t, i) {
  17916. "use strict";
  17917. function n(e) {
  17918. this.chunksize = e || 10,
  17919. this.chunks = {},
  17920. this.boundingBoxes = {},
  17921. this.children = [],
  17922. this.offset = new m.Vector3(0,.5,0),
  17923. this.material = new m.MeshBasicMaterial({
  17924. color: 16777215 * Math.random(),
  17925. side: m.DoubleSide
  17926. })
  17927. }
  17928. var m = e("three");
  17929. e("../enum/Viewmode"),
  17930. n.prototype.add = function(e) {
  17931. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17932. u ? (t = u.position.array,
  17933. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17934. e.faces);
  17935. var d = new m.Vector3;
  17936. if (i)
  17937. for (n = 0,
  17938. r = i.length; n < r; n += 3) {
  17939. var p = 3 * i[n]
  17940. , f = 3 * i[n + 1]
  17941. , g = 3 * i[n + 2];
  17942. o = (t[p] + t[f] + t[g]) / 3,
  17943. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17944. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17945. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17946. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17947. this.boundingBoxes[l] = new m.Box3),
  17948. 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]),
  17949. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17950. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17951. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17952. }
  17953. else
  17954. for (n = 0,
  17955. r = t.length; n < r; n += 9)
  17956. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17957. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17958. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17959. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17960. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17961. this.boundingBoxes[l] = new m.Box3),
  17962. 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]),
  17963. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17964. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17965. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17966. }
  17967. ,
  17968. n.prototype.build = function() {
  17969. var e = new m.Object3D;
  17970. for (var t in e.material = this.material,
  17971. this.chunks) {
  17972. var i = this.chunks[t]
  17973. , n = new m.BufferGeometry;
  17974. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17975. n.boundingBox = this.boundingBoxes[t];
  17976. var r = new m.Mesh(n,this.material);
  17977. r.material.visible = !1,
  17978. e.add(r),
  17979. this.chunks[t] = []
  17980. }
  17981. return e
  17982. }
  17983. ,
  17984. t.exports = n
  17985. }
  17986. , {
  17987. "../enum/Viewmode": 51,
  17988. three: 217
  17989. }],
  17990. 146: [function(e, t, i) {
  17991. "use strict";
  17992. var n = e("three")
  17993. , r = e("../settings")
  17994. , o = e("../util/common")
  17995. , a = e("../util/lerp")
  17996. , s = e("./ChunkedCollider")
  17997. , l = e("../util/transitions")
  17998. , c = e("../util/easing")
  17999. , h = (e("../objects/Panorama"),
  18000. e("../enum/RenderOrder"));
  18001. e("../localization/localize");
  18002. function u(e, t, i) {
  18003. n.Object3D.call(this),
  18004. this.model = e,
  18005. this.floorIndex = t,
  18006. this.lang = r.languageTag,
  18007. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  18008. this.panos = [],
  18009. this.chunks = [],
  18010. this.colliderBuilder = new s(3),
  18011. this.collider = null,
  18012. this.center = null,
  18013. this.boundingBox = new n.Box3,
  18014. this.size = null,
  18015. this.hidden = !1,
  18016. this.conservativeBoundingBox = new n.Box3,
  18017. this.debugColor = 16777215 * Math.random(),
  18018. this.transition = null
  18019. }
  18020. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  18021. this.model.setFloor(this, e)
  18022. }
  18023. ,
  18024. u.prototype.hide = function(e) {
  18025. if (!this.hidden || this.transition) {
  18026. this.chunks.forEach(function(e) {
  18027. e.material.transparent = !0
  18028. }),
  18029. l.cancel(this.transition);
  18030. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  18031. , i = e ? 0 : r.hideFloorDelay / t;
  18032. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  18033. this.hidden = !0
  18034. }
  18035. .bind(this), i, c.easeInOutQuad)
  18036. }
  18037. }
  18038. ,
  18039. u.prototype.show = function(e) {
  18040. if (this.hidden || this.transition) {
  18041. this.hidden = !1,
  18042. l.cancel(this.transition);
  18043. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  18044. , i = e ? 0 : r.showFloorDelay / t;
  18045. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  18046. this.hidden || this.chunks.forEach(function(e) {
  18047. e.material.transparent = !1
  18048. })
  18049. }
  18050. .bind(this), i, c.easeInOutQuad)
  18051. }
  18052. }
  18053. ,
  18054. u.prototype.toggle = function(e, t) {
  18055. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  18056. }
  18057. ,
  18058. u.prototype.containsPoint = function(t) {
  18059. return this.collider.children.some(function(e) {
  18060. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  18061. e.geometry.boundingBox.containsPoint(t)
  18062. })
  18063. }
  18064. ,
  18065. u.prototype.distanceToPoint = function(i) {
  18066. var n = null
  18067. , r = 1 / 0;
  18068. return this.collider.children.forEach(function(e) {
  18069. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  18070. var t = e.geometry.boundingBox.distanceToPoint(i);
  18071. (!n || t < r) && (r = t,
  18072. n = e)
  18073. }),
  18074. r
  18075. }
  18076. ,
  18077. u.prototype.addChunk = function(e) {
  18078. e.renderOrder = h.ghostFloor,
  18079. this.add(e),
  18080. this.chunks.push(e),
  18081. this.boundingBox.union(e.geometry.boundingBox),
  18082. this.size = this.boundingBox.size(),
  18083. this.colliderBuilder.add(e.geometry)
  18084. }
  18085. ,
  18086. u.prototype.addPano = function(e) {
  18087. this.panos.push(e),
  18088. this.add(e.skyboxMesh),
  18089. e.marker && this.add(e.marker);
  18090. var t = new n.Vector3(1,1,1)
  18091. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  18092. this.boundingBox.union(i)
  18093. }
  18094. ,
  18095. u.prototype.build = function() {
  18096. this.collider = this.colliderBuilder.build(!0),
  18097. this.add(this.collider),
  18098. this.center = this.boundingBox.center(),
  18099. this.conservativeBoundingBox.copy(this.boundingBox),
  18100. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  18101. return e.geometry.boundingBox.min.y
  18102. }), 5),
  18103. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  18104. return e.geometry.boundingBox.max.y
  18105. }), 5),
  18106. this.colliderBuilder = null
  18107. }
  18108. ,
  18109. u.prototype.toShortString = function() {
  18110. return o.nth(this.floorIndex + 1)
  18111. }
  18112. ,
  18113. u.prototype.toString = function() {
  18114. return this.name
  18115. }
  18116. ,
  18117. t.exports = u
  18118. }
  18119. , {
  18120. "../enum/RenderOrder": 42,
  18121. "../localization/localize": 108,
  18122. "./strings-cn-CN": 109,
  18123. "../objects/Panorama": 148,
  18124. "../settings": 166,
  18125. "../util/common": 185,
  18126. "../util/easing": 186,
  18127. "../util/lerp": 188,
  18128. "../util/transitions": 195,
  18129. "./ChunkedCollider": 145,
  18130. three: 217
  18131. }],
  18132. 147: [function(e, t, i) {
  18133. "use strict";
  18134. function n(e) {
  18135. this.player = e,
  18136. this.obj3d = null,
  18137. this.UP = new u.Vector3(0,1,0)
  18138. }
  18139. var u = e("three")
  18140. , d = e("../settings");
  18141. n.prototype.prefs = {
  18142. linewidth: 3,
  18143. height: .07,
  18144. opacity: .45,
  18145. endScale: .05
  18146. },
  18147. n.prototype.discard = function() {
  18148. if (this.obj3d) {
  18149. var e = this.obj3d.parent;
  18150. e && e.remove(this.obj3d)
  18151. }
  18152. this.obj3d = null
  18153. }
  18154. ,
  18155. n.prototype.draw = function() {
  18156. if (this.discard(),
  18157. d.showNeighbors) {
  18158. var e = this.player.currentPano.floor;
  18159. this.obj3d = new u.Object3D;
  18160. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18161. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18162. i.y += this.prefs.height;
  18163. var n = .1525
  18164. , r = new u.Matrix4;
  18165. for (var o in t)
  18166. if (t[o]) {
  18167. var a = this.player.model.panos.get(o)
  18168. , s = (a.position.clone().sub(this.player.model.position),
  18169. a.position.clone().sub(a.floorPosition))
  18170. , l = a.floorPosition.clone().sub(this.player.model.position);
  18171. l.y += this.prefs.height;
  18172. var c = new u.Geometry;
  18173. 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)),
  18174. 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)),
  18175. r.identity().setPosition(s),
  18176. c.applyMatrix(r),
  18177. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  18178. 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)),
  18179. r.lookAt(l, i, this.UP).setPosition(l),
  18180. c.applyMatrix(r),
  18181. c.vertices.push(l, i);
  18182. var h = new u.Line(c,new u.LineBasicMaterial({
  18183. color: a.debugColor.getHex(),
  18184. transparent: !0,
  18185. opacity: this.prefs.opacity,
  18186. depthWrite: !1,
  18187. name: "sLine" + o,
  18188. linewidth: this.prefs.linewidth
  18189. }));
  18190. this.obj3d.add(h)
  18191. }
  18192. e.add(this.obj3d)
  18193. }
  18194. }
  18195. ,
  18196. n.prototype.update = function() {
  18197. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18198. }
  18199. ,
  18200. t.exports = n
  18201. }
  18202. , {
  18203. "../settings": 166,
  18204. three: 217
  18205. }],
  18206. 148: [function(S, M, e) {
  18207. (function(e) {
  18208. "use strict";
  18209. function r(e, t, i, n) {
  18210. this.model = e,
  18211. this.id = t,
  18212. this.alignmentType = i.alignmentType || c.ALIGNED,
  18213. this.neighbourUUIDs = i.neighbours,
  18214. this.neighbourPanos = null,
  18215. this.floor = null,
  18216. this.floorIndex = i.floor,
  18217. this.failedLoadingAt = 0,
  18218. this.maxLoadRetries = 4,
  18219. this.origin = i.position.clone(),
  18220. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  18221. this.quaternion = i.quaternion.clone(),
  18222. this.skyboxMesh = new s.Mesh(E),
  18223. this.skyboxMesh.position.copy(this.position),
  18224. this.skyboxMesh.quaternion.copy(this.quaternion),
  18225. this.skyboxMesh.name = "skybox",
  18226. this.skyboxMesh.visible = !1,
  18227. this.skyboxMesh.updateMatrix(),
  18228. this.skyboxMesh.updateMatrixWorld(),
  18229. this.marker = null,
  18230. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  18231. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  18232. map: b,
  18233. side: s.DoubleSide,
  18234. opacity: 0,
  18235. transparent: !0,
  18236. depthWrite: !1
  18237. })),
  18238. this.marker.visible = this.showFloorMarker,
  18239. this.marker.renderOrder = l.panoMarker,
  18240. this.marker.name = "marker",
  18241. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  18242. this.marker.updateMatrixWorld(),
  18243. a.colorMarkerOnLoad && this.on("load", function() {
  18244. this.marker.material.color.set(65280)
  18245. })),
  18246. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18247. this.floorPosition = i.puck ? i.puck.clone() : null,
  18248. this.tiled = n,
  18249. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  18250. this.solidSkybox.flipY = !1,
  18251. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  18252. this.solidSkybox.magFilter = s.LinearFilter,
  18253. this.solidSkybox.generateMipmaps = !1)),
  18254. this.zoomed = !1,
  18255. this.panoRenderer = null,
  18256. this.qualityManager = null,
  18257. this.tileDownloader = null,
  18258. this.tiledPanoRenderTarget = null,
  18259. this.minimumTiledPanoLoaded = !1,
  18260. this.highestPartialTileRenderOpCompleted = 0,
  18261. this.highestFullTileRenderOpCompleted = 0,
  18262. this.shouldRedrawOnBaseLoaded = !1,
  18263. this.lockUntilRenderingComplete = !1,
  18264. a.colorMarkerOnLoad && this.on("load", function() {
  18265. this.marker.material.color.set(65280)
  18266. }),
  18267. (e = new s.TextureLoader).setCrossOrigin(!0);
  18268. var r = e.load("images/texture.jpg");
  18269. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  18270. color: 16777215,
  18271. transparent: !0,
  18272. opacity: .75,
  18273. map: r
  18274. })),
  18275. this.vrMarker.boluoType = "vr",
  18276. this.vrMarker.position.z = 1,
  18277. this.vrMarker.enabled = !0,
  18278. this.vrMarker.visible = !1,
  18279. window.vrMarkers = window.vrMarkers || [],
  18280. window.vrMarkers.push(this.vrMarker),
  18281. this.marker && this.marker.add(this.vrMarker),
  18282. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18283. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18284. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18285. this.adjustAngleEnable) {
  18286. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18287. this.skyboxMesh.quaternion.multiply(i);
  18288. var o = new s.Quaternion;
  18289. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18290. this.skyboxMesh.quaternion.multiply(o),
  18291. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18292. this.skyboxMesh.quaternion.multiply(n),
  18293. this.skyboxMesh.updateMatrix(),
  18294. this.skyboxMesh.updateMatrixWorld(),
  18295. this.model.updateProjectedPanos()
  18296. }
  18297. }
  18298. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18299. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18300. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18301. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18302. S("../enum/GLCubeFaces"),
  18303. 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");
  18304. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18305. function() {
  18306. this.setZoomed(!1),
  18307. this.emit("enter", {
  18308. oldPano: t,
  18309. newPano: this
  18310. }),
  18311. t = this
  18312. }
  18313. ),
  18314. r.prototype.exit = function() {
  18315. this.tiled ? (this.clearWaitDeferreds(),
  18316. this.minimumTiledPanoLoaded = !1,
  18317. this.tiledPanoRenderTarget = null,
  18318. this.setZoomed(!1),
  18319. this.panoRenderer.deactivateTiledPano(this),
  18320. this.highestPartialTileRenderOpCompleted = 0,
  18321. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18322. this.solidSkybox.loaded = !1,
  18323. this.solidSkybox.version = 0),
  18324. this.emit("exit")
  18325. }
  18326. ,
  18327. r.prototype.hoverOn = function(e) {
  18328. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18329. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18330. }
  18331. ,
  18332. r.prototype.hoverOff = function(e) {
  18333. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18334. }
  18335. ,
  18336. r.prototype.build1 = function() {
  18337. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18338. this.floor.addPano(this),
  18339. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18340. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18341. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18342. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  18343. }
  18344. ,
  18345. r.prototype.build2 = function() {
  18346. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18347. this.height = this.position.distanceTo(this.floorPosition),
  18348. this.placeMarker()
  18349. }
  18350. ,
  18351. r.prototype.interpolateFloorPosition = function() {
  18352. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18353. return !!e.floorPosition
  18354. }).sort(function(e, t) {
  18355. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18356. }
  18357. .bind(this))
  18358. , t = this.position.clone();
  18359. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18360. t
  18361. }
  18362. ,
  18363. r.prototype.raycastFloorPosition = function() {
  18364. I.warn("Performance warning: Raycasting to find floor position");
  18365. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18366. return e.length ? e[0].point : null
  18367. }
  18368. ,
  18369. 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)],
  18370. function() {
  18371. I.warn("Performance warning: Raycasting to find floor index");
  18372. for (var e = 0; e < i.length; e++) {
  18373. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18374. if (t.length)
  18375. return t[0].object.parent.parent
  18376. }
  18377. return null
  18378. }
  18379. ),
  18380. r.prototype.placeMarker = function() {
  18381. this.marker && (this.marker.position.copy(this.floorPosition),
  18382. this.marker.position.y += .05,
  18383. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18384. }
  18385. ,
  18386. r.prototype.translate = function(e) {
  18387. this.position.add(e),
  18388. this.floorPosition.add(e)
  18389. }
  18390. ,
  18391. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18392. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18393. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18394. }
  18395. ,
  18396. r.prototype.attachToPanoRenderer = function(e) {
  18397. this.panoRenderer = e,
  18398. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18399. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18400. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18401. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18402. }
  18403. ;
  18404. var w, T, x = {};
  18405. r.prototype.getWaitDeferred = function(e) {
  18406. var t = x[this.id];
  18407. t || (t = {},
  18408. x[this.id] = t);
  18409. var i = t[e];
  18410. return i || (i = {
  18411. deferred: $.Deferred(),
  18412. active: !1
  18413. },
  18414. t[e] = i),
  18415. i
  18416. }
  18417. ,
  18418. r.prototype.resetWaitDeferred = function(e) {
  18419. var t = this.getWaitDeferred(e);
  18420. t.active = !1,
  18421. t.deferred = $.Deferred()
  18422. }
  18423. ,
  18424. r.prototype.clearWaitDeferreds = function() {
  18425. var e = x[this.id];
  18426. for (var t in e || (e = {},
  18427. x[this.id] = e),
  18428. e)
  18429. if (e.hasOwnProperty(t)) {
  18430. var i = e[t];
  18431. i.active = !1,
  18432. i.deferred = $.Deferred()
  18433. }
  18434. }
  18435. ,
  18436. r.prototype.loadTiledPano = (new s.Vector3,
  18437. w = [],
  18438. T = [],
  18439. function(e, t, i, n, r, o) {
  18440. null != n || (n = !0),
  18441. null != r || (r = !0);
  18442. var a = this.getWaitDeferred(e)
  18443. , s = a.deferred
  18444. , l = null
  18445. , c = null;
  18446. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18447. c = i.vFov)),
  18448. !this.isLoaded(e)) {
  18449. if (!a.active) {
  18450. if (a.active = !0,
  18451. i) {
  18452. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18453. w[this.id + ":" + e] = {
  18454. tileCount: 0,
  18455. targetTileCount: h
  18456. },
  18457. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18458. }
  18459. T[this.id] || (T[this.id] = !0,
  18460. this.on(f.LoadComplete, function(e, t) {
  18461. var i = this.getWaitDeferred(e).deferred;
  18462. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18463. this.resetWaitDeferred(e))
  18464. }
  18465. .bind(this)),
  18466. this.on(f.LoadFailed, function(e) {
  18467. var t = this.getWaitDeferred(e).deferred;
  18468. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18469. this.resetWaitDeferred(e))
  18470. }
  18471. .bind(this)),
  18472. this.on(f.TileLoaded, function(e, t, i) {
  18473. var n = this.getWaitDeferred(e).deferred;
  18474. if (n && "pending" === n.state()) {
  18475. n.notify(e, t, i);
  18476. var r = w[this.id + ":" + e];
  18477. r && (r.tileCount++,
  18478. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18479. n.resolve(e, i),
  18480. this.resetWaitDeferred(e)))
  18481. }
  18482. }
  18483. .bind(this)))
  18484. }
  18485. this.tileDownloader.clearForceQueue(),
  18486. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18487. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18488. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18489. }
  18490. return s.promise()
  18491. }
  18492. ),
  18493. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18494. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18495. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18496. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18497. }
  18498. ,
  18499. r.prototype.onTileRendered = function(e, t, i, n) {
  18500. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18501. }
  18502. ,
  18503. r.prototype.onPanoRendered = function(e, t, i, n) {
  18504. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18505. this.updateSkyboxForZoomLevel(),
  18506. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18507. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18508. this.emit("load", t),
  18509. this.model.emit("load", this),
  18510. this.emit(f.LoadComplete, t, i))
  18511. }
  18512. ,
  18513. r.prototype.setZoomed = function(e) {
  18514. this.zoomed = e,
  18515. this.updateSkyboxForZoomLevel()
  18516. }
  18517. ,
  18518. r.prototype.ensureSkyboxReadyForRender = function() {
  18519. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18520. this.solidSkybox.loaded = !0)
  18521. }
  18522. ,
  18523. r.prototype.updateSkyboxForZoomLevel = function() {
  18524. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18525. }
  18526. ,
  18527. r.prototype.getSkyboxTexture = function() {
  18528. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18529. }
  18530. ,
  18531. r.prototype.onTileRenderFail = function(e, t, i) {
  18532. e === this.id && this.emit(f.LoadFailed, t)
  18533. }
  18534. ,
  18535. r.prototype.isLoaded = function(e) {
  18536. if (this.tiled) {
  18537. if (e && "string" == typeof e)
  18538. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18539. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18540. }
  18541. if (e && "number" == typeof e)
  18542. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18543. return !!this.solidSkybox.high || e in this.solidSkybox
  18544. }
  18545. ,
  18546. r.prototype.loadCube = function(a) {
  18547. if (this.isLoaded(a))
  18548. return I.info("Skipping load of pano, already loaded"),
  18549. $.when();
  18550. this.emit("loading", a),
  18551. this.model.emit("loading", this);
  18552. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18553. , e = n.filter(function(e) {
  18554. return !e
  18555. });
  18556. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18557. a = "high",
  18558. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18559. var t = 0
  18560. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18561. return u.getImage(n[t])
  18562. }
  18563. .bind(this));
  18564. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18565. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18566. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18567. this.solidSkybox.low = null),
  18568. this.solidSkybox.needsUpdate = !0,
  18569. this.emit("load", a),
  18570. this.model.emit("load", this),
  18571. this
  18572. }
  18573. .bind(this), function() {
  18574. I.error("Downloading cubemap for pano", this.id, "failed"),
  18575. this.failedLoadingAt = Date.now()
  18576. }
  18577. .bind(this), function() {
  18578. return $.when(++t, 6)
  18579. })
  18580. }
  18581. ,
  18582. r.raycastsSkipped = 0,
  18583. r.raycastsDone = 0,
  18584. r.prototype.findNeighourPanos = function() {
  18585. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18586. this.model.panos.forEach(function(e) {
  18587. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18588. var t = this.position.distanceTo(e.position);
  18589. if (t > a.panoramaNeighbourMaxDistance)
  18590. return this.model.panos.setNeighbour(this, e, !1),
  18591. void r.raycastsSkipped++;
  18592. var i = e.position.clone().sub(this.position).normalize()
  18593. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18594. r.raycastsDone++,
  18595. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18596. 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)))
  18597. }
  18598. }
  18599. .bind(this)),
  18600. this.model.panos.neighbourMap[this.id]
  18601. }
  18602. ,
  18603. r.prototype.worldPosition = function() {
  18604. return this.position
  18605. }
  18606. ,
  18607. r.prototype.addTextSprite = function(e, color, parent) {
  18608. this.removeTextSprite();
  18609. var ratio = 16;
  18610. var i = document.createElement("canvas")
  18611. , n = i.getContext("2d");
  18612. i.width = 1024,
  18613. i.height = i.width / ratio;
  18614. n.font = " 30px Arial",
  18615. n.fillStyle = "white";
  18616. var r = n.measureText(e).width;
  18617. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18618. var o = new s.Texture(i);
  18619. o.needsUpdate = !0;
  18620. var a = new s.SpriteMaterial({
  18621. map: o,
  18622. color: color || 16428055,
  18623. depthTest:false
  18624. });
  18625. this.text3d = new s.Sprite(a)
  18626. if(parent){
  18627. parent.add(this.text3d)
  18628. }else{
  18629. this.text3d.position.copy(this.skyboxMesh.position)
  18630. this.floor.add(this.text3d)
  18631. }
  18632. var scale = 5
  18633. this.text3d.scale.y = scale/ratio
  18634. this.text3d.scale.x = scale
  18635. }
  18636. ,
  18637. r.prototype.removeTextSprite = function() {
  18638. this.text3d && (this.text3d.parent.remove(this.text3d),
  18639. this.text3d.material.map.dispose(),
  18640. this.text3d = null)
  18641. }
  18642. ,
  18643. r.prototype.isAligned = function() {
  18644. return this.alignmentType === c.ALIGNED
  18645. }
  18646. ,
  18647. r.filters = {
  18648. inDirection: function(t, i, n) {
  18649. return function(e) {
  18650. return e.position.clone().sub(t).normalize().dot(i) > n
  18651. }
  18652. },
  18653. inFloorDirection: function(t, i, n) {
  18654. return function(e) {
  18655. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18656. }
  18657. },
  18658. inPanoDirection: function(n, r, o) {
  18659. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18660. function(e) {
  18661. var t = e.floorPosition.clone().sub(n).normalize()
  18662. , i = e.position.clone().sub(n).normalize();
  18663. return t.dot(r) > o || i.dot(r) > o
  18664. }
  18665. },
  18666. atFloor: function(t) {
  18667. return function(e) {
  18668. return !t || e.floor === t
  18669. }
  18670. },
  18671. not: function(t) {
  18672. return function(e) {
  18673. return e !== t
  18674. }
  18675. },
  18676. notIn: function(t) {
  18677. return function(e) {
  18678. return -1 === t.indexOf(e)
  18679. }
  18680. },
  18681. isLoaded: function() {
  18682. return function(e) {
  18683. return e.isLoaded()
  18684. }
  18685. },
  18686. isNotLoaded: function() {
  18687. return function(e) {
  18688. return !e.isLoaded()
  18689. }
  18690. },
  18691. isCloseEnoughTo: function(t, i) {
  18692. return function(e) {
  18693. return t.distanceTo(e.floorPosition) < i
  18694. }
  18695. },
  18696. hasMinimumHeightDifferenceTo: function(t, i) {
  18697. return function(e) {
  18698. return Math.abs(e.position.y - t.y) > i
  18699. }
  18700. },
  18701. isNotBehindNormal: function(t, i) {
  18702. var n = new s.Vector3;
  18703. return i = i.clone(),
  18704. function(e) {
  18705. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18706. }
  18707. },
  18708. isNeighbourPanoTo: function(t) {
  18709. return function(e) {
  18710. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18711. }
  18712. },
  18713. isNeighbourOfNeighbourTo: function(n) {
  18714. return function(i) {
  18715. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18716. var t = n.model.panos.get(e);
  18717. return !!t && t.neighbourPanos[i.id]
  18718. })
  18719. }
  18720. },
  18721. isNotRecentlyFailed: function(t) {
  18722. return function(e) {
  18723. return Date.now() - e.failedLoadingAt > t
  18724. }
  18725. },
  18726. isOnVisibleFloor: function() {
  18727. return function(e) {
  18728. return !e.floor.hidden
  18729. }
  18730. },
  18731. isPanoAligned: function() {
  18732. return function(e) {
  18733. return e.isAligned()
  18734. }
  18735. }
  18736. },
  18737. r.sortFunctions = {
  18738. distanceToPoint: function(i) {
  18739. return function(e, t) {
  18740. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18741. }
  18742. },
  18743. floorDistanceToPoint: function(i) {
  18744. return function(e, t) {
  18745. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18746. }
  18747. },
  18748. choose: function(i) {
  18749. return function(e, t) {
  18750. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18751. }
  18752. }
  18753. },
  18754. r.scoreFunctions = {
  18755. distance: function(t, i) {
  18756. return i = i || a.navigation.distanceFactor,
  18757. function(e) {
  18758. return t ? t.position.distanceTo(e.position) * i : 0
  18759. }
  18760. },
  18761. distanceSquared: function(t, i) {
  18762. return i = i || a.navigation.distanceFactor,
  18763. function(e) {
  18764. return t ? t.position.distanceToSquared(e.position) * i : 0
  18765. }
  18766. },
  18767. direction: function(t, i) {
  18768. return function(e) {
  18769. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18770. }
  18771. },
  18772. angle: function(t, i) {
  18773. return function(e) {
  18774. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18775. }
  18776. },
  18777. inFieldOfView: function(t, i) {
  18778. return function(e) {
  18779. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18780. }
  18781. },
  18782. optionality: function(t) {
  18783. return function(e) {
  18784. return e.neighbourUUIDs.filter(function(e) {
  18785. return !(e in t.neighbourUUIDs) && e !== t.id
  18786. }).length * a.navigation.optionalityFactor
  18787. }
  18788. },
  18789. penalizeHeightDifferenceUnder: function(t, i) {
  18790. return function(e) {
  18791. return t.y - e.position.y < i ? -20 : 0
  18792. }
  18793. }
  18794. },
  18795. M.exports = r
  18796. }
  18797. ).call(this, "/js/objects/Panorama.js")
  18798. }
  18799. , {
  18800. "../enum/AlignmentType": 17,
  18801. "../enum/GLCubeFaces": 25,
  18802. "../enum/PanoRendererEvents": 35,
  18803. "../enum/PanoSizeClass": 36,
  18804. "../enum/PanoramaEvents": 37,
  18805. "../enum/RenderLayers": 41,
  18806. "../enum/RenderOrder": 42,
  18807. "../enum/TileDownloaderEvents": 45,
  18808. "../enum/Viewmode": 51,
  18809. "../exception/BasicException": 55,
  18810. "../scene/SceneRenderer": 158,
  18811. "../settings": 166,
  18812. "../tile/TileUtils": 174,
  18813. "../util/ajax": 181,
  18814. "../util/common": 185,
  18815. "../util/lerp": 188,
  18816. "../util/logger": 189,
  18817. "../util/panorama": 191,
  18818. "../util/texture": 194,
  18819. "../util/transitions": 195,
  18820. events: 202,
  18821. three: 217
  18822. }],
  18823. 149: [function(e, t, i) {
  18824. "use strict";
  18825. function n(e) {
  18826. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18827. t.map.value = d,
  18828. t.opacity.value = 0,
  18829. t.color.value.set(o.reticuleColor),
  18830. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18831. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18832. side: r.DoubleSide,
  18833. depthWrite: !1,
  18834. depthTest: !1,
  18835. transparent: !0,
  18836. vertexShader: c.waypoint.vertexShader,
  18837. fragmentShader: c.waypoint.fragmentShader,
  18838. uniforms: t,
  18839. name: "waypoint",
  18840. opacity: 0,
  18841. visible: t.showMouseMarker
  18842. })),
  18843. this.layers.set(h.RETICULE),
  18844. this.renderOrder = u.reticule,
  18845. this.player = e,
  18846. this.direction = new r.Vector3,
  18847. this.hidden = !0,
  18848. this.mouseLastMoveTime = Date.now()
  18849. }
  18850. var r = e("three")
  18851. , o = e("../settings")
  18852. , a = e("../util/transitions")
  18853. , s = e("../util/texture")
  18854. , l = e("../util/lerp")
  18855. , c = e("../shaders")
  18856. , h = e("../enum/RenderLayers")
  18857. , u = e("../enum/RenderOrder")
  18858. , d = s.load("images/reticule-256x256.png");
  18859. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18860. this.hidden = i,
  18861. this.mouseLastMoveTime = Date.now()
  18862. }
  18863. ,
  18864. n.prototype.hide = function() {
  18865. this.hidden || (this.hidden = !0,
  18866. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18867. }
  18868. ,
  18869. n.prototype.show = function() {
  18870. this.hidden = !1,
  18871. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18872. }
  18873. ,
  18874. n.prototype.update = function() {
  18875. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18876. }
  18877. ,
  18878. n.prototype.updatePosition = function(e, t) {
  18879. if (!this.hidden) {
  18880. if (!t)
  18881. return this.hide();
  18882. var i = t.point
  18883. , n = e.distanceTo(i)
  18884. , r = 1 + .01 * n;
  18885. n < 1 && (r -= 1 - n),
  18886. this.show(),
  18887. this.scale.set(r, r, r),
  18888. this.direction = this.direction.multiplyScalar(.8),
  18889. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18890. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18891. this.lookAt(this.position.clone().add(this.direction))
  18892. }
  18893. }
  18894. ,
  18895. n.prototype.writeAstag = function() {
  18896. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18897. , t = new Date;
  18898. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18899. var i = {
  18900. enabled: !0,
  18901. version: "0",
  18902. created: t.toISOString(),
  18903. created_by: "APITest",
  18904. position: this.position.clone(),
  18905. stem: {
  18906. enabled: o.tags.pole.enabled,
  18907. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18908. },
  18909. label: "tag " + this.tagCount,
  18910. description: "Description " + e,
  18911. floor: function(e) {
  18912. if (e.currentFloor) {
  18913. var t = e.floors.indexOf(e.currentFloor);
  18914. return -1 < t ? t : void 0
  18915. }
  18916. }(this.player.model),
  18917. type: "info",
  18918. metadata: {
  18919. preferred_camera: {
  18920. mode: this.player.mode
  18921. }
  18922. }
  18923. };
  18924. console.log("--------------------------"),
  18925. console.log(JSON.stringify(i));
  18926. var n = this.player.model.addtag(e, i).build();
  18927. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18928. n.visible || n.show(o.tags.startup.fadeInDuration))
  18929. }
  18930. ,
  18931. t.exports = n
  18932. }
  18933. , {
  18934. "../enum/RenderLayers": 41,
  18935. "../enum/RenderOrder": 42,
  18936. "../settings": 166,
  18937. "../shaders": 167,
  18938. "../util/lerp": 188,
  18939. "../util/texture": 194,
  18940. "../util/transitions": 195,
  18941. three: 217
  18942. }],
  18943. 150: [function(e, t, i) {
  18944. "use strict";
  18945. function n(e, t) {
  18946. this.chunks = [],
  18947. this.floorId = e,
  18948. this.roomId = t,
  18949. this.position = new l.Vector3
  18950. }
  18951. var l = e("three");
  18952. n.prototype.addChunk = function(e) {
  18953. this.chunks.push(e)
  18954. }
  18955. ,
  18956. n.prototype.calcBoundaries = function() {
  18957. 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++) {
  18958. var a = this.chunks[o].geometry.attributes.position;
  18959. if (a)
  18960. for (var s = 0; s < a.array.length; s += 3)
  18961. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18962. t.add(e),
  18963. 0 === s ? (i.copy(e),
  18964. n.copy(e)) : (i.max(e),
  18965. n.min(e)),
  18966. r++
  18967. }
  18968. 0 < r ? (t.multiplyScalar(1 / r),
  18969. this.average = t) : this.average = null,
  18970. this.boundsMax = i,
  18971. this.boundsMin = n,
  18972. this.center = new l.Vector3,
  18973. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18974. }
  18975. ,
  18976. t.exports = n
  18977. }
  18978. , {
  18979. three: 217
  18980. }],
  18981. 151: [function(o, v, e) {
  18982. (function(e) {
  18983. "use strict";
  18984. function t(e, t, i) {
  18985. this.obj3d = null,
  18986. this.nodes = [],
  18987. this.colorHull = [],
  18988. this.shortPaths = {},
  18989. this.floorHull = null,
  18990. this.cameraHull = null,
  18991. this.floorPathDistance = 0,
  18992. this.floorCurvePoints = null,
  18993. this.floorCurveColors = null,
  18994. this.camCurvePoints = null,
  18995. this.warpDestHeroLoc = null,
  18996. this.warpDestPano = null,
  18997. this.warpPathPoints = null,
  18998. this.warpPathLengths = [0],
  18999. this.warpLength = 0,
  19000. this.closeWarpDistance = 4,
  19001. this.UP = U.UP.clone(),
  19002. this.longestStep = 0,
  19003. this.upcomingTransType = null,
  19004. this.burnsDir = 1,
  19005. this.prevNextDist = 0,
  19006. this.nextI = 0,
  19007. this.activeTransType = null,
  19008. this.lastTransType = null,
  19009. this.bunnyObj = null,
  19010. this.director = e,
  19011. this.player = t,
  19012. this.playerControls = i,
  19013. this.modelManager = t.modelManager,
  19014. this.updateModel(),
  19015. this.updateDefaultsFromModelData(),
  19016. this.bindEvents(),
  19017. this.warping = !1,
  19018. this.waitingToWarp = !1,
  19019. this.warpInterrupted = !1,
  19020. this.warpInterruptionBlackoutStyle = null,
  19021. this.warpInterruptionTravelTime = null
  19022. }
  19023. 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"),
  19024. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  19025. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  19026. 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"),
  19027. pathEnd: n.load("images/End.png"),
  19028. 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==")
  19029. };
  19030. t.prototype.setScene = function(e) {
  19031. this.createCpm(e),
  19032. this.createBunnyObj(e)
  19033. }
  19034. ,
  19035. t.prototype.updateModel = function() {
  19036. this.model = this.modelManager.getActiveModel()
  19037. }
  19038. ,
  19039. t.prototype.bindEvents = function() {
  19040. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  19041. }
  19042. ,
  19043. t.prototype.updateDefaultsFromModelData = function() {
  19044. this.model.data
  19045. }
  19046. ,
  19047. t.prototype.pointPathDistance = function(e) {
  19048. for (var t = 0, i = 1; i < e.length; i += 1)
  19049. t += e[i - 1].distanceTo(e[i]);
  19050. return t
  19051. }
  19052. ,
  19053. t.prototype.pointPathLengths = function(e) {
  19054. for (var t = [0], i = 1; i < e.length; i += 1)
  19055. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19056. return t
  19057. }
  19058. ,
  19059. t.prototype.interpAlongPath = function(e, t, i) {
  19060. var n, r = new P.Vector3, o = t[t.length - 1];
  19061. if (i < 1) {
  19062. n = i * o;
  19063. for (var a = 1; a < t.length; a += 1)
  19064. if (t[a] > n) {
  19065. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  19066. return r.copy(e[a]),
  19067. r.sub(e[a - 1]),
  19068. r.multiplyScalar(s),
  19069. r.add(e[a - 1]),
  19070. r
  19071. }
  19072. } else
  19073. r.copy(e[e.length - 1]);
  19074. return r
  19075. }
  19076. ,
  19077. t.prototype.pathHeight = function() {
  19078. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  19079. }
  19080. ,
  19081. t.prototype.createBunnyObj = function(e) {
  19082. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  19083. this.bunnyObj.visible = D.warp.showBunny),
  19084. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19085. e.add(this.bunnyObj)
  19086. }
  19087. ,
  19088. t.prototype.createCpm = function(e) {
  19089. if (!this.currentPanoMarker) {
  19090. var t = this.makeWaypointObj(I.pathEnd, "Current");
  19091. t.material.uniforms.opacity.value = 0,
  19092. this.currentPanoMarker = {
  19093. mesh: t,
  19094. placed: !1
  19095. }
  19096. }
  19097. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19098. this.placeCpm(),
  19099. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19100. }
  19101. ,
  19102. t.prototype.placeCpm = function() {
  19103. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19104. var e = this.player.currentPano.floor;
  19105. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19106. e.add(this.currentPanoMarker.mesh)),
  19107. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19108. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19109. this.currentPanoMarker.placed = !0
  19110. } else
  19111. this.popOutCpm()
  19112. }
  19113. ,
  19114. t.prototype.fadeInCpm = function(e) {
  19115. 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)
  19116. }
  19117. ,
  19118. t.prototype.fadeOutCpm = function(e) {
  19119. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19120. }
  19121. ,
  19122. t.prototype.popInCpm = function() {
  19123. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19124. }
  19125. ,
  19126. t.prototype.popOutCpm = function() {
  19127. this.fadeOutCpm(2)
  19128. }
  19129. ,
  19130. t.prototype.brushPrefs = {
  19131. linewidth: 7,
  19132. strokeWidth: 15,
  19133. cvSegments: 48,
  19134. paveStep: .1,
  19135. paveWidth: .2,
  19136. lookBlendDist: 3,
  19137. maxTurn: P.Math.degToRad(2)
  19138. },
  19139. t.prototype.panoPathDistance = function(e) {
  19140. var t = this.model.panos;
  19141. if (!e || e.length < 2)
  19142. return 0;
  19143. for (var i = [], n = 0; n < e.length; n += 1)
  19144. i.push(t.get(e[n]).floorPosition);
  19145. return this.pointPathDistance(i)
  19146. }
  19147. ,
  19148. t.prototype.loadTileTexture = function(t) {
  19149. var e = n.load(t, function(e) {
  19150. e.wrapS = P.RepeatWrapping,
  19151. e.wrapT = P.RepeatWrapping,
  19152. e.needsUpdate = !0,
  19153. H.debug('path texture "' + t + '" is ready')
  19154. }, function() {
  19155. H.error('path texture "' + t + '" failed')
  19156. });
  19157. return e.mapping = P.UVMapping,
  19158. e
  19159. }
  19160. ,
  19161. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19162. return new l({
  19163. cameraMode: n,
  19164. position: e,
  19165. quaternion: t,
  19166. panoId: i,
  19167. orthoZoom: o,
  19168. floorVisibility: r,
  19169. thumbUrl: null,
  19170. name: null
  19171. })
  19172. }
  19173. ,
  19174. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19175. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19176. }
  19177. ,
  19178. t.prototype.setWarpDestination = function(e) {
  19179. this.warpDestHeroLoc = e
  19180. }
  19181. ,
  19182. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  19183. var t = this.getHeroDescriptorByHeroIndex(e);
  19184. return null !== t && (this.setWarpDestination(t),
  19185. !0)
  19186. }
  19187. ,
  19188. t.prototype.setWarpDestinationByPano = function(e, t) {
  19189. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  19190. }
  19191. ,
  19192. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  19193. var i = this.model.panos.get(e);
  19194. if (i) {
  19195. t = t || new P.Quaternion;
  19196. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19197. return this.setWarpDestination(n),
  19198. !0
  19199. }
  19200. return !1
  19201. }
  19202. ,
  19203. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19204. var t = this.model.heroCount();
  19205. if (null !== this.warpDestHeroLoc && t < 1)
  19206. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19207. this.model.getHeroDescriptorByIndex(0);
  19208. var i = this.model.getHeroDescriptorByIndex(e);
  19209. if (i) {
  19210. var n = i.isPano() ? i.panoId : i.cameraMode;
  19211. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19212. }
  19213. return i
  19214. }
  19215. ,
  19216. t.prototype.getHeroDescriptorByPano = function(e) {
  19217. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  19218. }
  19219. ,
  19220. t.prototype.getHeroDescriptorByPanoId = function(e) {
  19221. var t = this.getHeroIndexFromPanoId(e);
  19222. return this.getHeroDescriptorByHeroIndex(t)
  19223. }
  19224. ,
  19225. t.prototype.getHeroIndexFromPanoId = function(e) {
  19226. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19227. var i = this.model.heroLocations[t]
  19228. , n = this.getHeroId(i);
  19229. if (n && n === e)
  19230. return t
  19231. }
  19232. return -1
  19233. }
  19234. ,
  19235. t.prototype.getHeroPano = function(e) {
  19236. if (null === e)
  19237. return H.warn("getHeroPano(): no destination"),
  19238. null;
  19239. var t = this.getHeroId(e)
  19240. , i = this.model.panos.get(t);
  19241. return void 0 === i && (i = null,
  19242. "" !== t && H.debug('unable to find pano "' + t + '"')),
  19243. i
  19244. }
  19245. ,
  19246. t.prototype.getHeroId = function(e) {
  19247. return e.panoId
  19248. }
  19249. ,
  19250. t.prototype.setWarpDestPano = function() {
  19251. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19252. this.warpDestPano
  19253. }
  19254. ,
  19255. t.prototype.brushToWarpPano = function(e, t) {
  19256. if (this.discardPathObject(),
  19257. !this.setWarpDestPano())
  19258. return !1;
  19259. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  19260. !this.warpDestPano)
  19261. return H.info("No brush"),
  19262. !1;
  19263. if (!this.player.currentPano)
  19264. return H.debug("No current pano, visibility undefined"),
  19265. !1;
  19266. if (!this.warpDestPano)
  19267. return H.info("No wPano, visibility undefined"),
  19268. !1;
  19269. if (!this.warpDestPano.isAligned())
  19270. return H.debug("Cannot brush to unaligned pano"),
  19271. !1;
  19272. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  19273. , n = !0;
  19274. if (this.player.currentPano.id === this.warpDestPano.id)
  19275. H.debug("Already at destination pano");
  19276. else {
  19277. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19278. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19279. this.obj3d = new P.Object3D,
  19280. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19281. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  19282. e = t) : (this.setPathHulls(this.nodes),
  19283. this.setFloorCurves(),
  19284. 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)))),
  19285. this.player.currentPano.floor.add(this.obj3d);
  19286. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  19287. , o = e === L.STD;
  19288. if (!n && (i || o)) {
  19289. if (r) {
  19290. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19291. this.obj3d.add(a)
  19292. }
  19293. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19294. this.obj3d.add(s)
  19295. }
  19296. this.appearSlow()
  19297. }
  19298. return this.upcomingTransType = e,
  19299. !n
  19300. }
  19301. ,
  19302. t.prototype.findShortestPath = function(e, t) {
  19303. if (!e || !t)
  19304. return null;
  19305. var i = D.warp.walkExtraPanosDistance
  19306. , n = e.id + ":" + t.id + ":" + i;
  19307. if (this.shortPaths.hasOwnProperty(n))
  19308. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19309. var r = t.id + ":" + e.id + ":" + i;
  19310. if (this.shortPaths.hasOwnProperty(r))
  19311. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19312. var o = this.model.panos.aStarSearch(e, t);
  19313. return this.model.panos.includeNodesNearPath(o, i),
  19314. this.shortPaths[n] = o ? o.slice() : null,
  19315. o
  19316. }
  19317. ,
  19318. t.prototype.makePathHulls = function(e) {
  19319. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19320. r = (t = h.get(e[0])).floor.floorIndex;
  19321. for (var u = 0; u < e.length; u += 1)
  19322. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19323. s.push(i),
  19324. l.push(t.position.clone()),
  19325. n = t.floor.floorIndex,
  19326. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19327. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19328. return a > this.longestStep && (this.longestStep = a,
  19329. H.debug("path contains " + a + " meter segment")),
  19330. {
  19331. floor: s,
  19332. camera: l,
  19333. color: c
  19334. }
  19335. }
  19336. ,
  19337. t.prototype.makeFloorCurves = function(e, t, i) {
  19338. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19339. , r = this.pointPathDistance(e) - 2 * n
  19340. , o = e.slice(0)
  19341. , a = o[1].clone().sub(o[0]);
  19342. a.y = 0,
  19343. a.normalize().multiplyScalar(n),
  19344. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19345. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19346. a.normalize().multiplyScalar(n),
  19347. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19348. var s = new P.CatmullRomCurve3(o)
  19349. , l = Math.floor(r / i);
  19350. l = 4 * Math.floor(l / 4),
  19351. l = Math.max(4, l);
  19352. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19353. h = 0,
  19354. c = u[f].distanceTo(e[0]);
  19355. for (var g = 1; g < e.length; g += 1)
  19356. p.copy(u[f]).sub(e[g]),
  19357. p.y *= 4,
  19358. p.length() < c && (h = g);
  19359. d.push(t[h])
  19360. }
  19361. return {
  19362. distance: r,
  19363. points: u,
  19364. colors: d
  19365. }
  19366. }
  19367. ,
  19368. t.prototype.makeCameraCurvePoints = function(e, t) {
  19369. var i = this.pointPathDistance(e);
  19370. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19371. }
  19372. ,
  19373. t.prototype.makeCameraCurveTangents = function(e, t) {
  19374. var i = this.pointPathDistance(e)
  19375. , n = new P.CatmullRomCurve3(e)
  19376. , r = Math.max(2, Math.floor(i / t));
  19377. r = r || 5;
  19378. for (var o = [], a = 0; a <= r; a++)
  19379. o.push(n.getTangentAt(a / r));
  19380. return o
  19381. }
  19382. ,
  19383. t.prototype.setPathHulls = function(e) {
  19384. var t = this.makePathHulls(e);
  19385. this.floorHull = t.floor,
  19386. this.cameraHull = t.camera,
  19387. this.colorHull = t.color
  19388. }
  19389. ,
  19390. t.prototype.setFloorCurves = function() {
  19391. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19392. this.floorPathDistance = e.distance,
  19393. this.floorCurvePoints = e.points,
  19394. this.floorCurveColors = e.colors
  19395. }
  19396. ,
  19397. t.prototype.setCameraCurvePoints = function() {
  19398. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19399. }
  19400. ,
  19401. t.prototype.chooseWarpPath = function(e) {
  19402. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19403. if (this.player.currentPano === this.warpDestPano || !e)
  19404. return this.warpPathPoints = null,
  19405. this.warpLength = 0,
  19406. !1;
  19407. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19408. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19409. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19410. t.multiplyScalar(.15).add(r.position),
  19411. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19412. t.y = r.position.y,
  19413. i.y = this.warpDestPano.position.y,
  19414. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19415. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19416. this.setCameraCurvePoints(),
  19417. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19418. this.warpLength = 0,
  19419. this.warpPathLengths = [0];
  19420. 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) {
  19421. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19422. var h = o.length();
  19423. o.y *= D.warp.climbEffort;
  19424. var u = o.length() / h;
  19425. if (1 < c) {
  19426. o.setY(0).normalize(),
  19427. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19428. var d = Math.min(1, o.dot(a))
  19429. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19430. u = Math.max(p, u)
  19431. }
  19432. this.warpLength += h * u,
  19433. this.warpPathLengths[c] = this.warpLength
  19434. }
  19435. return !0
  19436. }
  19437. ,
  19438. t.prototype.drawPathRibbon = function(e, t) {
  19439. this.bunnyObj.visible = D.warp.showBunny;
  19440. 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) {
  19441. a.copy(e[s]),
  19442. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19443. a.normalize(),
  19444. n.crossVectors(a, U.UP),
  19445. n.multiplyScalar(i);
  19446. var l = (new P.Vector3).copy(e[s]).add(r);
  19447. l.sub(n),
  19448. o.vertices.push(l),
  19449. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19450. o.vertices.push(l)
  19451. }
  19452. var c, h, u, d = 0;
  19453. for (s = 0; s < e.length - 1; s += 1) {
  19454. var p = 2 * s
  19455. , f = d
  19456. , g = d += e[s + 1].distanceTo(e[s])
  19457. , m = t[s]
  19458. , v = t[s + 1];
  19459. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19460. o.faces.push(c),
  19461. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19462. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19463. o.faces.push(c),
  19464. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19465. }
  19466. o.computeFaceNormals(),
  19467. o.computeVertexNormals(),
  19468. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19469. u.opacity.value = 0,
  19470. u.color.value.set(D.path.color),
  19471. new P.RawShaderMaterial({
  19472. side: P.DoubleSide,
  19473. depthWrite: !1,
  19474. transparent: !0,
  19475. vertexShader: C.ribbon.vertexShader,
  19476. fragmentShader: C.ribbon.fragmentShader,
  19477. uniforms: u,
  19478. name: "ribbonT",
  19479. opacity: 0
  19480. })) : new P.MeshBasicMaterial({
  19481. color: 16777215,
  19482. side: P.DoubleSide,
  19483. name: "ribbonOut",
  19484. vertexColors: P.VertexColors
  19485. });
  19486. var y = new P.Mesh(o,h);
  19487. return y.name = "ribbon",
  19488. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19489. y
  19490. }
  19491. ,
  19492. t.prototype.drawPathPavement = function(e) {
  19493. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19494. r.copy(e[o]),
  19495. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19496. r.normalize(),
  19497. i.crossVectors(r, U.UP),
  19498. i.multiplyScalar(this.brushPrefs.paveWidth),
  19499. (t = (new P.Vector3).copy(e[o])).sub(i),
  19500. n.vertices.push(t),
  19501. n.vertices.push((new P.Vector3).copy(e[o])),
  19502. (t = (new P.Vector3).copy(e[o])).add(i),
  19503. n.vertices.push(t);
  19504. var a, s, l;
  19505. for (o = 0; o < e.length - 1; o += 1)
  19506. a = 3 * o + 1,
  19507. l = .25 + (s = .25 * o),
  19508. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19509. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19510. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19511. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19512. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19513. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19514. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19515. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19516. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19517. color: D.path.color,
  19518. side: P.DoubleSide,
  19519. transparent: !0,
  19520. depthWrite: !1,
  19521. opacity: 0,
  19522. name: "paveT",
  19523. map: I.path
  19524. }) : new P.MeshBasicMaterial({
  19525. color: D.path.color,
  19526. side: P.DoubleSide,
  19527. transparent: !0,
  19528. depthWrite: !1,
  19529. opacity: 1,
  19530. name: "paveO",
  19531. map: I.path
  19532. });
  19533. return new P.Mesh(n,c)
  19534. }
  19535. ,
  19536. t.prototype.hintPrefs = {
  19537. rad: .18,
  19538. width: .0125,
  19539. depth: .0625,
  19540. setBack: -.04,
  19541. markRad: .25,
  19542. markInnerRad: .16
  19543. },
  19544. t.prototype.makeWaypointObj = function(e, t) {
  19545. var i = new P.Geometry
  19546. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19547. , r = this.pathHeight();
  19548. 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)),
  19549. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19550. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19551. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19552. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19553. o.map.value = e,
  19554. o.opacity.value = 0,
  19555. o.color.value.set(D.path.color);
  19556. var a = {
  19557. side: P.DoubleSide,
  19558. depthWrite: !1,
  19559. transparent: !0,
  19560. vertexShader: C.waypoint.vertexShader,
  19561. fragmentShader: C.waypoint.fragmentShader,
  19562. uniforms: o,
  19563. name: "waypoint",
  19564. opacity: 0
  19565. };
  19566. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19567. a.name = "wayPtOut");
  19568. var s = new P.RawShaderMaterial(a)
  19569. , l = new P.Mesh(i,s);
  19570. return l.name = t,
  19571. l
  19572. }
  19573. ,
  19574. t.prototype.makeStartMarker = function(e, t) {
  19575. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19576. i.y = 0,
  19577. i.normalize();
  19578. var n = Math.acos(i.x)
  19579. , r = this.makeWaypointObj(I.pathStart, "Start");
  19580. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19581. r.position.copy(e),
  19582. r
  19583. }
  19584. ,
  19585. t.prototype.makeEndMarker = function(e) {
  19586. var t = this.makeWaypointObj(I.pathEnd, "End")
  19587. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19588. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19589. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19590. t.position.copy(e),
  19591. t
  19592. }
  19593. ,
  19594. t.prototype.pathClean = function(e) {
  19595. if (e) {
  19596. for (var t in e.children)
  19597. this.pathClean(e.children[t]);
  19598. e.geometry && e.geometry.dispose(),
  19599. e.material && e.material.dispose()
  19600. }
  19601. }
  19602. ,
  19603. t.prototype.discardPathObject = function() {
  19604. if (this.obj3d) {
  19605. var e = this.obj3d.parent;
  19606. e && e.remove(this.obj3d),
  19607. this.pathClean(this.obj3d)
  19608. }
  19609. this.obj3d = null,
  19610. this.popInCpm()
  19611. }
  19612. ,
  19613. t.prototype.discardSlow = function() {
  19614. if (this.obj3d) {
  19615. if (this.player.mode !== O.PANORAMA)
  19616. return void this.discardPathObject();
  19617. for (var e, t = 0, i = function() {
  19618. this.discardPathObject()
  19619. }
  19620. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19621. 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]),
  19622. t += 1,
  19623. i = null);
  19624. 0 === t && this.discardPathObject(),
  19625. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19626. }
  19627. }
  19628. ,
  19629. t.prototype.appearSlow = function() {
  19630. var e;
  19631. this.fadeOutCpm(D.path.fadeInTime);
  19632. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19633. 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]))
  19634. }
  19635. ,
  19636. t.prototype.update = function() {
  19637. this.obj3d && this.obj3d.updateMatrixWorld()
  19638. }
  19639. ,
  19640. t.prototype.calcBurnsAmount = function(e) {
  19641. var n = P.Math.degToRad(D.warp.burnsAngle);
  19642. if (this.player.mode !== O.PANORAMA)
  19643. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19644. var t = this.burnsDir * n;
  19645. if (this.upcomingTransType === L.BLACK)
  19646. return t;
  19647. var i = e;
  19648. if (null === i)
  19649. return H.warn("Transition request for non-highlight"),
  19650. t;
  19651. var r = this.getHeroDescriptorByHeroIndex(i);
  19652. if (null === r)
  19653. return t;
  19654. if (!r.isPano())
  19655. return t;
  19656. function o(e) {
  19657. var t = Math.acos(Math.min(1, e.dot(l)))
  19658. , i = (new P.Vector3).crossVectors(l, e);
  19659. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19660. }
  19661. var a = this.getHeroPano(r)
  19662. , s = this.playerControls.cameras[O.PANORAMA]
  19663. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19664. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19665. if (a === this.player.currentPano)
  19666. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19667. var h = this.findShortestPath(this.player.currentPano, a);
  19668. if (null == h || h.length < 1)
  19669. return H.debug("Empty path ahead..."),
  19670. t;
  19671. var u = this.makePathHulls(h)
  19672. , d = new P.CatmullRomCurve3(u.camera)
  19673. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19674. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19675. }
  19676. ,
  19677. t.prototype.waitNextStep = function(e, t, i) {
  19678. var o = null == i ? D.warp.tourStepDelay : i;
  19679. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19680. var a = new P.Euler
  19681. , s = new P.Vector3;
  19682. H.debug("Starting wait: " + (void 0 !== t));
  19683. var l = this.calcBurnsAmount(e)
  19684. , c = function() {
  19685. this.endWarpState(),
  19686. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19687. t && t()
  19688. }
  19689. .bind(this)
  19690. , n = function(e, t) {
  19691. if (this.warpInterrupted)
  19692. return c(),
  19693. !0;
  19694. var i = t || 1e3 / 60;
  19695. if (D.warp.doBurns)
  19696. if (this.player.mode === O.PANORAMA) {
  19697. var n = this.playerControls.cameras[O.PANORAMA];
  19698. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19699. var r = i * l / o;
  19700. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19701. a.y += r,
  19702. s.set(0, 0, -1),
  19703. s.applyEuler(a),
  19704. s.add(n.position),
  19705. n.controls.lookAt(s),
  19706. n.controls.lookVector.copy(s),
  19707. n.lookAt(s)
  19708. } else
  19709. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19710. }
  19711. .bind(this);
  19712. this.startWarpState(),
  19713. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19714. }
  19715. ,
  19716. t.prototype.warpToNonPano = function(e) {
  19717. if (this.discardPathObject(),
  19718. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19719. var t = function() {
  19720. e && e()
  19721. }
  19722. .bind(this);
  19723. this.player.flyToNewMode({
  19724. mode: this.warpDestHeroLoc.cameraMode,
  19725. duration: D.warp.outsideTime,
  19726. warpDest: this.warpDestHeroLoc,
  19727. callback: t,
  19728. force: !0
  19729. })
  19730. } else
  19731. H.warn("no warp destination!!!"),
  19732. e && e()
  19733. }
  19734. ,
  19735. t.prototype._resetWarpShaderParams = function(e) {
  19736. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19737. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19738. }
  19739. ,
  19740. t.prototype._clearWarpShading = function() {
  19741. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19742. this._resetWarpShaderParams(e[t]),
  19743. e[t].visible = !0;
  19744. this._resetWarpShaderParams(this.model.skybox)
  19745. }
  19746. ,
  19747. t.prototype._warpStopFlying = function() {
  19748. this.activeTransType = null,
  19749. this.placeCpm()
  19750. }
  19751. ,
  19752. t.prototype._wrapupTravelOnlyBits = function() {
  19753. this._warpStopFlying(),
  19754. this.warpPathPoints && (this.player.currentPano.exit(),
  19755. this.warpDestPano.enter(),
  19756. this.player.currentPano = this.warpDestPano),
  19757. this.player.spider.draw(),
  19758. this.placeCpm()
  19759. }
  19760. ,
  19761. t.prototype._wrapupTravel = function(e) {
  19762. this._wrapupTravelOnlyBits(),
  19763. this.warpCameraAim(e)
  19764. }
  19765. ,
  19766. t.prototype._wrapupWarpShading = function(e) {
  19767. this._clearWarpShading(),
  19768. this._wrapupTravel(e)
  19769. }
  19770. ,
  19771. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19772. t !== z.END && this._clearWarpShading(),
  19773. this._wrapupTravelOnlyBits(),
  19774. this.upcomingTransType = null,
  19775. e && e()
  19776. }
  19777. ,
  19778. t.prototype._warpCameraAim = function(e, t) {
  19779. var i = this.warpDestHeroLoc.quaternion
  19780. , n = this.playerControls.cameras[O.PANORAMA]
  19781. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19782. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19783. , a = P.Math.radToDeg(Math.acos(o))
  19784. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19785. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19786. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19787. c.y = N.constrainedTurn(c.y),
  19788. this.burnsDir = Math.sign(c.y);
  19789. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19790. , u = new P.Vector3
  19791. , d = function(e, t) {
  19792. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19793. h.y = l.y + e * c.y,
  19794. h.z = l.z + e * c.z,
  19795. u.set(0, 0, -1),
  19796. u.applyEuler(h),
  19797. u.add(n.position),
  19798. n.controls.lookAt(u),
  19799. n.controls.lookVector.copy(u),
  19800. void n.lookAt(u))
  19801. }
  19802. .bind(this);
  19803. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19804. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19805. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19806. )
  19807. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19808. void (t && t())) */
  19809. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19810. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19811. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19812. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19813. void (t && t()))
  19814. }
  19815. ,
  19816. t.prototype._warpBendAim = function(e, t, i, n) {
  19817. var r = n || 0
  19818. , o = this.playerControls.cameras[O.PANORAMA]
  19819. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19820. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19821. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19822. l.y = N.constrainedTurn(l.y);
  19823. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19824. l.x = c * Math.sign(l.x),
  19825. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19826. this.burnsDir = Math.sign(l.y),
  19827. c *= Math.sign(l.y),
  19828. l.y = c;
  19829. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19830. , u = new P.Vector3
  19831. , d = function(e, t) {
  19832. if (e < .5)
  19833. h.x = s.x + e * l.x,
  19834. h.y = s.y + e * l.y,
  19835. h.z = s.z + e * l.z;
  19836. else {
  19837. var i = (1 - e) * D.warp.softBendEnd;
  19838. h.x = a.x - i * l.x,
  19839. h.y = a.y - i * l.y,
  19840. h.z = a.z - i * l.z
  19841. }
  19842. u.set(0, 0, -1),
  19843. u.applyEuler(h),
  19844. u.add(o.position),
  19845. o.controls.lookAt(u),
  19846. o.controls.lookVector.copy(u),
  19847. o.lookAt(u)
  19848. }
  19849. .bind(this);
  19850. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19851. }
  19852. ,
  19853. t.prototype._warpStepCameraAim = function(e, t, i) {
  19854. var n = this.playerControls.cameras[O.PANORAMA]
  19855. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19856. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19857. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19858. a.y = N.constrainedTurn(a.y),
  19859. this.burnsDir = Math.sign(a.y);
  19860. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19861. , l = new P.Vector3
  19862. , c = function(e, t) {
  19863. e < .5 ? s.copy(o) : s.copy(r),
  19864. l.set(0, 0, -1),
  19865. l.applyEuler(s),
  19866. l.add(n.position),
  19867. n.controls.lookAt(l),
  19868. n.controls.lookVector.copy(l),
  19869. n.lookAt(l)
  19870. }
  19871. .bind(this);
  19872. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19873. }
  19874. ,
  19875. t.prototype.setBurnsDir = function() {
  19876. var e = this.playerControls.cameras[O.PANORAMA]
  19877. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19878. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19879. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19880. n.y = N.constrainedTurn(n.y),
  19881. this.burnsDir = Math.sign(n.y)
  19882. }
  19883. ,
  19884. t.prototype.stepWarpPath = function(firstPos, e ) {
  19885. var i = this.playerControls.cameras[O.PANORAMA];
  19886. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19887. if (!n){
  19888. return i.position.copy(this.warpDestPano.position),
  19889. !0;
  19890. }
  19891. /* if (!this.warpPathPoints)
  19892. return i.position.copy(this.warpDestPano.position),
  19893. !0;
  19894. var n = this.warpPathPoints[0] */
  19895. var r = this.warpDestPano.position;
  19896. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19897. var o = new P.Vector3;
  19898. 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),
  19899. i.position.copy(o)
  19900. } else
  19901. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19902. }
  19903. ,
  19904. t.prototype.interruptAndFastForward = function(e, t) {
  19905. this.warping && (this.warpInterrupted = !0,
  19906. this.warpInterruptionBlackoutStyle = e,
  19907. this.warpInterruptionTravelTime = t,
  19908. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19909. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19910. }
  19911. ,
  19912. t.prototype.warpCameraAim = function(e) {
  19913. var t = D.warp.minWarpTime;
  19914. if (this.upcomingTransType === L.BLACK)
  19915. t = D.warp.teleportTime;
  19916. else {
  19917. var i = this.playerControls.cameras[O.PANORAMA]
  19918. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19919. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19920. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19921. o.y = N.constrainedTurn(o.y);
  19922. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19923. t = Math.max(t, a)
  19924. }
  19925. var s = function() {
  19926. this._warpStopFlying(),
  19927. this.discardSlow(),
  19928. e && e()
  19929. }
  19930. .bind(this);
  19931. this._warpCameraAim(t, s)
  19932. }
  19933. ,
  19934. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19935. this.model.skybox.material.uniforms.blackout.value = n;
  19936. var r = F.uniform(this.model.skybox, "progress", 1)
  19937. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19938. , a = !1
  19939. , s = function() {
  19940. if (this.warpInterrupted)
  19941. return a = !0
  19942. }
  19943. .bind(this)
  19944. , l = function(e, t) {
  19945. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19946. }
  19947. .bind(this)
  19948. , c = function(e, t) {
  19949. return i && a ? (o(0),
  19950. !0) : void o(e, t)
  19951. }
  19952. .bind(this);
  19953. V.start(s, e, null, t, null, "safeHaltWatch"),
  19954. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19955. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19956. }
  19957. ,
  19958. t.prototype.warpTravel_STD = function(e) {
  19959. 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),
  19960. 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;
  19961. t += this.warpLength * D.warp.timePerMeter,
  19962. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19963. function n(e) {
  19964. var t = i;
  19965. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19966. }
  19967. var y = !1
  19968. , r = this.warpDestHeroLoc.quaternion
  19969. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19970. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19971. , a = A.dot(o)
  19972. , C = P.Math.radToDeg(Math.acos(a))
  19973. , s = function() {
  19974. return m.lookAt(g, l, U.UP),
  19975. u.setFromRotationMatrix(m, D.warp.eOrder),
  19976. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19977. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19978. N.constrainedTurn(v.y)
  19979. }
  19980. .bind(this)
  19981. , I = function(e, t) {
  19982. if (this.warpInterrupted)
  19983. return y = !0
  19984. }
  19985. .bind(this)
  19986. , E = function(e, t) {
  19987. return y || !this.warpPathPoints ? (k.blur(0),
  19988. !0) : void k.blur(e)
  19989. }
  19990. .bind(this)
  19991. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19992. , b = function(e, t) {
  19993. return y || !this.warpPathPoints ? (_(0),
  19994. !0) : void _(e, t)
  19995. }
  19996. .bind(this)
  19997. , w = function(e, t) {
  19998. if (!this.warpPathPoints)
  19999. return h.position.copy(this.warpDestPano.position),
  20000. !0;
  20001. if (y)
  20002. return !0;
  20003. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20004. h.position.copy(i),
  20005. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20006. }
  20007. .bind(this)
  20008. , T = function(e, t) {
  20009. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  20010. !0)
  20011. }
  20012. .bind(this)
  20013. , x = function(e, t) {
  20014. if (y)
  20015. return H.debug(">>>> Walkthrough interupted at t=" + e),
  20016. !0;
  20017. if (!this.warpPathPoints)
  20018. return !0;
  20019. var i = this.warpLength * e
  20020. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  20021. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20022. D.warp.matchCam && (n *= 1 - r),
  20023. m.lookAt(g, l, U.UP),
  20024. u.setFromRotationMatrix(m, D.warp.eOrder),
  20025. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  20026. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  20027. v.y = N.constrainedTurn(v.y),
  20028. u.x = p.x + n * v.x,
  20029. u.y = p.y + n * v.y,
  20030. u.z = p.z + n * v.z,
  20031. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  20032. v.y = N.constrainedTurn(v.y);
  20033. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  20034. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  20035. f.x = f.x + v.x * D.warp.turnFriction,
  20036. f.y = f.y + v.y * D.warp.turnFriction,
  20037. f.z = f.z + v.z * D.warp.turnFriction,
  20038. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  20039. var a = l.clone().sub(g).normalize();
  20040. if (C < D.warp.maxAimRotation && 0 < r) {
  20041. var s = 1 - r;
  20042. a.x = a.x * s + r * A.x,
  20043. a.y = a.y * s + r * A.y,
  20044. a.z = a.z * s + r * A.z,
  20045. a.normalize()
  20046. }
  20047. this.bunnyObj.position.copy(h.position).add(a),
  20048. d.set(0, 0, -1).applyEuler(f).normalize(),
  20049. d.multiplyScalar(8),
  20050. d.add(h.position),
  20051. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  20052. h.controls.lookVector.copy(d),
  20053. h.lookAt(d))
  20054. }
  20055. .bind(this)
  20056. , S = function() {
  20057. y ? (this.discardSlow(),
  20058. this.upcomingTransType = L.BLACK,
  20059. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  20060. }
  20061. .bind(this);
  20062. T(0);
  20063. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  20064. , R = M / (t += M);
  20065. this.warpCommonParameters(t, R, !0, z.NONE),
  20066. V.start(I, t, null, 0, null, "_haltWatcher"),
  20067. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  20068. V.start(E, t, null, R, n, "blurring")),
  20069. V.start(b, t, null, R, n, "modelAlpha"),
  20070. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  20071. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  20072. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  20073. }
  20074. ,
  20075. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20076. var r = e || 0;
  20077. null != t || (t = D.warp.teleportTime),
  20078. this.warpCommonParameters(t, r, !1, i),
  20079. this.model.chunks.forEach(function(e) {
  20080. e.material.uniforms.blackout.value = i
  20081. }),
  20082. this._warpBendAim(null, t, null, r);
  20083. //add
  20084. var done = ()=>{
  20085. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20086. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  20087. //Overlay.updateVisibles([this.player.currentPano])
  20088. }
  20089. var o = function() {
  20090. this.wrapupWarpShadingOnly(n, i)
  20091. done()
  20092. }
  20093. .bind(this);
  20094. var firstPos = this.player.position.clone()//add
  20095. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  20096. }
  20097. ,
  20098. t.prototype.flightStepWalk = (a = new P.Vector3,
  20099. s = new P.Vector3,
  20100. function(e, t, i) {
  20101. if (this.warpInterrupted)
  20102. i && i();
  20103. else if (this.activeTransType !== L.WALK)
  20104. this._clearWarpShading(),
  20105. this._warpStopFlying(),
  20106. this.player.spider.draw(),
  20107. this.placeCpm(),
  20108. i && i();
  20109. else if (this.player.currentPano !== e) {
  20110. var n = {
  20111. pano: e,
  20112. lookAtPoint: t,
  20113. duration: null,
  20114. maxDistanceOverride: D.warp.walkMaxDist,
  20115. skipWarpingCheck: !1,
  20116. constantMoveSpeed: !0
  20117. };
  20118. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20119. n.zoomLevel = this.warpDestHeroLoc.zoom
  20120. }
  20121. n.duration = function(e, t) {
  20122. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  20123. s.copy(U.FORWARD),
  20124. this.player.getDirection(s),
  20125. a.copy(t).sub(e.position).normalize();
  20126. var n = a.dot(s)
  20127. , r = Math.acos(n)
  20128. , o = r / i;
  20129. return .001 < o && (i *= o / .001,
  20130. r < 1 && (i *= 1.2)),
  20131. i
  20132. }
  20133. .call(this, e, t),
  20134. this.player.nonInterruptingFlyToPano(n, i)
  20135. } else
  20136. i && i()
  20137. }
  20138. ),
  20139. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  20140. return this.flightStepWalk.bind(this, e, t, i)
  20141. }
  20142. ,
  20143. t.prototype.warpTravel_WALK = (f = [],
  20144. function(e) {
  20145. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  20146. var o = this.nodes[r]
  20147. , a = t.get(o);
  20148. this.nodes.length,
  20149. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  20150. i && n || (f.push(o),
  20151. i = a)
  20152. }
  20153. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  20154. var s = f.length
  20155. , l = t.get(f[s - 1])
  20156. , c = new Array(s + 1);
  20157. c[c.length - 1] = function() {
  20158. e && e()
  20159. }
  20160. .bind(this);
  20161. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  20162. var d = f[h];
  20163. l = t.get(d);
  20164. var p = new P.Vector3;
  20165. this.getLookAtForWalkingTourNode(f, h, p),
  20166. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  20167. h--
  20168. }
  20169. c[0]()
  20170. }
  20171. ),
  20172. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  20173. h = new P.Vector3,
  20174. u = new P.Vector3,
  20175. d = new P.Vector3,
  20176. p = new P.Vector3,
  20177. function(e, t, i) {
  20178. var n = e.length;
  20179. if (n <= t)
  20180. return !1;
  20181. var r = 1
  20182. , o = 1;
  20183. h.set(0, 0, 0),
  20184. p.set(0, 0, 0);
  20185. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  20186. if (a = this.player.model.panos.get(e[s]),
  20187. this.getOrientationForWalkingTourNode(e, s, u),
  20188. s === t && c.copy(u),
  20189. d.copy(u),
  20190. t < s) {
  20191. var l = d.dot(c) < .65;
  20192. r *= l ? .2 : .75,
  20193. o *= l ? .2 : .4
  20194. }
  20195. u.multiplyScalar(r),
  20196. h.add(u),
  20197. p.lerp(a.position, o)
  20198. }
  20199. return h.normalize(),
  20200. i.copy(p),
  20201. i.add(h),
  20202. !0
  20203. }
  20204. ),
  20205. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20206. var n = e.length;
  20207. if (n <= t)
  20208. return !1;
  20209. if (t === n - 1)
  20210. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20211. else {
  20212. var r = this.player.model.panos.get(e[t])
  20213. , o = this.player.model.panos.get(e[t + 1]);
  20214. i.copy(o.position).sub(r.position)
  20215. }
  20216. return i.normalize(),
  20217. !0
  20218. }
  20219. ,
  20220. t.prototype.warpCameraTravel = function(e, t, i, n) {
  20221. if (this.activeTransType = this.upcomingTransType,
  20222. this.lastTransType = this.activeTransType,
  20223. this.upcomingTransType = null,
  20224. e)
  20225. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  20226. this._clearWarpShading(),
  20227. this._warpStopFlying(),
  20228. this.player.spider.draw(),
  20229. this.placeCpm(),
  20230. n && n()
  20231. }
  20232. .bind(this)) : this.warpTravel_STD(n);
  20233. else {
  20234. var r = function() {
  20235. this._wrapupTravel(n)
  20236. }
  20237. .bind(this)
  20238. , o = {
  20239. pano: this.warpDestPano,
  20240. lookAtPoint: null,
  20241. duration: null,
  20242. maxDistanceOverride: null,
  20243. skipWarpingCheck: !1
  20244. };
  20245. this.player.flyToPano(o, r)
  20246. }
  20247. }
  20248. ,
  20249. t.prototype.startWarpState = function() {
  20250. this.warping = !0,
  20251. this.warpInterrupted = !1,
  20252. this.warpInterruptionBlackoutStyle = null,
  20253. this.warpInterruptionTravelTime = null
  20254. }
  20255. ,
  20256. t.prototype.endWarpState = function() {
  20257. this.warping = !1
  20258. }
  20259. ,
  20260. t.prototype.warpToPano = function(e, t, i, n) {
  20261. if (this.warping)
  20262. H.warn("Cannot warp when already warping");
  20263. else {
  20264. if (this.upcomingTransType = e,
  20265. this.activeTransType = null,
  20266. !this.setWarpDestPano())
  20267. return this.upcomingTransType = null,
  20268. void this.warpToNonPano(n);
  20269. if (this.player.mode !== O.PANORAMA)
  20270. return this.upcomingTransType = null,
  20271. this.discardSlow(),
  20272. void this.player.flyToNewMode({
  20273. mode: O.PANORAMA,
  20274. pano: this.warpDestPano,
  20275. duration: D.warp.outsideTime,
  20276. warpDest: this.warpDestHeroLoc,
  20277. callback: n,
  20278. force: !0
  20279. });
  20280. if (!this.warpDestPano)
  20281. return H.warn("no warp destination, callback dropped"),
  20282. void (this.upcomingTransType = null);
  20283. 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)
  20284. , o = this.chooseWarpPath(r);
  20285. if (o && this.upcomingTransType !== L.WALK) {
  20286. var a = function() {
  20287. this.waitingToWarp = !1,
  20288. this.warpToPano(e, t, i, n)
  20289. }
  20290. .bind(this);
  20291. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  20292. return void (this.waitingToWarp = !0)
  20293. }
  20294. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  20295. this.player.currentPano = this.warpDestPano,
  20296. this.placeCpm(),
  20297. this.fadeOutCpm(D.path.fadeOutTime),
  20298. this.player.spider.draw()),
  20299. H.debug("Warping to pano ", this.warpDestPano.position),
  20300. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  20301. this.startWarpState();
  20302. var s = function() {
  20303. this.endWarpState(),
  20304. n && n()
  20305. }
  20306. .bind(this);
  20307. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20308. }
  20309. }
  20310. ,
  20311. v.exports = t
  20312. }
  20313. ).call(this, "/js/objects/ShowPath.js")
  20314. }
  20315. , {
  20316. "../constants": 8,
  20317. "../effects": 16,
  20318. "../enum/BlackoutStyle": 18,
  20319. "../enum/ModelManagerEvents": 33,
  20320. "../enum/PlayerEvents": 40,
  20321. "../enum/RenderOrder": 42,
  20322. "../enum/Vectors": 50,
  20323. "../enum/Viewmode": 51,
  20324. "../enum/WarpStyle": 52,
  20325. "../gui/gui": 65,
  20326. "../model/ModelManager": 140,
  20327. "../objects/Snapshot": 153,
  20328. "../settings": 166,
  20329. "../shaders": 167,
  20330. "../util/easing": 186,
  20331. "../util/lerp": 188,
  20332. "../util/logger": 189,
  20333. "../util/math": 190,
  20334. "../util/texture": 194,
  20335. "../util/transitions": 195,
  20336. three: 217
  20337. }],
  20338. 152: [function(e, t, i) {
  20339. "use strict";
  20340. function n() {
  20341. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20342. , t = new r.RawShaderMaterial({
  20343. fragmentShader: o.skysphere.fragmentShader,
  20344. vertexShader: o.skysphere.vertexShader,
  20345. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20346. side: r.BackSide,
  20347. name: "skysphere"
  20348. });
  20349. t.uniforms.radius.value = e.parameters.radius,
  20350. r.Mesh.call(this, e, t)
  20351. }
  20352. var r = e("three")
  20353. , o = e("../shaders")
  20354. , a = e("../settings");
  20355. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20356. t.exports = n
  20357. }
  20358. , {
  20359. "../settings": 166,
  20360. "../shaders": 167,
  20361. three: 217
  20362. }],
  20363. 153: [function(r, o, e) {
  20364. (function(e) {
  20365. "use strict";
  20366. function t(e) {
  20367. n.call(this, e),
  20368. this.sid = e.sid,
  20369. this.panoId = e.panoId,
  20370. this.orthoZoom = e.orthoZoom,
  20371. this.floorVisibility = e.floorVisibility,
  20372. this.thumbUrl = e.thumbUrl,
  20373. this.name = e.name,
  20374. this.zoom = e.zoom
  20375. }
  20376. var i = (r("three"),
  20377. r("../util/logger"))
  20378. , n = (r("../settings"),
  20379. r("../enum/Viewmode"),
  20380. r("../util/common"),
  20381. r("../util/transitions"),
  20382. r("../util/lerp"),
  20383. r("../util/ajax"),
  20384. r("../util/texture"),
  20385. r("./View"));
  20386. r("events").EventEmitter,
  20387. new i(e),
  20388. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20389. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20390. }
  20391. ,
  20392. o.exports = t
  20393. }
  20394. ).call(this, "/js/objects/Snapshot.js")
  20395. }
  20396. , {
  20397. "../enum/Viewmode": 51,
  20398. "../settings": 166,
  20399. "../util/ajax": 181,
  20400. "../util/common": 185,
  20401. "../util/lerp": 188,
  20402. "../util/logger": 189,
  20403. "../util/texture": 194,
  20404. "../util/transitions": 195,
  20405. "./View": 154,
  20406. events: 202,
  20407. three: 217
  20408. }],
  20409. 154: [function(o, a, e) {
  20410. (function(e) {
  20411. "use strict";
  20412. function t(e) {
  20413. e = e || {},
  20414. this.position = new i.Vector3,
  20415. this.quaternion = new i.Quaternion,
  20416. this.update(e)
  20417. }
  20418. var i = o("three")
  20419. , n = o("../util/logger")
  20420. , r = (o("../settings"),
  20421. o("../enum/Viewmode"),
  20422. o("../util/common"),
  20423. o("../util/transitions"),
  20424. o("../util/lerp"),
  20425. o("../util/ajax"),
  20426. o("../util/texture"),
  20427. o("events").EventEmitter);
  20428. new n(e),
  20429. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20430. return !!this.cameraMode
  20431. }
  20432. ,
  20433. t.prototype.update = function(e) {
  20434. return this.cameraMode = e.cameraMode || this.cameraMode,
  20435. this.pano = e.pano || this.pano,
  20436. e.position && this.position.copy(e.position),
  20437. e.quaternion && this.quaternion.copy(e.quaternion),
  20438. this
  20439. }
  20440. ,
  20441. a.exports = t
  20442. }
  20443. ).call(this, "/js/objects/View.js")
  20444. }
  20445. , {
  20446. "../enum/Viewmode": 51,
  20447. "../settings": 166,
  20448. "../util/ajax": 181,
  20449. "../util/common": 185,
  20450. "../util/lerp": 188,
  20451. "../util/logger": 189,
  20452. "../util/texture": 194,
  20453. "../util/transitions": 195,
  20454. events: 202,
  20455. three: 217
  20456. }],
  20457. 155: [function(J, ee, e) {
  20458. (function(e) {
  20459. "use strict";
  20460. function t(e) {
  20461. this.currentPano = null,
  20462. this.nextPano = null,
  20463. this.camera = null,
  20464. this.paused = !1,
  20465. this.flying = !1,
  20466. this.sceneIntersectionPlane = null,
  20467. this.target = new B.Vector3,
  20468. this.mouse = new B.Vector3(1.1,1.1,.5),
  20469. this.mouseAtMouseDown = new B.Vector2,
  20470. this.mouseCouldBeClickToMove = !1,
  20471. this.mouseLastMoveTime = Date.now(),
  20472. this.mouseDown = !1,
  20473. this.mouseDownTimer = null,
  20474. this.couldBeLongTap = !1,
  20475. this.containsMouse = !0,
  20476. this.isTouchEvent = !1,
  20477. this.isPanoHover = !1,
  20478. this.reticule = new n(this),
  20479. this.panoMarkers = [],
  20480. this.spider = new s(this),
  20481. this.quaternion = new B.Quaternion,
  20482. this.position = new B.Vector3(15,10,15),
  20483. this.previousState = null,
  20484. this.lastInsideView = new o,
  20485. this.last360View = new o,
  20486. this.raycaster = new B.Raycaster,
  20487. this.intersect = null,
  20488. this.lastChangeTime = Date.now(),
  20489. this.history = new h,
  20490. this.cameraControls = null,
  20491. this.path = null,
  20492. this.model = null,
  20493. this.domElement = null,
  20494. this.cachedPanoCandidates = null,
  20495. this.basePanoSize = 0,
  20496. this.standardPanoSize = 0,
  20497. this.highPanoSize = 0,
  20498. this.ultraHighPanoSize = 0,
  20499. this.zoomLevel = 1,
  20500. this.zooming = 0,
  20501. this.zoomSpeed = .5,
  20502. this.scrollZoomSpeed = .06,
  20503. this.zoomSpeedAdjust = .05,
  20504. this.defaultZoomIncrement = .2,
  20505. this.baseFov = k.insideFOV,
  20506. this.zoomFov = this.baseFov,
  20507. this.zoomEnabled = !0,
  20508. this.preRenderingEnabled = !1,
  20509. this.setupCustomProperties(e),
  20510. this.zoomStats = new v,
  20511. this.modeTran = 'dollhouse-panorama'
  20512. this.currentCursor = '';
  20513. window.player = this
  20514. }
  20515. var B = J("three")
  20516. , i = J("./util/logger")
  20517. , n = J("./objects/Reticule")
  20518. , a = J("./objects/Panorama")
  20519. , r = J("./objects/ShowPath")
  20520. , o = J("./objects/View")
  20521. , s = (J("./objects/Snapshot"),
  20522. J("./objects/NSpider"))
  20523. , V = J("./enum/Viewmode")
  20524. , T = (J("./enum/TagStates"),
  20525. J("./enum/Vectors"))
  20526. , l = J("./enum/Keys")
  20527. , k = (J("./enum/AlignmentType"),
  20528. J("./settings"))
  20529. , x = J("./util/common")
  20530. , U = (J("./util/browser"),
  20531. J("./util/math"))
  20532. , H = J("./util/lerp")
  20533. , z = J("./util/easing")
  20534. , G = J("./util/transitions")
  20535. , c = J("events").EventEmitter
  20536. , h = (J("./shaders"),
  20537. J("./util/history"))
  20538. , S = (J("./util/camera"),
  20539. J("./model/ModelManager"),
  20540. J("./enum/PathDiscardMode"))
  20541. , M = J("./enum/PathDisplayMode")
  20542. , W = J("./enum/PlayerEvents")
  20543. , u = J("./enum/ControlEvents")
  20544. , d = J("./enum/ModelManagerEvents")
  20545. , R = J("./enum/WarpStyle")
  20546. , P = J("./enum/BlackoutStyle")
  20547. , p = J("./exception/BasicException")
  20548. , f = J("./enum/PanoSizeClass")
  20549. , g = (J("./tile/TileDownloader"),
  20550. J("./tile/TilePrioritizer"))
  20551. , m = (J("./enum/PanoramaEvents"),
  20552. J("./enum/ZoomEvents"))
  20553. , v = J("./util/ZoomStats")
  20554. , y = J("./constants")
  20555. , j = J("./util/common")
  20556. , A = J("./util/cameraLight")
  20557. , C = J("hot")
  20558. , Y = new i(e)
  20559. , q = Object.freeze({
  20560. FlyToPano: G.getUniqueId(),
  20561. FlyToNewMode: G.getUniqueId(),
  20562. FlyToSameMode: G.getUniqueId(),
  20563. FlyToViewFloor: G.getUniqueId(),
  20564. LookTransition: G.getUniqueId(),
  20565. ZoomTransition: G.getUniqueId()
  20566. });
  20567. function I(e) {
  20568. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20569. o[r] = n.charCodeAt(r);
  20570. return new Blob([o],{
  20571. type: i
  20572. })
  20573. }
  20574. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20575. this.modelManager = e.modelManager,
  20576. this.tileDownloader = e.tileDownloader,
  20577. this.panoRenderer = e.panoRenderer,
  20578. this.qualityManager = e.qualityManager,
  20579. this.domElement = e.container,
  20580. this.camera = e.camera,
  20581. this.tagManager = e.tagManager,
  20582. this.cameraControls = e.controls,
  20583. this.path = new r(e.director,this,e.controls),
  20584. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20585. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20586. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20587. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20588. this.tileDownloader.processPriorityQueue = !1,
  20589. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20590. this.bindEvents(e.container),
  20591. this.updateModel()
  20592. }
  20593. ,
  20594. t.prototype.screenShot = function(i) {
  20595. if (!this.flying && !this.flyingToTag) {
  20596. var n = this.sceneRenderer;
  20597. n.updateScreenSize(i)
  20598. this.model.panos.forEach(e=>{
  20599. if(e.marker){
  20600. e.marker.forceHide = e.marker.visible
  20601. e.marker.visible = !1;
  20602. }
  20603. })
  20604. /* for (var e in this.model.hots)
  20605. this.model.hots[e].mesh.visible = !1; */
  20606. player.model.hotGroup.visible = false
  20607. this.reticule.visible = !1,
  20608. this.reticule.forceUnvisible = !0,
  20609. this.path.currentPanoMarker.mesh.visible = !1,
  20610. setTimeout(function() {
  20611. n.renderer.clear(!0, !0, !0),
  20612. n.renderer.render(n.scene, n.camera);
  20613. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20614. i.f && i.f(e)
  20615. n.updateScreenSize({
  20616. resize: !0
  20617. })
  20618. this.reticule.visible = !0
  20619. player.model.hotGroup.visible = true
  20620. this.model.panos.forEach(e=>{
  20621. e.marker && (e.marker.visible = e.marker.forceHide);
  20622. })
  20623. this.path.currentPanoMarker.mesh.visible = !0,
  20624. n.renderer.render(n.scene, n.camera)
  20625. }
  20626. .bind(this), 30)
  20627. }
  20628. }
  20629. ;
  20630. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20631. t.prototype.getWrapShot = function() {
  20632. var i = this.getSnapAngleInfo()
  20633. , n = ",{\r\t" + i
  20634. , r = arguments[0];
  20635. this.screenShot({
  20636. width: g_snapShotWidth,
  20637. height: g_snapShotHeight,
  20638. type: "image/jpeg",
  20639. f: function(e) {
  20640. if (r && r.__callback)
  20641. return r.__callback(e, i);
  20642. var t = new Image;
  20643. t.src = e,
  20644. t.onload = function() {
  20645. var e = function(r, i) {
  20646. function n(e, t) {
  20647. var i = o || r
  20648. , n = document.createElement("canvas");
  20649. n.width = i.width,
  20650. n.height = i.height,
  20651. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20652. o = Q(e, n, t)
  20653. }
  20654. function e() {
  20655. var e = o || r
  20656. , t = I(e.src);
  20657. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20658. t = I(e.src)),
  20659. (o = o || new Image).base64Src = e.src,
  20660. o.src = window.URL.createObjectURL(t)
  20661. }
  20662. var o, t = Math.max(r.width, r.height);
  20663. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20664. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20665. e())),
  20666. o || r
  20667. }(this, {
  20668. maxSize: g_snapShotWidth,
  20669. oldType: "jpeg"
  20670. });
  20671. e.src.replace(function(e) {
  20672. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20673. }("image/jpeg"), "image/octet-stream");
  20674. var t = "snap" + (new Date).getTime();
  20675. !function(e, t) {
  20676. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20677. i.href = e,
  20678. i.download = t;
  20679. var n = document.createEvent("MouseEvents");
  20680. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20681. i.dispatchEvent(n)
  20682. }(e.src, t + ".jpg"),
  20683. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20684. n += '\r\t"sid":"' + t + '",',
  20685. n += '\r\t"name":"' + t + '"\r}',
  20686. logData(n)
  20687. }
  20688. }
  20689. })
  20690. }
  20691. /* ,
  20692. t.prototype.getSnapAngleInfo = function() {
  20693. var e = {}
  20694. , t = '"metadata":{'
  20695. , i = this.camera.quaternion.clone();
  20696. switch (this.mode) {
  20697. case "panorama":
  20698. e.scan_id = this.currentPano.id,
  20699. t += '"scan_id":"' + this.currentPano.id + '",';
  20700. break;
  20701. case "floorplan":
  20702. e.camera_mode = 1,
  20703. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20704. t += '"camera_mode":1,',
  20705. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20706. break;
  20707. case "dollhouse":
  20708. e.camera_mode = 2,
  20709. t += '"camera_mode":2,'
  20710. }
  20711. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20712. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20713. n.x *= -1,
  20714. n.w *= -1,
  20715. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20716. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20717. e.zoom = this.zoomLevel,
  20718. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20719. }
  20720. , */
  20721. t.prototype.getSnapAngleInfo = function(){
  20722. var info = {};
  20723. var str = '"metadata":{';
  20724. var q = this.camera.quaternion.clone();
  20725. switch (this.mode) {
  20726. case "panorama":
  20727. info.scan_id = this.currentPano.id;
  20728. str += ('"scan_id":"'+this.currentPano.id+'",');
  20729. break;
  20730. case "floorplan":
  20731. info.camera_mode = 1;
  20732. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20733. q.multiply(this.camera.quaternion);
  20734. str += ('"camera_mode":1,');
  20735. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20736. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20737. break;
  20738. case "dollhouse":
  20739. info.camera_mode = 2;
  20740. str += ('"camera_mode":2,');
  20741. break;
  20742. }
  20743. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20744. //console.log(info.camera_position)
  20745. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20746. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20747. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20748. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20749. out.x *= -1;
  20750. out.w *= -1;
  20751. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20752. }else{
  20753. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20754. } */
  20755. info.zoom = this.zoomLevel;
  20756. //console.log(info.camera_quaternion)
  20757. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20758. // fyz 扩展编辑页面, 加上导览点缩放值
  20759. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20760. console.log(str)
  20761. return str;
  20762. }
  20763. //------end
  20764. t.prototype.closePopup = function() {
  20765. if (g_currentHot) {
  20766. g_currentHot = null,
  20767. document.getElementById("popup").style.display = "none",
  20768. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20769. $("#popup iframe:last").remove();
  20770. document.getElementById("bgaudio");
  20771. if(g_bgAudio && g_bgAudio.pauseByHot){
  20772. manage.switchBgmState(true)
  20773. }
  20774. return false
  20775. }
  20776. }
  20777. ,
  20778. t.prototype.setupCustomProperties = function(e) {
  20779. var i = e || V.PANORAMA;
  20780. Object.defineProperty(this, "mode", {
  20781. get: function() {
  20782. return i
  20783. },
  20784. set: function(e) {
  20785. var t = i;
  20786. i = e,
  20787. this.onModeUpdated(t, i)
  20788. }
  20789. })
  20790. }
  20791. ,
  20792. t.prototype.isInMode = function() {
  20793. for (var e = 0; e < arguments.length; e++)
  20794. if (this.mode === arguments[e])
  20795. return !0;
  20796. return !1
  20797. }
  20798. ,
  20799. t.prototype.isOutsideMode = function(e) {
  20800. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20801. }
  20802. ,
  20803. t.prototype.is360View = function(e, t) {
  20804. return e === V.PANORAMA && t && !t.isAligned()
  20805. }
  20806. ,
  20807. t.prototype.setScene = function(e) {
  20808. this.sceneIntersectionPlane = e.plane,
  20809. this.path.setScene(e),
  20810. this.moveReticuleToScene(e)
  20811. }
  20812. ,
  20813. t.prototype.moveReticuleToScene = function(e) {
  20814. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20815. e.add(this.reticule)
  20816. }
  20817. ,
  20818. t.prototype.updateModel = function() {
  20819. function n(e) {
  20820. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20821. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20822. , n = t.position.y + (e - i.target.y)
  20823. , r = k.showFloorDuration + k.showFloorDelay;
  20824. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20825. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20826. }
  20827. this.model = this.modelManager.getActiveModel(),
  20828. this.model.on("floor.changed", function(e, t, i) {
  20829. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20830. }
  20831. .bind(this)),
  20832. this.model.on("allfloors.toggled", function(e, t) {
  20833. if (this.mode === V.DOLLHOUSE) {
  20834. var i = e ? this.model.center.y : i = t.center.y;
  20835. n.call(this, i)
  20836. }
  20837. }
  20838. .bind(this)),
  20839. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20840. var t = this;
  20841. this.model.panos.list.forEach(function(e) {
  20842. e.vrMarker.addEventListener("click", function() {
  20843. t.flyToPano({
  20844. pano: e
  20845. })
  20846. })
  20847. })
  20848. }
  20849. ,
  20850. t.prototype.updateModelDependentData = function() {
  20851. this.cameraControls.setModelForControls(this.model),
  20852. this.getPanoMarkersFromModel(this.model)
  20853. }
  20854. ,
  20855. t.prototype.onModelChanged = function() {
  20856. this.updateModel(),
  20857. this.updateModelDependentData()
  20858. }
  20859. ,
  20860. t.prototype.getPanoMarkersFromModel = function(e) {
  20861. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20862. return t.marker ? e.concat(t.marker) : e
  20863. }, [])
  20864. }
  20865. ,
  20866. t.prototype.handleControlMove = function(e) {
  20867. this.emit(W.Move, e)
  20868. }
  20869. ,
  20870. t.prototype.handleControlInputStart = function(e) {
  20871. this.emit(W.InputStart, e)
  20872. }
  20873. ,
  20874. t.prototype.onModeUpdated = function(e, t) {
  20875. this.cameraControls.activateControls(t),
  20876. this.emit(W.ModeChanged, e, t)
  20877. }
  20878. ,
  20879. t.prototype.isWarping = function() {
  20880. return this.path.warping
  20881. }
  20882. ,
  20883. t.prototype.isWaitingToWarp = function() {
  20884. return this.path.waitingToWarp
  20885. }
  20886. ,
  20887. t.prototype.getLabelScaleFactor = function() {
  20888. if (this.isOutsideMode()) {
  20889. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20890. }
  20891. return .5
  20892. }
  20893. ,
  20894. t.prototype.changeMusic = function() {
  20895. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20896. }
  20897. ,
  20898. t.prototype.bindEvents = function(e) {
  20899. e !== document && e.setAttribute("tabindex", -1),
  20900. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20901. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20902. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20903. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20904. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20905. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20906. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20907. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20908. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20909. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20910. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20911. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20912. document.addEventListener("pointerup", ()=>{//add
  20913. window.transformControls && transformControls.onPointerUp()
  20914. }),
  20915. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20916. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20917. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20918. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20919. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20920. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20921. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20922. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20923. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20924. window.getSeft && getSeft(this),
  20925. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20926. }
  20927. ,
  20928. t.prototype.onMouseDown = function(e) {
  20929. e.currentTarget !== document && e.currentTarget.focus(),
  20930. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20931. this.updateIntersect())
  20932. }
  20933. ,
  20934. t.prototype.onMouseMove = function(e) {
  20935. this.isTouchEvent = !1,
  20936. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20937. }
  20938. ,
  20939. t.prototype.onMouseOver = function(e) {
  20940. this.containsMouse = !0,
  20941. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20942. }
  20943. ,
  20944. t.prototype.onMouseOut = function(e) {
  20945. this.containsMouse = !1
  20946. }
  20947. ,
  20948. t.prototype.onMouseUp = function(e) {
  20949. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20950. }
  20951. ,
  20952. t.prototype.onTouchStart = function(e) {
  20953. if (e.currentTarget !== document && e.currentTarget.focus(),
  20954. !this.mouseDown) {
  20955. this.couldBeLongTap = !0;
  20956. var t = x.average(e.changedTouches, "clientX")
  20957. , i = x.average(e.changedTouches, "clientY");
  20958. this.handleInputStart.call(this, t, i, !0),
  20959. this.mouseDownTimer = setTimeout(function() {
  20960. this.updateIntersect(),
  20961. this.handleInputEnd.call(this, t, i, !0)
  20962. }
  20963. .bind(this), k.input.longTapThreshold)
  20964. }
  20965. }
  20966. ,
  20967. t.prototype.onTouchMove = function(e) {
  20968. var t = x.average(e.changedTouches, "clientX")
  20969. , i = x.average(e.changedTouches, "clientY");
  20970. this.handleInputMove.call(this, t, i, !0)
  20971. }
  20972. ,
  20973. t.prototype.onTouchEnd = function(e) {
  20974. if (clearTimeout(this.mouseDownTimer),
  20975. this.mouseDown) {
  20976. this.couldBeLongTap = !1,
  20977. this.updateIntersect();
  20978. var t = x.average(e.changedTouches, "clientX")
  20979. , i = x.average(e.changedTouches, "clientY");
  20980. this.handleInputEnd.call(this, t, i, !0)
  20981. }
  20982. }
  20983. ,
  20984. t.prototype.onPointerDown = function(e) {
  20985. return e.currentTarget !== document && e.currentTarget.focus(),
  20986. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20987. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20988. void (this.mouseDownTimer = setTimeout(function() {
  20989. this.updateIntersect(),
  20990. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20991. }
  20992. .bind(this), k.input.longTapThreshold)))
  20993. }
  20994. ,
  20995. t.prototype.onPointerMove = function(e) {
  20996. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20997. }
  20998. ,
  20999. t.prototype.onPointerUp = function(e) {
  21000. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21001. this.couldBeLongTap = !1,
  21002. this.updateIntersect(),
  21003. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21004. }
  21005. ,
  21006. t.prototype.onPointerOut = function(e) {
  21007. this.mouseDown = !1
  21008. }
  21009. ,
  21010. t.prototype.onPointerCancel = function(e) {
  21011. this.mouseDown = !1
  21012. }
  21013. ,
  21014. t.prototype.onKeyDown = function(e) {
  21015. var t = function() {
  21016. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  21017. }
  21018. .bind(this)
  21019. , i = e.which;
  21020. switch (i) {
  21021. case l.F:
  21022. t(),
  21023. this.changeFloor(-1);
  21024. break;
  21025. case l.R:
  21026. t(),
  21027. this.changeFloor(1)
  21028. }
  21029. if (this.mode === V.PANORAMA)
  21030. switch (i) {
  21031. case l.UPARROW:
  21032. case l.W:
  21033. this.flyLocalDirection(T.FORWARD.clone());
  21034. break;
  21035. case l.DOWNARROW:
  21036. case l.S:
  21037. this.flyLocalDirection(T.BACK.clone());
  21038. break;
  21039. case l.A:
  21040. this.flyLocalDirection(T.LEFT.clone());
  21041. break;
  21042. case l.D:
  21043. this.flyLocalDirection(T.RIGHT.clone())
  21044. }
  21045. }
  21046. ,
  21047. t.prototype.handleScrollPinchZoom = function(e) {
  21048. var t = e
  21049. , i = this.zoomLevel;
  21050. this.zoomBy(t),
  21051. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21052. }
  21053. ,
  21054. t.prototype.handleControlPinch = function(e) {
  21055. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  21056. }
  21057. ,
  21058. t.prototype.handleControlScroll = function(e) {
  21059. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21060. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  21061. }
  21062. ,
  21063. t.prototype.handleInputStart = function(e, t, i) {
  21064. var n = this.handelPadding(e, t);
  21065. e = n.x,
  21066. t = n.y,
  21067. this.isTouchEvent = i,
  21068. U.convertScreenPositionToNDC(e, t, this.mouse),
  21069. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21070. this.mouseCouldBeClickToMove = !0,
  21071. this.mouseDown = !0
  21072. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  21073. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  21074. window.transformControls && transformControls.onPointerDown()
  21075. }
  21076. ,
  21077. t.prototype.handelPadding = function(e, t) {
  21078. return this.pad || (this.pad = {
  21079. x: dom.getOffset("left", $("#player")[0]),
  21080. y: dom.getOffset("top", $("#player")[0])
  21081. }),
  21082. {
  21083. x: e - this.pad.x,
  21084. y: t - this.pad.y
  21085. }
  21086. }
  21087. ,
  21088. t.prototype.handleInputMove = function(e, t, i) {
  21089. var n = this.handelPadding(e, t);
  21090. e = n.x,
  21091. t = n.y,
  21092. this.isTouchEvent = i,
  21093. U.convertScreenPositionToNDC(e, t, this.mouse);
  21094. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  21095. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21096. this.couldBeLongTap = !1,
  21097. clearTimeout(this.mouseDownTimer)),
  21098. this.mouseLastMoveTime = Date.now(),
  21099. this.reticule.move(e, t, i)
  21100. window.transformControls && transformControls.onPointerMove()
  21101. }
  21102. ,
  21103. t.prototype.handleInputEnd = function(e, t, i) {
  21104. if (this.isTouchEvent = i,
  21105. this.mouseDown = !1,
  21106. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  21107. !i && this.couldBeLongTap)
  21108. return !0;
  21109. if (this.handleLongTap())
  21110. return !0;
  21111. window.transformControls && transformControls.onPointerUp()
  21112. if (this.mouseCouldBeClickToMove) {
  21113. if (this.flying)
  21114. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21115. !0;
  21116. //add----
  21117. if (this.checkHotClick())
  21118. return !0;
  21119. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  21120. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  21121. return;
  21122. }
  21123. if (window.VisiSet && VisiSet.setTagVisible ) {
  21124. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  21125. return;
  21126. }
  21127. if (window.VisiSet && VisiSet.setPanoLog ) {
  21128. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  21129. return;
  21130. }
  21131. if(this.hoveringPlane){
  21132. this.clickOverlay(this.hoveringPlane)
  21133. return;
  21134. }
  21135. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  21136. return EditOverlay.addPlane({intersect:this.intersect});
  21137. }
  21138. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  21139. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  21140. else if(objects.mainDesign.editType == "addOverlay")return !0;
  21141. } */
  21142. //----------
  21143. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  21144. this.history.invalidate(),
  21145. this.intersect)
  21146. return this.flyToPanoClosestToMouse();
  21147. if (this.mode === V.PANORAMA) {
  21148. var n = this.closestPanoInDirection(this.getMouseDirection());
  21149. return n ? this.flyToPano({
  21150. pano: n
  21151. }) : this.bump(this.getMouseDirection())
  21152. }
  21153. }
  21154. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21155. }
  21156. ,
  21157. t.prototype.handleLongTap = function() {
  21158. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  21159. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  21160. !0
  21161. }
  21162. ,
  21163. t.prototype.checktagClick = function() {
  21164. if (this.tagManager.intersectTag) {
  21165. var e = this.isTouchEvent
  21166. , t = this.tagManager.clickedOnTag(e, this);
  21167. return e || t || G.cancelById(q.LookTransition),
  21168. !0
  21169. }
  21170. if (this.tagManager.activeTag)
  21171. return this.tagManager.dismissActiveTag(),
  21172. !1
  21173. }
  21174. ,
  21175. t.prototype.rankedtagInDirection = function(e, t) {
  21176. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21177. }
  21178. ,
  21179. t.prototype.start = function(e) {
  21180. $(".toolLeft").removeClass("unable");
  21181. $(".toolTop").removeClass("unable");
  21182. //-------------------
  21183. window.initTransformCtl(B)
  21184. //this.model.loadOverlays()
  21185. //window.EditOverlay && window.EditOverlay.init(B);
  21186. window.VisiSet && VisiSet.init()
  21187. //-------------------
  21188. var t = e.mode
  21189. , i = e.pano
  21190. , n = e.position
  21191. , r = e.quaternion
  21192. , o = e.tag
  21193. , a = e.quickstart
  21194. , s = $.Deferred();
  21195. this.updateModelDependentData(),
  21196. this.updateFromControls(),
  21197. this.findDefaultViews();
  21198. var l = this.is360View(t, i);
  21199. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21200. s.done(function(e) {
  21201. this.emit(W.Ready, l, e, o)
  21202. }
  21203. .bind(this)),
  21204. s.promise()
  21205. }
  21206. ,
  21207. t.prototype.startOutside = function(e, t) {
  21208. var i = e.mode
  21209. , n = e.pano
  21210. , r = e.position
  21211. , o = e.quaternion
  21212. , a = e.zoom
  21213. , s = e.floorVisibility
  21214. , l = e.tag;
  21215. this.emit(W.StartOutside, k[i].transitionTime),
  21216. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21217. G.cancelById(q.FlyToViewFloor),
  21218. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21219. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21220. }
  21221. ,
  21222. t.prototype.startInside = function(e, t, i, n, r) {
  21223. r = r || $.Deferred();
  21224. var o = (this.currentPano = e) && !e.isAligned();
  21225. if (t = o ? e.position : t || e.position,
  21226. i = i || e.quaternion,
  21227. e) {
  21228. var a = this.startInside.bind(this, e, t, i, n, r);
  21229. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21230. return
  21231. }
  21232. //add
  21233. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21234. //this.updateHotVisible()
  21235. //EditOverlay.updatePano()
  21236. editTool.hotpoint.updatePano()
  21237. Hot.updateVisibles([this.currentPano])
  21238. return this.mode = V.PANORAMA,
  21239. e.floor.enter(this.mode),
  21240. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  21241. this.switchCameraMode(this.mode, i),
  21242. this.emit(W.StartInside, o),
  21243. r.resolve(!0),
  21244. r
  21245. }
  21246. ,
  21247. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  21248. if (r = r || $.Deferred(),
  21249. this.dollhouseMode(),
  21250. !i)
  21251. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21252. r.resolve(!1),
  21253. r;
  21254. e = e || i.position;
  21255. var o = n || this.cameraControls.activeControl.camera.quaternion
  21256. , a = i.position;
  21257. return this.fitDollhouse(a, e, o),
  21258. setTimeout(function(e) {
  21259. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  21260. var t = {
  21261. mode: V.PANORAMA,
  21262. pano: i,
  21263. quaternion: n,
  21264. callback: function() {
  21265. this.emit(W.FlyinFinished),
  21266. r.resolve(!0)
  21267. }
  21268. .bind(this)
  21269. };
  21270. this.flyToNewMode(t)
  21271. }
  21272. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  21273. r
  21274. }
  21275. ,
  21276. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  21277. K = {},
  21278. function(t, e, i, n, r, o, a, s, l, c) {
  21279. if (function() {
  21280. for (var e in Z)
  21281. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  21282. return !0;
  21283. return !1
  21284. }())
  21285. return !0;
  21286. var h = function(e, t, i) {
  21287. j.delayOneFrame(function() {
  21288. Z[e] = !1,
  21289. r && r(t, i)
  21290. }
  21291. .bind(this))
  21292. }
  21293. .bind(this, t.id)
  21294. , u = function(e, t) {
  21295. j.delayOneFrame(function() {
  21296. Z[e] = !1,
  21297. o && o(t)
  21298. }
  21299. .bind(this))
  21300. }
  21301. .bind(this, t.id);
  21302. try {
  21303. return null != s || (s = !0),
  21304. 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),
  21305. Z[t.id] && (K[t.id] = performance.now()),
  21306. Z[t.id]
  21307. } catch (e) {
  21308. throw Z[t.id] = !1,
  21309. K[t.id] = performance.now() - 5e3,
  21310. e
  21311. }
  21312. }
  21313. ),
  21314. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21315. if (!e)
  21316. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21317. return r && this.model.waitForLoad(e, function() {
  21318. return e.isLoaded(i)
  21319. }),
  21320. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21321. !0)
  21322. }
  21323. ,
  21324. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21325. function(e, t, i, n, r, o, a, s) {
  21326. if (!e)
  21327. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21328. return X.copy(T.FORWARD),
  21329. this.getDirection(X),
  21330. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21331. return e.isLoaded(t)
  21332. }),
  21333. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21334. i && i(e, t)
  21335. }
  21336. .bind(this)).fail(function(e) {
  21337. n && n(e)
  21338. }
  21339. .bind(this)).progress(function(e, t, i) {
  21340. r && r(e, t, i)
  21341. }
  21342. .bind(this)),
  21343. !0)
  21344. }
  21345. ),
  21346. t.prototype.switchCameraMode = function(e, t) {
  21347. var i = this.cameraControls.controls[e]
  21348. , n = i.camera;
  21349. switch (e) {
  21350. case V.PANORAMA:
  21351. n.position.copy(this.currentPano.position);
  21352. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21353. i.lookAt(r.add(n.position));
  21354. break;
  21355. case V.DOLLHOUSE:
  21356. var o = this.position.clone();
  21357. 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),
  21358. n.position.copy(o),
  21359. i.target.copy(this.target.clone().setY(this.model.center.y));
  21360. break;
  21361. //for多楼层 且 让模型刚好适应屏幕
  21362. /* var box = this.model.boundingBox.clone();
  21363. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21364. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21365. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21366. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21367. console.log(boxSize.x,distance, boxSize.length() / 2)
  21368. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21369. if(this.mode === V.PANORAMA){
  21370. i.target.copy(this.model.center);
  21371. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21372. }else{
  21373. i.target.copy(this.target.clone().setY(this.model.center.y))
  21374. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21375. }
  21376. vec.multiplyScalar(distance )
  21377. n.position.copy(i.target.clone().add(vec)) */
  21378. break
  21379. case V.FLOORPLAN:
  21380. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21381. i.target.copy(this.model.center).setY(0),
  21382. i.zoomToContain(this.model.size),
  21383. i.rotateToView(this.model.size, this.getDirection())
  21384. }
  21385. i.update(0)
  21386. }
  21387. ,
  21388. t.prototype.update = (new B.Vector3,
  21389. N = {},
  21390. F = [],
  21391. function(e) {
  21392. this.updatePersistentZooming(e),
  21393. this.updateFromControls(e),
  21394. this.getCurrentNodePanos(F)
  21395. if(this.hasChanged(N)){
  21396. this.lastChangeTime = Date.now(),
  21397. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21398. this.emit(W.ViewChanged)
  21399. //add:
  21400. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  21401. this.intersectHot && this.intersectHot.showTitle()
  21402. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  21403. for(var i in this.model.hots){
  21404. this.model.hots[i].update(this)
  21405. }
  21406. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  21407. overlay.update()
  21408. }) */
  21409. }
  21410. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21411. this.model.supportsTiles && (this.updateTileDownloader(F),
  21412. this.updatePanoRenderer(F)),
  21413. this.updatePreRendering(F),
  21414. this.reticule.update(),
  21415. this.path.update(),
  21416. this.spider.update(),
  21417. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21418. this.updateControlLocks(),
  21419. this.model.supportsTiles && this.updateZoomPano()
  21420. }
  21421. ),
  21422. t.prototype.updatePersistentZooming = function(e) {
  21423. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21424. }
  21425. ,
  21426. t.prototype.updateControlLocks = function() {
  21427. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21428. }
  21429. ,
  21430. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21431. function(e) {
  21432. var t = this.nextPano || this.currentPano;
  21433. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21434. this.getDirection(D),
  21435. this.panoRenderer.updateDirection(D))
  21436. }
  21437. ),
  21438. t.prototype.cleanupInactivePanos = (O = [],
  21439. L = [],
  21440. function() {
  21441. O.length = 0,
  21442. O.push(this.currentPano),
  21443. this.nextPano && O.push(this.nextPano);
  21444. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21445. L.push(this.panoRenderer.activePanos[e]);
  21446. for (var t = 0; t < L.length; t++) {
  21447. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21448. i.id === O[r].id && (n = !1);
  21449. n && i.exit()
  21450. }
  21451. }
  21452. ),
  21453. t.prototype.updatePreRendering = (w = {},
  21454. function(e) {
  21455. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21456. var t = this.nextPano || this.currentPano;
  21457. if (t && e && 1 < e.length) {
  21458. var i = e.findIndex(function(e) {
  21459. if (e.id === t.id)
  21460. return !0
  21461. });
  21462. if (0 <= i && i + 1 < e.length) {
  21463. var n = e[i + 1];
  21464. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21465. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21466. window.setTimeout(function(e) {
  21467. w[e.id] = !1
  21468. }
  21469. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21470. }
  21471. .bind(this, n), k.tiling.panoPreRenderDelay),
  21472. w[n.id] = !0)
  21473. }
  21474. }
  21475. }
  21476. }
  21477. ),
  21478. t.prototype.enablePreRendering = function() {
  21479. this.preRenderingEnabled = !0
  21480. }
  21481. ,
  21482. t.prototype.disablePreRendering = function() {
  21483. this.preRenderingEnabled = !1,
  21484. this.cleanupInactivePanos()
  21485. }
  21486. ,
  21487. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21488. function(e) {
  21489. var t = this.nextPano || this.currentPano;
  21490. t && (b.copy(T.FORWARD),
  21491. this.getDirection(b),
  21492. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21493. this.tileDownloader.processPriorityQueue = !0)
  21494. }
  21495. ),
  21496. t.prototype.updateFromControls = function(e) {
  21497. null != e || (e = 0),
  21498. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21499. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21500. this.position.copy(this.cameraControls.activeControl.camera.position),
  21501. this.target.copy(this.cameraControls.activeControl.target),
  21502. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21503. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21504. this.camera.position.copy(this.position),
  21505. this.camera.quaternion.copy(this.quaternion),
  21506. this.camera.updateMatrix(),
  21507. this.camera.updateMatrixWorld()
  21508. }
  21509. ,
  21510. t.prototype.hasChanged = function(e) {
  21511. if (!this.previousState)
  21512. return this.previousState = {
  21513. allFloorsVisible: this.model.allFloorsVisible,
  21514. position: this.position.clone(),
  21515. quaternion: this.quaternion.clone(),
  21516. mouse: this.mouse.clone(),
  21517. labelScaleFactor: this.getLabelScaleFactor(),
  21518. currentFloor: this.model.currentFloor,
  21519. projectionMatrix: this.camera.projectionMatrix.clone(),
  21520. worldMatrix: this.camera.matrixWorld.clone(),
  21521. mode: this.mode,
  21522. modelPosition: this.model.position.clone(),
  21523. modelCenter: this.model.center.clone(),
  21524. zoomLevel: this.zoomLevel
  21525. },
  21526. !0;
  21527. 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;
  21528. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21529. e.moved = !this.position.equals(this.previousState.position),
  21530. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21531. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21532. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21533. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21534. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21535. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21536. e.modeChanged = this.mode !== this.previousState.mode,
  21537. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21538. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21539. e.nextPanoActive = null !== this.nextPano,
  21540. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21541. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21542. this.previousState.position.copy(this.position),
  21543. this.previousState.quaternion.copy(this.quaternion),
  21544. this.previousState.mouse.copy(this.mouse),
  21545. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21546. this.previousState.currentFloor = this.model.currentFloor,
  21547. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21548. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21549. this.previousState.mode = this.mode,
  21550. this.previousState.modelPosition.copy(this.model.position),
  21551. this.previousState.modelCenter.copy(this.model.center),
  21552. this.previousState.zoomLevel = this.zoomLevel,
  21553. !t
  21554. }
  21555. ,
  21556. t.prototype.updateIntersect = function() {
  21557. var e = this.flying || this.isWarping()
  21558. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21559. , i = G.getById(q.LookTransition);
  21560. e || t || this.isTouchEvent || i.length && i[0].running;
  21561. {//clear:
  21562. if(this.intersectHot) this.intersectHot.hideTitle()
  21563. this.intersectHot = null
  21564. $("#player").css("cursor", "")
  21565. $(".toolRight .spotList ul li").removeClass("active")
  21566. }
  21567. var deal = ()=>{
  21568. if(this.intersect && this.intersect.object.visible ){
  21569. if("hotSprite" == this.intersect.object.type){
  21570. this.intersectHot = this.intersect.object
  21571. while(!(this.intersectHot instanceof Hot)){
  21572. this.intersectHot = this.intersectHot.parent
  21573. }
  21574. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21575. this.intersectHot.showTitle()
  21576. }
  21577. }
  21578. }
  21579. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  21580. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  21581. deal()
  21582. if(this.intersect){
  21583. $("#player").css("cursor", "pointer");
  21584. }
  21585. if(this.intersectHot){
  21586. this.intersect = null
  21587. }
  21588. return
  21589. }else if (g_HotStatus) {//加热点
  21590. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  21591. if(this.intersect){
  21592. $("#player").css("cursor", "cell")
  21593. }else{
  21594. $("#player").css("cursor", "not-allowed")
  21595. }
  21596. return;
  21597. }else{
  21598. if(this.model.hotGroup){
  21599. if(editTool.atPanel == 'hotpoint'){
  21600. var hots = this.model.hotGroup.children
  21601. }else{
  21602. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot )
  21603. }
  21604. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21605. if(this.intersect){
  21606. deal()
  21607. this.intersectHot && $("#player").css("cursor", "pointer");
  21608. return;
  21609. }
  21610. }
  21611. }
  21612. this.intersect = this.getMouseIntersect(),
  21613. this.intersect && this.updateClosestPano(this.intersect),
  21614. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21615. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21616. }
  21617. ,
  21618. t.prototype.checkHotClick = function() {
  21619. if (this.intersectHot){
  21620. if (window.VisiSet && VisiSet.setTagVisible ) {
  21621. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21622. return;
  21623. }else if(editTool.atPanel == 'hotpoint'){
  21624. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  21625. var sure = confirm("是否保存当前热点?")
  21626. if(sure){
  21627. editTool.hotpoint.saveHot().then(()=>{
  21628. editTool.hotpoint.editHot(this.intersectHot)
  21629. })
  21630. }else{
  21631. editTool.hotpoint.editHot(this.intersectHot)
  21632. }
  21633. }else{
  21634. editTool.hotpoint.editHot(this.intersectHot)
  21635. }
  21636. }else{
  21637. this.intersectHot.examine()
  21638. }
  21639. return !0
  21640. }
  21641. }
  21642. ,
  21643. t.prototype.getMouseDirection = function(e) {
  21644. e = e || this.mouse;
  21645. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21646. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21647. }
  21648. ,
  21649. t.prototype.hoverOverlay = function(mesh){
  21650. if(!mesh){
  21651. this.hoveringPlane = null;
  21652. $("#player").css("cursor",this.currentCursor || "" );
  21653. }else{
  21654. var overlay = mesh.parent;
  21655. $("#player").css("cursor","pointer");
  21656. this.hoveringPlane = overlay;
  21657. return true;
  21658. }
  21659. },
  21660. t.prototype.clickOverlay = function(overlay){
  21661. if(this.openOverlay && !overlay)return;
  21662. var plane = overlay.plane;
  21663. if(overlay.texType == "video"){
  21664. overlay.switchPlay(!!overlay.pausedByUser)
  21665. }
  21666. if(window.EditOverlay && EditOverlay.editing){
  21667. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21668. var sure = confirm("是否保存当前展览?")
  21669. if(sure){
  21670. $("#overlayProp button.submit").click()
  21671. }else{
  21672. EditOverlay.closeOverlayPanel('cancel')
  21673. }
  21674. }
  21675. EditOverlay.beginEdit(overlay);
  21676. return;
  21677. }
  21678. },
  21679. t.prototype.getMouseIntersect = function(e, t1) {
  21680. e = e || this.mouse.clone()
  21681. var t = t1 || this.model.floors.reduce(function(e, t) {
  21682. return t.hidden ? e : e.concat(t.collider.children)
  21683. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21684. t = t.slice(0)
  21685. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21686. this.raycaster.set(i, this.getMouseDirection(e));
  21687. var n = this.raycaster.intersectObjects(t , true );//add true
  21688. var o = n[0];
  21689. if(o){
  21690. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21691. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21692. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21693. o.horizontal = .8 < o.normal.y);
  21694. return o
  21695. }
  21696. }
  21697. ,
  21698. t.prototype.updateClosestPano = function(e) {
  21699. var t = [a.filters.isPanoAligned()];
  21700. if (this.mode === V.PANORAMA) {
  21701. if (!this.currentPano)
  21702. return;
  21703. t.push(a.filters.not(this.currentPano)),
  21704. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21705. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21706. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21707. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21708. } else{
  21709. t.push((pano)=>{ // add
  21710. return this.checkHasNeighbor(pano)
  21711. })
  21712. t.push(a.filters.isOnVisibleFloor()),
  21713. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21714. }
  21715. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21716. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21717. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21718. this.closestPano = i) : this.isPanoHover = !1
  21719. }
  21720. ,
  21721. t.prototype.dollhouseMode = function(e, t) {
  21722. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21723. this.mode = V.DOLLHOUSE,
  21724. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21725. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21726. , n = new B.Vector3(15,10,15);
  21727. if (e && t) {
  21728. var r = T.FORWARD.clone().applyQuaternion(t)
  21729. , o = this.model.center.clone().sub(e).dot(r);
  21730. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21731. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21732. }
  21733. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21734. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21735. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21736. this.updateFromControls(),
  21737. this.model.alpha = 1,
  21738. this.model.skybox.material.uniforms.opacity.value = 0
  21739. }
  21740. ,
  21741. t.prototype.insideMode = function(e, t) {
  21742. var i = $.Deferred()
  21743. , n = t || null;
  21744. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21745. var r = [a.filters.isPanoAligned()];
  21746. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21747. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21748. this.flyToNewMode({
  21749. mode: V.PANORAMA,
  21750. pano: e,
  21751. callback: n
  21752. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21753. } else {
  21754. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21755. i.reject(o)
  21756. }
  21757. return i.promise()
  21758. }
  21759. ,
  21760. t.prototype.fitDollhouse = function(e, t, i) {
  21761. var maxY = this.model.boundingBox.max.y;//add
  21762. var n = T.FORWARD.clone().applyQuaternion(i);
  21763. i = n.clone().add(e);
  21764. this.cameraControls.activeControl.target.copy(i),
  21765. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21766. }
  21767. ,
  21768. t.prototype.floorplanMode = function(e, t, i) {
  21769. this.mode = V.FLOORPLAN;
  21770. var n = this.cameraControls.controls[V.FLOORPLAN];
  21771. n.reset();
  21772. var r = e || this.model.center;
  21773. if (n.target.copy(r).setY(0),
  21774. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21775. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21776. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21777. t) {
  21778. var o = T.LEFT.clone().applyQuaternion(t);
  21779. n.rotateLeft(-Math.atan2(o.x, o.z))
  21780. } else
  21781. n.rotateToView(this.model.size, this.getDirection());
  21782. n.update(0)
  21783. }
  21784. ,
  21785. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21786. return e.skipWarpingCheck = !0,
  21787. this.flyToPano(e, t)
  21788. }
  21789. ,
  21790. t.prototype.updateMarkerVisi = function() {//加
  21791. if(this.mode != "panorama")return;
  21792. this.model.panos.list.forEach((pano)=>{
  21793. if(!pano.marker)return;
  21794. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21795. })
  21796. }
  21797. ,
  21798. /* t.prototype.updateHotVisible = function(pano){
  21799. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21800. var hots = this.model.hots;
  21801. pano = pano || this.currentPano;
  21802. for (var index in hots){
  21803. var visible;
  21804. if(this.mode != "panorama"){
  21805. visible = true;
  21806. }else{
  21807. //hots[index].mesh.material.depthTest = false;
  21808. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21809. }
  21810. hots[index].mesh.visible = visible;
  21811. }
  21812. }
  21813. */
  21814. t.prototype.flyToPano = function(e, t) {
  21815. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21816. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21817. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21818. if (aim){
  21819. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21820. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21821. }
  21822. else aimQua = aimQua
  21823. var zoomLevel = e.zoomLevel || 1 //add
  21824. if(this.flying) return t && t(e)
  21825. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21826. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21827. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21828. t && t(),
  21829. !1;
  21830. this.updateLastView()
  21831. if (this.mode !== V.PANORAMA)
  21832. return void this.flyToNewMode({
  21833. mode: V.PANORAMA,
  21834. pano: n,
  21835. duration: o,
  21836. quaternion: aimQua,
  21837. callback: t
  21838. });
  21839. if (!n || (h = x.deepExtend(e), u = function() {
  21840. j.delayOneFrame(function() {
  21841. this.flyToPano(h, t)
  21842. }.bind(this))
  21843. }.bind(this),
  21844. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21845. var d = function(e) {
  21846. t && t(e)
  21847. }
  21848. .bind(this);
  21849. this.currentPano || (this.currentPano = n,
  21850. this.path.placeCpm(),
  21851. this.path.fadeOutCpm(k.path.fadeOutTime),
  21852. this.spider.draw());
  21853. var p = o;
  21854. if ("number" != typeof o) {
  21855. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21856. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21857. }
  21858. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21859. zoomLevel !== this.zoomLevel)
  21860. switch (k.zoom.transitionStyle) {
  21861. case 1:
  21862. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21863. break;
  21864. case 2:
  21865. return h = x.deepExtend(e),
  21866. u = this.flyToPano.bind(this, h, t),
  21867. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21868. }
  21869. if (aimQua) {
  21870. G.cancelById(q.LookTransition),
  21871. p *= k.transition.aimSlowFactor;
  21872. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21873. , y = g.clone()
  21874. , A = new B.Vector3;
  21875. if (n === this.currentPano) {
  21876. var C = T.FORWARD.clone().applyQuaternion(g)
  21877. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21878. , E = C.angleTo(I);
  21879. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21880. void G.start(function(e) {
  21881. y.copy(g),
  21882. H.quaternion(y, aimQua)(e),
  21883. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21884. this.cameraControls.activeControl.lookAt(A)
  21885. }
  21886. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21887. }
  21888. }
  21889. if (n === this.currentPano )
  21890. return void d();
  21891. this.flying = !0;
  21892. var _ = this.position.clone()
  21893. , b = this.currentPano;
  21894. Y.debug("Flying to pano ", n.position);
  21895. this.emit(W.PanoChosen, this.currentPano, n);
  21896. this.emit(W.FlyingStarted, n.position, _, n, b);
  21897. //this.updateHotVisible(n); //更新热点显示
  21898. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21899. Hot.updateVisibles([this.currentPano, n])
  21900. aimQua && G.start(function(e) {
  21901. y.copy(g),
  21902. H.quaternion(y, aimQua)(e),
  21903. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21904. this.cameraControls.activeControl.lookAt(A)
  21905. }
  21906. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21907. var w = c ? null : z[k.transition.movementEasing];
  21908. this.nextPano = n;
  21909. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21910. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21911. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21912. this.flying = !1,
  21913. this.currentPano !== n && this.currentPano.exit(),
  21914. n.enter(),
  21915. this.currentPano = n,
  21916. this.nextPano = null,
  21917. this.path.placeCpm(),
  21918. this.path.fadeOutCpm(k.path.fadeOutTime),
  21919. this.spider.draw(),
  21920. this.emit(W.FlyingEnded, n.position, _, n, b),
  21921. this.updateMarkerVisi();//add
  21922. d(e)
  21923. if(this.mode == "panorama" ){
  21924. //EditOverlay.updatePano()
  21925. editTool.hotpoint.updatePano()
  21926. Hot.updateVisibles([this.currentPano])
  21927. }
  21928. }
  21929. .bind(this), 0, w, "camFly", q.FlyToPano)
  21930. }
  21931. }
  21932. ,
  21933. window._transitionPosId = 9999
  21934. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21935. G.cancelById(_transitionPosId)
  21936. var begin = function(object, pos, qua, scale){
  21937. if(pos){
  21938. if(!same(object.position, pos, 0.01)){
  21939. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21940. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21941. }
  21942. if(qua && !same(object.quaternion, qua, 1e-6)){
  21943. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21944. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21945. }
  21946. if(scale && !same(object.scale, scale, 0.001)){
  21947. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21948. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21949. }
  21950. }
  21951. }
  21952. var same = function(vec1, vec2, diff){
  21953. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21954. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21955. return s
  21956. }
  21957. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21958. /* this.model.hotGroup.children.forEach(overlay=>{
  21959. var panoData = overlay.transformAtPanos[sid]
  21960. var useCustom = !panoData
  21961. //if(overlay.usingTransformData || !useCustom){
  21962. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21963. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21964. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21965. overlay.getScaleBySize(panoData.width , panoData.height)
  21966. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21967. begin(overlay, pos, qua, scale )
  21968. //}
  21969. overlay.usingTransformData = !useCustom
  21970. }) */
  21971. for(let i in this.model.hots){//是否判断visible?
  21972. var hot = this.model.hots[i];
  21973. var panoData = hot.info.transformAtPanos[sid];
  21974. var useCustom = !panoData
  21975. //if(hot.usingTransformData || !useCustom){
  21976. var pos = useCustom ? hot.info.position : panoData.pos;
  21977. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21978. begin(hot, pos/* , qua */ )
  21979. //}
  21980. //hot.usingTransformData = !useCustom;
  21981. }
  21982. }
  21983. window._tranOutsideFocus = 4399
  21984. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21985. console.log("focusPoint")
  21986. if(this.mode == "floorplan"){
  21987. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21988. var control = player.cameraControls.controls.floorplan;
  21989. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21990. var currentScale = control.absoluteScale;
  21991. var currentTarget = control.target.clone()
  21992. G.cancelById(window._tranOutsideFocus, true);
  21993. G.start(function(progress){
  21994. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21995. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21996. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21997. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21998. }else if(player.mode == "dollhouse"){
  21999. var control = player.cameraControls.controls.dollhouse;
  22000. var radius = o.radius || 8;
  22001. var currentTarget = control.target.clone()
  22002. var dir = control.offset.clone().normalize()
  22003. var currentRadius = control.offset.length();
  22004. G.cancelById(window._tranOutsideFocus, true);
  22005. G.start(function(progress){
  22006. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22007. let radius_ = radius*progress+currentRadius*(1-progress)
  22008. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22009. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22010. }else if(this.mode == 'panorama'){
  22011. this.flyToPano({
  22012. lookAtPoint: o.aim.clone() ,
  22013. pano: this.currentPano,
  22014. aimDuration: o.dur || 600
  22015. })
  22016. }
  22017. }
  22018. t.prototype.fastForwardActivePanoFlight = function(e) {
  22019. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  22020. G.adjustSpeed(q.FlyToPano, e),
  22021. G.adjustSpeed(q.LookTransition, e)
  22022. }
  22023. ,
  22024. t.prototype.flyToPanoClosestToMouse = function() {
  22025. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  22026. this.intersect && this.updateClosestPano(this.intersect)),
  22027. this.closestPano)
  22028. return this.flyToPano({
  22029. pano: this.closestPano
  22030. });
  22031. var e = this.getMouseDirection();
  22032. this.flyDirection(e) || this.flyToPano({
  22033. pano: this.currentPano
  22034. })
  22035. }
  22036. ,
  22037. t.prototype.flyLocalDirection = function(e) {
  22038. var t = this.getDirection(e)
  22039. , i = 1 === e.z ? .4 : .75
  22040. , n = 1 === Math.abs(e.x);
  22041. return this.flyDirection(t, i, n)
  22042. }
  22043. ,
  22044. t.prototype.flyDirection = function(e, t, i) {
  22045. this.closePopup();
  22046. var n = $.Deferred();
  22047. this.history.invalidate();
  22048. var r = this.closestPanoInDirection(e, t, i);
  22049. return r ? this.flyToPano({
  22050. pano: r
  22051. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22052. n.resolve(!1)),
  22053. n.promise()
  22054. }
  22055. ,
  22056. t.prototype.closestPanoInDirection = function(e, t, i) {
  22057. return this.rankedPanoInDirection(0, e, t, i)
  22058. }
  22059. ,
  22060. t.prototype.rankedPanoInDirection = (_ = {
  22061. pano: null,
  22062. candidates: []
  22063. },
  22064. function(e, t, i, n) {
  22065. e = e || 0,
  22066. i = void 0 !== i ? i : .75;
  22067. var r = n ? "angle" : "direction";
  22068. 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)], _),
  22069. this.cachedPanoCandidates = _.candidates,
  22070. _.pano
  22071. }
  22072. ),
  22073. t.prototype.bump = function(e) {
  22074. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  22075. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  22076. if (.5 < Math.abs(a))
  22077. t = function() {
  22078. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  22079. }
  22080. .bind(this),
  22081. i = function() {
  22082. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  22083. }
  22084. .bind(this);
  22085. else {
  22086. var s = this.camera.position.clone()
  22087. , l = e.clone();
  22088. this.raycaster.set(s, l);
  22089. var c = this.model.floors.reduce(function(e, t) {
  22090. return e.concat(t.collider.children)
  22091. }, [])
  22092. , h = this.raycaster.intersectObjects(c)
  22093. , u = 0 < h.length ? h[0].distance / 25 : .04
  22094. , d = s.clone().add(l.multiplyScalar(u));
  22095. t = function() {
  22096. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  22097. }
  22098. .bind(this),
  22099. i = function() {
  22100. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  22101. }
  22102. .bind(this)
  22103. }
  22104. n = function() {
  22105. this.flying = !1
  22106. }
  22107. .bind(this),
  22108. this.flying = !0,
  22109. t()
  22110. }
  22111. }
  22112. ,
  22113. t.prototype.changeFloor = function(e) {
  22114. if (!this.is360View(this.mode, this.currentPano))
  22115. if (this.mode === V.PANORAMA) {
  22116. var t = this.history.reversePano(e);
  22117. t && t.isAligned() ? this.flyToPano({
  22118. pano: t
  22119. }) : this.changeFloorByScore(e)
  22120. } else
  22121. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22122. }
  22123. ,
  22124. t.prototype.changeFloorByScore = (E = {
  22125. pano: null,
  22126. candidates: []
  22127. },
  22128. function(e) {
  22129. var t = this.model.nextFloor(e);
  22130. 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),
  22131. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  22132. this.history.push(e, this.currentPano),
  22133. this.flyToPano({
  22134. pano: E.pano
  22135. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  22136. }
  22137. ),
  22138. t.prototype.gotoFloor = function(e) {
  22139. var t = e - this.model.currentFloor.floorIndex;
  22140. this.changeFloor(t)
  22141. }
  22142. ,
  22143. t.prototype.getDirection = function(e) {
  22144. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  22145. }
  22146. ,
  22147. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  22148. if (r = r || $.Deferred(),
  22149. this.mode === V.TRANSITIONING)
  22150. return Y.warn("should not be transitioning here"),
  22151. n && n(!1),
  22152. r.reject().promise();
  22153. var o = i || !1
  22154. , a = i ? i.position : this.position
  22155. , s = this.position.clone()
  22156. , l = this.currentPano;
  22157. if (Y.debug("New pose in mode " + this.mode),
  22158. !e || (retryCallback = function() {
  22159. j.delayOneFrame(function() {
  22160. this.flyToSameMode(e, t, i, n, r)
  22161. }
  22162. .bind(this))
  22163. }
  22164. .bind(this),
  22165. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22166. var c = function() {
  22167. this.emit(W.FlyingEnded, a, s, e, l),
  22168. n && n(!0)
  22169. }
  22170. .bind(this)
  22171. , h = k[this.mode]
  22172. , u = void 0 !== t ? t : h.transitionTime
  22173. , d = new B.Vector3
  22174. , p = new B.Vector3;
  22175. if (this.emit(W.FlyingStarted, a, s, e, l),
  22176. this.mode === V.PANORAMA)
  22177. Y.warn("we should not be here for panorama views");
  22178. else if (this.mode === V.DOLLHOUSE)
  22179. if (o) {
  22180. var f = new B.Vector3(0,1,0);
  22181. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22182. this.model.warpDestFloors(i.floorVisibility),
  22183. p.copy(i.position);
  22184. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22185. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  22186. , v = 3;
  22187. m.length ? (d.copy(m[0].point),
  22188. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  22189. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22190. var y = (new B.Matrix4).lookAt(p, d, f)
  22191. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  22192. , C = d.distanceTo(p)
  22193. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  22194. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  22195. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  22196. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  22197. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  22198. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  22199. this.path.burnsDir = Math.sign(b.y);
  22200. var w = new B.Euler(0,0,0,k.warp.eOrder)
  22201. , T = new B.Vector3;
  22202. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22203. G.start(function(e, t) {
  22204. w.x = E.x + e * b.x,
  22205. w.y = E.y + e * b.y,
  22206. w.z = E.z + e * b.z;
  22207. var i = _ + e * (C - _);
  22208. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  22209. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  22210. }
  22211. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  22212. G.start(function(e, t) {
  22213. this.cameraControls.controls[V.DOLLHOUSE].update(),
  22214. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  22215. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  22216. }
  22217. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22218. } else
  22219. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22220. else if (this.path.placeCpm(),
  22221. this.path.fadeInCpm(k.path.fadeInTime),
  22222. i) {
  22223. this.model.warpDestFloors(i.floorVisibility);
  22224. var x = this.cameraControls.cameras[V.FLOORPLAN]
  22225. , S = this.cameraControls.controls[V.FLOORPLAN]
  22226. , M = S.target.clone()
  22227. , R = i.position.clone().sub(M)
  22228. , P = x.position.clone().sub(S.target).length()
  22229. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22230. , L = Math.atan2(S.offset.x, S.offset.z)
  22231. , D = Math.atan2(O.x, O.z)
  22232. , N = S.absoluteScale
  22233. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  22234. G.start(function(e, t) {
  22235. S.target.copy(R).multiplyScalar(e).add(M);
  22236. var i = L + (D - L) * e;
  22237. S.offset.x = P * Math.sin(i),
  22238. S.offset.z = P * Math.cos(i),
  22239. x.position.copy(S.target).add(S.offset),
  22240. S.absoluteScale = N + e * (F - N),
  22241. S.update(),
  22242. this.quaternion.copy(x.quaternion),
  22243. this.position.copy(x.position),
  22244. this.target.copy(S.target),
  22245. this.camera.projectionMatrix.copy(x.projectionMatrix)
  22246. }
  22247. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  22248. } else
  22249. Y.info("flyToSameMode() funny floorplan view? skipping");
  22250. return G.setTimeout(function(e) {
  22251. this.mode = e,
  22252. c(),
  22253. r.resolve(!0)
  22254. }
  22255. .bind(this, this.mode), u, q.FlyToSameMode),
  22256. this.mode = V.TRANSITIONING,
  22257. r.promise()
  22258. }
  22259. }
  22260. ,
  22261. t.prototype.flyToNewMode = function(e, t) {
  22262. var i = (e = e || {}).mode
  22263. , n = e.pano
  22264. , r = e.duration
  22265. , o = e.warpDest
  22266. , a = e.callback
  22267. , s = e.force
  22268. , l = e.quaternion;
  22269. if (t = t || $.Deferred(),
  22270. this.isWarping())
  22271. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22272. a && a(!1),
  22273. t.reject("Cannot change mode during tour transition").promise();
  22274. if (this.mode === V.TRANSITIONING)
  22275. return a && a(!1),
  22276. t.reject("Cannot change mode during mode transition").promise();
  22277. if (i === this.mode)
  22278. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22279. t.promise()) : (a && a(!1),
  22280. t.reject("Already in " + i + " mode").promise());
  22281. var c = o || !1;
  22282. Y.debug("Switching mode to " + i);
  22283. var h = function() {
  22284. j.delayOneFrame(function() {
  22285. this.flyToNewMode(e, t)
  22286. }
  22287. .bind(this))
  22288. }
  22289. .bind(this);
  22290. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  22291. return t.promise();
  22292. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22293. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22294. this.model.waitForLoad(this.model, function() {
  22295. return this.model.meshTexturesLoaded
  22296. }
  22297. .bind(this)),
  22298. this.model.loadMeshTextures().done(h),
  22299. t.promise();
  22300. this.history.invalidate(),
  22301. this.updateLastView();
  22302. var u = this.mode
  22303. , d = this.cameraControls.cameras[i];
  22304. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  22305. var p = void 0 !== r ? r : e.transitionTime;
  22306. this.emit(W.ModeChanging, u, i, n),
  22307. n && (this.currentPano = n),
  22308. this.switchCameraMode(i, l),
  22309. G.cancelById(q.LookTransition);
  22310. var f = (new B.Vector3).copy(this.position);
  22311. this.modeTran = this.mode + "-" + i;
  22312. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  22313. VisiSet.finishSetPanoVisible()
  22314. VisiSet.finishSetTagVisible()
  22315. VisiSet.finishSetPanoLog()
  22316. }
  22317. if(editTool.atPanel == "screen"){
  22318. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  22319. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  22320. }
  22321. if(i == "panorama"){
  22322. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  22323. }else{
  22324. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  22325. }
  22326. if (i === V.PANORAMA)
  22327. this.emit(W.PanoChosen, n, n),
  22328. setTimeout(function() {
  22329. n.floor.enter(i)
  22330. }
  22331. .bind(this), p / 2),
  22332. this.path.fadeOutCpm(k.path.fadeOutTime);
  22333. else if (i === V.DOLLHOUSE) {
  22334. if (c && (this.model.stayPut = !0),
  22335. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  22336. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  22337. this.path.placeCpm(),
  22338. this.path.fadeInCpm(k.path.fadeInTime),
  22339. c) {
  22340. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  22341. f.set(15, 10, 15);
  22342. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  22343. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  22344. v.length ? (g.copy(v[0].point),
  22345. f.copy(o.position),
  22346. 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),
  22347. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  22348. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  22349. f.add(this.model.position),
  22350. d.position.copy(f),
  22351. this.cameraControls.controls[V.DOLLHOUSE].update()
  22352. }
  22353. } else if (this.path.placeCpm(),
  22354. this.path.fadeInCpm(k.path.fadeInTime),
  22355. o) {
  22356. this.model.warpDestFloors(o.floorVisibility);
  22357. var y = this.cameraControls.cameras[V.FLOORPLAN]
  22358. , A = this.cameraControls.controls[V.FLOORPLAN]
  22359. , C = y.position.clone().sub(A.target)
  22360. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  22361. , E = Math.atan2(I.x, I.z);
  22362. A.target.copy(o.position);
  22363. var _ = C.length();
  22364. A.offset.x = _ * Math.sin(E),
  22365. A.offset.y = 0,
  22366. A.offset.z = _ * Math.cos(E),
  22367. y.position.copy(A.target).add(A.offset),
  22368. A.target.clone().sub(d.position),
  22369. d.quaternion.copy(o.quaternion),
  22370. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  22371. A.absoluteScale = A.currentScale,
  22372. A.update()
  22373. } else
  22374. this.model.currentFloor.enter(i);
  22375. var b = this.currentPano
  22376. , w = this.position.clone();
  22377. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  22378. this.flying = !0,
  22379. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  22380. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22381. d.controls.update()),
  22382. e.blackoutStyle = P.FADEIN,
  22383. p = k.show360Views.transitionTime,
  22384. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  22385. this.mode = i,
  22386. this.path && this.path.popOutCpm(),
  22387. e.blackoutStyle = P.END,
  22388. p = k.show360Views.transitionTime,
  22389. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  22390. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  22391. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  22392. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  22393. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  22394. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  22395. G.setTimeout(function() {
  22396. this.flying = !1,
  22397. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  22398. this.currentPano.enter(),
  22399. this.path.placeCpm(),
  22400. this.path.fadeOutCpm(k.path.fadeOutTime),
  22401. this.spider.draw()),
  22402. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  22403. this.mode = i,
  22404. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  22405. if (this.afterCModeFuc) {
  22406. //手动加的函数
  22407. var cf = this.afterCModeFuc;
  22408. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22409. cf();
  22410. }
  22411. this.updateMarkerVisi();//add
  22412. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  22413. if(this.mode == "panorama" ){
  22414. //EditOverlay.updatePano()
  22415. editTool.hotpoint.updatePano()
  22416. }
  22417. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22418. if(this.mode == V.PANORAMA){
  22419. Hot.updateVisibles([this.currentPano])
  22420. }else{
  22421. Hot.updateVisibles(true)
  22422. this.model.hotGroup.children.forEach(overlay=>{
  22423. if(overlay.animateInfo){
  22424. GifTexDeal.start(overlay.animation)
  22425. }
  22426. })
  22427. }
  22428. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22429. t.resolve())
  22430. }
  22431. .bind(this), p, q.FlyToNewMode),
  22432. this.mode = V.TRANSITIONING,
  22433. //EditOverlay.updatePano(),//add
  22434. editTool.hotpoint.updatePano(),//add
  22435. //u == "panorama" && this.updateHotVisible(),
  22436. t.promise()
  22437. }
  22438. ,
  22439. t.prototype.fade360View = function(e, t, i) {
  22440. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22441. $(this.domElement).fadeOut(.5 * e, function() {
  22442. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22443. this.model.alpha = i.modelAlpha,
  22444. this.position.copy(t.position),
  22445. this.quaternion.copy(t.quaternion),
  22446. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22447. $(this.domElement).fadeIn(.5 * e)
  22448. }
  22449. .bind(this))
  22450. }
  22451. ,
  22452. t.prototype.findDefaultViews = function() {
  22453. this.findDefaultView(this.lastInsideView, !0),
  22454. this.findDefaultView(this.last360View, !1)
  22455. }
  22456. ,
  22457. t.prototype.findDefaultView = function(e, i) {
  22458. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22459. if (e.cameraMode !== V.PANORAMA)
  22460. return !1;
  22461. var t = r.get(e.panoId);
  22462. return t && t.isAligned() === i
  22463. });
  22464. 0 <= o ? (t = r.get(n[o].panoId),
  22465. e.update({
  22466. cameraMode: V.PANORAMA,
  22467. pano: t,
  22468. position: n[o].position,
  22469. quaternion: n[o].quaternion
  22470. })) : 0 <= (o = r.list.findIndex(function(e) {
  22471. return e.isAligned() === i
  22472. })) ? (t = r.list[o],
  22473. e.update({
  22474. cameraMode: V.PANORAMA,
  22475. pano: t,
  22476. position: t.position
  22477. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22478. }
  22479. ,
  22480. t.prototype.updateLastView = function() {
  22481. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22482. pano: this.currentPano,
  22483. position: this.position,
  22484. quaternion: this.quaternion
  22485. })
  22486. }
  22487. ,
  22488. t.prototype.goToLastView = function(e, t) {
  22489. var i = $.Deferred()
  22490. , n = i.resolve.bind(i)
  22491. , r = i.reject.bind(i)
  22492. , o = e ? this.lastInsideView : this.last360View;
  22493. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22494. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22495. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22496. mode: o.cameraMode,
  22497. pano: o.pano,
  22498. quaternion: o.quaternion,
  22499. callback: t
  22500. }).done(n).fail(r),
  22501. i.promise()
  22502. }
  22503. ,
  22504. t.prototype.fadeToView = function(e, t, i, n) {
  22505. var r = $.Deferred()
  22506. , o = r.resolve.bind(r)
  22507. , a = r.reject.bind(r);
  22508. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22509. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22510. a("Cannot go to illegal view"),
  22511. r.promise();
  22512. var s = (k[t.cameraMode],
  22513. function() {
  22514. $(this.domElement).fadeIn(.5 * i),
  22515. n && n(),
  22516. o()
  22517. }
  22518. .bind(this))
  22519. , l = e ? P.FADEIN : P.END;
  22520. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22521. $(this.domElement).fadeOut(.5 * i, function() {
  22522. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22523. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22524. pano: t.pano,
  22525. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22526. duration: 0
  22527. }, s) : this.flyToNewMode({
  22528. mode: t.cameraMode,
  22529. quaternion: t.quaternion,
  22530. duration: 0,
  22531. callback: s
  22532. })
  22533. }
  22534. .bind(this)),
  22535. r.promise()
  22536. }
  22537. ,
  22538. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22539. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22540. this.flying)
  22541. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22542. o && o(),
  22543. !1;
  22544. null != e || (e = M.Show),
  22545. this.history.invalidate(),
  22546. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22547. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22548. return this.emit(W.WarpStarted, a, i, n, r),
  22549. n = n || P.MIDDLE,
  22550. this.path.warpToPano(i, n, r, function() {
  22551. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22552. this.emit(W.WarpEnded, i),
  22553. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22554. o && o()
  22555. }
  22556. .bind(this)),
  22557. e === M.Hide && this.path.discardPathObject(),
  22558. !0
  22559. }
  22560. ,
  22561. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22562. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22563. s && s(),
  22564. !1)
  22565. }
  22566. ,
  22567. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22568. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22569. a && a(),
  22570. !1)
  22571. }
  22572. ,
  22573. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22574. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22575. }
  22576. ,
  22577. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22578. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22579. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22580. t && t(),
  22581. !1)
  22582. }
  22583. ,
  22584. t.prototype.aimTourCamera = function(e, t, i, n) {
  22585. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22586. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22587. }
  22588. ,
  22589. t.prototype.showPathToHeroLocation = function(e) {
  22590. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22591. }
  22592. ,
  22593. t.prototype.tourInterlude = function(e, t) {
  22594. this.history.invalidate(),
  22595. this.path.discardSlow();
  22596. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22597. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22598. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22599. var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22600. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22601. var timeEachItem = 2000;//假设每个item飞的时间
  22602. var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  22603. }
  22604. rotTime = Math.max(0, rotTime)
  22605. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22606. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22607. t && t()
  22608. }
  22609. .bind(this), rotTime)
  22610. }
  22611. ,
  22612. t.prototype.stopInterlude = function() {
  22613. this.interruptAndFastForward(null, 0)
  22614. }
  22615. ,
  22616. t.prototype.interruptAndFastForward = function(e, t) {
  22617. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22618. this.flying && this.emit(W.FlyingInterrupted),
  22619. this.path.interruptAndFastForward(e, t)
  22620. }
  22621. ,
  22622. t.prototype.setSize = function(e, t) {
  22623. var i = e / t;
  22624. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22625. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22626. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22627. this.cameraControls.cameras) {
  22628. var o = this.cameraControls.cameras[r];
  22629. o.fov = this.baseFov * (1 / this.zoomLevel),
  22630. o.updateAspect(i)
  22631. }
  22632. }
  22633. ,
  22634. t.prototype.toJSON = function() {
  22635. var e = {};
  22636. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22637. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22638. return e.hidden ? 0 : 1
  22639. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22640. e
  22641. }
  22642. ,
  22643. t.prototype.getCurrentNodePanos = function(e) {
  22644. if (this.model.panos.map,
  22645. e.length = 0,
  22646. this.path.nodes)
  22647. for (var t = 0; t < this.path.nodes.length; t++) {
  22648. var i = this.path.nodes[t];
  22649. e.push(this.model.panos.get(i))
  22650. }
  22651. }
  22652. ,
  22653. t.prototype.zoomIncrementally = function(e) {
  22654. var t = this.zoomLevel;
  22655. this.zoomTo(this.zoomLevel + e),
  22656. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22657. }
  22658. ,
  22659. t.prototype.zoomInIncrementally = function(e) {
  22660. e = e || this.defaultZoomIncrement,
  22661. this.zoomIncrementally(e)
  22662. }
  22663. ,
  22664. t.prototype.zoomOutIncrementally = function(e) {
  22665. e = e || -this.defaultZoomIncrement,
  22666. this.zoomIncrementally(e)
  22667. }
  22668. ,
  22669. t.prototype.zoomBy = function(e) {
  22670. this.zoomTo(this.zoomLevel * e)
  22671. }
  22672. ,
  22673. t.prototype.zoomIn = function() {
  22674. this.zoomBy(1 + this.zoomSpeed)
  22675. }
  22676. ,
  22677. t.prototype.zoomOut = function() {
  22678. this.zoomBy(1 - this.zoomSpeed)
  22679. }
  22680. ,
  22681. t.prototype.zoomTo = function(e, t) {
  22682. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22683. e > k.zoom.max && (e = k.zoom.max),
  22684. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22685. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22686. e === k.zoom.min && this.emit(m.ZoomMin)),
  22687. this.cameraControls.activeControl)) {
  22688. var i = this.cameraControls.activeControl.camera;
  22689. this.zoomLevel = e,
  22690. i.fov = this.baseFov * (1 / this.zoomLevel),
  22691. i.updateProjectionMatrix(),
  22692. this.zoomFov = i.fov
  22693. }
  22694. }
  22695. ,
  22696. t.prototype.increaseZoomSpeed = function() {
  22697. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22698. }
  22699. ,
  22700. t.prototype.decreaseZoomSpeed = function() {
  22701. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22702. }
  22703. ,
  22704. t.prototype.clampZoomSpeed = function(e) {
  22705. return e < 0 ? 0 : e
  22706. }
  22707. ,
  22708. t.prototype.activatePersistentZooming = function(e) {
  22709. this.zooming = e ? 1 : -1
  22710. }
  22711. ,
  22712. t.prototype.deactivatePersistentZooming = function() {
  22713. this.zooming = 0
  22714. }
  22715. ,
  22716. t.prototype.zoomDefault = function() {
  22717. this.zoomTo(1, !0)
  22718. }
  22719. window.fovTranId = 333;//add
  22720. t.prototype.smoothZoomToDefault = function(e, t) {
  22721. G.cancelById(window.fovTranId)
  22722. var i, n = this.zoomLevel, r = function(e) {
  22723. 1 < e && (e = 1),
  22724. i = n * (1 - e) + e,
  22725. this.zoomTo(i, !0)
  22726. }
  22727. .bind(this), o = function() {
  22728. this.zoomDefault(),
  22729. t && window.setTimeout(t, 50)
  22730. }
  22731. .bind(this);
  22732. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22733. }
  22734. ,
  22735. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22736. G.cancelById(window.fovTranId)
  22737. var i,
  22738. n = this.zoomLevel,
  22739. aimLevel = zoomLevel || this.baseFov / fov
  22740. if (n == aimLevel) return
  22741. var fun = function (e) {
  22742. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22743. }.bind(this)
  22744. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22745. }
  22746. ,
  22747. t.prototype.updateZoomPano = function() {
  22748. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22749. var e = this.currentPano;
  22750. if (e) {
  22751. var t = this.zoomLevel > k.zoom.activationThreshold
  22752. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22753. t);
  22754. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22755. this.panoRenderer.setZoomingActive(i, e, !0);
  22756. var n = function(e, t) {
  22757. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22758. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22759. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22760. e.setZoomed(t)
  22761. }
  22762. .bind(this);
  22763. i && !e.zoomed ? (n(e, !0),
  22764. this.panoRenderer.enableUltraHighQualityMode(function() {
  22765. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22766. i && n(e, !0)
  22767. }
  22768. .bind(this))) : !t && e.zoomed && n(e, !1)
  22769. }
  22770. }
  22771. },
  22772. //--------
  22773. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22774. var f2;
  22775. if (this.mode == mode) {
  22776. f1 && f1()
  22777. } else {
  22778. f2 = f1;
  22779. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22780. this.afterCModeFuc = function() {
  22781. this.afterCModeFuc = f2
  22782. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22783. }.bind(this)
  22784. } else {
  22785. this.afterCModeFuc = f2;//飞入后执行
  22786. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22787. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22788. }catch(e){}
  22789. }
  22790. }
  22791. }
  22792. ,
  22793. t.prototype.checkHasNeighbor = function(pano){//add
  22794. for(var i in pano.neighbourPanos ){
  22795. if(i == pano.id)continue;
  22796. if(pano.neighbourPanos[i]){
  22797. return true;
  22798. }
  22799. }
  22800. }
  22801. ,
  22802. ee.exports = t
  22803. }
  22804. ).call(this, "/js/player.js")
  22805. }
  22806. , {
  22807. "./constants": 8,
  22808. "./enum/AlignmentType": 17,
  22809. "./enum/BlackoutStyle": 18,
  22810. "./enum/ControlEvents": 21,
  22811. "./enum/Keys": 30,
  22812. "./enum/ModelManagerEvents": 33,
  22813. "./enum/PanoSizeClass": 36,
  22814. "./enum/PanoramaEvents": 37,
  22815. "./enum/PathDiscardMode": 38,
  22816. "./enum/PathDisplayMode": 39,
  22817. "./enum/PlayerEvents": 40,
  22818. "./enum/TagStates": 44,
  22819. "./enum/Vectors": 50,
  22820. "./enum/Viewmode": 51,
  22821. "./enum/WarpStyle": 52,
  22822. "./enum/ZoomEvents": 53,
  22823. "./exception/BasicException": 55,
  22824. "./model/ModelManager": 140,
  22825. "./objects/NSpider": 147,
  22826. "./objects/Panorama": 148,
  22827. "./objects/Reticule": 149,
  22828. "./objects/ShowPath": 151,
  22829. "./objects/Snapshot": 153,
  22830. "./objects/View": 154,
  22831. "./settings": 166,
  22832. "./shaders": 167,
  22833. "./tile/TileDownloader": 171,
  22834. "./tile/TilePrioritizer": 172,
  22835. "./util/ZoomStats": 179,
  22836. "./util/browser": 182,
  22837. "./util/camera": 183,
  22838. "./util/cameraLight": 184,
  22839. "./util/common": 185,
  22840. "./util/easing": 186,
  22841. "./util/history": 187,
  22842. "./util/lerp": 188,
  22843. "./util/logger": 189,
  22844. "./util/math": 190,
  22845. "./util/transitions": 195,
  22846. hot: "hot",
  22847. scaleImg: "scaleImg",
  22848. events: 202,
  22849. three: 217
  22850. }],
  22851. scaleImg: [function(e, t) {
  22852. var i = t;
  22853. (function() {
  22854. function e(e, t, i, n) {
  22855. function r() {
  22856. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22857. U.height = p,
  22858. H = U.getContext("2d")
  22859. }
  22860. function o(e) {
  22861. if (e) {
  22862. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22863. for (t = 0; t < ie; t += 4)
  22864. n[t] = e[t] * ne | 0,
  22865. n[t + 1] = e[t + 1] * ne | 0,
  22866. n[t + 2] = e[t + 2] * ne | 0,
  22867. n[t + 3] = e[t + 3] * ne | 0;
  22868. return delete e,
  22869. i
  22870. }
  22871. return H.getImageData(0, 0, d, p)
  22872. }
  22873. function a(e, t, i, n, r) {
  22874. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22875. }
  22876. var s, l;
  22877. if (t || (t = e.input,
  22878. i = e.output,
  22879. n = e.inputRemovable,
  22880. e.scale && (e = e.scale)),
  22881. t.src)
  22882. if (s = document.createElement("canvas"),
  22883. null != t.naturalWidth)
  22884. s.width = t.naturalWidth,
  22885. s.height = t.naturalHeight;
  22886. else if (null != t.runtimeStyle) {
  22887. var c = t.runtimeStyle
  22888. , h = c.width
  22889. , u = c.height;
  22890. c.width = "auto",
  22891. c.height = "auto",
  22892. s.width = t.width,
  22893. s.height = t.height,
  22894. c.width = h,
  22895. c.height = u
  22896. } else {
  22897. h = t.width,
  22898. u = t.height;
  22899. t.removeAttribute && (t.removeAttribute("width"),
  22900. t.removeAttribute("height")),
  22901. s.width = t.width,
  22902. s.height = t.height,
  22903. t.width = h,
  22904. t.height = u
  22905. }
  22906. else
  22907. s = t;
  22908. l = s.getContext("2d"),
  22909. t.src && l.drawImage(t, 0, 0);
  22910. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22911. if (!f || !g)
  22912. return !1;
  22913. (t.src || n) && s.clearRect(0, 0, f, g),
  22914. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22915. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22916. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22917. e * g + .5 | 0);
  22918. 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;
  22919. if (1 < re || 1 < oe)
  22920. for (r(),
  22921. G = (z = o()).data,
  22922. C = 0; C < p; C++)
  22923. for (V = (y = C / oe) - (w = 0 | y),
  22924. j = w * $,
  22925. W = w < 1 ? j : j - $,
  22926. w < g - 2 ? (Y = j + $,
  22927. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22928. A = 0; A < d; A++,
  22929. te += 4)
  22930. Z = (b = 0 | (v = A / re)) << 2,
  22931. b < f - 2 ? (K = Z + 4,
  22932. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22933. 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,
  22934. ++Z,
  22935. ++K,
  22936. ++Q,
  22937. 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,
  22938. ++Z,
  22939. ++K,
  22940. ++Q,
  22941. 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,
  22942. ++Z,
  22943. ++K,
  22944. ++Q,
  22945. 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,
  22946. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22947. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22948. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22949. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22950. else {
  22951. if (le.Float32Array)
  22952. L = new Float32Array(ie);
  22953. else
  22954. for (L = [],
  22955. te = 0; te < ie; ++te)
  22956. L[te] = 0;
  22957. for (y = 0; y < g; y++)
  22958. for (I = (_ = 0 | (C = y * oe)) * J,
  22959. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22960. R = C + oe - _ - 1),
  22961. v = 0; v < f; v++,
  22962. ee += 4)
  22963. switch (A = v * re,
  22964. E = 0 | A,
  22965. te = I + (E << 2),
  22966. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22967. P && (x = 1 + E - A,
  22968. S = A + re - E - 1),
  22969. D = m[ee],
  22970. F = m[ee + 1],
  22971. B = m[ee + 2],
  22972. N = m[ee + 3],
  22973. P + O) {
  22974. case 0:
  22975. L[te] += D * ae,
  22976. L[te + 1] += F * ae,
  22977. L[te + 2] += B * ae,
  22978. L[te + 3] += N * ae;
  22979. break;
  22980. case 1:
  22981. T = x * oe,
  22982. L[te] += D * T,
  22983. L[te + 1] += F * T,
  22984. L[te + 2] += B * T,
  22985. L[te + 3] += N * T,
  22986. T = S * oe,
  22987. L[te + 4] += D * T,
  22988. L[te + 5] += F * T,
  22989. L[te + 6] += B * T,
  22990. L[te + 7] += N * T;
  22991. break;
  22992. case 2:
  22993. T = re * M,
  22994. L[te] += D * T,
  22995. L[te + 1] += F * T,
  22996. L[te + 2] += B * T,
  22997. L[te + 3] += N * T,
  22998. T = re * R,
  22999. L[te += J] += D * T,
  23000. L[te + 1] += F * T,
  23001. L[te + 2] += B * T,
  23002. L[te + 3] += N * T;
  23003. break;
  23004. default:
  23005. T = x * M,
  23006. L[te] += D * T,
  23007. L[te + 1] += F * T,
  23008. L[te + 2] += B * T,
  23009. L[te + 3] += N * T,
  23010. T = S * M,
  23011. L[te + 4] += D * T,
  23012. L[te + 5] += F * T,
  23013. L[te + 6] += B * T,
  23014. L[te + 7] += N * T,
  23015. T = x * R,
  23016. L[te += J] += D * T,
  23017. L[te + 1] += F * T,
  23018. L[te + 2] += B * T,
  23019. L[te + 3] += N * T,
  23020. T = S * R,
  23021. L[te + 4] += D * T,
  23022. L[te + 5] += F * T,
  23023. L[te + 6] += B * T,
  23024. L[te + 7] += N * T
  23025. }
  23026. delete m,
  23027. r(),
  23028. z = o(L)
  23029. }
  23030. if (H.putImageData(z, 0, 0),
  23031. "string" == typeof i) {
  23032. var se;
  23033. if ("png" === i || "jpeg" === i)
  23034. return (se = n && t.src ? t : new Image).width = d,
  23035. se.height = p,
  23036. se.src = U.toDataURL("image/" + i, .85),
  23037. se;
  23038. if ("png-src" === i || "jpeg-src" === i)
  23039. return U.toDataURL("image/" + i.split("-")[0], .85)
  23040. }
  23041. return U
  23042. }
  23043. var le = this;
  23044. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  23045. exports.scale = e) : c = e
  23046. }
  23047. ).call(this),
  23048. i.exports = c
  23049. }
  23050. , {}],
  23051. 156: [function(i, n, e) {
  23052. (function(e) {
  23053. "use strict";
  23054. function t(e, t) {
  23055. this.model = e,
  23056. this.panos = e.panos,
  23057. this.player = t,
  23058. this.imagePanos = this.listImagePanos(),
  23059. this.retryMinimumTime = 1e4
  23060. }
  23061. var r = (i("three"),
  23062. i("./enum/Viewmode"))
  23063. , o = (i("./settings"),
  23064. i("./objects/Panorama"))
  23065. , a = new (i("./util/logger"))(e);
  23066. t.prototype.start = function() {
  23067. this.loadNextPano(function(e) {
  23068. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  23069. setTimeout(function() {
  23070. this.start()
  23071. }
  23072. .bind(this), 1e3))
  23073. }
  23074. .bind(this))
  23075. }
  23076. ,
  23077. t.prototype.validLoadTarget = function(e) {
  23078. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23079. }
  23080. ,
  23081. t.prototype.listImagePanos = function() {
  23082. var i = []
  23083. , n = this;
  23084. return this.model.images.forEach(function(e) {
  23085. if (e.metadata && e.metadata.scan_id) {
  23086. var t = n.model.panos.get(e.metadata.scan_id);
  23087. t && !t.isLoaded("high") && i.push(t)
  23088. }
  23089. }),
  23090. i
  23091. }
  23092. ,
  23093. t.prototype.nextNotLoadedImage = function() {
  23094. for (; 0 < this.imagePanos.length; ) {
  23095. var e = this.imagePanos[0];
  23096. if (!e.isLoaded("high"))
  23097. return e;
  23098. this.imagePanos.shift()
  23099. }
  23100. return null
  23101. }
  23102. ,
  23103. t.prototype.loadNextPano = function(e) {
  23104. var t, i, n = this.model.waitQueue.filter(function(e) {
  23105. return e.object instanceof o
  23106. });
  23107. 0 < n.length ? (t = n[0].object,
  23108. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23109. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23110. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23111. t = this.imagePanos[0],
  23112. 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),
  23113. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23114. a.debug("Preloading " + i + "-res pano " + t.id),
  23115. t.loadCube(i).done(e).fail(function() {
  23116. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23117. e()
  23118. })) : e && e(null)
  23119. }
  23120. ,
  23121. n.exports = t
  23122. }
  23123. ).call(this, "/js/preloaders.js")
  23124. }
  23125. , {
  23126. "./enum/Viewmode": 51,
  23127. "./objects/Panorama": 148,
  23128. "./settings": 166,
  23129. "./util/logger": 189,
  23130. three: 217
  23131. }],
  23132. 157: [function(a, s, e) {
  23133. (function(e) {
  23134. "use strict";
  23135. function t(e, t, i, n, r) {
  23136. this.qualityManager = e,
  23137. this.scene = t,
  23138. this.camera = i,
  23139. this.container = r,
  23140. this.controls = n,
  23141. this.controls.enabled = !0,
  23142. this.controls.locked = !0,
  23143. this.quickstartCamera = n.camera,
  23144. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  23145. this.skybox = null
  23146. }
  23147. var i = a("three")
  23148. , n = a("../util/logger")
  23149. , o = a("../constants")
  23150. , h = (a("../util/transitions"),
  23151. a("../util/lerp"),
  23152. a("../util/easing"),
  23153. a("../enum/Vectors"))
  23154. , u = a("../enum/PanoSizeClass")
  23155. , r = (a("../materials/ModelTextureMaterial"),
  23156. a("../materials/CubemapMaterial"))
  23157. , d = (a("../cameras/PanoramaCamera"),
  23158. a("../controls/PanoramaControls"),
  23159. a("../tile/TileUtils"),
  23160. a("../util/camera"),
  23161. a("../util/cameraLight"))
  23162. , p = (a("../util/browser"),
  23163. a("../settings"),
  23164. a("../gui/helpManager"),
  23165. new n(e));
  23166. t.prototype.load = function(e) {
  23167. e.pano.shouldRedrawOnBaseLoaded = !0;
  23168. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23169. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23170. var a = this.qualityManager.getPanoSize(u.BASE)
  23171. , s = this.qualityManager.getPanoSize(u.STANDARD);
  23172. if (e.pano.tiled) {
  23173. p.warn("Loading startPano, TILED", e.pano.id);
  23174. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23175. , c = this.quickstartCamera.fov;
  23176. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  23177. t = e.pano.loadTiledPano(s, r, {
  23178. hFov: l,
  23179. vFov: c
  23180. }, !1, !1, !0),
  23181. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23182. } else
  23183. p.warn("Loading startPano", e.pano.id),
  23184. t = e.pano.loadCube("high");
  23185. return $.when(t).then(function() {
  23186. n.init(e.pano, e.quaternion),
  23187. e.pano.tiled ? i.done(function() {
  23188. e.pano.lockUntilRenderingComplete = !1,
  23189. this.controls.locked = !1
  23190. }
  23191. .bind(this)) : this.controls.locked = !1
  23192. }
  23193. .bind(this))
  23194. }
  23195. ,
  23196. t.prototype.init = function(e, t) {
  23197. p.info("Quickstart done loading, adding scene objects"),
  23198. e.lockUntilRenderingComplete = !0,
  23199. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  23200. side: i.BackSide
  23201. })),
  23202. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23203. this.skybox.quaternion.copy(e.quaternion),
  23204. this.scene.add(this.skybox),
  23205. $(this.container).show()
  23206. }
  23207. ,
  23208. t.prototype.update = function(e) {
  23209. this.controls.update(e),
  23210. this.camera.copy(this.quickstartCamera)
  23211. }
  23212. ,
  23213. t.prototype.setSize = function(e, t) {
  23214. this.quickstartCamera.updateAspect(e / t)
  23215. }
  23216. ,
  23217. t.prototype.destroy = function() {
  23218. this.scene.remove(this.skybox)
  23219. }
  23220. ,
  23221. s.exports = t
  23222. }
  23223. ).call(this, "/js/scene/QuickstartManager.js")
  23224. }
  23225. , {
  23226. "../cameras/PanoramaCamera": 7,
  23227. "../constants": 8,
  23228. "../controls/PanoramaControls": 13,
  23229. "../enum/PanoSizeClass": 36,
  23230. "../enum/Vectors": 50,
  23231. "../gui/helpManager": 68,
  23232. "../materials/CubemapMaterial": 117,
  23233. "../materials/ModelTextureMaterial": 118,
  23234. "../settings": 166,
  23235. "../tile/TileUtils": 174,
  23236. "../util/browser": 182,
  23237. "../util/camera": 183,
  23238. "../util/cameraLight": 184,
  23239. "../util/easing": 186,
  23240. "../util/lerp": 188,
  23241. "../util/logger": 189,
  23242. "../util/transitions": 195,
  23243. three: 217
  23244. }],
  23245. 158: [function(e, t, i) {
  23246. "use strict";
  23247. function h(e, t, i) {
  23248. this.scene = e,
  23249. this.camera = t,
  23250. this.renderer = null,
  23251. this.effects = i,
  23252. this.animateCallback = null,
  23253. this.composer = null,
  23254. this.qualityManager = null,
  23255. e.renderWidth = 0,
  23256. e.renderHeight = 0,
  23257. this.updateClock = new M.Clock,
  23258. this.components = [],
  23259. this.updateListeners = [],
  23260. this.resizeListeners = [],
  23261. this.forceUpdateSize = !1,
  23262. this.started = !1,
  23263. this.textures = {},
  23264. this.suspendedObjects = []
  23265. }
  23266. 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;
  23267. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23268. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  23269. this.components.push(e),
  23270. e.update && this.updateListeners.push(e),
  23271. e.setSize && (this.resizeListeners.push(e),
  23272. this.forceUpdateSize = !0)
  23273. }
  23274. ,
  23275. h.prototype.removeComponent = function(t) {
  23276. function e(e) {
  23277. return e !== t
  23278. }
  23279. this.components = this.components.filter(e),
  23280. this.updateListeners = this.updateListeners.filter(e),
  23281. this.resizeListeners = this.resizeListeners.filter(e)
  23282. }
  23283. ,
  23284. h.prototype.start = function(e) {
  23285. if (this.started)
  23286. throw new l("Can't start SceneRenderer, already started");
  23287. this.createContext(e),
  23288. //u.isMobile() && this.boluoVrInit(),
  23289. this.initComposer(),
  23290. this.started = !0,
  23291. (b = b.bind(this))()
  23292. }
  23293. ,
  23294. h.prototype.createContext = function(e) {
  23295. try {
  23296. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  23297. this.renderer.autoClear = !0,
  23298. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23299. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  23300. this.emit(r.ContextCreated)
  23301. } catch (e) {
  23302. throw new c("Unable to create a WebGL rendering context")
  23303. }
  23304. d.profiling.enabled && this.overrideTextures(),
  23305. e.appendChild(this.renderer.domElement)
  23306. }
  23307. ,
  23308. h.prototype.overrideTextures = function() {
  23309. var d = this.renderer.context
  23310. , t = 0
  23311. , i = d.createTexture;
  23312. d.createTexture = function() {
  23313. var e = i.call(d);
  23314. return e.id = t++,
  23315. this.textures[e.id] = e
  23316. }
  23317. .bind(this);
  23318. var p = d.texImage2D;
  23319. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  23320. var c, h = this.getTextureTypeFromTarget(d, e);
  23321. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  23322. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  23323. s = r,
  23324. n = (l = o).naturalWidth,
  23325. r = l.naturalHeight,
  23326. p.call(d, e, t, i, a, s, l));
  23327. var u = this.textures[c.id];
  23328. u.width = h === f.TextureCube ? 6 * n : n,
  23329. u.height = r
  23330. }
  23331. .bind(this);
  23332. var n = d.deleteTexture;
  23333. d.deleteTexture = function(e) {
  23334. delete this.textures[e.id],
  23335. n.call(d, e)
  23336. }
  23337. .bind(this)
  23338. }
  23339. ,
  23340. h.prototype.updateTextureMemory = (n = null,
  23341. function() {
  23342. var e = 0;
  23343. for (var t in this.textures) {
  23344. var i = this.textures[t];
  23345. i.width && i.height && (e += i.width * i.height * 4)
  23346. }
  23347. e !== n && this.emit(r.MemoryUsageUpdated, e),
  23348. n = e
  23349. }
  23350. ),
  23351. h.prototype.getTextureTypeFromTarget = function(e, t) {
  23352. switch (t) {
  23353. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23354. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23355. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23356. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23357. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23358. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23359. return f.TextureCube;
  23360. case e.TEXTURE_2D:
  23361. return f.Texture2D;
  23362. default:
  23363. return null
  23364. }
  23365. }
  23366. ,
  23367. h.prototype.initComposer = function() {
  23368. this.composer = new M.EffectComposer(this.renderer),
  23369. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  23370. this.composer.addPass(this.effects.hblurPass),
  23371. this.composer.addPass(this.effects.vblurPass)
  23372. }
  23373. ,
  23374. h.prototype.setSize = function(e, t, i) {
  23375. this.renderWidth = e,
  23376. this.renderHeight = t,
  23377. this.effects.aspect = e / t,
  23378. this.renderer.setSize(e, t, !1, i),
  23379. this.composer.setSize(e, t);
  23380. for (var n = 0; n < this.resizeListeners.length; n++)
  23381. this.resizeListeners[n].setSize(e, t)
  23382. }
  23383. ,
  23384. h.prototype.render = function() {
  23385. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23386. }
  23387. ,
  23388. h.prototype.boluoVrInit = function() {
  23389. console.log("boluoVrInit"),
  23390. this.isHuawei5X = u.detectHUAWEI5X(),
  23391. this.oldRenderer = this.renderer,
  23392. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  23393. window.panoCamera = this.camera;
  23394. var i = this;
  23395. window._vrEnabled = !1,
  23396. Object.defineProperty(window, "vrEnabled", {
  23397. get: function() {
  23398. return window._vrEnabled
  23399. },
  23400. set: function(e) {
  23401. (e = !!e) ? (i.renderer = i.newRenderer,
  23402. window.vrMarkers.forEach(function(e) {
  23403. e.visible = !0
  23404. })) : (i.renderer = i.oldRenderer,
  23405. window.vrMarkers.forEach(function(e) {
  23406. e.visible = !1
  23407. })),
  23408. i.cursor.visible = e,
  23409. i.setSize($("#player").width(), $("#player").height()),
  23410. window._vrEnabled = e,
  23411. setTimeout(function() {
  23412. console.log(player.cameraControls.activeControl.camera.fov)
  23413. }, 500)
  23414. }
  23415. }),
  23416. this.createCursor(.5, !1, 1, 16777215, 0);
  23417. var e = {
  23418. setSize: function(e, t) {
  23419. i.camera.aspect = e / t
  23420. }
  23421. };
  23422. this.resizeListeners.push(e),
  23423. this.vrLoadingInit()
  23424. }
  23425. ,
  23426. h.prototype.vrLoadingInit = function() {
  23427. var e = new (e = function(camera) {
  23428. var t = this
  23429. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23430. , i = new M.MeshBasicMaterial({
  23431. color: 4967932,
  23432. side: M.DoubleSide
  23433. })
  23434. , n = new M.Mesh(e,i);
  23435. (this.mesh = n).position.z = -2,
  23436. n.scale.set(.08, .08, .08),
  23437. n.visible = !1,
  23438. //window.player.camera.add(n),
  23439. camera.add(n),
  23440. t.enabled = !1,
  23441. this.update = function(e) {
  23442. 1 == t.enabled && (n.rotation.z += 15 * e)
  23443. }
  23444. }
  23445. )(this.camera);
  23446. window.Loading = e,
  23447. this.updateListeners.push(e)
  23448. }
  23449. ,
  23450. h.prototype.createCursor = function(e, t, i, n, r) {
  23451. var o, a = new M.SpriteMaterial({
  23452. opacity: i,
  23453. color: n,
  23454. transparent: t,
  23455. map: this.boluoGetTexture("images/cursor.png"),
  23456. needsUpdate: !0,
  23457. side: M.DoubleSide
  23458. });
  23459. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23460. a.map.repeat = new M.Vector2(1 / 17,1),
  23461. a.depthTest = !1,
  23462. a.blending = M.AdditiveBlending,
  23463. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23464. o.position.z = -2,
  23465. o.visible = !1,
  23466. o.name = "cursor",
  23467. this.camera.add(o),
  23468. this.scene.add(this.camera),
  23469. this.cursor = o;
  23470. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23471. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23472. this.updateListeners.push(s)
  23473. }
  23474. ,
  23475. h.prototype.CursorAnimation = function(e, t, o) {
  23476. this.cursor = t,
  23477. this.raycaster = new M.Raycaster,
  23478. this.targetEventObj = {},
  23479. this.type = 1,
  23480. this.tweenFlag = !0;
  23481. var s = this;
  23482. this.target = o,
  23483. console.log(o.uuid),
  23484. this.euler = new M.Euler,
  23485. this.q0 = new M.Quaternion,
  23486. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23487. this.zee = new M.Vector3(0,0,1),
  23488. this.alpha = -1e3,
  23489. this.beta = -1e3,
  23490. this.gamma = -1e3,
  23491. this.orient = M.Math.degToRad(window.orientation || 0),
  23492. window.addEventListener("orientationchange", function() {
  23493. s.orient = M.Math.degToRad(window.orientation || 0)
  23494. }),
  23495. window.addEventListener("deviceorientation", function(e) {
  23496. var t = M.Math.degToRad(e.alpha)
  23497. , i = M.Math.degToRad(e.beta)
  23498. , n = M.Math.degToRad(e.gamma);
  23499. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23500. -1e3 === s.beta && (s.beta = i),
  23501. -1e3 === s.gamma && (s.gamma = n),
  23502. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23503. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23504. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23505. s.beta = i,
  23506. s.gamma = n),
  23507. h.vrDebug) {
  23508. $("#info-device-orientation").css("display", "block");
  23509. var r = "";
  23510. r += "alpha=(" + s.alpha + ")<BR/>",
  23511. r += "beta=(" + s.beta + ")<BR/>",
  23512. r += "gamma=" + s.gamma + "<BR/>",
  23513. document.getElementById("info-device-orientation").innerHTML = r
  23514. }
  23515. }),
  23516. this.setObjectQuaternion = function(e, t, i, n, r) {
  23517. s.euler.set(i, t, -n, "YXZ"),
  23518. e.setFromEuler(s.euler),
  23519. e.multiply(s.q1),
  23520. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23521. o.updateMatrixWorld()
  23522. }
  23523. ,
  23524. parent !== window && window.addEventListener("message", function(e) {
  23525. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23526. o && o.alpha && o.beta && o.gamma && (t = a,
  23527. i = M.Math.degToRad(o.alpha),
  23528. n = M.Math.degToRad(o.beta),
  23529. r = M.Math.degToRad(o.gamma),
  23530. t ? (-1e3 === s.alpha && (s.alpha = i),
  23531. -1e3 === s.beta && (s.beta = n),
  23532. -1e3 === s.gamma && (s.gamma = r),
  23533. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23534. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23535. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23536. s.beta = n,
  23537. s.gamma = r))
  23538. }),
  23539. this.update = function(e) {
  23540. TWEEN.update(),
  23541. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23542. this.triggerTargetEvent())
  23543. }
  23544. ,
  23545. this.triggerTargetEvent = function() {
  23546. var e = this.choseObj()
  23547. , t = e ? e.object : void 0;
  23548. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23549. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23550. t && t.enabled && this.startAnimate(function() {
  23551. this.clickCallback(t)
  23552. }
  23553. .bind(this))) : this.type,
  23554. this.targetEventObj.lastObj = t)
  23555. }
  23556. ,
  23557. this.choseObj = function() {
  23558. this.raycaster.setFromCamera({
  23559. x: 0,
  23560. y: 0
  23561. }, o);
  23562. var e = (this.raycaster.ray,
  23563. window.vrMarkers)
  23564. , t = this.raycaster.intersectObjects(e);
  23565. if (0 < t.length)
  23566. return t[0]
  23567. }
  23568. ,
  23569. this.clickCallback = function(e) {
  23570. this.runTHREEAction(e, "onclick")
  23571. }
  23572. ,
  23573. this.runTHREEAction = function(e, t) {
  23574. switch (t) {
  23575. case "onclick":
  23576. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23577. e()
  23578. });
  23579. break;
  23580. case "onhover":
  23581. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23582. e()
  23583. });
  23584. break;
  23585. case "onout":
  23586. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23587. e()
  23588. })
  23589. }
  23590. }
  23591. ,
  23592. this.startAnimate = function(e) {
  23593. this.tweenFlag && this.initAnimation(e)
  23594. }
  23595. ,
  23596. this.initAnimation = function(e) {
  23597. var t = this
  23598. , i = this.cursor.material.map.offset;
  23599. t.tweenFlag = !1,
  23600. this.cursorAnimate = new TWEEN.Tween(i).to({
  23601. x: 1
  23602. }, 1e3).onStart(function() {
  23603. t.tweenFlag = !1
  23604. }).onStop(function() {
  23605. t.tweenFlag = !0,
  23606. this.x = 0,
  23607. i.x = 0
  23608. }).onUpdate(function() {}).onComplete(function() {
  23609. e(),
  23610. i.x = 0,
  23611. setTimeout(function() {
  23612. t.tweenFlag = !0
  23613. }, 1500)
  23614. }),
  23615. this.cursorAnimate.easing(function(e) {
  23616. return Math.floor(17 * e) / 17
  23617. }),
  23618. this.cursorAnimate.start()
  23619. }
  23620. ,
  23621. this.autoCursorPosition = function(e) {
  23622. this.cursor.scale.set(.3, .3, .3)
  23623. }
  23624. }
  23625. ,
  23626. h.prototype.vrRenderer = function(a, i, e) {
  23627. var s = new i.vrCamera(e);
  23628. s.bananaAspect = .8,
  23629. this.width,
  23630. this.height;
  23631. i = this;
  23632. this.setSize = function(e, t) {
  23633. a.setSize.call(this, e, t),
  23634. i.width = e,
  23635. i.height = t
  23636. }
  23637. ,
  23638. this.render = function(e, t, i, n) {
  23639. var r, o;
  23640. if (window.cameraQua = t.quaternion.clone(),
  23641. t.__RESS__SKIP__STEREO__)
  23642. return a.render(e, t, i, n);
  23643. if ("PerspectiveCamera" === t.type)
  23644. r = s.cameraL,
  23645. o = s.cameraR,
  23646. e.updateMatrixWorld(),
  23647. null === t.parent && t.updateMatrixWorld(),
  23648. s.vrCameraUpdate(t);
  23649. else {
  23650. if ("OrthographicCamera" !== t.type)
  23651. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23652. r = o = t
  23653. }
  23654. a.setScissorTest(!0),
  23655. a.setScissor(0, 0, this.width / 2, this.height),
  23656. a.setViewport(0, 0, this.width / 2, this.height),
  23657. a.render.call(this, e, r, i, n),
  23658. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23659. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23660. a.render.call(this, e, o, i, n),
  23661. a.setScissorTest(!1)
  23662. }
  23663. ,
  23664. this.__proto__ = {
  23665. __proto__: a
  23666. }
  23667. }
  23668. ,
  23669. h.prototype.vrCamera = function(e) {
  23670. this.type = "StereoCamera",
  23671. this._aspect = 1,
  23672. this._overlap = .064,
  23673. this.cameraL = new M.PerspectiveCamera,
  23674. this.cameraL.layers.enable(1),
  23675. this.cameraL.matrixAutoUpdate = !1,
  23676. this.cameraR = new M.PerspectiveCamera,
  23677. this.cameraR.layers.enable(2),
  23678. this.cameraR.matrixAutoUpdate = !1,
  23679. this.eyeRight = new M.Matrix4,
  23680. this.eyeLeft = new M.Matrix4,
  23681. this.vrCameraNeedsUpdate = !0,
  23682. window.vrCameraL = this.cameraL,
  23683. Object.defineProperty(this, "bananaAspect", {
  23684. get: function() {
  23685. return this._aspect
  23686. },
  23687. set: function(e) {
  23688. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23689. this._aspect = e
  23690. }
  23691. }),
  23692. Object.defineProperty(this, "overlap", {
  23693. get: function() {
  23694. return this._overlap
  23695. },
  23696. set: function(e) {
  23697. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23698. this._overlap = e
  23699. }
  23700. }),
  23701. this.vrCameraUpdate = function(e) {
  23702. if (this.vrCameraNeedsUpdate = !0,
  23703. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23704. this.vrCameraNeedsUpdate) {
  23705. this.vrCameraNeedsUpdate = !1,
  23706. console.debug("vrCameraUpdate"),
  23707. this.bananaFocus = e.focus,
  23708. this.bananaFov = e.fov,
  23709. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23710. this.bananaNear = e.near,
  23711. this.bananaFar = e.far,
  23712. console.debug(e.aspect),
  23713. this.bananaFocus = 10;
  23714. 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);
  23715. this.eyeLeft.elements[12] = -r,
  23716. this.eyeRight.elements[12] = r,
  23717. t = -a * this.bananaReal_aspect + o,
  23718. i = a * this.bananaReal_aspect + o,
  23719. n.elements[0] = 2 * this.bananaNear / (i - t),
  23720. n.elements[8] = (i + t) / (i - t),
  23721. this.cameraL.projectionMatrix.copy(n),
  23722. t = -a * this.bananaReal_aspect - o,
  23723. i = a * this.bananaReal_aspect - o,
  23724. n.elements[0] = 2 * this.bananaNear / (i - t),
  23725. n.elements[8] = (i + t) / (i - t),
  23726. this.cameraR.projectionMatrix.copy(n)
  23727. }
  23728. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23729. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23730. }
  23731. }
  23732. ,
  23733. h.prototype.boluoGetTexture = function(e) {
  23734. var t = new M.TextureLoader;
  23735. return t.crossOrigin = "anonymous",
  23736. t.load(e)
  23737. }
  23738. ,
  23739. h.prototype.updateScreenSize = function(e) {
  23740. var t, i, n, r = !1;
  23741. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23742. n = e.height,
  23743. r = !0,
  23744. t = 1) : (i = $("#player").width(),
  23745. n = $("#player").height(),
  23746. e && e.resize && (o = this.renderWidth,
  23747. a = this.renderHeight),
  23748. i === o && n === a && !this.forceUpdateSize || (o = i,
  23749. a = n,
  23750. r = !0,
  23751. t = window.devicePixelRatio)),
  23752. r && (this.setSize(i, n, t),
  23753. this.forceUpdateSize = !1)
  23754. }
  23755. ,
  23756. h.prototype.updateComponents = function() {
  23757. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23758. this.updateListeners[t].update(e)
  23759. }
  23760. ,
  23761. h.prototype.suspend = function() {
  23762. this.started = !1,
  23763. this.suspendedObjects = this.scene.children.map(function(e) {
  23764. return this.scene.remove(e),
  23765. e
  23766. }
  23767. .bind(this)),
  23768. this.render()
  23769. }
  23770. ,
  23771. h.prototype.resume = function() {
  23772. this.suspendedObjects.forEach(function(e) {
  23773. this.scene.add(e)
  23774. }
  23775. .bind(this)),
  23776. this.suspendedObjects = [],
  23777. this.started = !0,
  23778. b()
  23779. }
  23780. ;
  23781. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23782. this.started && (window.requestAnimationFrame(b),
  23783. this.updateScreenSize(),
  23784. this.updateComponents(),
  23785. this.updateTextureMemory(),
  23786. this.render(),
  23787. this.emit(r.AfterRender))
  23788. };
  23789. h.prototype.getImageData = (E = document.createElement("canvas"),
  23790. _ = E.getContext("2d"),
  23791. function(e, t, i) {
  23792. return E.width === t && E.height === i || (E.width = t,
  23793. E.height = i),
  23794. _.drawImage(e, 0, 0, t, i),
  23795. _.getImageData(0, 0, t, i)
  23796. }
  23797. ),
  23798. h.prototype.initSizedTexture2D = function(e, t, i) {
  23799. var n = this.renderer
  23800. , r = n.context
  23801. , o = n.state
  23802. , a = new M.Texture(null);
  23803. !(a.flipY = !1) !== i && (i = !1),
  23804. a.generateMipmaps = i;
  23805. var s = n.paramThreeToGL(a.format)
  23806. , l = n.paramThreeToGL(a.type)
  23807. , c = n.properties.get(a)
  23808. , h = r.createTexture();
  23809. o.bindTexture(r.TEXTURE_2D, h),
  23810. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23811. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23812. a.wrapS = t,
  23813. a.wrapT = t;
  23814. var u = n.paramThreeToGL(t);
  23815. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23816. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23817. i ? (a.magFilter = M.LinearFilter,
  23818. a.minFilter = M.LinearMipMapLinearFilter,
  23819. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23820. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23821. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23822. a.minFilter = M.LinearFilter,
  23823. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23824. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23825. o.bindTexture(r.TEXTURE_2D, null),
  23826. c.__webglTexture = h,
  23827. a
  23828. }
  23829. ,
  23830. h.prototype.initSizedCubeMap = function(e, t) {
  23831. var i = this.renderer
  23832. , n = i.context
  23833. , r = i.state
  23834. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23835. o.flipY = !1,
  23836. o.generateMipmaps = t;
  23837. var a = i.paramThreeToGL(o.format)
  23838. , s = i.paramThreeToGL(o.type)
  23839. , l = i.properties.get(o)
  23840. , c = n.createTexture();
  23841. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23842. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23843. for (var h = 0; h < 6; h++)
  23844. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23845. return t ? (o.magFilter = M.LinearFilter,
  23846. o.minFilter = M.LinearMipMapLinearFilter,
  23847. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23848. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23849. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23850. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23851. o.minFilter = M.LinearFilter,
  23852. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23853. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23854. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23855. l.__image__webglTextureCube = c,
  23856. o
  23857. }
  23858. ,
  23859. h.prototype.deallocateCubeTexture = function(e) {
  23860. var t = this.renderer
  23861. , i = t.context
  23862. , n = t.properties.get(e);
  23863. i.deleteTexture(n.__image__webglTextureCube)
  23864. }
  23865. ,
  23866. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23867. var a = this.renderer
  23868. , s = a.context
  23869. , l = a.state
  23870. , c = a.properties.get(t);
  23871. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23872. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23873. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23874. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23875. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23876. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23877. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23878. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23879. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23880. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23881. l.bindTexture(s.TEXTURE_2D, null)
  23882. }
  23883. ,
  23884. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23885. var s = this.renderer
  23886. , l = s.context
  23887. , c = s.state
  23888. , h = s.properties.get(t);
  23889. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23890. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23891. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23892. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23893. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23894. }
  23895. ,
  23896. h.prototype.rebuildMipMaps2D = function(e) {
  23897. var t = this.renderer
  23898. , i = t.context
  23899. , n = t.state;
  23900. t.properties.get(e),
  23901. i.generateMipmap(i.TEXTURE_2D),
  23902. n.bindTexture(i.TEXTURE_2D, null)
  23903. }
  23904. ,
  23905. h.prototype.rebuildMipMaps3D = function(e) {
  23906. var t = this.renderer
  23907. , i = t.context
  23908. , n = t.state
  23909. , r = t.properties.get(e);
  23910. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23911. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23912. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23913. }
  23914. ,
  23915. h.prototype.renderToCubeMap = (P = !1,
  23916. F = N = D = L = O = null,
  23917. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23918. this.renderer.context,
  23919. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23920. (O = new M.Scene).add(L),
  23921. D = new M.ShaderMaterial({
  23922. uniforms: {
  23923. tDiffuse: {
  23924. type: "t",
  23925. value: null
  23926. },
  23927. alpha: {
  23928. type: "f",
  23929. value: 1
  23930. }
  23931. },
  23932. vertexShader: R.basicTextured.vertexShader,
  23933. fragmentShader: R.basicTextured.fragmentShader,
  23934. depthWrite: !1,
  23935. depthTest: !1,
  23936. side: M.DoubleSide
  23937. }),
  23938. N = new M.PlaneBufferGeometry(1,1),
  23939. (F = new M.Mesh(N,D)).position.z = 0,
  23940. O.add(F),
  23941. P = !0);
  23942. var m = N.getAttribute("uv");
  23943. m.setDynamic(!0),
  23944. m.needsUpdate = !0;
  23945. var v = m.array
  23946. , y = r / i
  23947. , A = o / n
  23948. , C = a / i
  23949. , I = s / n;
  23950. v[0] = y,
  23951. v[1] = A + I,
  23952. v[2] = y + C,
  23953. v[3] = A + I,
  23954. v[4] = y,
  23955. v[5] = A,
  23956. v[6] = y + C,
  23957. v[7] = A;
  23958. var E = N.getAttribute("position");
  23959. E.setDynamic(!0),
  23960. E.needsUpdate = !0;
  23961. var _ = E.array
  23962. , b = l / t.width - .5
  23963. , w = c / t.height - .5
  23964. , T = h / t.width
  23965. , x = u / t.height;
  23966. _[0] = b,
  23967. _[1] = w + x,
  23968. _[3] = b + T,
  23969. _[4] = w + x,
  23970. _[6] = b,
  23971. _[7] = w,
  23972. _[9] = b + T,
  23973. _[10] = w,
  23974. this.renderer.properties.get(e),
  23975. D.uniforms.tDiffuse.value = e,
  23976. D.blending = p || M.NoBlending,
  23977. D.transparent = !!f,
  23978. null != g || (g = 1),
  23979. D.uniforms.alpha.value = g,
  23980. D.needUpdate = !0,
  23981. t.activeCubeFace = d,
  23982. t.viewport.set(0, 0, t.width, t.height);
  23983. var S = this.renderer.autoClear;
  23984. this.renderer.autoClear = !1,
  23985. this.renderer.render(O, L, t, !1),
  23986. this.renderer.autoClear = S
  23987. }
  23988. ),
  23989. h.prototype.copyCubeMap = (g = !1,
  23990. C = A = y = v = m = null,
  23991. I = new M.Euler,
  23992. new M.Vector3,
  23993. function(e, t, i, n, r, o, a, s, l) {
  23994. this.renderer,
  23995. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23996. (m = new M.Scene).add(v),
  23997. y = new M.ShaderMaterial({
  23998. uniforms: {
  23999. tDiffuse: {
  24000. type: "t",
  24001. value: null
  24002. },
  24003. alpha: {
  24004. type: "f",
  24005. value: 1
  24006. }
  24007. },
  24008. vertexShader: R.copyCubeMap.vertexShader,
  24009. fragmentShader: R.copyCubeMap.fragmentShader,
  24010. depthWrite: !1,
  24011. depthTest: !1,
  24012. side: M.DoubleSide
  24013. }),
  24014. A = new M.BoxGeometry(2,2,2),
  24015. C = new M.Mesh(A,y),
  24016. m.add(C),
  24017. g = !0);
  24018. for (var c = 0; c < 6; c++)
  24019. h.getCubeOrientationForCubeFace(c, I),
  24020. C.rotation.copy(I),
  24021. C.matrixWorldNeedsUpdate = !0,
  24022. C.updateMatrixWorld(),
  24023. y.uniforms.tDiffuse.value = e,
  24024. y.blending = a || M.NoBlending,
  24025. y.transparent = !!s,
  24026. null != l || (l = 1),
  24027. y.uniforms.alpha.value = l,
  24028. y.needUpdate = !0,
  24029. t.activeCubeFace = c,
  24030. t.viewport.set(0, 0, r, o),
  24031. this.renderer.render(m, v, t, !1)
  24032. }
  24033. ),
  24034. h.getLookAtForCubeFace = function(e, t) {
  24035. switch (e) {
  24036. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24037. t.set(1, 0, 0);
  24038. break;
  24039. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24040. t.set(-1, 0, 0);
  24041. break;
  24042. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24043. t.set(0, 1, 0);
  24044. break;
  24045. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24046. t.set(0, -1, 0);
  24047. break;
  24048. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24049. t.set(0, 0, 1);
  24050. break;
  24051. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24052. t.set(0, 0, -1)
  24053. }
  24054. }
  24055. ,
  24056. h.getCubeOrientationForCubeFace = function(e, t) {
  24057. switch (e) {
  24058. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24059. t.set(0, -Math.PI / 2, 0);
  24060. break;
  24061. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24062. t.set(0, Math.PI / 2, 0);
  24063. break;
  24064. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24065. t.set(Math.PI / 2, Math.PI, 0);
  24066. break;
  24067. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24068. t.set(-Math.PI / 2, Math.PI, 0);
  24069. break;
  24070. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24071. t.set(0, -Math.PI, 0);
  24072. break;
  24073. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24074. t.set(0, 0, 0)
  24075. }
  24076. }
  24077. ,
  24078. t.exports = h
  24079. }
  24080. , {
  24081. "../enum/GLCubeFaces": 25,
  24082. "../enum/GLTextureType": 26,
  24083. "../enum/SceneRendererEvents": 43,
  24084. "../exception/BasicException": 55,
  24085. "../exception/RendererCreationException": 57,
  24086. "../settings": 166,
  24087. "../shaders": 167,
  24088. "../util/browser": 182,
  24089. events: 202,
  24090. three: 217
  24091. }],
  24092. 159: [function(e, t, i) {
  24093. "use strict";
  24094. function n(e) {
  24095. this.messenger = new a(e),
  24096. this.clientKey = null
  24097. }
  24098. var o = e("../util/ajax")
  24099. , r = e("./PostMessageType")
  24100. , a = e("./postmessage")
  24101. , s = e("./VersionInfo")
  24102. , l = e("events").EventEmitter
  24103. , c = window.location.origin + "/api/v1/user/";
  24104. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  24105. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  24106. }
  24107. ,
  24108. n.prototype.waitForConnection = function() {
  24109. return new Promise(function(t, i) {
  24110. this.messenger.on(r.CONNECT, function(e) {
  24111. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  24112. }
  24113. .bind(this))
  24114. }
  24115. .bind(this))
  24116. }
  24117. ,
  24118. n.prototype.onConnectionReceived = function(i) {
  24119. return this.messenger.setTarget(i.source, i.origin),
  24120. this.verifyConnection(i).then(function(e, t) {
  24121. this.messenger.send({
  24122. type: r.ACCEPT,
  24123. toId: i.fromId,
  24124. warning: t
  24125. }),
  24126. this.clientKey = e,
  24127. this.messenger.removeAllListeners(r.CONNECT),
  24128. this.bindEvents()
  24129. }
  24130. .bind(this), function(e) {
  24131. this.messenger.send({
  24132. type: r.REJECT,
  24133. toId: i.fromId,
  24134. reason: e
  24135. }),
  24136. this.messenger.setTarget()
  24137. }
  24138. .bind(this))
  24139. }
  24140. ,
  24141. n.prototype.verifyConnection = function(r) {
  24142. return new Promise(function(e, t) {
  24143. var i;
  24144. if (s.isDeprecated(r.sdkVersion))
  24145. i = "这个版本正在被弃用";
  24146. else if (!s.isSupported(r.sdkVersion))
  24147. return t("不支持此版本的SDK");
  24148. var n = {
  24149. cache: !1,
  24150. headers: {
  24151. "X-port-Application-Key": r.applicationKey,
  24152. "X-port-Referrer": r.origin
  24153. }
  24154. };
  24155. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  24156. }
  24157. )
  24158. }
  24159. ,
  24160. n.prototype.onMessageReceived = function(t) {
  24161. if (this.validateClientApplicationKey(t.applicationKey)) {
  24162. var i = this;
  24163. t.onDone = function(e) {
  24164. e.toId = t.fromId,
  24165. e.uid = t.uid,
  24166. e.type = r.RESPONSE,
  24167. i.messenger.send(e)
  24168. }
  24169. ,
  24170. this.emit(r.ACTION, t)
  24171. }
  24172. }
  24173. ,
  24174. n.prototype.validateClientApplicationKey = function(e) {
  24175. return this.clientKey === e
  24176. }
  24177. ,
  24178. n.prototype.sendEvent = function(e, t) {
  24179. this.messenger.send({
  24180. type: r.EVENT,
  24181. eventType: e,
  24182. eventData: t
  24183. })
  24184. }
  24185. ,
  24186. t.exports = n
  24187. }
  24188. , {
  24189. "../util/ajax": 181,
  24190. "./PostMessageType": 160,
  24191. "./VersionInfo": 163,
  24192. "./postmessage": 165,
  24193. events: 202
  24194. }],
  24195. 160: [function(e, t, i) {
  24196. "use strict";
  24197. t.exports = Object.freeze({
  24198. CONNECT: "postmessage.connect",
  24199. ACCEPT: "postmessage.accept",
  24200. REJECT: "postmessage.reject",
  24201. ACTION: "postmessage.action",
  24202. RESPONSE: "postmessage.response",
  24203. EVENT: "postmessage.event"
  24204. })
  24205. }
  24206. , {}],
  24207. 161: [function(e, t, i) {
  24208. "use strict";
  24209. t.exports = Object.freeze({
  24210. MOVE: "sdk.move",
  24211. ENTER_PANO: "sdk.enterpano",
  24212. MODEL_LOADED: "sdk.modelloaded"
  24213. })
  24214. }
  24215. , {}],
  24216. 162: [function(e, t, i) {
  24217. "use strict";
  24218. t.exports = Object.freeze({
  24219. FLY: "transition.fly",
  24220. FADEOUT: "transition.fade",
  24221. INSTANT: "transition.instant"
  24222. })
  24223. }
  24224. , {}],
  24225. 163: [function(e, t, i) {
  24226. "use strict";
  24227. t.exports = {
  24228. current: "1.0",
  24229. supported: ["1.0"],
  24230. deprecated: [],
  24231. isSupported: function(e) {
  24232. return -1 !== this.supported.indexOf(e)
  24233. },
  24234. isDeprecated: function(e) {
  24235. return -1 !== this.deprecated.indexOf(e)
  24236. },
  24237. isValid: function(e) {
  24238. return this.isSupported(e) || this.isDeprecated(e)
  24239. }
  24240. }
  24241. }
  24242. , {}],
  24243. 164: [function(q, X, e) {
  24244. (function(e) {
  24245. "use strict";
  24246. function r(e, t, i) {
  24247. e = e && e.toLowerCase().trim();
  24248. var n = new C.UP.clone
  24249. , r = Math.PI / 3
  24250. , o = Math.PI / 2;
  24251. switch (e) {
  24252. case "left":
  24253. i.copy(t),
  24254. i.applyAxisAngle(n, o);
  24255. break;
  24256. case "right":
  24257. i.copy(t),
  24258. i.applyAxisAngle(n, -o);
  24259. break;
  24260. case "forwardleft":
  24261. i.copy(t),
  24262. i.applyAxisAngle(n, r);
  24263. break;
  24264. case "forwardright":
  24265. i.copy(t),
  24266. i.applyAxisAngle(n, -r);
  24267. break;
  24268. case "forward":
  24269. default:
  24270. i.copy(t)
  24271. }
  24272. return i
  24273. }
  24274. function o(e, t) {
  24275. if (e) {
  24276. var i = {
  24277. pano: e,
  24278. lookAtPoint: null,
  24279. duration: null,
  24280. maxDistanceOverride: null,
  24281. skipWarpingCheck: !1
  24282. };
  24283. this.player.flyToPano(i, function() {
  24284. t && t({
  24285. success: !0,
  24286. message: "Transition complete."
  24287. })
  24288. })
  24289. } else
  24290. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24291. t && t({
  24292. success: !1,
  24293. error: "Unable to find pano."
  24294. })
  24295. }
  24296. function a(e, t) {
  24297. t.copy(C.FORWARD),
  24298. e.getDirection(t)
  24299. }
  24300. function c(i) {
  24301. return {
  24302. panos: i.panos.list.map(function(e) {
  24303. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24304. return {
  24305. uuid: e.id,
  24306. aligned: e.alignmentType === g.ALIGNED,
  24307. neighbourUUIDs: e.neighbourUUIDs.slice(),
  24308. position: function(e) {
  24309. return e.alignmentType !== g.ALIGNED ? null : {
  24310. x: e.position.x,
  24311. y: e.position.y,
  24312. z: e.position.z
  24313. }
  24314. }(e),
  24315. rotation: function(e) {
  24316. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24317. return {
  24318. x: h.Math.radToDeg(t._x),
  24319. y: h.Math.radToDeg(t._y),
  24320. z: h.Math.radToDeg(t._z)
  24321. }
  24322. }(e),
  24323. thumbnail: t
  24324. }
  24325. })
  24326. }
  24327. }
  24328. 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"),
  24329. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  24330. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  24331. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  24332. N.angle = 0,
  24333. N.angleTravelled = 0,
  24334. N.playerDirection = new h.Vector3,
  24335. N.lastFacingDirection = new h.Vector3,
  24336. N.onDone = null,
  24337. N.player = null,
  24338. N.start = function(e, t, i, n) {
  24339. N.active = !0,
  24340. e && t && (t = 0),
  24341. N.angle = e || t,
  24342. N.xAngle = e,
  24343. N.yAngle = t,
  24344. N.angleTravelled = 0,
  24345. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24346. i.getDirection(N.playerDirection),
  24347. N.lastFacingDirection.copy(N.playerDirection),
  24348. N.projectVectors(),
  24349. N.onDone = n,
  24350. N.player = i,
  24351. N()
  24352. }
  24353. ,
  24354. N.projectVectors = function() {
  24355. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  24356. N.lastFacingDirection.projectOnPlane(C.UP))
  24357. }
  24358. ,
  24359. N), P = (i = new h.Vector3,
  24360. function(e) {
  24361. e ? (i.copy(e.position),
  24362. i.add(e.discPosition),
  24363. s.projectPositionToCanvas(i, this.player.camera, i),
  24364. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  24365. }
  24366. ), O = (l = new h.Vector3,
  24367. function(e) {
  24368. var t = this.player.getDirection();
  24369. l.copy(t);
  24370. var i = l.y;
  24371. l.y = 0,
  24372. l.normalize();
  24373. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  24374. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  24375. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24376. 0;
  24377. this.player.mode === I.DOLLHOUSE && (n = -n);
  24378. var r = function() {
  24379. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  24380. }
  24381. .call(this) - .1
  24382. , o = function() {
  24383. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  24384. }
  24385. .call(this) + .1
  24386. , a = n + e;
  24387. r < a ? a = r : a < o && (a = o);
  24388. var s = a - n;
  24389. return 0 < e && s < .01 && (s = 0),
  24390. e < 0 && -.01 < s && (s = 0),
  24391. s
  24392. }
  24393. ), L = (t = new h.Euler,
  24394. function(e) {
  24395. return t.setFromQuaternion(e.quaternion, "YXZ"),
  24396. {
  24397. position: {
  24398. x: e.position.x,
  24399. y: e.position.y,
  24400. z: e.position.z
  24401. },
  24402. rotation: {
  24403. x: h.Math.radToDeg(t.x),
  24404. y: h.Math.radToDeg(t.y),
  24405. z: 0
  24406. },
  24407. pano: e.currentPano ? e.currentPano.id : null,
  24408. mode: e.mode
  24409. }
  24410. }
  24411. ), D = null;
  24412. function N() {
  24413. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24414. N.player.getDirection(N.playerDirection),
  24415. N.projectVectors();
  24416. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  24417. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  24418. N.onDone && (0,
  24419. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  24420. window.setTimeout(N, 4))
  24421. }
  24422. X.exports = {
  24423. init: function(e, t, i, n, r) {
  24424. Y.init(e, t, i, r),
  24425. D = new Promise(function(e, t) {
  24426. i.on(_.Ready, function() {
  24427. e()
  24428. })
  24429. }
  24430. .bind(this));
  24431. var o = new u(window)
  24432. , a = o.waitForConnection();
  24433. a.then(function(e) {
  24434. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24435. });
  24436. var s, l = (s = Date.now(),
  24437. function() {
  24438. if (!(Date.now() - s < 100)) {
  24439. var e = L(i);
  24440. o.sendEvent(b.MOVE, {
  24441. state: e
  24442. }),
  24443. s = Date.now()
  24444. }
  24445. }
  24446. );
  24447. i.on(_.Move, l),
  24448. i.on(_.ViewChanged, l),
  24449. n.on(p.ActiveModelChanged, function(e) {
  24450. function t(e) {
  24451. var t, i = e.newPano.id;
  24452. e.oldPano && (t = e.oldPano.id),
  24453. i !== t && o.sendEvent(b.ENTER_PANO, {
  24454. oldPano: t,
  24455. newPano: i
  24456. })
  24457. }
  24458. var i = e.model
  24459. , n = e.oldModel;
  24460. Y.model = i,
  24461. a.then(function() {
  24462. o.sendEvent(b.MODEL_LOADED, {
  24463. metadata: c(i)
  24464. })
  24465. }),
  24466. n && n.panos.forEach(function(e) {
  24467. e.removeEventListener("enter", t)
  24468. }),
  24469. i.panos.forEach(function(e) {
  24470. e.on("enter", t)
  24471. })
  24472. })
  24473. }
  24474. };
  24475. var F, B, V, k, U, H, z, G, W, j, Y = {
  24476. director: null,
  24477. player: null,
  24478. controls: null,
  24479. sceneRenderer: null,
  24480. model: null,
  24481. init: function(e, t, i, n) {
  24482. this.director = e,
  24483. this.player = i,
  24484. this.controls = t,
  24485. this.sceneRenderer = n
  24486. },
  24487. handleToObject: {},
  24488. objectToHandle: {},
  24489. handleCount: 0,
  24490. onMessageReceive: function(e) {
  24491. if (e) {
  24492. var t = e.targetFunction
  24493. , i = e.params
  24494. , n = e.onDone;
  24495. t && this[t] && this[t](i, n)
  24496. }
  24497. },
  24498. waitForInit: function(e, t) {
  24499. D.then(t.bind({
  24500. success: !0,
  24501. message: "Init complete."
  24502. }))
  24503. },
  24504. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24505. j = new h.Quaternion,
  24506. function(e, t) {
  24507. var i = e.pano
  24508. , n = e.rotation
  24509. , r = e.transition;
  24510. if (!this.model)
  24511. return t({
  24512. success: !1,
  24513. error: "The model has not been loaded yet"
  24514. });
  24515. var o = this.model.panos.get(i);
  24516. if (!o)
  24517. return t({
  24518. success: !1,
  24519. error: i + " does not exist in this model"
  24520. });
  24521. if (!n)
  24522. return t({
  24523. sucess: !1,
  24524. erorr: n + " is not a valid rotation"
  24525. });
  24526. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24527. console.log(n.z);
  24528. var a = {
  24529. success: !0,
  24530. message: i
  24531. };
  24532. if (r === v.FADEOUT)
  24533. j.setFromEuler(W),
  24534. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24535. else {
  24536. var s, l;
  24537. r === v.INSTANT && (l = s = 0);
  24538. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24539. this.player.flyToPano({
  24540. pano: o,
  24541. lookAtPoint: c,
  24542. duration: s,
  24543. aimDuration: l
  24544. }, t.bind(this, a))
  24545. }
  24546. }
  24547. ),
  24548. moveInDirection: function(e, t) {
  24549. var i = e.direction;
  24550. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24551. void (t && t({
  24552. success: !1,
  24553. error: "Invalid direction."
  24554. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24555. t(e ? {
  24556. success: !0,
  24557. message: "moved " + i
  24558. } : {
  24559. success: !1,
  24560. error: "Cannot move in direction: " + i
  24561. })
  24562. })
  24563. },
  24564. getPose: function(e, t) {
  24565. return this.player.camera.position,
  24566. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24567. t({
  24568. success: !0,
  24569. message: L(this.player)
  24570. })
  24571. },
  24572. takeScreenShot: (z = new h.PerspectiveCamera,
  24573. G = new h.WebGLRenderTarget,
  24574. function(e, t) {
  24575. if (!e.resolution)
  24576. return t({
  24577. success: !1,
  24578. error: "An invalid resolution was specified"
  24579. });
  24580. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24581. var i = this.sceneRenderer.renderer.getSize();
  24582. e.resolution.width = i.width,
  24583. e.resolution.height = i.height
  24584. }
  24585. z.layers.set(T.DEFAULT),
  24586. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24587. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24588. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24589. var n = e.resolution.width
  24590. , r = e.resolution.height
  24591. , o = n / r;
  24592. z.position.copy(this.sceneRenderer.camera.position),
  24593. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24594. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24595. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24596. G.setSize(n, r),
  24597. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24598. var a = new Uint8Array(n * r * 4);
  24599. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24600. var s = S.encode({
  24601. data: a,
  24602. width: n,
  24603. height: r,
  24604. heading: 180,
  24605. pitch: 0
  24606. }, {
  24607. quality: 75,
  24608. flipY: !0
  24609. });
  24610. t({
  24611. success: !0,
  24612. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24613. })
  24614. }
  24615. ),
  24616. findRankedPano: (U = new h.Vector3,
  24617. H = new h.Vector3,
  24618. function(e, t) {
  24619. a(this.player, H),
  24620. r(t, H, U);
  24621. var i = this.player.rankedPanoInDirection(e, U);
  24622. if (i) {
  24623. var n = this.objectToHandle[i.id];
  24624. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24625. this.handleToObject[n] = i),
  24626. n
  24627. }
  24628. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24629. -1
  24630. }
  24631. ),
  24632. findRankedtag: (V = new h.Vector3,
  24633. k = new h.Vector3,
  24634. function(e, t) {
  24635. a(this.player, k),
  24636. r(t, k, V);
  24637. var i = this.player.rankedtagInDirection(e, V);
  24638. if (i) {
  24639. var n = this.objectToHandle[i.sid];
  24640. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24641. this.handleToObject[n] = i),
  24642. n
  24643. }
  24644. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24645. -1
  24646. }
  24647. ),
  24648. clickNearesttag: function(e) {
  24649. this.clickRankedtag(0, e)
  24650. },
  24651. clickRankedtag: function(e, t) {
  24652. var i = function(e, t) {
  24653. var i = this.findRankedtag(e, t);
  24654. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24655. null)
  24656. }
  24657. .call(this, e, t);
  24658. i && P.call(this, i)
  24659. },
  24660. clickNearestPano: function(e, t) {
  24661. this.clickRankedPano(0, e, t)
  24662. },
  24663. clickRankedPano: function(e, t, i) {
  24664. var n = function(e, t) {
  24665. var i = this.findRankedPano(e, t);
  24666. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24667. null)
  24668. }
  24669. .call(this, e, t);
  24670. n ? o.call(this, n, i) : i(null)
  24671. },
  24672. clickPano: function(e, t) {
  24673. var i = this.handleTable[e];
  24674. i ? o.call(this, i, t) : t(null)
  24675. },
  24676. rotateDirection: function(e, t) {
  24677. var i = e.direction
  24678. , n = e.angle;
  24679. if (!R.active) {
  24680. var r = 0
  24681. , o = 0
  24682. , a = 0
  24683. , s = 0;
  24684. if (!n || isNaN(n))
  24685. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24686. void (t && t({
  24687. success: !1,
  24688. error: "Invalid rotation angle."
  24689. }));
  24690. if (this.player.mode === I.TRANSITIONING)
  24691. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24692. void (t && t({
  24693. success: !1,
  24694. error: "Cannot rotate while transitioning"
  24695. }));
  24696. if (i === m.RIGHT || i === m.LEFT)
  24697. i === m.RIGHT && (n = -n),
  24698. r = 0 < n ? -1 : 1,
  24699. a = n;
  24700. else {
  24701. if (i !== m.UP && i !== m.DOWN)
  24702. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24703. void (t && t({
  24704. success: !1,
  24705. error: "Invalid direction for rotation."
  24706. }));
  24707. if (this.player.mode === I.FLOORPLAN)
  24708. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24709. void (t && t({
  24710. success: !1,
  24711. error: "Cannot rotate " + i + " in floorplan mode"
  24712. }));
  24713. if (i === m.DOWN && (n = -n),
  24714. 0 === (n = O.call(this, n)))
  24715. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24716. void (t && t({
  24717. success: !1,
  24718. error: "Already at maximum rotation in direction: " + i
  24719. }));
  24720. o = 0 < n ? 1 : -1,
  24721. s = n
  24722. }
  24723. var l = n;
  24724. n = h.Math.degToRad(n),
  24725. a = h.Math.degToRad(a),
  24726. s = h.Math.degToRad(s);
  24727. var c = this.controls.activeControl;
  24728. c.startRotating(r, o),
  24729. R.start(a, s, this.player, function() {
  24730. c.stopRotating(!0),
  24731. t && t({
  24732. success: !0,
  24733. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24734. })
  24735. })
  24736. }
  24737. },
  24738. rotate: (F = new h.Vector3,
  24739. B = new h.Vector3,
  24740. function(e, t) {
  24741. var i = e.xAngle
  24742. , n = e.yAngle;
  24743. if (!R.active) {
  24744. if (i = i || 0,
  24745. n = n || 0,
  24746. isNaN(i) || isNaN(n))
  24747. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24748. void (t && t({
  24749. success: !1,
  24750. error: "Invalid rotation angle."
  24751. }));
  24752. if (this.player.mode === I.TRANSITIONING)
  24753. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24754. void (t && t({
  24755. success: !1,
  24756. error: "Cannot rotate while transitioning"
  24757. }));
  24758. Math.abs(i) < .01 && (i = 0),
  24759. Math.abs(n) < .01 && (n = 0);
  24760. var r = n;
  24761. n = O.call(this, n);
  24762. var o = 0 < r ? "UP" : "DOWN";
  24763. if (!(i = -i) && r && !n)
  24764. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24765. void (t && t({
  24766. success: !1,
  24767. error: "Already at maximum rotation in direction: " + o
  24768. }));
  24769. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24770. var a = n;
  24771. n = h.Math.degToRad(n),
  24772. i = h.Math.degToRad(i),
  24773. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24774. this.player.getDirection(F),
  24775. B.copy(F).applyAxisAngle(C.UP, i),
  24776. B.applyAxisAngle(C.RIGHT, n);
  24777. var s = (F.angleTo(B),
  24778. 0 < i ? -1 : i < 0 ? 1 : 0)
  24779. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24780. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24781. var c = this.controls.activeControl;
  24782. c.startRotating(s, l),
  24783. R.start(i, n, this.player, function() {
  24784. c.stopRotating(!0),
  24785. t && t({
  24786. success: !0,
  24787. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24788. })
  24789. })
  24790. }
  24791. }
  24792. ),
  24793. panCamera: function(e, i) {
  24794. function t(e) {
  24795. switch (r.removeAllListeners(w.AutoPanComplete),
  24796. r.removeAllListeners(w.AutoPanInterrupt),
  24797. r.removeAllListeners(w.AutoPanClamped),
  24798. e) {
  24799. case w.AutoPanInterrupt:
  24800. i({
  24801. success: !0,
  24802. message: "Camera panning interrupted."
  24803. });
  24804. break;
  24805. case w.AutoPanClamped:
  24806. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24807. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24808. return void i({
  24809. success: !1,
  24810. error: "Already at edge of current model bounds."
  24811. });
  24812. var t = "The view point is outside the bounds for the current model. ";
  24813. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24814. console.warn(t)
  24815. }
  24816. case w.AutoPanComplete:
  24817. i({
  24818. success: !0,
  24819. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24820. })
  24821. }
  24822. }
  24823. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24824. return i({
  24825. success: !1,
  24826. error: "Camera panning is not available in the current mode: " + this.player.mode
  24827. });
  24828. var n = e.position
  24829. , r = this.player.control;
  24830. r.setAutoPanPosition(n.x, n.z),
  24831. r.autoPan = !0;
  24832. var o = function(e, t) {
  24833. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24834. };
  24835. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24836. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24837. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24838. },
  24839. click: function(e, t) {
  24840. var i = e.x
  24841. , n = e.y;
  24842. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24843. n = n / 100 * $("#player").height()),
  24844. this.player.handleInputStart(i, n),
  24845. this.player.updateIntersect(),
  24846. this.player.handleInputEnd(i, n)
  24847. },
  24848. mouseOver: function(e, t) {
  24849. var i = e.x
  24850. , n = e.y;
  24851. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24852. n = n / 100 * $("#player").height()),
  24853. this.player.handleInputMove(i, n),
  24854. this.player.updateIntersect()
  24855. },
  24856. moveToMode: function(e, t) {
  24857. function i(e) {
  24858. t(e ? {
  24859. success: !1,
  24860. error: "Failed to load new mode: " + e
  24861. } : {
  24862. success: !0,
  24863. message: "Moved to new mode: " + n
  24864. })
  24865. }
  24866. var n = e.mode;
  24867. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24868. i()
  24869. }, function(e) {
  24870. i(e)
  24871. }) : t({
  24872. success: !1,
  24873. error: "Invalid mode selection"
  24874. })
  24875. }
  24876. }
  24877. }
  24878. ).call(this, "/js/sdk/automation.js")
  24879. }
  24880. , {
  24881. "../constants": 8,
  24882. "../enum/AlignmentType": 17,
  24883. "../enum/ControlEvents": 21,
  24884. "../enum/Direction": 22,
  24885. "../enum/GLCubeFaces": 25,
  24886. "../enum/Keys": 30,
  24887. "../enum/ModelManagerEvents": 33,
  24888. "../enum/PlayerEvents": 40,
  24889. "../enum/RenderLayers": 41,
  24890. "../enum/Vectors": 50,
  24891. "../enum/Viewmode": 51,
  24892. "../enum/WarpStyle": 52,
  24893. "../lib/jpeg_encoder": 94,
  24894. "../sdk/SdkEvents": 161,
  24895. "../settings": 166,
  24896. "../util/common": 185,
  24897. "../util/logger": 189,
  24898. "../util/math": 190,
  24899. "../util/panorama": 191,
  24900. "./ApiHost": 159,
  24901. "./PostMessageType": 160,
  24902. "./TransitionStyles": 162,
  24903. three: 217
  24904. }],
  24905. 165: [function(e, t, i) {
  24906. "use strict";
  24907. function n(e) {
  24908. this.sourceWindow = e,
  24909. this.targetWindow = null,
  24910. this.targetOrigin = null,
  24911. this.id = Math.floor(1e5 * Math.random()),
  24912. this.bindEvents()
  24913. }
  24914. var r = e("./PostMessageType")
  24915. , o = e("events").EventEmitter;
  24916. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24917. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24918. }
  24919. ,
  24920. n.prototype.setTarget = function(e, t) {
  24921. this.targetWindow = e,
  24922. this.targetOrigin = t
  24923. }
  24924. ,
  24925. n.prototype.onPostmessageReceived = function(e) {
  24926. var t = e.origin || e.originalEvent.origin
  24927. , i = e.source;
  24928. switch (e.data.type) {
  24929. case r.CONNECT:
  24930. break;
  24931. case r.RESPONSE:
  24932. if (this.id !== e.data.toId)
  24933. return;
  24934. default:
  24935. if (!this.validateMessageOrigin(t))
  24936. return
  24937. }
  24938. var n = e.data;
  24939. n.source = i,
  24940. n.origin = t,
  24941. n.timestamp = Date.now(),
  24942. this.emit(e.data.type, n)
  24943. }
  24944. ,
  24945. n.prototype.validateMessageOrigin = function(e) {
  24946. return "*" === this.targetOrigin || e === this.targetOrigin
  24947. }
  24948. ,
  24949. n.prototype.send = function(e) {
  24950. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24951. this.targetWindow.postMessage(e, this.targetOrigin))
  24952. }
  24953. ,
  24954. t.exports = n
  24955. }
  24956. , {
  24957. "./PostMessageType": 160,
  24958. events: 202
  24959. }],
  24960. 166: [function(e, t, i) {
  24961. "use strict";
  24962. var n = e("three")
  24963. , r = e("./util/browser")
  24964. , o = e("./enum/Viewmode")
  24965. , a = e("./enum/VROption")
  24966. , s = e("./enum/Colors")
  24967. , l = e("./enum/WarpStyle")
  24968. , c = e("./util/easing")
  24969. , h = e("./util/common")
  24970. , u = e("./util/showcase")
  24971. , d = e("./constants")
  24972. , p = {
  24973. debug: !1,
  24974. version: "2.25.6-0-gd87e5b1",
  24975. languageTag: r.valueFromHash("lang", null),
  24976. pageTitle: "四维虚拟漫游",
  24977. authorizationHeader: u.getAuthorizationHeader(),
  24978. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24979. logLevel: r.valueFromHash("log", 2),
  24980. skyboxRadius: 2500,
  24981. modelBoundsPadding: 5,
  24982. showNeighbors: !1,
  24983. brand: r.valueFromHash("brand", !0),
  24984. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24985. startHighlights: r.valueFromHash("hl", -1),
  24986. specialEdition: r.valueFromHash("bn", 0),
  24987. useWheel: r.valueFromHash("wh", !0),
  24988. crossOrigin: "anonymous",
  24989. fancierTransition: !1,
  24990. wireframe: !1,
  24991. skyboxWireframe: !1,
  24992. modelAlpha: 1,
  24993. highlightPanoSelection: !1,
  24994. showSweeps: !0,
  24995. showSkyboxes: !1,
  24996. showMesh: !0,
  24997. showFloors: !1,
  24998. showFloorDuration: 300,
  24999. showFloorDelay: 300,
  25000. hideFloorDuration: 300,
  25001. hideFloorDelay: 0,
  25002. reticuleOpacityTransitionTime: 250,
  25003. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  25004. markerOpacityTransitionTime: 500,
  25005. guiAnimationSpeed: 250,
  25006. highlightAnimationDuration: 500,
  25007. modelComponentLoadSpinnerDelay: 150,
  25008. captureErrors: !1,
  25009. maxMobileTextures: 6,
  25010. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25011. startupFlyinDelay: 3e3,
  25012. dollhouseDefault: {
  25013. minDistance: 1,//15, //编辑页面给近一些
  25014. maxDistance: 50,
  25015. minPolarAngle: n.Math.degToRad(10),
  25016. maxPolarAngle: n.Math.degToRad(90)
  25017. },
  25018. hideReticuleTimeout: 1e3,
  25019. analytics: {
  25020. inactivityThreshold: 30,
  25021. sessionTrackingRate: .15,
  25022. maxTrackedErrors: 20,
  25023. sessionDurationPingFrequency: 10,
  25024. sessionDurationTimeout: 15
  25025. },
  25026. flydown: {
  25027. movementEasing: "easeInOutQuad",
  25028. movementDelay: .001,
  25029. rotationEasing: "easeInOutQuad",
  25030. rotationDelay: .5,
  25031. modelTextureDelay: .75,
  25032. skyboxDelay: .75
  25033. },
  25034. transition: {
  25035. flySpeed: .001,
  25036. flyTime: 750,
  25037. flytimeMaxDistanceThreshold: 5,
  25038. flytimeDistanceMultiplier: 150,
  25039. aimTime: 1500,
  25040. aimSlowFactor: 1.5,
  25041. blur: .8,
  25042. movementEasing: "easeInOutQuad",
  25043. blendEasing: "easeInOutQuad",
  25044. fastForwardFactor: 3
  25045. },
  25046. show360Views: {
  25047. enabled: !0,
  25048. transitionTime: 1e3
  25049. },
  25050. quickstart: {
  25051. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  25052. animation: 1400,
  25053. showTextDelay: 500,
  25054. fadeOutDelay: 3e3,
  25055. fovChange: 10
  25056. },
  25057. appConfig: {
  25058. webvr_version: null,
  25059. segment_key: null,
  25060. embedly_key: null,
  25061. branch_key: null,
  25062. keen_write_key: null,
  25063. keen_project_id: null
  25064. },
  25065. vr: {
  25066. enabled: !0,
  25067. allowWebVR: !1,
  25068. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25069. },
  25070. share: {
  25071. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25072. },
  25073. input: {
  25074. longTapThreshold: 200,
  25075. moveToleranceNDC: .08,
  25076. touchMoveThreshold: 25
  25077. },
  25078. help: {
  25079. modalStayDuration: 600
  25080. },
  25081. immersive: {
  25082. timeToShowAgain: 1250,
  25083. uiStayDuration: 600
  25084. },
  25085. tourInteraction: {
  25086. disabled: "0" === r.valueFromHash("tourcta", null),
  25087. showPauseButton: 1e3,
  25088. showModal: 1500,
  25089. allowNextClick: 200,
  25090. largeModal: "1" === r.valueFromHash("tourcta", null),
  25091. smallModal: "2" === r.valueFromHash("tourcta", null)
  25092. },
  25093. labels: {
  25094. enabled: !1,
  25095. hideUntilStart: !0,
  25096. fadeInDuration: 250,
  25097. fadeInDelay: 250,
  25098. fadeOutDuration: 250,
  25099. fadeOutDelay: 0,
  25100. zoomHideThreshhold: {
  25101. mobile: r.isSmallScreen() ? .45 : .6,
  25102. desktop: 2
  25103. },
  25104. zoomTruncateThreshhold: {
  25105. mobile: r.isSmallScreen() ? .35 : .45,
  25106. desktop: .85
  25107. },
  25108. minLengthForTruncate: 16,
  25109. truncateLength: 12,
  25110. truncateSuffix: "..."
  25111. },
  25112. tags: {
  25113. enabled: r.valueFromHash("mt", 1),
  25114. startup: {
  25115. hideUntilStart: !0,
  25116. fadeInDuration: 500,
  25117. fadeInDelay: 100
  25118. },
  25119. visibility: {
  25120. anyDistance: !0,
  25121. visibleDistance: 8,
  25122. cameraClearance: .1,
  25123. alphaTestLevel: .05,
  25124. hideViaFloor: !0,
  25125. hideOffScreenDisc: !1,
  25126. hideOffScreenObject: !1
  25127. },
  25128. disc: {
  25129. opacity: 1,
  25130. disabledOpacity: .5,
  25131. scale: {
  25132. nearBound: 1.5,
  25133. farBound: 4.8,
  25134. linkFarBound: !1,
  25135. linkPercent: 40,
  25136. maxSize: 80,
  25137. minSize: 40,
  25138. baseViewportSize: 800,
  25139. responsiveness: 100
  25140. }
  25141. },
  25142. pole: {
  25143. enabled: !0,
  25144. height: .5,
  25145. width: 2,
  25146. opacity: .5,
  25147. color: "white"
  25148. },
  25149. navigate: {
  25150. nearestPano: !0,
  25151. lineOfSight: !0,
  25152. reactivate: !0,
  25153. aimAt: "disc",
  25154. tiltTolerance: 25,
  25155. rotateSpeedFactor: .6
  25156. }
  25157. },
  25158. path: {
  25159. color: window.DATA.floorMarkerColor || s.newBlue,
  25160. colorUp: s._desat(s.newBlue, .5),
  25161. colorDown: s._darken(s.newBlue, .35),
  25162. opacity: .5,
  25163. style: "ribbon",
  25164. height: .025,
  25165. ribbonWidth: .24,
  25166. outsideHeight: .5,
  25167. waypointRadius: .5,
  25168. waypointIndoorRadius: .24,
  25169. waypointPulse: 1e3,
  25170. typ: l.BLACK,
  25171. meshFree: r.valueFromHash("mf", 1),
  25172. mapGuides: r.valueFromHash("guides", !0),
  25173. fadeInTime: 400,
  25174. fadeOutTime: 300
  25175. },
  25176. warp: {
  25177. nearPanoDist: .1,
  25178. matchCam: !1,
  25179. blur: .33,
  25180. fastTime: 1500,
  25181. teleportTime: 1500,
  25182. outsideTime: 2e3,
  25183. lookAheadMax: .3,
  25184. lookAheadDist: 2.5,
  25185. softPushDist: .37,
  25186. softPushEnd: .3,
  25187. softBendAngle: 8,
  25188. softBendTilt: 4,
  25189. softBendEnd: .3,
  25190. doBurns: !0,
  25191. burnsAngle: 8,
  25192. minBurnsAngle: 35,
  25193. minDownAngle: -35,
  25194. maxTurnPerSec: 280,
  25195. maxAimPerSec: 35,
  25196. minRotation: 12,
  25197. maxAimRotation: 33.2,
  25198. turnFriction: .2,
  25199. flySpeed: .01,
  25200. minWarpTime: 1200,
  25201. warpInterruptionRedirectTime: 500,
  25202. tourStepDelay: r.valueFromHash("st", 0),
  25203. walkDelay: 0,
  25204. walkMaxDist: 50,
  25205. walkMinDist: .8,
  25206. walkSlideShowThreshhold: 3e3,
  25207. walkExtraPanosDistance: .4,
  25208. timePerMeter: 1200,
  25209. motionLeadTime: 5e3,
  25210. movementEasing: "easeInOutQuad",
  25211. blendEasing: "easeInOutQuad",
  25212. showBunny: !1,
  25213. loop: r.valueFromHash("lp", !1),
  25214. auto: r.valueFromHash("ts", -1),
  25215. eOrder: "YXZ",
  25216. stepFactor: .25,
  25217. brakeStrength: 2,
  25218. minBrakeAngle: .1,
  25219. maxBrakeAngle: 1.8,
  25220. climbEffort: 4
  25221. },
  25222. rotationFriction: .05,
  25223. rotationAccelerationInside: 4.5,
  25224. rotationAccelerationOutside: .15,
  25225. rotationAfterMoveMultiplier: 40,
  25226. rotationAfterMoveHistoryCount: 5,
  25227. panFriction: .09,
  25228. panAccelerationOutside: 60,
  25229. onload: r.valueFromHash("onload", o.PANORAMA),
  25230. zoomNearLimit: .1,
  25231. zoomFarLimit: 50,
  25232. navigation: {
  25233. panoScores: !1,
  25234. mouseDirection: !0,
  25235. filterStrictness: .75,
  25236. angleFactor: -30,
  25237. directionFactor: 10,
  25238. distanceFactor: -1,
  25239. optionalityFactor: 3
  25240. },
  25241. sdkInit: !1,
  25242. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25243. console: r.valueFromHash("console", !1),
  25244. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25245. panoramaNeighbourMaxDistance: 5,
  25246. panoFloorClickRadius: .35,
  25247. showScreenshotLocations: !1,
  25248. showAxis: !1,
  25249. showNeighbourRaycasts: !1,
  25250. colorMarkerOnLoad: !1,
  25251. colorMarkerByFloor: !1,
  25252. tiling: {
  25253. panoPreRenderRepeatDelay: 2500,
  25254. panoPreRenderDelay: 500,
  25255. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25256. tilingFlagNames: ["usetiles", "tiles"],
  25257. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25258. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25259. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25260. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25261. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25262. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25263. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25264. customCompression: r.valueFromHash("tilecustcomp", 0),
  25265. mobileHighQualityOverride: 1,
  25266. allowUltraHighResolution: !0
  25267. },
  25268. zoom: {
  25269. enabled: !0,
  25270. forceOff: r.valueFromHash("nozoom", 0),
  25271. overridemax: r.valueFromHash("maxzoom", null),
  25272. overridemin: r.valueFromHash("minzoom", null),
  25273. max: d.highQualityMaxZoom,
  25274. min: 1,
  25275. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25276. activationThreshold: 1.1,
  25277. restoreTime: 500
  25278. },
  25279. profiling: {
  25280. enabled: r.valueFromHash("mem", !1)
  25281. }
  25282. };
  25283. (p = h.deepExtend(p, d, {
  25284. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25285. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25286. panorama: {
  25287. transitionTime: 1e3,
  25288. modelAlpha: 0,
  25289. modelAlphaDelay: p.flydown.modelTextureDelay,
  25290. modelAlphaLength: 1,
  25291. skyboxOpacity: 1,
  25292. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25293. skyboxOpacityLength: .9,
  25294. fovLength: 1,
  25295. fovDelay: 0,
  25296. cameraMatrixDuration: .8,
  25297. cameraMatrixDelay: 0,
  25298. cameraMatrixEase: c.easeInCubic,
  25299. reticuleOpacity: 1,
  25300. markerOpacity: .3,
  25301. markerOpacityOnHover: 1
  25302. },
  25303. dollhouse: {
  25304. transitionTime: 1e3,
  25305. modelAlpha: 1,
  25306. modelAlphaDelay: 0,
  25307. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25308. skyboxOpacity: 0,
  25309. skyboxOpacityDelay: 0,
  25310. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25311. fovLength: 1,
  25312. fovDelay: 0,
  25313. cameraMatrixDuration: .8,
  25314. cameraMatrixDelay: .3,
  25315. cameraMatrixEase: c.easeInCubic,
  25316. reticuleOpacity: 1,
  25317. markerOpacity: 0,
  25318. markerOpacityOnHover: 0
  25319. },
  25320. floorplan: {
  25321. transitionTime: 1e3,
  25322. modelAlpha: 1,
  25323. modelAlphaDelay: 0,
  25324. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25325. skyboxOpacity: 0,
  25326. skyboxOpacityDelay: 0,
  25327. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25328. fovLength: 1,
  25329. fovDelay: 0,
  25330. cameraMatrixDuration: .5,
  25331. cameraMatrixDelay: 0,
  25332. cameraMatrixEase: c.easeOutCubic,
  25333. reticuleOpacity: 1,
  25334. markerOpacity: 0,
  25335. markerOpacityOnHover: 0,
  25336. cameraHeight: 50
  25337. },
  25338. transitioning: {
  25339. reticuleOpacity: 0,
  25340. markerOpacity: .3,
  25341. markerOpacityOnHover: 1
  25342. },
  25343. "floorplan-dollhouse": {
  25344. rotationDelay: 0,
  25345. rotationDuration: 1
  25346. },
  25347. "floorplan-panorama": {
  25348. rotationDelay: .5,
  25349. rotationDuration: 1
  25350. },
  25351. "dollhouse-panorama": {
  25352. rotationDelay: .5,
  25353. rotationDuration: 1
  25354. },
  25355. "dollhouse-floorplan": {
  25356. rotationDelay: 0,
  25357. rotationDuration: 1,
  25358. cameraMatrixDuration: 1.05,
  25359. cameraMatrixDelay: .5
  25360. },
  25361. "panorama-dollhouse": {
  25362. rotationDelay: 0,
  25363. rotationDuration: .5
  25364. },
  25365. "panorama-floorplan": {
  25366. transitionTime: 1500,
  25367. rotationDelay: 0,
  25368. rotationDuration: .5
  25369. }
  25370. })).path.meshFree && (p.path.typ = l.WALK),
  25371. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25372. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25373. window._settings = t.exports = p
  25374. }
  25375. , {
  25376. "./constants": 8,
  25377. "./enum/Colors": 19,
  25378. "./enum/VROption": 47,
  25379. "./enum/Viewmode": 51,
  25380. "./enum/WarpStyle": 52,
  25381. "./util/browser": 182,
  25382. "./util/common": 185,
  25383. "./util/easing": 186,
  25384. "./util/showcase": 193,
  25385. three: 217
  25386. }],
  25387. 167: [function(e, t, i) {
  25388. "use strict";
  25389. var n = e("three")
  25390. , r = e("./settings")
  25391. , 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"
  25392. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25393. t.exports = {
  25394. basicTextured: {
  25395. uniforms: {
  25396. tDiffuse: {
  25397. type: "t",
  25398. value: null
  25399. },
  25400. alpha: {
  25401. type: "f",
  25402. value: 1
  25403. }
  25404. },
  25405. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25406. 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}"
  25407. },
  25408. copyCubeMap: {
  25409. uniforms: {
  25410. tDiffuse: {
  25411. type: "t",
  25412. value: null
  25413. },
  25414. alpha: {
  25415. type: "f",
  25416. value: 1
  25417. }
  25418. },
  25419. 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}",
  25420. 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}"
  25421. },
  25422. cube: {
  25423. uniforms: {
  25424. map: {
  25425. type: "t",
  25426. value: null
  25427. },
  25428. opacity: {
  25429. type: "f",
  25430. value: 1
  25431. }
  25432. },
  25433. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25434. 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"
  25435. },
  25436. model: {
  25437. uniforms: {
  25438. map: {
  25439. type: "t",
  25440. value: null
  25441. },
  25442. modelAlpha: {
  25443. type: "f",
  25444. value: r.modelAlpha
  25445. },
  25446. opacity: {
  25447. type: "f",
  25448. value: 1
  25449. },
  25450. progress: {
  25451. type: "f",
  25452. value: 0
  25453. },
  25454. blackout: {
  25455. type: "i",
  25456. value: 0
  25457. },
  25458. pano0Map: {
  25459. type: "t",
  25460. value: null
  25461. },
  25462. pano0Position: {
  25463. type: "v3",
  25464. value: new n.Vector3
  25465. },
  25466. pano0Matrix: {
  25467. type: "m4",
  25468. value: new n.Matrix4
  25469. },
  25470. pano1Map: {
  25471. type: "t",
  25472. value: null
  25473. },
  25474. pano1Position: {
  25475. type: "v3",
  25476. value: new n.Vector3
  25477. },
  25478. pano1Matrix: {
  25479. type: "m4",
  25480. value: new n.Matrix4
  25481. }
  25482. },
  25483. 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",
  25484. 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"
  25485. },
  25486. hot: {
  25487. uniforms: {
  25488. color: {
  25489. type: "c",
  25490. value: new n.Color(16720384)
  25491. },
  25492. opac: {
  25493. type: "f",
  25494. value: 0
  25495. },
  25496. texture1: {
  25497. type: "t",
  25498. value: null
  25499. },
  25500. texture2: {
  25501. type: "t",
  25502. value: null
  25503. }
  25504. },
  25505. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25506. 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"
  25507. },
  25508. modelOutside: {
  25509. uniforms: {
  25510. map: {
  25511. type: "t",
  25512. value: null
  25513. },
  25514. opacity: {
  25515. type: "f",
  25516. value: 1
  25517. }
  25518. },
  25519. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25520. 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"
  25521. },
  25522. ribbon: {
  25523. uniforms: {
  25524. map: {
  25525. type: "t",
  25526. value: null
  25527. },
  25528. opacity: {
  25529. type: "f",
  25530. value: 1
  25531. },
  25532. color: {
  25533. type: "c",
  25534. value: new n.Color(r.path.color)
  25535. }
  25536. },
  25537. 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",
  25538. 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"
  25539. },
  25540. waypoint: {
  25541. uniforms: {
  25542. map: {
  25543. type: "t",
  25544. value: null
  25545. },
  25546. opacity: {
  25547. type: "f",
  25548. value: 1
  25549. },
  25550. pulse: {
  25551. type: "f",
  25552. value: 1
  25553. },
  25554. nearFade: {
  25555. type: "v2",
  25556. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25557. },
  25558. color: {
  25559. type: "c",
  25560. value: new n.Color(r.reticuleColor)
  25561. }
  25562. },
  25563. 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",
  25564. 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"
  25565. },
  25566. modelDebug: {
  25567. uniforms: {
  25568. map: {
  25569. type: "t",
  25570. value: null
  25571. },
  25572. modelAlpha: {
  25573. type: "f",
  25574. value: r.modelAlpha
  25575. },
  25576. depthmapRatio: {
  25577. type: "f",
  25578. value: 0
  25579. },
  25580. opacity: {
  25581. type: "f",
  25582. value: 1
  25583. },
  25584. progress: {
  25585. type: "f",
  25586. value: 0
  25587. },
  25588. considerOcclusion: {
  25589. type: "i",
  25590. value: r.fancierTransition
  25591. },
  25592. highlightPanoSelection: {
  25593. type: "i",
  25594. value: 0
  25595. },
  25596. useThirdPano: {
  25597. type: "i",
  25598. value: r.useThirdPano
  25599. },
  25600. pano0Map: {
  25601. type: "t",
  25602. value: null
  25603. },
  25604. pano0Depth: {
  25605. type: "t",
  25606. value: null
  25607. },
  25608. pano0Position: {
  25609. type: "v3",
  25610. value: new n.Vector3
  25611. },
  25612. pano0Matrix: {
  25613. type: "m4",
  25614. value: new n.Matrix4
  25615. },
  25616. pano0Weight: {
  25617. type: "f",
  25618. value: r.transition.pano0Weight
  25619. },
  25620. pano1Map: {
  25621. type: "t",
  25622. value: null
  25623. },
  25624. pano1Depth: {
  25625. type: "t",
  25626. value: null
  25627. },
  25628. pano1Position: {
  25629. type: "v3",
  25630. value: new n.Vector3
  25631. },
  25632. pano1Matrix: {
  25633. type: "m4",
  25634. value: new n.Matrix4
  25635. },
  25636. pano1Weight: {
  25637. type: "f",
  25638. value: r.transition.pano1Weight
  25639. },
  25640. pano2Map: {
  25641. type: "t",
  25642. value: null
  25643. },
  25644. pano2Depth: {
  25645. type: "t",
  25646. value: null
  25647. },
  25648. pano2Position: {
  25649. type: "v3",
  25650. value: new n.Vector3
  25651. },
  25652. pano2Matrix: {
  25653. type: "m4",
  25654. value: new n.Matrix4
  25655. },
  25656. pano2Weight: {
  25657. type: "f",
  25658. value: r.transition.pano2Weight
  25659. }
  25660. },
  25661. 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",
  25662. 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"
  25663. },
  25664. customDepth: {
  25665. uniforms: {
  25666. panoPosition: {
  25667. type: "v3",
  25668. value: new n.Vector3
  25669. }
  25670. },
  25671. 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",
  25672. 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"
  25673. },
  25674. skysphere: {
  25675. uniforms: {
  25676. radius: {
  25677. type: "f",
  25678. value: 0
  25679. }
  25680. },
  25681. 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",
  25682. 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"
  25683. },
  25684. tagDisc: {
  25685. uniforms: {
  25686. opacity: {
  25687. type: "f",
  25688. value: 0
  25689. },
  25690. color: {
  25691. type: "c",
  25692. value: new n.Color
  25693. },
  25694. bg: {
  25695. type: "t",
  25696. value: null
  25697. },
  25698. mask: {
  25699. type: "t",
  25700. value: null
  25701. }
  25702. },
  25703. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25704. 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"
  25705. }
  25706. }
  25707. window.shaders = t.exports;
  25708. }
  25709. , {
  25710. "./settings": 166,
  25711. three: 217
  25712. }],
  25713. 168: [function(E, _, e) {
  25714. (function(e) {
  25715. "use strict";
  25716. var t = E("three")
  25717. , i = (E("url"),
  25718. E("./util/ajax"))
  25719. , n = E("./settings")
  25720. , r = E("./util/logger")
  25721. , o = E("./util/math")
  25722. , a = E("./util/showcase")
  25723. , s = E("./objects/Panorama")
  25724. , l = new r(e)
  25725. , c = E("./model/Model")
  25726. , h = E("./shaders")
  25727. , u = E("./util/transitions")
  25728. , d = E("./objects/Chunk")
  25729. , p = E("./objects/Reticule")
  25730. , f = E("./objects/Skybox")
  25731. , g = E("./objects/Floor")
  25732. , m = E("./cameras/DollhouseCamera")
  25733. , v = E("./cameras/FloorplanCamera")
  25734. , y = E("./cameras/PanoramaCamera")
  25735. , A = E("./controls/DollhouseControls")
  25736. , C = E("./controls/FloorplanControls")
  25737. , I = E("./controls/PanoramaControls");
  25738. t.ImageUtils.crossOrigin = n.crossOrigin,
  25739. _.exports = {
  25740. shaders: h,
  25741. transitions: u,
  25742. Model: c,
  25743. Chunk: d,
  25744. Floor: g,
  25745. Skybox: f,
  25746. Reticule: p,
  25747. Panorama: s,
  25748. DollhouseCamera: m,
  25749. FloorplanCamera: v,
  25750. PanoramaCamera: y,
  25751. DollhouseControls: A,
  25752. FloorplanControls: C,
  25753. PanoramaControls: I,
  25754. getModel: function(e) {
  25755. if (!e.url)
  25756. throw 'getModel(): missing parameter "url"';
  25757. e.autoload = void 0 === e.autoload || e.autoload;
  25758. var t = a.parseSidUrl(e.url);
  25759. e.urlBase = t.urlBase,
  25760. e.urlModel = t.urlModel,
  25761. e.urlFiles = t.urlFiles;
  25762. var i = this._getPlatformError();
  25763. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25764. this._loadModel().then(this._buildModel.bind(this)))
  25765. },
  25766. _getPlatformError: function() {
  25767. 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"
  25768. },
  25769. _loadModel: function() {
  25770. return i.get(this.options.urlModel, {
  25771. responseType: "json",
  25772. prefetchFrom: "model",
  25773. auth: a.getAuthorizationHeader()
  25774. }).then(null, function() {
  25775. return l.warn("Model loading failed at initial metadata load"),
  25776. "loading-failed"
  25777. })
  25778. },
  25779. _buildModel: function(e) {
  25780. e = a.normalizeModeldata(e, o);
  25781. var t = new c(this.options,e);
  25782. return this.options.autoload ? t.load(!0) : $.when(t)
  25783. }
  25784. }
  25785. }
  25786. ).call(this, "/js/showcase.js")
  25787. }
  25788. , {
  25789. "./cameras/DollhouseCamera": 5,
  25790. "./cameras/FloorplanCamera": 6,
  25791. "./cameras/PanoramaCamera": 7,
  25792. "./controls/DollhouseControls": 10,
  25793. "./controls/FloorplanControls": 11,
  25794. "./controls/PanoramaControls": 13,
  25795. "./model/Model": 139,
  25796. "./objects/Chunk": 144,
  25797. "./objects/Floor": 146,
  25798. "./objects/Panorama": 148,
  25799. "./objects/Reticule": 149,
  25800. "./objects/Skybox": 152,
  25801. "./settings": 166,
  25802. "./shaders": 167,
  25803. "./util/ajax": 181,
  25804. "./util/logger": 189,
  25805. "./util/math": 190,
  25806. "./util/showcase": 193,
  25807. "./util/transitions": 195,
  25808. three: 217,
  25809. url: 208
  25810. }],
  25811. 169: [function(e, t, i) {
  25812. "use strict";
  25813. function l(e) {
  25814. var t = {
  25815. renderTarget: null,
  25816. inUse: !1,
  25817. size: -1,
  25818. pano: null
  25819. };
  25820. return t.inUse = !0,
  25821. t.size = e,
  25822. function(e) {
  25823. O.push(e)
  25824. }(t),
  25825. t
  25826. }
  25827. function c(e) {
  25828. for (var t = 0; t < O.length; t++) {
  25829. var i = O[t];
  25830. if (i.renderTarget === e)
  25831. return !(i.inUse = !1)
  25832. }
  25833. return !1
  25834. }
  25835. function n() {
  25836. this.tileDirectory = {},
  25837. this.activeRenderTargetDescriptors = {},
  25838. this.activePanos = [],
  25839. this.panoLODDescriptors = {},
  25840. this.panoDescriptors = {},
  25841. this.tileTrees = {},
  25842. this.sceneRenderer = null,
  25843. this.tileDownloader = null,
  25844. this.forceQueue = [],
  25845. this.uploadQueues = {},
  25846. this.uploadInterval = null,
  25847. this.uploadIntervalCancelled = !1,
  25848. this.usingTileOverlay = !1,
  25849. this.overlayTilesLoaded = !1,
  25850. this.overlayTileBase = null,
  25851. this.overlayTilesBasic = {},
  25852. this.overlayTilesEnhanced = {},
  25853. this.zoomRenderTarget = null,
  25854. this.zoomPano = null,
  25855. this.zoomingActive = !1,
  25856. this.zoomPanoId = null,
  25857. this.zoomPanoRenderingDisabled = !1,
  25858. this.direction = new _.Vector3,
  25859. this.initTime = -1,
  25860. this.maxBaseUploadsPerFrame = R,
  25861. this.maxNonBaseUploadsPerFrame = M
  25862. }
  25863. 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"),
  25864. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25865. e("../objects/Panorama"),
  25866. e("./TileTree")), y = (e("./TileDownloader"),
  25867. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25868. e("../util/browser"),
  25869. 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 = {
  25870. Base: 0,
  25871. Remaining: 1
  25872. }, O = [];
  25873. function L(e) {
  25874. var t = e.shift();
  25875. return t.uploadQueued = !1,
  25876. t
  25877. }
  25878. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25879. this.sceneRenderer = e,
  25880. this.tileDownloader = t,
  25881. this.qualityManager = i,
  25882. this.bindEvents(),
  25883. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25884. this.initTime = performance.now()
  25885. }
  25886. ,
  25887. n.prototype.getActivePanoTextures = function(e) {
  25888. e = e || [];
  25889. for (var t = 0; t < O.length; t++) {
  25890. var i = O[t];
  25891. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25892. }
  25893. }
  25894. ,
  25895. n.prototype.hasQueuedTiles = function() {
  25896. var e = this.peekNextFromUploadQueue();
  25897. return null != e
  25898. }
  25899. ,
  25900. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25901. return this.activeRenderTargetDescriptors[e]
  25902. }
  25903. ,
  25904. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25905. this.activeRenderTargetDescriptors[e] = t
  25906. }
  25907. ,
  25908. n.prototype.loadOverlayTiles = function() {
  25909. if (0 !== d.tiling.overlayStyle) {
  25910. var n = 0
  25911. , e = function(e, t, i) {
  25912. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25913. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25914. ++n === r.length && (this.overlayTilesLoaded = !0)
  25915. }
  25916. .bind(this)
  25917. , 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)]];
  25918. r.forEach(function(e) {
  25919. this.tileDownloader.loadImage(e[0], 0, e[1])
  25920. }
  25921. .bind(this)),
  25922. this.usingTileOverlay = !0
  25923. } else
  25924. this.usingTileOverlay = !1
  25925. }
  25926. ,
  25927. n.prototype.bindEvents = function() {
  25928. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25929. }
  25930. ,
  25931. n.prototype.setupZoomRenderTarget = function() {
  25932. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25933. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25934. return;
  25935. var e = this.zoomRenderTarget;
  25936. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25937. e) {
  25938. var t = e.width
  25939. , i = this.zoomRenderTarget.width;
  25940. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25941. e.texture.dispose(),
  25942. e.texture.loaded = !1,
  25943. e.texture.version = 0,
  25944. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25945. e.texture = null
  25946. }
  25947. this.zoomPanoRenderingDisabled = !1
  25948. } else
  25949. this.zoomPanoRenderingDisabled = !0
  25950. }
  25951. ,
  25952. n.prototype.enableUltraHighQualityMode = function(t) {
  25953. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25954. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25955. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25956. e && (this.qualityManager.enableUltraHighQualityMode(),
  25957. this.setupZoomRenderTarget(),
  25958. t())
  25959. }
  25960. .bind(this))
  25961. }
  25962. }
  25963. ,
  25964. n.prototype.activateTiledPano = function(e, t, i) {
  25965. i && this.clearAllQueuedUploads();
  25966. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25967. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25968. this.linkAllTilesAndNodes(e);
  25969. var r = this.getActiveRenderTargetDescriptor(e.id)
  25970. , o = t;
  25971. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25972. !r || o !== r.size) {
  25973. if (r && c(r.renderTarget),
  25974. !(r = function(e) {
  25975. for (var t = 0; t < O.length; t++) {
  25976. var i = O[t];
  25977. if (!i.inUse && i.size === e)
  25978. return i.inUse = !0,
  25979. i
  25980. }
  25981. return null
  25982. }(o))) {
  25983. var a = this.initTiledPano(o, !1);
  25984. (r = l(a.width)).renderTarget = a
  25985. }
  25986. r.pano = e,
  25987. this.resetPanoDescriptor(e.id),
  25988. this.resetPanoLODDescriptors(e.id),
  25989. this.resetRenderStatus(e.id, !0, !0)
  25990. }
  25991. this.setActiveRenderTargetDescriptor(e.id, r);
  25992. var s = i ? 0 : 1;
  25993. return this.updateActivePanos(e, s),
  25994. r.renderTarget
  25995. }
  25996. ,
  25997. n.prototype.deactivateTiledPano = function(e) {
  25998. var t = this.getActiveRenderTargetDescriptor(e.id);
  25999. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  26000. this.setActiveRenderTargetDescriptor(e.id, null);
  26001. var i = this.getUploadQueueForPano(e.id);
  26002. this.clearUploadQueue(i),
  26003. this.updateActivePanos()
  26004. }
  26005. ,
  26006. n.prototype.updateActivePanos = (s = [],
  26007. function(e, t) {
  26008. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  26009. e && s.length === t && s.push(e);
  26010. var n = this.activePanos[i]
  26011. , r = this.getActiveRenderTargetDescriptor(n.id);
  26012. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  26013. }
  26014. e && t >= s.length && s.push(e),
  26015. this.activePanos.length = 0,
  26016. this.activePanos.push.apply(this.activePanos, s)
  26017. }
  26018. ),
  26019. n.prototype.getActivePanoCount = function() {
  26020. return this.activePanos.length
  26021. }
  26022. ,
  26023. n.prototype.resetRenderStatus = function(e, r, o, t) {
  26024. var i = null;
  26025. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  26026. for (var n = function(e, t, i, n) {
  26027. o && (t.tile.zoomUploaded = !1),
  26028. r && (t.tile.uploaded = !1)
  26029. }, a = 0; a < A.FACES_PER_PANO; a++) {
  26030. this.getTileTree(e, a).breadthFirst({
  26031. callback: n.bind(this, a),
  26032. minLevel: i
  26033. })
  26034. }
  26035. }
  26036. ,
  26037. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26038. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26039. t.tile.zoomUploaded = t.tile.uploaded,
  26040. t.zoomCovered = t.covered
  26041. }, n = 0; n < A.FACES_PER_PANO; n++) {
  26042. this.getTileTree(e, n).breadthFirst({
  26043. callback: i.bind(this, n),
  26044. maxLevel: t
  26045. })
  26046. }
  26047. }
  26048. ,
  26049. n.prototype.renderPanoTiles = (h = [],
  26050. function(e, t, i, n) {
  26051. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26052. t = t || this.direction || m.FORWARD;
  26053. var r = this.getActiveRenderTargetDescriptor(e);
  26054. if (!this.isRenderTargetDescriptorValid(r))
  26055. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26056. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  26057. var a = this.getTileTree(e, o);
  26058. h.length = 0,
  26059. a.breadthFirst({
  26060. saveVisited: h
  26061. });
  26062. for (var s = 0; s < h.length; s++) {
  26063. var l = h[s];
  26064. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  26065. }
  26066. }
  26067. this.updateDirection(t)
  26068. }
  26069. ),
  26070. n.prototype.isRenderTargetDescriptorValid = function(e) {
  26071. return e && e.renderTarget
  26072. }
  26073. ,
  26074. n.prototype.isPanoActive = function(e) {
  26075. var t = this.getActiveRenderTargetDescriptor(e);
  26076. return this.isRenderTargetDescriptorValid(t)
  26077. }
  26078. ,
  26079. n.prototype.isPanoZoomed = function(e) {
  26080. return this.zoomingActive && this.zoomPanoId === e
  26081. }
  26082. ,
  26083. n.prototype.initTileTree = function(e, t, i) {
  26084. var n = this.tileTrees[e];
  26085. n || (n = [],
  26086. this.tileTrees[e] = n);
  26087. var r = n[t];
  26088. if (!r) {
  26089. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  26090. r = new v(A.TILE_SIZE,o),
  26091. n[t] = r
  26092. }
  26093. }
  26094. ,
  26095. n.prototype.getTileTree = function(e, t) {
  26096. var i = this.tileTrees[e];
  26097. if (!i)
  26098. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26099. var n = i[t];
  26100. if (!n)
  26101. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26102. return n
  26103. }
  26104. ,
  26105. n.prototype.initTiledPano = function(e, t) {
  26106. var i = this.sceneRenderer.renderer
  26107. , n = (i.context,
  26108. new _.WebGLRenderTargetCube(e,e,{
  26109. stencilBuffer: !1
  26110. }))
  26111. , r = new _.CubeTexture([]);
  26112. (n.texture = r).image = [null, null, null, null, null, null],
  26113. r.flipY = !0,
  26114. t ? (r.generateMipmaps = !0,
  26115. r.magFilter = _.LinearFilter,
  26116. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26117. r.magFilter = _.LinearFilter,
  26118. r.minFilter = _.LinearFilter),
  26119. r.format = _.RGBAFormat,
  26120. i.setRenderTarget(n),
  26121. i.setRenderTarget(null);
  26122. var o = i.properties.get(r);
  26123. return o.__image__webglTextureCube = o.__webglTexture,
  26124. n
  26125. }
  26126. ,
  26127. n.prototype.getUploadQueueForPano = function(e) {
  26128. var t = this.uploadQueues[e];
  26129. return t || (t = [],
  26130. this.uploadQueues[e] = t),
  26131. t
  26132. }
  26133. ,
  26134. n.prototype.isTileUploaded = function(e) {
  26135. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26136. }
  26137. ,
  26138. n.prototype.setUploaded = function(e, t) {
  26139. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26140. }
  26141. ,
  26142. n.prototype.queueTileUpload = function(e, t, i) {
  26143. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26144. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26145. var r = this.getUploadQueueForPano(e.panoId);
  26146. 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),
  26147. e.uploadQueued = !0,
  26148. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26149. }
  26150. }
  26151. ,
  26152. n.prototype.shoulPushToFrontOfQueue = function(e) {
  26153. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26154. }
  26155. ,
  26156. n.prototype.getTopUploadQueue = function() {
  26157. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  26158. for (var n = 0; n < this.activePanos.length; n++)
  26159. if (e = this.activePanos[n],
  26160. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  26161. switch (i) {
  26162. case P.Base:
  26163. if (0 === t[0].level)
  26164. return t;
  26165. break;
  26166. case P.Remaining:
  26167. return t
  26168. }
  26169. return null
  26170. }
  26171. ,
  26172. n.prototype.getNextFromUploadQueue = function() {
  26173. if (0 < this.forceQueue.length)
  26174. return L(this.forceQueue);
  26175. var e = this.getTopUploadQueue();
  26176. return e && 0 < e.length ? L(e) : null
  26177. }
  26178. ,
  26179. n.prototype.peekNextFromUploadQueue = function() {
  26180. if (0 < this.forceQueue.length)
  26181. return this.forceQueue[0];
  26182. var e = this.getTopUploadQueue();
  26183. return e && 0 < e.length ? e[0] : null
  26184. }
  26185. ,
  26186. n.prototype.clearAllQueuedUploads = function() {
  26187. this.clearAllUploadQueues(null, 0)
  26188. }
  26189. ,
  26190. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  26191. this.clearAllUploadQueues(e, 0)
  26192. }
  26193. ,
  26194. n.prototype.clearAllUploadQueues = function(e, t) {
  26195. if (e)
  26196. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26197. this.clearUploadQueue(this.forceQueue, t, e);
  26198. else {
  26199. for (var i = 0; i < this.activePanos.length; i++) {
  26200. var n = this.activePanos[i];
  26201. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26202. }
  26203. this.clearUploadQueue(this.forceQueue, t)
  26204. }
  26205. }
  26206. ,
  26207. n.prototype.clearUploadQueue = function(e, t, i) {
  26208. null != t || (t = 0);
  26209. for (var n = 0; n < e.length; ) {
  26210. var r = e[n];
  26211. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26212. e.splice(n, 1)) : n++
  26213. }
  26214. }
  26215. ,
  26216. n.prototype.refreshUploadInterval = (a = null,
  26217. function(e) {
  26218. this.uploadIntervalCancelled || (a = a || function() {
  26219. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  26220. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26221. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26222. }
  26223. .bind(this),
  26224. null != e || (e = x),
  26225. T || (e = S),
  26226. this.uploadInterval = window.setTimeout(a, e),
  26227. this.uploadIntervalDelay = e)
  26228. }
  26229. ),
  26230. n.prototype.update = (r = performance.now(),
  26231. o = 0,
  26232. function() {
  26233. this.uploadIntervalCancelled = !0,
  26234. window.clearTimeout(this.uploadInterval),
  26235. this.uploadInterval = null;
  26236. var e = performance.now() - r;
  26237. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26238. r = performance.now()),
  26239. o++
  26240. }
  26241. ),
  26242. n.prototype.updateUploadQueue = function(e, t) {
  26243. e = e || 1;
  26244. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  26245. var r = this.getNextFromUploadQueue();
  26246. if (!r)
  26247. break;
  26248. if (0 !== r.level ? i++ : n++,
  26249. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26250. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26251. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26252. }
  26253. }
  26254. }
  26255. ,
  26256. n.prototype.updateDirection = function(e) {
  26257. if (e = e || this.direction) {
  26258. this.direction = e;
  26259. for (var t = 0; t < this.activePanos.length; t++) {
  26260. var i = this.activePanos[t]
  26261. , n = this.getUploadQueueForPano(i.id);
  26262. y.sortPanoTiles(n, i, this.direction)
  26263. }
  26264. }
  26265. }
  26266. ,
  26267. n.prototype.uploadTile = (I = {},
  26268. new _.Vector4,
  26269. E = d.tiling.overlayStyle,
  26270. function(e, t) {
  26271. var i = e.panoId
  26272. , n = e.image
  26273. , r = e.tileSize
  26274. , o = e.panoSize
  26275. , a = e.tileIndex
  26276. , s = (e.faceTileIndex,
  26277. e.totalTiles)
  26278. , l = (e.face,
  26279. e.tileX)
  26280. , c = e.tileY
  26281. , h = !0
  26282. , u = !1
  26283. , d = (this.getPanoDescriptor(i),
  26284. this.getPanoLODDescriptor(i, o))
  26285. , p = this.getActiveRenderTargetDescriptor(i)
  26286. , f = p.renderTarget
  26287. , g = p.size;
  26288. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  26289. g = this.qualityManager.getMaxZoomPanoSize()),
  26290. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  26291. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  26292. this.isTileUploaded(e) && (u = h = !1)),
  26293. h) {
  26294. var m = r / o * g
  26295. , v = l * r / o * g
  26296. , y = c * r / o * g;
  26297. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  26298. var A = I[r];
  26299. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  26300. 1 === E || 2 === E) {
  26301. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26302. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  26303. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  26304. } else
  26305. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  26306. d.uploadCount++,
  26307. this.emit(b.TileRenderSuccess, i, o, a, s),
  26308. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  26309. this.setUploaded(e, !0),
  26310. this.addCoverageForNode(e.node)
  26311. } else
  26312. this.setUploaded(e, !1);
  26313. return e.uploadAttempted || (d.uploadAttempts++,
  26314. this.emit(b.TileUploadAttempted, i, o, a, s)),
  26315. e.uploadAttempted = !0,
  26316. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  26317. u
  26318. }
  26319. ),
  26320. n.prototype.linkTileAndNode = function(e, t) {
  26321. (t.tile = e).node = t
  26322. }
  26323. ,
  26324. n.prototype.linkAllTilesAndNodes = function(a) {
  26325. for (var e = function(e, t, i, n, r) {
  26326. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  26327. this.linkTileAndNode(o, i)
  26328. }, t = 0; t < A.FACES_PER_PANO; t++) {
  26329. var i = this.getTileTree(a.id, t);
  26330. i.breadthFirst({
  26331. callback: e.bind(this, i, t)
  26332. })
  26333. }
  26334. }
  26335. ,
  26336. n.prototype.anyUploaded = function(e) {
  26337. if (!e)
  26338. return !1;
  26339. if (e.tile && this.isTileUploaded(e.tile))
  26340. return !0;
  26341. if (e.children)
  26342. for (var t = 0; t < e.children.length; t++) {
  26343. var i = e.children[t];
  26344. if (this.anyUploaded(i))
  26345. return !0
  26346. }
  26347. return !1
  26348. }
  26349. ,
  26350. n.prototype.setNodeCovered = function(e, t) {
  26351. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26352. }
  26353. ,
  26354. n.prototype.isNodeCovered = function(e) {
  26355. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26356. }
  26357. ,
  26358. n.prototype.addCoverageForNode = function(e) {
  26359. if (this.setNodeCovered(e, !0),
  26360. e.parent && e.covered) {
  26361. var t = e.parent;
  26362. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26363. }
  26364. }
  26365. ,
  26366. n.prototype.calcFullCoverage = function(e) {
  26367. var t = !1;
  26368. if (e.children)
  26369. for (var i = 0; i < e.children.length; i++) {
  26370. var n = e.children[i];
  26371. t = t || this.calcFullCoverage(n)
  26372. }
  26373. e.covered = e.tile.uploaded || t
  26374. }
  26375. ,
  26376. n.prototype.nodeSubcovered = function(e) {
  26377. if (!e.children)
  26378. return !1;
  26379. for (var t = 0; t < e.children.length; t++)
  26380. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26381. return !1;
  26382. return !0
  26383. }
  26384. ,
  26385. n.prototype.resetPanoDescriptor = function(e) {
  26386. this.getPanoDescriptor(e)
  26387. }
  26388. ,
  26389. n.prototype.getPanoDescriptor = function(e) {
  26390. var t = this.panoDescriptors[e];
  26391. return t || (t = {},
  26392. this.panoDescriptors[e] = t),
  26393. t
  26394. }
  26395. ,
  26396. n.prototype.resetPanoLODDescriptors = function(e) {
  26397. var t = this.getPanoLODDescriptors(e);
  26398. for (var i in t)
  26399. if (t.hasOwnProperty(i)) {
  26400. var n = t[i];
  26401. n.uploadCount = 0,
  26402. n.uploadAttempts = 0
  26403. }
  26404. }
  26405. ,
  26406. n.prototype.getPanoLODDescriptor = function(e, t) {
  26407. var i = this.getPanoLODDescriptors(e)
  26408. , n = i[t];
  26409. return n || (n = {
  26410. uploadCount: 0,
  26411. uploadAttempts: 0
  26412. },
  26413. i[t] = n),
  26414. n
  26415. }
  26416. ,
  26417. n.prototype.getPanoLODDescriptors = function(e) {
  26418. var t = this.panoLODDescriptors[e];
  26419. return t || (t = {},
  26420. this.panoLODDescriptors[e] = t),
  26421. t
  26422. }
  26423. ,
  26424. n.prototype.onTileDownloaded = function(e) {
  26425. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  26426. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26427. if (i.downloaded = !0,
  26428. i.image = e.image,
  26429. i.panoSize = e.panoSize,
  26430. i.tileX = e.tileX,
  26431. i.tileY = e.tileY,
  26432. i.totalTiles = e.totalTiles,
  26433. i.tileIndex = e.tileIndex,
  26434. i.faceTileIndex = e.faceTileIndex,
  26435. i.face = e.face,
  26436. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26437. i.panoId = e.panoId,
  26438. i.tileSize = e.tileSize,
  26439. i.direction = (new _.Vector3).copy(e.direction),
  26440. i.node = null,
  26441. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26442. this.isPanoActive(i.panoId)) {
  26443. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26444. this.linkTileAndNode(i, n),
  26445. this.queueTileUpload(i, !0)
  26446. }
  26447. }
  26448. ,
  26449. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26450. var r = this.tileDirectory[e];
  26451. r || (r = {},
  26452. this.tileDirectory[e] = r);
  26453. var o = 16384 * t + 1024 * i + n
  26454. , a = r[o];
  26455. return a || (a = {
  26456. downloaded: !1,
  26457. uploaded: !1,
  26458. zoomUploaded: !1
  26459. },
  26460. r[o] = a),
  26461. a._key = e + ":" + t + ":" + i + ":" + n,
  26462. a._tileKey = o,
  26463. a
  26464. }
  26465. ,
  26466. n.prototype.setZoomingActive = function(e, t, i) {
  26467. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26468. this.zoomPanoId = t.id,
  26469. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26470. }
  26471. ,
  26472. n.prototype.updateZoomedPanoFromBase = function(e) {
  26473. if (!this.zoomPanoRenderingDisabled) {
  26474. var t = this.getActiveRenderTargetDescriptor(e.id);
  26475. if (t && t.renderTarget) {
  26476. var i = this.qualityManager.getMaxZoomPanoSize()
  26477. , n = t.renderTarget
  26478. , r = t.size;
  26479. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26480. this.copyBaseRenderStatusToZoomed(e.id)
  26481. }
  26482. }
  26483. }
  26484. ,
  26485. t.exports = n
  26486. }
  26487. , {
  26488. "../enum/GLCubeFaces": 25,
  26489. "../enum/PanoRendererEvents": 35,
  26490. "../enum/PanoSizeClass": 36,
  26491. "../enum/SceneRendererEvents": 43,
  26492. "../enum/TileDownloaderEvents": 45,
  26493. "../enum/Vectors": 50,
  26494. "../exception/BasicException": 55,
  26495. "../objects/Panorama": 148,
  26496. "../settings": 166,
  26497. "../util/browser": 182,
  26498. "../util/panorama": 191,
  26499. "./TileDownloader": 171,
  26500. "./TilePrioritizer": 172,
  26501. "./TileTree": 173,
  26502. "./TileUtils": 174,
  26503. events: 202,
  26504. three: 217
  26505. }],
  26506. 170: [function(e, t, i) {
  26507. "use strict";
  26508. function n(e, t, i) {
  26509. this.maxNavPanoSize = -1,
  26510. this.maxZoomPanoSize = -1,
  26511. this.devicePixelDensity = e,
  26512. this.deviceScreenSize = t,
  26513. this.clientBandwidth = i,
  26514. this.panoSizeClassMap = {},
  26515. this.useHighResolutionPanos = !0,
  26516. this.useUltraHighResolutionPanos = !1,
  26517. this.modelHasUltraHighPanos = !1
  26518. }
  26519. var r = e("../enum/PanoSizeClass")
  26520. , o = e("../settings")
  26521. , a = e("../util/browser")
  26522. , s = e("../constants")
  26523. , l = e("../util/showcase")
  26524. , c = e("../enum/ModelManagerEvents");
  26525. n.prototype.init = function(e) {
  26526. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26527. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26528. this.highSize = this.getPanoSize(r.HIGH),
  26529. this.standardSize = this.getPanoSize(r.STANDARD),
  26530. this.baseSize = this.getPanoSize(r.BASE),
  26531. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26532. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26533. this.updateMaximums(),
  26534. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26535. }
  26536. ,
  26537. n.prototype.updateFromModel = function(e) {
  26538. this.updateHighResolutionSettings(e),
  26539. this.updateUltraHighResolutionSettings(e)
  26540. }
  26541. ,
  26542. n.prototype.updateHighResolutionSettings = function(e) {
  26543. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26544. this.updateMaximums()
  26545. }
  26546. ,
  26547. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26548. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26549. this.updateMaximums()
  26550. }
  26551. ,
  26552. n.prototype.enableUltraHighQualityMode = function() {
  26553. this.modelHasUltraHighPanos = !0,
  26554. this.updateUltraHighResolutionSettings(null)
  26555. }
  26556. ,
  26557. n.prototype.ultraHighQualityModeEnabled = function() {
  26558. return this.modelHasUltraHighPanos
  26559. }
  26560. ,
  26561. n.prototype.onModelChanged = function(e) {
  26562. this.updateFromModel(e.model),
  26563. this.updateMaximums()
  26564. }
  26565. ,
  26566. n.prototype.updateMaximums = function() {
  26567. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26568. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26569. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26570. }
  26571. ,
  26572. n.prototype.buildPanoSizeClassMap = function() {
  26573. this.panoSizeClassMap[r.BASE] = 512,
  26574. this.panoSizeClassMap[r.STANDARD] = 1024,
  26575. this.panoSizeClassMap[r.HIGH] = 2048,
  26576. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26577. }
  26578. ,
  26579. n.prototype.getPanoSize = function(e) {
  26580. return this.panoSizeClassMap[e]
  26581. }
  26582. ,
  26583. n.prototype.getMaxPossiblePanoSize = function() {
  26584. return this.getPanoSize(r.ULTRAHIGH)
  26585. }
  26586. ,
  26587. n.prototype.getMaxPanoSize = function() {
  26588. return this.maxZoomPanoSize
  26589. }
  26590. ,
  26591. n.prototype.getMaxNavPanoSize = function() {
  26592. return this.maxNavPanoSize
  26593. }
  26594. ,
  26595. n.prototype.getMaxZoomPanoSize = function() {
  26596. return this.maxZoomPanoSize
  26597. }
  26598. ,
  26599. n.prototype.detectMaxNavPanoSizeClass = function() {
  26600. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26601. }
  26602. ,
  26603. n.prototype.detectMaxNavPanoSize = function() {
  26604. var e = this.detectMaxNavPanoSizeClass();
  26605. return this.getPanoSize(e)
  26606. }
  26607. ,
  26608. n.prototype.detectMaxZoomPanoSize = function() {
  26609. 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)
  26610. }
  26611. ,
  26612. t.exports = n
  26613. }
  26614. , {
  26615. "../constants": 8,
  26616. "../enum/ModelManagerEvents": 33,
  26617. "../enum/PanoSizeClass": 36,
  26618. "../settings": 166,
  26619. "../util/browser": 182,
  26620. "../util/showcase": 193
  26621. }],
  26622. 171: [function(A, C, e) {
  26623. (function(e) {
  26624. "use strict";
  26625. function i(e) {
  26626. this.panos = null,
  26627. this.retryMinimumTime = 1e4,
  26628. this.urls = null,
  26629. this.panoLoadCallbacks = {},
  26630. this.downloadDescriptors = {},
  26631. this.priorityQueue = [],
  26632. this.forceQueue = [],
  26633. this.activeDownloads = [],
  26634. this.qualityManager = null,
  26635. this.tilePrioritizer = null,
  26636. this.refreshInterval = null,
  26637. this.processPriorityQueue = !1,
  26638. this.concurrentDownloads = e.concurrentDownloads || 1,
  26639. this.downloadTestResults = {}
  26640. }
  26641. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26642. A("../settings")), r = (A("../objects/Panorama"),
  26643. A("../util/logger")), o = (A("../enum/Vectors"),
  26644. A("../enum/PanoSizeClass"),
  26645. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26646. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26647. Object.freeze({
  26648. Testing: 1,
  26649. Success: 2,
  26650. Fail: 3
  26651. }));
  26652. i.prototype = Object.create(l.prototype),
  26653. i.IDLE_REFRESH_DELAY = 500,
  26654. i.ACTIVE_REFRESH_DELAY = 16,
  26655. i.DOWNLOAD_RETRIES = 4,
  26656. i.prototype.init = function(e) {
  26657. this.qualityManager = e
  26658. }
  26659. ,
  26660. i.prototype.setUrls = function(e) {
  26661. this.urls = e
  26662. }
  26663. ,
  26664. i.prototype.setPanoData = function(e, t, i) {
  26665. this.panos = e,
  26666. this.imagePanos = t,
  26667. this.panoGroupId = i
  26668. }
  26669. ,
  26670. i.prototype.start = function() {
  26671. this.refreshUpdateInterval(0)
  26672. }
  26673. ,
  26674. i.prototype.stop = function() {
  26675. window.cancel(this.refreshInterval)
  26676. }
  26677. ,
  26678. i.prototype.refreshUpdateInterval = function(e) {
  26679. e = e || 0,
  26680. this.refreshInterval = window.setTimeout(function() {
  26681. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26682. }
  26683. .bind(this), e)
  26684. }
  26685. ,
  26686. i.prototype.update = function() {
  26687. var e = 0 < this.forceQueue.length;
  26688. return this.processQueueForDownloading(this.forceQueue),
  26689. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26690. 0 < this.priorityQueue.length && (e = !0),
  26691. this.processQueueForDownloading(this.priorityQueue)),
  26692. e
  26693. }
  26694. ,
  26695. i.prototype.forceQueueTilesForPano = (p = [],
  26696. f = [],
  26697. function(e, t, i, n, r, o) {
  26698. p.length = 0;
  26699. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26700. var l = a[s];
  26701. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26702. }
  26703. if (i && 0 < p.length) {
  26704. g.sortPanoTiles(p, e, i),
  26705. f.length = 0,
  26706. m.matchingTilesInDirection(e, t, i, n, r, f);
  26707. for (var c = 0, h = function(e) {
  26708. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26709. }; c < p.length; ) {
  26710. var u = p[c];
  26711. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26712. }
  26713. }
  26714. for (var d = 0; d < p.length; d++)
  26715. this.forceQueue.push(p[d]);
  26716. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26717. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26718. o && this.processQueueForDownloading(this.forceQueue, !0)
  26719. }
  26720. ),
  26721. i.prototype.clearForceQueue = function() {
  26722. this.clearQueue(this.forceQueue)
  26723. }
  26724. ,
  26725. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26726. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26727. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26728. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26729. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26730. }
  26731. ,
  26732. i.prototype.clearQueue = function(e) {
  26733. this.setStatusForAllDescriptors(e, v.None),
  26734. e.length = 0
  26735. }
  26736. ,
  26737. i.prototype.clearFromQueue = function(e, t, i) {
  26738. for (var n = 0; n < e.length; n++) {
  26739. var r = e[n];
  26740. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26741. }
  26742. }
  26743. ,
  26744. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26745. for (var i = 0; i < e.length; i++) {
  26746. var n = e[i];
  26747. n && (n.status = t)
  26748. }
  26749. }
  26750. ,
  26751. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26752. for (var i = 0; i < e.length; i++) {
  26753. var n = e[i];
  26754. n && (n.status !== t ? n.status = t : e[i] = null)
  26755. }
  26756. }
  26757. ,
  26758. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26759. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26760. , n = i[t];
  26761. return n || (n = this.buildDownloadDescriptorArray(t),
  26762. i[t] = n,
  26763. this.initTileDownloadDescriptors(n, e, t)),
  26764. n
  26765. }
  26766. ,
  26767. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26768. var t = this.downloadDescriptors[e.id];
  26769. return t || (t = {},
  26770. this.downloadDescriptors[e.id] = t),
  26771. t
  26772. }
  26773. ,
  26774. i.prototype.processQueueForDownloading = function(e, t) {
  26775. if (this.cleanupActiveDownloads(),
  26776. this.activeDownloads.length < this.concurrentDownloads || t)
  26777. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26778. var r = e.shift();
  26779. r && (this.startDownload(r),
  26780. n++)
  26781. }
  26782. }
  26783. ,
  26784. i.prototype.testDownload = function(t, e, i) {
  26785. var n = this.downloadTestResults[t];
  26786. if (n)
  26787. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26788. else {
  26789. this.downloadTestResults[t] = y.Testing;
  26790. var r = this.panos.list[0]
  26791. , o = this.getTileUrl(r.id, t, e, 0)
  26792. , a = function(e) {
  26793. this.downloadTestResults[t] = y.Success,
  26794. i(!0)
  26795. }
  26796. .bind(this)
  26797. , s = function() {
  26798. this.downloadTestResults[t] = y.Fail,
  26799. i(!1)
  26800. }
  26801. .bind(this);
  26802. this.loadImage(o, 0, a, s)
  26803. }
  26804. }
  26805. ,
  26806. i.prototype.startDownload = function(e) {
  26807. e.status = v.Downloading;
  26808. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26809. this.activeDownloads.push(e),
  26810. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26811. }
  26812. ,
  26813. i.prototype.downloadFailed = function(e, t) {}
  26814. ,
  26815. i.prototype.downloadComplete = function(e, t) {
  26816. if (e.panoGroupId === this.panoGroupId) {
  26817. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26818. e.status = v.Downloaded,
  26819. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26820. var n = {
  26821. panoId: e.pano.id,
  26822. image: t,
  26823. tileSize: e.tileSize,
  26824. panoSize: e.panoSize,
  26825. tileIndex: e.tileIndex,
  26826. faceTileIndex: e.faceTileIndex,
  26827. totalTiles: e.totalTiles,
  26828. face: e.face,
  26829. tileX: e.tileX,
  26830. tileY: e.tileY,
  26831. direction: e.direction
  26832. };
  26833. e.image = t,
  26834. this.emit(o.TileDownloadSuccess, n),
  26835. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26836. panoId: e.pano.id,
  26837. tileSize: e.tileSize,
  26838. panoSize: e.panoSize
  26839. },
  26840. this.emit(o.PanoDownloadComplete, n),
  26841. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26842. }
  26843. }
  26844. ,
  26845. i.prototype.cleanupActiveDownloads = (n = [],
  26846. function() {
  26847. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26848. var t = this.activeDownloads[e];
  26849. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26850. }
  26851. this.activeDownloads.length = 0,
  26852. this.activeDownloads.push.apply(this.activeDownloads, n)
  26853. }
  26854. ),
  26855. i.prototype.isPanoDownloaded = function(e, t) {
  26856. var i = this.getTileDownloadDescriptors(e, t);
  26857. if (i.length <= 0)
  26858. return !1;
  26859. for (var n = 0; n < i.length; n++) {
  26860. if (i[n].status !== v.Downloaded)
  26861. return !1
  26862. }
  26863. return !0
  26864. }
  26865. ,
  26866. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26867. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26868. this.panoLoadCallbacks[o] = {
  26869. onLoad: i,
  26870. onFail: n,
  26871. onProgress: r
  26872. }
  26873. }
  26874. ,
  26875. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26876. var i = e.id + ":" + t;
  26877. return this.panoLoadCallbacks[i]
  26878. }
  26879. ,
  26880. i.prototype.buildDownloadDescriptorArray = function(e) {
  26881. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26882. var r = this.buildDownloadDescriptor();
  26883. i.push(r)
  26884. }
  26885. return i
  26886. }
  26887. ,
  26888. i.prototype.buildDownloadDescriptor = function() {
  26889. return {
  26890. panoGroupId: null,
  26891. pano: null,
  26892. panoSize: -1,
  26893. tileSize: -1,
  26894. tileIndex: -1,
  26895. totalTiles: -1,
  26896. faceTileIndex: -1,
  26897. status: v.None,
  26898. url: null,
  26899. image: null,
  26900. direction: new t.Vector3,
  26901. face: -1,
  26902. cubeFace: -1,
  26903. tileX: -1,
  26904. tileY: -1
  26905. }
  26906. }
  26907. ,
  26908. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26909. for (var n = 0; n < e.length; n++) {
  26910. var r = e[n];
  26911. this.initTileDownloadDescriptor(r, t, i, n)
  26912. }
  26913. }
  26914. ,
  26915. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26916. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26917. e.face = m.getFaceForTile(i, n),
  26918. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26919. e.panoGroupId = this.panoGroupId,
  26920. e.pano = t,
  26921. e.panoSize = i,
  26922. e.tileSize = r,
  26923. e.tileIndex = n,
  26924. e.totalTiles = m.getTileCountForSize(i),
  26925. e.status = v.None,
  26926. e.image = null,
  26927. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26928. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26929. }
  26930. ,
  26931. i.prototype.getTileUrl = (c = {
  26932. 256: "256",
  26933. 512: "512",
  26934. 1024: "1k",
  26935. 2048: "2k",
  26936. 4096: "4k"
  26937. },
  26938. h = {
  26939. face: -1,
  26940. faceTileIndex: -1,
  26941. tileX: -1,
  26942. tileY: -1
  26943. },
  26944. function(e, t, i, n) {
  26945. m.getTileLocation(t, n, h);
  26946. var r = Math.floor(t / i)
  26947. , o = r * r
  26948. , a = Math.floor(n / o)
  26949. , s = "";
  26950. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26951. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26952. return d.changeIfTileGenerating(l)
  26953. }
  26954. ),
  26955. i.prototype.loadImage = function(e, t, i, n) {
  26956. s.getImage(e, t).then(function(e) {
  26957. i(e)
  26958. }).fail(n)
  26959. }
  26960. ,
  26961. C.exports = i
  26962. }
  26963. ).call(this, "/js/tile/TileDownloader.js")
  26964. }
  26965. , {
  26966. "../ab": 3,
  26967. "../enum/DownloadStatus": 24,
  26968. "../enum/GLCubeFaces": 25,
  26969. "../enum/PanoSizeClass": 36,
  26970. "../enum/TileDownloaderEvents": 45,
  26971. "../enum/Vectors": 50,
  26972. "../enum/Viewmode": 51,
  26973. "../objects/Panorama": 148,
  26974. "../settings": 166,
  26975. "../util/ajax": 181,
  26976. "../util/logger": 189,
  26977. "../util/panorama": 191,
  26978. "./TilePrioritizer": 172,
  26979. "./TileUtils": 174,
  26980. events: 202,
  26981. three: 217
  26982. }],
  26983. 172: [function(n, C, e) {
  26984. (function(e) {
  26985. "use strict";
  26986. function h(e, t, i, n, r) {
  26987. this.qualityManager = e,
  26988. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26989. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26990. this.baseSize = t,
  26991. this.standardSize = i,
  26992. this.highSize = n,
  26993. this.ultraHighSize = r,
  26994. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26995. }
  26996. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26997. n("../settings"),
  26998. n("../settings"),
  26999. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  27000. n("../enum/PanoSizeClass"),
  27001. n("../enum/ModelManagerEvents"),
  27002. n("../enum/GLCubeFaces"),
  27003. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  27004. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  27005. new t(e),
  27006. Object.freeze({
  27007. None: 0,
  27008. DirectionalFOV: 1
  27009. }));
  27010. h.PriorityCriteria = function(e, t, i, n, r) {
  27011. this.pano = e,
  27012. this.cameraPosition = (new o.Vector3).copy(t),
  27013. this.cameraDir = (new o.Vector3).copy(i),
  27014. this.panoSpaceDir = (new o.Vector3).copy(n),
  27015. this.upcomingPanos = r,
  27016. this.copy = function(e) {
  27017. this.pano = e.pano,
  27018. this.cameraPosition.copy(e.cameraPosition),
  27019. this.cameraDir.copy(e.cameraDir),
  27020. this.panoSpaceDir.copy(e.panoSpaceDir),
  27021. this.upcomingPanos = r
  27022. }
  27023. ,
  27024. this.zoomingActive = !1
  27025. }
  27026. ,
  27027. h.DIRECTIONAL_FOV = 180,
  27028. h.DIRECTIONAL_FOV_NARROW = 120,
  27029. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27030. h.MAX_SCORED_PANOS_TOADD = 2,
  27031. h.MAX_UPCOMING_PANOS_TOADD = 3,
  27032. h.DIRECTION_SCORE_STRICTNESS = .75,
  27033. h.appendQueue = function(e, t) {
  27034. if (e && t)
  27035. for (var i = 0; i < t.length; i++)
  27036. e.push(t[i])
  27037. }
  27038. ,
  27039. h.prototype.updateCriteria = function(e, t, i, n) {
  27040. this.priorityCriteria.pano = e,
  27041. this.priorityCriteria.cameraPosition.copy(t),
  27042. this.priorityCriteria.cameraDir.copy(i),
  27043. this.priorityCriteria.upcomingPanos = n,
  27044. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27045. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27046. }
  27047. ,
  27048. h.prototype.filterAndPrioritize = (u = [],
  27049. p = [],
  27050. f = [],
  27051. function(e, t, i) {
  27052. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  27053. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  27054. var n = this.baseSize
  27055. , r = this.standardSize
  27056. , o = this.highSize
  27057. , a = this.ultraHighSize;
  27058. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  27059. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  27060. f.length = 0,
  27061. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27062. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27063. h.appendQueue(e, f),
  27064. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  27065. f.length = 0,
  27066. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27067. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  27068. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27069. h.appendQueue(e, f),
  27070. f.length = 0,
  27071. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27072. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27073. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  27074. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27075. h.appendQueue(e, f),
  27076. this.queueTilesForPanos(e, u, i, n)
  27077. }
  27078. ),
  27079. h.prototype.canDownloadSize = function(e) {
  27080. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27081. }
  27082. ,
  27083. h.prototype.populateNeighborPanos = function(e, t, i) {
  27084. (i = i || []).length = 0;
  27085. var n = t.getNeighbours(e);
  27086. for (var r in n)
  27087. if (n.hasOwnProperty(r)) {
  27088. var o = t.get(r);
  27089. i.push(o)
  27090. }
  27091. return i
  27092. }
  27093. ,
  27094. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  27095. (i = i || []).length = 0;
  27096. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  27097. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  27098. , s = t.sortByScore(o, a);
  27099. if (s)
  27100. for (var l = 0; l < s.length && l < r; l++) {
  27101. var c = s[l].pano;
  27102. i.push(c)
  27103. }
  27104. return i
  27105. }
  27106. ,
  27107. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27108. for (var o = 0, a = 0; a < t.length; a++) {
  27109. var s = t[a];
  27110. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  27111. r && r <= o)
  27112. break
  27113. }
  27114. return o
  27115. }
  27116. ,
  27117. h.prototype.queueTilesForPano = (r = {
  27118. filter: a.None
  27119. },
  27120. function(e, t, i, n) {
  27121. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  27122. }
  27123. ),
  27124. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  27125. function(e, t, i, n, r, o, a, s) {
  27126. for (var l = 0, c = 0; c < i.length; c++) {
  27127. var h = i[c];
  27128. d.copy(h.position),
  27129. d.sub(r),
  27130. d.normalize();
  27131. var u = Math.max(Math.min(o.dot(d), 1), -1);
  27132. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  27133. s && s <= l))
  27134. break
  27135. }
  27136. return l
  27137. }
  27138. ),
  27139. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27140. for (var l = 0, c = 0; c < i.length; c++) {
  27141. var h = i[c];
  27142. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  27143. s && s <= l)
  27144. break
  27145. }
  27146. return l
  27147. }
  27148. ,
  27149. h.prototype.queueTilesInDirectionForPano = (s = {
  27150. filter: a.DirectionalFOV,
  27151. direction: new o.Vector3,
  27152. fov: 60
  27153. },
  27154. l = new o.Vector3,
  27155. function(e, t, i, n, r, o, a) {
  27156. return l.copy(o),
  27157. m.getRelativeDirection(i.quaternion, l),
  27158. s.direction.copy(l),
  27159. s.fov = a,
  27160. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  27161. }
  27162. ),
  27163. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  27164. function(e, t, i, n, r) {
  27165. var o = t.getTileDownloadDescriptors(i, n);
  27166. c.length = 0,
  27167. this.filterTileDownloadDescriptors(i, o, c, r);
  27168. for (var a = 0, s = 0; s < c.length; s++) {
  27169. var l = c[s];
  27170. l && (e.push(l),
  27171. a++)
  27172. }
  27173. return a
  27174. }
  27175. ),
  27176. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  27177. function(e, t, i, n) {
  27178. var r, o;
  27179. switch (n.filter) {
  27180. case a.DirectionalFOV:
  27181. for (r = 0; r < t.length; r++)
  27182. o = t[r],
  27183. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27184. break;
  27185. default:
  27186. for (r = 0; r < t.length; r++)
  27187. o = t[r],
  27188. i.push(o)
  27189. }
  27190. for (r = 0; r < i.length; r++)
  27191. o = i[r],
  27192. this.canIncludeDescriptor(o) || (i[r] = null)
  27193. }
  27194. ),
  27195. h.prototype.canIncludeDescriptor = function(e) {
  27196. return e.status !== i.Downloading && e.status !== i.Downloaded
  27197. }
  27198. ,
  27199. h.prototype.canIncludePano = function(e, t) {
  27200. return !e.isLoaded(t)
  27201. }
  27202. ,
  27203. h.getFOVDotThreshold = function(e) {
  27204. return Math.cos(o.Math.degToRad(e / 2))
  27205. }
  27206. ;
  27207. var y = (A._panoSpaceDir = new o.Vector3,
  27208. A._fovThreshold = -1,
  27209. A._fovThresholdNarrow = -1,
  27210. A);
  27211. function A(e, t) {
  27212. var i = A._panoSpaceDir
  27213. , n = A._fovThreshold
  27214. , r = A._fovThresholdNarrow
  27215. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  27216. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  27217. return e._dot = o,
  27218. t._dot = a,
  27219. 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)
  27220. }
  27221. h.sortPanoTiles = function(e, t, i) {
  27222. y._panoSpaceDir.copy(i),
  27223. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  27224. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27225. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  27226. e.sort(y)
  27227. }
  27228. ,
  27229. h.insertSortedPanoTile = function(e, t, i, n) {
  27230. y._panoSpaceDir.copy(n),
  27231. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  27232. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  27233. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  27234. for (var r = -1, o = 0; o < e.length; o++) {
  27235. if (y(t, e[o]) <= 0) {
  27236. r = o;
  27237. break
  27238. }
  27239. }
  27240. if (-1 === r)
  27241. e[e.length] = t;
  27242. else {
  27243. for (var a = e.length; r < a; a--)
  27244. e[a] = e[a - 1];
  27245. e[r] = t
  27246. }
  27247. }
  27248. ,
  27249. h.prototype.setZoomingActive = function(e) {
  27250. e !== this.zoomingActive && (this.zoomingActive = e)
  27251. }
  27252. ,
  27253. C.exports = h
  27254. }
  27255. ).call(this, "/js/tile/TilePrioritizer.js")
  27256. }
  27257. , {
  27258. "../enum/DownloadStatus": 24,
  27259. "../enum/GLCubeFaces": 25,
  27260. "../enum/ModelManagerEvents": 33,
  27261. "../enum/PanoSizeClass": 36,
  27262. "../enum/Vectors": 50,
  27263. "../enum/Viewmode": 51,
  27264. "../objects/Panorama": 148,
  27265. "../settings": 166,
  27266. "../util/browser": 182,
  27267. "../util/logger": 189,
  27268. "../util/math": 190,
  27269. "./TileUtils": 174,
  27270. events: 202,
  27271. three: 217
  27272. }],
  27273. 173: [function(e, t, i) {
  27274. "use strict";
  27275. function f(e, t) {
  27276. this.levels = t,
  27277. this.tileSize = e,
  27278. this.root = null,
  27279. this.allNodes = [],
  27280. function(e) {
  27281. e.root = function e(t, i, n) {
  27282. if (n > t.levels)
  27283. return null;
  27284. var r = new a(t,i);
  27285. t.allNodes.push(r);
  27286. for (var o = 0; o < s; o++)
  27287. r.children[o] = e(t, r, n + 1);
  27288. return r
  27289. }(e, null, 0)
  27290. }(this)
  27291. }
  27292. function a(e, t) {
  27293. this.tree = e,
  27294. this.parent = t,
  27295. this.children = [],
  27296. this.id = ++n
  27297. }
  27298. var g = (e("three"),
  27299. e("./TileUtils"),
  27300. e("../objects/Panorama"),
  27301. e("../util/panorama"),
  27302. e("events").EventEmitter,
  27303. 2)
  27304. , s = g * g;
  27305. f.TraversalType = Object.freeze({
  27306. PreOrder: 0,
  27307. PostOrder: 1
  27308. });
  27309. var n = 0;
  27310. f.getLevelCountForSize = function(e, t) {
  27311. var i = 0;
  27312. for (t < e && (t = e); !((t /= g) < e); )
  27313. i++;
  27314. return i
  27315. }
  27316. ,
  27317. f.getSizeForLevel = function(e, t) {
  27318. return Math.pow(g, t) * e
  27319. }
  27320. ,
  27321. f.prototype.getSubNode = function(e, t, i) {
  27322. (!t || e < this.tileSize) && (t = 0),
  27323. (!i || e < this.tileSize) && (i = 0),
  27324. e < this.tileSize && (e = this.tileSize);
  27325. var n = f.getLevelCountForSize(this.tileSize, e);
  27326. return function e(t, i, n, r, o) {
  27327. if (!t)
  27328. return null;
  27329. if (0 === n)
  27330. return t;
  27331. if (!t.children || 0 === t.children.length)
  27332. return null;
  27333. var a = Math.pow(g, n) / g
  27334. , s = r % a
  27335. , l = o % a
  27336. , c = Math.floor(o / a)
  27337. , h = Math.floor(r / a)
  27338. , u = c * g + h;
  27339. return e(t.children[u], i + 1, n - 1, s, l)
  27340. }(this.root, 0, n, t, i)
  27341. }
  27342. ,
  27343. f.prototype.breadthFirst = function(e) {
  27344. var t = !!(e = e || {}).nullLevelEnd
  27345. , i = e.maxLevel
  27346. , n = e.minLevel
  27347. , r = e.callback
  27348. , o = e.saveVisited
  27349. , a = []
  27350. , s = {}
  27351. , l = 0;
  27352. for (a.push(this.root),
  27353. a.push(s); 0 < a.length && !(i && i < l); ) {
  27354. var c = a.shift();
  27355. if (c === s)
  27356. (!n || n <= l) && (r && t && r(null),
  27357. o && t && o.push(null)),
  27358. 0 < a.length && a.push(s),
  27359. l++,
  27360. 0;
  27361. else {
  27362. if (c.children)
  27363. for (var h = 0; h < c.children.length; h++) {
  27364. c.children[h] && a.push(c.children[h])
  27365. }
  27366. var u = this.getFaceIndexFromNode(c);
  27367. (!n || n <= l) && (r && r(c, l, u),
  27368. o && o.push(c)),
  27369. 0
  27370. }
  27371. }
  27372. }
  27373. ,
  27374. f.prototype.getFaceIndexFromNode = function(e) {
  27375. if (!e)
  27376. return -1;
  27377. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27378. var o = i.parent;
  27379. if (!o)
  27380. break;
  27381. for (var a = -1, s = 0; s < o.children.length; s++)
  27382. o.children[s] === i && (a = s);
  27383. n = a % g * t + n,
  27384. r = Math.floor(a / g) * t + r,
  27385. t *= g,
  27386. i = o
  27387. }
  27388. return r * t + n
  27389. }
  27390. ,
  27391. f.prototype.depthFirst = function(e, t, i) {
  27392. !function e(t, i, n, r, o, a, s, l) {
  27393. if (t) {
  27394. s = s || f.TraversalType.PreOrder;
  27395. var c = r * g + n;
  27396. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  27397. a && a.push(t)),
  27398. t.children && 0 !== t.children.length) {
  27399. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  27400. for (var p = 0; p < g; p++)
  27401. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  27402. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  27403. a && a.push(t))
  27404. }
  27405. }
  27406. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27407. }
  27408. ,
  27409. t.exports = f
  27410. }
  27411. , {
  27412. "../objects/Panorama": 148,
  27413. "../util/panorama": 191,
  27414. "./TileUtils": 174,
  27415. events: 202,
  27416. three: 217
  27417. }],
  27418. 174: [function(e, t, i) {
  27419. "use strict";
  27420. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  27421. b.TILE_SIZE = 512,
  27422. b.FACES_PER_PANO = 6,
  27423. b.LocationOnTile = {
  27424. Center: 0,
  27425. UpperLeft: 1,
  27426. UpperRight: 2,
  27427. LowerRight: 3,
  27428. LowerLeft: 4
  27429. },
  27430. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  27431. var l = e / t
  27432. , c = t / e * 2
  27433. , h = c / 2
  27434. , u = n / l * 2 - 1 + h
  27435. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27436. switch (o = o || b.LocationOnTile.Center) {
  27437. case b.LocationOnTile.UpperLeft:
  27438. u -= h,
  27439. d += h,
  27440. u += a * c;
  27441. break;
  27442. case b.LocationOnTile.UpperRight:
  27443. u += h,
  27444. d += h,
  27445. d -= a * c;
  27446. break;
  27447. case b.LocationOnTile.LowerRight:
  27448. u += h,
  27449. d -= h,
  27450. u -= a * c;
  27451. break;
  27452. case b.LocationOnTile.LowerLeft:
  27453. u -= h,
  27454. d -= h,
  27455. d += a * c;
  27456. break;
  27457. case b.LocationOnTile.Center:
  27458. }
  27459. switch (i) {
  27460. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27461. _.setVector(s, -1, d, -u);
  27462. break;
  27463. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27464. _.setVector(s, 1, d, u);
  27465. break;
  27466. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27467. _.setVector(s, -u, 1, -d);
  27468. break;
  27469. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27470. _.setVector(s, -u, -1, d);
  27471. break;
  27472. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27473. _.setVector(s, -u, d, 1);
  27474. break;
  27475. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27476. _.setVector(s, u, d, -1)
  27477. }
  27478. _.normalize(s)
  27479. }
  27480. ,
  27481. b.getFaceForTile = function(e, t) {
  27482. var i = b.TILE_SIZE;
  27483. e < b.TILE_SIZE && (i = e);
  27484. var n = Math.floor(e / i)
  27485. , r = n * n;
  27486. return Math.floor(t / r)
  27487. }
  27488. ,
  27489. b.getTileLocation = function(e, t, i) {
  27490. var n = b.TILE_SIZE;
  27491. e < b.TILE_SIZE && (n = e);
  27492. var r = b.getFaceForTile(e, t)
  27493. , o = Math.floor(e / n)
  27494. , a = t - r * (o * o);
  27495. i.tileX = a % o,
  27496. i.tileY = Math.floor(a / o),
  27497. i.face = r,
  27498. i.faceTileIndex = a
  27499. }
  27500. ,
  27501. b.getTileCountForSize = function(e) {
  27502. if (e <= b.TILE_SIZE)
  27503. return b.FACES_PER_PANO;
  27504. var t = Math.floor(e / b.TILE_SIZE);
  27505. return t * t * b.FACES_PER_PANO
  27506. }
  27507. ,
  27508. b.getRelativeDirection = (r = new _.Matrix4,
  27509. o = new _.Quaternion,
  27510. function(e, t) {
  27511. o.copy(e),
  27512. o.inverse(),
  27513. r.makeRotationFromQuaternion(o),
  27514. r.applyToVector3(t),
  27515. _.normalize(t)
  27516. }
  27517. ),
  27518. b.matchingTilesInDirection = (c = new _.Vector3,
  27519. h = new _.Vector3(0,0,-1),
  27520. u = new _.Quaternion,
  27521. l = {
  27522. face: -1,
  27523. faceTileIndex: -1,
  27524. tileX: -1,
  27525. tileY: -1
  27526. },
  27527. d = function(e, t, i) {
  27528. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27529. b.getTileLocation(e, o, l),
  27530. t && !t(l) || (r++,
  27531. i && (a = l,
  27532. i.push({
  27533. face: a.face,
  27534. faceTileIndex: a.faceTileIndex,
  27535. tileX: a.tileX,
  27536. tileY: a.tileY
  27537. })));
  27538. var a;
  27539. return r
  27540. }
  27541. ,
  27542. function(e, t, i, n, r, o) {
  27543. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27544. if (b.getTileCountForSize(t),
  27545. !n && !r)
  27546. return d(t, null, o);
  27547. var s = !!r;
  27548. return r = r || n,
  27549. r = Math.max(0, Math.min(r, 360)),
  27550. n = Math.max(0, Math.min(n, 360)),
  27551. _.copyVector(i, c),
  27552. b.getRelativeDirection(e.quaternion, c),
  27553. s ? (u.setFromUnitVectors(c, h),
  27554. d(t, function(e) {
  27555. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27556. }, o)) : d(t, function(e) {
  27557. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27558. }, o)
  27559. }
  27560. ),
  27561. b.isTileWithinFrustum = (E = new _.Vector3,
  27562. function(e, t, i, n, r, o, a, s) {
  27563. 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++)
  27564. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27565. _.applyQuaternionToVector(o, E),
  27566. -1e-5 <= E.z)
  27567. ;
  27568. else {
  27569. var A = -1 / E.z
  27570. , C = E.x * A
  27571. , I = E.y * A;
  27572. l < I ? p++ : I < c && f++,
  27573. h < C ? g++ : C < u && m++,
  27574. v++
  27575. }
  27576. return f !== v && p !== v && g !== v && m !== v
  27577. }
  27578. ),
  27579. b.isTileWithinFOV = (p = new _.Vector3,
  27580. f = new _.Vector3(0,1,0),
  27581. g = new _.Vector3(1,0,0),
  27582. function(e, t, i, n, r, o, a) {
  27583. var s = b.mapFaceToCubemapFace(i);
  27584. if (_.cross(o, f, g),
  27585. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27586. b.isWithinFOV(p, o, a, null))
  27587. return !0;
  27588. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27589. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27590. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27591. b.isWithinFOV(p, o, a, null))
  27592. return !0;
  27593. h += l
  27594. }
  27595. return !1
  27596. }
  27597. ),
  27598. b.isWithinFOV = (a = new _.Vector3,
  27599. s = new _.Vector3,
  27600. function(e, t, i, n) {
  27601. if (_.copyVector(e, s),
  27602. n) {
  27603. _.copyVector(n, a),
  27604. _.normalize(a);
  27605. var r = _.dot(a, e);
  27606. a.x *= r,
  27607. a.y *= r,
  27608. a.z *= r,
  27609. _.subVector(s, a)
  27610. }
  27611. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27612. return Math.cos(o) <= _.dot(s, t)
  27613. }
  27614. ),
  27615. b.mapFaceToCubemapFace = (n = {
  27616. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27617. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27618. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27619. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27620. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27621. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27622. },
  27623. function(e) {
  27624. return n[e]
  27625. }
  27626. ),
  27627. t.exports = b
  27628. }
  27629. , {
  27630. "../enum/GLCubeFaces": 25,
  27631. "../util/MathLight": 176
  27632. }],
  27633. 175: [function(i, n, e) {
  27634. (function(e) {
  27635. "use strict";
  27636. function t() {
  27637. this.list = [],
  27638. this.index = {},
  27639. Object.defineProperty(this, "length", {
  27640. get: function() {
  27641. return this.list.length
  27642. }
  27643. })
  27644. }
  27645. new (i("./common"),
  27646. i("./logger"))(e),
  27647. t.prototype.forEach = function(e) {
  27648. this.list.forEach(e)
  27649. }
  27650. ,
  27651. t.prototype.add = function(e) {
  27652. this.list.push(e),
  27653. this.index[this.getIndex(e)] = e
  27654. }
  27655. ,
  27656. t.prototype.getIndex = function(e) {
  27657. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27658. }
  27659. ,
  27660. t.prototype.extend = function(e) {
  27661. for (var t = 0; t < e.length; t++)
  27662. this.add(e[t])
  27663. }
  27664. ,
  27665. t.prototype.get = function(e) {
  27666. return this.index[e]
  27667. }
  27668. ,
  27669. t.prototype.first = function() {
  27670. return this.list[0]
  27671. }
  27672. ,
  27673. t.prototype.last = function() {
  27674. return this.list[this.list.length - 1]
  27675. }
  27676. ,
  27677. t.prototype.reIndex = function() {
  27678. this.index = {};
  27679. var t = this;
  27680. this.forEach(function(e) {
  27681. t.index[t.getIndex(e)] = e
  27682. })
  27683. }
  27684. ,
  27685. t.prototype.filter = function(e) {
  27686. var t = this.list.filter(e);
  27687. return this.reIndex(),
  27688. t
  27689. }
  27690. ,
  27691. t.prototype.reduce = function(e, t) {
  27692. return this.list.reduce(e, t)
  27693. }
  27694. ,
  27695. t.prototype.sort = function(e) {
  27696. return this.list.sort(e)
  27697. }
  27698. ,
  27699. t.prototype.indexOf = function(e) {
  27700. for (var t = 0; t < this.list.length; ++t)
  27701. if (this.list[t] === e)
  27702. return t;
  27703. return -1
  27704. }
  27705. ,
  27706. n.exports = t
  27707. }
  27708. ).call(this, "/js/util/IndexedCollection.js")
  27709. }
  27710. , {
  27711. "./common": 185,
  27712. "./logger": 189
  27713. }],
  27714. 176: [function(e, t, i) {
  27715. "use strict";
  27716. e("../constants");
  27717. var n, r, o = {};
  27718. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27719. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27720. o.Vector3 = function(e, t, i) {
  27721. this.x = e || 0,
  27722. this.y = t || 0,
  27723. this.z = i || 0
  27724. }
  27725. ,
  27726. o.Matrix4 = function() {
  27727. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27728. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27729. }
  27730. ,
  27731. o.Matrix4.prototype = {
  27732. identity: function() {
  27733. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27734. this
  27735. },
  27736. copy: function(e) {
  27737. return this.elements.set(e.elements),
  27738. this
  27739. },
  27740. applyToVector3: function(e) {
  27741. var t = e.x
  27742. , i = e.y
  27743. , n = e.z
  27744. , r = this.elements;
  27745. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27746. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27747. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27748. this
  27749. },
  27750. getInverse: function(e, t) {
  27751. var i = this.elements
  27752. , n = e.elements
  27753. , r = n[0]
  27754. , o = n[1]
  27755. , a = n[2]
  27756. , s = n[3]
  27757. , l = n[4]
  27758. , c = n[5]
  27759. , h = n[6]
  27760. , u = n[7]
  27761. , d = n[8]
  27762. , p = n[9]
  27763. , f = n[10]
  27764. , g = n[11]
  27765. , m = n[12]
  27766. , v = n[13]
  27767. , y = n[14]
  27768. , A = n[15]
  27769. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27770. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27771. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27772. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27773. , b = r * C + o * I + a * E + s * _;
  27774. if (0 == b) {
  27775. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27776. if (t)
  27777. throw new Error(w);
  27778. return console.warn(w),
  27779. this.identity()
  27780. }
  27781. var T = 1 / b;
  27782. return i[0] = C * T,
  27783. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27784. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27785. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27786. i[4] = I * T,
  27787. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27788. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27789. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27790. i[8] = E * T,
  27791. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27792. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27793. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27794. i[12] = _ * T,
  27795. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27796. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27797. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27798. this
  27799. },
  27800. makeRotationFromQuaternion: function(e) {
  27801. var t = this.elements
  27802. , i = e.x
  27803. , n = e.y
  27804. , r = e.z
  27805. , o = e.w
  27806. , a = i + i
  27807. , s = n + n
  27808. , l = r + r
  27809. , c = i * a
  27810. , h = i * s
  27811. , u = i * l
  27812. , d = n * s
  27813. , p = n * l
  27814. , f = r * l
  27815. , g = o * a
  27816. , m = o * s
  27817. , v = o * l;
  27818. return t[0] = 1 - (d + f),
  27819. t[4] = h - v,
  27820. t[8] = u + m,
  27821. t[1] = h + v,
  27822. t[5] = 1 - (c + f),
  27823. t[9] = p - g,
  27824. t[2] = u - m,
  27825. t[6] = p + g,
  27826. t[10] = 1 - (c + d),
  27827. t[3] = 0,
  27828. t[7] = 0,
  27829. t[11] = 0,
  27830. t[12] = 0,
  27831. t[13] = 0,
  27832. t[14] = 0,
  27833. t[15] = 1,
  27834. this
  27835. }
  27836. },
  27837. o.Quaternion = function(e, t, i, n) {
  27838. this._x = e || 0,
  27839. this._y = t || 0,
  27840. this._z = i || 0,
  27841. this._w = void 0 !== n ? n : 1
  27842. }
  27843. ,
  27844. o.Quaternion.prototype = {
  27845. get x() {
  27846. return this._x
  27847. },
  27848. set x(e) {
  27849. this._x = e
  27850. },
  27851. get y() {
  27852. return this._y
  27853. },
  27854. set y(e) {
  27855. this._y = e
  27856. },
  27857. get z() {
  27858. return this._z
  27859. },
  27860. set z(e) {
  27861. this._z = e
  27862. },
  27863. get w() {
  27864. return this._w
  27865. },
  27866. set w(e) {
  27867. this._w = e
  27868. },
  27869. copy: function(e) {
  27870. this._x = e.x,
  27871. this._y = e.y,
  27872. this._z = e.z,
  27873. this._w = e.w
  27874. },
  27875. inverse: function() {
  27876. return this.conjugate().normalize()
  27877. },
  27878. conjugate: function() {
  27879. return this._x *= -1,
  27880. this._y *= -1,
  27881. this._z *= -1,
  27882. this
  27883. },
  27884. length: function() {
  27885. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27886. },
  27887. normalize: function() {
  27888. var e = this.length();
  27889. return 0 === e ? (this._x = 0,
  27890. this._y = 0,
  27891. this._z = 0,
  27892. this._w = 1) : (e = 1 / e,
  27893. this._x = this._x * e,
  27894. this._y = this._y * e,
  27895. this._z = this._z * e,
  27896. this._w = this._w * e),
  27897. this
  27898. },
  27899. setFromAxisAngle: function(e, t) {
  27900. var i = t / 2
  27901. , n = Math.sin(i);
  27902. return this._x = e.x * n,
  27903. this._y = e.y * n,
  27904. this._z = e.z * n,
  27905. this._w = Math.cos(i),
  27906. this
  27907. },
  27908. setFromUnitVectors: function(e, t) {
  27909. return void 0 === n && (n = new o.Vector3),
  27910. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27911. 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),
  27912. this._x = n.x,
  27913. this._y = n.y,
  27914. this._z = n.z,
  27915. this._w = r,
  27916. this.normalize()
  27917. },
  27918. multiply: function(e) {
  27919. return this.multiplyQuaternions(this, e)
  27920. },
  27921. premultiply: function(e) {
  27922. return this.multiplyQuaternions(e, this)
  27923. },
  27924. multiplyQuaternions: function(e, t) {
  27925. var i = e._x
  27926. , n = e._y
  27927. , r = e._z
  27928. , o = e._w
  27929. , a = t._x
  27930. , s = t._y
  27931. , l = t._z
  27932. , c = t._w;
  27933. return this._x = i * c + o * a + n * l - r * s,
  27934. this._y = n * c + o * s + r * a - i * l,
  27935. this._z = r * c + o * l + i * s - n * a,
  27936. this._w = o * c - i * a - n * s - r * l,
  27937. this
  27938. }
  27939. },
  27940. o.convertWorkshopVector = function(e) {
  27941. return new o.Vector3(-e.x,e.y,e.z)
  27942. }
  27943. ,
  27944. o.convertWorkshopQuaternion = function(e) {
  27945. 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))
  27946. }
  27947. ,
  27948. o.convertWorkshopOrthoZoom = function(e) {
  27949. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27950. }
  27951. ,
  27952. o.convertWorkshopPanoramaQuaternion = function(e) {
  27953. 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))
  27954. }
  27955. ,
  27956. o.normalize = function(e) {
  27957. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27958. , i = Math.sqrt(t);
  27959. e.x /= i,
  27960. e.y /= i,
  27961. e.z /= i
  27962. }
  27963. ,
  27964. o.dot = function(e, t) {
  27965. return e.x * t.x + e.y * t.y + e.z * t.z
  27966. }
  27967. ,
  27968. o.cross = function(e, t, i) {
  27969. var n = e.x
  27970. , r = e.y
  27971. , o = e.z;
  27972. i.x = r * t.z - o * t.y,
  27973. i.y = o * t.x - n * t.z,
  27974. i.z = n * t.y - r * t.x
  27975. }
  27976. ,
  27977. o.setVector = function(e, t, i, n) {
  27978. e.x = t,
  27979. e.y = i,
  27980. e.z = n
  27981. }
  27982. ,
  27983. o.copyVector = function(e, t) {
  27984. t.x = e.x,
  27985. t.y = e.y,
  27986. t.z = e.z
  27987. }
  27988. ,
  27989. o.addVector = function(e, t) {
  27990. e.x += t.x,
  27991. e.y += t.y,
  27992. e.z += t.z
  27993. }
  27994. ,
  27995. o.subVector = function(e, t) {
  27996. e.x -= t.x,
  27997. e.y -= t.y,
  27998. e.z -= t.z
  27999. }
  28000. ,
  28001. o.applyQuaternionToVector = function(e, t) {
  28002. var i = t.x
  28003. , n = t.y
  28004. , r = t.z
  28005. , o = e.x
  28006. , a = e.y
  28007. , s = e.z
  28008. , l = e.w
  28009. , c = l * i + a * r - s * n
  28010. , h = l * n + s * i - o * r
  28011. , u = l * r + o * n - a * i
  28012. , d = -o * i - a * n - s * r;
  28013. t.x = c * l + d * -o + h * -s - u * -a,
  28014. t.y = h * l + d * -a + u * -o - c * -s,
  28015. t.z = u * l + d * -s + c * -a - h * -o
  28016. }
  28017. ,
  28018. o.angleBetweenVectors = function(e, t) {
  28019. return Math.acos(o.dot(e, t))
  28020. }
  28021. ,
  28022. t.exports = o
  28023. }
  28024. , {
  28025. "../constants": 8
  28026. }],
  28027. 177: [function(c, h, e) {
  28028. (function(e) {
  28029. "use strict";
  28030. function t(e) {
  28031. this.cache = null,
  28032. this.expires = 0
  28033. }
  28034. function i() {
  28035. this.baseUrl = null,
  28036. this.cache = null,
  28037. this.expires = 0
  28038. }
  28039. function n() {
  28040. this.baseUrl = null,
  28041. this.expires = 0
  28042. }
  28043. function r(e) {
  28044. this.initialLoadingPromise = null,
  28045. this.endpoint = e + "?type=3",
  28046. this.urlContainer = null,
  28047. this.authorizationHeader = s.getAuthorizationHeader(),
  28048. this.containerClasses = [n, i, t]
  28049. }
  28050. c("./ajax");
  28051. var o = c("./logger")
  28052. , a = c("../constants")
  28053. , s = c("./showcase")
  28054. , l = (c("../ab"),
  28055. new o(e));
  28056. t.prototype = {
  28057. version: 1,
  28058. validate: function(e) {
  28059. return "catalog.json"in e && 0 < Object.keys(e).length
  28060. },
  28061. update: function(e) {
  28062. return this.cache = e,
  28063. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28064. $.when()
  28065. },
  28066. get: function(e) {
  28067. return this.cache[e]
  28068. }
  28069. },
  28070. i.prototype = {
  28071. version: 2,
  28072. validate: function(e) {
  28073. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  28074. },
  28075. update: function(e) {
  28076. return this.baseUrl = e["base.url"],
  28077. this.cache = e,
  28078. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28079. $.when()
  28080. },
  28081. get: function(e) {
  28082. var t = this.cache[e];
  28083. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28084. }
  28085. },
  28086. n.prototype = {
  28087. version: 3,
  28088. validate: function(e) {
  28089. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28090. },
  28091. update: function(e) {
  28092. return this.baseUrl = e.templates[0],
  28093. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  28094. $.when()
  28095. },
  28096. get: function(e) {
  28097. return this.baseUrl.replace("{{filename}}", e)
  28098. }
  28099. },
  28100. r.prototype = {
  28101. init: function() {
  28102. return this.initialLoadingPromise || (setInterval(function() {
  28103. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28104. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  28105. this.refresh().done(function() {
  28106. l.debug("Refreshed")
  28107. }).fail(function() {
  28108. l.error("Failed url refresh, urls might go stale soon")
  28109. }))
  28110. }
  28111. .bind(this), a.signedUrlCheckInterval),
  28112. this.initialLoadingPromise = this.refresh()),
  28113. this.initialLoadingPromise
  28114. },
  28115. refresh: function(e) {
  28116. return {},
  28117. $.Deferred().resolve()
  28118. },
  28119. get: function(e) {
  28120. return window.DATA.files.templates[0].replace("{{filename}}", e)
  28121. }
  28122. },
  28123. h.exports = r
  28124. }
  28125. ).call(this, "/js/util/ModelUrls.js")
  28126. }
  28127. , {
  28128. "../ab": 3,
  28129. "../constants": 8,
  28130. "./ajax": 181,
  28131. "./logger": 189,
  28132. "./showcase": 193
  28133. }],
  28134. 178: [function(l, c, e) {
  28135. (function(e) {
  28136. "use strict";
  28137. function t() {
  28138. i.call(this),
  28139. this.neighbourMap = {},
  28140. this.map = null
  28141. }
  28142. 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"),
  28143. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  28144. n.inherit(t, i),
  28145. t.prototype.getIndex = function(e) {
  28146. return e.id
  28147. }
  28148. ,
  28149. t.prototype.find = function(e, t) {
  28150. var i = n.filterAll(this.list, e);
  28151. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28152. i = n.stableSort(i, e)
  28153. }),
  28154. i[0])
  28155. }
  28156. ,
  28157. t.prototype.sortByScore = function(e, t) {
  28158. var i = n.filterAll(this.list, e);
  28159. return 0 === i.length ? null : i = i.map(function(i) {
  28160. return {
  28161. pano: i,
  28162. score: t.reduce(function(e, t) {
  28163. return e + t(i)
  28164. }, 0)
  28165. }
  28166. }).sort(function(e, t) {
  28167. return t.score - e.score
  28168. })
  28169. }
  28170. ,
  28171. t.prototype.lowestByScore = function(e, t, i) {
  28172. return this.findRankedByScore(0, e, t, i)
  28173. }
  28174. ,
  28175. t.prototype.findRankedByScore = function(e, t, i, n) {
  28176. n && (n.candidates = null,
  28177. n.pano = null),
  28178. e = e || 0;
  28179. var r = this.sortByScore(t, i);
  28180. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28181. n.pano = r[e].pano),
  28182. r[e].pano)
  28183. }
  28184. ,
  28185. t.prototype.showPanoScores = function(e) {
  28186. this.list.forEach(function(e) {
  28187. e.removeTextSprite()
  28188. });
  28189. var t = 6344768;
  28190. e.forEach(function(e) {
  28191. e.pano.addTextSprite(e.score.toFixed(2), t),
  28192. t = 16428055
  28193. })
  28194. }
  28195. ,
  28196. t.prototype.isNeighbour = function(e, t) {
  28197. return this.neighbourMap[e.id][t.id]
  28198. }
  28199. ,
  28200. t.prototype.getNeighbours = function(e) {
  28201. return this.neighbourMap[e.id]
  28202. }
  28203. ,
  28204. t.prototype.setNeighbour = function(e, t, i) {
  28205. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28206. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28207. this.neighbourMap[e.id][e.id] = !0,
  28208. this.neighbourMap[t.id][t.id] = !0,
  28209. this.neighbourMap[e.id][t.id] = i,
  28210. this.neighbourMap[t.id][e.id] = i,
  28211. this.neighbourMap[e.id]
  28212. }
  28213. ,
  28214. t.prototype.findClosest = function(e, t) {
  28215. var i = [r.filters.isPanoAligned()];
  28216. return t && i.push(r.filters.inDirection(e, t, .75)),
  28217. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  28218. }
  28219. ,
  28220. t.prototype.dualNeighbors = function(e, t) {
  28221. var i, n = [];
  28222. for (i in this.neighbourMap[e.id])
  28223. this.neighbourMap[t.id][i] && n.push(i);
  28224. return n
  28225. }
  28226. ,
  28227. t.prototype.populate_path_graph = function() {
  28228. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  28229. for (e = 0; e < this.list.length; e += 1) {
  28230. for (t in s = !(a = {}),
  28231. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  28232. if (i[t]) {
  28233. o = this.index[t],
  28234. u.copy(r.floorPosition),
  28235. u.sub(o.floorPosition);
  28236. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  28237. , p = (Math.abs(u.y),
  28238. Math.max(d, .01),
  28239. Math.max(0, Math.abs(u.y) - .2));
  28240. n = 0 < p ? (1,
  28241. p = Math.pow(4 * p, 2),
  28242. d = Math.pow(d, 2),
  28243. Math.sqrt(p * p + d * d)) : (1,
  28244. u.length()),
  28245. a[o.id] = n,
  28246. s = !0
  28247. }
  28248. s ? c[r.id] = a : h += 1
  28249. }
  28250. this.map = c,
  28251. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  28252. }
  28253. ,
  28254. t.prototype.aStarSearch = function(e, t) {
  28255. var i = Date.now()
  28256. , n = new o({
  28257. start: e,
  28258. isEnd: function(e) {
  28259. return e === t
  28260. },
  28261. neighbor: function(e) {
  28262. var t = e.neighbourPanos || e.findNeighourPanos()
  28263. , i = [];
  28264. for (var n in t)
  28265. t[n] && i.push(this.index[n]); //add: t[n] &&
  28266. return i
  28267. }
  28268. .bind(this),
  28269. distance: function(e, t) {
  28270. return this.map[e.id][t.id]
  28271. }
  28272. .bind(this),
  28273. heuristic: function(e, t) {
  28274. return 1
  28275. }
  28276. .bind(this),
  28277. hash: function(e) {
  28278. return e.id
  28279. },
  28280. timeout: 5e3
  28281. });
  28282. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  28283. "success" !== n.status)
  28284. return T.debug("Did not find A* path from " + e + " to " + t),
  28285. null;
  28286. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28287. var r = [];
  28288. return n.path.forEach(function(e) {
  28289. r.push(e.id)
  28290. }),
  28291. r
  28292. }
  28293. ,
  28294. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  28295. g = new w.Vector3,
  28296. m = new w.Vector3,
  28297. v = new w.Vector3,
  28298. y = new w.Vector3,
  28299. A = new w.Vector3,
  28300. C = new w.Vector3,
  28301. I = new w.Vector3,
  28302. E = [],
  28303. _ = new w.Vector3,
  28304. b = new w.Vector3,
  28305. function(e, t) {
  28306. if (e)
  28307. for (var i = function(e, t, i) {
  28308. return y.copy(t).sub(e),
  28309. y.dot(i)
  28310. }, n = function(e, t) {
  28311. return i(_, e.position, m) - i(_, t.position, m)
  28312. }, r = 0; r < e.length - 1; ) {
  28313. var o = e[r]
  28314. , a = e[r + 1]
  28315. , s = this.index[o]
  28316. , l = this.index[a];
  28317. _.copy(s.position),
  28318. b.copy(l.position),
  28319. E.length = 0,
  28320. f.copy(b).sub(_),
  28321. m.copy(f).normalize();
  28322. for (var c = 0; c < this.list.length; c++) {
  28323. var h = this.list[c];
  28324. y.copy(h.position).sub(_);
  28325. var u = y.dot(m);
  28326. 0 < u && (C.copy(m),
  28327. C.multiplyScalar(u),
  28328. A.copy(y),
  28329. A.sub(C),
  28330. A.length() < t && (g.copy(f).negate(),
  28331. v.copy(g).normalize(),
  28332. I.copy(h.position).sub(b),
  28333. 0 < I.dot(v) && E.push(h)))
  28334. }
  28335. if (0 < E.length) {
  28336. E.sort(n);
  28337. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  28338. e[d] = e[d - E.length];
  28339. for (var p = 0; p < E.length; p++)
  28340. e[p + r + 1] = E[p].id
  28341. }
  28342. r += E.length + 1
  28343. }
  28344. }
  28345. ),
  28346. t.prototype.fadeMarkerOpacity = function(e, t) {
  28347. var i = void 0 === e ? a.panorama.markerOpacity : e
  28348. , n = this.list.findIndex(function(e) {
  28349. return e.marker
  28350. });
  28351. if (!(n < 0)) {
  28352. var r = this.list[n].marker.material.opacity;
  28353. if (r !== e) {
  28354. var o = i - r;
  28355. s.trigger({
  28356. func: function(e, t) {
  28357. var i = r + e * o;
  28358. this.forEach(function(e) {
  28359. e.marker && (e.marker.material.opacity = i)
  28360. })
  28361. }
  28362. .bind(this),
  28363. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28364. name: "_fpm"
  28365. })
  28366. }
  28367. }
  28368. }
  28369. ,
  28370. c.exports = t
  28371. }
  28372. ).call(this, "/js/util/PanoramaCollection.js")
  28373. }
  28374. , {
  28375. "../objects/Panorama": 148,
  28376. "../settings": 166,
  28377. "./IndexedCollection": 175,
  28378. "./aStar": 180,
  28379. "./common": 185,
  28380. "./logger": 189,
  28381. "./transitions": 195,
  28382. three: 217
  28383. }],
  28384. 179: [function(e, t, i) {
  28385. "use strict";
  28386. function n() {
  28387. this.actionSequence = [],
  28388. this.actionSequenceInProgress = !1
  28389. }
  28390. function r(e, t, i, n) {
  28391. c.trackAlways("zoom_" + e, {
  28392. from: t,
  28393. to: i,
  28394. pano: n
  28395. })
  28396. }
  28397. var o, a, s, l, c = e("../analytics");
  28398. n.prototype.reset = function(e) {
  28399. this.actionSequenceInProgress = !1,
  28400. this.actionSequence.length = 0
  28401. }
  28402. ,
  28403. n.prototype.addZoomAction = (a = o = null,
  28404. s = !1,
  28405. l = function() {
  28406. if (o = null,
  28407. 0 < this.actionSequence.length) {
  28408. var e = this.actionSequence[0].start
  28409. , t = this.actionSequence[this.actionSequence.length - 1].end;
  28410. 1 === e ? function(e, t) {
  28411. r("initial", 1, e, t)
  28412. }(t, a) : function(e, t, i) {
  28413. r("followup", e, t, i)
  28414. }(e, t, a)
  28415. }
  28416. this.reset()
  28417. }
  28418. ,
  28419. function(e, t, i) {
  28420. if (e !== t) {
  28421. s || (l = l.bind(this),
  28422. s = !0),
  28423. o && (window.clearTimeout(o),
  28424. o = null),
  28425. i === a && this.actionSequenceInProgress || (this.reset(),
  28426. a = i),
  28427. this.actionSequenceInProgress = !0;
  28428. var n = {
  28429. start: e,
  28430. end: t
  28431. };
  28432. this.actionSequence.push(n),
  28433. o = window.setTimeout(l, 150)
  28434. }
  28435. }
  28436. ),
  28437. t.exports = n
  28438. }
  28439. , {
  28440. "../analytics": 4
  28441. }],
  28442. 180: [function(e, t, i) {
  28443. "use strict";
  28444. function g(e) {
  28445. if (void 0 === e.parent)
  28446. return [e.data];
  28447. var t = g(e.parent);
  28448. return t.push(e.data),
  28449. t
  28450. }
  28451. function m(e) {
  28452. return e.toString()
  28453. }
  28454. function v(e, t) {
  28455. return e.f - t.f
  28456. }
  28457. var y = e("Set")
  28458. , A = e("heap")
  28459. , C = e("dict");
  28460. t.exports = function(e) {
  28461. void 0 === e.timeout && (e.timeout = 1 / 0);
  28462. var t = e.hash || m
  28463. , i = {
  28464. data: e.start,
  28465. g: 0,
  28466. h: e.heuristic(e.start)
  28467. }
  28468. , n = i;
  28469. i.f = i.h;
  28470. var r = new y
  28471. , o = new A(v)
  28472. , a = C();
  28473. o.push(i),
  28474. a.set(t(i.data), i);
  28475. for (var s = new Date; o.size(); ) {
  28476. if (new Date - s > e.timeout)
  28477. return {
  28478. status: "timeout",
  28479. cost: n.g,
  28480. path: g(n)
  28481. };
  28482. var l = o.pop();
  28483. if (a.delete(t(l.data)),
  28484. e.isEnd(l.data))
  28485. return {
  28486. status: "success",
  28487. cost: l.g,
  28488. path: g(l)
  28489. };
  28490. r.add(t(l.data));
  28491. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28492. var u = c[h];
  28493. if (!r.contains(t(u))) {
  28494. var d = l.g + e.distance(l.data, u)
  28495. , p = a.get(t(u))
  28496. , f = !1;
  28497. if (void 0 === p)
  28498. p = {
  28499. data: u
  28500. },
  28501. a.set(t(u), p);
  28502. else {
  28503. if (p.g < d)
  28504. continue;
  28505. f = !0
  28506. }
  28507. p.parent = l,
  28508. p.g = d,
  28509. p.h = e.heuristic(u),
  28510. p.f = d + p.h,
  28511. p.h < n.h && (n = p),
  28512. f ? o.heapify() : o.push(p)
  28513. }
  28514. }
  28515. }
  28516. return {
  28517. status: "noPath",
  28518. cost: n.g,
  28519. path: g(n)
  28520. }
  28521. }
  28522. }
  28523. , {
  28524. Set: 196,
  28525. dict: 210,
  28526. heap: 211
  28527. }],
  28528. 181: [function(i, n, e) {
  28529. (function(e) {
  28530. "use strict";
  28531. function s(e, t, i) {
  28532. function n() {
  28533. l.warn("Retrying ", t),
  28534. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28535. }
  28536. var r = function(e, t, i) {
  28537. var n = new XMLHttpRequest;
  28538. if (i && "withCredentials"in n)
  28539. n.open(e, t, i);
  28540. else if ("undefined" != typeof XDomainRequest)
  28541. (n = new XDomainRequest).open(e, t);
  28542. else {
  28543. if (i)
  28544. throw "Browser does not support CORS!";
  28545. n.open(e, t)
  28546. }
  28547. return n
  28548. }(e, t, !1);
  28549. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28550. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28551. i.responseType)
  28552. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28553. r.responseType = i.responseType;
  28554. else {
  28555. if ("image/jpeg" !== i.responseType)
  28556. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28557. r.responseType = "arraybuffer"
  28558. }
  28559. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28560. i.auth && r.setRequestHeader("Authorization", i.auth),
  28561. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28562. r.setRequestHeader("Content-Type", "application/json")),
  28563. "object" == typeof i.headers)
  28564. for (var o in i.headers)
  28565. r.setRequestHeader(o, i.headers[o]);
  28566. var a = $.Deferred();
  28567. return r.onreadystatechange = function(e) {
  28568. if (4 === this.readyState)
  28569. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28570. i.retries++,
  28571. setTimeout(n, 1e3);
  28572. else if (200 === this.status) {
  28573. var t = function(e, t) {
  28574. var i = e.response;
  28575. if ("json" === t && "object" != typeof i)
  28576. try {
  28577. i = JSON.parse(e.responseText)
  28578. } catch (e) {
  28579. return void a.reject({
  28580. error: "Failed parsing JSON"
  28581. })
  28582. }
  28583. else if ("image/jpeg" === t) {
  28584. var n = new Uint8Array(e.response)
  28585. , r = new Blob([n],{
  28586. type: "image/jpeg"
  28587. })
  28588. , o = URL.createObjectURL(r);
  28589. (i = new Image).src = o,
  28590. i.crossOrigin = "Anonymous",
  28591. i.onload = function() {
  28592. URL.revokeObjectURL(o)
  28593. }
  28594. }
  28595. return i
  28596. }(this, i.responseType);
  28597. a.resolve(t)
  28598. } else
  28599. a.reject(this)
  28600. }
  28601. ,
  28602. r.onprogress = function(e) {
  28603. a.notify(e)
  28604. }
  28605. ,
  28606. r.send(i.data),
  28607. a.promise()
  28608. }
  28609. function o(e, t) {
  28610. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28611. return t.headers && function(t) {
  28612. return Object.keys(t).sort().map(function(e) {
  28613. return {
  28614. key: e,
  28615. value: t[e]
  28616. }
  28617. })
  28618. }(t.headers).forEach(function(e) {
  28619. i += "__" + e.key + ":" + e.value
  28620. }),
  28621. i
  28622. }
  28623. var t = i("./logger")
  28624. , a = i("../ab")
  28625. , l = new t(e);
  28626. window.URL = window.URL || window.webkitURL,
  28627. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28628. window.DATA = window.DATA || {},
  28629. n.exports = {
  28630. get: function(e, t) {
  28631. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28632. if (n) {
  28633. var r = function(e, t) {
  28634. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28635. }(e, t);
  28636. if (r)
  28637. return r
  28638. }
  28639. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  28640. n && function(e, t, i) {
  28641. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28642. }(e, t, i),
  28643. i
  28644. },
  28645. post: function(e, t) {
  28646. return s("POST", e, t)
  28647. },
  28648. patch: function(e, t) {
  28649. return s("PATCH", e, t)
  28650. },
  28651. getImage: function(e, t) {
  28652. function i() {
  28653. l.warn("Retrying ", e),
  28654. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28655. }
  28656. var n = $.Deferred()
  28657. , r = new Image
  28658. , o = this;
  28659. return e = a.changeIfImageOptimzing(e),
  28660. null != t || (t = 3),
  28661. r.onerror = function() {
  28662. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28663. }
  28664. ,
  28665. r.onload = function() {
  28666. n.resolve(r)
  28667. }
  28668. ,
  28669. r.crossOrigin = "anonymous",
  28670. r.src = e,
  28671. n
  28672. }
  28673. }
  28674. }
  28675. ).call(this, "/js/util/ajax.js")
  28676. }
  28677. , {
  28678. "../ab": 3,
  28679. "./logger": 189
  28680. }],
  28681. 182: [function(e, t, i) {
  28682. "use strict";
  28683. function n(e, t) {
  28684. var i = window.navigator.userAgent.match(e);
  28685. return i = i ? i[1].split(t) : [],
  28686. {
  28687. major: parseInt(i[0]) || 0,
  28688. minor: parseInt(i[1]) || 0,
  28689. patch: parseInt(i[2]) || 0
  28690. }
  28691. }
  28692. var r = e("../exception/DeviceMismatchException");
  28693. window.browser = t.exports = {
  28694. isFullscreen: function() {
  28695. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28696. },
  28697. supportsFullscreen: function() {
  28698. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28699. },
  28700. isPointerLocked: function() {
  28701. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28702. },
  28703. requestFullscreen: function(e, t) {
  28704. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28705. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28706. },
  28707. requestPointerLock: function() {
  28708. var e;
  28709. if (document.fullscreenElement)
  28710. e = document.fullscreenElement();
  28711. else if (document.mozFullscreenElement)
  28712. e = document.mozFullscreenElement();
  28713. else if (document.mozFullScreenElement)
  28714. e = document.mozFullScreenElement();
  28715. else {
  28716. if (!document.webkitFullscreenElement)
  28717. return;
  28718. e = document.webkitFullscreenElement()
  28719. }
  28720. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28721. e.requestPointerLock(),
  28722. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28723. },
  28724. exitPointerLock: function() {
  28725. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28726. document.exitPointerLock()
  28727. },
  28728. exitFullscreen: function() {
  28729. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28730. },
  28731. details: function() {
  28732. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28733. return e ? {
  28734. name: e[1],
  28735. version: parseInt(e[2]),
  28736. platform: navigator.platform
  28737. } : {}
  28738. },
  28739. is: function(e) {
  28740. return this.details() && this.details().name === e
  28741. },
  28742. inIframe: function() {
  28743. return window.parent !== window
  28744. },
  28745. aspectRatio: function() {
  28746. var e = $("#player").width() / $("#player").height();
  28747. return isFinite(e) ? e : 0
  28748. },
  28749. userAgent: function() {
  28750. return window.navigator.userAgent
  28751. },
  28752. isMobile: function() {
  28753. var e = navigator.userAgent || navigator.vendor || window.opera;
  28754. 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))
  28755. },
  28756. isLandscape: function() {
  28757. return this.isMobile && 1 < this.aspectRatio()
  28758. },
  28759. isSmallScreen: function() {
  28760. return screen.width / window.devicePixelRatio < 240
  28761. },
  28762. detectIE: function() {
  28763. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28764. },
  28765. detectSafari: function() {
  28766. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28767. },
  28768. detectFirefox: function() {
  28769. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28770. },
  28771. detectChrome: function() {
  28772. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28773. },
  28774. detectOpera: function() {
  28775. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28776. },
  28777. detectIOS: function() {
  28778. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28779. },
  28780. detectIPad: function() {
  28781. var e = window.navigator.userAgent;
  28782. return /iPad/.test(e)
  28783. },
  28784. detectIPod: function() {
  28785. var e = window.navigator.userAgent;
  28786. return /iPod/.test(e)
  28787. },
  28788. detectIPhone: function() {
  28789. var e = window.navigator.userAgent;
  28790. return /iPhone/.test(e)
  28791. },
  28792. detectAndroid: function() {
  28793. return -1 !== window.navigator.userAgent.indexOf("Android")
  28794. },
  28795. detectAndroidMobile: function() {
  28796. var e = window.navigator.userAgent;
  28797. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28798. },
  28799. detectSamsungNative: function() {
  28800. var e = window.navigator.userAgent;
  28801. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28802. },
  28803. detectSamsungS6: function() {
  28804. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28805. },
  28806. detectHUAWEI5X: function() {
  28807. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28808. },
  28809. detectWebVR: function() {
  28810. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28811. },
  28812. getVRDisplay: function() {
  28813. var t = $.Deferred();
  28814. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28815. 1 <= e.length && t.resolve(e[0]),
  28816. t.reject(null)
  28817. }),
  28818. t) : t.reject(null)
  28819. },
  28820. iosVersion: function() {
  28821. if (!this.detectIOS())
  28822. throw new r("Did not detect an iDevice");
  28823. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28824. },
  28825. androidVersion: function() {
  28826. if (!this.detectAndroid())
  28827. throw new r("Did not detect an Android based device");
  28828. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28829. },
  28830. valueFromCookie: function(e, t) {
  28831. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28832. if (!i)
  28833. return t;
  28834. var n = i[1];
  28835. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28836. },
  28837. valueFromHash: function(e, t) {
  28838. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28839. if (!i)
  28840. return t;
  28841. var n = i[1];
  28842. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28843. }
  28844. }
  28845. }
  28846. , {
  28847. "../exception/DeviceMismatchException": 56
  28848. }],
  28849. 183: [function(i, n, e) {
  28850. (function(e) {
  28851. "use strict";
  28852. var o = i("../controls/serializer")
  28853. , a = i("../util/math")
  28854. , s = i("./browser")
  28855. , l = i("../enum/Viewmode")
  28856. , t = i("../util/logger")
  28857. , c = i("three")
  28858. , h = new t(e);
  28859. n.exports = {
  28860. getStartCameraOptions: function(e, t) {
  28861. var i = function(e) {
  28862. var t = s.valueFromHash("start", "")
  28863. , i = {};
  28864. if ("" !== t) {
  28865. h.debug("Start override found in parameters, trying to parse..."),
  28866. i = function(e) {
  28867. return o.deserialize(e)
  28868. }(t) || {};
  28869. var n = s.valueFromHash("tag", null);
  28870. n && (i.tag = n),
  28871. i.panoId && (i.pano = e.get(i.panoId))
  28872. }
  28873. return i
  28874. }(t);
  28875. if (0 < Object.keys(i).length)
  28876. return i;
  28877. if (e.heroImage)
  28878. i = function(e, t) {
  28879. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28880. return {};
  28881. var i = {}
  28882. , n = e.heroImage.metadata;
  28883. h.debug("Using start position from thumbnail image"),
  28884. i.position = n.camera_position,
  28885. i.quaternion = n.camera_quaternion;
  28886. try {
  28887. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28888. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28889. } catch (e) {
  28890. h.debug(e.message)
  28891. }
  28892. return i
  28893. }(e, t);
  28894. else if (window.DATA.camera_start) {
  28895. var n = window.DATA.camera_start;
  28896. try {
  28897. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28898. i.position = (new c.Vector3).fromArray(n.camera.position),
  28899. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28900. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28901. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28902. h.debug("Using camera_start"),
  28903. h.debug("Modeldata pano: ", i.pano.quaternion),
  28904. h.debug("Camera start pano: ", n.pano.quaternion)),
  28905. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28906. } catch (e) {
  28907. h.warn(e.message)
  28908. if(i.mode == "panorama" && !i.pano){
  28909. i.pano = t.list[0]
  28910. }
  28911. }
  28912. }
  28913. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28914. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28915. i.pano = t.findClosest(i.position) ,
  28916. i.quaternion = i.pano.quaternion),
  28917. 0 === Object.keys(i).length) {
  28918. var r = t.list[0];
  28919. r && (i.mode = l.PANORAMA,
  28920. i.pano = r,
  28921. i.position = r.position,
  28922. i.quaternion = r.quaternion,
  28923. h.info("Starting at 1st pano " + r.id))
  28924. }
  28925. return i.mode = i.mode || l.DOLLHOUSE,
  28926. i
  28927. }
  28928. }
  28929. }
  28930. ).call(this, "/js/util/camera.js")
  28931. }
  28932. , {
  28933. "../controls/serializer": 14,
  28934. "../enum/Viewmode": 51,
  28935. "../util/logger": 189,
  28936. "../util/math": 190,
  28937. "./browser": 182,
  28938. three: 217
  28939. }],
  28940. 184: [function(e, t, i) {
  28941. "use strict";
  28942. function r(e, t, i) {
  28943. var n = t
  28944. , r = i;
  28945. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28946. }
  28947. function o(e, t, i) {
  28948. var n = t
  28949. , r = i;
  28950. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28951. }
  28952. var a = e("./MathLight");
  28953. t.exports = {
  28954. clampVFOV: function(e, t, i, n) {
  28955. return t < r(e, i, n) ? o(t, i, n) : e
  28956. },
  28957. getHFOVForCamera: function(e, t, i) {
  28958. return r(e.fov, t, i)
  28959. },
  28960. getHFOVFromVFOV: r,
  28961. getVFOVFromHFOV: o
  28962. }
  28963. window.MathLight = t.exports
  28964. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28965. var prec = Math.pow(10, - (precision || 4));
  28966. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28967. if(e1.w){
  28968. return s1 && Math.abs(e1.w - e2.w) < prec
  28969. }else return s1
  28970. }
  28971. }
  28972. , {
  28973. "./MathLight": 176
  28974. }],
  28975. 185: [function(e, t, i) {
  28976. "use strict";
  28977. var a = e("three");
  28978. t.exports = {
  28979. delayOneFrame: function(e) {
  28980. window.setTimeout(e, 1)
  28981. },
  28982. normalizeUrl: function(e) {
  28983. return e.replace("https://", "http://")
  28984. },
  28985. domainFromUrl: function(e) {
  28986. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28987. return t ? t[3] : e
  28988. },
  28989. average: function(e, t) {
  28990. if (0 === e.length)
  28991. return null;
  28992. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28993. i += t ? e[r][t] : e[r],
  28994. n++
  28995. }
  28996. return i / n
  28997. },
  28998. countUnique: function(e) {
  28999. for (var t = {}, i = 0; i < e.length; i++)
  29000. t[e[i]] = 1 + (t[e[i]] || 0);
  29001. return Object.keys(t).length
  29002. },
  29003. averageVectors: function(e, t) {
  29004. var i = new a.Vector3;
  29005. if (0 === e.length)
  29006. return i;
  29007. for (var n = 0, r = 0; r < e.length; r++) {
  29008. var o = t ? e[r][t] : e[r];
  29009. i.add(o),
  29010. n++
  29011. }
  29012. return i.divideScalar(n)
  29013. },
  29014. equalLists: function(e, t) {
  29015. if (e.length !== t.length)
  29016. return !1;
  29017. for (var i = 0; i < e.length; i++)
  29018. if (e[i] !== t[i])
  29019. return !1;
  29020. return !0
  29021. },
  29022. lowerMedian: function(e, t) {
  29023. return 0 === e.length ? null : (t = t || 2,
  29024. e.sort(function(e, t) {
  29025. return e - t
  29026. }),
  29027. e[Math.floor(e.length / t)])
  29028. },
  29029. stableSort: function(e, n) {
  29030. return e.map(function(e, t) {
  29031. return {
  29032. value: e,
  29033. index: t
  29034. }
  29035. }).sort(function(e, t) {
  29036. var i = n(e.value, t.value);
  29037. return 0 !== i ? i : e.index - t.index
  29038. }).map(function(e) {
  29039. return e.value
  29040. })
  29041. },
  29042. filterAll: function(e, i) {
  29043. return e.filter(function(t) {
  29044. return i.every(function(e) {
  29045. return e(t)
  29046. })
  29047. })
  29048. },
  29049. formatDate: function(e) {
  29050. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29051. },
  29052. formatDatetime: function(e) {
  29053. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29054. },
  29055. randomString: function(e) {
  29056. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29057. t += i.charAt(Math.floor(Math.random() * i.length));
  29058. return t
  29059. },
  29060. uint8ToBase64: function(e, t) {
  29061. t && "number" == typeof t || (t = 8192);
  29062. for (var i = [], n = 0; n < e.length; n += t)
  29063. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29064. return btoa(i.join(""))
  29065. },
  29066. uuid4: function e(t) {
  29067. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29068. },
  29069. nth: function(e) {
  29070. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29071. },
  29072. extendObject: function(t, i) {
  29073. return Object.keys(i).forEach(function(e) {
  29074. t[e] = i[e]
  29075. }),
  29076. t
  29077. },
  29078. deepExtend: function e(t) {
  29079. t = t || {};
  29080. for (var i = 1; i < arguments.length; i++) {
  29081. var n = arguments[i];
  29082. if (n)
  29083. for (var r in n)
  29084. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29085. }
  29086. return t
  29087. },
  29088. inherit: function(e, t) {
  29089. e.prototype = Object.create(t.prototype),
  29090. e.prototype.constructor = e
  29091. },
  29092. extend: function(e, t) {
  29093. for (var i in t.prototype)
  29094. e.prototype[i] = t.prototype[i]
  29095. },
  29096. getVisiblePano : function(positions = [], panos, options={}){//add
  29097. var visiblePanos = [];
  29098. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  29099. panos.forEach((pano)=>{
  29100. if(!pano.isAligned())return;
  29101. var A = pano.position.clone();
  29102. var posB = options.posAtPanos[pano.id] || positions;
  29103. var posLength = posB.length
  29104. for(let i=0;i<posLength;i++){
  29105. var B = posB[i];
  29106. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  29107. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  29108. if (!o || !o.length){ //只要有一点可见,就算整体可见
  29109. visiblePanos.push(pano.id);
  29110. break;
  29111. }
  29112. }
  29113. })
  29114. return visiblePanos
  29115. }
  29116. ,
  29117. sortByScore : function(list, request, rank) {
  29118. var i = this.filterAll(list, request);
  29119. return 0 === i.length ? null : i = i.map(function(e) {
  29120. return {
  29121. item: e,
  29122. score: rank.reduce(function(t, i) {
  29123. return t + i(e);
  29124. }, 0)
  29125. };
  29126. }).sort(function(e, t) {
  29127. return t.score - e.score;
  29128. });
  29129. }
  29130. },
  29131. Math.sign = function(e) {
  29132. return e < 0 ? -1 : 1
  29133. }
  29134. window.common = t.exports
  29135. }
  29136. , {
  29137. three: 217
  29138. }],
  29139. 186: [function(e, t, i) {
  29140. "use strict";
  29141. var r = {
  29142. linearTween: function(e, t, i, n) {
  29143. return i * e / n + t
  29144. },
  29145. easeInQuad: function(e, t, i, n) {
  29146. return i * (e /= n) * e + t
  29147. },
  29148. easeOutQuad: function(e, t, i, n) {
  29149. return -i * (e /= n) * (e - 2) + t
  29150. },
  29151. easeInOutQuad: function(e, t, i, n) {
  29152. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  29153. },
  29154. easeInCubic: function(e, t, i, n) {
  29155. return i * (e /= n) * e * e + t
  29156. },
  29157. easeOutCubic: function(e, t, i, n) {
  29158. return e /= n,
  29159. i * (--e * e * e + 1) + t
  29160. },
  29161. easeInOutCubic: function(e, t, i, n) {
  29162. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  29163. },
  29164. easeInQuart: function(e, t, i, n) {
  29165. return i * (e /= n) * e * e * e + t
  29166. },
  29167. easeOutQuart: function(e, t, i, n) {
  29168. return e /= n,
  29169. -i * (--e * e * e * e - 1) + t
  29170. },
  29171. easeInOutQuart: function(e, t, i, n) {
  29172. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  29173. },
  29174. easeInQuint: function(e, t, i, n) {
  29175. return i * (e /= n) * e * e * e * e + t
  29176. },
  29177. easeOutQuint: function(e, t, i, n) {
  29178. return e /= n,
  29179. i * (--e * e * e * e * e + 1) + t
  29180. },
  29181. easeInOutQuint: function(e, t, i, n) {
  29182. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  29183. },
  29184. easeInSine: function(e, t, i, n) {
  29185. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  29186. },
  29187. easeOutSine: function(e, t, i, n) {
  29188. return i * Math.sin(e / n * (Math.PI / 2)) + t
  29189. },
  29190. easeInOutSine: function(e, t, i, n) {
  29191. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  29192. },
  29193. easeInExpo: function(e, t, i, n) {
  29194. return i * Math.pow(2, 10 * (e / n - 1)) + t
  29195. },
  29196. easeOutExpo: function(e, t, i, n) {
  29197. return i * (1 - Math.pow(2, -10 * e / n)) + t
  29198. },
  29199. easeInOutExpo: function(e, t, i, n) {
  29200. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29201. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  29202. },
  29203. easeInCirc: function(e, t, i, n) {
  29204. return e /= n,
  29205. -i * (Math.sqrt(1 - e * e) - 1) + t
  29206. },
  29207. easeOutCirc: function(e, t, i, n) {
  29208. return e /= n,
  29209. e--,
  29210. i * Math.sqrt(1 - e * e) + t
  29211. },
  29212. easeInOutCirc: function(e, t, i, n) {
  29213. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29214. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29215. },
  29216. easeInElastic: function(e, t, i, n) {
  29217. var r = 1.70158
  29218. , o = 0
  29219. , a = i;
  29220. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29221. r = a < Math.abs(i) ? (a = i,
  29222. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29223. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  29224. },
  29225. easeOutElastic: function(e, t, i, n) {
  29226. var r = 1.70158
  29227. , o = 0
  29228. , a = i;
  29229. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  29230. r = a < Math.abs(i) ? (a = i,
  29231. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29232. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29233. },
  29234. easeInOutElastic: function(e, t, i, n) {
  29235. var r = 1.70158
  29236. , o = 0
  29237. , a = i;
  29238. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  29239. r = a < Math.abs(i) ? (a = i,
  29240. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  29241. 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)
  29242. },
  29243. easeInBack: function(e, t, i, n, r) {
  29244. return void 0 === r && (r = 1.70158),
  29245. i * (e /= n) * e * ((r + 1) * e - r) + t
  29246. },
  29247. easeOutBack: function(e, t, i, n, r) {
  29248. return void 0 === r && (r = 1.70158),
  29249. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29250. },
  29251. easeInOutBack: function(e, t, i, n, r) {
  29252. return void 0 === r && (r = 1.70158),
  29253. (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
  29254. },
  29255. easeOutBounce: function(e, t, i, n) {
  29256. 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
  29257. },
  29258. easeInBounce: function(e, t, i, n) {
  29259. return i - r.easeOutBounce(n - e, 0, i, n) + t
  29260. },
  29261. easeInOutBounce: function(e, t, i, n) {
  29262. 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
  29263. }
  29264. };
  29265. window.easing = t.exports = r
  29266. }
  29267. , {}],
  29268. 187: [function(e, t, i) {
  29269. "use strict";
  29270. function n() {
  29271. this.events = [],
  29272. this.valid = !1
  29273. }
  29274. var r = e("../enum/Joystick");
  29275. n.prototype.push = function(e, t) {
  29276. this.events.push({
  29277. direction: e,
  29278. pano: t
  29279. }),
  29280. this.valid = !0
  29281. }
  29282. ,
  29283. n.prototype.pop = function(e) {
  29284. var t = this.events.pop();
  29285. return this.events.length < 1 && (this.valid = !1),
  29286. t
  29287. }
  29288. ,
  29289. n.prototype.peek = function() {
  29290. return this.events.length ? this.events[this.events.length - 1] : {
  29291. direction: null,
  29292. pano: null
  29293. }
  29294. }
  29295. ,
  29296. n.prototype.invalidate = function() {
  29297. this.events = [],
  29298. this.valid = !1
  29299. }
  29300. ,
  29301. n.prototype.reversePano = function(e) {
  29302. if (!this.valid)
  29303. return null;
  29304. var t = this.peek();
  29305. return r.opposite(e) === t.direction ? (this.pop(),
  29306. t.pano) : null
  29307. }
  29308. ,
  29309. t.exports = n
  29310. }
  29311. , {
  29312. "../enum/Joystick": 29
  29313. }],
  29314. 188: [function(e, t, i) {
  29315. "use strict";
  29316. t.exports = {
  29317. vector: function(t, i) {
  29318. var n = t.clone();
  29319. return i = i.clone(),
  29320. function(e) {
  29321. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  29322. }
  29323. },
  29324. quaternion: function(t, i) {
  29325. var n = t.clone();
  29326. return function(e) {
  29327. t.copy(n).slerp(i, e)
  29328. }
  29329. },
  29330. property: function(t, i, n, r) {
  29331. var o = t[i];
  29332. return function(e) {
  29333. t[i] = o * (1 - e) + n * e,
  29334. r && r(t[i])
  29335. }
  29336. },
  29337. uniform: function(t, i, n) {
  29338. var r = t.material.uniforms[i].value;
  29339. return function(e) {
  29340. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  29341. }
  29342. },
  29343. matrix4: function(o, a) {
  29344. var s = o.clone();
  29345. return function(e) {
  29346. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  29347. t[r] = i[r] * (1 - e) + n[r] * e
  29348. }
  29349. },
  29350. allUniforms: function(e, t, i) {
  29351. var n = e.map(function(e) {
  29352. return this.uniform(e, t, i)
  29353. }
  29354. .bind(this));
  29355. return function(t) {
  29356. n.forEach(function(e) {
  29357. e(t)
  29358. })
  29359. }
  29360. }
  29361. }
  29362. }
  29363. , {}],
  29364. 189: [function(e, t, i) {
  29365. "use strict";
  29366. function h(n) {
  29367. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  29368. if (h.consoleEnabled) {
  29369. var l = function(e) {
  29370. $("#debug-console").append("<p>" + e + "</p>"),
  29371. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29372. };
  29373. e = function(e) {
  29374. l(Array.prototype.slice.call(arguments).join(" "))
  29375. }
  29376. ,
  29377. t = function(e) {
  29378. l(Array.prototype.slice.call(arguments).join(" "))
  29379. }
  29380. ,
  29381. i = function(e) {
  29382. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29383. }
  29384. ,
  29385. r = function(e) {
  29386. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29387. }
  29388. } else
  29389. console.log ? (e = console.log,
  29390. t = console.info ? console.info : console.log,
  29391. i = console.warn ? console.warn : console.log,
  29392. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  29393. ;
  29394. function c(e) {
  29395. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  29396. }
  29397. return {
  29398. debug: function() {
  29399. h.level >= h.levels.debug && e.apply(console, c(arguments))
  29400. },
  29401. info: function() {
  29402. h.level >= h.levels.info && t.apply(console, c(arguments))
  29403. },
  29404. warn: function() {
  29405. (function(e, t) {
  29406. if (u) {
  29407. var i = Array.prototype.slice.call(e).join(" ");
  29408. u.captureMessage(i, {
  29409. level: t,
  29410. path: n,
  29411. timestamp: h.timestamp()
  29412. })
  29413. }
  29414. }
  29415. )(arguments, "warn"),
  29416. h.level >= h.levels.warn && i.apply(console, c(arguments))
  29417. },
  29418. error: function() {
  29419. (function(e, t) {
  29420. if (u) {
  29421. var i = Array.prototype.slice.call(e).join(" ");
  29422. u.captureException(new Error(i), {
  29423. level: t,
  29424. path: n,
  29425. timestamp: h.timestamp()
  29426. })
  29427. }
  29428. }
  29429. )(arguments, "error"),
  29430. h.level >= h.levels.error && r.apply(console, c(arguments))
  29431. },
  29432. v3str: function(e, t) {
  29433. var i = void 0 === t ? 2 : t;
  29434. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29435. },
  29436. eulstr: function(e, t) {
  29437. var i = void 0 === t ? 2 : t;
  29438. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29439. },
  29440. time: function(e) {
  29441. h.level >= h.levels.debug && (s[e] = Date.now())
  29442. },
  29443. timeEnd: function(e) {
  29444. if (h.level >= h.levels.debug) {
  29445. var t = s[e];
  29446. if (!t)
  29447. return;
  29448. var i = (Date.now() - t) / 1e3;
  29449. this.debug(e, i + "s")
  29450. }
  29451. }
  29452. }
  29453. }
  29454. var u = window.Raven;
  29455. h.timestamp = function() {
  29456. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29457. }
  29458. ,
  29459. h.level = (h.levels = {
  29460. debug: 3,
  29461. info: 2,
  29462. warn: 1,
  29463. error: 0
  29464. }).info,
  29465. t.exports = h
  29466. }
  29467. , {}],
  29468. 190: [function(e, t, i) {
  29469. "use strict";
  29470. var o = e("three")
  29471. , r = e("../enum/GLCubeFaces");
  29472. e("../constants");
  29473. t.exports = {
  29474. convertVisionVector: function(e) {
  29475. return new o.Vector3(e.x,e.z,-e.y)
  29476. },
  29477. convertVisionQuaternion: function(e) {
  29478. 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)))
  29479. },
  29480. convertWorkshopVector: function(e) {
  29481. return new o.Vector3(-e.x,e.y,e.z)
  29482. },
  29483. convertWorkshopQuaternion: function(e) {
  29484. 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))
  29485. },
  29486. convertWorkshopPanoramaQuaternion: function(e) {
  29487. 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)))
  29488. },
  29489. convertWorkshopOrthoZoom: function(e) {
  29490. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29491. },
  29492. toPrecision: function(e, t) {
  29493. function i(e, t) {
  29494. var i = Math.pow(10, t);
  29495. return Math.round(e * i) / i
  29496. }
  29497. if (e instanceof Array) {
  29498. for (var n = 0; n < e.length; n++)
  29499. e[n] = i(e[n], t);
  29500. return e
  29501. }
  29502. return i(e, t)
  29503. },
  29504. isEmptyQuaternion: function(e) {
  29505. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29506. },
  29507. projectPositionToCanvas: function(e, t, i) {
  29508. (i = i || new o.Vector3).copy(e);
  29509. var n = .5 * $("#player").width()
  29510. , r = .5 * $("#player").height();
  29511. return i.project(t),
  29512. i.x = i.x * n + n,
  29513. i.y = -i.y * r + r,
  29514. i
  29515. },
  29516. convertScreenPositionToNDC: function(e, t, i) {
  29517. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29518. i.y = -t / $("#player").height() * 2 + 1,
  29519. i
  29520. },
  29521. constrainedTurn: function(e) {
  29522. var t = e % (2 * Math.PI);
  29523. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29524. },
  29525. getFOVDotThreshold: function(e) {
  29526. return Math.cos(o.Math.degToRad(e / 2))
  29527. },
  29528. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29529. switch (e) {
  29530. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29531. i.set(1, t.y, t.x);
  29532. break;
  29533. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29534. i.set(-1, t.y, -t.x);
  29535. break;
  29536. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29537. i.set(-t.x, 1, -t.y);
  29538. break;
  29539. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29540. i.set(-t.x, -1, t.y);
  29541. break;
  29542. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29543. i.set(-t.x, t.y, 1);
  29544. break;
  29545. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29546. i.set(t.x, t.y, -1)
  29547. }
  29548. n && i.normalize()
  29549. },
  29550. //add:
  29551. getPos2d : function(point, camera, dom){
  29552. var camera = camera ;
  29553. var dom = dom;
  29554. 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);
  29555. var x,y;
  29556. x = (pos.x + 1) / 2 * dom.clientWidth;
  29557. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29558. var inSight = x <= dom.clientWidth && x >= 0
  29559. && y <= dom.clientHeight && y >= 0
  29560. return {
  29561. pos: new THREE.Vector2(x,y),
  29562. vector: pos,
  29563. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29564. inSight : inSight //在屏幕范围内可见
  29565. };
  29566. },
  29567. getDirByLonLat: function(lon, lat) {
  29568. var dir = new THREE.Vector3();
  29569. var phi = THREE.Math.degToRad(90 - lat);
  29570. var theta = THREE.Math.degToRad(lon);
  29571. dir.x = Math.sin(phi) * Math.cos(theta);
  29572. dir.y = Math.cos(phi);
  29573. dir.z = Math.sin(phi) * Math.sin(theta);
  29574. return dir.negate();
  29575. }
  29576. }
  29577. window.math = t.exports
  29578. }
  29579. , {
  29580. "../constants": 8,
  29581. "../enum/GLCubeFaces": 25,
  29582. three: 217
  29583. }],
  29584. 191: [function(e, t, i) {
  29585. "use strict";
  29586. function o(e) {
  29587. return r[e]
  29588. }
  29589. var n = e("../enum/GLCubeFaces")
  29590. , a = [0, 1, 2, 3, 4, 5]
  29591. , r = {
  29592. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29593. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29594. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29595. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29596. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29597. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29598. };
  29599. t.exports = {
  29600. mapFaceToCubemapFace: o,
  29601. getCubemapUrls: function(i, n, r) {
  29602. return a.map(function(e, t) {
  29603. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29604. }
  29605. .bind(this))
  29606. }
  29607. }
  29608. }
  29609. , {
  29610. "../enum/GLCubeFaces": 25
  29611. }],
  29612. 192: [function(e, t, i) {
  29613. "use strict";
  29614. t.exports = {
  29615. captureErrors: function(e, t, i) {
  29616. if ("Raven"in window) {
  29617. Raven.config(e, t).install(),
  29618. i && Raven.setTagsContext(i);
  29619. var n = console.warn
  29620. , r = console.error;
  29621. console.warn = function() {
  29622. var e = Array.prototype.slice.call(arguments);
  29623. Raven.captureMessage(e.join(" "), {
  29624. level: "warning"
  29625. }),
  29626. n.apply(console, e)
  29627. }
  29628. ,
  29629. console.error = function() {
  29630. var e = Array.prototype.slice.call(arguments);
  29631. Raven.captureException(new Error(e.join(" ")), {
  29632. level: "error"
  29633. }),
  29634. r.apply(console, e)
  29635. }
  29636. } else
  29637. console.error("Raven not found, not capturing errors.")
  29638. }
  29639. }
  29640. }
  29641. , {}],
  29642. 193: [function(c, h, e) {
  29643. (function(e) {
  29644. "use strict";
  29645. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29646. getAuthorizationHeader: function() {
  29647. var e = n.valueFromHash("auth");
  29648. if (e)
  29649. return e.replace(",", " ");
  29650. var t = n.valueFromCookie("token");
  29651. return t ? "Token " + t : null
  29652. },
  29653. parseSidUrl: function(e) {
  29654. var t, i;
  29655. if (t = g_Prefix,
  29656. (e = e || "").match(/^https?/)) {
  29657. o.parse(e);
  29658. t = g_Prefix,
  29659. i = e
  29660. } else
  29661. i = (t = g_Prefix) + "data/" + e;
  29662. return {
  29663. urlBase: t,
  29664. urlModel: i,
  29665. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29666. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29667. }
  29668. },
  29669. getModelIDFromQueryString: function() {
  29670. return n.valueFromHash("model") || n.valueFromHash("m")
  29671. },
  29672. /* normalizeModeldata: function(e, i) {
  29673. e = JSON.parse(JSON.stringify(e));
  29674. var n = null;
  29675. if (e.images.forEach(function(t) {
  29676. if (t.metadata) {
  29677. if ("string" == typeof t.metadata)
  29678. try {
  29679. t.metadata = JSON.parse(t.metadata)
  29680. } catch (e) {
  29681. s.warn("Unable to parse image metadata"),
  29682. t.metadata = null
  29683. }
  29684. else
  29685. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29686. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29687. 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)),
  29688. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29689. t.metadata.zoom = t.metadata.zoom || 1),
  29690. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29691. }
  29692. }),
  29693. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29694. var t = {};
  29695. t.pano = {
  29696. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29697. position: i.convertWorkshopVector(n.scan_position),
  29698. uuid: n.scan_id
  29699. },
  29700. t.camera = {
  29701. quaternion: n.camera_quaternion,
  29702. position: n.camera_position
  29703. },
  29704. e.startPano = t
  29705. }
  29706. return e
  29707. }, */
  29708. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29709. e = JSON.parse(JSON.stringify(e));
  29710. var i = null;
  29711. var deal = function(n) {
  29712. if(!n.metadata) return;
  29713. if ("string" == typeof n.metadata)
  29714. try {
  29715. n.metadata = JSON.parse(n.metadata)
  29716. } catch (e) {
  29717. s.warn("Unable to parse image metadata"),
  29718. n.metadata = null
  29719. }
  29720. else{
  29721. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29722. }
  29723. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29724. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29725. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29726. }else{
  29727. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29728. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29729. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29730. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29731. }
  29732. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29733. }
  29734. //改
  29735. e.images.forEach(info=>{
  29736. if(info.locations){
  29737. info.locations.forEach(a=>deal(a))
  29738. }else{
  29739. deal(info)
  29740. }
  29741. })
  29742. //icon初始视角的:
  29743. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29744. var n = {};
  29745. n.pano = {
  29746. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29747. position: t.convertWorkshopVector(i.scan_position),
  29748. uuid: i.scan_id
  29749. },
  29750. n.camera = {
  29751. quaternion: i.camera_quaternion,
  29752. position: i.camera_position
  29753. },
  29754. e.startPano = n
  29755. }
  29756. return e
  29757. },
  29758. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29759. function(e) {
  29760. if (!e)
  29761. throw new Error("Vision version is required");
  29762. var t = i.exec(e);
  29763. if (null === t)
  29764. throw new Error("String is not a vision version: " + e);
  29765. return parseInt(t[1])
  29766. }
  29767. ),
  29768. modelDataPromisesTiles: function(e) {
  29769. var t = e.vision_version || window.DATA.vision_version;
  29770. if (t)
  29771. try {
  29772. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29773. } catch (e) {
  29774. s.warn("Invalid vision version: " + t)
  29775. }
  29776. return !1
  29777. }
  29778. };
  29779. h.exports = l
  29780. }
  29781. ).call(this, "/js/util/showcase.js")
  29782. }
  29783. , {
  29784. "../constants": 8,
  29785. "./browser": 182,
  29786. "./logger": 189,
  29787. three: 217,
  29788. url: 208
  29789. }],
  29790. 194: [function(e, t, i) {
  29791. "use strict";
  29792. var r = e("../util/ajax")
  29793. , o = e("three")
  29794. , a = e("../settings")
  29795. , s = {};
  29796. t.exports = {
  29797. load: function(e, t, i) {
  29798. var n = s[e];
  29799. return n ? t && setTimeout(function() {
  29800. t(n)
  29801. }, 1) : (n = new o.Texture,
  29802. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29803. n.magFilter = o.LinearFilter,
  29804. n.generateMipmaps = !1),
  29805. n.sourceFile = e,
  29806. s[e] = n,
  29807. r.getImage(e).then(function(e) {
  29808. n.image = e,
  29809. n.needsUpdate = !0,
  29810. t && t(n)
  29811. }).fail(i)),
  29812. n
  29813. },
  29814. loadBase64: function(e, t) {
  29815. t = t || "png";
  29816. var i = new o.Texture;
  29817. return i.image = document.createElement("img"),
  29818. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29819. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29820. i.magFilter = o.LinearFilter,
  29821. i.generateMipmaps = !1),
  29822. i.needsUpdate = !0,
  29823. i
  29824. },
  29825. isLoaded: function(e) {
  29826. return !!s[e]
  29827. }
  29828. }
  29829. window.Texture = t.exports
  29830. }
  29831. , {
  29832. "../settings": 166,
  29833. "../util/ajax": 181,
  29834. three: 217
  29835. }],
  29836. 195: [function(e, t, i) {
  29837. "use strict";
  29838. var l = e("./easing");
  29839. window.transitions = t.exports = {
  29840. globalDone: null,
  29841. funcs: [],
  29842. counter: 0,
  29843. uniqueID: 0,
  29844. start: function(e, t, i, n, r, o, a) {
  29845. return n = n || 0,
  29846. this.funcs.push({
  29847. func: e,
  29848. current: -n * Math.abs(t),
  29849. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29850. done: i,
  29851. easing: r || l.linearTween,
  29852. cycling: t < 0,
  29853. running: !0,
  29854. debug: n < 0,
  29855. name: o || "T" + this.counter,
  29856. id: void 0 === a ? this.counter : a,
  29857. paused: !1
  29858. }),
  29859. e(0, 16),
  29860. this.counter += 1,
  29861. e
  29862. },
  29863. trigger: function(e) {
  29864. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29865. , i = e.func || function() {}
  29866. , n = void 0 === e.duration ? 0 : e.duration;
  29867. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29868. var r = e.done || null
  29869. , o = e.easing || l.linearTween
  29870. , a = e.name || "R" + this.counter
  29871. , s = void 0 === e.id ? this.counter : e.id;
  29872. return this.start(i, n, r, t, o, a, s)
  29873. },
  29874. setTimeout: function(e, t, i) {
  29875. var n = void 0 === i ? this.counter : i;
  29876. return this.trigger({
  29877. done: e,
  29878. duration: void 0 === t ? 0 : t,
  29879. name: "O" + this.counter,
  29880. id: n
  29881. })
  29882. },
  29883. pause: function() {
  29884. this.paused = !0
  29885. },
  29886. resume: function() {
  29887. this.paused = !1
  29888. },
  29889. update: function(n) {
  29890. this.funcs.forEach(function(e) {
  29891. if (!(e.paused || (e.current += 1e3 * n,
  29892. e.current < 0)))
  29893. if (e.current >= e.duration && !e.cycling) {
  29894. var t = e.easing(1, 0, 1, 1);
  29895. e.func(t, 1e3 * n),
  29896. e.done && e.done(),
  29897. e.running = !1
  29898. } else {
  29899. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29900. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29901. e.running = !1)
  29902. }
  29903. });
  29904. var e = this.funcs.length;
  29905. this.funcs = this.funcs.filter(function(e) {
  29906. return e.running
  29907. });
  29908. var t = this.funcs.length;
  29909. if (0 < e && 0 === t && this.globalDone) {
  29910. var i = this.globalDone;
  29911. this.globalDone = null,
  29912. i()
  29913. }
  29914. },
  29915. adjustSpeed: function(e, t) {
  29916. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29917. var r = i[n];
  29918. r.duration /= t,
  29919. r.current /= t
  29920. }
  29921. },
  29922. getById: function(t) {
  29923. return this.funcs.filter(function(e) {
  29924. return t === e.id
  29925. })
  29926. },
  29927. get: function(e) {
  29928. for (var t = 0; t < this.funcs.length; t += 1)
  29929. if (this.funcs[t].func === e)
  29930. return this.funcs[t];
  29931. return null
  29932. },
  29933. isRunning: function(e) {
  29934. var t = this.get(e);
  29935. return null !== t && t.running
  29936. },
  29937. countActive: function() {
  29938. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29939. e += this.funcs[t].running;
  29940. return e
  29941. },
  29942. listActive: function() {
  29943. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29944. this.funcs[t].running && e.push(this.funcs[t].name);
  29945. return e
  29946. },
  29947. done: function(e) {
  29948. this.globalDone = e
  29949. },
  29950. cancelById: function(e) {
  29951. var t = void 0 === e ? 0 : e;
  29952. this.funcs = this.funcs.filter(function(e) {
  29953. return e.id !== t
  29954. })
  29955. },
  29956. cancel: function(t) {
  29957. this.funcs = this.funcs.filter(function(e) {
  29958. return e.func !== t
  29959. })
  29960. },
  29961. getUniqueId: function() {
  29962. return this.uniqueID -= 1,
  29963. this.uniqueID
  29964. }
  29965. }
  29966. }
  29967. , {
  29968. "./easing": 186
  29969. }],
  29970. 196: [function(e, t, i) {
  29971. function n(e) {
  29972. if (this.set = {},
  29973. this.infContains = function() {
  29974. return !0
  29975. }
  29976. ,
  29977. "object" == typeof e)
  29978. if (e instanceof Array)
  29979. for (var t = 0; t < e.length; t++)
  29980. this.set[e[t]] = !0;
  29981. else
  29982. this.set = e;
  29983. else if ("function" == typeof e)
  29984. this.infContains = e;
  29985. else if (void 0 !== e)
  29986. throw new Error("set must be either an array or an object.")
  29987. }
  29988. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29989. return !!this.set[e]
  29990. }
  29991. ,
  29992. n.prototype.add = function(e) {
  29993. if (1 == arguments.length)
  29994. this.set[e] = !0;
  29995. else
  29996. for (var t = 0; t < arguments.length; t++)
  29997. this.set[arguments[t]] = !0
  29998. }
  29999. ,
  30000. n.prototype.addAll = function(e) {
  30001. if ("object" != typeof e && !(e instanceof Array))
  30002. throw new Error("arr must be an array.");
  30003. for (var t = 0; t < e.length; t++)
  30004. this.add(e[t])
  30005. }
  30006. ,
  30007. n.prototype.delete = n.prototype.remove = function(e) {
  30008. if (1 == arguments.length)
  30009. delete this.set[e];
  30010. else
  30011. for (var t = 0; t < arguments.length; t++)
  30012. delete this.set[arguments[t]]
  30013. }
  30014. ,
  30015. n.prototype.clear = function() {
  30016. this.set = {}
  30017. }
  30018. ,
  30019. n.prototype.size = function() {
  30020. return Object.keys(this.set).length
  30021. }
  30022. ,
  30023. n.prototype.toString = function() {
  30024. return "{" + Object.keys(this.set).toString() + "}"
  30025. }
  30026. ,
  30027. n.prototype["*values"] = n.prototype.toArray = function() {
  30028. return void 0 === this.set ? [] : Object.keys(this.set)
  30029. }
  30030. }
  30031. , {}],
  30032. 197: [function(e, t, i) {}
  30033. , {}],
  30034. 198: [function(N, e, F) {
  30035. (function(e) {
  30036. "use strict";
  30037. function i() {
  30038. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30039. }
  30040. function o(e, t) {
  30041. if (i() < t)
  30042. throw new RangeError("Invalid typed array length");
  30043. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  30044. e.length = t),
  30045. e
  30046. }
  30047. function u(e, t, i) {
  30048. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  30049. return new u(e,t,i);
  30050. if ("number" != typeof e)
  30051. return n(this, e, t, i);
  30052. if ("string" == typeof t)
  30053. throw new Error("If encoding is specified then the first argument must be a string");
  30054. return a(this, e)
  30055. }
  30056. function n(e, t, i, n) {
  30057. if ("number" == typeof t)
  30058. throw new TypeError('"value" argument must not be a number');
  30059. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  30060. if (t.byteLength,
  30061. i < 0 || t.byteLength < i)
  30062. throw new RangeError("'offset' is out of bounds");
  30063. if (t.byteLength < i + (n || 0))
  30064. throw new RangeError("'length' is out of bounds");
  30065. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  30066. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  30067. e
  30068. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  30069. if ("string" == typeof i && "" !== i || (i = "utf8"),
  30070. !u.isEncoding(i))
  30071. throw new TypeError('"encoding" must be a valid string encoding');
  30072. var n = 0 | c(t, i)
  30073. , r = (e = o(e, n)).write(t, i);
  30074. return r !== n && (e = e.slice(0, r)),
  30075. e
  30076. }(e, t, i) : function(e, t) {
  30077. if (u.isBuffer(t)) {
  30078. var i = 0 | l(t.length);
  30079. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  30080. e
  30081. }
  30082. if (t) {
  30083. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  30084. return "number" != typeof t.length || function(e) {
  30085. return e != e
  30086. }(t.length) ? o(e, 0) : s(e, t);
  30087. if ("Buffer" === t.type && L(t.data))
  30088. return s(e, t.data)
  30089. }
  30090. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  30091. }(e, t)
  30092. }
  30093. function r(e) {
  30094. if ("number" != typeof e)
  30095. throw new TypeError('"size" argument must be a number');
  30096. if (e < 0)
  30097. throw new RangeError('"size" argument must not be negative')
  30098. }
  30099. function a(e, t) {
  30100. if (r(t),
  30101. e = o(e, t < 0 ? 0 : 0 | l(t)),
  30102. !u.TYPED_ARRAY_SUPPORT)
  30103. for (var i = 0; i < t; ++i)
  30104. e[i] = 0;
  30105. return e
  30106. }
  30107. function s(e, t) {
  30108. var i = t.length < 0 ? 0 : 0 | l(t.length);
  30109. e = o(e, i);
  30110. for (var n = 0; n < i; n += 1)
  30111. e[n] = 255 & t[n];
  30112. return e
  30113. }
  30114. function l(e) {
  30115. if (e >= i())
  30116. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  30117. return 0 | e
  30118. }
  30119. function c(e, t) {
  30120. if (u.isBuffer(e))
  30121. return e.length;
  30122. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  30123. return e.byteLength;
  30124. "string" != typeof e && (e = "" + e);
  30125. var i = e.length;
  30126. if (0 === i)
  30127. return 0;
  30128. for (var n = !1; ; )
  30129. switch (t) {
  30130. case "ascii":
  30131. case "latin1":
  30132. case "binary":
  30133. return i;
  30134. case "utf8":
  30135. case "utf-8":
  30136. case void 0:
  30137. return S(e).length;
  30138. case "ucs2":
  30139. case "ucs-2":
  30140. case "utf16le":
  30141. case "utf-16le":
  30142. return 2 * i;
  30143. case "hex":
  30144. return i >>> 1;
  30145. case "base64":
  30146. return M(e).length;
  30147. default:
  30148. if (n)
  30149. return S(e).length;
  30150. t = ("" + t).toLowerCase(),
  30151. n = !0
  30152. }
  30153. }
  30154. function h(e, t, i) {
  30155. var n = e[t];
  30156. e[t] = e[i],
  30157. e[i] = n
  30158. }
  30159. function d(e, t, i, n, r) {
  30160. if (0 === e.length)
  30161. return -1;
  30162. if ("string" == typeof i ? (n = i,
  30163. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  30164. i = +i,
  30165. isNaN(i) && (i = r ? 0 : e.length - 1),
  30166. i < 0 && (i = e.length + i),
  30167. i >= e.length) {
  30168. if (r)
  30169. return -1;
  30170. i = e.length - 1
  30171. } else if (i < 0) {
  30172. if (!r)
  30173. return -1;
  30174. i = 0
  30175. }
  30176. if ("string" == typeof t && (t = u.from(t, n)),
  30177. u.isBuffer(t))
  30178. return 0 === t.length ? -1 : p(e, t, i, n, r);
  30179. if ("number" == typeof t)
  30180. return t &= 255,
  30181. 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);
  30182. throw new TypeError("val must be string, number or Buffer")
  30183. }
  30184. function p(e, t, i, n, r) {
  30185. function o(e, t) {
  30186. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  30187. }
  30188. var a, s = 1, l = e.length, c = t.length;
  30189. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  30190. if (e.length < 2 || t.length < 2)
  30191. return -1;
  30192. l /= s = 2,
  30193. c /= 2,
  30194. i /= 2
  30195. }
  30196. if (r) {
  30197. var h = -1;
  30198. for (a = i; a < l; a++)
  30199. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  30200. if (-1 === h && (h = a),
  30201. a - h + 1 === c)
  30202. return h * s
  30203. } else
  30204. -1 !== h && (a -= a - h),
  30205. h = -1
  30206. } else
  30207. for (l < i + c && (i = l - c),
  30208. a = i; 0 <= a; a--) {
  30209. for (var u = !0, d = 0; d < c; d++)
  30210. if (o(e, a + d) !== o(t, d)) {
  30211. u = !1;
  30212. break
  30213. }
  30214. if (u)
  30215. return a
  30216. }
  30217. return -1
  30218. }
  30219. function g(e, t, i, n) {
  30220. i = Number(i) || 0;
  30221. var r = e.length - i;
  30222. n ? r < (n = Number(n)) && (n = r) : n = r;
  30223. var o = t.length;
  30224. if (o % 2 != 0)
  30225. throw new TypeError("Invalid hex string");
  30226. o / 2 < n && (n = o / 2);
  30227. for (var a = 0; a < n; ++a) {
  30228. var s = parseInt(t.substr(2 * a, 2), 16);
  30229. if (isNaN(s))
  30230. return a;
  30231. e[i + a] = s
  30232. }
  30233. return a
  30234. }
  30235. function m(e, t, i, n) {
  30236. return R(function(e) {
  30237. for (var t = [], i = 0; i < e.length; ++i)
  30238. t.push(255 & e.charCodeAt(i));
  30239. return t
  30240. }(t), e, i, n)
  30241. }
  30242. function f(e, t, i) {
  30243. i = Math.min(e.length, i);
  30244. for (var n = [], r = t; r < i; ) {
  30245. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  30246. if (r + u <= i)
  30247. switch (u) {
  30248. case 1:
  30249. c < 128 && (h = c);
  30250. break;
  30251. case 2:
  30252. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  30253. break;
  30254. case 3:
  30255. o = e[r + 1],
  30256. a = e[r + 2],
  30257. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  30258. break;
  30259. case 4:
  30260. o = e[r + 1],
  30261. a = e[r + 2],
  30262. s = e[r + 3],
  30263. 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))
  30264. }
  30265. null === h ? (h = 65533,
  30266. u = 1) : 65535 < h && (h -= 65536,
  30267. n.push(h >>> 10 & 1023 | 55296),
  30268. h = 56320 | 1023 & h),
  30269. n.push(h),
  30270. r += u
  30271. }
  30272. return function(e) {
  30273. var t = e.length;
  30274. if (t <= D)
  30275. return String.fromCharCode.apply(String, e);
  30276. for (var i = "", n = 0; n < t; )
  30277. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  30278. return i
  30279. }(n)
  30280. }
  30281. function v(e, t, i) {
  30282. var n = "";
  30283. i = Math.min(e.length, i);
  30284. for (var r = t; r < i; ++r)
  30285. n += String.fromCharCode(127 & e[r]);
  30286. return n
  30287. }
  30288. function y(e, t, i) {
  30289. var n = "";
  30290. i = Math.min(e.length, i);
  30291. for (var r = t; r < i; ++r)
  30292. n += String.fromCharCode(e[r]);
  30293. return n
  30294. }
  30295. function A(e, t, i) {
  30296. var n, r = e.length;
  30297. (!t || t < 0) && (t = 0),
  30298. (!i || i < 0 || r < i) && (i = r);
  30299. for (var o = "", a = t; a < i; ++a)
  30300. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  30301. return o
  30302. }
  30303. function C(e, t, i) {
  30304. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30305. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30306. return r
  30307. }
  30308. function I(e, t, i) {
  30309. if (e % 1 != 0 || e < 0)
  30310. throw new RangeError("offset is not uint");
  30311. if (i < e + t)
  30312. throw new RangeError("Trying to access beyond buffer length")
  30313. }
  30314. function E(e, t, i, n, r, o) {
  30315. if (!u.isBuffer(e))
  30316. throw new TypeError('"buffer" argument must be a Buffer instance');
  30317. if (r < t || t < o)
  30318. throw new RangeError('"value" argument is out of bounds');
  30319. if (i + n > e.length)
  30320. throw new RangeError("Index out of range")
  30321. }
  30322. function _(e, t, i, n) {
  30323. t < 0 && (t = 65535 + t + 1);
  30324. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30325. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30326. }
  30327. function b(e, t, i, n) {
  30328. t < 0 && (t = 4294967295 + t + 1);
  30329. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30330. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30331. }
  30332. function w(e, t, i, n) {
  30333. if (i + n > e.length)
  30334. throw new RangeError("Index out of range");
  30335. if (i < 0)
  30336. throw new RangeError("Index out of range")
  30337. }
  30338. function T(e, t, i, n, r) {
  30339. return r || w(e, 0, i, 4),
  30340. O.write(e, t, i, n, 23, 4),
  30341. i + 4
  30342. }
  30343. function x(e, t, i, n, r) {
  30344. return r || w(e, 0, i, 8),
  30345. O.write(e, t, i, n, 52, 8),
  30346. i + 8
  30347. }
  30348. function S(e, t) {
  30349. t = t || 1 / 0;
  30350. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30351. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  30352. if (!r) {
  30353. if (56319 < i) {
  30354. -1 < (t -= 3) && o.push(239, 191, 189);
  30355. continue
  30356. }
  30357. if (a + 1 === n) {
  30358. -1 < (t -= 3) && o.push(239, 191, 189);
  30359. continue
  30360. }
  30361. r = i;
  30362. continue
  30363. }
  30364. if (i < 56320) {
  30365. -1 < (t -= 3) && o.push(239, 191, 189),
  30366. r = i;
  30367. continue
  30368. }
  30369. i = 65536 + (r - 55296 << 10 | i - 56320)
  30370. } else
  30371. r && -1 < (t -= 3) && o.push(239, 191, 189);
  30372. if (r = null,
  30373. i < 128) {
  30374. if ((t -= 1) < 0)
  30375. break;
  30376. o.push(i)
  30377. } else if (i < 2048) {
  30378. if ((t -= 2) < 0)
  30379. break;
  30380. o.push(i >> 6 | 192, 63 & i | 128)
  30381. } else if (i < 65536) {
  30382. if ((t -= 3) < 0)
  30383. break;
  30384. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30385. } else {
  30386. if (!(i < 1114112))
  30387. throw new Error("Invalid code point");
  30388. if ((t -= 4) < 0)
  30389. break;
  30390. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30391. }
  30392. }
  30393. return o
  30394. }
  30395. function M(e) {
  30396. return P.toByteArray(function(e) {
  30397. if ((e = function(e) {
  30398. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30399. }(e).replace(t, "")).length < 2)
  30400. return "";
  30401. for (; e.length % 4 != 0; )
  30402. e += "=";
  30403. return e
  30404. }(e))
  30405. }
  30406. function R(e, t, i, n) {
  30407. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30408. t[r + i] = e[r];
  30409. return r
  30410. }
  30411. var P = N("base64-js")
  30412. , O = N("ieee754")
  30413. , L = N("isarray");
  30414. F.Buffer = u,
  30415. F.SlowBuffer = function(e) {
  30416. return +e != e && (e = 0),
  30417. u.alloc(+e)
  30418. }
  30419. ,
  30420. F.INSPECT_MAX_BYTES = 50,
  30421. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  30422. try {
  30423. var e = new Uint8Array(1);
  30424. return e.__proto__ = {
  30425. __proto__: Uint8Array.prototype,
  30426. foo: function() {
  30427. return 42
  30428. }
  30429. },
  30430. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30431. } catch (e) {
  30432. return !1
  30433. }
  30434. }(),
  30435. F.kMaxLength = i(),
  30436. u.poolSize = 8192,
  30437. u._augment = function(e) {
  30438. return e.__proto__ = u.prototype,
  30439. e
  30440. }
  30441. ,
  30442. u.from = function(e, t, i) {
  30443. return n(null, e, t, i)
  30444. }
  30445. ,
  30446. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  30447. u.__proto__ = Uint8Array,
  30448. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  30449. value: null,
  30450. configurable: !0
  30451. })),
  30452. u.alloc = function(e, t, i) {
  30453. return function(e, t, i, n) {
  30454. return r(t),
  30455. 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)
  30456. }(null, e, t, i)
  30457. }
  30458. ,
  30459. u.allocUnsafe = function(e) {
  30460. return a(null, e)
  30461. }
  30462. ,
  30463. u.allocUnsafeSlow = function(e) {
  30464. return a(null, e)
  30465. }
  30466. ,
  30467. u.isBuffer = function(e) {
  30468. return !(null == e || !e._isBuffer)
  30469. }
  30470. ,
  30471. u.compare = function(e, t) {
  30472. if (!u.isBuffer(e) || !u.isBuffer(t))
  30473. throw new TypeError("Arguments must be Buffers");
  30474. if (e === t)
  30475. return 0;
  30476. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30477. if (e[r] !== t[r]) {
  30478. i = e[r],
  30479. n = t[r];
  30480. break
  30481. }
  30482. return i < n ? -1 : n < i ? 1 : 0
  30483. }
  30484. ,
  30485. u.isEncoding = function(e) {
  30486. switch (String(e).toLowerCase()) {
  30487. case "hex":
  30488. case "utf8":
  30489. case "utf-8":
  30490. case "ascii":
  30491. case "latin1":
  30492. case "binary":
  30493. case "base64":
  30494. case "ucs2":
  30495. case "ucs-2":
  30496. case "utf16le":
  30497. case "utf-16le":
  30498. return !0;
  30499. default:
  30500. return !1
  30501. }
  30502. }
  30503. ,
  30504. u.concat = function(e, t) {
  30505. if (!L(e))
  30506. throw new TypeError('"list" argument must be an Array of Buffers');
  30507. if (0 === e.length)
  30508. return u.alloc(0);
  30509. var i;
  30510. if (void 0 === t)
  30511. for (i = t = 0; i < e.length; ++i)
  30512. t += e[i].length;
  30513. var n = u.allocUnsafe(t)
  30514. , r = 0;
  30515. for (i = 0; i < e.length; ++i) {
  30516. var o = e[i];
  30517. if (!u.isBuffer(o))
  30518. throw new TypeError('"list" argument must be an Array of Buffers');
  30519. o.copy(n, r),
  30520. r += o.length
  30521. }
  30522. return n
  30523. }
  30524. ,
  30525. u.byteLength = c,
  30526. u.prototype._isBuffer = !0,
  30527. u.prototype.swap16 = function() {
  30528. var e = this.length;
  30529. if (e % 2 != 0)
  30530. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30531. for (var t = 0; t < e; t += 2)
  30532. h(this, t, t + 1);
  30533. return this
  30534. }
  30535. ,
  30536. u.prototype.swap32 = function() {
  30537. var e = this.length;
  30538. if (e % 4 != 0)
  30539. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30540. for (var t = 0; t < e; t += 4)
  30541. h(this, t, t + 3),
  30542. h(this, t + 1, t + 2);
  30543. return this
  30544. }
  30545. ,
  30546. u.prototype.swap64 = function() {
  30547. var e = this.length;
  30548. if (e % 8 != 0)
  30549. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30550. for (var t = 0; t < e; t += 8)
  30551. h(this, t, t + 7),
  30552. h(this, t + 1, t + 6),
  30553. h(this, t + 2, t + 5),
  30554. h(this, t + 3, t + 4);
  30555. return this
  30556. }
  30557. ,
  30558. u.prototype.toString = function() {
  30559. var e = 0 | this.length;
  30560. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30561. var n, r, o, a = !1;
  30562. if ((void 0 === t || t < 0) && (t = 0),
  30563. t > this.length)
  30564. return "";
  30565. if ((void 0 === i || i > this.length) && (i = this.length),
  30566. i <= 0)
  30567. return "";
  30568. if ((i >>>= 0) <= (t >>>= 0))
  30569. return "";
  30570. for (e = e || "utf8"; ; )
  30571. switch (e) {
  30572. case "hex":
  30573. return A(this, t, i);
  30574. case "utf8":
  30575. case "utf-8":
  30576. return f(this, t, i);
  30577. case "ascii":
  30578. return v(this, t, i);
  30579. case "latin1":
  30580. case "binary":
  30581. return y(this, t, i);
  30582. case "base64":
  30583. return n = this,
  30584. o = i,
  30585. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30586. case "ucs2":
  30587. case "ucs-2":
  30588. case "utf16le":
  30589. case "utf-16le":
  30590. return C(this, t, i);
  30591. default:
  30592. if (a)
  30593. throw new TypeError("Unknown encoding: " + e);
  30594. e = (e + "").toLowerCase(),
  30595. a = !0
  30596. }
  30597. }
  30598. .apply(this, arguments)
  30599. }
  30600. ,
  30601. u.prototype.equals = function(e) {
  30602. if (!u.isBuffer(e))
  30603. throw new TypeError("Argument must be a Buffer");
  30604. return this === e || 0 === u.compare(this, e)
  30605. }
  30606. ,
  30607. u.prototype.inspect = function() {
  30608. var e = ""
  30609. , t = F.INSPECT_MAX_BYTES;
  30610. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30611. this.length > t && (e += " ... ")),
  30612. "<Buffer " + e + ">"
  30613. }
  30614. ,
  30615. u.prototype.compare = function(e, t, i, n, r) {
  30616. if (!u.isBuffer(e))
  30617. throw new TypeError("Argument must be a Buffer");
  30618. if (void 0 === t && (t = 0),
  30619. void 0 === i && (i = e ? e.length : 0),
  30620. void 0 === n && (n = 0),
  30621. void 0 === r && (r = this.length),
  30622. t < 0 || i > e.length || n < 0 || r > this.length)
  30623. throw new RangeError("out of range index");
  30624. if (r <= n && i <= t)
  30625. return 0;
  30626. if (r <= n)
  30627. return -1;
  30628. if (i <= t)
  30629. return 1;
  30630. if (this === e)
  30631. return 0;
  30632. 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)
  30633. if (l[h] !== c[h]) {
  30634. o = l[h],
  30635. a = c[h];
  30636. break
  30637. }
  30638. return o < a ? -1 : a < o ? 1 : 0
  30639. }
  30640. ,
  30641. u.prototype.includes = function(e, t, i) {
  30642. return -1 !== this.indexOf(e, t, i)
  30643. }
  30644. ,
  30645. u.prototype.indexOf = function(e, t, i) {
  30646. return d(this, e, t, i, !0)
  30647. }
  30648. ,
  30649. u.prototype.lastIndexOf = function(e, t, i) {
  30650. return d(this, e, t, i, !1)
  30651. }
  30652. ,
  30653. u.prototype.write = function(e, t, i, n) {
  30654. if (void 0 === t)
  30655. n = "utf8",
  30656. i = this.length,
  30657. t = 0;
  30658. else if (void 0 === i && "string" == typeof t)
  30659. n = t,
  30660. i = this.length,
  30661. t = 0;
  30662. else {
  30663. if (!isFinite(t))
  30664. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30665. t |= 0,
  30666. isFinite(i) ? (i |= 0,
  30667. void 0 === n && (n = "utf8")) : (n = i,
  30668. i = void 0)
  30669. }
  30670. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30671. if ((void 0 === i || p < i) && (i = p),
  30672. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30673. throw new RangeError("Attempt to write outside buffer bounds");
  30674. n = n || "utf8";
  30675. for (var f = !1; ; )
  30676. switch (n) {
  30677. case "hex":
  30678. return g(this, e, t, i);
  30679. case "utf8":
  30680. case "utf-8":
  30681. return u = t,
  30682. d = i,
  30683. R(S(e, (h = this).length - u), h, u, d);
  30684. case "ascii":
  30685. return m(this, e, t, i);
  30686. case "latin1":
  30687. case "binary":
  30688. return m(this, e, t, i);
  30689. case "base64":
  30690. return s = this,
  30691. l = t,
  30692. c = i,
  30693. R(M(e), s, l, c);
  30694. case "ucs2":
  30695. case "ucs-2":
  30696. case "utf16le":
  30697. case "utf-16le":
  30698. return o = t,
  30699. a = i,
  30700. R(function(e, t) {
  30701. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30702. i = e.charCodeAt(a),
  30703. n = i >> 8,
  30704. r = i % 256,
  30705. o.push(r),
  30706. o.push(n);
  30707. return o
  30708. }(e, (r = this).length - o), r, o, a);
  30709. default:
  30710. if (f)
  30711. throw new TypeError("Unknown encoding: " + n);
  30712. n = ("" + n).toLowerCase(),
  30713. f = !0
  30714. }
  30715. }
  30716. ,
  30717. u.prototype.toJSON = function() {
  30718. return {
  30719. type: "Buffer",
  30720. data: Array.prototype.slice.call(this._arr || this, 0)
  30721. }
  30722. }
  30723. ;
  30724. var D = 4096;
  30725. u.prototype.slice = function(e, t) {
  30726. var i, n = this.length;
  30727. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30728. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30729. t < e && (t = e),
  30730. u.TYPED_ARRAY_SUPPORT)
  30731. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30732. else {
  30733. var r = t - e;
  30734. i = new u(r,void 0);
  30735. for (var o = 0; o < r; ++o)
  30736. i[o] = this[o + e]
  30737. }
  30738. return i
  30739. }
  30740. ,
  30741. u.prototype.readUIntLE = function(e, t, i) {
  30742. e |= 0,
  30743. t |= 0,
  30744. i || I(e, t, this.length);
  30745. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30746. n += this[e + o] * r;
  30747. return n
  30748. }
  30749. ,
  30750. u.prototype.readUIntBE = function(e, t, i) {
  30751. e |= 0,
  30752. t |= 0,
  30753. i || I(e, t, this.length);
  30754. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30755. n += this[e + --t] * r;
  30756. return n
  30757. }
  30758. ,
  30759. u.prototype.readUInt8 = function(e, t) {
  30760. return t || I(e, 1, this.length),
  30761. this[e]
  30762. }
  30763. ,
  30764. u.prototype.readUInt16LE = function(e, t) {
  30765. return t || I(e, 2, this.length),
  30766. this[e] | this[e + 1] << 8
  30767. }
  30768. ,
  30769. u.prototype.readUInt16BE = function(e, t) {
  30770. return t || I(e, 2, this.length),
  30771. this[e] << 8 | this[e + 1]
  30772. }
  30773. ,
  30774. u.prototype.readUInt32LE = function(e, t) {
  30775. return t || I(e, 4, this.length),
  30776. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30777. }
  30778. ,
  30779. u.prototype.readUInt32BE = function(e, t) {
  30780. return t || I(e, 4, this.length),
  30781. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30782. }
  30783. ,
  30784. u.prototype.readIntLE = function(e, t, i) {
  30785. e |= 0,
  30786. t |= 0,
  30787. i || I(e, t, this.length);
  30788. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30789. n += this[e + o] * r;
  30790. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30791. n
  30792. }
  30793. ,
  30794. u.prototype.readIntBE = function(e, t, i) {
  30795. e |= 0,
  30796. t |= 0,
  30797. i || I(e, t, this.length);
  30798. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30799. o += this[e + --n] * r;
  30800. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30801. o
  30802. }
  30803. ,
  30804. u.prototype.readInt8 = function(e, t) {
  30805. return t || I(e, 1, this.length),
  30806. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30807. }
  30808. ,
  30809. u.prototype.readInt16LE = function(e, t) {
  30810. t || I(e, 2, this.length);
  30811. var i = this[e] | this[e + 1] << 8;
  30812. return 32768 & i ? 4294901760 | i : i
  30813. }
  30814. ,
  30815. u.prototype.readInt16BE = function(e, t) {
  30816. t || I(e, 2, this.length);
  30817. var i = this[e + 1] | this[e] << 8;
  30818. return 32768 & i ? 4294901760 | i : i
  30819. }
  30820. ,
  30821. u.prototype.readInt32LE = function(e, t) {
  30822. return t || I(e, 4, this.length),
  30823. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30824. }
  30825. ,
  30826. u.prototype.readInt32BE = function(e, t) {
  30827. return t || I(e, 4, this.length),
  30828. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30829. }
  30830. ,
  30831. u.prototype.readFloatLE = function(e, t) {
  30832. return t || I(e, 4, this.length),
  30833. O.read(this, e, !0, 23, 4)
  30834. }
  30835. ,
  30836. u.prototype.readFloatBE = function(e, t) {
  30837. return t || I(e, 4, this.length),
  30838. O.read(this, e, !1, 23, 4)
  30839. }
  30840. ,
  30841. u.prototype.readDoubleLE = function(e, t) {
  30842. return t || I(e, 8, this.length),
  30843. O.read(this, e, !0, 52, 8)
  30844. }
  30845. ,
  30846. u.prototype.readDoubleBE = function(e, t) {
  30847. return t || I(e, 8, this.length),
  30848. O.read(this, e, !1, 52, 8)
  30849. }
  30850. ,
  30851. u.prototype.writeUIntLE = function(e, t, i, n) {
  30852. e = +e,
  30853. t |= 0,
  30854. i |= 0,
  30855. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30856. var r = 1
  30857. , o = 0;
  30858. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30859. this[t + o] = e / r & 255;
  30860. return t + i
  30861. }
  30862. ,
  30863. u.prototype.writeUIntBE = function(e, t, i, n) {
  30864. e = +e,
  30865. t |= 0,
  30866. i |= 0,
  30867. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30868. var r = i - 1
  30869. , o = 1;
  30870. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30871. this[t + r] = e / o & 255;
  30872. return t + i
  30873. }
  30874. ,
  30875. u.prototype.writeUInt8 = function(e, t, i) {
  30876. return e = +e,
  30877. t |= 0,
  30878. i || E(this, e, t, 1, 255, 0),
  30879. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30880. this[t] = 255 & e,
  30881. t + 1
  30882. }
  30883. ,
  30884. u.prototype.writeUInt16LE = function(e, t, i) {
  30885. return e = +e,
  30886. t |= 0,
  30887. i || E(this, e, t, 2, 65535, 0),
  30888. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30889. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30890. t + 2
  30891. }
  30892. ,
  30893. u.prototype.writeUInt16BE = function(e, t, i) {
  30894. return e = +e,
  30895. t |= 0,
  30896. i || E(this, e, t, 2, 65535, 0),
  30897. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30898. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30899. t + 2
  30900. }
  30901. ,
  30902. u.prototype.writeUInt32LE = function(e, t, i) {
  30903. return e = +e,
  30904. t |= 0,
  30905. i || E(this, e, t, 4, 4294967295, 0),
  30906. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30907. this[t + 2] = e >>> 16,
  30908. this[t + 1] = e >>> 8,
  30909. this[t] = 255 & e) : b(this, e, t, !0),
  30910. t + 4
  30911. }
  30912. ,
  30913. u.prototype.writeUInt32BE = function(e, t, i) {
  30914. return e = +e,
  30915. t |= 0,
  30916. i || E(this, e, t, 4, 4294967295, 0),
  30917. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30918. this[t + 1] = e >>> 16,
  30919. this[t + 2] = e >>> 8,
  30920. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30921. t + 4
  30922. }
  30923. ,
  30924. u.prototype.writeIntLE = function(e, t, i, n) {
  30925. if (e = +e,
  30926. t |= 0,
  30927. !n) {
  30928. var r = Math.pow(2, 8 * i - 1);
  30929. E(this, e, t, i, r - 1, -r)
  30930. }
  30931. var o = 0
  30932. , a = 1
  30933. , s = 0;
  30934. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30935. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30936. this[t + o] = (e / a >> 0) - s & 255;
  30937. return t + i
  30938. }
  30939. ,
  30940. u.prototype.writeIntBE = function(e, t, i, n) {
  30941. if (e = +e,
  30942. t |= 0,
  30943. !n) {
  30944. var r = Math.pow(2, 8 * i - 1);
  30945. E(this, e, t, i, r - 1, -r)
  30946. }
  30947. var o = i - 1
  30948. , a = 1
  30949. , s = 0;
  30950. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30951. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30952. this[t + o] = (e / a >> 0) - s & 255;
  30953. return t + i
  30954. }
  30955. ,
  30956. u.prototype.writeInt8 = function(e, t, i) {
  30957. return e = +e,
  30958. t |= 0,
  30959. i || E(this, e, t, 1, 127, -128),
  30960. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30961. e < 0 && (e = 255 + e + 1),
  30962. this[t] = 255 & e,
  30963. t + 1
  30964. }
  30965. ,
  30966. u.prototype.writeInt16LE = function(e, t, i) {
  30967. return e = +e,
  30968. t |= 0,
  30969. i || E(this, e, t, 2, 32767, -32768),
  30970. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30971. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30972. t + 2
  30973. }
  30974. ,
  30975. u.prototype.writeInt16BE = function(e, t, i) {
  30976. return e = +e,
  30977. t |= 0,
  30978. i || E(this, e, t, 2, 32767, -32768),
  30979. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30980. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30981. t + 2
  30982. }
  30983. ,
  30984. u.prototype.writeInt32LE = function(e, t, i) {
  30985. return e = +e,
  30986. t |= 0,
  30987. i || E(this, e, t, 4, 2147483647, -2147483648),
  30988. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30989. this[t + 1] = e >>> 8,
  30990. this[t + 2] = e >>> 16,
  30991. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30992. t + 4
  30993. }
  30994. ,
  30995. u.prototype.writeInt32BE = function(e, t, i) {
  30996. return e = +e,
  30997. t |= 0,
  30998. i || E(this, e, t, 4, 2147483647, -2147483648),
  30999. e < 0 && (e = 4294967295 + e + 1),
  31000. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31001. this[t + 1] = e >>> 16,
  31002. this[t + 2] = e >>> 8,
  31003. this[t + 3] = 255 & e) : b(this, e, t, !1),
  31004. t + 4
  31005. }
  31006. ,
  31007. u.prototype.writeFloatLE = function(e, t, i) {
  31008. return T(this, e, t, !0, i)
  31009. }
  31010. ,
  31011. u.prototype.writeFloatBE = function(e, t, i) {
  31012. return T(this, e, t, !1, i)
  31013. }
  31014. ,
  31015. u.prototype.writeDoubleLE = function(e, t, i) {
  31016. return x(this, e, t, !0, i)
  31017. }
  31018. ,
  31019. u.prototype.writeDoubleBE = function(e, t, i) {
  31020. return x(this, e, t, !1, i)
  31021. }
  31022. ,
  31023. u.prototype.copy = function(e, t, i, n) {
  31024. if (i = i || 0,
  31025. n || 0 === n || (n = this.length),
  31026. t >= e.length && (t = e.length),
  31027. t = t || 0,
  31028. 0 < n && n < i && (n = i),
  31029. n === i)
  31030. return 0;
  31031. if (0 === e.length || 0 === this.length)
  31032. return 0;
  31033. if (t < 0)
  31034. throw new RangeError("targetStart out of bounds");
  31035. if (i < 0 || i >= this.length)
  31036. throw new RangeError("sourceStart out of bounds");
  31037. if (n < 0)
  31038. throw new RangeError("sourceEnd out of bounds");
  31039. n > this.length && (n = this.length),
  31040. e.length - t < n - i && (n = e.length - t + i);
  31041. var r, o = n - i;
  31042. if (this === e && i < t && t < n)
  31043. for (r = o - 1; 0 <= r; --r)
  31044. e[r + t] = this[r + i];
  31045. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  31046. for (r = 0; r < o; ++r)
  31047. e[r + t] = this[r + i];
  31048. else
  31049. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  31050. return o
  31051. }
  31052. ,
  31053. u.prototype.fill = function(e, t, i, n) {
  31054. if ("string" == typeof e) {
  31055. if ("string" == typeof t ? (n = t,
  31056. t = 0,
  31057. i = this.length) : "string" == typeof i && (n = i,
  31058. i = this.length),
  31059. 1 === e.length) {
  31060. var r = e.charCodeAt(0);
  31061. r < 256 && (e = r)
  31062. }
  31063. if (void 0 !== n && "string" != typeof n)
  31064. throw new TypeError("encoding must be a string");
  31065. if ("string" == typeof n && !u.isEncoding(n))
  31066. throw new TypeError("Unknown encoding: " + n)
  31067. } else
  31068. "number" == typeof e && (e &= 255);
  31069. if (t < 0 || this.length < t || this.length < i)
  31070. throw new RangeError("Out of range index");
  31071. if (i <= t)
  31072. return this;
  31073. var o;
  31074. if (t >>>= 0,
  31075. i = void 0 === i ? this.length : i >>> 0,
  31076. "number" == typeof (e = e || 0))
  31077. for (o = t; o < i; ++o)
  31078. this[o] = e;
  31079. else {
  31080. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  31081. , s = a.length;
  31082. for (o = 0; o < i - t; ++o)
  31083. this[o + t] = a[o % s]
  31084. }
  31085. return this
  31086. }
  31087. ;
  31088. var t = /[^+\/0-9A-Za-z-_]/g
  31089. }
  31090. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31091. }
  31092. , {
  31093. "base64-js": 199,
  31094. ieee754: 200,
  31095. isarray: 201
  31096. }],
  31097. 199: [function(e, t, i) {
  31098. "use strict";
  31099. function l(e) {
  31100. var t = e.length;
  31101. if (0 < t % 4)
  31102. throw new Error("Invalid string. Length must be a multiple of 4");
  31103. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  31104. }
  31105. function c(e, t, i) {
  31106. for (var n, r = [], o = t; o < i; o += 3)
  31107. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  31108. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  31109. var a;
  31110. return r.join("")
  31111. }
  31112. i.byteLength = function(e) {
  31113. return 3 * e.length / 4 - l(e)
  31114. }
  31115. ,
  31116. i.toByteArray = function(e) {
  31117. var t, i, n, r, o, a = e.length;
  31118. r = l(e),
  31119. o = new d(3 * a / 4 - r),
  31120. i = 0 < r ? a - 4 : a;
  31121. var s = 0;
  31122. for (t = 0; t < i; t += 4,
  31123. 3)
  31124. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  31125. o[s++] = n >> 16 & 255,
  31126. o[s++] = n >> 8 & 255,
  31127. o[s++] = 255 & n;
  31128. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  31129. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  31130. o[s++] = n >> 8 & 255,
  31131. o[s++] = 255 & n),
  31132. o
  31133. }
  31134. ,
  31135. i.fromByteArray = function(e) {
  31136. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  31137. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  31138. return 1 == n ? (t = e[i - 1],
  31139. r += h[t >> 2],
  31140. r += h[t << 4 & 63],
  31141. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  31142. r += h[t >> 10],
  31143. r += h[t >> 4 & 63],
  31144. r += h[t << 2 & 63],
  31145. r += "="),
  31146. o.push(r),
  31147. o.join("")
  31148. }
  31149. ;
  31150. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  31151. h[r] = n[r],
  31152. u[n.charCodeAt(r)] = r;
  31153. u["-".charCodeAt(0)] = 62,
  31154. u["_".charCodeAt(0)] = 63
  31155. }
  31156. , {}],
  31157. 200: [function(e, t, i) {
  31158. i.read = function(e, t, i, n, r) {
  31159. 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];
  31160. for (u += d,
  31161. o = p & (1 << -h) - 1,
  31162. p >>= -h,
  31163. h += s; 0 < h; o = 256 * o + e[t + u],
  31164. u += d,
  31165. h -= 8)
  31166. ;
  31167. for (a = o & (1 << -h) - 1,
  31168. o >>= -h,
  31169. h += n; 0 < h; a = 256 * a + e[t + u],
  31170. u += d,
  31171. h -= 8)
  31172. ;
  31173. if (0 === o)
  31174. o = 1 - c;
  31175. else {
  31176. if (o === l)
  31177. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  31178. a += Math.pow(2, n),
  31179. o -= c
  31180. }
  31181. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  31182. }
  31183. ,
  31184. i.write = function(e, t, i, n, r, o) {
  31185. 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;
  31186. for (t = Math.abs(t),
  31187. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  31188. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  31189. t * (l = Math.pow(2, -a)) < 1 && (a--,
  31190. l *= 2),
  31191. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  31192. l /= 2),
  31193. h <= a + u ? (s = 0,
  31194. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  31195. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31196. a = 0)); 8 <= r; e[i + p] = 255 & s,
  31197. p += f,
  31198. s /= 256,
  31199. r -= 8)
  31200. ;
  31201. for (a = a << r | s,
  31202. c += r; 0 < c; e[i + p] = 255 & a,
  31203. p += f,
  31204. a /= 256,
  31205. c -= 8)
  31206. ;
  31207. e[i + p - f] |= 128 * g
  31208. }
  31209. }
  31210. , {}],
  31211. 201: [function(e, t, i) {
  31212. var n = {}.toString;
  31213. t.exports = Array.isArray || function(e) {
  31214. return "[object Array]" == n.call(e)
  31215. }
  31216. }
  31217. , {}],
  31218. 202: [function(e, t, i) {
  31219. function n() {
  31220. this._events = this._events || {},
  31221. this._maxListeners = this._maxListeners || void 0
  31222. }
  31223. function l(e) {
  31224. return "function" == typeof e
  31225. }
  31226. function c(e) {
  31227. return "object" == typeof e && null !== e
  31228. }
  31229. function h(e) {
  31230. return void 0 === e
  31231. }
  31232. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  31233. n.prototype._maxListeners = void 0,
  31234. n.defaultMaxListeners = 10,
  31235. n.prototype.setMaxListeners = function(e) {
  31236. if (!function(e) {
  31237. return "number" == typeof e
  31238. }(e) || e < 0 || isNaN(e))
  31239. throw TypeError("n must be a positive number");
  31240. return this._maxListeners = e,
  31241. this
  31242. }
  31243. ,
  31244. n.prototype.emit = function(e) {
  31245. var t, i, n, r, o, a;
  31246. if (this._events || (this._events = {}),
  31247. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  31248. if ((t = arguments[1])instanceof Error)
  31249. throw t;
  31250. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31251. throw s.context = t,
  31252. s
  31253. }
  31254. if (h(i = this._events[e]))
  31255. return !1;
  31256. if (l(i))
  31257. switch (arguments.length) {
  31258. case 1:
  31259. i.call(this);
  31260. break;
  31261. case 2:
  31262. i.call(this, arguments[1]);
  31263. break;
  31264. case 3:
  31265. i.call(this, arguments[1], arguments[2]);
  31266. break;
  31267. default:
  31268. r = Array.prototype.slice.call(arguments, 1),
  31269. i.apply(this, r)
  31270. }
  31271. else if (c(i))
  31272. for (r = Array.prototype.slice.call(arguments, 1),
  31273. n = (a = i.slice()).length,
  31274. o = 0; o < n; o++)
  31275. a[o].apply(this, r);
  31276. return !0
  31277. }
  31278. ,
  31279. n.prototype.on = n.prototype.addListener = function(e, t) {
  31280. var i;
  31281. if (!l(t))
  31282. throw TypeError("listener must be a function");
  31283. return this._events || (this._events = {}),
  31284. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  31285. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31286. 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,
  31287. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31288. "function" == typeof console.trace && console.trace())),
  31289. this
  31290. }
  31291. ,
  31292. n.prototype.once = function(e, t) {
  31293. function i() {
  31294. this.removeListener(e, i),
  31295. n || (n = !0,
  31296. t.apply(this, arguments))
  31297. }
  31298. if (!l(t))
  31299. throw TypeError("listener must be a function");
  31300. var n = !1;
  31301. return i.listener = t,
  31302. this.on(e, i),
  31303. this
  31304. }
  31305. ,
  31306. n.prototype.removeListener = function(e, t) {
  31307. var i, n, r, o;
  31308. if (!l(t))
  31309. throw TypeError("listener must be a function");
  31310. if (!this._events || !this._events[e])
  31311. return this;
  31312. if (r = (i = this._events[e]).length,
  31313. n = -1,
  31314. i === t || l(i.listener) && i.listener === t)
  31315. delete this._events[e],
  31316. this._events.removeListener && this.emit("removeListener", e, t);
  31317. else if (c(i)) {
  31318. for (o = r; 0 < o--; )
  31319. if (i[o] === t || i[o].listener && i[o].listener === t) {
  31320. n = o;
  31321. break
  31322. }
  31323. if (n < 0)
  31324. return this;
  31325. 1 === i.length ? (i.length = 0,
  31326. delete this._events[e]) : i.splice(n, 1),
  31327. this._events.removeListener && this.emit("removeListener", e, t)
  31328. }
  31329. return this
  31330. }
  31331. ,
  31332. n.prototype.removeAllListeners = function(e) {
  31333. var t, i;
  31334. if (!this._events)
  31335. return this;
  31336. if (!this._events.removeListener)
  31337. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31338. this;
  31339. if (0 === arguments.length) {
  31340. for (t in this._events)
  31341. "removeListener" !== t && this.removeAllListeners(t);
  31342. return this.removeAllListeners("removeListener"),
  31343. this._events = {},
  31344. this
  31345. }
  31346. if (l(i = this._events[e]))
  31347. this.removeListener(e, i);
  31348. else if (i)
  31349. for (; i.length; )
  31350. this.removeListener(e, i[i.length - 1]);
  31351. return delete this._events[e],
  31352. this
  31353. }
  31354. ,
  31355. n.prototype.listeners = function(e) {
  31356. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31357. }
  31358. ,
  31359. n.prototype.listenerCount = function(e) {
  31360. if (this._events) {
  31361. var t = this._events[e];
  31362. if (l(t))
  31363. return 1;
  31364. if (t)
  31365. return t.length
  31366. }
  31367. return 0
  31368. }
  31369. ,
  31370. n.listenerCount = function(e, t) {
  31371. return e.listenerCount(t)
  31372. }
  31373. }
  31374. , {}],
  31375. 203: [function(e, t, i) {
  31376. function n() {
  31377. throw new Error("setTimeout has not been defined")
  31378. }
  31379. function r() {
  31380. throw new Error("clearTimeout has not been defined")
  31381. }
  31382. function o(t) {
  31383. if (h === setTimeout)
  31384. return setTimeout(t, 0);
  31385. if ((h === n || !h) && setTimeout)
  31386. return h = setTimeout,
  31387. setTimeout(t, 0);
  31388. try {
  31389. return h(t, 0)
  31390. } catch (e) {
  31391. try {
  31392. return h.call(null, t, 0)
  31393. } catch (e) {
  31394. return h.call(this, t, 0)
  31395. }
  31396. }
  31397. }
  31398. function a() {
  31399. g && p && (g = !1,
  31400. p.length ? f = p.concat(f) : m = -1,
  31401. f.length && s())
  31402. }
  31403. function s() {
  31404. if (!g) {
  31405. var e = o(a);
  31406. g = !0;
  31407. for (var t = f.length; t; ) {
  31408. for (p = f,
  31409. f = []; ++m < t; )
  31410. p && p[m].run();
  31411. m = -1,
  31412. t = f.length
  31413. }
  31414. p = null,
  31415. g = !1,
  31416. function(t) {
  31417. if (u === clearTimeout)
  31418. return clearTimeout(t);
  31419. if ((u === r || !u) && clearTimeout)
  31420. return u = clearTimeout,
  31421. clearTimeout(t);
  31422. try {
  31423. u(t)
  31424. } catch (e) {
  31425. try {
  31426. return u.call(null, t)
  31427. } catch (e) {
  31428. return u.call(this, t)
  31429. }
  31430. }
  31431. }(e)
  31432. }
  31433. }
  31434. function l(e, t) {
  31435. this.fun = e,
  31436. this.array = t
  31437. }
  31438. function c() {}
  31439. var h, u, d = t.exports = {};
  31440. !function() {
  31441. try {
  31442. h = "function" == typeof setTimeout ? setTimeout : n
  31443. } catch (e) {
  31444. h = n
  31445. }
  31446. try {
  31447. u = "function" == typeof clearTimeout ? clearTimeout : r
  31448. } catch (e) {
  31449. u = r
  31450. }
  31451. }();
  31452. var p, f = [], g = !1, m = -1;
  31453. d.nextTick = function(e) {
  31454. var t = new Array(arguments.length - 1);
  31455. if (1 < arguments.length)
  31456. for (var i = 1; i < arguments.length; i++)
  31457. t[i - 1] = arguments[i];
  31458. f.push(new l(e,t)),
  31459. 1 !== f.length || g || o(s)
  31460. }
  31461. ,
  31462. l.prototype.run = function() {
  31463. this.fun.apply(null, this.array)
  31464. }
  31465. ,
  31466. d.title = "browser",
  31467. d.browser = !0,
  31468. d.env = {},
  31469. d.argv = [],
  31470. d.version = "",
  31471. d.versions = {},
  31472. d.on = c,
  31473. d.addListener = c,
  31474. d.once = c,
  31475. d.off = c,
  31476. d.removeListener = c,
  31477. d.removeAllListeners = c,
  31478. d.emit = c,
  31479. d.binding = function(e) {
  31480. throw new Error("process.binding is not supported")
  31481. }
  31482. ,
  31483. d.cwd = function() {
  31484. return "/"
  31485. }
  31486. ,
  31487. d.chdir = function(e) {
  31488. throw new Error("process.chdir is not supported")
  31489. }
  31490. ,
  31491. d.umask = function() {
  31492. return 0
  31493. }
  31494. }
  31495. , {}],
  31496. 204: [function(e, O, L) {
  31497. (function(P) {
  31498. !function(e) {
  31499. function v(e) {
  31500. throw new RangeError(g[e])
  31501. }
  31502. function r(e, t) {
  31503. for (var i = e.length, n = []; i--; )
  31504. n[i] = t(e[i]);
  31505. return n
  31506. }
  31507. function t(e, t) {
  31508. var i = e.split("@")
  31509. , n = "";
  31510. return 1 < i.length && (n = i[0] + "@",
  31511. e = i[1]),
  31512. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31513. }
  31514. function y(e) {
  31515. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31516. 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),
  31517. r--) : n.push(t);
  31518. return n
  31519. }
  31520. function A(e) {
  31521. return r(e, function(e) {
  31522. var t = "";
  31523. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31524. e = 56320 | 1023 & e),
  31525. t + R(e)
  31526. }).join("")
  31527. }
  31528. function C(e, t) {
  31529. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31530. }
  31531. function I(e, t, i) {
  31532. var n = 0;
  31533. for (e = i ? M(e / u) : e >> 1,
  31534. e += M(e / t); m * w >> 1 < e; n += _)
  31535. e = M(e / m);
  31536. return M(n + (m + 1) * e / (e + h))
  31537. }
  31538. function i(e) {
  31539. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31540. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31541. n = 0; n < i; ++n)
  31542. 128 <= e.charCodeAt(n) && v("not-basic"),
  31543. d.push(e.charCodeAt(n));
  31544. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31545. for (o = f,
  31546. a = 1,
  31547. s = _; p <= r && v("invalid-input"),
  31548. u = e.charCodeAt(r++),
  31549. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31550. f += l * a,
  31551. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31552. a > M(E / (h = _ - c)) && v("overflow"),
  31553. a *= h;
  31554. m = I(f - o, t = d.length + 1, 0 == o),
  31555. M(f / t) > E - g && v("overflow"),
  31556. g += M(f / t),
  31557. f %= t,
  31558. d.splice(f++, 0, g)
  31559. }
  31560. return A(d)
  31561. }
  31562. function n(e) {
  31563. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31564. for (d = (e = y(e)).length,
  31565. t = x,
  31566. o = T,
  31567. a = i = 0; a < d; ++a)
  31568. (u = e[a]) < 128 && m.push(R(u));
  31569. for (n = r = m.length,
  31570. r && m.push(S); n < d; ) {
  31571. for (s = E,
  31572. a = 0; a < d; ++a)
  31573. t <= (u = e[a]) && u < s && (s = u);
  31574. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31575. i += (s - t) * p,
  31576. t = s,
  31577. a = 0; a < d; ++a)
  31578. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31579. u == t) {
  31580. for (l = i,
  31581. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31582. g = l - h,
  31583. f = _ - h,
  31584. m.push(R(C(h + g % f, 0))),
  31585. l = M(g / f);
  31586. m.push(R(C(l, 0))),
  31587. o = I(i, p, n == r),
  31588. i = 0,
  31589. ++n
  31590. }
  31591. ++i,
  31592. ++t
  31593. }
  31594. return m.join("")
  31595. }
  31596. var o = "object" == typeof L && L && !L.nodeType && L
  31597. , a = "object" == typeof O && O && !O.nodeType && O
  31598. , s = "object" == typeof P && P;
  31599. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31600. 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 = {
  31601. overflow: "Overflow: input needs wider integers to process",
  31602. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31603. "invalid-input": "Invalid input"
  31604. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31605. if (l = {
  31606. version: "1.4.1",
  31607. ucs2: {
  31608. decode: y,
  31609. encode: A
  31610. },
  31611. decode: i,
  31612. encode: n,
  31613. toASCII: function(e) {
  31614. return t(e, function(e) {
  31615. return p.test(e) ? "xn--" + n(e) : e
  31616. })
  31617. },
  31618. toUnicode: function(e) {
  31619. return t(e, function(e) {
  31620. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31621. })
  31622. }
  31623. },
  31624. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31625. define("punycode", function() {
  31626. return l
  31627. });
  31628. else if (o && a)
  31629. if (O.exports == o)
  31630. a.exports = l;
  31631. else
  31632. for (c in l)
  31633. l.hasOwnProperty(c) && (o[c] = l[c]);
  31634. else
  31635. e.punycode = l
  31636. }(this)
  31637. }
  31638. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31639. }
  31640. , {}],
  31641. 205: [function(e, t, i) {
  31642. "use strict";
  31643. t.exports = function(e, t, i, n) {
  31644. t = t || "&",
  31645. i = i || "=";
  31646. var r = {};
  31647. if ("string" != typeof e || 0 === e.length)
  31648. return r;
  31649. var o = /\+/g;
  31650. e = e.split(t);
  31651. var a = 1e3;
  31652. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31653. var s, l, c = e.length;
  31654. 0 < a && a < c && (c = a);
  31655. for (var h = 0; h < c; ++h) {
  31656. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31657. d = 0 <= m ? (u = g.substr(0, m),
  31658. g.substr(m + 1)) : (u = g,
  31659. ""),
  31660. p = decodeURIComponent(u),
  31661. f = decodeURIComponent(d),
  31662. s = r,
  31663. l = p,
  31664. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31665. }
  31666. return r
  31667. }
  31668. ;
  31669. var v = Array.isArray || function(e) {
  31670. return "[object Array]" === Object.prototype.toString.call(e)
  31671. }
  31672. }
  31673. , {}],
  31674. 206: [function(e, t, i) {
  31675. "use strict";
  31676. function o(e, t) {
  31677. if (e.map)
  31678. return e.map(t);
  31679. for (var i = [], n = 0; n < e.length; n++)
  31680. i.push(t(e[n], n));
  31681. return i
  31682. }
  31683. function a(e) {
  31684. switch (typeof e) {
  31685. case "string":
  31686. return e;
  31687. case "boolean":
  31688. return e ? "true" : "false";
  31689. case "number":
  31690. return isFinite(e) ? e : "";
  31691. default:
  31692. return ""
  31693. }
  31694. }
  31695. t.exports = function(i, n, r, e) {
  31696. return n = n || "&",
  31697. r = r || "=",
  31698. null === i && (i = void 0),
  31699. "object" == typeof i ? o(l(i), function(e) {
  31700. var t = encodeURIComponent(a(e)) + r;
  31701. return s(i[e]) ? o(i[e], function(e) {
  31702. return t + encodeURIComponent(a(e))
  31703. }).join(n) : t + encodeURIComponent(a(i[e]))
  31704. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31705. }
  31706. ;
  31707. var s = Array.isArray || function(e) {
  31708. return "[object Array]" === Object.prototype.toString.call(e)
  31709. }
  31710. , l = Object.keys || function(e) {
  31711. var t = [];
  31712. for (var i in e)
  31713. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31714. return t
  31715. }
  31716. }
  31717. , {}],
  31718. 207: [function(e, t, i) {
  31719. "use strict";
  31720. i.decode = i.parse = e("./decode"),
  31721. i.encode = i.stringify = e("./encode")
  31722. }
  31723. , {
  31724. "./decode": 205,
  31725. "./encode": 206
  31726. }],
  31727. 208: [function(e, t, i) {
  31728. "use strict";
  31729. function x() {
  31730. this.protocol = null,
  31731. this.slashes = null,
  31732. this.auth = null,
  31733. this.host = null,
  31734. this.port = null,
  31735. this.hostname = null,
  31736. this.hash = null,
  31737. this.search = null,
  31738. this.query = null,
  31739. this.pathname = null,
  31740. this.path = null,
  31741. this.href = null
  31742. }
  31743. function n(e, t, i) {
  31744. if (e && D.isObject(e) && e instanceof x)
  31745. return e;
  31746. var n = new x;
  31747. return n.parse(e, t, i),
  31748. n
  31749. }
  31750. var L = e("punycode")
  31751. , D = e("./util");
  31752. i.parse = n,
  31753. i.resolve = function(e, t) {
  31754. return n(e, !1, !0).resolve(t)
  31755. }
  31756. ,
  31757. i.resolveObject = function(e, t) {
  31758. return e ? n(e, !1, !0).resolveObject(t) : t
  31759. }
  31760. ,
  31761. i.format = function(e) {
  31762. return D.isString(e) && (e = n(e)),
  31763. e instanceof x ? e.format() : x.prototype.format.call(e)
  31764. }
  31765. ,
  31766. i.Url = x;
  31767. var N = /^([a-z0-9.+-]+:)/i
  31768. , r = /:[0-9]*$/
  31769. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31770. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31771. , B = ["'"].concat(o)
  31772. , V = ["%", "/", "?", ";", "#"].concat(B)
  31773. , k = ["/", "?", "#"]
  31774. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31775. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31776. , z = {
  31777. javascript: !0,
  31778. "javascript:": !0
  31779. }
  31780. , G = {
  31781. javascript: !0,
  31782. "javascript:": !0
  31783. }
  31784. , W = {
  31785. http: !0,
  31786. https: !0,
  31787. ftp: !0,
  31788. gopher: !0,
  31789. file: !0,
  31790. "http:": !0,
  31791. "https:": !0,
  31792. "ftp:": !0,
  31793. "gopher:": !0,
  31794. "file:": !0
  31795. }
  31796. , j = e("querystring");
  31797. x.prototype.parse = function(e, t, i) {
  31798. if (!D.isString(e))
  31799. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31800. var n = e.indexOf("?")
  31801. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31802. , o = e.split(r);
  31803. o[0] = o[0].replace(/\\/g, "/");
  31804. var a = e = o.join(r);
  31805. if (a = a.trim(),
  31806. !i && 1 === e.split("#").length) {
  31807. var s = F.exec(a);
  31808. if (s)
  31809. return this.path = a,
  31810. this.href = a,
  31811. this.pathname = s[1],
  31812. s[2] ? (this.search = s[2],
  31813. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31814. this.query = {}),
  31815. this
  31816. }
  31817. var l = N.exec(a);
  31818. if (l) {
  31819. var c = (l = l[0]).toLowerCase();
  31820. this.protocol = c,
  31821. a = a.substr(l.length)
  31822. }
  31823. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31824. var h = "//" === a.substr(0, 2);
  31825. !h || l && G[l] || (a = a.substr(2),
  31826. this.slashes = !0)
  31827. }
  31828. if (!G[l] && (h || l && !W[l])) {
  31829. for (var u = -1, d = 0; d < k.length; d++) {
  31830. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31831. }
  31832. var p, f;
  31833. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31834. a = a.slice(f + 1),
  31835. this.auth = decodeURIComponent(p)),
  31836. u = -1;
  31837. for (d = 0; d < V.length; d++) {
  31838. var g;
  31839. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31840. }
  31841. -1 === u && (u = a.length),
  31842. this.host = a.slice(0, u),
  31843. a = a.slice(u),
  31844. this.parseHost(),
  31845. this.hostname = this.hostname || "";
  31846. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31847. if (!m)
  31848. for (var v = this.hostname.split(/\./), y = (d = 0,
  31849. v.length); d < y; d++) {
  31850. var A = v[d];
  31851. if (A && !A.match(U)) {
  31852. for (var C = "", I = 0, E = A.length; I < E; I++)
  31853. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31854. if (!C.match(U)) {
  31855. var _ = v.slice(0, d)
  31856. , b = v.slice(d + 1)
  31857. , w = A.match(H);
  31858. w && (_.push(w[1]),
  31859. b.unshift(w[2])),
  31860. b.length && (a = "/" + b.join(".") + a),
  31861. this.hostname = _.join(".");
  31862. break
  31863. }
  31864. }
  31865. }
  31866. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31867. m || (this.hostname = L.toASCII(this.hostname));
  31868. var T = this.port ? ":" + this.port : ""
  31869. , x = this.hostname || "";
  31870. this.host = x + T,
  31871. this.href += this.host,
  31872. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31873. "/" !== a[0] && (a = "/" + a))
  31874. }
  31875. if (!z[c])
  31876. for (d = 0,
  31877. y = B.length; d < y; d++) {
  31878. var S = B[d];
  31879. if (-1 !== a.indexOf(S)) {
  31880. var M = encodeURIComponent(S);
  31881. M === S && (M = escape(S)),
  31882. a = a.split(S).join(M)
  31883. }
  31884. }
  31885. var R = a.indexOf("#");
  31886. -1 !== R && (this.hash = a.substr(R),
  31887. a = a.slice(0, R));
  31888. var P = a.indexOf("?");
  31889. if (-1 !== P ? (this.search = a.substr(P),
  31890. this.query = a.substr(P + 1),
  31891. t && (this.query = j.parse(this.query)),
  31892. a = a.slice(0, P)) : t && (this.search = "",
  31893. this.query = {}),
  31894. a && (this.pathname = a),
  31895. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31896. this.pathname || this.search) {
  31897. T = this.pathname || "";
  31898. var O = this.search || "";
  31899. this.path = T + O
  31900. }
  31901. return this.href = this.format(),
  31902. this
  31903. }
  31904. ,
  31905. x.prototype.format = function() {
  31906. var e = this.auth || "";
  31907. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31908. e += "@");
  31909. var t = this.protocol || ""
  31910. , i = this.pathname || ""
  31911. , n = this.hash || ""
  31912. , r = !1
  31913. , o = "";
  31914. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31915. this.port && (r += ":" + this.port)),
  31916. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31917. var a = this.search || o && "?" + o || "";
  31918. return t && ":" !== t.substr(-1) && (t += ":"),
  31919. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31920. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31921. n && "#" !== n.charAt(0) && (n = "#" + n),
  31922. a && "?" !== a.charAt(0) && (a = "?" + a),
  31923. t + r + (i = i.replace(/[?#]/g, function(e) {
  31924. return encodeURIComponent(e)
  31925. })) + (a = a.replace("#", "%23")) + n
  31926. }
  31927. ,
  31928. x.prototype.resolve = function(e) {
  31929. return this.resolveObject(n(e, !1, !0)).format()
  31930. }
  31931. ,
  31932. x.prototype.resolveObject = function(e) {
  31933. if (D.isString(e)) {
  31934. var t = new x;
  31935. t.parse(e, !1, !0),
  31936. e = t
  31937. }
  31938. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31939. var o = n[r];
  31940. i[o] = this[o]
  31941. }
  31942. if (i.hash = e.hash,
  31943. "" === e.href)
  31944. return i.href = i.format(),
  31945. i;
  31946. if (e.slashes && !e.protocol) {
  31947. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31948. var l = a[s];
  31949. "protocol" !== l && (i[l] = e[l])
  31950. }
  31951. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31952. i.href = i.format(),
  31953. i
  31954. }
  31955. if (e.protocol && e.protocol !== i.protocol) {
  31956. if (!W[e.protocol]) {
  31957. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31958. var u = c[h];
  31959. i[u] = e[u]
  31960. }
  31961. return i.href = i.format(),
  31962. i
  31963. }
  31964. if (i.protocol = e.protocol,
  31965. e.host || G[e.protocol])
  31966. i.pathname = e.pathname;
  31967. else {
  31968. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31969. ;
  31970. e.host || (e.host = ""),
  31971. e.hostname || (e.hostname = ""),
  31972. "" !== d[0] && d.unshift(""),
  31973. d.length < 2 && d.unshift(""),
  31974. i.pathname = d.join("/")
  31975. }
  31976. if (i.search = e.search,
  31977. i.query = e.query,
  31978. i.host = e.host || "",
  31979. i.auth = e.auth,
  31980. i.hostname = e.hostname || e.host,
  31981. i.port = e.port,
  31982. i.pathname || i.search) {
  31983. var p = i.pathname || ""
  31984. , f = i.search || "";
  31985. i.path = p + f
  31986. }
  31987. return i.slashes = i.slashes || e.slashes,
  31988. i.href = i.format(),
  31989. i
  31990. }
  31991. var g = i.pathname && "/" === i.pathname.charAt(0)
  31992. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31993. , v = m || g || i.host && e.pathname
  31994. , y = v
  31995. , A = i.pathname && i.pathname.split("/") || []
  31996. , C = (d = e.pathname && e.pathname.split("/") || [],
  31997. i.protocol && !W[i.protocol]);
  31998. if (C && (i.hostname = "",
  31999. i.port = null,
  32000. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  32001. i.host = "",
  32002. e.protocol && (e.hostname = null,
  32003. e.port = null,
  32004. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  32005. e.host = null),
  32006. v = v && ("" === d[0] || "" === A[0])),
  32007. m)
  32008. i.host = e.host || "" === e.host ? e.host : i.host,
  32009. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  32010. i.search = e.search,
  32011. i.query = e.query,
  32012. A = d;
  32013. else if (d.length)
  32014. (A = A || []).pop(),
  32015. A = A.concat(d),
  32016. i.search = e.search,
  32017. i.query = e.query;
  32018. else if (!D.isNullOrUndefined(e.search)) {
  32019. if (C)
  32020. i.hostname = i.host = A.shift(),
  32021. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  32022. i.host = i.hostname = w.shift());
  32023. return i.search = e.search,
  32024. i.query = e.query,
  32025. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32026. i.href = i.format(),
  32027. i
  32028. }
  32029. if (!A.length)
  32030. return i.pathname = null,
  32031. i.search ? i.path = "/" + i.search : i.path = null,
  32032. i.href = i.format(),
  32033. i;
  32034. 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--)
  32035. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  32036. _++) : _ && (A.splice(b, 1),
  32037. _--);
  32038. if (!v && !y)
  32039. for (; _--; )
  32040. A.unshift("..");
  32041. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  32042. E && "/" !== A.join("/").substr(-1) && A.push("");
  32043. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  32044. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  32045. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  32046. i.host = i.hostname = w.shift()));
  32047. return (v = v || i.host && A.length) && !T && A.unshift(""),
  32048. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  32049. i.path = null),
  32050. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32051. i.auth = e.auth || i.auth,
  32052. i.slashes = i.slashes || e.slashes,
  32053. i.href = i.format(),
  32054. i
  32055. }
  32056. ,
  32057. x.prototype.parseHost = function() {
  32058. var e = this.host
  32059. , t = r.exec(e);
  32060. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  32061. e = e.substr(0, e.length - t.length)),
  32062. e && (this.hostname = e)
  32063. }
  32064. }
  32065. , {
  32066. "./util": 209,
  32067. punycode: 204,
  32068. querystring: 207
  32069. }],
  32070. 209: [function(e, t, i) {
  32071. "use strict";
  32072. t.exports = {
  32073. isString: function(e) {
  32074. return "string" == typeof e
  32075. },
  32076. isObject: function(e) {
  32077. return "object" == typeof e && null !== e
  32078. },
  32079. isNull: function(e) {
  32080. return null === e
  32081. },
  32082. isNullOrUndefined: function(e) {
  32083. return null == e
  32084. }
  32085. }
  32086. }
  32087. , {}],
  32088. 210: [function(e, t, i) {
  32089. "use strict";
  32090. function r(e) {
  32091. return c + e
  32092. }
  32093. function s(e) {
  32094. if ("string" != typeof e)
  32095. throw new TypeError("key must be a string.")
  32096. }
  32097. var l = Object.prototype.hasOwnProperty
  32098. , c = "~";
  32099. t.exports = function(t) {
  32100. var o = Object.create(null)
  32101. , n = 0
  32102. , a = {};
  32103. return function(e, t) {
  32104. for (var i in t)
  32105. Object.defineProperty(e, i, {
  32106. value: t[i],
  32107. configurable: !0,
  32108. writable: !0
  32109. })
  32110. }(a, {
  32111. get: function(e, t) {
  32112. s(e);
  32113. var i = r(e);
  32114. return i in o ? o[i] : t
  32115. },
  32116. set: function(e, t) {
  32117. s(e);
  32118. var i = r(e);
  32119. return i in o || ++n,
  32120. o[i] = t
  32121. },
  32122. has: function(e) {
  32123. return s(e),
  32124. r(e)in o
  32125. },
  32126. delete: function(e) {
  32127. s(e);
  32128. var t = r(e);
  32129. return t in o && (--n,
  32130. delete o[t],
  32131. !0)
  32132. },
  32133. clear: function() {
  32134. o = Object.create(null),
  32135. n = 0
  32136. },
  32137. forEach: function(e, t) {
  32138. if ("function" != typeof e)
  32139. throw new TypeError("`callback` must be a function");
  32140. for (var i in o)
  32141. if (l.call(o, i)) {
  32142. var n = i.substring(c.length)
  32143. , r = o[i];
  32144. e.call(t, r, n, a)
  32145. }
  32146. }
  32147. }),
  32148. Object.defineProperty(a, "size", {
  32149. get: function() {
  32150. return n
  32151. },
  32152. configurable: !0
  32153. }),
  32154. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  32155. a.set(e, t[e])
  32156. }),
  32157. a
  32158. }
  32159. }
  32160. , {}],
  32161. 211: [function(e, t, i) {
  32162. t.exports = e("./lib/heap")
  32163. }
  32164. , {
  32165. "./lib/heap": 212
  32166. }],
  32167. 212: [function(e, y, A) {
  32168. (function() {
  32169. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  32170. function v(e) {
  32171. this.cmp = null != e ? e : d,
  32172. this.nodes = []
  32173. }
  32174. l = Math.floor,
  32175. m = Math.min,
  32176. d = function(e, t) {
  32177. return e < t ? -1 : t < e ? 1 : 0
  32178. }
  32179. ,
  32180. g = function(e, t, i, n, r) {
  32181. var o;
  32182. if (null == i && (i = 0),
  32183. null == r && (r = d),
  32184. i < 0)
  32185. throw new Error("lo must be non-negative");
  32186. for (null == n && (n = e.length); i < n; )
  32187. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  32188. return [].splice.apply(e, [i, i - i].concat(t)),
  32189. t
  32190. }
  32191. ,
  32192. t = function(e, t, i) {
  32193. return null == i && (i = d),
  32194. e.push(t),
  32195. h(e, 0, e.length - 1, i)
  32196. }
  32197. ,
  32198. f = function(e, t) {
  32199. var i, n;
  32200. return null == t && (t = d),
  32201. i = e.pop(),
  32202. e.length ? (n = e[0],
  32203. e[0] = i,
  32204. u(e, 0, t)) : n = i,
  32205. n
  32206. }
  32207. ,
  32208. i = function(e, t, i) {
  32209. var n;
  32210. return null == i && (i = d),
  32211. n = e[0],
  32212. e[0] = t,
  32213. u(e, 0, i),
  32214. n
  32215. }
  32216. ,
  32217. c = function(e, t, i) {
  32218. var n;
  32219. return null == i && (i = d),
  32220. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  32221. e[0] = n[1],
  32222. u(e, 0, i)),
  32223. t
  32224. }
  32225. ,
  32226. p = function(i, e) {
  32227. var t, n, r, o, a, s;
  32228. for (null == e && (e = d),
  32229. a = [],
  32230. n = 0,
  32231. r = (o = function() {
  32232. s = [];
  32233. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  32234. s.push(e);
  32235. return s
  32236. }
  32237. .apply(this).reverse()).length; n < r; n++)
  32238. t = o[n],
  32239. a.push(u(i, t, e));
  32240. return a
  32241. }
  32242. ,
  32243. o = function(e, t, i) {
  32244. var n;
  32245. if (null == i && (i = d),
  32246. -1 !== (n = e.indexOf(t)))
  32247. return h(e, 0, n, i),
  32248. u(e, n, i)
  32249. }
  32250. ,
  32251. n = function(e, t, i) {
  32252. var n, r, o, a, s;
  32253. if (null == i && (i = d),
  32254. !(r = e.slice(0, t)).length)
  32255. return r;
  32256. for (p(r, i),
  32257. o = 0,
  32258. a = (s = e.slice(t)).length; o < a; o++)
  32259. n = s[o],
  32260. c(r, n, i);
  32261. return r.sort(i).reverse()
  32262. }
  32263. ,
  32264. r = function(e, t, i) {
  32265. var n, r, o, a, s, l, c, h, u;
  32266. if (null == i && (i = d),
  32267. 10 * t <= e.length) {
  32268. if (!(o = e.slice(0, t).sort(i)).length)
  32269. return o;
  32270. for (r = o[o.length - 1],
  32271. a = 0,
  32272. l = (c = e.slice(t)).length; a < l; a++)
  32273. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  32274. o.pop(),
  32275. r = o[o.length - 1]);
  32276. return o
  32277. }
  32278. for (p(e, i),
  32279. u = [],
  32280. s = 0,
  32281. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  32282. u.push(f(e, i));
  32283. return u
  32284. }
  32285. ,
  32286. h = function(e, t, i, n) {
  32287. var r, o, a;
  32288. for (null == n && (n = d),
  32289. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  32290. e[i] = o,
  32291. i = a;
  32292. return e[i] = r
  32293. }
  32294. ,
  32295. u = function(e, t, i) {
  32296. var n, r, o, a, s;
  32297. for (null == i && (i = d),
  32298. r = e.length,
  32299. o = e[s = t],
  32300. n = 2 * t + 1; n < r; )
  32301. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  32302. e[t] = e[n],
  32303. n = 2 * (t = n) + 1;
  32304. return e[t] = o,
  32305. h(e, s, t, i)
  32306. }
  32307. ,
  32308. v.push = t,
  32309. v.pop = f,
  32310. v.replace = i,
  32311. v.pushpop = c,
  32312. v.heapify = p,
  32313. v.updateItem = o,
  32314. v.nlargest = n,
  32315. v.nsmallest = r,
  32316. v.prototype.push = function(e) {
  32317. return t(this.nodes, e, this.cmp)
  32318. }
  32319. ,
  32320. v.prototype.pop = function() {
  32321. return f(this.nodes, this.cmp)
  32322. }
  32323. ,
  32324. v.prototype.peek = function() {
  32325. return this.nodes[0]
  32326. }
  32327. ,
  32328. v.prototype.contains = function(e) {
  32329. return -1 !== this.nodes.indexOf(e)
  32330. }
  32331. ,
  32332. v.prototype.replace = function(e) {
  32333. return i(this.nodes, e, this.cmp)
  32334. }
  32335. ,
  32336. v.prototype.pushpop = function(e) {
  32337. return c(this.nodes, e, this.cmp)
  32338. }
  32339. ,
  32340. v.prototype.heapify = function() {
  32341. return p(this.nodes, this.cmp)
  32342. }
  32343. ,
  32344. v.prototype.updateItem = function(e) {
  32345. return o(this.nodes, e, this.cmp)
  32346. }
  32347. ,
  32348. v.prototype.clear = function() {
  32349. return this.nodes = []
  32350. }
  32351. ,
  32352. v.prototype.empty = function() {
  32353. return 0 === this.nodes.length
  32354. }
  32355. ,
  32356. v.prototype.size = function() {
  32357. return this.nodes.length
  32358. }
  32359. ,
  32360. v.prototype.clone = function() {
  32361. var e;
  32362. return (e = new v).nodes = this.nodes.slice(0),
  32363. e
  32364. }
  32365. ,
  32366. v.prototype.toArray = function() {
  32367. return this.nodes.slice(0)
  32368. }
  32369. ,
  32370. v.prototype.insert = v.prototype.push,
  32371. v.prototype.top = v.prototype.peek,
  32372. v.prototype.front = v.prototype.peek,
  32373. v.prototype.has = v.prototype.contains,
  32374. v.prototype.copy = v.prototype.clone,
  32375. e = v,
  32376. a = this,
  32377. s = function() {
  32378. return e
  32379. }
  32380. ,
  32381. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  32382. }
  32383. ).call(this)
  32384. }
  32385. , {}],
  32386. 213: [function(e, t, i) {
  32387. function n() {}
  32388. function o(e) {
  32389. if ("object" != typeof this)
  32390. throw new TypeError("Promises must be constructed via new");
  32391. if ("function" != typeof e)
  32392. throw new TypeError("not a function");
  32393. this._state = 0,
  32394. this._handled = !1,
  32395. this._value = void 0,
  32396. this._deferreds = [],
  32397. h(e, this)
  32398. }
  32399. function r(i, n) {
  32400. for (; 3 === i._state; )
  32401. i = i._value;
  32402. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  32403. void o._immediateFn(function() {
  32404. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  32405. if (null !== e) {
  32406. var t;
  32407. try {
  32408. t = e(i._value)
  32409. } catch (e) {
  32410. return void s(n.promise, e)
  32411. }
  32412. a(n.promise, t)
  32413. } else
  32414. (1 === i._state ? a : s)(n.promise, i._value)
  32415. }))
  32416. }
  32417. function a(e, t) {
  32418. try {
  32419. if (t === e)
  32420. throw new TypeError("A promise cannot be resolved with itself.");
  32421. if (t && ("object" == typeof t || "function" == typeof t)) {
  32422. var i = t.then;
  32423. if (t instanceof o)
  32424. return e._state = 3,
  32425. e._value = t,
  32426. void l(e);
  32427. if ("function" == typeof i)
  32428. return void h(function(e, t) {
  32429. return function() {
  32430. e.apply(t, arguments)
  32431. }
  32432. }(i, t), e)
  32433. }
  32434. e._state = 1,
  32435. e._value = t,
  32436. l(e)
  32437. } catch (t) {
  32438. s(e, t)
  32439. }
  32440. }
  32441. function s(e, t) {
  32442. e._state = 2,
  32443. e._value = t,
  32444. l(e)
  32445. }
  32446. function l(e) {
  32447. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  32448. e._handled || o._unhandledRejectionFn(e._value)
  32449. });
  32450. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32451. r(e, e._deferreds[t]);
  32452. e._deferreds = null
  32453. }
  32454. function c(e, t, i) {
  32455. this.onFulfilled = "function" == typeof e ? e : null,
  32456. this.onRejected = "function" == typeof t ? t : null,
  32457. this.promise = i
  32458. }
  32459. function h(e, t) {
  32460. var i = !1;
  32461. try {
  32462. e(function(e) {
  32463. i || (i = !0,
  32464. a(t, e))
  32465. }, function(e) {
  32466. i || (i = !0,
  32467. s(t, e))
  32468. })
  32469. } catch (e) {
  32470. if (i)
  32471. return;
  32472. i = !0,
  32473. s(t, e)
  32474. }
  32475. }
  32476. var u, d;
  32477. u = this,
  32478. d = setTimeout,
  32479. o.prototype.catch = function(e) {
  32480. return this.then(null, e)
  32481. }
  32482. ,
  32483. o.prototype.then = function(e, t) {
  32484. var i = new this.constructor(n);
  32485. return r(this, new c(e,t,i)),
  32486. i
  32487. }
  32488. ,
  32489. o.all = function(e) {
  32490. var s = Array.prototype.slice.call(e);
  32491. return new o(function(n, r) {
  32492. function o(t, e) {
  32493. try {
  32494. if (e && ("object" == typeof e || "function" == typeof e)) {
  32495. var i = e.then;
  32496. if ("function" == typeof i)
  32497. return void i.call(e, function(e) {
  32498. o(t, e)
  32499. }, r)
  32500. }
  32501. s[t] = e,
  32502. 0 == --a && n(s)
  32503. } catch (e) {
  32504. r(e)
  32505. }
  32506. }
  32507. if (0 === s.length)
  32508. return n([]);
  32509. for (var a = s.length, e = 0; e < s.length; e++)
  32510. o(e, s[e])
  32511. }
  32512. )
  32513. }
  32514. ,
  32515. o.resolve = function(t) {
  32516. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32517. e(t)
  32518. }
  32519. )
  32520. }
  32521. ,
  32522. o.reject = function(i) {
  32523. return new o(function(e, t) {
  32524. t(i)
  32525. }
  32526. )
  32527. }
  32528. ,
  32529. o.race = function(r) {
  32530. return new o(function(e, t) {
  32531. for (var i = 0, n = r.length; i < n; i++)
  32532. r[i].then(e, t)
  32533. }
  32534. )
  32535. }
  32536. ,
  32537. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32538. setImmediate(e)
  32539. }
  32540. || function(e) {
  32541. d(e, 0)
  32542. }
  32543. ,
  32544. o._unhandledRejectionFn = function(e) {
  32545. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32546. }
  32547. ,
  32548. o._setImmediateFn = function(e) {
  32549. o._immediateFn = e
  32550. }
  32551. ,
  32552. o._setUnhandledRejectionFn = function(e) {
  32553. o._unhandledRejectionFn = e
  32554. }
  32555. ,
  32556. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32557. }
  32558. , {}],
  32559. 214: [function(p, i, e) {
  32560. (function(d) {
  32561. var e, t;
  32562. e = this,
  32563. t = function(I, e) {
  32564. "use strict";
  32565. var a, t, u, i, s, n, r, o = {};
  32566. return o.ByteBuffer = I,
  32567. o.Long = I.Long || null,
  32568. o.VERSION = "5.0.1",
  32569. o.WIRE_TYPES = {},
  32570. o.WIRE_TYPES.VARINT = 0,
  32571. o.WIRE_TYPES.BITS64 = 1,
  32572. o.WIRE_TYPES.LDELIM = 2,
  32573. o.WIRE_TYPES.STARTGROUP = 3,
  32574. o.WIRE_TYPES.ENDGROUP = 4,
  32575. o.WIRE_TYPES.BITS32 = 5,
  32576. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32577. o.TYPES = {
  32578. int32: {
  32579. name: "int32",
  32580. wireType: o.WIRE_TYPES.VARINT,
  32581. defaultValue: 0
  32582. },
  32583. uint32: {
  32584. name: "uint32",
  32585. wireType: o.WIRE_TYPES.VARINT,
  32586. defaultValue: 0
  32587. },
  32588. sint32: {
  32589. name: "sint32",
  32590. wireType: o.WIRE_TYPES.VARINT,
  32591. defaultValue: 0
  32592. },
  32593. int64: {
  32594. name: "int64",
  32595. wireType: o.WIRE_TYPES.VARINT,
  32596. defaultValue: o.Long ? o.Long.ZERO : void 0
  32597. },
  32598. uint64: {
  32599. name: "uint64",
  32600. wireType: o.WIRE_TYPES.VARINT,
  32601. defaultValue: o.Long ? o.Long.UZERO : void 0
  32602. },
  32603. sint64: {
  32604. name: "sint64",
  32605. wireType: o.WIRE_TYPES.VARINT,
  32606. defaultValue: o.Long ? o.Long.ZERO : void 0
  32607. },
  32608. bool: {
  32609. name: "bool",
  32610. wireType: o.WIRE_TYPES.VARINT,
  32611. defaultValue: !1
  32612. },
  32613. double: {
  32614. name: "double",
  32615. wireType: o.WIRE_TYPES.BITS64,
  32616. defaultValue: 0
  32617. },
  32618. string: {
  32619. name: "string",
  32620. wireType: o.WIRE_TYPES.LDELIM,
  32621. defaultValue: ""
  32622. },
  32623. bytes: {
  32624. name: "bytes",
  32625. wireType: o.WIRE_TYPES.LDELIM,
  32626. defaultValue: null
  32627. },
  32628. fixed32: {
  32629. name: "fixed32",
  32630. wireType: o.WIRE_TYPES.BITS32,
  32631. defaultValue: 0
  32632. },
  32633. sfixed32: {
  32634. name: "sfixed32",
  32635. wireType: o.WIRE_TYPES.BITS32,
  32636. defaultValue: 0
  32637. },
  32638. fixed64: {
  32639. name: "fixed64",
  32640. wireType: o.WIRE_TYPES.BITS64,
  32641. defaultValue: o.Long ? o.Long.UZERO : void 0
  32642. },
  32643. sfixed64: {
  32644. name: "sfixed64",
  32645. wireType: o.WIRE_TYPES.BITS64,
  32646. defaultValue: o.Long ? o.Long.ZERO : void 0
  32647. },
  32648. float: {
  32649. name: "float",
  32650. wireType: o.WIRE_TYPES.BITS32,
  32651. defaultValue: 0
  32652. },
  32653. enum: {
  32654. name: "enum",
  32655. wireType: o.WIRE_TYPES.VARINT,
  32656. defaultValue: 0
  32657. },
  32658. message: {
  32659. name: "message",
  32660. wireType: o.WIRE_TYPES.LDELIM,
  32661. defaultValue: null
  32662. },
  32663. group: {
  32664. name: "group",
  32665. wireType: o.WIRE_TYPES.STARTGROUP,
  32666. defaultValue: null
  32667. }
  32668. },
  32669. 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],
  32670. o.ID_MIN = 1,
  32671. o.ID_MAX = 536870911,
  32672. o.convertFieldsToCamelCase = !1,
  32673. o.populateAccessors = !0,
  32674. o.populateDefaults = !0,
  32675. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32676. r.XHR = function() {
  32677. for (var e = [function() {
  32678. return new XMLHttpRequest
  32679. }
  32680. , function() {
  32681. return new ActiveXObject("Msxml2.XMLHTTP")
  32682. }
  32683. , function() {
  32684. return new ActiveXObject("Msxml3.XMLHTTP")
  32685. }
  32686. , function() {
  32687. return new ActiveXObject("Microsoft.XMLHTTP")
  32688. }
  32689. ], t = null, i = 0; i < e.length; i++) {
  32690. try {
  32691. t = e[i]()
  32692. } catch (e) {
  32693. continue
  32694. }
  32695. break
  32696. }
  32697. if (!t)
  32698. throw Error("XMLHttpRequest is not supported");
  32699. return t
  32700. }
  32701. ,
  32702. r.fetch = function(e, i) {
  32703. if (i && "function" != typeof i && (i = null),
  32704. r.IS_NODE) {
  32705. var t = p("fs");
  32706. if (i)
  32707. t.readFile(e, function(e, t) {
  32708. i(e ? null : "" + t)
  32709. });
  32710. else
  32711. try {
  32712. return t.readFileSync(e)
  32713. } catch (e) {
  32714. return null
  32715. }
  32716. } else {
  32717. var n = r.XHR();
  32718. if (n.open("GET", e, !!i),
  32719. n.setRequestHeader("Accept", "text/plain"),
  32720. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32721. !i)
  32722. return n.send(null),
  32723. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32724. if (n.onreadystatechange = function() {
  32725. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32726. }
  32727. ,
  32728. 4 == n.readyState)
  32729. return;
  32730. n.send(null)
  32731. }
  32732. }
  32733. ,
  32734. r.toCamelCase = function(e) {
  32735. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32736. return t.toUpperCase()
  32737. })
  32738. }
  32739. ,
  32740. r),
  32741. o.Lang = {
  32742. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32743. RULE: /^(?:required|optional|repeated|map)$/,
  32744. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32745. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32746. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32747. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32748. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32749. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32750. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32751. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32752. NUMBER_OCT: /^0[0-7]+$/,
  32753. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32754. BOOL: /^(?:true|false)$/i,
  32755. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32756. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32757. WHITESPACE: /\s/,
  32758. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32759. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32760. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32761. },
  32762. o.DotProto = function(r, a) {
  32763. function s(e, t) {
  32764. var i = -1
  32765. , n = 1;
  32766. if ("-" == e.charAt(0) && (n = -1,
  32767. e = e.substring(1)),
  32768. a.NUMBER_DEC.test(e))
  32769. i = parseInt(e);
  32770. else if (a.NUMBER_HEX.test(e))
  32771. i = parseInt(e.substring(2), 16);
  32772. else {
  32773. if (!a.NUMBER_OCT.test(e))
  32774. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32775. i = parseInt(e.substring(1), 8)
  32776. }
  32777. if (i = n * i | 0,
  32778. !t && i < 0)
  32779. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32780. return i
  32781. }
  32782. function o(e) {
  32783. var t = 1;
  32784. if ("-" == e.charAt(0) && (t = -1,
  32785. e = e.substring(1)),
  32786. a.NUMBER_DEC.test(e))
  32787. return t * parseInt(e, 10);
  32788. if (a.NUMBER_HEX.test(e))
  32789. return t * parseInt(e.substring(2), 16);
  32790. if (a.NUMBER_OCT.test(e))
  32791. return t * parseInt(e.substring(1), 8);
  32792. if ("inf" === e)
  32793. return t * (1 / 0);
  32794. if ("nan" === e)
  32795. return NaN;
  32796. if (a.NUMBER_FLT.test(e))
  32797. return t * parseFloat(e);
  32798. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32799. }
  32800. function n(e, t, i) {
  32801. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32802. e[t].push(i))
  32803. }
  32804. function t(e) {
  32805. this.source = e + "",
  32806. this.index = 0,
  32807. this.line = 1,
  32808. this.stack = [],
  32809. this._stringOpen = null
  32810. }
  32811. var e = {}
  32812. , i = t.prototype;
  32813. i._readString = function() {
  32814. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32815. e.lastIndex = this.index - 1;
  32816. var t = e.exec(this.source);
  32817. if (!t)
  32818. throw Error("unterminated string");
  32819. return this.index = e.lastIndex,
  32820. this.stack.push(this._stringOpen),
  32821. this._stringOpen = null,
  32822. t[1]
  32823. }
  32824. ,
  32825. i.next = function() {
  32826. if (0 < this.stack.length)
  32827. return this.stack.shift();
  32828. if (this.index >= this.source.length)
  32829. return null;
  32830. if (null !== this._stringOpen)
  32831. return this._readString();
  32832. var e, t, i;
  32833. do {
  32834. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32835. if ("\n" === i && ++this.line,
  32836. ++this.index === this.source.length)
  32837. return null;
  32838. if ("/" === this.source.charAt(this.index))
  32839. if (++this.index,
  32840. "/" === this.source.charAt(this.index)) {
  32841. for (; "\n" !== this.source.charAt(++this.index); )
  32842. if (this.index == this.source.length)
  32843. return null;
  32844. ++this.index,
  32845. ++this.line,
  32846. e = !0
  32847. } else {
  32848. if ("*" !== (i = this.source.charAt(this.index)))
  32849. return "/";
  32850. do {
  32851. if ("\n" === i && ++this.line,
  32852. ++this.index === this.source.length)
  32853. return null;
  32854. t = i,
  32855. i = this.source.charAt(this.index)
  32856. } while ("*" !== t || "/" !== i);++this.index,
  32857. e = !0
  32858. }
  32859. } while (e);if (this.index === this.source.length)
  32860. return null;
  32861. var n = this.index;
  32862. if (a.DELIM.lastIndex = 0,
  32863. !a.DELIM.test(this.source.charAt(n++)))
  32864. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32865. ++n;
  32866. var r = this.source.substring(this.index, this.index = n);
  32867. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32868. r
  32869. }
  32870. ,
  32871. i.peek = function() {
  32872. if (0 === this.stack.length) {
  32873. var e = this.next();
  32874. if (null === e)
  32875. return null;
  32876. this.stack.push(e)
  32877. }
  32878. return this.stack[0]
  32879. }
  32880. ,
  32881. i.skip = function(e) {
  32882. var t = this.next();
  32883. if (t !== e)
  32884. throw Error("illegal '" + t + "', '" + e + "' expected")
  32885. }
  32886. ,
  32887. i.omit = function(e) {
  32888. return this.peek() === e && (this.next(),
  32889. !0)
  32890. }
  32891. ,
  32892. i.toString = function() {
  32893. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32894. }
  32895. ,
  32896. e.Tokenizer = t;
  32897. function l(e) {
  32898. this.tn = new t(e),
  32899. this.proto3 = !1
  32900. }
  32901. var c = l.prototype;
  32902. return c.parse = function() {
  32903. var e, t, i = {
  32904. name: "[ROOT]",
  32905. package: null,
  32906. messages: [],
  32907. enums: [],
  32908. imports: [],
  32909. options: {},
  32910. services: []
  32911. }, n = !0;
  32912. try {
  32913. for (; e = this.tn.next(); )
  32914. switch (e) {
  32915. case "package":
  32916. if (!n || null !== i.package)
  32917. throw Error("unexpected 'package'");
  32918. if (e = this.tn.next(),
  32919. !a.TYPEREF.test(e))
  32920. throw Error("illegal package name: " + e);
  32921. this.tn.skip(";"),
  32922. i.package = e;
  32923. break;
  32924. case "import":
  32925. if (!n)
  32926. throw Error("unexpected 'import'");
  32927. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32928. e = this._readString(),
  32929. this.tn.skip(";"),
  32930. t || i.imports.push(e);
  32931. break;
  32932. case "syntax":
  32933. if (!n)
  32934. throw Error("unexpected 'syntax'");
  32935. this.tn.skip("="),
  32936. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32937. this.tn.skip(";");
  32938. break;
  32939. case "message":
  32940. this._parseMessage(i, null),
  32941. n = !1;
  32942. break;
  32943. case "enum":
  32944. this._parseEnum(i),
  32945. n = !1;
  32946. break;
  32947. case "option":
  32948. this._parseOption(i);
  32949. break;
  32950. case "service":
  32951. this._parseService(i);
  32952. break;
  32953. case "extend":
  32954. this._parseExtend(i);
  32955. break;
  32956. default:
  32957. throw Error("unexpected '" + e + "'")
  32958. }
  32959. } catch (e) {
  32960. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32961. e
  32962. }
  32963. return delete i.name,
  32964. i
  32965. }
  32966. ,
  32967. l.parse = function(e) {
  32968. return new l(e).parse()
  32969. }
  32970. ,
  32971. c._readString = function() {
  32972. var e, t, i = "";
  32973. do {
  32974. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32975. throw Error("illegal string delimiter: " + t);
  32976. i += this.tn.next(),
  32977. this.tn.skip(t),
  32978. e = this.tn.peek()
  32979. } while ('"' === e || '"' === e);return i
  32980. }
  32981. ,
  32982. c._readValue = function(e) {
  32983. var t = this.tn.peek();
  32984. if ('"' === t || "'" === t)
  32985. return this._readString();
  32986. if (this.tn.next(),
  32987. a.NUMBER.test(t))
  32988. return o(t);
  32989. if (a.BOOL.test(t))
  32990. return "true" === t.toLowerCase();
  32991. if (e && a.TYPEREF.test(t))
  32992. return t;
  32993. throw Error("illegal value: " + t)
  32994. }
  32995. ,
  32996. c._parseOption = function(e, t) {
  32997. var i = this.tn.next()
  32998. , n = !1;
  32999. if ("(" === i && (n = !0,
  33000. i = this.tn.next()),
  33001. !a.TYPEREF.test(i))
  33002. throw Error("illegal option name: " + i);
  33003. var r = i;
  33004. n && (this.tn.skip(")"),
  33005. r = "(" + r + ")",
  33006. i = this.tn.peek(),
  33007. a.FQTYPEREF.test(i) && (r += i,
  33008. this.tn.next())),
  33009. this.tn.skip("="),
  33010. this._parseOptionValue(e, r),
  33011. t || this.tn.skip(";")
  33012. }
  33013. ,
  33014. c._parseOptionValue = function(e, t) {
  33015. var i = this.tn.peek();
  33016. if ("{" !== i)
  33017. n(e.options, t, this._readValue(!0));
  33018. else
  33019. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  33020. if (!a.NAME.test(i))
  33021. throw Error("illegal option name: " + t + "." + i);
  33022. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  33023. }
  33024. }
  33025. ,
  33026. c._parseService = function(e) {
  33027. var t = this.tn.next();
  33028. if (!a.NAME.test(t))
  33029. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  33030. var i = {
  33031. name: t,
  33032. rpc: {},
  33033. options: {}
  33034. };
  33035. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33036. if ("option" === t)
  33037. this._parseOption(i);
  33038. else {
  33039. if ("rpc" !== t)
  33040. throw Error("illegal service token: " + t);
  33041. this._parseServiceRPC(i)
  33042. }
  33043. this.tn.omit(";"),
  33044. e.services.push(i)
  33045. }
  33046. ,
  33047. c._parseServiceRPC = function(e) {
  33048. var t = this.tn.next();
  33049. if (!a.NAME.test(t))
  33050. throw Error("illegal rpc service method name: " + t);
  33051. var i = t
  33052. , n = {
  33053. request: null,
  33054. response: null,
  33055. request_stream: !1,
  33056. response_stream: !1,
  33057. options: {}
  33058. };
  33059. if (this.tn.skip("("),
  33060. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  33061. t = this.tn.next()),
  33062. !a.TYPEREF.test(t))
  33063. throw Error("illegal rpc service request type: " + t);
  33064. if (n.request = t,
  33065. this.tn.skip(")"),
  33066. "returns" !== (t = this.tn.next()).toLowerCase())
  33067. throw Error("illegal rpc service request type delimiter: " + t);
  33068. if (this.tn.skip("("),
  33069. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  33070. t = this.tn.next()),
  33071. n.response = t,
  33072. this.tn.skip(")"),
  33073. "{" === (t = this.tn.peek())) {
  33074. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  33075. if ("option" !== t)
  33076. throw Error("illegal rpc service token: " + t);
  33077. this._parseOption(n)
  33078. }
  33079. this.tn.omit(";")
  33080. } else
  33081. this.tn.skip(";");
  33082. void 0 === e.rpc && (e.rpc = {}),
  33083. e.rpc[i] = n
  33084. }
  33085. ,
  33086. c._parseMessage = function(e, t) {
  33087. var i = !!t
  33088. , n = this.tn.next()
  33089. , r = {
  33090. name: "",
  33091. fields: [],
  33092. enums: [],
  33093. messages: [],
  33094. options: {},
  33095. services: [],
  33096. oneofs: {}
  33097. };
  33098. if (!a.NAME.test(n))
  33099. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  33100. for (r.name = n,
  33101. i && (this.tn.skip("="),
  33102. t.id = s(this.tn.next()),
  33103. r.isGroup = !0),
  33104. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  33105. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  33106. if (a.RULE.test(n))
  33107. this._parseMessageField(r, n);
  33108. else if ("oneof" === n)
  33109. this._parseMessageOneOf(r);
  33110. else if ("enum" === n)
  33111. this._parseEnum(r);
  33112. else if ("message" === n)
  33113. this._parseMessage(r);
  33114. else if ("option" === n)
  33115. this._parseOption(r);
  33116. else if ("service" === n)
  33117. this._parseService(r);
  33118. else if ("extensions" === n)
  33119. r.extensions = this._parseExtensionRanges();
  33120. else if ("reserved" === n)
  33121. this._parseIgnored();
  33122. else if ("extend" === n)
  33123. this._parseExtend(r);
  33124. else {
  33125. if (!a.TYPEREF.test(n))
  33126. throw Error("illegal message token: " + n);
  33127. if (!this.proto3)
  33128. throw Error("illegal field rule: " + n);
  33129. this._parseMessageField(r, "optional", n)
  33130. }
  33131. return this.tn.omit(";"),
  33132. e.messages.push(r),
  33133. r
  33134. }
  33135. ,
  33136. c._parseIgnored = function() {
  33137. for (; ";" !== this.tn.peek(); )
  33138. this.tn.next();
  33139. this.tn.skip(";")
  33140. }
  33141. ,
  33142. c._parseMessageField = function(e, t, i) {
  33143. if (!a.RULE.test(t))
  33144. throw Error("illegal message field rule: " + t);
  33145. var n, r = {
  33146. rule: t,
  33147. type: "",
  33148. name: "",
  33149. options: {},
  33150. id: 0
  33151. };
  33152. if ("map" === t) {
  33153. if (i)
  33154. throw Error("illegal type: " + i);
  33155. if (this.tn.skip("<"),
  33156. n = this.tn.next(),
  33157. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33158. throw Error("illegal message field type: " + n);
  33159. if (r.keytype = n,
  33160. this.tn.skip(","),
  33161. n = this.tn.next(),
  33162. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  33163. throw Error("illegal message field: " + n);
  33164. if (r.type = n,
  33165. this.tn.skip(">"),
  33166. n = this.tn.next(),
  33167. !a.NAME.test(n))
  33168. throw Error("illegal message field name: " + n);
  33169. r.name = n,
  33170. this.tn.skip("="),
  33171. r.id = s(this.tn.next()),
  33172. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33173. this.tn.skip(";")
  33174. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  33175. var o = this._parseMessage(e, r);
  33176. if (!/^[A-Z]/.test(o.name))
  33177. throw Error("illegal group name: " + o.name);
  33178. r.type = o.name,
  33179. r.name = o.name.toLowerCase(),
  33180. this.tn.omit(";")
  33181. } else {
  33182. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  33183. throw Error("illegal message field type: " + i);
  33184. if (r.type = i,
  33185. n = this.tn.next(),
  33186. !a.NAME.test(n))
  33187. throw Error("illegal message field name: " + n);
  33188. r.name = n,
  33189. this.tn.skip("="),
  33190. r.id = s(this.tn.next()),
  33191. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  33192. this.tn.skip(";")
  33193. }
  33194. return e.fields.push(r),
  33195. r
  33196. }
  33197. ,
  33198. c._parseMessageOneOf = function(e) {
  33199. var t = this.tn.next();
  33200. if (!a.NAME.test(t))
  33201. throw Error("illegal oneof name: " + t);
  33202. var i, n = t, r = [];
  33203. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33204. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  33205. r.push(i.id);
  33206. this.tn.omit(";"),
  33207. e.oneofs[n] = r
  33208. }
  33209. ,
  33210. c._parseFieldOptions = function(e) {
  33211. this.tn.skip("[");
  33212. for (var t = !0; "]" !== this.tn.peek(); )
  33213. t || this.tn.skip(","),
  33214. this._parseOption(e, !0),
  33215. t = !1;
  33216. this.tn.next()
  33217. }
  33218. ,
  33219. c._parseEnum = function(e) {
  33220. var t = {
  33221. name: "",
  33222. values: [],
  33223. options: {}
  33224. }
  33225. , i = this.tn.next();
  33226. if (!a.NAME.test(i))
  33227. throw Error("illegal name: " + i);
  33228. for (t.name = i,
  33229. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33230. if ("option" === i)
  33231. this._parseOption(t);
  33232. else {
  33233. if (!a.NAME.test(i))
  33234. throw Error("illegal name: " + i);
  33235. this.tn.skip("=");
  33236. var n = {
  33237. name: i,
  33238. id: s(this.tn.next(), !0)
  33239. };
  33240. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  33241. options: {}
  33242. }),
  33243. this.tn.skip(";"),
  33244. t.values.push(n)
  33245. }
  33246. this.tn.omit(";"),
  33247. e.enums.push(t)
  33248. }
  33249. ,
  33250. c._parseExtensionRanges = function() {
  33251. var e, t, i, n = [];
  33252. do {
  33253. for (t = []; ; ) {
  33254. switch (e = this.tn.next()) {
  33255. case "min":
  33256. i = r.ID_MIN;
  33257. break;
  33258. case "max":
  33259. i = r.ID_MAX;
  33260. break;
  33261. default:
  33262. i = o(e)
  33263. }
  33264. if (t.push(i),
  33265. 2 === t.length)
  33266. break;
  33267. if ("to" !== this.tn.peek()) {
  33268. t.push(i);
  33269. break
  33270. }
  33271. this.tn.next()
  33272. }
  33273. n.push(t)
  33274. } while (this.tn.omit(","));return this.tn.skip(";"),
  33275. n
  33276. }
  33277. ,
  33278. c._parseExtend = function(e) {
  33279. var t = this.tn.next();
  33280. if (!a.TYPEREF.test(t))
  33281. throw Error("illegal extend reference: " + t);
  33282. var i = {
  33283. ref: t,
  33284. fields: []
  33285. };
  33286. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  33287. if (a.RULE.test(t))
  33288. this._parseMessageField(i, t);
  33289. else {
  33290. if (!a.TYPEREF.test(t))
  33291. throw Error("illegal extend token: " + t);
  33292. if (!this.proto3)
  33293. throw Error("illegal field rule: " + t);
  33294. this._parseMessageField(i, "optional", t)
  33295. }
  33296. return this.tn.omit(";"),
  33297. e.messages.push(i),
  33298. i
  33299. }
  33300. ,
  33301. c.toString = function() {
  33302. return "Parser at line " + this.tn.line
  33303. }
  33304. ,
  33305. e.Parser = l,
  33306. e
  33307. }(o, o.Lang),
  33308. o.Reflect = function(g) {
  33309. function a(e, t) {
  33310. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  33311. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  33312. if ("string" == typeof e)
  33313. return g.Long.fromString(e, t || !1, 10);
  33314. if ("number" == typeof e)
  33315. return g.Long.fromNumber(e, t || !1);
  33316. throw Error("not convertible to Long")
  33317. }
  33318. function m(e, t) {
  33319. var i = t.readVarint32()
  33320. , n = 7 & i
  33321. , r = i >>> 3;
  33322. switch (n) {
  33323. case g.WIRE_TYPES.VARINT:
  33324. for (; 128 == (128 & (i = t.readUint8())); )
  33325. ;
  33326. break;
  33327. case g.WIRE_TYPES.BITS64:
  33328. t.offset += 8;
  33329. break;
  33330. case g.WIRE_TYPES.LDELIM:
  33331. i = t.readVarint32(),
  33332. t.offset += i;
  33333. break;
  33334. case g.WIRE_TYPES.STARTGROUP:
  33335. m(r, t);
  33336. break;
  33337. case g.WIRE_TYPES.ENDGROUP:
  33338. if (r === e)
  33339. return !1;
  33340. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  33341. case g.WIRE_TYPES.BITS32:
  33342. t.offset += 4;
  33343. break;
  33344. default:
  33345. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  33346. }
  33347. return !0
  33348. }
  33349. function h(e, t, i) {
  33350. this.builder = e,
  33351. this.parent = t,
  33352. this.name = i,
  33353. this.className
  33354. }
  33355. var s = {}
  33356. , e = h.prototype;
  33357. e.fqn = function() {
  33358. for (var e = this.name, t = this; null != (t = t.parent); )
  33359. e = t.name + "." + e;
  33360. return e
  33361. }
  33362. ,
  33363. e.toString = function(e) {
  33364. return (e ? this.className + " " : "") + this.fqn()
  33365. }
  33366. ,
  33367. e.build = function() {
  33368. throw Error(this.toString(!0) + " cannot be built directly")
  33369. }
  33370. ,
  33371. s.T = h;
  33372. function l(e, t, i, n, r) {
  33373. h.call(this, e, t, i),
  33374. this.className = "Namespace",
  33375. this.children = [],
  33376. this.options = n || {},
  33377. this.syntax = r || "proto2"
  33378. }
  33379. var t = l.prototype = Object.create(h.prototype);
  33380. t.getChildren = function(e) {
  33381. if (null == (e = e || null))
  33382. return this.children.slice();
  33383. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33384. this.children[i]instanceof e && t.push(this.children[i]);
  33385. return t
  33386. }
  33387. ,
  33388. t.addChild = function(e) {
  33389. var t;
  33390. if (t = this.getChild(e.name))
  33391. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33392. t.name = t.originalName;
  33393. else {
  33394. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33395. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33396. e.name = e.originalName
  33397. }
  33398. this.children.push(e)
  33399. }
  33400. ,
  33401. t.getChild = function(e) {
  33402. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33403. if (this.children[i][t] === e)
  33404. return this.children[i];
  33405. return null
  33406. }
  33407. ,
  33408. t.resolve = function(e, t) {
  33409. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  33410. if ("" === n[o]) {
  33411. for (; null !== r.parent; )
  33412. r = r.parent;
  33413. o++
  33414. }
  33415. do {
  33416. do {
  33417. if (!(r instanceof s.Namespace)) {
  33418. r = null;
  33419. break
  33420. }
  33421. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  33422. r = null;
  33423. break
  33424. }
  33425. r = i,
  33426. o++
  33427. } while (o < n.length);if (null != r)
  33428. break;
  33429. if (null !== this.parent)
  33430. return this.parent.resolve(e, t)
  33431. } while (null != r);return r
  33432. }
  33433. ,
  33434. t.qn = function(e) {
  33435. for (var t = [], i = e; t.unshift(i.name),
  33436. null !== (i = i.parent); )
  33437. ;
  33438. for (var n = 1; n <= t.length; n++) {
  33439. var r = t.slice(t.length - n);
  33440. if (e === this.resolve(r, e instanceof s.Namespace))
  33441. return r.join(".")
  33442. }
  33443. return e.fqn()
  33444. }
  33445. ,
  33446. t.build = function() {
  33447. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33448. (e = i[n])instanceof l && (t[e.name] = e.build());
  33449. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33450. value: this.buildOpt()
  33451. }),
  33452. t
  33453. }
  33454. ,
  33455. t.buildOpt = function() {
  33456. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33457. var r = t[i]
  33458. , o = this.options[t[i]];
  33459. e[r] = o
  33460. }
  33461. return e
  33462. }
  33463. ,
  33464. t.getOption = function(e) {
  33465. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  33466. }
  33467. ,
  33468. s.Namespace = l;
  33469. function u(e, t, i, n) {
  33470. if (this.type = e,
  33471. this.resolvedType = t,
  33472. this.isMapKey = i,
  33473. this.syntax = n,
  33474. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  33475. throw Error("Invalid map key type: " + e.name)
  33476. }
  33477. var i = u.prototype;
  33478. u.defaultFieldValue = function(e) {
  33479. if ("string" == typeof e && (e = g.TYPES[e]),
  33480. void 0 === e.defaultValue)
  33481. throw Error("default value for type " + e.name + " is not supported");
  33482. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  33483. }
  33484. ,
  33485. i.verifyValue = function(t) {
  33486. function i(e, t) {
  33487. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33488. }
  33489. var n = this;
  33490. switch (this.type) {
  33491. case g.TYPES.int32:
  33492. case g.TYPES.sint32:
  33493. case g.TYPES.sfixed32:
  33494. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33495. 4294967295 < t ? 0 | t : t;
  33496. case g.TYPES.uint32:
  33497. case g.TYPES.fixed32:
  33498. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33499. t < 0 ? t >>> 0 : t;
  33500. case g.TYPES.int64:
  33501. case g.TYPES.sint64:
  33502. case g.TYPES.sfixed64:
  33503. if (g.Long)
  33504. try {
  33505. return a(t, !1)
  33506. } catch (e) {
  33507. i(typeof t, e.message)
  33508. }
  33509. else
  33510. i(typeof t, "requires Long.js");
  33511. case g.TYPES.uint64:
  33512. case g.TYPES.fixed64:
  33513. if (g.Long)
  33514. try {
  33515. return a(t, !0)
  33516. } catch (e) {
  33517. i(typeof t, e.message)
  33518. }
  33519. else
  33520. i(typeof t, "requires Long.js");
  33521. case g.TYPES.bool:
  33522. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33523. t;
  33524. case g.TYPES.float:
  33525. case g.TYPES.double:
  33526. return "number" != typeof t && i(typeof t, "not a number"),
  33527. t;
  33528. case g.TYPES.string:
  33529. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33530. "" + t;
  33531. case g.TYPES.bytes:
  33532. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33533. case g.TYPES.enum:
  33534. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33535. for (o = 0; o < e.length; o++) {
  33536. if (e[o].name == t)
  33537. return e[o].id;
  33538. if (e[o].id == t)
  33539. return e[o].id
  33540. }
  33541. if ("proto3" === this.syntax)
  33542. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33543. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33544. t;
  33545. i(t, "not a valid enum value");
  33546. case g.TYPES.group:
  33547. case g.TYPES.message:
  33548. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33549. t instanceof this.resolvedType.clazz)
  33550. return t;
  33551. if (t instanceof g.Builder.Message) {
  33552. var r = {};
  33553. for (var o in t)
  33554. t.hasOwnProperty(o) && (r[o] = t[o]);
  33555. t = r
  33556. }
  33557. return new this.resolvedType.clazz(t)
  33558. }
  33559. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33560. }
  33561. ,
  33562. i.calculateLength = function(e, t) {
  33563. if (null === t)
  33564. return 0;
  33565. var i;
  33566. switch (this.type) {
  33567. case g.TYPES.int32:
  33568. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33569. case g.TYPES.uint32:
  33570. return I.calculateVarint32(t);
  33571. case g.TYPES.sint32:
  33572. return I.calculateVarint32(I.zigZagEncode32(t));
  33573. case g.TYPES.fixed32:
  33574. case g.TYPES.sfixed32:
  33575. case g.TYPES.float:
  33576. return 4;
  33577. case g.TYPES.int64:
  33578. case g.TYPES.uint64:
  33579. return I.calculateVarint64(t);
  33580. case g.TYPES.sint64:
  33581. return I.calculateVarint64(I.zigZagEncode64(t));
  33582. case g.TYPES.fixed64:
  33583. case g.TYPES.sfixed64:
  33584. return 8;
  33585. case g.TYPES.bool:
  33586. return 1;
  33587. case g.TYPES.enum:
  33588. return I.calculateVarint32(t);
  33589. case g.TYPES.double:
  33590. return 8;
  33591. case g.TYPES.string:
  33592. return i = I.calculateUTF8Bytes(t),
  33593. I.calculateVarint32(i) + i;
  33594. case g.TYPES.bytes:
  33595. if (t.remaining() < 0)
  33596. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33597. return I.calculateVarint32(t.remaining()) + t.remaining();
  33598. case g.TYPES.message:
  33599. return i = this.resolvedType.calculate(t),
  33600. I.calculateVarint32(i) + i;
  33601. case g.TYPES.group:
  33602. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33603. }
  33604. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33605. }
  33606. ,
  33607. i.encodeValue = function(e, t, i) {
  33608. if (null === t)
  33609. return i;
  33610. switch (this.type) {
  33611. case g.TYPES.int32:
  33612. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33613. break;
  33614. case g.TYPES.uint32:
  33615. i.writeVarint32(t);
  33616. break;
  33617. case g.TYPES.sint32:
  33618. i.writeVarint32ZigZag(t);
  33619. break;
  33620. case g.TYPES.fixed32:
  33621. i.writeUint32(t);
  33622. break;
  33623. case g.TYPES.sfixed32:
  33624. i.writeInt32(t);
  33625. break;
  33626. case g.TYPES.int64:
  33627. case g.TYPES.uint64:
  33628. i.writeVarint64(t);
  33629. break;
  33630. case g.TYPES.sint64:
  33631. i.writeVarint64ZigZag(t);
  33632. break;
  33633. case g.TYPES.fixed64:
  33634. i.writeUint64(t);
  33635. break;
  33636. case g.TYPES.sfixed64:
  33637. i.writeInt64(t);
  33638. break;
  33639. case g.TYPES.bool:
  33640. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33641. break;
  33642. case g.TYPES.enum:
  33643. i.writeVarint32(t);
  33644. break;
  33645. case g.TYPES.float:
  33646. i.writeFloat32(t);
  33647. break;
  33648. case g.TYPES.double:
  33649. i.writeFloat64(t);
  33650. break;
  33651. case g.TYPES.string:
  33652. i.writeVString(t);
  33653. break;
  33654. case g.TYPES.bytes:
  33655. if (t.remaining() < 0)
  33656. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33657. var n = t.offset;
  33658. i.writeVarint32(t.remaining()),
  33659. i.append(t),
  33660. t.offset = n;
  33661. break;
  33662. case g.TYPES.message:
  33663. var r = (new I).LE();
  33664. this.resolvedType.encode(t, r),
  33665. i.writeVarint32(r.offset),
  33666. i.append(r.flip());
  33667. break;
  33668. case g.TYPES.group:
  33669. this.resolvedType.encode(t, i),
  33670. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33671. break;
  33672. default:
  33673. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33674. }
  33675. return i
  33676. }
  33677. ,
  33678. i.decode = function(e, t, i) {
  33679. if (t != this.type.wireType)
  33680. throw Error("Unexpected wire type for element");
  33681. var n, r;
  33682. switch (this.type) {
  33683. case g.TYPES.int32:
  33684. return 0 | e.readVarint32();
  33685. case g.TYPES.uint32:
  33686. return e.readVarint32() >>> 0;
  33687. case g.TYPES.sint32:
  33688. return 0 | e.readVarint32ZigZag();
  33689. case g.TYPES.fixed32:
  33690. return e.readUint32() >>> 0;
  33691. case g.TYPES.sfixed32:
  33692. return 0 | e.readInt32();
  33693. case g.TYPES.int64:
  33694. return e.readVarint64();
  33695. case g.TYPES.uint64:
  33696. return e.readVarint64().toUnsigned();
  33697. case g.TYPES.sint64:
  33698. return e.readVarint64ZigZag();
  33699. case g.TYPES.fixed64:
  33700. return e.readUint64();
  33701. case g.TYPES.sfixed64:
  33702. return e.readInt64();
  33703. case g.TYPES.bool:
  33704. return !!e.readVarint32();
  33705. case g.TYPES.enum:
  33706. return e.readVarint32();
  33707. case g.TYPES.float:
  33708. return e.readFloat();
  33709. case g.TYPES.double:
  33710. return e.readDouble();
  33711. case g.TYPES.string:
  33712. return e.readVString();
  33713. case g.TYPES.bytes:
  33714. if (r = e.readVarint32(),
  33715. e.remaining() < r)
  33716. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33717. return (n = e.clone()).limit = n.offset + r,
  33718. e.offset += r,
  33719. n;
  33720. case g.TYPES.message:
  33721. return r = e.readVarint32(),
  33722. this.resolvedType.decode(e, r);
  33723. case g.TYPES.group:
  33724. return this.resolvedType.decode(e, -1, i)
  33725. }
  33726. throw Error("[INTERNAL] Illegal decode type")
  33727. }
  33728. ,
  33729. i.valueFromString = function(e) {
  33730. if (!this.isMapKey)
  33731. throw Error("valueFromString() called on non-map-key element");
  33732. switch (this.type) {
  33733. case g.TYPES.int32:
  33734. case g.TYPES.sint32:
  33735. case g.TYPES.sfixed32:
  33736. case g.TYPES.uint32:
  33737. case g.TYPES.fixed32:
  33738. return this.verifyValue(parseInt(e));
  33739. case g.TYPES.int64:
  33740. case g.TYPES.sint64:
  33741. case g.TYPES.sfixed64:
  33742. case g.TYPES.uint64:
  33743. case g.TYPES.fixed64:
  33744. return this.verifyValue(e);
  33745. case g.TYPES.bool:
  33746. return "true" === e;
  33747. case g.TYPES.string:
  33748. return this.verifyValue(e);
  33749. case g.TYPES.bytes:
  33750. return I.fromBinary(e)
  33751. }
  33752. }
  33753. ,
  33754. i.valueToString = function(e) {
  33755. if (!this.isMapKey)
  33756. throw Error("valueToString() called on non-map-key element");
  33757. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33758. }
  33759. ,
  33760. s.Element = u;
  33761. var d = function(e, t, i, n, r, o) {
  33762. l.call(this, e, t, i, n, o),
  33763. this.className = "Message",
  33764. this.extensions = void 0,
  33765. this.clazz = null,
  33766. this.isGroup = !!r,
  33767. this._fields = null,
  33768. this._fieldsById = null,
  33769. this._fieldsByName = null
  33770. }
  33771. , n = d.prototype = Object.create(l.prototype);
  33772. n.build = function(e) {
  33773. if (this.clazz && !e)
  33774. return this.clazz;
  33775. var t = function(u, a) {
  33776. function d(e, i, n, r) {
  33777. if (null === e || "object" != typeof e) {
  33778. if (r && r instanceof u.Reflect.Enum) {
  33779. var t = u.Reflect.Enum.getName(r.object, e);
  33780. if (null !== t)
  33781. return t
  33782. }
  33783. return e
  33784. }
  33785. if (I.isByteBuffer(e))
  33786. return i ? e.toBase64() : e.toBuffer();
  33787. if (u.Long.isLong(e))
  33788. return n ? e.toString() : u.Long.fromValue(e);
  33789. var o;
  33790. if (Array.isArray(e))
  33791. return o = [],
  33792. e.forEach(function(e, t) {
  33793. o[t] = d(e, i, n, r)
  33794. }),
  33795. o;
  33796. if (o = {},
  33797. e instanceof u.Map) {
  33798. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33799. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33800. return o
  33801. }
  33802. var l = e.$type
  33803. , c = void 0;
  33804. for (var h in e)
  33805. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33806. return o
  33807. }
  33808. var s = a.getChildren(u.Reflect.Message.Field)
  33809. , l = a.getChildren(u.Reflect.Message.OneOf)
  33810. , c = function(e, t) {
  33811. u.Builder.Message.call(this);
  33812. for (var i = 0, n = l.length; i < n; ++i)
  33813. this[l[i].name] = null;
  33814. for (i = 0,
  33815. n = s.length; i < n; ++i) {
  33816. var r = s[i];
  33817. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33818. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33819. }
  33820. var o;
  33821. if (0 < arguments.length)
  33822. 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)
  33823. for (i = 0,
  33824. n = arguments.length; i < n; ++i)
  33825. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33826. else
  33827. this.$set(e)
  33828. }
  33829. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33830. o.add = function(e, t, i) {
  33831. var n = a._fieldsByName[e];
  33832. if (!i) {
  33833. if (!n)
  33834. throw Error(this + "#" + e + " is undefined");
  33835. if (!(n instanceof u.Reflect.Message.Field))
  33836. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33837. if (!n.repeated)
  33838. throw Error(this + "#" + e + " is not a repeated field");
  33839. t = n.verifyValue(t, !0)
  33840. }
  33841. return null === this[e] && (this[e] = []),
  33842. this[e].push(t),
  33843. this
  33844. }
  33845. ,
  33846. o.$add = o.add,
  33847. o.set = function(e, t, i) {
  33848. if (e && "object" == typeof e) {
  33849. for (var n in i = t,
  33850. e)
  33851. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33852. return this
  33853. }
  33854. var r = a._fieldsByName[e];
  33855. if (i)
  33856. this[e] = t;
  33857. else {
  33858. if (!r)
  33859. throw Error(this + "#" + e + " is not a field: undefined");
  33860. if (!(r instanceof u.Reflect.Message.Field))
  33861. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33862. this[r.name] = t = r.verifyValue(t)
  33863. }
  33864. if (r && r.oneof) {
  33865. var o = this[r.oneof.name];
  33866. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33867. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33868. }
  33869. return this
  33870. }
  33871. ,
  33872. o.$set = o.set,
  33873. o.get = function(e, t) {
  33874. if (t)
  33875. return this[e];
  33876. var i = a._fieldsByName[e];
  33877. if (!(i && i instanceof u.Reflect.Message.Field))
  33878. throw Error(this + "#" + e + " is not a field: undefined");
  33879. if (!(i instanceof u.Reflect.Message.Field))
  33880. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33881. return this[i.name]
  33882. }
  33883. ,
  33884. o.$get = o.get;
  33885. for (var e = 0; e < s.length; e++) {
  33886. var t = s[e];
  33887. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33888. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33889. return e.toUpperCase().replace("_", "")
  33890. });
  33891. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33892. function t(e, t) {
  33893. return this[i.name] = t ? e : i.verifyValue(e),
  33894. this
  33895. }
  33896. function n() {
  33897. return this[i.name]
  33898. }
  33899. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33900. return "_" + e
  33901. });
  33902. null === a.getChild("set" + e) && (o["set" + e] = t),
  33903. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33904. null === a.getChild("get" + e) && (o["get" + e] = n),
  33905. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33906. }(t)
  33907. }
  33908. return o.encode = function(t, e) {
  33909. "boolean" == typeof t && (e = t,
  33910. t = void 0);
  33911. var i = !1;
  33912. t || (t = new I,
  33913. i = !0);
  33914. var n = t.littleEndian;
  33915. try {
  33916. return a.encode(this, t.LE(), e),
  33917. (i ? t.flip() : t).LE(n)
  33918. } catch (e) {
  33919. throw t.LE(n),
  33920. e
  33921. }
  33922. }
  33923. ,
  33924. c.encode = function(e, t, i) {
  33925. return new c(e).encode(t, i)
  33926. }
  33927. ,
  33928. o.calculate = function() {
  33929. return a.calculate(this)
  33930. }
  33931. ,
  33932. o.encodeDelimited = function(e, t) {
  33933. var i = !1;
  33934. e || (e = new I,
  33935. i = !0);
  33936. var n = (new I).LE();
  33937. return a.encode(this, n, t).flip(),
  33938. e.writeVarint32(n.remaining()),
  33939. e.append(n),
  33940. i ? e.flip() : e
  33941. }
  33942. ,
  33943. o.encodeAB = function() {
  33944. try {
  33945. return this.encode().toArrayBuffer()
  33946. } catch (e) {
  33947. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33948. e
  33949. }
  33950. }
  33951. ,
  33952. o.toArrayBuffer = o.encodeAB,
  33953. o.encodeNB = function() {
  33954. try {
  33955. return this.encode().toBuffer()
  33956. } catch (e) {
  33957. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33958. e
  33959. }
  33960. }
  33961. ,
  33962. o.toBuffer = o.encodeNB,
  33963. o.encode64 = function() {
  33964. try {
  33965. return this.encode().toBase64()
  33966. } catch (e) {
  33967. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33968. e
  33969. }
  33970. }
  33971. ,
  33972. o.toBase64 = o.encode64,
  33973. o.encodeHex = function() {
  33974. try {
  33975. return this.encode().toHex()
  33976. } catch (e) {
  33977. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33978. e
  33979. }
  33980. }
  33981. ,
  33982. o.toHex = o.encodeHex,
  33983. o.toRaw = function(e, t) {
  33984. return d(this, !!e, !!t, this.$type)
  33985. }
  33986. ,
  33987. o.encodeJSON = function() {
  33988. return JSON.stringify(d(this, !0, !0, this.$type))
  33989. }
  33990. ,
  33991. c.decode = function(t, e, i) {
  33992. "string" == typeof e && (i = e,
  33993. e = -1),
  33994. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33995. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33996. try {
  33997. var r = a.decode(t.LE());
  33998. return t.LE(n),
  33999. r
  34000. } catch (e) {
  34001. throw t.LE(n),
  34002. e
  34003. }
  34004. }
  34005. ,
  34006. c.decodeDelimited = function(t, e) {
  34007. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  34008. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  34009. return null;
  34010. var i = t.offset
  34011. , n = t.readVarint32();
  34012. if (t.remaining() < n)
  34013. return t.offset = i,
  34014. null;
  34015. try {
  34016. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  34017. return t.offset += n,
  34018. r
  34019. } catch (e) {
  34020. throw t.offset += n,
  34021. e
  34022. }
  34023. }
  34024. ,
  34025. c.decode64 = function(e) {
  34026. return c.decode(e, "base64")
  34027. }
  34028. ,
  34029. c.decodeHex = function(e) {
  34030. return c.decode(e, "hex")
  34031. }
  34032. ,
  34033. c.decodeJSON = function(e) {
  34034. return new c(JSON.parse(e))
  34035. }
  34036. ,
  34037. o.toString = function() {
  34038. return a.toString()
  34039. }
  34040. ,
  34041. Object.defineProperty && (Object.defineProperty(c, "$options", {
  34042. value: a.buildOpt()
  34043. }),
  34044. Object.defineProperty(o, "$options", {
  34045. value: c.$options
  34046. }),
  34047. Object.defineProperty(c, "$type", {
  34048. value: a
  34049. }),
  34050. Object.defineProperty(o, "$type", {
  34051. value: a
  34052. })),
  34053. c
  34054. }(g, this);
  34055. this._fields = [],
  34056. this._fieldsById = {},
  34057. this._fieldsByName = {};
  34058. for (var i, n = 0, r = this.children.length; n < r; n++)
  34059. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  34060. if (t.hasOwnProperty(i.name))
  34061. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  34062. t[i.name] = i.build()
  34063. } else if (i instanceof d.Field)
  34064. i.build(),
  34065. this._fields.push(i),
  34066. this._fieldsById[i.id] = i,
  34067. this._fieldsByName[i.name] = i;
  34068. else if (!(i instanceof d.OneOf || i instanceof v))
  34069. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  34070. return this.clazz = t
  34071. }
  34072. ,
  34073. n.encode = function(e, t, i) {
  34074. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34075. r = e[(n = this._fields[a]).name],
  34076. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  34077. if (null === o)
  34078. return t;
  34079. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  34080. throw l.encoded = t,
  34081. l
  34082. }
  34083. ,
  34084. n.calculate = function(e) {
  34085. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34086. if (i = e[(t = this._fields[r]).name],
  34087. t.required && null === i)
  34088. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  34089. n += t.calculate(i, e)
  34090. }
  34091. return n
  34092. }
  34093. ,
  34094. n.decode = function(e, t, i) {
  34095. t = "number" == typeof t ? t : -1;
  34096. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  34097. if (o = (n = e.readVarint32()) >>> 3,
  34098. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  34099. if (o !== i)
  34100. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  34101. break
  34102. }
  34103. if (a = this._fieldsById[o]) {
  34104. if (a.repeated && !a.options.packed)
  34105. l[a.name].push(a.decode(r, e));
  34106. else if (a.map) {
  34107. var c = a.decode(r, e);
  34108. l[a.name].set(c[0], c[1])
  34109. } else if (l[a.name] = a.decode(r, e),
  34110. a.oneof) {
  34111. var h = l[a.oneof.name];
  34112. null !== h && h !== a.name && (l[h] = null),
  34113. l[a.oneof.name] = a.name
  34114. }
  34115. } else
  34116. switch (r) {
  34117. case g.WIRE_TYPES.VARINT:
  34118. e.readVarint32();
  34119. break;
  34120. case g.WIRE_TYPES.BITS32:
  34121. e.offset += 4;
  34122. break;
  34123. case g.WIRE_TYPES.BITS64:
  34124. e.offset += 8;
  34125. break;
  34126. case g.WIRE_TYPES.LDELIM:
  34127. var u = e.readVarint32();
  34128. e.offset += u;
  34129. break;
  34130. case g.WIRE_TYPES.STARTGROUP:
  34131. for (; m(o, e); )
  34132. ;
  34133. break;
  34134. default:
  34135. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  34136. }
  34137. }
  34138. for (var d = 0, p = this._fields.length; d < p; ++d)
  34139. if (null === l[(a = this._fields[d]).name])
  34140. if ("proto3" === this.syntax)
  34141. l[a.name] = a.defaultValue;
  34142. else {
  34143. if (a.required) {
  34144. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  34145. throw f.decoded = l,
  34146. f
  34147. }
  34148. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  34149. }
  34150. return l
  34151. }
  34152. ,
  34153. s.Message = d;
  34154. function c(e, t, i, n, r, o, a, s, l, c) {
  34155. h.call(this, e, t, o),
  34156. this.className = "Message.Field",
  34157. this.required = "required" === i,
  34158. this.repeated = "repeated" === i,
  34159. this.map = "map" === i,
  34160. this.keyType = n || null,
  34161. this.type = r,
  34162. this.resolvedType = null,
  34163. this.id = a,
  34164. this.options = s || {},
  34165. this.defaultValue = null,
  34166. this.oneof = l || null,
  34167. this.syntax = c || "proto2",
  34168. this.originalName = this.name,
  34169. this.element = null,
  34170. this.keyElement = null,
  34171. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  34172. }
  34173. var r = c.prototype = Object.create(h.prototype);
  34174. r.build = function() {
  34175. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  34176. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  34177. "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)
  34178. }
  34179. ,
  34180. r.verifyValue = function(e, t) {
  34181. function i(e, t) {
  34182. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  34183. }
  34184. t = t || !1;
  34185. var n, r = this;
  34186. if (null === e)
  34187. return this.required && i(typeof e, "required"),
  34188. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  34189. null;
  34190. if (!this.repeated || t)
  34191. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  34192. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  34193. this.element.verifyValue(e));
  34194. Array.isArray(e) || (e = [e]);
  34195. var o = [];
  34196. for (n = 0; n < e.length; n++)
  34197. o.push(this.element.verifyValue(e[n]));
  34198. return o
  34199. }
  34200. ,
  34201. r.hasWirePresence = function(e, t) {
  34202. if ("proto3" !== this.syntax)
  34203. return null !== e;
  34204. if (this.oneof && t[this.oneof.name] === this.name)
  34205. return !0;
  34206. switch (this.type) {
  34207. case g.TYPES.int32:
  34208. case g.TYPES.sint32:
  34209. case g.TYPES.sfixed32:
  34210. case g.TYPES.uint32:
  34211. case g.TYPES.fixed32:
  34212. return 0 !== e;
  34213. case g.TYPES.int64:
  34214. case g.TYPES.sint64:
  34215. case g.TYPES.sfixed64:
  34216. case g.TYPES.uint64:
  34217. case g.TYPES.fixed64:
  34218. return 0 !== e.low || 0 !== e.high;
  34219. case g.TYPES.bool:
  34220. return e;
  34221. case g.TYPES.float:
  34222. case g.TYPES.double:
  34223. return 0 !== e;
  34224. case g.TYPES.string:
  34225. return 0 < e.length;
  34226. case g.TYPES.bytes:
  34227. return 0 < e.remaining();
  34228. case g.TYPES.enum:
  34229. return 0 !== e;
  34230. case g.TYPES.message:
  34231. return null !== e;
  34232. default:
  34233. return !0
  34234. }
  34235. }
  34236. ,
  34237. r.encode = function(t, r, e) {
  34238. if (null === this.type || "object" != typeof this.type)
  34239. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34240. if (null === t || this.repeated && 0 == t.length)
  34241. return r;
  34242. try {
  34243. var i;
  34244. if (this.repeated)
  34245. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34246. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34247. r.ensureCapacity(r.offset += 1);
  34248. var n = r.offset;
  34249. for (i = 0; i < t.length; i++)
  34250. this.element.encodeValue(this.id, t[i], r);
  34251. var o = r.offset - n
  34252. , a = I.calculateVarint32(o);
  34253. if (1 < a) {
  34254. var s = r.slice(n, r.offset);
  34255. n += a - 1,
  34256. r.offset = n,
  34257. r.append(s)
  34258. }
  34259. r.writeVarint32(o, n - a)
  34260. } else
  34261. for (i = 0; i < t.length; i++)
  34262. r.writeVarint32(this.id << 3 | this.type.wireType),
  34263. this.element.encodeValue(this.id, t[i], r);
  34264. else
  34265. this.map ? t.forEach(function(e, t, i) {
  34266. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34267. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34268. r.writeVarint32(n),
  34269. r.writeVarint32(8 | this.keyType.wireType),
  34270. this.keyElement.encodeValue(1, t, r),
  34271. r.writeVarint32(16 | this.type.wireType),
  34272. this.element.encodeValue(2, e, r)
  34273. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  34274. this.element.encodeValue(this.id, t, r))
  34275. } catch (e) {
  34276. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34277. }
  34278. return r
  34279. }
  34280. ,
  34281. r.calculate = function(t, e) {
  34282. if (t = this.verifyValue(t),
  34283. null === this.type || "object" != typeof this.type)
  34284. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34285. if (null === t || this.repeated && 0 == t.length)
  34286. return 0;
  34287. var r = 0;
  34288. try {
  34289. var i, n;
  34290. if (this.repeated)
  34291. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  34292. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34293. i = n = 0; i < t.length; i++)
  34294. n += this.element.calculateLength(this.id, t[i]);
  34295. r += I.calculateVarint32(n),
  34296. r += n
  34297. } else
  34298. for (i = 0; i < t.length; i++)
  34299. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34300. r += this.element.calculateLength(this.id, t[i]);
  34301. else
  34302. this.map ? t.forEach(function(e, t, i) {
  34303. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  34304. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  34305. r += I.calculateVarint32(n),
  34306. r += n
  34307. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  34308. r += this.element.calculateLength(this.id, t))
  34309. } catch (e) {
  34310. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  34311. }
  34312. return r
  34313. }
  34314. ,
  34315. r.decode = function(e, t, i) {
  34316. var n, r;
  34317. 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))
  34318. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  34319. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  34320. r = t.readVarint32(),
  34321. r = t.offset + r;
  34322. for (var o = []; t.offset < r; )
  34323. o.push(this.decode(this.type.wireType, t, !0));
  34324. return o
  34325. }
  34326. if (this.map) {
  34327. var a = u.defaultFieldValue(this.keyType);
  34328. if (n = u.defaultFieldValue(this.type),
  34329. r = t.readVarint32(),
  34330. t.remaining() < r)
  34331. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  34332. var s = t.clone();
  34333. for (s.limit = s.offset + r,
  34334. t.offset += r; 0 < s.remaining(); ) {
  34335. var l = s.readVarint32();
  34336. e = 7 & l;
  34337. var c = l >>> 3;
  34338. if (1 == c)
  34339. a = this.keyElement.decode(s, e, c);
  34340. else {
  34341. if (2 != c)
  34342. throw Error("Unexpected tag in map field key/value submessage");
  34343. n = this.element.decode(s, e, c)
  34344. }
  34345. }
  34346. return [a, n]
  34347. }
  34348. return this.element.decode(t, e, this.id)
  34349. }
  34350. ,
  34351. s.Message.Field = c;
  34352. function o(e, t, i, n, r, o, a) {
  34353. c.call(this, e, t, i, null, n, r, o, a),
  34354. this.extension
  34355. }
  34356. o.prototype = Object.create(c.prototype),
  34357. s.Message.ExtensionField = o;
  34358. s.Message.OneOf = function(e, t, i) {
  34359. h.call(this, e, t, i),
  34360. this.fields = []
  34361. }
  34362. ;
  34363. var p = function(e, t, i, n, r) {
  34364. l.call(this, e, t, i, n, r),
  34365. this.className = "Enum",
  34366. this.object = null
  34367. };
  34368. p.getName = function(e, t) {
  34369. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34370. if (e[i = n[r]] === t)
  34371. return i;
  34372. return null
  34373. }
  34374. ,
  34375. (p.prototype = Object.create(l.prototype)).build = function(e) {
  34376. if (this.object && !e)
  34377. return this.object;
  34378. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  34379. t[i[n].name] = i[n].id;
  34380. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34381. value: this.buildOpt(),
  34382. enumerable: !1
  34383. }),
  34384. this.object = t
  34385. }
  34386. ,
  34387. s.Enum = p;
  34388. function f(e, t, i, n) {
  34389. h.call(this, e, t, i),
  34390. this.className = "Enum.Value",
  34391. this.id = n
  34392. }
  34393. f.prototype = Object.create(h.prototype),
  34394. s.Enum.Value = f;
  34395. var v = function(e, t, i, n) {
  34396. h.call(this, e, t, i),
  34397. this.field = n
  34398. };
  34399. v.prototype = Object.create(h.prototype),
  34400. s.Extension = v;
  34401. var y = function(e, t, i, n) {
  34402. l.call(this, e, t, i, n),
  34403. this.className = "Service",
  34404. this.clazz = null
  34405. };
  34406. (y.prototype = Object.create(l.prototype)).build = function(e) {
  34407. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  34408. for (var o = function(e) {
  34409. t.Builder.Service.call(this),
  34410. this.rpcImpl = e || function(e, t, i) {
  34411. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34412. }
  34413. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  34414. !function(n) {
  34415. e[n.name] = function(e, i) {
  34416. try {
  34417. try {
  34418. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  34419. } catch (e) {
  34420. if (!(e instanceof TypeError))
  34421. throw e
  34422. }
  34423. if (null === e || "object" != typeof e)
  34424. throw Error("Illegal arguments");
  34425. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  34426. this.rpcImpl(n.fqn(), e, function(e, t) {
  34427. if (!e) {
  34428. null === t && (t = "");
  34429. try {
  34430. t = n.resolvedResponseType.clazz.decode(t)
  34431. } catch (e) {}
  34432. 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))
  34433. }
  34434. i(e)
  34435. })
  34436. } catch (e) {
  34437. setTimeout(i.bind(this, e), 0)
  34438. }
  34439. }
  34440. ,
  34441. o[n.name] = function(e, t, i) {
  34442. new o(e)[n.name](t, i)
  34443. }
  34444. ,
  34445. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  34446. value: n.buildOpt()
  34447. }),
  34448. Object.defineProperty(e[n.name], "$options", {
  34449. value: o[n.name].$options
  34450. }))
  34451. }(i[n]);
  34452. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  34453. value: r.buildOpt()
  34454. }),
  34455. Object.defineProperty(e, "$options", {
  34456. value: o.$options
  34457. }),
  34458. Object.defineProperty(o, "$type", {
  34459. value: r
  34460. }),
  34461. Object.defineProperty(e, "$type", {
  34462. value: r
  34463. })),
  34464. o
  34465. }(g, this)
  34466. }
  34467. ,
  34468. s.Service = y;
  34469. function A(e, t, i, n) {
  34470. h.call(this, e, t, i),
  34471. this.className = "Service.Method",
  34472. this.options = n || {}
  34473. }
  34474. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  34475. s.Service.Method = A;
  34476. function C(e, t, i, n, r, o, a, s) {
  34477. A.call(this, e, t, i, s),
  34478. this.className = "Service.RPCMethod",
  34479. this.requestName = n,
  34480. this.responseName = r,
  34481. this.requestStream = o,
  34482. this.responseStream = a,
  34483. this.resolvedRequestType = null,
  34484. this.resolvedResponseType = null
  34485. }
  34486. return C.prototype = Object.create(A.prototype),
  34487. s.Service.RPCMethod = C,
  34488. s
  34489. }(o),
  34490. o.Builder = (i = (u = o).Lang,
  34491. s = o.Reflect,
  34492. n = h.prototype,
  34493. h.isMessage = function(e) {
  34494. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34495. }
  34496. ,
  34497. h.isMessageField = function(e) {
  34498. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34499. }
  34500. ,
  34501. h.isEnum = function(e) {
  34502. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34503. }
  34504. ,
  34505. h.isService = function(e) {
  34506. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34507. }
  34508. ,
  34509. h.isExtend = function(e) {
  34510. return "string" == typeof e.ref
  34511. }
  34512. ,
  34513. n.reset = function() {
  34514. return this.ptr = this.ns,
  34515. this
  34516. }
  34517. ,
  34518. n.define = function(e) {
  34519. if ("string" != typeof e || !i.TYPEREF.test(e))
  34520. throw Error("illegal namespace: " + e);
  34521. return e.split(".").forEach(function(e) {
  34522. var t = this.ptr.getChild(e);
  34523. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34524. this.ptr = t
  34525. }, this),
  34526. this
  34527. }
  34528. ,
  34529. n.create = function(e) {
  34530. if (!e)
  34531. return this;
  34532. if (Array.isArray(e)) {
  34533. if (0 === e.length)
  34534. return this;
  34535. e = e.slice()
  34536. } else
  34537. e = [e];
  34538. for (var t = [e]; 0 < t.length; ) {
  34539. if (e = t.pop(),
  34540. !Array.isArray(e))
  34541. throw Error("not a valid namespace: " + JSON.stringify(e));
  34542. for (; 0 < e.length; ) {
  34543. var i = e.shift();
  34544. if (h.isMessage(i)) {
  34545. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34546. , n = {};
  34547. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34548. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34549. }, this),
  34550. i.fields && i.fields.forEach(function(e) {
  34551. if (null !== o.getChild(0 | e.id))
  34552. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34553. if (e.options && "object" != typeof e.options)
  34554. throw Error("illegal field options in " + o.name + "#" + e.name);
  34555. var t = null;
  34556. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34557. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34558. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34559. t && t.fields.push(e),
  34560. o.addChild(e)
  34561. }, this);
  34562. var r = [];
  34563. if (i.enums && i.enums.forEach(function(e) {
  34564. r.push(e)
  34565. }),
  34566. i.messages && i.messages.forEach(function(e) {
  34567. r.push(e)
  34568. }),
  34569. i.services && i.services.forEach(function(e) {
  34570. r.push(e)
  34571. }),
  34572. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34573. this.ptr.addChild(o),
  34574. 0 < r.length) {
  34575. t.push(e),
  34576. e = r,
  34577. r = null,
  34578. this.ptr = o,
  34579. o = null;
  34580. continue
  34581. }
  34582. r = null
  34583. } else if (h.isEnum(i))
  34584. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34585. i.values.forEach(function(e) {
  34586. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34587. }, this),
  34588. this.ptr.addChild(o);
  34589. else if (h.isService(i))
  34590. o = new s.Service(this,this.ptr,i.name,i.options),
  34591. Object.keys(i.rpc).forEach(function(e) {
  34592. var t = i.rpc[e];
  34593. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34594. }, this),
  34595. this.ptr.addChild(o);
  34596. else {
  34597. if (!h.isExtend(i))
  34598. throw Error("not a valid definition: " + JSON.stringify(i));
  34599. if (o = this.ptr.resolve(i.ref, !0))
  34600. i.fields.forEach(function(t) {
  34601. if (null !== o.getChild(0 | t.id))
  34602. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34603. if (o.extensions) {
  34604. var i = !1;
  34605. if (o.extensions.forEach(function(e) {
  34606. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34607. }),
  34608. !i)
  34609. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34610. }
  34611. var e = t.name;
  34612. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34613. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34614. , r = new s.Extension(this,this.ptr,t.name,n);
  34615. n.extension = r,
  34616. this.ptr.addChild(r),
  34617. o.addChild(n)
  34618. }, this);
  34619. else if (!/\.?google\.protobuf\./.test(i.ref))
  34620. throw Error("extended message " + i.ref + " is not defined")
  34621. }
  34622. o = i = null
  34623. }
  34624. e = null,
  34625. this.ptr = this.ptr.parent
  34626. }
  34627. return this.resolved = !1,
  34628. this.result = null,
  34629. this
  34630. }
  34631. ,
  34632. n.import = function(t, e) {
  34633. var i = "/";
  34634. if ("string" == typeof e) {
  34635. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34636. !0 === this.files[e])
  34637. return this.reset();
  34638. this.files[e] = !0
  34639. } else if ("object" == typeof e) {
  34640. var n = e.root;
  34641. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34642. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34643. var r = n + i + e.file;
  34644. if (!0 === this.files[r])
  34645. return this.reset();
  34646. this.files[r] = !0
  34647. }
  34648. if (t.imports && 0 < t.imports.length) {
  34649. var o, a = !1;
  34650. "object" == typeof e ? (this.importRoot = e.root,
  34651. a = !0,
  34652. o = this.importRoot,
  34653. e = e.file,
  34654. (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(/\\[^\\]*$/, ""),
  34655. i = "\\") : o = "." : o = null;
  34656. for (var s = 0; s < t.imports.length; s++)
  34657. if ("string" == typeof t.imports[s]) {
  34658. if (!o)
  34659. throw Error("cannot determine import root");
  34660. var l = t.imports[s];
  34661. if ("google/protobuf/descriptor.proto" === l)
  34662. continue;
  34663. if (l = o + i + l,
  34664. !0 === this.files[l])
  34665. continue;
  34666. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34667. var c = u.Util.fetch(l);
  34668. if (null === c)
  34669. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34670. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34671. } else
  34672. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34673. return t + "_import" + s + "." + i
  34674. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34675. a && (this.importRoot = null)
  34676. }
  34677. t.package && this.define(t.package),
  34678. t.syntax && function t(i) {
  34679. i.messages && i.messages.forEach(function(e) {
  34680. e.syntax = i.syntax,
  34681. t(e)
  34682. }),
  34683. i.enums && i.enums.forEach(function(e) {
  34684. e.syntax = i.syntax
  34685. })
  34686. }(t);
  34687. var h = this.ptr;
  34688. return t.options && Object.keys(t.options).forEach(function(e) {
  34689. h.options[e] = t.options[e]
  34690. }),
  34691. t.messages && (this.create(t.messages),
  34692. this.ptr = h),
  34693. t.enums && (this.create(t.enums),
  34694. this.ptr = h),
  34695. t.services && (this.create(t.services),
  34696. this.ptr = h),
  34697. t.extends && this.create(t.extends),
  34698. this.reset()
  34699. }
  34700. ,
  34701. n.resolveAll = function() {
  34702. var e;
  34703. if (null == this.ptr || "object" == typeof this.ptr.type)
  34704. return this;
  34705. if (this.ptr instanceof s.Namespace)
  34706. this.ptr.children.forEach(function(e) {
  34707. this.ptr = e,
  34708. this.resolveAll()
  34709. }, this);
  34710. else if (this.ptr instanceof s.Message.Field) {
  34711. if (i.TYPE.test(this.ptr.type))
  34712. this.ptr.type = u.TYPES[this.ptr.type];
  34713. else {
  34714. if (!i.TYPEREF.test(this.ptr.type))
  34715. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34716. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34717. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34718. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34719. if (this.ptr.type = u.TYPES.enum,
  34720. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34721. throw Error("proto3 message cannot reference proto2 enum")
  34722. } else {
  34723. if (!(e instanceof s.Message))
  34724. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34725. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34726. }
  34727. }
  34728. if (this.ptr.map) {
  34729. if (!i.TYPE.test(this.ptr.keyType))
  34730. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34731. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34732. }
  34733. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34734. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34735. throw Error("illegal service type in " + this.ptr.toString(!0));
  34736. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34737. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34738. if (this.ptr.resolvedRequestType = e,
  34739. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34740. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34741. this.ptr.resolvedResponseType = e
  34742. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34743. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34744. return this.reset()
  34745. }
  34746. ,
  34747. n.build = function(e) {
  34748. if (this.reset(),
  34749. this.resolved || (this.resolveAll(),
  34750. this.resolved = !0,
  34751. this.result = null),
  34752. null === this.result && (this.result = this.ns.build()),
  34753. !e)
  34754. return this.result;
  34755. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34756. if (!i[t[n]]) {
  34757. i = null;
  34758. break
  34759. }
  34760. i = i[t[n]]
  34761. }
  34762. return i
  34763. }
  34764. ,
  34765. n.lookup = function(e, t) {
  34766. return e ? this.ns.resolve(e, t) : this.ns
  34767. }
  34768. ,
  34769. n.toString = function() {
  34770. return "Builder"
  34771. }
  34772. ,
  34773. h.Message = function() {}
  34774. ,
  34775. h.Enum = function() {}
  34776. ,
  34777. h.Service = function() {}
  34778. ,
  34779. h),
  34780. o.Map = (a = o.Reflect,
  34781. (t = c.prototype).clear = function() {
  34782. this.map = {}
  34783. }
  34784. ,
  34785. t.delete = function(e) {
  34786. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34787. , i = t in this.map;
  34788. return delete this.map[t],
  34789. i
  34790. }
  34791. ,
  34792. t.entries = function() {
  34793. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34794. t.push([(e = this.map[i[n]]).key, e.value]);
  34795. return l(t)
  34796. }
  34797. ,
  34798. t.keys = function() {
  34799. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34800. e.push(this.map[t[i]].key);
  34801. return l(e)
  34802. }
  34803. ,
  34804. t.values = function() {
  34805. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34806. e.push(this.map[t[i]].value);
  34807. return l(e)
  34808. }
  34809. ,
  34810. t.forEach = function(e, t) {
  34811. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34812. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34813. }
  34814. ,
  34815. t.set = function(e, t) {
  34816. var i = this.keyElem.verifyValue(e)
  34817. , n = this.valueElem.verifyValue(t);
  34818. return this.map[this.keyElem.valueToString(i)] = {
  34819. key: i,
  34820. value: n
  34821. },
  34822. this
  34823. }
  34824. ,
  34825. t.get = function(e) {
  34826. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34827. if (t in this.map)
  34828. return this.map[t].value
  34829. }
  34830. ,
  34831. t.has = function(e) {
  34832. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34833. }
  34834. ,
  34835. c),
  34836. o.loadProto = function(e, t, i) {
  34837. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34838. t = void 0),
  34839. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34840. }
  34841. ,
  34842. o.protoFromString = o.loadProto,
  34843. o.loadProtoFile = function(t, i, n) {
  34844. if (i && "object" == typeof i ? (n = i,
  34845. i = null) : i && "function" == typeof i || (i = null),
  34846. i)
  34847. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34848. if (null !== e)
  34849. try {
  34850. i(null, o.loadProto(e, n, t))
  34851. } catch (e) {
  34852. i(e)
  34853. }
  34854. else
  34855. i(Error("Failed to fetch file"))
  34856. });
  34857. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34858. return null === e ? null : o.loadProto(e, n, t)
  34859. }
  34860. ,
  34861. o.protoFromFile = o.loadProtoFile,
  34862. o.newBuilder = function(e) {
  34863. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34864. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34865. new o.Builder(e)
  34866. }
  34867. ,
  34868. o.loadJson = function(e, t, i) {
  34869. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34870. t = null),
  34871. t && "object" == typeof t || (t = o.newBuilder()),
  34872. "string" == typeof e && (e = JSON.parse(e)),
  34873. t.import(e, i),
  34874. t.resolveAll(),
  34875. t
  34876. }
  34877. ,
  34878. o.loadJsonFile = function(t, i, n) {
  34879. if (i && "object" == typeof i ? (n = i,
  34880. i = null) : i && "function" == typeof i || (i = null),
  34881. i)
  34882. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34883. if (null !== e)
  34884. try {
  34885. i(null, o.loadJson(JSON.parse(e), n, t))
  34886. } catch (e) {
  34887. i(e)
  34888. }
  34889. else
  34890. i(Error("Failed to fetch file"))
  34891. });
  34892. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34893. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34894. }
  34895. ,
  34896. o;
  34897. function l(e) {
  34898. var t = 0;
  34899. return {
  34900. next: function() {
  34901. return t < e.length ? {
  34902. done: !1,
  34903. value: e[t++]
  34904. } : {
  34905. done: !0
  34906. }
  34907. }
  34908. }
  34909. }
  34910. function c(e, t) {
  34911. if (!e.map)
  34912. throw Error("field is not a map");
  34913. if (this.field = e,
  34914. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34915. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34916. this.map = {},
  34917. Object.defineProperty(this, "size", {
  34918. get: function() {
  34919. return Object.keys(this.map).length
  34920. }
  34921. }),
  34922. t)
  34923. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34924. var r = this.keyElem.valueFromString(i[n])
  34925. , o = this.valueElem.verifyValue(t[i[n]]);
  34926. this.map[this.keyElem.valueToString(r)] = {
  34927. key: r,
  34928. value: o
  34929. }
  34930. }
  34931. }
  34932. function h(e) {
  34933. this.ns = new s.Namespace(this,null,""),
  34934. this.ptr = this.ns,
  34935. this.resolved = !1,
  34936. this.result = null,
  34937. this.files = {},
  34938. this.importRoot = null,
  34939. this.options = e || {}
  34940. }
  34941. }
  34942. ,
  34943. "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)
  34944. }
  34945. ).call(this, p("_process"))
  34946. }
  34947. , {
  34948. _process: 203,
  34949. bytebuffer: 215,
  34950. fs: 197,
  34951. path: 197
  34952. }],
  34953. 215: [function(t, e, i) {
  34954. var n, r;
  34955. n = this,
  34956. r = function(l) {
  34957. "use strict";
  34958. function s(e) {
  34959. var t = 0;
  34960. return function() {
  34961. return t < e.length ? e.charCodeAt(t++) : null
  34962. }
  34963. }
  34964. function c() {
  34965. var e = []
  34966. , t = [];
  34967. return function() {
  34968. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34969. e.length = 0),
  34970. void Array.prototype.push.apply(e, arguments))
  34971. }
  34972. }
  34973. function n(e, t, i, n, r) {
  34974. 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];
  34975. for (u += d,
  34976. o = p & (1 << -h) - 1,
  34977. p >>= -h,
  34978. h += s; 0 < h; o = 256 * o + e[t + u],
  34979. u += d,
  34980. h -= 8)
  34981. ;
  34982. for (a = o & (1 << -h) - 1,
  34983. o >>= -h,
  34984. h += n; 0 < h; a = 256 * a + e[t + u],
  34985. u += d,
  34986. h -= 8)
  34987. ;
  34988. if (0 === o)
  34989. o = 1 - c;
  34990. else {
  34991. if (o === l)
  34992. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34993. a += Math.pow(2, n),
  34994. o -= c
  34995. }
  34996. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34997. }
  34998. function r(e, t, i, n, r, o) {
  34999. 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;
  35000. for (t = Math.abs(t),
  35001. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  35002. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  35003. t * (l = Math.pow(2, -a)) < 1 && (a--,
  35004. l *= 2),
  35005. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  35006. l /= 2),
  35007. h <= a + u ? (s = 0,
  35008. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  35009. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  35010. a = 0)); 8 <= r; e[i + p] = 255 & s,
  35011. p += f,
  35012. s /= 256,
  35013. r -= 8)
  35014. ;
  35015. for (a = a << r | s,
  35016. c += r; 0 < c; e[i + p] = 255 & a,
  35017. p += f,
  35018. a /= 256,
  35019. c -= 8)
  35020. ;
  35021. e[i + p - f] |= 128 * g
  35022. }
  35023. var f = function(e, t, i) {
  35024. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  35025. void 0 === t && (t = f.DEFAULT_ENDIAN),
  35026. void 0 === i && (i = f.DEFAULT_NOASSERT),
  35027. !i) {
  35028. if ((e |= 0) < 0)
  35029. throw RangeError("Illegal capacity");
  35030. t = !!t,
  35031. i = !!i
  35032. }
  35033. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  35034. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  35035. this.offset = 0,
  35036. this.markedOffset = -1,
  35037. this.limit = e,
  35038. this.littleEndian = t,
  35039. this.noAssert = i
  35040. };
  35041. f.VERSION = "5.0.1",
  35042. f.LITTLE_ENDIAN = !0,
  35043. f.BIG_ENDIAN = !1,
  35044. f.DEFAULT_CAPACITY = 16,
  35045. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  35046. f.DEFAULT_NOASSERT = !1,
  35047. f.Long = l || null;
  35048. var a = f.prototype;
  35049. a.__isByteBuffer__,
  35050. Object.defineProperty(a, "__isByteBuffer__", {
  35051. value: !0,
  35052. enumerable: !1,
  35053. configurable: !1
  35054. });
  35055. var o = new ArrayBuffer(0)
  35056. , i = String.fromCharCode;
  35057. f.accessor = function() {
  35058. return Uint8Array
  35059. }
  35060. ,
  35061. f.allocate = function(e, t, i) {
  35062. return new f(e,t,i)
  35063. }
  35064. ,
  35065. f.concat = function(e, t, i, n) {
  35066. "boolean" != typeof t && "string" == typeof t || (n = i,
  35067. i = t,
  35068. t = void 0);
  35069. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  35070. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  35071. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  35072. if (0 === o)
  35073. return new f(0,i,n);
  35074. var l, c = new f(o,i,n);
  35075. for (a = 0; a < s; )
  35076. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  35077. c.offset += r);
  35078. return c.limit = c.offset,
  35079. c.offset = 0,
  35080. c
  35081. }
  35082. ,
  35083. f.isByteBuffer = function(e) {
  35084. return !0 === (e && e.__isByteBuffer__)
  35085. }
  35086. ,
  35087. f.type = function() {
  35088. return ArrayBuffer
  35089. }
  35090. ,
  35091. f.wrap = function(e, t, i, n) {
  35092. if ("string" != typeof t && (n = i,
  35093. i = t,
  35094. t = void 0),
  35095. "string" == typeof e)
  35096. switch (void 0 === t && (t = "utf8"),
  35097. t) {
  35098. case "base64":
  35099. return f.fromBase64(e, i);
  35100. case "hex":
  35101. return f.fromHex(e, i);
  35102. case "binary":
  35103. return f.fromBinary(e, i);
  35104. case "utf8":
  35105. return f.fromUTF8(e, i);
  35106. case "debug":
  35107. return f.fromDebug(e, i);
  35108. default:
  35109. throw Error("Unsupported encoding: " + t)
  35110. }
  35111. if (null === e || "object" != typeof e)
  35112. throw TypeError("Illegal buffer");
  35113. var r;
  35114. if (f.isByteBuffer(e))
  35115. return (r = a.clone.call(e)).markedOffset = -1,
  35116. r;
  35117. if (e instanceof Uint8Array)
  35118. r = new f(0,i,n),
  35119. 0 < e.length && (r.buffer = e.buffer,
  35120. r.offset = e.byteOffset,
  35121. r.limit = e.byteOffset + e.byteLength,
  35122. r.view = new Uint8Array(e.buffer));
  35123. else if (e instanceof ArrayBuffer)
  35124. r = new f(0,i,n),
  35125. 0 < e.byteLength && (r.buffer = e,
  35126. r.offset = 0,
  35127. r.limit = e.byteLength,
  35128. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  35129. else {
  35130. if ("[object Array]" !== Object.prototype.toString.call(e))
  35131. throw TypeError("Illegal buffer");
  35132. (r = new f(e.length,i,n)).limit = e.length;
  35133. for (var o = 0; o < e.length; ++o)
  35134. r.view[o] = e[o]
  35135. }
  35136. return r
  35137. }
  35138. ,
  35139. a.writeBitSet = function(e, t) {
  35140. var i = void 0 === t;
  35141. if (i && (t = this.offset),
  35142. !this.noAssert) {
  35143. if (!(e instanceof Array))
  35144. throw TypeError("Illegal BitSet: Not an array");
  35145. if ("number" != typeof t || t % 1 != 0)
  35146. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35147. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35148. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35149. }
  35150. var n, r = t, o = e.length, a = o >> 3, s = 0;
  35151. for (t += this.writeVarint32(o, t); a--; )
  35152. 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,
  35153. this.writeByte(n, t++);
  35154. if (s < o) {
  35155. var l = 0;
  35156. for (n = 0; s < o; )
  35157. n |= (1 & !!e[s++]) << l++;
  35158. this.writeByte(n, t++)
  35159. }
  35160. return i ? (this.offset = t,
  35161. this) : t - r
  35162. }
  35163. ,
  35164. a.readBitSet = function(e) {
  35165. var t = void 0 === e;
  35166. t && (e = this.offset);
  35167. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  35168. for (e += n.length; o--; )
  35169. i = this.readByte(e++),
  35170. s[a++] = !!(1 & i),
  35171. s[a++] = !!(2 & i),
  35172. s[a++] = !!(4 & i),
  35173. s[a++] = !!(8 & i),
  35174. s[a++] = !!(16 & i),
  35175. s[a++] = !!(32 & i),
  35176. s[a++] = !!(64 & i),
  35177. s[a++] = !!(128 & i);
  35178. if (a < r) {
  35179. var l = 0;
  35180. for (i = this.readByte(e++); a < r; )
  35181. s[a++] = !!(i >> l++ & 1)
  35182. }
  35183. return t && (this.offset = e),
  35184. s
  35185. }
  35186. ,
  35187. a.readBytes = function(e, t) {
  35188. var i = void 0 === t;
  35189. if (i && (t = this.offset),
  35190. !this.noAssert) {
  35191. if ("number" != typeof t || t % 1 != 0)
  35192. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35193. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  35194. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35195. }
  35196. var n = this.slice(t, t + e);
  35197. return i && (this.offset += e),
  35198. n
  35199. }
  35200. ,
  35201. a.writeBytes = a.append,
  35202. a.writeInt8 = function(e, t) {
  35203. var i = void 0 === t;
  35204. if (i && (t = this.offset),
  35205. !this.noAssert) {
  35206. if ("number" != typeof e || e % 1 != 0)
  35207. throw TypeError("Illegal value: " + e + " (not an integer)");
  35208. if (e |= 0,
  35209. "number" != typeof t || t % 1 != 0)
  35210. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35211. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35212. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35213. }
  35214. t += 1;
  35215. var n = this.buffer.byteLength;
  35216. return n < t && this.resize((n *= 2) > t ? n : t),
  35217. t -= 1,
  35218. this.view[t] = e,
  35219. i && (this.offset += 1),
  35220. this
  35221. }
  35222. ,
  35223. a.writeByte = a.writeInt8,
  35224. a.readInt8 = function(e) {
  35225. var t = void 0 === e;
  35226. if (t && (e = this.offset),
  35227. !this.noAssert) {
  35228. if ("number" != typeof e || e % 1 != 0)
  35229. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35230. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35231. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35232. }
  35233. var i = this.view[e];
  35234. return 128 == (128 & i) && (i = -(255 - i + 1)),
  35235. t && (this.offset += 1),
  35236. i
  35237. }
  35238. ,
  35239. a.readByte = a.readInt8,
  35240. a.writeUint8 = function(e, t) {
  35241. var i = void 0 === t;
  35242. if (i && (t = this.offset),
  35243. !this.noAssert) {
  35244. if ("number" != typeof e || e % 1 != 0)
  35245. throw TypeError("Illegal value: " + e + " (not an integer)");
  35246. if (e >>>= 0,
  35247. "number" != typeof t || t % 1 != 0)
  35248. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35249. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35250. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35251. }
  35252. t += 1;
  35253. var n = this.buffer.byteLength;
  35254. return n < t && this.resize((n *= 2) > t ? n : t),
  35255. t -= 1,
  35256. this.view[t] = e,
  35257. i && (this.offset += 1),
  35258. this
  35259. }
  35260. ,
  35261. a.writeUInt8 = a.writeUint8,
  35262. a.readUint8 = function(e) {
  35263. var t = void 0 === e;
  35264. if (t && (e = this.offset),
  35265. !this.noAssert) {
  35266. if ("number" != typeof e || e % 1 != 0)
  35267. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35268. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35269. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35270. }
  35271. var i = this.view[e];
  35272. return t && (this.offset += 1),
  35273. i
  35274. }
  35275. ,
  35276. a.readUInt8 = a.readUint8,
  35277. a.writeInt16 = function(e, t) {
  35278. var i = void 0 === t;
  35279. if (i && (t = this.offset),
  35280. !this.noAssert) {
  35281. if ("number" != typeof e || e % 1 != 0)
  35282. throw TypeError("Illegal value: " + e + " (not an integer)");
  35283. if (e |= 0,
  35284. "number" != typeof t || t % 1 != 0)
  35285. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35286. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35287. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35288. }
  35289. t += 2;
  35290. var n = this.buffer.byteLength;
  35291. return n < t && this.resize((n *= 2) > t ? n : t),
  35292. t -= 2,
  35293. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35294. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35295. this.view[t + 1] = 255 & e),
  35296. i && (this.offset += 2),
  35297. this
  35298. }
  35299. ,
  35300. a.writeShort = a.writeInt16,
  35301. a.readInt16 = function(e) {
  35302. var t = void 0 === e;
  35303. if (t && (e = this.offset),
  35304. !this.noAssert) {
  35305. if ("number" != typeof e || e % 1 != 0)
  35306. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35307. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35308. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35309. }
  35310. var i = 0;
  35311. return this.littleEndian ? (i = this.view[e],
  35312. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35313. i |= this.view[e + 1]),
  35314. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  35315. t && (this.offset += 2),
  35316. i
  35317. }
  35318. ,
  35319. a.readShort = a.readInt16,
  35320. a.writeUint16 = function(e, t) {
  35321. var i = void 0 === t;
  35322. if (i && (t = this.offset),
  35323. !this.noAssert) {
  35324. if ("number" != typeof e || e % 1 != 0)
  35325. throw TypeError("Illegal value: " + e + " (not an integer)");
  35326. if (e >>>= 0,
  35327. "number" != typeof t || t % 1 != 0)
  35328. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35329. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35330. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35331. }
  35332. t += 2;
  35333. var n = this.buffer.byteLength;
  35334. return n < t && this.resize((n *= 2) > t ? n : t),
  35335. t -= 2,
  35336. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35337. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35338. this.view[t + 1] = 255 & e),
  35339. i && (this.offset += 2),
  35340. this
  35341. }
  35342. ,
  35343. a.writeUInt16 = a.writeUint16,
  35344. a.readUint16 = function(e) {
  35345. var t = void 0 === e;
  35346. if (t && (e = this.offset),
  35347. !this.noAssert) {
  35348. if ("number" != typeof e || e % 1 != 0)
  35349. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35350. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  35351. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35352. }
  35353. var i = 0;
  35354. return this.littleEndian ? (i = this.view[e],
  35355. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35356. i |= this.view[e + 1]),
  35357. t && (this.offset += 2),
  35358. i
  35359. }
  35360. ,
  35361. a.readUInt16 = a.readUint16,
  35362. a.writeInt32 = function(e, t) {
  35363. var i = void 0 === t;
  35364. if (i && (t = this.offset),
  35365. !this.noAssert) {
  35366. if ("number" != typeof e || e % 1 != 0)
  35367. throw TypeError("Illegal value: " + e + " (not an integer)");
  35368. if (e |= 0,
  35369. "number" != typeof t || t % 1 != 0)
  35370. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35371. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35372. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35373. }
  35374. t += 4;
  35375. var n = this.buffer.byteLength;
  35376. return n < t && this.resize((n *= 2) > t ? n : t),
  35377. t -= 4,
  35378. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35379. this.view[t + 2] = e >>> 16 & 255,
  35380. this.view[t + 1] = e >>> 8 & 255,
  35381. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35382. this.view[t + 1] = e >>> 16 & 255,
  35383. this.view[t + 2] = e >>> 8 & 255,
  35384. this.view[t + 3] = 255 & e),
  35385. i && (this.offset += 4),
  35386. this
  35387. }
  35388. ,
  35389. a.writeInt = a.writeInt32,
  35390. a.readInt32 = function(e) {
  35391. var t = void 0 === e;
  35392. if (t && (e = this.offset),
  35393. !this.noAssert) {
  35394. if ("number" != typeof e || e % 1 != 0)
  35395. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35396. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35397. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35398. }
  35399. var i = 0;
  35400. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35401. i |= this.view[e + 1] << 8,
  35402. i |= this.view[e],
  35403. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35404. i |= this.view[e + 2] << 8,
  35405. i |= this.view[e + 3],
  35406. i += this.view[e] << 24 >>> 0),
  35407. i |= 0,
  35408. t && (this.offset += 4),
  35409. i
  35410. }
  35411. ,
  35412. a.readInt = a.readInt32,
  35413. a.writeUint32 = function(e, t) {
  35414. var i = void 0 === t;
  35415. if (i && (t = this.offset),
  35416. !this.noAssert) {
  35417. if ("number" != typeof e || e % 1 != 0)
  35418. throw TypeError("Illegal value: " + e + " (not an integer)");
  35419. if (e >>>= 0,
  35420. "number" != typeof t || t % 1 != 0)
  35421. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35422. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35423. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35424. }
  35425. t += 4;
  35426. var n = this.buffer.byteLength;
  35427. return n < t && this.resize((n *= 2) > t ? n : t),
  35428. t -= 4,
  35429. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35430. this.view[t + 2] = e >>> 16 & 255,
  35431. this.view[t + 1] = e >>> 8 & 255,
  35432. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35433. this.view[t + 1] = e >>> 16 & 255,
  35434. this.view[t + 2] = e >>> 8 & 255,
  35435. this.view[t + 3] = 255 & e),
  35436. i && (this.offset += 4),
  35437. this
  35438. }
  35439. ,
  35440. a.writeUInt32 = a.writeUint32,
  35441. a.readUint32 = function(e) {
  35442. var t = void 0 === e;
  35443. if (t && (e = this.offset),
  35444. !this.noAssert) {
  35445. if ("number" != typeof e || e % 1 != 0)
  35446. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35447. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35448. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35449. }
  35450. var i = 0;
  35451. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35452. i |= this.view[e + 1] << 8,
  35453. i |= this.view[e],
  35454. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35455. i |= this.view[e + 2] << 8,
  35456. i |= this.view[e + 3],
  35457. i += this.view[e] << 24 >>> 0),
  35458. t && (this.offset += 4),
  35459. i
  35460. }
  35461. ,
  35462. a.readUInt32 = a.readUint32,
  35463. l && (a.writeInt64 = function(e, t) {
  35464. var i = void 0 === t;
  35465. if (i && (t = this.offset),
  35466. !this.noAssert) {
  35467. if ("number" == typeof e)
  35468. e = l.fromNumber(e);
  35469. else if ("string" == typeof e)
  35470. e = l.fromString(e);
  35471. else if (!(e && e instanceof l))
  35472. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35473. if ("number" != typeof t || t % 1 != 0)
  35474. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35475. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35476. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35477. }
  35478. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35479. t += 8;
  35480. var n = this.buffer.byteLength;
  35481. n < t && this.resize((n *= 2) > t ? n : t),
  35482. t -= 8;
  35483. var r = e.low
  35484. , o = e.high;
  35485. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35486. this.view[t + 2] = r >>> 16 & 255,
  35487. this.view[t + 1] = r >>> 8 & 255,
  35488. this.view[t] = 255 & r,
  35489. t += 4,
  35490. this.view[t + 3] = o >>> 24 & 255,
  35491. this.view[t + 2] = o >>> 16 & 255,
  35492. this.view[t + 1] = o >>> 8 & 255,
  35493. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35494. this.view[t + 1] = o >>> 16 & 255,
  35495. this.view[t + 2] = o >>> 8 & 255,
  35496. this.view[t + 3] = 255 & o,
  35497. t += 4,
  35498. this.view[t] = r >>> 24 & 255,
  35499. this.view[t + 1] = r >>> 16 & 255,
  35500. this.view[t + 2] = r >>> 8 & 255,
  35501. this.view[t + 3] = 255 & r),
  35502. i && (this.offset += 8),
  35503. this
  35504. }
  35505. ,
  35506. a.writeLong = a.writeInt64,
  35507. a.readInt64 = function(e) {
  35508. var t = void 0 === e;
  35509. if (t && (e = this.offset),
  35510. !this.noAssert) {
  35511. if ("number" != typeof e || e % 1 != 0)
  35512. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35513. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35514. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35515. }
  35516. var i = 0
  35517. , n = 0;
  35518. this.littleEndian ? (i = this.view[e + 2] << 16,
  35519. i |= this.view[e + 1] << 8,
  35520. i |= this.view[e],
  35521. i += this.view[e + 3] << 24 >>> 0,
  35522. e += 4,
  35523. n = this.view[e + 2] << 16,
  35524. n |= this.view[e + 1] << 8,
  35525. n |= this.view[e],
  35526. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35527. n |= this.view[e + 2] << 8,
  35528. n |= this.view[e + 3],
  35529. n += this.view[e] << 24 >>> 0,
  35530. e += 4,
  35531. i = this.view[e + 1] << 16,
  35532. i |= this.view[e + 2] << 8,
  35533. i |= this.view[e + 3],
  35534. i += this.view[e] << 24 >>> 0);
  35535. var r = new l(i,n,!1);
  35536. return t && (this.offset += 8),
  35537. r
  35538. }
  35539. ,
  35540. a.readLong = a.readInt64,
  35541. a.writeUint64 = function(e, t) {
  35542. var i = void 0 === t;
  35543. if (i && (t = this.offset),
  35544. !this.noAssert) {
  35545. if ("number" == typeof e)
  35546. e = l.fromNumber(e);
  35547. else if ("string" == typeof e)
  35548. e = l.fromString(e);
  35549. else if (!(e && e instanceof l))
  35550. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  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. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35557. t += 8;
  35558. var n = this.buffer.byteLength;
  35559. n < t && this.resize((n *= 2) > t ? n : t),
  35560. t -= 8;
  35561. var r = e.low
  35562. , o = e.high;
  35563. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35564. this.view[t + 2] = r >>> 16 & 255,
  35565. this.view[t + 1] = r >>> 8 & 255,
  35566. this.view[t] = 255 & r,
  35567. t += 4,
  35568. this.view[t + 3] = o >>> 24 & 255,
  35569. this.view[t + 2] = o >>> 16 & 255,
  35570. this.view[t + 1] = o >>> 8 & 255,
  35571. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35572. this.view[t + 1] = o >>> 16 & 255,
  35573. this.view[t + 2] = o >>> 8 & 255,
  35574. this.view[t + 3] = 255 & o,
  35575. t += 4,
  35576. this.view[t] = r >>> 24 & 255,
  35577. this.view[t + 1] = r >>> 16 & 255,
  35578. this.view[t + 2] = r >>> 8 & 255,
  35579. this.view[t + 3] = 255 & r),
  35580. i && (this.offset += 8),
  35581. this
  35582. }
  35583. ,
  35584. a.writeUInt64 = a.writeUint64,
  35585. a.readUint64 = function(e) {
  35586. var t = void 0 === e;
  35587. if (t && (e = this.offset),
  35588. !this.noAssert) {
  35589. if ("number" != typeof e || e % 1 != 0)
  35590. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35591. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35592. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35593. }
  35594. var i = 0
  35595. , n = 0;
  35596. this.littleEndian ? (i = this.view[e + 2] << 16,
  35597. i |= this.view[e + 1] << 8,
  35598. i |= this.view[e],
  35599. i += this.view[e + 3] << 24 >>> 0,
  35600. e += 4,
  35601. n = this.view[e + 2] << 16,
  35602. n |= this.view[e + 1] << 8,
  35603. n |= this.view[e],
  35604. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35605. n |= this.view[e + 2] << 8,
  35606. n |= this.view[e + 3],
  35607. n += this.view[e] << 24 >>> 0,
  35608. e += 4,
  35609. i = this.view[e + 1] << 16,
  35610. i |= this.view[e + 2] << 8,
  35611. i |= this.view[e + 3],
  35612. i += this.view[e] << 24 >>> 0);
  35613. var r = new l(i,n,!0);
  35614. return t && (this.offset += 8),
  35615. r
  35616. }
  35617. ,
  35618. a.readUInt64 = a.readUint64),
  35619. a.writeFloat32 = function(e, t) {
  35620. var i = void 0 === t;
  35621. if (i && (t = this.offset),
  35622. !this.noAssert) {
  35623. if ("number" != typeof e)
  35624. throw TypeError("Illegal value: " + e + " (not a number)");
  35625. if ("number" != typeof t || t % 1 != 0)
  35626. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35627. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35628. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35629. }
  35630. t += 4;
  35631. var n = this.buffer.byteLength;
  35632. return n < t && this.resize((n *= 2) > t ? n : t),
  35633. t -= 4,
  35634. r(this.view, e, t, this.littleEndian, 23, 4),
  35635. i && (this.offset += 4),
  35636. this
  35637. }
  35638. ,
  35639. a.writeFloat = a.writeFloat32,
  35640. a.readFloat32 = function(e) {
  35641. var t = void 0 === e;
  35642. if (t && (e = this.offset),
  35643. !this.noAssert) {
  35644. if ("number" != typeof e || e % 1 != 0)
  35645. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35646. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35647. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35648. }
  35649. var i = n(this.view, e, this.littleEndian, 23, 4);
  35650. return t && (this.offset += 4),
  35651. i
  35652. }
  35653. ,
  35654. a.readFloat = a.readFloat32,
  35655. a.writeFloat64 = function(e, t) {
  35656. var i = void 0 === t;
  35657. if (i && (t = this.offset),
  35658. !this.noAssert) {
  35659. if ("number" != typeof e)
  35660. throw TypeError("Illegal value: " + e + " (not a number)");
  35661. if ("number" != typeof t || t % 1 != 0)
  35662. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35663. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35664. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35665. }
  35666. t += 8;
  35667. var n = this.buffer.byteLength;
  35668. return n < t && this.resize((n *= 2) > t ? n : t),
  35669. t -= 8,
  35670. r(this.view, e, t, this.littleEndian, 52, 8),
  35671. i && (this.offset += 8),
  35672. this
  35673. }
  35674. ,
  35675. a.writeDouble = a.writeFloat64,
  35676. a.readFloat64 = function(e) {
  35677. var t = void 0 === e;
  35678. if (t && (e = this.offset),
  35679. !this.noAssert) {
  35680. if ("number" != typeof e || e % 1 != 0)
  35681. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35682. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35683. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35684. }
  35685. var i = n(this.view, e, this.littleEndian, 52, 8);
  35686. return t && (this.offset += 8),
  35687. i
  35688. }
  35689. ,
  35690. a.readDouble = a.readFloat64,
  35691. f.MAX_VARINT32_BYTES = 5,
  35692. f.calculateVarint32 = function(e) {
  35693. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35694. }
  35695. ,
  35696. f.zigZagEncode32 = function(e) {
  35697. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35698. }
  35699. ,
  35700. f.zigZagDecode32 = function(e) {
  35701. return e >>> 1 ^ -(1 & e) | 0
  35702. }
  35703. ,
  35704. a.writeVarint32 = function(e, t) {
  35705. var i = void 0 === t;
  35706. if (i && (t = this.offset),
  35707. !this.noAssert) {
  35708. if ("number" != typeof e || e % 1 != 0)
  35709. throw TypeError("Illegal value: " + e + " (not an integer)");
  35710. if (e |= 0,
  35711. "number" != typeof t || t % 1 != 0)
  35712. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35713. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35714. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35715. }
  35716. var n, r = f.calculateVarint32(e);
  35717. t += r;
  35718. var o = this.buffer.byteLength;
  35719. for (o < t && this.resize((o *= 2) > t ? o : t),
  35720. t -= r,
  35721. e >>>= 0; 128 <= e; )
  35722. n = 127 & e | 128,
  35723. this.view[t++] = n,
  35724. e >>>= 7;
  35725. return this.view[t++] = e,
  35726. i ? (this.offset = t,
  35727. this) : r
  35728. }
  35729. ,
  35730. a.writeVarint32ZigZag = function(e, t) {
  35731. return this.writeVarint32(f.zigZagEncode32(e), t)
  35732. }
  35733. ,
  35734. a.readVarint32 = function(e) {
  35735. var t = void 0 === e;
  35736. if (t && (e = this.offset),
  35737. !this.noAssert) {
  35738. if ("number" != typeof e || e % 1 != 0)
  35739. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35740. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35741. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35742. }
  35743. var i, n = 0, r = 0;
  35744. do {
  35745. if (!this.noAssert && e > this.limit) {
  35746. var o = Error("Truncated");
  35747. throw o.truncated = !0,
  35748. o
  35749. }
  35750. i = this.view[e++],
  35751. n < 5 && (r |= (127 & i) << 7 * n),
  35752. ++n
  35753. } while (0 != (128 & i));return r |= 0,
  35754. t ? (this.offset = e,
  35755. r) : {
  35756. value: r,
  35757. length: n
  35758. }
  35759. }
  35760. ,
  35761. a.readVarint32ZigZag = function(e) {
  35762. var t = this.readVarint32(e);
  35763. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35764. t
  35765. }
  35766. ,
  35767. l && (f.MAX_VARINT64_BYTES = 10,
  35768. f.calculateVarint64 = function(e) {
  35769. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35770. var t = e.toInt() >>> 0
  35771. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35772. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35773. 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
  35774. }
  35775. ,
  35776. f.zigZagEncode64 = function(e) {
  35777. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35778. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35779. }
  35780. ,
  35781. f.zigZagDecode64 = function(e) {
  35782. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35783. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35784. }
  35785. ,
  35786. a.writeVarint64 = function(e, t) {
  35787. var i = void 0 === t;
  35788. if (i && (t = this.offset),
  35789. !this.noAssert) {
  35790. if ("number" == typeof e)
  35791. e = l.fromNumber(e);
  35792. else if ("string" == typeof e)
  35793. e = l.fromString(e);
  35794. else if (!(e && e instanceof l))
  35795. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35796. if ("number" != typeof t || t % 1 != 0)
  35797. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35798. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35799. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35800. }
  35801. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35802. var n = f.calculateVarint64(e)
  35803. , r = e.toInt() >>> 0
  35804. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35805. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35806. t += n;
  35807. var s = this.buffer.byteLength;
  35808. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35809. t -= n,
  35810. n) {
  35811. case 10:
  35812. this.view[t + 9] = a >>> 7 & 1;
  35813. case 9:
  35814. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35815. case 8:
  35816. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35817. case 7:
  35818. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35819. case 6:
  35820. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35821. case 5:
  35822. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35823. case 4:
  35824. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35825. case 3:
  35826. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35827. case 2:
  35828. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35829. case 1:
  35830. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35831. }
  35832. return i ? (this.offset += n,
  35833. this) : n
  35834. }
  35835. ,
  35836. a.writeVarint64ZigZag = function(e, t) {
  35837. return this.writeVarint64(f.zigZagEncode64(e), t)
  35838. }
  35839. ,
  35840. a.readVarint64 = function(e) {
  35841. var t = void 0 === e;
  35842. if (t && (e = this.offset),
  35843. !this.noAssert) {
  35844. if ("number" != typeof e || e % 1 != 0)
  35845. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35846. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35847. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35848. }
  35849. var i = e
  35850. , n = 0
  35851. , r = 0
  35852. , o = 0
  35853. , a = 0;
  35854. if (n = 127 & (a = this.view[e++]),
  35855. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35856. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35857. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35858. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35859. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35860. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35861. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35862. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35863. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35864. 128 & a || this.noAssert && void 0 === a))))))))))
  35865. throw Error("Buffer overrun");
  35866. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35867. return t ? (this.offset = e,
  35868. s) : {
  35869. value: s,
  35870. length: e - i
  35871. }
  35872. }
  35873. ,
  35874. a.readVarint64ZigZag = function(e) {
  35875. var t = this.readVarint64(e);
  35876. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35877. t
  35878. }
  35879. ),
  35880. a.writeCString = function(e, t) {
  35881. var i = void 0 === t;
  35882. i && (t = this.offset);
  35883. var n, r = e.length;
  35884. if (!this.noAssert) {
  35885. if ("string" != typeof e)
  35886. throw TypeError("Illegal str: Not a string");
  35887. for (n = 0; n < r; ++n)
  35888. if (0 === e.charCodeAt(n))
  35889. throw RangeError("Illegal str: Contains NULL-characters");
  35890. if ("number" != typeof t || t % 1 != 0)
  35891. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35892. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35893. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35894. }
  35895. r = d.calculateUTF16asUTF8(s(e))[1],
  35896. t += r + 1;
  35897. var o = this.buffer.byteLength;
  35898. return o < t && this.resize((o *= 2) > t ? o : t),
  35899. t -= r + 1,
  35900. d.encodeUTF16toUTF8(s(e), function(e) {
  35901. this.view[t++] = e
  35902. }
  35903. .bind(this)),
  35904. this.view[t++] = 0,
  35905. i ? (this.offset = t,
  35906. this) : r
  35907. }
  35908. ,
  35909. a.readCString = function(e) {
  35910. var t = void 0 === e;
  35911. if (t && (e = this.offset),
  35912. !this.noAssert) {
  35913. if ("number" != typeof e || e % 1 != 0)
  35914. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35915. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35916. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35917. }
  35918. var i, n = e, r = -1;
  35919. return d.decodeUTF8toUTF16(function() {
  35920. if (0 === r)
  35921. return null;
  35922. if (e >= this.limit)
  35923. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35924. return 0 === (r = this.view[e++]) ? null : r
  35925. }
  35926. .bind(this), i = c(), !0),
  35927. t ? (this.offset = e,
  35928. i()) : {
  35929. string: i(),
  35930. length: e - n
  35931. }
  35932. }
  35933. ,
  35934. a.writeIString = function(e, t) {
  35935. var i = void 0 === t;
  35936. if (i && (t = this.offset),
  35937. !this.noAssert) {
  35938. if ("string" != typeof e)
  35939. throw TypeError("Illegal str: Not a string");
  35940. if ("number" != typeof t || t % 1 != 0)
  35941. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35942. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35943. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35944. }
  35945. var n, r = t;
  35946. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35947. t += 4 + n;
  35948. var o = this.buffer.byteLength;
  35949. if (o < t && this.resize((o *= 2) > t ? o : t),
  35950. t -= 4 + n,
  35951. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35952. this.view[t + 2] = n >>> 16 & 255,
  35953. this.view[t + 1] = n >>> 8 & 255,
  35954. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35955. this.view[t + 1] = n >>> 16 & 255,
  35956. this.view[t + 2] = n >>> 8 & 255,
  35957. this.view[t + 3] = 255 & n),
  35958. t += 4,
  35959. d.encodeUTF16toUTF8(s(e), function(e) {
  35960. this.view[t++] = e
  35961. }
  35962. .bind(this)),
  35963. t !== r + 4 + n)
  35964. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35965. return i ? (this.offset = t,
  35966. this) : t - r
  35967. }
  35968. ,
  35969. a.readIString = function(e) {
  35970. var t = void 0 === e;
  35971. if (t && (e = this.offset),
  35972. !this.noAssert) {
  35973. if ("number" != typeof e || e % 1 != 0)
  35974. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35975. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35976. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35977. }
  35978. var i = e
  35979. , n = this.readUint32(e)
  35980. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35981. return e += r.length,
  35982. t ? (this.offset = e,
  35983. r.string) : {
  35984. string: r.string,
  35985. length: e - i
  35986. }
  35987. }
  35988. ,
  35989. f.METRICS_CHARS = "c",
  35990. f.METRICS_BYTES = "b",
  35991. a.writeUTF8String = function(e, t) {
  35992. var i = void 0 === t;
  35993. if (i && (t = this.offset),
  35994. !this.noAssert) {
  35995. if ("number" != typeof t || t % 1 != 0)
  35996. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35997. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35998. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35999. }
  36000. var n, r = t;
  36001. n = d.calculateUTF16asUTF8(s(e))[1],
  36002. t += n;
  36003. var o = this.buffer.byteLength;
  36004. return o < t && this.resize((o *= 2) > t ? o : t),
  36005. t -= n,
  36006. d.encodeUTF16toUTF8(s(e), function(e) {
  36007. this.view[t++] = e
  36008. }
  36009. .bind(this)),
  36010. i ? (this.offset = t,
  36011. this) : t - r
  36012. }
  36013. ,
  36014. a.writeString = a.writeUTF8String,
  36015. f.calculateUTF8Chars = function(e) {
  36016. return d.calculateUTF16asUTF8(s(e))[0]
  36017. }
  36018. ,
  36019. f.calculateUTF8Bytes = function(e) {
  36020. return d.calculateUTF16asUTF8(s(e))[1]
  36021. }
  36022. ,
  36023. f.calculateString = f.calculateUTF8Bytes,
  36024. a.readUTF8String = function(e, t, i) {
  36025. "number" == typeof t && (i = t,
  36026. t = void 0);
  36027. var n = void 0 === i;
  36028. if (n && (i = this.offset),
  36029. void 0 === t && (t = f.METRICS_CHARS),
  36030. !this.noAssert) {
  36031. if ("number" != typeof e || e % 1 != 0)
  36032. throw TypeError("Illegal length: " + e + " (not an integer)");
  36033. if (e |= 0,
  36034. "number" != typeof i || i % 1 != 0)
  36035. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36036. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36037. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36038. }
  36039. var r, o = 0, a = i;
  36040. if (t === f.METRICS_CHARS) {
  36041. if (r = c(),
  36042. d.decodeUTF8(function() {
  36043. return o < e && i < this.limit ? this.view[i++] : null
  36044. }
  36045. .bind(this), function(e) {
  36046. ++o,
  36047. d.UTF8toUTF16(e, r)
  36048. }),
  36049. o !== e)
  36050. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  36051. return n ? (this.offset = i,
  36052. r()) : {
  36053. string: r(),
  36054. length: i - a
  36055. }
  36056. }
  36057. if (t !== f.METRICS_BYTES)
  36058. throw TypeError("Unsupported metrics: " + t);
  36059. if (!this.noAssert) {
  36060. if ("number" != typeof i || i % 1 != 0)
  36061. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36062. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  36063. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  36064. }
  36065. var s = i + e;
  36066. if (d.decodeUTF8toUTF16(function() {
  36067. return i < s ? this.view[i++] : null
  36068. }
  36069. .bind(this), r = c(), this.noAssert),
  36070. i !== s)
  36071. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  36072. return n ? (this.offset = i,
  36073. r()) : {
  36074. string: r(),
  36075. length: i - a
  36076. }
  36077. }
  36078. ,
  36079. a.readString = a.readUTF8String,
  36080. a.writeVString = function(e, t) {
  36081. var i = void 0 === t;
  36082. if (i && (t = this.offset),
  36083. !this.noAssert) {
  36084. if ("string" != typeof e)
  36085. throw TypeError("Illegal str: Not a string");
  36086. if ("number" != typeof t || t % 1 != 0)
  36087. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36088. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  36089. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36090. }
  36091. var n, r, o = t;
  36092. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  36093. r = f.calculateVarint32(n),
  36094. t += r + n;
  36095. var a = this.buffer.byteLength;
  36096. if (a < t && this.resize((a *= 2) > t ? a : t),
  36097. t -= r + n,
  36098. t += this.writeVarint32(n, t),
  36099. d.encodeUTF16toUTF8(s(e), function(e) {
  36100. this.view[t++] = e
  36101. }
  36102. .bind(this)),
  36103. t !== o + n + r)
  36104. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  36105. return i ? (this.offset = t,
  36106. this) : t - o
  36107. }
  36108. ,
  36109. a.readVString = function(e) {
  36110. var t = void 0 === e;
  36111. if (t && (e = this.offset),
  36112. !this.noAssert) {
  36113. if ("number" != typeof e || e % 1 != 0)
  36114. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36115. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  36116. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36117. }
  36118. var i = e
  36119. , n = this.readVarint32(e)
  36120. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  36121. return e += r.length,
  36122. t ? (this.offset = e,
  36123. r.string) : {
  36124. string: r.string,
  36125. length: e - i
  36126. }
  36127. }
  36128. ,
  36129. a.append = function(e, t, i) {
  36130. "number" != typeof t && "string" == typeof t || (i = t,
  36131. t = void 0);
  36132. var n = void 0 === i;
  36133. if (n && (i = this.offset),
  36134. !this.noAssert) {
  36135. if ("number" != typeof i || i % 1 != 0)
  36136. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36137. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36138. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36139. }
  36140. e instanceof f || (e = f.wrap(e, t));
  36141. var r = e.limit - e.offset;
  36142. if (r <= 0)
  36143. return this;
  36144. i += r;
  36145. var o = this.buffer.byteLength;
  36146. return o < i && this.resize((o *= 2) > i ? o : i),
  36147. i -= r,
  36148. this.view.set(e.view.subarray(e.offset, e.limit), i),
  36149. e.offset += r,
  36150. n && (this.offset += r),
  36151. this
  36152. }
  36153. ,
  36154. a.appendTo = function(e, t) {
  36155. return e.append(this, t),
  36156. this
  36157. }
  36158. ,
  36159. a.assert = function(e) {
  36160. return this.noAssert = !e,
  36161. this
  36162. }
  36163. ,
  36164. a.capacity = function() {
  36165. return this.buffer.byteLength
  36166. }
  36167. ,
  36168. a.clear = function() {
  36169. return this.offset = 0,
  36170. this.limit = this.buffer.byteLength,
  36171. this.markedOffset = -1,
  36172. this
  36173. }
  36174. ,
  36175. a.clone = function(e) {
  36176. var t = new f(0,this.littleEndian,this.noAssert);
  36177. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  36178. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  36179. t.view = this.view),
  36180. t.offset = this.offset,
  36181. t.markedOffset = this.markedOffset,
  36182. t.limit = this.limit,
  36183. t
  36184. }
  36185. ,
  36186. a.compact = function(e, t) {
  36187. if (void 0 === e && (e = this.offset),
  36188. void 0 === t && (t = this.limit),
  36189. !this.noAssert) {
  36190. if ("number" != typeof e || e % 1 != 0)
  36191. throw TypeError("Illegal begin: Not an integer");
  36192. if (e >>>= 0,
  36193. "number" != typeof t || t % 1 != 0)
  36194. throw TypeError("Illegal end: Not an integer");
  36195. if (t >>>= 0,
  36196. e < 0 || t < e || t > this.buffer.byteLength)
  36197. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36198. }
  36199. if (0 === e && t === this.buffer.byteLength)
  36200. return this;
  36201. var i = t - e;
  36202. if (0 == i)
  36203. return this.buffer = o,
  36204. this.view = null,
  36205. 0 <= this.markedOffset && (this.markedOffset -= e),
  36206. this.offset = 0,
  36207. this.limit = 0,
  36208. this;
  36209. var n = new ArrayBuffer(i)
  36210. , r = new Uint8Array(n);
  36211. return r.set(this.view.subarray(e, t)),
  36212. this.buffer = n,
  36213. this.view = r,
  36214. 0 <= this.markedOffset && (this.markedOffset -= e),
  36215. this.offset = 0,
  36216. this.limit = i,
  36217. this
  36218. }
  36219. ,
  36220. a.copy = function(e, t) {
  36221. if (void 0 === e && (e = this.offset),
  36222. void 0 === t && (t = this.limit),
  36223. !this.noAssert) {
  36224. if ("number" != typeof e || e % 1 != 0)
  36225. throw TypeError("Illegal begin: Not an integer");
  36226. if (e >>>= 0,
  36227. "number" != typeof t || t % 1 != 0)
  36228. throw TypeError("Illegal end: Not an integer");
  36229. if (t >>>= 0,
  36230. e < 0 || t < e || t > this.buffer.byteLength)
  36231. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36232. }
  36233. if (e === t)
  36234. return new f(0,this.littleEndian,this.noAssert);
  36235. var i = t - e
  36236. , n = new f(i,this.littleEndian,this.noAssert);
  36237. return n.offset = 0,
  36238. n.limit = i,
  36239. 0 <= n.markedOffset && (n.markedOffset -= e),
  36240. this.copyTo(n, 0, e, t),
  36241. n
  36242. }
  36243. ,
  36244. a.copyTo = function(e, t, i, n) {
  36245. var r, o;
  36246. if (!this.noAssert && !f.isByteBuffer(e))
  36247. throw TypeError("Illegal target: Not a ByteBuffer");
  36248. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  36249. i = (r = void 0 === i) ? this.offset : 0 | i,
  36250. n = void 0 === n ? this.limit : 0 | n,
  36251. t < 0 || t > e.buffer.byteLength)
  36252. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36253. if (i < 0 || n > this.buffer.byteLength)
  36254. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36255. var a = n - i;
  36256. return 0 == a ? e : (e.ensureCapacity(t + a),
  36257. e.view.set(this.view.subarray(i, n), t),
  36258. r && (this.offset += a),
  36259. o && (e.offset += a),
  36260. this)
  36261. }
  36262. ,
  36263. a.ensureCapacity = function(e) {
  36264. var t = this.buffer.byteLength;
  36265. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36266. }
  36267. ,
  36268. a.fill = function(e, t, i) {
  36269. var n = void 0 === t;
  36270. if (n && (t = this.offset),
  36271. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  36272. void 0 === t && (t = this.offset),
  36273. void 0 === i && (i = this.limit),
  36274. !this.noAssert) {
  36275. if ("number" != typeof e || e % 1 != 0)
  36276. throw TypeError("Illegal value: " + e + " (not an integer)");
  36277. if (e |= 0,
  36278. "number" != typeof t || t % 1 != 0)
  36279. throw TypeError("Illegal begin: Not an integer");
  36280. if (t >>>= 0,
  36281. "number" != typeof i || i % 1 != 0)
  36282. throw TypeError("Illegal end: Not an integer");
  36283. if (i >>>= 0,
  36284. t < 0 || i < t || i > this.buffer.byteLength)
  36285. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36286. }
  36287. if (i <= t)
  36288. return this;
  36289. for (; t < i; )
  36290. this.view[t++] = e;
  36291. return n && (this.offset = t),
  36292. this
  36293. }
  36294. ,
  36295. a.flip = function() {
  36296. return this.limit = this.offset,
  36297. this.offset = 0,
  36298. this
  36299. }
  36300. ,
  36301. a.mark = function(e) {
  36302. if (e = void 0 === e ? this.offset : e,
  36303. !this.noAssert) {
  36304. if ("number" != typeof e || e % 1 != 0)
  36305. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36306. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  36307. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36308. }
  36309. return this.markedOffset = e,
  36310. this
  36311. }
  36312. ,
  36313. a.order = function(e) {
  36314. if (!this.noAssert && "boolean" != typeof e)
  36315. throw TypeError("Illegal littleEndian: Not a boolean");
  36316. return this.littleEndian = !!e,
  36317. this
  36318. }
  36319. ,
  36320. a.LE = function(e) {
  36321. return this.littleEndian = void 0 === e || !!e,
  36322. this
  36323. }
  36324. ,
  36325. a.BE = function(e) {
  36326. return this.littleEndian = void 0 !== e && !e,
  36327. this
  36328. }
  36329. ,
  36330. a.prepend = function(e, t, i) {
  36331. "number" != typeof t && "string" == typeof t || (i = t,
  36332. t = void 0);
  36333. var n = void 0 === i;
  36334. if (n && (i = this.offset),
  36335. !this.noAssert) {
  36336. if ("number" != typeof i || i % 1 != 0)
  36337. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36338. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  36339. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36340. }
  36341. e instanceof f || (e = f.wrap(e, t));
  36342. var r = e.limit - e.offset;
  36343. if (r <= 0)
  36344. return this;
  36345. var o = r - i;
  36346. if (0 < o) {
  36347. var a = new ArrayBuffer(this.buffer.byteLength + o)
  36348. , s = new Uint8Array(a);
  36349. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  36350. this.buffer = a,
  36351. this.view = s,
  36352. this.offset += o,
  36353. 0 <= this.markedOffset && (this.markedOffset += o),
  36354. this.limit += o,
  36355. i += o
  36356. } else
  36357. new Uint8Array(this.buffer);
  36358. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36359. e.offset = e.limit,
  36360. n && (this.offset -= r),
  36361. this
  36362. }
  36363. ,
  36364. a.prependTo = function(e, t) {
  36365. return e.prepend(this, t),
  36366. this
  36367. }
  36368. ,
  36369. a.printDebug = function(e) {
  36370. "function" != typeof e && (e = console.log.bind(console)),
  36371. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36372. }
  36373. ,
  36374. a.remaining = function() {
  36375. return this.limit - this.offset
  36376. }
  36377. ,
  36378. a.reset = function() {
  36379. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  36380. this.markedOffset = -1) : this.offset = 0,
  36381. this
  36382. }
  36383. ,
  36384. a.resize = function(e) {
  36385. if (!this.noAssert) {
  36386. if ("number" != typeof e || e % 1 != 0)
  36387. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36388. if ((e |= 0) < 0)
  36389. throw RangeError("Illegal capacity: 0 <= " + e)
  36390. }
  36391. if (this.buffer.byteLength < e) {
  36392. var t = new ArrayBuffer(e)
  36393. , i = new Uint8Array(t);
  36394. i.set(this.view),
  36395. this.buffer = t,
  36396. this.view = i
  36397. }
  36398. return this
  36399. }
  36400. ,
  36401. a.reverse = function(e, t) {
  36402. if (void 0 === e && (e = this.offset),
  36403. void 0 === t && (t = this.limit),
  36404. !this.noAssert) {
  36405. if ("number" != typeof e || e % 1 != 0)
  36406. throw TypeError("Illegal begin: Not an integer");
  36407. if (e >>>= 0,
  36408. "number" != typeof t || t % 1 != 0)
  36409. throw TypeError("Illegal end: Not an integer");
  36410. if (t >>>= 0,
  36411. e < 0 || t < e || t > this.buffer.byteLength)
  36412. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36413. }
  36414. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  36415. this
  36416. }
  36417. ,
  36418. a.skip = function(e) {
  36419. if (!this.noAssert) {
  36420. if ("number" != typeof e || e % 1 != 0)
  36421. throw TypeError("Illegal length: " + e + " (not an integer)");
  36422. e |= 0
  36423. }
  36424. var t = this.offset + e;
  36425. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36426. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36427. return this.offset = t,
  36428. this
  36429. }
  36430. ,
  36431. a.slice = function(e, t) {
  36432. if (void 0 === e && (e = this.offset),
  36433. void 0 === t && (t = this.limit),
  36434. !this.noAssert) {
  36435. if ("number" != typeof e || e % 1 != 0)
  36436. throw TypeError("Illegal begin: Not an integer");
  36437. if (e >>>= 0,
  36438. "number" != typeof t || t % 1 != 0)
  36439. throw TypeError("Illegal end: Not an integer");
  36440. if (t >>>= 0,
  36441. e < 0 || t < e || t > this.buffer.byteLength)
  36442. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36443. }
  36444. var i = this.clone();
  36445. return i.offset = e,
  36446. i.limit = t,
  36447. i
  36448. }
  36449. ,
  36450. a.toBuffer = function(e) {
  36451. var t = this.offset
  36452. , i = this.limit;
  36453. if (!this.noAssert) {
  36454. if ("number" != typeof t || t % 1 != 0)
  36455. throw TypeError("Illegal offset: Not an integer");
  36456. if (t >>>= 0,
  36457. "number" != typeof i || i % 1 != 0)
  36458. throw TypeError("Illegal limit: Not an integer");
  36459. if (i >>>= 0,
  36460. t < 0 || i < t || i > this.buffer.byteLength)
  36461. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36462. }
  36463. if (!e && 0 === t && i === this.buffer.byteLength)
  36464. return this.buffer;
  36465. if (t === i)
  36466. return o;
  36467. var n = new ArrayBuffer(i - t);
  36468. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36469. n
  36470. }
  36471. ,
  36472. a.toArrayBuffer = a.toBuffer,
  36473. a.toString = function(e, t, i) {
  36474. if (void 0 === e)
  36475. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36476. switch ("number" == typeof e && (i = t = e = "utf8"),
  36477. e) {
  36478. case "utf8":
  36479. return this.toUTF8(t, i);
  36480. case "base64":
  36481. return this.toBase64(t, i);
  36482. case "hex":
  36483. return this.toHex(t, i);
  36484. case "binary":
  36485. return this.toBinary(t, i);
  36486. case "debug":
  36487. return this.toDebug();
  36488. case "columns":
  36489. return this.toColumns();
  36490. default:
  36491. throw Error("Unsupported encoding: " + e)
  36492. }
  36493. }
  36494. ;
  36495. var h = function() {
  36496. 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)
  36497. a[r[t]] = t;
  36498. return e.encode = function(e, t) {
  36499. for (var i, n; null !== (i = e()); )
  36500. t(r[i >> 2 & 63]),
  36501. n = (3 & i) << 4,
  36502. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36503. n = (15 & i) << 2,
  36504. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36505. t(r[63 & i])) : (t(r[63 & n]),
  36506. t(61))) : (t(r[63 & n]),
  36507. t(61),
  36508. t(61))
  36509. }
  36510. ,
  36511. e.decode = function(e, t) {
  36512. function i(e) {
  36513. throw Error("Illegal character code: " + e)
  36514. }
  36515. for (var n, r, o; null !== (n = e()); )
  36516. if (void 0 === (r = a[n]) && i(n),
  36517. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36518. t(r << 2 >>> 0 | (48 & o) >> 4),
  36519. null !== (n = e()))) {
  36520. if (void 0 === (r = a[n])) {
  36521. if (61 === n)
  36522. break;
  36523. i(n)
  36524. }
  36525. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36526. null !== (n = e())) {
  36527. if (void 0 === (o = a[n])) {
  36528. if (61 === n)
  36529. break;
  36530. i(n)
  36531. }
  36532. t((3 & r) << 6 >>> 0 | o)
  36533. }
  36534. }
  36535. }
  36536. ,
  36537. e.test = function(e) {
  36538. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36539. }
  36540. ,
  36541. e
  36542. }();
  36543. a.toBase64 = function(e, t) {
  36544. if (void 0 === e && (e = this.offset),
  36545. void 0 === t && (t = this.limit),
  36546. t |= 0,
  36547. (e |= 0) < 0 || t > this.capacity || t < e)
  36548. throw RangeError("begin, end");
  36549. var i;
  36550. return h.encode(function() {
  36551. return e < t ? this.view[e++] : null
  36552. }
  36553. .bind(this), i = c()),
  36554. i()
  36555. }
  36556. ,
  36557. f.fromBase64 = function(e, t) {
  36558. if ("string" != typeof e)
  36559. throw TypeError("str");
  36560. var i = new f(e.length / 4 * 3,t)
  36561. , n = 0;
  36562. return h.decode(s(e), function(e) {
  36563. i.view[n++] = e
  36564. }),
  36565. i.limit = n,
  36566. i
  36567. }
  36568. ,
  36569. f.btoa = function(e) {
  36570. return f.fromBinary(e).toBase64()
  36571. }
  36572. ,
  36573. f.atob = function(e) {
  36574. return f.fromBase64(e).toBinary()
  36575. }
  36576. ,
  36577. a.toBinary = function(e, t) {
  36578. if (void 0 === e && (e = this.offset),
  36579. void 0 === t && (t = this.limit),
  36580. t |= 0,
  36581. (e |= 0) < 0 || t > this.capacity() || t < e)
  36582. throw RangeError("begin, end");
  36583. if (e === t)
  36584. return "";
  36585. for (var i = [], n = []; e < t; )
  36586. i.push(this.view[e++]),
  36587. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36588. i = []);
  36589. return n.join("") + String.fromCharCode.apply(String, i)
  36590. }
  36591. ,
  36592. f.fromBinary = function(e, t) {
  36593. if ("string" != typeof e)
  36594. throw TypeError("str");
  36595. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36596. if (255 < (i = e.charCodeAt(n)))
  36597. throw RangeError("illegal char code: " + i);
  36598. o.view[n++] = i
  36599. }
  36600. return o.limit = r,
  36601. o
  36602. }
  36603. ,
  36604. a.toDebug = function(e) {
  36605. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36606. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36607. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36608. ++i,
  36609. e && 0 < i && i % 16 == 0 && i !== n) {
  36610. for (; r.length < 51; )
  36611. r += " ";
  36612. a += r + o + "\n",
  36613. r = o = ""
  36614. }
  36615. 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 ? " " : ""
  36616. }
  36617. if (e && " " !== r) {
  36618. for (; r.length < 51; )
  36619. r += " ";
  36620. a += r + o + "\n"
  36621. }
  36622. return e ? a : r
  36623. }
  36624. ,
  36625. f.fromDebug = function(e, t, i) {
  36626. 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; ) {
  36627. switch (n = e.charAt(s++)) {
  36628. case "!":
  36629. if (!i) {
  36630. if (h || u || d) {
  36631. p = !0;
  36632. break
  36633. }
  36634. h = u = d = !0
  36635. }
  36636. a.offset = a.markedOffset = a.limit = l,
  36637. c = !1;
  36638. break;
  36639. case "|":
  36640. if (!i) {
  36641. if (h || d) {
  36642. p = !0;
  36643. break
  36644. }
  36645. h = d = !0
  36646. }
  36647. a.offset = a.limit = l,
  36648. c = !1;
  36649. break;
  36650. case "[":
  36651. if (!i) {
  36652. if (h || u) {
  36653. p = !0;
  36654. break
  36655. }
  36656. h = u = !0
  36657. }
  36658. a.offset = a.markedOffset = l,
  36659. c = !1;
  36660. break;
  36661. case "<":
  36662. if (!i) {
  36663. if (h) {
  36664. p = !0;
  36665. break
  36666. }
  36667. h = !0
  36668. }
  36669. a.offset = l,
  36670. c = !1;
  36671. break;
  36672. case "]":
  36673. if (!i) {
  36674. if (d || u) {
  36675. p = !0;
  36676. break
  36677. }
  36678. d = u = !0
  36679. }
  36680. a.limit = a.markedOffset = l,
  36681. c = !1;
  36682. break;
  36683. case ">":
  36684. if (!i) {
  36685. if (d) {
  36686. p = !0;
  36687. break
  36688. }
  36689. d = !0
  36690. }
  36691. a.limit = l,
  36692. c = !1;
  36693. break;
  36694. case "'":
  36695. if (!i) {
  36696. if (u) {
  36697. p = !0;
  36698. break
  36699. }
  36700. u = !0
  36701. }
  36702. a.markedOffset = l,
  36703. c = !1;
  36704. break;
  36705. case " ":
  36706. c = !1;
  36707. break;
  36708. default:
  36709. if (!i && c) {
  36710. p = !0;
  36711. break
  36712. }
  36713. if (r = parseInt(n + e.charAt(s++), 16),
  36714. !i && (isNaN(r) || r < 0 || 255 < r))
  36715. throw TypeError("Illegal str: Not a debug encoded string");
  36716. a.view[l++] = r,
  36717. c = !0
  36718. }
  36719. if (p)
  36720. throw TypeError("Illegal str: Invalid symbol at " + s)
  36721. }
  36722. if (!i) {
  36723. if (!h || !d)
  36724. throw TypeError("Illegal str: Missing offset or limit");
  36725. if (l < a.buffer.byteLength)
  36726. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36727. }
  36728. return a
  36729. }
  36730. ,
  36731. a.toHex = function(e, t) {
  36732. if (e = void 0 === e ? this.offset : e,
  36733. t = void 0 === t ? this.limit : t,
  36734. !this.noAssert) {
  36735. if ("number" != typeof e || e % 1 != 0)
  36736. throw TypeError("Illegal begin: Not an integer");
  36737. if (e >>>= 0,
  36738. "number" != typeof t || t % 1 != 0)
  36739. throw TypeError("Illegal end: Not an integer");
  36740. if (t >>>= 0,
  36741. e < 0 || t < e || t > this.buffer.byteLength)
  36742. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36743. }
  36744. for (var i, n = new Array(t - e); e < t; )
  36745. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36746. return n.join("")
  36747. }
  36748. ,
  36749. f.fromHex = function(e, t, i) {
  36750. if (!i) {
  36751. if ("string" != typeof e)
  36752. throw TypeError("Illegal str: Not a string");
  36753. if (e.length % 2 != 0)
  36754. throw TypeError("Illegal str: Length not a multiple of 2")
  36755. }
  36756. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36757. if (n = parseInt(e.substring(a, a + 2), 16),
  36758. !i && (!isFinite(n) || n < 0 || 255 < n))
  36759. throw TypeError("Illegal str: Contains non-hex characters");
  36760. o.view[s++] = n
  36761. }
  36762. return o.limit = s,
  36763. o
  36764. }
  36765. ;
  36766. var u, d = u = {
  36767. MAX_CODEPOINT: 1114111,
  36768. encodeUTF8: function(e, t) {
  36769. var i = null;
  36770. for ("number" == typeof e && (i = e,
  36771. e = function() {
  36772. return null
  36773. }
  36774. ); null !== i || null !== (i = e()); )
  36775. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36776. t(i >> 12 & 63 | 128)),
  36777. t(i >> 6 & 63 | 128)),
  36778. t(63 & i | 128)),
  36779. i = null
  36780. },
  36781. decodeUTF8: function(e, t) {
  36782. for (var i, n, r, o, a = function(e) {
  36783. e = e.slice(0, e.indexOf(null));
  36784. var t = Error(e.toString());
  36785. throw t.name = "TruncatedError",
  36786. t.bytes = e,
  36787. t
  36788. }; null !== (i = e()); )
  36789. if (0 == (128 & i))
  36790. t(i);
  36791. else if (192 == (224 & i))
  36792. null === (n = e()) && a([i, n]),
  36793. t((31 & i) << 6 | 63 & n);
  36794. else if (224 == (240 & i))
  36795. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36796. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36797. else {
  36798. if (240 != (248 & i))
  36799. throw RangeError("Illegal starting byte: " + i);
  36800. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36801. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36802. }
  36803. },
  36804. UTF16toUTF8: function(e, t) {
  36805. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36806. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36807. n = null) : t(i);
  36808. null !== n && t(n)
  36809. },
  36810. UTF8toUTF16: function(e, t) {
  36811. var i = null;
  36812. for ("number" == typeof e && (i = e,
  36813. e = function() {
  36814. return null
  36815. }
  36816. ); null !== i || null !== (i = e()); )
  36817. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36818. t(i % 1024 + 56320)),
  36819. i = null
  36820. },
  36821. encodeUTF16toUTF8: function(e, t) {
  36822. u.UTF16toUTF8(e, function(e) {
  36823. u.encodeUTF8(e, t)
  36824. })
  36825. },
  36826. decodeUTF8toUTF16: function(e, t) {
  36827. u.decodeUTF8(e, function(e) {
  36828. u.UTF8toUTF16(e, t)
  36829. })
  36830. },
  36831. calculateCodePoint: function(e) {
  36832. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36833. },
  36834. calculateUTF8: function(e) {
  36835. for (var t, i = 0; null !== (t = e()); )
  36836. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36837. return i
  36838. },
  36839. calculateUTF16asUTF8: function(e) {
  36840. var t = 0
  36841. , i = 0;
  36842. return u.UTF16toUTF8(e, function(e) {
  36843. ++t,
  36844. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36845. }),
  36846. [t, i]
  36847. }
  36848. };
  36849. return a.toUTF8 = function(t, i) {
  36850. if (void 0 === t && (t = this.offset),
  36851. void 0 === i && (i = this.limit),
  36852. !this.noAssert) {
  36853. if ("number" != typeof t || t % 1 != 0)
  36854. throw TypeError("Illegal begin: Not an integer");
  36855. if (t >>>= 0,
  36856. "number" != typeof i || i % 1 != 0)
  36857. throw TypeError("Illegal end: Not an integer");
  36858. if (i >>>= 0,
  36859. t < 0 || i < t || i > this.buffer.byteLength)
  36860. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36861. }
  36862. var e;
  36863. try {
  36864. d.decodeUTF8toUTF16(function() {
  36865. return t < i ? this.view[t++] : null
  36866. }
  36867. .bind(this), e = c())
  36868. } catch (e) {
  36869. if (t !== i)
  36870. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36871. }
  36872. return e()
  36873. }
  36874. ,
  36875. f.fromUTF8 = function(e, t, i) {
  36876. if (!i && "string" != typeof e)
  36877. throw TypeError("Illegal str: Not a string");
  36878. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36879. , r = 0;
  36880. return d.encodeUTF16toUTF8(s(e), function(e) {
  36881. n.view[r++] = e
  36882. }),
  36883. n.limit = r,
  36884. n
  36885. }
  36886. ,
  36887. f
  36888. }
  36889. ,
  36890. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36891. var e;
  36892. try {
  36893. e = t("long")
  36894. } catch (e) {}
  36895. return r(e)
  36896. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36897. }
  36898. , {
  36899. long: 216
  36900. }],
  36901. 216: [function(e, t, i) {
  36902. var n, r;
  36903. n = this,
  36904. r = function() {
  36905. "use strict";
  36906. function n(e, t, i) {
  36907. this.low = 0 | e,
  36908. this.high = 0 | t,
  36909. this.unsigned = !!i
  36910. }
  36911. function p(e) {
  36912. return !0 === (e && e.__isLong__)
  36913. }
  36914. function e(e, t) {
  36915. var i, n, r;
  36916. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36917. r && (a[e] = i),
  36918. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36919. r && (o[e] = i),
  36920. i)
  36921. }
  36922. function f(e, t) {
  36923. if (isNaN(e) || !isFinite(e))
  36924. return t ? l : y;
  36925. if (t) {
  36926. if (e < 0)
  36927. return l;
  36928. if (r <= e)
  36929. return I
  36930. } else {
  36931. if (e <= -s)
  36932. return E;
  36933. if (s <= e + 1)
  36934. return C
  36935. }
  36936. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36937. }
  36938. function g(e, t, i) {
  36939. return new n(e,t,i)
  36940. }
  36941. function h(e, t, i) {
  36942. if (0 === e.length)
  36943. throw Error("empty string");
  36944. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36945. return y;
  36946. if (t = "number" == typeof t ? (i = t,
  36947. !1) : !!t,
  36948. (i = i || 10) < 2 || 36 < i)
  36949. throw RangeError("radix");
  36950. var n;
  36951. if (0 < (n = e.indexOf("-")))
  36952. throw Error("interior hyphen");
  36953. if (0 === n)
  36954. return h(e.substring(1), t, i).neg();
  36955. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36956. var s = Math.min(8, e.length - a)
  36957. , l = parseInt(e.substring(a, a + s), i);
  36958. if (s < 8) {
  36959. var c = f(u(i, s));
  36960. o = o.mul(c).add(f(l))
  36961. } else
  36962. o = (o = o.mul(r)).add(f(l))
  36963. }
  36964. return o.unsigned = t,
  36965. o
  36966. }
  36967. function m(e) {
  36968. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36969. }
  36970. Object.defineProperty(n.prototype, "__isLong__", {
  36971. value: !0,
  36972. enumerable: !1,
  36973. configurable: !1
  36974. }),
  36975. n.isLong = p;
  36976. var o = {}
  36977. , a = {};
  36978. n.fromInt = e,
  36979. n.fromNumber = f,
  36980. n.fromBits = g;
  36981. var u = Math.pow;
  36982. n.fromString = h,
  36983. n.fromValue = m;
  36984. var i = 4294967296
  36985. , r = 0x10000000000000000
  36986. , s = r / 2
  36987. , v = e(1 << 24)
  36988. , y = e(0);
  36989. n.ZERO = y;
  36990. var l = e(0, !0);
  36991. n.UZERO = l;
  36992. var c = e(1);
  36993. n.ONE = c;
  36994. var d = e(1, !0);
  36995. n.UONE = d;
  36996. var A = e(-1);
  36997. n.NEG_ONE = A;
  36998. var C = g(-1, 2147483647, !1);
  36999. n.MAX_VALUE = C;
  37000. var I = g(-1, -1, !0);
  37001. n.MAX_UNSIGNED_VALUE = I;
  37002. var E = g(0, -2147483648, !1);
  37003. n.MIN_VALUE = E;
  37004. var t = n.prototype;
  37005. return t.toInt = function() {
  37006. return this.unsigned ? this.low >>> 0 : this.low
  37007. }
  37008. ,
  37009. t.toNumber = function() {
  37010. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  37011. }
  37012. ,
  37013. t.toString = function(e) {
  37014. if ((e = e || 10) < 2 || 36 < e)
  37015. throw RangeError("radix");
  37016. if (this.isZero())
  37017. return "0";
  37018. if (this.isNegative()) {
  37019. if (this.eq(E)) {
  37020. var t = f(e)
  37021. , i = this.div(t)
  37022. , n = i.mul(t).sub(this);
  37023. return i.toString(e) + n.toInt().toString(e)
  37024. }
  37025. return "-" + this.neg().toString(e)
  37026. }
  37027. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  37028. var s = o.div(r)
  37029. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  37030. if ((o = s).isZero())
  37031. return l + a;
  37032. for (; l.length < 6; )
  37033. l = "0" + l;
  37034. a = "" + l + a
  37035. }
  37036. }
  37037. ,
  37038. t.getHighBits = function() {
  37039. return this.high
  37040. }
  37041. ,
  37042. t.getHighBitsUnsigned = function() {
  37043. return this.high >>> 0
  37044. }
  37045. ,
  37046. t.getLowBits = function() {
  37047. return this.low
  37048. }
  37049. ,
  37050. t.getLowBitsUnsigned = function() {
  37051. return this.low >>> 0
  37052. }
  37053. ,
  37054. t.getNumBitsAbs = function() {
  37055. if (this.isNegative())
  37056. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  37057. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  37058. ;
  37059. return 0 != this.high ? t + 33 : t + 1
  37060. }
  37061. ,
  37062. t.isZero = function() {
  37063. return 0 === this.high && 0 === this.low
  37064. }
  37065. ,
  37066. t.isNegative = function() {
  37067. return !this.unsigned && this.high < 0
  37068. }
  37069. ,
  37070. t.isPositive = function() {
  37071. return this.unsigned || 0 <= this.high
  37072. }
  37073. ,
  37074. t.isOdd = function() {
  37075. return 1 == (1 & this.low)
  37076. }
  37077. ,
  37078. t.isEven = function() {
  37079. return 0 == (1 & this.low)
  37080. }
  37081. ,
  37082. t.equals = function(e) {
  37083. return p(e) || (e = m(e)),
  37084. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  37085. }
  37086. ,
  37087. t.eq = t.equals,
  37088. t.notEquals = function(e) {
  37089. return !this.eq(e)
  37090. }
  37091. ,
  37092. t.neq = t.notEquals,
  37093. t.lessThan = function(e) {
  37094. return this.comp(e) < 0
  37095. }
  37096. ,
  37097. t.lt = t.lessThan,
  37098. t.lessThanOrEqual = function(e) {
  37099. return this.comp(e) <= 0
  37100. }
  37101. ,
  37102. t.lte = t.lessThanOrEqual,
  37103. t.greaterThan = function(e) {
  37104. return 0 < this.comp(e)
  37105. }
  37106. ,
  37107. t.gt = t.greaterThan,
  37108. t.greaterThanOrEqual = function(e) {
  37109. return 0 <= this.comp(e)
  37110. }
  37111. ,
  37112. t.gte = t.greaterThanOrEqual,
  37113. t.compare = function(e) {
  37114. if (p(e) || (e = m(e)),
  37115. this.eq(e))
  37116. return 0;
  37117. var t = this.isNegative()
  37118. , i = e.isNegative();
  37119. 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
  37120. }
  37121. ,
  37122. t.comp = t.compare,
  37123. t.negate = function() {
  37124. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  37125. }
  37126. ,
  37127. t.neg = t.negate,
  37128. t.add = function(e) {
  37129. p(e) || (e = m(e));
  37130. var t = this.high >>> 16
  37131. , i = 65535 & this.high
  37132. , n = this.low >>> 16
  37133. , r = 65535 & this.low
  37134. , o = e.high >>> 16
  37135. , a = 65535 & e.high
  37136. , s = e.low >>> 16
  37137. , l = 0
  37138. , c = 0
  37139. , h = 0
  37140. , u = 0;
  37141. return h += (u += r + (65535 & e.low)) >>> 16,
  37142. c += (h += n + s) >>> 16,
  37143. l += (c += i + a) >>> 16,
  37144. l += t + o,
  37145. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  37146. }
  37147. ,
  37148. t.subtract = function(e) {
  37149. return p(e) || (e = m(e)),
  37150. this.add(e.neg())
  37151. }
  37152. ,
  37153. t.sub = t.subtract,
  37154. t.multiply = function(e) {
  37155. if (this.isZero())
  37156. return y;
  37157. if (p(e) || (e = m(e)),
  37158. e.isZero())
  37159. return y;
  37160. if (this.eq(E))
  37161. return e.isOdd() ? E : y;
  37162. if (e.eq(E))
  37163. return this.isOdd() ? E : y;
  37164. if (this.isNegative())
  37165. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  37166. if (e.isNegative())
  37167. return this.mul(e.neg()).neg();
  37168. if (this.lt(v) && e.lt(v))
  37169. return f(this.toNumber() * e.toNumber(), this.unsigned);
  37170. var t = this.high >>> 16
  37171. , i = 65535 & this.high
  37172. , n = this.low >>> 16
  37173. , r = 65535 & this.low
  37174. , o = e.high >>> 16
  37175. , a = 65535 & e.high
  37176. , s = e.low >>> 16
  37177. , l = 65535 & e.low
  37178. , c = 0
  37179. , h = 0
  37180. , u = 0
  37181. , d = 0;
  37182. return u += (d += r * l) >>> 16,
  37183. h += (u += n * l) >>> 16,
  37184. u &= 65535,
  37185. h += (u += r * s) >>> 16,
  37186. c += (h += i * l) >>> 16,
  37187. h &= 65535,
  37188. c += (h += n * s) >>> 16,
  37189. h &= 65535,
  37190. c += (h += r * a) >>> 16,
  37191. c += t * l + i * s + n * a + r * o,
  37192. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  37193. }
  37194. ,
  37195. t.mul = t.multiply,
  37196. t.divide = function(e) {
  37197. if (p(e) || (e = m(e)),
  37198. e.isZero())
  37199. throw Error("division by zero");
  37200. if (this.isZero())
  37201. return this.unsigned ? l : y;
  37202. var t, i, n;
  37203. if (this.unsigned) {
  37204. if (e.unsigned || (e = e.toUnsigned()),
  37205. e.gt(this))
  37206. return l;
  37207. if (e.gt(this.shru(1)))
  37208. return d;
  37209. n = l
  37210. } else {
  37211. if (this.eq(E))
  37212. 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)),
  37213. n = t.add(i.div(e)));
  37214. if (e.eq(E))
  37215. return this.unsigned ? l : y;
  37216. if (this.isNegative())
  37217. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37218. if (e.isNegative())
  37219. return this.div(e.neg()).neg();
  37220. n = y
  37221. }
  37222. for (i = this; i.gte(e); ) {
  37223. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  37224. 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); )
  37225. s = (a = f(t -= o, this.unsigned)).mul(e);
  37226. a.isZero() && (a = c),
  37227. n = n.add(a),
  37228. i = i.sub(s)
  37229. }
  37230. return n
  37231. }
  37232. ,
  37233. t.div = t.divide,
  37234. t.modulo = function(e) {
  37235. return p(e) || (e = m(e)),
  37236. this.sub(this.div(e).mul(e))
  37237. }
  37238. ,
  37239. t.mod = t.modulo,
  37240. t.not = function() {
  37241. return g(~this.low, ~this.high, this.unsigned)
  37242. }
  37243. ,
  37244. t.and = function(e) {
  37245. return p(e) || (e = m(e)),
  37246. g(this.low & e.low, this.high & e.high, this.unsigned)
  37247. }
  37248. ,
  37249. t.or = function(e) {
  37250. return p(e) || (e = m(e)),
  37251. g(this.low | e.low, this.high | e.high, this.unsigned)
  37252. }
  37253. ,
  37254. t.xor = function(e) {
  37255. return p(e) || (e = m(e)),
  37256. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37257. }
  37258. ,
  37259. t.shiftLeft = function(e) {
  37260. return p(e) && (e = e.toInt()),
  37261. 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)
  37262. }
  37263. ,
  37264. t.shl = t.shiftLeft,
  37265. t.shiftRight = function(e) {
  37266. return p(e) && (e = e.toInt()),
  37267. 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)
  37268. }
  37269. ,
  37270. t.shr = t.shiftRight,
  37271. t.shiftRightUnsigned = function(e) {
  37272. if (p(e) && (e = e.toInt()),
  37273. 0 === (e &= 63))
  37274. return this;
  37275. var t = this.high;
  37276. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  37277. }
  37278. ,
  37279. t.shru = t.shiftRightUnsigned,
  37280. t.toSigned = function() {
  37281. return this.unsigned ? g(this.low, this.high, !1) : this
  37282. }
  37283. ,
  37284. t.toUnsigned = function() {
  37285. return this.unsigned ? this : g(this.low, this.high, !0)
  37286. }
  37287. ,
  37288. t.toBytes = function(e) {
  37289. return e ? this.toBytesLE() : this.toBytesBE()
  37290. }
  37291. ,
  37292. t.toBytesLE = function() {
  37293. var e = this.high
  37294. , t = this.low;
  37295. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37296. }
  37297. ,
  37298. t.toBytesBE = function() {
  37299. var e = this.high
  37300. , t = this.low;
  37301. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37302. }
  37303. ,
  37304. n
  37305. }
  37306. ,
  37307. "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()
  37308. }
  37309. , {}],
  37310. 217: [function(e, t, i) {
  37311. 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 = {
  37312. REVISION: "75"
  37313. };
  37314. function Ii(e, t) {
  37315. return e.distance - t.distance
  37316. }
  37317. function Ei(e, t, i, n) {
  37318. if (!1 !== e.visible && (e.raycast(t, i),
  37319. !0 === n))
  37320. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  37321. Ei(r[o], t, i, !0)
  37322. }
  37323. function _i(e, t, i) {
  37324. return i < 0 && (i += 1),
  37325. 1 < i && (i -= 1),
  37326. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37327. }
  37328. function bi(e, t, i, n, r, o, a) {
  37329. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  37330. r.multiplyScalar(Vt.x),
  37331. o.multiplyScalar(Vt.y),
  37332. a.multiplyScalar(Vt.z),
  37333. r.add(o).add(a),
  37334. r.clone()
  37335. }
  37336. function wi(e, t, i, n, r, o, a) {
  37337. var s = e.material;
  37338. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  37339. return null;
  37340. Ut.copy(a),
  37341. Ut.applyMatrix4(e.matrixWorld);
  37342. var l = t.ray.origin.distanceTo(Ut);
  37343. return l < t.near || l > t.far ? null : {
  37344. distance: l,
  37345. point: Ut.clone(),
  37346. object: e
  37347. }
  37348. }
  37349. function Ti(e, t, i, n, r, o, a, s) {
  37350. Mt.fromArray(n, 3 * o),
  37351. Rt.fromArray(n, 3 * a),
  37352. Pt.fromArray(n, 3 * s);
  37353. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  37354. return l && (r && (Nt.fromArray(r, 2 * o),
  37355. Ft.fromArray(r, 2 * a),
  37356. Bt.fromArray(r, 2 * s),
  37357. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  37358. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  37359. l.faceIndex = o),
  37360. l
  37361. }
  37362. function xi() {}
  37363. function Si(e, t, i, n, r, o) {
  37364. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  37365. if (s = e[o[t]].x,
  37366. l = e[o[t]].y,
  37367. c = e[o[i]].x,
  37368. h = e[o[i]].y,
  37369. u = e[o[n]].x,
  37370. d = e[o[n]].y,
  37371. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  37372. return !1;
  37373. for (g = u - c,
  37374. m = d - h,
  37375. v = s - u,
  37376. y = l - d,
  37377. A = c - s,
  37378. C = h - l,
  37379. a = 0; a < r; a++)
  37380. if (p = e[o[a]].x,
  37381. f = e[o[a]].y,
  37382. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  37383. E = v * (f - d) - y * (p - u),
  37384. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  37385. return !1;
  37386. return !0
  37387. }
  37388. function Mi(e) {
  37389. switch (e) {
  37390. case Ci.LinearEncoding:
  37391. return ["Linear", "( value )"];
  37392. case Ci.sRGBEncoding:
  37393. return ["sRGB", "( value )"];
  37394. case Ci.RGBEEncoding:
  37395. return ["RGBE", "( value )"];
  37396. case Ci.RGBM7Encoding:
  37397. return ["RGBM", "( value, 7.0 )"];
  37398. case Ci.RGBM16Encoding:
  37399. return ["RGBM", "( value, 16.0 )"];
  37400. case Ci.RGBDEncoding:
  37401. return ["RGBD", "( value, 256.0 )"];
  37402. case Ci.GammaEncoding:
  37403. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  37404. default:
  37405. throw new Error("unsupported encoding: " + e)
  37406. }
  37407. }
  37408. function Ri(e, t) {
  37409. var i = Mi(t);
  37410. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  37411. }
  37412. function Pi(e) {
  37413. return "" !== e
  37414. }
  37415. function Oi(e, t) {
  37416. 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)
  37417. }
  37418. function Li(e) {
  37419. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  37420. var i = Ci.ShaderChunk[t];
  37421. if (void 0 === i)
  37422. throw new Error("Can not resolve #include <" + t + ">");
  37423. return Li(i)
  37424. })
  37425. }
  37426. function Di(e) {
  37427. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  37428. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  37429. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  37430. return r
  37431. })
  37432. }
  37433. function Ni(e, t, i, n) {
  37434. gi.set(t, i, n).unproject(mi);
  37435. var r = fi[e];
  37436. if (void 0 !== r)
  37437. for (var o = 0, a = r.length; o < a; o++)
  37438. pi.vertices[r[o]].copy(gi)
  37439. }
  37440. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  37441. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37442. void 0 === Math.sign && (Math.sign = function(e) {
  37443. return e < 0 ? -1 : 0 < e ? 1 : +e
  37444. }
  37445. ),
  37446. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37447. get: function() {
  37448. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37449. }
  37450. }),
  37451. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37452. writable: !0,
  37453. configurable: !0,
  37454. value: function(e) {
  37455. "use strict";
  37456. if (null == e)
  37457. throw new TypeError("Cannot convert first argument to object");
  37458. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37459. var r = arguments[i];
  37460. if (null != r) {
  37461. r = Object(r);
  37462. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37463. var l = o[a]
  37464. , c = Object.getOwnPropertyDescriptor(r, l);
  37465. void 0 !== c && c.enumerable && (t[l] = r[l])
  37466. }
  37467. }
  37468. }
  37469. return t
  37470. }
  37471. }),
  37472. Ci.MOUSE = {
  37473. LEFT: 0,
  37474. MIDDLE: 1,
  37475. RIGHT: 2
  37476. },
  37477. Ci.CullFaceNone = 0,
  37478. Ci.CullFaceBack = 1,
  37479. Ci.CullFaceFront = 2,
  37480. Ci.CullFaceFrontBack = 3,
  37481. Ci.FrontFaceDirectionCW = 0,
  37482. Ci.FrontFaceDirectionCCW = 1,
  37483. Ci.BasicShadowMap = 0,
  37484. Ci.PCFShadowMap = 1,
  37485. Ci.PCFSoftShadowMap = 2,
  37486. Ci.FrontSide = 0,
  37487. Ci.BackSide = 1,
  37488. Ci.DoubleSide = 2,
  37489. Ci.FlatShading = 1,
  37490. Ci.SmoothShading = 2,
  37491. Ci.NoColors = 0,
  37492. Ci.FaceColors = 1,
  37493. Ci.VertexColors = 2,
  37494. Ci.NoBlending = 0,
  37495. Ci.NormalBlending = 1,
  37496. Ci.AdditiveBlending = 2,
  37497. Ci.SubtractiveBlending = 3,
  37498. Ci.MultiplyBlending = 4,
  37499. Ci.CustomBlending = 5,
  37500. Ci.AddEquation = 100,
  37501. Ci.SubtractEquation = 101,
  37502. Ci.ReverseSubtractEquation = 102,
  37503. Ci.MinEquation = 103,
  37504. Ci.MaxEquation = 104,
  37505. Ci.ZeroFactor = 200,
  37506. Ci.OneFactor = 201,
  37507. Ci.SrcColorFactor = 202,
  37508. Ci.OneMinusSrcColorFactor = 203,
  37509. Ci.SrcAlphaFactor = 204,
  37510. Ci.OneMinusSrcAlphaFactor = 205,
  37511. Ci.DstAlphaFactor = 206,
  37512. Ci.OneMinusDstAlphaFactor = 207,
  37513. Ci.DstColorFactor = 208,
  37514. Ci.OneMinusDstColorFactor = 209,
  37515. Ci.SrcAlphaSaturateFactor = 210,
  37516. Ci.NeverDepth = 0,
  37517. Ci.AlwaysDepth = 1,
  37518. Ci.LessDepth = 2,
  37519. Ci.LessEqualDepth = 3,
  37520. Ci.EqualDepth = 4,
  37521. Ci.GreaterEqualDepth = 5,
  37522. Ci.GreaterDepth = 6,
  37523. Ci.NotEqualDepth = 7,
  37524. Ci.MultiplyOperation = 0,
  37525. Ci.MixOperation = 1,
  37526. Ci.AddOperation = 2,
  37527. Ci.NoToneMapping = 0,
  37528. Ci.LinearToneMapping = 1,
  37529. Ci.ReinhardToneMapping = 2,
  37530. Ci.Uncharted2ToneMapping = 3,
  37531. Ci.CineonToneMapping = 4,
  37532. Ci.UVMapping = 300,
  37533. Ci.CubeReflectionMapping = 301,
  37534. Ci.CubeRefractionMapping = 302,
  37535. Ci.EquirectangularReflectionMapping = 303,
  37536. Ci.EquirectangularRefractionMapping = 304,
  37537. Ci.SphericalReflectionMapping = 305,
  37538. Ci.CubeUVReflectionMapping = 306,
  37539. Ci.CubeUVRefractionMapping = 307,
  37540. Ci.RepeatWrapping = 1e3,
  37541. Ci.ClampToEdgeWrapping = 1001,
  37542. Ci.MirroredRepeatWrapping = 1002,
  37543. Ci.NearestFilter = 1003,
  37544. Ci.NearestMipMapNearestFilter = 1004,
  37545. Ci.NearestMipMapLinearFilter = 1005,
  37546. Ci.LinearFilter = 1006,
  37547. Ci.LinearMipMapNearestFilter = 1007,
  37548. Ci.LinearMipMapLinearFilter = 1008,
  37549. Ci.UnsignedByteType = 1009,
  37550. Ci.ByteType = 1010,
  37551. Ci.ShortType = 1011,
  37552. Ci.UnsignedShortType = 1012,
  37553. Ci.IntType = 1013,
  37554. Ci.UnsignedIntType = 1014,
  37555. Ci.FloatType = 1015,
  37556. Ci.HalfFloatType = 1025,
  37557. Ci.UnsignedShort4444Type = 1016,
  37558. Ci.UnsignedShort5551Type = 1017,
  37559. Ci.UnsignedShort565Type = 1018,
  37560. Ci.AlphaFormat = 1019,
  37561. Ci.RGBFormat = 1020,
  37562. Ci.RGBAFormat = 1021,
  37563. Ci.LuminanceFormat = 1022,
  37564. Ci.LuminanceAlphaFormat = 1023,
  37565. Ci.RGBEFormat = Ci.RGBAFormat,
  37566. Ci.RGB_S3TC_DXT1_Format = 2001,
  37567. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37568. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37569. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37570. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37571. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37572. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37573. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37574. Ci.RGB_ETC1_Format = 2151,
  37575. Ci.LoopOnce = 2200,
  37576. Ci.LoopRepeat = 2201,
  37577. Ci.LoopPingPong = 2202,
  37578. Ci.InterpolateDiscrete = 2300,
  37579. Ci.InterpolateLinear = 2301,
  37580. Ci.InterpolateSmooth = 2302,
  37581. Ci.ZeroCurvatureEnding = 2400,
  37582. Ci.ZeroSlopeEnding = 2401,
  37583. Ci.WrapAroundEnding = 2402,
  37584. Ci.TrianglesDrawMode = 0,
  37585. Ci.TriangleStripDrawMode = 1,
  37586. Ci.TriangleFanDrawMode = 2,
  37587. Ci.LinearEncoding = 3e3,
  37588. Ci.sRGBEncoding = 3001,
  37589. Ci.GammaEncoding = 3007,
  37590. Ci.RGBEEncoding = 3002,
  37591. Ci.LogLuvEncoding = 3003,
  37592. Ci.RGBM7Encoding = 3004,
  37593. Ci.RGBM16Encoding = 3005,
  37594. Ci.RGBDEncoding = 3006,
  37595. Ci.Color = function(e) {
  37596. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37597. }
  37598. ,
  37599. Ci.Color.prototype = {
  37600. constructor: Ci.Color,
  37601. r: 1,
  37602. g: 1,
  37603. b: 1,
  37604. set: function(e) {
  37605. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37606. this
  37607. },
  37608. setScalar: function(e) {
  37609. this.r = e,
  37610. this.g = e,
  37611. this.b = e
  37612. },
  37613. setHex: function(e) {
  37614. return e = Math.floor(e),
  37615. this.r = (e >> 16 & 255) / 255,
  37616. this.g = (e >> 8 & 255) / 255,
  37617. this.b = (255 & e) / 255,
  37618. this
  37619. },
  37620. setRGB: function(e, t, i) {
  37621. return this.r = e,
  37622. this.g = t,
  37623. this.b = i,
  37624. this
  37625. },
  37626. setHSL: function(e, t, i) {
  37627. if (e = Ci.Math.euclideanModulo(e, 1),
  37628. t = Ci.Math.clamp(t, 0, 1),
  37629. i = Ci.Math.clamp(i, 0, 1),
  37630. 0 === t)
  37631. this.r = this.g = this.b = i;
  37632. else {
  37633. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37634. , r = 2 * i - n;
  37635. this.r = _i(r, n, e + 1 / 3),
  37636. this.g = _i(r, n, e),
  37637. this.b = _i(r, n, e - 1 / 3)
  37638. }
  37639. return this
  37640. },
  37641. setStyle: function(t) {
  37642. function e(e) {
  37643. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37644. }
  37645. var i;
  37646. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37647. var n, r = i[1], o = i[2];
  37648. switch (r) {
  37649. case "rgb":
  37650. case "rgba":
  37651. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37652. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37653. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37654. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37655. e(n[5]),
  37656. this;
  37657. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37658. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37659. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37660. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37661. e(n[5]),
  37662. this;
  37663. break;
  37664. case "hsl":
  37665. case "hsla":
  37666. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37667. var a = parseFloat(n[1]) / 360
  37668. , s = parseInt(n[2], 10) / 100
  37669. , l = parseInt(n[3], 10) / 100;
  37670. return e(n[5]),
  37671. this.setHSL(a, s, l)
  37672. }
  37673. }
  37674. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37675. var c, h = (c = i[1]).length;
  37676. if (3 === h)
  37677. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37678. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37679. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37680. this;
  37681. if (6 === h)
  37682. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37683. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37684. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37685. this
  37686. }
  37687. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37688. return this
  37689. },
  37690. clone: function() {
  37691. return new this.constructor(this.r,this.g,this.b)
  37692. },
  37693. copy: function(e) {
  37694. return this.r = e.r,
  37695. this.g = e.g,
  37696. this.b = e.b,
  37697. this
  37698. },
  37699. copyGammaToLinear: function(e, t) {
  37700. return void 0 === t && (t = 2),
  37701. this.r = Math.pow(e.r, t),
  37702. this.g = Math.pow(e.g, t),
  37703. this.b = Math.pow(e.b, t),
  37704. this
  37705. },
  37706. copyLinearToGamma: function(e, t) {
  37707. void 0 === t && (t = 2);
  37708. var i = 0 < t ? 1 / t : 1;
  37709. return this.r = Math.pow(e.r, i),
  37710. this.g = Math.pow(e.g, i),
  37711. this.b = Math.pow(e.b, i),
  37712. this
  37713. },
  37714. convertGammaToLinear: function() {
  37715. var e = this.r
  37716. , t = this.g
  37717. , i = this.b;
  37718. return this.r = e * e,
  37719. this.g = t * t,
  37720. this.b = i * i,
  37721. this
  37722. },
  37723. convertLinearToGamma: function() {
  37724. return this.r = Math.sqrt(this.r),
  37725. this.g = Math.sqrt(this.g),
  37726. this.b = Math.sqrt(this.b),
  37727. this
  37728. },
  37729. getHex: function() {
  37730. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37731. },
  37732. getHexString: function() {
  37733. return ("000000" + this.getHex().toString(16)).slice(-6)
  37734. },
  37735. getHSL: function(e) {
  37736. var t, i, n = e || {
  37737. h: 0,
  37738. s: 0,
  37739. l: 0
  37740. }, 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;
  37741. if (l === s)
  37742. i = t = 0;
  37743. else {
  37744. var h = s - l;
  37745. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37746. s) {
  37747. case r:
  37748. t = (o - a) / h + (o < a ? 6 : 0);
  37749. break;
  37750. case o:
  37751. t = (a - r) / h + 2;
  37752. break;
  37753. case a:
  37754. t = (r - o) / h + 4
  37755. }
  37756. t /= 6
  37757. }
  37758. return n.h = t,
  37759. n.s = i,
  37760. n.l = c,
  37761. n
  37762. },
  37763. getStyle: function() {
  37764. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37765. },
  37766. offsetHSL: function(e, t, i) {
  37767. var n = this.getHSL();
  37768. return n.h += e,
  37769. n.s += t,
  37770. n.l += i,
  37771. this.setHSL(n.h, n.s, n.l),
  37772. this
  37773. },
  37774. add: function(e) {
  37775. return this.r += e.r,
  37776. this.g += e.g,
  37777. this.b += e.b,
  37778. this
  37779. },
  37780. addColors: function(e, t) {
  37781. return this.r = e.r + t.r,
  37782. this.g = e.g + t.g,
  37783. this.b = e.b + t.b,
  37784. this
  37785. },
  37786. addScalar: function(e) {
  37787. return this.r += e,
  37788. this.g += e,
  37789. this.b += e,
  37790. this
  37791. },
  37792. multiply: function(e) {
  37793. return this.r *= e.r,
  37794. this.g *= e.g,
  37795. this.b *= e.b,
  37796. this
  37797. },
  37798. multiplyScalar: function(e) {
  37799. return this.r *= e,
  37800. this.g *= e,
  37801. this.b *= e,
  37802. this
  37803. },
  37804. lerp: function(e, t) {
  37805. return this.r += (e.r - this.r) * t,
  37806. this.g += (e.g - this.g) * t,
  37807. this.b += (e.b - this.b) * t,
  37808. this
  37809. },
  37810. equals: function(e) {
  37811. return e.r === this.r && e.g === this.g && e.b === this.b
  37812. },
  37813. fromArray: function(e, t) {
  37814. return void 0 === t && (t = 0),
  37815. this.r = e[t],
  37816. this.g = e[t + 1],
  37817. this.b = e[t + 2],
  37818. this
  37819. },
  37820. toArray: function(e, t) {
  37821. return void 0 === e && (e = []),
  37822. void 0 === t && (t = 0),
  37823. e[t] = this.r,
  37824. e[t + 1] = this.g,
  37825. e[t + 2] = this.b,
  37826. e
  37827. }
  37828. },
  37829. Ci.ColorKeywords = {
  37830. aliceblue: 15792383,
  37831. antiquewhite: 16444375,
  37832. aqua: 65535,
  37833. aquamarine: 8388564,
  37834. azure: 15794175,
  37835. beige: 16119260,
  37836. bisque: 16770244,
  37837. black: 0,
  37838. blanchedalmond: 16772045,
  37839. blue: 255,
  37840. blueviolet: 9055202,
  37841. brown: 10824234,
  37842. burlywood: 14596231,
  37843. cadetblue: 6266528,
  37844. chartreuse: 8388352,
  37845. chocolate: 13789470,
  37846. coral: 16744272,
  37847. cornflowerblue: 6591981,
  37848. cornsilk: 16775388,
  37849. crimson: 14423100,
  37850. cyan: 65535,
  37851. darkblue: 139,
  37852. darkcyan: 35723,
  37853. darkgoldenrod: 12092939,
  37854. darkgray: 11119017,
  37855. darkgreen: 25600,
  37856. darkgrey: 11119017,
  37857. darkkhaki: 12433259,
  37858. darkmagenta: 9109643,
  37859. darkolivegreen: 5597999,
  37860. darkorange: 16747520,
  37861. darkorchid: 10040012,
  37862. darkred: 9109504,
  37863. darksalmon: 15308410,
  37864. darkseagreen: 9419919,
  37865. darkslateblue: 4734347,
  37866. darkslategray: 3100495,
  37867. darkslategrey: 3100495,
  37868. darkturquoise: 52945,
  37869. darkviolet: 9699539,
  37870. deeppink: 16716947,
  37871. deepskyblue: 49151,
  37872. dimgray: 6908265,
  37873. dimgrey: 6908265,
  37874. dodgerblue: 2003199,
  37875. firebrick: 11674146,
  37876. floralwhite: 16775920,
  37877. forestgreen: 2263842,
  37878. fuchsia: 16711935,
  37879. gainsboro: 14474460,
  37880. ghostwhite: 16316671,
  37881. gold: 16766720,
  37882. goldenrod: 14329120,
  37883. gray: 8421504,
  37884. green: 32768,
  37885. greenyellow: 11403055,
  37886. grey: 8421504,
  37887. honeydew: 15794160,
  37888. hotpink: 16738740,
  37889. indianred: 13458524,
  37890. indigo: 4915330,
  37891. ivory: 16777200,
  37892. khaki: 15787660,
  37893. lavender: 15132410,
  37894. lavenderblush: 16773365,
  37895. lawngreen: 8190976,
  37896. lemonchiffon: 16775885,
  37897. lightblue: 11393254,
  37898. lightcoral: 15761536,
  37899. lightcyan: 14745599,
  37900. lightgoldenrodyellow: 16448210,
  37901. lightgray: 13882323,
  37902. lightgreen: 9498256,
  37903. lightgrey: 13882323,
  37904. lightpink: 16758465,
  37905. lightsalmon: 16752762,
  37906. lightseagreen: 2142890,
  37907. lightskyblue: 8900346,
  37908. lightslategray: 7833753,
  37909. lightslategrey: 7833753,
  37910. lightsteelblue: 11584734,
  37911. lightyellow: 16777184,
  37912. lime: 65280,
  37913. limegreen: 3329330,
  37914. linen: 16445670,
  37915. magenta: 16711935,
  37916. maroon: 8388608,
  37917. mediumaquamarine: 6737322,
  37918. mediumblue: 205,
  37919. mediumorchid: 12211667,
  37920. mediumpurple: 9662683,
  37921. mediumseagreen: 3978097,
  37922. mediumslateblue: 8087790,
  37923. mediumspringgreen: 64154,
  37924. mediumturquoise: 4772300,
  37925. mediumvioletred: 13047173,
  37926. midnightblue: 1644912,
  37927. mintcream: 16121850,
  37928. mistyrose: 16770273,
  37929. moccasin: 16770229,
  37930. navajowhite: 16768685,
  37931. navy: 128,
  37932. oldlace: 16643558,
  37933. olive: 8421376,
  37934. olivedrab: 7048739,
  37935. orange: 16753920,
  37936. orangered: 16729344,
  37937. orchid: 14315734,
  37938. palegoldenrod: 15657130,
  37939. palegreen: 10025880,
  37940. paleturquoise: 11529966,
  37941. palevioletred: 14381203,
  37942. papayawhip: 16773077,
  37943. peachpuff: 16767673,
  37944. peru: 13468991,
  37945. pink: 16761035,
  37946. plum: 14524637,
  37947. powderblue: 11591910,
  37948. purple: 8388736,
  37949. red: 16711680,
  37950. rosybrown: 12357519,
  37951. royalblue: 4286945,
  37952. saddlebrown: 9127187,
  37953. salmon: 16416882,
  37954. sandybrown: 16032864,
  37955. seagreen: 3050327,
  37956. seashell: 16774638,
  37957. sienna: 10506797,
  37958. silver: 12632256,
  37959. skyblue: 8900331,
  37960. slateblue: 6970061,
  37961. slategray: 7372944,
  37962. slategrey: 7372944,
  37963. snow: 16775930,
  37964. springgreen: 65407,
  37965. steelblue: 4620980,
  37966. tan: 13808780,
  37967. teal: 32896,
  37968. thistle: 14204888,
  37969. tomato: 16737095,
  37970. turquoise: 4251856,
  37971. violet: 15631086,
  37972. wheat: 16113331,
  37973. white: 16777215,
  37974. whitesmoke: 16119285,
  37975. yellow: 16776960,
  37976. yellowgreen: 10145074
  37977. },
  37978. Ci.Quaternion = function(e, t, i, n) {
  37979. this._x = e || 0,
  37980. this._y = t || 0,
  37981. this._z = i || 0,
  37982. this._w = void 0 !== n ? n : 1
  37983. }
  37984. ,
  37985. Ci.Quaternion.prototype = {
  37986. constructor: Ci.Quaternion,
  37987. get x() {
  37988. return this._x
  37989. },
  37990. set x(e) {
  37991. this._x = e,
  37992. this.onChangeCallback()
  37993. },
  37994. get y() {
  37995. return this._y
  37996. },
  37997. set y(e) {
  37998. this._y = e,
  37999. this.onChangeCallback()
  38000. },
  38001. get z() {
  38002. return this._z
  38003. },
  38004. set z(e) {
  38005. this._z = e,
  38006. this.onChangeCallback()
  38007. },
  38008. get w() {
  38009. return this._w
  38010. },
  38011. set w(e) {
  38012. this._w = e,
  38013. this.onChangeCallback()
  38014. },
  38015. set: function(e, t, i, n) {
  38016. return this._x = e,
  38017. this._y = t,
  38018. this._z = i,
  38019. this._w = n,
  38020. this.onChangeCallback(),
  38021. this
  38022. },
  38023. clone: function() {
  38024. return new this.constructor(this._x,this._y,this._z,this._w)
  38025. },
  38026. toObject:function(){//add
  38027. return {x:this.x, y:this.y,z:this.z, w:this.w};
  38028. },
  38029. copy: function(e) {
  38030. return this._x = e.x,
  38031. this._y = e.y,
  38032. this._z = e.z,
  38033. this._w = e.w,
  38034. this.onChangeCallback(),
  38035. this
  38036. },
  38037. setFromEuler: function(e, t) {
  38038. if (e instanceof Ci.Euler == 0)
  38039. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  38040. var i = Math.cos(e._x / 2)
  38041. , n = Math.cos(e._y / 2)
  38042. , r = Math.cos(e._z / 2)
  38043. , o = Math.sin(e._x / 2)
  38044. , a = Math.sin(e._y / 2)
  38045. , s = Math.sin(e._z / 2)
  38046. , l = e.order;
  38047. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  38048. this._y = i * a * r - o * n * s,
  38049. this._z = i * n * s + o * a * r,
  38050. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  38051. this._y = i * a * r - o * n * s,
  38052. this._z = i * n * s - o * a * r,
  38053. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  38054. this._y = i * a * r + o * n * s,
  38055. this._z = i * n * s + o * a * r,
  38056. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  38057. this._y = i * a * r + o * n * s,
  38058. this._z = i * n * s - o * a * r,
  38059. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  38060. this._y = i * a * r + o * n * s,
  38061. this._z = i * n * s - o * a * r,
  38062. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  38063. this._y = i * a * r - o * n * s,
  38064. this._z = i * n * s + o * a * r,
  38065. this._w = i * n * r + o * a * s),
  38066. !1 !== t && this.onChangeCallback(),
  38067. this
  38068. },
  38069. setFromAxisAngle: function(e, t) {
  38070. var i = t / 2
  38071. , n = Math.sin(i);
  38072. return this._x = e.x * n,
  38073. this._y = e.y * n,
  38074. this._z = e.z * n,
  38075. this._w = Math.cos(i),
  38076. this.onChangeCallback(),
  38077. this
  38078. },
  38079. setFromRotationMatrix: function(e) {
  38080. 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;
  38081. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  38082. this._w = .25 / t,
  38083. this._x = (h - l) * t,
  38084. this._y = (o - c) * t,
  38085. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  38086. this._w = (h - l) / t,
  38087. this._x = .25 * t,
  38088. this._y = (r + a) / t,
  38089. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  38090. this._w = (o - c) / t,
  38091. this._x = (r + a) / t,
  38092. this._y = .25 * t,
  38093. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  38094. this._w = (a - r) / t,
  38095. this._x = (o + c) / t,
  38096. this._y = (l + h) / t,
  38097. this._z = .25 * t),
  38098. this.onChangeCallback(),
  38099. this
  38100. },
  38101. setFromUnitVectors: function(e, t) {
  38102. return void 0 === Be && (Be = new Ci.Vector3),
  38103. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  38104. 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),
  38105. this._x = Be.x,
  38106. this._y = Be.y,
  38107. this._z = Be.z,
  38108. this._w = Ve,
  38109. this.normalize(),
  38110. this
  38111. },
  38112. inverse: function() {
  38113. return this.conjugate().normalize(),
  38114. this
  38115. },
  38116. conjugate: function() {
  38117. return this._x *= -1,
  38118. this._y *= -1,
  38119. this._z *= -1,
  38120. this.onChangeCallback(),
  38121. this
  38122. },
  38123. dot: function(e) {
  38124. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  38125. },
  38126. lengthSq: function() {
  38127. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  38128. },
  38129. length: function() {
  38130. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  38131. },
  38132. normalize: function() {
  38133. var e = this.length();
  38134. return 0 === e ? (this._x = 0,
  38135. this._y = 0,
  38136. this._z = 0,
  38137. this._w = 1) : (e = 1 / e,
  38138. this._x = this._x * e,
  38139. this._y = this._y * e,
  38140. this._z = this._z * e,
  38141. this._w = this._w * e),
  38142. this.onChangeCallback(),
  38143. this
  38144. },
  38145. multiply: function(e, t) {
  38146. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  38147. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  38148. },
  38149. multiplyQuaternions: function(e, t) {
  38150. var i = e._x
  38151. , n = e._y
  38152. , r = e._z
  38153. , o = e._w
  38154. , a = t._x
  38155. , s = t._y
  38156. , l = t._z
  38157. , c = t._w;
  38158. return this._x = i * c + o * a + n * l - r * s,
  38159. this._y = n * c + o * s + r * a - i * l,
  38160. this._z = r * c + o * l + i * s - n * a,
  38161. this._w = o * c - i * a - n * s - r * l,
  38162. this.onChangeCallback(),
  38163. this
  38164. },
  38165. slerp: function(e, t) {
  38166. if (0 === t)
  38167. return this;
  38168. if (1 === t)
  38169. return this.copy(e);
  38170. var i = this._x
  38171. , n = this._y
  38172. , r = this._z
  38173. , o = this._w
  38174. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  38175. if (a < 0 ? (this._w = -e._w,
  38176. this._x = -e._x,
  38177. this._y = -e._y,
  38178. this._z = -e._z,
  38179. a = -a) : this.copy(e),
  38180. 1 <= a)
  38181. return this._w = o,
  38182. this._x = i,
  38183. this._y = n,
  38184. this._z = r,
  38185. this;
  38186. var s = Math.sqrt(1 - a * a);
  38187. if (Math.abs(s) < .001)
  38188. return this._w = .5 * (o + this._w),
  38189. this._x = .5 * (i + this._x),
  38190. this._y = .5 * (n + this._y),
  38191. this._z = .5 * (r + this._z),
  38192. this;
  38193. var l = Math.atan2(s, a)
  38194. , c = Math.sin((1 - t) * l) / s
  38195. , h = Math.sin(t * l) / s;
  38196. return this._w = o * c + this._w * h,
  38197. this._x = i * c + this._x * h,
  38198. this._y = n * c + this._y * h,
  38199. this._z = r * c + this._z * h,
  38200. this.onChangeCallback(),
  38201. this
  38202. },
  38203. equals: function(e) {
  38204. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38205. },
  38206. fromArray: function(e, t) {
  38207. return void 0 === t && (t = 0),
  38208. this._x = e[t],
  38209. this._y = e[t + 1],
  38210. this._z = e[t + 2],
  38211. this._w = e[t + 3],
  38212. this.onChangeCallback(),
  38213. this
  38214. },
  38215. toArray: function(e, t) {
  38216. return void 0 === e && (e = []),
  38217. void 0 === t && (t = 0),
  38218. e[t] = this._x,
  38219. e[t + 1] = this._y,
  38220. e[t + 2] = this._z,
  38221. e[t + 3] = this._w,
  38222. e
  38223. },
  38224. onChange: function(e) {
  38225. return this.onChangeCallback = e,
  38226. this
  38227. },
  38228. onChangeCallback: function() {}
  38229. },
  38230. Object.assign(Ci.Quaternion, {
  38231. slerp: function(e, t, i, n) {
  38232. return i.copy(e).slerp(t, n)
  38233. },
  38234. slerpFlat: function(e, t, i, n, r, o, a) {
  38235. var s = i[n + 0]
  38236. , l = i[n + 1]
  38237. , c = i[n + 2]
  38238. , h = i[n + 3]
  38239. , u = r[o + 0]
  38240. , d = r[o + 1]
  38241. , p = r[o + 2]
  38242. , f = r[o + 3];
  38243. if (h !== f || s !== u || l !== d || c !== p) {
  38244. var g = 1 - a
  38245. , m = s * u + l * d + c * p + h * f
  38246. , v = 0 <= m ? 1 : -1
  38247. , y = 1 - m * m;
  38248. if (y > Number.EPSILON) {
  38249. var A = Math.sqrt(y)
  38250. , C = Math.atan2(A, m * v);
  38251. g = Math.sin(g * C) / A,
  38252. a = Math.sin(a * C) / A
  38253. }
  38254. var I = a * v;
  38255. if (s = s * g + u * I,
  38256. l = l * g + d * I,
  38257. c = c * g + p * I,
  38258. h = h * g + f * I,
  38259. g === 1 - a) {
  38260. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38261. s *= E,
  38262. l *= E,
  38263. c *= E,
  38264. h *= E
  38265. }
  38266. }
  38267. e[t] = s,
  38268. e[t + 1] = l,
  38269. e[t + 2] = c,
  38270. e[t + 3] = h
  38271. }
  38272. }),
  38273. Ci.Vector2 = function(e, t) {
  38274. this.x = e || 0,
  38275. this.y = t || 0
  38276. }
  38277. ,
  38278. Ci.Vector2.prototype = {
  38279. constructor: Ci.Vector2,
  38280. get width() {
  38281. return this.x
  38282. },
  38283. set width(e) {
  38284. this.x = e
  38285. },
  38286. get height() {
  38287. return this.y
  38288. },
  38289. set height(e) {
  38290. this.y = e
  38291. },
  38292. set: function(e, t) {
  38293. return this.x = e,
  38294. this.y = t,
  38295. this
  38296. },
  38297. setScalar: function(e) {
  38298. return this.x = e,
  38299. this.y = e,
  38300. this
  38301. },
  38302. setX: function(e) {
  38303. return this.x = e,
  38304. this
  38305. },
  38306. setY: function(e) {
  38307. return this.y = e,
  38308. this
  38309. },
  38310. setComponent: function(e, t) {
  38311. switch (e) {
  38312. case 0:
  38313. this.x = t;
  38314. break;
  38315. case 1:
  38316. this.y = t;
  38317. break;
  38318. default:
  38319. throw new Error("index is out of range: " + e)
  38320. }
  38321. },
  38322. getComponent: function(e) {
  38323. switch (e) {
  38324. case 0:
  38325. return this.x;
  38326. case 1:
  38327. return this.y;
  38328. default:
  38329. throw new Error("index is out of range: " + e)
  38330. }
  38331. },
  38332. clone: function() {
  38333. return new this.constructor(this.x,this.y)
  38334. },
  38335. copy: function(e) {
  38336. return this.x = e.x,
  38337. this.y = e.y,
  38338. this
  38339. },
  38340. add: function(e, t) {
  38341. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38342. this.addVectors(e, t)) : (this.x += e.x,
  38343. this.y += e.y,
  38344. this)
  38345. },
  38346. addScalar: function(e) {
  38347. return this.x += e,
  38348. this.y += e,
  38349. this
  38350. },
  38351. addVectors: function(e, t) {
  38352. return this.x = e.x + t.x,
  38353. this.y = e.y + t.y,
  38354. this
  38355. },
  38356. addScaledVector: function(e, t) {
  38357. return this.x += e.x * t,
  38358. this.y += e.y * t,
  38359. this
  38360. },
  38361. sub: function(e, t) {
  38362. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38363. this.subVectors(e, t)) : (this.x -= e.x,
  38364. this.y -= e.y,
  38365. this)
  38366. },
  38367. subScalar: function(e) {
  38368. return this.x -= e,
  38369. this.y -= e,
  38370. this
  38371. },
  38372. subVectors: function(e, t) {
  38373. return this.x = e.x - t.x,
  38374. this.y = e.y - t.y,
  38375. this
  38376. },
  38377. multiply: function(e) {
  38378. return this.x *= e.x,
  38379. this.y *= e.y,
  38380. this
  38381. },
  38382. multiplyScalar: function(e) {
  38383. return isFinite(e) ? (this.x *= e,
  38384. this.y *= e) : (this.x = 0,
  38385. this.y = 0),
  38386. this
  38387. },
  38388. divide: function(e) {
  38389. return this.x /= e.x,
  38390. this.y /= e.y,
  38391. this
  38392. },
  38393. divideScalar: function(e) {
  38394. return this.multiplyScalar(1 / e)
  38395. },
  38396. min: function(e) {
  38397. return this.x = Math.min(this.x, e.x),
  38398. this.y = Math.min(this.y, e.y),
  38399. this
  38400. },
  38401. max: function(e) {
  38402. return this.x = Math.max(this.x, e.x),
  38403. this.y = Math.max(this.y, e.y),
  38404. this
  38405. },
  38406. clamp: function(e, t) {
  38407. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38408. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38409. this
  38410. },
  38411. clampScalar: function(e, t) {
  38412. return void 0 === Ne && (Ne = new Ci.Vector2,
  38413. Fe = new Ci.Vector2),
  38414. Ne.set(e, e),
  38415. Fe.set(t, t),
  38416. this.clamp(Ne, Fe)
  38417. },
  38418. clampLength: function(e, t) {
  38419. var i = this.length();
  38420. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38421. this
  38422. },
  38423. floor: function() {
  38424. return this.x = Math.floor(this.x),
  38425. this.y = Math.floor(this.y),
  38426. this
  38427. },
  38428. ceil: function() {
  38429. return this.x = Math.ceil(this.x),
  38430. this.y = Math.ceil(this.y),
  38431. this
  38432. },
  38433. round: function() {
  38434. return this.x = Math.round(this.x),
  38435. this.y = Math.round(this.y),
  38436. this
  38437. },
  38438. roundToZero: function() {
  38439. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38440. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38441. this
  38442. },
  38443. negate: function() {
  38444. return this.x = -this.x,
  38445. this.y = -this.y,
  38446. this
  38447. },
  38448. dot: function(e) {
  38449. return this.x * e.x + this.y * e.y
  38450. },
  38451. lengthSq: function() {
  38452. return this.x * this.x + this.y * this.y
  38453. },
  38454. length: function() {
  38455. return Math.sqrt(this.x * this.x + this.y * this.y)
  38456. },
  38457. lengthManhattan: function() {
  38458. return Math.abs(this.x) + Math.abs(this.y)
  38459. },
  38460. normalize: function() {
  38461. return this.divideScalar(this.length())
  38462. },
  38463. angle: function() {
  38464. var e = Math.atan2(this.y, this.x);
  38465. return e < 0 && (e += 2 * Math.PI),
  38466. e
  38467. },
  38468. distanceTo: function(e) {
  38469. return Math.sqrt(this.distanceToSquared(e))
  38470. },
  38471. distanceToSquared: function(e) {
  38472. var t = this.x - e.x
  38473. , i = this.y - e.y;
  38474. return t * t + i * i
  38475. },
  38476. setLength: function(e) {
  38477. return this.multiplyScalar(e / this.length())
  38478. },
  38479. lerp: function(e, t) {
  38480. return this.x += (e.x - this.x) * t,
  38481. this.y += (e.y - this.y) * t,
  38482. this
  38483. },
  38484. lerpVectors: function(e, t, i) {
  38485. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38486. this
  38487. },
  38488. equals: function(e) {
  38489. return e.x === this.x && e.y === this.y
  38490. },
  38491. fromArray: function(e, t) {
  38492. return void 0 === t && (t = 0),
  38493. this.x = e[t],
  38494. this.y = e[t + 1],
  38495. this
  38496. },
  38497. toArray: function(e, t) {
  38498. return void 0 === e && (e = []),
  38499. void 0 === t && (t = 0),
  38500. e[t] = this.x,
  38501. e[t + 1] = this.y,
  38502. e
  38503. },
  38504. fromAttribute: function(e, t, i) {
  38505. return void 0 === i && (i = 0),
  38506. t = t * e.itemSize + i,
  38507. this.x = e.array[t],
  38508. this.y = e.array[t + 1],
  38509. this
  38510. },
  38511. rotateAround: function(e, t) {
  38512. var i = Math.cos(t)
  38513. , n = Math.sin(t)
  38514. , r = this.x - e.x
  38515. , o = this.y - e.y;
  38516. return this.x = r * i - o * n + e.x,
  38517. this.y = r * n + o * i + e.y,
  38518. this
  38519. }
  38520. },
  38521. Ci.Vector3 = function(e, t, i) {
  38522. this.x = e || 0,
  38523. this.y = t || 0,
  38524. this.z = i || 0
  38525. }
  38526. ,
  38527. Ci.Vector3.prototype = {
  38528. constructor: Ci.Vector3,
  38529. set: function(e, t, i) {
  38530. return this.x = e,
  38531. this.y = t,
  38532. this.z = i,
  38533. this
  38534. },
  38535. setScalar: function(e) {
  38536. return this.x = e,
  38537. this.y = e,
  38538. this.z = e,
  38539. this
  38540. },
  38541. setX: function(e) {
  38542. return this.x = e,
  38543. this
  38544. },
  38545. setY: function(e) {
  38546. return this.y = e,
  38547. this
  38548. },
  38549. setZ: function(e) {
  38550. return this.z = e,
  38551. this
  38552. },
  38553. setComponent: function(e, t) {
  38554. switch (e) {
  38555. case 0:
  38556. this.x = t;
  38557. break;
  38558. case 1:
  38559. this.y = t;
  38560. break;
  38561. case 2:
  38562. this.z = t;
  38563. break;
  38564. default:
  38565. throw new Error("index is out of range: " + e)
  38566. }
  38567. },
  38568. getComponent: function(e) {
  38569. switch (e) {
  38570. case 0:
  38571. return this.x;
  38572. case 1:
  38573. return this.y;
  38574. case 2:
  38575. return this.z;
  38576. default:
  38577. throw new Error("index is out of range: " + e)
  38578. }
  38579. },
  38580. clone: function() {
  38581. return new this.constructor(this.x,this.y,this.z)
  38582. },
  38583. copy: function(e) {
  38584. return this.x = e.x,
  38585. this.y = e.y,
  38586. this.z = e.z,
  38587. this
  38588. },
  38589. add: function(e, t) {
  38590. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38591. this.addVectors(e, t)) : (this.x += e.x,
  38592. this.y += e.y,
  38593. this.z += e.z,
  38594. this)
  38595. },
  38596. addScalar: function(e) {
  38597. return this.x += e,
  38598. this.y += e,
  38599. this.z += e,
  38600. this
  38601. },
  38602. addVectors: function(e, t) {
  38603. return this.x = e.x + t.x,
  38604. this.y = e.y + t.y,
  38605. this.z = e.z + t.z,
  38606. this
  38607. },
  38608. addScaledVector: function(e, t) {
  38609. return this.x += e.x * t,
  38610. this.y += e.y * t,
  38611. this.z += e.z * t,
  38612. this
  38613. },
  38614. sub: function(e, t) {
  38615. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38616. this.subVectors(e, t)) : (this.x -= e.x,
  38617. this.y -= e.y,
  38618. this.z -= e.z,
  38619. this)
  38620. },
  38621. subScalar: function(e) {
  38622. return this.x -= e,
  38623. this.y -= e,
  38624. this.z -= e,
  38625. this
  38626. },
  38627. subVectors: function(e, t) {
  38628. return this.x = e.x - t.x,
  38629. this.y = e.y - t.y,
  38630. this.z = e.z - t.z,
  38631. this
  38632. },
  38633. multiply: function(e, t) {
  38634. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38635. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38636. this.y *= e.y,
  38637. this.z *= e.z,
  38638. this)
  38639. },
  38640. multiplyScalar: function(e) {
  38641. return isFinite(e) ? (this.x *= e,
  38642. this.y *= e,
  38643. this.z *= e) : (this.x = 0,
  38644. this.y = 0,
  38645. this.z = 0),
  38646. this
  38647. },
  38648. multiplyVectors: function(e, t) {
  38649. return this.x = e.x * t.x,
  38650. this.y = e.y * t.y,
  38651. this.z = e.z * t.z,
  38652. this
  38653. },
  38654. applyEuler: function(e) {
  38655. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38656. void 0 === De && (De = new Ci.Quaternion),
  38657. this.applyQuaternion(De.setFromEuler(e)),
  38658. this
  38659. },
  38660. applyAxisAngle: function(e, t) {
  38661. return void 0 === Le && (Le = new Ci.Quaternion),
  38662. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38663. this
  38664. },
  38665. applyMatrix3: function(e) {
  38666. var t = this.x
  38667. , i = this.y
  38668. , n = this.z
  38669. , r = e.elements;
  38670. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38671. this.y = r[1] * t + r[4] * i + r[7] * n,
  38672. this.z = r[2] * t + r[5] * i + r[8] * n,
  38673. this
  38674. },
  38675. applyMatrix4: function(e) {
  38676. var t = this.x
  38677. , i = this.y
  38678. , n = this.z
  38679. , r = e.elements;
  38680. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38681. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38682. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38683. this
  38684. },
  38685. applyProjection: function(e) {
  38686. var t = this.x
  38687. , i = this.y
  38688. , n = this.z
  38689. , r = e.elements
  38690. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38691. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38692. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38693. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38694. this
  38695. },
  38696. applyQuaternion: function(e) {
  38697. var t = this.x
  38698. , i = this.y
  38699. , n = this.z
  38700. , r = e.x
  38701. , o = e.y
  38702. , a = e.z
  38703. , s = e.w
  38704. , l = s * t + o * n - a * i
  38705. , c = s * i + a * t - r * n
  38706. , h = s * n + r * i - o * t
  38707. , u = -r * t - o * i - a * n;
  38708. return this.x = l * s + u * -r + c * -a - h * -o,
  38709. this.y = c * s + u * -o + h * -r - l * -a,
  38710. this.z = h * s + u * -a + l * -o - c * -r,
  38711. this
  38712. },
  38713. project: function(e) {
  38714. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38715. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38716. this.applyProjection(Oe)
  38717. },
  38718. unproject: function(e) {
  38719. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38720. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38721. this.applyProjection(Pe)
  38722. },
  38723. transformDirection: function(e) {
  38724. var t = this.x
  38725. , i = this.y
  38726. , n = this.z
  38727. , r = e.elements;
  38728. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38729. this.y = r[1] * t + r[5] * i + r[9] * n,
  38730. this.z = r[2] * t + r[6] * i + r[10] * n,
  38731. this.normalize(),
  38732. this
  38733. },
  38734. divide: function(e) {
  38735. return this.x /= e.x,
  38736. this.y /= e.y,
  38737. this.z /= e.z,
  38738. this
  38739. },
  38740. divideScalar: function(e) {
  38741. return this.multiplyScalar(1 / e)
  38742. },
  38743. min: function(e) {
  38744. return this.x = Math.min(this.x, e.x),
  38745. this.y = Math.min(this.y, e.y),
  38746. this.z = Math.min(this.z, e.z),
  38747. this
  38748. },
  38749. max: function(e) {
  38750. return this.x = Math.max(this.x, e.x),
  38751. this.y = Math.max(this.y, e.y),
  38752. this.z = Math.max(this.z, e.z),
  38753. this
  38754. },
  38755. clamp: function(e, t) {
  38756. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38757. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38758. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38759. this
  38760. },
  38761. clampScalar: function(e, t) {
  38762. return void 0 === Me && (Me = new Ci.Vector3,
  38763. Re = new Ci.Vector3),
  38764. Me.set(e, e, e),
  38765. Re.set(t, t, t),
  38766. this.clamp(Me, Re)
  38767. },
  38768. clampLength: function(e, t) {
  38769. var i = this.length();
  38770. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38771. this
  38772. },
  38773. floor: function() {
  38774. return this.x = Math.floor(this.x),
  38775. this.y = Math.floor(this.y),
  38776. this.z = Math.floor(this.z),
  38777. this
  38778. },
  38779. ceil: function() {
  38780. return this.x = Math.ceil(this.x),
  38781. this.y = Math.ceil(this.y),
  38782. this.z = Math.ceil(this.z),
  38783. this
  38784. },
  38785. round: function() {
  38786. return this.x = Math.round(this.x),
  38787. this.y = Math.round(this.y),
  38788. this.z = Math.round(this.z),
  38789. this
  38790. },
  38791. roundToZero: function() {
  38792. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38793. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38794. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38795. this
  38796. },
  38797. negate: function() {
  38798. return this.x = -this.x,
  38799. this.y = -this.y,
  38800. this.z = -this.z,
  38801. this
  38802. },
  38803. dot: function(e) {
  38804. return this.x * e.x + this.y * e.y + this.z * e.z
  38805. },
  38806. lengthSq: function() {
  38807. return this.x * this.x + this.y * this.y + this.z * this.z
  38808. },
  38809. length: function() {
  38810. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38811. },
  38812. lengthManhattan: function() {
  38813. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38814. },
  38815. normalize: function() {
  38816. return this.divideScalar(this.length())
  38817. },
  38818. setLength: function(e) {
  38819. return this.multiplyScalar(e / this.length())
  38820. },
  38821. lerp: function(e, t) {
  38822. return this.x += (e.x - this.x) * t,
  38823. this.y += (e.y - this.y) * t,
  38824. this.z += (e.z - this.z) * t,
  38825. this
  38826. },
  38827. lerpVectors: function(e, t, i) {
  38828. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38829. this
  38830. },
  38831. cross: function(e, t) {
  38832. if (void 0 !== t)
  38833. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38834. this.crossVectors(e, t);
  38835. var i = this.x
  38836. , n = this.y
  38837. , r = this.z;
  38838. return this.x = n * e.z - r * e.y,
  38839. this.y = r * e.x - i * e.z,
  38840. this.z = i * e.y - n * e.x,
  38841. this
  38842. },
  38843. crossVectors: function(e, t) {
  38844. var i = e.x
  38845. , n = e.y
  38846. , r = e.z
  38847. , o = t.x
  38848. , a = t.y
  38849. , s = t.z;
  38850. return this.x = n * s - r * a,
  38851. this.y = r * o - i * s,
  38852. this.z = i * a - n * o,
  38853. this
  38854. },
  38855. projectOnVector: function(e) {
  38856. return void 0 === xe && (xe = new Ci.Vector3),
  38857. xe.copy(e).normalize(),
  38858. Se = this.dot(xe),
  38859. this.copy(xe).multiplyScalar(Se)
  38860. },
  38861. projectOnPlane: function(e) {
  38862. return void 0 === Te && (Te = new Ci.Vector3),
  38863. Te.copy(this).projectOnVector(e),
  38864. this.sub(Te)
  38865. },
  38866. reflect: function(e) {
  38867. return void 0 === we && (we = new Ci.Vector3),
  38868. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38869. },
  38870. angleTo: function(e) {
  38871. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38872. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38873. },
  38874. distanceTo: function(e) {
  38875. return Math.sqrt(this.distanceToSquared(e))
  38876. },
  38877. distanceToSquared: function(e) {
  38878. var t = this.x - e.x
  38879. , i = this.y - e.y
  38880. , n = this.z - e.z;
  38881. return t * t + i * i + n * n
  38882. },
  38883. setFromSpherical: function(e) {
  38884. var t = Math.sin(e.phi) * e.radius;
  38885. return this.x = t * Math.sin(e.theta),
  38886. this.y = Math.cos(e.phi) * e.radius,
  38887. this.z = t * Math.cos(e.theta),
  38888. this
  38889. },
  38890. setFromMatrixPosition: function(e) {
  38891. return this.setFromMatrixColumn(e, 3)
  38892. },
  38893. setFromMatrixScale: function(e) {
  38894. var t = this.setFromMatrixColumn(e, 0).length()
  38895. , i = this.setFromMatrixColumn(e, 1).length()
  38896. , n = this.setFromMatrixColumn(e, 2).length();
  38897. return this.x = t,
  38898. this.y = i,
  38899. this.z = n,
  38900. this
  38901. },
  38902. setFromMatrixColumn: function(e, t) {
  38903. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38904. t = e = t),
  38905. this.fromArray(e.elements, 4 * t)
  38906. },
  38907. equals: function(e) {
  38908. return e.x === this.x && e.y === this.y && e.z === this.z
  38909. },
  38910. fromArray: function(e, t) {
  38911. return void 0 === t && (t = 0),
  38912. this.x = e[t],
  38913. this.y = e[t + 1],
  38914. this.z = e[t + 2],
  38915. this
  38916. },
  38917. toArray: function(e, t) {
  38918. return void 0 === e && (e = []),
  38919. void 0 === t && (t = 0),
  38920. e[t] = this.x,
  38921. e[t + 1] = this.y,
  38922. e[t + 2] = this.z,
  38923. e
  38924. },
  38925. fromAttribute: function(e, t, i) {
  38926. return void 0 === i && (i = 0),
  38927. t = t * e.itemSize + i,
  38928. this.x = e.array[t],
  38929. this.y = e.array[t + 1],
  38930. this.z = e.array[t + 2],
  38931. this
  38932. }
  38933. },
  38934. Ci.Vector4 = function(e, t, i, n) {
  38935. this.x = e || 0,
  38936. this.y = t || 0,
  38937. this.z = i || 0,
  38938. this.w = void 0 !== n ? n : 1
  38939. }
  38940. ,
  38941. Ci.Vector4.prototype = {
  38942. constructor: Ci.Vector4,
  38943. set: function(e, t, i, n) {
  38944. return this.x = e,
  38945. this.y = t,
  38946. this.z = i,
  38947. this.w = n,
  38948. this
  38949. },
  38950. setScalar: function(e) {
  38951. return this.x = e,
  38952. this.y = e,
  38953. this.z = e,
  38954. this.w = e,
  38955. this
  38956. },
  38957. setX: function(e) {
  38958. return this.x = e,
  38959. this
  38960. },
  38961. setY: function(e) {
  38962. return this.y = e,
  38963. this
  38964. },
  38965. setZ: function(e) {
  38966. return this.z = e,
  38967. this
  38968. },
  38969. setW: function(e) {
  38970. return this.w = e,
  38971. this
  38972. },
  38973. setComponent: function(e, t) {
  38974. switch (e) {
  38975. case 0:
  38976. this.x = t;
  38977. break;
  38978. case 1:
  38979. this.y = t;
  38980. break;
  38981. case 2:
  38982. this.z = t;
  38983. break;
  38984. case 3:
  38985. this.w = t;
  38986. break;
  38987. default:
  38988. throw new Error("index is out of range: " + e)
  38989. }
  38990. },
  38991. getComponent: function(e) {
  38992. switch (e) {
  38993. case 0:
  38994. return this.x;
  38995. case 1:
  38996. return this.y;
  38997. case 2:
  38998. return this.z;
  38999. case 3:
  39000. return this.w;
  39001. default:
  39002. throw new Error("index is out of range: " + e)
  39003. }
  39004. },
  39005. clone: function() {
  39006. return new this.constructor(this.x,this.y,this.z,this.w)
  39007. },
  39008. copy: function(e) {
  39009. return this.x = e.x,
  39010. this.y = e.y,
  39011. this.z = e.z,
  39012. this.w = void 0 !== e.w ? e.w : 1,
  39013. this
  39014. },
  39015. add: function(e, t) {
  39016. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39017. this.addVectors(e, t)) : (this.x += e.x,
  39018. this.y += e.y,
  39019. this.z += e.z,
  39020. this.w += e.w,
  39021. this)
  39022. },
  39023. addScalar: function(e) {
  39024. return this.x += e,
  39025. this.y += e,
  39026. this.z += e,
  39027. this.w += e,
  39028. this
  39029. },
  39030. addVectors: function(e, t) {
  39031. return this.x = e.x + t.x,
  39032. this.y = e.y + t.y,
  39033. this.z = e.z + t.z,
  39034. this.w = e.w + t.w,
  39035. this
  39036. },
  39037. addScaledVector: function(e, t) {
  39038. return this.x += e.x * t,
  39039. this.y += e.y * t,
  39040. this.z += e.z * t,
  39041. this.w += e.w * t,
  39042. this
  39043. },
  39044. sub: function(e, t) {
  39045. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39046. this.subVectors(e, t)) : (this.x -= e.x,
  39047. this.y -= e.y,
  39048. this.z -= e.z,
  39049. this.w -= e.w,
  39050. this)
  39051. },
  39052. subScalar: function(e) {
  39053. return this.x -= e,
  39054. this.y -= e,
  39055. this.z -= e,
  39056. this.w -= e,
  39057. this
  39058. },
  39059. subVectors: function(e, t) {
  39060. return this.x = e.x - t.x,
  39061. this.y = e.y - t.y,
  39062. this.z = e.z - t.z,
  39063. this.w = e.w - t.w,
  39064. this
  39065. },
  39066. multiplyScalar: function(e) {
  39067. return isFinite(e) ? (this.x *= e,
  39068. this.y *= e,
  39069. this.z *= e,
  39070. this.w *= e) : (this.x = 0,
  39071. this.y = 0,
  39072. this.z = 0,
  39073. this.w = 0),
  39074. this
  39075. },
  39076. applyMatrix4: function(e) {
  39077. var t = this.x
  39078. , i = this.y
  39079. , n = this.z
  39080. , r = this.w
  39081. , o = e.elements;
  39082. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  39083. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  39084. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  39085. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  39086. this
  39087. },
  39088. divideScalar: function(e) {
  39089. return this.multiplyScalar(1 / e)
  39090. },
  39091. setAxisAngleFromQuaternion: function(e) {
  39092. this.w = 2 * Math.acos(e.w);
  39093. var t = Math.sqrt(1 - e.w * e.w);
  39094. return t < 1e-4 ? (this.x = 1,
  39095. this.y = 0,
  39096. this.z = 0) : (this.x = e.x / t,
  39097. this.y = e.y / t,
  39098. this.z = e.z / t),
  39099. this
  39100. },
  39101. setAxisAngleFromRotationMatrix: function(e) {
  39102. 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];
  39103. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  39104. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  39105. return this.set(1, 0, 0, 0),
  39106. this;
  39107. t = Math.PI;
  39108. var g = (a + 1) / 2
  39109. , m = (h + 1) / 2
  39110. , v = (f + 1) / 2
  39111. , y = (s + c) / 4
  39112. , A = (l + d) / 4
  39113. , C = (u + p) / 4;
  39114. return m < g && v < g ? r = g < .01 ? (i = 0,
  39115. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  39116. A / i) : v < m ? r = m < .01 ? (n = 0,
  39117. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  39118. C / n) : v < .01 ? (n = i = .707106781,
  39119. r = 0) : (i = A / (r = Math.sqrt(v)),
  39120. n = C / r),
  39121. this.set(i, n, r, t),
  39122. this
  39123. }
  39124. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  39125. return Math.abs(I) < .001 && (I = 1),
  39126. this.x = (p - u) / I,
  39127. this.y = (l - d) / I,
  39128. this.z = (c - s) / I,
  39129. this.w = Math.acos((a + h + f - 1) / 2),
  39130. this
  39131. },
  39132. min: function(e) {
  39133. return this.x = Math.min(this.x, e.x),
  39134. this.y = Math.min(this.y, e.y),
  39135. this.z = Math.min(this.z, e.z),
  39136. this.w = Math.min(this.w, e.w),
  39137. this
  39138. },
  39139. max: function(e) {
  39140. return this.x = Math.max(this.x, e.x),
  39141. this.y = Math.max(this.y, e.y),
  39142. this.z = Math.max(this.z, e.z),
  39143. this.w = Math.max(this.w, e.w),
  39144. this
  39145. },
  39146. clamp: function(e, t) {
  39147. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39148. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39149. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39150. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  39151. this
  39152. },
  39153. clampScalar: function(e, t) {
  39154. return void 0 === _e && (_e = new Ci.Vector4,
  39155. be = new Ci.Vector4),
  39156. _e.set(e, e, e, e),
  39157. be.set(t, t, t, t),
  39158. this.clamp(_e, be)
  39159. },
  39160. floor: function() {
  39161. return this.x = Math.floor(this.x),
  39162. this.y = Math.floor(this.y),
  39163. this.z = Math.floor(this.z),
  39164. this.w = Math.floor(this.w),
  39165. this
  39166. },
  39167. ceil: function() {
  39168. return this.x = Math.ceil(this.x),
  39169. this.y = Math.ceil(this.y),
  39170. this.z = Math.ceil(this.z),
  39171. this.w = Math.ceil(this.w),
  39172. this
  39173. },
  39174. round: function() {
  39175. return this.x = Math.round(this.x),
  39176. this.y = Math.round(this.y),
  39177. this.z = Math.round(this.z),
  39178. this.w = Math.round(this.w),
  39179. this
  39180. },
  39181. roundToZero: function() {
  39182. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39183. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39184. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39185. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  39186. this
  39187. },
  39188. negate: function() {
  39189. return this.x = -this.x,
  39190. this.y = -this.y,
  39191. this.z = -this.z,
  39192. this.w = -this.w,
  39193. this
  39194. },
  39195. dot: function(e) {
  39196. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39197. },
  39198. lengthSq: function() {
  39199. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39200. },
  39201. length: function() {
  39202. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39203. },
  39204. lengthManhattan: function() {
  39205. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39206. },
  39207. normalize: function() {
  39208. return this.divideScalar(this.length())
  39209. },
  39210. setLength: function(e) {
  39211. return this.multiplyScalar(e / this.length())
  39212. },
  39213. lerp: function(e, t) {
  39214. return this.x += (e.x - this.x) * t,
  39215. this.y += (e.y - this.y) * t,
  39216. this.z += (e.z - this.z) * t,
  39217. this.w += (e.w - this.w) * t,
  39218. this
  39219. },
  39220. lerpVectors: function(e, t, i) {
  39221. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39222. this
  39223. },
  39224. equals: function(e) {
  39225. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39226. },
  39227. fromArray: function(e, t) {
  39228. return void 0 === t && (t = 0),
  39229. this.x = e[t],
  39230. this.y = e[t + 1],
  39231. this.z = e[t + 2],
  39232. this.w = e[t + 3],
  39233. this
  39234. },
  39235. toArray: function(e, t) {
  39236. return void 0 === e && (e = []),
  39237. void 0 === t && (t = 0),
  39238. e[t] = this.x,
  39239. e[t + 1] = this.y,
  39240. e[t + 2] = this.z,
  39241. e[t + 3] = this.w,
  39242. e
  39243. },
  39244. fromAttribute: function(e, t, i) {
  39245. return void 0 === i && (i = 0),
  39246. t = t * e.itemSize + i,
  39247. this.x = e.array[t],
  39248. this.y = e.array[t + 1],
  39249. this.z = e.array[t + 2],
  39250. this.w = e.array[t + 3],
  39251. this
  39252. }
  39253. },
  39254. Ci.Euler = function(e, t, i, n) {
  39255. this._x = e || 0,
  39256. this._y = t || 0,
  39257. this._z = i || 0,
  39258. this._order = n || Ci.Euler.DefaultOrder
  39259. }
  39260. ,
  39261. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39262. Ci.Euler.DefaultOrder = "XYZ",
  39263. Ci.Euler.prototype = {
  39264. constructor: Ci.Euler,
  39265. get x() {
  39266. return this._x
  39267. },
  39268. set x(e) {
  39269. this._x = e,
  39270. this.onChangeCallback()
  39271. },
  39272. get y() {
  39273. return this._y
  39274. },
  39275. set y(e) {
  39276. this._y = e,
  39277. this.onChangeCallback()
  39278. },
  39279. get z() {
  39280. return this._z
  39281. },
  39282. set z(e) {
  39283. this._z = e,
  39284. this.onChangeCallback()
  39285. },
  39286. get order() {
  39287. return this._order
  39288. },
  39289. set order(e) {
  39290. this._order = e,
  39291. this.onChangeCallback()
  39292. },
  39293. set: function(e, t, i, n) {
  39294. return this._x = e,
  39295. this._y = t,
  39296. this._z = i,
  39297. this._order = n || this._order,
  39298. this.onChangeCallback(),
  39299. this
  39300. },
  39301. clone: function() {
  39302. return new this.constructor(this._x,this._y,this._z,this._order)
  39303. },
  39304. copy: function(e) {
  39305. return this._x = e._x,
  39306. this._y = e._y,
  39307. this._z = e._z,
  39308. this._order = e._order,
  39309. this.onChangeCallback(),
  39310. this
  39311. },
  39312. toObject: function() {//xzw
  39313. return {x:this.x,y:this.y,z:this.z}
  39314. },
  39315. setFromRotationMatrix: function(e, t, i) {
  39316. var n = Ci.Math.clamp
  39317. , r = e.elements
  39318. , o = r[0]
  39319. , a = r[4]
  39320. , s = r[8]
  39321. , l = r[1]
  39322. , c = r[5]
  39323. , h = r[9]
  39324. , u = r[2]
  39325. , d = r[6]
  39326. , p = r[10];
  39327. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  39328. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  39329. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  39330. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  39331. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  39332. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  39333. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  39334. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  39335. this._z = Math.atan2(-a, c)) : (this._y = 0,
  39336. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  39337. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  39338. this._z = Math.atan2(l, o)) : (this._x = 0,
  39339. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  39340. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  39341. this._y = Math.atan2(-u, o)) : (this._x = 0,
  39342. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  39343. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  39344. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  39345. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39346. this._order = t,
  39347. !1 !== i && this.onChangeCallback(),
  39348. this
  39349. },
  39350. setFromQuaternion: function(e, t, i) {
  39351. return void 0 === Ee && (Ee = new Ci.Matrix4),
  39352. Ee.makeRotationFromQuaternion(e),
  39353. this.setFromRotationMatrix(Ee, t, i),
  39354. this
  39355. },
  39356. setFromVector3: function(e, t) {
  39357. return this.set(e.x, e.y, e.z, t || this._order)
  39358. },
  39359. reorder: (Ie = new Ci.Quaternion,
  39360. function(e) {
  39361. Ie.setFromEuler(this),
  39362. this.setFromQuaternion(Ie, e)
  39363. }
  39364. ),
  39365. equals: function(e) {
  39366. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39367. },
  39368. fromArray: function(e) {
  39369. return this._x = e[0],
  39370. this._y = e[1],
  39371. this._z = e[2],
  39372. void 0 !== e[3] && (this._order = e[3]),
  39373. this.onChangeCallback(),
  39374. this
  39375. },
  39376. toArray: function(e, t) {
  39377. return void 0 === e && (e = []),
  39378. void 0 === t && (t = 0),
  39379. e[t] = this._x,
  39380. e[t + 1] = this._y,
  39381. e[t + 2] = this._z,
  39382. e[t + 3] = this._order,
  39383. e
  39384. },
  39385. toVector3: function(e) {
  39386. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  39387. },
  39388. onChange: function(e) {
  39389. return this.onChangeCallback = e,
  39390. this
  39391. },
  39392. onChangeCallback: function() {}
  39393. },
  39394. Ci.Line3 = function(e, t) {
  39395. this.start = void 0 !== e ? e : new Ci.Vector3,
  39396. this.end = void 0 !== t ? t : new Ci.Vector3
  39397. }
  39398. ,
  39399. Ci.Line3.prototype = {
  39400. constructor: Ci.Line3,
  39401. set: function(e, t) {
  39402. return this.start.copy(e),
  39403. this.end.copy(t),
  39404. this
  39405. },
  39406. clone: function() {
  39407. return (new this.constructor).copy(this)
  39408. },
  39409. copy: function(e) {
  39410. return this.start.copy(e.start),
  39411. this.end.copy(e.end),
  39412. this
  39413. },
  39414. center: function(e) {
  39415. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  39416. },
  39417. delta: function(e) {
  39418. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  39419. },
  39420. distanceSq: function() {
  39421. return this.start.distanceToSquared(this.end)
  39422. },
  39423. distance: function() {
  39424. return this.start.distanceTo(this.end)
  39425. },
  39426. at: function(e, t) {
  39427. var i = t || new Ci.Vector3;
  39428. return this.delta(i).multiplyScalar(e).add(this.start)
  39429. },
  39430. closestPointToPointParameter: (Ae = new Ci.Vector3,
  39431. Ce = new Ci.Vector3,
  39432. function(e, t) {
  39433. Ae.subVectors(e, this.start),
  39434. Ce.subVectors(this.end, this.start);
  39435. var i = Ce.dot(Ce)
  39436. , n = Ce.dot(Ae) / i;
  39437. return t && (n = Ci.Math.clamp(n, 0, 1)),
  39438. n
  39439. }
  39440. ),
  39441. closestPointToPoint: function(e, t, i) {
  39442. var n = this.closestPointToPointParameter(e, t)
  39443. , r = i || new Ci.Vector3;
  39444. return this.delta(r).multiplyScalar(n).add(this.start)
  39445. },
  39446. applyMatrix4: function(e) {
  39447. return this.start.applyMatrix4(e),
  39448. this.end.applyMatrix4(e),
  39449. this
  39450. },
  39451. equals: function(e) {
  39452. return e.start.equals(this.start) && e.end.equals(this.end)
  39453. }
  39454. },
  39455. Ci.Box2 = function(e, t) {
  39456. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  39457. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  39458. }
  39459. ,
  39460. Ci.Box2.prototype = {
  39461. constructor: Ci.Box2,
  39462. set: function(e, t) {
  39463. return this.min.copy(e),
  39464. this.max.copy(t),
  39465. this
  39466. },
  39467. setFromPoints: function(e) {
  39468. this.makeEmpty();
  39469. for (var t = 0, i = e.length; t < i; t++)
  39470. this.expandByPoint(e[t]);
  39471. return this
  39472. },
  39473. setFromCenterAndSize: (ye = new Ci.Vector2,
  39474. function(e, t) {
  39475. var i = ye.copy(t).multiplyScalar(.5);
  39476. return this.min.copy(e).sub(i),
  39477. this.max.copy(e).add(i),
  39478. this
  39479. }
  39480. ),
  39481. clone: function() {
  39482. return (new this.constructor).copy(this)
  39483. },
  39484. copy: function(e) {
  39485. return this.min.copy(e.min),
  39486. this.max.copy(e.max),
  39487. this
  39488. },
  39489. makeEmpty: function() {
  39490. return this.min.x = this.min.y = 1 / 0,
  39491. this.max.x = this.max.y = -1 / 0,
  39492. this
  39493. },
  39494. isEmpty: function() {
  39495. return this.max.x < this.min.x || this.max.y < this.min.y
  39496. },
  39497. center: function(e) {
  39498. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39499. },
  39500. size: function(e) {
  39501. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39502. },
  39503. expandByPoint: function(e) {
  39504. return this.min.min(e),
  39505. this.max.max(e),
  39506. this
  39507. },
  39508. expandByVector: function(e) {
  39509. return this.min.sub(e),
  39510. this.max.add(e),
  39511. this
  39512. },
  39513. expandByScalar: function(e) {
  39514. return this.min.addScalar(-e),
  39515. this.max.addScalar(e),
  39516. this
  39517. },
  39518. containsPoint: function(e) {
  39519. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39520. },
  39521. containsBox: function(e) {
  39522. 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
  39523. },
  39524. getParameter: function(e, t) {
  39525. 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))
  39526. },
  39527. intersectsBox: function(e) {
  39528. 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)
  39529. },
  39530. clampPoint: function(e, t) {
  39531. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39532. },
  39533. distanceToPoint: (ve = new Ci.Vector2,
  39534. function(e) {
  39535. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39536. }
  39537. ),
  39538. intersect: function(e) {
  39539. return this.min.max(e.min),
  39540. this.max.min(e.max),
  39541. this
  39542. },
  39543. union: function(e) {
  39544. return this.min.min(e.min),
  39545. this.max.max(e.max),
  39546. this
  39547. },
  39548. translate: function(e) {
  39549. return this.min.add(e),
  39550. this.max.add(e),
  39551. this
  39552. },
  39553. equals: function(e) {
  39554. return e.min.equals(this.min) && e.max.equals(this.max)
  39555. }
  39556. },
  39557. Ci.Box3 = function(e, t) {
  39558. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39559. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39560. }
  39561. ,
  39562. Ci.Box3.prototype = {
  39563. constructor: Ci.Box3,
  39564. set: function(e, t) {
  39565. return this.min.copy(e),
  39566. this.max.copy(t),
  39567. this
  39568. },
  39569. setFromArray: function(e) {
  39570. this.makeEmpty();
  39571. 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) {
  39572. var c = e[s]
  39573. , h = e[s + 1]
  39574. , u = e[s + 2];
  39575. c < t && (t = c),
  39576. h < i && (i = h),
  39577. u < n && (n = u),
  39578. r < c && (r = c),
  39579. o < h && (o = h),
  39580. a < u && (a = u)
  39581. }
  39582. this.min.set(t, i, n),
  39583. this.max.set(r, o, a)
  39584. },
  39585. setFromPoints: function(e) {
  39586. this.makeEmpty();
  39587. for (var t = 0, i = e.length; t < i; t++)
  39588. this.expandByPoint(e[t]);
  39589. return this
  39590. },
  39591. setFromCenterAndSize: (me = new Ci.Vector3,
  39592. function(e, t) {
  39593. var i = me.copy(t).multiplyScalar(.5);
  39594. return this.min.copy(e).sub(i),
  39595. this.max.copy(e).add(i),
  39596. this
  39597. }
  39598. ),
  39599. setFromObject: function(e) {
  39600. void 0 === ge && (ge = new Ci.Box3);
  39601. var i = this;
  39602. return this.makeEmpty(),
  39603. e.updateMatrixWorld(!0),
  39604. e.traverse(function(e) {
  39605. var t = e.geometry;
  39606. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39607. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39608. ge.applyMatrix4(e.matrixWorld),
  39609. i.union(ge)))
  39610. }),
  39611. this
  39612. },
  39613. clone: function() {
  39614. return (new this.constructor).copy(this)
  39615. },
  39616. copy: function(e) {
  39617. return this.min.copy(e.min),
  39618. this.max.copy(e.max),
  39619. this
  39620. },
  39621. makeEmpty: function() {
  39622. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39623. this.max.x = this.max.y = this.max.z = -1 / 0,
  39624. this
  39625. },
  39626. isEmpty: function() {
  39627. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39628. },
  39629. center: function(e) {
  39630. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39631. },
  39632. size: function(e) {
  39633. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39634. },
  39635. expandByPoint: function(e) {
  39636. return this.min.min(e),
  39637. this.max.max(e),
  39638. this
  39639. },
  39640. expandByVector: function(e) {
  39641. return this.min.sub(e),
  39642. this.max.add(e),
  39643. this
  39644. },
  39645. expandByScalar: function(e) {
  39646. return this.min.addScalar(-e),
  39647. this.max.addScalar(e),
  39648. this
  39649. },
  39650. containsPoint: function(e) {
  39651. 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)
  39652. },
  39653. containsBox: function(e) {
  39654. 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
  39655. },
  39656. getParameter: function(e, t) {
  39657. 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))
  39658. },
  39659. intersectsBox: function(e) {
  39660. 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)
  39661. },
  39662. intersectsSphere: function(e) {
  39663. return void 0 === fe && (fe = new Ci.Vector3),
  39664. this.clampPoint(e.center, fe),
  39665. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39666. },
  39667. intersectsPlane: function(e) {
  39668. var t, i;
  39669. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39670. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39671. e.normal.x * this.min.x),
  39672. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39673. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39674. i += e.normal.y * this.min.y),
  39675. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39676. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39677. i += e.normal.z * this.min.z),
  39678. t <= e.constant && i >= e.constant
  39679. },
  39680. clampPoint: function(e, t) {
  39681. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39682. },
  39683. distanceToPoint: (pe = new Ci.Vector3,
  39684. function(e) {
  39685. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39686. }
  39687. ),
  39688. getBoundingSphere: (de = new Ci.Vector3,
  39689. function(e) {
  39690. var t = e || new Ci.Sphere;
  39691. return t.center = this.center(),
  39692. t.radius = .5 * this.size(de).length(),
  39693. t
  39694. }
  39695. ),
  39696. intersect: function(e) {
  39697. return this.min.max(e.min),
  39698. this.max.min(e.max),
  39699. this
  39700. },
  39701. union: function(e) {
  39702. return this.min.min(e.min),
  39703. this.max.max(e.max),
  39704. this
  39705. },
  39706. 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],
  39707. function(e) {
  39708. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39709. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39710. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39711. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39712. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39713. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39714. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39715. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39716. this.makeEmpty(),
  39717. this.setFromPoints(ue),
  39718. this
  39719. }
  39720. ),
  39721. translate: function(e) {
  39722. return this.min.add(e),
  39723. this.max.add(e),
  39724. this
  39725. },
  39726. equals: function(e) {
  39727. return e.min.equals(this.min) && e.max.equals(this.max)
  39728. }
  39729. },
  39730. Ci.Matrix3 = function() {
  39731. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39732. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39733. }
  39734. ,
  39735. Ci.Matrix3.prototype = {
  39736. constructor: Ci.Matrix3,
  39737. set: function(e, t, i, n, r, o, a, s, l) {
  39738. var c = this.elements;
  39739. return c[0] = e,
  39740. c[1] = n,
  39741. c[2] = a,
  39742. c[3] = t,
  39743. c[4] = r,
  39744. c[5] = s,
  39745. c[6] = i,
  39746. c[7] = o,
  39747. c[8] = l,
  39748. this
  39749. },
  39750. identity: function() {
  39751. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39752. this
  39753. },
  39754. clone: function() {
  39755. return (new this.constructor).fromArray(this.elements)
  39756. },
  39757. copy: function(e) {
  39758. var t = e.elements;
  39759. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39760. this
  39761. },
  39762. setFromMatrix4: function(e) {
  39763. var t = e.elements;
  39764. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39765. this
  39766. },
  39767. applyToVector3Array: function(e, t, i) {
  39768. void 0 === he && (he = new Ci.Vector3),
  39769. void 0 === t && (t = 0),
  39770. void 0 === i && (i = e.length);
  39771. for (var n = 0, r = t; n < i; n += 3,
  39772. r += 3)
  39773. he.fromArray(e, r),
  39774. he.applyMatrix3(this),
  39775. he.toArray(e, r);
  39776. return e
  39777. },
  39778. applyToBuffer: function(e, t, i) {
  39779. void 0 === ce && (ce = new Ci.Vector3),
  39780. void 0 === t && (t = 0),
  39781. void 0 === i && (i = e.length / e.itemSize);
  39782. for (var n = 0, r = t; n < i; n++,
  39783. r++)
  39784. ce.x = e.getX(r),
  39785. ce.y = e.getY(r),
  39786. ce.z = e.getZ(r),
  39787. ce.applyMatrix3(this),
  39788. e.setXYZ(ce.x, ce.y, ce.z);
  39789. return e
  39790. },
  39791. multiplyScalar: function(e) {
  39792. var t = this.elements;
  39793. return t[0] *= e,
  39794. t[3] *= e,
  39795. t[6] *= e,
  39796. t[1] *= e,
  39797. t[4] *= e,
  39798. t[7] *= e,
  39799. t[2] *= e,
  39800. t[5] *= e,
  39801. t[8] *= e,
  39802. this
  39803. },
  39804. determinant: function() {
  39805. var e = this.elements
  39806. , t = e[0]
  39807. , i = e[1]
  39808. , n = e[2]
  39809. , r = e[3]
  39810. , o = e[4]
  39811. , a = e[5]
  39812. , s = e[6]
  39813. , l = e[7]
  39814. , c = e[8];
  39815. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39816. },
  39817. getInverse: function(e, t) {
  39818. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39819. var i = e.elements
  39820. , n = this.elements
  39821. , r = i[0]
  39822. , o = i[1]
  39823. , a = i[2]
  39824. , s = i[3]
  39825. , l = i[4]
  39826. , c = i[5]
  39827. , h = i[6]
  39828. , u = i[7]
  39829. , d = i[8]
  39830. , p = d * l - c * u
  39831. , f = c * h - d * s
  39832. , g = u * s - l * h
  39833. , m = r * p + o * f + a * g;
  39834. if (0 != m)
  39835. return n[0] = p,
  39836. n[1] = a * u - d * o,
  39837. n[2] = c * o - a * l,
  39838. n[3] = f,
  39839. n[4] = d * r - a * h,
  39840. n[5] = a * s - c * r,
  39841. n[6] = g,
  39842. n[7] = o * h - u * r,
  39843. n[8] = l * r - o * s,
  39844. this.multiplyScalar(1 / m);
  39845. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39846. if (t)
  39847. throw new Error(v);
  39848. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39849. },
  39850. transpose: function() {
  39851. var e, t = this.elements;
  39852. return e = t[1],
  39853. t[1] = t[3],
  39854. t[3] = e,
  39855. e = t[2],
  39856. t[2] = t[6],
  39857. t[6] = e,
  39858. e = t[5],
  39859. t[5] = t[7],
  39860. t[7] = e,
  39861. this
  39862. },
  39863. flattenToArrayOffset: function(e, t) {
  39864. var i = this.elements;
  39865. return e[t] = i[0],
  39866. e[t + 1] = i[1],
  39867. e[t + 2] = i[2],
  39868. e[t + 3] = i[3],
  39869. e[t + 4] = i[4],
  39870. e[t + 5] = i[5],
  39871. e[t + 6] = i[6],
  39872. e[t + 7] = i[7],
  39873. e[t + 8] = i[8],
  39874. e
  39875. },
  39876. getNormalMatrix: function(e) {
  39877. return this.setFromMatrix4(e).getInverse(this).transpose()
  39878. },
  39879. transposeIntoArray: function(e) {
  39880. var t = this.elements;
  39881. return e[0] = t[0],
  39882. e[1] = t[3],
  39883. e[2] = t[6],
  39884. e[3] = t[1],
  39885. e[4] = t[4],
  39886. e[5] = t[7],
  39887. e[6] = t[2],
  39888. e[7] = t[5],
  39889. e[8] = t[8],
  39890. this
  39891. },
  39892. fromArray: function(e) {
  39893. return this.elements.set(e),
  39894. this
  39895. },
  39896. toArray: function() {
  39897. var e = this.elements;
  39898. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39899. }
  39900. },
  39901. Ci.Matrix4 = function() {
  39902. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39903. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39904. }
  39905. ,
  39906. Ci.Matrix4.prototype = {
  39907. constructor: Ci.Matrix4,
  39908. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39909. var m = this.elements;
  39910. return m[0] = e,
  39911. m[4] = t,
  39912. m[8] = i,
  39913. m[12] = n,
  39914. m[1] = r,
  39915. m[5] = o,
  39916. m[9] = a,
  39917. m[13] = s,
  39918. m[2] = l,
  39919. m[6] = c,
  39920. m[10] = h,
  39921. m[14] = u,
  39922. m[3] = d,
  39923. m[7] = p,
  39924. m[11] = f,
  39925. m[15] = g,
  39926. this
  39927. },
  39928. identity: function() {
  39929. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39930. this
  39931. },
  39932. clone: function() {
  39933. return (new Ci.Matrix4).fromArray(this.elements)
  39934. },
  39935. copy: function(e) {
  39936. return this.elements.set(e.elements),
  39937. this
  39938. },
  39939. copyPosition: function(e) {
  39940. var t = this.elements
  39941. , i = e.elements;
  39942. return t[12] = i[12],
  39943. t[13] = i[13],
  39944. t[14] = i[14],
  39945. this
  39946. },
  39947. extractBasis: function(e, t, i) {
  39948. return e.setFromMatrixColumn(this, 0),
  39949. t.setFromMatrixColumn(this, 1),
  39950. i.setFromMatrixColumn(this, 2),
  39951. this
  39952. },
  39953. makeBasis: function(e, t, i) {
  39954. 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),
  39955. this
  39956. },
  39957. extractRotation: function(e) {
  39958. void 0 === le && (le = new Ci.Vector3);
  39959. var t = this.elements
  39960. , i = e.elements
  39961. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39962. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39963. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39964. return t[0] = i[0] * n,
  39965. t[1] = i[1] * n,
  39966. t[2] = i[2] * n,
  39967. t[4] = i[4] * r,
  39968. t[5] = i[5] * r,
  39969. t[6] = i[6] * r,
  39970. t[8] = i[8] * o,
  39971. t[9] = i[9] * o,
  39972. t[10] = i[10] * o,
  39973. this
  39974. },
  39975. makeRotationFromEuler: function(e) {
  39976. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39977. var t = this.elements
  39978. , i = e.x
  39979. , n = e.y
  39980. , r = e.z
  39981. , o = Math.cos(i)
  39982. , a = Math.sin(i)
  39983. , s = Math.cos(n)
  39984. , l = Math.sin(n)
  39985. , c = Math.cos(r)
  39986. , h = Math.sin(r);
  39987. if ("XYZ" === e.order) {
  39988. var u = o * c
  39989. , d = o * h
  39990. , p = a * c
  39991. , f = a * h;
  39992. t[0] = s * c,
  39993. t[4] = -s * h,
  39994. t[8] = l,
  39995. t[1] = d + p * l,
  39996. t[5] = u - f * l,
  39997. t[9] = -a * s,
  39998. t[2] = f - u * l,
  39999. t[6] = p + d * l,
  40000. t[10] = o * s
  40001. } else if ("YXZ" === e.order) {
  40002. var g = s * c
  40003. , m = s * h
  40004. , v = l * c
  40005. , y = l * h;
  40006. t[0] = g + y * a,
  40007. t[4] = v * a - m,
  40008. t[8] = o * l,
  40009. t[1] = o * h,
  40010. t[5] = o * c,
  40011. t[9] = -a,
  40012. t[2] = m * a - v,
  40013. t[6] = y + g * a,
  40014. t[10] = o * s
  40015. } else if ("ZXY" === e.order) {
  40016. g = s * c,
  40017. m = s * h,
  40018. v = l * c,
  40019. y = l * h;
  40020. t[0] = g - y * a,
  40021. t[4] = -o * h,
  40022. t[8] = v + m * a,
  40023. t[1] = m + v * a,
  40024. t[5] = o * c,
  40025. t[9] = y - g * a,
  40026. t[2] = -o * l,
  40027. t[6] = a,
  40028. t[10] = o * s
  40029. } else if ("ZYX" === e.order) {
  40030. u = o * c,
  40031. d = o * h,
  40032. p = a * c,
  40033. f = a * h;
  40034. t[0] = s * c,
  40035. t[4] = p * l - d,
  40036. t[8] = u * l + f,
  40037. t[1] = s * h,
  40038. t[5] = f * l + u,
  40039. t[9] = d * l - p,
  40040. t[2] = -l,
  40041. t[6] = a * s,
  40042. t[10] = o * s
  40043. } else if ("YZX" === e.order) {
  40044. var A = o * s
  40045. , C = o * l
  40046. , I = a * s
  40047. , E = a * l;
  40048. t[0] = s * c,
  40049. t[4] = E - A * h,
  40050. t[8] = I * h + C,
  40051. t[1] = h,
  40052. t[5] = o * c,
  40053. t[9] = -a * c,
  40054. t[2] = -l * c,
  40055. t[6] = C * h + I,
  40056. t[10] = A - E * h
  40057. } else if ("XZY" === e.order) {
  40058. A = o * s,
  40059. C = o * l,
  40060. I = a * s,
  40061. E = a * l;
  40062. t[0] = s * c,
  40063. t[4] = -h,
  40064. t[8] = l * c,
  40065. t[1] = A * h + E,
  40066. t[5] = o * c,
  40067. t[9] = C * h - I,
  40068. t[2] = I * h - C,
  40069. t[6] = a * c,
  40070. t[10] = E * h + A
  40071. }
  40072. return t[3] = 0,
  40073. t[7] = 0,
  40074. t[11] = 0,
  40075. t[12] = 0,
  40076. t[13] = 0,
  40077. t[14] = 0,
  40078. t[15] = 1,
  40079. this
  40080. },
  40081. makeRotationFromQuaternion: function(e) {
  40082. var t = this.elements
  40083. , i = e.x
  40084. , n = e.y
  40085. , r = e.z
  40086. , o = e.w
  40087. , a = i + i
  40088. , s = n + n
  40089. , l = r + r
  40090. , c = i * a
  40091. , h = i * s
  40092. , u = i * l
  40093. , d = n * s
  40094. , p = n * l
  40095. , f = r * l
  40096. , g = o * a
  40097. , m = o * s
  40098. , v = o * l;
  40099. return t[0] = 1 - (d + f),
  40100. t[4] = h - v,
  40101. t[8] = u + m,
  40102. t[1] = h + v,
  40103. t[5] = 1 - (c + f),
  40104. t[9] = p - g,
  40105. t[2] = u - m,
  40106. t[6] = p + g,
  40107. t[10] = 1 - (c + d),
  40108. t[3] = 0,
  40109. t[7] = 0,
  40110. t[11] = 0,
  40111. t[12] = 0,
  40112. t[13] = 0,
  40113. t[14] = 0,
  40114. t[15] = 1,
  40115. this
  40116. },
  40117. lookAt: function(e, t, i) {
  40118. void 0 === oe && (oe = new Ci.Vector3),
  40119. void 0 === ae && (ae = new Ci.Vector3),
  40120. void 0 === se && (se = new Ci.Vector3);
  40121. var n = this.elements;
  40122. return se.subVectors(e, t).normalize(),
  40123. 0 === se.lengthSq() && (se.z = 1),
  40124. oe.crossVectors(i, se).normalize(),
  40125. 0 === oe.lengthSq() && (se.x += 1e-4,
  40126. oe.crossVectors(i, se).normalize()),
  40127. ae.crossVectors(se, oe),
  40128. n[0] = oe.x,
  40129. n[4] = ae.x,
  40130. n[8] = se.x,
  40131. n[1] = oe.y,
  40132. n[5] = ae.y,
  40133. n[9] = se.y,
  40134. n[2] = oe.z,
  40135. n[6] = ae.z,
  40136. n[10] = se.z,
  40137. this
  40138. },
  40139. multiply: function(e, t) {
  40140. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  40141. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  40142. },
  40143. multiplyMatrices: function(e, t) {
  40144. var i = e.elements
  40145. , n = t.elements
  40146. , r = this.elements
  40147. , o = i[0]
  40148. , a = i[4]
  40149. , s = i[8]
  40150. , l = i[12]
  40151. , c = i[1]
  40152. , h = i[5]
  40153. , u = i[9]
  40154. , d = i[13]
  40155. , p = i[2]
  40156. , f = i[6]
  40157. , g = i[10]
  40158. , m = i[14]
  40159. , v = i[3]
  40160. , y = i[7]
  40161. , A = i[11]
  40162. , C = i[15]
  40163. , I = n[0]
  40164. , E = n[4]
  40165. , _ = n[8]
  40166. , b = n[12]
  40167. , w = n[1]
  40168. , T = n[5]
  40169. , x = n[9]
  40170. , S = n[13]
  40171. , M = n[2]
  40172. , R = n[6]
  40173. , P = n[10]
  40174. , O = n[14]
  40175. , L = n[3]
  40176. , D = n[7]
  40177. , N = n[11]
  40178. , F = n[15];
  40179. return r[0] = o * I + a * w + s * M + l * L,
  40180. r[4] = o * E + a * T + s * R + l * D,
  40181. r[8] = o * _ + a * x + s * P + l * N,
  40182. r[12] = o * b + a * S + s * O + l * F,
  40183. r[1] = c * I + h * w + u * M + d * L,
  40184. r[5] = c * E + h * T + u * R + d * D,
  40185. r[9] = c * _ + h * x + u * P + d * N,
  40186. r[13] = c * b + h * S + u * O + d * F,
  40187. r[2] = p * I + f * w + g * M + m * L,
  40188. r[6] = p * E + f * T + g * R + m * D,
  40189. r[10] = p * _ + f * x + g * P + m * N,
  40190. r[14] = p * b + f * S + g * O + m * F,
  40191. r[3] = v * I + y * w + A * M + C * L,
  40192. r[7] = v * E + y * T + A * R + C * D,
  40193. r[11] = v * _ + y * x + A * P + C * N,
  40194. r[15] = v * b + y * S + A * O + C * F,
  40195. this
  40196. },
  40197. multiplyToArray: function(e, t, i) {
  40198. var n = this.elements;
  40199. return this.multiplyMatrices(e, t),
  40200. i[0] = n[0],
  40201. i[1] = n[1],
  40202. i[2] = n[2],
  40203. i[3] = n[3],
  40204. i[4] = n[4],
  40205. i[5] = n[5],
  40206. i[6] = n[6],
  40207. i[7] = n[7],
  40208. i[8] = n[8],
  40209. i[9] = n[9],
  40210. i[10] = n[10],
  40211. i[11] = n[11],
  40212. i[12] = n[12],
  40213. i[13] = n[13],
  40214. i[14] = n[14],
  40215. i[15] = n[15],
  40216. this
  40217. },
  40218. multiplyScalar: function(e) {
  40219. var t = this.elements;
  40220. return t[0] *= e,
  40221. t[4] *= e,
  40222. t[8] *= e,
  40223. t[12] *= e,
  40224. t[1] *= e,
  40225. t[5] *= e,
  40226. t[9] *= e,
  40227. t[13] *= e,
  40228. t[2] *= e,
  40229. t[6] *= e,
  40230. t[10] *= e,
  40231. t[14] *= e,
  40232. t[3] *= e,
  40233. t[7] *= e,
  40234. t[11] *= e,
  40235. t[15] *= e,
  40236. this
  40237. },
  40238. applyToVector3Array: function(e, t, i) {
  40239. void 0 === re && (re = new Ci.Vector3),
  40240. void 0 === t && (t = 0),
  40241. void 0 === i && (i = e.length);
  40242. for (var n = 0, r = t; n < i; n += 3,
  40243. r += 3)
  40244. re.fromArray(e, r),
  40245. re.applyMatrix4(this),
  40246. re.toArray(e, r);
  40247. return e
  40248. },
  40249. applyToBuffer: function(e, t, i) {
  40250. void 0 === ne && (ne = new Ci.Vector3),
  40251. void 0 === t && (t = 0),
  40252. void 0 === i && (i = e.length / e.itemSize);
  40253. for (var n = 0, r = t; n < i; n++,
  40254. r++)
  40255. ne.x = e.getX(r),
  40256. ne.y = e.getY(r),
  40257. ne.z = e.getZ(r),
  40258. ne.applyMatrix4(this),
  40259. e.setXYZ(ne.x, ne.y, ne.z);
  40260. return e
  40261. },
  40262. determinant: function() {
  40263. var e = this.elements
  40264. , t = e[0]
  40265. , i = e[4]
  40266. , n = e[8]
  40267. , r = e[12]
  40268. , o = e[1]
  40269. , a = e[5]
  40270. , s = e[9]
  40271. , l = e[13]
  40272. , c = e[2]
  40273. , h = e[6]
  40274. , u = e[10]
  40275. , d = e[14];
  40276. 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)
  40277. },
  40278. transpose: function() {
  40279. var e, t = this.elements;
  40280. return e = t[1],
  40281. t[1] = t[4],
  40282. t[4] = e,
  40283. e = t[2],
  40284. t[2] = t[8],
  40285. t[8] = e,
  40286. e = t[6],
  40287. t[6] = t[9],
  40288. t[9] = e,
  40289. e = t[3],
  40290. t[3] = t[12],
  40291. t[12] = e,
  40292. e = t[7],
  40293. t[7] = t[13],
  40294. t[13] = e,
  40295. e = t[11],
  40296. t[11] = t[14],
  40297. t[14] = e,
  40298. this
  40299. },
  40300. flattenToArrayOffset: function(e, t) {
  40301. var i = this.elements;
  40302. return e[t] = i[0],
  40303. e[t + 1] = i[1],
  40304. e[t + 2] = i[2],
  40305. e[t + 3] = i[3],
  40306. e[t + 4] = i[4],
  40307. e[t + 5] = i[5],
  40308. e[t + 6] = i[6],
  40309. e[t + 7] = i[7],
  40310. e[t + 8] = i[8],
  40311. e[t + 9] = i[9],
  40312. e[t + 10] = i[10],
  40313. e[t + 11] = i[11],
  40314. e[t + 12] = i[12],
  40315. e[t + 13] = i[13],
  40316. e[t + 14] = i[14],
  40317. e[t + 15] = i[15],
  40318. e
  40319. },
  40320. getPosition: function() {
  40321. return void 0 === ie && (ie = new Ci.Vector3),
  40322. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40323. ie.setFromMatrixColumn(this, 3)
  40324. },
  40325. setPosition: function(e) {
  40326. var t = this.elements;
  40327. return t[12] = e.x,
  40328. t[13] = e.y,
  40329. t[14] = e.z,
  40330. this
  40331. },
  40332. getInverse: function(e, t) {
  40333. var i = this.elements
  40334. , n = e.elements
  40335. , r = n[0]
  40336. , o = n[1]
  40337. , a = n[2]
  40338. , s = n[3]
  40339. , l = n[4]
  40340. , c = n[5]
  40341. , h = n[6]
  40342. , u = n[7]
  40343. , d = n[8]
  40344. , p = n[9]
  40345. , f = n[10]
  40346. , g = n[11]
  40347. , m = n[12]
  40348. , v = n[13]
  40349. , y = n[14]
  40350. , A = n[15]
  40351. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  40352. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  40353. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  40354. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  40355. , b = r * C + o * I + a * E + s * _;
  40356. if (0 != b)
  40357. return i[0] = C,
  40358. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  40359. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  40360. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40361. i[4] = I,
  40362. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  40363. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  40364. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40365. i[8] = E,
  40366. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  40367. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  40368. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40369. i[12] = _,
  40370. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  40371. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  40372. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40373. this.multiplyScalar(1 / b);
  40374. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40375. if (t)
  40376. throw new Error(w);
  40377. return console.warn(w),
  40378. this.identity()
  40379. },
  40380. scale: function(e) {
  40381. var t = this.elements
  40382. , i = e.x
  40383. , n = e.y
  40384. , r = e.z;
  40385. return t[0] *= i,
  40386. t[4] *= n,
  40387. t[8] *= r,
  40388. t[1] *= i,
  40389. t[5] *= n,
  40390. t[9] *= r,
  40391. t[2] *= i,
  40392. t[6] *= n,
  40393. t[10] *= r,
  40394. t[3] *= i,
  40395. t[7] *= n,
  40396. t[11] *= r,
  40397. this
  40398. },
  40399. getMaxScaleOnAxis: function() {
  40400. var e = this.elements
  40401. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40402. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40403. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40404. return Math.sqrt(Math.max(t, i, n))
  40405. },
  40406. makeTranslation: function(e, t, i) {
  40407. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40408. this
  40409. },
  40410. makeRotationX: function(e) {
  40411. var t = Math.cos(e)
  40412. , i = Math.sin(e);
  40413. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40414. this
  40415. },
  40416. makeRotationY: function(e) {
  40417. var t = Math.cos(e)
  40418. , i = Math.sin(e);
  40419. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40420. this
  40421. },
  40422. makeRotationZ: function(e) {
  40423. var t = Math.cos(e)
  40424. , i = Math.sin(e);
  40425. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40426. this
  40427. },
  40428. makeRotationAxis: function(e, t) {
  40429. var i = Math.cos(t)
  40430. , n = Math.sin(t)
  40431. , r = 1 - i
  40432. , o = e.x
  40433. , a = e.y
  40434. , s = e.z
  40435. , l = r * o
  40436. , c = r * a;
  40437. 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),
  40438. this
  40439. },
  40440. makeScale: function(e, t, i) {
  40441. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40442. this
  40443. },
  40444. compose: function(e, t, i) {
  40445. return this.makeRotationFromQuaternion(t),
  40446. this.scale(i),
  40447. this.setPosition(e),
  40448. this
  40449. },
  40450. decompose: function(e, t, i) {
  40451. void 0 === ee && (ee = new Ci.Vector3),
  40452. void 0 === te && (te = new Ci.Matrix4);
  40453. var n = this.elements
  40454. , r = ee.set(n[0], n[1], n[2]).length()
  40455. , o = ee.set(n[4], n[5], n[6]).length()
  40456. , a = ee.set(n[8], n[9], n[10]).length();
  40457. this.determinant() < 0 && (r = -r),
  40458. e.x = n[12],
  40459. e.y = n[13],
  40460. e.z = n[14],
  40461. te.elements.set(this.elements);
  40462. var s = 1 / r
  40463. , l = 1 / o
  40464. , c = 1 / a;
  40465. return te.elements[0] *= s,
  40466. te.elements[1] *= s,
  40467. te.elements[2] *= s,
  40468. te.elements[4] *= l,
  40469. te.elements[5] *= l,
  40470. te.elements[6] *= l,
  40471. te.elements[8] *= c,
  40472. te.elements[9] *= c,
  40473. te.elements[10] *= c,
  40474. t.setFromRotationMatrix(te),
  40475. i.x = r,
  40476. i.y = o,
  40477. i.z = a,
  40478. this
  40479. },
  40480. makeFrustum: function(e, t, i, n, r, o) {
  40481. var a = this.elements
  40482. , s = 2 * r / (t - e)
  40483. , l = 2 * r / (n - i)
  40484. , c = (t + e) / (t - e)
  40485. , h = (n + i) / (n - i)
  40486. , u = -(o + r) / (o - r)
  40487. , d = -2 * o * r / (o - r);
  40488. return a[0] = s,
  40489. a[4] = 0,
  40490. a[8] = c,
  40491. a[12] = 0,
  40492. a[1] = 0,
  40493. a[5] = l,
  40494. a[9] = h,
  40495. a[13] = 0,
  40496. a[2] = 0,
  40497. a[6] = 0,
  40498. a[10] = u,
  40499. a[14] = d,
  40500. a[3] = 0,
  40501. a[7] = 0,
  40502. a[11] = -1,
  40503. a[15] = 0,
  40504. this
  40505. },
  40506. makePerspective: function(e, t, i, n) {
  40507. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40508. , o = -r
  40509. , a = o * t
  40510. , s = r * t;
  40511. return this.makeFrustum(a, s, o, r, i, n)
  40512. },
  40513. makeOrthographic: function(e, t, i, n, r, o) {
  40514. var a = this.elements
  40515. , s = 1 / (t - e)
  40516. , l = 1 / (i - n)
  40517. , c = 1 / (o - r)
  40518. , h = (t + e) * s
  40519. , u = (i + n) * l
  40520. , d = (o + r) * c;
  40521. return a[0] = 2 * s,
  40522. a[4] = 0,
  40523. a[8] = 0,
  40524. a[12] = -h,
  40525. a[1] = 0,
  40526. a[5] = 2 * l,
  40527. a[9] = 0,
  40528. a[13] = -u,
  40529. a[2] = 0,
  40530. a[6] = 0,
  40531. a[10] = -2 * c,
  40532. a[14] = -d,
  40533. a[3] = 0,
  40534. a[7] = 0,
  40535. a[11] = 0,
  40536. a[15] = 1,
  40537. this
  40538. },
  40539. equals: function(e) {
  40540. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40541. if (t[n] !== i[n])
  40542. return !1;
  40543. return !0
  40544. },
  40545. fromArray: function(e) {
  40546. return this.elements.set(e),
  40547. this
  40548. },
  40549. toArray: function() {
  40550. var e = this.elements;
  40551. 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]]
  40552. }
  40553. },
  40554. Ci.Ray = function(e, t) {
  40555. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40556. this.direction = void 0 !== t ? t : new Ci.Vector3
  40557. }
  40558. ,
  40559. Ci.Ray.prototype = {
  40560. constructor: Ci.Ray,
  40561. set: function(e, t) {
  40562. return this.origin.copy(e),
  40563. this.direction.copy(t),
  40564. this
  40565. },
  40566. clone: function() {
  40567. return (new this.constructor).copy(this)
  40568. },
  40569. copy: function(e) {
  40570. return this.origin.copy(e.origin),
  40571. this.direction.copy(e.direction),
  40572. this
  40573. },
  40574. at: function(e, t) {
  40575. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40576. },
  40577. lookAt: function(e) {
  40578. this.direction.copy(e).sub(this.origin).normalize()
  40579. },
  40580. recast: ($ = new Ci.Vector3,
  40581. function(e) {
  40582. return this.origin.copy(this.at(e, $)),
  40583. this
  40584. }
  40585. ),
  40586. closestPointToPoint: function(e, t) {
  40587. var i = t || new Ci.Vector3;
  40588. i.subVectors(e, this.origin);
  40589. var n = i.dot(this.direction);
  40590. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40591. },
  40592. distanceToPoint: function(e) {
  40593. return Math.sqrt(this.distanceSqToPoint(e))
  40594. },
  40595. distanceSqToPoint: (J = new Ci.Vector3,
  40596. function(e) {
  40597. var t = J.subVectors(e, this.origin).dot(this.direction);
  40598. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40599. J.distanceToSquared(e))
  40600. }
  40601. ),
  40602. distanceSqToSegment: (Z = new Ci.Vector3,
  40603. K = new Ci.Vector3,
  40604. Q = new Ci.Vector3,
  40605. function(e, t, i, n) {
  40606. Z.copy(e).add(t).multiplyScalar(.5),
  40607. K.copy(t).sub(e).normalize(),
  40608. Q.copy(this.origin).sub(Z);
  40609. 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);
  40610. if (0 < p)
  40611. if (o = c * h - u,
  40612. s = l * p,
  40613. 0 <= (r = c * u - h))
  40614. if (-s <= o)
  40615. if (o <= s) {
  40616. var f = 1 / p;
  40617. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40618. } else
  40619. o = l,
  40620. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40621. else
  40622. o = -l,
  40623. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40624. else
  40625. 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,
  40626. (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;
  40627. else
  40628. o = 0 < c ? -l : l,
  40629. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40630. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40631. n && n.copy(K).multiplyScalar(o).add(Z),
  40632. a
  40633. }
  40634. ),
  40635. intersectSphere: (X = new Ci.Vector3,
  40636. function(e, t) {
  40637. X.subVectors(e.center, this.origin);
  40638. var i = X.dot(this.direction)
  40639. , n = X.dot(X) - i * i
  40640. , r = e.radius * e.radius;
  40641. if (r < n)
  40642. return null;
  40643. var o = Math.sqrt(r - n)
  40644. , a = i - o
  40645. , s = i + o;
  40646. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40647. }
  40648. ),
  40649. intersectsSphere: function(e) {
  40650. return this.distanceToPoint(e.center) <= e.radius
  40651. },
  40652. distanceToPlane: function(e) {
  40653. var t = e.normal.dot(this.direction);
  40654. if (0 === t)
  40655. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40656. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40657. return 0 <= i ? i : null
  40658. },
  40659. intersectPlane: function(e, t) {
  40660. var i = this.distanceToPlane(e);
  40661. return null === i ? null : this.at(i, t)
  40662. },
  40663. intersectsPlane: function(e) {
  40664. var t = e.distanceToPoint(this.origin);
  40665. return 0 === t || e.normal.dot(this.direction) * t < 0
  40666. },
  40667. intersectBox: function(e, t) {
  40668. 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;
  40669. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40670. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40671. (e.min.x - u.x) * l),
  40672. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40673. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40674. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40675. (o < n || n != n) && (n = o),
  40676. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40677. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40678. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40679. (s < n || n != n) && (n = s),
  40680. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40681. },
  40682. intersectsBox: (q = new Ci.Vector3,
  40683. function(e) {
  40684. return null !== this.intersectBox(e, q)
  40685. }
  40686. ),
  40687. intersectTriangle: (G = new Ci.Vector3,
  40688. W = new Ci.Vector3,
  40689. j = new Ci.Vector3,
  40690. Y = new Ci.Vector3,
  40691. function(e, t, i, n, r) {
  40692. W.subVectors(t, e),
  40693. j.subVectors(i, e),
  40694. Y.crossVectors(W, j);
  40695. var o, a = this.direction.dot(Y);
  40696. if (0 < a) {
  40697. if (n)
  40698. return null;
  40699. o = 1
  40700. } else {
  40701. if (!(a < 0))
  40702. return null;
  40703. o = -1,
  40704. a = -a
  40705. }
  40706. G.subVectors(this.origin, e);
  40707. var s = o * this.direction.dot(j.crossVectors(G, j));
  40708. if (s < 0)
  40709. return null;
  40710. var l = o * this.direction.dot(W.cross(G));
  40711. if (l < 0)
  40712. return null;
  40713. if (a < s + l)
  40714. return null;
  40715. var c = -o * G.dot(Y);
  40716. return c < 0 ? null : this.at(c / a, r)
  40717. }
  40718. ),
  40719. applyMatrix4: function(e) {
  40720. return this.direction.add(this.origin).applyMatrix4(e),
  40721. this.origin.applyMatrix4(e),
  40722. this.direction.sub(this.origin),
  40723. this.direction.normalize(),
  40724. this
  40725. },
  40726. equals: function(e) {
  40727. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40728. }
  40729. },
  40730. Ci.Sphere = function(e, t) {
  40731. this.center = void 0 !== e ? e : new Ci.Vector3,
  40732. this.radius = void 0 !== t ? t : 0
  40733. }
  40734. ,
  40735. Ci.Sphere.prototype = {
  40736. constructor: Ci.Sphere,
  40737. set: function(e, t) {
  40738. return this.center.copy(e),
  40739. this.radius = t,
  40740. this
  40741. },
  40742. setFromPoints: (z = new Ci.Box3,
  40743. function(e, t) {
  40744. var i = this.center;
  40745. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40746. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40747. n = Math.max(n, i.distanceToSquared(e[r]));
  40748. return this.radius = Math.sqrt(n),
  40749. this
  40750. }
  40751. ),
  40752. clone: function() {
  40753. return (new this.constructor).copy(this)
  40754. },
  40755. copy: function(e) {
  40756. return this.center.copy(e.center),
  40757. this.radius = e.radius,
  40758. this
  40759. },
  40760. empty: function() {
  40761. return this.radius <= 0
  40762. },
  40763. containsPoint: function(e) {
  40764. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40765. },
  40766. distanceToPoint: function(e) {
  40767. return e.distanceTo(this.center) - this.radius
  40768. },
  40769. intersectsSphere: function(e) {
  40770. var t = this.radius + e.radius;
  40771. return e.center.distanceToSquared(this.center) <= t * t
  40772. },
  40773. intersectsBox: function(e) {
  40774. return e.intersectsSphere(this)
  40775. },
  40776. intersectsPlane: function(e) {
  40777. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40778. },
  40779. clampPoint: function(e, t) {
  40780. var i = this.center.distanceToSquared(e)
  40781. , n = t || new Ci.Vector3;
  40782. return n.copy(e),
  40783. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40784. n.multiplyScalar(this.radius).add(this.center)),
  40785. n
  40786. },
  40787. getBoundingBox: function(e) {
  40788. var t = e || new Ci.Box3;
  40789. return t.set(this.center, this.center),
  40790. t.expandByScalar(this.radius),
  40791. t
  40792. },
  40793. applyMatrix4: function(e) {
  40794. return this.center.applyMatrix4(e),
  40795. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40796. this
  40797. },
  40798. translate: function(e) {
  40799. return this.center.add(e),
  40800. this
  40801. },
  40802. equals: function(e) {
  40803. return e.center.equals(this.center) && e.radius === this.radius
  40804. }
  40805. },
  40806. Ci.Frustum = function(e, t, i, n, r, o) {
  40807. 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]
  40808. }
  40809. ,
  40810. Ci.Frustum.prototype = {
  40811. constructor: Ci.Frustum,
  40812. set: function(e, t, i, n, r, o) {
  40813. var a = this.planes;
  40814. return a[0].copy(e),
  40815. a[1].copy(t),
  40816. a[2].copy(i),
  40817. a[3].copy(n),
  40818. a[4].copy(r),
  40819. a[5].copy(o),
  40820. this
  40821. },
  40822. clone: function() {
  40823. return (new this.constructor).copy(this)
  40824. },
  40825. copy: function(e) {
  40826. for (var t = this.planes, i = 0; i < 6; i++)
  40827. t[i].copy(e.planes[i]);
  40828. return this
  40829. },
  40830. setFromMatrix: function(e) {
  40831. var t = this.planes
  40832. , i = e.elements
  40833. , n = i[0]
  40834. , r = i[1]
  40835. , o = i[2]
  40836. , a = i[3]
  40837. , s = i[4]
  40838. , l = i[5]
  40839. , c = i[6]
  40840. , h = i[7]
  40841. , u = i[8]
  40842. , d = i[9]
  40843. , p = i[10]
  40844. , f = i[11]
  40845. , g = i[12]
  40846. , m = i[13]
  40847. , v = i[14]
  40848. , y = i[15];
  40849. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40850. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40851. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40852. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40853. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40854. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40855. this
  40856. },
  40857. intersectsObject: (H = new Ci.Sphere,
  40858. function(e) {
  40859. var t = e.geometry;
  40860. return null === t.boundingSphere && t.computeBoundingSphere(),
  40861. H.copy(t.boundingSphere),
  40862. H.applyMatrix4(e.matrixWorld),
  40863. this.intersectsSphere(H)
  40864. }
  40865. ),
  40866. intersectsSphere: function(e) {
  40867. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40868. if (t[r].distanceToPoint(i) < n)
  40869. return !1
  40870. }
  40871. return !0
  40872. },
  40873. intersectsBox: (k = new Ci.Vector3,
  40874. U = new Ci.Vector3,
  40875. function(e) {
  40876. for (var t = this.planes, i = 0; i < 6; i++) {
  40877. var n = t[i];
  40878. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40879. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40880. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40881. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40882. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40883. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40884. var r = n.distanceToPoint(k)
  40885. , o = n.distanceToPoint(U);
  40886. if (r < 0 && o < 0)
  40887. return !1
  40888. }
  40889. return !0
  40890. }
  40891. ),
  40892. containsPoint: function(e) {
  40893. for (var t = this.planes, i = 0; i < 6; i++)
  40894. if (t[i].distanceToPoint(e) < 0)
  40895. return !1;
  40896. return !0
  40897. }
  40898. },
  40899. Ci.Plane = function(e, t) {
  40900. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40901. this.constant = void 0 !== t ? t : 0
  40902. }
  40903. ,
  40904. Ci.Plane.prototype = {
  40905. constructor: Ci.Plane,
  40906. set: function(e, t) {
  40907. return this.normal.copy(e),
  40908. this.constant = t,
  40909. this
  40910. },
  40911. setComponents: function(e, t, i, n) {
  40912. return this.normal.set(e, t, i),
  40913. this.constant = n,
  40914. this
  40915. },
  40916. setFromNormalAndCoplanarPoint: function(e, t) {
  40917. return this.normal.copy(e),
  40918. this.constant = -t.dot(this.normal),
  40919. this
  40920. },
  40921. setFromCoplanarPoints: (B = new Ci.Vector3,
  40922. V = new Ci.Vector3,
  40923. function(e, t, i) {
  40924. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40925. return this.setFromNormalAndCoplanarPoint(n, e),
  40926. this
  40927. }
  40928. ),
  40929. clone: function() {
  40930. return (new this.constructor).copy(this)
  40931. },
  40932. copy: function(e) {
  40933. return this.normal.copy(e.normal),
  40934. this.constant = e.constant,
  40935. this
  40936. },
  40937. normalize: function() {
  40938. var e = 1 / this.normal.length();
  40939. return this.normal.multiplyScalar(e),
  40940. this.constant *= e,
  40941. this
  40942. },
  40943. negate: function() {
  40944. return this.constant *= -1,
  40945. this.normal.negate(),
  40946. this
  40947. },
  40948. distanceToPoint: function(e) {
  40949. return this.normal.dot(e) + this.constant
  40950. },
  40951. distanceToSphere: function(e) {
  40952. return this.distanceToPoint(e.center) - e.radius
  40953. },
  40954. projectPoint: function(e, t) {
  40955. return this.orthoPoint(e, t).sub(e).negate()
  40956. },
  40957. orthoPoint: function(e, t) {
  40958. var i = this.distanceToPoint(e);
  40959. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40960. },
  40961. intersectLine: (F = new Ci.Vector3,
  40962. function(e, t) {
  40963. var i = t || new Ci.Vector3
  40964. , n = e.delta(F)
  40965. , r = this.normal.dot(n);
  40966. if (0 !== r) {
  40967. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40968. if (!(o < 0 || 1 < o))
  40969. return i.copy(n).multiplyScalar(o).add(e.start)
  40970. } else if (0 === this.distanceToPoint(e.start))
  40971. return i.copy(e.start)
  40972. }
  40973. ),
  40974. intersectsLine: function(e) {
  40975. var t = this.distanceToPoint(e.start)
  40976. , i = this.distanceToPoint(e.end);
  40977. return t < 0 && 0 < i || i < 0 && 0 < t
  40978. },
  40979. intersectsBox: function(e) {
  40980. return e.intersectsPlane(this)
  40981. },
  40982. intersectsSphere: function(e) {
  40983. return e.intersectsPlane(this)
  40984. },
  40985. coplanarPoint: function(e) {
  40986. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40987. },
  40988. applyMatrix4: (L = new Ci.Vector3,
  40989. D = new Ci.Vector3,
  40990. N = new Ci.Matrix3,
  40991. function(e, t) {
  40992. var i = t || N.getNormalMatrix(e)
  40993. , n = L.copy(this.normal).applyMatrix3(i)
  40994. , r = this.coplanarPoint(D);
  40995. return r.applyMatrix4(e),
  40996. this.setFromNormalAndCoplanarPoint(n, r),
  40997. this
  40998. }
  40999. ),
  41000. translate: function(e) {
  41001. return this.constant = this.constant - e.dot(this.normal),
  41002. this
  41003. },
  41004. equals: function(e) {
  41005. return e.normal.equals(this.normal) && e.constant === this.constant
  41006. }
  41007. },
  41008. Ci.Spherical = function(e, t, i) {
  41009. return this.radius = void 0 !== e ? e : 1,
  41010. this.phi = void 0 !== t ? t : 0,
  41011. this.theta = void 0 !== i ? i : 0,
  41012. this
  41013. }
  41014. ,
  41015. Ci.Spherical.prototype = {
  41016. constructor: Ci.Spherical,
  41017. set: function(e, t, i) {
  41018. this.radius = e,
  41019. this.phi = t,
  41020. this.theta = i
  41021. },
  41022. clone: function() {
  41023. return (new this.constructor).copy(this)
  41024. },
  41025. copy: function(e) {
  41026. return this.radius.copy(e.radius),
  41027. this.phi.copy(e.phi),
  41028. this.theta.copy(e.theta),
  41029. this
  41030. },
  41031. makeSafe: function() {
  41032. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  41033. },
  41034. setFromVector3: function(e) {
  41035. return this.radius = e.length(),
  41036. 0 === this.radius ? (this.theta = 0,
  41037. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  41038. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  41039. this
  41040. }
  41041. },
  41042. Ci.Math = {
  41043. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  41044. P = new Array(36),
  41045. O = 0,
  41046. function() {
  41047. for (var e = 0; e < 36; e++)
  41048. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  41049. M = 15 & O,
  41050. O >>= 4,
  41051. P[e] = R[19 === e ? 3 & M | 8 : M]);
  41052. return P.join("")
  41053. }
  41054. ),
  41055. clamp: function(e, t, i) {
  41056. return Math.max(t, Math.min(i, e))
  41057. },
  41058. euclideanModulo: function(e, t) {
  41059. return (e % t + t) % t
  41060. },
  41061. mapLinear: function(e, t, i, n, r) {
  41062. return n + (e - t) * (r - n) / (i - t)
  41063. },
  41064. smoothstep: function(e, t, i) {
  41065. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  41066. },
  41067. smootherstep: function(e, t, i) {
  41068. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  41069. },
  41070. random16: function() {
  41071. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  41072. Math.random()
  41073. },
  41074. randInt: function(e, t) {
  41075. return e + Math.floor(Math.random() * (t - e + 1))
  41076. },
  41077. randFloat: function(e, t) {
  41078. return e + Math.random() * (t - e)
  41079. },
  41080. randFloatSpread: function(e) {
  41081. return e * (.5 - Math.random())
  41082. },
  41083. degToRad: (S = Math.PI / 180,
  41084. function(e) {
  41085. return e * S
  41086. }
  41087. ),
  41088. radToDeg: (x = 180 / Math.PI,
  41089. function(e) {
  41090. return e * x
  41091. }
  41092. ),
  41093. isPowerOfTwo: function(e) {
  41094. return 0 == (e & e - 1) && 0 !== e
  41095. },
  41096. nearestPowerOfTwo: function(e) {
  41097. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  41098. },
  41099. nextPowerOfTwo: function(e) {
  41100. return e--,
  41101. e |= e >> 1,
  41102. e |= e >> 2,
  41103. e |= e >> 4,
  41104. e |= e >> 8,
  41105. e |= e >> 16,
  41106. ++e
  41107. }
  41108. },
  41109. Ci.Spline = function(e) {
  41110. function t(e, t, i, n, r, o, a) {
  41111. var s = .5 * (i - e)
  41112. , l = .5 * (n - t);
  41113. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  41114. }
  41115. this.points = e;
  41116. var i, n, r, o, a, s, l, c, h, u = [], d = {
  41117. x: 0,
  41118. y: 0,
  41119. z: 0
  41120. };
  41121. this.initFromArray = function(e) {
  41122. this.points = [];
  41123. for (var t = 0; t < e.length; t++)
  41124. this.points[t] = {
  41125. x: e[t][0],
  41126. y: e[t][1],
  41127. z: e[t][2]
  41128. }
  41129. }
  41130. ,
  41131. this.getPoint = function(e) {
  41132. return i = (this.points.length - 1) * e,
  41133. n = Math.floor(i),
  41134. r = i - n,
  41135. u[0] = 0 === n ? n : n - 1,
  41136. u[1] = n,
  41137. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  41138. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  41139. s = this.points[u[0]],
  41140. l = this.points[u[1]],
  41141. c = this.points[u[2]],
  41142. h = this.points[u[3]],
  41143. a = r * (o = r * r),
  41144. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  41145. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  41146. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  41147. d
  41148. }
  41149. ,
  41150. this.getControlPointsArray = function() {
  41151. var e, t, i = this.points.length, n = [];
  41152. for (e = 0; e < i; e++)
  41153. t = this.points[e],
  41154. n[e] = [t.x, t.y, t.z];
  41155. return n
  41156. }
  41157. ,
  41158. this.getLength = function(e) {
  41159. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  41160. for (h[0] = 0,
  41161. e = e || 100,
  41162. n = this.points.length * e,
  41163. l.copy(this.points[0]),
  41164. t = 1; t < n; t++)
  41165. i = t / n,
  41166. r = this.getPoint(i),
  41167. c.copy(r),
  41168. u += c.distanceTo(l),
  41169. l.copy(r),
  41170. o = (this.points.length - 1) * i,
  41171. (a = Math.floor(o)) !== s && (h[a] = u,
  41172. s = a);
  41173. return h[h.length] = u,
  41174. {
  41175. chunks: h,
  41176. total: u
  41177. }
  41178. }
  41179. ,
  41180. this.reparametrizeByArcLength = function(e) {
  41181. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  41182. for (c.push(h.copy(this.points[0]).clone()),
  41183. t = 1; t < this.points.length; t++) {
  41184. for (a = u.chunks[t] - u.chunks[t - 1],
  41185. s = Math.ceil(e * a / u.total),
  41186. r = (t - 1) / (this.points.length - 1),
  41187. o = t / (this.points.length - 1),
  41188. i = 1; i < s - 1; i++)
  41189. n = r + i * (1 / s) * (o - r),
  41190. l = this.getPoint(n),
  41191. c.push(h.copy(l).clone());
  41192. c.push(h.copy(this.points[t]).clone())
  41193. }
  41194. this.points = c
  41195. }
  41196. }
  41197. ,
  41198. Ci.Triangle = function(e, t, i) {
  41199. this.a = void 0 !== e ? e : new Ci.Vector3,
  41200. this.b = void 0 !== t ? t : new Ci.Vector3,
  41201. this.c = void 0 !== i ? i : new Ci.Vector3
  41202. }
  41203. ,
  41204. Ci.Triangle.normal = (T = new Ci.Vector3,
  41205. function(e, t, i, n) {
  41206. var r = n || new Ci.Vector3;
  41207. r.subVectors(i, t),
  41208. T.subVectors(e, t),
  41209. r.cross(T);
  41210. var o = r.lengthSq();
  41211. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  41212. }
  41213. ),
  41214. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  41215. b = new Ci.Vector3,
  41216. w = new Ci.Vector3,
  41217. function(e, t, i, n, r) {
  41218. _.subVectors(n, t),
  41219. b.subVectors(i, t),
  41220. w.subVectors(e, t);
  41221. var o = _.dot(_)
  41222. , a = _.dot(b)
  41223. , s = _.dot(w)
  41224. , l = b.dot(b)
  41225. , c = b.dot(w)
  41226. , h = o * l - a * a
  41227. , u = r || new Ci.Vector3;
  41228. if (0 == h)
  41229. return u.set(-2, -1, -1);
  41230. var d = 1 / h
  41231. , p = (l * s - a * c) * d
  41232. , f = (o * c - a * s) * d;
  41233. return u.set(1 - p - f, f, p)
  41234. }
  41235. ),
  41236. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  41237. function(e, t, i, n) {
  41238. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  41239. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  41240. }
  41241. ),
  41242. Ci.Triangle.prototype = {
  41243. constructor: Ci.Triangle,
  41244. set: function(e, t, i) {
  41245. return this.a.copy(e),
  41246. this.b.copy(t),
  41247. this.c.copy(i),
  41248. this
  41249. },
  41250. setFromPointsAndIndices: function(e, t, i, n) {
  41251. return this.a.copy(e[t]),
  41252. this.b.copy(e[i]),
  41253. this.c.copy(e[n]),
  41254. this
  41255. },
  41256. clone: function() {
  41257. return (new this.constructor).copy(this)
  41258. },
  41259. copy: function(e) {
  41260. return this.a.copy(e.a),
  41261. this.b.copy(e.b),
  41262. this.c.copy(e.c),
  41263. this
  41264. },
  41265. area: (C = new Ci.Vector3,
  41266. I = new Ci.Vector3,
  41267. function() {
  41268. return C.subVectors(this.c, this.b),
  41269. I.subVectors(this.a, this.b),
  41270. .5 * C.cross(I).length()
  41271. }
  41272. ),
  41273. midpoint: function(e) {
  41274. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41275. },
  41276. normal: function(e) {
  41277. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  41278. },
  41279. plane: function(e) {
  41280. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  41281. },
  41282. barycoordFromPoint: function(e, t) {
  41283. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41284. },
  41285. containsPoint: function(e) {
  41286. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  41287. },
  41288. equals: function(e) {
  41289. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41290. }
  41291. },
  41292. Ci.Interpolant = function(e, t, i, n) {
  41293. this.parameterPositions = e,
  41294. this._cachedIndex = 0,
  41295. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41296. this.sampleValues = t,
  41297. this.valueSize = i
  41298. }
  41299. ,
  41300. Ci.Interpolant.prototype = {
  41301. constructor: Ci.Interpolant,
  41302. evaluate: function(e) {
  41303. var t = this.parameterPositions
  41304. , i = this._cachedIndex
  41305. , n = t[i]
  41306. , r = t[i - 1];
  41307. e: {
  41308. t: {
  41309. var o;
  41310. i: {
  41311. n: if (!(e < n)) {
  41312. for (var a = i + 2; ; ) {
  41313. if (void 0 === n) {
  41314. if (e < r)
  41315. break n;
  41316. return i = t.length,
  41317. this._cachedIndex = i,
  41318. this.afterEnd_(i - 1, e, r)
  41319. }
  41320. if (i === a)
  41321. break;
  41322. if (r = n,
  41323. e < (n = t[++i]))
  41324. break t
  41325. }
  41326. o = t.length;
  41327. break i
  41328. }
  41329. if (r <= e)
  41330. break e;
  41331. var s = t[1];
  41332. e < s && (i = 2,
  41333. r = s);
  41334. for (a = i - 2; ; ) {
  41335. if (void 0 === r)
  41336. return this._cachedIndex = 0,
  41337. this.beforeStart_(0, e, n);
  41338. if (i === a)
  41339. break;
  41340. if (n = r,
  41341. (r = t[--i - 1]) <= e)
  41342. break t
  41343. }
  41344. o = i,
  41345. i = 0
  41346. }
  41347. for (; i < o; ) {
  41348. var l = i + o >>> 1;
  41349. e < t[l] ? o = l : i = 1 + l
  41350. }
  41351. if (n = t[i],
  41352. void 0 === (r = t[i - 1]))
  41353. return this._cachedIndex = 0,
  41354. this.beforeStart_(0, e, n);
  41355. if (void 0 === n)
  41356. return i = t.length,
  41357. this._cachedIndex = i,
  41358. this.afterEnd_(i - 1, r, e)
  41359. }
  41360. this._cachedIndex = i,
  41361. this.intervalChanged_(i, r, n)
  41362. }
  41363. return this.interpolate_(i, r, e, n)
  41364. },
  41365. settings: null,
  41366. DefaultSettings_: {},
  41367. getSettings_: function() {
  41368. return this.settings || this.DefaultSettings_
  41369. },
  41370. copySampleValue_: function(e) {
  41371. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41372. t[o] = i[r + o];
  41373. return t
  41374. },
  41375. interpolate_: function(e, t, i, n) {
  41376. throw new Error("call to abstract method")
  41377. },
  41378. intervalChanged_: function(e, t, i) {}
  41379. },
  41380. Object.assign(Ci.Interpolant.prototype, {
  41381. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  41382. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  41383. }),
  41384. Ci.CubicInterpolant = function(e, t, i, n) {
  41385. Ci.Interpolant.call(this, e, t, i, n),
  41386. this._weightPrev = -0,
  41387. this._offsetPrev = -0,
  41388. this._weightNext = -0,
  41389. this._offsetNext = -0
  41390. }
  41391. ,
  41392. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41393. constructor: Ci.CubicInterpolant,
  41394. DefaultSettings_: {
  41395. endingStart: Ci.ZeroCurvatureEnding,
  41396. endingEnd: Ci.ZeroCurvatureEnding
  41397. },
  41398. intervalChanged_: function(e, t, i) {
  41399. var n = this.parameterPositions
  41400. , r = e - 2
  41401. , o = e + 1
  41402. , a = n[r]
  41403. , s = n[o];
  41404. if (void 0 === a)
  41405. switch (this.getSettings_().endingStart) {
  41406. case Ci.ZeroSlopeEnding:
  41407. r = e,
  41408. a = 2 * t - i;
  41409. break;
  41410. case Ci.WrapAroundEnding:
  41411. a = t + n[r = n.length - 2] - n[r + 1];
  41412. break;
  41413. default:
  41414. r = e,
  41415. a = i
  41416. }
  41417. if (void 0 === s)
  41418. switch (this.getSettings_().endingEnd) {
  41419. case Ci.ZeroSlopeEnding:
  41420. o = e,
  41421. s = 2 * i - t;
  41422. break;
  41423. case Ci.WrapAroundEnding:
  41424. s = i + n[o = 1] - n[0];
  41425. break;
  41426. default:
  41427. o = e - 1,
  41428. s = t
  41429. }
  41430. var l = .5 * (i - t)
  41431. , c = this.valueSize;
  41432. this._weightPrev = l / (t - a),
  41433. this._weightNext = l / (s - i),
  41434. this._offsetPrev = r * c,
  41435. this._offsetNext = o * c
  41436. },
  41437. interpolate_: function(e, t, i, n) {
  41438. 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)
  41439. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  41440. return r
  41441. }
  41442. }),
  41443. Ci.DiscreteInterpolant = function(e, t, i, n) {
  41444. Ci.Interpolant.call(this, e, t, i, n)
  41445. }
  41446. ,
  41447. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41448. constructor: Ci.DiscreteInterpolant,
  41449. interpolate_: function(e, t, i, n) {
  41450. return this.copySampleValue_(e - 1)
  41451. }
  41452. }),
  41453. Ci.LinearInterpolant = function(e, t, i, n) {
  41454. Ci.Interpolant.call(this, e, t, i, n)
  41455. }
  41456. ,
  41457. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41458. constructor: Ci.LinearInterpolant,
  41459. interpolate_: function(e, t, i, n) {
  41460. 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)
  41461. r[u] = o[l + u] * h + o[s + u] * c;
  41462. return r
  41463. }
  41464. }),
  41465. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  41466. Ci.Interpolant.call(this, e, t, i, n)
  41467. }
  41468. ,
  41469. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  41470. constructor: Ci.QuaternionLinearInterpolant,
  41471. interpolate_: function(e, t, i, n) {
  41472. 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)
  41473. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  41474. return r
  41475. }
  41476. }),
  41477. Ci.Clock = function(e) {
  41478. this.autoStart = void 0 === e || e,
  41479. this.startTime = 0,
  41480. this.oldTime = 0,
  41481. this.elapsedTime = 0,
  41482. this.running = !1
  41483. }
  41484. ,
  41485. Ci.Clock.prototype = {
  41486. constructor: Ci.Clock,
  41487. start: function() {
  41488. this.startTime = performance.now(),
  41489. this.oldTime = this.startTime,
  41490. this.running = !0
  41491. },
  41492. stop: function() {
  41493. this.getElapsedTime(),
  41494. this.running = !1
  41495. },
  41496. getElapsedTime: function() {
  41497. return this.getDelta(),
  41498. this.elapsedTime
  41499. },
  41500. getDelta: function() {
  41501. var e = 0;
  41502. if (this.autoStart && !this.running && this.start(),
  41503. this.running) {
  41504. var t = performance.now();
  41505. e = .001 * (t - this.oldTime),
  41506. this.oldTime = t,
  41507. this.elapsedTime += e
  41508. }
  41509. return e
  41510. }
  41511. },
  41512. Ci.EventDispatcher = function() {}
  41513. ,
  41514. Ci.EventDispatcher.prototype = {
  41515. constructor: Ci.EventDispatcher,
  41516. apply: function(e) {
  41517. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41518. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41519. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41520. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41521. },
  41522. addEventListener: function(e, t) {
  41523. void 0 === this._listeners && (this._listeners = {});
  41524. var i = this._listeners;
  41525. void 0 === i[e] && (i[e] = []),
  41526. -1 === i[e].indexOf(t) && i[e].push(t)
  41527. },
  41528. hasEventListener: function(e, t) {
  41529. if (void 0 === this._listeners)
  41530. return !1;
  41531. var i = this._listeners;
  41532. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41533. },
  41534. removeEventListener: function(e, t) {
  41535. if (void 0 !== this._listeners) {
  41536. var i = this._listeners[e];
  41537. if (void 0 !== i) {
  41538. var n = i.indexOf(t);
  41539. -1 !== n && i.splice(n, 1)
  41540. }
  41541. }
  41542. },
  41543. dispatchEvent: function(e) {
  41544. if (void 0 !== this._listeners) {
  41545. var t = this._listeners[e.type];
  41546. if (void 0 !== t) {
  41547. e.target = this;
  41548. for (var i = [], n = t.length, r = 0; r < n; r++)
  41549. i[r] = t[r];
  41550. for (r = 0; r < n; r++)
  41551. i[r].call(this, e)
  41552. }
  41553. }
  41554. }
  41555. },
  41556. Ci.Layers = function() {
  41557. this.mask = 1
  41558. }
  41559. ,
  41560. Ci.Layers.prototype = {
  41561. constructor: Ci.Layers,
  41562. set: function(e) {
  41563. this.mask = 1 << e
  41564. },
  41565. enable: function(e) {
  41566. this.mask |= 1 << e
  41567. },
  41568. toggle: function(e) {
  41569. this.mask ^= 1 << e
  41570. },
  41571. disable: function(e) {
  41572. this.mask &= ~(1 << e)
  41573. },
  41574. test: function(e) {
  41575. return 0 != (this.mask & e.mask)
  41576. }
  41577. },
  41578. (A = Ci).Raycaster = function(e, t, i, n) {
  41579. this.ray = new A.Ray(e,t),
  41580. this.near = i || 0,
  41581. this.far = n || 1 / 0,
  41582. this.params = {
  41583. Mesh: {},
  41584. Line: {},
  41585. LOD: {},
  41586. Points: {
  41587. threshold: 1
  41588. },
  41589. Sprite: {}
  41590. },
  41591. Object.defineProperties(this.params, {
  41592. PointCloud: {
  41593. get: function() {
  41594. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41595. this.Points
  41596. }
  41597. }
  41598. })
  41599. }
  41600. ,
  41601. A.Raycaster.prototype = {
  41602. constructor: A.Raycaster,
  41603. linePrecision: 1,
  41604. set: function(e, t) {
  41605. this.ray.set(e, t)
  41606. },
  41607. setFromCamera: function(e, t) {
  41608. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41609. 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),
  41610. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41611. },
  41612. intersectObject: function(e, t) {
  41613. var i = [];
  41614. return Ei(e, this, i, t),
  41615. i.sort(Ii),
  41616. i
  41617. },
  41618. intersectObjects: function(e, t) {
  41619. var i = [];
  41620. if (!1 === Array.isArray(e))
  41621. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41622. i;
  41623. for (var n = 0, r = e.length; n < r; n++)
  41624. Ei(e[n], this, i, t);
  41625. return i.sort(Ii),
  41626. i
  41627. }
  41628. },
  41629. Ci.Object3D = function() {
  41630. Object.defineProperty(this, "id", {
  41631. value: Ci.Object3DIdCount++
  41632. }),
  41633. this.uuid = Ci.Math.generateUUID(),
  41634. this.name = "",
  41635. this.type = "Object3D",
  41636. this.parent = null,
  41637. this.children = [],
  41638. this.up = Ci.Object3D.DefaultUp.clone();
  41639. var e = new Ci.Vector3
  41640. , t = new Ci.Euler
  41641. , i = new Ci.Quaternion
  41642. , n = new Ci.Vector3(1,1,1);
  41643. t.onChange(function() {
  41644. i.setFromEuler(t, !1)
  41645. }),
  41646. i.onChange(function() {
  41647. t.setFromQuaternion(i, void 0, !1)
  41648. }),
  41649. Object.defineProperties(this, {
  41650. position: {
  41651. enumerable: !0,
  41652. value: e
  41653. },
  41654. rotation: {
  41655. enumerable: !0,
  41656. value: t
  41657. },
  41658. quaternion: {
  41659. enumerable: !0,
  41660. value: i
  41661. },
  41662. scale: {
  41663. enumerable: !0,
  41664. value: n
  41665. },
  41666. modelViewMatrix: {
  41667. value: new Ci.Matrix4
  41668. },
  41669. normalMatrix: {
  41670. value: new Ci.Matrix3
  41671. }
  41672. }),
  41673. this.rotationAutoUpdate = !0,
  41674. this.matrix = new Ci.Matrix4,
  41675. this.matrixWorld = new Ci.Matrix4,
  41676. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41677. this.matrixWorldNeedsUpdate = !1,
  41678. this.layers = new Ci.Layers,
  41679. this.visible = !0,
  41680. this.castShadow = !1,
  41681. this.receiveShadow = !1,
  41682. this.frustumCulled = !0,
  41683. this.renderOrder = 0,
  41684. this.userData = {}
  41685. }
  41686. ,
  41687. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41688. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41689. Ci.Object3D.prototype = {
  41690. constructor: Ci.Object3D,
  41691. applyMatrix: function(e) {
  41692. this.matrix.multiplyMatrices(e, this.matrix),
  41693. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41694. },
  41695. setRotationFromAxisAngle: function(e, t) {
  41696. this.quaternion.setFromAxisAngle(e, t)
  41697. },
  41698. setRotationFromEuler: function(e) {
  41699. this.quaternion.setFromEuler(e, !0)
  41700. },
  41701. setRotationFromMatrix: function(e) {
  41702. this.quaternion.setFromRotationMatrix(e)
  41703. },
  41704. setRotationFromQuaternion: function(e) {
  41705. this.quaternion.copy(e)
  41706. },
  41707. rotateOnAxis: (y = new Ci.Quaternion,
  41708. function(e, t) {
  41709. return y.setFromAxisAngle(e, t),
  41710. this.quaternion.multiply(y),
  41711. this
  41712. }
  41713. ),
  41714. rotateX: (v = new Ci.Vector3(1,0,0),
  41715. function(e) {
  41716. return this.rotateOnAxis(v, e)
  41717. }
  41718. ),
  41719. rotateY: (m = new Ci.Vector3(0,1,0),
  41720. function(e) {
  41721. return this.rotateOnAxis(m, e)
  41722. }
  41723. ),
  41724. rotateZ: (g = new Ci.Vector3(0,0,1),
  41725. function(e) {
  41726. return this.rotateOnAxis(g, e)
  41727. }
  41728. ),
  41729. translateOnAxis: (f = new Ci.Vector3,
  41730. function(e, t) {
  41731. return f.copy(e).applyQuaternion(this.quaternion),
  41732. this.position.add(f.multiplyScalar(t)),
  41733. this
  41734. }
  41735. ),
  41736. translateX: (p = new Ci.Vector3(1,0,0),
  41737. function(e) {
  41738. return this.translateOnAxis(p, e)
  41739. }
  41740. ),
  41741. translateY: (d = new Ci.Vector3(0,1,0),
  41742. function(e) {
  41743. return this.translateOnAxis(d, e)
  41744. }
  41745. ),
  41746. translateZ: (u = new Ci.Vector3(0,0,1),
  41747. function(e) {
  41748. return this.translateOnAxis(u, e)
  41749. }
  41750. ),
  41751. localToWorld: function(e) {
  41752. return e.applyMatrix4(this.matrixWorld)
  41753. },
  41754. worldToLocal: (h = new Ci.Matrix4,
  41755. function(e) {
  41756. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41757. }
  41758. ),
  41759. lookAt: (c = new Ci.Matrix4,
  41760. function(e) {
  41761. c.lookAt(e, this.position, this.up),
  41762. this.quaternion.setFromRotationMatrix(c)
  41763. }
  41764. ),
  41765. add: function(e) {
  41766. if (1 < arguments.length) {
  41767. for (var t = 0; t < arguments.length; t++)
  41768. this.add(arguments[t]);
  41769. return this
  41770. }
  41771. 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),
  41772. e.parent = this,
  41773. e.dispatchEvent({
  41774. type: "added"
  41775. }),
  41776. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41777. this
  41778. },
  41779. remove: function(e) {
  41780. if (1 < arguments.length)
  41781. for (var t = 0; t < arguments.length; t++)
  41782. this.remove(arguments[t]);
  41783. var i = this.children.indexOf(e);
  41784. -1 !== i && (e.parent = null,
  41785. e.dispatchEvent({
  41786. type: "removed"
  41787. }),
  41788. this.children.splice(i, 1))
  41789. },
  41790. getObjectById: function(e) {
  41791. return this.getObjectByProperty("id", e)
  41792. },
  41793. getObjectByName: function(e) {
  41794. return this.getObjectByProperty("name", e)
  41795. },
  41796. getObjectByProperty: function(e, t) {
  41797. if (this[e] === t)
  41798. return this;
  41799. for (var i = 0, n = this.children.length; i < n; i++) {
  41800. var r = this.children[i].getObjectByProperty(e, t);
  41801. if (void 0 !== r)
  41802. return r
  41803. }
  41804. },
  41805. getWorldPosition: function(e) {
  41806. var t = e || new Ci.Vector3;
  41807. return this.updateMatrixWorld(!0),
  41808. t.setFromMatrixPosition(this.matrixWorld)
  41809. },
  41810. getWorldQuaternion: (s = new Ci.Vector3,
  41811. l = new Ci.Vector3,
  41812. function(e) {
  41813. var t = e || new Ci.Quaternion;
  41814. return this.updateMatrixWorld(!0),
  41815. this.matrixWorld.decompose(s, t, l),
  41816. t
  41817. }
  41818. ),
  41819. getWorldRotation: (a = new Ci.Quaternion,
  41820. function(e) {
  41821. var t = e || new Ci.Euler;
  41822. return this.getWorldQuaternion(a),
  41823. t.setFromQuaternion(a, this.rotation.order, !1)
  41824. }
  41825. ),
  41826. getWorldScale: (r = new Ci.Vector3,
  41827. o = new Ci.Quaternion,
  41828. function(e) {
  41829. var t = e || new Ci.Vector3;
  41830. return this.updateMatrixWorld(!0),
  41831. this.matrixWorld.decompose(r, o, t),
  41832. t
  41833. }
  41834. ),
  41835. getWorldDirection: (n = new Ci.Quaternion,
  41836. function(e) {
  41837. var t = e || new Ci.Vector3;
  41838. return this.getWorldQuaternion(n),
  41839. t.set(0, 0, 1).applyQuaternion(n)
  41840. }
  41841. ),
  41842. raycast: function() {},
  41843. traverse: function(e) {
  41844. e(this);
  41845. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41846. t[i].traverse(e)
  41847. },
  41848. traverseVisible: function(e) {
  41849. if (!1 !== this.visible) {
  41850. e(this);
  41851. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41852. t[i].traverseVisible(e)
  41853. }
  41854. },
  41855. traverseAncestors: function(e) {
  41856. var t = this.parent;
  41857. null !== t && (e(t),
  41858. t.traverseAncestors(e))
  41859. },
  41860. updateMatrix: function() {
  41861. this.matrix.compose(this.position, this.quaternion, this.scale),
  41862. this.matrixWorldNeedsUpdate = !0
  41863. },
  41864. updateMatrixWorld: function(e) {
  41865. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41866. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41867. e = !(this.matrixWorldNeedsUpdate = !1));
  41868. for (var t = 0, i = this.children.length; t < i; t++)
  41869. this.children[t].updateMatrixWorld(e)
  41870. },
  41871. toJSON: function(e) {
  41872. function t(e) {
  41873. var t = [];
  41874. for (var i in e) {
  41875. var n = e[i];
  41876. delete n.metadata,
  41877. t.push(n)
  41878. }
  41879. return t
  41880. }
  41881. var i = void 0 === e
  41882. , n = {};
  41883. i && (e = {
  41884. geometries: {},
  41885. materials: {},
  41886. textures: {},
  41887. images: {}
  41888. },
  41889. n.metadata = {
  41890. version: 4.4,
  41891. type: "Object",
  41892. generator: "Object3D.toJSON"
  41893. });
  41894. var r = {};
  41895. if (r.uuid = this.uuid,
  41896. r.type = this.type,
  41897. "" !== this.name && (r.name = this.name),
  41898. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41899. !0 === this.castShadow && (r.castShadow = !0),
  41900. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41901. !1 === this.visible && (r.visible = !1),
  41902. r.matrix = this.matrix.toArray(),
  41903. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41904. r.geometry = this.geometry.uuid),
  41905. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41906. r.material = this.material.uuid),
  41907. 0 < this.children.length) {
  41908. r.children = [];
  41909. for (var o = 0; o < this.children.length; o++)
  41910. r.children.push(this.children[o].toJSON(e).object)
  41911. }
  41912. if (i) {
  41913. var a = t(e.geometries)
  41914. , s = t(e.materials)
  41915. , l = t(e.textures)
  41916. , c = t(e.images);
  41917. 0 < a.length && (n.geometries = a),
  41918. 0 < s.length && (n.materials = s),
  41919. 0 < l.length && (n.textures = l),
  41920. 0 < c.length && (n.images = c)
  41921. }
  41922. return n.object = r,
  41923. n
  41924. },
  41925. clone: function(e) {
  41926. return (new this.constructor).copy(this, e)
  41927. },
  41928. copy: function(e, t) {
  41929. if (void 0 === t && (t = !0),
  41930. this.name = e.name,
  41931. this.up.copy(e.up),
  41932. this.position.copy(e.position),
  41933. this.quaternion.copy(e.quaternion),
  41934. this.scale.copy(e.scale),
  41935. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41936. this.matrix.copy(e.matrix),
  41937. this.matrixWorld.copy(e.matrixWorld),
  41938. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41939. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41940. this.visible = e.visible,
  41941. this.castShadow = e.castShadow,
  41942. this.receiveShadow = e.receiveShadow,
  41943. this.frustumCulled = e.frustumCulled,
  41944. this.renderOrder = e.renderOrder,
  41945. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41946. !0 === t)
  41947. for (var i = 0; i < e.children.length; i++) {
  41948. var n = e.children[i];
  41949. this.add(n.clone())
  41950. }
  41951. return this
  41952. }
  41953. },
  41954. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41955. Ci.Object3DIdCount = 0,
  41956. Ci.Face3 = function(e, t, i, n, r, o) {
  41957. this.a = e,
  41958. this.b = t,
  41959. this.c = i,
  41960. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41961. this.vertexNormals = Array.isArray(n) ? n : [],
  41962. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41963. this.vertexColors = Array.isArray(r) ? r : [],
  41964. this.materialIndex = void 0 !== o ? o : 0
  41965. }
  41966. ,
  41967. Ci.Face3.prototype = {
  41968. constructor: Ci.Face3,
  41969. clone: function() {
  41970. return (new this.constructor).copy(this)
  41971. },
  41972. copy: function(e) {
  41973. this.a = e.a,
  41974. this.b = e.b,
  41975. this.c = e.c,
  41976. this.normal.copy(e.normal),
  41977. this.color.copy(e.color),
  41978. this.materialIndex = e.materialIndex;
  41979. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41980. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41981. for (t = 0,
  41982. i = e.vertexColors.length; t < i; t++)
  41983. this.vertexColors[t] = e.vertexColors[t].clone();
  41984. return this
  41985. }
  41986. },
  41987. Ci.BufferAttribute = function(e, t) {
  41988. this.uuid = Ci.Math.generateUUID(),
  41989. this.array = e,
  41990. this.itemSize = t,
  41991. this.dynamic = !1,
  41992. this.updateRange = {
  41993. offset: 0,
  41994. count: -1
  41995. },
  41996. this.version = 0
  41997. }
  41998. ,
  41999. Ci.BufferAttribute.prototype = {
  42000. constructor: Ci.BufferAttribute,
  42001. get count() {
  42002. return this.array.length / this.itemSize
  42003. },
  42004. set needsUpdate(e) {
  42005. !0 === e && this.version++
  42006. },
  42007. setDynamic: function(e) {
  42008. return this.dynamic = e,
  42009. this
  42010. },
  42011. copy: function(e) {
  42012. return this.array = new e.array.constructor(e.array),
  42013. this.itemSize = e.itemSize,
  42014. this.dynamic = e.dynamic,
  42015. this
  42016. },
  42017. copyAt: function(e, t, i) {
  42018. e *= this.itemSize,
  42019. i *= t.itemSize;
  42020. for (var n = 0, r = this.itemSize; n < r; n++)
  42021. this.array[e + n] = t.array[i + n];
  42022. return this
  42023. },
  42024. copyArray: function(e) {
  42025. return this.array.set(e),
  42026. this
  42027. },
  42028. copyColorsArray: function(e) {
  42029. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42030. var o = e[n];
  42031. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  42032. o = new Ci.Color),
  42033. t[i++] = o.r,
  42034. t[i++] = o.g,
  42035. t[i++] = o.b
  42036. }
  42037. return this
  42038. },
  42039. copyIndicesArray: function(e) {
  42040. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42041. var o = e[n];
  42042. t[i++] = o.a,
  42043. t[i++] = o.b,
  42044. t[i++] = o.c
  42045. }
  42046. return this
  42047. },
  42048. copyVector2sArray: function(e) {
  42049. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42050. var o = e[n];
  42051. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  42052. o = new Ci.Vector2),
  42053. t[i++] = o.x,
  42054. t[i++] = o.y
  42055. }
  42056. return this
  42057. },
  42058. copyVector3sArray: function(e) {
  42059. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42060. var o = e[n];
  42061. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  42062. o = new Ci.Vector3),
  42063. t[i++] = o.x,
  42064. t[i++] = o.y,
  42065. t[i++] = o.z
  42066. }
  42067. return this
  42068. },
  42069. copyVector4sArray: function(e) {
  42070. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42071. var o = e[n];
  42072. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  42073. o = new Ci.Vector4),
  42074. t[i++] = o.x,
  42075. t[i++] = o.y,
  42076. t[i++] = o.z,
  42077. t[i++] = o.w
  42078. }
  42079. return this
  42080. },
  42081. set: function(e, t) {
  42082. return void 0 === t && (t = 0),
  42083. this.array.set(e, t),
  42084. this
  42085. },
  42086. getX: function(e) {
  42087. return this.array[e * this.itemSize]
  42088. },
  42089. setX: function(e, t) {
  42090. return this.array[e * this.itemSize] = t,
  42091. this
  42092. },
  42093. getY: function(e) {
  42094. return this.array[e * this.itemSize + 1]
  42095. },
  42096. setY: function(e, t) {
  42097. return this.array[e * this.itemSize + 1] = t,
  42098. this
  42099. },
  42100. getZ: function(e) {
  42101. return this.array[e * this.itemSize + 2]
  42102. },
  42103. setZ: function(e, t) {
  42104. return this.array[e * this.itemSize + 2] = t,
  42105. this
  42106. },
  42107. getW: function(e) {
  42108. return this.array[e * this.itemSize + 3]
  42109. },
  42110. setW: function(e, t) {
  42111. return this.array[e * this.itemSize + 3] = t,
  42112. this
  42113. },
  42114. setXY: function(e, t, i) {
  42115. return e *= this.itemSize,
  42116. this.array[e + 0] = t,
  42117. this.array[e + 1] = i,
  42118. this
  42119. },
  42120. setXYZ: function(e, t, i, n) {
  42121. return e *= this.itemSize,
  42122. this.array[e + 0] = t,
  42123. this.array[e + 1] = i,
  42124. this.array[e + 2] = n,
  42125. this
  42126. },
  42127. setXYZW: function(e, t, i, n, r) {
  42128. return e *= this.itemSize,
  42129. this.array[e + 0] = t,
  42130. this.array[e + 1] = i,
  42131. this.array[e + 2] = n,
  42132. this.array[e + 3] = r,
  42133. this
  42134. },
  42135. clone: function() {
  42136. return (new this.constructor).copy(this)
  42137. }
  42138. },
  42139. Ci.Int8Attribute = function(e, t) {
  42140. return new Ci.BufferAttribute(new Int8Array(e),t)
  42141. }
  42142. ,
  42143. Ci.Uint8Attribute = function(e, t) {
  42144. return new Ci.BufferAttribute(new Uint8Array(e),t)
  42145. }
  42146. ,
  42147. Ci.Uint8ClampedAttribute = function(e, t) {
  42148. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  42149. }
  42150. ,
  42151. Ci.Int16Attribute = function(e, t) {
  42152. return new Ci.BufferAttribute(new Int16Array(e),t)
  42153. }
  42154. ,
  42155. Ci.Uint16Attribute = function(e, t) {
  42156. return new Ci.BufferAttribute(new Uint16Array(e),t)
  42157. }
  42158. ,
  42159. Ci.Int32Attribute = function(e, t) {
  42160. return new Ci.BufferAttribute(new Int32Array(e),t)
  42161. }
  42162. ,
  42163. Ci.Uint32Attribute = function(e, t) {
  42164. return new Ci.BufferAttribute(new Uint32Array(e),t)
  42165. }
  42166. ,
  42167. Ci.Float32Attribute = function(e, t) {
  42168. return new Ci.BufferAttribute(new Float32Array(e),t)
  42169. }
  42170. ,
  42171. Ci.Float64Attribute = function(e, t) {
  42172. return new Ci.BufferAttribute(new Float64Array(e),t)
  42173. }
  42174. ,
  42175. Ci.DynamicBufferAttribute = function(e, t) {
  42176. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  42177. new Ci.BufferAttribute(e,t).setDynamic(!0)
  42178. }
  42179. ,
  42180. Ci.InstancedBufferAttribute = function(e, t, i) {
  42181. Ci.BufferAttribute.call(this, e, t),
  42182. this.meshPerAttribute = i || 1
  42183. }
  42184. ,
  42185. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  42186. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  42187. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  42188. return Ci.BufferAttribute.prototype.copy.call(this, e),
  42189. this.meshPerAttribute = e.meshPerAttribute,
  42190. this
  42191. }
  42192. ,
  42193. Ci.InterleavedBuffer = function(e, t) {
  42194. this.uuid = Ci.Math.generateUUID(),
  42195. this.array = e,
  42196. this.stride = t,
  42197. this.dynamic = !1,
  42198. this.updateRange = {
  42199. offset: 0,
  42200. count: -1
  42201. },
  42202. this.version = 0
  42203. }
  42204. ,
  42205. Ci.InterleavedBuffer.prototype = {
  42206. constructor: Ci.InterleavedBuffer,
  42207. get length() {
  42208. return this.array.length
  42209. },
  42210. get count() {
  42211. return this.array.length / this.stride
  42212. },
  42213. set needsUpdate(e) {
  42214. !0 === e && this.version++
  42215. },
  42216. setDynamic: function(e) {
  42217. return this.dynamic = e,
  42218. this
  42219. },
  42220. copy: function(e) {
  42221. return this.array = new e.array.constructor(e.array),
  42222. this.stride = e.stride,
  42223. this.dynamic = e.dynamic,
  42224. this
  42225. },
  42226. copyAt: function(e, t, i) {
  42227. e *= this.stride,
  42228. i *= t.stride;
  42229. for (var n = 0, r = this.stride; n < r; n++)
  42230. this.array[e + n] = t.array[i + n];
  42231. return this
  42232. },
  42233. set: function(e, t) {
  42234. return void 0 === t && (t = 0),
  42235. this.array.set(e, t),
  42236. this
  42237. },
  42238. clone: function() {
  42239. return (new this.constructor).copy(this)
  42240. }
  42241. },
  42242. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  42243. Ci.InterleavedBuffer.call(this, e, t),
  42244. this.meshPerAttribute = i || 1
  42245. }
  42246. ,
  42247. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  42248. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  42249. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42250. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  42251. this.meshPerAttribute = e.meshPerAttribute,
  42252. this
  42253. }
  42254. ,
  42255. Ci.InterleavedBufferAttribute = function(e, t, i) {
  42256. this.uuid = Ci.Math.generateUUID(),
  42257. this.data = e,
  42258. this.itemSize = t,
  42259. this.offset = i
  42260. }
  42261. ,
  42262. Ci.InterleavedBufferAttribute.prototype = {
  42263. constructor: Ci.InterleavedBufferAttribute,
  42264. get length() {
  42265. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42266. this.array.length
  42267. },
  42268. get count() {
  42269. return this.data.count
  42270. },
  42271. setX: function(e, t) {
  42272. return this.data.array[e * this.data.stride + this.offset] = t,
  42273. this
  42274. },
  42275. setY: function(e, t) {
  42276. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42277. this
  42278. },
  42279. setZ: function(e, t) {
  42280. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42281. this
  42282. },
  42283. setW: function(e, t) {
  42284. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42285. this
  42286. },
  42287. getX: function(e) {
  42288. return this.data.array[e * this.data.stride + this.offset]
  42289. },
  42290. getY: function(e) {
  42291. return this.data.array[e * this.data.stride + this.offset + 1]
  42292. },
  42293. getZ: function(e) {
  42294. return this.data.array[e * this.data.stride + this.offset + 2]
  42295. },
  42296. getW: function(e) {
  42297. return this.data.array[e * this.data.stride + this.offset + 3]
  42298. },
  42299. setXY: function(e, t, i) {
  42300. return e = e * this.data.stride + this.offset,
  42301. this.data.array[e + 0] = t,
  42302. this.data.array[e + 1] = i,
  42303. this
  42304. },
  42305. setXYZ: function(e, t, i, n) {
  42306. return e = e * this.data.stride + this.offset,
  42307. this.data.array[e + 0] = t,
  42308. this.data.array[e + 1] = i,
  42309. this.data.array[e + 2] = n,
  42310. this
  42311. },
  42312. setXYZW: function(e, t, i, n, r) {
  42313. return e = e * this.data.stride + this.offset,
  42314. this.data.array[e + 0] = t,
  42315. this.data.array[e + 1] = i,
  42316. this.data.array[e + 2] = n,
  42317. this.data.array[e + 3] = r,
  42318. this
  42319. }
  42320. },
  42321. Ci.Geometry = function() {
  42322. Object.defineProperty(this, "id", {
  42323. value: Ci.GeometryIdCount++
  42324. }),
  42325. this.uuid = Ci.Math.generateUUID(),
  42326. this.name = "",
  42327. this.type = "Geometry",
  42328. this.vertices = [],
  42329. this.colors = [],
  42330. this.faces = [],
  42331. this.faceVertexUvs = [[]],
  42332. this.morphTargets = [],
  42333. this.morphNormals = [],
  42334. this.skinWeights = [],
  42335. this.skinIndices = [],
  42336. this.lineDistances = [],
  42337. this.boundingBox = null,
  42338. this.boundingSphere = null,
  42339. this.verticesNeedUpdate = !1,
  42340. this.elementsNeedUpdate = !1,
  42341. this.uvsNeedUpdate = !1,
  42342. this.normalsNeedUpdate = !1,
  42343. this.colorsNeedUpdate = !1,
  42344. this.lineDistancesNeedUpdate = !1,
  42345. this.groupsNeedUpdate = !1
  42346. }
  42347. ,
  42348. Ci.Geometry.prototype = {
  42349. constructor: Ci.Geometry,
  42350. applyMatrix: function(e) {
  42351. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  42352. this.vertices[i].applyMatrix4(e)
  42353. }
  42354. for (i = 0,
  42355. n = this.faces.length; i < n; i++) {
  42356. var r = this.faces[i];
  42357. r.normal.applyMatrix3(t).normalize();
  42358. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  42359. r.vertexNormals[o].applyMatrix3(t).normalize()
  42360. }
  42361. return null !== this.boundingBox && this.computeBoundingBox(),
  42362. null !== this.boundingSphere && this.computeBoundingSphere(),
  42363. this.verticesNeedUpdate = !0,
  42364. this.normalsNeedUpdate = !0,
  42365. this
  42366. },
  42367. rotateX: function(e) {
  42368. return void 0 === mt && (mt = new Ci.Matrix4),
  42369. mt.makeRotationX(e),
  42370. this.applyMatrix(mt),
  42371. this
  42372. },
  42373. rotateY: function(e) {
  42374. return void 0 === gt && (gt = new Ci.Matrix4),
  42375. gt.makeRotationY(e),
  42376. this.applyMatrix(gt),
  42377. this
  42378. },
  42379. rotateZ: function(e) {
  42380. return void 0 === ft && (ft = new Ci.Matrix4),
  42381. ft.makeRotationZ(e),
  42382. this.applyMatrix(ft),
  42383. this
  42384. },
  42385. translate: function(e, t, i) {
  42386. return void 0 === pt && (pt = new Ci.Matrix4),
  42387. pt.makeTranslation(e, t, i),
  42388. this.applyMatrix(pt),
  42389. this
  42390. },
  42391. scale: function(e, t, i) {
  42392. return void 0 === dt && (dt = new Ci.Matrix4),
  42393. dt.makeScale(e, t, i),
  42394. this.applyMatrix(dt),
  42395. this
  42396. },
  42397. lookAt: function(e) {
  42398. void 0 === ut && (ut = new Ci.Object3D),
  42399. ut.lookAt(e),
  42400. ut.updateMatrix(),
  42401. this.applyMatrix(ut.matrix)
  42402. },
  42403. fromBufferGeometry: function(e) {
  42404. function t(e, t, i, n) {
  42405. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  42406. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  42407. , a = new Ci.Face3(e,t,i,r,o,n);
  42408. s.faces.push(a),
  42409. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  42410. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  42411. }
  42412. var s = this
  42413. , i = null !== e.index ? e.index.array : void 0
  42414. , n = e.attributes
  42415. , r = n.position.array
  42416. , l = void 0 !== n.normal ? n.normal.array : void 0
  42417. , c = void 0 !== n.color ? n.color.array : void 0
  42418. , h = void 0 !== n.uv ? n.uv.array : void 0
  42419. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  42420. void 0 !== u && (this.faceVertexUvs[1] = []);
  42421. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  42422. a += 2)
  42423. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  42424. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  42425. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  42426. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  42427. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  42428. if (void 0 !== i) {
  42429. var g = e.groups;
  42430. if (0 < g.length)
  42431. for (o = 0; o < g.length; o++)
  42432. for (var m = g[o], v = m.start, y = (a = v,
  42433. v + m.count); a < y; a += 3)
  42434. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  42435. else
  42436. for (o = 0; o < i.length; o += 3)
  42437. t(i[o], i[o + 1], i[o + 2])
  42438. } else
  42439. for (o = 0; o < r.length / 3; o += 3)
  42440. t(o, o + 1, o + 2);
  42441. return this.computeFaceNormals(),
  42442. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42443. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42444. this
  42445. },
  42446. center: function() {
  42447. this.computeBoundingBox();
  42448. var e = this.boundingBox.center().negate();
  42449. return this.translate(e.x, e.y, e.z),
  42450. e
  42451. },
  42452. normalize: function() {
  42453. this.computeBoundingSphere();
  42454. var e = this.boundingSphere.center
  42455. , t = this.boundingSphere.radius
  42456. , i = 0 === t ? 1 : 1 / t
  42457. , n = new Ci.Matrix4;
  42458. 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),
  42459. this.applyMatrix(n),
  42460. this
  42461. },
  42462. computeFaceNormals: function() {
  42463. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  42464. var r = this.faces[i]
  42465. , o = this.vertices[r.a]
  42466. , a = this.vertices[r.b]
  42467. , s = this.vertices[r.c];
  42468. e.subVectors(s, a),
  42469. t.subVectors(o, a),
  42470. e.cross(t),
  42471. e.normalize(),
  42472. r.normal.copy(e)
  42473. }
  42474. },
  42475. computeVertexNormals: function(e) {
  42476. var t, i, n, r, o, a;
  42477. for (void 0 === e && (e = !0),
  42478. a = new Array(this.vertices.length),
  42479. t = 0,
  42480. i = this.vertices.length; t < i; t++)
  42481. a[t] = new Ci.Vector3;
  42482. if (e) {
  42483. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  42484. for (n = 0,
  42485. r = this.faces.length; n < r; n++)
  42486. o = this.faces[n],
  42487. s = this.vertices[o.a],
  42488. l = this.vertices[o.b],
  42489. c = this.vertices[o.c],
  42490. h.subVectors(c, l),
  42491. u.subVectors(s, l),
  42492. h.cross(u),
  42493. a[o.a].add(h),
  42494. a[o.b].add(h),
  42495. a[o.c].add(h)
  42496. } else
  42497. for (n = 0,
  42498. r = this.faces.length; n < r; n++)
  42499. a[(o = this.faces[n]).a].add(o.normal),
  42500. a[o.b].add(o.normal),
  42501. a[o.c].add(o.normal);
  42502. for (t = 0,
  42503. i = this.vertices.length; t < i; t++)
  42504. a[t].normalize();
  42505. for (n = 0,
  42506. r = this.faces.length; n < r; n++) {
  42507. var d = (o = this.faces[n]).vertexNormals;
  42508. 3 === d.length ? (d[0].copy(a[o.a]),
  42509. d[1].copy(a[o.b]),
  42510. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42511. d[1] = a[o.b].clone(),
  42512. d[2] = a[o.c].clone())
  42513. }
  42514. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42515. },
  42516. computeMorphNormals: function() {
  42517. var e, t, i, n, r;
  42518. for (i = 0,
  42519. n = this.faces.length; i < n; i++)
  42520. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42521. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42522. e = 0,
  42523. t = r.vertexNormals.length; e < t; e++)
  42524. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42525. var o = new Ci.Geometry;
  42526. for (o.faces = this.faces,
  42527. e = 0,
  42528. t = this.morphTargets.length; e < t; e++) {
  42529. if (!this.morphNormals[e]) {
  42530. this.morphNormals[e] = {},
  42531. this.morphNormals[e].faceNormals = [],
  42532. this.morphNormals[e].vertexNormals = [];
  42533. var a = this.morphNormals[e].faceNormals
  42534. , s = this.morphNormals[e].vertexNormals;
  42535. for (i = 0,
  42536. n = this.faces.length; i < n; i++)
  42537. l = new Ci.Vector3,
  42538. c = {
  42539. a: new Ci.Vector3,
  42540. b: new Ci.Vector3,
  42541. c: new Ci.Vector3
  42542. },
  42543. a.push(l),
  42544. s.push(c)
  42545. }
  42546. var l, c, h = this.morphNormals[e];
  42547. for (o.vertices = this.morphTargets[e].vertices,
  42548. o.computeFaceNormals(),
  42549. o.computeVertexNormals(),
  42550. i = 0,
  42551. n = this.faces.length; i < n; i++)
  42552. r = this.faces[i],
  42553. l = h.faceNormals[i],
  42554. c = h.vertexNormals[i],
  42555. l.copy(r.normal),
  42556. c.a.copy(r.vertexNormals[0]),
  42557. c.b.copy(r.vertexNormals[1]),
  42558. c.c.copy(r.vertexNormals[2])
  42559. }
  42560. for (i = 0,
  42561. n = this.faces.length; i < n; i++)
  42562. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42563. r.vertexNormals = r.__originalVertexNormals
  42564. },
  42565. computeTangents: function() {
  42566. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42567. },
  42568. computeLineDistances: function() {
  42569. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42570. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42571. this.lineDistances[i] = e
  42572. },
  42573. computeBoundingBox: function() {
  42574. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42575. this.boundingBox.setFromPoints(this.vertices)
  42576. },
  42577. computeBoundingSphere: function() {
  42578. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42579. this.boundingSphere.setFromPoints(this.vertices)
  42580. },
  42581. merge: function(e, t, i) {
  42582. if (e instanceof Ci.Geometry != 0) {
  42583. 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];
  42584. void 0 === i && (i = 0),
  42585. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42586. for (var u = 0, d = a.length; u < d; u++) {
  42587. var p = a[u].clone();
  42588. void 0 !== t && p.applyMatrix4(t),
  42589. o.push(p)
  42590. }
  42591. for (u = 0,
  42592. d = l.length; u < d; u++) {
  42593. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42594. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42595. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42596. for (var C = 0, I = y.length; C < I; C++)
  42597. g = y[C].clone(),
  42598. void 0 !== n && g.applyMatrix3(n).normalize(),
  42599. f.vertexNormals.push(g);
  42600. f.color.copy(v.color);
  42601. for (C = 0,
  42602. I = A.length; C < I; C++)
  42603. m = A[C],
  42604. f.vertexColors.push(m.clone());
  42605. f.materialIndex = v.materialIndex + i,
  42606. s.push(f)
  42607. }
  42608. for (u = 0,
  42609. d = h.length; u < d; u++) {
  42610. var E = h[u]
  42611. , _ = [];
  42612. if (void 0 !== E) {
  42613. for (C = 0,
  42614. I = E.length; C < I; C++)
  42615. _.push(E[C].clone());
  42616. c.push(_)
  42617. }
  42618. }
  42619. } else
  42620. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42621. },
  42622. mergeMesh: function(e) {
  42623. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42624. void this.merge(e.geometry, e.matrix))
  42625. },
  42626. mergeVertices: function() {
  42627. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42628. for (i = 0,
  42629. n = this.vertices.length; i < n; i++)
  42630. e = this.vertices[i],
  42631. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42632. c.push(this.vertices[i]),
  42633. h[i] = c.length - 1) : h[i] = h[l[t]];
  42634. var d = [];
  42635. for (i = 0,
  42636. n = this.faces.length; i < n; i++) {
  42637. (r = this.faces[i]).a = h[r.a],
  42638. r.b = h[r.b],
  42639. r.c = h[r.c],
  42640. o = [r.a, r.b, r.c];
  42641. for (var p = 0; p < 3; p++)
  42642. if (o[p] === o[(p + 1) % 3]) {
  42643. p,
  42644. d.push(i);
  42645. break
  42646. }
  42647. }
  42648. for (i = d.length - 1; 0 <= i; i--) {
  42649. var f = d[i];
  42650. for (this.faces.splice(f, 1),
  42651. a = 0,
  42652. s = this.faceVertexUvs.length; a < s; a++)
  42653. this.faceVertexUvs[a].splice(f, 1)
  42654. }
  42655. var g = this.vertices.length - c.length;
  42656. return this.vertices = c,
  42657. g
  42658. },
  42659. sortFacesByMaterialIndex: function() {
  42660. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42661. e[i]._id = i;
  42662. e.sort(function(e, t) {
  42663. return e.materialIndex - t.materialIndex
  42664. });
  42665. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42666. o && o.length === t && (n = []),
  42667. a && a.length === t && (r = []);
  42668. for (i = 0; i < t; i++) {
  42669. var s = e[i]._id;
  42670. n && n.push(o[s]),
  42671. r && r.push(a[s])
  42672. }
  42673. n && (this.faceVertexUvs[0] = n),
  42674. r && (this.faceVertexUvs[1] = r)
  42675. },
  42676. toJSON: function() {
  42677. function e(e, t, i) {
  42678. return i ? e | 1 << t : e & ~(1 << t)
  42679. }
  42680. function t(e) {
  42681. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42682. return void 0 !== d[t] || (d[t] = u.length / 3,
  42683. u.push(e.x, e.y, e.z)),
  42684. d[t]
  42685. }
  42686. function i(e) {
  42687. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42688. return void 0 !== f[t] || (f[t] = p.length,
  42689. p.push(e.getHex())),
  42690. f[t]
  42691. }
  42692. function n(e) {
  42693. var t = e.x.toString() + e.y.toString();
  42694. return void 0 !== m[t] || (m[t] = g.length / 2,
  42695. g.push(e.x, e.y)),
  42696. m[t]
  42697. }
  42698. var r = {
  42699. metadata: {
  42700. version: 4.4,
  42701. type: "Geometry",
  42702. generator: "Geometry.toJSON"
  42703. }
  42704. };
  42705. if (r.uuid = this.uuid,
  42706. r.type = this.type,
  42707. "" !== this.name && (r.name = this.name),
  42708. void 0 !== this.parameters) {
  42709. var o = this.parameters;
  42710. for (var a in o)
  42711. void 0 !== o[a] && (r[a] = o[a]);
  42712. return r
  42713. }
  42714. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42715. var c = this.vertices[l];
  42716. s.push(c.x, c.y, c.z)
  42717. }
  42718. var h = []
  42719. , u = []
  42720. , d = {}
  42721. , p = []
  42722. , f = {}
  42723. , g = []
  42724. , m = {};
  42725. for (l = 0; l < this.faces.length; l++) {
  42726. var v = this.faces[l]
  42727. , y = void 0 !== this.faceVertexUvs[0][l]
  42728. , A = 0 < v.normal.length()
  42729. , C = 0 < v.vertexNormals.length
  42730. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42731. , E = 0 < v.vertexColors.length
  42732. , _ = 0;
  42733. 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),
  42734. h.push(_),
  42735. h.push(v.a, v.b, v.c),
  42736. h.push(v.materialIndex),
  42737. y) {
  42738. var b = this.faceVertexUvs[0][l];
  42739. h.push(n(b[0]), n(b[1]), n(b[2]))
  42740. }
  42741. if (A && h.push(t(v.normal)),
  42742. C) {
  42743. var w = v.vertexNormals;
  42744. h.push(t(w[0]), t(w[1]), t(w[2]))
  42745. }
  42746. if (I && h.push(i(v.color)),
  42747. E) {
  42748. var T = v.vertexColors;
  42749. h.push(i(T[0]), i(T[1]), i(T[2]))
  42750. }
  42751. }
  42752. return r.data = {},
  42753. r.data.vertices = s,
  42754. r.data.normals = u,
  42755. 0 < p.length && (r.data.colors = p),
  42756. 0 < g.length && (r.data.uvs = [g]),
  42757. r.data.faces = h,
  42758. r
  42759. },
  42760. clone: function() {
  42761. return (new Ci.Geometry).copy(this)
  42762. },
  42763. copy: function(e) {
  42764. this.vertices = [],
  42765. this.faces = [],
  42766. this.faceVertexUvs = [[]];
  42767. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42768. this.vertices.push(t[i].clone());
  42769. var r = e.faces;
  42770. for (i = 0,
  42771. n = r.length; i < n; i++)
  42772. this.faces.push(r[i].clone());
  42773. for (i = 0,
  42774. n = e.faceVertexUvs.length; i < n; i++) {
  42775. var o = e.faceVertexUvs[i];
  42776. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42777. for (var a = 0, s = o.length; a < s; a++) {
  42778. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42779. var d = l[h];
  42780. c.push(d.clone())
  42781. }
  42782. this.faceVertexUvs[i].push(c)
  42783. }
  42784. }
  42785. return this
  42786. },
  42787. dispose: function() {
  42788. this.dispatchEvent({
  42789. type: "dispose"
  42790. })
  42791. }
  42792. },
  42793. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42794. Ci.GeometryIdCount = 0,
  42795. Ci.DirectGeometry = function() {
  42796. Object.defineProperty(this, "id", {
  42797. value: Ci.GeometryIdCount++
  42798. }),
  42799. this.uuid = Ci.Math.generateUUID(),
  42800. this.name = "",
  42801. this.type = "DirectGeometry",
  42802. this.indices = [],
  42803. this.vertices = [],
  42804. this.normals = [],
  42805. this.colors = [],
  42806. this.uvs = [],
  42807. this.uvs2 = [],
  42808. this.groups = [],
  42809. this.morphTargets = {},
  42810. this.skinWeights = [],
  42811. this.skinIndices = [],
  42812. this.boundingBox = null,
  42813. this.boundingSphere = null,
  42814. this.verticesNeedUpdate = !1,
  42815. this.normalsNeedUpdate = !1,
  42816. this.colorsNeedUpdate = !1,
  42817. this.uvsNeedUpdate = !1,
  42818. this.groupsNeedUpdate = !1
  42819. }
  42820. ,
  42821. Ci.DirectGeometry.prototype = {
  42822. constructor: Ci.DirectGeometry,
  42823. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42824. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42825. computeFaceNormals: function() {
  42826. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42827. },
  42828. computeVertexNormals: function() {
  42829. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42830. },
  42831. computeGroups: function(e) {
  42832. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42833. var a = r[o];
  42834. a.materialIndex !== i && (i = a.materialIndex,
  42835. void 0 !== t && (t.count = 3 * o - t.start,
  42836. n.push(t)),
  42837. t = {
  42838. start: 3 * o,
  42839. materialIndex: i
  42840. })
  42841. }
  42842. void 0 !== t && (t.count = 3 * o - t.start,
  42843. n.push(t)),
  42844. this.groups = n
  42845. },
  42846. fromGeometry: function(e) {
  42847. 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;
  42848. if (0 < l) {
  42849. t = [];
  42850. for (var c = 0; c < l; c++)
  42851. t[c] = [];
  42852. this.morphTargets.position = t
  42853. }
  42854. var h, u = e.morphNormals, d = u.length;
  42855. if (0 < d) {
  42856. h = [];
  42857. for (c = 0; c < d; c++)
  42858. h[c] = [];
  42859. this.morphTargets.normal = h
  42860. }
  42861. var p = e.skinIndices
  42862. , f = e.skinWeights
  42863. , g = p.length === n.length
  42864. , m = f.length === n.length;
  42865. for (c = 0; c < i.length; c++) {
  42866. var v = i[c];
  42867. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42868. var y = v.vertexNormals;
  42869. if (3 === y.length)
  42870. this.normals.push(y[0], y[1], y[2]);
  42871. else {
  42872. var A = v.normal;
  42873. this.normals.push(A, A, A)
  42874. }
  42875. var C, I = v.vertexColors;
  42876. if (3 === I.length)
  42877. this.colors.push(I[0], I[1], I[2]);
  42878. else {
  42879. var E = v.color;
  42880. this.colors.push(E, E, E)
  42881. }
  42882. if (!0 === o)
  42883. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42884. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42885. if (!0 === a)
  42886. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42887. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42888. for (var _ = 0; _ < l; _++) {
  42889. var b = s[_].vertices;
  42890. t[_].push(b[v.a], b[v.b], b[v.c])
  42891. }
  42892. for (_ = 0; _ < d; _++) {
  42893. var w = u[_].vertexNormals[c];
  42894. h[_].push(w.a, w.b, w.c)
  42895. }
  42896. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42897. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42898. }
  42899. return this.computeGroups(e),
  42900. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42901. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42902. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42903. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42904. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42905. this
  42906. },
  42907. dispose: function() {
  42908. this.dispatchEvent({
  42909. type: "dispose"
  42910. })
  42911. }
  42912. },
  42913. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42914. Ci.BufferGeometry = function() {
  42915. Object.defineProperty(this, "id", {
  42916. value: Ci.GeometryIdCount++
  42917. }),
  42918. this.uuid = Ci.Math.generateUUID(),
  42919. this.name = "",
  42920. this.type = "BufferGeometry",
  42921. this.index = null,
  42922. this.attributes = {},
  42923. this.morphAttributes = {},
  42924. this.groups = [],
  42925. this.boundingBox = null,
  42926. this.boundingSphere = null,
  42927. this.drawRange = {
  42928. start: 0,
  42929. count: 1 / 0
  42930. }
  42931. }
  42932. ,
  42933. Ci.BufferGeometry.prototype = {
  42934. constructor: Ci.BufferGeometry,
  42935. getIndex: function() {
  42936. return this.index
  42937. },
  42938. setIndex: function(e) {
  42939. this.index = e
  42940. },
  42941. addAttribute: function(e, t) {
  42942. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42943. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42944. void this.setIndex(t)) : (this.attributes[e] = t,
  42945. this)
  42946. },
  42947. getAttribute: function(e) {
  42948. return this.attributes[e]
  42949. },
  42950. removeAttribute: function(e) {
  42951. return delete this.attributes[e],
  42952. this
  42953. },
  42954. addGroup: function(e, t, i) {
  42955. this.groups.push({
  42956. start: e,
  42957. count: t,
  42958. materialIndex: void 0 !== i ? i : 0
  42959. })
  42960. },
  42961. clearGroups: function() {
  42962. this.groups = []
  42963. },
  42964. setDrawRange: function(e, t) {
  42965. this.drawRange.start = e,
  42966. this.drawRange.count = t
  42967. },
  42968. applyMatrix: function(e) {
  42969. var t = this.attributes.position;
  42970. void 0 !== t && (e.applyToVector3Array(t.array),
  42971. t.needsUpdate = !0);
  42972. var i = this.attributes.normal;
  42973. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42974. i.needsUpdate = !0);
  42975. return null !== this.boundingBox && this.computeBoundingBox(),
  42976. null !== this.boundingSphere && this.computeBoundingSphere(),
  42977. this
  42978. },
  42979. rotateX: function(e) {
  42980. return void 0 === ht && (ht = new Ci.Matrix4),
  42981. ht.makeRotationX(e),
  42982. this.applyMatrix(ht),
  42983. this
  42984. },
  42985. rotateY: function(e) {
  42986. return void 0 === ct && (ct = new Ci.Matrix4),
  42987. ct.makeRotationY(e),
  42988. this.applyMatrix(ct),
  42989. this
  42990. },
  42991. rotateZ: function(e) {
  42992. return void 0 === lt && (lt = new Ci.Matrix4),
  42993. lt.makeRotationZ(e),
  42994. this.applyMatrix(lt),
  42995. this
  42996. },
  42997. translate: function(e, t, i) {
  42998. return void 0 === st && (st = new Ci.Matrix4),
  42999. st.makeTranslation(e, t, i),
  43000. this.applyMatrix(st),
  43001. this
  43002. },
  43003. scale: function(e, t, i) {
  43004. return void 0 === at && (at = new Ci.Matrix4),
  43005. at.makeScale(e, t, i),
  43006. this.applyMatrix(at),
  43007. this
  43008. },
  43009. lookAt: function(e) {
  43010. void 0 === ot && (ot = new Ci.Object3D),
  43011. ot.lookAt(e),
  43012. ot.updateMatrix(),
  43013. this.applyMatrix(ot.matrix)
  43014. },
  43015. center: function() {
  43016. this.computeBoundingBox();
  43017. var e = this.boundingBox.center().negate();
  43018. return this.translate(e.x, e.y, e.z),
  43019. e
  43020. },
  43021. setFromObject: function(e) {
  43022. var t = e.geometry;
  43023. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  43024. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  43025. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  43026. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  43027. this.addAttribute("color", n.copyColorsArray(t.colors)),
  43028. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  43029. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  43030. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  43031. }
  43032. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  43033. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  43034. } else
  43035. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  43036. return this
  43037. },
  43038. updateFromObject: function(e) {
  43039. var t, i = e.geometry;
  43040. if (e instanceof Ci.Mesh) {
  43041. var n = i.__directGeometry;
  43042. if (void 0 === n)
  43043. return this.fromGeometry(i);
  43044. n.verticesNeedUpdate = i.verticesNeedUpdate,
  43045. n.normalsNeedUpdate = i.normalsNeedUpdate,
  43046. n.colorsNeedUpdate = i.colorsNeedUpdate,
  43047. n.uvsNeedUpdate = i.uvsNeedUpdate,
  43048. n.groupsNeedUpdate = i.groupsNeedUpdate,
  43049. i.verticesNeedUpdate = !1,
  43050. i.normalsNeedUpdate = !1,
  43051. i.colorsNeedUpdate = !1,
  43052. i.uvsNeedUpdate = !1,
  43053. i.groupsNeedUpdate = !1,
  43054. i = n
  43055. }
  43056. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  43057. t.needsUpdate = !0),
  43058. i.verticesNeedUpdate = !1);
  43059. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  43060. t.needsUpdate = !0),
  43061. i.normalsNeedUpdate = !1);
  43062. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  43063. t.needsUpdate = !0),
  43064. i.colorsNeedUpdate = !1);
  43065. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  43066. t.needsUpdate = !0),
  43067. i.uvsNeedUpdate = !1);
  43068. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  43069. t.needsUpdate = !0),
  43070. i.lineDistancesNeedUpdate = !1);
  43071. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  43072. this.groups = i.groups,
  43073. i.groupsNeedUpdate = !1),
  43074. this
  43075. },
  43076. fromGeometry: function(e) {
  43077. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  43078. this.fromDirectGeometry(e.__directGeometry)
  43079. },
  43080. fromDirectGeometry: function(e) {
  43081. var t = new Float32Array(3 * e.vertices.length);
  43082. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  43083. 0 < e.normals.length) {
  43084. var i = new Float32Array(3 * e.normals.length);
  43085. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  43086. }
  43087. if (0 < e.colors.length) {
  43088. var n = new Float32Array(3 * e.colors.length);
  43089. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  43090. }
  43091. if (0 < e.uvs.length) {
  43092. var r = new Float32Array(2 * e.uvs.length);
  43093. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  43094. }
  43095. if (0 < e.uvs2.length) {
  43096. var o = new Float32Array(2 * e.uvs2.length);
  43097. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  43098. }
  43099. if (0 < e.indices.length) {
  43100. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  43101. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  43102. }
  43103. for (var s in this.groups = e.groups,
  43104. e.morphTargets) {
  43105. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  43106. var d = c[h]
  43107. , p = new Ci.Float32Attribute(3 * d.length,3);
  43108. l.push(p.copyVector3sArray(d))
  43109. }
  43110. this.morphAttributes[s] = l
  43111. }
  43112. if (0 < e.skinIndices.length) {
  43113. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  43114. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  43115. }
  43116. if (0 < e.skinWeights.length) {
  43117. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  43118. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  43119. }
  43120. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43121. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43122. this
  43123. },
  43124. computeBoundingBox: (new Ci.Vector3,
  43125. function() {
  43126. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  43127. var e = this.attributes.position.array;
  43128. e && this.boundingBox.setFromArray(e),
  43129. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  43130. this.boundingBox.max.set(0, 0, 0)),
  43131. (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)
  43132. }
  43133. ),
  43134. computeBoundingSphere: (nt = new Ci.Box3,
  43135. rt = new Ci.Vector3,
  43136. function() {
  43137. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  43138. var e = this.attributes.position.array;
  43139. if (e) {
  43140. var t = this.boundingSphere.center;
  43141. nt.setFromArray(e),
  43142. nt.center(t);
  43143. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  43144. rt.fromArray(e, n),
  43145. i = Math.max(i, t.distanceToSquared(rt));
  43146. this.boundingSphere.radius = Math.sqrt(i),
  43147. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  43148. }
  43149. }
  43150. ),
  43151. computeFaceNormals: function() {},
  43152. computeVertexNormals: function() {
  43153. var e = this.index
  43154. , t = this.attributes
  43155. , i = this.groups;
  43156. if (t.position) {
  43157. var n = t.position.array;
  43158. if (void 0 === t.normal)
  43159. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  43160. else
  43161. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  43162. r[o] = 0;
  43163. 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;
  43164. if (e) {
  43165. var m = e.array;
  43166. 0 === i.length && this.addGroup(0, m.length);
  43167. for (var v = 0, y = i.length; v < y; ++v) {
  43168. var A = i[v]
  43169. , C = A.start;
  43170. for (o = C,
  43171. a = C + A.count; o < a; o += 3)
  43172. s = 3 * m[o + 0],
  43173. l = 3 * m[o + 1],
  43174. c = 3 * m[o + 2],
  43175. u.fromArray(n, s),
  43176. d.fromArray(n, l),
  43177. p.fromArray(n, c),
  43178. f.subVectors(p, d),
  43179. g.subVectors(u, d),
  43180. f.cross(g),
  43181. h[s] += f.x,
  43182. h[1 + s] += f.y,
  43183. h[2 + s] += f.z,
  43184. h[l] += f.x,
  43185. h[1 + l] += f.y,
  43186. h[2 + l] += f.z,
  43187. h[c] += f.x,
  43188. h[1 + c] += f.y,
  43189. h[2 + c] += f.z
  43190. }
  43191. } else
  43192. for (o = 0,
  43193. a = n.length; o < a; o += 9)
  43194. u.fromArray(n, o),
  43195. d.fromArray(n, o + 3),
  43196. p.fromArray(n, o + 6),
  43197. f.subVectors(p, d),
  43198. g.subVectors(u, d),
  43199. f.cross(g),
  43200. h[o] = f.x,
  43201. h[o + 1] = f.y,
  43202. h[o + 2] = f.z,
  43203. h[o + 3] = f.x,
  43204. h[o + 4] = f.y,
  43205. h[o + 5] = f.z,
  43206. h[o + 6] = f.x,
  43207. h[o + 7] = f.y,
  43208. h[o + 8] = f.z;
  43209. this.normalizeNormals(),
  43210. t.normal.needsUpdate = !0
  43211. }
  43212. },
  43213. merge: function(e, t) {
  43214. if (e instanceof Ci.BufferGeometry != 0) {
  43215. void 0 === t && (t = 0);
  43216. var i = this.attributes;
  43217. for (var n in i)
  43218. if (void 0 !== e.attributes[n])
  43219. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  43220. l++)
  43221. r[l] = a[s];
  43222. return this
  43223. }
  43224. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  43225. },
  43226. normalizeNormals: function() {
  43227. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43228. e = r[o],
  43229. t = r[o + 1],
  43230. i = r[o + 2],
  43231. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43232. r[o] *= n,
  43233. r[o + 1] *= n,
  43234. r[o + 2] *= n
  43235. },
  43236. toNonIndexed: function() {
  43237. if (null === this.index)
  43238. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43239. this;
  43240. var e = new Ci.BufferGeometry
  43241. , t = this.index.array
  43242. , i = this.attributes;
  43243. for (var n in i) {
  43244. 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++) {
  43245. l = t[h] * a;
  43246. for (var d = 0; d < a; d++)
  43247. s[c++] = o[l++]
  43248. }
  43249. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  43250. }
  43251. return e
  43252. },
  43253. toJSON: function() {
  43254. var e = {
  43255. metadata: {
  43256. version: 4.4,
  43257. type: "BufferGeometry",
  43258. generator: "BufferGeometry.toJSON"
  43259. }
  43260. };
  43261. if (e.uuid = this.uuid,
  43262. e.type = this.type,
  43263. "" !== this.name && (e.name = this.name),
  43264. void 0 !== this.parameters) {
  43265. var t = this.parameters;
  43266. for (var i in t)
  43267. void 0 !== t[i] && (e[i] = t[i]);
  43268. return e
  43269. }
  43270. e.data = {
  43271. attributes: {}
  43272. };
  43273. var n = this.index;
  43274. if (null !== n) {
  43275. var r = Array.prototype.slice.call(n.array);
  43276. e.data.index = {
  43277. type: n.array.constructor.name,
  43278. array: r
  43279. }
  43280. }
  43281. var o = this.attributes;
  43282. for (var i in o) {
  43283. var a = o[i];
  43284. r = Array.prototype.slice.call(a.array);
  43285. e.data.attributes[i] = {
  43286. itemSize: a.itemSize,
  43287. type: a.array.constructor.name,
  43288. array: r
  43289. }
  43290. }
  43291. var s = this.groups;
  43292. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43293. var l = this.boundingSphere;
  43294. return null !== l && (e.data.boundingSphere = {
  43295. center: l.center.toArray(),
  43296. radius: l.radius
  43297. }),
  43298. e
  43299. },
  43300. clone: function() {
  43301. return (new Ci.BufferGeometry).copy(this)
  43302. },
  43303. copy: function(e) {
  43304. var t = e.index;
  43305. null !== t && this.setIndex(t.clone());
  43306. var i = e.attributes;
  43307. for (var n in i) {
  43308. var r = i[n];
  43309. this.addAttribute(n, r.clone())
  43310. }
  43311. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43312. var l = o[a];
  43313. this.addGroup(l.start, l.count)
  43314. }
  43315. return this
  43316. },
  43317. dispose: function() {
  43318. this.dispatchEvent({
  43319. type: "dispose"
  43320. })
  43321. }
  43322. },
  43323. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  43324. Ci.BufferGeometry.MaxIndex = 65535,
  43325. Ci.InstancedBufferGeometry = function() {
  43326. Ci.BufferGeometry.call(this),
  43327. this.type = "InstancedBufferGeometry",
  43328. this.maxInstancedCount = void 0
  43329. }
  43330. ,
  43331. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  43332. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  43333. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43334. this.groups.push({
  43335. start: e,
  43336. count: t,
  43337. instances: i
  43338. })
  43339. }
  43340. ,
  43341. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  43342. var t = e.index;
  43343. null !== t && this.setIndex(t.clone());
  43344. var i = e.attributes;
  43345. for (var n in i) {
  43346. var r = i[n];
  43347. this.addAttribute(n, r.clone())
  43348. }
  43349. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43350. var l = o[a];
  43351. this.addGroup(l.start, l.count, l.instances)
  43352. }
  43353. return this
  43354. }
  43355. ,
  43356. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  43357. Ci.Uniform = function(e, t) {
  43358. this.type = e,
  43359. this.value = t,
  43360. this.dynamic = !1
  43361. }
  43362. ,
  43363. Ci.Uniform.prototype = {
  43364. constructor: Ci.Uniform,
  43365. onUpdate: function(e) {
  43366. return this.dynamic = !0,
  43367. this.onUpdateCallback = e,
  43368. this
  43369. }
  43370. },
  43371. Ci.AnimationClip = function(e, t, i) {
  43372. this.name = e || Ci.Math.generateUUID(),
  43373. this.tracks = i,
  43374. this.duration = void 0 !== t ? t : -1,
  43375. this.duration < 0 && this.resetDuration(),
  43376. this.trim(),
  43377. this.optimize()
  43378. }
  43379. ,
  43380. Ci.AnimationClip.prototype = {
  43381. constructor: Ci.AnimationClip,
  43382. resetDuration: function() {
  43383. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  43384. var n = this.tracks[t];
  43385. e = Math.max(e, n.times[n.times.length - 1])
  43386. }
  43387. this.duration = e
  43388. },
  43389. trim: function() {
  43390. for (var e = 0; e < this.tracks.length; e++)
  43391. this.tracks[e].trim(0, this.duration);
  43392. return this
  43393. },
  43394. optimize: function() {
  43395. for (var e = 0; e < this.tracks.length; e++)
  43396. this.tracks[e].optimize();
  43397. return this
  43398. }
  43399. },
  43400. Object.assign(Ci.AnimationClip, {
  43401. parse: function(e) {
  43402. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  43403. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  43404. return new Ci.AnimationClip(e.name,e.duration,t)
  43405. },
  43406. toJSON: function(e) {
  43407. for (var t = [], i = e.tracks, n = {
  43408. name: e.name,
  43409. duration: e.duration,
  43410. tracks: t
  43411. }, r = 0, o = i.length; r !== o; ++r)
  43412. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  43413. return n
  43414. },
  43415. CreateFromMorphTargetSequence: function(e, t, i) {
  43416. for (var n = t.length, r = [], o = 0; o < n; o++) {
  43417. var a = []
  43418. , s = [];
  43419. a.push((o + n - 1) % n, o, (o + 1) % n),
  43420. s.push(0, 1, 0);
  43421. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  43422. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  43423. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  43424. 0 === a[0] && (a.push(n),
  43425. s.push(s[0])),
  43426. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  43427. }
  43428. return new Ci.AnimationClip(e,-1,r)
  43429. },
  43430. findByName: function(e, t) {
  43431. for (var i = 0; i < e.length; i++)
  43432. if (e[i].name === t)
  43433. return e[i];
  43434. return null
  43435. },
  43436. CreateClipsFromMorphTargetSequences: function(e, t) {
  43437. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  43438. var a = e[r]
  43439. , s = a.name.match(n);
  43440. if (s && 1 < s.length) {
  43441. var l = i[h = s[1]];
  43442. l || (i[h] = l = []),
  43443. l.push(a)
  43444. }
  43445. }
  43446. var c = [];
  43447. for (var h in i)
  43448. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  43449. return c
  43450. },
  43451. parseAnimation: function(e, t, i) {
  43452. if (!e)
  43453. return console.error(" no animation in JSONLoader data"),
  43454. null;
  43455. function n(e, t, i, n, r) {
  43456. if (0 !== i.length) {
  43457. var o = []
  43458. , a = [];
  43459. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  43460. 0 !== o.length && r.push(new e(t,o,a))
  43461. }
  43462. }
  43463. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  43464. var h = l[c].keys;
  43465. if (h && 0 != h.length)
  43466. if (h[0].morphTargets) {
  43467. for (var u = {}, d = 0; d < h.length; d++)
  43468. if (h[d].morphTargets)
  43469. for (var p = 0; p < h[d].morphTargets.length; p++)
  43470. u[h[d].morphTargets[p]] = -1;
  43471. for (var f in u) {
  43472. var g = []
  43473. , m = [];
  43474. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  43475. var v = h[d];
  43476. g.push(v.time),
  43477. m.push(v.morphTarget === f ? 1 : 0)
  43478. }
  43479. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  43480. }
  43481. a = u.length * (s || 1)
  43482. } else {
  43483. var y = ".bones[" + t[c].name + "]";
  43484. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  43485. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43486. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43487. }
  43488. }
  43489. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43490. }
  43491. }),
  43492. Ci.AnimationMixer = function(e) {
  43493. this._root = e,
  43494. this._initMemoryManager(),
  43495. this._accuIndex = 0,
  43496. this.time = 0,
  43497. this.timeScale = 1
  43498. }
  43499. ,
  43500. Ci.AnimationMixer.prototype = {
  43501. constructor: Ci.AnimationMixer,
  43502. clipAction: function(e, t) {
  43503. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43504. if (void 0 !== a) {
  43505. var s = a.actionByRoot[n];
  43506. if (void 0 !== s)
  43507. return s;
  43508. if (o = (i = a.knownActions[0])._clip,
  43509. e !== r && e !== o)
  43510. throw new Error("Different clips with the same name detected!")
  43511. }
  43512. if (null === o)
  43513. return null;
  43514. var l = new Ci.AnimationMixer._Action(this,o,t);
  43515. return this._bindAction(l, i),
  43516. this._addInactiveAction(l, r, n),
  43517. l
  43518. },
  43519. existingAction: function(e, t) {
  43520. var i = (t || this._root).uuid
  43521. , n = "string" == typeof e ? e : e.name
  43522. , r = this._actionsByClip[n];
  43523. return void 0 !== r && r.actionByRoot[i] || null
  43524. },
  43525. stopAllAction: function() {
  43526. var e = this._actions
  43527. , t = this._nActiveActions
  43528. , i = this._bindings
  43529. , n = this._nActiveBindings;
  43530. this._nActiveActions = 0;
  43531. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43532. e[r].reset();
  43533. for (r = 0; r !== n; ++r)
  43534. i[r].useCount = 0;
  43535. return this
  43536. },
  43537. update: function(e) {
  43538. e *= this.timeScale;
  43539. 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) {
  43540. var s = t[a];
  43541. s.enabled && s._update(n, e, r, o)
  43542. }
  43543. var l = this._bindings
  43544. , c = this._nActiveBindings;
  43545. for (a = 0; a !== c; ++a)
  43546. l[a].apply(o);
  43547. return this
  43548. },
  43549. getRoot: function() {
  43550. return this._root
  43551. },
  43552. uncacheClip: function(e) {
  43553. var t = this._actions
  43554. , i = e.name
  43555. , n = this._actionsByClip
  43556. , r = n[i];
  43557. if (void 0 !== r) {
  43558. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43559. var l = o[a];
  43560. this._deactivateAction(l);
  43561. var c = l._cacheIndex
  43562. , h = t[t.length - 1];
  43563. l._cacheIndex = null,
  43564. l._byClipCacheIndex = null,
  43565. t[h._cacheIndex = c] = h,
  43566. t.pop(),
  43567. this._removeInactiveBindingsForAction(l)
  43568. }
  43569. delete n[i]
  43570. }
  43571. },
  43572. uncacheRoot: function(e) {
  43573. var t = e.uuid
  43574. , i = this._actionsByClip;
  43575. for (var n in i) {
  43576. var r = i[n].actionByRoot[t];
  43577. void 0 !== r && (this._deactivateAction(r),
  43578. this._removeInactiveAction(r))
  43579. }
  43580. var o = this._bindingsByRootAndName[t];
  43581. if (void 0 !== o)
  43582. for (var a in o) {
  43583. var s = o[a];
  43584. s.restoreOriginalState(),
  43585. this._removeInactiveBinding(s)
  43586. }
  43587. },
  43588. uncacheAction: function(e, t) {
  43589. var i = this.existingAction(e, t);
  43590. null !== i && (this._deactivateAction(i),
  43591. this._removeInactiveAction(i))
  43592. }
  43593. },
  43594. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43595. Ci.AnimationMixer._Action = function(e, t, i) {
  43596. this._mixer = e,
  43597. this._clip = t,
  43598. this._localRoot = i || null;
  43599. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43600. endingStart: Ci.ZeroCurvatureEnding,
  43601. endingEnd: Ci.ZeroCurvatureEnding
  43602. }, s = 0; s !== r; ++s) {
  43603. var l = n[s].createInterpolant(null);
  43604. (o[s] = l).settings = a
  43605. }
  43606. this._interpolantSettings = a,
  43607. this._interpolants = o,
  43608. this._propertyBindings = new Array(r),
  43609. this._cacheIndex = null,
  43610. this._byClipCacheIndex = null,
  43611. this._timeScaleInterpolant = null,
  43612. this._weightInterpolant = null,
  43613. this.loop = Ci.LoopRepeat,
  43614. this._loopCount = -1,
  43615. this._startTime = null,
  43616. this.time = 0,
  43617. this.timeScale = 1,
  43618. this._effectiveTimeScale = 1,
  43619. this.weight = 1,
  43620. this._effectiveWeight = 1,
  43621. this.repetitions = 1 / 0,
  43622. this.paused = !1,
  43623. this.enabled = !0,
  43624. this.clampWhenFinished = !1,
  43625. this.zeroSlopeAtStart = !0,
  43626. this.zeroSlopeAtEnd = !0
  43627. }
  43628. ,
  43629. Ci.AnimationMixer._Action.prototype = {
  43630. constructor: Ci.AnimationMixer._Action,
  43631. play: function() {
  43632. return this._mixer._activateAction(this),
  43633. this
  43634. },
  43635. stop: function() {
  43636. return this._mixer._deactivateAction(this),
  43637. this.reset()
  43638. },
  43639. reset: function() {
  43640. return this.paused = !1,
  43641. this.enabled = !0,
  43642. this.time = 0,
  43643. this._loopCount = -1,
  43644. this._startTime = null,
  43645. this.stopFading().stopWarping()
  43646. },
  43647. isRunning: function() {
  43648. return this._startTime,
  43649. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43650. },
  43651. isScheduled: function() {
  43652. return this._mixer._isActiveAction(this)
  43653. },
  43654. startAt: function(e) {
  43655. return this._startTime = e,
  43656. this
  43657. },
  43658. setLoop: function(e, t) {
  43659. return this.loop = e,
  43660. this.repetitions = t,
  43661. this
  43662. },
  43663. setEffectiveWeight: function(e) {
  43664. return this.weight = e,
  43665. this._effectiveWeight = this.enabled ? e : 0,
  43666. this.stopFading()
  43667. },
  43668. getEffectiveWeight: function() {
  43669. return this._effectiveWeight
  43670. },
  43671. fadeIn: function(e) {
  43672. return this._scheduleFading(e, 0, 1)
  43673. },
  43674. fadeOut: function(e) {
  43675. return this._scheduleFading(e, 1, 0)
  43676. },
  43677. crossFadeFrom: function(e, t, i) {
  43678. if (this._mixer,
  43679. e.fadeOut(t),
  43680. this.fadeIn(t),
  43681. i) {
  43682. var n = this._clip.duration
  43683. , r = e._clip.duration
  43684. , o = r / n
  43685. , a = n / r;
  43686. e.warp(1, o, t),
  43687. this.warp(a, 1, t)
  43688. }
  43689. return this
  43690. },
  43691. crossFadeTo: function(e, t, i) {
  43692. return e.crossFadeFrom(this, t, i)
  43693. },
  43694. stopFading: function() {
  43695. var e = this._weightInterpolant;
  43696. return null !== e && (this._weightInterpolant = null,
  43697. this._mixer._takeBackControlInterpolant(e)),
  43698. this
  43699. },
  43700. setEffectiveTimeScale: function(e) {
  43701. return this.timeScale = e,
  43702. this._effectiveTimeScale = this.paused ? 0 : e,
  43703. this.stopWarping()
  43704. },
  43705. getEffectiveTimeScale: function() {
  43706. return this._effectiveTimeScale
  43707. },
  43708. setDuration: function(e) {
  43709. return this.timeScale = this._clip.duration / e,
  43710. this.stopWarping()
  43711. },
  43712. syncWith: function(e) {
  43713. return this.time = e.time,
  43714. this.timeScale = e.timeScale,
  43715. this.stopWarping()
  43716. },
  43717. halt: function(e) {
  43718. return this.warp(this._currentTimeScale, 0, e)
  43719. },
  43720. warp: function(e, t, i) {
  43721. var n = this._mixer
  43722. , r = n.time
  43723. , o = this._timeScaleInterpolant
  43724. , a = this.timeScale;
  43725. null === o && (o = n._lendControlInterpolant(),
  43726. this._timeScaleInterpolant = o);
  43727. var s = o.parameterPositions
  43728. , l = o.sampleValues;
  43729. return s[0] = r,
  43730. s[1] = r + i,
  43731. l[0] = e / a,
  43732. l[1] = t / a,
  43733. this
  43734. },
  43735. stopWarping: function() {
  43736. var e = this._timeScaleInterpolant;
  43737. return null !== e && (this._timeScaleInterpolant = null,
  43738. this._mixer._takeBackControlInterpolant(e)),
  43739. this
  43740. },
  43741. getMixer: function() {
  43742. return this._mixer
  43743. },
  43744. getClip: function() {
  43745. return this._clip
  43746. },
  43747. getRoot: function() {
  43748. return this._localRoot || this._mixer._root
  43749. },
  43750. _update: function(e, t, i, n) {
  43751. var r = this._startTime;
  43752. if (null !== r) {
  43753. var o = (e - r) * i;
  43754. if (o < 0 || 0 === i)
  43755. return;
  43756. this._startTime = null,
  43757. t = i * o
  43758. }
  43759. t *= this._updateTimeScale(e);
  43760. var a = this._updateTime(t)
  43761. , s = this._updateWeight(e);
  43762. if (0 < s)
  43763. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43764. l[h].evaluate(a),
  43765. c[h].accumulate(n, s)
  43766. },
  43767. _updateWeight: function(e) {
  43768. var t = 0;
  43769. if (this.enabled) {
  43770. t = this.weight;
  43771. var i = this._weightInterpolant;
  43772. if (null !== i) {
  43773. var n = i.evaluate(e)[0];
  43774. t *= n,
  43775. e > i.parameterPositions[1] && (this.stopFading(),
  43776. 0 === n && (this.enabled = !1))
  43777. }
  43778. }
  43779. return this._effectiveWeight = t
  43780. },
  43781. _updateTimeScale: function(e) {
  43782. var t = 0;
  43783. if (!this.paused) {
  43784. t = this.timeScale;
  43785. var i = this._timeScaleInterpolant;
  43786. if (null !== i)
  43787. t *= i.evaluate(e)[0],
  43788. e > i.parameterPositions[1] && (this.stopWarping(),
  43789. 0 === t ? this.pause = !0 : this.timeScale = t)
  43790. }
  43791. return this._effectiveTimeScale = t
  43792. },
  43793. _updateTime: function(e) {
  43794. var t = this.time + e;
  43795. if (0 === e)
  43796. return t;
  43797. var i = this._clip.duration
  43798. , n = this.loop
  43799. , r = this._loopCount
  43800. , o = !1;
  43801. switch (n) {
  43802. case Ci.LoopOnce:
  43803. if (-1 === r && (this.loopCount = 0,
  43804. this._setEndings(!0, !0, !1)),
  43805. i <= t)
  43806. t = i;
  43807. else {
  43808. if (!(t < 0))
  43809. break;
  43810. t = 0
  43811. }
  43812. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43813. this._mixer.dispatchEvent({
  43814. type: "finished",
  43815. action: this,
  43816. direction: e < 0 ? -1 : 1
  43817. });
  43818. break;
  43819. case Ci.LoopPingPong:
  43820. o = !0;
  43821. case Ci.LoopRepeat:
  43822. if (-1 === r && (0 < e ? (r = 0,
  43823. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43824. i <= t || t < 0) {
  43825. var a = Math.floor(t / i);
  43826. t -= i * a,
  43827. r += Math.abs(a);
  43828. var s = this.repetitions - r;
  43829. if (s < 0) {
  43830. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43831. t = 0 < e ? i : 0,
  43832. this._mixer.dispatchEvent({
  43833. type: "finished",
  43834. action: this,
  43835. direction: 0 < e ? 1 : -1
  43836. });
  43837. break
  43838. }
  43839. if (0 == s) {
  43840. var l = e < 0;
  43841. this._setEndings(l, !l, o)
  43842. } else
  43843. this._setEndings(!1, !1, o);
  43844. this._loopCount = r,
  43845. this._mixer.dispatchEvent({
  43846. type: "loop",
  43847. action: this,
  43848. loopDelta: a
  43849. })
  43850. }
  43851. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43852. return i - (this.time = t)
  43853. }
  43854. return this.time = t
  43855. },
  43856. _setEndings: function(e, t, i) {
  43857. var n = this._interpolantSettings;
  43858. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43859. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43860. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43861. },
  43862. _scheduleFading: function(e, t, i) {
  43863. var n = this._mixer
  43864. , r = n.time
  43865. , o = this._weightInterpolant;
  43866. null === o && (o = n._lendControlInterpolant(),
  43867. this._weightInterpolant = o);
  43868. var a = o.parameterPositions
  43869. , s = o.sampleValues;
  43870. return a[0] = r,
  43871. s[0] = t,
  43872. a[1] = r + e,
  43873. s[1] = i,
  43874. this
  43875. }
  43876. },
  43877. Object.assign(Ci.AnimationMixer.prototype, {
  43878. _bindAction: function(e, t) {
  43879. var i = e._localRoot || this._root
  43880. , n = e._clip.tracks
  43881. , r = n.length
  43882. , o = e._propertyBindings
  43883. , a = e._interpolants
  43884. , s = i.uuid
  43885. , l = this._bindingsByRootAndName
  43886. , c = l[s];
  43887. void 0 === c && (c = {},
  43888. l[s] = c);
  43889. for (var h = 0; h !== r; ++h) {
  43890. var u = n[h]
  43891. , d = u.name
  43892. , p = c[d];
  43893. if (void 0 !== p)
  43894. o[h] = p;
  43895. else {
  43896. if (void 0 !== (p = o[h])) {
  43897. null === p._cacheIndex && (++p.referenceCount,
  43898. this._addInactiveBinding(p, s, d));
  43899. continue
  43900. }
  43901. var f = t && t._propertyBindings[h].binding.parsedPath;
  43902. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43903. this._addInactiveBinding(p, s, d),
  43904. o[h] = p
  43905. }
  43906. a[h].resultBuffer = p.buffer
  43907. }
  43908. },
  43909. _activateAction: function(e) {
  43910. if (!this._isActiveAction(e)) {
  43911. if (null === e._cacheIndex) {
  43912. var t = (e._localRoot || this._root).uuid
  43913. , i = e._clip.name
  43914. , n = this._actionsByClip[i];
  43915. this._bindAction(e, n && n.knownActions[0]),
  43916. this._addInactiveAction(e, i, t)
  43917. }
  43918. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43919. var s = r[o];
  43920. 0 == s.useCount++ && (this._lendBinding(s),
  43921. s.saveOriginalState())
  43922. }
  43923. this._lendAction(e)
  43924. }
  43925. },
  43926. _deactivateAction: function(e) {
  43927. if (this._isActiveAction(e)) {
  43928. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43929. var r = t[i];
  43930. 0 == --r.useCount && (r.restoreOriginalState(),
  43931. this._takeBackBinding(r))
  43932. }
  43933. this._takeBackAction(e)
  43934. }
  43935. },
  43936. _initMemoryManager: function() {
  43937. this._actions = [],
  43938. this._nActiveActions = 0,
  43939. this._actionsByClip = {},
  43940. this._bindings = [],
  43941. this._nActiveBindings = 0,
  43942. this._bindingsByRootAndName = {},
  43943. this._controlInterpolants = [],
  43944. this._nActiveControlInterpolants = 0;
  43945. var e = this;
  43946. this.stats = {
  43947. actions: {
  43948. get total() {
  43949. return e._actions.length
  43950. },
  43951. get inUse() {
  43952. return e._nActiveActions
  43953. }
  43954. },
  43955. bindings: {
  43956. get total() {
  43957. return e._bindings.length
  43958. },
  43959. get inUse() {
  43960. return e._nActiveBindings
  43961. }
  43962. },
  43963. controlInterpolants: {
  43964. get total() {
  43965. return e._controlInterpolants.length
  43966. },
  43967. get inUse() {
  43968. return e._nActiveControlInterpolants
  43969. }
  43970. }
  43971. }
  43972. },
  43973. _isActiveAction: function(e) {
  43974. var t = e._cacheIndex;
  43975. return null !== t && t < this._nActiveActions
  43976. },
  43977. _addInactiveAction: function(e, t, i) {
  43978. var n = this._actions
  43979. , r = this._actionsByClip
  43980. , o = r[t];
  43981. if (void 0 === o)
  43982. o = {
  43983. knownActions: [e],
  43984. actionByRoot: {}
  43985. },
  43986. e._byClipCacheIndex = 0,
  43987. r[t] = o;
  43988. else {
  43989. var a = o.knownActions;
  43990. e._byClipCacheIndex = a.length,
  43991. a.push(e)
  43992. }
  43993. e._cacheIndex = n.length,
  43994. n.push(e),
  43995. o.actionByRoot[i] = e
  43996. },
  43997. _removeInactiveAction: function(e) {
  43998. var t = this._actions
  43999. , i = t[t.length - 1]
  44000. , n = e._cacheIndex;
  44001. t[i._cacheIndex = n] = i,
  44002. t.pop(),
  44003. e._cacheIndex = null;
  44004. var r = e._clip.name
  44005. , o = this._actionsByClip
  44006. , a = o[r]
  44007. , s = a.knownActions
  44008. , l = s[s.length - 1]
  44009. , c = e._byClipCacheIndex;
  44010. s[l._byClipCacheIndex = c] = l,
  44011. s.pop(),
  44012. e._byClipCacheIndex = null,
  44013. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  44014. 0 === s.length && delete o[r],
  44015. this._removeInactiveBindingsForAction(e)
  44016. },
  44017. _removeInactiveBindingsForAction: function(e) {
  44018. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  44019. var r = t[i];
  44020. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  44021. }
  44022. },
  44023. _lendAction: function(e) {
  44024. var t = this._actions
  44025. , i = e._cacheIndex
  44026. , n = this._nActiveActions++
  44027. , r = t[n];
  44028. t[e._cacheIndex = n] = e,
  44029. t[r._cacheIndex = i] = r
  44030. },
  44031. _takeBackAction: function(e) {
  44032. var t = this._actions
  44033. , i = e._cacheIndex
  44034. , n = --this._nActiveActions
  44035. , r = t[n];
  44036. t[e._cacheIndex = n] = e,
  44037. t[r._cacheIndex = i] = r
  44038. },
  44039. _addInactiveBinding: function(e, t, i) {
  44040. var n = this._bindingsByRootAndName
  44041. , r = n[t]
  44042. , o = this._bindings;
  44043. void 0 === r && (r = {},
  44044. n[t] = r),
  44045. (r[i] = e)._cacheIndex = o.length,
  44046. o.push(e)
  44047. },
  44048. _removeInactiveBinding: function(e) {
  44049. var t = this._bindings
  44050. , i = e.binding
  44051. , n = i.rootNode.uuid
  44052. , r = i.path
  44053. , o = this._bindingsByRootAndName
  44054. , a = o[n]
  44055. , s = t[t.length - 1]
  44056. , l = e._cacheIndex;
  44057. t[s._cacheIndex = l] = s,
  44058. t.pop(),
  44059. delete a[r];
  44060. e: {
  44061. for (var c in a)
  44062. break e;
  44063. delete o[n]
  44064. }
  44065. },
  44066. _lendBinding: function(e) {
  44067. var t = this._bindings
  44068. , i = e._cacheIndex
  44069. , n = this._nActiveBindings++
  44070. , r = t[n];
  44071. t[e._cacheIndex = n] = e,
  44072. t[r._cacheIndex = i] = r
  44073. },
  44074. _takeBackBinding: function(e) {
  44075. var t = this._bindings
  44076. , i = e._cacheIndex
  44077. , n = --this._nActiveBindings
  44078. , r = t[n];
  44079. t[e._cacheIndex = n] = e,
  44080. t[r._cacheIndex = i] = r
  44081. },
  44082. _lendControlInterpolant: function() {
  44083. var e = this._controlInterpolants
  44084. , t = this._nActiveControlInterpolants++
  44085. , i = e[t];
  44086. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  44087. i
  44088. },
  44089. _takeBackControlInterpolant: function(e) {
  44090. var t = this._controlInterpolants
  44091. , i = e.__cacheIndex
  44092. , n = --this._nActiveControlInterpolants
  44093. , r = t[n];
  44094. t[e.__cacheIndex = n] = e,
  44095. t[r.__cacheIndex = i] = r
  44096. },
  44097. _controlInterpolantsResultBuffer: new Float32Array(1)
  44098. }),
  44099. Ci.AnimationObjectGroup = function(e) {
  44100. this.uuid = Ci.Math.generateUUID(),
  44101. this._objects = Array.prototype.slice.call(arguments),
  44102. this.nCachedObjects_ = 0;
  44103. var t = {};
  44104. this._indicesByUUID = t;
  44105. for (var i = 0, n = arguments.length; i !== n; ++i)
  44106. t[arguments[i].uuid] = i;
  44107. this._paths = [],
  44108. this._parsedPaths = [],
  44109. this._bindings = [],
  44110. this._bindingsIndicesByPath = {};
  44111. var r = this;
  44112. this.stats = {
  44113. objects: {
  44114. get total() {
  44115. return r._objects.length
  44116. },
  44117. get inUse() {
  44118. return this.total - r.nCachedObjects_
  44119. }
  44120. },
  44121. get bindingsPerObject() {
  44122. return r._bindings.length
  44123. }
  44124. }
  44125. }
  44126. ,
  44127. Ci.AnimationObjectGroup.prototype = {
  44128. constructor: Ci.AnimationObjectGroup,
  44129. add: function(e) {
  44130. 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) {
  44131. var u = arguments[c]
  44132. , d = u.uuid
  44133. , p = r[d];
  44134. if (void 0 === p) {
  44135. p = i++,
  44136. r[d] = p,
  44137. t.push(u);
  44138. for (var f = 0, g = l; f !== g; ++f)
  44139. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  44140. } else if (p < n) {
  44141. var m = t[p]
  44142. , v = --n
  44143. , y = t[v];
  44144. t[r[y.uuid] = p] = y,
  44145. t[r[d] = v] = u;
  44146. for (f = 0,
  44147. g = l; f !== g; ++f) {
  44148. var A = s[f]
  44149. , C = A[v]
  44150. , I = A[p];
  44151. A[p] = C,
  44152. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  44153. A[v] = I
  44154. }
  44155. } else
  44156. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  44157. }
  44158. this.nCachedObjects_ = n
  44159. },
  44160. remove: function(e) {
  44161. for (var t = this._objects, i = (t.length,
  44162. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44163. var l = arguments[a]
  44164. , c = l.uuid
  44165. , h = n[c];
  44166. if (void 0 !== h && i <= h) {
  44167. var u = i++
  44168. , d = t[u];
  44169. t[n[d.uuid] = h] = d,
  44170. t[n[c] = u] = l;
  44171. for (var p = 0, f = o; p !== f; ++p) {
  44172. var g = r[p]
  44173. , m = g[u]
  44174. , v = g[h];
  44175. g[h] = m,
  44176. g[u] = v
  44177. }
  44178. }
  44179. }
  44180. this.nCachedObjects_ = i
  44181. },
  44182. uncache: function(e) {
  44183. 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) {
  44184. var c = arguments[s].uuid
  44185. , h = r[c];
  44186. if (void 0 !== h)
  44187. if (delete r[c],
  44188. h < n) {
  44189. var u = --n
  44190. , d = t[u]
  44191. , p = t[y = --i];
  44192. t[r[d.uuid] = h] = d,
  44193. t[r[p.uuid] = u] = p,
  44194. t.pop();
  44195. for (var f = 0, g = a; f !== g; ++f) {
  44196. var m = (A = o[f])[u]
  44197. , v = A[y];
  44198. A[h] = m,
  44199. A[u] = v,
  44200. A.pop()
  44201. }
  44202. } else {
  44203. var y;
  44204. t[r[(p = t[y = --i]).uuid] = h] = p,
  44205. t.pop();
  44206. for (f = 0,
  44207. g = a; f !== g; ++f) {
  44208. var A;
  44209. (A = o[f])[h] = A[y],
  44210. A.pop()
  44211. }
  44212. }
  44213. }
  44214. this.nCachedObjects_ = n
  44215. },
  44216. subscribe_: function(e, t) {
  44217. var i = this._bindingsIndicesByPath
  44218. , n = i[e]
  44219. , r = this._bindings;
  44220. if (void 0 !== n)
  44221. return r[n];
  44222. var o = this._paths
  44223. , a = this._parsedPaths
  44224. , s = this._objects
  44225. , l = s.length
  44226. , c = this.nCachedObjects_
  44227. , h = new Array(l);
  44228. n = r.length,
  44229. i[e] = n,
  44230. o.push(e),
  44231. a.push(t),
  44232. r.push(h);
  44233. for (var u = c, d = s.length; u !== d; ++u) {
  44234. var p = s[u];
  44235. h[u] = new Ci.PropertyBinding(p,e,t)
  44236. }
  44237. return h
  44238. },
  44239. unsubscribe_: function(e) {
  44240. var t = this._bindingsIndicesByPath
  44241. , i = t[e];
  44242. if (void 0 !== i) {
  44243. var n = this._paths
  44244. , r = this._parsedPaths
  44245. , o = this._bindings
  44246. , a = o.length - 1
  44247. , s = o[a];
  44248. o[t[e[a]] = i] = s,
  44249. o.pop(),
  44250. r[i] = r[a],
  44251. r.pop(),
  44252. n[i] = n[a],
  44253. n.pop()
  44254. }
  44255. }
  44256. },
  44257. Ci.AnimationUtils = {
  44258. arraySlice: function(e, t, i) {
  44259. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44260. },
  44261. convertArray: function(e, t, i) {
  44262. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44263. },
  44264. isTypedArray: function(e) {
  44265. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44266. },
  44267. getKeyframeOrder: function(i) {
  44268. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  44269. t[n] = n;
  44270. return t.sort(function(e, t) {
  44271. return i[e] - i[t]
  44272. }),
  44273. t
  44274. },
  44275. sortedArray: function(e, t, i) {
  44276. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44277. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44278. r[a++] = e[s + l];
  44279. return r
  44280. },
  44281. flattenJSON: function(e, t, i, n) {
  44282. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44283. o = e[r++];
  44284. if (void 0 !== o) {
  44285. var a = o[n];
  44286. if (void 0 !== a)
  44287. if (Array.isArray(a))
  44288. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44289. i.push.apply(i, a)),
  44290. void 0 !== (o = e[r++]); )
  44291. ;
  44292. else if (void 0 !== a.toArray)
  44293. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44294. a.toArray(i, i.length)),
  44295. void 0 !== (o = e[r++]); )
  44296. ;
  44297. else
  44298. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  44299. i.push(a)),
  44300. void 0 !== (o = e[r++]); )
  44301. ;
  44302. }
  44303. }
  44304. },
  44305. Ci.KeyframeTrack = function(e, t, i, n) {
  44306. if (void 0 === e)
  44307. throw new Error("track name is undefined");
  44308. if (void 0 === t || 0 === t.length)
  44309. throw new Error("no keyframes in track named " + e);
  44310. this.name = e,
  44311. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  44312. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  44313. this.setInterpolation(n || this.DefaultInterpolation),
  44314. this.validate(),
  44315. this.optimize()
  44316. }
  44317. ,
  44318. Ci.KeyframeTrack.prototype = {
  44319. constructor: Ci.KeyframeTrack,
  44320. TimeBufferType: Float32Array,
  44321. ValueBufferType: Float32Array,
  44322. DefaultInterpolation: Ci.InterpolateLinear,
  44323. InterpolantFactoryMethodDiscrete: function(e) {
  44324. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44325. },
  44326. InterpolantFactoryMethodLinear: function(e) {
  44327. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44328. },
  44329. InterpolantFactoryMethodSmooth: function(e) {
  44330. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44331. },
  44332. setInterpolation: function(e) {
  44333. var t = void 0;
  44334. switch (e) {
  44335. case Ci.InterpolateDiscrete:
  44336. t = this.InterpolantFactoryMethodDiscrete;
  44337. break;
  44338. case Ci.InterpolateLinear:
  44339. t = this.InterpolantFactoryMethodLinear;
  44340. break;
  44341. case Ci.InterpolateSmooth:
  44342. t = this.InterpolantFactoryMethodSmooth
  44343. }
  44344. if (void 0 !== t)
  44345. this.createInterpolant = t;
  44346. else {
  44347. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44348. if (void 0 === this.createInterpolant) {
  44349. if (e === this.DefaultInterpolation)
  44350. throw new Error(i);
  44351. this.setInterpolation(this.DefaultInterpolation)
  44352. }
  44353. console.warn(i)
  44354. }
  44355. },
  44356. getInterpolation: function() {
  44357. switch (this.createInterpolant) {
  44358. case this.InterpolantFactoryMethodDiscrete:
  44359. return Ci.InterpolateDiscrete;
  44360. case this.InterpolantFactoryMethodLinear:
  44361. return Ci.InterpolateLinear;
  44362. case this.InterpolantFactoryMethodSmooth:
  44363. return Ci.InterpolateSmooth
  44364. }
  44365. },
  44366. getValueSize: function() {
  44367. return this.values.length / this.times.length
  44368. },
  44369. shift: function(e) {
  44370. if (0 !== e)
  44371. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44372. t[i] += e;
  44373. return this
  44374. },
  44375. scale: function(e) {
  44376. if (1 !== e)
  44377. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44378. t[i] *= e;
  44379. return this
  44380. },
  44381. trim: function(e, t) {
  44382. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  44383. ++r;
  44384. for (; -1 !== o && i[o] > t; )
  44385. --o;
  44386. if (++o,
  44387. 0 !== r || o !== n) {
  44388. o <= r && (r = (o = Math.max(o, 1)) - 1);
  44389. var a = this.getValueSize();
  44390. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  44391. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  44392. }
  44393. return this
  44394. },
  44395. validate: function() {
  44396. var e = !0
  44397. , t = this.getValueSize();
  44398. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  44399. e = !1);
  44400. var i = this.times
  44401. , n = this.values
  44402. , r = i.length;
  44403. 0 === r && (console.error("track is empty", this),
  44404. e = !1);
  44405. for (var o = null, a = 0; a !== r; a++) {
  44406. var s = i[a];
  44407. if ("number" == typeof s && isNaN(s)) {
  44408. console.error("time is not a valid number", this, a, s),
  44409. e = !1;
  44410. break
  44411. }
  44412. if (null !== o && s < o) {
  44413. console.error("out of order keys", this, a, s, o),
  44414. e = !1;
  44415. break
  44416. }
  44417. o = s
  44418. }
  44419. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  44420. a = 0;
  44421. for (var l = n.length; a !== l; ++a) {
  44422. var c = n[a];
  44423. if (isNaN(c)) {
  44424. console.error("value is not a valid number", this, a, c),
  44425. e = !1;
  44426. break
  44427. }
  44428. }
  44429. }
  44430. return e
  44431. },
  44432. optimize: function() {
  44433. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  44434. var a = !1
  44435. , s = e[r];
  44436. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  44437. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  44438. var d = t[l + u];
  44439. if (d !== t[c + u] || d !== t[h + u]) {
  44440. a = !0;
  44441. break
  44442. }
  44443. }
  44444. if (a) {
  44445. if (r !== n) {
  44446. e[n] = e[r];
  44447. var p = r * i
  44448. , f = n * i;
  44449. for (u = 0; u !== i; ++u)
  44450. t[f + u] = t[p + u]
  44451. }
  44452. ++n
  44453. }
  44454. }
  44455. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  44456. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  44457. this
  44458. }
  44459. },
  44460. Object.assign(Ci.KeyframeTrack, {
  44461. parse: function(e) {
  44462. if (void 0 === e.type)
  44463. throw new Error("track type undefined, can not parse");
  44464. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44465. if (void 0 === e.times) {
  44466. console.warn("legacy JSON format detected, converting");
  44467. var i = []
  44468. , n = [];
  44469. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  44470. e.times = i,
  44471. e.values = n
  44472. }
  44473. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44474. },
  44475. toJSON: function(e) {
  44476. var t, i = e.constructor;
  44477. if (void 0 !== i.toJSON)
  44478. t = i.toJSON(e);
  44479. else {
  44480. t = {
  44481. name: e.name,
  44482. times: Ci.AnimationUtils.convertArray(e.times, Array),
  44483. values: Ci.AnimationUtils.convertArray(e.values, Array)
  44484. };
  44485. var n = e.getInterpolation();
  44486. n !== e.DefaultInterpolation && (t.interpolation = n)
  44487. }
  44488. return t.type = e.ValueTypeName,
  44489. t
  44490. },
  44491. _getTrackTypeForValueTypeName: function(e) {
  44492. switch (e.toLowerCase()) {
  44493. case "scalar":
  44494. case "double":
  44495. case "float":
  44496. case "number":
  44497. case "integer":
  44498. return Ci.NumberKeyframeTrack;
  44499. case "vector":
  44500. case "vector2":
  44501. case "vector3":
  44502. case "vector4":
  44503. return Ci.VectorKeyframeTrack;
  44504. case "color":
  44505. return Ci.ColorKeyframeTrack;
  44506. case "quaternion":
  44507. return Ci.QuaternionKeyframeTrack;
  44508. case "bool":
  44509. case "boolean":
  44510. return Ci.BooleanKeyframeTrack;
  44511. case "string":
  44512. return Ci.StringKeyframeTrack
  44513. }
  44514. throw new Error("Unsupported typeName: " + e)
  44515. }
  44516. }),
  44517. Ci.PropertyBinding = function(e, t, i) {
  44518. this.path = t,
  44519. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44520. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44521. this.rootNode = e
  44522. }
  44523. ,
  44524. Ci.PropertyBinding.prototype = {
  44525. constructor: Ci.PropertyBinding,
  44526. getValue: function(e, t) {
  44527. this.bind(),
  44528. this.getValue(e, t)
  44529. },
  44530. setValue: function(e, t) {
  44531. this.bind(),
  44532. this.setValue(e, t)
  44533. },
  44534. bind: function() {
  44535. var e = this.node
  44536. , t = this.parsedPath
  44537. , i = t.objectName
  44538. , n = t.propertyName
  44539. , r = t.propertyIndex;
  44540. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44541. this.node = e),
  44542. this.getValue = this._getValue_unavailable,
  44543. this.setValue = this._setValue_unavailable,
  44544. e) {
  44545. if (i) {
  44546. var o = t.objectIndex;
  44547. switch (i) {
  44548. case "materials":
  44549. if (!e.material)
  44550. return void console.error(" can not bind to material as node does not have a material", this);
  44551. if (!e.material.materials)
  44552. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44553. e = e.material.materials;
  44554. break;
  44555. case "bones":
  44556. if (!e.skeleton)
  44557. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44558. e = e.skeleton.bones;
  44559. for (var a = 0; a < e.length; a++)
  44560. if (e[a].name === o) {
  44561. o = a;
  44562. break
  44563. }
  44564. break;
  44565. default:
  44566. if (void 0 === e[i])
  44567. return void console.error(" can not bind to objectName of node, undefined", this);
  44568. e = e[i]
  44569. }
  44570. if (void 0 !== o) {
  44571. if (void 0 === e[o])
  44572. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44573. e = e[o]
  44574. }
  44575. }
  44576. var s = e[n];
  44577. if (s) {
  44578. var l = this.Versioning.None;
  44579. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44580. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44581. this.targetObject = e);
  44582. var c = this.BindingType.Direct;
  44583. if (void 0 !== r) {
  44584. if ("morphTargetInfluences" === n) {
  44585. if (!e.geometry)
  44586. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44587. if (!e.geometry.morphTargets)
  44588. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44589. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44590. if (e.geometry.morphTargets[a].name === r) {
  44591. r = a;
  44592. break
  44593. }
  44594. }
  44595. c = this.BindingType.ArrayElement,
  44596. this.resolvedProperty = s,
  44597. this.propertyIndex = r
  44598. } else
  44599. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44600. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44601. this.resolvedProperty = s) : this.propertyName = n;
  44602. this.getValue = this.GetterByBindingType[c],
  44603. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44604. } else {
  44605. var h = t.nodeName;
  44606. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44607. }
  44608. } else
  44609. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44610. },
  44611. unbind: function() {
  44612. this.node = null,
  44613. this.getValue = this._getValue_unbound,
  44614. this.setValue = this._setValue_unbound
  44615. }
  44616. },
  44617. Object.assign(Ci.PropertyBinding.prototype, {
  44618. _getValue_unavailable: function() {},
  44619. _setValue_unavailable: function() {},
  44620. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44621. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44622. BindingType: {
  44623. Direct: 0,
  44624. EntireArray: 1,
  44625. ArrayElement: 2,
  44626. HasFromToArray: 3
  44627. },
  44628. Versioning: {
  44629. None: 0,
  44630. NeedsUpdate: 1,
  44631. MatrixWorldNeedsUpdate: 2
  44632. },
  44633. GetterByBindingType: [function(e, t) {
  44634. e[t] = this.node[this.propertyName]
  44635. }
  44636. , function(e, t) {
  44637. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44638. e[t++] = i[n]
  44639. }
  44640. , function(e, t) {
  44641. e[t] = this.resolvedProperty[this.propertyIndex]
  44642. }
  44643. , function(e, t) {
  44644. this.resolvedProperty.toArray(e, t)
  44645. }
  44646. ],
  44647. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44648. this.node[this.propertyName] = e[t]
  44649. }
  44650. , function(e, t) {
  44651. this.node[this.propertyName] = e[t],
  44652. this.targetObject.needsUpdate = !0
  44653. }
  44654. , function(e, t) {
  44655. this.node[this.propertyName] = e[t],
  44656. this.targetObject.matrixWorldNeedsUpdate = !0
  44657. }
  44658. ], [function(e, t) {
  44659. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44660. i[n] = e[t++]
  44661. }
  44662. , function(e, t) {
  44663. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44664. i[n] = e[t++];
  44665. this.targetObject.needsUpdate = !0
  44666. }
  44667. , function(e, t) {
  44668. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44669. i[n] = e[t++];
  44670. this.targetObject.matrixWorldNeedsUpdate = !0
  44671. }
  44672. ], [function(e, t) {
  44673. this.resolvedProperty[this.propertyIndex] = e[t]
  44674. }
  44675. , function(e, t) {
  44676. this.resolvedProperty[this.propertyIndex] = e[t],
  44677. this.targetObject.needsUpdate = !0
  44678. }
  44679. , function(e, t) {
  44680. this.resolvedProperty[this.propertyIndex] = e[t],
  44681. this.targetObject.matrixWorldNeedsUpdate = !0
  44682. }
  44683. ], [function(e, t) {
  44684. this.resolvedProperty.fromArray(e, t)
  44685. }
  44686. , function(e, t) {
  44687. this.resolvedProperty.fromArray(e, t),
  44688. this.targetObject.needsUpdate = !0
  44689. }
  44690. , function(e, t) {
  44691. this.resolvedProperty.fromArray(e, t),
  44692. this.targetObject.matrixWorldNeedsUpdate = !0
  44693. }
  44694. ]]
  44695. }),
  44696. Ci.PropertyBinding.Composite = function(e, t, i) {
  44697. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44698. this._targetGroup = e,
  44699. this._bindings = e.subscribe_(t, n)
  44700. }
  44701. ,
  44702. Ci.PropertyBinding.Composite.prototype = {
  44703. constructor: Ci.PropertyBinding.Composite,
  44704. getValue: function(e, t) {
  44705. this.bind();
  44706. var i = this._targetGroup.nCachedObjects_
  44707. , n = this._bindings[i];
  44708. void 0 !== n && n.getValue(e, t)
  44709. },
  44710. setValue: function(e, t) {
  44711. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44712. i[n].setValue(e, t)
  44713. },
  44714. bind: function() {
  44715. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44716. e[t].bind()
  44717. },
  44718. unbind: function() {
  44719. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44720. e[t].unbind()
  44721. }
  44722. },
  44723. Ci.PropertyBinding.create = function(e, t, i) {
  44724. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44725. }
  44726. ,
  44727. Ci.PropertyBinding.parseTrackName = function(e) {
  44728. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44729. , i = t.exec(e);
  44730. if (!i)
  44731. throw new Error("cannot parse trackName at all: " + e);
  44732. i.index === t.lastIndex && t.lastIndex++;
  44733. var n = {
  44734. nodeName: i[3],
  44735. objectName: i[5],
  44736. objectIndex: i[7],
  44737. propertyName: i[9],
  44738. propertyIndex: i[11]
  44739. };
  44740. if (null === n.propertyName || 0 === n.propertyName.length)
  44741. throw new Error("can not parse propertyName from trackName: " + e);
  44742. return n
  44743. }
  44744. ,
  44745. Ci.PropertyBinding.findNode = function(e, r) {
  44746. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44747. return e;
  44748. if (e.skeleton) {
  44749. var t = function(e) {
  44750. for (var t = 0; t < e.bones.length; t++) {
  44751. var i = e.bones[t];
  44752. if (i.name === r)
  44753. return i
  44754. }
  44755. return null
  44756. }(e.skeleton);
  44757. if (t)
  44758. return t
  44759. }
  44760. if (e.children) {
  44761. var o = function(e) {
  44762. for (var t = 0; t < e.length; t++) {
  44763. var i = e[t];
  44764. if (i.name === r || i.uuid === r)
  44765. return i;
  44766. var n = o(i.children);
  44767. if (n)
  44768. return n
  44769. }
  44770. return null
  44771. }
  44772. , i = o(e.children);
  44773. if (i)
  44774. return i
  44775. }
  44776. return null
  44777. }
  44778. ,
  44779. Ci.PropertyMixer = function(e, t, i) {
  44780. this.binding = e,
  44781. this.valueSize = i;
  44782. var n, r = Float64Array;
  44783. switch (t) {
  44784. case "quaternion":
  44785. n = this._slerp;
  44786. break;
  44787. case "string":
  44788. case "bool":
  44789. r = Array,
  44790. n = this._select;
  44791. break;
  44792. default:
  44793. n = this._lerp
  44794. }
  44795. this.buffer = new r(4 * i),
  44796. this._mixBufferRegion = n,
  44797. this.cumulativeWeight = 0,
  44798. this.useCount = 0,
  44799. this.referenceCount = 0
  44800. }
  44801. ,
  44802. Ci.PropertyMixer.prototype = {
  44803. constructor: Ci.PropertyMixer,
  44804. accumulate: function(e, t) {
  44805. var i = this.buffer
  44806. , n = this.valueSize
  44807. , r = e * n + n
  44808. , o = this.cumulativeWeight;
  44809. if (0 === o) {
  44810. for (var a = 0; a !== n; ++a)
  44811. i[r + a] = i[a];
  44812. o = t
  44813. } else {
  44814. var s = t / (o += t);
  44815. this._mixBufferRegion(i, r, 0, s, n)
  44816. }
  44817. this.cumulativeWeight = o
  44818. },
  44819. apply: function(e) {
  44820. var t = this.valueSize
  44821. , i = this.buffer
  44822. , n = e * t + t
  44823. , r = this.cumulativeWeight
  44824. , o = this.binding;
  44825. if (this.cumulativeWeight = 0,
  44826. r < 1) {
  44827. var a = 3 * t;
  44828. this._mixBufferRegion(i, n, a, 1 - r, t)
  44829. }
  44830. for (var s = t, l = t + t; s !== l; ++s)
  44831. if (i[s] !== i[s + t]) {
  44832. o.setValue(i, n);
  44833. break
  44834. }
  44835. },
  44836. saveOriginalState: function() {
  44837. var e = this.binding
  44838. , t = this.buffer
  44839. , i = this.valueSize
  44840. , n = 3 * i;
  44841. e.getValue(t, n);
  44842. for (var r = i, o = n; r !== o; ++r)
  44843. t[r] = t[n + r % i];
  44844. this.cumulativeWeight = 0
  44845. },
  44846. restoreOriginalState: function() {
  44847. var e = 3 * this.valueSize;
  44848. this.binding.setValue(this.buffer, e)
  44849. },
  44850. _select: function(e, t, i, n, r) {
  44851. if (.5 <= n)
  44852. for (var o = 0; o !== r; ++o)
  44853. e[t + o] = e[i + o]
  44854. },
  44855. _slerp: function(e, t, i, n, r) {
  44856. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44857. },
  44858. _lerp: function(e, t, i, n, r) {
  44859. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44860. var s = t + a;
  44861. e[s] = e[s] * o + e[i + a] * n
  44862. }
  44863. }
  44864. },
  44865. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44866. Ci.KeyframeTrack.call(this, e, t, i)
  44867. }
  44868. ,
  44869. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44870. constructor: Ci.BooleanKeyframeTrack,
  44871. ValueTypeName: "bool",
  44872. ValueBufferType: Array,
  44873. DefaultInterpolation: Ci.IntepolateDiscrete,
  44874. InterpolantFactoryMethodLinear: void 0,
  44875. InterpolantFactoryMethodSmooth: void 0
  44876. }),
  44877. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44878. Ci.KeyframeTrack.call(this, e, t, i, n)
  44879. }
  44880. ,
  44881. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44882. constructor: Ci.NumberKeyframeTrack,
  44883. ValueTypeName: "number"
  44884. }),
  44885. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44886. Ci.KeyframeTrack.call(this, e, t, i, n)
  44887. }
  44888. ,
  44889. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44890. constructor: Ci.QuaternionKeyframeTrack,
  44891. ValueTypeName: "quaternion",
  44892. DefaultInterpolation: Ci.InterpolateLinear,
  44893. InterpolantFactoryMethodLinear: function(e) {
  44894. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44895. },
  44896. InterpolantFactoryMethodSmooth: void 0
  44897. }),
  44898. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44899. Ci.KeyframeTrack.call(this, e, t, i, n)
  44900. }
  44901. ,
  44902. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44903. constructor: Ci.StringKeyframeTrack,
  44904. ValueTypeName: "string",
  44905. ValueBufferType: Array,
  44906. DefaultInterpolation: Ci.IntepolateDiscrete,
  44907. InterpolantFactoryMethodLinear: void 0,
  44908. InterpolantFactoryMethodSmooth: void 0
  44909. }),
  44910. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44911. Ci.KeyframeTrack.call(this, e, t, i, n)
  44912. }
  44913. ,
  44914. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44915. constructor: Ci.VectorKeyframeTrack,
  44916. ValueTypeName: "vector"
  44917. }),
  44918. Ci.Audio = function(e) {
  44919. Ci.Object3D.call(this),
  44920. this.type = "Audio",
  44921. this.context = e.context,
  44922. this.source = this.context.createBufferSource(),
  44923. this.source.onended = this.onEnded.bind(this),
  44924. this.gain = this.context.createGain(),
  44925. this.gain.connect(e.getInput()),
  44926. this.autoplay = !1,
  44927. this.startTime = 0,
  44928. this.playbackRate = 1,
  44929. this.isPlaying = !1,
  44930. this.hasPlaybackControl = !0,
  44931. this.sourceType = "empty",
  44932. this.filter = null
  44933. }
  44934. ,
  44935. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44936. Ci.Audio.prototype.constructor = Ci.Audio,
  44937. Ci.Audio.prototype.getOutput = function() {
  44938. return this.gain
  44939. }
  44940. ,
  44941. Ci.Audio.prototype.load = function(e) {
  44942. var t = new Ci.AudioBuffer(this.context);
  44943. return t.load(e),
  44944. this.setBuffer(t),
  44945. this
  44946. }
  44947. ,
  44948. Ci.Audio.prototype.setNodeSource = function(e) {
  44949. return this.hasPlaybackControl = !1,
  44950. this.sourceType = "audioNode",
  44951. this.source = e,
  44952. this.connect(),
  44953. this
  44954. }
  44955. ,
  44956. Ci.Audio.prototype.setBuffer = function(e) {
  44957. var t = this;
  44958. return e.onReady(function(e) {
  44959. t.source.buffer = e,
  44960. t.sourceType = "buffer",
  44961. t.autoplay && t.play()
  44962. }),
  44963. this
  44964. }
  44965. ,
  44966. Ci.Audio.prototype.play = function() {
  44967. if (!0 !== this.isPlaying)
  44968. if (!1 !== this.hasPlaybackControl) {
  44969. var e = this.context.createBufferSource();
  44970. e.buffer = this.source.buffer,
  44971. e.loop = this.source.loop,
  44972. e.onended = this.source.onended,
  44973. e.start(0, this.startTime),
  44974. e.playbackRate.value = this.playbackRate,
  44975. this.isPlaying = !0,
  44976. this.source = e,
  44977. this.connect()
  44978. } else
  44979. console.warn("THREE.Audio: this Audio has no playback control.");
  44980. else
  44981. console.warn("THREE.Audio: Audio is already playing.")
  44982. }
  44983. ,
  44984. Ci.Audio.prototype.pause = function() {
  44985. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44986. void (this.startTime = this.context.currentTime))
  44987. }
  44988. ,
  44989. Ci.Audio.prototype.stop = function() {
  44990. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44991. void (this.startTime = 0))
  44992. }
  44993. ,
  44994. Ci.Audio.prototype.connect = function() {
  44995. null !== this.filter ? (this.source.connect(this.filter),
  44996. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44997. }
  44998. ,
  44999. Ci.Audio.prototype.disconnect = function() {
  45000. null !== this.filter ? (this.source.disconnect(this.filter),
  45001. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  45002. }
  45003. ,
  45004. Ci.Audio.prototype.getFilter = function() {
  45005. return this.filter
  45006. }
  45007. ,
  45008. Ci.Audio.prototype.setFilter = function(e) {
  45009. void 0 === e && (e = null),
  45010. !0 === this.isPlaying ? (this.disconnect(),
  45011. this.filter = e,
  45012. this.connect()) : this.filter = e
  45013. }
  45014. ,
  45015. Ci.Audio.prototype.setPlaybackRate = function(e) {
  45016. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  45017. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  45018. }
  45019. ,
  45020. Ci.Audio.prototype.getPlaybackRate = function() {
  45021. return this.playbackRate
  45022. }
  45023. ,
  45024. Ci.Audio.prototype.onEnded = function() {
  45025. this.isPlaying = !1
  45026. }
  45027. ,
  45028. Ci.Audio.prototype.setLoop = function(e) {
  45029. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  45030. }
  45031. ,
  45032. Ci.Audio.prototype.getLoop = function() {
  45033. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  45034. !1) : this.source.loop
  45035. }
  45036. ,
  45037. Ci.Audio.prototype.setVolume = function(e) {
  45038. this.gain.gain.value = e
  45039. }
  45040. ,
  45041. Ci.Audio.prototype.getVolume = function() {
  45042. return this.gain.gain.value
  45043. }
  45044. ,
  45045. Ci.AudioAnalyser = function(e, t) {
  45046. this.analyser = e.context.createAnalyser(),
  45047. this.analyser.fftSize = void 0 !== t ? t : 2048,
  45048. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  45049. e.getOutput().connect(this.analyser)
  45050. }
  45051. ,
  45052. Ci.AudioAnalyser.prototype = {
  45053. constructor: Ci.AudioAnalyser,
  45054. getData: function() {
  45055. return this.analyser.getByteFrequencyData(this.data),
  45056. this.data
  45057. }
  45058. },
  45059. Ci.AudioBuffer = function(e) {
  45060. this.context = e,
  45061. this.ready = !1,
  45062. this.readyCallbacks = []
  45063. }
  45064. ,
  45065. Ci.AudioBuffer.prototype.load = function(e) {
  45066. var i = this
  45067. , t = new XMLHttpRequest;
  45068. return t.open("GET", e, !0),
  45069. t.responseType = "arraybuffer",
  45070. t.onload = function(e) {
  45071. i.context.decodeAudioData(this.response, function(e) {
  45072. i.buffer = e,
  45073. i.ready = !0;
  45074. for (var t = 0; t < i.readyCallbacks.length; t++)
  45075. i.readyCallbacks[t](i.buffer);
  45076. i.readyCallbacks = []
  45077. })
  45078. }
  45079. ,
  45080. t.send(),
  45081. this
  45082. }
  45083. ,
  45084. Ci.AudioBuffer.prototype.onReady = function(e) {
  45085. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  45086. }
  45087. ,
  45088. Ci.PositionalAudio = function(e) {
  45089. Ci.Audio.call(this, e),
  45090. this.panner = this.context.createPanner(),
  45091. this.panner.connect(this.gain)
  45092. }
  45093. ,
  45094. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  45095. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  45096. Ci.PositionalAudio.prototype.getOutput = function() {
  45097. return this.panner
  45098. }
  45099. ,
  45100. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  45101. this.panner.refDistance = e
  45102. }
  45103. ,
  45104. Ci.PositionalAudio.prototype.getRefDistance = function() {
  45105. return this.panner.refDistance
  45106. }
  45107. ,
  45108. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  45109. this.panner.rolloffFactor = e
  45110. }
  45111. ,
  45112. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  45113. return this.panner.rolloffFactor
  45114. }
  45115. ,
  45116. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  45117. this.panner.distanceModel = e
  45118. }
  45119. ,
  45120. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  45121. return this.panner.distanceModel
  45122. }
  45123. ,
  45124. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  45125. this.panner.maxDistance = e
  45126. }
  45127. ,
  45128. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  45129. return this.panner.maxDistance
  45130. }
  45131. ,
  45132. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  45133. function(e) {
  45134. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  45135. it.setFromMatrixPosition(this.matrixWorld),
  45136. this.panner.setPosition(it.x, it.y, it.z)
  45137. }
  45138. ),
  45139. Ci.AudioListener = function() {
  45140. Ci.Object3D.call(this),
  45141. this.type = "AudioListener",
  45142. this.context = new (window.AudioContext || window.webkitAudioContext),
  45143. this.gain = this.context.createGain(),
  45144. this.gain.connect(this.context.destination),
  45145. this.filter = null
  45146. }
  45147. ,
  45148. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  45149. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  45150. Ci.AudioListener.prototype.getInput = function() {
  45151. return this.gain
  45152. }
  45153. ,
  45154. Ci.AudioListener.prototype.removeFilter = function() {
  45155. null !== this.filter && (this.gain.disconnect(this.filter),
  45156. this.filter.disconnect(this.context.destination),
  45157. this.gain.connect(this.context.destination),
  45158. this.filter = null)
  45159. }
  45160. ,
  45161. Ci.AudioListener.prototype.setFilter = function(e) {
  45162. null !== this.filter ? (this.gain.disconnect(this.filter),
  45163. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45164. this.filter = e,
  45165. this.gain.connect(this.filter),
  45166. this.filter.connect(this.context.destination)
  45167. }
  45168. ,
  45169. Ci.AudioListener.prototype.getFilter = function() {
  45170. return this.filter
  45171. }
  45172. ,
  45173. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  45174. this.gain.gain.value = e
  45175. }
  45176. ,
  45177. Ci.AudioListener.prototype.getMasterVolume = function() {
  45178. return this.gain.gain.value
  45179. }
  45180. ,
  45181. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  45182. $e = new Ci.Quaternion,
  45183. et = new Ci.Vector3,
  45184. tt = new Ci.Vector3,
  45185. function(e) {
  45186. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  45187. var t = this.context.listener
  45188. , i = this.up;
  45189. this.matrixWorld.decompose(Je, $e, et),
  45190. tt.set(0, 0, -1).applyQuaternion($e),
  45191. t.setPosition(Je.x, Je.y, Je.z),
  45192. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  45193. }
  45194. ),
  45195. Ci.Camera = function() {
  45196. Ci.Object3D.call(this),
  45197. this.type = "Camera",
  45198. this.matrixWorldInverse = new Ci.Matrix4,
  45199. this.projectionMatrix = new Ci.Matrix4
  45200. }
  45201. ,
  45202. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  45203. Ci.Camera.prototype.constructor = Ci.Camera,
  45204. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  45205. function(e) {
  45206. var t = e || new Ci.Vector3;
  45207. return this.getWorldQuaternion(Qe),
  45208. t.set(0, 0, -1).applyQuaternion(Qe)
  45209. }
  45210. ),
  45211. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  45212. function(e) {
  45213. Ke.lookAt(this.position, e, this.up),
  45214. this.quaternion.setFromRotationMatrix(Ke)
  45215. }
  45216. ),
  45217. Ci.Camera.prototype.clone = function() {
  45218. return (new this.constructor).copy(this)
  45219. }
  45220. ,
  45221. Ci.Camera.prototype.copy = function(e) {
  45222. return Ci.Object3D.prototype.copy.call(this, e),
  45223. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45224. this.projectionMatrix.copy(e.projectionMatrix),
  45225. this
  45226. }
  45227. ,
  45228. Ci.CubeCamera = function(e, t, i) {
  45229. Ci.Object3D.call(this),
  45230. this.type = "CubeCamera";
  45231. var r = new Ci.PerspectiveCamera(90,1,e,t);
  45232. r.up.set(0, -1, 0),
  45233. r.lookAt(new Ci.Vector3(1,0,0)),
  45234. this.add(r);
  45235. var o = new Ci.PerspectiveCamera(90,1,e,t);
  45236. o.up.set(0, -1, 0),
  45237. o.lookAt(new Ci.Vector3(-1,0,0)),
  45238. this.add(o);
  45239. var a = new Ci.PerspectiveCamera(90,1,e,t);
  45240. a.up.set(0, 0, 1),
  45241. a.lookAt(new Ci.Vector3(0,1,0)),
  45242. this.add(a);
  45243. var s = new Ci.PerspectiveCamera(90,1,e,t);
  45244. s.up.set(0, 0, -1),
  45245. s.lookAt(new Ci.Vector3(0,-1,0)),
  45246. this.add(s);
  45247. var l = new Ci.PerspectiveCamera(90,1,e,t);
  45248. l.up.set(0, -1, 0),
  45249. l.lookAt(new Ci.Vector3(0,0,1)),
  45250. this.add(l);
  45251. var c = new Ci.PerspectiveCamera(90,1,e,t);
  45252. c.up.set(0, -1, 0),
  45253. c.lookAt(new Ci.Vector3(0,0,-1)),
  45254. this.add(c);
  45255. var n = {
  45256. format: Ci.RGBFormat,
  45257. magFilter: Ci.LinearFilter,
  45258. minFilter: Ci.LinearFilter
  45259. };
  45260. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  45261. this.updateCubeMap = function(e, t) {
  45262. null === this.parent && this.updateMatrixWorld();
  45263. var i = this.renderTarget
  45264. , n = i.texture.generateMipmaps;
  45265. i.texture.generateMipmaps = !1,
  45266. i.activeCubeFace = 0,
  45267. e.render(t, r, i),
  45268. i.activeCubeFace = 1,
  45269. e.render(t, o, i),
  45270. i.activeCubeFace = 2,
  45271. e.render(t, a, i),
  45272. i.activeCubeFace = 3,
  45273. e.render(t, s, i),
  45274. i.activeCubeFace = 4,
  45275. e.render(t, l, i),
  45276. i.texture.generateMipmaps = n,
  45277. i.activeCubeFace = 5,
  45278. e.render(t, c, i),
  45279. e.setRenderTarget(null)
  45280. }
  45281. }
  45282. ,
  45283. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  45284. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  45285. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  45286. Ci.Camera.call(this),
  45287. this.type = "OrthographicCamera",
  45288. this.zoom = 1,
  45289. this.left = e,
  45290. this.right = t,
  45291. this.top = i,
  45292. this.bottom = n,
  45293. this.near = void 0 !== r ? r : .1,
  45294. this.far = void 0 !== o ? o : 2e3,
  45295. this.updateProjectionMatrix()
  45296. }
  45297. ,
  45298. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  45299. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  45300. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45301. var e = (this.right - this.left) / (2 * this.zoom)
  45302. , t = (this.top - this.bottom) / (2 * this.zoom)
  45303. , i = (this.right + this.left) / 2
  45304. , n = (this.top + this.bottom) / 2;
  45305. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45306. }
  45307. ,
  45308. Ci.OrthographicCamera.prototype.copy = function(e) {
  45309. return Ci.Camera.prototype.copy.call(this, e),
  45310. this.left = e.left,
  45311. this.right = e.right,
  45312. this.top = e.top,
  45313. this.bottom = e.bottom,
  45314. this.near = e.near,
  45315. this.far = e.far,
  45316. this.zoom = e.zoom,
  45317. this
  45318. }
  45319. ,
  45320. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  45321. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45322. return t.object.zoom = this.zoom,
  45323. t.object.left = this.left,
  45324. t.object.right = this.right,
  45325. t.object.top = this.top,
  45326. t.object.bottom = this.bottom,
  45327. t.object.near = this.near,
  45328. t.object.far = this.far,
  45329. t
  45330. }
  45331. ,
  45332. Ci.PerspectiveCamera = function(e, t, i, n) {
  45333. Ci.Camera.call(this),
  45334. this.type = "PerspectiveCamera",
  45335. this.focalLength = 10,
  45336. this.zoom = 1,
  45337. this.fov = void 0 !== e ? e : 50,
  45338. this.aspect = void 0 !== t ? t : 1,
  45339. this.near = void 0 !== i ? i : .1,
  45340. this.far = void 0 !== n ? n : 2e3,
  45341. this.updateProjectionMatrix()
  45342. }
  45343. ,
  45344. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  45345. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  45346. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  45347. void 0 === t && (t = 24),
  45348. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  45349. this.updateProjectionMatrix()
  45350. }
  45351. ,
  45352. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45353. this.fullWidth = e,
  45354. this.fullHeight = t,
  45355. this.x = i,
  45356. this.y = n,
  45357. this.width = r,
  45358. this.height = o,
  45359. this.updateProjectionMatrix()
  45360. }
  45361. ,
  45362. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45363. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  45364. if (this.fullWidth) {
  45365. var t = this.fullWidth / this.fullHeight
  45366. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  45367. , n = -i
  45368. , r = t * n
  45369. , o = t * i
  45370. , a = Math.abs(o - r)
  45371. , s = Math.abs(i - n);
  45372. 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)
  45373. } else
  45374. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45375. }
  45376. ,
  45377. Ci.PerspectiveCamera.prototype.copy = function(e) {
  45378. return Ci.Camera.prototype.copy.call(this, e),
  45379. this.focalLength = e.focalLength,
  45380. this.zoom = e.zoom,
  45381. this.fov = e.fov,
  45382. this.aspect = e.aspect,
  45383. this.near = e.near,
  45384. this.far = e.far,
  45385. this
  45386. }
  45387. ,
  45388. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  45389. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45390. return t.object.focalLength = this.focalLength,
  45391. t.object.zoom = this.zoom,
  45392. t.object.fov = this.fov,
  45393. t.object.aspect = this.aspect,
  45394. t.object.near = this.near,
  45395. t.object.far = this.far,
  45396. t
  45397. }
  45398. ,
  45399. Ci.StereoCamera = function() {
  45400. this.type = "StereoCamera",
  45401. this.aspect = 1,
  45402. this.cameraL = new Ci.PerspectiveCamera,
  45403. this.cameraL.layers.enable(1),
  45404. this.cameraL.matrixAutoUpdate = !1,
  45405. this.cameraR = new Ci.PerspectiveCamera,
  45406. this.cameraR.layers.enable(2),
  45407. this.cameraR.matrixAutoUpdate = !1
  45408. }
  45409. ,
  45410. Ci.StereoCamera.prototype = {
  45411. constructor: Ci.StereoCamera,
  45412. update: (Xe = new Ci.Matrix4,
  45413. Ze = new Ci.Matrix4,
  45414. function(e) {
  45415. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  45416. Ge = e.focalLength,
  45417. We = e.fov,
  45418. je = e.aspect * this.aspect,
  45419. Ye = e.near,
  45420. qe = e.far;
  45421. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  45422. Ze.elements[12] = -.032,
  45423. Xe.elements[12] = .032,
  45424. t = -o * je + r,
  45425. i = o * je + r,
  45426. n.elements[0] = 2 * Ye / (i - t),
  45427. n.elements[8] = (i + t) / (i - t),
  45428. this.cameraL.projectionMatrix.copy(n),
  45429. t = -o * je - r,
  45430. i = o * je - r,
  45431. n.elements[0] = 2 * Ye / (i - t),
  45432. n.elements[8] = (i + t) / (i - t),
  45433. this.cameraR.projectionMatrix.copy(n)
  45434. }
  45435. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  45436. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  45437. }
  45438. )
  45439. },
  45440. Ci.Light = function(e, t) {
  45441. Ci.Object3D.call(this),
  45442. this.type = "Light",
  45443. this.color = new Ci.Color(e),
  45444. this.intensity = void 0 !== t ? t : 1,
  45445. this.receiveShadow = void 0
  45446. }
  45447. ,
  45448. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  45449. Ci.Light.prototype.constructor = Ci.Light,
  45450. Ci.Light.prototype.copy = function(e) {
  45451. return Ci.Object3D.prototype.copy.call(this, e),
  45452. this.color.copy(e.color),
  45453. this.intensity = e.intensity,
  45454. this
  45455. }
  45456. ,
  45457. Ci.Light.prototype.toJSON = function(e) {
  45458. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  45459. return t.object.color = this.color.getHex(),
  45460. t.object.intensity = this.intensity,
  45461. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45462. void 0 !== this.distance && (t.object.distance = this.distance),
  45463. void 0 !== this.angle && (t.object.angle = this.angle),
  45464. void 0 !== this.decay && (t.object.decay = this.decay),
  45465. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45466. t
  45467. }
  45468. ,
  45469. Ci.LightShadow = function(e) {
  45470. this.camera = e,
  45471. this.bias = 0,
  45472. this.radius = 1,
  45473. this.mapSize = new Ci.Vector2(512,512),
  45474. this.map = null,
  45475. this.matrix = new Ci.Matrix4
  45476. }
  45477. ,
  45478. Ci.LightShadow.prototype = {
  45479. constructor: Ci.LightShadow,
  45480. copy: function(e) {
  45481. return this.camera = e.camera.clone(),
  45482. this.bias = e.bias,
  45483. this.radius = e.radius,
  45484. this.mapSize.copy(e.mapSize),
  45485. this
  45486. },
  45487. clone: function() {
  45488. return (new this.constructor).copy(this)
  45489. }
  45490. },
  45491. Ci.AmbientLight = function(e, t) {
  45492. Ci.Light.call(this, e, t),
  45493. this.type = "AmbientLight",
  45494. this.castShadow = void 0
  45495. }
  45496. ,
  45497. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45498. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45499. Ci.DirectionalLight = function(e, t) {
  45500. Ci.Light.call(this, e, t),
  45501. this.type = "DirectionalLight",
  45502. this.position.set(0, 1, 0),
  45503. this.updateMatrix(),
  45504. this.target = new Ci.Object3D,
  45505. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45506. }
  45507. ,
  45508. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45509. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45510. Ci.DirectionalLight.prototype.copy = function(e) {
  45511. return Ci.Light.prototype.copy.call(this, e),
  45512. this.target = e.target.clone(),
  45513. this.shadow = e.shadow.clone(),
  45514. this
  45515. }
  45516. ,
  45517. Ci.HemisphereLight = function(e, t, i) {
  45518. Ci.Light.call(this, e, i),
  45519. this.type = "HemisphereLight",
  45520. this.castShadow = void 0,
  45521. this.position.set(0, 1, 0),
  45522. this.updateMatrix(),
  45523. this.groundColor = new Ci.Color(t)
  45524. }
  45525. ,
  45526. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45527. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45528. Ci.HemisphereLight.prototype.copy = function(e) {
  45529. return Ci.Light.prototype.copy.call(this, e),
  45530. this.groundColor.copy(e.groundColor),
  45531. this
  45532. }
  45533. ,
  45534. Ci.PointLight = function(e, t, i, n) {
  45535. Ci.Light.call(this, e, t),
  45536. this.type = "PointLight",
  45537. this.distance = void 0 !== i ? i : 0,
  45538. this.decay = void 0 !== n ? n : 1,
  45539. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45540. }
  45541. ,
  45542. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45543. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45544. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45545. get: function() {
  45546. return 4 * this.intensity * Math.PI
  45547. },
  45548. set: function(e) {
  45549. this.intensity = e / (4 * Math.PI)
  45550. }
  45551. }),
  45552. Ci.PointLight.prototype.copy = function(e) {
  45553. return Ci.Light.prototype.copy.call(this, e),
  45554. this.distance = e.distance,
  45555. this.decay = e.decay,
  45556. this.shadow = e.shadow.clone(),
  45557. this
  45558. }
  45559. ,
  45560. Ci.SpotLight = function(e, t, i, n, r, o) {
  45561. Ci.Light.call(this, e, t),
  45562. this.type = "SpotLight",
  45563. this.position.set(0, 1, 0),
  45564. this.updateMatrix(),
  45565. this.target = new Ci.Object3D,
  45566. this.distance = void 0 !== i ? i : 0,
  45567. this.angle = void 0 !== n ? n : Math.PI / 3,
  45568. this.penumbra = void 0 !== r ? r : 0,
  45569. this.decay = void 0 !== o ? o : 1,
  45570. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45571. }
  45572. ,
  45573. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45574. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45575. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45576. get: function() {
  45577. return this.intensity * Math.PI
  45578. },
  45579. set: function(e) {
  45580. this.intensity = e / Math.PI
  45581. }
  45582. }),
  45583. Ci.SpotLight.prototype.copy = function(e) {
  45584. return Ci.Light.prototype.copy.call(this, e),
  45585. this.distance = e.distance,
  45586. this.angle = e.angle,
  45587. this.penumbra = e.penumbra,
  45588. this.decay = e.decay,
  45589. this.target = e.target.clone(),
  45590. this.shadow = e.shadow.clone(),
  45591. this
  45592. }
  45593. ,
  45594. Ci.Cache = {
  45595. enabled: !1,
  45596. files: {},
  45597. add: function(e, t) {
  45598. !1 !== this.enabled && (this.files[e] = t)
  45599. },
  45600. get: function(e) {
  45601. if (!1 !== this.enabled)
  45602. return this.files[e]
  45603. },
  45604. remove: function(e) {
  45605. delete this.files[e]
  45606. },
  45607. clear: function() {
  45608. this.files = {}
  45609. }
  45610. },
  45611. Ci.Loader = function() {
  45612. this.onLoadStart = function() {}
  45613. ,
  45614. this.onLoadProgress = function() {}
  45615. ,
  45616. this.onLoadComplete = function() {}
  45617. }
  45618. ,
  45619. Ci.Loader.prototype = {
  45620. constructor: Ci.Loader,
  45621. crossOrigin: void 0,
  45622. extractUrlBase: function(e) {
  45623. var t = e.split("/");
  45624. return 1 === t.length ? "./" : (t.pop(),
  45625. t.join("/") + "/")
  45626. },
  45627. initMaterials: function(e, t, i) {
  45628. for (var n = [], r = 0; r < e.length; ++r)
  45629. n[r] = this.createMaterial(e[r], t, i);
  45630. return n
  45631. },
  45632. createMaterial: function(e, c, h) {
  45633. function t(e, t, i, n, r) {
  45634. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45635. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45636. He.load(a)),
  45637. void 0 !== t && (o.repeat.fromArray(t),
  45638. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45639. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45640. void 0 !== i && o.offset.fromArray(i),
  45641. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45642. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45643. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45644. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45645. void 0 !== r && (o.anisotropy = r);
  45646. var l = Ci.Math.generateUUID();
  45647. return u[l] = o,
  45648. l
  45649. }
  45650. void 0 === Ue && (Ue = new Ci.Color),
  45651. void 0 === He && (He = new Ci.TextureLoader),
  45652. void 0 === ze && (ze = new Ci.MaterialLoader);
  45653. var u = {}
  45654. , i = {
  45655. uuid: Ci.Math.generateUUID(),
  45656. type: "MeshLambertMaterial"
  45657. };
  45658. for (var n in e) {
  45659. var r = e[n];
  45660. switch (n) {
  45661. case "DbgColor":
  45662. case "DbgIndex":
  45663. case "opticalDensity":
  45664. case "illumination":
  45665. break;
  45666. case "DbgName":
  45667. i.name = r;
  45668. break;
  45669. case "blending":
  45670. i.blending = Ci[r];
  45671. break;
  45672. case "colorAmbient":
  45673. case "mapAmbient":
  45674. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45675. break;
  45676. case "colorDiffuse":
  45677. i.color = Ue.fromArray(r).getHex();
  45678. break;
  45679. case "colorSpecular":
  45680. i.specular = Ue.fromArray(r).getHex();
  45681. break;
  45682. case "colorEmissive":
  45683. i.emissive = Ue.fromArray(r).getHex();
  45684. break;
  45685. case "specularCoef":
  45686. i.shininess = r;
  45687. break;
  45688. case "shading":
  45689. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45690. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45691. break;
  45692. case "mapDiffuse":
  45693. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45694. break;
  45695. case "mapDiffuseRepeat":
  45696. case "mapDiffuseOffset":
  45697. case "mapDiffuseWrap":
  45698. case "mapDiffuseAnisotropy":
  45699. break;
  45700. case "mapLight":
  45701. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45702. break;
  45703. case "mapLightRepeat":
  45704. case "mapLightOffset":
  45705. case "mapLightWrap":
  45706. case "mapLightAnisotropy":
  45707. break;
  45708. case "mapAO":
  45709. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45710. break;
  45711. case "mapAORepeat":
  45712. case "mapAOOffset":
  45713. case "mapAOWrap":
  45714. case "mapAOAnisotropy":
  45715. break;
  45716. case "mapBump":
  45717. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45718. break;
  45719. case "mapBumpScale":
  45720. i.bumpScale = r;
  45721. break;
  45722. case "mapBumpRepeat":
  45723. case "mapBumpOffset":
  45724. case "mapBumpWrap":
  45725. case "mapBumpAnisotropy":
  45726. break;
  45727. case "mapNormal":
  45728. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45729. break;
  45730. case "mapNormalFactor":
  45731. i.normalScale = [r, r];
  45732. break;
  45733. case "mapNormalRepeat":
  45734. case "mapNormalOffset":
  45735. case "mapNormalWrap":
  45736. case "mapNormalAnisotropy":
  45737. break;
  45738. case "mapSpecular":
  45739. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45740. break;
  45741. case "mapSpecularRepeat":
  45742. case "mapSpecularOffset":
  45743. case "mapSpecularWrap":
  45744. case "mapSpecularAnisotropy":
  45745. break;
  45746. case "mapAlpha":
  45747. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45748. break;
  45749. case "mapAlphaRepeat":
  45750. case "mapAlphaOffset":
  45751. case "mapAlphaWrap":
  45752. case "mapAlphaAnisotropy":
  45753. break;
  45754. case "flipSided":
  45755. i.side = Ci.BackSide;
  45756. break;
  45757. case "doubleSided":
  45758. i.side = Ci.DoubleSide;
  45759. break;
  45760. case "transparency":
  45761. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45762. i.opacity = r;
  45763. break;
  45764. case "depthTest":
  45765. case "depthWrite":
  45766. case "colorWrite":
  45767. case "opacity":
  45768. case "reflectivity":
  45769. case "transparent":
  45770. case "visible":
  45771. case "wireframe":
  45772. i[n] = r;
  45773. break;
  45774. case "vertexColors":
  45775. !0 === r && (i.vertexColors = Ci.VertexColors),
  45776. "face" === r && (i.vertexColors = Ci.FaceColors);
  45777. break;
  45778. default:
  45779. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45780. }
  45781. }
  45782. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45783. "MeshPhongMaterial" !== i.type && delete i.specular,
  45784. i.opacity < 1 && (i.transparent = !0),
  45785. ze.setTextures(u),
  45786. ze.parse(i)
  45787. }
  45788. },
  45789. Ci.Loader.Handlers = {
  45790. handlers: [],
  45791. add: function(e, t) {
  45792. this.handlers.push(e, t)
  45793. },
  45794. get: function(e) {
  45795. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45796. var r = t[i]
  45797. , o = t[i + 1];
  45798. if (r.test(e))
  45799. return o
  45800. }
  45801. return null
  45802. }
  45803. },
  45804. Ci.XHRLoader = function(e) {
  45805. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45806. }
  45807. ,
  45808. Ci.XHRLoader.prototype = {
  45809. constructor: Ci.XHRLoader,
  45810. load: function(i, n, t, r) {
  45811. void 0 !== this.path && (i = this.path + i);
  45812. var o = this
  45813. , e = Ci.Cache.get(i);
  45814. if (void 0 !== e)
  45815. return n && setTimeout(function() {
  45816. n(e)
  45817. }, 0),
  45818. e;
  45819. var a = new XMLHttpRequest;
  45820. return a.overrideMimeType("text/plain"),
  45821. a.open("GET", i, !0),
  45822. a.addEventListener("load", function(e) {
  45823. var t = e.target.response;
  45824. Ci.Cache.add(i, t),
  45825. 200 === this.status ? (n && n(t),
  45826. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45827. n && n(t),
  45828. o.manager.itemEnd(i)) : (r && r(e),
  45829. o.manager.itemError(i))
  45830. }, !1),
  45831. void 0 !== t && a.addEventListener("progress", function(e) {
  45832. t(e)
  45833. }, !1),
  45834. a.addEventListener("error", function(e) {
  45835. r && r(e),
  45836. o.manager.itemError(i)
  45837. }, !1),
  45838. void 0 !== this.responseType && (a.responseType = this.responseType),
  45839. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45840. a.send(null),
  45841. o.manager.itemStart(i),
  45842. a
  45843. },
  45844. setPath: function(e) {
  45845. this.path = e
  45846. },
  45847. setResponseType: function(e) {
  45848. this.responseType = e
  45849. },
  45850. setWithCredentials: function(e) {
  45851. this.withCredentials = e
  45852. }
  45853. },
  45854. Ci.FontLoader = function(e) {
  45855. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45856. }
  45857. ,
  45858. Ci.FontLoader.prototype = {
  45859. constructor: Ci.FontLoader,
  45860. load: function(e, t, i, n) {
  45861. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45862. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45863. }, i, n)
  45864. }
  45865. },
  45866. Ci.ImageLoader = function(e) {
  45867. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45868. }
  45869. ,
  45870. Ci.ImageLoader.prototype = {
  45871. constructor: Ci.ImageLoader,
  45872. load: function(t, i, n, r) {
  45873. void 0 !== this.path && (t = this.path + t);
  45874. var o = this
  45875. , e = Ci.Cache.get(t);
  45876. if (void 0 !== e)
  45877. return o.manager.itemStart(t),
  45878. i ? setTimeout(function() {
  45879. i(e),
  45880. o.manager.itemEnd(t)
  45881. }, 0) : o.manager.itemEnd(t),
  45882. e;
  45883. var a = document.createElement("img");
  45884. return a.addEventListener("load", function(e) {
  45885. Ci.Cache.add(t, this),
  45886. i && i(this),
  45887. o.manager.itemEnd(t)
  45888. }, !1),
  45889. void 0 !== n && a.addEventListener("progress", function(e) {
  45890. n(e)
  45891. }, !1),
  45892. a.addEventListener("error", function(e) {
  45893. r && r(e),
  45894. o.manager.itemError(t)
  45895. }, !1),
  45896. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45897. o.manager.itemStart(t),
  45898. a.src = t,
  45899. a
  45900. },
  45901. setCrossOrigin: function(e) {
  45902. this.crossOrigin = e
  45903. },
  45904. setPath: function(e) {
  45905. this.path = e
  45906. }
  45907. },
  45908. Ci.JSONLoader = function(e) {
  45909. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45910. e = void 0),
  45911. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45912. this.withCredentials = !1
  45913. }
  45914. ,
  45915. Ci.JSONLoader.prototype = {
  45916. constructor: Ci.JSONLoader,
  45917. get statusDomElement() {
  45918. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45919. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45920. this._statusDomElement
  45921. },
  45922. load: function(o, a, e, t) {
  45923. var s = this
  45924. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45925. , i = new Ci.XHRLoader(this.manager);
  45926. i.setWithCredentials(this.withCredentials),
  45927. i.load(o, function(e) {
  45928. var t = JSON.parse(e)
  45929. , i = t.metadata;
  45930. if (void 0 !== i) {
  45931. var n = i.type;
  45932. if (void 0 !== n) {
  45933. if ("object" === n.toLowerCase())
  45934. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45935. if ("scene" === n.toLowerCase())
  45936. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45937. }
  45938. }
  45939. var r = s.parse(t, l);
  45940. a(r.geometry, r.materials)
  45941. }, e, t)
  45942. },
  45943. setTexturePath: function(e) {
  45944. this.texturePath = e
  45945. },
  45946. parse: function(D, e) {
  45947. var N = new Ci.Geometry
  45948. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45949. if (function(e) {
  45950. function t(e, t) {
  45951. return e & 1 << t
  45952. }
  45953. 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;
  45954. if (void 0 !== D.uvs) {
  45955. for (i = 0; i < D.uvs.length; i++)
  45956. D.uvs[i].length && L++;
  45957. for (i = 0; i < L; i++)
  45958. N.faceVertexUvs[i] = []
  45959. }
  45960. for (o = 0,
  45961. a = R.length; o < a; )
  45962. (A = new Ci.Vector3).x = R[o++] * e,
  45963. A.y = R[o++] * e,
  45964. A.z = R[o++] * e,
  45965. N.vertices.push(A);
  45966. for (o = 0,
  45967. a = M.length; o < a; )
  45968. if (d = t(u = M[o++], 0),
  45969. p = t(u, 1),
  45970. f = t(u, 3),
  45971. g = t(u, 4),
  45972. m = t(u, 5),
  45973. v = t(u, 6),
  45974. y = t(u, 7),
  45975. d) {
  45976. if ((I = new Ci.Face3).a = M[o],
  45977. I.b = M[o + 1],
  45978. I.c = M[o + 3],
  45979. (E = new Ci.Face3).a = M[o + 1],
  45980. E.b = M[o + 2],
  45981. E.c = M[o + 3],
  45982. o += 4,
  45983. p && (h = M[o++],
  45984. I.materialIndex = h,
  45985. E.materialIndex = h),
  45986. r = N.faces.length,
  45987. f)
  45988. for (i = 0; i < L; i++)
  45989. for (w = D.uvs[i],
  45990. N.faceVertexUvs[i][r] = [],
  45991. N.faceVertexUvs[i][r + 1] = [],
  45992. n = 0; n < 4; n++)
  45993. x = w[2 * (c = M[o++])],
  45994. S = w[2 * c + 1],
  45995. T = new Ci.Vector2(x,S),
  45996. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45997. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45998. if (g && (l = 3 * M[o++],
  45999. I.normal.set(P[l++], P[l++], P[l]),
  46000. E.normal.copy(I.normal)),
  46001. m)
  46002. for (i = 0; i < 4; i++)
  46003. l = 3 * M[o++],
  46004. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  46005. 2 !== i && I.vertexNormals.push(b),
  46006. 0 !== i && E.vertexNormals.push(b);
  46007. if (v && (_ = O[s = M[o++]],
  46008. I.color.setHex(_),
  46009. E.color.setHex(_)),
  46010. y)
  46011. for (i = 0; i < 4; i++)
  46012. _ = O[s = M[o++]],
  46013. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  46014. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  46015. N.faces.push(I),
  46016. N.faces.push(E)
  46017. } else {
  46018. if ((C = new Ci.Face3).a = M[o++],
  46019. C.b = M[o++],
  46020. C.c = M[o++],
  46021. p && (h = M[o++],
  46022. C.materialIndex = h),
  46023. r = N.faces.length,
  46024. f)
  46025. for (i = 0; i < L; i++)
  46026. for (w = D.uvs[i],
  46027. N.faceVertexUvs[i][r] = [],
  46028. n = 0; n < 3; n++)
  46029. x = w[2 * (c = M[o++])],
  46030. S = w[2 * c + 1],
  46031. T = new Ci.Vector2(x,S),
  46032. N.faceVertexUvs[i][r].push(T);
  46033. if (g && (l = 3 * M[o++],
  46034. C.normal.set(P[l++], P[l++], P[l])),
  46035. m)
  46036. for (i = 0; i < 3; i++)
  46037. l = 3 * M[o++],
  46038. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  46039. C.vertexNormals.push(b);
  46040. if (v && (s = M[o++],
  46041. C.color.setHex(O[s])),
  46042. y)
  46043. for (i = 0; i < 3; i++)
  46044. s = M[o++],
  46045. C.vertexColors.push(new Ci.Color(O[s]));
  46046. N.faces.push(C)
  46047. }
  46048. }(t),
  46049. function() {
  46050. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  46051. if (D.skinWeights)
  46052. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  46053. var n = D.skinWeights[t]
  46054. , r = 1 < e ? D.skinWeights[t + 1] : 0
  46055. , o = 2 < e ? D.skinWeights[t + 2] : 0
  46056. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  46057. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  46058. }
  46059. if (D.skinIndices)
  46060. for (t = 0,
  46061. i = D.skinIndices.length; t < i; t += e) {
  46062. var s = D.skinIndices[t]
  46063. , l = 1 < e ? D.skinIndices[t + 1] : 0
  46064. , c = 2 < e ? D.skinIndices[t + 2] : 0
  46065. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  46066. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  46067. }
  46068. N.bones = D.bones,
  46069. 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.")
  46070. }(),
  46071. function(e) {
  46072. if (void 0 !== D.morphTargets)
  46073. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  46074. N.morphTargets[t] = {},
  46075. N.morphTargets[t].name = D.morphTargets[t].name,
  46076. N.morphTargets[t].vertices = [];
  46077. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  46078. var s = new Ci.Vector3;
  46079. s.x = r[o] * e,
  46080. s.y = r[o + 1] * e,
  46081. s.z = r[o + 2] * e,
  46082. n.push(s)
  46083. }
  46084. }
  46085. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  46086. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  46087. var l = N.faces
  46088. , c = D.morphColors[0].colors;
  46089. for (t = 0,
  46090. i = l.length; t < i; t++)
  46091. l[t].color.fromArray(c, 3 * t)
  46092. }
  46093. }(t),
  46094. function() {
  46095. var e = []
  46096. , t = [];
  46097. void 0 !== D.animation && t.push(D.animation),
  46098. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  46099. for (var i = 0; i < t.length; i++) {
  46100. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  46101. n && e.push(n)
  46102. }
  46103. if (N.morphTargets) {
  46104. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  46105. e = e.concat(r)
  46106. }
  46107. 0 < e.length && (N.animations = e)
  46108. }(),
  46109. N.computeFaceNormals(),
  46110. N.computeBoundingSphere(),
  46111. void 0 === D.materials || 0 === D.materials.length)
  46112. return {
  46113. geometry: N
  46114. };
  46115. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  46116. return {
  46117. geometry: N,
  46118. materials: i
  46119. }
  46120. }
  46121. },
  46122. Ci.LoadingManager = function(e, t, i) {
  46123. var n = this
  46124. , r = !1
  46125. , o = 0
  46126. , a = 0;
  46127. this.onStart = void 0,
  46128. this.onLoad = e,
  46129. this.onProgress = t,
  46130. this.onError = i,
  46131. this.itemStart = function(e) {
  46132. a++,
  46133. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  46134. r = !0
  46135. }
  46136. ,
  46137. this.itemEnd = function(e) {
  46138. o++,
  46139. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46140. o === a && (r = !1,
  46141. void 0 !== n.onLoad && n.onLoad())
  46142. }
  46143. ,
  46144. this.itemError = function(e) {
  46145. void 0 !== n.onError && n.onError(e)
  46146. }
  46147. }
  46148. ,
  46149. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  46150. Ci.BufferGeometryLoader = function(e) {
  46151. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46152. }
  46153. ,
  46154. Ci.BufferGeometryLoader.prototype = {
  46155. constructor: Ci.BufferGeometryLoader,
  46156. load: function(e, t, i, n) {
  46157. var r = this;
  46158. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46159. t(r.parse(JSON.parse(e)))
  46160. }, i, n)
  46161. },
  46162. parse: function(e) {
  46163. var t = new Ci.BufferGeometry
  46164. , i = e.data.index
  46165. , n = {
  46166. Int8Array: Int8Array,
  46167. Uint8Array: Uint8Array,
  46168. Uint8ClampedArray: Uint8ClampedArray,
  46169. Int16Array: Int16Array,
  46170. Uint16Array: Uint16Array,
  46171. Int32Array: Int32Array,
  46172. Uint32Array: Uint32Array,
  46173. Float32Array: Float32Array,
  46174. Float64Array: Float64Array
  46175. };
  46176. if (void 0 !== i) {
  46177. var r = new n[i.type](i.array);
  46178. t.setIndex(new Ci.BufferAttribute(r,1))
  46179. }
  46180. var o = e.data.attributes;
  46181. for (var a in o) {
  46182. var s = o[a];
  46183. r = new n[s.type](s.array);
  46184. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  46185. }
  46186. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  46187. if (void 0 !== l)
  46188. for (var c = 0, h = l.length; c !== h; ++c) {
  46189. var u = l[c];
  46190. t.addGroup(u.start, u.count, u.materialIndex)
  46191. }
  46192. var d = e.data.boundingSphere;
  46193. if (void 0 !== d) {
  46194. var p = new Ci.Vector3;
  46195. void 0 !== d.center && p.fromArray(d.center),
  46196. t.boundingSphere = new Ci.Sphere(p,d.radius)
  46197. }
  46198. return t
  46199. }
  46200. },
  46201. Ci.MaterialLoader = function(e) {
  46202. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46203. this.textures = {}
  46204. }
  46205. ,
  46206. Ci.MaterialLoader.prototype = {
  46207. constructor: Ci.MaterialLoader,
  46208. load: function(e, t, i, n) {
  46209. var r = this;
  46210. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46211. t(r.parse(JSON.parse(e)))
  46212. }, i, n)
  46213. },
  46214. setTextures: function(e) {
  46215. this.textures = e
  46216. },
  46217. getTexture: function(e) {
  46218. var t = this.textures;
  46219. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46220. t[e]
  46221. },
  46222. parse: function(e) {
  46223. var t = new Ci[e.type];
  46224. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46225. void 0 !== e.name && (t.name = e.name),
  46226. void 0 !== e.color && t.color.setHex(e.color),
  46227. void 0 !== e.roughness && (t.roughness = e.roughness),
  46228. void 0 !== e.metalness && (t.metalness = e.metalness),
  46229. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46230. void 0 !== e.specular && t.specular.setHex(e.specular),
  46231. void 0 !== e.shininess && (t.shininess = e.shininess),
  46232. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46233. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46234. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46235. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46236. void 0 !== e.shading && (t.shading = e.shading),
  46237. void 0 !== e.blending && (t.blending = e.blending),
  46238. void 0 !== e.side && (t.side = e.side),
  46239. void 0 !== e.opacity && (t.opacity = e.opacity),
  46240. void 0 !== e.transparent && (t.transparent = e.transparent),
  46241. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46242. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46243. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46244. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46245. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46246. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46247. void 0 !== e.size && (t.size = e.size),
  46248. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46249. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46250. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46251. t.transparent = !0),
  46252. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46253. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46254. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46255. void 0 !== e.normalScale) {
  46256. var i = e.normalScale;
  46257. !1 === Array.isArray(i) && (i = [i, i]),
  46258. t.normalScale = (new Ci.Vector2).fromArray(i)
  46259. }
  46260. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46261. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46262. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46263. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46264. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46265. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46266. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46267. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46268. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46269. t.combine = Ci.MultiplyOperation),
  46270. e.reflectivity && (t.reflectivity = e.reflectivity),
  46271. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46272. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46273. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46274. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46275. void 0 !== e.materials)
  46276. for (var n = 0, r = e.materials.length; n < r; n++)
  46277. t.materials.push(this.parse(e.materials[n]));
  46278. return t
  46279. }
  46280. },
  46281. Ci.ObjectLoader = function(e) {
  46282. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46283. this.texturePath = ""
  46284. }
  46285. ,
  46286. Ci.ObjectLoader.prototype = {
  46287. constructor: Ci.ObjectLoader,
  46288. load: function(e, t, i, n) {
  46289. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46290. var r = this;
  46291. new Ci.XHRLoader(r.manager).load(e, function(e) {
  46292. r.parse(JSON.parse(e), t)
  46293. }, i, n)
  46294. },
  46295. setTexturePath: function(e) {
  46296. this.texturePath = e
  46297. },
  46298. setCrossOrigin: function(e) {
  46299. this.crossOrigin = e
  46300. },
  46301. parse: function(e, t) {
  46302. var i = this.parseGeometries(e.geometries)
  46303. , n = this.parseImages(e.images, function() {
  46304. void 0 !== t && t(a)
  46305. })
  46306. , r = this.parseTextures(e.textures, n)
  46307. , o = this.parseMaterials(e.materials, r)
  46308. , a = this.parseObject(e.object, i, o);
  46309. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46310. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46311. a
  46312. },
  46313. parseGeometries: function(e) {
  46314. var t = {};
  46315. if (void 0 !== e)
  46316. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  46317. var a, s = e[r];
  46318. switch (s.type) {
  46319. case "PlaneGeometry":
  46320. case "PlaneBufferGeometry":
  46321. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  46322. break;
  46323. case "BoxGeometry":
  46324. case "BoxBufferGeometry":
  46325. case "CubeGeometry":
  46326. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  46327. break;
  46328. case "CircleGeometry":
  46329. case "CircleBufferGeometry":
  46330. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  46331. break;
  46332. case "CylinderGeometry":
  46333. case "CylinderBufferGeometry":
  46334. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  46335. break;
  46336. case "SphereGeometry":
  46337. case "SphereBufferGeometry":
  46338. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  46339. break;
  46340. case "DodecahedronGeometry":
  46341. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  46342. break;
  46343. case "IcosahedronGeometry":
  46344. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  46345. break;
  46346. case "OctahedronGeometry":
  46347. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  46348. break;
  46349. case "TetrahedronGeometry":
  46350. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  46351. break;
  46352. case "RingGeometry":
  46353. case "RingBufferGeometry":
  46354. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  46355. break;
  46356. case "TorusGeometry":
  46357. case "TorusBufferGeometry":
  46358. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  46359. break;
  46360. case "TorusKnotGeometry":
  46361. case "TorusKnotBufferGeometry":
  46362. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  46363. break;
  46364. case "LatheGeometry":
  46365. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  46366. break;
  46367. case "BufferGeometry":
  46368. a = n.parse(s);
  46369. break;
  46370. case "Geometry":
  46371. a = i.parse(s.data, this.texturePath).geometry;
  46372. break;
  46373. default:
  46374. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  46375. continue
  46376. }
  46377. a.uuid = s.uuid,
  46378. void 0 !== s.name && (a.name = s.name),
  46379. t[s.uuid] = a
  46380. }
  46381. return t
  46382. },
  46383. parseMaterials: function(e, t) {
  46384. var i = {};
  46385. if (void 0 !== e) {
  46386. var n = new Ci.MaterialLoader;
  46387. n.setTextures(t);
  46388. for (var r = 0, o = e.length; r < o; r++) {
  46389. var a = n.parse(e[r]);
  46390. i[a.uuid] = a
  46391. }
  46392. }
  46393. return i
  46394. },
  46395. parseAnimations: function(e) {
  46396. for (var t = [], i = 0; i < e.length; i++) {
  46397. var n = Ci.AnimationClip.parse(e[i]);
  46398. t.push(n)
  46399. }
  46400. return t
  46401. },
  46402. parseImages: function(e, t) {
  46403. function i(e) {
  46404. return n.manager.itemStart(e),
  46405. a.load(e, function() {
  46406. n.manager.itemEnd(e)
  46407. })
  46408. }
  46409. var n = this
  46410. , r = {};
  46411. if (void 0 !== e && 0 < e.length) {
  46412. var o = new Ci.LoadingManager(t)
  46413. , a = new Ci.ImageLoader(o);
  46414. a.setCrossOrigin(this.crossOrigin);
  46415. for (var s = 0, l = e.length; s < l; s++) {
  46416. var c = e[s]
  46417. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  46418. r[c.uuid] = i(h)
  46419. }
  46420. }
  46421. return r
  46422. },
  46423. parseTextures: function(e, t) {
  46424. function i(e) {
  46425. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46426. Ci[e])
  46427. }
  46428. var n = {};
  46429. if (void 0 !== e)
  46430. for (var r = 0, o = e.length; r < o; r++) {
  46431. var a = e[r];
  46432. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  46433. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  46434. var s = new Ci.Texture(t[a.image]);
  46435. s.needsUpdate = !0,
  46436. s.uuid = a.uuid,
  46437. void 0 !== a.name && (s.name = a.name),
  46438. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  46439. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  46440. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  46441. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  46442. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  46443. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  46444. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  46445. s.wrapT = i(a.wrap[1])),
  46446. n[a.uuid] = s
  46447. }
  46448. return n
  46449. },
  46450. parseObject: (ke = new Ci.Matrix4,
  46451. function(e, t, i) {
  46452. function n(e) {
  46453. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46454. t[e]
  46455. }
  46456. function r(e) {
  46457. if (void 0 !== e)
  46458. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46459. i[e]
  46460. }
  46461. var o;
  46462. switch (e.type) {
  46463. case "Scene":
  46464. o = new Ci.Scene;
  46465. break;
  46466. case "PerspectiveCamera":
  46467. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  46468. break;
  46469. case "OrthographicCamera":
  46470. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  46471. break;
  46472. case "AmbientLight":
  46473. o = new Ci.AmbientLight(e.color,e.intensity);
  46474. break;
  46475. case "DirectionalLight":
  46476. o = new Ci.DirectionalLight(e.color,e.intensity);
  46477. break;
  46478. case "PointLight":
  46479. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  46480. break;
  46481. case "SpotLight":
  46482. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  46483. break;
  46484. case "HemisphereLight":
  46485. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46486. break;
  46487. case "Mesh":
  46488. var a = n(e.geometry)
  46489. , s = r(e.material);
  46490. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46491. break;
  46492. case "LOD":
  46493. o = new Ci.LOD;
  46494. break;
  46495. case "Line":
  46496. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46497. break;
  46498. case "PointCloud":
  46499. case "Points":
  46500. o = new Ci.Points(n(e.geometry),r(e.material));
  46501. break;
  46502. case "Sprite":
  46503. o = new Ci.Sprite(r(e.material));
  46504. break;
  46505. case "Group":
  46506. o = new Ci.Group;
  46507. break;
  46508. default:
  46509. o = new Ci.Object3D
  46510. }
  46511. if (o.uuid = e.uuid,
  46512. void 0 !== e.name && (o.name = e.name),
  46513. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46514. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46515. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46516. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46517. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46518. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46519. void 0 !== e.visible && (o.visible = e.visible),
  46520. void 0 !== e.userData && (o.userData = e.userData),
  46521. void 0 !== e.children)
  46522. for (var l in e.children)
  46523. o.add(this.parseObject(e.children[l], t, i));
  46524. if ("LOD" === e.type)
  46525. for (var c = e.levels, h = 0; h < c.length; h++) {
  46526. var u = c[h];
  46527. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46528. }
  46529. return o
  46530. }
  46531. )
  46532. },
  46533. Ci.TextureLoader = function(e) {
  46534. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46535. }
  46536. ,
  46537. Ci.TextureLoader.prototype = {
  46538. constructor: Ci.TextureLoader,
  46539. load: function(e, t, i, n) {
  46540. var r = new Ci.Texture
  46541. , o = new Ci.ImageLoader(this.manager);
  46542. return o.setCrossOrigin(this.crossOrigin),
  46543. o.setPath(this.path),
  46544. o.load(e, function(e) {
  46545. r.image = e,
  46546. r.needsUpdate = !0,
  46547. void 0 !== t && t(r)
  46548. }, i, n),
  46549. r
  46550. },
  46551. setCrossOrigin: function(e) {
  46552. this.crossOrigin = e
  46553. },
  46554. setPath: function(e) {
  46555. this.path = e
  46556. }
  46557. },
  46558. Ci.CubeTextureLoader = function(e) {
  46559. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46560. }
  46561. ,
  46562. Ci.CubeTextureLoader.prototype = {
  46563. constructor: Ci.CubeTextureLoader,
  46564. load: function(e, i, t, n) {
  46565. function r(t) {
  46566. a.load(e[t], function(e) {
  46567. o.images[t] = e,
  46568. 6 === ++s && (o.needsUpdate = !0,
  46569. i && i(o))
  46570. }, void 0, n)
  46571. }
  46572. var o = new Ci.CubeTexture
  46573. , a = new Ci.ImageLoader(this.manager);
  46574. a.setCrossOrigin(this.crossOrigin),
  46575. a.setPath(this.path);
  46576. for (var s = 0, l = 0; l < e.length; ++l)
  46577. r(l);
  46578. return o
  46579. },
  46580. setCrossOrigin: function(e) {
  46581. this.crossOrigin = e
  46582. },
  46583. setPath: function(e) {
  46584. this.path = e
  46585. }
  46586. },
  46587. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46588. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46589. this._parser = null
  46590. }
  46591. ,
  46592. Ci.BinaryTextureLoader.prototype = {
  46593. constructor: Ci.BinaryTextureLoader,
  46594. load: function(e, i, t, n) {
  46595. var r = this
  46596. , o = new Ci.DataTexture
  46597. , a = new Ci.XHRLoader(this.manager);
  46598. return a.setResponseType("arraybuffer"),
  46599. a.load(e, function(e) {
  46600. var t = r._parser(e);
  46601. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46602. o.image.height = t.height,
  46603. o.image.data = t.data),
  46604. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46605. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46606. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46607. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46608. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46609. void 0 !== t.format && (o.format = t.format),
  46610. void 0 !== t.type && (o.type = t.type),
  46611. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46612. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46613. o.needsUpdate = !0,
  46614. i && i(o, t))
  46615. }, t, n),
  46616. o
  46617. }
  46618. },
  46619. Ci.CompressedTextureLoader = function(e) {
  46620. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46621. this._parser = null
  46622. }
  46623. ,
  46624. Ci.CompressedTextureLoader.prototype = {
  46625. constructor: Ci.CompressedTextureLoader,
  46626. load: function(e, o, t, n) {
  46627. function i(i) {
  46628. r.load(e[i], function(e) {
  46629. var t = a._parser(e, !0);
  46630. s[i] = {
  46631. width: t.width,
  46632. height: t.height,
  46633. format: t.format,
  46634. mipmaps: t.mipmaps
  46635. },
  46636. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46637. l.format = t.format,
  46638. l.needsUpdate = !0,
  46639. o && o(l))
  46640. }, t, n)
  46641. }
  46642. var a = this
  46643. , s = []
  46644. , l = new Ci.CompressedTexture;
  46645. l.image = s;
  46646. var r = new Ci.XHRLoader(this.manager);
  46647. if (r.setPath(this.path),
  46648. r.setResponseType("arraybuffer"),
  46649. Array.isArray(e))
  46650. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46651. i(h);
  46652. else
  46653. r.load(e, function(e) {
  46654. var t = a._parser(e, !0);
  46655. if (t.isCubemap)
  46656. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46657. s[n] = {
  46658. mipmaps: []
  46659. };
  46660. for (var r = 0; r < t.mipmapCount; r++)
  46661. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46662. s[n].format = t.format,
  46663. s[n].width = t.width,
  46664. s[n].height = t.height
  46665. }
  46666. else
  46667. l.image.width = t.width,
  46668. l.image.height = t.height,
  46669. l.mipmaps = t.mipmaps;
  46670. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46671. l.format = t.format,
  46672. l.needsUpdate = !0,
  46673. o && o(l)
  46674. }, t, n);
  46675. return l
  46676. },
  46677. setPath: function(e) {
  46678. this.path = e
  46679. }
  46680. },
  46681. Ci.Material = function() {
  46682. Object.defineProperty(this, "id", {
  46683. value: Ci.MaterialIdCount++
  46684. }),
  46685. this.uuid = Ci.Math.generateUUID(),
  46686. this.name = "",
  46687. this.type = "Material",
  46688. this.side = Ci.FrontSide,
  46689. this.opacity = 1,
  46690. this.transparent = !1,
  46691. this.blending = Ci.NormalBlending,
  46692. this.blendSrc = Ci.SrcAlphaFactor,
  46693. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46694. this.blendEquation = Ci.AddEquation,
  46695. this.blendSrcAlpha = null,
  46696. this.blendDstAlpha = null,
  46697. this.blendEquationAlpha = null,
  46698. this.depthFunc = Ci.LessEqualDepth,
  46699. this.depthTest = !0,
  46700. this.depthWrite = !0,
  46701. this.colorWrite = !0,
  46702. this.precision = null,
  46703. this.polygonOffset = !1,
  46704. this.polygonOffsetFactor = 0,
  46705. this.polygonOffsetUnits = 0,
  46706. this.alphaTest = 0,
  46707. this.premultipliedAlpha = !1,
  46708. this.overdraw = 0,
  46709. this.visible = !0,
  46710. this._needsUpdate = !0
  46711. }
  46712. ,
  46713. Ci.Material.prototype = {
  46714. constructor: Ci.Material,
  46715. get needsUpdate() {
  46716. return this._needsUpdate
  46717. },
  46718. set needsUpdate(e) {
  46719. !0 === e && this.update(),
  46720. this._needsUpdate = e
  46721. },
  46722. setValues: function(e) {
  46723. if (void 0 !== e)
  46724. for (var t in e) {
  46725. var i = e[t];
  46726. if (void 0 !== i) {
  46727. var n = this[t];
  46728. 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.")
  46729. } else
  46730. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46731. }
  46732. },
  46733. toJSON: function(e) {
  46734. function t(e) {
  46735. var t = [];
  46736. for (var i in e) {
  46737. var n = e[i];
  46738. delete n.metadata,
  46739. t.push(n)
  46740. }
  46741. return t
  46742. }
  46743. var i = void 0 === e;
  46744. i && (e = {
  46745. textures: {},
  46746. images: {}
  46747. });
  46748. var n = {
  46749. metadata: {
  46750. version: 4.4,
  46751. type: "Material",
  46752. generator: "Material.toJSON"
  46753. }
  46754. };
  46755. if (n.uuid = this.uuid,
  46756. n.type = this.type,
  46757. "" !== this.name && (n.name = this.name),
  46758. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46759. .5 !== this.roughness && (n.roughness = this.roughness),
  46760. .5 !== this.metalness && (n.metalness = this.metalness),
  46761. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46762. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46763. void 0 !== this.shininess && (n.shininess = this.shininess),
  46764. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46765. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46766. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46767. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46768. n.bumpScale = this.bumpScale),
  46769. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46770. n.normalScale = this.normalScale.toArray()),
  46771. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46772. n.displacementScale = this.displacementScale,
  46773. n.displacementBias = this.displacementBias),
  46774. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46775. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46776. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46777. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46778. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46779. n.reflectivity = this.reflectivity),
  46780. void 0 !== this.size && (n.size = this.size),
  46781. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46782. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46783. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46784. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46785. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46786. this.opacity < 1 && (n.opacity = this.opacity),
  46787. !0 === this.transparent && (n.transparent = this.transparent),
  46788. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46789. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46790. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46791. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46792. i) {
  46793. var r = t(e.textures)
  46794. , o = t(e.images);
  46795. 0 < r.length && (n.textures = r),
  46796. 0 < o.length && (n.images = o)
  46797. }
  46798. return n
  46799. },
  46800. clone: function() {
  46801. return (new this.constructor).copy(this)
  46802. },
  46803. copy: function(e) {
  46804. return this.name = e.name,
  46805. this.side = e.side,
  46806. this.opacity = e.opacity,
  46807. this.transparent = e.transparent,
  46808. this.blending = e.blending,
  46809. this.blendSrc = e.blendSrc,
  46810. this.blendDst = e.blendDst,
  46811. this.blendEquation = e.blendEquation,
  46812. this.blendSrcAlpha = e.blendSrcAlpha,
  46813. this.blendDstAlpha = e.blendDstAlpha,
  46814. this.blendEquationAlpha = e.blendEquationAlpha,
  46815. this.depthFunc = e.depthFunc,
  46816. this.depthTest = e.depthTest,
  46817. this.depthWrite = e.depthWrite,
  46818. this.colorWrite = e.colorWrite,
  46819. this.precision = e.precision,
  46820. this.polygonOffset = e.polygonOffset,
  46821. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46822. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46823. this.alphaTest = e.alphaTest,
  46824. this.premultipliedAlpha = e.premultipliedAlpha,
  46825. this.overdraw = e.overdraw,
  46826. this.visible = e.visible,
  46827. this
  46828. },
  46829. update: function() {
  46830. this.dispatchEvent({
  46831. type: "update"
  46832. })
  46833. },
  46834. dispose: function() {
  46835. this.dispatchEvent({
  46836. type: "dispose"
  46837. })
  46838. }
  46839. },
  46840. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46841. Ci.MaterialIdCount = 0,
  46842. Ci.LineBasicMaterial = function(e) {
  46843. Ci.Material.call(this),
  46844. this.type = "LineBasicMaterial",
  46845. this.color = new Ci.Color(16777215),
  46846. this.linewidth = 1,
  46847. this.linecap = "round",
  46848. this.linejoin = "round",
  46849. this.blending = Ci.NormalBlending,
  46850. this.vertexColors = Ci.NoColors,
  46851. this.fog = !0,
  46852. this.setValues(e)
  46853. }
  46854. ,
  46855. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46856. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46857. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46858. return Ci.Material.prototype.copy.call(this, e),
  46859. this.color.copy(e.color),
  46860. this.linewidth = e.linewidth,
  46861. this.linecap = e.linecap,
  46862. this.linejoin = e.linejoin,
  46863. this.vertexColors = e.vertexColors,
  46864. this.fog = e.fog,
  46865. this
  46866. }
  46867. ,
  46868. Ci.LineDashedMaterial = function(e) {
  46869. Ci.Material.call(this),
  46870. this.type = "LineDashedMaterial",
  46871. this.color = new Ci.Color(16777215),
  46872. this.linewidth = 1,
  46873. this.scale = 1,
  46874. this.dashSize = 3,
  46875. this.gapSize = 1,
  46876. this.blending = Ci.NormalBlending,
  46877. this.vertexColors = Ci.NoColors,
  46878. this.fog = !0,
  46879. this.setValues(e)
  46880. }
  46881. ,
  46882. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46883. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46884. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46885. return Ci.Material.prototype.copy.call(this, e),
  46886. this.color.copy(e.color),
  46887. this.linewidth = e.linewidth,
  46888. this.scale = e.scale,
  46889. this.dashSize = e.dashSize,
  46890. this.gapSize = e.gapSize,
  46891. this.vertexColors = e.vertexColors,
  46892. this.fog = e.fog,
  46893. this
  46894. }
  46895. ,
  46896. Ci.MeshBasicMaterial = function(e) {
  46897. Ci.Material.call(this),
  46898. this.type = "MeshBasicMaterial",
  46899. this.color = new Ci.Color(16777215),
  46900. this.map = null,
  46901. this.aoMap = null,
  46902. this.aoMapIntensity = 1,
  46903. this.specularMap = null,
  46904. this.alphaMap = null,
  46905. this.envMap = null,
  46906. this.combine = Ci.MultiplyOperation,
  46907. this.reflectivity = 1,
  46908. this.refractionRatio = .98,
  46909. this.fog = !0,
  46910. this.shading = Ci.SmoothShading,
  46911. this.blending = Ci.NormalBlending,
  46912. this.wireframe = !1,
  46913. this.wireframeLinewidth = 1,
  46914. this.wireframeLinecap = "round",
  46915. this.wireframeLinejoin = "round",
  46916. this.vertexColors = Ci.NoColors,
  46917. this.skinning = !1,
  46918. this.morphTargets = !1,
  46919. this.setValues(e)
  46920. }
  46921. ,
  46922. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46923. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46924. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46925. return Ci.Material.prototype.copy.call(this, e),
  46926. this.color.copy(e.color),
  46927. this.map = e.map,
  46928. this.aoMap = e.aoMap,
  46929. this.aoMapIntensity = e.aoMapIntensity,
  46930. this.specularMap = e.specularMap,
  46931. this.alphaMap = e.alphaMap,
  46932. this.envMap = e.envMap,
  46933. this.combine = e.combine,
  46934. this.reflectivity = e.reflectivity,
  46935. this.refractionRatio = e.refractionRatio,
  46936. this.fog = e.fog,
  46937. this.shading = e.shading,
  46938. this.wireframe = e.wireframe,
  46939. this.wireframeLinewidth = e.wireframeLinewidth,
  46940. this.wireframeLinecap = e.wireframeLinecap,
  46941. this.wireframeLinejoin = e.wireframeLinejoin,
  46942. this.vertexColors = e.vertexColors,
  46943. this.skinning = e.skinning,
  46944. this.morphTargets = e.morphTargets,
  46945. this
  46946. }
  46947. ,
  46948. Ci.MeshLambertMaterial = function(e) {
  46949. Ci.Material.call(this),
  46950. this.type = "MeshLambertMaterial",
  46951. this.color = new Ci.Color(16777215),
  46952. this.map = null,
  46953. this.lightMap = null,
  46954. this.lightMapIntensity = 1,
  46955. this.aoMap = null,
  46956. this.aoMapIntensity = 1,
  46957. this.emissive = new Ci.Color(0),
  46958. this.emissiveIntensity = 1,
  46959. this.emissiveMap = null,
  46960. this.specularMap = null,
  46961. this.alphaMap = null,
  46962. this.envMap = null,
  46963. this.combine = Ci.MultiplyOperation,
  46964. this.reflectivity = 1,
  46965. this.refractionRatio = .98,
  46966. this.fog = !0,
  46967. this.blending = Ci.NormalBlending,
  46968. this.wireframe = !1,
  46969. this.wireframeLinewidth = 1,
  46970. this.wireframeLinecap = "round",
  46971. this.wireframeLinejoin = "round",
  46972. this.vertexColors = Ci.NoColors,
  46973. this.skinning = !1,
  46974. this.morphTargets = !1,
  46975. this.morphNormals = !1,
  46976. this.setValues(e)
  46977. }
  46978. ,
  46979. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46980. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46981. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46982. return Ci.Material.prototype.copy.call(this, e),
  46983. this.color.copy(e.color),
  46984. this.map = e.map,
  46985. this.lightMap = e.lightMap,
  46986. this.lightMapIntensity = e.lightMapIntensity,
  46987. this.aoMap = e.aoMap,
  46988. this.aoMapIntensity = e.aoMapIntensity,
  46989. this.emissive.copy(e.emissive),
  46990. this.emissiveMap = e.emissiveMap,
  46991. this.emissiveIntensity = e.emissiveIntensity,
  46992. this.specularMap = e.specularMap,
  46993. this.alphaMap = e.alphaMap,
  46994. this.envMap = e.envMap,
  46995. this.combine = e.combine,
  46996. this.reflectivity = e.reflectivity,
  46997. this.refractionRatio = e.refractionRatio,
  46998. this.fog = e.fog,
  46999. this.wireframe = e.wireframe,
  47000. this.wireframeLinewidth = e.wireframeLinewidth,
  47001. this.wireframeLinecap = e.wireframeLinecap,
  47002. this.wireframeLinejoin = e.wireframeLinejoin,
  47003. this.vertexColors = e.vertexColors,
  47004. this.skinning = e.skinning,
  47005. this.morphTargets = e.morphTargets,
  47006. this.morphNormals = e.morphNormals,
  47007. this
  47008. }
  47009. ,
  47010. Ci.MeshPhongMaterial = function(e) {
  47011. Ci.Material.call(this),
  47012. this.type = "MeshPhongMaterial",
  47013. this.color = new Ci.Color(16777215),
  47014. this.specular = new Ci.Color(1118481),
  47015. this.shininess = 30,
  47016. this.map = null,
  47017. this.lightMap = null,
  47018. this.lightMapIntensity = 1,
  47019. this.aoMap = null,
  47020. this.aoMapIntensity = 1,
  47021. this.emissive = new Ci.Color(0),
  47022. this.emissiveIntensity = 1,
  47023. this.emissiveMap = null,
  47024. this.bumpMap = null,
  47025. this.bumpScale = 1,
  47026. this.normalMap = null,
  47027. this.normalScale = new Ci.Vector2(1,1),
  47028. this.displacementMap = null,
  47029. this.displacementScale = 1,
  47030. this.displacementBias = 0,
  47031. this.specularMap = null,
  47032. this.alphaMap = null,
  47033. this.envMap = null,
  47034. this.combine = Ci.MultiplyOperation,
  47035. this.reflectivity = 1,
  47036. this.refractionRatio = .98,
  47037. this.fog = !0,
  47038. this.shading = Ci.SmoothShading,
  47039. this.blending = Ci.NormalBlending,
  47040. this.wireframe = !1,
  47041. this.wireframeLinewidth = 1,
  47042. this.wireframeLinecap = "round",
  47043. this.wireframeLinejoin = "round",
  47044. this.vertexColors = Ci.NoColors,
  47045. this.skinning = !1,
  47046. this.morphTargets = !1,
  47047. this.morphNormals = !1,
  47048. this.setValues(e)
  47049. }
  47050. ,
  47051. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  47052. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  47053. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  47054. return Ci.Material.prototype.copy.call(this, e),
  47055. this.color.copy(e.color),
  47056. this.specular.copy(e.specular),
  47057. this.shininess = e.shininess,
  47058. this.map = e.map,
  47059. this.lightMap = e.lightMap,
  47060. this.lightMapIntensity = e.lightMapIntensity,
  47061. this.aoMap = e.aoMap,
  47062. this.aoMapIntensity = e.aoMapIntensity,
  47063. this.emissive.copy(e.emissive),
  47064. this.emissiveMap = e.emissiveMap,
  47065. this.emissiveIntensity = e.emissiveIntensity,
  47066. this.bumpMap = e.bumpMap,
  47067. this.bumpScale = e.bumpScale,
  47068. this.normalMap = e.normalMap,
  47069. this.normalScale.copy(e.normalScale),
  47070. this.displacementMap = e.displacementMap,
  47071. this.displacementScale = e.displacementScale,
  47072. this.displacementBias = e.displacementBias,
  47073. this.specularMap = e.specularMap,
  47074. this.alphaMap = e.alphaMap,
  47075. this.envMap = e.envMap,
  47076. this.combine = e.combine,
  47077. this.reflectivity = e.reflectivity,
  47078. this.refractionRatio = e.refractionRatio,
  47079. this.fog = e.fog,
  47080. this.shading = e.shading,
  47081. this.wireframe = e.wireframe,
  47082. this.wireframeLinewidth = e.wireframeLinewidth,
  47083. this.wireframeLinecap = e.wireframeLinecap,
  47084. this.wireframeLinejoin = e.wireframeLinejoin,
  47085. this.vertexColors = e.vertexColors,
  47086. this.skinning = e.skinning,
  47087. this.morphTargets = e.morphTargets,
  47088. this.morphNormals = e.morphNormals,
  47089. this
  47090. }
  47091. ,
  47092. Ci.MeshStandardMaterial = function(e) {
  47093. Ci.Material.call(this),
  47094. this.type = "MeshStandardMaterial",
  47095. this.color = new Ci.Color(16777215),
  47096. this.roughness = .5,
  47097. this.metalness = .5,
  47098. this.map = null,
  47099. this.lightMap = null,
  47100. this.lightMapIntensity = 1,
  47101. this.aoMap = null,
  47102. this.aoMapIntensity = 1,
  47103. this.emissive = new Ci.Color(0),
  47104. this.emissiveIntensity = 1,
  47105. this.emissiveMap = null,
  47106. this.bumpMap = null,
  47107. this.bumpScale = 1,
  47108. this.normalMap = null,
  47109. this.normalScale = new Ci.Vector2(1,1),
  47110. this.displacementMap = null,
  47111. this.displacementScale = 1,
  47112. this.displacementBias = 0,
  47113. this.roughnessMap = null,
  47114. this.metalnessMap = null,
  47115. this.alphaMap = null,
  47116. this.envMap = null,
  47117. this.envMapIntensity = 1,
  47118. this.refractionRatio = .98,
  47119. this.fog = !0,
  47120. this.shading = Ci.SmoothShading,
  47121. this.blending = Ci.NormalBlending,
  47122. this.wireframe = !1,
  47123. this.wireframeLinewidth = 1,
  47124. this.wireframeLinecap = "round",
  47125. this.wireframeLinejoin = "round",
  47126. this.vertexColors = Ci.NoColors,
  47127. this.skinning = !1,
  47128. this.morphTargets = !1,
  47129. this.morphNormals = !1,
  47130. this.setValues(e)
  47131. }
  47132. ,
  47133. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  47134. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  47135. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  47136. return Ci.Material.prototype.copy.call(this, e),
  47137. this.color.copy(e.color),
  47138. this.roughness = e.roughness,
  47139. this.metalness = e.metalness,
  47140. this.map = e.map,
  47141. this.lightMap = e.lightMap,
  47142. this.lightMapIntensity = e.lightMapIntensity,
  47143. this.aoMap = e.aoMap,
  47144. this.aoMapIntensity = e.aoMapIntensity,
  47145. this.emissive.copy(e.emissive),
  47146. this.emissiveMap = e.emissiveMap,
  47147. this.emissiveIntensity = e.emissiveIntensity,
  47148. this.bumpMap = e.bumpMap,
  47149. this.bumpScale = e.bumpScale,
  47150. this.normalMap = e.normalMap,
  47151. this.normalScale.copy(e.normalScale),
  47152. this.displacementMap = e.displacementMap,
  47153. this.displacementScale = e.displacementScale,
  47154. this.displacementBias = e.displacementBias,
  47155. this.roughnessMap = e.roughnessMap,
  47156. this.metalnessMap = e.metalnessMap,
  47157. this.alphaMap = e.alphaMap,
  47158. this.envMap = e.envMap,
  47159. this.envMapIntensity = e.envMapIntensity,
  47160. this.refractionRatio = e.refractionRatio,
  47161. this.fog = e.fog,
  47162. this.shading = e.shading,
  47163. this.wireframe = e.wireframe,
  47164. this.wireframeLinewidth = e.wireframeLinewidth,
  47165. this.wireframeLinecap = e.wireframeLinecap,
  47166. this.wireframeLinejoin = e.wireframeLinejoin,
  47167. this.vertexColors = e.vertexColors,
  47168. this.skinning = e.skinning,
  47169. this.morphTargets = e.morphTargets,
  47170. this.morphNormals = e.morphNormals,
  47171. this
  47172. }
  47173. ,
  47174. Ci.MeshDepthMaterial = function(e) {
  47175. Ci.Material.call(this),
  47176. this.type = "MeshDepthMaterial",
  47177. this.morphTargets = !1,
  47178. this.wireframe = !1,
  47179. this.wireframeLinewidth = 1,
  47180. this.setValues(e)
  47181. }
  47182. ,
  47183. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  47184. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  47185. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  47186. return Ci.Material.prototype.copy.call(this, e),
  47187. this.wireframe = e.wireframe,
  47188. this.wireframeLinewidth = e.wireframeLinewidth,
  47189. this
  47190. }
  47191. ,
  47192. Ci.MeshNormalMaterial = function(e) {
  47193. Ci.Material.call(this, e),
  47194. this.type = "MeshNormalMaterial",
  47195. this.wireframe = !1,
  47196. this.wireframeLinewidth = 1,
  47197. this.morphTargets = !1,
  47198. this.setValues(e)
  47199. }
  47200. ,
  47201. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  47202. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  47203. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  47204. return Ci.Material.prototype.copy.call(this, e),
  47205. this.wireframe = e.wireframe,
  47206. this.wireframeLinewidth = e.wireframeLinewidth,
  47207. this
  47208. }
  47209. ,
  47210. Ci.MultiMaterial = function(e) {
  47211. this.uuid = Ci.Math.generateUUID(),
  47212. this.type = "MultiMaterial",
  47213. this.materials = e instanceof Array ? e : [],
  47214. this.visible = !0
  47215. }
  47216. ,
  47217. Ci.MultiMaterial.prototype = {
  47218. constructor: Ci.MultiMaterial,
  47219. toJSON: function(e) {
  47220. for (var t = {
  47221. metadata: {
  47222. version: 4.2,
  47223. type: "material",
  47224. generator: "MaterialExporter"
  47225. },
  47226. uuid: this.uuid,
  47227. type: this.type,
  47228. materials: []
  47229. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47230. var o = i[n].toJSON(e);
  47231. delete o.metadata,
  47232. t.materials.push(o)
  47233. }
  47234. return t.visible = this.visible,
  47235. t
  47236. },
  47237. clone: function() {
  47238. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47239. e.materials.push(this.materials[t].clone());
  47240. return e.visible = this.visible,
  47241. e
  47242. }
  47243. },
  47244. Ci.PointsMaterial = function(e) {
  47245. Ci.Material.call(this),
  47246. this.type = "PointsMaterial",
  47247. this.color = new Ci.Color(16777215),
  47248. this.map = null,
  47249. this.size = 1,
  47250. this.sizeAttenuation = !0,
  47251. this.blending = Ci.NormalBlending,
  47252. this.vertexColors = Ci.NoColors,
  47253. this.fog = !0,
  47254. this.setValues(e)
  47255. }
  47256. ,
  47257. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  47258. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  47259. Ci.PointsMaterial.prototype.copy = function(e) {
  47260. return Ci.Material.prototype.copy.call(this, e),
  47261. this.color.copy(e.color),
  47262. this.map = e.map,
  47263. this.size = e.size,
  47264. this.sizeAttenuation = e.sizeAttenuation,
  47265. this.vertexColors = e.vertexColors,
  47266. this.fog = e.fog,
  47267. this
  47268. }
  47269. ,
  47270. Ci.ShaderMaterial = function(e) {
  47271. Ci.Material.call(this),
  47272. this.type = "ShaderMaterial",
  47273. this.defines = {},
  47274. this.uniforms = {},
  47275. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47276. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47277. this.shading = Ci.SmoothShading,
  47278. this.linewidth = 1,
  47279. this.wireframe = !1,
  47280. this.wireframeLinewidth = 1,
  47281. this.fog = !1,
  47282. this.lights = !1,
  47283. this.vertexColors = Ci.NoColors,
  47284. this.skinning = !1,
  47285. this.morphTargets = !1,
  47286. this.morphNormals = !1,
  47287. this.extensions = {
  47288. derivatives: !1,
  47289. fragDepth: !1,
  47290. drawBuffers: !1,
  47291. shaderTextureLOD: !1
  47292. },
  47293. this.defaultAttributeValues = {
  47294. color: [1, 1, 1],
  47295. uv: [0, 0],
  47296. uv2: [0, 0]
  47297. },
  47298. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47299. this.setValues(e))
  47300. }
  47301. ,
  47302. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  47303. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  47304. Ci.ShaderMaterial.prototype.copy = function(e) {
  47305. return Ci.Material.prototype.copy.call(this, e),
  47306. this.fragmentShader = e.fragmentShader,
  47307. this.vertexShader = e.vertexShader,
  47308. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  47309. this.defines = e.defines,
  47310. this.shading = e.shading,
  47311. this.wireframe = e.wireframe,
  47312. this.wireframeLinewidth = e.wireframeLinewidth,
  47313. this.fog = e.fog,
  47314. this.lights = e.lights,
  47315. this.vertexColors = e.vertexColors,
  47316. this.skinning = e.skinning,
  47317. this.morphTargets = e.morphTargets,
  47318. this.morphNormals = e.morphNormals,
  47319. this.extensions = e.extensions,
  47320. this
  47321. }
  47322. ,
  47323. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  47324. var t = Ci.Material.prototype.toJSON.call(this, e);
  47325. return t.uniforms = this.uniforms,
  47326. t.vertexShader = this.vertexShader,
  47327. t.fragmentShader = this.fragmentShader,
  47328. t
  47329. }
  47330. ,
  47331. Ci.RawShaderMaterial = function(e) {
  47332. Ci.ShaderMaterial.call(this, e),
  47333. this.type = "RawShaderMaterial"
  47334. }
  47335. ,
  47336. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  47337. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  47338. Ci.SpriteMaterial = function(e) {
  47339. Ci.Material.call(this),
  47340. this.type = "SpriteMaterial",
  47341. this.color = new Ci.Color(16777215),
  47342. this.map = null,
  47343. this.rotation = 0,
  47344. this.fog = !1,
  47345. this.setValues(e)
  47346. }
  47347. ,
  47348. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  47349. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  47350. Ci.SpriteMaterial.prototype.copy = function(e) {
  47351. return Ci.Material.prototype.copy.call(this, e),
  47352. this.color.copy(e.color),
  47353. this.map = e.map,
  47354. this.rotation = e.rotation,
  47355. this.fog = e.fog,
  47356. this
  47357. }
  47358. ,
  47359. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  47360. Object.defineProperty(this, "id", {
  47361. value: Ci.TextureIdCount++
  47362. }),
  47363. this.uuid = Ci.Math.generateUUID(),
  47364. this.name = "",
  47365. this.sourceFile = "",
  47366. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  47367. this.mipmaps = [],
  47368. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  47369. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  47370. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  47371. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  47372. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  47373. this.anisotropy = void 0 !== l ? l : 1,
  47374. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  47375. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  47376. this.offset = new Ci.Vector2(0,0),
  47377. this.repeat = new Ci.Vector2(1,1),
  47378. this.generateMipmaps = !0,
  47379. this.premultiplyAlpha = !1,
  47380. this.flipY = !0,
  47381. this.unpackAlignment = 4,
  47382. this.encoding = Ci.LinearEncoding,
  47383. this.version = 0,
  47384. this.onUpdate = null
  47385. }
  47386. ,
  47387. Ci.Texture.DEFAULT_IMAGE = void 0,
  47388. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  47389. Ci.Texture.prototype = {
  47390. constructor: Ci.Texture,
  47391. set needsUpdate(e) {
  47392. !0 === e && this.version++
  47393. },
  47394. clone: function() {
  47395. return (new this.constructor).copy(this)
  47396. },
  47397. copy: function(e) {
  47398. return this.image = e.image,
  47399. this.mipmaps = e.mipmaps.slice(0),
  47400. this.mapping = e.mapping,
  47401. this.wrapS = e.wrapS,
  47402. this.wrapT = e.wrapT,
  47403. this.magFilter = e.magFilter,
  47404. this.minFilter = e.minFilter,
  47405. this.anisotropy = e.anisotropy,
  47406. this.format = e.format,
  47407. this.type = e.type,
  47408. this.offset.copy(e.offset),
  47409. this.repeat.copy(e.repeat),
  47410. this.generateMipmaps = e.generateMipmaps,
  47411. this.premultiplyAlpha = e.premultiplyAlpha,
  47412. this.flipY = e.flipY,
  47413. this.unpackAlignment = e.unpackAlignment,
  47414. this.encoding = e.encoding,
  47415. this
  47416. },
  47417. toJSON: function(e) {
  47418. if (void 0 !== e.textures[this.uuid])
  47419. return e.textures[this.uuid];
  47420. var t, i, n = {
  47421. metadata: {
  47422. version: 4.4,
  47423. type: "Texture",
  47424. generator: "Texture.toJSON"
  47425. },
  47426. uuid: this.uuid,
  47427. name: this.name,
  47428. mapping: this.mapping,
  47429. repeat: [this.repeat.x, this.repeat.y],
  47430. offset: [this.offset.x, this.offset.y],
  47431. wrap: [this.wrapS, this.wrapT],
  47432. minFilter: this.minFilter,
  47433. magFilter: this.magFilter,
  47434. anisotropy: this.anisotropy
  47435. };
  47436. if (void 0 !== this.image) {
  47437. var r = this.image;
  47438. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  47439. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47440. uuid: r.uuid,
  47441. url: (t = r,
  47442. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  47443. i.height = t.height,
  47444. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  47445. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  47446. }),
  47447. n.image = r.uuid
  47448. }
  47449. return e.textures[this.uuid] = n
  47450. },
  47451. dispose: function() {
  47452. this.dispatchEvent({
  47453. type: "dispose"
  47454. })
  47455. },
  47456. transformUv: function(e) {
  47457. if (this.mapping === Ci.UVMapping) {
  47458. if (e.multiply(this.repeat),
  47459. e.add(this.offset),
  47460. e.x < 0 || 1 < e.x)
  47461. switch (this.wrapS) {
  47462. case Ci.RepeatWrapping:
  47463. e.x = e.x - Math.floor(e.x);
  47464. break;
  47465. case Ci.ClampToEdgeWrapping:
  47466. e.x = e.x < 0 ? 0 : 1;
  47467. break;
  47468. case Ci.MirroredRepeatWrapping:
  47469. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47470. }
  47471. if (e.y < 0 || 1 < e.y)
  47472. switch (this.wrapT) {
  47473. case Ci.RepeatWrapping:
  47474. e.y = e.y - Math.floor(e.y);
  47475. break;
  47476. case Ci.ClampToEdgeWrapping:
  47477. e.y = e.y < 0 ? 0 : 1;
  47478. break;
  47479. case Ci.MirroredRepeatWrapping:
  47480. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47481. }
  47482. this.flipY && (e.y = 1 - e.y)
  47483. }
  47484. }
  47485. },
  47486. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47487. Ci.TextureIdCount = 0,
  47488. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47489. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47490. this.needsUpdate = !0
  47491. }
  47492. ,
  47493. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47494. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47495. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47496. e = void 0 !== e ? e : [],
  47497. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47498. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47499. this.flipY = !1
  47500. }
  47501. ,
  47502. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47503. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47504. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47505. get: function() {
  47506. return this.image
  47507. },
  47508. set: function(e) {
  47509. this.image = e
  47510. }
  47511. }),
  47512. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47513. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47514. this.image = {
  47515. width: t,
  47516. height: i
  47517. },
  47518. this.mipmaps = e,
  47519. this.flipY = !1,
  47520. this.generateMipmaps = !1
  47521. }
  47522. ,
  47523. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47524. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47525. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47526. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47527. this.image = {
  47528. data: e,
  47529. width: t,
  47530. height: i
  47531. },
  47532. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47533. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47534. this.flipY = !1,
  47535. this.generateMipmaps = !1
  47536. }
  47537. ,
  47538. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47539. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47540. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47541. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47542. this.generateMipmaps = !1;
  47543. var c = this;
  47544. !function e() {
  47545. requestAnimationFrame(e),
  47546. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47547. }()
  47548. }
  47549. ,
  47550. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47551. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47552. Ci.Group = function() {
  47553. Ci.Object3D.call(this),
  47554. this.type = "Group"
  47555. }
  47556. ,
  47557. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47558. Ci.Group.prototype.constructor = Ci.Group,
  47559. Ci.Points = function(e, t) {
  47560. Ci.Object3D.call(this),
  47561. this.type = "Points",
  47562. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47563. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47564. color: 16777215 * Math.random()
  47565. })
  47566. }
  47567. ,
  47568. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47569. Ci.Points.prototype.constructor = Ci.Points,
  47570. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47571. jt = new Ci.Ray,
  47572. Yt = new Ci.Sphere,
  47573. function(o, a) {
  47574. function e(e, t) {
  47575. var i = jt.distanceSqToPoint(e);
  47576. if (i < c) {
  47577. var n = jt.closestPointToPoint(e);
  47578. n.applyMatrix4(l);
  47579. var r = o.ray.origin.distanceTo(n);
  47580. if (r < o.near || r > o.far)
  47581. return;
  47582. a.push({
  47583. distance: r,
  47584. distanceToRay: Math.sqrt(i),
  47585. point: n.clone(),
  47586. index: t,
  47587. face: null,
  47588. object: s
  47589. })
  47590. }
  47591. }
  47592. var s = this
  47593. , t = this.geometry
  47594. , l = this.matrixWorld
  47595. , i = o.params.Points.threshold;
  47596. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47597. Yt.copy(t.boundingSphere),
  47598. Yt.applyMatrix4(l),
  47599. !1 !== o.ray.intersectsSphere(Yt)) {
  47600. Wt.getInverse(l),
  47601. jt.copy(o.ray).applyMatrix4(Wt);
  47602. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47603. , c = n * n
  47604. , r = new Ci.Vector3;
  47605. if (t instanceof Ci.BufferGeometry) {
  47606. var h = t.index
  47607. , u = t.attributes.position.array;
  47608. if (null !== h)
  47609. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47610. var g = d[p];
  47611. r.fromArray(u, 3 * g),
  47612. e(r, g)
  47613. }
  47614. else {
  47615. p = 0;
  47616. for (var m = u.length / 3; p < m; p++)
  47617. r.fromArray(u, 3 * p),
  47618. e(r, p)
  47619. }
  47620. } else {
  47621. var v = t.vertices;
  47622. for (p = 0,
  47623. m = v.length; p < m; p++)
  47624. e(v[p], p)
  47625. }
  47626. }
  47627. }
  47628. ),
  47629. Ci.Points.prototype.clone = function() {
  47630. return new this.constructor(this.geometry,this.material).copy(this)
  47631. }
  47632. ,
  47633. Ci.Line = function(e, t, i) {
  47634. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47635. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47636. this.type = "Line",
  47637. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47638. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47639. color: 16777215 * Math.random()
  47640. })))
  47641. }
  47642. ,
  47643. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47644. Ci.Line.prototype.constructor = Ci.Line,
  47645. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47646. zt = new Ci.Ray,
  47647. Gt = new Ci.Sphere,
  47648. function(e, t) {
  47649. var i = e.linePrecision
  47650. , n = i * i
  47651. , r = this.geometry
  47652. , o = this.matrixWorld;
  47653. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47654. Gt.copy(r.boundingSphere),
  47655. Gt.applyMatrix4(o),
  47656. !1 !== e.ray.intersectsSphere(Gt)) {
  47657. Ht.getInverse(o),
  47658. zt.copy(e.ray).applyMatrix4(Ht);
  47659. var a = new Ci.Vector3
  47660. , s = new Ci.Vector3
  47661. , l = new Ci.Vector3
  47662. , c = new Ci.Vector3
  47663. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47664. if (r instanceof Ci.BufferGeometry) {
  47665. var u = r.index
  47666. , d = r.attributes.position.array;
  47667. if (null !== u)
  47668. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47669. var m = p[f]
  47670. , v = p[f + 1];
  47671. a.fromArray(d, 3 * m),
  47672. s.fromArray(d, 3 * v),
  47673. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47674. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47675. distance: C,
  47676. point: l.clone().applyMatrix4(this.matrixWorld),
  47677. index: f,
  47678. face: null,
  47679. faceIndex: null,
  47680. object: this
  47681. }))
  47682. }
  47683. else
  47684. for (f = 0,
  47685. g = d.length / 3 - 1; f < g; f += h)
  47686. a.fromArray(d, 3 * f),
  47687. s.fromArray(d, 3 * f + 3),
  47688. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47689. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47690. distance: C,
  47691. point: l.clone().applyMatrix4(this.matrixWorld),
  47692. index: f,
  47693. face: null,
  47694. faceIndex: null,
  47695. object: this
  47696. }))
  47697. } else if (r instanceof Ci.Geometry) {
  47698. var y = r.vertices
  47699. , A = y.length;
  47700. for (f = 0; f < A - 1; f += h) {
  47701. var C;
  47702. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47703. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47704. distance: C,
  47705. point: l.clone().applyMatrix4(this.matrixWorld),
  47706. index: f,
  47707. face: null,
  47708. faceIndex: null,
  47709. object: this
  47710. }))
  47711. }
  47712. }
  47713. }
  47714. }
  47715. ),
  47716. Ci.Line.prototype.clone = function() {
  47717. return new this.constructor(this.geometry,this.material).copy(this)
  47718. }
  47719. ,
  47720. Ci.LineStrip = 0,
  47721. Ci.LinePieces = 1,
  47722. Ci.LineSegments = function(e, t) {
  47723. Ci.Line.call(this, e, t),
  47724. this.type = "LineSegments"
  47725. }
  47726. ,
  47727. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47728. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47729. Ci.Mesh = function(e, t) {
  47730. Ci.Object3D.call(this),
  47731. this.type = "Mesh",
  47732. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47733. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47734. color: 16777215 * Math.random()
  47735. }),
  47736. this.drawMode = Ci.TrianglesDrawMode,
  47737. this.updateMorphTargets()
  47738. }
  47739. ,
  47740. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47741. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47742. Ci.Mesh.prototype.setDrawMode = function(e) {
  47743. this.drawMode = e
  47744. }
  47745. ,
  47746. Ci.Mesh.prototype.updateMorphTargets = function() {
  47747. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47748. this.morphTargetBase = -1,
  47749. this.morphTargetInfluences = [],
  47750. this.morphTargetDictionary = {};
  47751. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47752. this.morphTargetInfluences.push(0),
  47753. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47754. }
  47755. }
  47756. ,
  47757. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47758. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47759. 0)
  47760. }
  47761. ,
  47762. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47763. xt = new Ci.Ray,
  47764. St = new Ci.Sphere,
  47765. Mt = new Ci.Vector3,
  47766. Rt = new Ci.Vector3,
  47767. Pt = new Ci.Vector3,
  47768. Ot = new Ci.Vector3,
  47769. Lt = new Ci.Vector3,
  47770. Dt = new Ci.Vector3,
  47771. Nt = new Ci.Vector2,
  47772. Ft = new Ci.Vector2,
  47773. Bt = new Ci.Vector2,
  47774. Vt = new Ci.Vector3,
  47775. kt = new Ci.Vector3,
  47776. Ut = new Ci.Vector3,
  47777. function(e, t) {
  47778. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47779. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47780. St.copy(r.boundingSphere),
  47781. St.applyMatrix4(a),
  47782. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47783. xt.copy(e.ray).applyMatrix4(Tt),
  47784. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47785. if (r instanceof Ci.BufferGeometry) {
  47786. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47787. if (void 0 !== u.uv && (i = u.uv.array),
  47788. null !== h)
  47789. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47790. s = p[f],
  47791. l = p[f + 1],
  47792. c = p[f + 2],
  47793. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47794. t.push(n));
  47795. else
  47796. for (f = 0,
  47797. g = d.length; f < g; f += 9)
  47798. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47799. t.push(n))
  47800. } else if (r instanceof Ci.Geometry) {
  47801. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47802. 0 < _.length && (i = _);
  47803. for (var b = 0, w = E.length; b < w; b++) {
  47804. var T = E[b]
  47805. , x = 1 == A ? C[T.materialIndex] : o;
  47806. if (void 0 !== x) {
  47807. if (m = I[T.a],
  47808. v = I[T.b],
  47809. y = I[T.c],
  47810. !0 === x.morphTargets) {
  47811. var S = r.morphTargets
  47812. , M = this.morphTargetInfluences;
  47813. Mt.set(0, 0, 0),
  47814. Rt.set(0, 0, 0),
  47815. Pt.set(0, 0, 0);
  47816. for (var R = 0, P = S.length; R < P; R++) {
  47817. var O = M[R];
  47818. if (0 !== O) {
  47819. var L = S[R].vertices;
  47820. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47821. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47822. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47823. }
  47824. }
  47825. Mt.add(m),
  47826. Rt.add(v),
  47827. Pt.add(y),
  47828. m = Mt,
  47829. v = Rt,
  47830. y = Pt
  47831. }
  47832. if (n = wi(this, e, xt, m, v, y, kt)) {
  47833. if (i) {
  47834. var D = i[b];
  47835. Nt.copy(D[0]),
  47836. Ft.copy(D[1]),
  47837. Bt.copy(D[2]),
  47838. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47839. }
  47840. n.face = T,
  47841. n.faceIndex = b,
  47842. t.push(n)
  47843. }
  47844. }
  47845. }
  47846. }
  47847. }
  47848. ),
  47849. Ci.Mesh.prototype.clone = function() {
  47850. return new this.constructor(this.geometry,this.material).copy(this)
  47851. }
  47852. ,
  47853. Ci.Bone = function(e) {
  47854. Ci.Object3D.call(this),
  47855. this.type = "Bone",
  47856. this.skin = e
  47857. }
  47858. ,
  47859. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47860. Ci.Bone.prototype.constructor = Ci.Bone,
  47861. Ci.Bone.prototype.copy = function(e) {
  47862. return Ci.Object3D.prototype.copy.call(this, e),
  47863. this.skin = e.skin,
  47864. this
  47865. }
  47866. ,
  47867. Ci.Skeleton = function(e, t, i) {
  47868. if (this.useVertexTexture = void 0 === i || i,
  47869. this.identityMatrix = new Ci.Matrix4,
  47870. e = e || [],
  47871. this.bones = e.slice(0),
  47872. this.useVertexTexture) {
  47873. var n = Math.sqrt(4 * this.bones.length);
  47874. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47875. n = Math.max(n, 4),
  47876. this.boneTextureWidth = n,
  47877. this.boneTextureHeight = n,
  47878. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47879. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47880. } else
  47881. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47882. if (void 0 === t)
  47883. this.calculateInverses();
  47884. else if (this.bones.length === t.length)
  47885. this.boneInverses = t.slice(0);
  47886. else {
  47887. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47888. this.boneInverses = [];
  47889. for (var r = 0, o = this.bones.length; r < o; r++)
  47890. this.boneInverses.push(new Ci.Matrix4)
  47891. }
  47892. }
  47893. ,
  47894. Ci.Skeleton.prototype.calculateInverses = function() {
  47895. this.boneInverses = [];
  47896. for (var e = 0, t = this.bones.length; e < t; e++) {
  47897. var i = new Ci.Matrix4;
  47898. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47899. this.boneInverses.push(i)
  47900. }
  47901. }
  47902. ,
  47903. Ci.Skeleton.prototype.pose = function() {
  47904. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47905. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47906. for (t = 0,
  47907. i = this.bones.length; t < i; t++)
  47908. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47909. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47910. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47911. }
  47912. ,
  47913. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47914. function() {
  47915. for (var e = 0, t = this.bones.length; e < t; e++) {
  47916. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47917. wt.multiplyMatrices(i, this.boneInverses[e]),
  47918. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47919. }
  47920. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47921. }
  47922. ),
  47923. Ci.Skeleton.prototype.clone = function() {
  47924. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47925. }
  47926. ,
  47927. Ci.SkinnedMesh = function(e, t, i) {
  47928. Ci.Mesh.call(this, e, t),
  47929. this.type = "SkinnedMesh",
  47930. this.bindMode = "attached",
  47931. this.bindMatrix = new Ci.Matrix4,
  47932. this.bindMatrixInverse = new Ci.Matrix4;
  47933. var n = [];
  47934. if (this.geometry && void 0 !== this.geometry.bones) {
  47935. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47936. o = this.geometry.bones[a],
  47937. r = new Ci.Bone(this),
  47938. n.push(r),
  47939. r.name = o.name,
  47940. r.position.fromArray(o.pos),
  47941. r.quaternion.fromArray(o.rotq),
  47942. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47943. for (a = 0,
  47944. s = this.geometry.bones.length; a < s; ++a)
  47945. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47946. }
  47947. this.normalizeSkinWeights(),
  47948. this.updateMatrixWorld(!0),
  47949. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47950. }
  47951. ,
  47952. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47953. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47954. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47955. this.skeleton = e,
  47956. void 0 === t && (this.updateMatrixWorld(!0),
  47957. this.skeleton.calculateInverses(),
  47958. t = this.matrixWorld),
  47959. this.bindMatrix.copy(t),
  47960. this.bindMatrixInverse.getInverse(t)
  47961. }
  47962. ,
  47963. Ci.SkinnedMesh.prototype.pose = function() {
  47964. this.skeleton.pose()
  47965. }
  47966. ,
  47967. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47968. if (this.geometry instanceof Ci.Geometry)
  47969. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47970. var t = this.geometry.skinWeights[e];
  47971. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47972. }
  47973. else if (this.geometry instanceof Ci.BufferGeometry) {
  47974. var i = new Ci.Vector4
  47975. , n = this.geometry.attributes.skinWeight;
  47976. for (e = 0; e < n.count; e++) {
  47977. var r;
  47978. i.x = n.getX(e),
  47979. i.y = n.getY(e),
  47980. i.z = n.getZ(e),
  47981. i.w = n.getW(e),
  47982. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47983. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47984. }
  47985. }
  47986. }
  47987. ,
  47988. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47989. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47990. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47991. }
  47992. ,
  47993. Ci.SkinnedMesh.prototype.clone = function() {
  47994. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47995. }
  47996. ,
  47997. Ci.LOD = function() {
  47998. Ci.Object3D.call(this),
  47999. this.type = "LOD",
  48000. Object.defineProperties(this, {
  48001. levels: {
  48002. enumerable: !0,
  48003. value: []
  48004. },
  48005. objects: {
  48006. get: function() {
  48007. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  48008. this.levels
  48009. }
  48010. }
  48011. })
  48012. }
  48013. ,
  48014. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  48015. Ci.LOD.prototype.constructor = Ci.LOD,
  48016. Ci.LOD.prototype.addLevel = function(e, t) {
  48017. void 0 === t && (t = 0),
  48018. t = Math.abs(t);
  48019. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  48020. ;
  48021. i.splice(n, 0, {
  48022. distance: t,
  48023. object: e
  48024. }),
  48025. this.add(e)
  48026. }
  48027. ,
  48028. Ci.LOD.prototype.getObjectForDistance = function(e) {
  48029. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  48030. ;
  48031. return t[i - 1].object
  48032. }
  48033. ,
  48034. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  48035. function(e, t) {
  48036. bt.setFromMatrixPosition(this.matrixWorld);
  48037. var i = e.ray.origin.distanceTo(bt);
  48038. this.getObjectForDistance(i).raycast(e, t)
  48039. }
  48040. ),
  48041. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  48042. _t = new Ci.Vector3,
  48043. function(e) {
  48044. var t = this.levels;
  48045. if (1 < t.length) {
  48046. Et.setFromMatrixPosition(e.matrixWorld),
  48047. _t.setFromMatrixPosition(this.matrixWorld);
  48048. var i = Et.distanceTo(_t);
  48049. t[0].object.visible = !0;
  48050. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  48051. t[n - 1].object.visible = !1,
  48052. t[n].object.visible = !0;
  48053. for (; n < r; n++)
  48054. t[n].object.visible = !1
  48055. }
  48056. }
  48057. ),
  48058. Ci.LOD.prototype.copy = function(e) {
  48059. Ci.Object3D.prototype.copy.call(this, e, !1);
  48060. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  48061. var r = t[i];
  48062. this.addLevel(r.object.clone(), r.distance)
  48063. }
  48064. return this
  48065. }
  48066. ,
  48067. Ci.LOD.prototype.toJSON = function(e) {
  48068. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  48069. t.object.levels = [];
  48070. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  48071. var o = i[n];
  48072. t.object.levels.push({
  48073. object: o.object.uuid,
  48074. distance: o.distance
  48075. })
  48076. }
  48077. return t
  48078. }
  48079. ,
  48080. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  48081. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  48082. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  48083. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  48084. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  48085. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  48086. function(e) {
  48087. Ci.Object3D.call(this),
  48088. this.type = "Sprite",
  48089. this.geometry = It,
  48090. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  48091. }
  48092. ),
  48093. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  48094. Ci.Sprite.prototype.constructor = Ci.Sprite,
  48095. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  48096. function(e, t) {
  48097. vt.setFromMatrixPosition(this.matrixWorld);
  48098. var i = e.ray.distanceSqToPoint(vt);
  48099. this.scale.x * this.scale.y < i || t.push({
  48100. distance: Math.sqrt(i),
  48101. point: this.position,
  48102. face: null,
  48103. object: this
  48104. })
  48105. }
  48106. ),
  48107. Ci.Sprite.prototype.clone = function() {
  48108. return new this.constructor(this.material).copy(this)
  48109. }
  48110. ,
  48111. Ci.Particle = Ci.Sprite,
  48112. Ci.LensFlare = function(e, t, i, n, r) {
  48113. Ci.Object3D.call(this),
  48114. this.lensFlares = [],
  48115. this.positionScreen = new Ci.Vector3,
  48116. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  48117. }
  48118. ,
  48119. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  48120. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  48121. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  48122. void 0 === t && (t = -1),
  48123. void 0 === i && (i = 0),
  48124. void 0 === o && (o = 1),
  48125. void 0 === r && (r = new Ci.Color(16777215)),
  48126. void 0 === n && (n = Ci.NormalBlending),
  48127. i = Math.min(i, Math.max(0, i)),
  48128. this.lensFlares.push({
  48129. texture: e,
  48130. size: t,
  48131. distance: i,
  48132. x: 0,
  48133. y: 0,
  48134. z: 0,
  48135. scale: 1,
  48136. rotation: 0,
  48137. opacity: o,
  48138. color: r,
  48139. blending: n
  48140. })
  48141. }
  48142. ,
  48143. Ci.LensFlare.prototype.updateLensFlares = function() {
  48144. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48145. for (e = 0; e < i; e++)
  48146. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  48147. t.y = this.positionScreen.y + r * t.distance,
  48148. t.wantedRotation = t.x * Math.PI * .25,
  48149. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48150. }
  48151. ,
  48152. Ci.LensFlare.prototype.copy = function(e) {
  48153. Ci.Object3D.prototype.copy.call(this, e),
  48154. this.positionScreen.copy(e.positionScreen),
  48155. this.customUpdateCallback = e.customUpdateCallback;
  48156. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48157. this.lensFlares.push(e.lensFlares[t]);
  48158. return this
  48159. }
  48160. ,
  48161. Ci.Scene = function() {
  48162. Ci.Object3D.call(this),
  48163. this.type = "Scene",
  48164. this.fog = null,
  48165. this.overrideMaterial = null,
  48166. this.autoUpdate = !0
  48167. }
  48168. ,
  48169. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  48170. Ci.Scene.prototype.constructor = Ci.Scene,
  48171. Ci.Scene.prototype.copy = function(e, t) {
  48172. return Ci.Object3D.prototype.copy.call(this, e, t),
  48173. null !== e.fog && (this.fog = e.fog.clone()),
  48174. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48175. this.autoUpdate = e.autoUpdate,
  48176. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48177. this
  48178. }
  48179. ,
  48180. Ci.Fog = function(e, t, i) {
  48181. this.name = "",
  48182. this.color = new Ci.Color(e),
  48183. this.near = void 0 !== t ? t : 1,
  48184. this.far = void 0 !== i ? i : 1e3
  48185. }
  48186. ,
  48187. Ci.Fog.prototype.clone = function() {
  48188. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  48189. }
  48190. ,
  48191. Ci.FogExp2 = function(e, t) {
  48192. this.name = "",
  48193. this.color = new Ci.Color(e),
  48194. this.density = void 0 !== t ? t : 25e-5
  48195. }
  48196. ,
  48197. Ci.FogExp2.prototype.clone = function() {
  48198. return new Ci.FogExp2(this.color.getHex(),this.density)
  48199. }
  48200. ,
  48201. Ci.ShaderChunk = {},
  48202. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48203. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48204. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48205. 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",
  48206. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48207. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48208. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48209. 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",
  48210. 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",
  48211. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48212. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48213. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48214. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48215. 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",
  48216. 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",
  48217. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48218. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48219. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48220. 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",
  48221. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48222. 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",
  48223. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48224. 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",
  48225. 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",
  48226. 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",
  48227. 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",
  48228. 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",
  48229. 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",
  48230. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48231. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48232. 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",
  48233. 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",
  48234. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48235. 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",
  48236. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48237. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48238. 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",
  48239. 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",
  48240. 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",
  48241. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48242. 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",
  48243. 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",
  48244. 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",
  48245. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48246. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48247. 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",
  48248. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48249. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48250. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48251. 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",
  48252. 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",
  48253. 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",
  48254. 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",
  48255. 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",
  48256. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48257. 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",
  48258. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48259. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48260. 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",
  48261. 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",
  48262. 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",
  48263. 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",
  48264. 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",
  48265. 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",
  48266. 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",
  48267. 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",
  48268. 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",
  48269. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48270. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48271. 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",
  48272. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48273. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48274. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48275. 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",
  48276. 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",
  48277. 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",
  48278. 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",
  48279. Ci.UniformsUtils = {
  48280. merge: function(e) {
  48281. for (var t = {}, i = 0; i < e.length; i++) {
  48282. var n = this.clone(e[i]);
  48283. for (var r in n)
  48284. t[r] = n[r]
  48285. }
  48286. return t
  48287. },
  48288. clone: function(e) {
  48289. var t = {};
  48290. for (var i in e)
  48291. for (var n in t[i] = {},
  48292. e[i]) {
  48293. var r = e[i][n];
  48294. 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
  48295. }
  48296. return t
  48297. }
  48298. },
  48299. Ci.UniformsLib = {
  48300. common: {
  48301. diffuse: {
  48302. type: "c",
  48303. value: new Ci.Color(15658734)
  48304. },
  48305. opacity: {
  48306. type: "f",
  48307. value: 1
  48308. },
  48309. map: {
  48310. type: "t",
  48311. value: null
  48312. },
  48313. offsetRepeat: {
  48314. type: "v4",
  48315. value: new Ci.Vector4(0,0,1,1)
  48316. },
  48317. specularMap: {
  48318. type: "t",
  48319. value: null
  48320. },
  48321. alphaMap: {
  48322. type: "t",
  48323. value: null
  48324. },
  48325. envMap: {
  48326. type: "t",
  48327. value: null
  48328. },
  48329. flipEnvMap: {
  48330. type: "f",
  48331. value: -1
  48332. },
  48333. reflectivity: {
  48334. type: "f",
  48335. value: 1
  48336. },
  48337. refractionRatio: {
  48338. type: "f",
  48339. value: .98
  48340. }
  48341. },
  48342. aomap: {
  48343. aoMap: {
  48344. type: "t",
  48345. value: null
  48346. },
  48347. aoMapIntensity: {
  48348. type: "f",
  48349. value: 1
  48350. }
  48351. },
  48352. lightmap: {
  48353. lightMap: {
  48354. type: "t",
  48355. value: null
  48356. },
  48357. lightMapIntensity: {
  48358. type: "f",
  48359. value: 1
  48360. }
  48361. },
  48362. emissivemap: {
  48363. emissiveMap: {
  48364. type: "t",
  48365. value: null
  48366. }
  48367. },
  48368. bumpmap: {
  48369. bumpMap: {
  48370. type: "t",
  48371. value: null
  48372. },
  48373. bumpScale: {
  48374. type: "f",
  48375. value: 1
  48376. }
  48377. },
  48378. normalmap: {
  48379. normalMap: {
  48380. type: "t",
  48381. value: null
  48382. },
  48383. normalScale: {
  48384. type: "v2",
  48385. value: new Ci.Vector2(1,1)
  48386. }
  48387. },
  48388. displacementmap: {
  48389. displacementMap: {
  48390. type: "t",
  48391. value: null
  48392. },
  48393. displacementScale: {
  48394. type: "f",
  48395. value: 1
  48396. },
  48397. displacementBias: {
  48398. type: "f",
  48399. value: 0
  48400. }
  48401. },
  48402. roughnessmap: {
  48403. roughnessMap: {
  48404. type: "t",
  48405. value: null
  48406. }
  48407. },
  48408. metalnessmap: {
  48409. metalnessMap: {
  48410. type: "t",
  48411. value: null
  48412. }
  48413. },
  48414. fog: {
  48415. fogDensity: {
  48416. type: "f",
  48417. value: 25e-5
  48418. },
  48419. fogNear: {
  48420. type: "f",
  48421. value: 1
  48422. },
  48423. fogFar: {
  48424. type: "f",
  48425. value: 2e3
  48426. },
  48427. fogColor: {
  48428. type: "c",
  48429. value: new Ci.Color(16777215)
  48430. }
  48431. },
  48432. lights: {
  48433. ambientLightColor: {
  48434. type: "fv",
  48435. value: []
  48436. },
  48437. directionalLights: {
  48438. type: "sa",
  48439. value: [],
  48440. properties: {
  48441. direction: {
  48442. type: "v3"
  48443. },
  48444. color: {
  48445. type: "c"
  48446. },
  48447. shadow: {
  48448. type: "i"
  48449. },
  48450. shadowBias: {
  48451. type: "f"
  48452. },
  48453. shadowRadius: {
  48454. type: "f"
  48455. },
  48456. shadowMapSize: {
  48457. type: "v2"
  48458. }
  48459. }
  48460. },
  48461. directionalShadowMap: {
  48462. type: "tv",
  48463. value: []
  48464. },
  48465. directionalShadowMatrix: {
  48466. type: "m4v",
  48467. value: []
  48468. },
  48469. spotLights: {
  48470. type: "sa",
  48471. value: [],
  48472. properties: {
  48473. color: {
  48474. type: "c"
  48475. },
  48476. position: {
  48477. type: "v3"
  48478. },
  48479. direction: {
  48480. type: "v3"
  48481. },
  48482. distance: {
  48483. type: "f"
  48484. },
  48485. coneCos: {
  48486. type: "f"
  48487. },
  48488. penumbraCos: {
  48489. type: "f"
  48490. },
  48491. decay: {
  48492. type: "f"
  48493. },
  48494. shadow: {
  48495. type: "i"
  48496. },
  48497. shadowBias: {
  48498. type: "f"
  48499. },
  48500. shadowRadius: {
  48501. type: "f"
  48502. },
  48503. shadowMapSize: {
  48504. type: "v2"
  48505. }
  48506. }
  48507. },
  48508. spotShadowMap: {
  48509. type: "tv",
  48510. value: []
  48511. },
  48512. spotShadowMatrix: {
  48513. type: "m4v",
  48514. value: []
  48515. },
  48516. pointLights: {
  48517. type: "sa",
  48518. value: [],
  48519. properties: {
  48520. color: {
  48521. type: "c"
  48522. },
  48523. position: {
  48524. type: "v3"
  48525. },
  48526. decay: {
  48527. type: "f"
  48528. },
  48529. distance: {
  48530. type: "f"
  48531. },
  48532. shadow: {
  48533. type: "i"
  48534. },
  48535. shadowBias: {
  48536. type: "f"
  48537. },
  48538. shadowRadius: {
  48539. type: "f"
  48540. },
  48541. shadowMapSize: {
  48542. type: "v2"
  48543. }
  48544. }
  48545. },
  48546. pointShadowMap: {
  48547. type: "tv",
  48548. value: []
  48549. },
  48550. pointShadowMatrix: {
  48551. type: "m4v",
  48552. value: []
  48553. },
  48554. hemisphereLights: {
  48555. type: "sa",
  48556. value: [],
  48557. properties: {
  48558. direction: {
  48559. type: "v3"
  48560. },
  48561. skyColor: {
  48562. type: "c"
  48563. },
  48564. groundColor: {
  48565. type: "c"
  48566. }
  48567. }
  48568. }
  48569. },
  48570. points: {
  48571. diffuse: {
  48572. type: "c",
  48573. value: new Ci.Color(15658734)
  48574. },
  48575. opacity: {
  48576. type: "f",
  48577. value: 1
  48578. },
  48579. size: {
  48580. type: "f",
  48581. value: 1
  48582. },
  48583. scale: {
  48584. type: "f",
  48585. value: 1
  48586. },
  48587. map: {
  48588. type: "t",
  48589. value: null
  48590. },
  48591. offsetRepeat: {
  48592. type: "v4",
  48593. value: new Ci.Vector4(0,0,1,1)
  48594. }
  48595. }
  48596. },
  48597. 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",
  48598. 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",
  48599. 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",
  48600. 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",
  48601. 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",
  48602. 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",
  48603. 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",
  48604. 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",
  48605. 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",
  48606. 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",
  48607. 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",
  48608. 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",
  48609. 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",
  48610. 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",
  48611. 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",
  48612. 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",
  48613. 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",
  48614. 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",
  48615. 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",
  48616. 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",
  48617. 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",
  48618. 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",
  48619. 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",
  48620. 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",
  48621. Ci.ShaderLib = {
  48622. basic: {
  48623. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48624. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48625. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48626. },
  48627. lambert: {
  48628. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48629. emissive: {
  48630. type: "c",
  48631. value: new Ci.Color(0)
  48632. }
  48633. }]),
  48634. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48635. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48636. },
  48637. phong: {
  48638. 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, {
  48639. emissive: {
  48640. type: "c",
  48641. value: new Ci.Color(0)
  48642. },
  48643. specular: {
  48644. type: "c",
  48645. value: new Ci.Color(1118481)
  48646. },
  48647. shininess: {
  48648. type: "f",
  48649. value: 30
  48650. }
  48651. }]),
  48652. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48653. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48654. },
  48655. standard: {
  48656. 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, {
  48657. emissive: {
  48658. type: "c",
  48659. value: new Ci.Color(0)
  48660. },
  48661. roughness: {
  48662. type: "f",
  48663. value: .5
  48664. },
  48665. metalness: {
  48666. type: "f",
  48667. value: 0
  48668. },
  48669. envMapIntensity: {
  48670. type: "f",
  48671. value: 1
  48672. }
  48673. }]),
  48674. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48675. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48676. },
  48677. points: {
  48678. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48679. vertexShader: Ci.ShaderChunk.points_vert,
  48680. fragmentShader: Ci.ShaderChunk.points_frag
  48681. },
  48682. dashed: {
  48683. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48684. scale: {
  48685. type: "f",
  48686. value: 1
  48687. },
  48688. dashSize: {
  48689. type: "f",
  48690. value: 1
  48691. },
  48692. totalSize: {
  48693. type: "f",
  48694. value: 2
  48695. }
  48696. }]),
  48697. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48698. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48699. },
  48700. depth: {
  48701. uniforms: {
  48702. mNear: {
  48703. type: "f",
  48704. value: 1
  48705. },
  48706. mFar: {
  48707. type: "f",
  48708. value: 2e3
  48709. },
  48710. opacity: {
  48711. type: "f",
  48712. value: 1
  48713. }
  48714. },
  48715. vertexShader: Ci.ShaderChunk.depth_vert,
  48716. fragmentShader: Ci.ShaderChunk.depth_frag
  48717. },
  48718. normal: {
  48719. uniforms: {
  48720. opacity: {
  48721. type: "f",
  48722. value: 1
  48723. }
  48724. },
  48725. vertexShader: Ci.ShaderChunk.normal_vert,
  48726. fragmentShader: Ci.ShaderChunk.normal_frag
  48727. },
  48728. cube: {
  48729. uniforms: {
  48730. tCube: {
  48731. type: "t",
  48732. value: null
  48733. },
  48734. tFlip: {
  48735. type: "f",
  48736. value: -1
  48737. }
  48738. },
  48739. vertexShader: Ci.ShaderChunk.cube_vert,
  48740. fragmentShader: Ci.ShaderChunk.cube_frag
  48741. },
  48742. equirect: {
  48743. uniforms: {
  48744. tEquirect: {
  48745. type: "t",
  48746. value: null
  48747. },
  48748. tFlip: {
  48749. type: "f",
  48750. value: -1
  48751. }
  48752. },
  48753. vertexShader: Ci.ShaderChunk.equirect_vert,
  48754. fragmentShader: Ci.ShaderChunk.equirect_frag
  48755. },
  48756. depthRGBA: {
  48757. uniforms: {},
  48758. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48759. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48760. },
  48761. distanceRGBA: {
  48762. uniforms: {
  48763. lightPos: {
  48764. type: "v3",
  48765. value: new Ci.Vector3(0,0,0)
  48766. }
  48767. },
  48768. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48769. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48770. }
  48771. },
  48772. Ci.WebGLRenderer = function(e) {
  48773. function S() {
  48774. return null === Q ? he : 1
  48775. }
  48776. function i(e, t, i, n) {
  48777. !0 === V && (e *= n,
  48778. t *= n,
  48779. i *= n),
  48780. _e.clearColor(e, t, i, n)
  48781. }
  48782. function t() {
  48783. _e.init(),
  48784. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48785. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48786. i(ae.r, ae.g, ae.b, se)
  48787. }
  48788. function n() {
  48789. te = K = null,
  48790. ee = "",
  48791. $ = -1,
  48792. _e.reset()
  48793. }
  48794. function r(e) {
  48795. e.preventDefault(),
  48796. n(),
  48797. t(),
  48798. be.clear()
  48799. }
  48800. function f(e) {
  48801. var t = e.target;
  48802. t.removeEventListener("dispose", f),
  48803. function(e) {
  48804. var t = be.get(e);
  48805. if (e.image && t.__image__webglTextureCube)
  48806. X.deleteTexture(t.__image__webglTextureCube);
  48807. else {
  48808. if (void 0 === t.__webglInit)
  48809. return;
  48810. X.deleteTexture(t.__webglTexture)
  48811. }
  48812. be.delete(e)
  48813. }(t),
  48814. ye.textures--
  48815. }
  48816. function a(e) {
  48817. var t = e.target;
  48818. t.removeEventListener("dispose", a),
  48819. function(e) {
  48820. var t = be.get(e)
  48821. , i = be.get(e.texture);
  48822. if (e && void 0 !== i.__webglTexture) {
  48823. if (X.deleteTexture(i.__webglTexture),
  48824. e instanceof Ci.WebGLRenderTargetCube)
  48825. for (var n = 0; n < 6; n++)
  48826. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48827. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48828. else
  48829. X.deleteFramebuffer(t.__webglFramebuffer),
  48830. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48831. be.delete(e.texture),
  48832. be.delete(e)
  48833. }
  48834. }(t),
  48835. ye.textures--
  48836. }
  48837. function v(e) {
  48838. var t = e.target;
  48839. t.removeEventListener("dispose", v),
  48840. function(e) {
  48841. y(e),
  48842. be.delete(e)
  48843. }(t)
  48844. }
  48845. function y(e) {
  48846. var t = be.get(e).program;
  48847. (e.program = void 0) !== t && Te.releaseProgram(t)
  48848. }
  48849. function M(e, t) {
  48850. return Math.abs(t[0]) - Math.abs(e[0])
  48851. }
  48852. function s(e, t) {
  48853. 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
  48854. }
  48855. function l(e, t) {
  48856. 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
  48857. }
  48858. function d(e, t, i, n, r) {
  48859. var o, a;
  48860. a = i.transparent ? (o = G,
  48861. ++W) : (o = H,
  48862. ++z);
  48863. var s = o[a];
  48864. void 0 !== s ? (s.id = e.id,
  48865. s.object = e,
  48866. s.geometry = t,
  48867. s.material = i,
  48868. s.z = me.z,
  48869. s.group = r) : (s = {
  48870. id: e.id,
  48871. object: e,
  48872. geometry: t,
  48873. material: i,
  48874. z: me.z,
  48875. group: r
  48876. },
  48877. o.push(s))
  48878. }
  48879. function c(e, t, i, n) {
  48880. for (var r = 0, o = e.length; r < o; r++) {
  48881. var a = e[r]
  48882. , s = a.object
  48883. , l = a.geometry
  48884. , c = void 0 === n ? a.material : n
  48885. , h = a.group;
  48886. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48887. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48888. s instanceof Ci.ImmediateRenderObject) {
  48889. R(c);
  48890. var u = P(t, i, c, s);
  48891. ee = "",
  48892. s.render(function(e) {
  48893. Z.renderBufferImmediate(e, u, c)
  48894. })
  48895. } else
  48896. Z.renderBufferDirect(t, i, l, c, s, h)
  48897. }
  48898. }
  48899. function R(e) {
  48900. (function(e) {
  48901. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48902. _e.setFlipSided(e.side === Ci.BackSide)
  48903. }
  48904. )(e),
  48905. !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),
  48906. _e.setDepthFunc(e.depthFunc),
  48907. _e.setDepthTest(e.depthTest),
  48908. _e.setDepthWrite(e.depthWrite),
  48909. _e.setColorWrite(e.colorWrite),
  48910. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48911. }
  48912. function P(e, t, i, n) {
  48913. oe = 0;
  48914. var r = be.get(i);
  48915. void 0 === r.program && (i.needsUpdate = !0),
  48916. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48917. i.needsUpdate && (function(e, t, i) {
  48918. var n = be.get(e)
  48919. , r = Te.getParameters(e, ve, t, i)
  48920. , o = Te.getProgramCode(e, r)
  48921. , a = n.program
  48922. , s = !0;
  48923. if (void 0 === a)
  48924. e.addEventListener("dispose", v);
  48925. else if (a.code !== o)
  48926. y(e);
  48927. else {
  48928. if (void 0 !== r.shaderID)
  48929. return;
  48930. s = !1
  48931. }
  48932. if (s) {
  48933. if (r.shaderID) {
  48934. var l = Ci.ShaderLib[r.shaderID];
  48935. n.__webglShader = {
  48936. name: e.type,
  48937. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48938. vertexShader: l.vertexShader,
  48939. fragmentShader: l.fragmentShader
  48940. }
  48941. } else
  48942. n.__webglShader = {
  48943. name: e.type,
  48944. uniforms: e.uniforms,
  48945. vertexShader: e.vertexShader,
  48946. fragmentShader: e.fragmentShader
  48947. };
  48948. e.__webglShader = n.__webglShader,
  48949. a = Te.acquireProgram(e, r, o),
  48950. n.program = a,
  48951. e.program = a
  48952. }
  48953. var c = a.getAttributes();
  48954. if (e.morphTargets)
  48955. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48956. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48957. if (e.morphNormals)
  48958. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48959. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48960. n.uniformsList = [];
  48961. var u = n.__webglShader.uniforms
  48962. , d = n.program.getUniforms();
  48963. for (var p in u) {
  48964. var f = d[p];
  48965. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48966. }
  48967. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48968. u.ambientLightColor.value = ve.ambient,
  48969. u.directionalLights.value = ve.directional,
  48970. u.spotLights.value = ve.spot,
  48971. u.pointLights.value = ve.point,
  48972. u.hemisphereLights.value = ve.hemi,
  48973. u.directionalShadowMap.value = ve.directionalShadowMap,
  48974. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48975. u.spotShadowMap.value = ve.spotShadowMap,
  48976. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48977. u.pointShadowMap.value = ve.pointShadowMap,
  48978. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48979. n.hasDynamicUniforms = !1;
  48980. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48981. if (!0 === n.uniformsList[g][0].dynamic) {
  48982. n.hasDynamicUniforms = !0;
  48983. break
  48984. }
  48985. }
  48986. }(i, t, n),
  48987. i.needsUpdate = !1);
  48988. var o = !1
  48989. , a = !1
  48990. , s = !1
  48991. , l = r.program
  48992. , c = l.getUniforms()
  48993. , h = r.__webglShader.uniforms;
  48994. if (l.id !== K && (X.useProgram(l.program),
  48995. K = l.id,
  48996. s = a = o = !0),
  48997. i.id !== $ && ($ = i.id,
  48998. a = !0),
  48999. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  49000. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  49001. e !== te && (te = e,
  49002. s = a = !0),
  49003. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  49004. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  49005. (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),
  49006. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  49007. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  49008. i.skinning)
  49009. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  49010. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  49011. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  49012. if (void 0 !== c.boneTexture) {
  49013. var u = A();
  49014. X.uniform1i(c.boneTexture, u),
  49015. Z.setTexture(n.skeleton.boneTexture, u)
  49016. }
  49017. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  49018. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  49019. } else
  49020. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  49021. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  49022. e.ambientLightColor.needsUpdate = t,
  49023. e.directionalLights.needsUpdate = t,
  49024. e.pointLights.needsUpdate = t,
  49025. e.spotLights.needsUpdate = t,
  49026. e.hemisphereLights.needsUpdate = t
  49027. }(h, s),
  49028. t && i.fog && function(e, t) {
  49029. e.fogColor.value = t.color,
  49030. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  49031. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  49032. }(h, t),
  49033. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  49034. var i;
  49035. if (e.opacity.value = t.opacity,
  49036. e.diffuse.value = t.color,
  49037. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49038. e.map.value = t.map,
  49039. e.specularMap.value = t.specularMap,
  49040. e.alphaMap.value = t.alphaMap,
  49041. t.aoMap && (e.aoMap.value = t.aoMap,
  49042. e.aoMapIntensity.value = t.aoMapIntensity),
  49043. 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),
  49044. void 0 !== i) {
  49045. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  49046. var n = i.offset
  49047. , r = i.repeat;
  49048. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  49049. }
  49050. e.envMap.value = t.envMap,
  49051. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  49052. e.reflectivity.value = t.reflectivity,
  49053. e.refractionRatio.value = t.refractionRatio
  49054. }(h, i),
  49055. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  49056. function(e, t) {
  49057. e.dashSize.value = t.dashSize,
  49058. e.totalSize.value = t.dashSize + t.gapSize,
  49059. e.scale.value = t.scale
  49060. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  49061. if (e.diffuse.value = t.color,
  49062. e.opacity.value = t.opacity,
  49063. e.size.value = t.size * he,
  49064. e.scale.value = O.clientHeight / 2,
  49065. e.map.value = t.map,
  49066. null !== t.map) {
  49067. var i = t.map.offset
  49068. , n = t.map.repeat;
  49069. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49070. }
  49071. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  49072. t.lightMap && (e.lightMap.value = t.lightMap,
  49073. e.lightMapIntensity.value = t.lightMapIntensity),
  49074. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49075. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  49076. e.specular.value = t.specular,
  49077. e.shininess.value = Math.max(t.shininess, 1e-4),
  49078. t.lightMap && (e.lightMap.value = t.lightMap,
  49079. e.lightMapIntensity.value = t.lightMapIntensity),
  49080. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49081. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49082. e.bumpScale.value = t.bumpScale),
  49083. t.normalMap && (e.normalMap.value = t.normalMap,
  49084. e.normalScale.value.copy(t.normalScale)),
  49085. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49086. e.displacementScale.value = t.displacementScale,
  49087. e.displacementBias.value = t.displacementBias)
  49088. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  49089. e.roughness.value = t.roughness,
  49090. e.metalness.value = t.metalness,
  49091. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49092. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49093. t.lightMap && (e.lightMap.value = t.lightMap,
  49094. e.lightMapIntensity.value = t.lightMapIntensity),
  49095. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49096. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49097. e.bumpScale.value = t.bumpScale),
  49098. t.normalMap && (e.normalMap.value = t.normalMap,
  49099. e.normalScale.value.copy(t.normalScale)),
  49100. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49101. e.displacementScale.value = t.displacementScale,
  49102. e.displacementBias.value = t.displacementBias),
  49103. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49104. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  49105. h.mFar.value = e.far,
  49106. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  49107. g(r.uniformsList)),
  49108. function(e, t) {
  49109. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49110. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49111. }(c, n),
  49112. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  49113. !0 === r.hasDynamicUniforms && function(e, t, i) {
  49114. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49115. var a = e[r][0]
  49116. , s = a.onUpdateCallback;
  49117. void 0 !== s && (s.bind(a)(t, i),
  49118. n.push(e[r]))
  49119. }
  49120. g(n)
  49121. }(r.uniformsList, n, e),
  49122. l
  49123. }
  49124. function p(e, t) {
  49125. e.diffuse.value = t.color,
  49126. e.opacity.value = t.opacity
  49127. }
  49128. function A() {
  49129. var e = oe;
  49130. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  49131. oe += 1,
  49132. e
  49133. }
  49134. function C(e, t, i, n) {
  49135. var r, o;
  49136. if ("1i" === t)
  49137. X.uniform1i(i, n);
  49138. else if ("1f" === t)
  49139. X.uniform1f(i, n);
  49140. else if ("2f" === t)
  49141. X.uniform2f(i, n[0], n[1]);
  49142. else if ("3f" === t)
  49143. X.uniform3f(i, n[0], n[1], n[2]);
  49144. else if ("4f" === t)
  49145. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  49146. else if ("1iv" === t)
  49147. X.uniform1iv(i, n);
  49148. else if ("3iv" === t)
  49149. X.uniform3iv(i, n);
  49150. else if ("1fv" === t)
  49151. X.uniform1fv(i, n);
  49152. else if ("2fv" === t)
  49153. X.uniform2fv(i, n);
  49154. else if ("3fv" === t)
  49155. X.uniform3fv(i, n);
  49156. else if ("4fv" === t)
  49157. X.uniform4fv(i, n);
  49158. else if ("Matrix2fv" === t)
  49159. X.uniformMatrix2fv(i, !1, n);
  49160. else if ("Matrix3fv" === t)
  49161. X.uniformMatrix3fv(i, !1, n);
  49162. else if ("Matrix4fv" === t)
  49163. X.uniformMatrix4fv(i, !1, n);
  49164. else if ("i" === t)
  49165. X.uniform1i(i, n);
  49166. else if ("f" === t)
  49167. X.uniform1f(i, n);
  49168. else if ("v2" === t)
  49169. X.uniform2f(i, n.x, n.y);
  49170. else if ("v3" === t)
  49171. X.uniform3f(i, n.x, n.y, n.z);
  49172. else if ("v4" === t)
  49173. X.uniform4f(i, n.x, n.y, n.z, n.w);
  49174. else if ("c" === t)
  49175. X.uniform3f(i, n.r, n.g, n.b);
  49176. else if ("s" === t) {
  49177. var a = e.properties;
  49178. for (var s in a) {
  49179. var l = a[s]
  49180. , c = i[s]
  49181. , h = n[s];
  49182. C(l, l.type, c, h)
  49183. }
  49184. } else if ("sa" === t) {
  49185. a = e.properties;
  49186. for (var u = 0, d = n.length; u < d; u++)
  49187. for (var s in a) {
  49188. l = a[s],
  49189. c = i[u][s],
  49190. h = n[u][s];
  49191. C(l, l.type, c, h)
  49192. }
  49193. } else if ("iv1" === t)
  49194. X.uniform1iv(i, n);
  49195. else if ("iv" === t)
  49196. X.uniform3iv(i, n);
  49197. else if ("fv1" === t)
  49198. X.uniform1fv(i, n);
  49199. else if ("fv" === t)
  49200. X.uniform3fv(i, n);
  49201. else if ("v2v" === t) {
  49202. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  49203. u = 0;
  49204. for (var p = 0, f = n.length; u < f; u++,
  49205. p += 2)
  49206. e._array[p + 0] = n[u].x,
  49207. e._array[p + 1] = n[u].y;
  49208. X.uniform2fv(i, e._array)
  49209. } else if ("v3v" === t) {
  49210. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  49211. u = 0;
  49212. var g = 0;
  49213. for (f = n.length; u < f; u++,
  49214. g += 3)
  49215. e._array[g + 0] = n[u].x,
  49216. e._array[g + 1] = n[u].y,
  49217. e._array[g + 2] = n[u].z;
  49218. X.uniform3fv(i, e._array)
  49219. } else if ("v4v" === t) {
  49220. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  49221. u = 0;
  49222. var m = 0;
  49223. for (f = n.length; u < f; u++,
  49224. m += 4)
  49225. e._array[m + 0] = n[u].x,
  49226. e._array[m + 1] = n[u].y,
  49227. e._array[m + 2] = n[u].z,
  49228. e._array[m + 3] = n[u].w;
  49229. X.uniform4fv(i, e._array)
  49230. } else if ("m2" === t)
  49231. X.uniformMatrix2fv(i, !1, n.elements);
  49232. else if ("m3" === t)
  49233. X.uniformMatrix3fv(i, !1, n.elements);
  49234. else if ("m3v" === t) {
  49235. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  49236. for (u = 0,
  49237. f = n.length; u < f; u++)
  49238. n[u].flattenToArrayOffset(e._array, 9 * u);
  49239. X.uniformMatrix3fv(i, !1, e._array)
  49240. } else if ("m4" === t)
  49241. X.uniformMatrix4fv(i, !1, n.elements);
  49242. else if ("m4v" === t) {
  49243. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  49244. for (u = 0,
  49245. f = n.length; u < f; u++)
  49246. n[u].flattenToArrayOffset(e._array, 16 * u);
  49247. X.uniformMatrix4fv(i, !1, e._array)
  49248. } else if ("t" === t) {
  49249. if (r = n,
  49250. o = A(),
  49251. X.uniform1i(i, o),
  49252. !r)
  49253. return;
  49254. 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)
  49255. } else if ("tv" === t) {
  49256. void 0 === e._array && (e._array = []);
  49257. for (u = 0,
  49258. f = e.value.length; u < f; u++)
  49259. e._array[u] = A();
  49260. X.uniform1iv(i, e._array);
  49261. for (u = 0,
  49262. f = e.value.length; u < f; u++)
  49263. r = e.value[u],
  49264. o = e._array[u],
  49265. 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))
  49266. } else
  49267. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49268. }
  49269. function g(e) {
  49270. for (var t = 0, i = e.length; t < i; t++) {
  49271. var n = e[t][0];
  49272. if (!1 !== n.needsUpdate)
  49273. C(n, n.type, e[t][1], n.value)
  49274. }
  49275. }
  49276. function m(e, t, i) {
  49277. var n;
  49278. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  49279. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  49280. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  49281. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  49282. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  49283. 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),
  49284. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  49285. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  49286. 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)),
  49287. n = Ie.get("EXT_texture_filter_anisotropic")) {
  49288. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  49289. return;
  49290. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  49291. return;
  49292. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  49293. be.get(t).__currentAnisotropy = t.anisotropy)
  49294. }
  49295. }
  49296. function o(e, t, i) {
  49297. void 0 === e.__webglInit && (e.__webglInit = !0,
  49298. t.addEventListener("dispose", f),
  49299. e.__webglTexture = X.createTexture(),
  49300. ye.textures++),
  49301. _e.activeTexture(X.TEXTURE0 + i),
  49302. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  49303. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49304. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49305. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  49306. var n = I(t.image, Ee.maxTextureSize);
  49307. !function(e) {
  49308. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  49309. }(t) || !1 !== E(n) || (n = function(e) {
  49310. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49311. var t = document.createElement("canvas");
  49312. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  49313. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  49314. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  49315. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49316. t
  49317. }
  49318. return e
  49319. }(n));
  49320. var r = E(n)
  49321. , o = x(t.format)
  49322. , a = x(t.type);
  49323. m(X.TEXTURE_2D, t, r);
  49324. var s, l = t.mipmaps;
  49325. if (t instanceof Ci.DataTexture)
  49326. if (0 < l.length && r) {
  49327. for (var c = 0, h = l.length; c < h; c++)
  49328. s = l[c],
  49329. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  49330. t.generateMipmaps = !1
  49331. } else
  49332. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  49333. else if (t instanceof Ci.CompressedTexture)
  49334. for (c = 0,
  49335. h = l.length; c < h; c++)
  49336. s = l[c],
  49337. 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);
  49338. else if (0 < l.length && r) {
  49339. for (c = 0,
  49340. h = l.length; c < h; c++)
  49341. s = l[c],
  49342. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  49343. t.generateMipmaps = !1
  49344. } else
  49345. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  49346. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49347. e.__version = t.version,
  49348. t.onUpdate && t.onUpdate(t)
  49349. }
  49350. function I(e, t) {
  49351. if (e.width > t || e.height > t) {
  49352. var i = t / Math.max(e.width, e.height)
  49353. , n = document.createElement("canvas");
  49354. return n.width = Math.floor(e.width * i),
  49355. n.height = Math.floor(e.height * i),
  49356. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49357. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49358. n
  49359. }
  49360. return e
  49361. }
  49362. function E(e) {
  49363. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  49364. }
  49365. function _(e, t) {
  49366. var i = be.get(e);
  49367. if (6 === e.image.length)
  49368. if (0 < e.version && i.__version !== e.version) {
  49369. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  49370. i.__image__webglTextureCube = X.createTexture(),
  49371. ye.textures++),
  49372. _e.activeTexture(X.TEXTURE0 + t),
  49373. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49374. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49375. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  49376. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  49377. var s = E(o[0])
  49378. , l = x(e.format)
  49379. , c = x(e.type);
  49380. m(X.TEXTURE_CUBE_MAP, e, s);
  49381. for (a = 0; a < 6; a++)
  49382. if (n)
  49383. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  49384. h = u[d],
  49385. 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);
  49386. else
  49387. 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]);
  49388. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49389. i.__version = e.version,
  49390. e.onUpdate && e.onUpdate(e)
  49391. } else
  49392. _e.activeTexture(X.TEXTURE0 + t),
  49393. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49394. }
  49395. function b(e, t) {
  49396. _e.activeTexture(X.TEXTURE0 + t),
  49397. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  49398. }
  49399. function h(e, t, i, n) {
  49400. var r = x(t.texture.format)
  49401. , o = x(t.texture.type);
  49402. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49403. X.bindFramebuffer(X.FRAMEBUFFER, e),
  49404. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  49405. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49406. }
  49407. function u(e, t) {
  49408. X.bindRenderbuffer(X.RENDERBUFFER, e),
  49409. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  49410. 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),
  49411. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  49412. X.bindRenderbuffer(X.RENDERBUFFER, null)
  49413. }
  49414. function w(e) {
  49415. var t = be.get(e)
  49416. , i = be.get(e.texture);
  49417. e.addEventListener("dispose", a),
  49418. i.__webglTexture = X.createTexture(),
  49419. ye.textures++;
  49420. var n = e instanceof Ci.WebGLRenderTargetCube
  49421. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  49422. if (n) {
  49423. t.__webglFramebuffer = [];
  49424. for (var o = 0; o < 6; o++)
  49425. t.__webglFramebuffer[o] = X.createFramebuffer()
  49426. } else
  49427. t.__webglFramebuffer = X.createFramebuffer();
  49428. if (n) {
  49429. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  49430. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  49431. for (o = 0; o < 6; o++)
  49432. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  49433. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  49434. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  49435. } else
  49436. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  49437. m(X.TEXTURE_2D, e.texture, r),
  49438. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  49439. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  49440. _e.bindTexture(X.TEXTURE_2D, null);
  49441. e.depthBuffer && function(e) {
  49442. var t = be.get(e);
  49443. if (e instanceof Ci.WebGLRenderTargetCube) {
  49444. t.__webglDepthbuffer = [];
  49445. for (var i = 0; i < 6; i++)
  49446. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  49447. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  49448. u(t.__webglDepthbuffer[i], e)
  49449. } else
  49450. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  49451. t.__webglDepthbuffer = X.createRenderbuffer(),
  49452. u(t.__webglDepthbuffer, e);
  49453. X.bindFramebuffer(X.FRAMEBUFFER, null)
  49454. }(e)
  49455. }
  49456. function T(e) {
  49457. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  49458. }
  49459. function x(e) {
  49460. var t;
  49461. if (e === Ci.RepeatWrapping)
  49462. return X.REPEAT;
  49463. if (e === Ci.ClampToEdgeWrapping)
  49464. return X.CLAMP_TO_EDGE;
  49465. if (e === Ci.MirroredRepeatWrapping)
  49466. return X.MIRRORED_REPEAT;
  49467. if (e === Ci.NearestFilter)
  49468. return X.NEAREST;
  49469. if (e === Ci.NearestMipMapNearestFilter)
  49470. return X.NEAREST_MIPMAP_NEAREST;
  49471. if (e === Ci.NearestMipMapLinearFilter)
  49472. return X.NEAREST_MIPMAP_LINEAR;
  49473. if (e === Ci.LinearFilter)
  49474. return X.LINEAR;
  49475. if (e === Ci.LinearMipMapNearestFilter)
  49476. return X.LINEAR_MIPMAP_NEAREST;
  49477. if (e === Ci.LinearMipMapLinearFilter)
  49478. return X.LINEAR_MIPMAP_LINEAR;
  49479. if (e === Ci.UnsignedByteType)
  49480. return X.UNSIGNED_BYTE;
  49481. if (e === Ci.UnsignedShort4444Type)
  49482. return X.UNSIGNED_SHORT_4_4_4_4;
  49483. if (e === Ci.UnsignedShort5551Type)
  49484. return X.UNSIGNED_SHORT_5_5_5_1;
  49485. if (e === Ci.UnsignedShort565Type)
  49486. return X.UNSIGNED_SHORT_5_6_5;
  49487. if (e === Ci.ByteType)
  49488. return X.BYTE;
  49489. if (e === Ci.ShortType)
  49490. return X.SHORT;
  49491. if (e === Ci.UnsignedShortType)
  49492. return X.UNSIGNED_SHORT;
  49493. if (e === Ci.IntType)
  49494. return X.INT;
  49495. if (e === Ci.UnsignedIntType)
  49496. return X.UNSIGNED_INT;
  49497. if (e === Ci.FloatType)
  49498. return X.FLOAT;
  49499. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49500. return t.HALF_FLOAT_OES;
  49501. if (e === Ci.AlphaFormat)
  49502. return X.ALPHA;
  49503. if (e === Ci.RGBFormat)
  49504. return X.RGB;
  49505. if (e === Ci.RGBAFormat)
  49506. return X.RGBA;
  49507. if (e === Ci.LuminanceFormat)
  49508. return X.LUMINANCE;
  49509. if (e === Ci.LuminanceAlphaFormat)
  49510. return X.LUMINANCE_ALPHA;
  49511. if (e === Ci.AddEquation)
  49512. return X.FUNC_ADD;
  49513. if (e === Ci.SubtractEquation)
  49514. return X.FUNC_SUBTRACT;
  49515. if (e === Ci.ReverseSubtractEquation)
  49516. return X.FUNC_REVERSE_SUBTRACT;
  49517. if (e === Ci.ZeroFactor)
  49518. return X.ZERO;
  49519. if (e === Ci.OneFactor)
  49520. return X.ONE;
  49521. if (e === Ci.SrcColorFactor)
  49522. return X.SRC_COLOR;
  49523. if (e === Ci.OneMinusSrcColorFactor)
  49524. return X.ONE_MINUS_SRC_COLOR;
  49525. if (e === Ci.SrcAlphaFactor)
  49526. return X.SRC_ALPHA;
  49527. if (e === Ci.OneMinusSrcAlphaFactor)
  49528. return X.ONE_MINUS_SRC_ALPHA;
  49529. if (e === Ci.DstAlphaFactor)
  49530. return X.DST_ALPHA;
  49531. if (e === Ci.OneMinusDstAlphaFactor)
  49532. return X.ONE_MINUS_DST_ALPHA;
  49533. if (e === Ci.DstColorFactor)
  49534. return X.DST_COLOR;
  49535. if (e === Ci.OneMinusDstColorFactor)
  49536. return X.ONE_MINUS_DST_COLOR;
  49537. if (e === Ci.SrcAlphaSaturateFactor)
  49538. return X.SRC_ALPHA_SATURATE;
  49539. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49540. if (e === Ci.RGB_S3TC_DXT1_Format)
  49541. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49542. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49543. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49544. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49545. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49546. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49547. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49548. }
  49549. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49550. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49551. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49552. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49553. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49554. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49555. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49556. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49557. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49558. }
  49559. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49560. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49561. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49562. if (e === Ci.MinEquation)
  49563. return t.MIN_EXT;
  49564. if (e === Ci.MaxEquation)
  49565. return t.MAX_EXT
  49566. }
  49567. return 0
  49568. }
  49569. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49570. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49571. , L = void 0 !== e.context ? e.context : null
  49572. , D = void 0 !== e.alpha && e.alpha
  49573. , N = void 0 === e.depth || e.depth
  49574. , F = void 0 === e.stencil || e.stencil
  49575. , B = void 0 !== e.antialias && e.antialias
  49576. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49577. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49578. , U = []
  49579. , H = []
  49580. , z = -1
  49581. , G = []
  49582. , W = -1
  49583. , j = new Float32Array(8)
  49584. , Y = []
  49585. , q = [];
  49586. this.domElement = O,
  49587. this.context = null,
  49588. this.autoClear = !0,
  49589. this.autoClearColor = !0,
  49590. this.autoClearDepth = !0,
  49591. this.autoClearStencil = !0,
  49592. this.sortObjects = !0,
  49593. this.gammaFactor = 2,
  49594. this.gammaInput = !1,
  49595. this.gammaOutput = !1,
  49596. this.physicallyCorrectLights = !1,
  49597. this.toneMapping = Ci.LinearToneMapping,
  49598. this.toneMappingExposure = 1,
  49599. this.toneMappingWhitePoint = 1,
  49600. this.maxMorphTargets = 8,
  49601. this.maxMorphNormals = 4,
  49602. this.autoScaleCubemaps = !0;
  49603. 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 = {
  49604. hash: "",
  49605. ambient: [0, 0, 0],
  49606. directional: [],
  49607. directionalShadowMap: [],
  49608. directionalShadowMatrix: [],
  49609. spot: [],
  49610. spotShadowMap: [],
  49611. spotShadowMatrix: [],
  49612. point: [],
  49613. pointShadowMap: [],
  49614. pointShadowMatrix: [],
  49615. hemi: [],
  49616. shadows: [],
  49617. shadowsPointLight: 0
  49618. }, ye = {
  49619. geometries: 0,
  49620. textures: 0
  49621. }, Ae = {
  49622. calls: 0,
  49623. vertices: 0,
  49624. faces: 0,
  49625. points: 0
  49626. };
  49627. this.info = {
  49628. render: Ae,
  49629. memory: ye,
  49630. programs: null
  49631. };
  49632. try {
  49633. var Ce = {
  49634. alpha: D,
  49635. depth: N,
  49636. stencil: F,
  49637. antialias: B,
  49638. premultipliedAlpha: V,
  49639. preserveDrawingBuffer: k
  49640. };
  49641. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49642. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49643. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49644. return {
  49645. rangeMin: 1,
  49646. rangeMax: 1,
  49647. precision: 1
  49648. }
  49649. }
  49650. ),
  49651. O.addEventListener("webglcontextlost", r, !1)
  49652. } catch (e) {
  49653. console.error("THREE.WebGLRenderer: " + e)
  49654. }
  49655. var Ie = new Ci.WebGLExtensions(X);
  49656. Ie.get("OES_texture_float"),
  49657. Ie.get("OES_texture_float_linear"),
  49658. Ie.get("OES_texture_half_float"),
  49659. Ie.get("OES_texture_half_float_linear"),
  49660. Ie.get("OES_standard_derivatives"),
  49661. Ie.get("ANGLE_instanced_arrays"),
  49662. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49663. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49664. , _e = new Ci.WebGLState(X,Ie,x)
  49665. , be = new Ci.WebGLProperties
  49666. , we = new Ci.WebGLObjects(X,be,this.info)
  49667. , Te = new Ci.WebGLPrograms(this,Ee)
  49668. , xe = new Ci.WebGLLights;
  49669. this.info.programs = Te.programs;
  49670. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49671. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49672. t(),
  49673. this.context = X,
  49674. this.capabilities = Ee,
  49675. this.extensions = Ie,
  49676. this.properties = be,
  49677. this.state = _e;
  49678. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49679. this.shadowMap = Re;
  49680. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49681. this.getContext = function() {
  49682. return X
  49683. }
  49684. ,
  49685. this.getContextAttributes = function() {
  49686. return X.getContextAttributes()
  49687. }
  49688. ,
  49689. this.forceContextLoss = function() {
  49690. Ie.get("WEBGL_lose_context").loseContext()
  49691. }
  49692. ,
  49693. this.getMaxAnisotropy = function() {
  49694. if (void 0 !== Pe)
  49695. return Pe;
  49696. var e = Ie.get("EXT_texture_filter_anisotropic");
  49697. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49698. }
  49699. ,
  49700. this.getPrecision = function() {
  49701. return Ee.precision
  49702. }
  49703. ,
  49704. this.getPixelRatio = function() {
  49705. return he
  49706. }
  49707. ,
  49708. this.setPixelRatio = function(e) {
  49709. void 0 !== e && (he = e,
  49710. this.setSize(pe.z, pe.w, !1))
  49711. }
  49712. ,
  49713. this.getSize = function() {
  49714. return {
  49715. width: le,
  49716. height: ce
  49717. }
  49718. }
  49719. ,
  49720. this.setSize = function(e, t, i, n) {
  49721. null != n && (he = n),
  49722. le = e,
  49723. ce = t,
  49724. O.width = e * he,
  49725. O.height = t * he,
  49726. !1 !== i && (O.style.width = e + "px",
  49727. O.style.height = t + "px"),
  49728. this.setViewport(0, 0, e, t)
  49729. }
  49730. ,
  49731. this.setViewport = function(e, t, i, n) {
  49732. _e.viewport(pe.set(e, t, i, n))
  49733. }
  49734. ,
  49735. this.setScissor = function(e, t, i, n) {
  49736. _e.scissor(ue.set(e, t, i, n))
  49737. }
  49738. ,
  49739. this.setScissorTest = function(e) {
  49740. _e.setScissorTest(de = e)
  49741. }
  49742. ,
  49743. this.getClearColor = function() {
  49744. return ae
  49745. }
  49746. ,
  49747. this.setClearColor = function(e, t) {
  49748. ae.set(e),
  49749. se = void 0 !== t ? t : 1,
  49750. i(ae.r, ae.g, ae.b, se)
  49751. }
  49752. ,
  49753. this.getClearAlpha = function() {
  49754. return se
  49755. }
  49756. ,
  49757. this.setClearAlpha = function(e) {
  49758. se = e,
  49759. i(ae.r, ae.g, ae.b, se)
  49760. }
  49761. ,
  49762. this.clear = function(e, t, i) {
  49763. var n = 0;
  49764. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49765. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49766. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49767. X.clear(n)
  49768. }
  49769. ,
  49770. this.clearColor = function() {
  49771. this.clear(!0, !1, !1)
  49772. }
  49773. ,
  49774. this.clearDepth = function() {
  49775. this.clear(!1, !0, !1)
  49776. }
  49777. ,
  49778. this.clearStencil = function() {
  49779. this.clear(!1, !1, !0)
  49780. }
  49781. ,
  49782. this.clearTarget = function(e, t, i, n) {
  49783. this.setRenderTarget(e),
  49784. this.clear(t, i, n)
  49785. }
  49786. ,
  49787. this.resetGLState = n,
  49788. this.dispose = function() {
  49789. O.removeEventListener("webglcontextlost", r, !1)
  49790. }
  49791. ,
  49792. this.renderBufferImmediate = function(e, t, i) {
  49793. _e.initAttributes();
  49794. var n = be.get(e);
  49795. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49796. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49797. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49798. e.hasColors && !n.color && (n.color = X.createBuffer());
  49799. var r = t.getAttributes();
  49800. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49801. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49802. _e.enableAttribute(r.position),
  49803. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49804. e.hasNormals) {
  49805. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49806. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49807. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49808. var s = e.normalArray
  49809. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49810. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49811. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49812. s[o + 0] = l,
  49813. s[o + 1] = c,
  49814. s[o + 2] = h,
  49815. s[o + 3] = l,
  49816. s[o + 4] = c,
  49817. s[o + 5] = h,
  49818. s[o + 6] = l,
  49819. s[o + 7] = c,
  49820. s[o + 8] = h
  49821. }
  49822. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49823. _e.enableAttribute(r.normal),
  49824. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49825. }
  49826. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49827. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49828. _e.enableAttribute(r.uv),
  49829. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49830. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49831. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49832. _e.enableAttribute(r.color),
  49833. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49834. _e.disableUnusedAttributes(),
  49835. X.drawArrays(X.TRIANGLES, 0, e.count),
  49836. e.count = 0
  49837. }
  49838. ,
  49839. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49840. R(n);
  49841. var a = P(e, t, n, r)
  49842. , s = !1
  49843. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49844. l !== ee && (ee = l,
  49845. s = !0);
  49846. var c = r.morphTargetInfluences;
  49847. if (void 0 !== c) {
  49848. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49849. var p = c[u];
  49850. h.push([p, u])
  49851. }
  49852. h.sort(M),
  49853. 8 < h.length && (h.length = 8);
  49854. var f = i.morphAttributes;
  49855. for (u = 0,
  49856. d = h.length; u < d; u++) {
  49857. p = h[u];
  49858. if (j[u] = p[0],
  49859. 0 !== p[0]) {
  49860. var g = p[1];
  49861. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49862. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49863. } else
  49864. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49865. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49866. }
  49867. var m = a.getUniforms();
  49868. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49869. s = !0
  49870. }
  49871. g = i.index;
  49872. var v, y = i.attributes.position;
  49873. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49874. null !== g ? (v = Me).setIndex(g) : v = Se,
  49875. s && (function(e, t, i, n) {
  49876. var r;
  49877. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49878. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49879. else {
  49880. void 0 === n && (n = 0),
  49881. _e.initAttributes();
  49882. var o = i.attributes
  49883. , a = t.getAttributes()
  49884. , s = e.defaultAttributeValues;
  49885. for (var l in a) {
  49886. var c = a[l];
  49887. if (0 <= c) {
  49888. var h = o[l];
  49889. if (void 0 !== h) {
  49890. var u = h.itemSize
  49891. , d = we.getAttributeBuffer(h);
  49892. if (h instanceof Ci.InterleavedBufferAttribute) {
  49893. var p = h.data
  49894. , f = p.stride
  49895. , g = h.offset;
  49896. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49897. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49898. X.bindBuffer(X.ARRAY_BUFFER, d),
  49899. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49900. } else
  49901. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49902. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49903. X.bindBuffer(X.ARRAY_BUFFER, d),
  49904. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49905. } else if (void 0 !== s) {
  49906. var m = s[l];
  49907. if (void 0 !== m)
  49908. switch (m.length) {
  49909. case 2:
  49910. X.vertexAttrib2fv(c, m);
  49911. break;
  49912. case 3:
  49913. X.vertexAttrib3fv(c, m);
  49914. break;
  49915. case 4:
  49916. X.vertexAttrib4fv(c, m);
  49917. break;
  49918. default:
  49919. X.vertexAttrib1fv(c, m)
  49920. }
  49921. }
  49922. }
  49923. }
  49924. _e.disableUnusedAttributes()
  49925. }
  49926. }(n, a, i),
  49927. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49928. var A = 1 / 0;
  49929. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49930. var C = i.drawRange.start
  49931. , I = i.drawRange.count
  49932. , E = null !== o ? o.start : 0
  49933. , _ = null !== o ? o.count : 1 / 0
  49934. , b = Math.max(0, C, E)
  49935. , w = Math.min(0 + A, C + I, E + _) - 1
  49936. , T = Math.max(0, w - b + 1);
  49937. if (r instanceof Ci.Mesh)
  49938. if (!0 === n.wireframe)
  49939. _e.setLineWidth(n.wireframeLinewidth * S()),
  49940. v.setMode(X.LINES);
  49941. else
  49942. switch (r.drawMode) {
  49943. case Ci.TrianglesDrawMode:
  49944. v.setMode(X.TRIANGLES);
  49945. break;
  49946. case Ci.TriangleStripDrawMode:
  49947. v.setMode(X.TRIANGLE_STRIP);
  49948. break;
  49949. case Ci.TriangleFanDrawMode:
  49950. v.setMode(X.TRIANGLE_FAN)
  49951. }
  49952. else if (r instanceof Ci.Line) {
  49953. var x = n.linewidth;
  49954. void 0 === x && (x = 1),
  49955. _e.setLineWidth(x * S()),
  49956. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49957. } else
  49958. r instanceof Ci.Points && v.setMode(X.POINTS);
  49959. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49960. }
  49961. ,
  49962. this.render = function(e, t, i, n) {
  49963. if (t instanceof Ci.Camera != 0) {
  49964. var r = e.fog;
  49965. if (ee = "",
  49966. $ = -1,
  49967. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49968. null === t.parent && t.updateMatrixWorld(),
  49969. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49970. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49971. fe.setFromMatrix(ge),
  49972. U.length = 0,
  49973. W = z = -1,
  49974. Y.length = 0,
  49975. q.length = 0,
  49976. function e(t, i) {
  49977. if (!1 !== t.visible) {
  49978. if (t.layers.test(i.layers))
  49979. if (t instanceof Ci.Light)
  49980. U.push(t);
  49981. else if (t instanceof Ci.Sprite)
  49982. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49983. else if (t instanceof Ci.LensFlare)
  49984. q.push(t);
  49985. else if (t instanceof Ci.ImmediateRenderObject)
  49986. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49987. me.applyProjection(ge)),
  49988. d(t, null, t.material, me.z, null);
  49989. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49990. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49991. var n = t.material;
  49992. if (!0 === n.visible) {
  49993. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49994. me.applyProjection(ge));
  49995. var r = we.update(t);
  49996. if (n instanceof Ci.MultiMaterial)
  49997. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49998. var c = o[s]
  49999. , h = a[c.materialIndex];
  50000. !0 === h.visible && d(t, r, h, me.z, c)
  50001. }
  50002. else
  50003. d(t, r, n, me.z, null)
  50004. }
  50005. }
  50006. var u = t.children;
  50007. for (s = 0,
  50008. l = u.length; s < l; s++)
  50009. e(u[s], i)
  50010. }
  50011. }(e, t),
  50012. H.length = z + 1,
  50013. G.length = W + 1,
  50014. !0 === Z.sortObjects && (H.sort(s),
  50015. G.sort(l)),
  50016. function(e, t) {
  50017. 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;
  50018. for (i = ve.shadowsPointLight = 0,
  50019. n = e.length; i < n; i++)
  50020. if (o = (r = e[i]).color,
  50021. a = r.intensity,
  50022. s = r.distance,
  50023. r instanceof Ci.AmbientLight)
  50024. l += o.r * a,
  50025. c += o.g * a,
  50026. h += o.b * a;
  50027. else if (r instanceof Ci.DirectionalLight) {
  50028. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  50029. v.direction.setFromMatrixPosition(r.matrixWorld),
  50030. me.setFromMatrixPosition(r.target.matrixWorld),
  50031. v.direction.sub(me),
  50032. v.direction.transformDirection(u),
  50033. v.shadow = r.castShadow,
  50034. r.castShadow && (v.shadowBias = r.shadow.bias,
  50035. v.shadowRadius = r.shadow.radius,
  50036. v.shadowMapSize = r.shadow.mapSize,
  50037. ve.shadows[m++] = r),
  50038. ve.directionalShadowMap[d] = r.shadow.map,
  50039. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  50040. ve.directional[d++] = v
  50041. } else if (r instanceof Ci.SpotLight) {
  50042. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  50043. v.position.applyMatrix4(u),
  50044. v.color.copy(o).multiplyScalar(a),
  50045. v.distance = s,
  50046. v.direction.setFromMatrixPosition(r.matrixWorld),
  50047. me.setFromMatrixPosition(r.target.matrixWorld),
  50048. v.direction.sub(me),
  50049. v.direction.transformDirection(u),
  50050. v.coneCos = Math.cos(r.angle),
  50051. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  50052. v.decay = 0 === r.distance ? 0 : r.decay,
  50053. v.shadow = r.castShadow,
  50054. r.castShadow && (v.shadowBias = r.shadow.bias,
  50055. v.shadowRadius = r.shadow.radius,
  50056. v.shadowMapSize = r.shadow.mapSize,
  50057. ve.shadows[m++] = r),
  50058. ve.spotShadowMap[f] = r.shadow.map,
  50059. ve.spotShadowMatrix[f] = r.shadow.matrix,
  50060. ve.spot[f++] = v
  50061. } else if (r instanceof Ci.PointLight) {
  50062. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  50063. v.position.applyMatrix4(u),
  50064. v.color.copy(r.color).multiplyScalar(r.intensity),
  50065. v.distance = r.distance,
  50066. v.decay = 0 === r.distance ? 0 : r.decay,
  50067. v.shadow = r.castShadow,
  50068. r.castShadow && (v.shadowBias = r.shadow.bias,
  50069. v.shadowRadius = r.shadow.radius,
  50070. v.shadowMapSize = r.shadow.mapSize,
  50071. ve.shadows[m++] = r),
  50072. ve.pointShadowMap[p] = r.shadow.map,
  50073. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  50074. me.setFromMatrixPosition(r.matrixWorld).negate(),
  50075. ve.pointShadowMatrix[p].identity().setPosition(me),
  50076. ve.point[p++] = v
  50077. } else if (r instanceof Ci.HemisphereLight) {
  50078. var v;
  50079. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  50080. v.direction.transformDirection(u),
  50081. v.direction.normalize(),
  50082. v.skyColor.copy(r.color).multiplyScalar(a),
  50083. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  50084. ve.hemi[g++] = v
  50085. }
  50086. ve.ambient[0] = l,
  50087. ve.ambient[1] = c,
  50088. ve.ambient[2] = h,
  50089. ve.directional.length = d,
  50090. ve.spot.length = f,
  50091. ve.point.length = p,
  50092. ve.hemi.length = g,
  50093. ve.shadows.length = m,
  50094. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  50095. }(U, t),
  50096. Re.render(e, t),
  50097. Ae.calls = 0,
  50098. Ae.vertices = 0,
  50099. Ae.faces = 0,
  50100. void (Ae.points = 0) === i && (i = null),
  50101. this.setRenderTarget(i),
  50102. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50103. e.overrideMaterial) {
  50104. var o = e.overrideMaterial;
  50105. c(H, t, r, o),
  50106. c(G, t, r, o)
  50107. } else
  50108. _e.setBlending(Ci.NoBlending),
  50109. c(H, t, r),
  50110. c(G, t, r);
  50111. if (Oe.render(e, t),
  50112. Le.render(e, t, re),
  50113. i) {
  50114. var a = i.texture;
  50115. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  50116. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  50117. , i = be.get(e.texture).__webglTexture;
  50118. _e.bindTexture(t, i),
  50119. X.generateMipmap(t),
  50120. _e.bindTexture(t, null)
  50121. }(i)
  50122. }
  50123. _e.setDepthTest(!0),
  50124. _e.setDepthWrite(!0),
  50125. _e.setColorWrite(!0)
  50126. } else
  50127. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  50128. }
  50129. ,
  50130. this.setFaceCulling = function(e, t) {
  50131. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  50132. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  50133. _e.enable(X.CULL_FACE))
  50134. }
  50135. ,
  50136. this.setTexture = function(e, t) {
  50137. var i = be.get(e);
  50138. if (0 < e.version && i.__version !== e.version) {
  50139. var n = e.image;
  50140. 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)
  50141. }
  50142. _e.activeTexture(X.TEXTURE0 + t),
  50143. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  50144. }
  50145. ,
  50146. this.getCurrentRenderTarget = function() {
  50147. return Q
  50148. }
  50149. ,
  50150. this.setRenderTarget = function(e) {
  50151. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  50152. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  50153. if (e) {
  50154. var n = be.get(e);
  50155. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  50156. ie.copy(e.scissor),
  50157. ne = e.scissorTest,
  50158. re.copy(e.viewport)
  50159. } else
  50160. t = null,
  50161. ie.copy(ue).multiplyScalar(he),
  50162. ne = de,
  50163. re.copy(pe).multiplyScalar(he);
  50164. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  50165. J = t),
  50166. _e.scissor(ie),
  50167. _e.setScissorTest(ne),
  50168. _e.viewport(re),
  50169. i) {
  50170. var r = be.get(e.texture);
  50171. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  50172. }
  50173. }
  50174. ,
  50175. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  50176. if (e instanceof Ci.WebGLRenderTarget != 0) {
  50177. var a = be.get(e).__webglFramebuffer;
  50178. if (a) {
  50179. var s = !1;
  50180. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  50181. s = !0);
  50182. try {
  50183. var l = e.texture;
  50184. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  50185. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50186. 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")))
  50187. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50188. 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.")
  50189. } finally {
  50190. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  50191. }
  50192. }
  50193. } else
  50194. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  50195. }
  50196. }
  50197. ,
  50198. Ci.WebGLRenderTarget = function(e, t, i) {
  50199. this.uuid = Ci.Math.generateUUID(),
  50200. this.width = e,
  50201. this.height = t,
  50202. this.scissor = new Ci.Vector4(0,0,e,t),
  50203. this.scissorTest = !1,
  50204. this.viewport = new Ci.Vector4(0,0,e,t),
  50205. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  50206. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50207. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50208. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50209. }
  50210. ,
  50211. Ci.WebGLRenderTarget.prototype = {
  50212. constructor: Ci.WebGLRenderTarget,
  50213. setSize: function(e, t) {
  50214. this.width === e && this.height === t || (this.width = e,
  50215. this.height = t,
  50216. this.dispose()),
  50217. this.viewport.set(0, 0, e, t),
  50218. this.scissor.set(0, 0, e, t)
  50219. },
  50220. clone: function() {
  50221. return (new this.constructor).copy(this)
  50222. },
  50223. copy: function(e) {
  50224. return this.width = e.width,
  50225. this.height = e.height,
  50226. this.viewport.copy(e.viewport),
  50227. this.texture = e.texture.clone(),
  50228. this.depthBuffer = e.depthBuffer,
  50229. this.stencilBuffer = e.stencilBuffer,
  50230. this
  50231. },
  50232. dispose: function() {
  50233. this.dispatchEvent({
  50234. type: "dispose"
  50235. })
  50236. }
  50237. },
  50238. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  50239. Ci.WebGLRenderTargetCube = function(e, t, i) {
  50240. Ci.WebGLRenderTarget.call(this, e, t, i),
  50241. this.activeCubeFace = 0,
  50242. this.activeMipMapLevel = 0
  50243. }
  50244. ,
  50245. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  50246. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  50247. Ci.WebGLBufferRenderer = function(r, o, a) {
  50248. var s;
  50249. this.setMode = function(e) {
  50250. s = e
  50251. }
  50252. ,
  50253. this.render = function(e, t) {
  50254. r.drawArrays(s, e, t),
  50255. a.calls++,
  50256. a.vertices += t,
  50257. s === r.TRIANGLES && (a.faces += t / 3)
  50258. }
  50259. ,
  50260. this.renderInstances = function(e) {
  50261. var t = o.get("ANGLE_instanced_arrays");
  50262. if (null !== t) {
  50263. var i = e.attributes.position
  50264. , n = 0;
  50265. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  50266. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  50267. a.calls++,
  50268. a.vertices += n * e.maxInstancedCount,
  50269. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  50270. } else
  50271. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  50272. }
  50273. }
  50274. ,
  50275. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  50276. var s, l, c;
  50277. this.setMode = function(e) {
  50278. s = e
  50279. }
  50280. ,
  50281. this.setIndex = function(e) {
  50282. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  50283. 4) : (l = r.UNSIGNED_SHORT,
  50284. 2)
  50285. }
  50286. ,
  50287. this.render = function(e, t) {
  50288. r.drawElements(s, t, l, e * c),
  50289. a.calls++,
  50290. a.vertices += t,
  50291. s === r.TRIANGLES && (a.faces += t / 3)
  50292. }
  50293. ,
  50294. this.renderInstances = function(e, t, i) {
  50295. var n = o.get("ANGLE_instanced_arrays");
  50296. 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),
  50297. a.calls++,
  50298. a.vertices += i * e.maxInstancedCount,
  50299. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  50300. }
  50301. }
  50302. ,
  50303. Ci.WebGLExtensions = function(i) {
  50304. var n = {};
  50305. this.get = function(e) {
  50306. if (void 0 !== n[e])
  50307. return n[e];
  50308. var t;
  50309. switch (e) {
  50310. case "EXT_texture_filter_anisotropic":
  50311. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50312. break;
  50313. case "WEBGL_compressed_texture_s3tc":
  50314. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50315. break;
  50316. case "WEBGL_compressed_texture_pvrtc":
  50317. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50318. break;
  50319. case "WEBGL_compressed_texture_etc1":
  50320. t = i.getExtension("WEBGL_compressed_texture_etc1");
  50321. break;
  50322. default:
  50323. t = i.getExtension(e)
  50324. }
  50325. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  50326. n[e] = t
  50327. }
  50328. }
  50329. ,
  50330. Ci.WebGLCapabilities = function(t, e, i) {
  50331. function n(e) {
  50332. if ("highp" === e) {
  50333. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  50334. return "highp";
  50335. e = "mediump"
  50336. }
  50337. 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"
  50338. }
  50339. this.getMaxPrecision = n,
  50340. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50341. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50342. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  50343. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50344. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  50345. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  50346. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  50347. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  50348. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  50349. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  50350. this.vertexTextures = 0 < this.maxVertexTextures,
  50351. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  50352. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50353. var r = n(this.precision);
  50354. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50355. this.precision = r),
  50356. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  50357. }
  50358. ,
  50359. Ci.WebGLGeometries = function(i, o, a) {
  50360. function s(e) {
  50361. var t = e.target
  50362. , i = c[t.id];
  50363. null !== i.index && l(i.index),
  50364. function(e) {
  50365. for (var t in e)
  50366. l(e[t])
  50367. }(i.attributes),
  50368. t.removeEventListener("dispose", s),
  50369. delete c[t.id];
  50370. var n = o.get(t);
  50371. n.wireframe && l(n.wireframe),
  50372. o.delete(t);
  50373. var r = o.get(i);
  50374. r.wireframe && l(r.wireframe),
  50375. o.delete(i),
  50376. a.memory.geometries--
  50377. }
  50378. function l(e) {
  50379. var t = function(e) {
  50380. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  50381. }(e);
  50382. void 0 !== t && (i.deleteBuffer(t),
  50383. function(e) {
  50384. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  50385. }(e))
  50386. }
  50387. var c = {};
  50388. this.get = function(e) {
  50389. var t, i = e.geometry;
  50390. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  50391. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  50392. t = i._bufferGeometry),
  50393. c[i.id] = t,
  50394. a.memory.geometries++,
  50395. t)
  50396. }
  50397. }
  50398. ,
  50399. Ci.WebGLLights = function() {
  50400. var i = {};
  50401. this.get = function(e) {
  50402. if (void 0 !== i[e.id])
  50403. return i[e.id];
  50404. var t;
  50405. switch (e.type) {
  50406. case "DirectionalLight":
  50407. t = {
  50408. direction: new Ci.Vector3,
  50409. color: new Ci.Color,
  50410. shadow: !1,
  50411. shadowBias: 0,
  50412. shadowRadius: 1,
  50413. shadowMapSize: new Ci.Vector2
  50414. };
  50415. break;
  50416. case "SpotLight":
  50417. t = {
  50418. position: new Ci.Vector3,
  50419. direction: new Ci.Vector3,
  50420. color: new Ci.Color,
  50421. distance: 0,
  50422. coneCos: 0,
  50423. penumbraCos: 0,
  50424. decay: 0,
  50425. shadow: !1,
  50426. shadowBias: 0,
  50427. shadowRadius: 1,
  50428. shadowMapSize: new Ci.Vector2
  50429. };
  50430. break;
  50431. case "PointLight":
  50432. t = {
  50433. position: new Ci.Vector3,
  50434. color: new Ci.Color,
  50435. distance: 0,
  50436. decay: 0,
  50437. shadow: !1,
  50438. shadowBias: 0,
  50439. shadowRadius: 1,
  50440. shadowMapSize: new Ci.Vector2
  50441. };
  50442. break;
  50443. case "HemisphereLight":
  50444. t = {
  50445. direction: new Ci.Vector3,
  50446. skyColor: new Ci.Color,
  50447. groundColor: new Ci.Color
  50448. }
  50449. }
  50450. return i[e.id] = t
  50451. }
  50452. }
  50453. ,
  50454. Ci.WebGLObjects = function(g, m, e) {
  50455. function v(e, t) {
  50456. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  50457. , n = m.get(i);
  50458. void 0 === n.__webglBuffer ? function(e, t, i) {
  50459. e.__webglBuffer = g.createBuffer(),
  50460. g.bindBuffer(i, e.__webglBuffer);
  50461. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  50462. g.bufferData(i, t.array, n),
  50463. e.version = t.version
  50464. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  50465. g.bindBuffer(i, e.__webglBuffer),
  50466. !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)),
  50467. t.updateRange.count = 0),
  50468. e.version = t.version
  50469. }(n, i, t)
  50470. }
  50471. function y(e, t, i) {
  50472. if (i < t) {
  50473. var n = t;
  50474. t = i,
  50475. i = n
  50476. }
  50477. var r = e[t];
  50478. return void 0 === r ? (e[t] = [i],
  50479. !0) : -1 === r.indexOf(i) && (r.push(i),
  50480. !0)
  50481. }
  50482. var c = new Ci.WebGLGeometries(g,m,e);
  50483. this.getAttributeBuffer = function(e) {
  50484. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  50485. }
  50486. ,
  50487. this.getWireframeAttribute = function(e) {
  50488. var t = m.get(e);
  50489. if (void 0 !== t.wireframe)
  50490. return t.wireframe;
  50491. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50492. if (null !== r)
  50493. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50494. var h = i[l + 0]
  50495. , u = i[l + 1]
  50496. , d = i[l + 2];
  50497. y(s, h, u) && n.push(h, u),
  50498. y(s, u, d) && n.push(u, d),
  50499. y(s, d, h) && n.push(d, h)
  50500. }
  50501. else
  50502. for (l = 0,
  50503. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50504. h = l + 0,
  50505. u = l + 1,
  50506. d = l + 2;
  50507. n.push(h, u, u, d, d, h)
  50508. }
  50509. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50510. , f = new Ci.BufferAttribute(new p(n),1);
  50511. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50512. t.wireframe = f
  50513. }
  50514. ,
  50515. this.update = function(e) {
  50516. var t = c.get(e);
  50517. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50518. var i = t.index
  50519. , n = t.attributes;
  50520. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50521. n)
  50522. v(n[r], g.ARRAY_BUFFER);
  50523. var o = t.morphAttributes;
  50524. for (var r in o)
  50525. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50526. v(a[s], g.ARRAY_BUFFER);
  50527. return t
  50528. }
  50529. }
  50530. ,
  50531. Ci.WebGLProgram = (Qt = 0,
  50532. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50533. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50534. ei = /^([\w\d_]+)\[0\]$/,
  50535. function(e, t, i, n) {
  50536. var r = e.context
  50537. , o = i.extensions
  50538. , a = i.defines
  50539. , s = i.__webglShader.vertexShader
  50540. , l = i.__webglShader.fragmentShader
  50541. , c = "SHADOWMAP_TYPE_BASIC";
  50542. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50543. var h = "ENVMAP_TYPE_CUBE"
  50544. , u = "ENVMAP_MODE_REFLECTION"
  50545. , d = "ENVMAP_BLENDING_MULTIPLY";
  50546. if (n.envMap) {
  50547. switch (i.envMap.mapping) {
  50548. case Ci.CubeReflectionMapping:
  50549. case Ci.CubeRefractionMapping:
  50550. h = "ENVMAP_TYPE_CUBE";
  50551. break;
  50552. case Ci.CubeUVReflectionMapping:
  50553. case Ci.CubeUVRefractionMapping:
  50554. h = "ENVMAP_TYPE_CUBE_UV";
  50555. break;
  50556. case Ci.EquirectangularReflectionMapping:
  50557. case Ci.EquirectangularRefractionMapping:
  50558. h = "ENVMAP_TYPE_EQUIREC";
  50559. break;
  50560. case Ci.SphericalReflectionMapping:
  50561. h = "ENVMAP_TYPE_SPHERE"
  50562. }
  50563. switch (i.envMap.mapping) {
  50564. case Ci.CubeRefractionMapping:
  50565. case Ci.EquirectangularRefractionMapping:
  50566. u = "ENVMAP_MODE_REFRACTION"
  50567. }
  50568. switch (i.combine) {
  50569. case Ci.MultiplyOperation:
  50570. d = "ENVMAP_BLENDING_MULTIPLY";
  50571. break;
  50572. case Ci.MixOperation:
  50573. d = "ENVMAP_BLENDING_MIX";
  50574. break;
  50575. case Ci.AddOperation:
  50576. d = "ENVMAP_BLENDING_ADD"
  50577. }
  50578. }
  50579. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50580. 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")
  50581. }(o, n, e.extensions), v = function(e) {
  50582. var t = [];
  50583. for (var i in e) {
  50584. var n = e[i];
  50585. !1 !== n && t.push("#define " + i + " " + n)
  50586. }
  50587. return t.join("\n")
  50588. }(a), y = r.createProgram();
  50589. 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"),
  50590. [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) {
  50591. var i;
  50592. switch (t) {
  50593. case Ci.LinearToneMapping:
  50594. i = "Linear";
  50595. break;
  50596. case Ci.ReinhardToneMapping:
  50597. i = "Reinhard";
  50598. break;
  50599. case Ci.Uncharted2ToneMapping:
  50600. i = "Uncharted2";
  50601. break;
  50602. case Ci.CineonToneMapping:
  50603. i = "OptimizedCineon";
  50604. break;
  50605. default:
  50606. throw new Error("unsupported toneMapping: " + t)
  50607. }
  50608. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50609. }("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) {
  50610. var i = Mi(t);
  50611. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50612. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50613. s = Oi(s = Li(s), n),
  50614. l = Oi(l = Li(l), n),
  50615. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50616. l = Di(l));
  50617. var A = p + s
  50618. , C = f + l
  50619. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50620. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50621. r.attachShader(y, I),
  50622. r.attachShader(y, E),
  50623. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50624. r.linkProgram(y);
  50625. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50626. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50627. 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),
  50628. M && (this.diagnostics = {
  50629. runnable: S,
  50630. material: i,
  50631. programLog: w,
  50632. vertexShader: {
  50633. log: T,
  50634. prefix: p
  50635. },
  50636. fragmentShader: {
  50637. log: x,
  50638. prefix: f
  50639. }
  50640. }),
  50641. r.deleteShader(I),
  50642. r.deleteShader(E),
  50643. this.getUniforms = function() {
  50644. return void 0 === _ && (_ = function(e, t) {
  50645. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50646. var o = e.getActiveUniform(t, r).name
  50647. , a = e.getUniformLocation(t, o)
  50648. , s = Jt.exec(o);
  50649. if (s) {
  50650. var l = s[1]
  50651. , c = s[2]
  50652. , h = i[l];
  50653. (h = h || (i[l] = {}))[c] = a
  50654. } else if (s = $t.exec(o)) {
  50655. var u = s[1]
  50656. , d = s[2]
  50657. , p = s[3]
  50658. , f = i[u]
  50659. , g = (f = f || (i[u] = []))[d];
  50660. (g = g || (f[d] = {}))[p] = a
  50661. } else
  50662. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50663. }
  50664. return i
  50665. }(r, y)),
  50666. _
  50667. }
  50668. ,
  50669. this.getAttributes = function() {
  50670. return void 0 === b && (b = function(e, t) {
  50671. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50672. var o = e.getActiveAttrib(t, r).name;
  50673. i[o] = e.getAttribLocation(t, o)
  50674. }
  50675. return i
  50676. }(r, y)),
  50677. b
  50678. }
  50679. ,
  50680. this.destroy = function() {
  50681. r.deleteProgram(y),
  50682. this.program = void 0
  50683. }
  50684. ,
  50685. Object.defineProperties(this, {
  50686. uniforms: {
  50687. get: function() {
  50688. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50689. this.getUniforms()
  50690. }
  50691. },
  50692. attributes: {
  50693. get: function() {
  50694. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50695. this.getAttributes()
  50696. }
  50697. }
  50698. }),
  50699. this.id = Qt++,
  50700. this.code = t,
  50701. this.usedTimes = 1,
  50702. this.program = y,
  50703. this.vertexShader = I,
  50704. this.fragmentShader = E,
  50705. this
  50706. }
  50707. ),
  50708. Ci.WebGLPrograms = function(s, l) {
  50709. function c(e, t) {
  50710. var i;
  50711. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50712. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50713. i
  50714. }
  50715. var h = []
  50716. , u = {
  50717. MeshDepthMaterial: "depth",
  50718. MeshNormalMaterial: "normal",
  50719. MeshBasicMaterial: "basic",
  50720. MeshLambertMaterial: "lambert",
  50721. MeshPhongMaterial: "phong",
  50722. MeshStandardMaterial: "standard",
  50723. LineBasicMaterial: "basic",
  50724. LineDashedMaterial: "dashed",
  50725. PointsMaterial: "points"
  50726. }
  50727. , 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"];
  50728. this.getParameters = function(e, t, i, n) {
  50729. var r = u[e.type]
  50730. , o = function(e) {
  50731. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50732. return 1024;
  50733. var t = l.maxVertexUniforms
  50734. , i = Math.floor((t - 20) / 4);
  50735. 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)")),
  50736. i
  50737. }(n)
  50738. , a = s.getPrecision();
  50739. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50740. {
  50741. shaderID: r,
  50742. precision: a,
  50743. supportsVertexTextures: l.vertexTextures,
  50744. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50745. map: !!e.map,
  50746. mapEncoding: c(e.map, s.gammaInput),
  50747. envMap: !!e.envMap,
  50748. envMapMode: e.envMap && e.envMap.mapping,
  50749. envMapEncoding: c(e.envMap, s.gammaInput),
  50750. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50751. lightMap: !!e.lightMap,
  50752. aoMap: !!e.aoMap,
  50753. emissiveMap: !!e.emissiveMap,
  50754. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50755. bumpMap: !!e.bumpMap,
  50756. normalMap: !!e.normalMap,
  50757. displacementMap: !!e.displacementMap,
  50758. roughnessMap: !!e.roughnessMap,
  50759. metalnessMap: !!e.metalnessMap,
  50760. specularMap: !!e.specularMap,
  50761. alphaMap: !!e.alphaMap,
  50762. combine: e.combine,
  50763. vertexColors: e.vertexColors,
  50764. fog: i,
  50765. useFog: e.fog,
  50766. fogExp: i instanceof Ci.FogExp2,
  50767. flatShading: e.shading === Ci.FlatShading,
  50768. sizeAttenuation: e.sizeAttenuation,
  50769. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50770. skinning: e.skinning,
  50771. maxBones: o,
  50772. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50773. morphTargets: e.morphTargets,
  50774. morphNormals: e.morphNormals,
  50775. maxMorphTargets: s.maxMorphTargets,
  50776. maxMorphNormals: s.maxMorphNormals,
  50777. numDirLights: t.directional.length,
  50778. numPointLights: t.point.length,
  50779. numSpotLights: t.spot.length,
  50780. numHemiLights: t.hemi.length,
  50781. pointLightShadows: t.shadowsPointLight,
  50782. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50783. shadowMapType: s.shadowMap.type,
  50784. toneMapping: s.toneMapping,
  50785. physicallyCorrectLights: s.physicallyCorrectLights,
  50786. premultipliedAlpha: e.premultipliedAlpha,
  50787. alphaTest: e.alphaTest,
  50788. doubleSided: e.side === Ci.DoubleSide,
  50789. flipSided: e.side === Ci.BackSide
  50790. }
  50791. }
  50792. ,
  50793. this.getProgramCode = function(e, t) {
  50794. var i = [];
  50795. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50796. i.push(e.vertexShader)),
  50797. void 0 !== e.defines)
  50798. for (var n in e.defines)
  50799. i.push(n),
  50800. i.push(e.defines[n]);
  50801. for (var r = 0; r < a.length; r++) {
  50802. var o = a[r];
  50803. i.push(o),
  50804. i.push(t[o])
  50805. }
  50806. return i.join()
  50807. }
  50808. ,
  50809. this.acquireProgram = function(e, t, i) {
  50810. for (var n, r = 0, o = h.length; r < o; r++) {
  50811. var a = h[r];
  50812. if (a.code === i) {
  50813. ++(n = a).usedTimes;
  50814. break
  50815. }
  50816. }
  50817. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50818. h.push(n)),
  50819. n
  50820. }
  50821. ,
  50822. this.releaseProgram = function(e) {
  50823. if (0 == --e.usedTimes) {
  50824. var t = h.indexOf(e);
  50825. h[t] = h[h.length - 1],
  50826. h.pop(),
  50827. e.destroy()
  50828. }
  50829. }
  50830. ,
  50831. this.programs = h
  50832. }
  50833. ,
  50834. Ci.WebGLProperties = function() {
  50835. var n = {};
  50836. this.get = function(e) {
  50837. var t = e.uuid
  50838. , i = n[t];
  50839. return void 0 === i && (i = {},
  50840. n[t] = i),
  50841. i
  50842. }
  50843. ,
  50844. this.delete = function(e) {
  50845. delete n[e.uuid]
  50846. }
  50847. ,
  50848. this.clear = function() {
  50849. n = {}
  50850. }
  50851. }
  50852. ,
  50853. Ci.WebGLShader = function(e, t, i) {
  50854. var n = e.createShader(t);
  50855. return e.shaderSource(n, i),
  50856. e.compileShader(n),
  50857. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50858. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50859. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50860. t[i] = i + 1 + ": " + t[i];
  50861. return t.join("\n")
  50862. }(i)),
  50863. n
  50864. }
  50865. ,
  50866. Ci.WebGLShadowMap = function(P, O, L) {
  50867. function D(e, t, i, n) {
  50868. var r = e.geometry
  50869. , o = null
  50870. , a = p
  50871. , s = e.customDepthMaterial;
  50872. if (i && (a = f,
  50873. s = e.customDistanceMaterial),
  50874. s)
  50875. o = s;
  50876. else {
  50877. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50878. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50879. , h = 0;
  50880. l && (h |= u),
  50881. c && (h |= d),
  50882. o = a[h]
  50883. }
  50884. return o.visible = t.visible,
  50885. o.wireframe = t.wireframe,
  50886. o.wireframeLinewidth = t.wireframeLinewidth,
  50887. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50888. o
  50889. }
  50890. function N(e, t, i) {
  50891. if (!1 !== e.visible) {
  50892. 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)))
  50893. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50894. G.push(e));
  50895. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50896. N(n[r], t, i)
  50897. }
  50898. }
  50899. 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) {
  50900. var a = 0 != (o & u)
  50901. , s = 0 != (o & d)
  50902. , l = new Ci.ShaderMaterial({
  50903. uniforms: i,
  50904. vertexShader: t.vertexShader,
  50905. fragmentShader: t.fragmentShader,
  50906. morphTargets: a,
  50907. skinning: s
  50908. });
  50909. p[o] = l;
  50910. var c = new Ci.ShaderMaterial({
  50911. defines: {
  50912. USE_SHADOWMAP: ""
  50913. },
  50914. uniforms: r,
  50915. vertexShader: n.vertexShader,
  50916. fragmentShader: n.fragmentShader,
  50917. morphTargets: a,
  50918. skinning: s
  50919. });
  50920. f[o] = c
  50921. }
  50922. var q = this;
  50923. this.enabled = !1,
  50924. this.autoUpdate = !0,
  50925. this.needsUpdate = !1,
  50926. this.type = Ci.PCFShadowMap,
  50927. this.cullFace = Ci.CullFaceFront,
  50928. this.render = function(e, t) {
  50929. var i, n, r = O.shadows;
  50930. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50931. B.clearColor(1, 1, 1, 1),
  50932. B.disable(F.BLEND),
  50933. B.enable(F.CULL_FACE),
  50934. F.frontFace(F.CCW),
  50935. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50936. B.setDepthTest(!0),
  50937. B.setScissorTest(!1);
  50938. for (var o = 0, a = r.length; o < a; o++) {
  50939. var s = r[o]
  50940. , l = s.shadow
  50941. , c = l.camera;
  50942. if (U.copy(l.mapSize),
  50943. s instanceof Ci.PointLight) {
  50944. i = 6,
  50945. n = !0;
  50946. var h = U.x
  50947. , u = U.y;
  50948. Y[0].set(2 * h, u, h, u),
  50949. Y[1].set(0, u, h, u),
  50950. Y[2].set(3 * h, u, h, u),
  50951. Y[3].set(h, u, h, u),
  50952. Y[4].set(3 * h, 0, h, u),
  50953. Y[5].set(h, 0, h, u),
  50954. U.x *= 4,
  50955. U.y *= 2
  50956. } else
  50957. n = !(i = 1);
  50958. if (null === l.map) {
  50959. var d = {
  50960. minFilter: Ci.NearestFilter,
  50961. magFilter: Ci.NearestFilter,
  50962. format: Ci.RGBAFormat
  50963. };
  50964. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50965. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50966. c.updateProjectionMatrix()
  50967. }
  50968. var p = l.map
  50969. , f = l.matrix;
  50970. z.setFromMatrixPosition(s.matrixWorld),
  50971. c.position.copy(z),
  50972. P.setRenderTarget(p),
  50973. P.clear();
  50974. for (var g = 0; g < i; g++) {
  50975. if (n) {
  50976. H.copy(c.position),
  50977. H.add(W[g]),
  50978. c.up.copy(j[g]),
  50979. c.lookAt(H);
  50980. var m = Y[g];
  50981. B.viewport(m)
  50982. } else
  50983. H.setFromMatrixPosition(s.target.matrixWorld),
  50984. c.lookAt(H);
  50985. c.updateMatrixWorld(),
  50986. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50987. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50988. f.multiply(c.projectionMatrix),
  50989. f.multiply(c.matrixWorldInverse),
  50990. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50991. V.setFromMatrix(k),
  50992. G.length = 0,
  50993. N(e, t, c);
  50994. for (var v = 0, y = G.length; v < y; v++) {
  50995. var A = G[v]
  50996. , C = L.update(A)
  50997. , I = A.material;
  50998. if (I instanceof Ci.MultiMaterial)
  50999. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  51000. var T = E[b]
  51001. , x = _[T.materialIndex];
  51002. if (!0 === x.visible) {
  51003. var S = D(A, x, n, z);
  51004. P.renderBufferDirect(c, null, C, S, A, T)
  51005. }
  51006. }
  51007. else {
  51008. S = D(A, I, n, z);
  51009. P.renderBufferDirect(c, null, C, S, A, null)
  51010. }
  51011. }
  51012. }
  51013. }
  51014. var M = P.getClearColor()
  51015. , R = P.getClearAlpha();
  51016. P.setClearColor(M, R),
  51017. B.enable(F.BLEND),
  51018. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  51019. q.needsUpdate = !1
  51020. }
  51021. }
  51022. }
  51023. ,
  51024. Ci.WebGLState = function(l, i, c) {
  51025. var n = this
  51026. , r = new Ci.Vector4
  51027. , o = new Uint8Array(16)
  51028. , a = new Uint8Array(16)
  51029. , s = new Uint8Array(16)
  51030. , t = {}
  51031. , h = null
  51032. , u = null
  51033. , d = null
  51034. , p = null
  51035. , f = null
  51036. , g = null
  51037. , m = null
  51038. , v = null
  51039. , y = !1
  51040. , A = null
  51041. , C = null
  51042. , I = null
  51043. , E = null
  51044. , _ = null
  51045. , b = null
  51046. , w = null
  51047. , T = null
  51048. , x = null
  51049. , S = null
  51050. , M = null
  51051. , R = null
  51052. , P = null
  51053. , O = null
  51054. , L = null
  51055. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  51056. , N = void 0
  51057. , F = {}
  51058. , B = new Ci.Vector4
  51059. , V = null
  51060. , k = null
  51061. , U = new Ci.Vector4
  51062. , H = new Ci.Vector4
  51063. , z = l.createTexture();
  51064. l.bindTexture(l.TEXTURE_2D, z),
  51065. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  51066. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  51067. this.init = function() {
  51068. this.clearColor(0, 0, 0, 1),
  51069. this.clearDepth(1),
  51070. this.clearStencil(0),
  51071. this.enable(l.DEPTH_TEST),
  51072. l.depthFunc(l.LEQUAL),
  51073. l.frontFace(l.CCW),
  51074. l.cullFace(l.BACK),
  51075. this.enable(l.CULL_FACE),
  51076. this.enable(l.BLEND),
  51077. l.blendEquation(l.FUNC_ADD),
  51078. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  51079. }
  51080. ,
  51081. this.initAttributes = function() {
  51082. for (var e = 0, t = o.length; e < t; e++)
  51083. o[e] = 0
  51084. }
  51085. ,
  51086. this.enableAttribute = function(e) {
  51087. o[e] = 1,
  51088. 0 === a[e] && (l.enableVertexAttribArray(e),
  51089. a[e] = 1),
  51090. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  51091. s[e] = 0)
  51092. }
  51093. ,
  51094. this.enableAttributeAndDivisor = function(e, t, i) {
  51095. o[e] = 1,
  51096. 0 === a[e] && (l.enableVertexAttribArray(e),
  51097. a[e] = 1),
  51098. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  51099. s[e] = t)
  51100. }
  51101. ,
  51102. this.disableUnusedAttributes = function() {
  51103. for (var e = 0, t = a.length; e < t; e++)
  51104. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  51105. a[e] = 0)
  51106. }
  51107. ,
  51108. this.enable = function(e) {
  51109. !0 !== t[e] && (l.enable(e),
  51110. t[e] = !0)
  51111. }
  51112. ,
  51113. this.disable = function(e) {
  51114. !1 !== t[e] && (l.disable(e),
  51115. t[e] = !1)
  51116. }
  51117. ,
  51118. this.getCompressedTextureFormats = function() {
  51119. if (null === h && (h = [],
  51120. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  51121. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  51122. h.push(e[t]);
  51123. return h
  51124. }
  51125. ,
  51126. this.setBlending = function(e, t, i, n, r, o, a, s) {
  51127. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  51128. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51129. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  51130. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51131. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51132. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51133. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  51134. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51135. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  51136. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  51137. u = e,
  51138. y = s),
  51139. e === Ci.CustomBlending ? (r = r || t,
  51140. o = o || i,
  51141. a = a || n,
  51142. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  51143. d = t,
  51144. g = r),
  51145. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  51146. p = i,
  51147. f = n,
  51148. m = o,
  51149. v = a)) : v = m = g = f = p = d = null
  51150. }
  51151. ,
  51152. this.setDepthFunc = function(e) {
  51153. if (A !== e) {
  51154. if (e)
  51155. switch (e) {
  51156. case Ci.NeverDepth:
  51157. l.depthFunc(l.NEVER);
  51158. break;
  51159. case Ci.AlwaysDepth:
  51160. l.depthFunc(l.ALWAYS);
  51161. break;
  51162. case Ci.LessDepth:
  51163. l.depthFunc(l.LESS);
  51164. break;
  51165. case Ci.LessEqualDepth:
  51166. l.depthFunc(l.LEQUAL);
  51167. break;
  51168. case Ci.EqualDepth:
  51169. l.depthFunc(l.EQUAL);
  51170. break;
  51171. case Ci.GreaterEqualDepth:
  51172. l.depthFunc(l.GEQUAL);
  51173. break;
  51174. case Ci.GreaterDepth:
  51175. l.depthFunc(l.GREATER);
  51176. break;
  51177. case Ci.NotEqualDepth:
  51178. l.depthFunc(l.NOTEQUAL);
  51179. break;
  51180. default:
  51181. l.depthFunc(l.LEQUAL)
  51182. }
  51183. else
  51184. l.depthFunc(l.LEQUAL);
  51185. A = e
  51186. }
  51187. }
  51188. ,
  51189. this.setDepthTest = function(e) {
  51190. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  51191. }
  51192. ,
  51193. this.setDepthWrite = function(e) {
  51194. C !== e && (l.depthMask(e),
  51195. C = e)
  51196. }
  51197. ,
  51198. this.setColorWrite = function(e) {
  51199. I !== e && (l.colorMask(e, e, e, e),
  51200. I = e)
  51201. }
  51202. ,
  51203. this.setStencilFunc = function(e, t, i) {
  51204. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  51205. _ = e,
  51206. b = t,
  51207. w = i)
  51208. }
  51209. ,
  51210. this.setStencilOp = function(e, t, i) {
  51211. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  51212. T = e,
  51213. x = t,
  51214. S = i)
  51215. }
  51216. ,
  51217. this.setStencilTest = function(e) {
  51218. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  51219. }
  51220. ,
  51221. this.setStencilWrite = function(e) {
  51222. E !== e && (l.stencilMask(e),
  51223. E = e)
  51224. }
  51225. ,
  51226. this.setFlipSided = function(e) {
  51227. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  51228. M = e)
  51229. }
  51230. ,
  51231. this.setLineWidth = function(e) {
  51232. e !== R && (l.lineWidth(e),
  51233. R = e)
  51234. }
  51235. ,
  51236. this.setPolygonOffset = function(e, t, i) {
  51237. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  51238. !e || P === t && O === i || (l.polygonOffset(t, i),
  51239. P = t,
  51240. O = i)
  51241. }
  51242. ,
  51243. this.getScissorTest = function() {
  51244. return L
  51245. }
  51246. ,
  51247. this.setScissorTest = function(e) {
  51248. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  51249. }
  51250. ,
  51251. this.activeTexture = function(e) {
  51252. void 0 === e && (e = l.TEXTURE0 + D - 1),
  51253. N !== e && (l.activeTexture(e),
  51254. N = e)
  51255. }
  51256. ,
  51257. this.bindTexture = function(e, t) {
  51258. void 0 === N && n.activeTexture();
  51259. var i = F[N];
  51260. void 0 === i && (i = {
  51261. type: void 0,
  51262. texture: void 0
  51263. },
  51264. F[N] = i),
  51265. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  51266. i.type = e,
  51267. i.texture = t)
  51268. }
  51269. ,
  51270. this.compressedTexImage2D = function() {
  51271. try {
  51272. l.compressedTexImage2D.apply(l, arguments)
  51273. } catch (e) {
  51274. console.error(e)
  51275. }
  51276. }
  51277. ,
  51278. this.texImage2D = function() {
  51279. try {
  51280. l.texImage2D.apply(l, arguments)
  51281. } catch (e) {
  51282. console.error(e)
  51283. }
  51284. }
  51285. ,
  51286. this.clearColor = function(e, t, i, n) {
  51287. r.set(e, t, i, n),
  51288. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  51289. B.copy(r))
  51290. }
  51291. ,
  51292. this.clearDepth = function(e) {
  51293. V !== e && (l.clearDepth(e),
  51294. V = e)
  51295. }
  51296. ,
  51297. this.clearStencil = function(e) {
  51298. k !== e && (l.clearStencil(e),
  51299. k = e)
  51300. }
  51301. ,
  51302. this.scissor = function(e) {
  51303. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  51304. U.copy(e))
  51305. }
  51306. ,
  51307. this.viewport = function(e) {
  51308. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  51309. H.copy(e))
  51310. }
  51311. ,
  51312. this.reset = function() {
  51313. for (var e = 0; e < a.length; e++)
  51314. 1 === a[e] && (l.disableVertexAttribArray(e),
  51315. a[e] = 0);
  51316. t = {},
  51317. N = void 0,
  51318. F = {},
  51319. M = E = C = I = u = h = null
  51320. }
  51321. }
  51322. ,
  51323. Ci.LensFlarePlugin = function(v, y) {
  51324. function A() {
  51325. 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]);
  51326. C = S.createBuffer(),
  51327. I = S.createBuffer(),
  51328. S.bindBuffer(S.ARRAY_BUFFER, C),
  51329. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  51330. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51331. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  51332. T = S.createTexture(),
  51333. x = S.createTexture(),
  51334. M.bindTexture(S.TEXTURE_2D, T),
  51335. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  51336. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51337. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51338. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51339. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51340. M.bindTexture(S.TEXTURE_2D, x),
  51341. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  51342. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  51343. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  51344. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  51345. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  51346. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  51347. 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"),
  51348. 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")
  51349. } : {
  51350. 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"),
  51351. 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")
  51352. },
  51353. E = function(e) {
  51354. var t = S.createProgram()
  51355. , i = S.createShader(S.FRAGMENT_SHADER)
  51356. , n = S.createShader(S.VERTEX_SHADER)
  51357. , r = "precision " + v.getPrecision() + " float;\n";
  51358. return S.shaderSource(i, r + e.fragmentShader),
  51359. S.shaderSource(n, r + e.vertexShader),
  51360. S.compileShader(i),
  51361. S.compileShader(n),
  51362. S.attachShader(t, i),
  51363. S.attachShader(t, n),
  51364. S.linkProgram(t),
  51365. t
  51366. }(e),
  51367. _ = {
  51368. vertex: S.getAttribLocation(E, "position"),
  51369. uv: S.getAttribLocation(E, "uv")
  51370. },
  51371. b = {
  51372. renderType: S.getUniformLocation(E, "renderType"),
  51373. map: S.getUniformLocation(E, "map"),
  51374. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  51375. opacity: S.getUniformLocation(E, "opacity"),
  51376. color: S.getUniformLocation(E, "color"),
  51377. scale: S.getUniformLocation(E, "scale"),
  51378. rotation: S.getUniformLocation(E, "rotation"),
  51379. screenPosition: S.getUniformLocation(E, "screenPosition")
  51380. }
  51381. }
  51382. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  51383. this.render = function(e, t, i) {
  51384. if (0 !== y.length) {
  51385. var n = new Ci.Vector3
  51386. , r = i.w / i.z
  51387. , o = .5 * i.z
  51388. , a = .5 * i.w
  51389. , s = 16 / i.w
  51390. , l = new Ci.Vector2(s * r,s)
  51391. , c = new Ci.Vector3(1,1,0)
  51392. , h = new Ci.Vector2(1,1);
  51393. void 0 === E && A(),
  51394. S.useProgram(E),
  51395. M.initAttributes(),
  51396. M.enableAttribute(_.vertex),
  51397. M.enableAttribute(_.uv),
  51398. M.disableUnusedAttributes(),
  51399. S.uniform1i(b.occlusionMap, 0),
  51400. S.uniform1i(b.map, 1),
  51401. S.bindBuffer(S.ARRAY_BUFFER, C),
  51402. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  51403. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  51404. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  51405. M.disable(S.CULL_FACE),
  51406. M.setDepthWrite(!1);
  51407. for (var u = 0, d = y.length; u < d; u++) {
  51408. s = 16 / i.w,
  51409. l.set(s * r, s);
  51410. var p = y[u];
  51411. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  51412. n.applyMatrix4(t.matrixWorldInverse),
  51413. n.applyProjection(t.projectionMatrix),
  51414. c.copy(n),
  51415. h.x = c.x * o + o,
  51416. h.y = c.y * a + a,
  51417. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  51418. M.activeTexture(S.TEXTURE0),
  51419. M.bindTexture(S.TEXTURE_2D, null),
  51420. M.activeTexture(S.TEXTURE1),
  51421. M.bindTexture(S.TEXTURE_2D, T),
  51422. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51423. S.uniform1i(b.renderType, 0),
  51424. S.uniform2f(b.scale, l.x, l.y),
  51425. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51426. M.disable(S.BLEND),
  51427. M.enable(S.DEPTH_TEST),
  51428. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51429. M.activeTexture(S.TEXTURE0),
  51430. M.bindTexture(S.TEXTURE_2D, x),
  51431. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  51432. S.uniform1i(b.renderType, 1),
  51433. M.disable(S.DEPTH_TEST),
  51434. M.activeTexture(S.TEXTURE1),
  51435. M.bindTexture(S.TEXTURE_2D, T),
  51436. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  51437. p.positionScreen.copy(c),
  51438. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  51439. S.uniform1i(b.renderType, 2),
  51440. M.enable(S.BLEND);
  51441. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  51442. var m = p.lensFlares[f];
  51443. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  51444. c.y = m.y,
  51445. c.z = m.z,
  51446. s = m.size * m.scale / i.w,
  51447. l.x = s * r,
  51448. l.y = s,
  51449. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  51450. S.uniform2f(b.scale, l.x, l.y),
  51451. S.uniform1f(b.rotation, m.rotation),
  51452. S.uniform1f(b.opacity, m.opacity),
  51453. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  51454. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  51455. v.setTexture(m.texture, 1),
  51456. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  51457. }
  51458. }
  51459. }
  51460. M.enable(S.CULL_FACE),
  51461. M.enable(S.DEPTH_TEST),
  51462. M.setDepthWrite(!0),
  51463. v.resetGLState()
  51464. }
  51465. }
  51466. }
  51467. ,
  51468. Ci.SpritePlugin = function(u, d) {
  51469. function p() {
  51470. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51471. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51472. g = I.createBuffer(),
  51473. m = I.createBuffer(),
  51474. I.bindBuffer(I.ARRAY_BUFFER, g),
  51475. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  51476. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51477. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  51478. v = function() {
  51479. var e = I.createProgram()
  51480. , t = I.createShader(I.VERTEX_SHADER)
  51481. , i = I.createShader(I.FRAGMENT_SHADER);
  51482. 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")),
  51483. 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")),
  51484. I.compileShader(t),
  51485. I.compileShader(i),
  51486. I.attachShader(e, t),
  51487. I.attachShader(e, i),
  51488. I.linkProgram(e),
  51489. e
  51490. }(),
  51491. y = {
  51492. position: I.getAttribLocation(v, "position"),
  51493. uv: I.getAttribLocation(v, "uv")
  51494. },
  51495. A = {
  51496. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51497. uvScale: I.getUniformLocation(v, "uvScale"),
  51498. rotation: I.getUniformLocation(v, "rotation"),
  51499. scale: I.getUniformLocation(v, "scale"),
  51500. color: I.getUniformLocation(v, "color"),
  51501. map: I.getUniformLocation(v, "map"),
  51502. opacity: I.getUniformLocation(v, "opacity"),
  51503. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51504. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51505. fogType: I.getUniformLocation(v, "fogType"),
  51506. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51507. fogNear: I.getUniformLocation(v, "fogNear"),
  51508. fogFar: I.getUniformLocation(v, "fogFar"),
  51509. fogColor: I.getUniformLocation(v, "fogColor"),
  51510. alphaTest: I.getUniformLocation(v, "alphaTest")
  51511. };
  51512. var i = document.createElement("canvas");
  51513. i.width = 8,
  51514. i.height = 8;
  51515. var n = i.getContext("2d");
  51516. n.fillStyle = "white",
  51517. n.fillRect(0, 0, 8, 8),
  51518. (C = new Ci.Texture(i)).needsUpdate = !0
  51519. }
  51520. function f(e, t) {
  51521. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51522. }
  51523. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51524. this.render = function(e, t) {
  51525. if (0 !== d.length) {
  51526. void 0 === v && p(),
  51527. I.useProgram(v),
  51528. E.initAttributes(),
  51529. E.enableAttribute(y.position),
  51530. E.enableAttribute(y.uv),
  51531. E.disableUnusedAttributes(),
  51532. E.disable(I.CULL_FACE),
  51533. E.enable(I.BLEND),
  51534. I.bindBuffer(I.ARRAY_BUFFER, g),
  51535. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51536. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51537. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51538. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51539. E.activeTexture(I.TEXTURE0),
  51540. I.uniform1i(A.map, 0);
  51541. var i = 0
  51542. , n = 0
  51543. , r = e.fog;
  51544. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51545. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51546. I.uniform1f(A.fogFar, r.far),
  51547. I.uniform1i(A.fogType, 1),
  51548. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51549. I.uniform1i(A.fogType, 2),
  51550. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51551. n = i = 0);
  51552. for (var o = 0, a = d.length; o < a; o++) {
  51553. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51554. l.z = -l.modelViewMatrix.elements[14]
  51555. }
  51556. d.sort(f);
  51557. var s = [];
  51558. for (o = 0,
  51559. a = d.length; o < a; o++) {
  51560. var l, c = (l = d[o]).material;
  51561. I.uniform1f(A.alphaTest, c.alphaTest),
  51562. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51563. l.matrixWorld.decompose(_, b, w),
  51564. s[0] = w.x,
  51565. s[1] = w.y;
  51566. var h = 0;
  51567. e.fog && c.fog && (h = n),
  51568. i !== h && (I.uniform1i(A.fogType, h),
  51569. i = h),
  51570. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51571. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51572. I.uniform2f(A.uvScale, 1, 1)),
  51573. I.uniform1f(A.opacity, c.opacity),
  51574. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51575. I.uniform1f(A.rotation, c.rotation),
  51576. I.uniform2fv(A.scale, s),
  51577. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51578. E.setDepthTest(c.depthTest),
  51579. E.setDepthWrite(c.depthWrite),
  51580. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51581. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51582. }
  51583. E.enable(I.CULL_FACE),
  51584. u.resetGLState()
  51585. }
  51586. }
  51587. }
  51588. ,
  51589. Object.defineProperties(Ci.Box2.prototype, {
  51590. empty: {
  51591. value: function() {
  51592. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51593. this.isEmpty()
  51594. }
  51595. },
  51596. isIntersectionBox: {
  51597. value: function(e) {
  51598. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51599. this.intersectsBox(e)
  51600. }
  51601. }
  51602. }),
  51603. Object.defineProperties(Ci.Box3.prototype, {
  51604. empty: {
  51605. value: function() {
  51606. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51607. this.isEmpty()
  51608. }
  51609. },
  51610. isIntersectionBox: {
  51611. value: function(e) {
  51612. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51613. this.intersectsBox(e)
  51614. }
  51615. },
  51616. isIntersectionSphere: {
  51617. value: function(e) {
  51618. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51619. this.intersectsSphere(e)
  51620. }
  51621. }
  51622. }),
  51623. Object.defineProperties(Ci.Matrix3.prototype, {
  51624. multiplyVector3: {
  51625. value: function(e) {
  51626. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51627. e.applyMatrix3(this)
  51628. }
  51629. },
  51630. multiplyVector3Array: {
  51631. value: function(e) {
  51632. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51633. this.applyToVector3Array(e)
  51634. }
  51635. }
  51636. }),
  51637. Object.defineProperties(Ci.Matrix4.prototype, {
  51638. extractPosition: {
  51639. value: function(e) {
  51640. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51641. this.copyPosition(e)
  51642. }
  51643. },
  51644. setRotationFromQuaternion: {
  51645. value: function(e) {
  51646. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51647. this.makeRotationFromQuaternion(e)
  51648. }
  51649. },
  51650. multiplyVector3: {
  51651. value: function(e) {
  51652. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51653. e.applyProjection(this)
  51654. }
  51655. },
  51656. multiplyVector4: {
  51657. value: function(e) {
  51658. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51659. e.applyMatrix4(this)
  51660. }
  51661. },
  51662. multiplyVector3Array: {
  51663. value: function(e) {
  51664. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51665. this.applyToVector3Array(e)
  51666. }
  51667. },
  51668. rotateAxis: {
  51669. value: function(e) {
  51670. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51671. e.transformDirection(this)
  51672. }
  51673. },
  51674. crossVector: {
  51675. value: function(e) {
  51676. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51677. e.applyMatrix4(this)
  51678. }
  51679. },
  51680. translate: {
  51681. value: function(e) {
  51682. console.error("THREE.Matrix4: .translate() has been removed.")
  51683. }
  51684. },
  51685. rotateX: {
  51686. value: function(e) {
  51687. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51688. }
  51689. },
  51690. rotateY: {
  51691. value: function(e) {
  51692. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51693. }
  51694. },
  51695. rotateZ: {
  51696. value: function(e) {
  51697. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51698. }
  51699. },
  51700. rotateByAxis: {
  51701. value: function(e, t) {
  51702. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51703. }
  51704. }
  51705. }),
  51706. Object.defineProperties(Ci.Plane.prototype, {
  51707. isIntersectionLine: {
  51708. value: function(e) {
  51709. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51710. this.intersectsLine(e)
  51711. }
  51712. }
  51713. }),
  51714. Object.defineProperties(Ci.Quaternion.prototype, {
  51715. multiplyVector3: {
  51716. value: function(e) {
  51717. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51718. e.applyQuaternion(this)
  51719. }
  51720. }
  51721. }),
  51722. Object.defineProperties(Ci.Ray.prototype, {
  51723. isIntersectionBox: {
  51724. value: function(e) {
  51725. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51726. this.intersectsBox(e)
  51727. }
  51728. },
  51729. isIntersectionPlane: {
  51730. value: function(e) {
  51731. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51732. this.intersectsPlane(e)
  51733. }
  51734. },
  51735. isIntersectionSphere: {
  51736. value: function(e) {
  51737. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51738. this.intersectsSphere(e)
  51739. }
  51740. }
  51741. }),
  51742. Object.defineProperties(Ci.Vector3.prototype, {
  51743. setEulerFromRotationMatrix: {
  51744. value: function() {
  51745. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51746. }
  51747. },
  51748. setEulerFromQuaternion: {
  51749. value: function() {
  51750. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51751. }
  51752. },
  51753. getPositionFromMatrix: {
  51754. value: function(e) {
  51755. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51756. this.setFromMatrixPosition(e)
  51757. }
  51758. },
  51759. getScaleFromMatrix: {
  51760. value: function(e) {
  51761. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51762. this.setFromMatrixScale(e)
  51763. }
  51764. },
  51765. getColumnFromMatrix: {
  51766. value: function(e, t) {
  51767. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51768. this.setFromMatrixColumn(e, t)
  51769. }
  51770. }
  51771. }),
  51772. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51773. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51774. new Ci.Face3(e,t,i,r,o,a)
  51775. }
  51776. ,
  51777. Ci.Vertex = function(e, t, i) {
  51778. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51779. new Ci.Vector3(e,t,i)
  51780. }
  51781. ,
  51782. Object.defineProperties(Ci.Object3D.prototype, {
  51783. eulerOrder: {
  51784. get: function() {
  51785. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51786. this.rotation.order
  51787. },
  51788. set: function(e) {
  51789. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51790. this.rotation.order = e
  51791. }
  51792. },
  51793. getChildByName: {
  51794. value: function(e) {
  51795. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51796. this.getObjectByName(e)
  51797. }
  51798. },
  51799. renderDepth: {
  51800. set: function(e) {
  51801. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51802. }
  51803. },
  51804. translate: {
  51805. value: function(e, t) {
  51806. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51807. this.translateOnAxis(t, e)
  51808. }
  51809. },
  51810. useQuaternion: {
  51811. get: function() {
  51812. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51813. },
  51814. set: function(e) {
  51815. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51816. }
  51817. }
  51818. }),
  51819. Object.defineProperties(Ci, {
  51820. PointCloud: {
  51821. value: function(e, t) {
  51822. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51823. new Ci.Points(e,t)
  51824. }
  51825. },
  51826. ParticleSystem: {
  51827. value: function(e, t) {
  51828. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51829. new Ci.Points(e,t)
  51830. }
  51831. }
  51832. }),
  51833. Object.defineProperties(Ci.Light.prototype, {
  51834. onlyShadow: {
  51835. set: function(e) {
  51836. console.warn("THREE.Light: .onlyShadow has been removed.")
  51837. }
  51838. },
  51839. shadowCameraFov: {
  51840. set: function(e) {
  51841. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51842. this.shadow.camera.fov = e
  51843. }
  51844. },
  51845. shadowCameraLeft: {
  51846. set: function(e) {
  51847. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51848. this.shadow.camera.left = e
  51849. }
  51850. },
  51851. shadowCameraRight: {
  51852. set: function(e) {
  51853. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51854. this.shadow.camera.right = e
  51855. }
  51856. },
  51857. shadowCameraTop: {
  51858. set: function(e) {
  51859. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51860. this.shadow.camera.top = e
  51861. }
  51862. },
  51863. shadowCameraBottom: {
  51864. set: function(e) {
  51865. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51866. this.shadow.camera.bottom = e
  51867. }
  51868. },
  51869. shadowCameraNear: {
  51870. set: function(e) {
  51871. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51872. this.shadow.camera.near = e
  51873. }
  51874. },
  51875. shadowCameraFar: {
  51876. set: function(e) {
  51877. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51878. this.shadow.camera.far = e
  51879. }
  51880. },
  51881. shadowCameraVisible: {
  51882. set: function(e) {
  51883. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51884. }
  51885. },
  51886. shadowBias: {
  51887. set: function(e) {
  51888. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51889. this.shadow.bias = e
  51890. }
  51891. },
  51892. shadowDarkness: {
  51893. set: function(e) {
  51894. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51895. }
  51896. },
  51897. shadowMapWidth: {
  51898. set: function(e) {
  51899. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51900. this.shadow.mapSize.width = e
  51901. }
  51902. },
  51903. shadowMapHeight: {
  51904. set: function(e) {
  51905. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51906. this.shadow.mapSize.height = e
  51907. }
  51908. }
  51909. }),
  51910. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51911. length: {
  51912. get: function() {
  51913. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51914. this.array.length
  51915. }
  51916. }
  51917. }),
  51918. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51919. drawcalls: {
  51920. get: function() {
  51921. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51922. this.groups
  51923. }
  51924. },
  51925. offsets: {
  51926. get: function() {
  51927. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51928. this.groups
  51929. }
  51930. },
  51931. addIndex: {
  51932. value: function(e) {
  51933. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51934. this.setIndex(e)
  51935. }
  51936. },
  51937. addDrawCall: {
  51938. value: function(e, t, i) {
  51939. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51940. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51941. this.addGroup(e, t)
  51942. }
  51943. },
  51944. clearDrawCalls: {
  51945. value: function() {
  51946. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51947. this.clearGroups()
  51948. }
  51949. },
  51950. computeTangents: {
  51951. value: function() {
  51952. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51953. }
  51954. },
  51955. computeOffsets: {
  51956. value: function() {
  51957. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51958. }
  51959. }
  51960. }),
  51961. Object.defineProperties(Ci.Material.prototype, {
  51962. wrapAround: {
  51963. get: function() {
  51964. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51965. },
  51966. set: function(e) {
  51967. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51968. }
  51969. },
  51970. wrapRGB: {
  51971. get: function() {
  51972. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51973. new Ci.Color
  51974. }
  51975. }
  51976. }),
  51977. Object.defineProperties(Ci, {
  51978. PointCloudMaterial: {
  51979. value: function(e) {
  51980. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51981. new Ci.PointsMaterial(e)
  51982. }
  51983. },
  51984. ParticleBasicMaterial: {
  51985. value: function(e) {
  51986. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51987. new Ci.PointsMaterial(e)
  51988. }
  51989. },
  51990. ParticleSystemMaterial: {
  51991. value: function(e) {
  51992. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51993. new Ci.PointsMaterial(e)
  51994. }
  51995. }
  51996. }),
  51997. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51998. metal: {
  51999. get: function() {
  52000. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52001. !1
  52002. },
  52003. set: function(e) {
  52004. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52005. }
  52006. }
  52007. }),
  52008. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  52009. derivatives: {
  52010. get: function() {
  52011. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52012. this.extensions.derivatives
  52013. },
  52014. set: function(e) {
  52015. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52016. this.extensions.derivatives = e
  52017. }
  52018. }
  52019. }),
  52020. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  52021. supportsFloatTextures: {
  52022. value: function() {
  52023. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52024. this.extensions.get("OES_texture_float")
  52025. }
  52026. },
  52027. supportsHalfFloatTextures: {
  52028. value: function() {
  52029. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52030. this.extensions.get("OES_texture_half_float")
  52031. }
  52032. },
  52033. supportsStandardDerivatives: {
  52034. value: function() {
  52035. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52036. this.extensions.get("OES_standard_derivatives")
  52037. }
  52038. },
  52039. supportsCompressedTextureS3TC: {
  52040. value: function() {
  52041. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52042. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52043. }
  52044. },
  52045. supportsCompressedTexturePVRTC: {
  52046. value: function() {
  52047. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52048. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52049. }
  52050. },
  52051. supportsBlendMinMax: {
  52052. value: function() {
  52053. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52054. this.extensions.get("EXT_blend_minmax")
  52055. }
  52056. },
  52057. supportsVertexTextures: {
  52058. value: function() {
  52059. return this.capabilities.vertexTextures
  52060. }
  52061. },
  52062. supportsInstancedArrays: {
  52063. value: function() {
  52064. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52065. this.extensions.get("ANGLE_instanced_arrays")
  52066. }
  52067. },
  52068. enableScissorTest: {
  52069. value: function(e) {
  52070. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52071. this.setScissorTest(e)
  52072. }
  52073. },
  52074. initMaterial: {
  52075. value: function() {
  52076. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52077. }
  52078. },
  52079. addPrePlugin: {
  52080. value: function() {
  52081. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52082. }
  52083. },
  52084. addPostPlugin: {
  52085. value: function() {
  52086. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52087. }
  52088. },
  52089. updateShadowMap: {
  52090. value: function() {
  52091. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52092. }
  52093. },
  52094. shadowMapEnabled: {
  52095. get: function() {
  52096. return this.shadowMap.enabled
  52097. },
  52098. set: function(e) {
  52099. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52100. this.shadowMap.enabled = e
  52101. }
  52102. },
  52103. shadowMapType: {
  52104. get: function() {
  52105. return this.shadowMap.type
  52106. },
  52107. set: function(e) {
  52108. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52109. this.shadowMap.type = e
  52110. }
  52111. },
  52112. shadowMapCullFace: {
  52113. get: function() {
  52114. return this.shadowMap.cullFace
  52115. },
  52116. set: function(e) {
  52117. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52118. this.shadowMap.cullFace = e
  52119. }
  52120. }
  52121. }),
  52122. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  52123. wrapS: {
  52124. get: function() {
  52125. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52126. this.texture.wrapS
  52127. },
  52128. set: function(e) {
  52129. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52130. this.texture.wrapS = e
  52131. }
  52132. },
  52133. wrapT: {
  52134. get: function() {
  52135. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52136. this.texture.wrapT
  52137. },
  52138. set: function(e) {
  52139. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52140. this.texture.wrapT = e
  52141. }
  52142. },
  52143. magFilter: {
  52144. get: function() {
  52145. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52146. this.texture.magFilter
  52147. },
  52148. set: function(e) {
  52149. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52150. this.texture.magFilter = e
  52151. }
  52152. },
  52153. minFilter: {
  52154. get: function() {
  52155. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52156. this.texture.minFilter
  52157. },
  52158. set: function(e) {
  52159. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52160. this.texture.minFilter = e
  52161. }
  52162. },
  52163. anisotropy: {
  52164. get: function() {
  52165. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52166. this.texture.anisotropy
  52167. },
  52168. set: function(e) {
  52169. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52170. this.texture.anisotropy = e
  52171. }
  52172. },
  52173. offset: {
  52174. get: function() {
  52175. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52176. this.texture.offset
  52177. },
  52178. set: function(e) {
  52179. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52180. this.texture.offset = e
  52181. }
  52182. },
  52183. repeat: {
  52184. get: function() {
  52185. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52186. this.texture.repeat
  52187. },
  52188. set: function(e) {
  52189. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52190. this.texture.repeat = e
  52191. }
  52192. },
  52193. format: {
  52194. get: function() {
  52195. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52196. this.texture.format
  52197. },
  52198. set: function(e) {
  52199. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52200. this.texture.format = e
  52201. }
  52202. },
  52203. type: {
  52204. get: function() {
  52205. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52206. this.texture.type
  52207. },
  52208. set: function(e) {
  52209. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52210. this.texture.type = e
  52211. }
  52212. },
  52213. generateMipmaps: {
  52214. get: function() {
  52215. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52216. this.texture.generateMipmaps
  52217. },
  52218. set: function(e) {
  52219. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52220. this.texture.generateMipmaps = e
  52221. }
  52222. }
  52223. }),
  52224. Ci.GeometryUtils = {
  52225. merge: function(e, t, i) {
  52226. var n;
  52227. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  52228. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52229. n = t.matrix,
  52230. t = t.geometry),
  52231. e.merge(t, n, i)
  52232. },
  52233. center: function(e) {
  52234. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52235. e.center()
  52236. }
  52237. },
  52238. Ci.ImageUtils = {
  52239. crossOrigin: void 0,
  52240. loadTexture: function(e, t, i, n) {
  52241. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52242. var r = new Ci.TextureLoader;
  52243. r.setCrossOrigin(this.crossOrigin);
  52244. var o = r.load(e, i, void 0, n);
  52245. return t && (o.mapping = t),
  52246. o
  52247. },
  52248. loadTextureCube: function(e, t, i, n) {
  52249. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52250. var r = new Ci.CubeTextureLoader;
  52251. r.setCrossOrigin(this.crossOrigin);
  52252. var o = r.load(e, i, void 0, n);
  52253. return t && (o.mapping = t),
  52254. o
  52255. },
  52256. loadCompressedTexture: function() {
  52257. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52258. },
  52259. loadCompressedTextureCube: function() {
  52260. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52261. }
  52262. },
  52263. Ci.Projector = function() {
  52264. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52265. this.projectVector = function(e, t) {
  52266. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52267. e.project(t)
  52268. }
  52269. ,
  52270. this.unprojectVector = function(e, t) {
  52271. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52272. e.unproject(t)
  52273. }
  52274. ,
  52275. this.pickingRay = function(e, t) {
  52276. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52277. }
  52278. }
  52279. ,
  52280. Ci.CanvasRenderer = function() {
  52281. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52282. this.domElement = document.createElement("canvas"),
  52283. this.clear = function() {}
  52284. ,
  52285. this.render = function() {}
  52286. ,
  52287. this.setClearColor = function() {}
  52288. ,
  52289. this.setSize = function() {}
  52290. }
  52291. ,
  52292. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  52293. Ci.CurveUtils = {
  52294. tangentQuadraticBezier: function(e, t, i, n) {
  52295. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52296. },
  52297. tangentCubicBezier: function(e, t, i, n, r) {
  52298. 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
  52299. },
  52300. tangentSpline: function(e, t, i, n, r) {
  52301. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  52302. },
  52303. interpolate: function(e, t, i, n, r) {
  52304. var o = .5 * (i - e)
  52305. , a = .5 * (n - t)
  52306. , s = r * r;
  52307. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52308. }
  52309. },
  52310. Ci.SceneUtils = {
  52311. createMultiMaterialObject: function(e, t) {
  52312. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  52313. i.add(new Ci.Mesh(e,t[n]));
  52314. return i
  52315. },
  52316. detach: function(e, t, i) {
  52317. e.applyMatrix(t.matrixWorld),
  52318. t.remove(e),
  52319. i.add(e)
  52320. },
  52321. attach: function(e, t, i) {
  52322. var n = new Ci.Matrix4;
  52323. n.getInverse(i.matrixWorld),
  52324. e.applyMatrix(n),
  52325. t.remove(e),
  52326. i.add(e)
  52327. }
  52328. },
  52329. Ci.ShapeUtils = {
  52330. area: function(e) {
  52331. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52332. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52333. return .5 * i
  52334. },
  52335. triangulate: function(e, t) {
  52336. var i = e.length;
  52337. if (i < 3)
  52338. return null;
  52339. var n, r, o, a = [], s = [], l = [];
  52340. if (0 < Ci.ShapeUtils.area(e))
  52341. for (r = 0; r < i; r++)
  52342. s[r] = r;
  52343. else
  52344. for (r = 0; r < i; r++)
  52345. s[r] = i - 1 - r;
  52346. var c = i
  52347. , h = 2 * c;
  52348. for (r = c - 1; 2 < c; ) {
  52349. if (h-- <= 0)
  52350. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52351. t ? l : a;
  52352. if (c <= (n = r) && (n = 0),
  52353. c <= (r = n + 1) && (r = 0),
  52354. c <= (o = r + 1) && (o = 0),
  52355. Si(e, n, r, o, c, s)) {
  52356. var u, d, p, f, g;
  52357. for (u = s[n],
  52358. d = s[r],
  52359. p = s[o],
  52360. a.push([e[u], e[d], e[p]]),
  52361. l.push([s[n], s[r], s[o]]),
  52362. g = (f = r) + 1; g < c; f++,
  52363. g++)
  52364. s[f] = s[g];
  52365. h = 2 * --c
  52366. }
  52367. }
  52368. return t ? l : a
  52369. },
  52370. triangulateShape: function(e, t) {
  52371. function w(e, t, i) {
  52372. 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
  52373. }
  52374. function b(e, t, i, n, r) {
  52375. var o = t.x - e.x
  52376. , a = t.y - e.y
  52377. , s = n.x - i.x
  52378. , l = n.y - i.y
  52379. , c = e.x - i.x
  52380. , h = e.y - i.y
  52381. , u = a * s - o * l
  52382. , d = a * c - o * h;
  52383. if (Math.abs(u) > Number.EPSILON) {
  52384. var p;
  52385. if (0 < u) {
  52386. if (d < 0 || u < d)
  52387. return [];
  52388. if ((p = l * c - s * h) < 0 || u < p)
  52389. return []
  52390. } else {
  52391. if (0 < d || d < u)
  52392. return [];
  52393. if (0 < (p = l * c - s * h) || p < u)
  52394. return []
  52395. }
  52396. if (0 === p)
  52397. return !r || 0 != d && d != u ? [e] : [];
  52398. if (p === u)
  52399. return !r || 0 != d && d != u ? [t] : [];
  52400. if (0 == d)
  52401. return [i];
  52402. if (d == u)
  52403. return [n];
  52404. var f = p / u;
  52405. return [{
  52406. x: e.x + f * o,
  52407. y: e.y + f * a
  52408. }]
  52409. }
  52410. if (0 != d || l * c != s * h)
  52411. return [];
  52412. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  52413. 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,
  52414. (m = t).x) : (v = (g = t).x,
  52415. (m = e).x),
  52416. i.x < n.x ? (I = (A = i).x,
  52417. (C = n).x) : (I = (A = n).x,
  52418. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  52419. (m = t).y) : (v = (g = t).y,
  52420. (m = e).y),
  52421. i.y < n.y ? (I = (A = i).y,
  52422. (C = n).y) : (I = (A = n).y,
  52423. (C = i).y)),
  52424. 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])
  52425. }
  52426. function T(e, t, i, n) {
  52427. var r = t.x - e.x
  52428. , o = t.y - e.y
  52429. , a = i.x - e.x
  52430. , s = i.y - e.y
  52431. , l = n.x - e.x
  52432. , c = n.y - e.y
  52433. , h = r * s - o * a
  52434. , u = r * c - o * l;
  52435. if (Math.abs(h) > Number.EPSILON) {
  52436. var d = l * s - c * a;
  52437. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  52438. }
  52439. return 0 < u
  52440. }
  52441. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  52442. Array.prototype.push.apply(c, t[h]);
  52443. for (i = 0,
  52444. n = c.length; i < n; i++)
  52445. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  52446. l[a] = i;
  52447. var d = function(e, a) {
  52448. function t(e, t) {
  52449. var i = m.length - 1
  52450. , n = e - 1;
  52451. n < 0 && (n = i);
  52452. var r = e + 1;
  52453. i < r && (r = 0);
  52454. var o = T(m[e], m[n], m[r], c[t]);
  52455. if (!o)
  52456. return !1;
  52457. var a = c.length - 1
  52458. , s = t - 1;
  52459. s < 0 && (s = a);
  52460. var l = t + 1;
  52461. return a < l && (l = 0),
  52462. !!(o = T(c[t], c[s], c[l], m[e]))
  52463. }
  52464. function i(e, t) {
  52465. var i, n;
  52466. for (i = 0; i < m.length; i++)
  52467. if (n = i + 1,
  52468. n %= m.length,
  52469. 0 < b(e, t, m[i], m[n], !0).length)
  52470. return !0;
  52471. return !1
  52472. }
  52473. function n(e, t) {
  52474. var i, n, r, o;
  52475. for (i = 0; i < v.length; i++)
  52476. for (n = a[v[i]],
  52477. r = 0; r < n.length; r++)
  52478. if (o = r + 1,
  52479. o %= n.length,
  52480. 0 < b(e, t, n[r], n[o], !0).length)
  52481. return !0;
  52482. return !1
  52483. }
  52484. 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++)
  52485. v.push(A);
  52486. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52487. if (--E < 0) {
  52488. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52489. break
  52490. }
  52491. for (o = I; o < m.length; o++) {
  52492. s = m[o],
  52493. r = -1;
  52494. for (A = 0; A < v.length; A++)
  52495. if (h = v[A],
  52496. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52497. c = a[h];
  52498. for (var _ = 0; _ < c.length; _++)
  52499. if (l = c[_],
  52500. t(o, _) && !i(s, l) && !n(s, l)) {
  52501. r = _,
  52502. v.splice(A, 1),
  52503. d = m.slice(0, o + 1),
  52504. p = m.slice(o),
  52505. f = c.slice(r),
  52506. g = c.slice(0, r + 1),
  52507. m = d.concat(f).concat(g).concat(p),
  52508. I = o;
  52509. break
  52510. }
  52511. if (0 <= r)
  52512. break;
  52513. y[u] = !0
  52514. }
  52515. if (0 <= r)
  52516. break
  52517. }
  52518. }
  52519. return m
  52520. }(e, t)
  52521. , p = Ci.ShapeUtils.triangulate(d, !1);
  52522. for (i = 0,
  52523. n = p.length; i < n; i++)
  52524. for (o = p[i],
  52525. r = 0; r < 3; r++)
  52526. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52527. return p.concat()
  52528. },
  52529. isClockWise: function(e) {
  52530. return Ci.ShapeUtils.area(e) < 0
  52531. },
  52532. b2: function(e, t, i, n) {
  52533. return function(e, t) {
  52534. var i = 1 - e;
  52535. return i * i * t
  52536. }(e, t) + function(e, t) {
  52537. return 2 * (1 - e) * e * t
  52538. }(e, i) + function(e, t) {
  52539. return e * e * t
  52540. }(e, n)
  52541. },
  52542. b3: function(e, t, i, n, r) {
  52543. return function(e, t) {
  52544. var i = 1 - e;
  52545. return i * i * i * t
  52546. }(e, t) + function(e, t) {
  52547. var i = 1 - e;
  52548. return 3 * i * i * e * t
  52549. }(e, i) + function(e, t) {
  52550. return 3 * (1 - e) * e * e * t
  52551. }(e, n) + function(e, t) {
  52552. return e * e * e * t
  52553. }(e, r)
  52554. }
  52555. },
  52556. Ci.Curve = function() {}
  52557. ,
  52558. Ci.Curve.prototype = {
  52559. constructor: Ci.Curve,
  52560. getPoint: function(e) {
  52561. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52562. null
  52563. },
  52564. getPointAt: function(e) {
  52565. var t = this.getUtoTmapping(e);
  52566. return this.getPoint(t)
  52567. },
  52568. getPoints: function(e) {
  52569. e = e || 5;
  52570. var t, i = [];
  52571. for (t = 0; t <= e; t++)
  52572. i.push(this.getPoint(t / e));
  52573. return i
  52574. },
  52575. getSpacedPoints: function(e) {
  52576. e = e || 5;
  52577. var t, i = [];
  52578. for (t = 0; t <= e; t++)
  52579. i.push(this.getPointAt(t / e));
  52580. return i
  52581. },
  52582. getLength: function() {
  52583. var e = this.getLengths();
  52584. return e[e.length - 1]
  52585. },
  52586. getLengths: function(e) {
  52587. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52588. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52589. return this.cacheArcLengths;
  52590. this.needsUpdate = !1;
  52591. var t, i, n = [], r = this.getPoint(0), o = 0;
  52592. for (n.push(0),
  52593. i = 1; i <= e; i++)
  52594. o += (t = this.getPoint(i / e)).distanceTo(r),
  52595. n.push(o),
  52596. r = t;
  52597. return this.cacheArcLengths = n
  52598. },
  52599. updateArcLengths: function() {
  52600. this.needsUpdate = !0,
  52601. this.getLengths()
  52602. },
  52603. getUtoTmapping: function(e, t) {
  52604. var i, n = this.getLengths(), r = 0, o = n.length;
  52605. i = t || e * n[o - 1];
  52606. for (var a, s = 0, l = o - 1; s <= l; )
  52607. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52608. s = r + 1;
  52609. else {
  52610. if (!(0 < a)) {
  52611. l = r;
  52612. break
  52613. }
  52614. l = r - 1
  52615. }
  52616. if (n[r = l] === i)
  52617. return r / (o - 1);
  52618. var c = n[r];
  52619. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52620. },
  52621. getTangent: function(e) {
  52622. var t = e - 1e-4
  52623. , i = e + 1e-4;
  52624. t < 0 && (t = 0),
  52625. 1 < i && (i = 1);
  52626. var n = this.getPoint(t);
  52627. return this.getPoint(i).clone().sub(n).normalize()
  52628. },
  52629. getTangentAt: function(e) {
  52630. var t = this.getUtoTmapping(e);
  52631. return this.getTangent(t)
  52632. }
  52633. },
  52634. Ci.Curve.create = function(e, t) {
  52635. return e.prototype = Object.create(Ci.Curve.prototype),
  52636. (e.prototype.constructor = e).prototype.getPoint = t,
  52637. e
  52638. }
  52639. ,
  52640. Ci.CurvePath = function() {
  52641. this.curves = [],
  52642. this.autoClose = !1
  52643. }
  52644. ,
  52645. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52646. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52647. Ci.CurvePath.prototype.add = function(e) {
  52648. this.curves.push(e)
  52649. }
  52650. ,
  52651. Ci.CurvePath.prototype.closePath = function() {
  52652. var e = this.curves[0].getPoint(0)
  52653. , t = this.curves[this.curves.length - 1].getPoint(1);
  52654. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52655. }
  52656. ,
  52657. Ci.CurvePath.prototype.getPoint = function(e) {
  52658. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52659. if (i[n] >= t) {
  52660. var r = i[n] - t
  52661. , o = this.curves[n]
  52662. , a = 1 - r / o.getLength();
  52663. return o.getPointAt(a)
  52664. }
  52665. n++
  52666. }
  52667. return null
  52668. }
  52669. ,
  52670. Ci.CurvePath.prototype.getLength = function() {
  52671. var e = this.getCurveLengths();
  52672. return e[e.length - 1]
  52673. }
  52674. ,
  52675. Ci.CurvePath.prototype.getCurveLengths = function() {
  52676. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52677. return this.cacheLengths;
  52678. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52679. t += this.curves[i].getLength(),
  52680. e.push(t);
  52681. return this.cacheLengths = e
  52682. }
  52683. ,
  52684. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52685. var t = this.getPoints(e);
  52686. return this.createGeometry(t)
  52687. }
  52688. ,
  52689. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52690. var t = this.getSpacedPoints(e);
  52691. return this.createGeometry(t)
  52692. }
  52693. ,
  52694. Ci.CurvePath.prototype.createGeometry = function(e) {
  52695. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52696. var r = e[i];
  52697. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52698. }
  52699. return t
  52700. }
  52701. ,
  52702. Ci.Font = function(e) {
  52703. this.data = e
  52704. }
  52705. ,
  52706. Ci.Font.prototype = {
  52707. constructor: Ci.Font,
  52708. generateShapes: function(e, s, b) {
  52709. function l(e, t, i) {
  52710. var n = w.glyphs[e] || w.glyphs["?"];
  52711. if (n) {
  52712. 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;
  52713. if (n.o)
  52714. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52715. switch (A[C++]) {
  52716. case "m":
  52717. r = A[C++] * t + i,
  52718. o = A[C++] * t,
  52719. g.moveTo(r, o);
  52720. break;
  52721. case "l":
  52722. r = A[C++] * t + i,
  52723. o = A[C++] * t,
  52724. g.lineTo(r, o);
  52725. break;
  52726. case "q":
  52727. if (a = A[C++] * t + i,
  52728. s = A[C++] * t,
  52729. h = A[C++] * t + i,
  52730. u = A[C++] * t,
  52731. g.quadraticCurveTo(h, u, a, s),
  52732. f = m[m.length - 1]) {
  52733. l = f.x,
  52734. c = f.y;
  52735. for (var E = 1; E <= b; E++) {
  52736. v(_ = E / b, l, h, a),
  52737. v(_, c, u, s)
  52738. }
  52739. }
  52740. break;
  52741. case "b":
  52742. if (a = A[C++] * t + i,
  52743. s = A[C++] * t,
  52744. h = A[C++] * t + i,
  52745. u = A[C++] * t,
  52746. d = A[C++] * t + i,
  52747. p = A[C++] * t,
  52748. g.bezierCurveTo(h, u, d, p, a, s),
  52749. f = m[m.length - 1]) {
  52750. l = f.x,
  52751. c = f.y;
  52752. for (E = 1; E <= b; E++) {
  52753. var _;
  52754. y(_ = E / b, l, h, d, a),
  52755. y(_, c, u, p, s)
  52756. }
  52757. }
  52758. }
  52759. }
  52760. return {
  52761. offset: n.ha * t,
  52762. path: g
  52763. }
  52764. }
  52765. }
  52766. void 0 === s && (s = 100),
  52767. void 0 === b && (b = 4);
  52768. for (var w = this.data, t = function(e) {
  52769. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52770. var a = l(t[o], i, n);
  52771. n += a.offset,
  52772. r.push(a.path)
  52773. }
  52774. return r
  52775. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52776. Array.prototype.push.apply(i, t[n].toShapes());
  52777. return i
  52778. }
  52779. },
  52780. Ci.Path = function(e) {
  52781. Ci.CurvePath.call(this),
  52782. this.actions = [],
  52783. e && this.fromPoints(e)
  52784. }
  52785. ,
  52786. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52787. Ci.Path.prototype.constructor = Ci.Path,
  52788. Ci.Path.prototype.fromPoints = function(e) {
  52789. this.moveTo(e[0].x, e[0].y);
  52790. for (var t = 1, i = e.length; t < i; t++)
  52791. this.lineTo(e[t].x, e[t].y)
  52792. }
  52793. ,
  52794. Ci.Path.prototype.moveTo = function(e, t) {
  52795. this.actions.push({
  52796. action: "moveTo",
  52797. args: [e, t]
  52798. })
  52799. }
  52800. ,
  52801. Ci.Path.prototype.lineTo = function(e, t) {
  52802. var i = this.actions[this.actions.length - 1].args
  52803. , n = i[i.length - 2]
  52804. , r = i[i.length - 1]
  52805. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52806. this.curves.push(o),
  52807. this.actions.push({
  52808. action: "lineTo",
  52809. args: [e, t]
  52810. })
  52811. }
  52812. ,
  52813. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52814. var r = this.actions[this.actions.length - 1].args
  52815. , o = r[r.length - 2]
  52816. , a = r[r.length - 1]
  52817. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52818. this.curves.push(s),
  52819. this.actions.push({
  52820. action: "quadraticCurveTo",
  52821. args: [e, t, i, n]
  52822. })
  52823. }
  52824. ,
  52825. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52826. var a = this.actions[this.actions.length - 1].args
  52827. , s = a[a.length - 2]
  52828. , l = a[a.length - 1]
  52829. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52830. this.curves.push(c),
  52831. this.actions.push({
  52832. action: "bezierCurveTo",
  52833. args: [e, t, i, n, r, o]
  52834. })
  52835. }
  52836. ,
  52837. Ci.Path.prototype.splineThru = function(e) {
  52838. var t = Array.prototype.slice.call(arguments)
  52839. , i = this.actions[this.actions.length - 1].args
  52840. , n = i[i.length - 2]
  52841. , r = i[i.length - 1]
  52842. , o = [new Ci.Vector2(n,r)];
  52843. Array.prototype.push.apply(o, e);
  52844. var a = new Ci.SplineCurve(o);
  52845. this.curves.push(a),
  52846. this.actions.push({
  52847. action: "splineThru",
  52848. args: t
  52849. })
  52850. }
  52851. ,
  52852. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52853. var a = this.actions[this.actions.length - 1].args
  52854. , s = a[a.length - 2]
  52855. , l = a[a.length - 1];
  52856. this.absarc(e + s, t + l, i, n, r, o)
  52857. }
  52858. ,
  52859. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52860. this.absellipse(e, t, i, i, n, r, o)
  52861. }
  52862. ,
  52863. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52864. var l = this.actions[this.actions.length - 1].args
  52865. , c = l[l.length - 2]
  52866. , h = l[l.length - 1];
  52867. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52868. }
  52869. ,
  52870. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52871. var l = [e, t, i, n, r, o, a, s || 0]
  52872. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52873. this.curves.push(c);
  52874. var h = c.getPoint(1);
  52875. l.push(h.x),
  52876. l.push(h.y),
  52877. this.actions.push({
  52878. action: "ellipse",
  52879. args: l
  52880. })
  52881. }
  52882. ,
  52883. Ci.Path.prototype.getSpacedPoints = function(e) {
  52884. e = e || 40;
  52885. for (var t = [], i = 0; i < e; i++)
  52886. t.push(this.getPoint(i / e));
  52887. return this.autoClose && t.push(t[0]),
  52888. t
  52889. }
  52890. ,
  52891. Ci.Path.prototype.getPoints = function(e) {
  52892. e = e || 12;
  52893. 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++) {
  52894. var v = this.actions[g]
  52895. , y = v.action
  52896. , A = v.args;
  52897. switch (y) {
  52898. case "moveTo":
  52899. case "lineTo":
  52900. f.push(new Ci.Vector2(A[0],A[1]));
  52901. break;
  52902. case "quadraticCurveTo":
  52903. t = A[2],
  52904. i = A[3],
  52905. o = A[0],
  52906. a = A[1],
  52907. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52908. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52909. c[c.length - 1]);
  52910. for (var C = 1; C <= e; C++) {
  52911. h = d(O = C / e, s, o, t),
  52912. u = d(O, l, a, i),
  52913. f.push(new Ci.Vector2(h,u))
  52914. }
  52915. break;
  52916. case "bezierCurveTo":
  52917. t = A[4],
  52918. i = A[5],
  52919. o = A[0],
  52920. a = A[1],
  52921. n = A[2],
  52922. r = A[3],
  52923. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52924. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52925. c[c.length - 1]);
  52926. for (C = 1; C <= e; C++) {
  52927. h = p(O = C / e, s, o, n, t),
  52928. u = p(O, l, a, r, i),
  52929. f.push(new Ci.Vector2(h,u))
  52930. }
  52931. break;
  52932. case "splineThru":
  52933. c = this.actions[g - 1].args;
  52934. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52935. , E = e * A[0].length;
  52936. I = I.concat(A[0]);
  52937. var _ = new Ci.SplineCurve(I);
  52938. for (C = 1; C <= E; C++)
  52939. f.push(_.getPointAt(C / E));
  52940. break;
  52941. case "arc":
  52942. var b = A[0]
  52943. , w = A[1]
  52944. , T = A[2]
  52945. , x = A[3]
  52946. , S = A[4]
  52947. , M = !!A[5]
  52948. , R = S - x
  52949. , P = 2 * e;
  52950. for (C = 1; C <= P; C++) {
  52951. var O = C / P;
  52952. M || (O = 1 - O),
  52953. L = x + O * R,
  52954. h = b + T * Math.cos(L),
  52955. u = w + T * Math.sin(L),
  52956. f.push(new Ci.Vector2(h,u))
  52957. }
  52958. break;
  52959. case "ellipse":
  52960. b = A[0],
  52961. w = A[1];
  52962. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52963. S = A[5],
  52964. M = !!A[6],
  52965. A[7]);
  52966. R = S - x,
  52967. P = 2 * e;
  52968. 0 !== V && (D = Math.cos(V),
  52969. N = Math.sin(V));
  52970. for (C = 1; C <= P; C++) {
  52971. O = C / P;
  52972. if (M || (O = 1 - O),
  52973. L = x + O * R,
  52974. h = b + F * Math.cos(L),
  52975. u = w + B * Math.sin(L),
  52976. 0 !== V) {
  52977. var k = h;
  52978. h = (k - b) * D - (u - w) * N + b,
  52979. u = (k - b) * N + (u - w) * D + w
  52980. }
  52981. f.push(new Ci.Vector2(h,u))
  52982. }
  52983. }
  52984. }
  52985. var U = f[f.length - 1];
  52986. 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),
  52987. this.autoClose && f.push(f[0]),
  52988. f
  52989. }
  52990. ,
  52991. Ci.Path.prototype.toShapes = function(e, t) {
  52992. function i(e) {
  52993. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52994. var r = e[i]
  52995. , o = new Ci.Shape;
  52996. o.actions = r.actions,
  52997. o.curves = r.curves,
  52998. t.push(o)
  52999. }
  53000. return t
  53001. }
  53002. function n(e, t) {
  53003. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53004. var a = t[r]
  53005. , s = t[o]
  53006. , l = s.x - a.x
  53007. , c = s.y - a.y;
  53008. if (Math.abs(c) > Number.EPSILON) {
  53009. if (c < 0 && (a = t[o],
  53010. l = -l,
  53011. s = t[r],
  53012. c = -c),
  53013. e.y < a.y || e.y > s.y)
  53014. continue;
  53015. if (e.y === a.y) {
  53016. if (e.x === a.x)
  53017. return !0
  53018. } else {
  53019. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53020. if (0 == h)
  53021. return !0;
  53022. if (h < 0)
  53023. continue;
  53024. n = !n
  53025. }
  53026. } else {
  53027. if (e.y !== a.y)
  53028. continue;
  53029. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53030. return !0
  53031. }
  53032. }
  53033. return n
  53034. }
  53035. var r = Ci.ShapeUtils.isClockWise
  53036. , o = function(e) {
  53037. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  53038. var o = e[n]
  53039. , a = o.args
  53040. , s = o.action;
  53041. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  53042. i = new Ci.Path),
  53043. i[s].apply(i, a)
  53044. }
  53045. return 0 !== i.actions.length && t.push(i),
  53046. t
  53047. }(this.actions);
  53048. if (0 === o.length)
  53049. return [];
  53050. if (!0 === t)
  53051. return i(o);
  53052. var a, s, l, c = [];
  53053. if (1 === o.length)
  53054. return s = o[0],
  53055. (l = new Ci.Shape).actions = s.actions,
  53056. l.curves = s.curves,
  53057. c.push(l),
  53058. c;
  53059. var h = !r(o[0].getPoints());
  53060. h = e ? !h : h;
  53061. var u, d = [], p = [], f = [], g = 0;
  53062. p[g] = void 0,
  53063. f[g] = [];
  53064. for (var m = 0, v = o.length; m < v; m++)
  53065. a = r(u = (s = o[m]).getPoints()),
  53066. (a = e ? !a : a) ? (!h && p[g] && g++,
  53067. p[g] = {
  53068. s: new Ci.Shape,
  53069. p: u
  53070. },
  53071. p[g].s.actions = s.actions,
  53072. p[g].s.curves = s.curves,
  53073. h && g++,
  53074. f[g] = []) : f[g].push({
  53075. h: s,
  53076. p: u[0]
  53077. });
  53078. if (!p[0])
  53079. return i(o);
  53080. if (1 < p.length) {
  53081. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  53082. d[C] = [];
  53083. for (C = 0,
  53084. I = p.length; C < I; C++)
  53085. for (var E = f[C], _ = 0; _ < E.length; _++) {
  53086. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  53087. n(b.p, p[T].p) && (C !== T && A.push({
  53088. froms: C,
  53089. tos: T,
  53090. hole: _
  53091. }),
  53092. w ? (w = !1,
  53093. d[T].push(b)) : y = !0);
  53094. w && d[C].push(b)
  53095. }
  53096. 0 < A.length && (y || (f = d))
  53097. }
  53098. m = 0;
  53099. for (var x, S = p.length; m < S; m++) {
  53100. l = p[m].s,
  53101. c.push(l);
  53102. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  53103. l.holes.push(x[M].h)
  53104. }
  53105. return c
  53106. }
  53107. ,
  53108. Ci.Shape = function() {
  53109. Ci.Path.apply(this, arguments),
  53110. this.holes = []
  53111. }
  53112. ,
  53113. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  53114. Ci.Shape.prototype.constructor = Ci.Shape,
  53115. Ci.Shape.prototype.extrude = function(e) {
  53116. return new Ci.ExtrudeGeometry(this,e)
  53117. }
  53118. ,
  53119. Ci.Shape.prototype.makeGeometry = function(e) {
  53120. return new Ci.ShapeGeometry(this,e)
  53121. }
  53122. ,
  53123. Ci.Shape.prototype.getPointsHoles = function(e) {
  53124. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53125. t[i] = this.holes[i].getPoints(e);
  53126. return t
  53127. }
  53128. ,
  53129. Ci.Shape.prototype.extractAllPoints = function(e) {
  53130. return {
  53131. shape: this.getPoints(e),
  53132. holes: this.getPointsHoles(e)
  53133. }
  53134. }
  53135. ,
  53136. Ci.Shape.prototype.extractPoints = function(e) {
  53137. return this.extractAllPoints(e)
  53138. }
  53139. ,
  53140. Ci.LineCurve = function(e, t) {
  53141. this.v1 = e,
  53142. this.v2 = t
  53143. }
  53144. ,
  53145. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  53146. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  53147. Ci.LineCurve.prototype.getPoint = function(e) {
  53148. var t = this.v2.clone().sub(this.v1);
  53149. return t.multiplyScalar(e).add(this.v1),
  53150. t
  53151. }
  53152. ,
  53153. Ci.LineCurve.prototype.getPointAt = function(e) {
  53154. return this.getPoint(e)
  53155. }
  53156. ,
  53157. Ci.LineCurve.prototype.getTangent = function(e) {
  53158. return this.v2.clone().sub(this.v1).normalize()
  53159. }
  53160. ,
  53161. Ci.QuadraticBezierCurve = function(e, t, i) {
  53162. this.v0 = e,
  53163. this.v1 = t,
  53164. this.v2 = i
  53165. }
  53166. ,
  53167. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53168. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  53169. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53170. var t = Ci.ShapeUtils.b2;
  53171. 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))
  53172. }
  53173. ,
  53174. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53175. var t = Ci.CurveUtils.tangentQuadraticBezier;
  53176. 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()
  53177. }
  53178. ,
  53179. Ci.CubicBezierCurve = function(e, t, i, n) {
  53180. this.v0 = e,
  53181. this.v1 = t,
  53182. this.v2 = i,
  53183. this.v3 = n
  53184. }
  53185. ,
  53186. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  53187. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  53188. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  53189. var t = Ci.ShapeUtils.b3;
  53190. 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))
  53191. }
  53192. ,
  53193. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  53194. var t = Ci.CurveUtils.tangentCubicBezier;
  53195. 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()
  53196. }
  53197. ,
  53198. Ci.SplineCurve = function(e) {
  53199. this.points = null == e ? [] : e
  53200. }
  53201. ,
  53202. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  53203. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  53204. Ci.SplineCurve.prototype.getPoint = function(e) {
  53205. var t = this.points
  53206. , i = (t.length - 1) * e
  53207. , n = Math.floor(i)
  53208. , r = i - n
  53209. , o = t[0 === n ? n : n - 1]
  53210. , a = t[n]
  53211. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53212. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53213. , c = Ci.CurveUtils.interpolate;
  53214. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  53215. }
  53216. ,
  53217. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53218. this.aX = e,
  53219. this.aY = t,
  53220. this.xRadius = i,
  53221. this.yRadius = n,
  53222. this.aStartAngle = r,
  53223. this.aEndAngle = o,
  53224. this.aClockwise = a,
  53225. this.aRotation = s || 0
  53226. }
  53227. ,
  53228. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  53229. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  53230. Ci.EllipseCurve.prototype.getPoint = function(e) {
  53231. var t, i = this.aEndAngle - this.aStartAngle;
  53232. i < 0 && (i += 2 * Math.PI),
  53233. i > 2 * Math.PI && (i -= 2 * Math.PI),
  53234. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  53235. var n = this.aX + this.xRadius * Math.cos(t)
  53236. , r = this.aY + this.yRadius * Math.sin(t);
  53237. if (0 !== this.aRotation) {
  53238. var o = Math.cos(this.aRotation)
  53239. , a = Math.sin(this.aRotation)
  53240. , s = n
  53241. , l = r;
  53242. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  53243. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  53244. }
  53245. return new Ci.Vector2(n,r)
  53246. }
  53247. ,
  53248. Ci.ArcCurve = function(e, t, i, n, r, o) {
  53249. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  53250. }
  53251. ,
  53252. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  53253. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  53254. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  53255. this.v1 = e,
  53256. this.v2 = t
  53257. }, function(e) {
  53258. var t = new Ci.Vector3;
  53259. return t.subVectors(this.v2, this.v1),
  53260. t.multiplyScalar(e),
  53261. t.add(this.v1),
  53262. t
  53263. }),
  53264. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  53265. this.v0 = e,
  53266. this.v1 = t,
  53267. this.v2 = i
  53268. }, function(e) {
  53269. var t = Ci.ShapeUtils.b2;
  53270. 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))
  53271. }),
  53272. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  53273. this.v0 = e,
  53274. this.v1 = t,
  53275. this.v2 = i,
  53276. this.v3 = n
  53277. }, function(e) {
  53278. var t = Ci.ShapeUtils.b3;
  53279. 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))
  53280. }),
  53281. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  53282. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53283. this.points = null == e ? [] : e
  53284. }, function(e) {
  53285. var t = this.points
  53286. , i = (t.length - 1) * e
  53287. , n = Math.floor(i)
  53288. , r = i - n
  53289. , o = t[0 == n ? n : n - 1]
  53290. , a = t[n]
  53291. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  53292. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  53293. , c = Ci.CurveUtils.interpolate;
  53294. 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))
  53295. }),
  53296. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  53297. Xt = new xi,
  53298. Zt = new xi,
  53299. Kt = new xi,
  53300. xi.prototype.init = function(e, t, i, n) {
  53301. this.c0 = e,
  53302. this.c1 = i,
  53303. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53304. this.c3 = 2 * e - 2 * t + i + n
  53305. }
  53306. ,
  53307. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53308. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53309. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53310. s *= o,
  53311. l *= o,
  53312. this.init(t, i, s, l)
  53313. }
  53314. ,
  53315. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  53316. this.init(t, i, r * (i - e), r * (n - t))
  53317. }
  53318. ,
  53319. xi.prototype.calc = function(e) {
  53320. var t = e * e
  53321. , i = t * e;
  53322. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53323. }
  53324. ,
  53325. Ci.Curve.create(function(e) {
  53326. this.points = e || [],
  53327. this.closed = !1
  53328. }, function(e) {
  53329. var t, i, n, r, o, a, s, l, c = this.points;
  53330. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  53331. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  53332. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  53333. n = 1),
  53334. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  53335. qt),
  53336. a = c[i % r],
  53337. s = c[(i + 1) % r],
  53338. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  53339. qt),
  53340. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53341. var h = "chordal" === this.type ? .5 : .25
  53342. , u = Math.pow(o.distanceToSquared(a), h)
  53343. , d = Math.pow(a.distanceToSquared(s), h)
  53344. , p = Math.pow(s.distanceToSquared(l), h);
  53345. d < 1e-4 && (d = 1),
  53346. u < 1e-4 && (u = d),
  53347. p < 1e-4 && (p = d),
  53348. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  53349. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  53350. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  53351. } else if ("catmullrom" === this.type) {
  53352. var f = void 0 !== this.tension ? this.tension : .5;
  53353. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  53354. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  53355. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  53356. }
  53357. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  53358. })),
  53359. Ci.ClosedSplineCurve3 = function(e) {
  53360. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53361. Ci.CatmullRomCurve3.call(this, e),
  53362. this.type = "catmullrom",
  53363. this.closed = !0
  53364. }
  53365. ,
  53366. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  53367. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  53368. Ci.Geometry.call(this),
  53369. this.type = "BoxGeometry",
  53370. this.parameters = {
  53371. width: e,
  53372. height: t,
  53373. depth: i,
  53374. widthSegments: n,
  53375. heightSegments: r,
  53376. depthSegments: o
  53377. },
  53378. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  53379. this.mergeVertices()
  53380. }
  53381. ,
  53382. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53383. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  53384. Ci.CubeGeometry = Ci.BoxGeometry,
  53385. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  53386. function a(e, t, i, n, r, o, a, s, l, c, h) {
  53387. 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++)
  53388. for (var E = I * d - f, _ = 0; _ < m; _++) {
  53389. var b = _ * u - p;
  53390. C[e] = b * n,
  53391. C[t] = E * r,
  53392. C[i] = g,
  53393. P[D] = C.x,
  53394. P[D + 1] = C.y,
  53395. P[D + 2] = C.z,
  53396. C[e] = 0,
  53397. C[t] = 0,
  53398. C[i] = 0 < s ? 1 : -1,
  53399. O[D] = C.x,
  53400. O[D + 1] = C.y,
  53401. O[D + 2] = C.z,
  53402. L[N] = _ / l,
  53403. L[N + 1] = 1 - I / c,
  53404. D += 3,
  53405. N += 2,
  53406. y += 1
  53407. }
  53408. for (I = 0; I < c; I++)
  53409. for (_ = 0; _ < l; _++) {
  53410. var w = B + _ + m * I
  53411. , T = B + _ + m * (I + 1)
  53412. , x = B + (_ + 1) + m * (I + 1)
  53413. , S = B + (_ + 1) + m * I;
  53414. R[F] = w,
  53415. R[F + 1] = T,
  53416. R[F + 2] = S,
  53417. R[F + 3] = T,
  53418. R[F + 4] = x,
  53419. R[F + 5] = S,
  53420. F += 6,
  53421. A += 6
  53422. }
  53423. M.addGroup(V, A, h),
  53424. V += A,
  53425. B += y
  53426. }
  53427. Ci.BufferGeometry.call(this),
  53428. this.type = "BoxBufferGeometry",
  53429. this.parameters = {
  53430. width: e,
  53431. height: t,
  53432. depth: i,
  53433. widthSegments: n,
  53434. heightSegments: r,
  53435. depthSegments: o
  53436. };
  53437. var M = this;
  53438. n = Math.floor(n) || 1,
  53439. r = Math.floor(r) || 1,
  53440. o = Math.floor(o) || 1;
  53441. var s, l, c, h, u = (h = 0,
  53442. h += (s = n) * (l = r) * 2,
  53443. h += s * (c = o) * 2,
  53444. 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;
  53445. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  53446. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  53447. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  53448. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  53449. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  53450. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  53451. this.setIndex(new Ci.BufferAttribute(R,1)),
  53452. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  53453. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  53454. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  53455. }
  53456. ,
  53457. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53458. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  53459. Ci.CircleGeometry = function(e, t, i, n) {
  53460. Ci.Geometry.call(this),
  53461. this.type = "CircleGeometry",
  53462. this.parameters = {
  53463. radius: e,
  53464. segments: t,
  53465. thetaStart: i,
  53466. thetaLength: n
  53467. },
  53468. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  53469. }
  53470. ,
  53471. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53472. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  53473. Ci.CircleBufferGeometry = function(e, t, i, n) {
  53474. Ci.BufferGeometry.call(this),
  53475. this.type = "CircleBufferGeometry",
  53476. this.parameters = {
  53477. radius: e,
  53478. segments: t,
  53479. thetaStart: i,
  53480. thetaLength: n
  53481. },
  53482. e = e || 50,
  53483. t = void 0 !== t ? Math.max(3, t) : 8,
  53484. i = void 0 !== i ? i : 0,
  53485. n = void 0 !== n ? n : 2 * Math.PI;
  53486. var r = t + 2
  53487. , o = new Float32Array(3 * r)
  53488. , a = new Float32Array(3 * r)
  53489. , s = new Float32Array(2 * r);
  53490. a[2] = 1,
  53491. s[0] = .5,
  53492. s[1] = .5;
  53493. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53494. c += 3,
  53495. h += 2) {
  53496. var u = i + l / t * n;
  53497. o[c] = e * Math.cos(u),
  53498. o[c + 1] = e * Math.sin(u),
  53499. a[c + 2] = 1,
  53500. s[h] = (o[c] / e + 1) / 2,
  53501. s[h + 1] = (o[c + 1] / e + 1) / 2
  53502. }
  53503. var d = [];
  53504. for (c = 1; c <= t; c++)
  53505. d.push(c, c + 1, 0);
  53506. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53507. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53508. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53509. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53510. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53511. }
  53512. ,
  53513. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53514. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53515. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53516. function t(e) {
  53517. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53518. for (i = b,
  53519. t = 1; t <= m; t++)
  53520. I.setXYZ(b, 0, x * s, 0),
  53521. E.setXYZ(b, 0, s, 0),
  53522. !0 === e ? (r.x = t / m,
  53523. r.y = 0) : (r.x = (t - 1) / m,
  53524. r.y = 1),
  53525. _.setXY(b, r.x, r.y),
  53526. b++;
  53527. for (n = b,
  53528. t = 0; t <= m; t++) {
  53529. var l = t / m;
  53530. o.x = a * Math.sin(l * A + y),
  53531. o.y = x * s,
  53532. o.z = a * Math.cos(l * A + y),
  53533. I.setXYZ(b, o.x, o.y, o.z),
  53534. E.setXYZ(b, 0, s, 0),
  53535. _.setXY(b, l, !0 === e ? 1 : 0),
  53536. b++
  53537. }
  53538. for (t = 0; t < m; t++) {
  53539. var c = i + t
  53540. , h = n + t;
  53541. !0 === e ? (C.setX(w, h),
  53542. w++,
  53543. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53544. w++,
  53545. C.setX(w, h)),
  53546. w++,
  53547. C.setX(w, c),
  53548. w++
  53549. }
  53550. }
  53551. Ci.BufferGeometry.call(this),
  53552. this.type = "CylinderBufferGeometry",
  53553. this.parameters = {
  53554. radiusTop: p,
  53555. radiusBottom: f,
  53556. height: g,
  53557. radialSegments: m,
  53558. heightSegments: v,
  53559. openEnded: e,
  53560. thetaStart: y,
  53561. thetaLength: A
  53562. },
  53563. p = void 0 !== p ? p : 20,
  53564. f = void 0 !== f ? f : 20,
  53565. g = void 0 !== g ? g : 100,
  53566. m = Math.floor(m) || 8,
  53567. v = Math.floor(v) || 1,
  53568. e = void 0 !== e && e,
  53569. y = void 0 !== y ? y : 0,
  53570. A = void 0 !== A ? A : 2 * Math.PI;
  53571. var i, n, r = (n = (m + 1) * (v + 1),
  53572. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53573. n), o = (i = m * v * 2 * 3,
  53574. !1 === e && (i += 2 * m * 3),
  53575. 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;
  53576. (function() {
  53577. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53578. for (t = 0; t <= v; t++) {
  53579. var o = []
  53580. , a = t / v
  53581. , s = a * (f - p) + p;
  53582. for (e = 0; e <= m; e++) {
  53583. var l = e / m;
  53584. n.x = s * Math.sin(l * A + y),
  53585. n.y = -a * g + x,
  53586. n.z = s * Math.cos(l * A + y),
  53587. I.setXYZ(b, n.x, n.y, n.z),
  53588. i.copy(n),
  53589. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53590. i.z = Math.cos(l * A + y)),
  53591. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53592. E.setXYZ(b, i.x, i.y, i.z),
  53593. _.setXY(b, l, 1 - a),
  53594. o.push(b),
  53595. b++
  53596. }
  53597. T.push(o)
  53598. }
  53599. for (e = 0; e < m; e++)
  53600. for (t = 0; t < v; t++) {
  53601. var c = T[t][e]
  53602. , h = T[t + 1][e]
  53603. , u = T[t + 1][e + 1]
  53604. , d = T[t][e + 1];
  53605. C.setX(w, c),
  53606. w++,
  53607. C.setX(w, h),
  53608. w++,
  53609. C.setX(w, d),
  53610. w++,
  53611. C.setX(w, h),
  53612. w++,
  53613. C.setX(w, u),
  53614. w++,
  53615. C.setX(w, d),
  53616. w++
  53617. }
  53618. }
  53619. )(),
  53620. !1 === e && (0 < p && t(!0),
  53621. 0 < f && t(!1)),
  53622. this.setIndex(C),
  53623. this.addAttribute("position", I),
  53624. this.addAttribute("normal", E),
  53625. this.addAttribute("uv", _)
  53626. }
  53627. ,
  53628. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53629. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53630. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53631. Ci.Geometry.call(this),
  53632. this.type = "CylinderGeometry",
  53633. this.parameters = {
  53634. radiusTop: e,
  53635. radiusBottom: t,
  53636. height: i,
  53637. radialSegments: n,
  53638. heightSegments: r,
  53639. openEnded: o,
  53640. thetaStart: a,
  53641. thetaLength: s
  53642. },
  53643. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53644. this.mergeVertices()
  53645. }
  53646. ,
  53647. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53648. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53649. Ci.EdgesGeometry = function(e, t) {
  53650. function i(e, t) {
  53651. return e - t
  53652. }
  53653. Ci.BufferGeometry.call(this),
  53654. t = void 0 !== t ? t : 1;
  53655. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53656. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53657. n.mergeVertices(),
  53658. n.computeFaceNormals();
  53659. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53660. for (var d = c[h], p = 0; p < 3; p++) {
  53661. o[0] = d[s[p]],
  53662. o[1] = d[s[(p + 1) % 3]],
  53663. o.sort(i),
  53664. void 0 === a[g = o.toString()] ? a[g] = {
  53665. vert1: o[0],
  53666. vert2: o[1],
  53667. face1: h,
  53668. face2: void 0
  53669. } : a[g].face2 = h
  53670. }
  53671. var f = [];
  53672. for (var g in a) {
  53673. var m = a[g];
  53674. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53675. var v = l[m.vert1];
  53676. f.push(v.x),
  53677. f.push(v.y),
  53678. f.push(v.z),
  53679. v = l[m.vert2],
  53680. f.push(v.x),
  53681. f.push(v.y),
  53682. f.push(v.z)
  53683. }
  53684. }
  53685. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53686. }
  53687. ,
  53688. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53689. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53690. Ci.ExtrudeGeometry = function(e, t) {
  53691. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53692. this.type = "ExtrudeGeometry",
  53693. e = Array.isArray(e) ? e : [e],
  53694. this.addShapeList(e, t),
  53695. void this.computeFaceNormals())
  53696. }
  53697. ;
  53698. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53699. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53700. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53701. for (var i = e.length, n = 0; n < i; n++) {
  53702. var r = e[n];
  53703. this.addShape(r, t)
  53704. }
  53705. }
  53706. ,
  53707. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53708. function i(e, t, i) {
  53709. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53710. t.clone().multiplyScalar(i).add(e)
  53711. }
  53712. function n(e, t, i) {
  53713. 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;
  53714. if (Math.abs(u) > Number.EPSILON) {
  53715. var d = Math.sqrt(h)
  53716. , p = Math.sqrt(l * l + c * c)
  53717. , f = t.x - s / d
  53718. , g = t.y + a / d
  53719. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53720. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53721. if (v <= 2)
  53722. return new Ci.Vector2(n,r);
  53723. o = Math.sqrt(v / 2)
  53724. } else {
  53725. var y = !1;
  53726. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53727. o = y ? (n = -s,
  53728. r = a,
  53729. Math.sqrt(h)) : (n = a,
  53730. r = s,
  53731. Math.sqrt(h / 2))
  53732. }
  53733. return new Ci.Vector2(n / o,r / o)
  53734. }
  53735. function r(e, t) {
  53736. var i, n;
  53737. for (G = e.length; 0 <= --G; ) {
  53738. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53739. var r = 0
  53740. , o = A + 2 * m;
  53741. for (r = 0; r < o; r++) {
  53742. var a = U * r
  53743. , s = U * (r + 1);
  53744. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53745. }
  53746. }
  53747. }
  53748. function o(e, t, i) {
  53749. T.vertices.push(new Ci.Vector3(e,t,i))
  53750. }
  53751. function a(e, t, i) {
  53752. e += x,
  53753. t += x,
  53754. i += x,
  53755. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53756. var n = E.generateTopUV(T, e, t, i);
  53757. T.faceVertexUvs[0].push(n)
  53758. }
  53759. function l(e, t, i, n) {
  53760. e += x,
  53761. t += x,
  53762. i += x,
  53763. n += x,
  53764. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53765. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53766. var r = E.generateSideWallUV(T, e, t, i, n);
  53767. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53768. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53769. }
  53770. 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;
  53771. C && (s = C.getSpacedPoints(A),
  53772. v = !(I = !0),
  53773. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53774. h = new Ci.Vector3,
  53775. u = new Ci.Vector3,
  53776. d = new Ci.Vector3),
  53777. v || (g = f = m = 0);
  53778. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53779. if (P) {
  53780. for (M = M.reverse(),
  53781. b = 0,
  53782. w = R.length; b < w; b++)
  53783. _ = R[b],
  53784. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53785. P = !1
  53786. }
  53787. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53788. , L = M;
  53789. for (b = 0,
  53790. w = R.length; b < w; b++)
  53791. _ = R[b],
  53792. M = M.concat(_);
  53793. 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++,
  53794. j++,
  53795. Y++)
  53796. j === W && (j = 0),
  53797. Y === W && (Y = 0),
  53798. z[G] = n(L[G], L[j], L[Y]);
  53799. var q, X, Z = [], K = z.concat();
  53800. for (b = 0,
  53801. w = R.length; b < w; b++) {
  53802. for (_ = R[b],
  53803. q = [],
  53804. G = 0,
  53805. j = (W = _.length) - 1,
  53806. Y = G + 1; G < W; G++,
  53807. j++,
  53808. Y++)
  53809. j === W && (j = 0),
  53810. Y === W && (Y = 0),
  53811. q[G] = n(_[G], _[j], _[Y]);
  53812. Z.push(q),
  53813. K = K.concat(q)
  53814. }
  53815. for (D = 0; D < m; D++) {
  53816. for (B = f * (1 - (F = D / m)),
  53817. N = g * Math.sin(F * Math.PI / 2),
  53818. G = 0,
  53819. W = L.length; G < W; G++)
  53820. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53821. for (b = 0,
  53822. w = R.length; b < w; b++)
  53823. for (_ = R[b],
  53824. q = Z[b],
  53825. G = 0,
  53826. W = _.length; G < W; G++)
  53827. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53828. }
  53829. for (N = g,
  53830. G = 0; G < U; G++)
  53831. V = v ? i(M[G], K[G], N) : M[G],
  53832. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53833. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53834. d.copy(s[0]).add(u).add(h),
  53835. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53836. for (X = 1; X <= A; X++)
  53837. for (G = 0; G < U; G++)
  53838. V = v ? i(M[G], K[G], N) : M[G],
  53839. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53840. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53841. d.copy(s[X]).add(u).add(h),
  53842. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53843. for (D = m - 1; 0 <= D; D--) {
  53844. for (B = f * (1 - (F = D / m)),
  53845. N = g * Math.sin(F * Math.PI / 2),
  53846. G = 0,
  53847. W = L.length; G < W; G++)
  53848. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53849. for (b = 0,
  53850. w = R.length; b < w; b++)
  53851. for (_ = R[b],
  53852. q = Z[b],
  53853. G = 0,
  53854. W = _.length; G < W; G++)
  53855. V = i(_[G], q[G], N),
  53856. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53857. }
  53858. (function() {
  53859. if (v) {
  53860. var e = 0
  53861. , t = U * e;
  53862. for (G = 0; G < H; G++)
  53863. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53864. for (t = U * (e = A + 2 * m),
  53865. G = 0; G < H; G++)
  53866. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53867. } else {
  53868. for (G = 0; G < H; G++)
  53869. a((k = O[G])[2], k[1], k[0]);
  53870. for (G = 0; G < H; G++)
  53871. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53872. }
  53873. }
  53874. )(),
  53875. function() {
  53876. var e = 0;
  53877. for (r(L, e),
  53878. e += L.length,
  53879. b = 0,
  53880. w = R.length; b < w; b++)
  53881. r(_ = R[b], e),
  53882. e += _.length
  53883. }()
  53884. }
  53885. ,
  53886. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53887. generateTopUV: function(e, t, i, n) {
  53888. var r = e.vertices
  53889. , o = r[t]
  53890. , a = r[i]
  53891. , s = r[n];
  53892. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53893. },
  53894. generateSideWallUV: function(e, t, i, n, r) {
  53895. var o = e.vertices
  53896. , a = o[t]
  53897. , s = o[i]
  53898. , l = o[n]
  53899. , c = o[r];
  53900. 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)]
  53901. }
  53902. },
  53903. Ci.ShapeGeometry = function(e, t) {
  53904. Ci.Geometry.call(this),
  53905. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53906. this.addShapeList(e, t),
  53907. this.computeFaceNormals()
  53908. }
  53909. ,
  53910. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53911. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53912. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53913. for (var i = 0, n = e.length; i < n; i++)
  53914. this.addShape(e[i], t);
  53915. return this
  53916. }
  53917. ,
  53918. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53919. void 0 === t && (t = {});
  53920. 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);
  53921. if (d) {
  53922. for (h = h.reverse(),
  53923. i = 0,
  53924. n = u.length; i < n; i++)
  53925. r = u[i],
  53926. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53927. d = !1
  53928. }
  53929. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53930. for (i = 0,
  53931. n = u.length; i < n; i++)
  53932. r = u[i],
  53933. h = h.concat(r);
  53934. var f, g, m = h.length, v = p.length;
  53935. for (i = 0; i < m; i++)
  53936. f = h[i],
  53937. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53938. for (i = 0; i < v; i++) {
  53939. var y = (g = p[i])[0] + l
  53940. , A = g[1] + l
  53941. , C = g[2] + l;
  53942. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53943. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53944. }
  53945. }
  53946. ,
  53947. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53948. Ci.BufferGeometry.call(this),
  53949. this.type = "LatheBufferGeometry",
  53950. this.parameters = {
  53951. points: e,
  53952. segments: t,
  53953. phiStart: i,
  53954. phiLength: n
  53955. },
  53956. t = Math.floor(t) || 12,
  53957. i = i || 0,
  53958. n = n || 2 * Math.PI,
  53959. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53960. 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,
  53961. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53962. for (o = 0; o <= t; o++) {
  53963. var v = i + o * f * n
  53964. , y = Math.sin(v)
  53965. , A = Math.cos(v);
  53966. for (a = 0; a <= e.length - 1; a++)
  53967. g.x = e[a].x * y,
  53968. g.y = e[a].y,
  53969. g.z = e[a].x * A,
  53970. h.setXYZ(d, g.x, g.y, g.z),
  53971. m.x = o / t,
  53972. m.y = a / (e.length - 1),
  53973. u.setXY(d, m.x, m.y),
  53974. d++
  53975. }
  53976. for (o = 0; o < t; o++)
  53977. for (a = 0; a < e.length - 1; a++) {
  53978. var C = r = a + o * e.length
  53979. , I = r + e.length
  53980. , E = r + e.length + 1
  53981. , _ = r + 1;
  53982. c.setX(p, C),
  53983. p++,
  53984. c.setX(p, I),
  53985. p++,
  53986. c.setX(p, _),
  53987. p++,
  53988. c.setX(p, I),
  53989. p++,
  53990. c.setX(p, E),
  53991. p++,
  53992. c.setX(p, _),
  53993. p++
  53994. }
  53995. if (this.setIndex(c),
  53996. this.addAttribute("position", h),
  53997. this.addAttribute("uv", u),
  53998. this.computeVertexNormals(),
  53999. n === 2 * Math.PI) {
  54000. var b = this.attributes.normal.array
  54001. , w = new Ci.Vector3
  54002. , T = new Ci.Vector3
  54003. , x = new Ci.Vector3;
  54004. for (r = t * e.length * 3,
  54005. a = o = 0; o < e.length; o++,
  54006. a += 3)
  54007. w.x = b[a + 0],
  54008. w.y = b[a + 1],
  54009. w.z = b[a + 2],
  54010. T.x = b[r + a + 0],
  54011. T.y = b[r + a + 1],
  54012. T.z = b[r + a + 2],
  54013. x.addVectors(w, T).normalize(),
  54014. b[a + 0] = b[r + a + 0] = x.x,
  54015. b[a + 1] = b[r + a + 1] = x.y,
  54016. b[a + 2] = b[r + a + 2] = x.z
  54017. }
  54018. }
  54019. ,
  54020. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54021. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  54022. Ci.LatheGeometry = function(e, t, i, n) {
  54023. Ci.Geometry.call(this),
  54024. this.type = "LatheGeometry",
  54025. this.parameters = {
  54026. points: e,
  54027. segments: t,
  54028. phiStart: i,
  54029. phiLength: n
  54030. },
  54031. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  54032. this.mergeVertices()
  54033. }
  54034. ,
  54035. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54036. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  54037. Ci.PlaneGeometry = function(e, t, i, n) {
  54038. Ci.Geometry.call(this),
  54039. this.type = "PlaneGeometry",
  54040. this.parameters = {
  54041. width: e,
  54042. height: t,
  54043. widthSegments: i,
  54044. heightSegments: n
  54045. },
  54046. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  54047. }
  54048. ,
  54049. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54050. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  54051. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  54052. Ci.BufferGeometry.call(this),
  54053. this.type = "PlaneBufferGeometry",
  54054. this.parameters = {
  54055. width: e,
  54056. height: t,
  54057. widthSegments: i,
  54058. heightSegments: n
  54059. };
  54060. 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++)
  54061. for (var y = v * u - o, A = 0; A < l; A++) {
  54062. var C = A * h - r;
  54063. d[g] = C,
  54064. d[g + 1] = -y,
  54065. p[g + 2] = 1,
  54066. f[m] = A / a,
  54067. f[m + 1] = 1 - v / s,
  54068. g += 3,
  54069. m += 2
  54070. }
  54071. g = 0;
  54072. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  54073. for (v = 0; v < s; v++)
  54074. for (A = 0; A < a; A++) {
  54075. var E = A + l * v
  54076. , _ = A + l * (v + 1)
  54077. , b = A + 1 + l * (v + 1)
  54078. , w = A + 1 + l * v;
  54079. I[g] = E,
  54080. I[g + 1] = _,
  54081. I[g + 2] = w,
  54082. I[g + 3] = _,
  54083. I[g + 4] = b,
  54084. I[g + 5] = w,
  54085. g += 6
  54086. }
  54087. this.setIndex(new Ci.BufferAttribute(I,1)),
  54088. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  54089. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  54090. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  54091. }
  54092. ,
  54093. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54094. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  54095. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  54096. Ci.BufferGeometry.call(this),
  54097. this.type = "RingBufferGeometry",
  54098. this.parameters = {
  54099. innerRadius: e,
  54100. outerRadius: t,
  54101. thetaSegments: i,
  54102. phiSegments: n,
  54103. thetaStart: r,
  54104. thetaLength: o
  54105. },
  54106. e = e || 20,
  54107. t = t || 50,
  54108. r = void 0 !== r ? r : 0,
  54109. o = void 0 !== o ? o : 2 * Math.PI;
  54110. 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;
  54111. for (s = 0; s <= n; s++) {
  54112. for (l = 0; l <= i; l++)
  54113. a = r + l / i * o,
  54114. A.x = v * Math.cos(a),
  54115. A.y = v * Math.sin(a),
  54116. d.setXYZ(g, A.x, A.y, A.z),
  54117. p.setXYZ(g, 0, 0, 1),
  54118. C.x = (A.x / t + 1) / 2,
  54119. C.y = (A.y / t + 1) / 2,
  54120. f.setXY(g, C.x, C.y),
  54121. g++;
  54122. v += y
  54123. }
  54124. for (s = 0; s < n; s++) {
  54125. var I = s * (i + 1);
  54126. for (l = 0; l < i; l++) {
  54127. var E = a = l + I
  54128. , _ = a + i + 1
  54129. , b = a + i + 2
  54130. , w = a + 1;
  54131. u.setX(m, E),
  54132. m++,
  54133. u.setX(m, _),
  54134. m++,
  54135. u.setX(m, b),
  54136. m++,
  54137. u.setX(m, E),
  54138. m++,
  54139. u.setX(m, b),
  54140. m++,
  54141. u.setX(m, w),
  54142. m++
  54143. }
  54144. }
  54145. this.setIndex(u),
  54146. this.addAttribute("position", d),
  54147. this.addAttribute("normal", p),
  54148. this.addAttribute("uv", f)
  54149. }
  54150. ,
  54151. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54152. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  54153. Ci.RingGeometry = function(e, t, i, n, r, o) {
  54154. Ci.Geometry.call(this),
  54155. this.type = "RingGeometry",
  54156. this.parameters = {
  54157. innerRadius: e,
  54158. outerRadius: t,
  54159. thetaSegments: i,
  54160. phiSegments: n,
  54161. thetaStart: r,
  54162. thetaLength: o
  54163. },
  54164. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  54165. }
  54166. ,
  54167. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54168. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  54169. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  54170. Ci.Geometry.call(this),
  54171. this.type = "SphereGeometry",
  54172. this.parameters = {
  54173. radius: e,
  54174. widthSegments: t,
  54175. heightSegments: i,
  54176. phiStart: n,
  54177. phiLength: r,
  54178. thetaStart: o,
  54179. thetaLength: a
  54180. },
  54181. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  54182. }
  54183. ,
  54184. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54185. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  54186. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  54187. Ci.BufferGeometry.call(this),
  54188. this.type = "SphereBufferGeometry",
  54189. this.parameters = {
  54190. radius: e,
  54191. widthSegments: t,
  54192. heightSegments: i,
  54193. phiStart: n,
  54194. phiLength: r,
  54195. thetaStart: o,
  54196. thetaLength: a
  54197. },
  54198. e = e || 50,
  54199. t = Math.max(3, Math.floor(t) || 8),
  54200. i = Math.max(2, Math.floor(i) || 6),
  54201. n = void 0 !== n ? n : 0,
  54202. r = void 0 !== r ? r : 2 * Math.PI;
  54203. 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++) {
  54204. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  54205. var A = y / t
  54206. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  54207. , I = e * Math.cos(o + v * a)
  54208. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  54209. f.set(C, I, E).normalize(),
  54210. c.setXYZ(d, C, I, E),
  54211. h.setXYZ(d, f.x, f.y, f.z),
  54212. u.setXY(d, A, 1 - v),
  54213. m.push(d),
  54214. d++
  54215. }
  54216. p.push(m)
  54217. }
  54218. var _ = [];
  54219. for (g = 0; g < i; g++)
  54220. for (y = 0; y < t; y++) {
  54221. var b = p[g][y + 1]
  54222. , w = p[g][y]
  54223. , T = p[g + 1][y]
  54224. , x = p[g + 1][y + 1];
  54225. (0 !== g || 0 < o) && _.push(b, w, x),
  54226. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  54227. }
  54228. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  54229. this.addAttribute("position", c),
  54230. this.addAttribute("normal", h),
  54231. this.addAttribute("uv", u),
  54232. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  54233. }
  54234. ,
  54235. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54236. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  54237. Ci.TextGeometry = function(e, t) {
  54238. var i = (t = t || {}).font;
  54239. if (i instanceof Ci.Font == 0)
  54240. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54241. new Ci.Geometry;
  54242. var n = i.generateShapes(e, t.size, t.curveSegments);
  54243. t.amount = void 0 !== t.height ? t.height : 50,
  54244. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54245. void 0 === t.bevelSize && (t.bevelSize = 8),
  54246. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54247. Ci.ExtrudeGeometry.call(this, n, t),
  54248. this.type = "TextGeometry"
  54249. }
  54250. ,
  54251. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  54252. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  54253. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  54254. Ci.BufferGeometry.call(this),
  54255. this.type = "TorusBufferGeometry",
  54256. this.parameters = {
  54257. radius: e,
  54258. tube: t,
  54259. radialSegments: i,
  54260. tubularSegments: n,
  54261. arc: r
  54262. },
  54263. e = e || 100,
  54264. t = t || 40,
  54265. i = Math.floor(i) || 8,
  54266. n = Math.floor(n) || 6,
  54267. r = r || 2 * Math.PI;
  54268. 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;
  54269. for (o = 0; o <= i; o++)
  54270. for (a = 0; a <= n; a++) {
  54271. var A = a / n * r
  54272. , C = o / i * Math.PI * 2;
  54273. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  54274. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  54275. v.z = t * Math.sin(C),
  54276. h[p] = v.x,
  54277. h[p + 1] = v.y,
  54278. h[p + 2] = v.z,
  54279. m.x = e * Math.cos(A),
  54280. m.y = e * Math.sin(A),
  54281. y.subVectors(v, m).normalize(),
  54282. u[p] = y.x,
  54283. u[p + 1] = y.y,
  54284. u[p + 2] = y.z,
  54285. d[f] = a / n,
  54286. d[f + 1] = o / i,
  54287. p += 3,
  54288. f += 2
  54289. }
  54290. for (o = 1; o <= i; o++)
  54291. for (a = 1; a <= n; a++) {
  54292. var I = (n + 1) * o + a - 1
  54293. , E = (n + 1) * (o - 1) + a - 1
  54294. , _ = (n + 1) * (o - 1) + a
  54295. , b = (n + 1) * o + a;
  54296. c[g] = I,
  54297. c[g + 1] = E,
  54298. c[g + 2] = b,
  54299. c[g + 3] = E,
  54300. c[g + 4] = _,
  54301. c[g + 5] = b,
  54302. g += 6
  54303. }
  54304. this.setIndex(new Ci.BufferAttribute(c,1)),
  54305. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  54306. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  54307. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  54308. }
  54309. ,
  54310. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54311. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  54312. Ci.TorusGeometry = function(e, t, i, n, r) {
  54313. Ci.Geometry.call(this),
  54314. this.type = "TorusGeometry",
  54315. this.parameters = {
  54316. radius: e,
  54317. tube: t,
  54318. radialSegments: i,
  54319. tubularSegments: n,
  54320. arc: r
  54321. },
  54322. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  54323. }
  54324. ,
  54325. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54326. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  54327. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  54328. function a(e, t, i, n, r) {
  54329. var o = Math.cos(e)
  54330. , a = Math.sin(e)
  54331. , s = i / t * e
  54332. , l = Math.cos(s);
  54333. r.x = n * (2 + l) * .5 * o,
  54334. r.y = n * (2 + l) * a * .5,
  54335. r.z = n * Math.sin(s) * .5
  54336. }
  54337. Ci.BufferGeometry.call(this),
  54338. this.type = "TorusKnotBufferGeometry",
  54339. this.parameters = {
  54340. radius: e,
  54341. tube: t,
  54342. tubularSegments: i,
  54343. radialSegments: n,
  54344. p: r,
  54345. q: o
  54346. },
  54347. e = e || 100,
  54348. t = t || 40,
  54349. i = Math.floor(i) || 64,
  54350. r = r || 2,
  54351. o = o || 3;
  54352. 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;
  54353. for (s = 0; s <= i; ++s) {
  54354. var w = s / i * r * Math.PI * 2;
  54355. for (a(w, r, o, e, C),
  54356. a(.01 + w, r, o, e, I),
  54357. _.subVectors(I, C),
  54358. b.addVectors(I, C),
  54359. E.crossVectors(_, b),
  54360. b.crossVectors(E, _),
  54361. E.normalize(),
  54362. b.normalize(),
  54363. l = 0; l <= n; ++l) {
  54364. var T = l / n * Math.PI * 2
  54365. , x = -t * Math.cos(T)
  54366. , S = t * Math.sin(T);
  54367. v.x = C.x + (x * b.x + S * E.x),
  54368. v.y = C.y + (x * b.y + S * E.y),
  54369. v.z = C.z + (x * b.z + S * E.z),
  54370. d.setXYZ(g, v.x, v.y, v.z),
  54371. y.subVectors(v, C).normalize(),
  54372. p.setXYZ(g, y.x, y.y, y.z),
  54373. A.x = s / i,
  54374. A.y = l / n,
  54375. f.setXY(g, A.x, A.y),
  54376. g++
  54377. }
  54378. }
  54379. for (l = 1; l <= i; l++)
  54380. for (s = 1; s <= n; s++) {
  54381. var M = (n + 1) * (l - 1) + (s - 1)
  54382. , R = (n + 1) * l + (s - 1)
  54383. , P = (n + 1) * l + s
  54384. , O = (n + 1) * (l - 1) + s;
  54385. u.setX(m, M),
  54386. m++,
  54387. u.setX(m, R),
  54388. m++,
  54389. u.setX(m, O),
  54390. m++,
  54391. u.setX(m, R),
  54392. m++,
  54393. u.setX(m, P),
  54394. m++,
  54395. u.setX(m, O),
  54396. m++
  54397. }
  54398. this.setIndex(u),
  54399. this.addAttribute("position", d),
  54400. this.addAttribute("normal", p),
  54401. this.addAttribute("uv", f)
  54402. }
  54403. ,
  54404. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54405. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  54406. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  54407. Ci.Geometry.call(this),
  54408. this.type = "TorusKnotGeometry",
  54409. this.parameters = {
  54410. radius: e,
  54411. tube: t,
  54412. tubularSegments: i,
  54413. radialSegments: n,
  54414. p: r,
  54415. q: o
  54416. },
  54417. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54418. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  54419. this.mergeVertices()
  54420. }
  54421. ,
  54422. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54423. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  54424. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  54425. Ci.Geometry.call(this),
  54426. this.type = "TubeGeometry",
  54427. this.parameters = {
  54428. path: e,
  54429. segments: t,
  54430. radius: i,
  54431. radialSegments: n,
  54432. closed: r,
  54433. taper: o
  54434. },
  54435. t = t || 64,
  54436. i = i || 1,
  54437. n = n || 8,
  54438. r = r || !1,
  54439. o = o || Ci.TubeGeometry.NoTaper;
  54440. 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;
  54441. for (this.tangents = D,
  54442. this.normals = N,
  54443. this.binormals = F,
  54444. f = 0; f < P; f++)
  54445. for (M[f] = [],
  54446. l = f / (P - 1),
  54447. p = e.getPointAt(l),
  54448. D[f],
  54449. a = N[f],
  54450. s = F[f],
  54451. h = i * o(l),
  54452. g = 0; g < n; g++)
  54453. c = g / n * 2 * Math.PI,
  54454. u = -h * Math.cos(c),
  54455. d = h * Math.sin(c),
  54456. O.copy(p),
  54457. O.x += u * a.x + d * s.x,
  54458. O.y += u * a.y + d * s.y,
  54459. O.z += u * a.z + d * s.z,
  54460. M[f][g] = (T = O.x,
  54461. x = O.y,
  54462. S = O.z,
  54463. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  54464. for (f = 0; f < t; f++)
  54465. for (g = 0; g < n; g++)
  54466. m = r ? (f + 1) % t : f + 1,
  54467. v = (g + 1) % n,
  54468. y = M[f][g],
  54469. A = M[m][g],
  54470. C = M[m][v],
  54471. I = M[f][v],
  54472. E = new Ci.Vector2(f / t,g / n),
  54473. _ = new Ci.Vector2((f + 1) / t,g / n),
  54474. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  54475. w = new Ci.Vector2(f / t,(g + 1) / n),
  54476. this.faces.push(new Ci.Face3(y,A,I)),
  54477. this.faceVertexUvs[0].push([E, _, w]),
  54478. this.faces.push(new Ci.Face3(A,C,I)),
  54479. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  54480. this.computeFaceNormals(),
  54481. this.computeVertexNormals()
  54482. }
  54483. ,
  54484. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54485. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54486. Ci.TubeGeometry.NoTaper = function(e) {
  54487. return 1
  54488. }
  54489. ,
  54490. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54491. return Math.sin(Math.PI * e)
  54492. }
  54493. ,
  54494. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54495. 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;
  54496. for (this.tangents = u,
  54497. this.normals = d,
  54498. this.binormals = p,
  54499. l = 0; l < m; l++)
  54500. c = l / (m - 1),
  54501. u[l] = e.getTangentAt(c),
  54502. u[l].normalize();
  54503. for (d[0] = new Ci.Vector3,
  54504. p[0] = new Ci.Vector3,
  54505. r = Number.MAX_VALUE,
  54506. o = Math.abs(u[0].x),
  54507. a = Math.abs(u[0].y),
  54508. s = Math.abs(u[0].z),
  54509. o <= r && (r = o,
  54510. h.set(1, 0, 0)),
  54511. a <= r && (r = a,
  54512. h.set(0, 1, 0)),
  54513. s <= r && h.set(0, 0, 1),
  54514. f.crossVectors(u[0], h).normalize(),
  54515. d[0].crossVectors(u[0], f),
  54516. p[0].crossVectors(u[0], d[0]),
  54517. l = 1; l < m; l++)
  54518. d[l] = d[l - 1].clone(),
  54519. p[l] = p[l - 1].clone(),
  54520. f.crossVectors(u[l - 1], u[l]),
  54521. f.length() > Number.EPSILON && (f.normalize(),
  54522. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54523. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54524. p[l].crossVectors(u[l], d[l]);
  54525. if (i)
  54526. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54527. n /= m - 1,
  54528. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54529. l = 1; l < m; l++)
  54530. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54531. p[l].crossVectors(u[l], d[l])
  54532. }
  54533. ,
  54534. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54535. function f(e) {
  54536. var t = e.normalize().clone();
  54537. t.index = m.vertices.push(t) - 1;
  54538. var i = a(e) / 2 / Math.PI + .5
  54539. , n = function(e) {
  54540. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54541. }(e) / Math.PI + .5;
  54542. return t.uv = new Ci.Vector2(i,1 - n),
  54543. t
  54544. }
  54545. function g(e, t, i, n) {
  54546. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54547. m.faces.push(r),
  54548. y.copy(e).add(t).add(i).divideScalar(3);
  54549. var o = a(y);
  54550. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54551. }
  54552. function r(e, t) {
  54553. 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++) {
  54554. a[l] = [];
  54555. 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++)
  54556. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54557. }
  54558. for (l = 0; l < i; l++)
  54559. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54560. var p = Math.floor(d / 2);
  54561. 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)
  54562. }
  54563. }
  54564. function a(e) {
  54565. return Math.atan2(e.z, -e.x)
  54566. }
  54567. function s(e, t, i) {
  54568. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54569. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54570. e.clone()
  54571. }
  54572. Ci.Geometry.call(this),
  54573. this.type = "PolyhedronGeometry",
  54574. this.parameters = {
  54575. vertices: e,
  54576. indices: t,
  54577. radius: i,
  54578. detail: n
  54579. },
  54580. i = i || 1,
  54581. n = n || 0;
  54582. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54583. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54584. var c = this.vertices
  54585. , h = []
  54586. , u = (o = 0,
  54587. 0);
  54588. for (l = t.length; o < l; o += 3,
  54589. u++) {
  54590. var d = c[t[o]]
  54591. , p = c[t[o + 1]]
  54592. , v = c[t[o + 2]];
  54593. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54594. }
  54595. var y = new Ci.Vector3;
  54596. for (o = 0,
  54597. l = h.length; o < l; o++)
  54598. r(h[o], n);
  54599. for (o = 0,
  54600. l = this.faceVertexUvs[0].length; o < l; o++) {
  54601. var A = this.faceVertexUvs[0][o]
  54602. , C = A[0].x
  54603. , I = A[1].x
  54604. , E = A[2].x
  54605. , _ = Math.max(C, I, E)
  54606. , b = Math.min(C, I, E);
  54607. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54608. I < .2 && (A[1].x += 1),
  54609. E < .2 && (A[2].x += 1))
  54610. }
  54611. for (o = 0,
  54612. l = this.vertices.length; o < l; o++)
  54613. this.vertices[o].multiplyScalar(i);
  54614. this.mergeVertices(),
  54615. this.computeFaceNormals(),
  54616. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54617. }
  54618. ,
  54619. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54620. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54621. Ci.DodecahedronGeometry = function(e, t) {
  54622. var i = (1 + Math.sqrt(5)) / 2
  54623. , n = 1 / i
  54624. , 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];
  54625. 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),
  54626. this.type = "DodecahedronGeometry",
  54627. this.parameters = {
  54628. radius: e,
  54629. detail: t
  54630. }
  54631. }
  54632. ,
  54633. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54634. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54635. Ci.IcosahedronGeometry = function(e, t) {
  54636. var i = (1 + Math.sqrt(5)) / 2
  54637. , 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];
  54638. 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),
  54639. this.type = "IcosahedronGeometry",
  54640. this.parameters = {
  54641. radius: e,
  54642. detail: t
  54643. }
  54644. }
  54645. ,
  54646. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54647. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54648. Ci.OctahedronGeometry = function(e, t) {
  54649. 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),
  54650. this.type = "OctahedronGeometry",
  54651. this.parameters = {
  54652. radius: e,
  54653. detail: t
  54654. }
  54655. }
  54656. ,
  54657. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54658. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54659. Ci.TetrahedronGeometry = function(e, t) {
  54660. 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),
  54661. this.type = "TetrahedronGeometry",
  54662. this.parameters = {
  54663. radius: e,
  54664. detail: t
  54665. }
  54666. }
  54667. ,
  54668. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54669. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54670. Ci.ParametricGeometry = function(e, t, i) {
  54671. Ci.Geometry.call(this),
  54672. this.type = "ParametricGeometry",
  54673. this.parameters = {
  54674. func: e,
  54675. slices: t,
  54676. stacks: i
  54677. };
  54678. 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;
  54679. for (n = 0; n <= i; n++)
  54680. for (a = n / i,
  54681. r = 0; r <= t; r++)
  54682. o = e(r / t, a),
  54683. g.push(o);
  54684. for (n = 0; n < i; n++)
  54685. for (r = 0; r < t; r++)
  54686. l = (s = n * y + r) + 1,
  54687. c = (n + 1) * y + r + 1,
  54688. h = (n + 1) * y + r,
  54689. u = new Ci.Vector2(r / t,n / i),
  54690. d = new Ci.Vector2((r + 1) / t,n / i),
  54691. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54692. f = new Ci.Vector2(r / t,(n + 1) / i),
  54693. m.push(new Ci.Face3(s,l,h)),
  54694. v.push([u, d, f]),
  54695. m.push(new Ci.Face3(l,c,h)),
  54696. v.push([d.clone(), p, f.clone()]);
  54697. this.computeFaceNormals(),
  54698. this.computeVertexNormals()
  54699. }
  54700. ,
  54701. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54702. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54703. Ci.WireframeGeometry = function(e) {
  54704. function t(e, t) {
  54705. return e - t
  54706. }
  54707. Ci.BufferGeometry.call(this);
  54708. var i = [0, 0]
  54709. , n = {}
  54710. , r = ["a", "b", "c"];
  54711. if (e instanceof Ci.Geometry) {
  54712. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54713. for (var u = a[c], d = 0; d < 3; d++) {
  54714. i[0] = u[r[d]],
  54715. i[1] = u[r[(d + 1) % 3]],
  54716. i.sort(t),
  54717. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54718. l[2 * s + 1] = i[1],
  54719. n[E] = !0,
  54720. s++)
  54721. }
  54722. var p = new Float32Array(2 * s * 3);
  54723. for (c = 0,
  54724. h = s; c < h; c++)
  54725. for (d = 0; d < 2; d++) {
  54726. var f = o[l[2 * c + d]];
  54727. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54728. p[_ + 1] = f.y,
  54729. p[_ + 2] = f.z
  54730. }
  54731. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54732. } else if (e instanceof Ci.BufferGeometry)
  54733. if (null !== e.index) {
  54734. var g = e.index.array
  54735. , m = (o = e.attributes.position,
  54736. e.groups);
  54737. s = 0;
  54738. 0 === m.length && e.addGroup(0, g.length);
  54739. l = new Uint32Array(2 * g.length);
  54740. for (var v = 0, y = m.length; v < y; ++v)
  54741. for (var A = m[v], C = A.start, I = (c = C,
  54742. C + A.count); c < I; c += 3)
  54743. for (d = 0; d < 3; d++) {
  54744. var E;
  54745. i[0] = g[c + d],
  54746. i[1] = g[c + (d + 1) % 3],
  54747. i.sort(t),
  54748. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54749. l[2 * s + 1] = i[1],
  54750. n[E] = !0,
  54751. s++)
  54752. }
  54753. for (p = new Float32Array(2 * s * 3),
  54754. c = 0,
  54755. h = s; c < h; c++)
  54756. for (d = 0; d < 2; d++) {
  54757. var _ = 6 * c + 3 * d
  54758. , b = l[2 * c + d];
  54759. p[_ + 0] = o.getX(b),
  54760. p[_ + 1] = o.getY(b),
  54761. p[_ + 2] = o.getZ(b)
  54762. }
  54763. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54764. } else {
  54765. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54766. for (p = new Float32Array(2 * s * 3),
  54767. c = 0,
  54768. h = w; c < h; c++)
  54769. for (d = 0; d < 3; d++) {
  54770. var T = 9 * c + 3 * d;
  54771. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54772. p[_ + 1] = o[1 + T],
  54773. p[_ + 2] = o[2 + T];
  54774. b = 9 * c + (d + 1) % 3 * 3;
  54775. p[_ + 3] = o[b],
  54776. p[_ + 4] = o[b + 1],
  54777. p[_ + 5] = o[b + 2]
  54778. }
  54779. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54780. }
  54781. }
  54782. ,
  54783. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54784. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54785. Ci.AxisHelper = function(e) {
  54786. e = e || 1;
  54787. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54788. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54789. , n = new Ci.BufferGeometry;
  54790. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54791. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54792. var r = new Ci.LineBasicMaterial({
  54793. vertexColors: Ci.VertexColors
  54794. });
  54795. Ci.LineSegments.call(this, n, r)
  54796. }
  54797. ,
  54798. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54799. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54800. Ci.ArrowHelper = function() {
  54801. var a = new Ci.Geometry;
  54802. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54803. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54804. return s.translate(0, -.5, 0),
  54805. function(e, t, i, n, r, o) {
  54806. Ci.Object3D.call(this),
  54807. void 0 === n && (n = 16776960),
  54808. void 0 === i && (i = 1),
  54809. void 0 === r && (r = .2 * i),
  54810. void 0 === o && (o = .2 * r),
  54811. this.position.copy(t),
  54812. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54813. color: n
  54814. })),
  54815. this.line.matrixAutoUpdate = !1,
  54816. this.add(this.line),
  54817. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54818. color: n
  54819. })),
  54820. this.cone.matrixAutoUpdate = !1,
  54821. this.add(this.cone),
  54822. this.setDirection(e),
  54823. this.setLength(i, r, o)
  54824. }
  54825. }(),
  54826. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54827. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54828. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54829. function(e) {
  54830. .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(),
  54831. yi = Math.acos(e.y),
  54832. this.quaternion.setFromAxisAngle(Ai, yi))
  54833. }
  54834. ),
  54835. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54836. void 0 === t && (t = .2 * e),
  54837. void 0 === i && (i = .2 * t),
  54838. this.line.scale.set(1, Math.max(0, e - t), 1),
  54839. this.line.updateMatrix(),
  54840. this.cone.scale.set(i, t, i),
  54841. this.cone.position.y = e,
  54842. this.cone.updateMatrix()
  54843. }
  54844. ,
  54845. Ci.ArrowHelper.prototype.setColor = function(e) {
  54846. this.line.material.color.set(e),
  54847. this.cone.material.color.set(e)
  54848. }
  54849. ,
  54850. Ci.BoxHelper = function(e) {
  54851. 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])
  54852. , i = new Float32Array(24)
  54853. , n = new Ci.BufferGeometry;
  54854. n.setIndex(new Ci.BufferAttribute(t,1)),
  54855. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54856. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54857. color: 16776960
  54858. })),
  54859. void 0 !== e && this.update(e)
  54860. }
  54861. ,
  54862. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54863. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54864. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54865. function(e) {
  54866. if (vi.setFromObject(e),
  54867. !vi.isEmpty()) {
  54868. var t = vi.min
  54869. , i = vi.max
  54870. , n = this.geometry.attributes.position
  54871. , r = n.array;
  54872. r[0] = i.x,
  54873. r[1] = i.y,
  54874. r[2] = i.z,
  54875. r[3] = t.x,
  54876. r[4] = i.y,
  54877. r[5] = i.z,
  54878. r[6] = t.x,
  54879. r[7] = t.y,
  54880. r[8] = i.z,
  54881. r[9] = i.x,
  54882. r[10] = t.y,
  54883. r[11] = i.z,
  54884. r[12] = i.x,
  54885. r[13] = i.y,
  54886. r[14] = t.z,
  54887. r[15] = t.x,
  54888. r[16] = i.y,
  54889. r[17] = t.z,
  54890. r[18] = t.x,
  54891. r[19] = t.y,
  54892. r[20] = t.z,
  54893. r[21] = i.x,
  54894. r[22] = t.y,
  54895. r[23] = t.z,
  54896. n.needsUpdate = !0,
  54897. this.geometry.computeBoundingSphere()
  54898. }
  54899. }
  54900. ),
  54901. Ci.BoundingBoxHelper = function(e, t) {
  54902. var i = void 0 !== t ? t : 8947848;
  54903. this.object = e,
  54904. this.box = new Ci.Box3,
  54905. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54906. color: i,
  54907. wireframe: !0
  54908. }))
  54909. }
  54910. ,
  54911. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54912. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54913. Ci.BoundingBoxHelper.prototype.update = function() {
  54914. this.box.setFromObject(this.object),
  54915. this.box.size(this.scale),
  54916. this.box.center(this.position)
  54917. }
  54918. ,
  54919. Ci.CameraHelper = function(e) {
  54920. function t(e, t, i) {
  54921. n(e, i),
  54922. n(t, i)
  54923. }
  54924. function n(e, t) {
  54925. i.vertices.push(new Ci.Vector3),
  54926. i.colors.push(new Ci.Color(t)),
  54927. void 0 === o[e] && (o[e] = []),
  54928. o[e].push(i.vertices.length - 1)
  54929. }
  54930. var i = new Ci.Geometry
  54931. , r = new Ci.LineBasicMaterial({
  54932. color: 16777215,
  54933. vertexColors: Ci.FaceColors
  54934. })
  54935. , o = {}
  54936. , a = 16755200
  54937. , s = 16711680
  54938. , l = 3355443;
  54939. t("n1", "n2", a),
  54940. t("n2", "n4", a),
  54941. t("n4", "n3", a),
  54942. t("n3", "n1", a),
  54943. t("f1", "f2", a),
  54944. t("f2", "f4", a),
  54945. t("f4", "f3", a),
  54946. t("f3", "f1", a),
  54947. t("n1", "f1", a),
  54948. t("n2", "f2", a),
  54949. t("n3", "f3", a),
  54950. t("n4", "f4", a),
  54951. t("p", "n1", s),
  54952. t("p", "n2", s),
  54953. t("p", "n3", s),
  54954. t("p", "n4", s),
  54955. t("u1", "u2", 43775),
  54956. t("u2", "u3", 43775),
  54957. t("u3", "u1", 43775),
  54958. t("c", "t", 16777215),
  54959. t("p", "c", l),
  54960. t("cn1", "cn2", l),
  54961. t("cn3", "cn4", l),
  54962. t("cf1", "cf2", l),
  54963. t("cf3", "cf4", l),
  54964. Ci.LineSegments.call(this, i, r),
  54965. this.camera = e,
  54966. this.camera.updateProjectionMatrix(),
  54967. this.matrix = e.matrixWorld,
  54968. this.matrixAutoUpdate = !1,
  54969. this.pointMap = o,
  54970. this.update()
  54971. }
  54972. ,
  54973. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54974. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54975. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54976. mi = new Ci.Camera,
  54977. function() {
  54978. pi = this.geometry,
  54979. fi = this.pointMap,
  54980. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54981. Ni("c", 0, 0, -1),
  54982. Ni("t", 0, 0, 1),
  54983. Ni("n1", -1, -1, -1),
  54984. Ni("n2", 1, -1, -1),
  54985. Ni("n3", -1, 1, -1),
  54986. Ni("n4", 1, 1, -1),
  54987. Ni("f1", -1, -1, 1),
  54988. Ni("f2", 1, -1, 1),
  54989. Ni("f3", -1, 1, 1),
  54990. Ni("f4", 1, 1, 1),
  54991. Ni("u1", .7, 1.1, -1),
  54992. Ni("u2", -.7, 1.1, -1),
  54993. Ni("u3", 0, 2, -1),
  54994. Ni("cf1", -1, 0, 1),
  54995. Ni("cf2", 1, 0, 1),
  54996. Ni("cf3", 0, -1, 1),
  54997. Ni("cf4", 0, 1, 1),
  54998. Ni("cn1", -1, 0, -1),
  54999. Ni("cn2", 1, 0, -1),
  55000. Ni("cn3", 0, -1, -1),
  55001. Ni("cn4", 0, 1, -1),
  55002. pi.verticesNeedUpdate = !0
  55003. }
  55004. ),
  55005. Ci.DirectionalLightHelper = function(e, t) {
  55006. Ci.Object3D.call(this),
  55007. this.light = e,
  55008. this.light.updateMatrixWorld(),
  55009. this.matrix = e.matrixWorld,
  55010. this.matrixAutoUpdate = !1,
  55011. t = t || 1;
  55012. var i = new Ci.Geometry;
  55013. 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));
  55014. var n = new Ci.LineBasicMaterial({
  55015. fog: !1
  55016. });
  55017. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55018. this.lightPlane = new Ci.Line(i,n),
  55019. this.add(this.lightPlane),
  55020. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  55021. (n = new Ci.LineBasicMaterial({
  55022. fog: !1
  55023. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55024. this.targetLine = new Ci.Line(i,n),
  55025. this.add(this.targetLine),
  55026. this.update()
  55027. }
  55028. ,
  55029. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55030. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  55031. Ci.DirectionalLightHelper.prototype.dispose = function() {
  55032. this.lightPlane.geometry.dispose(),
  55033. this.lightPlane.material.dispose(),
  55034. this.targetLine.geometry.dispose(),
  55035. this.targetLine.material.dispose()
  55036. }
  55037. ,
  55038. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  55039. ui = new Ci.Vector3,
  55040. di = new Ci.Vector3,
  55041. function() {
  55042. hi.setFromMatrixPosition(this.light.matrixWorld),
  55043. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  55044. di.subVectors(ui, hi),
  55045. this.lightPlane.lookAt(di),
  55046. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55047. this.targetLine.geometry.vertices[1].copy(di),
  55048. this.targetLine.geometry.verticesNeedUpdate = !0,
  55049. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55050. }
  55051. ),
  55052. Ci.EdgesHelper = function(e, t, i) {
  55053. var n = void 0 !== t ? t : 16777215;
  55054. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  55055. color: n
  55056. })),
  55057. this.matrix = e.matrixWorld,
  55058. this.matrixAutoUpdate = !1
  55059. }
  55060. ,
  55061. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55062. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  55063. Ci.FaceNormalsHelper = function(e, t, i, n) {
  55064. this.object = e,
  55065. this.size = void 0 !== t ? t : 1;
  55066. var r = void 0 !== i ? i : 16776960
  55067. , o = void 0 !== n ? n : 1
  55068. , a = 0
  55069. , s = this.object.geometry;
  55070. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55071. var l = new Ci.BufferGeometry
  55072. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55073. l.addAttribute("position", c),
  55074. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55075. color: r,
  55076. linewidth: o
  55077. })),
  55078. this.matrixAutoUpdate = !1,
  55079. this.update()
  55080. }
  55081. ,
  55082. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55083. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  55084. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  55085. li = new Ci.Vector3,
  55086. ci = new Ci.Matrix3,
  55087. function() {
  55088. this.object.updateMatrixWorld(!0),
  55089. ci.getNormalMatrix(this.object.matrixWorld);
  55090. 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++) {
  55091. var l = r[a]
  55092. , c = l.normal;
  55093. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  55094. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  55095. t.setXYZ(o, si.x, si.y, si.z),
  55096. o += 1,
  55097. t.setXYZ(o, li.x, li.y, li.z),
  55098. o += 1
  55099. }
  55100. return t.needsUpdate = !0,
  55101. this
  55102. }
  55103. ),
  55104. Ci.GridHelper = function(e, t) {
  55105. var i = new Ci.Geometry
  55106. , n = new Ci.LineBasicMaterial({
  55107. vertexColors: Ci.VertexColors
  55108. });
  55109. this.color1 = new Ci.Color(4473924),
  55110. this.color2 = new Ci.Color(8947848);
  55111. for (var r = -e; r <= e; r += t) {
  55112. 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));
  55113. var o = 0 === r ? this.color1 : this.color2;
  55114. i.colors.push(o, o, o, o)
  55115. }
  55116. Ci.LineSegments.call(this, i, n)
  55117. }
  55118. ,
  55119. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55120. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  55121. Ci.GridHelper.prototype.setColors = function(e, t) {
  55122. this.color1.set(e),
  55123. this.color2.set(t),
  55124. this.geometry.colorsNeedUpdate = !0
  55125. }
  55126. ,
  55127. Ci.HemisphereLightHelper = function(e, t) {
  55128. Ci.Object3D.call(this),
  55129. this.light = e,
  55130. this.light.updateMatrixWorld(),
  55131. this.matrix = e.matrixWorld,
  55132. this.matrixAutoUpdate = !1,
  55133. this.colors = [new Ci.Color, new Ci.Color];
  55134. var i = new Ci.SphereGeometry(t,4,2);
  55135. i.rotateX(-Math.PI / 2);
  55136. for (var n = 0; n < 8; n++)
  55137. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  55138. var r = new Ci.MeshBasicMaterial({
  55139. vertexColors: Ci.FaceColors,
  55140. wireframe: !0
  55141. });
  55142. this.lightSphere = new Ci.Mesh(i,r),
  55143. this.add(this.lightSphere),
  55144. this.update()
  55145. }
  55146. ,
  55147. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55148. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  55149. Ci.HemisphereLightHelper.prototype.dispose = function() {
  55150. this.lightSphere.geometry.dispose(),
  55151. this.lightSphere.material.dispose()
  55152. }
  55153. ,
  55154. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  55155. function() {
  55156. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55157. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55158. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55159. this.lightSphere.geometry.colorsNeedUpdate = !0
  55160. }
  55161. ),
  55162. Ci.PointLightHelper = function(e, t) {
  55163. this.light = e,
  55164. this.light.updateMatrixWorld();
  55165. var i = new Ci.SphereGeometry(t,4,2)
  55166. , n = new Ci.MeshBasicMaterial({
  55167. wireframe: !0,
  55168. fog: !1
  55169. });
  55170. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55171. Ci.Mesh.call(this, i, n),
  55172. this.matrix = this.light.matrixWorld,
  55173. this.matrixAutoUpdate = !1
  55174. }
  55175. ,
  55176. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  55177. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  55178. Ci.PointLightHelper.prototype.dispose = function() {
  55179. this.geometry.dispose(),
  55180. this.material.dispose()
  55181. }
  55182. ,
  55183. Ci.PointLightHelper.prototype.update = function() {
  55184. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55185. }
  55186. ,
  55187. Ci.SkeletonHelper = function(e) {
  55188. this.bones = this.getBoneList(e);
  55189. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  55190. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  55191. t.vertices.push(new Ci.Vector3),
  55192. t.colors.push(new Ci.Color(0,0,1)),
  55193. t.colors.push(new Ci.Color(0,1,0)))
  55194. }
  55195. t.dynamic = !0;
  55196. var n = new Ci.LineBasicMaterial({
  55197. vertexColors: Ci.VertexColors,
  55198. depthTest: !1,
  55199. depthWrite: !1,
  55200. transparent: !0
  55201. });
  55202. Ci.LineSegments.call(this, t, n),
  55203. this.root = e,
  55204. this.matrix = e.matrixWorld,
  55205. this.matrixAutoUpdate = !1,
  55206. this.update()
  55207. }
  55208. ,
  55209. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55210. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  55211. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  55212. var t = [];
  55213. e instanceof Ci.Bone && t.push(e);
  55214. for (var i = 0; i < e.children.length; i++)
  55215. t.push.apply(t, this.getBoneList(e.children[i]));
  55216. return t
  55217. }
  55218. ,
  55219. Ci.SkeletonHelper.prototype.update = function() {
  55220. 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++) {
  55221. var o = this.bones[r];
  55222. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  55223. e.vertices[n].setFromMatrixPosition(i),
  55224. i.multiplyMatrices(t, o.parent.matrixWorld),
  55225. e.vertices[n + 1].setFromMatrixPosition(i),
  55226. n += 2)
  55227. }
  55228. e.verticesNeedUpdate = !0,
  55229. e.computeBoundingSphere()
  55230. }
  55231. ,
  55232. Ci.SpotLightHelper = function(e) {
  55233. Ci.Object3D.call(this),
  55234. this.light = e,
  55235. this.light.updateMatrixWorld(),
  55236. this.matrix = e.matrixWorld,
  55237. this.matrixAutoUpdate = !1;
  55238. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  55239. t.translate(0, -.5, 0),
  55240. t.rotateX(-Math.PI / 2);
  55241. var i = new Ci.MeshBasicMaterial({
  55242. wireframe: !0,
  55243. fog: !1
  55244. });
  55245. this.cone = new Ci.Mesh(t,i),
  55246. this.add(this.cone),
  55247. this.update()
  55248. }
  55249. ,
  55250. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  55251. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  55252. Ci.SpotLightHelper.prototype.dispose = function() {
  55253. this.cone.geometry.dispose(),
  55254. this.cone.material.dispose()
  55255. }
  55256. ,
  55257. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  55258. oi = new Ci.Vector3,
  55259. function() {
  55260. var e = this.light.distance ? this.light.distance : 1e4
  55261. , t = e * Math.tan(this.light.angle);
  55262. this.cone.scale.set(t, t, e),
  55263. ri.setFromMatrixPosition(this.light.matrixWorld),
  55264. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  55265. this.cone.lookAt(oi.sub(ri)),
  55266. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55267. }
  55268. ),
  55269. Ci.VertexNormalsHelper = function(e, t, i, n) {
  55270. this.object = e,
  55271. this.size = void 0 !== t ? t : 1;
  55272. var r = void 0 !== i ? i : 16711680
  55273. , o = void 0 !== n ? n : 1
  55274. , a = 0
  55275. , s = this.object.geometry;
  55276. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  55277. var l = new Ci.BufferGeometry
  55278. , c = new Ci.Float32Attribute(2 * a * 3,3);
  55279. l.addAttribute("position", c),
  55280. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  55281. color: r,
  55282. linewidth: o
  55283. })),
  55284. this.matrixAutoUpdate = !1,
  55285. this.update()
  55286. }
  55287. ,
  55288. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55289. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  55290. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  55291. ii = new Ci.Vector3,
  55292. ni = new Ci.Matrix3,
  55293. function() {
  55294. var e = ["a", "b", "c"];
  55295. this.object.updateMatrixWorld(!0),
  55296. ni.getNormalMatrix(this.object.matrixWorld);
  55297. var t = this.object.matrixWorld
  55298. , i = this.geometry.attributes.position
  55299. , n = this.object.geometry;
  55300. if (n instanceof Ci.Geometry)
  55301. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  55302. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  55303. var d = r[c[e[h]]]
  55304. , p = c.vertexNormals[h];
  55305. ti.copy(d).applyMatrix4(t),
  55306. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55307. i.setXYZ(a, ti.x, ti.y, ti.z),
  55308. a += 1,
  55309. i.setXYZ(a, ii.x, ii.y, ii.z),
  55310. a += 1
  55311. }
  55312. else if (n instanceof Ci.BufferGeometry) {
  55313. var f = n.attributes.position
  55314. , g = n.attributes.normal;
  55315. for (h = a = 0,
  55316. u = f.count; h < u; h++)
  55317. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  55318. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  55319. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  55320. i.setXYZ(a, ti.x, ti.y, ti.z),
  55321. a += 1,
  55322. i.setXYZ(a, ii.x, ii.y, ii.z),
  55323. a += 1
  55324. }
  55325. return i.needsUpdate = !0,
  55326. this
  55327. }
  55328. ),
  55329. Ci.WireframeHelper = function(e, t) {
  55330. var i = void 0 !== t ? t : 16777215;
  55331. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  55332. color: i
  55333. })),
  55334. this.matrix = e.matrixWorld,
  55335. this.matrixAutoUpdate = !1
  55336. }
  55337. ,
  55338. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  55339. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  55340. Ci.ImmediateRenderObject = function(e) {
  55341. Ci.Object3D.call(this),
  55342. this.material = e,
  55343. this.render = function(e) {}
  55344. }
  55345. ,
  55346. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  55347. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  55348. Ci.MorphBlendMesh = function(e, t) {
  55349. Ci.Mesh.call(this, e, t),
  55350. this.animationsMap = {},
  55351. this.animationsList = [];
  55352. var i = this.geometry.morphTargets.length
  55353. , n = i - 1
  55354. , r = i / 1;
  55355. this.createAnimation("__default", 0, n, r),
  55356. this.setAnimationWeight("__default", 1)
  55357. }
  55358. ,
  55359. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  55360. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  55361. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55362. var r = {
  55363. start: t,
  55364. end: i,
  55365. length: i - t + 1,
  55366. fps: n,
  55367. duration: (i - t) / n,
  55368. lastFrame: 0,
  55369. currentFrame: 0,
  55370. active: !1,
  55371. time: 0,
  55372. direction: 1,
  55373. weight: 1,
  55374. directionBackwards: !1,
  55375. mirroredLoop: !1
  55376. };
  55377. this.animationsMap[e] = r,
  55378. this.animationsList.push(r)
  55379. }
  55380. ,
  55381. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55382. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55383. var s = r.morphTargets[o].name.match(i);
  55384. if (s && 1 < s.length)
  55385. n[l = s[1]] || (n[l] = {
  55386. start: 1 / 0,
  55387. end: -1 / 0
  55388. }),
  55389. o < (c = n[l]).start && (c.start = o),
  55390. o > c.end && (c.end = o),
  55391. t = t || l
  55392. }
  55393. for (var l in n) {
  55394. var c = n[l];
  55395. this.createAnimation(l, c.start, c.end, e)
  55396. }
  55397. this.firstAnimation = t
  55398. }
  55399. ,
  55400. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55401. var t = this.animationsMap[e];
  55402. t && (t.direction = 1,
  55403. t.directionBackwards = !1)
  55404. }
  55405. ,
  55406. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55407. var t = this.animationsMap[e];
  55408. t && (t.direction = -1,
  55409. t.directionBackwards = !0)
  55410. }
  55411. ,
  55412. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55413. var i = this.animationsMap[e];
  55414. i && (i.fps = t,
  55415. i.duration = (i.end - i.start) / i.fps)
  55416. }
  55417. ,
  55418. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55419. var i = this.animationsMap[e];
  55420. i && (i.duration = t,
  55421. i.fps = (i.end - i.start) / i.duration)
  55422. }
  55423. ,
  55424. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55425. var i = this.animationsMap[e];
  55426. i && (i.weight = t)
  55427. }
  55428. ,
  55429. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55430. var i = this.animationsMap[e];
  55431. i && (i.time = t)
  55432. }
  55433. ,
  55434. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55435. var t = 0
  55436. , i = this.animationsMap[e];
  55437. return i && (t = i.time),
  55438. t
  55439. }
  55440. ,
  55441. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55442. var t = -1
  55443. , i = this.animationsMap[e];
  55444. return i && (t = i.duration),
  55445. t
  55446. }
  55447. ,
  55448. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  55449. var t = this.animationsMap[e];
  55450. t ? (t.time = 0,
  55451. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55452. }
  55453. ,
  55454. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55455. var t = this.animationsMap[e];
  55456. t && (t.active = !1)
  55457. }
  55458. ,
  55459. Ci.MorphBlendMesh.prototype.update = function(e) {
  55460. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55461. var n = this.animationsList[t];
  55462. if (n.active) {
  55463. var r = n.duration / n.length;
  55464. n.time += n.direction * e,
  55465. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  55466. n.time > n.duration && (n.time = n.duration,
  55467. n.directionBackwards = !0),
  55468. n.time < 0 && (n.time = 0,
  55469. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  55470. n.time < 0 && (n.time += n.duration));
  55471. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  55472. , a = n.weight;
  55473. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  55474. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  55475. this.morphTargetInfluences[o] = 0,
  55476. n.lastFrame = n.currentFrame,
  55477. n.currentFrame = o);
  55478. var s = n.time % r / r;
  55479. n.directionBackwards && (s = 1 - s),
  55480. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  55481. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  55482. }
  55483. }
  55484. }
  55485. ,
  55486. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55487. i.THREE = Ci) : this.THREE = Ci
  55488. window.THREE = Ci
  55489. getObjLoader()
  55490. }
  55491. , {}]
  55492. }, {}, [116]);