main_2020_edit.js 2.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295
  1. if (function() {
  2. "use strict";
  3. function o(e, t) {
  4. return typeof e === t
  5. }
  6. function a(e, t) {
  7. return e instanceof t
  8. }
  9. function s(e) {
  10. return e && e.nodeType
  11. }
  12. function l(e) {
  13. return s(e) ? e : a(e, y) ? e[0] : void 0
  14. }
  15. function e(e, i, n) {
  16. return y.each(e, function(e, t) {
  17. n = i.call(t, n, e, t)
  18. }),
  19. n
  20. }
  21. function t(e, t, i) {
  22. var n, r, o;
  23. if (e === t)
  24. return !0;
  25. if (!e || !t || e.constructor !== t.constructor)
  26. return !1;
  27. for (n = 0,
  28. r = i.length; n < r; n += 1) {
  29. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  30. return !1;
  31. if (e[o] !== t[o])
  32. return !1
  33. }
  34. return !0
  35. }
  36. function c(e, t, i, n) {
  37. this.left = w(e),
  38. this.top = w(t),
  39. this.width = w(i),
  40. this.height = w(n),
  41. this.right = this.left + this.width,
  42. this.bottom = this.top + this.height
  43. }
  44. function h(e, t, i, n) {
  45. this.visible = e || 0,
  46. this.viewport = t || 0,
  47. this.possible = i || 0,
  48. this.rects = n && I({}, n) || null
  49. }
  50. function r(e, t) {
  51. this.els = e,
  52. this.viewport = t
  53. }
  54. function n(e, t) {
  55. return e.val - t.val
  56. }
  57. function u(e, t) {
  58. return t.val - e.val
  59. }
  60. function d(e) {
  61. var t = c.ofContent(e, !0)
  62. , i = c.ofViewport(e, !0)
  63. , n = t.width - i.width
  64. , r = t.height - i.height;
  65. this.content = t,
  66. this.viewport = i,
  67. this.width = n <= 0 ? null : i.left / n,
  68. this.height = r <= 0 ? null : i.top / r,
  69. this.left = i.left,
  70. this.top = i.top,
  71. this.right = t.right - i.right,
  72. this.bottom = t.bottom - i.bottom
  73. }
  74. function p(e) {
  75. this.el = e || window
  76. }
  77. function f(e, t) {
  78. this.context = e,
  79. this.viewport = t,
  80. this.init()
  81. }
  82. function g(e, t, i, n) {
  83. this.context = new r(e,t),
  84. this.property = i,
  85. this.descending = n,
  86. this.init()
  87. }
  88. function m(e) {
  89. e && e !== window && e !== document ? (this.context = e,
  90. this.$autoTarget = y(e)) : this.context = window,
  91. this.init()
  92. }
  93. 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 = {},
  94. v = 1,
  95. function(e) {
  96. return e ? (i[e] || (i[e] = v,
  97. v += 1),
  98. i[e]) : 0
  99. }
  100. );
  101. I(c.prototype, {
  102. equals: function(e) {
  103. return t(this, e, ["left", "top", "width", "height"])
  104. },
  105. area: function() {
  106. return this.width * this.height
  107. },
  108. relativeTo: function(e) {
  109. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  110. },
  111. intersection: function(e) {
  112. if (!a(e, c))
  113. return null;
  114. var t = _(this.left, e.left)
  115. , i = b(this.right, e.right)
  116. , n = _(this.top, e.top)
  117. , r = i - t
  118. , o = b(this.bottom, e.bottom) - n;
  119. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  120. },
  121. envelope: function(e) {
  122. if (!a(e, c))
  123. return this;
  124. var t = b(this.left, e.left)
  125. , i = _(this.right, e.right)
  126. , n = b(this.top, e.top);
  127. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  128. }
  129. }),
  130. I(c, {
  131. ofContent: function(e, t) {
  132. 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())
  133. },
  134. ofViewport: function(e, t) {
  135. 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())
  136. },
  137. ofElement: function(e) {
  138. var t = y(e);
  139. if (!t.is(":visible"))
  140. return null;
  141. var i = t.offset();
  142. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  143. }
  144. }),
  145. I(h.prototype, {
  146. equals: function(e) {
  147. return this.fracsEqual(e) && this.rectsEqual(e)
  148. },
  149. fracsEqual: function(e) {
  150. return t(this, e, ["visible", "viewport", "possible"])
  151. },
  152. rectsEqual: function(e) {
  153. return t(this.rects, e.rects, ["document", "element", "viewport"])
  154. }
  155. }),
  156. I(h, {
  157. of: function(e, t) {
  158. var i, n, r;
  159. return e = s(e) && c.ofElement(e) || e,
  160. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  161. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  162. r = b(e.width, t.width) * b(e.height, t.height),
  163. new h(n / e.area(),n / t.area(),n / r,{
  164. document: i,
  165. element: i.relativeTo(e),
  166. viewport: i.relativeTo(t)
  167. })) : new h
  168. }
  169. });
  170. var x = ["width", "height", "left", "right", "top", "bottom"]
  171. , S = ["possible", "visible", "viewport"];
  172. I(r.prototype, {
  173. sorted: function(t, e) {
  174. var i = this.viewport;
  175. return y.map(this.els, function(e) {
  176. return {
  177. el: e,
  178. val: function(e, t, i) {
  179. var n;
  180. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  181. n ? n[i] : 0
  182. }(e, i, t)
  183. }
  184. }).sort(e ? u : n)
  185. },
  186. best: function(e, t) {
  187. return this.els.length ? this.sorted(e, t)[0] : null
  188. }
  189. }),
  190. I(d.prototype, {
  191. equals: function(e) {
  192. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  193. }
  194. }),
  195. I(p.prototype, {
  196. equals: function(e) {
  197. return t(this, e, ["el"])
  198. },
  199. scrollState: function() {
  200. return new d(this.el)
  201. },
  202. scrollTo: function(e, t, i) {
  203. var n = y(this.el === window ? "html,body" : this.el);
  204. e = e || 0,
  205. t = t || 0,
  206. i = isNaN(i) ? 1e3 : i,
  207. n.stop(!0).animate({
  208. scrollLeft: e,
  209. scrollTop: t
  210. }, i)
  211. },
  212. scroll: function(e, t, i) {
  213. var n = this.el === window ? A : y(this.el);
  214. e = e || 0,
  215. t = t || 0,
  216. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  217. },
  218. scrollToRect: function(e, t, i, n) {
  219. t = t || 0,
  220. i = i || 0,
  221. this.scrollTo(e.left - t, e.top - i, n)
  222. },
  223. scrollToElement: function(e, t, i, n) {
  224. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  225. this.scrollToRect(r, t, i, n)
  226. }
  227. });
  228. var M = {
  229. init: function() {
  230. this.callbacks = y.Callbacks("memory unique"),
  231. this.currVal = null,
  232. this.prevVal = null,
  233. this.checkProxy = y.proxy(this.check, this),
  234. this.autoCheck()
  235. },
  236. bind: function(e) {
  237. this.callbacks.add(e)
  238. },
  239. unbind: function(e) {
  240. e ? this.callbacks.remove(e) : this.callbacks.empty()
  241. },
  242. trigger: function() {
  243. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  244. },
  245. check: function(e) {
  246. var t = this.updatedValue(e);
  247. return void 0 !== t && (this.prevVal = this.currVal,
  248. this.currVal = t,
  249. this.trigger(),
  250. !0)
  251. },
  252. $autoTarget: A,
  253. autoEvents: "load resize scroll",
  254. autoCheck: function(e) {
  255. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  256. }
  257. };
  258. I(f.prototype, M, {
  259. updatedValue: function() {
  260. var e = h.of(this.context, this.viewport);
  261. return this.currVal && this.currVal.equals(e) ? void 0 : e
  262. }
  263. }),
  264. I(g.prototype, M, {
  265. updatedValue: function() {
  266. var e = this.context.best(this.property, this.descending);
  267. return e && (e = 0 < e.val ? e.el : null,
  268. this.currVal !== e) ? e : void 0
  269. }
  270. }),
  271. I(m.prototype, M, {
  272. updatedValue: function() {
  273. var e = new d(this.context);
  274. return this.currVal && this.currVal.equals(e) ? void 0 : e
  275. }
  276. });
  277. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  278. function H(e, t, i, n) {
  279. return i = N(i) ? i.apply(e, t) : i,
  280. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  281. }
  282. R = U,
  283. P = {
  284. statics: {
  285. version: "0.15.0",
  286. Rect: c,
  287. Fractions: h,
  288. Group: r,
  289. ScrollState: d,
  290. Viewport: p,
  291. FracsCallbacks: f,
  292. GroupCallbacks: g,
  293. ScrollStateCallbacks: m,
  294. fracs: function(e, t) {
  295. return h.of(e, t)
  296. }
  297. },
  298. methods: {
  299. content: function(e) {
  300. return this.length ? c.ofContent(this[0], e) : null
  301. },
  302. envelope: function() {
  303. return e(this, function(e) {
  304. var t = c.ofElement(this);
  305. return e ? e.envelope(t) : t
  306. })
  307. },
  308. fracs: function(e, i, n) {
  309. o(e, "string") || (n = i,
  310. i = e,
  311. e = null),
  312. E(i) || (n = i,
  313. i = null),
  314. n = l(n);
  315. var r = U + ".fracs." + T(n);
  316. return "unbind" === e ? this.each(function() {
  317. var e = y(this).data(r);
  318. e && e.unbind(i)
  319. }) : "check" === e ? this.each(function() {
  320. var e = y(this).data(r);
  321. e && e.check()
  322. }) : E(i) ? this.each(function() {
  323. var e = y(this)
  324. , t = e.data(r);
  325. t || (t = new f(this,n),
  326. e.data(r, t)),
  327. t.bind(i)
  328. }) : this.length ? h.of(this[0], n) : null
  329. },
  330. intersection: function() {
  331. return e(this, function(e) {
  332. var t = c.ofElement(this);
  333. return e ? e.intersection(t) : t
  334. })
  335. },
  336. max: function(e, t, i) {
  337. return E(t) || (i = t,
  338. t = null),
  339. i = l(i),
  340. t ? (new g(this,i,e,!0).bind(t),
  341. this) : this.pushStack(new r(this,i).best(e, !0).el)
  342. },
  343. min: function(e, t, i) {
  344. return E(t) || (i = t,
  345. t = null),
  346. i = l(i),
  347. t ? (new g(this,i,e).bind(t),
  348. this) : this.pushStack(new r(this,i).best(e).el)
  349. },
  350. rect: function() {
  351. return this.length ? c.ofElement(this[0]) : null
  352. },
  353. scrollState: function(e, i) {
  354. var n = U + ".scrollState";
  355. return o(e, "string") || (i = e,
  356. e = null),
  357. "unbind" === e ? this.each(function() {
  358. var e = y(this).data(n);
  359. e && e.unbind(i)
  360. }) : "check" === e ? this.each(function() {
  361. var e = y(this).data(n);
  362. e && e.check()
  363. }) : E(i) ? this.each(function() {
  364. var e = y(this)
  365. , t = e.data(n);
  366. t || (t = new m(this),
  367. e.data(n, t)),
  368. t.bind(i)
  369. }) : this.length ? new d(this[0]) : null
  370. },
  371. scroll: function(e, t, i) {
  372. return this.each(function() {
  373. new p(this).scroll(e, t, i)
  374. })
  375. },
  376. scrollTo: function(e, t, i, n) {
  377. return y.isNumeric(e) && (n = i,
  378. i = t,
  379. t = e,
  380. e = null),
  381. e = l(e),
  382. this.each(function() {
  383. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  384. })
  385. },
  386. scrollToThis: function(e, t, i, n) {
  387. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  388. this
  389. },
  390. softLink: function(t, i, n, r) {
  391. return r = new p(l(r)),
  392. this.filter("a[href^=#]").each(function() {
  393. var e = y(this);
  394. e.on("click", function() {
  395. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  396. })
  397. })
  398. },
  399. sort: function(e, t, i) {
  400. return o(t, "boolean") || (i = t,
  401. t = null),
  402. i = l(i),
  403. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  404. return e.el
  405. }))
  406. },
  407. viewport: function(e) {
  408. return this.length ? c.ofViewport(this[0], e) : null
  409. }
  410. },
  411. defaultStatic: "fracs",
  412. defaultMethod: "fracs"
  413. },
  414. O = [].slice,
  415. L = jQuery,
  416. D = L.extend,
  417. N = L.isFunction,
  418. F = D({}, P),
  419. B = function() {
  420. return H(this, O.call(arguments), F.defaultStatic, B)
  421. }
  422. ,
  423. V = function(e) {
  424. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  425. }
  426. ,
  427. (k = function(e) {
  428. e && (D(B, e.statics),
  429. D(V, e.methods)),
  430. B.modplug = k
  431. }
  432. ).prev = {
  433. statics: L[R],
  434. methods: L.fn[R]
  435. },
  436. k(P),
  437. L[R] = B,
  438. L.fn[R] = V
  439. }(),
  440. "undefined" == typeof jQuery)
  441. throw new Error("Bootstrap's JavaScript requires jQuery");
  442. !function(m) {
  443. "use strict";
  444. function r(e, t) {
  445. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  446. this.init("tooltip", e, t)
  447. }
  448. r.VERSION = "3.2.0",
  449. r.DEFAULTS = {
  450. animation: !0,
  451. placement: "top",
  452. selector: !1,
  453. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  454. trigger: "hover focus",
  455. title: "",
  456. delay: 0,
  457. html: !1,
  458. container: !1,
  459. viewport: {
  460. selector: "body",
  461. padding: 0
  462. }
  463. },
  464. r.prototype.init = function(e, t, i) {
  465. this.enabled = !0,
  466. this.type = e,
  467. this.$element = m(t),
  468. this.options = this.getOptions(i),
  469. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  470. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  471. var o = n[r];
  472. if ("click" == o)
  473. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  474. else if ("manual" != o) {
  475. var a = "hover" == o ? "mouseenter" : "focusin"
  476. , s = "hover" == o ? "mouseleave" : "focusout";
  477. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  478. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  479. }
  480. }
  481. this.options.selector ? this._options = m.extend({}, this.options, {
  482. trigger: "manual",
  483. selector: ""
  484. }) : this.fixTitle()
  485. }
  486. ,
  487. r.prototype.getDefaults = function() {
  488. return r.DEFAULTS
  489. }
  490. ,
  491. r.prototype.getOptions = function(e) {
  492. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  493. show: e.delay,
  494. hide: e.delay
  495. }),
  496. e
  497. }
  498. ,
  499. r.prototype.getDelegateOptions = function() {
  500. var i = {}
  501. , n = this.getDefaults();
  502. return this._options && m.each(this._options, function(e, t) {
  503. n[e] != t && (i[e] = t)
  504. }),
  505. i
  506. }
  507. ,
  508. r.prototype.enter = function(e) {
  509. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  510. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  511. m(e.currentTarget).data("bs." + this.type, t)),
  512. clearTimeout(t.timeout),
  513. t.hoverState = "in",
  514. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  515. }
  516. ,
  517. r.prototype.leave = function(e) {
  518. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  519. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  520. m(e.currentTarget).data("bs." + this.type, t)),
  521. clearTimeout(t.timeout),
  522. t.hoverState = "out",
  523. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  524. "out" == t.hoverState && t.hide()
  525. }, t.options.delay.hide)) : t.hide()
  526. }
  527. ,
  528. r.prototype.show = function() {
  529. var e = m.Event("show.bs." + this.type);
  530. if (this.hasContent() && this.enabled) {
  531. this.$element.trigger(e);
  532. var t = m.contains(document.documentElement, this.$element[0]);
  533. if (e.isDefaultPrevented() || !t)
  534. return;
  535. var i = this
  536. , n = this.tip()
  537. , r = this.getUID(this.type);
  538. this.setContent(),
  539. n.attr("id", r),
  540. this.$element.attr("aria-describedby", r),
  541. this.options.animation && n.addClass("fade");
  542. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  543. , a = /\s?auto?\s?/i
  544. , s = a.test(o);
  545. s && (o = o.replace(a, "") || "top"),
  546. n.detach().css({
  547. top: 0,
  548. left: 0,
  549. display: "block"
  550. }).addClass(o).data("bs." + this.type, this),
  551. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  552. var l = this.getPosition()
  553. , c = n[0].offsetWidth
  554. , h = n[0].offsetHeight;
  555. if (s) {
  556. var u = o
  557. , d = this.$element.parent()
  558. , p = this.getPosition(d);
  559. 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,
  560. n.removeClass(u).addClass(o)
  561. }
  562. var f = this.getCalculatedOffset(o, l, c, h);
  563. this.applyPlacement(f, o);
  564. var g = function() {
  565. i.$element.trigger("shown.bs." + i.type),
  566. i.hoverState = null
  567. };
  568. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  569. }
  570. }
  571. ,
  572. r.prototype.applyPlacement = function(e, t) {
  573. var i = this.tip()
  574. , n = i[0].offsetWidth
  575. , r = i[0].offsetHeight
  576. , o = parseInt(i.css("margin-top"), 10)
  577. , a = parseInt(i.css("margin-left"), 10);
  578. isNaN(o) && (o = 0),
  579. isNaN(a) && (a = 0),
  580. e.top = e.top + o,
  581. e.left = e.left + a,
  582. m.offset.setOffset(i[0], m.extend({
  583. using: function(e) {
  584. i.css({
  585. top: Math.round(e.top),
  586. left: Math.round(e.left)
  587. })
  588. }
  589. }, e), 0),
  590. i.addClass("in");
  591. var s = i[0].offsetWidth
  592. , l = i[0].offsetHeight;
  593. "top" == t && l != r && (e.top = e.top + r - l);
  594. var c = this.getViewportAdjustedDelta(t, e, s, l);
  595. c.left ? e.left += c.left : e.top += c.top;
  596. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  597. , u = c.left ? "left" : "top"
  598. , d = c.left ? "offsetWidth" : "offsetHeight";
  599. i.offset(e),
  600. this.replaceArrow(h, i[0][d], u)
  601. }
  602. ,
  603. r.prototype.replaceArrow = function(e, t, i) {
  604. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  605. }
  606. ,
  607. r.prototype.setContent = function() {
  608. var e = this.tip()
  609. , t = this.getTitle();
  610. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  611. e.removeClass("fade in top bottom left right")
  612. }
  613. ,
  614. r.prototype.hide = function() {
  615. function e() {
  616. "in" != t.hoverState && i.detach(),
  617. t.$element.trigger("hidden.bs." + t.type)
  618. }
  619. var t = this
  620. , i = this.tip()
  621. , n = m.Event("hide.bs." + this.type);
  622. if (this.$element.removeAttr("aria-describedby"),
  623. this.$element.trigger(n),
  624. !n.isDefaultPrevented())
  625. return i.removeClass("in"),
  626. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  627. this.hoverState = null,
  628. this
  629. }
  630. ,
  631. r.prototype.fixTitle = function() {
  632. var e = this.$element;
  633. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  634. }
  635. ,
  636. r.prototype.hasContent = function() {
  637. return this.getTitle()
  638. }
  639. ,
  640. r.prototype.getPosition = function(e) {
  641. var t = (e = e || this.$element)[0]
  642. , i = "BODY" == t.tagName;
  643. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  644. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  645. width: i ? m(window).width() : e.outerWidth(),
  646. height: i ? m(window).height() : e.outerHeight()
  647. }, i ? {
  648. top: 0,
  649. left: 0
  650. } : e.offset())
  651. }
  652. ,
  653. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  654. return "bottom" == e ? {
  655. top: t.top + t.height,
  656. left: t.left + t.width / 2 - i / 2
  657. } : "top" == e ? {
  658. top: t.top - n,
  659. left: t.left + t.width / 2 - i / 2
  660. } : "left" == e ? {
  661. top: t.top + t.height / 2 - n / 2,
  662. left: t.left - i
  663. } : {
  664. top: t.top + t.height / 2 - n / 2,
  665. left: t.left + t.width
  666. }
  667. }
  668. ,
  669. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  670. var r = {
  671. top: 0,
  672. left: 0
  673. };
  674. if (!this.$viewport)
  675. return r;
  676. var o = this.options.viewport && this.options.viewport.padding || 0
  677. , a = this.getPosition(this.$viewport);
  678. if (/right|left/.test(e)) {
  679. var s = t.top - o - a.scroll
  680. , l = t.top + o - a.scroll + n;
  681. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  682. } else {
  683. var c = t.left - o
  684. , h = t.left + o + i;
  685. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  686. }
  687. return r
  688. }
  689. ,
  690. r.prototype.getTitle = function() {
  691. var e = this.$element
  692. , t = this.options;
  693. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  694. }
  695. ,
  696. r.prototype.getUID = function(e) {
  697. for (; e += ~~(1e6 * Math.random()),
  698. document.getElementById(e); )
  699. ;
  700. return e
  701. }
  702. ,
  703. r.prototype.tip = function() {
  704. return this.$tip = this.$tip || m(this.options.template)
  705. }
  706. ,
  707. r.prototype.arrow = function() {
  708. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  709. }
  710. ,
  711. r.prototype.validate = function() {
  712. this.$element[0].parentNode || (this.hide(),
  713. this.$element = null,
  714. this.options = null)
  715. }
  716. ,
  717. r.prototype.enable = function() {
  718. this.enabled = !0
  719. }
  720. ,
  721. r.prototype.disable = function() {
  722. this.enabled = !1
  723. }
  724. ,
  725. r.prototype.toggleEnabled = function() {
  726. this.enabled = !this.enabled
  727. }
  728. ,
  729. r.prototype.toggle = function(e) {
  730. var t = this;
  731. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  732. m(e.currentTarget).data("bs." + this.type, t))),
  733. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  734. }
  735. ,
  736. r.prototype.destroy = function() {
  737. clearTimeout(this.timeout),
  738. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  739. }
  740. ;
  741. var e = m.fn.tooltip;
  742. m.fn.tooltip = function(n) {
  743. return this.each(function() {
  744. var e = m(this)
  745. , t = e.data("bs.tooltip")
  746. , i = "object" == typeof n && n;
  747. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  748. "string" == typeof n && t[n]())
  749. })
  750. }
  751. ,
  752. m.fn.tooltip.Constructor = r,
  753. m.fn.tooltip.noConflict = function() {
  754. return m.fn.tooltip = e,
  755. this
  756. }
  757. }(jQuery),
  758. function(e, t, i) {
  759. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  760. }(0, this, function() {
  761. "use strict";
  762. function Keen() {
  763. return _init.apply(this, arguments)
  764. }
  765. function _init(e) {
  766. if (_isUndefined(e))
  767. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  768. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  769. throw new Error("Please provide a projectId");
  770. this.configure(e)
  771. }
  772. function _extend(e) {
  773. for (var t = 1; t < arguments.length; t++)
  774. for (var i in arguments[t])
  775. e[i] = arguments[t][i];
  776. return e
  777. }
  778. function _isUndefined(e) {
  779. return void 0 === e
  780. }
  781. function _type(e) {
  782. var t = e && e.constructor ? e.constructor.toString() : void 0;
  783. return t ? t.match(/function (.*)\(/)[1] : "Null"
  784. }
  785. function _each(e, t, i) {
  786. var n;
  787. if (!e)
  788. return 0;
  789. if (i = i || e,
  790. "array" === _type(e)) {
  791. for (n = 0; n < e.length; n++)
  792. if (!1 === t.call(i, e[n], n, e))
  793. return 0
  794. } else
  795. for (n in e)
  796. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  797. return 0;
  798. return 1
  799. }
  800. function _parse_params(e) {
  801. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  802. return decodeURIComponent(e.replace(n, " "))
  803. }, a = e.split("?")[1]; t = r.exec(a); )
  804. i[o(t[1])] = o(t[2]);
  805. return i
  806. }
  807. function _set_protocol(e) {
  808. switch (e) {
  809. case "http":
  810. return "http";
  811. case "auto":
  812. return location.protocol.replace(/:/g, "");
  813. case "https":
  814. case void 0:
  815. default:
  816. return "https"
  817. }
  818. }
  819. function _set_request_type(e) {
  820. var t = e || "jsonp"
  821. , i = !1;
  822. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  823. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  824. }
  825. function _build_url(e) {
  826. return this.client.endpoint + "/projects/" + this.client.projectId + e
  827. }
  828. function _uploadEvent(e, t, i, n, r) {
  829. var o = _build_url.apply(this, ["/events/" + e])
  830. , a = {};
  831. for (var s in i = !1 !== i,
  832. this.client.globalProperties && (a = this.client.globalProperties(e)),
  833. t)
  834. t.hasOwnProperty(s) && (a[s] = t[s]);
  835. switch (this.client.requestType) {
  836. case "xhr":
  837. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  838. break;
  839. case "jsonp":
  840. var l = JSON.stringify(a)
  841. , c = Keen.Base64.encode(l);
  842. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  843. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  844. break;
  845. case "beacon":
  846. l = JSON.stringify(a),
  847. c = Keen.Base64.encode(l);
  848. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  849. o += "&c=clv1",
  850. _request.beacon.apply(this, [o, null, n, r])
  851. }
  852. }
  853. Keen.prototype.configure = function(e) {
  854. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  855. e.protocol = _set_protocol(e.protocol),
  856. e.requestType = _set_request_type(e.requestType),
  857. this.client = {
  858. projectId: e.projectId,
  859. writeKey: e.writeKey,
  860. readKey: e.readKey,
  861. globalProperties: null,
  862. endpoint: e.protocol + "://" + e.host,
  863. requestType: e.requestType
  864. },
  865. Keen.trigger("client", this, e),
  866. this.trigger("ready"),
  867. this
  868. }
  869. ;
  870. var _request = {
  871. xhr: function(e, t, i, n, r, o, a, s) {
  872. if (!r)
  873. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  874. var l = new XMLHttpRequest;
  875. if (l.onreadystatechange = function() {
  876. if (4 == l.readyState)
  877. if (200 <= l.status && l.status < 300) {
  878. var e;
  879. try {
  880. e = JSON.parse(l.responseText)
  881. } catch (e) {
  882. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  883. s && s(l, e)
  884. }
  885. a && e && a(e)
  886. } else
  887. Keen.log("HTTP request failed."),
  888. s && s(l, null)
  889. }
  890. ,
  891. l.open(e, t, o),
  892. r && l.setRequestHeader("Authorization", r),
  893. n && l.setRequestHeader("Content-Type", "application/json"),
  894. i)
  895. for (var c in i)
  896. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  897. var h = n ? JSON.stringify(n) : null;
  898. l.send(h)
  899. },
  900. jsonp: function(e, t, i, n) {
  901. if (!t)
  902. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  903. if (t && e.indexOf("api_key") < 0) {
  904. var r = 0 < e.indexOf("?") ? "&" : "?";
  905. e = e + r + "api_key=" + t
  906. }
  907. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  908. o += "a";
  909. var a = !1;
  910. window[o] = function(e) {
  911. a = !0,
  912. i && e && i(e),
  913. window[o] = void 0
  914. }
  915. ,
  916. e = e + "&jsonp=" + o;
  917. var s = document.createElement("script");
  918. s.id = "keen-jsonp",
  919. s.src = e,
  920. document.getElementsByTagName("head")[0].appendChild(s),
  921. s.onreadystatechange = function() {
  922. !1 === a && "loaded" === this.readyState && (a = !0,
  923. n && n())
  924. }
  925. ,
  926. s.onerror = function() {
  927. !1 === a && (a = !0,
  928. n && n())
  929. }
  930. },
  931. beacon: function(e, t, i, n) {
  932. if (t && e.indexOf("api_key") < 0) {
  933. var r = 0 < e.indexOf("?") ? "&" : "?";
  934. e = e + r + "api_key=" + t
  935. }
  936. var o = document.createElement("img");
  937. o.onload = function() {
  938. if (!0,
  939. "naturalHeight"in this) {
  940. if (this.naturalHeight + this.naturalWidth === 0)
  941. return void this.onerror()
  942. } else if (this.width + this.height === 0)
  943. return void this.onerror();
  944. i && i({
  945. created: !0
  946. })
  947. }
  948. ,
  949. o.onerror = function() {
  950. !0,
  951. n && n()
  952. }
  953. ,
  954. o.src = e
  955. }
  956. }
  957. , Events = Keen.Events = {
  958. on: function(e, t) {
  959. return this.listeners || (this.listeners = {}),
  960. (this.listeners[e] || (this.listeners[e] = [])).push({
  961. callback: t
  962. }),
  963. this
  964. },
  965. off: function(e, t) {
  966. if (!e && !t)
  967. return this.listeners = void 0,
  968. delete this.listeners,
  969. this;
  970. for (var i = this.listeners[e] || [], n = i.length; n--; )
  971. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  972. t && 0 != i.length || (this.listeners[e] = void 0,
  973. delete this.listeners[e]);
  974. return this
  975. },
  976. trigger: function(e) {
  977. if (!this.listeners)
  978. return this;
  979. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  980. i[n].callback.apply(this, t);
  981. return this
  982. }
  983. };
  984. _extend(Keen.prototype, Events),
  985. _extend(Keen, Events),
  986. Keen.loaded = !0,
  987. Keen.utils = {
  988. each: _each,
  989. extend: _extend,
  990. parseParams: _parse_params
  991. },
  992. Keen.ready = function(e) {
  993. Keen.loaded ? e() : Keen.on("ready", e)
  994. }
  995. ,
  996. Keen.log = function(e) {
  997. "object" == typeof console && console.log("[Keen IO]", e)
  998. }
  999. ;
  1000. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1001. Keen.prototype.addEvent = function() {
  1002. _uploadEvent.apply(this, arguments)
  1003. }
  1004. ,
  1005. Keen.prototype.addEventSync = function(e, t, i, n) {
  1006. _uploadEvent.apply(this, [e, t, !1, i, n])
  1007. }
  1008. ,
  1009. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1010. var o = e
  1011. , a = o.metaKey
  1012. , s = o.target
  1013. , l = !1
  1014. , c = function() {};
  1015. return void 0 === n && (n = 500),
  1016. "A" === s.nodeName ? c = function() {
  1017. a || l || (l = !0,
  1018. window.location = s.href)
  1019. }
  1020. : "FORM" === s.nodeName && (c = function() {
  1021. l || (l = !0,
  1022. s.submit())
  1023. }
  1024. ),
  1025. r && (c = function() {
  1026. l || (l = !0,
  1027. r())
  1028. }
  1029. ),
  1030. _uploadEvent.call(this, t, i, c, c),
  1031. setTimeout(function() {
  1032. c()
  1033. }, n),
  1034. !!a && void 0
  1035. }
  1036. ,
  1037. Keen.prototype.setGlobalProperties = function(e) {
  1038. if (!this.client)
  1039. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1040. if (!e || "function" != typeof e)
  1041. throw new Error("Invalid value for global properties: " + e);
  1042. this.client.globalProperties = e
  1043. }
  1044. ,
  1045. Keen.Base64 = {
  1046. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1047. encode: function(e) {
  1048. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1049. for (e = this.utf8.encode(e); c < e.length; )
  1050. t = e.charCodeAt(c++),
  1051. i = e.charCodeAt(c++),
  1052. n = e.charCodeAt(c++),
  1053. r = t >> 2,
  1054. o = (3 & t) << 4 | i >> 4,
  1055. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1056. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1057. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1058. return l
  1059. },
  1060. decode: function(e) {
  1061. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1062. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1063. t = c.indexOf(e.charAt(l++)),
  1064. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1065. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1066. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1067. return this.utf8.decode(s)
  1068. },
  1069. utf8: {
  1070. encode: function(e) {
  1071. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1072. 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);
  1073. return i
  1074. },
  1075. decode: function(e) {
  1076. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1077. 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];
  1078. return i
  1079. }
  1080. }
  1081. },
  1082. "object" != typeof JSON && (JSON = {}),
  1083. function() {
  1084. function f(e) {
  1085. return e < 10 ? "0" + e : e
  1086. }
  1087. function quote(e) {
  1088. return escapable.lastIndex = 0,
  1089. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1090. var t = meta[e];
  1091. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1092. }) + '"' : '"' + e + '"'
  1093. }
  1094. function str(e, t) {
  1095. var i, n, r, o, a, s = gap, l = t[e];
  1096. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1097. "function" == typeof rep && (l = rep.call(t, e, l)),
  1098. typeof l) {
  1099. case "string":
  1100. return quote(l);
  1101. case "number":
  1102. return isFinite(l) ? String(l) : "null";
  1103. case "boolean":
  1104. case "null":
  1105. return String(l);
  1106. case "object":
  1107. if (!l)
  1108. return "null";
  1109. if (gap += indent,
  1110. a = [],
  1111. "[object Array]" === Object.prototype.toString.apply(l)) {
  1112. for (o = l.length,
  1113. i = 0; i < o; i += 1)
  1114. a[i] = str(i, l) || "null";
  1115. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1116. gap = s,
  1117. r
  1118. }
  1119. if (rep && "object" == typeof rep)
  1120. for (o = rep.length,
  1121. i = 0; i < o; i += 1)
  1122. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1123. else
  1124. for (n in l)
  1125. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1126. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1127. gap = s,
  1128. r
  1129. }
  1130. }
  1131. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1132. 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
  1133. }
  1134. ,
  1135. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1136. return this.valueOf()
  1137. }
  1138. );
  1139. 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 = {
  1140. "\b": "\\b",
  1141. "\t": "\\t",
  1142. "\n": "\\n",
  1143. "\f": "\\f",
  1144. "\r": "\\r",
  1145. '"': '\\"',
  1146. "\\": "\\\\"
  1147. }, rep;
  1148. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1149. var n;
  1150. if (indent = gap = "",
  1151. "number" == typeof i)
  1152. for (n = 0; n < i; n += 1)
  1153. indent += " ";
  1154. else
  1155. "string" == typeof i && (indent = i);
  1156. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1157. throw new Error("JSON.stringify");
  1158. return str("", {
  1159. "": e
  1160. })
  1161. }
  1162. ),
  1163. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1164. function walk(e, t) {
  1165. var i, n, r = e[t];
  1166. if (r && "object" == typeof r)
  1167. for (i in r)
  1168. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1169. return reviver.call(e, t, r)
  1170. }
  1171. var j;
  1172. if (text = String(text),
  1173. cx.lastIndex = 0,
  1174. cx.test(text) && (text = text.replace(cx, function(e) {
  1175. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1176. })),
  1177. /^[\],:{}\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, "")))
  1178. return j = eval("(" + text + ")"),
  1179. "function" == typeof reviver ? walk({
  1180. "": j
  1181. }, "") : j;
  1182. throw new SyntaxError("JSON.parse")
  1183. }
  1184. )
  1185. }(),
  1186. Hh = Keen.utils,
  1187. Ih = function(i) {
  1188. function e(e) {
  1189. for (u = 1; e = n.shift(); )
  1190. e()
  1191. }
  1192. 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]);
  1193. return r[l] && r[l](s, t = function() {
  1194. r.removeEventListener(s, t, !1),
  1195. e()
  1196. }
  1197. , !1),
  1198. a && r.attachEvent(c, t = function() {
  1199. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1200. e())
  1201. }
  1202. ),
  1203. i = a ? function(t) {
  1204. self != top ? u ? t() : n.push(t) : function() {
  1205. try {
  1206. o.doScroll("left")
  1207. } catch (e) {
  1208. return setTimeout(function() {
  1209. i(t)
  1210. }, 50)
  1211. }
  1212. t()
  1213. }()
  1214. }
  1215. : function(e) {
  1216. u ? e() : n.push(e)
  1217. }
  1218. }
  1219. ,
  1220. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1221. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1222. if (loaded && cached) {
  1223. for (var instance in clients = cached.clients || {},
  1224. ready = cached.ready || [],
  1225. clients)
  1226. if (clients.hasOwnProperty(instance)) {
  1227. var client = clients[instance];
  1228. for (var method in Keen.prototype)
  1229. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1230. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1231. ,
  1232. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1233. ,
  1234. client._config && (client.configure.call(client, client._config),
  1235. delete client._config),
  1236. client._setGlobalProperties) {
  1237. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1238. client.setGlobalProperties.apply(client, globals[i]);
  1239. delete client._setGlobalProperties
  1240. }
  1241. if (client._addEvent) {
  1242. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1243. client.addEvent.apply(client, queue[i]);
  1244. delete client._addEvent
  1245. }
  1246. var callback = client._on || [];
  1247. if (client._on) {
  1248. for (var i = 0; i < callback.length; i++)
  1249. client.on.apply(client, callback[i]);
  1250. client.trigger("ready"),
  1251. delete client._on
  1252. }
  1253. }
  1254. for (var i = 0; i < ready.length; i++) {
  1255. var callback = ready[i];
  1256. Keen.on("ready", function() {
  1257. callback()
  1258. })
  1259. }
  1260. }
  1261. return Keen.loaded && setTimeout(function() {
  1262. Keen.utils.domready(function() {
  1263. Keen.trigger("ready")
  1264. })
  1265. }, 0),
  1266. Keen
  1267. }),
  1268. function() {
  1269. var i = window.analytics = window.analytics || [];
  1270. if (!i.initialize) {
  1271. if (i.invoked)
  1272. return window.console && console.error && console.error("Segment snippet included twice.");
  1273. i.invoked = !0,
  1274. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1275. i.factory = function(t) {
  1276. return function() {
  1277. var e = Array.prototype.slice.call(arguments);
  1278. return e.unshift(t),
  1279. i.push(e),
  1280. i
  1281. }
  1282. }
  1283. ;
  1284. for (var e = 0; e < i.methods.length; e++) {
  1285. var t = i.methods[e];
  1286. i[t] = i.factory(t)
  1287. }
  1288. i.load = function(e) {
  1289. var t = document.createElement("script");
  1290. t.type = "text/javascript",
  1291. t.async = !0,
  1292. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1293. var i = document.getElementsByTagName("script")[0];
  1294. i.parentNode.insertBefore(t, i)
  1295. }
  1296. ,
  1297. i.SNIPPET_VERSION = "4.0.0"
  1298. }
  1299. }(),
  1300. function(i, u) {
  1301. "use strict";
  1302. var d = "function"
  1303. , p = "undefined"
  1304. , f = "object"
  1305. , e = "major"
  1306. , t = "model"
  1307. , n = "name"
  1308. , r = "type"
  1309. , o = "vendor"
  1310. , a = "version"
  1311. , s = "architecture"
  1312. , l = "console"
  1313. , c = "mobile"
  1314. , h = "tablet"
  1315. , g = {
  1316. has: function(e, t) {
  1317. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1318. },
  1319. lowerize: function(e) {
  1320. return e.toLowerCase()
  1321. }
  1322. }
  1323. , m = {
  1324. rgx: function() {
  1325. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1326. var c = l[s]
  1327. , h = l[s + 1];
  1328. if (typeof e == p)
  1329. for (n in e = {},
  1330. h)
  1331. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1332. for (t = i = 0; t < c.length; t++)
  1333. if (o = c[t].exec(this.getUA())) {
  1334. for (n = 0; n < h.length; n++)
  1335. a = o[++i],
  1336. 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;
  1337. break
  1338. }
  1339. if (o)
  1340. break
  1341. }
  1342. return e
  1343. },
  1344. str: function(e, t) {
  1345. for (var i in t)
  1346. if (typeof t[i] == f && 0 < t[i].length) {
  1347. for (var n = 0; n < t[i].length; n++)
  1348. if (g.has(t[i][n], e))
  1349. return "?" === i ? u : i
  1350. } else if (g.has(t[i], e))
  1351. return "?" === i ? u : i;
  1352. return e
  1353. }
  1354. }
  1355. , v = {
  1356. browser: {
  1357. oldsafari: {
  1358. major: {
  1359. 1: ["/8", "/1", "/3"],
  1360. 2: "/4",
  1361. "?": "/"
  1362. },
  1363. version: {
  1364. "1.0": "/8",
  1365. 1.2: "/1",
  1366. 1.3: "/3",
  1367. "2.0": "/412",
  1368. "2.0.2": "/416",
  1369. "2.0.3": "/417",
  1370. "2.0.4": "/419",
  1371. "?": "/"
  1372. }
  1373. }
  1374. },
  1375. device: {
  1376. sprint: {
  1377. model: {
  1378. "Evo Shift 4G": "7373KT"
  1379. },
  1380. vendor: {
  1381. HTC: "APA",
  1382. Sprint: "Sprint"
  1383. }
  1384. }
  1385. },
  1386. os: {
  1387. windows: {
  1388. version: {
  1389. ME: "4.90",
  1390. "NT 3.11": "NT3.51",
  1391. "NT 4.0": "NT4.0",
  1392. 2e3: "NT 5.0",
  1393. XP: ["NT 5.1", "NT 5.2"],
  1394. Vista: "NT 6.0",
  1395. 7: "NT 6.1",
  1396. 8: "NT 6.2",
  1397. 8.1: "NT 6.3",
  1398. RT: "ARM"
  1399. }
  1400. }
  1401. }
  1402. }
  1403. , y = {
  1404. 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]],
  1405. 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]],
  1406. 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]],
  1407. 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]],
  1408. 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]]
  1409. }
  1410. , A = function(e) {
  1411. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1412. return this instanceof A ? (this.getBrowser = function() {
  1413. return m.rgx.apply(this, y.browser)
  1414. }
  1415. ,
  1416. this.getCPU = function() {
  1417. return m.rgx.apply(this, y.cpu)
  1418. }
  1419. ,
  1420. this.getDevice = function() {
  1421. return m.rgx.apply(this, y.device)
  1422. }
  1423. ,
  1424. this.getEngine = function() {
  1425. return m.rgx.apply(this, y.engine)
  1426. }
  1427. ,
  1428. this.getOS = function() {
  1429. return m.rgx.apply(this, y.os)
  1430. }
  1431. ,
  1432. this.getResult = function() {
  1433. return {
  1434. ua: this.getUA(),
  1435. browser: this.getBrowser(),
  1436. engine: this.getEngine(),
  1437. os: this.getOS(),
  1438. device: this.getDevice(),
  1439. cpu: this.getCPU()
  1440. }
  1441. }
  1442. ,
  1443. this.getUA = function() {
  1444. return t
  1445. }
  1446. ,
  1447. this.setUA = function(e) {
  1448. return t = e,
  1449. this
  1450. }
  1451. ,
  1452. void this.setUA(t)) : new A(e).getResult()
  1453. };
  1454. if (typeof exports != p)
  1455. typeof module != p && module.exports && (exports = module.exports = A),
  1456. exports.UAParser = A;
  1457. else if (i.UAParser = A,
  1458. typeof define == d && define.amd && define(function() {
  1459. return A
  1460. }),
  1461. typeof i.jQuery != p) {
  1462. var C = i.jQuery
  1463. , I = new A;
  1464. C.ua = I.getResult(),
  1465. C.ua.get = function() {
  1466. return I.getUA()
  1467. }
  1468. ,
  1469. C.ua.set = function(e) {
  1470. I.setUA(e);
  1471. var t = I.getResult();
  1472. for (var i in t)
  1473. C.ua[i] = t[i]
  1474. }
  1475. }
  1476. }(this),
  1477. window.Modernizr = function(e, t) {
  1478. function i(e, t) {
  1479. return typeof e === t
  1480. }
  1481. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1482. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1483. return t in e && i(e.constructor.prototype[t], "undefined")
  1484. }
  1485. : function(e, t) {
  1486. return p.call(e, t)
  1487. }
  1488. ,
  1489. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1490. var r = this;
  1491. if ("function" != typeof r)
  1492. throw new TypeError;
  1493. var o = d.call(arguments, 1)
  1494. , a = function() {
  1495. if (this instanceof a) {
  1496. function e() {}
  1497. e.prototype = r.prototype;
  1498. var t = new e
  1499. , i = r.apply(t, o.concat(d.call(arguments)));
  1500. return Object(i) === i ? i : t
  1501. }
  1502. return r.apply(n, o.concat(d.call(arguments)))
  1503. };
  1504. return a
  1505. }
  1506. ),
  1507. h.webgl = function() {
  1508. return !!e.WebGLRenderingContext
  1509. }
  1510. ,
  1511. h)
  1512. r(h, f) && (n = f.toLowerCase(),
  1513. a[n] = h[f](),
  1514. u.push((a[n] ? "" : "no-") + n));
  1515. return a.addTest = function(e, t) {
  1516. if ("object" == typeof e)
  1517. for (var i in e)
  1518. r(e, i) && a.addTest(i, e[i]);
  1519. else {
  1520. if (e = e.toLowerCase(),
  1521. void 0 !== a[e])
  1522. return a;
  1523. t = "function" == typeof t ? t() : t,
  1524. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1525. a[e] = t
  1526. }
  1527. return a
  1528. }
  1529. ,
  1530. o = "",
  1531. c.cssText = o,
  1532. l = null,
  1533. a._version = "2.8.2",
  1534. a
  1535. }(this, this.document),
  1536. function(xe, e, Se) {
  1537. "use strict";
  1538. function Me(s, e, n) {
  1539. function a(e) {
  1540. var t = Q.length;
  1541. if (G.old = xe.extend({}, G),
  1542. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1543. Y = W[F.horizontal ? "width" : "height"](),
  1544. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1545. Q.length = 0,
  1546. G.start = 0,
  1547. G.end = nt(z - H, 0),
  1548. le) {
  1549. $.length,
  1550. J = U.children(F.itemSelector),
  1551. $.length = 0;
  1552. 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;
  1553. z = 0,
  1554. J.each(function(e, t) {
  1555. var i = xe(t)
  1556. , n = t.getBoundingClientRect()
  1557. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1558. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1559. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1560. , s = r + o + a
  1561. , l = !o || !a
  1562. , c = {};
  1563. c.el = t,
  1564. c.size = l ? r : s,
  1565. c.half = c.size / 2,
  1566. c.start = z + (l ? o : 0),
  1567. c.center = c.start - it(H / 2 - c.size / 2),
  1568. c.end = c.start - H + c.size,
  1569. e || (z += u),
  1570. z += s,
  1571. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1572. e === g && (c.end += d,
  1573. z += d,
  1574. f = l ? a : 0),
  1575. $.push(c),
  1576. h = c
  1577. }),
  1578. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1579. z -= f,
  1580. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1581. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1582. }
  1583. if (G.center = it(G.end / 2 + G.start / 2),
  1584. v(),
  1585. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1586. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1587. X.end = Y - q,
  1588. _e || c()),
  1589. !V && 0 < H) {
  1590. var n = G.start
  1591. , r = "";
  1592. if (le)
  1593. xe.each($, function(e, t) {
  1594. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1595. Q.push(n),
  1596. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1597. });
  1598. else
  1599. for (; n - H < G.end; )
  1600. Q.push(n),
  1601. n += H;
  1602. if (Z[0] && t !== Q.length) {
  1603. for (var o = 0; o < Q.length; o++)
  1604. r += F.pageBuilder.call(B, o);
  1605. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1606. }
  1607. }
  1608. if (ee.slideeSize = z,
  1609. ee.frameSize = H,
  1610. ee.sbSize = Y,
  1611. ee.handleSize = q,
  1612. le) {
  1613. e && null != F.startAt && (m(F.startAt),
  1614. B[se ? "toCenter" : "toStart"](F.startAt));
  1615. var a = $[ee.activeItem];
  1616. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1617. } else
  1618. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1619. L("load")
  1620. }
  1621. function l(e, t, i) {
  1622. if (le && Ie.released && !i) {
  1623. var n = d(e)
  1624. , r = e > G.start && e < G.end;
  1625. se ? (r && (e = $[n.centerItem].center),
  1626. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1627. }
  1628. 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),
  1629. Ae.start = +new Date,
  1630. Ae.time = 0,
  1631. Ae.from = G.cur,
  1632. Ae.to = e,
  1633. Ae.delta = e - G.cur,
  1634. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1635. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1636. Ie.tweese = 0,
  1637. e !== G.dest && (G.dest = e,
  1638. L("change"),
  1639. _e || o()),
  1640. g(),
  1641. v(),
  1642. p(),
  1643. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1644. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1645. L("activePage", ye.page))
  1646. }
  1647. function o() {
  1648. if (B.initialized) {
  1649. if (!_e)
  1650. return _e = Ge(o),
  1651. void (Ie.released && L("moveStart"));
  1652. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1653. $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),
  1654. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1655. Ae.to === G.cur ? (G.cur = Ae.to,
  1656. Ie.tweese = _e = 0) : _e = Ge(o),
  1657. L("move"),
  1658. 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"),
  1659. !_e && Ie.released && L("moveEnd"),
  1660. c()
  1661. }
  1662. }
  1663. function c() {
  1664. 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,
  1665. X.cur = Fe(it(X.cur), X.start, X.end),
  1666. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1667. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1668. }
  1669. function t() {
  1670. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1671. Te = Ie.init ? Ge(t) : 0,
  1672. Ce.now = +new Date,
  1673. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1674. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1675. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1676. Ce.lastTime = Ce.now
  1677. }
  1678. function i(e, t, i) {
  1679. if ("boolean" === Re(t) && (i = t,
  1680. t = Se),
  1681. t === Se)
  1682. l(G[e], i);
  1683. else {
  1684. if (se && "center" !== e)
  1685. return;
  1686. var n = B.getPos(t);
  1687. n && l(n[e], i, !se)
  1688. }
  1689. }
  1690. function h(e) {
  1691. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1692. }
  1693. function u(e) {
  1694. return h(De(e) && e < 0 ? e + $.length : e)
  1695. }
  1696. function m(e, t) {
  1697. var i = h(e);
  1698. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1699. J.eq(i).addClass(F.activeClass),
  1700. ye.active = ee.activeItem = i,
  1701. p(),
  1702. L("active", i)),
  1703. i)
  1704. }
  1705. function d(e) {
  1706. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1707. var t = {}
  1708. , i = ae ? 0 : H / 2;
  1709. if (!V)
  1710. for (var n = 0, r = Q.length; n < r; n++) {
  1711. if (e >= G.end || n === Q.length - 1) {
  1712. t.activePage = Q.length - 1;
  1713. break
  1714. }
  1715. if (e <= Q[n] + i) {
  1716. t.activePage = n;
  1717. break
  1718. }
  1719. }
  1720. if (le) {
  1721. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1722. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1723. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1724. l === c - 1 || e <= $[l].end + $[l].half) {
  1725. a = l;
  1726. break
  1727. }
  1728. t.firstItem = De(o) ? o : 0,
  1729. t.centerItem = De(s) ? s : t.firstItem,
  1730. t.lastItem = De(a) ? a : t.centerItem
  1731. }
  1732. return t
  1733. }
  1734. function v(e) {
  1735. xe.extend(ee, d(e))
  1736. }
  1737. function p() {
  1738. var e = G.dest <= G.start
  1739. , t = G.dest >= G.end
  1740. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1741. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1742. ge.is("button,input") && ge.prop("disabled", e),
  1743. me.is("button,input") && me.prop("disabled", t),
  1744. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1745. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1746. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1747. de.is("button,input") && de.prop("disabled", e),
  1748. ue.is("button,input") && ue.prop("disabled", t)),
  1749. le && null != ee.activeItem) {
  1750. var n = 0 === ee.activeItem
  1751. , r = ee.activeItem >= $.length - 1
  1752. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1753. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1754. pe.is("button,input") && pe.prop("disabled", n),
  1755. fe.is("button,input") && fe.prop("disabled", r),
  1756. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1757. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1758. }
  1759. }
  1760. function r(e, t, i) {
  1761. if (e = u(e),
  1762. t = u(t),
  1763. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1764. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1765. var n = e < t ? e : i ? t : t - 1
  1766. , r = t < e ? e : i ? t + 1 : t
  1767. , o = t < e;
  1768. 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)),
  1769. a()
  1770. }
  1771. }
  1772. function f(e, t) {
  1773. for (var i = 0, n = ve[e].length; i < n; i++)
  1774. if (ve[e][i] === t)
  1775. return i;
  1776. return -1
  1777. }
  1778. function g() {
  1779. Ie.released && !B.isPaused && B.resume()
  1780. }
  1781. function y(e) {
  1782. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1783. }
  1784. function A() {
  1785. Ie.history[0] = Ie.history[1],
  1786. Ie.history[1] = Ie.history[2],
  1787. Ie.history[2] = Ie.history[3],
  1788. Ie.history[3] = Ie.delta
  1789. }
  1790. function C(e) {
  1791. Ie.released = 0,
  1792. Ie.source = e,
  1793. Ie.slidee = "slidee" === e
  1794. }
  1795. function I(e) {
  1796. var t = "touchstart" === e.type
  1797. , i = e.data.source
  1798. , n = "slidee" === i;
  1799. 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),
  1800. C(i),
  1801. Ie.init = 0,
  1802. Ie.$source = xe(e.target),
  1803. Ie.touch = t,
  1804. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1805. Ie.initX = Ie.pointer.pageX,
  1806. Ie.initY = Ie.pointer.pageY,
  1807. Ie.initPos = n ? G.cur : X.cur,
  1808. Ie.start = +new Date,
  1809. Ie.time = 0,
  1810. Ie.path = 0,
  1811. Ie.delta = 0,
  1812. Ie.locked = 0,
  1813. Ie.history = [0, 0, 0, 0],
  1814. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1815. We.on(t ? qe : Ye, E),
  1816. B.pause(1),
  1817. (n ? U : j).addClass(F.draggedClass),
  1818. L("moveStart"),
  1819. n && (be = setInterval(A, 10)))
  1820. }
  1821. function E(e) {
  1822. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1823. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1824. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1825. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1826. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1827. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1828. Ie.released || !(Ie.path < 1)) {
  1829. if (!Ie.init) {
  1830. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1831. return _();
  1832. Ie.init = 1
  1833. }
  1834. Pe(e),
  1835. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1836. Ie.$source.on(Ze, Oe)),
  1837. Ie.released && (_(),
  1838. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1839. Ie.delta += Ie.swing,
  1840. Ie.tweese = 10 < $e(Ie.swing))),
  1841. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1842. }
  1843. }
  1844. function _() {
  1845. clearInterval(be),
  1846. Ie.released = !0,
  1847. We.off(Ie.touch ? qe : Ye, E),
  1848. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1849. setTimeout(function() {
  1850. Ie.$source.off(Ze, Oe)
  1851. }),
  1852. G.cur === G.dest && Ie.init && L("moveEnd"),
  1853. B.resume(1),
  1854. Ie.init = 0
  1855. }
  1856. function b(e) {
  1857. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1858. }
  1859. function w() {
  1860. B.stop(),
  1861. We.off("mouseup", w)
  1862. }
  1863. function T(e) {
  1864. switch (Pe(e),
  1865. this) {
  1866. case ue[0]:
  1867. case de[0]:
  1868. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1869. We.on("mouseup", w);
  1870. break;
  1871. case pe[0]:
  1872. B.prev();
  1873. break;
  1874. case fe[0]:
  1875. B.next();
  1876. break;
  1877. case ge[0]:
  1878. B.prevPage();
  1879. break;
  1880. case me[0]:
  1881. B.nextPage()
  1882. }
  1883. }
  1884. function x(e) {
  1885. e.originalEvent[He] = B;
  1886. var t = +new Date;
  1887. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1888. ot = t;
  1889. else if (F.scrollBy && G.start !== G.end) {
  1890. var i = function(e) {
  1891. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1892. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1893. le ? (Ue = +new Date,
  1894. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1895. Ee.last = Ue,
  1896. Ee.delta += Ee.curDelta,
  1897. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1898. Ee.delta %= 1),
  1899. Ee.finalDelta) : Ee.curDelta
  1900. }(e.originalEvent);
  1901. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1902. B.slideBy(F.scrollBy * i)
  1903. }
  1904. }
  1905. function S(e) {
  1906. F.clickBar && e.target === W[0] && (Pe(e),
  1907. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1908. }
  1909. function M(e) {
  1910. if (F.keyboardNavBy)
  1911. switch (e.which) {
  1912. case F.horizontal ? 37 : 38:
  1913. Pe(e),
  1914. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1915. break;
  1916. case F.horizontal ? 39 : 40:
  1917. Pe(e),
  1918. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1919. }
  1920. }
  1921. function R(e) {
  1922. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1923. }
  1924. function P() {
  1925. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1926. }
  1927. function O(e) {
  1928. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1929. }
  1930. function L(e, t) {
  1931. if (ve[e]) {
  1932. for (N = ve[e].length,
  1933. Je.length = 0,
  1934. D = 0; D < N; D++)
  1935. Je.push(ve[e][D]);
  1936. for (D = 0; D < N; D++)
  1937. Je[D].call(B, e, t)
  1938. }
  1939. }
  1940. 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 = {
  1941. start: 0,
  1942. center: 0,
  1943. end: 0,
  1944. cur: 0,
  1945. dest: 0
  1946. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1947. start: 0,
  1948. end: 0,
  1949. cur: 0
  1950. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1951. firstItem: 0,
  1952. lastItem: 0,
  1953. centerItem: 0,
  1954. activeItem: null,
  1955. activePage: 0
  1956. }, 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 = {
  1957. released: 1
  1958. }, Ee = {
  1959. last: 0,
  1960. delta: 0,
  1961. resetTime: 200
  1962. }, _e = 0, be = 0, we = 0, Te = 0;
  1963. V || (s = k[0]),
  1964. B.initialized = 0,
  1965. B.frame = s,
  1966. B.slidee = U[0],
  1967. B.pos = G,
  1968. B.rel = ee,
  1969. B.items = $,
  1970. B.pages = Q,
  1971. B.isPaused = 0,
  1972. B.options = F,
  1973. B.dragging = Ie,
  1974. B.reload = function() {
  1975. a()
  1976. }
  1977. ,
  1978. B.getPos = function(e) {
  1979. if (le) {
  1980. var t = h(e);
  1981. return -1 !== t && $[t]
  1982. }
  1983. var i = U.find(e).eq(0);
  1984. if (i[0]) {
  1985. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1986. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1987. return {
  1988. start: n,
  1989. center: n - H / 2 + r / 2,
  1990. end: n - H + r,
  1991. size: r
  1992. }
  1993. }
  1994. return !1
  1995. }
  1996. ,
  1997. B.moveBy = function(e) {
  1998. Ce.speed = e,
  1999. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2000. Ce.startPos = G.cur,
  2001. C("button"),
  2002. Ie.init = 1,
  2003. L("moveStart"),
  2004. ze(Te),
  2005. t())
  2006. }
  2007. ,
  2008. B.stop = function() {
  2009. "button" === Ie.source && (Ie.init = 0,
  2010. Ie.released = 1)
  2011. }
  2012. ,
  2013. B.prev = function() {
  2014. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2015. }
  2016. ,
  2017. B.next = function() {
  2018. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2019. }
  2020. ,
  2021. B.prevPage = function() {
  2022. B.activatePage(ee.activePage - 1)
  2023. }
  2024. ,
  2025. B.nextPage = function() {
  2026. B.activatePage(ee.activePage + 1)
  2027. }
  2028. ,
  2029. B.slideBy = function(e, t) {
  2030. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2031. }
  2032. ,
  2033. B.slideTo = function(e, t) {
  2034. l(e, t)
  2035. }
  2036. ,
  2037. B.toStart = function(e, t) {
  2038. i("start", e, t)
  2039. }
  2040. ,
  2041. B.toEnd = function(e, t) {
  2042. i("end", e, t)
  2043. }
  2044. ,
  2045. B.toCenter = function(e, t) {
  2046. i("center", e, t)
  2047. }
  2048. ,
  2049. B.getIndex = h,
  2050. B.activate = function(e, t) {
  2051. var i = m(e);
  2052. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2053. }
  2054. ,
  2055. B.activatePage = function(e, t) {
  2056. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2057. }
  2058. ,
  2059. B.resume = function(e) {
  2060. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2061. we ? we = clearTimeout(we) : L("resume"),
  2062. we = setTimeout(function() {
  2063. switch (L("cycle"),
  2064. F.cycleBy) {
  2065. case "items":
  2066. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2067. break;
  2068. case "pages":
  2069. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2070. }
  2071. }, F.cycleInterval))
  2072. }
  2073. ,
  2074. B.pause = function(e) {
  2075. e < B.isPaused || (B.isPaused = e || 100,
  2076. we && (we = clearTimeout(we),
  2077. L("pause")))
  2078. }
  2079. ,
  2080. B.toggle = function() {
  2081. B[we ? "pause" : "resume"]()
  2082. }
  2083. ,
  2084. B.set = function(e, t) {
  2085. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2086. }
  2087. ,
  2088. B.add = function(e, t) {
  2089. var i = xe(e);
  2090. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2091. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2092. a()
  2093. }
  2094. ,
  2095. B.remove = function(e) {
  2096. if (le) {
  2097. var t = u(e);
  2098. if (-1 < t) {
  2099. J.eq(t).remove();
  2100. var i = t === ee.activeItem;
  2101. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2102. a(),
  2103. i && (ye.active = null,
  2104. B.activate(ee.activeItem))
  2105. }
  2106. } else
  2107. xe(e).remove(),
  2108. a()
  2109. }
  2110. ,
  2111. B.moveAfter = function(e, t) {
  2112. r(e, t, 1)
  2113. }
  2114. ,
  2115. B.moveBefore = function(e, t) {
  2116. r(e, t)
  2117. }
  2118. ,
  2119. B.on = function(e, t) {
  2120. if ("object" === Re(e))
  2121. for (var i in e)
  2122. e.hasOwnProperty(i) && B.on(i, e[i]);
  2123. else if ("function" === Re(t))
  2124. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2125. ve[n[r]] = ve[n[r]] || [],
  2126. -1 === f(n[r], t) && ve[n[r]].push(t);
  2127. else if ("array" === Re(t))
  2128. for (var a = 0, s = t.length; a < s; a++)
  2129. B.on(e, t[a])
  2130. }
  2131. ,
  2132. B.one = function(t, i) {
  2133. B.on(t, function e() {
  2134. i.apply(B, arguments),
  2135. B.off(t, e)
  2136. })
  2137. }
  2138. ,
  2139. B.off = function(e, t) {
  2140. if (t instanceof Array)
  2141. for (var i = 0, n = t.length; i < n; i++)
  2142. B.off(e, t[i]);
  2143. else
  2144. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2145. if (ve[r[o]] = ve[r[o]] || [],
  2146. null == t)
  2147. ve[r[o]].length = 0;
  2148. else {
  2149. var s = f(r[o], t);
  2150. -1 !== s && ve[r[o]].splice(s, 1)
  2151. }
  2152. }
  2153. ,
  2154. B.destroy = function() {
  2155. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2156. We.off("keydown", M),
  2157. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2158. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2159. Z.empty(),
  2160. V || (k.off("." + He),
  2161. te.restore(),
  2162. ie.restore(),
  2163. ne.restore(),
  2164. re.restore(),
  2165. xe.removeData(s, He)),
  2166. $.length = Q.length = 0,
  2167. ye = {},
  2168. B.initialized = 0,
  2169. B
  2170. }
  2171. ,
  2172. B.init = function() {
  2173. if (!B.initialized) {
  2174. B.on(n);
  2175. var e = ["overflow", "position"]
  2176. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2177. te.save.apply(te, e),
  2178. ne.save.apply(ne, e),
  2179. ie.save.apply(ie, t),
  2180. re.save.apply(re, t);
  2181. var i = j;
  2182. return V || (i = i.add(U),
  2183. k.css("overflow", "hidden"),
  2184. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2185. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2186. i.css({
  2187. position: "absolute"
  2188. })),
  2189. F.forward && ue.on(Ke, T),
  2190. F.backward && de.on(Ke, T),
  2191. F.prev && pe.on(Ze, T),
  2192. F.next && fe.on(Ze, T),
  2193. F.prevPage && ge.on(Ze, T),
  2194. F.nextPage && me.on(Ze, T),
  2195. ce.on(Xe, x),
  2196. W[0] && W.on(Ze, S),
  2197. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2198. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2199. he.on(je, {
  2200. source: "slidee"
  2201. }, I),
  2202. j && j.on(je, {
  2203. source: "handle"
  2204. }, I),
  2205. We.on("keydown", M),
  2206. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2207. k.on("scroll." + He, Le)),
  2208. B.initialized = 1,
  2209. a(!0),
  2210. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2211. B
  2212. }
  2213. }
  2214. }
  2215. function Re(e) {
  2216. 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
  2217. }
  2218. function Pe(e, t) {
  2219. e.preventDefault(),
  2220. t && e.stopPropagation()
  2221. }
  2222. function Oe(e) {
  2223. Pe(e, 1),
  2224. xe(this).off(e.type, Oe)
  2225. }
  2226. function Le() {
  2227. this.scrollLeft = 0,
  2228. this.scrollTop = 0
  2229. }
  2230. function De(e) {
  2231. return !isNaN(parseFloat(e)) && isFinite(e)
  2232. }
  2233. function Ne(e, t) {
  2234. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2235. }
  2236. function Fe(e, t, i) {
  2237. return e < t ? t : i < e ? i : e
  2238. }
  2239. function Be(t) {
  2240. var i = {
  2241. style: {},
  2242. save: function() {
  2243. if (t && t.nodeType) {
  2244. for (var e = 0; e < arguments.length; e++)
  2245. i.style[arguments[e]] = t.style[arguments[e]];
  2246. return i
  2247. }
  2248. },
  2249. restore: function() {
  2250. if (t && t.nodeType) {
  2251. for (var e in i.style)
  2252. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2253. return i
  2254. }
  2255. }
  2256. };
  2257. return i
  2258. }
  2259. 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;
  2260. function t(e) {
  2261. for (var t = 0, i = r.length; t < i; t++) {
  2262. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2263. if (null != o.style[n])
  2264. return n
  2265. }
  2266. }
  2267. We.on(Xe, function(e) {
  2268. var t = e.originalEvent[He]
  2269. , i = +new Date;
  2270. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2271. }),
  2272. function(t) {
  2273. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2274. var t = (new Date).getTime()
  2275. , i = Math.max(0, 16 - (t - r))
  2276. , n = setTimeout(e, i);
  2277. return r = t,
  2278. n
  2279. }
  2280. ;
  2281. var r = (new Date).getTime()
  2282. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2283. ze = function(e) {
  2284. i.call(t, e)
  2285. }
  2286. }(window),
  2287. r = ["", "webkit", "moz", "ms", "o"],
  2288. o = document.createElement("div"),
  2289. Ve = t("transform"),
  2290. ke = t("perspective") ? "translateZ(0) " : "",
  2291. e.Sly = Me,
  2292. xe.fn.sly = function(n, r) {
  2293. var o, a;
  2294. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2295. a = Array.prototype.slice.call(arguments, 1)),
  2296. n = {}),
  2297. this.each(function(e, t) {
  2298. var i = xe.data(t, He);
  2299. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2300. })
  2301. }
  2302. ,
  2303. Me.defaults = {
  2304. slidee: null,
  2305. horizontal: !1,
  2306. itemNav: null,
  2307. itemSelector: null,
  2308. smart: !1,
  2309. activateOn: null,
  2310. activateMiddle: !1,
  2311. scrollSource: null,
  2312. scrollBy: 0,
  2313. scrollHijack: 300,
  2314. scrollTrap: !1,
  2315. dragSource: null,
  2316. mouseDragging: !1,
  2317. touchDragging: !1,
  2318. releaseSwing: !1,
  2319. swingSpeed: .2,
  2320. elasticBounds: !1,
  2321. interactive: null,
  2322. scrollBar: null,
  2323. dragHandle: !1,
  2324. dynamicHandle: !1,
  2325. minHandleSize: 50,
  2326. clickBar: !1,
  2327. syncSpeed: .5,
  2328. pagesBar: null,
  2329. activatePageOn: null,
  2330. pageBuilder: function(e) {
  2331. return "<li>" + (e + 1) + "</li>"
  2332. },
  2333. forward: null,
  2334. backward: null,
  2335. prev: null,
  2336. next: null,
  2337. prevPage: null,
  2338. nextPage: null,
  2339. cycleBy: null,
  2340. cycleInterval: 5e3,
  2341. pauseOnHover: !1,
  2342. startPaused: !1,
  2343. moveBy: 300,
  2344. speed: 0,
  2345. easing: "swing",
  2346. startAt: null,
  2347. keyboardNavBy: null,
  2348. draggedClass: "dragged",
  2349. activeClass: "active",
  2350. disabledClass: "disabled"
  2351. }
  2352. }(jQuery, window),
  2353. function o(a, s, l) {
  2354. function c(i, e) {
  2355. if (!s[i]) {
  2356. if (!a[i]) {
  2357. var t = "function" == typeof require && require;
  2358. if (!e && t)
  2359. return t(i, !0);
  2360. if (h)
  2361. return h(i, !0);
  2362. var n = new Error("Cannot find module '" + i + "'");
  2363. throw n.code = "MODULE_NOT_FOUND",
  2364. n
  2365. }
  2366. var r = s[i] = {
  2367. exports: {}
  2368. };
  2369. a[i][0].call(r.exports, function(e) {
  2370. var t = a[i][1][e];
  2371. return c(t || e)
  2372. }, r, r.exports, o, a, s, l)
  2373. }
  2374. return s[i].exports
  2375. }
  2376. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2377. c(l[e]);
  2378. return c
  2379. }({
  2380. 1: [function(p, f, e) {
  2381. (function(e) {
  2382. "use strict";
  2383. function t(e) {
  2384. this.player = null,
  2385. this.director = null,
  2386. this.modelManager = null,
  2387. this.container = null,
  2388. this.tagManager = null,
  2389. this.fadeInSpeed = e,
  2390. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2391. }
  2392. var r = p("three")
  2393. , i = p("./util/logger")
  2394. , n = (p("./util/common"),
  2395. p("./enum/PlayerEvents"))
  2396. , o = p("./enum/DirectorEvents")
  2397. , a = p("./settings")
  2398. , s = p("./enum/Viewmode")
  2399. , l = (p("./enum/WarpStyle"),
  2400. p("./enum/BlackoutStyle"),
  2401. p("./enum/ModelManagerEvents"))
  2402. , c = p("./enum/tagEvents")
  2403. , h = p("./util/transitions")
  2404. , u = p("./util/lerp")
  2405. , d = new i(e);
  2406. t.prototype.init = function(e, t, i, n, r) {
  2407. (window.app = this).player = t,
  2408. this.director = e,
  2409. this.modelManager = i,
  2410. this.tagManager = n,
  2411. this.container = r,
  2412. this.updateModel(),
  2413. this.bindEvents()
  2414. }
  2415. ,
  2416. t.prototype.bindEvents = function() {
  2417. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2418. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2419. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2420. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2421. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2422. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2423. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2424. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2425. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2426. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2427. }
  2428. ,
  2429. t.prototype.updateModel = function() {
  2430. this.model = this.modelManager.getActiveModel()
  2431. }
  2432. ,
  2433. t.prototype.handleWarpStarted = function() {
  2434. this.hidePlayerReticule()
  2435. }
  2436. ,
  2437. t.prototype.ontagActivated = function() {
  2438. this.hidePlayerReticule()
  2439. }
  2440. ,
  2441. t.prototype.onNavigationTotag = function() {
  2442. this.hidePlayerReticule()
  2443. }
  2444. ,
  2445. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2446. var n = this.modelManager.getActiveModel()
  2447. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2448. n.fadePanoMarkers(r),
  2449. n.setMode(t)
  2450. }
  2451. ,
  2452. t.prototype.handlePlayerModeChanged = function(e, t) {
  2453. var i = this.modelManager.getActiveModel()
  2454. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2455. i.setSide(n),
  2456. i.setMode(t)
  2457. }
  2458. ,
  2459. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2460. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2461. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2462. }
  2463. ,
  2464. t.prototype.handleActionInterruption = function() {}
  2465. ,
  2466. t.prototype.handleStartInside = function(e) {
  2467. var t = a[this.player.mode]
  2468. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2469. this.fadeIn(this.fadeInSpeed),
  2470. this.model.alpha = 0,
  2471. this.model.skybox.material.uniforms.opacity.value = 1,
  2472. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2473. var n = this.player.reticule;
  2474. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2475. }
  2476. ,
  2477. t.prototype.handleStartOutside = function(e) {
  2478. this.fadeIn(e)
  2479. }
  2480. ,
  2481. t.prototype.fadeIn = function(e) {
  2482. null != e || (e = 2e3,
  2483. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2484. $(this.container).fadeIn(e)
  2485. }
  2486. ,
  2487. t.prototype.hidePlayerReticule = function() {
  2488. this.player.reticule.hide()
  2489. }
  2490. ,
  2491. f.exports = t
  2492. }
  2493. ).call(this, "/js/DisplayController.js")
  2494. }
  2495. , {
  2496. "./enum/BlackoutStyle": 18,
  2497. "./enum/DirectorEvents": 23,
  2498. "./enum/tagEvents": 32,
  2499. "./enum/ModelManagerEvents": 33,
  2500. "./enum/PlayerEvents": 40,
  2501. "./enum/Viewmode": 51,
  2502. "./enum/WarpStyle": 52,
  2503. "./settings": 166,
  2504. "./util/common": 185,
  2505. "./util/lerp": 188,
  2506. "./util/logger": 189,
  2507. "./util/transitions": 195,
  2508. three: 217
  2509. }],
  2510. 2: [function(e, t, i) {
  2511. "use strict";
  2512. function n() {
  2513. this.baseStartTime = performance.timing.navigationStart,
  2514. this.loadingStartTime = null,
  2515. this.waitingStartTime = null,
  2516. this.appReadyTime = null
  2517. }
  2518. n.prototype.setBaseStartTime = function(e) {
  2519. this.baseStartTime = e || Date.now()
  2520. }
  2521. ,
  2522. n.prototype.setWaitingStartTime = function(e) {
  2523. this.waitingStartTime = e || Date.now()
  2524. }
  2525. ,
  2526. n.prototype.setLoadingStartTime = function(e) {
  2527. this.loadingStartTime = e || Date.now()
  2528. }
  2529. ,
  2530. n.prototype.setAppReadyTime = function(e) {
  2531. this.appReadyTime = e || Date.now()
  2532. }
  2533. ,
  2534. n.prototype.calcFullLoadingTime = function() {
  2535. var e = this.appReadyTime - this.baseStartTime;
  2536. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2537. e
  2538. }
  2539. ,
  2540. t.exports = n
  2541. }
  2542. , {}],
  2543. 3: [function(i, n, e) {
  2544. (function(e) {
  2545. "use strict";
  2546. function a() {
  2547. return 100 * Math.random()
  2548. }
  2549. var t = i("./util/logger")
  2550. , s = i("./util/browser")
  2551. , l = new t(e)
  2552. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2553. initialized: !1,
  2554. init: function(e, t) {
  2555. if (t = t || {},
  2556. !this.initialized) {
  2557. for (var i in this.initialized = !0,
  2558. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2559. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2560. e) {
  2561. var n = i.match("^sc_tilegen_([0-9]+)$");
  2562. n && (c.tilegen = a() < parseInt(n[1]));
  2563. var r = i.match("^sc_imgopt_([0-9]+)$");
  2564. r && (c.imgopt = a() < parseInt(r[1]))
  2565. }
  2566. for (var o in t)
  2567. c[o] = t[o],
  2568. l.debug("A/B override:", o, c[o])
  2569. }
  2570. },
  2571. changeIfTileGenerating: function(e) {
  2572. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2573. e += ""),
  2574. e
  2575. },
  2576. changeIfImageOptimzing: function(e) {
  2577. if(e.includes("blob:http"))return e;//add
  2578. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2579. e += ""),
  2580. e
  2581. },
  2582. tilegen: !1,
  2583. imgopt: !1
  2584. };
  2585. n.exports = c
  2586. }
  2587. ).call(this, "/js/ab.js")
  2588. }
  2589. , {
  2590. "./util/browser": 182,
  2591. "./util/logger": 189
  2592. }],
  2593. 4: [function(u, d, e) {
  2594. (function(e) {
  2595. "use strict";
  2596. function r(n, e, t, i) {
  2597. function r(e) {
  2598. a[e.sid] = !0;
  2599. var t = e.billboard.media && e.billboard.media.type
  2600. , i = {
  2601. tag_id: e.sid,
  2602. tags_visited: Object.keys(a).length,
  2603. tag_count: Object.keys(n.tags).length,
  2604. tag_view_count: ++d,
  2605. has_media: !!t
  2606. };
  2607. t && (i.media_type = t),
  2608. g("tag_opened", i)
  2609. }
  2610. var o, a = {}, s = Date.now() - P, l = null;
  2611. i && (l = Date.now() - window.navigationStart);
  2612. try {
  2613. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2614. } catch (n) {
  2615. o = !1
  2616. }
  2617. var c, h = n.supportsVR;
  2618. h || (c = "VR disabled at the model/account level",
  2619. 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"))),
  2620. g("model_loaded", {
  2621. duration: s,
  2622. duration_from_navigation_start: l,
  2623. has_hlr: o,
  2624. has_vr: h,
  2625. vr_reason: c
  2626. });
  2627. var u = 0;
  2628. n.panos.forEach(function(e) {
  2629. e.on("enter", function() {
  2630. f("pano_viewed", {
  2631. pano_id: e.id,
  2632. pano_view_count: ++u,
  2633. alignment_type: e.alignmentType,
  2634. interaction_source: R,
  2635. navigation_source: v
  2636. })
  2637. })
  2638. });
  2639. var d = 0;
  2640. for (var p in n.tags)
  2641. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2642. e.on("tour_auto", function(e) {
  2643. v = "tour_" + e
  2644. }),
  2645. e.on("tour_manual", function(e) {
  2646. R = "gui-" + e,
  2647. v = "tour_manual"
  2648. }),
  2649. t.on(C.InteractionKey, function() {
  2650. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2651. }),
  2652. t.on(C.InteractionDirect, function() {
  2653. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2654. }),
  2655. function(t) {
  2656. I.on(T.OPENED, function() {
  2657. f("showcase_share_intent", {
  2658. pano_id: t.currentPano && t.currentPano.id
  2659. })
  2660. }),
  2661. I.on(T.LINK_CLICKED, function(e) {
  2662. f("showcase_share_action", {
  2663. channel: e.channel,
  2664. pano_id: t.currentPano && t.currentPano.id
  2665. })
  2666. }),
  2667. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2668. f("showcase_share_origin_link_clicked")
  2669. })
  2670. }(e),
  2671. function() {
  2672. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2673. gui_action: "click_vr_button"
  2674. })),
  2675. _.on(S.LAUNCH, function(e) {
  2676. f("showcase_gui", {
  2677. gui_action: "launch_vr",
  2678. vr_platform: e.vr_platform,
  2679. vr_app: e.vr_app
  2680. })
  2681. }),
  2682. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2683. gui_action: "vr_modal_prev"
  2684. })),
  2685. _.on(S.NEXT, function(e) {
  2686. f("showcase_gui", {
  2687. gui_action: e.nextAction
  2688. })
  2689. }),
  2690. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2691. gui_action: "vr_modal_close"
  2692. })),
  2693. _.on(S.falseICECHOSEN, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: e.name + " "
  2696. })
  2697. }),
  2698. _.on(S.STORE, function(e) {
  2699. f("showcase_gui", {
  2700. gui_action: "launch_store",
  2701. store: e
  2702. })
  2703. })
  2704. }()
  2705. }
  2706. function f(e, t) {
  2707. if (t = t || {},
  2708. i)
  2709. try {
  2710. window.analytics.track(e, s.extendObject(t, c), {
  2711. context: {
  2712. app: {
  2713. name: "showcase",
  2714. version: "2.25.6-0-gd87e5b1"
  2715. },
  2716. screen: {
  2717. width: window.screen.width,
  2718. height: window.screen.height,
  2719. density: window.devicePixelRatio
  2720. }
  2721. }
  2722. })
  2723. } catch (t) {
  2724. console.warn("Failed to send data to segment for " + e)
  2725. }
  2726. }
  2727. function g(e, t) {
  2728. f(e, t = t || {})
  2729. }
  2730. function m(e, t) {
  2731. R = e === C.InteractionGui ? "gui-" + t : e,
  2732. v = "self_guided"
  2733. }
  2734. var v, o, a = (u("three"),
  2735. u("./util/ajax"),
  2736. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2737. 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"),
  2738. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2739. d.exports = {
  2740. report: function(e, t, i, n) {
  2741. !function(e, t) {
  2742. if (o)
  2743. try {
  2744. o.addEvent(e, s.extendObject({
  2745. host: window.location.host,
  2746. keen: {
  2747. addons: [{
  2748. name: "keen:ua_parser",
  2749. input: {
  2750. ua_string: "user_agent"
  2751. },
  2752. output: "parsed_user_agent"
  2753. }]
  2754. },
  2755. user_agent: "${keen.user_agent}",
  2756. referrer: {
  2757. url: s.normalizeUrl(document.referrer),
  2758. domain: s.domainFromUrl(document.referrer),
  2759. url_original: document.referrer
  2760. },
  2761. embedded: y.inIframe(),
  2762. is_mobile: y.isMobile(),
  2763. version: "2.25.6-0-gd87e5b1"
  2764. }, t))
  2765. } catch (e) {
  2766. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2767. }
  2768. }("Session starts", {
  2769. model: e,
  2770. status: t,
  2771. loadtime: Date.now() - (P || Date.now()),
  2772. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2773. autoplay: i,
  2774. quickstart: n,
  2775. ab_tilegen: a.tilegen,
  2776. ab_imgopt: a.imgopt
  2777. })
  2778. },
  2779. impression: function(e) {
  2780. g("impression", {
  2781. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2782. url_params: (void 0 !== e.immediate && e.immediate,
  2783. window.location.search.substr(1).split("&"))
  2784. })
  2785. },
  2786. initKeen: function(e) {
  2787. return e.token && e.appId ? void (o = new Keen({
  2788. projectId: e.appId,
  2789. writeKey: e.token,
  2790. readKey: "",
  2791. requestType: "xhr"
  2792. })) : void l.warn("no keen token/appId")
  2793. },
  2794. initSegment: function(e) {
  2795. return e.token ? (i = e.token,
  2796. window.analytics.load(e.token),
  2797. c = {
  2798. model_id: e.model,
  2799. start_source: e.startSource,
  2800. autoplay: e.autoplay,
  2801. quickstart: e.quickstart,
  2802. language_tag: t.languageTag,
  2803. is_mobile: y.isMobile(),
  2804. iframe: y.inIframe(),
  2805. aspect_ratio: y.aspectRatio(),
  2806. session_id: h,
  2807. window: {
  2808. width: $("#player").width(),
  2809. height: $("#player").height()
  2810. },
  2811. platform: {
  2812. browser: {
  2813. name: $.ua.browser.name,
  2814. major: $.ua.browser.major,
  2815. version: $.ua.browser.version
  2816. },
  2817. os: {
  2818. name: $.ua.os.name,
  2819. version: $.ua.os.version
  2820. },
  2821. device: {
  2822. vendor: $.ua.device.vendor,
  2823. model: $.ua.device.model,
  2824. type: $.ua.device.type
  2825. }
  2826. }
  2827. },
  2828. n = Math.random() < t.analytics.sessionTrackingRate,
  2829. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2830. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2831. },
  2832. sessionStart: function(e) {
  2833. l.debug("analytics user_session_start"),
  2834. f("session_started"),
  2835. P = Date.now(),
  2836. window.addEventListener("unload", function() {
  2837. !function(e, t) {
  2838. if (t = t || {},
  2839. navigator.sendBeacon && i)
  2840. try {
  2841. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2842. event: e,
  2843. anonymousId: window.analytics.user().anonymousId(),
  2844. properties: s.extendObject(t, c),
  2845. writeKey: i,
  2846. sentAt: Date.now(),
  2847. type: "track",
  2848. context: {
  2849. userAgent: y.userAgent(),
  2850. library: {
  2851. name: "showcase-beacon",
  2852. version: "2.25.6-0-gd87e5b1"
  2853. },
  2854. app: {
  2855. name: "showcase",
  2856. version: "2.25.6-0-gd87e5b1"
  2857. }
  2858. }
  2859. }))
  2860. } catch (e) {
  2861. console.warn("Failed to send async segment request")
  2862. }
  2863. }("session_ended", {
  2864. duration: Date.now() - P
  2865. })
  2866. })
  2867. },
  2868. modelLoaded: function(e, t, i, n) {
  2869. r(e, t, i, n)
  2870. },
  2871. loadComplete: function(e) {
  2872. f("load_times", {
  2873. time_to_app_start: e
  2874. })
  2875. },
  2876. track: function(e, t) {
  2877. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2878. f(e, t))
  2879. },
  2880. trackAlways: function(e, t) {
  2881. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2882. f(e, t)
  2883. },
  2884. getSessionId: function() {
  2885. return h
  2886. },
  2887. updateInteraction: m
  2888. }
  2889. }
  2890. ).call(this, "/js/analytics.js")
  2891. }
  2892. , {
  2893. "./ab": 3,
  2894. "./enum/ControlEvents": 21,
  2895. "./enum/PlayerEvents": 40,
  2896. "./enum/VROption": 47,
  2897. "./enum/VRPlatforms": 49,
  2898. "./enum/Viewmode": 51,
  2899. "./gui/sharing/ShareEvents": 76,
  2900. "./gui/sharing/modal": 77,
  2901. "./gui/title/TitleEvents": 80,
  2902. "./gui/title/titleBar": 82,
  2903. "./gui/vr/vrEvent": 85,
  2904. "./gui/vr/vrModal": 87,
  2905. "./localization/localize": 108,
  2906. "./tag/Billboard/BillboardEvent": 120,
  2907. "./settings": 166,
  2908. "./util/ajax": 181,
  2909. "./util/browser": 182,
  2910. "./util/common": 185,
  2911. "./util/logger": 189,
  2912. three: 217
  2913. }],
  2914. 5: [function(e, t, i) {
  2915. "use strict";
  2916. function n() {
  2917. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2918. this.controls = null
  2919. }
  2920. var r = e("three")
  2921. , o = e("../constants")
  2922. , a = e("../util/cameraLight");
  2923. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2924. this.aspect = e,
  2925. this.updateProjectionMatrix()
  2926. }
  2927. ,
  2928. t.exports = n
  2929. }
  2930. , {
  2931. "../constants": 8,
  2932. "../util/cameraLight": 184,
  2933. three: 217
  2934. }],
  2935. 6: [function(e, t, i) {
  2936. "use strict";
  2937. function n() {
  2938. var e = $("#player").width() / $("#player").height();
  2939. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2940. this.controls = null,
  2941. this.updateAspect(e)
  2942. }
  2943. var r = e("three")
  2944. , o = e("../constants");
  2945. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2946. this.aspect = e,
  2947. this.top = o.orthoBase / e,
  2948. this.bottom = -o.orthoBase / e,
  2949. this.updateProjectionMatrix()
  2950. }
  2951. ,
  2952. t.exports = n
  2953. }
  2954. , {
  2955. "../constants": 8,
  2956. three: 217
  2957. }],
  2958. 7: [function(e, t, i) {
  2959. "use strict";
  2960. function n() {
  2961. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2962. this.controls = null
  2963. }
  2964. var r = e("three")
  2965. , o = e("../settings")
  2966. , a = e("../util/cameraLight");
  2967. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2968. this.aspect = e,
  2969. this.updateProjectionMatrix()
  2970. }
  2971. ,
  2972. t.exports = n
  2973. }
  2974. , {
  2975. "../settings": 166,
  2976. "../util/cameraLight": 184,
  2977. three: 217
  2978. }],
  2979. 8: [function(e, t, i) {
  2980. "use strict";
  2981. t.exports = {
  2982. signedUrlDefaultExpireTime: 24e4,
  2983. signedUrlCheckInterval: 1e4,
  2984. signedUrlRefreshBuffer: 15e3,
  2985. dollhouseFOV: 70,
  2986. dollhouseNear: .1,//1,
  2987. dollhouseFar: 5e3,
  2988. insideFOV: 70,
  2989. insideFOVMax: 120,
  2990. insideNear: .1,
  2991. insideFar: 5e3,
  2992. insideLookSpeed: .12,
  2993. insideLookLimitUp: 40,
  2994. insideLookLimitDown: -40,
  2995. orthoNear: 1,
  2996. orthoFar: 5e3,
  2997. orthoBase: 10,
  2998. narrowLandscapeHeight: 290,
  2999. reallyNarrowLandscapeHeight: 250,
  3000. visionTilingStartDate: new Date("8/26/2016"),
  3001. visionTilingStartVersion: "1.1.407.13667",
  3002. windowHeightHighQualityThreshold: 900,
  3003. tourStepDelayDefault: 3500,
  3004. tourStepDelaySlideShow: 5e3,
  3005. workshopApsect: 9 / 16,
  3006. highQualityMaxZoom: 2,
  3007. ultraHighQualityMaxZoom: 3
  3008. }
  3009. }
  3010. , {}],
  3011. 9: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. this.activeControl = null,
  3015. this.controls = {},
  3016. this.cameras = {}
  3017. }
  3018. var a = e("./PanoramaControls")
  3019. , s = e("./DollhouseControls")
  3020. , l = e("./FloorplanControls")
  3021. , c = e("../cameras/PanoramaCamera")
  3022. , h = e("../cameras/DollhouseCamera")
  3023. , u = e("../cameras/FloorplanCamera")
  3024. , r = e("events").EventEmitter
  3025. , d = e("../enum/ControlEvents")
  3026. , o = e("../enum/ModelManagerEvents")
  3027. , p = e("../enum/Viewmode")
  3028. , f = e("../settings");
  3029. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3030. this.setUpControls(),
  3031. this.bindEvents(e, t)
  3032. }
  3033. ,
  3034. n.prototype.activateControls = function(e) {
  3035. this.activeControl && (this.activeControl.reset(),
  3036. this.activeControl.enabled = !1),
  3037. this.controls[e] && (this.controls[e].enabled = !0),
  3038. this.activeControl = this.controls[e]
  3039. }
  3040. ,
  3041. n.prototype.setUpControls = function() {
  3042. var i = {}
  3043. , n = {}
  3044. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3045. , r = [c, h, u]
  3046. , o = [a, s, l];
  3047. e.forEach(function(e, t) {
  3048. i[e] = new r[t],
  3049. n[e] = new o[t](i[e]),
  3050. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3051. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3052. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3053. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3054. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3055. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3056. }
  3057. .bind(this)),
  3058. this.controls = n,
  3059. this.cameras = i
  3060. }
  3061. ,
  3062. n.prototype.bindEvents = function(e, t) {
  3063. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3064. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3065. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3066. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3067. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3068. passive: !1
  3069. }),
  3070. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3071. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3072. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3073. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3074. e.addEventListener("contextmenu", function(e) {
  3075. e.preventDefault()
  3076. }),
  3077. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3078. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3079. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3080. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3081. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3082. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3083. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3084. t.on(o.ActiveModelChanged, function(e) {
  3085. this.setModelForControls(e.model)
  3086. }
  3087. .bind(this))
  3088. }
  3089. ,
  3090. n.prototype.setModelForControls = function(e) {
  3091. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3092. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3093. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3094. this.controls[e].setBounds(t)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.onMouseDown = function(e) {
  3100. e.preventDefault(),
  3101. this.activeControl && this.activeControl.onMouseDown(e)
  3102. }
  3103. ,
  3104. n.prototype.onMouseMove = function(e) {
  3105. e.preventDefault(),
  3106. this.activeControl && this.activeControl.onMouseMove(e)
  3107. }
  3108. ,
  3109. n.prototype.onMouseUp = function(e) {
  3110. e.preventDefault(),
  3111. this.activeControl && this.activeControl.onMouseUp(e)
  3112. }
  3113. ,
  3114. n.prototype.onMouseOver = function(e) {
  3115. e.preventDefault(),
  3116. this.activeControl && this.activeControl.onMouseOver(e)
  3117. }
  3118. ,
  3119. n.prototype.onMouseWheel = function(e) {
  3120. e.preventDefault(),
  3121. this.activeControl && this.activeControl.onMouseWheel(e)
  3122. }
  3123. ,
  3124. n.prototype.onTouchStart = function(e) {
  3125. e.preventDefault(),
  3126. this.activeControl && this.activeControl.onTouchStart(e),
  3127. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3128. $("#hotListContent ul .active").removeClass("active"),
  3129. $("#hotList")[0].classList.remove("active")
  3130. }
  3131. ,
  3132. n.prototype.onTouchMove = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onTouchMove(e)
  3135. }
  3136. ,
  3137. n.prototype.onTouchEnd = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onTouchEnd(e)
  3140. }
  3141. ,
  3142. n.prototype.onPointerDown = function(e) {
  3143. if (e.preventDefault(),
  3144. this.activeControl)
  3145. switch (e.pointerType) {
  3146. case "mouse":
  3147. this.activeControl.onMouseDown(e);
  3148. break;
  3149. default:
  3150. this.activeControl.onPointerDown(e)
  3151. }
  3152. }
  3153. ,
  3154. n.prototype.onPointerMove = function(e) {
  3155. if (e.preventDefault(),
  3156. this.activeControl)
  3157. switch (e.pointerType) {
  3158. case "mouse":
  3159. this.activeControl.onMouseMove(e);
  3160. break;
  3161. default:
  3162. this.activeControl.onPointerMove(e)
  3163. }
  3164. }
  3165. ,
  3166. n.prototype.onPointerUp = function(e) {
  3167. if (e.preventDefault(),
  3168. this.activeControl)
  3169. switch (e.pointerType) {
  3170. case "mouse":
  3171. this.activeControl.onMouseUp(e);
  3172. break;
  3173. default:
  3174. this.activeControl.onPointerUp(e)
  3175. }
  3176. }
  3177. ,
  3178. n.prototype.onPointerCancel = function(e) {
  3179. e.preventDefault(),
  3180. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3181. }
  3182. ,
  3183. n.prototype.onKeyDown = function(e) {
  3184. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3185. this.activeControl && this.activeControl.onKeyDown(e))
  3186. }
  3187. ,
  3188. n.prototype.onKeyUp = function(e) {
  3189. e.preventDefault(),
  3190. this.activeControl && this.activeControl.onKeyUp(e)
  3191. }
  3192. ,
  3193. t.exports = n
  3194. }
  3195. , {
  3196. "../cameras/DollhouseCamera": 5,
  3197. "../cameras/FloorplanCamera": 6,
  3198. "../cameras/PanoramaCamera": 7,
  3199. "../enum/ControlEvents": 21,
  3200. "../enum/ModelManagerEvents": 33,
  3201. "../enum/Viewmode": 51,
  3202. "../settings": 166,
  3203. "./DollhouseControls": 10,
  3204. "./FloorplanControls": 11,
  3205. "./PanoramaControls": 13,
  3206. events: 202
  3207. }],
  3208. 10: [function(e, t, i) {
  3209. "use strict";
  3210. function n(e) {
  3211. a.call(this, e),
  3212. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3213. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3214. this.minDistance = o.dollhouseDefault.minDistance,
  3215. this.maxDistance = o.dollhouseDefault.maxDistance,
  3216. this.adjustedMinDistance = this.minDistance,
  3217. this.adjustedMaxDistance = this.maxDistance
  3218. }
  3219. var r = e("three")
  3220. , o = e("../settings")
  3221. , a = e("./OutsideControls");
  3222. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3223. this.camera.updateMatrix();
  3224. var i = this.camera.position.clone().sub(this.target).length();
  3225. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3226. this.panLeft(2 * e * i / $("#player").height()),
  3227. this.panUp(-2 * t * i / $("#player").height())
  3228. }
  3229. ,
  3230. n.prototype.updateZoom = function() {
  3231. return this.offset.length() * this.scale
  3232. }
  3233. ,
  3234. n.prototype.setZoomBounds = function(e) {
  3235. var t = e.min.distanceTo(e.max);
  3236. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3237. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3238. this.minDistance = this.adjustedMinDistance,
  3239. this.maxDistance = this.adjustedMaxDistance
  3240. }
  3241. ,
  3242. n.prototype.resetRanges = function(e, t) {
  3243. e ? (this.minDistance = Math.min(e, this.minDistance),
  3244. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3245. this.maxDistance = this.adjustedMaxDistance),
  3246. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3247. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3248. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3249. }
  3250. ,
  3251. n.prototype.toJSON = function() {
  3252. return a.prototype.toJSON.call(this)
  3253. }
  3254. ,
  3255. t.exports = n
  3256. }
  3257. , {
  3258. "../settings": 166,
  3259. "./OutsideControls": 12,
  3260. three: 217
  3261. }],
  3262. 11: [function(e, t, i) {
  3263. "use strict";
  3264. function n(e) {
  3265. c.call(this, e),
  3266. this.minDistance = 15,
  3267. this.maxDistance = 50,
  3268. this.noRotateUpDown = !0,
  3269. this.minPolarAngle = 0,
  3270. this.maxPolarAngle = 0,
  3271. this.mouseActions[u.LEFT] = h.PAN,
  3272. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3273. this.mouseActions[u.RIGHT] = h.ROTATE,
  3274. this.touchActions[1] = h.PAN,
  3275. this.touchActions[2] = h.ROTATE_DOLLY,
  3276. this.absoluteScale = 1,
  3277. this.currentScale = 1
  3278. }
  3279. 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");
  3280. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3281. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3282. this.currentScale = this.absoluteScale
  3283. }
  3284. ,
  3285. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3286. var t = Math.max(modelSize.x, modelSize.z)
  3287. , i = Math.min(modelSize.x, modelSize.z)
  3288. , n = Math.max(t, i * this.camera.aspect)
  3289. , r = Math.max(i, t * this.camera.aspect);
  3290. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3291. return absoluteScale
  3292. },
  3293. n.prototype.rotateToView = function(e, t) {
  3294. var i = 0;
  3295. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3296. this.rotateLeft(i),
  3297. this.update(0)
  3298. }
  3299. ,
  3300. n.prototype.pan = function(e, t) {
  3301. this.camera.updateMatrix(),
  3302. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3303. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3304. }
  3305. ,
  3306. n.prototype.updateZoom = function() {
  3307. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3308. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3309. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3310. this.camera.left = -l.orthoBase * this.currentScale,
  3311. this.camera.right = l.orthoBase * this.currentScale,
  3312. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3313. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3314. this.camera.updateProjectionMatrix(),
  3315. this.offset.length()
  3316. }
  3317. ,
  3318. n.prototype.toJSON = (r = new s.Quaternion,
  3319. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3320. a = new s.Quaternion,
  3321. function() {
  3322. var e = c.prototype.toJSON.call(this);
  3323. return r.copy(e.camera_quaternion),
  3324. a.copy(o),
  3325. a.multiply(r),
  3326. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3327. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3328. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3329. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3330. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3331. e
  3332. }
  3333. ),
  3334. t.exports = n
  3335. }
  3336. , {
  3337. "../enum/ControlActions": 20,
  3338. "../enum/MouseButton": 34,
  3339. "../settings": 166,
  3340. "../util/browser": 182,
  3341. "../util/math": 190,
  3342. "./OutsideControls": 12,
  3343. three: 217
  3344. }],
  3345. 12: [function(e, t, i) {
  3346. "use strict";
  3347. function n(e) {
  3348. this.camera = e,
  3349. (this.camera.controls = this).enabled = !1,
  3350. this.target = new a.Vector3,
  3351. this.targetBounds = new a.Box3,
  3352. this.zoomSpeed = 2,//编辑时缩放快一些
  3353. this.minDistance = 0,
  3354. this.maxDistance = 1 / 0,
  3355. this.noRotateUpDown = !1,
  3356. this.rotateSpeed = 1,
  3357. this.keyboardZoomSpeed = 0,
  3358. this.keyPanSpeed = 7,
  3359. this.autoRotate = !1,
  3360. this.autoRotateSpeed = 2,
  3361. this.autoPan = !1,
  3362. this.autoPanPosition = new a.Vector3,
  3363. this.minPolarAngle = a.Math.degToRad(25),
  3364. this.maxPolarAngle = a.Math.degToRad(65),
  3365. this.rotationAcceleration = new a.Vector2,
  3366. this.rotationSpeed = new a.Vector2,
  3367. this.panAcceleration = new a.Vector2,
  3368. this.panSpeed = new a.Vector2,
  3369. this.rotateStart = new a.Vector2,
  3370. this.rotateEnd = new a.Vector2,
  3371. this.rotateDelta = new a.Vector2,
  3372. this.panStart = new a.Vector2,
  3373. this.panEnd = new a.Vector2,
  3374. this.panDelta = new a.Vector2,
  3375. this.panOffset = new a.Vector3,
  3376. this.offset = new a.Vector3,
  3377. this.dollyStart = new a.Vector2,
  3378. this.dollyEnd = new a.Vector2,
  3379. this.dollyDelta = new a.Vector2,
  3380. this.phiDelta = 0,
  3381. this.thetaDelta = 0,
  3382. this.scale = 1,
  3383. this.panVector = new a.Vector3,
  3384. this.lastPosition = new a.Vector3,
  3385. this.state = u.NONE,
  3386. this.mouseActions = {},
  3387. this.mouseActions[d.LEFT] = u.ROTATE,
  3388. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3389. this.mouseActions[d.RIGHT] = u.PAN,
  3390. this.touchActions = {},
  3391. this.touchActions[1] = u.ROTATE,
  3392. this.touchActions[2] = u.PAN_DOLLY,
  3393. this.lastMoveTime = 0,
  3394. this.pointersLimit = 2,
  3395. this.pointers = []
  3396. }
  3397. 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;
  3398. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3399. this.targetBounds = e
  3400. }
  3401. ,
  3402. n.prototype.isEngaged = function() {
  3403. return this.state !== u.NONE
  3404. }
  3405. ,
  3406. n.prototype.rotateLeft = function(e) {
  3407. void 0 === e && (e = this.getAutoRotationAngle()),
  3408. this.thetaDelta -= e
  3409. }
  3410. ,
  3411. n.prototype.rotateUp = function(e) {
  3412. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3413. this.phiDelta -= e)
  3414. }
  3415. ,
  3416. n.prototype.panLeft = function(e) {
  3417. var t = this.camera.matrix.elements;
  3418. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3419. this.panOffset.multiplyScalar(-e),
  3420. this.panVector.add(this.panOffset)
  3421. }
  3422. ,
  3423. n.prototype.panUp = function(e) {
  3424. var t = this.camera.matrix.elements;
  3425. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3426. this.panOffset.multiplyScalar(-e),
  3427. this.panVector.add(this.panOffset)
  3428. }
  3429. ,
  3430. n.prototype.startRotating = function(e, t) {
  3431. e && this.navRotationAcc("x", e),
  3432. t && this.navRotationAcc("y", t)
  3433. }
  3434. ,
  3435. n.prototype.stopRotating = function(e) {
  3436. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3437. this.navRotationAcc("x", 0),
  3438. this.navRotationAcc("y", 0)
  3439. }
  3440. ,
  3441. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3442. o = new a.Vector3,
  3443. function(e, t) {
  3444. r.copy(this.camera.position),
  3445. void 0 === e && null === e || r.setX(e),
  3446. void 0 === t && null === t || r.setZ(t);
  3447. var i = this.camera.position.distanceTo(this.target)
  3448. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3449. this.targetClamped = !1,
  3450. o.copy(r).addScaledVector(n, i),
  3451. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3452. r.copy(o).addScaledVector(n, -i),
  3453. this.targetClamped = !0),
  3454. this.autoPanPosition.x = r.x,
  3455. this.autoPanPosition.z = r.z,
  3456. this.autoPan && this.stopAutoPanning()
  3457. }
  3458. ),
  3459. n.prototype.stopAutoPanning = function() {
  3460. var e = this.autoPan;
  3461. this.autoPan = !1,
  3462. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3463. }
  3464. ,
  3465. n.prototype.dollyIn = function(e) {
  3466. void 0 === e && (e = this.getZoomScale()),
  3467. this.scale /= e
  3468. }
  3469. ,
  3470. n.prototype.dollyOut = function(e) {
  3471. void 0 === e && (e = this.getZoomScale()),
  3472. this.scale *= e
  3473. }
  3474. ,
  3475. n.prototype.updatePan = function(e) {
  3476. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3477. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3478. this.autoPan) {
  3479. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3480. t.setY(0).clampLength(0, 50 * e),
  3481. this.target.add(t),
  3482. this.camera.position.add(t),
  3483. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3484. this.stopAutoPanning())
  3485. }
  3486. }
  3487. ,
  3488. n.prototype.update = function(e) {
  3489. e = e || 1 / 60,
  3490. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3491. this.rotateLeft(-this.rotationSpeed.x),
  3492. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3493. this.updatePan(e);
  3494. var t = this.camera.position;
  3495. this.offset.copy(t).sub(this.target);
  3496. var i = Math.atan2(this.offset.x, this.offset.z)
  3497. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3498. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3499. i += this.thetaDelta,
  3500. n += this.phiDelta,
  3501. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3502. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3503. var r = this.updateZoom();
  3504. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3505. this.target.add(this.panVector),
  3506. this.targetBounds.clampPoint(this.target, this.target),
  3507. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3508. this.offset.y = r * Math.cos(n),
  3509. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3510. t.copy(this.target).add(this.offset),
  3511. this.camera.lookAt(this.target),
  3512. this.thetaDelta = 0,
  3513. this.phiDelta = 0,
  3514. this.scale = 1,
  3515. this.panVector.set(0, 0, 0),
  3516. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3517. }
  3518. ,
  3519. n.prototype.getAutoRotationAngle = function() {
  3520. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3521. }
  3522. ,
  3523. n.prototype.getZoomScale = function() {
  3524. return Math.pow(.95, this.zoomSpeed)
  3525. }
  3526. ,
  3527. n.prototype.onMouseDown = function(e) {
  3528. if (this.enabled) {
  3529. switch (e.preventDefault(),
  3530. this.stopAutoPanning(),
  3531. this.mouseDown = !0,
  3532. this.state = this.mouseActions[e.button],
  3533. this.state) {
  3534. case u.ROTATE:
  3535. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3536. this.rotationSpeed.set(0, 0);
  3537. break;
  3538. case u.DOLLY:
  3539. this.dollyStart.set(e.clientX, e.clientY);
  3540. break;
  3541. case u.PAN:
  3542. this.panStart.set(e.clientX, e.clientY)
  3543. }
  3544. this.emit(f.InputStart, "mouse")
  3545. }
  3546. }
  3547. ,
  3548. n.prototype.onMouseMove = function(e) {
  3549. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3550. switch (e.preventDefault(),
  3551. this.state) {
  3552. case u.ROTATE:
  3553. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3554. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3555. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3556. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3557. this.rotateStart.copy(this.rotateEnd);
  3558. break;
  3559. case u.DOLLY:
  3560. this.dollyEnd.set(e.clientX, e.clientY),
  3561. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3562. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3563. this.dollyStart.copy(this.dollyEnd);
  3564. break;
  3565. case u.PAN:
  3566. this.panEnd.set(e.clientX, e.clientY),
  3567. this.panDelta.subVectors(this.panEnd, this.panStart),
  3568. this.pan(this.panDelta.x, this.panDelta.y),
  3569. this.panStart.copy(this.panEnd)
  3570. }
  3571. this.emit(f.Move, "mouse"),
  3572. this.lastMoveTime = e.timeStamp,
  3573. this.update()
  3574. }
  3575. }
  3576. ,
  3577. n.prototype.onMouseUp = function(e) {
  3578. this.enabled && (this.mouseDown = !1,
  3579. this.state = u.NONE,
  3580. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3581. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3582. this.update(),
  3583. this.rotationAcceleration.set(0, 0),
  3584. this.rotateDelta.set(0, 0)))
  3585. }
  3586. ,
  3587. n.prototype.onMouseOver = function(e) {
  3588. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3589. }
  3590. ,
  3591. n.prototype.onMouseWheel = function(e) {
  3592. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3593. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3594. this.update())
  3595. }
  3596. ,
  3597. n.prototype.onKeyDown = function(e) {
  3598. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3599. this.handleKeyDown(e.which)))
  3600. }
  3601. ,
  3602. n.prototype.navRotationAcc = function(e, t) {
  3603. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3604. }
  3605. ,
  3606. n.prototype.navPanAcc = function(e, t) {
  3607. this.stopAutoPanning(),
  3608. this.panAcceleration[e] = t
  3609. }
  3610. ,
  3611. n.prototype.handleKeyDown = function(e) {
  3612. var t = !0;
  3613. switch (e) {
  3614. case p.UPARROW:
  3615. case p.I:
  3616. this.navRotationAcc("y", 1);
  3617. break;
  3618. case p.DOWNARROW:
  3619. case p.K:
  3620. this.navRotationAcc("y", -1);
  3621. break;
  3622. case p.LEFTARROW:
  3623. case p.J:
  3624. this.navRotationAcc("x", -1);
  3625. break;
  3626. case p.RIGHTARROW:
  3627. case p.L:
  3628. this.navRotationAcc("x", 1);
  3629. break;
  3630. case p.W:
  3631. this.navPanAcc("y", 1);
  3632. break;
  3633. case p.S:
  3634. this.navPanAcc("y", -1);
  3635. break;
  3636. case p.A:
  3637. this.navPanAcc("x", -1);
  3638. break;
  3639. case p.D:
  3640. this.navPanAcc("x", 1);
  3641. break;
  3642. default:
  3643. t = !1
  3644. }
  3645. t && this.emit(f.Move, "key")
  3646. }
  3647. ,
  3648. n.prototype.onKeyUp = function(e) {
  3649. this.enabled && (e.preventDefault(),
  3650. e.stopPropagation(),
  3651. this.handleKeyUp(e.which))
  3652. }
  3653. ,
  3654. n.prototype.handleKeyUp = function(e) {
  3655. switch (e) {
  3656. case p.I:
  3657. case p.K:
  3658. case p.UPARROW:
  3659. case p.DOWNARROW:
  3660. this.keyboardZoomSpeed = 0,
  3661. this.rotationAcceleration.y = 0;
  3662. break;
  3663. case p.J:
  3664. case p.L:
  3665. case p.LEFTARROW:
  3666. case p.RIGHTARROW:
  3667. this.rotationAcceleration.x = 0;
  3668. break;
  3669. case p.S:
  3670. case p.W:
  3671. this.panAcceleration.y = 0;
  3672. break;
  3673. case p.A:
  3674. case p.D:
  3675. this.panAcceleration.x = 0
  3676. }
  3677. }
  3678. ,
  3679. n.prototype.onTouchStart = function(i) {
  3680. if (this.enabled || this.state === u.NONE) {
  3681. i.preventDefault(),
  3682. i.stopPropagation(),
  3683. this.stopAutoPanning();
  3684. var e = function() {
  3685. if (2 === i.touches.length) {
  3686. var e = i.touches[0].pageX - i.touches[1].pageX
  3687. , t = i.touches[0].pageY - i.touches[1].pageY;
  3688. this.dollyStart.set(e, t)
  3689. }
  3690. }
  3691. .bind(this)
  3692. , t = function() {
  3693. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3694. }
  3695. .bind(this)
  3696. , n = function() {
  3697. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3698. }
  3699. .bind(this);
  3700. switch (this.state = this.touchActions[i.touches.length],
  3701. this.state) {
  3702. case u.PAN_DOLLY:
  3703. e();
  3704. case u.PAN:
  3705. t();
  3706. break;
  3707. case u.ROTATE_DOLLY:
  3708. e();
  3709. case u.ROTATE:
  3710. n()
  3711. }
  3712. this.rotationSpeed.set(0, 0),
  3713. this.emit(f.InputStart, "touch")
  3714. }
  3715. }
  3716. ,
  3717. n.prototype.onTouchMove = function(a) {
  3718. if (this.enabled && this.state !== u.NONE) {
  3719. a.preventDefault(),
  3720. a.stopPropagation();
  3721. var s = function() {
  3722. var e = a.touches[0].pageX - a.touches[1].pageX
  3723. , t = a.touches[0].pageY - a.touches[1].pageY;
  3724. this.dollyEnd.set(e, t);
  3725. var i = this.dollyStart.length() - this.dollyEnd.length();
  3726. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3727. this.dollyStart.copy(this.dollyEnd)
  3728. }
  3729. .bind(this)
  3730. , e = function() {
  3731. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3732. this.panDelta.subVectors(this.panEnd, this.panStart),
  3733. this.pan(this.panDelta.x, this.panDelta.y),
  3734. this.panStart.copy(this.panEnd),
  3735. this.rotateDelta.set(0, 0)
  3736. }
  3737. .bind(this)
  3738. , l = function() {
  3739. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3740. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3741. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3742. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3743. this.rotateStart.copy(this.rotateEnd)
  3744. }
  3745. .bind(this)
  3746. , t = function() {
  3747. if (2 === a.touches.length) {
  3748. var e = window.devicePixelRatio || 1
  3749. , t = a.touches[1].pageX - a.touches[0].pageX
  3750. , i = a.touches[1].pageY - a.touches[0].pageY
  3751. , n = Math.sqrt(t * t + i * i);
  3752. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3753. this.state = u.DOLLY,
  3754. s();
  3755. else {
  3756. var r = h.average(a.touches, "pageX")
  3757. , o = h.average(a.touches, "pageY");
  3758. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3759. this.rotateStart.set(r, o),
  3760. l())
  3761. }
  3762. }
  3763. }
  3764. .bind(this);
  3765. switch (this.state) {
  3766. case u.PAN_DOLLY:
  3767. s();
  3768. case u.PAN:
  3769. e();
  3770. break;
  3771. case u.ROTATE_DOLLY:
  3772. t();
  3773. break;
  3774. case u.DOLLY:
  3775. s();
  3776. break;
  3777. case u.ROTATE:
  3778. l();
  3779. break;
  3780. default:
  3781. this.state = u.NONE
  3782. }
  3783. this.lastMoveTime = a.timeStamp,
  3784. this.emit(f.Move, "touch")
  3785. }
  3786. }
  3787. ,
  3788. n.prototype.onTouchEnd = function(e) {
  3789. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3790. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3791. this.state = u.NONE,
  3792. this.update(),
  3793. this.rotationAcceleration.set(0, 0),
  3794. this.rotateDelta.set(0, 0))
  3795. }
  3796. ,
  3797. n.prototype.onPointerDown = function(e) {
  3798. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3799. id: e.pointerId,
  3800. pageX: e.pageX,
  3801. pageY: e.pageY
  3802. }),
  3803. e.touches = this.pointers,
  3804. this.onTouchStart(e)),
  3805. this.emit(f.InputStart, "pointer"))
  3806. }
  3807. ,
  3808. n.prototype.onPointerMove = function(t) {
  3809. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3810. t.pointerId === e.id && (e.pageX = t.pageX,
  3811. e.pageY = t.pageY)
  3812. }),
  3813. t.touches = this.pointers,
  3814. this.onTouchMove(t))
  3815. }
  3816. ,
  3817. n.prototype.onPointerUp = function(i) {
  3818. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3819. i.pointerId === e.id && this.pointers.splice(t, 1)
  3820. }
  3821. .bind(this)),
  3822. i.touches = this.pointers,
  3823. this.onTouchEnd(i))
  3824. }
  3825. ,
  3826. n.prototype.reset = function() {
  3827. this.state = u.NONE,
  3828. this.stopAutoPanning(),
  3829. this.rotationSpeed.set(0, 0),
  3830. this.rotationAcceleration.set(0, 0),
  3831. this.panSpeed.set(0, 0),
  3832. this.panAcceleration.set(0, 0)
  3833. }
  3834. ,
  3835. n.prototype.toJSON = function() {
  3836. return {
  3837. camera_position: {
  3838. x: s.toPrecision(this.camera.position.x, 4),
  3839. y: s.toPrecision(this.camera.position.y, 4),
  3840. z: s.toPrecision(this.camera.position.z, 4)
  3841. },
  3842. camera_quaternion: {
  3843. x: s.toPrecision(this.camera.quaternion.x, 4),
  3844. y: s.toPrecision(this.camera.quaternion.y, 4),
  3845. z: s.toPrecision(this.camera.quaternion.z, 4),
  3846. w: s.toPrecision(this.camera.quaternion.w, 4)
  3847. }
  3848. }
  3849. }
  3850. ,
  3851. t.exports = n
  3852. }
  3853. , {
  3854. "../enum/ControlActions": 20,
  3855. "../enum/ControlEvents": 21,
  3856. "../enum/Keys": 30,
  3857. "../enum/MouseButton": 34,
  3858. "../enum/Vectors": 50,
  3859. "../settings": 166,
  3860. "../util/common": 185,
  3861. "../util/math": 190,
  3862. events: 202,
  3863. three: 217
  3864. }],
  3865. 13: [function(u, d, e) {
  3866. (function(e) {
  3867. "use strict";
  3868. function t(e) {
  3869. this.camera = e,
  3870. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3871. this.lookVector = new s.Vector3,
  3872. this.lookSpeed = .05,
  3873. this.rotationAcc = new s.Vector2,
  3874. this.rotationSpeed = new s.Vector2,
  3875. this.lat = 0,
  3876. this.lon = 0,
  3877. this.phi = 0,
  3878. this.theta = 0,
  3879. this.enabled = !1,
  3880. this.locked = !1,
  3881. this.pointer = new s.Vector2(0,0),
  3882. this.rotationHistory = [],
  3883. this.rotationDifference = new s.Vector2,
  3884. this.pointerDragOn = !1,
  3885. this.pointerDragStart = new s.Vector2(0,0),
  3886. this.pinchDistance = 0,
  3887. this.moveStart = new s.Vector2,
  3888. this.moveTolerance = .01,
  3889. this.pointersLimit = 2,
  3890. this.pointers = []
  3891. }
  3892. var s = u("three")
  3893. , i = u("../util/logger")
  3894. , n = u("../settings")
  3895. , r = u("../util/common")
  3896. , o = u("../util/math")
  3897. , a = (u("../enum/Vectors"),
  3898. u("../enum/MouseButton"))
  3899. , l = u("../enum/Keys")
  3900. , c = u("../enum/ControlEvents")
  3901. , h = u("events").EventEmitter;
  3902. new i(e),
  3903. (t.prototype = Object.create(h.prototype)).usable = function() {
  3904. return this.enabled && !this.locked
  3905. }
  3906. ,
  3907. /* t.prototype.lookAt = function(e) {
  3908. var t = this.camera.position.clone().sub(e)
  3909. , i = Math.atan(t.z / t.x);
  3910. i += t.x < 0 ? Math.PI : 0,
  3911. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3912. this.lon = s.Math.radToDeg(i) + 180;
  3913. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3914. , r = Math.atan(t.y / n);
  3915. this.lat = -s.Math.radToDeg(r)
  3916. } */
  3917. t.prototype.lookAt = function(aim, dir) {
  3918. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  3919. var i = Math.atan(t.z / t.x);
  3920. i += t.x < 0 ? Math.PI : 0;
  3921. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  3922. this.lon = s.Math.radToDeg(i) + 180;
  3923. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  3924. o = Math.atan(t.y / n);
  3925. this.lat = -s.Math.radToDeg(o);
  3926. }
  3927. ,
  3928. t.prototype.startRotationFrom = function(e, t) {
  3929. o.convertScreenPositionToNDC(e, t, this.pointer),
  3930. this.pointerDragOn = !0,
  3931. this.pointerDragStart.copy(this.pointer),
  3932. this.moveStart.copy(this.pointer),
  3933. this.rotationHistory = [],
  3934. this.rotationSpeed.set(0, 0)
  3935. }
  3936. ,
  3937. t.prototype.onMouseOver = function(e) {
  3938. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3939. }
  3940. ,
  3941. t.prototype.onTouchStart = function(e) {
  3942. if (this.usable()) {
  3943. switch (e.preventDefault(),
  3944. e.stopPropagation(),
  3945. e.touches.length) {
  3946. case 1:
  3947. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3948. break;
  3949. case 2:
  3950. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3951. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3952. this.pinchDistance = Math.sqrt(t * t + i * i)
  3953. }
  3954. this.emit(c.InputStart, "touch")
  3955. }
  3956. }
  3957. ,
  3958. t.prototype.onPointerDown = function(e) {
  3959. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3960. id: e.pointerId,
  3961. clientX: e.clientX,
  3962. clientY: e.clientY
  3963. }),
  3964. e.touches = this.pointers,
  3965. this.onTouchStart(e),
  3966. this.emit(c.InputStart, "pointer"))
  3967. }
  3968. ,
  3969. t.prototype.onMouseDown = function(e) {
  3970. if (this.usable()) {
  3971. switch (e.preventDefault(),
  3972. e.stopPropagation(),
  3973. e.button) {
  3974. case a.LEFT:
  3975. this.startRotationFrom(e.clientX, e.clientY)
  3976. }
  3977. this.emit(c.InputStart, "mouse")
  3978. }
  3979. }
  3980. ,
  3981. t.prototype.updateRotation = function() {
  3982. if (this.usable() && this.pointerDragOn) {
  3983. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3984. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3985. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3986. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3987. , r = Math.atan2(e.y, i)
  3988. , o = Math.atan2(t.y, n);
  3989. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3990. e.y = 0,
  3991. t.y = 0;
  3992. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3993. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  3994. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  3995. this.pointerDragStart.copy(this.pointer)
  3996. }
  3997. }
  3998. ,
  3999. t.prototype.onMouseMove = function(e) {
  4000. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4001. 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"))
  4002. }
  4003. ,
  4004. t.prototype.onTouchMove = function(e) {
  4005. if (this.usable())
  4006. switch (this.emit(c.Move, "touch"),
  4007. e.touches.length) {
  4008. case 1:
  4009. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4010. break;
  4011. case 2:
  4012. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4013. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4014. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4015. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4016. this.emit(c.Pinch, n),
  4017. this.pinchDistance -= n)
  4018. }
  4019. }
  4020. ,
  4021. t.prototype.onPointerMove = function(t) {
  4022. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4023. t.pointerId === e.id && (e.clientX = t.clientX,
  4024. e.clientY = t.clientY)
  4025. }),
  4026. t.touches = this.pointers,
  4027. this.onTouchMove(t))
  4028. }
  4029. ,
  4030. t.prototype.endRotation = function() {
  4031. this.pointerDragOn = !1;
  4032. var e = r.averageVectors(this.rotationHistory);
  4033. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4034. }
  4035. ,
  4036. t.prototype.onTouchEnd = function(e) {
  4037. this.usable() && (e.preventDefault(),
  4038. e.stopPropagation(),
  4039. this.endRotation())
  4040. }
  4041. ,
  4042. t.prototype.onMouseUp = function(e) {
  4043. this.usable() && (e.preventDefault(),
  4044. e.stopPropagation(),
  4045. this.endRotation())
  4046. }
  4047. ,
  4048. t.prototype.onPointerUp = function(i) {
  4049. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4050. i.pointerId === e.id && this.pointers.splice(t, 1)
  4051. }
  4052. .bind(this)),
  4053. i.touches = this.pointers,
  4054. this.onTouchEnd(i))
  4055. }
  4056. ,
  4057. t.prototype.update = function(e) {
  4058. for (this.lon,
  4059. this.lat,
  4060. this.updateRotation(),
  4061. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4062. this.rotationHistory.shift();
  4063. this.lon += this.rotationDifference.x,
  4064. this.lat += this.rotationDifference.y,
  4065. this.rotationDifference.set(0, 0),
  4066. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4067. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4068. this.lon += this.rotationSpeed.x * e,
  4069. this.lat += this.rotationSpeed.y * e
  4070. var insideLookLimitDown = n.insideLookLimitDown - n.insideFOV/2 + this.camera.fov / 2
  4071. var insideLookLimitUp = n.insideLookLimitUp + n.insideFOV/2 - this.camera.fov / 2
  4072. 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 );
  4073. //this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4074. this.phi = s.Math.degToRad(90 - this.lat),
  4075. this.theta = s.Math.degToRad(this.lon),
  4076. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4077. this.lookVector.y = Math.cos(this.phi),
  4078. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4079. this.target.copy(this.lookVector).add(this.camera.position),
  4080. this.camera.lookAt(this.target)
  4081. }
  4082. ,
  4083. t.prototype.onMouseWheel = function(e) {
  4084. if (this.usable()) {
  4085. var t = e.wheelDelta || -e.detail;
  4086. this.emit(c.InteractionDirect),
  4087. this.emit(c.Scroll, t)
  4088. }
  4089. }
  4090. ,
  4091. t.prototype.onKeyDown = function(e) {
  4092. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4093. this.handleKeyDown(e.which)))
  4094. }
  4095. ,
  4096. t.prototype.handleKeyDown = function(e) {
  4097. var t = function(e, t) {
  4098. this.rotationAcc[e] = t
  4099. }
  4100. .bind(this);
  4101. this.emit(c.InteractionKey);
  4102. var i = !0;
  4103. switch (e) {
  4104. case l.LEFTARROW:
  4105. case l.J:
  4106. t("x", -1);
  4107. break;
  4108. case l.RIGHTARROW:
  4109. case l.L:
  4110. t("x", 1);
  4111. break;
  4112. case l.I:
  4113. t("y", 1);
  4114. break;
  4115. case l.K:
  4116. t("y", -1);
  4117. break;
  4118. default:
  4119. i = !1
  4120. }
  4121. i && this.emit(c.Move, "key")
  4122. }
  4123. ,
  4124. t.prototype.onKeyUp = function(e) {
  4125. this.usable() && (e.preventDefault(),
  4126. e.stopPropagation(),
  4127. this.handleKeyUp(e.which))
  4128. }
  4129. ,
  4130. t.prototype.handleKeyUp = function(e) {
  4131. switch (e) {
  4132. case l.LEFTARROW:
  4133. case l.J:
  4134. case l.RIGHTARROW:
  4135. case l.L:
  4136. this.rotationAcc.x = 0;
  4137. break;
  4138. case l.I:
  4139. case l.K:
  4140. this.rotationAcc.y = 0
  4141. }
  4142. }
  4143. ,
  4144. t.prototype.startRotating = function(e, t) {
  4145. e && (this.rotationAcc.x = e),
  4146. t && (this.rotationAcc.y = t)
  4147. }
  4148. ,
  4149. t.prototype.stopRotating = function(e) {
  4150. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4151. this.rotationAcc.set(0, 0)
  4152. }
  4153. ,
  4154. t.prototype.reset = function() {
  4155. this.pointerDragOn = !1,
  4156. this.rotationAcc.set(0, 0),
  4157. this.rotationSpeed.set(0, 0),
  4158. this.pointers = []
  4159. }
  4160. ,
  4161. t.prototype.toJSON = function() {
  4162. return {
  4163. camera_position: {
  4164. x: o.toPrecision(this.camera.position.x, 4),
  4165. y: o.toPrecision(this.camera.position.y, 4),
  4166. z: o.toPrecision(this.camera.position.z, 4)
  4167. },
  4168. camera_quaternion: {
  4169. x: o.toPrecision(this.camera.quaternion.x, 4),
  4170. y: o.toPrecision(this.camera.quaternion.y, 4),
  4171. z: o.toPrecision(this.camera.quaternion.z, 4),
  4172. w: o.toPrecision(this.camera.quaternion.w, 4)
  4173. }
  4174. }
  4175. }
  4176. ,
  4177. t.prototype.setStateFromJSON = function(e) {
  4178. this.camera.position.copy(e.camera_position),
  4179. this.camera.quaternion.copy(e.camera_quaternion)
  4180. }
  4181. ,
  4182. d.exports = t
  4183. }
  4184. ).call(this, "/js/controls/PanoramaControls.js")
  4185. }
  4186. , {
  4187. "../enum/ControlEvents": 21,
  4188. "../enum/Keys": 30,
  4189. "../enum/MouseButton": 34,
  4190. "../enum/Vectors": 50,
  4191. "../settings": 166,
  4192. "../util/common": 185,
  4193. "../util/logger": 189,
  4194. "../util/math": 190,
  4195. events: 202,
  4196. three: 217
  4197. }],
  4198. 14: [function(t, i, e) {
  4199. (function(e) {
  4200. "use strict";
  4201. var c = t("three")
  4202. , h = t("../enum/Viewmode")
  4203. , u = new (t("../util/logger"))(e);
  4204. i.exports = {
  4205. serialize: function(e) {
  4206. return encodeURI(JSON.stringify(e))
  4207. },
  4208. deserialize: function(e) {
  4209. function t(e) {
  4210. return e.reduce(function(e, t) {
  4211. return e && "number" == typeof t && !isNaN(t)
  4212. }, !0)
  4213. }
  4214. try {
  4215. var i = JSON.parse(decodeURI(e))
  4216. , n = {
  4217. mode: h.fromInt(i.camera_mode),
  4218. panoId: i.scan_id,
  4219. position: (new c.Vector3).copy(i.camera_position),
  4220. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4221. zoom: i.ortho_zoom,
  4222. floorVisibility: i.floor_visibility
  4223. }
  4224. , r = n.position;
  4225. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4226. var o = n.quaternion;
  4227. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4228. n
  4229. } catch (i) {
  4230. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4231. try {
  4232. var a = e.split(",")
  4233. , s = {
  4234. x: parseFloat(a[2]),
  4235. y: parseFloat(a[3]),
  4236. z: parseFloat(a[4])
  4237. }
  4238. , l = {
  4239. x: parseFloat(a[5]),
  4240. y: parseFloat(a[6]),
  4241. z: parseFloat(a[7]),
  4242. w: parseFloat(a[8])
  4243. };
  4244. return t([s.x, s.y, s.z]) || (s.x = 0,
  4245. s.y = 0,
  4246. s.z = 0),
  4247. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4248. l.y = 0,
  4249. l.z = 0,
  4250. l.w = 1),
  4251. {
  4252. mode: h.fromInt(a[0]),
  4253. panoId: a[1],
  4254. position: (new c.Vector3).copy(s),
  4255. quaternion: (new c.Quaternion).copy(l)
  4256. }
  4257. } catch (t) {
  4258. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4259. }
  4260. }
  4261. return null
  4262. }
  4263. }
  4264. }
  4265. ).call(this, "/js/controls/serializer.js")
  4266. }
  4267. , {
  4268. "../enum/Viewmode": 51,
  4269. "../util/logger": 189,
  4270. three: 217
  4271. }],
  4272. 15: [function(C, I, e) {
  4273. (function(e) {
  4274. "use strict";
  4275. function t() {
  4276. this.endlessLoop = r.warp.loop,
  4277. this.clock = new i.Clock(!0),
  4278. this.model = null,
  4279. this.player = null,
  4280. this.currentItem = null,
  4281. this.destinationItem = null,
  4282. this.tourIsPlaying = !1,
  4283. this.transitionStage = v.None,
  4284. this.nextFunc = null,
  4285. this.onTheBus = !1,
  4286. this.tourInProgress = !1,
  4287. this.reachSource = null,
  4288. this.interrupted = !1,
  4289. this.nItems = 0,
  4290. this.walkingSectionPaused = !1
  4291. }
  4292. var i = C("three")
  4293. , n = C("./util/logger")
  4294. , r = C("./settings")
  4295. , o = C("./util/transitions")
  4296. , a = C("events").EventEmitter
  4297. , s = C("./enum/Viewmode")
  4298. , l = C("./analytics")
  4299. , c = C("./enum/WarpStyle")
  4300. , h = (o = C("./util/transitions"),
  4301. C("./model/ModelManager"),
  4302. C("./enum/ModelManagerEvents"))
  4303. , u = C("./enum/DirectorEvents")
  4304. , d = C("./enum/PlayerEvents")
  4305. , p = (C("./enum/ControlEvents"),
  4306. C("./enum/BlackoutStyle"))
  4307. , f = C("./enum/PathDiscardMode")
  4308. , g = C("./enum/PathDisplayMode")
  4309. , m = (C("./player"),
  4310. new n(e))
  4311. , v = Object.freeze({
  4312. None: 0,
  4313. Moving: 1,
  4314. Aiming: 2,
  4315. Interlude: 3
  4316. })
  4317. , y = Object.freeze({
  4318. Forward: 1,
  4319. NoChange: 0,
  4320. Backwards: -1
  4321. })
  4322. , A = o.getUniqueId();
  4323. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4324. this.player = e,
  4325. this.modelManager = t,
  4326. this.updateModel(),
  4327. this.resetAll(),
  4328. this.bindEvents()
  4329. }
  4330. ,
  4331. t.prototype.resetAll = function() {
  4332. if (this.currentItem = null,
  4333. this.destinationItem = null,
  4334. this.tourIsPlaying = !1,
  4335. //this.bgmReplay(),
  4336. this.transitionStage = v.None,
  4337. this.nextFunc = null,
  4338. this.onTheBus = !1,
  4339. this.reachSource = null,
  4340. this.interrupted = !1,
  4341. this.model) {
  4342. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4343. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4344. } else
  4345. this.defaultWarpStyle = c.BLACK,
  4346. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4347. this.resetSpecialTransition()
  4348. }
  4349. ,
  4350. t.prototype.updateModel = function() {
  4351. this.model = this.modelManager.getActiveModel(),
  4352. this.nItems = this.model.heroLocations.length
  4353. }
  4354. ,
  4355. t.prototype.bindEvents = function() {
  4356. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4357. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4358. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4359. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4360. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4361. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4362. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4363. this.player.once(d.Move, function() {
  4364. o.cancelById(A)
  4365. })
  4366. }
  4367. ,
  4368. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4369. return /* e === c.WALK && ( */this.interrupt(p.NONE),
  4370. this.pauseWalkingSection(),
  4371. this.player.fastForwardActivePanoFlight(),
  4372. !0/* ) */
  4373. }
  4374. ,
  4375. t.prototype.handlePlayerMove = function(e) {
  4376. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4377. this.emit("update.controls")
  4378. }
  4379. ,
  4380. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4381. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4382. this.emit("update.controls"))
  4383. }
  4384. ,
  4385. t.prototype.handlePlayerModeChanged = function(e, t) {
  4386. this.intermediateState() || e === t || (this.onTheBus = !1,
  4387. this.emit("update.controls"))
  4388. }
  4389. ,
  4390. t.prototype.handlePlayerInputStart = function(e) {
  4391. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4392. }
  4393. ,
  4394. t.prototype.handlePlayerFlyingStarted = function() {
  4395. this.clearWalkingSectionPaused()
  4396. }
  4397. ,
  4398. t.prototype.describe = function() {
  4399. return {
  4400. nItems: this.nItems,
  4401. currentItem: this.currentItem,
  4402. destinationItem: this.destinationItem,
  4403. tourIsPlaying: this.tourIsPlaying,
  4404. onTheBus: this.onTheBus,
  4405. endlessLoop: this.endlessLoop,
  4406. viewMode: this.player.mode,
  4407. inTransition: this._inTransition(),
  4408. transitionStage: this.transitionStage,
  4409. tourInProgress: this.tourInProgress
  4410. }
  4411. }
  4412. ,
  4413. t.prototype._inTransition = function() {
  4414. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4415. }
  4416. ,
  4417. t.prototype.bounceable = function() {
  4418. var e = this.clock.getDelta();
  4419. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4420. }
  4421. ,
  4422. t.prototype.itemCompare = function(item1, item2, type){//add
  4423. if(type == 'equal'){//==
  4424. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4425. }else if(type == 'less'){//<
  4426. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4427. }
  4428. }
  4429. t.prototype.currentMoveDirection = function() {
  4430. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4431. 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
  4432. }
  4433. ,
  4434. t.prototype.clearPath = function() {
  4435. this._inTransition() || this.player.path.discardPathObject()
  4436. }
  4437. ,
  4438. t.prototype.allFloors = function() {
  4439. this.model.toggleAllFloors()
  4440. }
  4441. ,
  4442. t.prototype.actionComplete = function(e) {
  4443. if (this.interrupted = !1,
  4444. this.transitionStage = v.None,
  4445. this.resetSpecialTransition(),
  4446. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4447. this.tourIsPlaying || (this.player.disablePreRendering(),
  4448. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4449. this.emit("update.controls"),
  4450. this.nextFunc) {
  4451. var t = this.nextFunc;
  4452. this.nextFunc = null,
  4453. t()
  4454. }
  4455. }
  4456. ,
  4457. t.prototype.awaitCompletion = function(e, t) {
  4458. this.nextFunc = t,
  4459. e()
  4460. }
  4461. ,
  4462. t.prototype.updateSuccessFunction = function(e) {
  4463. this.nextFunc = e
  4464. }
  4465. ,
  4466. t.prototype.interrupt = function(e, t) {
  4467. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4468. this.tourIsPlaying = !1,
  4469. //this.bgmReplay(),
  4470. this.interrupted = !0,
  4471. this.nextFunc = null,
  4472. this.emit(u.ActionInterrupted),
  4473. null != e || (e = p.BEGINNING),
  4474. this.player.interruptAndFastForward(e, t),
  4475. !0)
  4476. }
  4477. ,
  4478. t.prototype.wouldInterrupt = function() {
  4479. return this.transitionStage !== v.None
  4480. }
  4481. ,
  4482. t.prototype.intermediateState = function() {
  4483. return this.transitionStage !== v.None
  4484. }
  4485. ,
  4486. t.prototype.isInterrupted = function() {
  4487. return this.interrupted
  4488. }
  4489. ,
  4490. t.prototype.pauseWalkingSection = function() {
  4491. this.walkingSectionPaused = !0
  4492. }
  4493. ,
  4494. t.prototype.clearWalkingSectionPaused = function() {
  4495. this.walkingSectionPaused = !1
  4496. }
  4497. ,
  4498. t.prototype.autoTour = function() {
  4499. var i = Date.now();
  4500. this.model.auxDataPromise.then(function() {
  4501. i = Date.now() - i;
  4502. var e = r.warp.auto
  4503. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4504. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4505. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4506. done: function() {
  4507. this.playTour()
  4508. }
  4509. .bind(this),
  4510. name: "_atr",
  4511. id: A
  4512. })
  4513. }
  4514. .bind(this))
  4515. }
  4516. ,
  4517. t.prototype.atDestinationPano = function() {
  4518. if (!this.player.currentPano || null === this.destinationItem)
  4519. return !1;
  4520. var e = this.player.currentPano.id;
  4521. if (void 0 === e)
  4522. return !1;
  4523. var t = this.model.heroLocations;
  4524. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4525. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4526. return destination && destination.panoId == e
  4527. }
  4528. ,
  4529. t.prototype.redirectToItem = function(e, t) {
  4530. if (null != e)
  4531. if (this.wouldInterrupt())
  4532. if (this.player.mode !== s.TRANSITIONING) {
  4533. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4534. var i = function() {
  4535. o.setTimeout(function() {
  4536. this.setDestinationItem(e),
  4537. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4538. }
  4539. .bind(this), 0)
  4540. }
  4541. .bind(this);
  4542. this.interrupt(p.END, 0),
  4543. this.updateSuccessFunction(i)
  4544. } else
  4545. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4546. else
  4547. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4548. else
  4549. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4550. }
  4551. ,
  4552. t.prototype.useSpecialTransition = function(e) {
  4553. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4554. this.nextWarpStyle = c.BLACK
  4555. }
  4556. ,
  4557. t.prototype.resetSpecialTransition = function() {
  4558. this.nextWarpStyle = this.defaultWarpStyle
  4559. }
  4560. ,
  4561. t.prototype.arrivedAtDestination = function(e) {
  4562. if (this.player.flying || this.player.isWarping())
  4563. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4564. else {
  4565. this.transitionStage = v.Aiming;
  4566. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4567. this.player.model.fadePanoMarkers(0),
  4568. this.awaitCompletion(function() {
  4569. this.resetSpecialTransition(),
  4570. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4571. }
  4572. .bind(this), t)
  4573. }
  4574. }
  4575. ,
  4576. t.prototype.goToDestination = function(e, t, i, n) {
  4577. //音频
  4578. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4579. if(musicInfo && musicInfo.music){
  4580. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4581. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4582. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4583. let audioSrc2 = common.getFileNameFromUrl(src)
  4584. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4585. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4586. SoundManager.play('tour',null,0) // currentTime = 0;
  4587. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4588. SoundManager.play('tour')//继续播。 如果不是< 说明播完了,item[1]不为0应该是继续播放就不需要从头
  4589. }
  4590. }else{//很可能是该folder的起始
  4591. SoundManager.play('tour', manage.dealURL(src))
  4592. }
  4593. }
  4594. if (this.onTheBus = !0,
  4595. this.emit("update.controls"),
  4596. this.player.updateLastView(),
  4597. n || !this.atDestinationPano()){
  4598. if (this.player.flying || this.player.isWarping())
  4599. m.warn("Cannot go to new destination while player is flying or warping.");
  4600. else {
  4601. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4602. , s = null
  4603. , l = null;
  4604. if (a.isPano()) {
  4605. var o1 = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4606. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o1, !0, i, this.actionComplete.bind(this)),
  4607. s = this.arrivedAtDestination.bind(this, !0)
  4608. //add
  4609. if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
  4610. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4611. }
  4612. } else{
  4613. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4614. s = this.arrivedAtDestination.bind(this, !1);
  4615. }
  4616. this.transitionStage = v.Moving,
  4617. this.model.fadePanoMarkers(0),
  4618. this.awaitCompletion(function() {
  4619. l()
  4620. }
  4621. .bind(this), s),
  4622. this.emit("update.controls")
  4623. }
  4624. }else{
  4625. //add 原地旋转时, 写到_warpCameraAim里,因那有时间
  4626. /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4627. if(a.zoom && a.zoom != this.player.zoomLevel){
  4628. this.player.smoothZoomFovTo(null, a.zoom, r.warp.teleportTime) //瞬间过渡的时间
  4629. } */
  4630. this.arrivedAtDestination(!0)
  4631. }
  4632. }
  4633. ,
  4634. t.prototype.tourInterlude = function() {
  4635. if (l.trackAlways("reach_highlight", {
  4636. reach_source: this.reachSource
  4637. }),
  4638. this.model.fadePanoMarkers(0),
  4639. this.emit("update.controls"),
  4640. this.tourIsPlaying)
  4641. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4642. this.stopTour(),
  4643. this.emit(u.TourEnd),
  4644. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4645. this.transitionStage = v.Interlude,
  4646. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4647. }
  4648. .bind(this), this.goNext.bind(this))
  4649. }
  4650. ,
  4651. t.prototype.playTour = function() {
  4652. if (!this.bounceable())
  4653. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4654. this.tourInProgress = !0,
  4655. this.reachSource = "play",
  4656. this.tourIsPlaying = !0,
  4657. this.wasZoomEnabled = this.player.zoomEnabled,
  4658. this.player.zoomEnabled = !1,
  4659. this.resetSpecialTransition(),
  4660. this.emit("update.controls"),
  4661. this.emit(u.TourStart),
  4662. this.player.enablePreRendering(),
  4663. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4664. this.goToDestination()) : this.goNext()))
  4665. }
  4666. ,
  4667. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4668. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4669. this.tourIsPlaying = !1,
  4670. //(!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4671. this.interrupt(),
  4672. this.clearWalkingSectionPaused(),
  4673. this.resetSpecialTransition(),
  4674. this.emit("update.controls"))
  4675. }
  4676. ,
  4677. t.prototype.endTourProgress = function() {
  4678. this.tourInProgress = !1,
  4679. this.emit("update.controls"),
  4680. this.emit(u.TourEnd)
  4681. }
  4682. ,
  4683. t.prototype.goToHighlight = function(e) {
  4684. if (this.wouldInterrupt())
  4685. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4686. else {
  4687. if (m.debug("<tour.goto " + e + ">"),
  4688. this.isInterrupted())
  4689. return;
  4690. this.clearWalkingSectionPaused(),
  4691. this.setDestinationItem(e),
  4692. this.useSpecialTransition("Hilight"),
  4693. this.goToDestination(true),//add true
  4694. l.trackAlways("reach_highlight", {
  4695. reach_source: "thumb"
  4696. })
  4697. }
  4698. }
  4699. ,
  4700. t.prototype.prevHighlight = function() {
  4701. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4702. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4703. this.reachSource = "prev",
  4704. this.goPrev()))
  4705. }
  4706. ,
  4707. t.prototype.nextHighlight = function() {
  4708. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4709. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4710. this.reachSource = "next",
  4711. this.goNext()))
  4712. }
  4713. ,
  4714. t.prototype.changeMode = function(e) {
  4715. var t = $.Deferred()
  4716. , i = t.resolve.bind(t)
  4717. , n = t.reject.bind(t);
  4718. if (this.emit(u.StartModeChange),
  4719. !function() {
  4720. return this.clearWalkingSectionPaused(),
  4721. !!this.wouldInterrupt() && (this.interrupt(),
  4722. !0)
  4723. }
  4724. .bind(this)()) {
  4725. switch (e) {
  4726. case s.PANORAMA:
  4727. 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);
  4728. break;
  4729. case s.DOLLHOUSE:
  4730. case s.FLOORPLAN:
  4731. this.player.flyToNewMode({
  4732. mode: e
  4733. }).done(i).fail(n);
  4734. break;
  4735. case s.OUTDOOR:
  4736. 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)
  4737. }
  4738. return t.promise()
  4739. }
  4740. }
  4741. ,
  4742. t.prototype.atEndOfTour = function(item) {
  4743. //return this.currentItem >= this.nItems - 1
  4744. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4745. if(end){
  4746. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4747. if(heroLocations){
  4748. end = this.currentItem[1] >= heroLocations.length - 1
  4749. }
  4750. }
  4751. return end;
  4752. }
  4753. ,
  4754. t.prototype.firstDestination = function() {
  4755. //return 0 < this.nItems ? 0 : null
  4756. return 0 < this.nItems ? [0,0]: null
  4757. }
  4758. ,
  4759. t.prototype.finalDestination = function() {
  4760. //return 0 < this.nItems ? this.nItems - 1 : null
  4761. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4762. }
  4763. ,
  4764. t.prototype.goPrev = function() {
  4765. this.tourAdvance(-1)
  4766. }
  4767. ,
  4768. t.prototype.goNext = function() {
  4769. this.tourAdvance(1)
  4770. }
  4771. ,
  4772. t.prototype.setDestinationItem = function(e) {
  4773. this.destinationItem = e,
  4774. this.emit("update.controls")
  4775. }
  4776. ,
  4777. t.prototype.setCurrentItem = function(e) {
  4778. this.currentItem = e,
  4779. this.emit("update.controls")
  4780. }
  4781. ,
  4782. t.prototype.nextItem = function(currentItem) {
  4783. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4784. if(currentItem == void 0)return this.firstDestination()
  4785. var currentLocation = this.model.heroLocations[currentItem[0]];
  4786. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4787. var item;
  4788. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4789. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4790. }else{
  4791. item = [currentItem[0] , currentItem[1]+1]
  4792. }
  4793. if(item[0] >= this.nItems ){
  4794. item = this.firstDestination()
  4795. }
  4796. return item;
  4797. //暂时不理会endlessLoop,默认为false
  4798. }
  4799. ,
  4800. t.prototype.prevItem = function(currentItem) {
  4801. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4802. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4803. var item;
  4804. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4805. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4806. else{
  4807. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4808. if(this.currentItem[1] == 0){//子目录中第一个
  4809. return [currentItem[0] - 1, lastChildNum-1]
  4810. }else{
  4811. return [currentItem[0], currentItem[1]-1]
  4812. }
  4813. }
  4814. }
  4815. ,
  4816. t.prototype.tourAdvance = function(e) {//e是1或-1
  4817. m.debug("tourAdvance(" + e + ")")
  4818. if(null === this.currentItem || void 0 === this.currentItem){
  4819. this.setDestinationItem(this.firstDestination())
  4820. }else{
  4821. var item
  4822. if(e == 1){
  4823. item = this.nextItem(this.currentItem)
  4824. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  4825. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4826. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4827. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  4828. }else{
  4829. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  4830. } */
  4831. }else if(e == -1){
  4832. item = this.prevItem(this.currentItem)
  4833. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  4834. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  4835. else{
  4836. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4837. if(this.currentItem[1] == 0){//子目录中第一个
  4838. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  4839. }else{
  4840. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  4841. }
  4842. } */
  4843. }
  4844. //this.setDestinationItem(this.currentItem + e)
  4845. this.setDestinationItem(item)
  4846. }
  4847. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4848. this.useSpecialTransition("reverse-looping to end")
  4849. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4850. this.useSpecialTransition("looping back to start")
  4851. }
  4852. /* if(this.destinationItem[0] < 0 ){
  4853. this.setDestinationItem(this.finalDestination())
  4854. this.useSpecialTransition("reverse-looping to end")
  4855. }else{
  4856. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4857. this.useSpecialTransition("looping back to start"))
  4858. } */
  4859. /* var momentTour = this.getMomentTour(this.destinationItem);
  4860. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4861. var i = this.player.zoomLevel;
  4862. this.player.zoomEnabled = !0;
  4863. var t = function(e, t) {
  4864. this.player.zoomTo((1 - e) * i, !0)
  4865. }
  4866. .bind(this);
  4867. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4868. } */
  4869. this.goToDestination()
  4870. }
  4871. ,
  4872. t.prototype.getMomentTour = function(destinationItem) {//add
  4873. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  4874. if(!destinationItem) return wholeMomentTour
  4875. else{
  4876. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  4877. if(currentLocation.momentTour)return currentLocation.momentTour;
  4878. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  4879. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  4880. }
  4881. }
  4882. ,
  4883. I.exports = t
  4884. }
  4885. ).call(this, "/js/director.js")
  4886. }
  4887. , {
  4888. "./analytics": 4,
  4889. "./enum/BlackoutStyle": 18,
  4890. "./enum/ControlEvents": 21,
  4891. "./enum/DirectorEvents": 23,
  4892. "./enum/ModelManagerEvents": 33,
  4893. "./enum/PathDiscardMode": 38,
  4894. "./enum/PathDisplayMode": 39,
  4895. "./enum/PlayerEvents": 40,
  4896. "./enum/Viewmode": 51,
  4897. "./enum/WarpStyle": 52,
  4898. "./model/ModelManager": 140,
  4899. "./player": 155,
  4900. "./settings": 166,
  4901. "./util/logger": 189,
  4902. "./util/transitions": 195,
  4903. events: 202,
  4904. three: 217
  4905. }],
  4906. 16: [function(e, t, i) {
  4907. "use strict";
  4908. var n = e("three")
  4909. , r = e("./enum/Viewmode")
  4910. , o = (e("./settings"),
  4911. e("./util/transitions"))
  4912. , a = e("./enum/PlayerEvents")
  4913. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4914. , l = new n.ShaderPass(n.VerticalBlurShader);
  4915. l.renderToScreen = !0;
  4916. var c = $("#player").width() / $("#player").height();
  4917. isNaN(c) && (c = 1);
  4918. var h = {
  4919. currentBlur: 0,
  4920. aspect: c,
  4921. blurStrength: 1,
  4922. hblurPass: s,
  4923. vblurPass: l,
  4924. bindEvents: function(e) {
  4925. e.on(a.ModeChanged, function(e, t) {
  4926. e === r.PANORAMA && (o.cancel(h.blur),
  4927. o.cancel(h.addBlur),
  4928. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4929. })
  4930. },
  4931. blur: function(e) {
  4932. var t = (h.currentBlur = e) * h.blurStrength;
  4933. l.uniforms.v.value = t / 512 * h.aspect,
  4934. s.uniforms.h.value = t / 512
  4935. },
  4936. addBlur: function(e) {
  4937. e = Math.max(e, h.currentBlur),
  4938. h.blur(e)
  4939. },
  4940. removeBlur: function(e) {
  4941. e = Math.min(1 - e, h.currentBlur),
  4942. h.blur(e)
  4943. }
  4944. };
  4945. h.blur(0),
  4946. t.exports = h
  4947. }
  4948. , {
  4949. "./enum/PlayerEvents": 40,
  4950. "./enum/Viewmode": 51,
  4951. "./settings": 166,
  4952. "./util/transitions": 195,
  4953. three: 217
  4954. }],
  4955. 17: [function(e, t, i) {
  4956. "use strict";
  4957. t.exports = {
  4958. UNKNOWN: 0,
  4959. ALIGNED: 1,
  4960. UNALIGNED: 2,
  4961. PLACED: 3
  4962. }
  4963. }
  4964. , {}],
  4965. 18: [function(e, t, i) {
  4966. "use strict";
  4967. t.exports = {
  4968. NONE: 0,
  4969. MIDDLE: 1,
  4970. END: 2,
  4971. BEGINNING: 3,
  4972. FADEIN: 4
  4973. }
  4974. }
  4975. , {}],
  4976. 19: [function(e, t, i) {
  4977. "use strict";
  4978. var r = e("three");
  4979. t.exports = {
  4980. newBlue: new r.Color(4967932),
  4981. altBlue: new r.Color(47355),
  4982. tagDefault: new r.Color(223357),
  4983. classicBlue: new r.Color(53759),
  4984. mpYellow: new r.Color(16502016),
  4985. mpOrange: new r.Color(16428055),
  4986. mpBlue: new r.Color(12096),
  4987. mpLtGrey: new r.Color(13751252),
  4988. mpDkGrey: new r.Color(10000019),
  4989. mpRed: new r.Color(12525854),
  4990. mpOrangeDesat: new r.Color(16764529),
  4991. mpBlueDesat: new r.Color(4034734),
  4992. mpRedDesat: new r.Color(14705505),
  4993. white: new r.Color(16777215),
  4994. black: new r.Color(0),
  4995. _desat: function(e, t) {
  4996. var i = t || .3
  4997. , n = (new r.Color).copy(e).getHSL();
  4998. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4999. },
  5000. _darken: function(e, t) {
  5001. var i = t || .2
  5002. , n = e.getHSL();
  5003. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5004. }
  5005. }
  5006. }
  5007. , {
  5008. three: 217
  5009. }],
  5010. 20: [function(e, t, i) {
  5011. "use strict";
  5012. t.exports = {
  5013. NONE: -1,
  5014. ROTATE: 0,
  5015. DOLLY: 1,
  5016. PAN: 2,
  5017. ROTATE_DOLLY: 3,
  5018. PAN_DOLLY: 4
  5019. }
  5020. }
  5021. , {}],
  5022. 21: [function(e, t, i) {
  5023. "use strict";
  5024. t.exports = {
  5025. Move: "move",
  5026. InteractionDirect: "interaction.direct",
  5027. InteractionKey: "interaction.key",
  5028. InteractionGui: "interaction.gui",
  5029. FlyInDirection: "fly.direction",
  5030. InputStart: "input.start",
  5031. Pinch: "input.pinch",
  5032. Scroll: "input.scroll",
  5033. AutoPanInterrupt: "autopan.interrupt",
  5034. AutoPanComplete: "autopan.complete",
  5035. AutoPanClamped: "autopan.clamped",
  5036. LongTap: "longtap"
  5037. }
  5038. }
  5039. , {}],
  5040. 22: [function(e, t, i) {
  5041. "use strict";
  5042. t.exports = Object.freeze({
  5043. FORWARD: "FORWARD",
  5044. LEFT: "LEFT",
  5045. RIGHT: "RIGHT",
  5046. BACK: "BACK",
  5047. UP: "UP",
  5048. DOWN: "DOWN"
  5049. })
  5050. }
  5051. , {}],
  5052. 23: [function(e, t, i) {
  5053. "use strict";
  5054. t.exports = {
  5055. ActionInterrupted: "action.interrupted",
  5056. TourStart: "tour.start",
  5057. TourEnd: "tour.end",
  5058. StartModeChange: "mode.startChange"
  5059. }
  5060. }
  5061. , {}],
  5062. 24: [function(e, t, i) {
  5063. "use strict";
  5064. t.exports = Object.freeze({
  5065. None: 0,
  5066. Queued: 1,
  5067. ForceQueued: 2,
  5068. Downloading: 3,
  5069. Downloaded: 4,
  5070. DownloadFailed: 5
  5071. })
  5072. }
  5073. , {}],
  5074. 25: [function(e, t, i) {
  5075. "use strict";
  5076. t.exports = {
  5077. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5078. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5079. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5080. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5081. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5082. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5083. }
  5084. }
  5085. , {}],
  5086. 26: [function(e, t, i) {
  5087. "use strict";
  5088. t.exports = {
  5089. Texture2D: 0,
  5090. TextureCube: 1
  5091. }
  5092. }
  5093. , {}],
  5094. 27: [function(e, t, i) {
  5095. "use strict";
  5096. t.exports = {
  5097. SMALL: "small",
  5098. LARGE: "large"
  5099. }
  5100. }
  5101. , {}],
  5102. 28: [function(e, t, i) {
  5103. "use strict";
  5104. var n = e("./Viewmode")
  5105. , r = {
  5106. LANDING: {},
  5107. NAVIGATION: "navigation",
  5108. MORE_HELP: "moreHelp",
  5109. TOUR_INTERACTION: {}
  5110. };
  5111. r.LANDING[n.PANORAMA] = "panorama.landing",
  5112. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5113. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5114. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5115. r.TOUR_INTERACTION.standard = "standard.tour",
  5116. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5117. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5118. t.exports = r
  5119. }
  5120. , {
  5121. "./Viewmode": 51
  5122. }],
  5123. 29: [function(e, t, i) {
  5124. "use strict";
  5125. var n = {
  5126. UP: 1,
  5127. DOWN: -1,
  5128. LEFT: "L",
  5129. RIGHT: "R",
  5130. FORWARD: "F",
  5131. BACK: "B",
  5132. reverse: {},
  5133. opposite: function(e) {
  5134. return this.reverse[e.toString()]
  5135. }
  5136. };
  5137. n.reverse[n.UP] = n.DOWN,
  5138. n.reverse[n.DOWN] = n.UP,
  5139. n.reverse[n.LEFT] = n.RIGHT,
  5140. n.reverse[n.RIGHT] = n.LEFT,
  5141. n.reverse[n.FORWARD] = n.BACK,
  5142. n.reverse[n.BACK] = n.FORWARD,
  5143. t.exports = n
  5144. }
  5145. , {}],
  5146. 30: [function(e, t, i) {
  5147. "use strict";
  5148. var n = {
  5149. ZERO: 48,
  5150. ONE: 49,
  5151. TWO: 50,
  5152. THREE: 51,
  5153. FOUR: 52,
  5154. FIVE: 53,
  5155. SIX: 54,
  5156. SEVEN: 55,
  5157. EIGHT: 56,
  5158. NINE: 57,
  5159. LEFTARROW: 37,
  5160. UPARROW: 38,
  5161. RIGHTARROW: 39,
  5162. DOWNARROW: 40,
  5163. A: 65,
  5164. B: 66,
  5165. C: 67,
  5166. D: 68,
  5167. E: 69,
  5168. F: 70,
  5169. G: 71,
  5170. H: 72,
  5171. I: 73,
  5172. J: 74,
  5173. K: 75,
  5174. L: 76,
  5175. M: 77,
  5176. N: 78,
  5177. O: 79,
  5178. P: 80,
  5179. Q: 81,
  5180. R: 82,
  5181. S: 83,
  5182. T: 84,
  5183. U: 85,
  5184. V: 86,
  5185. W: 87,
  5186. X: 88,
  5187. Y: 89,
  5188. Z: 90,
  5189. SPACE: 32,
  5190. RETURN: 13,
  5191. SEMICOLON: 186,
  5192. PLUSEQUALS: 187,
  5193. DASHUNDERSCORE: 189,
  5194. OPENBRACKET: 219
  5195. };
  5196. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5197. n.PLUSEQUALS = 61,
  5198. n.DASHUNDERSCORE = 173),
  5199. t.exports = n
  5200. }
  5201. , {
  5202. "../util/browser": 182
  5203. }],
  5204. 31: [function(e, t, i) {
  5205. "use strict";
  5206. t.exports = {
  5207. EN_US: "en-US",
  5208. ES_MX: "es-MX",
  5209. FR_FR: "fr-FR",
  5210. DE_DE: "de-DE",
  5211. RU_RU: "ru-RU",
  5212. CN_CN: "cn-CN",
  5213. JP_JP: "jp-JP"
  5214. }
  5215. }
  5216. , {}],
  5217. 32: [function(e, t, i) {
  5218. "use strict";
  5219. t.exports = {
  5220. TagActivated: "tag.activated",
  5221. TagDismissed: "tag.dismissed",
  5222. TagNavigation: "tag.navigation"
  5223. }
  5224. }
  5225. , {}],
  5226. 33: [function(e, t, i) {
  5227. "use strict";
  5228. t.exports = {
  5229. ModelAdded: "model-added",
  5230. ActiveModelChanged: "active-model-changed"
  5231. }
  5232. }
  5233. , {}],
  5234. 34: [function(e, t, i) {
  5235. "use strict";
  5236. t.exports = {
  5237. LEFT: 0,
  5238. MIDDLE: 1,
  5239. RIGHT: 2
  5240. }
  5241. }
  5242. , {}],
  5243. 35: [function(e, t, i) {
  5244. "use strict";
  5245. t.exports = {
  5246. PanoRenderComplete: "panorama.render.complete",
  5247. TileRenderFailure: "panorama.tile.render.failed",
  5248. TileRenderSuccess: "panorama.tile.render.success",
  5249. TileUploadAttempted: "panorama.tile.upload.attempted",
  5250. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5251. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5252. }
  5253. }
  5254. , {}],
  5255. 36: [function(e, t, i) {
  5256. "use strict";
  5257. t.exports = {
  5258. BASE: 1,
  5259. STANDARD: 2,
  5260. HIGH: 3,
  5261. ULTRAHIGH: 4
  5262. }
  5263. }
  5264. , {}],
  5265. 37: [function(e, t, i) {
  5266. "use strict";
  5267. t.exports = {
  5268. LoadComplete: "panorama.load.complete",
  5269. LoadFailed: "panorama.load.failed",
  5270. TileLoaded: "panorama.tile.loaded"
  5271. }
  5272. }
  5273. , {}],
  5274. 38: [function(e, t, i) {
  5275. "use strict";
  5276. t.exports = Object.freeze({
  5277. Standard: 0,
  5278. Slow: 1,
  5279. Retain: 2
  5280. })
  5281. }
  5282. , {}],
  5283. 39: [function(e, t, i) {
  5284. "use strict";
  5285. t.exports = Object.freeze({
  5286. Show: 0,
  5287. Hide: 1,
  5288. Retain: 2
  5289. })
  5290. }
  5291. , {}],
  5292. 40: [function(e, t, i) {
  5293. "use strict";
  5294. t.exports = {
  5295. Move: "move",
  5296. MoveComplete: "move.complete",
  5297. ModeChanged: "mode.changed",
  5298. ModeChanging: "mode.changing",
  5299. PanoChosen: "pano.chosen",
  5300. ClosestPanoChanging: "closest.pano.changing",
  5301. WarpStarted: "warp.started",
  5302. WarpInterrupted: "warp.interrupted",
  5303. WarpEnded: "warp.ended",
  5304. FlyinFinished: "flyin.finished",
  5305. FlyingStarted: "flying.started",
  5306. FlyingInterrupted: "flying.interrupted",
  5307. FlyingEnded: "flying.ended",
  5308. Ready: "ready",
  5309. StartInside: "start.inside",
  5310. StartOutside: "start.outside",
  5311. ViewChanged: "view.changed",
  5312. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5313. InputStart: "input.start"
  5314. }
  5315. }
  5316. , {}],
  5317. 41: [function(e, t, i) {
  5318. "use strict";
  5319. t.exports = Object.freeze({
  5320. DEFAULT: 0,
  5321. PANOMARKERS: 1,
  5322. RETICULE: 2,
  5323. TAG: 3
  5324. })
  5325. }
  5326. , {}],
  5327. 42: [function(e, t, i) {
  5328. "use strict";
  5329. t.exports = {
  5330. visibleFloor: 1,
  5331. ghostFloor: 3,
  5332. boundingSkybox: 1,
  5333. panoMarker: 2,
  5334. reticule: 3,
  5335. tagStem: 4,
  5336. tagDisc: 5,
  5337. ribbon: 100
  5338. }
  5339. }
  5340. , {}],
  5341. 43: [function(e, t, i) {
  5342. "use strict";
  5343. t.exports = {
  5344. ContextCreated: "scene-renderer-context-created",
  5345. AfterRender: "after-render",
  5346. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5347. }
  5348. }
  5349. , {}],
  5350. 44: [function(e, t, i) {
  5351. "use strict";
  5352. t.exports = {
  5353. IDLE: "idle",
  5354. BROWSE: "browse",
  5355. EXAMINE: "examine"
  5356. }
  5357. }
  5358. , {}],
  5359. 45: [function(e, t, i) {
  5360. "use strict";
  5361. t.exports = {
  5362. TileDownloadSuccess: "tiledownloader.download.success",
  5363. TileDownloadFailure: "tiledownloader.download.failure",
  5364. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5365. }
  5366. }
  5367. , {}],
  5368. 46: [function(e, t, i) {
  5369. "use strict";
  5370. t.exports = {
  5371. CardboardAndroid: "googlevr",
  5372. GearVR: "gearvr",
  5373. CardboardIOS: "googlevrios",
  5374. Cardboard: "googlevr"
  5375. }
  5376. }
  5377. , {}],
  5378. 47: [function(e, t, i) {
  5379. "use strict";
  5380. t.exports = {
  5381. NONE: 0,
  5382. CONTEXTUAL: 1,
  5383. ANDROID: 2
  5384. }
  5385. }
  5386. , {}],
  5387. 48: [function(e, t, i) {
  5388. "use strict";
  5389. var n = {
  5390. Title: 0,
  5391. Cardboard: 1
  5392. }
  5393. , r = {
  5394. Title: 0,
  5395. Cardboard: 1,
  5396. Gear: 2
  5397. };
  5398. [n, r].forEach(function(e) {
  5399. e.pageCount = Object.keys(e).length
  5400. }),
  5401. t.exports.ios = n,
  5402. t.exports.standard = r
  5403. }
  5404. , {}],
  5405. 49: [function(e, t, i) {
  5406. "use strict";
  5407. t.exports = {
  5408. Android: "android",
  5409. IOS: "ios",
  5410. Desktop: "desktop",
  5411. UnsupportedAndroid: "android-unsupported"
  5412. }
  5413. }
  5414. , {}],
  5415. 50: [function(e, t, i) {
  5416. "use strict";
  5417. var n = e("three");
  5418. t.exports = {
  5419. UP: new n.Vector3(0,1,0),
  5420. DOWN: new n.Vector3(0,-1,0),
  5421. LEFT: new n.Vector3(-1,0,0),
  5422. RIGHT: new n.Vector3(1,0,0),
  5423. FORWARD: new n.Vector3(0,0,-1),
  5424. BACK: new n.Vector3(0,0,1)
  5425. }
  5426. }
  5427. , {
  5428. three: 217
  5429. }],
  5430. 51: [function(e, t, i) {
  5431. "use strict";
  5432. var n = e("../exception/ViewmodeConvertException")
  5433. , r = e("./coreViewmodes")
  5434. , o = {
  5435. MESH: "mesh",
  5436. OUTDOOR: "outdoor",
  5437. TRANSITIONING: "transitioning",
  5438. toInt: function(e) {
  5439. switch (e) {
  5440. case this.PANORAMA:
  5441. return 1;
  5442. case this.DOLLHOUSE:
  5443. return 2;
  5444. case this.FLOORPLAN:
  5445. return 3;
  5446. case this.OUTDOOR:
  5447. return 4;
  5448. case this.TRANSITIONING:
  5449. return -1
  5450. }
  5451. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5452. },
  5453. fromInt: function(e) {
  5454. switch (e) {
  5455. case "1":
  5456. case 1:
  5457. return this.PANORAMA;
  5458. case "2":
  5459. case 2:
  5460. return this.DOLLHOUSE;
  5461. case "3":
  5462. case 3:
  5463. return this.FLOORPLAN;
  5464. case "4":
  5465. case 4:
  5466. return this.OUTDOOR
  5467. }
  5468. throw new n("No known conversion for int to viewmode for int: " + e)
  5469. },
  5470. convertWorkshopModeInt: function(e) {
  5471. switch (e) {
  5472. case "0":
  5473. case 0:
  5474. case void 0:
  5475. return this.PANORAMA;
  5476. case "1":
  5477. case 1:
  5478. return this.FLOORPLAN;
  5479. case "2":
  5480. case 2:
  5481. return this.DOLLHOUSE;
  5482. case "3":
  5483. case 3:
  5484. return this.MESH
  5485. }
  5486. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5487. }
  5488. };
  5489. e("../util/common").extendObject(o, r),
  5490. t.exports = o
  5491. }
  5492. , {
  5493. "../exception/ViewmodeConvertException": 58,
  5494. "../util/common": 185,
  5495. "./coreViewmodes": 54
  5496. }],
  5497. 52: [function(e, t, i) {
  5498. "use strict";
  5499. t.exports = {
  5500. BLACK: "black",
  5501. STD: "std",
  5502. WALK: "walk"
  5503. }
  5504. }
  5505. , {}],
  5506. 53: [function(e, t, i) {
  5507. "use strict";
  5508. t.exports = {
  5509. ZoomIn: "zoom.in",
  5510. ZoomOut: "zoom.out",
  5511. ZoomMax: "zoom.max",
  5512. ZoomMin: "zoom.min"
  5513. }
  5514. }
  5515. , {}],
  5516. 54: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. PANORAMA: "panorama",
  5520. DOLLHOUSE: "dollhouse",
  5521. FLOORPLAN: "floorplan"
  5522. }
  5523. }
  5524. , {}],
  5525. 55: [function(e, t, i) {
  5526. "use strict";
  5527. t.exports = function(e) {
  5528. this.message = e
  5529. }
  5530. }
  5531. , {}],
  5532. 56: [function(e, t, i) {
  5533. "use strict";
  5534. function n(e) {
  5535. r.call(this, e)
  5536. }
  5537. var r = e("./BasicException");
  5538. n.prototype = Object.create(r.prototype),
  5539. t.exports = n
  5540. }
  5541. , {
  5542. "./BasicException": 55
  5543. }],
  5544. 57: [function(e, t, i) {
  5545. "use strict";
  5546. function n(e) {
  5547. r.call(this, e)
  5548. }
  5549. var r = e("./BasicException");
  5550. n.prototype = Object.create(r.prototype),
  5551. t.exports = n
  5552. }
  5553. , {
  5554. "./BasicException": 55
  5555. }],
  5556. 58: [function(e, t, i) {
  5557. "use strict";
  5558. function n(e) {
  5559. r.call(this, e)
  5560. }
  5561. var r = e("./BasicException");
  5562. n.prototype = Object.create(r.prototype),
  5563. t.exports = n
  5564. }
  5565. , {
  5566. "./BasicException": 55
  5567. }],
  5568. 59: [function(a, s, e) {
  5569. (function(e) {
  5570. "use strict";
  5571. var i = a("./util/ajax")
  5572. , n = a("./util/showcase")
  5573. , t = a("./util/logger")
  5574. , r = new t(e)
  5575. , o = {};
  5576. s.exports = {
  5577. loadFeatureFlags: function(e) {
  5578. var t = $.Deferred();
  5579. return i.get(e.urlBase + "", {
  5580. responseType: "json",
  5581. prefetchFrom: "user",
  5582. auth: n.getAuthorizationHeader()
  5583. }).done(function(e) {
  5584. (o = function(e) {
  5585. var t = {};
  5586. if (e) {
  5587. var i = e.flags;
  5588. if (i)
  5589. for (var n in i)
  5590. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5591. return t
  5592. }
  5593. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5594. null
  5595. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5596. }).fail(function() {
  5597. r.debug("Retrieval of feature flags failed."),
  5598. t.reject("loading-failed")
  5599. }),
  5600. t.promise()
  5601. },
  5602. getFlags: function() {
  5603. return o
  5604. },
  5605. updateDependentSettings: function(e, t) {
  5606. (e = e || o).labels && (t.labels.enabled = !0),
  5607. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5608. e.showcase_sdk && (t.sdkInit = !0),
  5609. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5610. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5611. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5612. e.hide_sc_sharing && (t.share.enabled = !1)
  5613. }
  5614. }
  5615. }
  5616. ).call(this, "/js/featureflags.js")
  5617. }
  5618. , {
  5619. "./util/ajax": 181,
  5620. "./util/logger": 189,
  5621. "./util/showcase": 193
  5622. }],
  5623. 60: [function(e, t, i) {
  5624. "use strict";
  5625. var n = (e("../util/common"),
  5626. {
  5627. status: 0,
  5628. set: function(e) {
  5629. if (isNaN(e))
  5630. return !1;
  5631. var t = $(".progressbar");
  5632. e < 0 && (e = 0),
  5633. 100 < e && (e = 100);
  5634. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5635. , n = Math.round(e)
  5636. , r = parseInt(i) - 15;
  5637. t.find(".bar").css("width", i),
  5638. t.find(".label").css("left", r),
  5639. t.find(".perc").text(n + "%"),
  5640. this.status = e
  5641. },
  5642. done: function(e) {
  5643. return e || this.status ? (this.status = null,
  5644. this.set(100)) : this
  5645. }
  5646. });
  5647. t.exports.circleLoader = n
  5648. }
  5649. , {
  5650. "../util/common": 185
  5651. }],
  5652. 61: [function(e, t, i) {
  5653. "use strict";
  5654. t.exports = Object.freeze({
  5655. CLOSE: "modal.closer.close"
  5656. })
  5657. }
  5658. , {}],
  5659. 62: [function(e, t, i) {
  5660. "use strict";
  5661. function n(t, e) {
  5662. function i() {
  5663. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5664. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5665. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5666. c.classList.remove("closeByFooter")))
  5667. }
  5668. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5669. }
  5670. var r = e("../../settings")
  5671. , o = (e("../../tag/Media/MediaEvent"),
  5672. e("../../util/browser"))
  5673. , a = e("../../util/common")
  5674. , s = e("./ModalCloserEvent")
  5675. , l = e("events").EventEmitter
  5676. , c = document.getElementsByClassName("footer")[0]
  5677. , h = c.querySelectorAll(".close")[0]
  5678. , u = null
  5679. , d = null
  5680. , p = null
  5681. , f = (o.isMobile(),
  5682. {
  5683. open: function(e) {
  5684. e && (n(e),
  5685. u && h.removeEventListener("click", u, !0),
  5686. u = function(e, t) {
  5687. t && (t.stopPropagation(),
  5688. t.preventDefault()),
  5689. e && this.emit(s.CLOSE, e),
  5690. f.reset()
  5691. }
  5692. .bind(this, e.id),
  5693. h.addEventListener("click", u, !0),
  5694. d && window.removeEventListener("resize", d, !0),
  5695. d = n.bind(this, e),
  5696. window.addEventListener("resize", d, !0))
  5697. },
  5698. reset: function() {
  5699. c.classList.remove("closeByFooter"),
  5700. h.removeEventListener("click", u, !0),
  5701. window.removeEventListener("resize", d, !0),
  5702. u = d = p = null
  5703. }
  5704. });
  5705. a.extendObject(f, l.prototype),
  5706. t.exports = f
  5707. }
  5708. , {
  5709. "../../tag/Media/MediaEvent": 131,
  5710. "../../settings": 166,
  5711. "../../util/browser": 182,
  5712. "../../util/common": 185,
  5713. "./ModalCloserEvent": 61,
  5714. events: 202
  5715. }],
  5716. 63: [function(e, t, i) {
  5717. "use strict";
  5718. var A = e("../lib/dat.gui")
  5719. , C = e("three")
  5720. , I = e("../util/easing")
  5721. , E = e("../enum/Viewmode")
  5722. , _ = e("../enum/Colors")
  5723. , b = e("../enum/WarpStyle")
  5724. , w = e("../settings");
  5725. e("../tag/tag"),
  5726. A.GUI.prototype.removeFolder = function(e) {
  5727. var t = this.__folders[e];
  5728. t && (t.close(),
  5729. this.__ul.removeChild(t.domElement.parentNode),
  5730. delete this.__folders[e],
  5731. this.onResize())
  5732. }
  5733. ,
  5734. t.exports.toggle = function(t, e, i) {
  5735. var n = new A.GUI({
  5736. width: 400
  5737. })
  5738. , r = n.addFolder("Flydown from Dollhouse");
  5739. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5740. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5741. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5742. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5743. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5744. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5745. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5746. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5747. var o = n.addFolder("Transition between panos");
  5748. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5749. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5750. w.transition.flyTime = 0,
  5751. o.__controllers.forEach(function(e) {
  5752. e.updateDisplay()
  5753. })
  5754. }),
  5755. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5756. w.transition.flySpeed = 0,
  5757. o.__controllers.forEach(function(e) {
  5758. e.updateDisplay()
  5759. })
  5760. }),
  5761. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5762. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5763. o.add(w.transition, "movementEasing", Object.keys(I));
  5764. var a = n.addFolder("Path Display");
  5765. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5766. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5767. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5768. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5769. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5770. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5771. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5772. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5773. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5774. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5775. w.path.color = _[w.path.color],
  5776. w.path.colorUp = _._desat(w.path.color),
  5777. w.path.colorDown = _.darken(w.path.color)
  5778. }),
  5779. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5780. w.reticuleColor = _[w.reticuleColor]
  5781. });
  5782. var s = n.addFolder("Warping")
  5783. , l = s.addFolder("Warp/Teleport");
  5784. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5785. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5786. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5787. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5788. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5789. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5790. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5791. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5792. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5793. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5794. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5795. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5796. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5797. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5798. w.path.typ = b[w.path.typ]
  5799. }),
  5800. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5801. e.endlessLoop = w.warp.loop
  5802. }),
  5803. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5804. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5805. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5806. var c = s.addFolder("Long Warp Only");
  5807. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5808. w.warp.flySpeed = 0,
  5809. c.__controllers.forEach(function(e) {
  5810. e.updateDisplay()
  5811. })
  5812. }),
  5813. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5814. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5815. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5816. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5817. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5818. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5819. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5820. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5821. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5822. var h = n.addFolder("Warp Esoterica");
  5823. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5824. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5825. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5826. w.warp.minWarpTime = 0,
  5827. h.__controllers.forEach(function(e) {
  5828. e.updateDisplay()
  5829. })
  5830. }),
  5831. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5832. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5833. h.add(w.warp, "movementEasing", Object.keys(I));
  5834. var u = n.addFolder("Misc");
  5835. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5836. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5837. }),
  5838. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5839. i.cameras[E.PANORAMA].fov = w.insideFOV
  5840. }),
  5841. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5842. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5843. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5844. var d = n.addFolder("Navigation");
  5845. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5846. w.navigation.panoScores || t.panos.forEach(function(e) {
  5847. e.floor.remove(e.text3d),
  5848. e.text3d = null
  5849. })
  5850. }),
  5851. d.add(w.navigation, "mouseDirection"),
  5852. d.add(w.navigation, "filterStrictness", 0, 1),
  5853. d.add(w.navigation, "angleFactor", -60, 0),
  5854. d.add(w.navigation, "directionFactor", 1, 20),
  5855. d.add(w.navigation, "distanceFactor", -5, 5),
  5856. d.add(w.navigation, "optionalityFactor", .1, 10);
  5857. var p = n.addFolder("tags")
  5858. , f = p.addFolder("Tag Creation");
  5859. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5860. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5861. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5862. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5863. var g = p.addFolder("Visibility");
  5864. g.add(w.tags.visibility, "anyDistance"),
  5865. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5866. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5867. g.add(w.tags.visibility, "hideViaFloor"),
  5868. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5869. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5870. var m = p.addFolder("Disc Parameters");
  5871. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5872. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5873. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5874. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5875. }),
  5876. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5877. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5878. }),
  5879. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5880. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5881. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5882. var v = p.addFolder("Navigate");
  5883. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5884. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5885. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5886. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5887. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5888. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5889. var y = n.addFolder("Debug");
  5890. y.add(w, "wireframe").onFinishChange(function() {
  5891. t.chunks.forEach(function(e) {
  5892. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5893. e.wireframeTwin.material.depthWrite = !1,
  5894. e.wireframeTwin.material.depthTest = !1,
  5895. e.wireframeTwin.material.opacity = .5,
  5896. e.wireframeTwin.material.transparent = !0),
  5897. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5898. })
  5899. }),
  5900. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5901. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5902. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5903. t.skybox.wireframe = null)
  5904. }),
  5905. y.add(w, "showSweeps").onFinishChange(function() {
  5906. t.setSweepVisibility(w.showSweeps)
  5907. }),
  5908. y.add(w, "showMesh").onFinishChange(function() {
  5909. t.chunks.forEach(function(e) {
  5910. e.visible = w.showMesh
  5911. })
  5912. }),
  5913. y.add(w, "showFloors").onFinishChange(function() {
  5914. t.floors.forEach(function(e) {
  5915. e.collider.children.forEach(function(e) {
  5916. e.material.visible = w.showFloors
  5917. })
  5918. })
  5919. }),
  5920. y.add(w, "showSkyboxes").onFinishChange(function() {
  5921. t.panos.forEach(function(e) {
  5922. e.skyboxMesh.visible = w.showSkyboxes
  5923. })
  5924. }),
  5925. y.add(w, "showNeighbors").onChange(function() {}),
  5926. y.add(t, "alpha", 0, 1)
  5927. }
  5928. }
  5929. , {
  5930. "../enum/Colors": 19,
  5931. "../enum/Viewmode": 51,
  5932. "../enum/WarpStyle": 52,
  5933. "../lib/dat.gui": 93,
  5934. "../tag/tag": 123,
  5935. "../settings": 166,
  5936. "../util/easing": 186,
  5937. three: 217
  5938. }],
  5939. 64: [function(c, h, e) {
  5940. (function(e) {
  5941. "use strict";
  5942. function i(e, t, i, n) {
  5943. $(".gui-error .error-problem-text").text(e),
  5944. $(".gui-error .error-solution-text").text(t),
  5945. $(".gui-error .error-explanation").text(i),
  5946. $(".gui-error .error-actions").html(n),
  5947. $(window).resize(),
  5948. $(".gui-error").fadeIn(),
  5949. $("#bottom-logo").fadeIn()
  5950. }
  5951. function n(e) {
  5952. 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("");
  5953. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5954. r.isMobile() || $("[rel=tiletip]").tooltip({
  5955. placement: "bottom",
  5956. delay: {
  5957. show: 50,
  5958. hide: 0
  5959. },
  5960. trigger: "hover",
  5961. viewport: {
  5962. selector: "body",
  5963. padding: 10
  5964. }
  5965. })
  5966. }
  5967. function t() {
  5968. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5969. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5970. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5971. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5972. e.preventDefault(),
  5973. e.stopPropagation(),
  5974. n(" ")
  5975. })
  5976. }
  5977. var r = c("./../util/browser")
  5978. , o = c("./../analytics")
  5979. , a = c("./../settings")
  5980. , s = c("../localization/localize")
  5981. , l = new (c("./../util/logger"))(e);
  5982. h.exports.error = function(e) {
  5983. if ($("head title").text(a.pageTitle),
  5984. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5985. $("#gui-loading").fadeOut(250),
  5986. $("#quick-blackout").hide(),
  5987. o.track("showcase_error", {
  5988. error_key: e
  5989. }),
  5990. s.locale || s.init(),
  5991. "webgl-unsupported" === e)
  5992. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5993. else if ("webgl-ios" === e)
  5994. 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>.");
  5995. else if ("webgl-safari" === e)
  5996. 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>.");
  5997. else if ("webgl-generic" === e)
  5998. t();
  5999. else if ("missing-urls" === e)
  6000. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6001. else if ("loading-failed" === e)
  6002. 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>.");
  6003. else {
  6004. if ("loading-failed-maintenance" !== e)
  6005. return void l.error("Unhandled error: " + e);
  6006. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6007. }
  6008. }
  6009. }
  6010. ).call(this, "/js/gui/error.js")
  6011. }
  6012. , {
  6013. "../localization/localize": 108,
  6014. "./../analytics": 4,
  6015. "./../settings": 166,
  6016. "./../util/browser": 182,
  6017. "./../util/logger": 189
  6018. }],
  6019. 65: [function(Oe, Le, e) {
  6020. (function(e) {
  6021. "use strict";
  6022. function c() {
  6023. for (var e in Ce)
  6024. if (Ce.hasOwnProperty(e)) {
  6025. var t = Ce[e];
  6026. if (!t.visible)
  6027. for (var i = 0; i < t.elements.length; i++)
  6028. $(t.elements[i]).hide()
  6029. }
  6030. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6031. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6032. ge = [],
  6033. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6034. ge.push(".hideTarget", ".pinTop.right")
  6035. }
  6036. function v(e, t) {
  6037. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6038. $("#gui-zoomin").toggle(i),
  6039. $("#gui-zoomout").toggle(i)
  6040. }
  6041. function l() {
  6042. n(),
  6043. $(".pinBottom").toggleClass("open"),
  6044. $("#drawer").toggleClass("open"),
  6045. $(".footer").toggleClass("open"),
  6046. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6047. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6048. O.resetDrawer()),
  6049. setTimeout(function() {
  6050. $("#pullTab").toggleClass("opened")
  6051. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6052. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6053. }
  6054. function t(e) {
  6055. var t;
  6056. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6057. t = e.position().top + e.outerHeight(),
  6058. e.attr("style", "display: none")),
  6059. $("#player").outerHeight() - 130 < t + 25
  6060. }
  6061. function y(e) {
  6062. "touchstart" === e.type && e.preventDefault(),
  6063. e.stopPropagation()
  6064. }
  6065. function n() {
  6066. w && (w.reload(),
  6067. w.init())
  6068. }
  6069. function r() {
  6070. $("#gui-spinner").stop(!0, !0),
  6071. $("#gui-spinner").fadeOut(1e3),
  6072. !(Ae = !0)
  6073. }
  6074. function A(e, t) {
  6075. var i = e.mode
  6076. , n = t || e.currentPano;
  6077. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6078. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6079. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6080. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6081. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6082. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6083. $("#gui-modes-outside").removeClass("desktop-only")),
  6084. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6085. pe = i,
  6086. $("#gui-modes-outside").addClass("hidden"),
  6087. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6088. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6089. }
  6090. function C(t, i) {
  6091. function e() {
  6092. document.getElementById("vr").classList.remove("hidden"),
  6093. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6094. S.supportsFullscreen() ? function(e) {
  6095. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6096. Q.init(t.data, i, e, x),
  6097. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6098. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6099. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6100. $(".improper-embed").toggleClass("hidden", !1),
  6101. n())
  6102. }, function(e) {
  6103. n()
  6104. }) : n()
  6105. }
  6106. function n() {
  6107. var e;
  6108. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6109. X.init(t.data, x),
  6110. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6111. function() {
  6112. _e("vr"),
  6113. V.open(e)
  6114. }
  6115. )),
  6116. X.on(Z.CLOSED, V.reset)
  6117. }
  6118. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6119. switch (M.vr.option) {
  6120. case le.CONTEXTUAL:
  6121. e();
  6122. break;
  6123. case le.ANDROID:
  6124. S.detectAndroid() && e();
  6125. break;
  6126. case le.NONE:
  6127. }
  6128. }
  6129. function h(e, i) {
  6130. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6131. if ("372" !== getQueryVariable("m")) {
  6132. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6133. $(".gui-floor").find(".container").prepend(r)
  6134. }
  6135. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6136. n.on("click", function(e) {
  6137. y(e),
  6138. _e("floor"),
  6139. n.toggleClass("open")
  6140. }),
  6141. $(".floorChoice").on("click", function(e) {
  6142. y(e);
  6143. var t = $(this).data("index");
  6144. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6145. i.player.gotoFloor(t),
  6146. R.track("showcase_gui", {
  6147. gui_action: "click_floor_select_button",
  6148. interaction_source: "gui"
  6149. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6150. _e("move"),
  6151. i.allFloors(),
  6152. R.track("showcase_gui", {
  6153. gui_action: "click_toggle_all_floors_button",
  6154. interaction_source: "gui"
  6155. })),
  6156. n.removeClass("open")
  6157. })
  6158. }
  6159. function I(e, t) {
  6160. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6161. $(".gui-floor-icon").hide(),
  6162. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6163. $(".gui-floor-icon").show(),
  6164. $(".gui-floor-title").hide()),
  6165. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6166. $(".gui-floor-number").text(se.FLOOR_ALL),
  6167. $(".floorChoice").removeClass("active"),
  6168. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6169. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6170. $(".floorChoice").removeClass("active"),
  6171. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6172. }
  6173. function E() {
  6174. var e = $("#player").width() - 20
  6175. , t = $("#scroller")
  6176. , i = $("#drawer")
  6177. , n = $(".pinBottom");
  6178. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6179. i.addClass("noScroll"),
  6180. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6181. i.toggleClass("noScroll"),
  6182. n.toggleClass("noScroll"))
  6183. }
  6184. function _(e) {
  6185. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6186. e = e || 0,
  6187. Ae = !1,
  6188. window.setTimeout(function() {
  6189. Ae || (!0,
  6190. $("#gui-spinner").stop(!0, !0).show())
  6191. }
  6192. .bind(this), e)
  6193. }(M.modelComponentLoadSpinnerDelay)
  6194. }
  6195. function b(e, t) {
  6196. for (var i = []; e; )
  6197. i.push(e),
  6198. e = e.parentNode;
  6199. for (; t && -1 === i.indexOf(t); )
  6200. t = t.parentNode;
  6201. return t
  6202. }
  6203. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6204. Oe("../util/ajax"),
  6205. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6206. Oe("../util/camera"),
  6207. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6208. 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"),
  6209. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6210. Oe("../enum/PathDisplayMode"),
  6211. Oe("../enum/DirectorEvents"),
  6212. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6213. Oe("../enum/WarpStyle"),
  6214. Oe("../enum/AlignmentType"),
  6215. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6216. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6217. coBrand: {
  6218. visible: !0,
  6219. elements: [".co-brand", "#loaderCoBrand"]
  6220. },
  6221. help: {
  6222. visible: !0,
  6223. elements: [".nav-help", "#nav-help"]
  6224. },
  6225. tourControls: {
  6226. visible: !0,
  6227. elements: [".next", ".previous", "#play"]
  6228. },
  6229. highlight: {
  6230. visible: !0,
  6231. elements: ["#drawer", "#pullTab"]
  6232. },
  6233. share: {
  6234. visible: !0,
  6235. elements: [".socialButton", "#share"]
  6236. },
  6237. fullScreen: {
  6238. visible: !0,
  6239. elements: ["#gui-fullscreen"]
  6240. },
  6241. floors: {
  6242. visible: !0,
  6243. elements: [".gui-floor"]
  6244. }
  6245. }, Ie = (g = document.getElementById("drawer"),
  6246. function() {
  6247. $("#player").height() < 400 && g.classList.contains("open") && l()
  6248. }
  6249. ), Ee = (f = document.getElementById("meta-info"),
  6250. function() {
  6251. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6252. }
  6253. ), _e = (i = document.getElementById("meta-info"),
  6254. s = document.getElementById("interaction-modal"),
  6255. u = $("#drawer").eq(0),
  6256. d = $(".gui-floor").eq(0),
  6257. p = $(".vr-popup").eq(0),
  6258. function(e) {
  6259. switch (e) {
  6260. case "info":
  6261. we(),
  6262. Te(),
  6263. Ie(),
  6264. Me(),
  6265. Re(),
  6266. xe(),
  6267. Pe();
  6268. break;
  6269. case "terms":
  6270. be(),
  6271. Te(),
  6272. Se(),
  6273. Me(),
  6274. Re(),
  6275. xe(),
  6276. Pe();
  6277. break;
  6278. case "help":
  6279. be(),
  6280. we(),
  6281. Me(),
  6282. Re(),
  6283. xe(),
  6284. Pe();
  6285. break;
  6286. case "vr":
  6287. be(),
  6288. we(),
  6289. Me(),
  6290. Re(),
  6291. Te(),
  6292. Pe(),
  6293. t(p) && Se();
  6294. break;
  6295. case "highlights":
  6296. Ee(),
  6297. we(),
  6298. Me(),
  6299. Re();
  6300. break;
  6301. case "share":
  6302. be(),
  6303. we(),
  6304. Te(),
  6305. Re(),
  6306. xe(),
  6307. Pe();
  6308. break;
  6309. case "floor":
  6310. we(),
  6311. Me(),
  6312. xe();
  6313. break;
  6314. case "view":
  6315. Re(),
  6316. Me(),
  6317. we(),
  6318. xe();
  6319. break;
  6320. case "tour":
  6321. case "move":
  6322. we(),
  6323. Me(),
  6324. Re(),
  6325. xe();
  6326. break;
  6327. case "resize":
  6328. be(),
  6329. Ie(),
  6330. Re();
  6331. break;
  6332. case "tag":
  6333. we(),
  6334. Te(),
  6335. Me(),
  6336. Re(),
  6337. xe()
  6338. }
  6339. }
  6340. );
  6341. function be() {
  6342. i.classList.contains("expand") && z.toggleMeta(!0)
  6343. }
  6344. function we() {
  6345. W.hide()
  6346. }
  6347. function Te() {
  6348. U.close()
  6349. }
  6350. function xe() {
  6351. X.dismiss()
  6352. }
  6353. function Se() {
  6354. u.hasClass("open") && l()
  6355. }
  6356. function Me() {
  6357. K.hide()
  6358. }
  6359. function Re() {
  6360. d.hasClass("open") && d.removeClass("open")
  6361. }
  6362. function Pe() {
  6363. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6364. }
  6365. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6366. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6367. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6368. setTimeout(function() {
  6369. $(".icon:visible").hide().show(0)
  6370. }, 100)
  6371. }),
  6372. $("#gui-fullscreen").find("a").on("click", function(e) {
  6373. y(e),
  6374. S.requestFullscreen($("body")[0]),
  6375. R.track("showcase_gui", {
  6376. gui_action: "click_enter_fullscreen",
  6377. interaction_source: "gui"
  6378. })
  6379. }),
  6380. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6381. y(e),
  6382. S.exitFullscreen(),
  6383. R.track("showcase_gui", {
  6384. gui_action: "click_exit_fullscreen",
  6385. interaction_source: "gui"
  6386. })
  6387. }),
  6388. $(window).on("resize", function(e) {
  6389. var t = e.target.innerHeight
  6390. , i = e.target.innerWidth;
  6391. t === o && i === a || (Ce.highlight.visible && E(),
  6392. _e("resize"),
  6393. $(".pinTop.right").removeClass("hideUnderMeta"),
  6394. n(),
  6395. o = t,
  6396. a = i)
  6397. }).resize(),
  6398. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6399. $("#pullTab").on("click", function(e) {
  6400. y(e),
  6401. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6402. gui_action: "hide_highlight_reel"
  6403. }),
  6404. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6405. gui_action: "show_highlight_reel"
  6406. }),
  6407. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6408. l()
  6409. }),
  6410. window.DATA.showHotListSta && ($("#hotList").css("display", ""),
  6411. $("#hotList").on("click", function(e) {
  6412. y(e);
  6413. var t = $("#hotListWrap")[0];
  6414. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6415. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6416. this.classList.add("active"))
  6417. }),
  6418. $("#hotListContent ul").on("mouseover", function(e) {
  6419. y(e);
  6420. var t = e.target
  6421. , i = document.getElementById("hotListWrap");
  6422. if ("SPAN" === t.tagName) {
  6423. var n = t.parentElement.parentElement;
  6424. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6425. } else if ("LI" === t.tagName) {
  6426. n = t.parentElement;
  6427. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6428. } else
  6429. i.style.width = ""
  6430. }),
  6431. $("#hotListContent ul").on("click", function(e) {
  6432. y(e),
  6433. this.preElem && this.preElem.classList.remove("active"),
  6434. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6435. e.target.parentElement.hot && e.target.parentElement.hot.examine(!0),
  6436. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6437. e.target.hot && e.target.hot.examine(!0),
  6438. this.preElem = e.target)
  6439. }),
  6440. $("#hotListClose").on("click", function(e) {
  6441. y(e),
  6442. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6443. $("#hotListContent ul .active").removeClass("active"),
  6444. $("#hotList")[0].classList.remove("active")
  6445. })),
  6446. "true" === window.DATA.supportsVR && $("#vr").css("display", ""),
  6447. $("#more-menu-button").on("click", function(e) {
  6448. y(e),
  6449. $("#more-menu").toggleClass("open")
  6450. }),
  6451. Le.exports.init = function(s, l, c, e, t, i, n) {
  6452. var r;
  6453. x = n,
  6454. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6455. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6456. F.init(),
  6457. D.init(s, i),
  6458. ce.init(s, l, e),
  6459. $(".icon").on("mouseover", function() {
  6460. l.player && l.player.reticule.hide()
  6461. }),
  6462. function(e, t) {
  6463. var i = t.player;
  6464. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6465. y(e),
  6466. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6467. R.track("USER", {
  6468. event_type: "showcase_gui",
  6469. gui_action: "click_inside_mode_button"
  6470. }),
  6471. t.changeMode(ie.PANORAMA)
  6472. }),
  6473. $("#gui-modes-outside").find("a").on("click", function(e) {
  6474. y(e),
  6475. R.track("showcase_gui", {
  6476. gui_action: "click_outside_mode_button"
  6477. }),
  6478. t.changeMode(pe)
  6479. }),
  6480. $("#gui-modes-floorplan").on("click", function(e) {
  6481. y(e),
  6482. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6483. gui_action: "click_floorplan_mode_button"
  6484. }),
  6485. t.changeMode(ie.FLOORPLAN))
  6486. }),
  6487. $("#gui-modes-dollhouse").on("click", function(e) {
  6488. y(e),
  6489. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6490. gui_action: "click_dollhouse_mode_button"
  6491. }),
  6492. t.changeMode(ie.DOLLHOUSE))
  6493. })
  6494. }(0, l),
  6495. function(e, t) {
  6496. $("#play").on("mousedown touchstart", function(e) {
  6497. y(e),
  6498. _e("tour"),
  6499. q.play(),
  6500. R.trackAlways("showcase_gui", {
  6501. gui_action: "play_highlights"
  6502. })
  6503. }),
  6504. window.startAndPlay = function(e) {
  6505. _e("tour"),
  6506. q.play(),
  6507. R.trackAlways("showcase_gui", {
  6508. gui_action: "play_highlights"
  6509. })
  6510. }
  6511. ,
  6512. $("#pause").on("mousedown touchstart", function(e) {
  6513. y(e),
  6514. q.pause(),
  6515. R.trackAlways("showcase_gui", {
  6516. gui_action: "pause_highlights"
  6517. })
  6518. }),
  6519. $("#gui-zoomin").find("a").on("click", function(e) {
  6520. y(e),
  6521. t.player.zoomInIncrementally()
  6522. }),
  6523. $("#gui-zoomout").find("a").on("click", function(e) {
  6524. y(e),
  6525. t.player.zoomOutIncrementally()
  6526. })
  6527. }(0, l),
  6528. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(DATA.name/* s.data.name */),
  6529. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6530. function() {
  6531. _e("share"),
  6532. V.open(r)
  6533. }
  6534. )),
  6535. K.on(ae.CLOSED, V.reset)),
  6536. 0 < s.heroLocations.length ? function(e, i, t) {
  6537. var n = 100 / (fe = e.heroLocations.length) + "%"
  6538. , r = $("#thumb-container")
  6539. , o = $("#progressBar");
  6540. $("#status").find(".totalSteps").text(fe);
  6541. for (var a = 0; a < fe; a++) {
  6542. var s = e.heroLocations[a]
  6543. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6544. if(s.heroLocations){//有子项,选第一张截图
  6545. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6546. }else{
  6547. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6548. }
  6549. if (l.attr("data-index", a),
  6550. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6551. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6552. s.name) {
  6553. var c = $('<div class="overlay"></div>').text(s.name);
  6554. l.prepend(c)
  6555. }
  6556. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6557. var h = e.panos.get(s.panoId)
  6558. , 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>';
  6559. l.prepend(u)
  6560. }
  6561. r.append(l),
  6562. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6563. }
  6564. T = 144 * fe,
  6565. 111 * fe,
  6566. $(".thumbImg").on("mouseover", function() {
  6567. !function(e) {
  6568. return e.describe().inTransition
  6569. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6570. }),
  6571. $(".thumbImg").on("mouseout", function() {
  6572. i.clearPath()
  6573. }),
  6574. $(".thumbImg").on("click", function(e) {
  6575. y(e);
  6576. var t = $(this);
  6577. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6578. R.trackAlways("showcase_gui", {
  6579. gui_action: "click_highlight"
  6580. }),
  6581. i.goToHighlight([t.data("index"),0])//改
  6582. }),
  6583. $(".previous").find("a").on("click", function(e) {
  6584. y(e),
  6585. R.trackAlways("showcase_gui", {
  6586. gui_action: "prev_highlight"
  6587. }),
  6588. i.prevHighlight()
  6589. }),
  6590. $(".next").find("a").on("click", function(e) {
  6591. y(e),
  6592. R.trackAlways("showcase_gui", {
  6593. gui_action: "next_highlight"
  6594. }),
  6595. i.nextHighlight()
  6596. }),
  6597. $("#drawer").on("mouseleave", function(t) {
  6598. var i;
  6599. y(t);
  6600. try {
  6601. i = new MouseEvent("mouseup",{
  6602. clientX: t.clientX,
  6603. clientY: t.clientY,
  6604. screenX: t.screenX,
  6605. screenY: t.screenY
  6606. })
  6607. } catch (e) {
  6608. (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)
  6609. }
  6610. document.dispatchEvent(i)
  6611. }),
  6612. (w = new Sly($("#scrollFrame"),{
  6613. horizontal: !0,
  6614. itemNav: "centered",
  6615. smart: !0,
  6616. scrollTrap: !0,
  6617. scrollBy: 1,
  6618. mouseDragging: !0,
  6619. touchDragging: !0,
  6620. speed: 300,
  6621. dragHandle: !0,
  6622. dynamicHandle: !0,
  6623. clickBar: !0,
  6624. scrollBar: $("#scroller"),
  6625. activateOn: null
  6626. }).init()).on("active", function(e, t) {
  6627. t,
  6628. _e("tour"),
  6629. $(".step").removeClass("active"),
  6630. $("#status").find(".curIdx").text(t + 1);
  6631. for (var i = 0; i <= t; i++)
  6632. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6633. }),
  6634. E()
  6635. }(s, l, c) : (Ce.highlight.visible = !1,
  6636. Ce.tourControls.visible = !1),
  6637. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6638. function() {
  6639. var n;
  6640. document.body.addEventListener("mousedown", function(e) {
  6641. n = 0 === e.button || 1 === e.which ? e.target : null
  6642. }, !0),
  6643. document.body.addEventListener("mouseup", function(t) {
  6644. n !== t.target && (n = b(n, t.target));
  6645. var e = document.getElementById("gui-parent");
  6646. if (b(e, n) !== e && (n = null),
  6647. n) {
  6648. var i;
  6649. try {
  6650. i = new MouseEvent("click",t)
  6651. } catch (e) {
  6652. (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)
  6653. }
  6654. i.syntheticClick = !0,
  6655. n.dispatchEvent(i),
  6656. n = null
  6657. }
  6658. }, !0),
  6659. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6660. e.syntheticClick || (e.stopPropagation(),
  6661. "A" === e.target.nodeName && e.preventDefault())
  6662. }, !0)
  6663. }(),
  6664. A(c),
  6665. C(s, t),
  6666. s.on("floor.changed", I),
  6667. s.on("waiting", function(e) {
  6668. _(e)
  6669. }
  6670. .bind(this, s)),
  6671. s.on("waiting-done", function(e) {
  6672. _(e)
  6673. }
  6674. .bind(this, s)),
  6675. c.on(re.ModeChanged, function(e, t) {
  6676. A(c),
  6677. v(l, c),
  6678. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6679. U.updateMode(t)
  6680. }),
  6681. e.on(oe.Move, _e.bind(this, "move")),
  6682. c.on(re.Ready, function() {
  6683. O.init(e, c, c.tagManager, l),
  6684. c.on(re.ModeChanged, function(e, t) {
  6685. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6686. })
  6687. }),
  6688. c.on(re.PanoChosen, function(e, t) {
  6689. A(c, t),
  6690. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6691. }),
  6692. V.on(k.CLOSE, function(e) {
  6693. switch (e) {
  6694. case "vr-modal":
  6695. X.dismiss();
  6696. break;
  6697. case "share-modal":
  6698. K.hide();
  6699. break;
  6700. case "terms-modal":
  6701. W.hide()
  6702. }
  6703. });
  6704. 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();
  6705. l.on("update.controls", function() {
  6706. var e, t, i, n = l.describe();
  6707. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6708. u.show()),
  6709. n.tourInProgress && (d.forEach(function(e) {
  6710. e.classList.add("playing")
  6711. }),
  6712. p.addClass("playing"),
  6713. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6714. u.hide()),
  6715. n.tourInProgress || (q.stopTour(),
  6716. d.forEach(function(e) {
  6717. e.classList.remove("playing")
  6718. }),
  6719. p.removeClass("playing"),
  6720. f.removeClass("playing"))),
  6721. null !== n.currentItem) {
  6722. var r, o;
  6723. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6724. n.onTheBus ? (r = "active",
  6725. o = "recent") : (o = "active",
  6726. r = "recent");
  6727. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6728. for (e = 0; e < s.heroLocations.length; e += 1)
  6729. i = g.eq(e),
  6730. t = m.eq(e),
  6731. i.removeClass(o),
  6732. t.removeClass(o),
  6733. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6734. t.addClass(r),
  6735. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6736. t.addClass(r)) : (i.removeClass(r),
  6737. t.removeClass(r))
  6738. } else
  6739. for (e = 0; e < s.heroLocations.length; e += 1)
  6740. i = g.eq(e),
  6741. t = m.eq(e),
  6742. i.removeClass("active recent"),
  6743. t.removeClass("active recent");
  6744. v(l, c)
  6745. }),
  6746. document.addEventListener("keydown", function(e) {
  6747. switch (R.updateInteraction(oe.InteractionKey),
  6748. e.which) {
  6749. case te.ZERO:
  6750. M.debug && s.toggleAlpha();
  6751. break;
  6752. case te.NINE:
  6753. M.debug && B.toggle();
  6754. break;
  6755. case te.ONE:
  6756. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6757. break;
  6758. case te.TWO:
  6759. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6760. break;
  6761. case te.THREE:
  6762. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6763. break;
  6764. case te.FOUR:
  6765. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6766. break;
  6767. case te.SPACE:
  6768. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6769. break;
  6770. case te.RETURN:
  6771. M.debug && s.toggleExplodeUp();
  6772. break;
  6773. case te.P:
  6774. !function(e) {
  6775. me.gui || (me.gui = function(e) {
  6776. var t = new he.GUI;
  6777. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6778. e.setSweepVisibility(M.showSweeps)
  6779. }),
  6780. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6781. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6782. M.transition.flySpeed = 0,
  6783. t.__controllers.forEach(function(e) {
  6784. e.updateDisplay()
  6785. })
  6786. }),
  6787. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6788. $(t.__closeButton).hide(),
  6789. t
  6790. }(me.model)),
  6791. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6792. }(!me.visible);
  6793. break;
  6794. case te.U:
  6795. !function(e) {
  6796. ve.gui || (ve.gui = function(t, i) {
  6797. function e() {
  6798. var e = i.toJSON();
  6799. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6800. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6801. }
  6802. var n = {}
  6803. , r = new he.GUI({
  6804. autoPlace: !0,
  6805. width: "60%"
  6806. });
  6807. return e(),
  6808. i.on(re.ViewChanged, e),
  6809. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6810. r.domElement.id = "datLinks",
  6811. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6812. if (!S.detectSafari()) {
  6813. var t = document.createElement("button");
  6814. t.classList.add("btn-deep-link"),
  6815. t.innerText = se.MENU_COPY,
  6816. e.nextSibling.appendChild(t);
  6817. var n = function() {
  6818. alert(se.LINK_ALERT_COPY),
  6819. t.hide()
  6820. };
  6821. t.addEventListener("click", function(e) {
  6822. try {
  6823. var t = e.target.parentNode.childNodes[0];
  6824. t.select();
  6825. var i = document.execCommand("copy");
  6826. t.blur(),
  6827. i || n()
  6828. } catch (e) {
  6829. n()
  6830. }
  6831. })
  6832. }
  6833. }),
  6834. $(r.__closeButton).hide(),
  6835. r
  6836. }(ve.model, ve.player)),
  6837. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6838. }(!ve.visible);
  6839. break;
  6840. case te.X:
  6841. M.debug && s.toggleExplode();
  6842. break;
  6843. case te.PLUSEQUALS:
  6844. l.player.activatePersistentZooming(!0),
  6845. O.hideUi();
  6846. break;
  6847. case te.DASHUNDERSCORE:
  6848. l.player.activatePersistentZooming(!1),
  6849. O.hideUi();
  6850. break;
  6851. case te.SEVEN:
  6852. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6853. break;
  6854. case te.EIGHT:
  6855. l.player.decreaseZoomSpeed();
  6856. break;
  6857. case te.NINE:
  6858. l.player.increaseZoomSpeed()
  6859. }
  6860. return c && c.reticule.hide(),
  6861. !0
  6862. }
  6863. .bind(this)),
  6864. document.addEventListener("keyup", function(e) {
  6865. switch (e.which) {
  6866. case te.PLUSEQUALS:
  6867. l.player.deactivatePersistentZooming();
  6868. break;
  6869. case te.DASHUNDERSCORE:
  6870. l.player.deactivatePersistentZooming()
  6871. }
  6872. }
  6873. .bind(this)),
  6874. function(e) {
  6875. me = {
  6876. gui: null,
  6877. visible: !1,
  6878. model: e
  6879. }
  6880. }(s),
  6881. function(e, t) {
  6882. ve = {
  6883. gui: null,
  6884. visible: !1,
  6885. model: e,
  6886. player: t
  6887. }
  6888. }(s, l.player),
  6889. function(e) {
  6890. function t(e, i) {
  6891. $(e).find("a").each(function(e, t) {
  6892. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6893. t.style.pointerEvents = i ? "auto" : "none"
  6894. })
  6895. }
  6896. e.on(de.ZoomMax, function() {
  6897. t("#gui-zoomin", !1),
  6898. t("#gui-zoomout", !0)
  6899. }),
  6900. e.on(de.ZoomMin, function() {
  6901. t("#gui-zoomin", !0),
  6902. t("#gui-zoomout", !1)
  6903. }),
  6904. e.on(de.ZoomIn, function() {
  6905. t("#gui-zoomout", !0)
  6906. }),
  6907. e.on(de.ZoomOut, function() {
  6908. t("#gui-zoomin", !0)
  6909. }),
  6910. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6911. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6912. }(c),
  6913. P.setAutoPlay(s.heroCount()),
  6914. U.init(c, i.mode),
  6915. U.on(H.OPENED, _e.bind(this, "help")),
  6916. W.init(),
  6917. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6918. function() {
  6919. _e("terms"),
  6920. V.open(o)
  6921. }
  6922. )),
  6923. W.on(j.CLOSED, V.reset),
  6924. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6925. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6926. M.profiling.enabled && B.show(),
  6927. q.init(l)
  6928. }
  6929. ,
  6930. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6931. function a() {
  6932. o.setLoadingStartTime(),
  6933. function() {
  6934. function e(e) {
  6935. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6936. }
  6937. $("body").css("touch-action", "none"),
  6938. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6939. var t = document.getElementById("terms-text")
  6940. , i = document.getElementById("more-help-wrapper")
  6941. , n = (document.getElementById("navigation-help-wrapper"),
  6942. document.getElementById("help-dialog"),
  6943. document.getElementById("tag-billboards"));
  6944. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6945. passive: !1
  6946. }),
  6947. document.body.addEventListener("DOMMouseScroll", e)),
  6948. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6949. e.stopPropagation()
  6950. })
  6951. }(),
  6952. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6953. l()) : function(e) {
  6954. L.show(e),
  6955. c()
  6956. }(l)
  6957. }
  6958. var s = $.Deferred()
  6959. , l = s.resolve.bind(s);
  6960. ye = !0,
  6961. _(e);
  6962. e.data.player_options && function(e) {
  6963. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6964. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6965. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6966. }(e.data.player_options),
  6967. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6968. se.localizeGUI();
  6969. !function(i) {
  6970. function e(e, t) {
  6971. return !!i.player_options[e] && i[t || e]
  6972. }
  6973. $(".model-title").text(i.name);
  6974. var t = M.pageTitle;
  6975. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6976. document.title = t,
  6977. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6978. delay: {
  6979. show: 50,
  6980. hide: 0
  6981. },
  6982. trigger: "hover",
  6983. html: !1,
  6984. viewport: {
  6985. selector: "body",
  6986. padding: 10
  6987. }
  6988. }),
  6989. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6990. z.populate({
  6991. name: e("model_name", "name"),
  6992. coBrand: e("presented_by"),
  6993. description: e("model_summary", "summary") || "暂无内容",
  6994. contactName: e("contact_name"),
  6995. address: e("address"),
  6996. phone: e("contact_phone"),
  6997. formattedPhone: i.formatted_contact_phone,
  6998. email: e("contact_email"),
  6999. url: e("external_url"),
  7000. socialSharing: i.enable_social_sharing && i.is_public
  7001. })
  7002. }(e.data);
  7003. r || $(".quick").addClass("hidden");
  7004. n ? (R.impression(),
  7005. a()) : (o.setWaitingStartTime(),
  7006. N.show(r, a))
  7007. return s
  7008. }
  7009. ,
  7010. Le.exports.endLoading = function(e, t, i) {
  7011. var n = t.player;
  7012. function r() {
  7013. i.dismissExaminedTag(),
  7014. i.disableHovering()
  7015. }
  7016. $("#gui-thumb").fadeOut(2500),
  7017. L.hide(function() {
  7018. ye = !1
  7019. }),
  7020. Y.init(e, i),
  7021. z.finishSetup(Object.keys(e.tags).length),
  7022. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7023. X.on(Z.OPENED, r),
  7024. K.on(ae.OPENED, r),
  7025. U.on(H.OPENED, r),
  7026. W.on(j.OPENED, r);
  7027. var o = i.enableHovering.bind(i);
  7028. if (X.on(Z.CLOSED, o),
  7029. K.on(ae.CLOSED, o),
  7030. U.on(H.CLOSED, o),
  7031. W.on(j.CLOSED, o),
  7032. M.labels.enabled && Object.keys(e.labels).length,
  7033. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7034. I(e.currentFloor, n.mode)),
  7035. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7036. h(e, t)),
  7037. c(),
  7038. v(t, t.player),
  7039. $("#gui").fadeIn(1500),
  7040. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7041. l(),
  7042. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7043. }, 2e3),
  7044. !S.isMobile())
  7045. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7046. $(a[s]).addClass("hasHover");
  7047. _(e),
  7048. z.setupToggling(),
  7049. window.editHotPanel && editHotPanel(),
  7050. function() {
  7051. var i = $("#pullTab")
  7052. , e = {
  7053. bottom: {
  7054. "border-bottom-left-radius": "10px",
  7055. "border-bottom-right-radius": "10px"
  7056. },
  7057. top: {
  7058. "border-top-left-radius": "10px",
  7059. "border-top-right-radius": "10px"
  7060. }
  7061. }
  7062. , t = {
  7063. bottom: {
  7064. "border-top-right-radius": "10px",
  7065. "border-bottom-right-radius": "10px"
  7066. },
  7067. top: {
  7068. "border-bottom-left-radius": "10px",
  7069. "border-top-left-radius": "10px"
  7070. }
  7071. };
  7072. function n(e, t) {
  7073. $("#gui-modes-map > div:visible:last").css(e),
  7074. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7075. }
  7076. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7077. (window.DATA.model.special || "true" === window.DATA.special) && window.specialScene && specialScene.special().afterImplement()
  7078. }()
  7079. $(".toolRight a").removeClass('hasHover')
  7080. }
  7081. ,
  7082. Le.exports.onProgress = function(e) {
  7083. L.progress(e)
  7084. }
  7085. }
  7086. ).call(this, "/js/gui/gui.js")
  7087. }
  7088. , {
  7089. "../analytics": 4,
  7090. "../controls/serializer": 14,
  7091. "../enum/AlignmentType": 17,
  7092. "../enum/BlackoutStyle": 18,
  7093. "../enum/ControlEvents": 21,
  7094. "../enum/DirectorEvents": 23,
  7095. "../enum/Keys": 30,
  7096. "../enum/PathDiscardMode": 38,
  7097. "../enum/PathDisplayMode": 39,
  7098. "../enum/PlayerEvents": 40,
  7099. "../enum/VROption": 47,
  7100. "../enum/Vectors": 50,
  7101. "../enum/Viewmode": 51,
  7102. "../enum/WarpStyle": 52,
  7103. "../enum/ZoomEvents": 53,
  7104. "../lib/dat.gui": 93,
  7105. "../localization/localize": 108,
  7106. "../tag/Media/MediaEvent": 131,
  7107. "../objects/Snapshot": 153,
  7108. "../settings": 166,
  7109. "../util/ajax": 181,
  7110. "../util/browser": 182,
  7111. "../util/camera": 183,
  7112. "../util/logger": 189,
  7113. "../util/showcase": 193,
  7114. "../util/transitions": 195,
  7115. "./closer/ModalCloserEvent": 61,
  7116. "./closer/modalCloser": 62,
  7117. "./help/HelpEvent": 66,
  7118. "./help/help": 67,
  7119. "./helpManager": 68,
  7120. "./immersiveMode": 69,
  7121. "./konami": 70,
  7122. "./landingScreen": 71,
  7123. "./loadingScreen": 72,
  7124. "./memoryUsage": 73,
  7125. "./playButton": 74,
  7126. "./populateModal": 75,
  7127. "./sharing/ShareEvents": 76,
  7128. "./sharing/modal": 77,
  7129. "./terms/TermsEvent": 78,
  7130. "./terms/terms": 79,
  7131. "./title/TitleEvents": 80,
  7132. "./title/tagToggle": 81,
  7133. "./title/titleBar": 82,
  7134. "./tourInteraction": 84,
  7135. "./vr/vrEvent": 85,
  7136. "./vr/vrModal": 87,
  7137. "./webvr/WebVrEvent": 88,
  7138. "./webvr/webVRgui": 89,
  7139. three: 217
  7140. }],
  7141. 66: [function(e, t, i) {
  7142. "use strict";
  7143. t.exports = Object.freeze({
  7144. OPENED: "help.opened",
  7145. CLOSED: "help.closed"
  7146. })
  7147. }
  7148. , {}],
  7149. 67: [function(e, t, i) {
  7150. "use strict";
  7151. function n() {
  7152. p.on("click", function(e) {
  7153. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7154. setTimeout(function() {
  7155. x = !1
  7156. }, h.help.modalStayDuration),
  7157. S.emit(l.OPENED),
  7158. f.addClass("open " + T),
  7159. p.addClass("open"),
  7160. o(),
  7161. r(),
  7162. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7163. v.classList.add("fadeIn")))
  7164. }),
  7165. E.on("click", function(e) {
  7166. S.close()
  7167. }),
  7168. C.on("click", function(e) {
  7169. T && T !== a.TRANSITIONING && (o(),
  7170. r())
  7171. }),
  7172. I.on("click", function(e) {
  7173. o(),
  7174. I.addClass("underline-tab"),
  7175. c.fill(b, s.MORE_HELP),
  7176. f.addClass("more-help")
  7177. })
  7178. }
  7179. function r() {
  7180. C.addClass("underline-tab"),
  7181. c.fill(_, s.NAVIGATION, T),
  7182. f.addClass(T)
  7183. }
  7184. function o() {
  7185. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7186. A.forEach(function(e) {
  7187. e.classList.remove("underline-tab")
  7188. })
  7189. }
  7190. var a = e("../../enum/Viewmode")
  7191. , s = e("../../enum/HelpModalType")
  7192. , l = e("./HelpEvent")
  7193. , c = (e("../helpManager"),
  7194. e("./../populateModal"))
  7195. , h = e("../../settings")
  7196. , u = e("../../util/common")
  7197. , d = e("events").EventEmitter
  7198. , p = $(".footer-help").eq(0)
  7199. , f = $("#help-dialog").eq(0)
  7200. , g = document.querySelector("#quick-logo")
  7201. , m = document.querySelector("#loaderCoBrand")
  7202. , v = document.querySelector("#help-dialog")
  7203. , y = document.querySelector(".footer")
  7204. , A = $(".help-tabs").children().toArray()
  7205. , C = $(".navigation-tab").eq(0)
  7206. , I = $(".more-help-tab").eq(0)
  7207. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7208. f.find(".close").eq(0))
  7209. , _ = f.find(".interactions").toArray()
  7210. , b = f.find(".ui-instructions").toArray()
  7211. , w = a.PANORAMA
  7212. , T = a.PANORAMA
  7213. , x = !1
  7214. , S = {
  7215. init: function(e, t) {
  7216. w = T = t,
  7217. [v, m, g, y].forEach(function(e) {
  7218. e.classList.add(c.deviceType)
  7219. }),
  7220. n()
  7221. },
  7222. close: function() {
  7223. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7224. p.removeClass("open"),
  7225. f.removeClass("open"),
  7226. v.classList.contains("fadeIn"))) {
  7227. v.classList.remove("fadeIn");
  7228. var e = T === a.TRANSITIONING ? w : T;
  7229. c.clear(_, s.NAVIGATION, e)
  7230. }
  7231. },
  7232. updateMode: function(e) {
  7233. w = T,
  7234. T = e
  7235. }
  7236. };
  7237. u.extendObject(S, d.prototype),
  7238. t.exports = S
  7239. }
  7240. , {
  7241. "../../enum/HelpModalType": 28,
  7242. "../../enum/Viewmode": 51,
  7243. "../../settings": 166,
  7244. "../../util/common": 185,
  7245. "../helpManager": 68,
  7246. "./../populateModal": 75,
  7247. "./HelpEvent": 66,
  7248. events: 202
  7249. }],
  7250. 68: [function(s, l, e) {
  7251. (function(e) {
  7252. "use strict";
  7253. var t = s("../util/browser")
  7254. , i = s("./../util/logger")
  7255. , n = s("./../settings")
  7256. , r = new i(e)
  7257. , o = function() {
  7258. var t;
  7259. try {
  7260. return t = window.localStorage.getItem("visitCount") || "0",
  7261. t = (parseFloat(t) + 1).toString(),
  7262. window.localStorage.setItem("visitCount", t),
  7263. r.debug("visitCount = " + t),
  7264. t
  7265. } catch (e) {
  7266. t = "1",
  7267. r.debug("couldn't set local storage")
  7268. }
  7269. }()
  7270. , a = !1;
  7271. l.exports = {
  7272. isHelpDisabled: function() {
  7273. return "0" === t.valueFromHash("help", null) || a
  7274. },
  7275. isLargeHelpEnabled: function() {
  7276. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7277. },
  7278. isSmallHelpEnabled: function() {
  7279. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7280. },
  7281. isHelpEnabled: function() {
  7282. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7283. },
  7284. setAutoPlay: function(e) {
  7285. a = 0 <= n.warp.auto && 1 < e
  7286. }
  7287. }
  7288. }
  7289. ).call(this, "/js/gui/helpManager.js")
  7290. }
  7291. , {
  7292. "../util/browser": 182,
  7293. "./../settings": 166,
  7294. "./../util/logger": 189
  7295. }],
  7296. 69: [function(e, t, i) {
  7297. "use strict";
  7298. function r(e) {
  7299. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7300. T = !0,
  7301. h.close(),
  7302. function(e) {
  7303. !n(e) && S ? v.forEach(function(e) {
  7304. e.classList.remove("drawerOpen"),
  7305. e.classList.add("duringTour")
  7306. }) : C.hasClass("open") ? v.forEach(function(e) {
  7307. e.classList.remove("duringTour"),
  7308. e.classList.add("drawerOpen")
  7309. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7310. e.classList.add("fadeOut")
  7311. })
  7312. }(e),
  7313. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7314. C.hasClass("playing") || (y.forEach(function(e) {
  7315. e.classList.add("detectHover")
  7316. }),
  7317. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7318. }
  7319. function o() {
  7320. C.hasClass("playing") || (clearTimeout(x),
  7321. x = setTimeout(a, c.immersive.timeToShowAgain))
  7322. }
  7323. function a() {
  7324. clearTimeout(x),
  7325. T = !1,
  7326. m.forEach(function(e) {
  7327. e.classList.remove("drawerOpen")
  7328. }),
  7329. S || v.forEach(function(e) {
  7330. e.classList.remove("duringTour")
  7331. }),
  7332. y.forEach(function(e) {
  7333. e.classList.remove("detectHover")
  7334. })
  7335. }
  7336. function s() {
  7337. T ? a() : r(),
  7338. M = !0,
  7339. setTimeout(function() {
  7340. M = !1
  7341. }, c.immersive.uiStayDuration)
  7342. }
  7343. function n(e) {
  7344. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7345. }
  7346. var l = e("../util/browser")
  7347. , c = e("../settings")
  7348. , h = e("./help/help")
  7349. , u = e("../enum/tagEvents")
  7350. , d = e("../enum/ControlEvents")
  7351. , p = e("../enum/PlayerEvents")
  7352. , f = e("../enum/DirectorEvents")
  7353. , g = (p = e("../enum/PlayerEvents"),
  7354. e("../enum/Viewmode"))
  7355. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7356. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7357. , y = $("#hover-bottom, #hover-top").toArray()
  7358. , A = ($("#pullTab").eq(0),
  7359. $("#playHead").eq(0),
  7360. $(".pinBottom-container").eq(0))
  7361. , C = $("#drawer").eq(0)
  7362. , I = $("#drawer-container").eq(0)
  7363. , E = $("#meta-info").eq(0)
  7364. , _ = $(".pinTop.left").eq(0)
  7365. , b = $("#player").eq(0)
  7366. , w = document.getElementById("pullTab")
  7367. , T = !1
  7368. , x = null
  7369. , S = !1
  7370. , M = !1
  7371. , R = null
  7372. , P = !1;
  7373. t.exports.init = function(e, t, i, n) {
  7374. (function(t, i, e, n) {
  7375. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7376. t.controls[e].on(d.Move, r),
  7377. t.controls[e].on(d.LongTap, s)
  7378. }),
  7379. b.on("mousewheel DOMMouseScroll", r),
  7380. e.on(u.TagActivated, r),
  7381. e.on(u.TagNavigation, r),
  7382. i.on(p.FlyingEnded, o),
  7383. i.on(p.ModeChanging, function(e, t) {
  7384. P = t !== g.PANORAMA && e !== g.PANORAMA
  7385. }),
  7386. i.on(p.ModeChanged, function(e, t) {
  7387. R = i.mode,
  7388. t !== g.TRANSITIONING ? a() : r("modeChange")
  7389. }),
  7390. n.on(f.TourStart, function() {
  7391. S = !0,
  7392. r()
  7393. }),
  7394. n.on(f.TourEnd, function() {
  7395. S = !1,
  7396. a()
  7397. }),
  7398. n.on(f.ActionInterrupted, function() {
  7399. S = !1
  7400. }),
  7401. w.addEventListener("touchend", function() {
  7402. $("#pullTab").hasClass("opened") && !S && a()
  7403. }, !0)
  7404. }
  7405. )(e, t, i, n),
  7406. l.isMobile() ? (y.forEach(function(e) {
  7407. e.classList.add("mobile")
  7408. }),
  7409. A.click(a)) : (y.forEach(function(e) {
  7410. e.addEventListener("mouseleave", function() {
  7411. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7412. }, !0)
  7413. }),
  7414. b.mouseleave(function() {
  7415. y[0].classList.contains("detectHover") && a()
  7416. })),
  7417. R = t.mode
  7418. }
  7419. ,
  7420. t.exports.hideUi = r,
  7421. t.exports.resetDrawer = function() {
  7422. I.hasClass("duringTour") || (S = !1,
  7423. r("gui"),
  7424. a())
  7425. }
  7426. }
  7427. , {
  7428. "../enum/ControlEvents": 21,
  7429. "../enum/DirectorEvents": 23,
  7430. "../enum/tagEvents": 32,
  7431. "../enum/PlayerEvents": 40,
  7432. "../enum/Viewmode": 51,
  7433. "../settings": 166,
  7434. "../util/browser": 182,
  7435. "./help/help": 67
  7436. }],
  7437. 70: [function(i, n, e) {
  7438. (function(e) {
  7439. "use strict";
  7440. var t = i("./../util/logger")
  7441. , o = i("./../settings")
  7442. , a = i("./debug")
  7443. , s = i("./../util/common")
  7444. , l = (i("./gui"),
  7445. new t(e));
  7446. o.console && $("body").append('<div id="debug-console"></div>'),
  7447. n.exports.init = function(i, n, r) {
  7448. l.debug("konami has the modelInstance");
  7449. var t = [];
  7450. $(window).on("keydown", function(e) {
  7451. t.push(e.which),
  7452. t.length > o.secretPanelWord.length && t.shift(),
  7453. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7454. o.debug = !0)
  7455. }),
  7456. $(window).on("keydown", function e(t) {
  7457. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7458. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7459. })
  7460. }
  7461. }
  7462. ).call(this, "/js/gui/konami.js")
  7463. }
  7464. , {
  7465. "./../settings": 166,
  7466. "./../util/common": 185,
  7467. "./../util/logger": 189,
  7468. "./debug": 63,
  7469. "./gui": 65
  7470. }],
  7471. 71: [function(e, t, i) {
  7472. "use strict";
  7473. function r() {
  7474. s.clear(m, l.LANDING[v]),
  7475. g.removeClass("fadeIn")
  7476. }
  7477. var o = e("../settings")
  7478. , a = (e("./help/help"),
  7479. e("./helpManager"))
  7480. , s = e("./populateModal")
  7481. , l = e("../enum/HelpModalType")
  7482. , n = e("../enum/Viewmode")
  7483. , c = e("../enum/DirectorEvents")
  7484. , h = e("../enum/PlayerEvents")
  7485. , u = $("#quick-blackout").eq(0)
  7486. , d = $("#quick-logo").eq(0)
  7487. , p = $(".quick-brand").toArray()
  7488. , f = $("#loaderCoBrand").eq(0)
  7489. , g = $("#interaction-modal").eq(0)
  7490. , m = g.find(".interaction").toArray()
  7491. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7492. "");
  7493. t.exports.delayLanding = function(e) {
  7494. var t = $.Deferred();
  7495. e || t.resolve();
  7496. var i = o.startupFlyinDelay;
  7497. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7498. setTimeout(t.resolve.bind(t), i),
  7499. t
  7500. }
  7501. ,
  7502. t.exports.showMessage = function(e, t, i) {
  7503. var n = 0;
  7504. o.quickstart.enabled && (function(e) {
  7505. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7506. d.before(f),
  7507. p = $(".quick-brand").toArray()), */
  7508. u.addClass("fadeOut")
  7509. /* setTimeout(function() {
  7510. p.forEach(function(e) {
  7511. e.classList.add("fadeIn")
  7512. })
  7513. }, o.quickstart.showTextDelay),
  7514. setTimeout(function() {
  7515. p.forEach(function(e) {
  7516. e.classList.add("fadeOut")
  7517. })
  7518. }, o.quickstart.fadeOutDelay) */
  7519. }(i),
  7520. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7521. function(e, t) {
  7522. setTimeout(function() {
  7523. if (a.isHelpEnabled()) {
  7524. if (t(),
  7525. s.init(),
  7526. g.addClass("fadeIn landing " + s.deviceType),
  7527. a.isSmallHelpEnabled())
  7528. return void g.addClass("small");
  7529. s.fill(m, l.LANDING[v]),
  7530. g.addClass(v)
  7531. }
  7532. }, e);
  7533. var i = {
  7534. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7535. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7536. }
  7537. , n = $(".nav-icon .icon");
  7538. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7539. function r(e) {
  7540. e.on("click", function() {
  7541. var e = null;
  7542. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7543. i.length < e || e < 1)
  7544. return !1;
  7545. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7546. "data-page": e,
  7547. src: i.mobile[e - 1]
  7548. }) : n.attr({
  7549. "data-page": e,
  7550. src: i.pc[e - 1]
  7551. })
  7552. })
  7553. }
  7554. r($(".next-button")),
  7555. r($(".prev-button"))
  7556. }(n, function() {
  7557. e.once(h.Move, r),
  7558. t.once(c.TourStart, r)
  7559. })
  7560. }
  7561. ,
  7562. t.exports.init = function(e, t) {
  7563. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7564. }
  7565. ,
  7566. t.exports.dismissModal = r
  7567. }
  7568. , {
  7569. "../enum/DirectorEvents": 23,
  7570. "../enum/HelpModalType": 28,
  7571. "../enum/PlayerEvents": 40,
  7572. "../enum/Viewmode": 51,
  7573. "../settings": 166,
  7574. "./help/help": 67,
  7575. "./helpManager": 68,
  7576. "./populateModal": 75
  7577. }],
  7578. 72: [function(e, t, i) {
  7579. "use strict";
  7580. var n = e("./circleLoader").circleLoader;
  7581. t.exports = {
  7582. element: $("#gui-loading"),
  7583. hide: function(e) {
  7584. n.done(),
  7585. this.element.fadeOut(1500, e)
  7586. },
  7587. show: function(e) {
  7588. this.element.fadeIn(500, function() {
  7589. this.element.css("display", "table"),
  7590. e && e()
  7591. }
  7592. .bind(this))
  7593. },
  7594. progress: function(e) {
  7595. n.set(e)
  7596. }
  7597. }
  7598. }
  7599. , {
  7600. "./circleLoader": 60
  7601. }],
  7602. 73: [function(e, t, i) {
  7603. "use strict";
  7604. var n = e("../settings")
  7605. , r = $("#memory-info")
  7606. , o = r.find("#memory-gpu")
  7607. , a = !1;
  7608. t.exports = {
  7609. show: function() {
  7610. n.profiling.enabled && (r.show(),
  7611. a = !0)
  7612. },
  7613. hide: function() {
  7614. r.hide(),
  7615. a = !1
  7616. },
  7617. toggle: function() {
  7618. a ? this.hide() : this.show()
  7619. },
  7620. update: function(e) {
  7621. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7622. }
  7623. }
  7624. }
  7625. , {
  7626. "../settings": 166
  7627. }],
  7628. 74: [function(e, t, i) {
  7629. "use strict";
  7630. e("../util/browser"),
  7631. e("../analytics");
  7632. e("../settings"),
  7633. t.exports = {
  7634. show: function(e, t) {
  7635. $("#gui-message").fadeOut(500, function() {
  7636. t()
  7637. })
  7638. }
  7639. }
  7640. }
  7641. , {
  7642. "../analytics": 4,
  7643. "../settings": 166,
  7644. "../util/browser": 182
  7645. }],
  7646. 75: [function(e, t, i) {
  7647. "use strict";
  7648. function n(e, t, i, n) {
  7649. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7650. }
  7651. var r = e("../util/browser")
  7652. , o = e("../localization/localize")
  7653. , a = e("../enum/HelpModalType")
  7654. , s = (e("../enum/HelpModalSize"),
  7655. e("../enum/Viewmode"));
  7656. t.exports = {
  7657. init: function() {
  7658. if (!this.hasInitialized) {
  7659. this.hasInitialized = !0,
  7660. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7661. this.assets = {},
  7662. this.assets[a.LANDING[s.PANORAMA]] = {
  7663. desktop: {
  7664. left: {
  7665. "top-info": o.ROTATE,
  7666. "big-image": "images/nav_help_mouse_drag_left.png",
  7667. keyboard: "images/nav_help_keyboard_left_right.png"
  7668. },
  7669. middle: {
  7670. "top-info": o.MOVE,
  7671. "big-image": "images/nav_help_mouse_click.png",
  7672. keyboard: "images/nav_help_keyboard_up_down.png"
  7673. },
  7674. right: {
  7675. "top-info": o.ZOOM,
  7676. "big-image": "images/nav_help_mouse_zoom.png",
  7677. keyboard: "images/nav_help_zoom_keys.png"
  7678. }
  7679. },
  7680. mobile: {
  7681. left: {
  7682. "top-info": o.ROTATE,
  7683. "big-image": "images/nav_help_gesture_drag.png"
  7684. },
  7685. middle: {
  7686. "top-info": o.MOVE,
  7687. "big-image": "images/nav_help_gesture_tap.png"
  7688. },
  7689. right: {
  7690. "top-info": o.ZOOM,
  7691. "big-image": "images/nav_help_gesture_pinch.png"
  7692. }
  7693. }
  7694. },
  7695. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7696. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7697. desktop: {
  7698. left: {
  7699. "top-info": o.ROTATE,
  7700. "big-image": "images/nav_help_mouse_drag_left.png",
  7701. keyboard: "images/nav_help_keyboard_left_right.png"
  7702. },
  7703. middle: {
  7704. "top-info": o.MOVE,
  7705. "big-image": "images/nav_help_mouse_position_right.png"
  7706. }
  7707. },
  7708. mobile: {
  7709. left: {
  7710. "top-info": o.ROTATE,
  7711. "big-image": "images/nav_help_gesture_drag.png"
  7712. },
  7713. middle: {
  7714. "top-info": o.MOVE,
  7715. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7716. }
  7717. }
  7718. },
  7719. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7720. desktop: {
  7721. left: {
  7722. "top-info": o.MOVE,
  7723. "big-image": "images/nav_help_mouse_position_left.png"
  7724. },
  7725. middle: {
  7726. "top-info": o.ROTATE,
  7727. "big-image": "images/nav_help_mouse_drag_right.png",
  7728. keyboard: "images/nav_help_keyboard_left_right.png"
  7729. }
  7730. },
  7731. mobile: {
  7732. left: {
  7733. "top-info": o.MOVE,
  7734. "big-image": "images/nav_help_gesture_position.png"
  7735. },
  7736. middle: {
  7737. "top-info": o.ROTATE,
  7738. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7739. }
  7740. }
  7741. };
  7742. var e = {
  7743. "top-info": o.INSIDE,
  7744. "big-image": "images/nav_help_click_inside.png",
  7745. keyboard: "images/nav_help_inside_key.png"
  7746. };
  7747. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7748. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7749. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7750. var t = {
  7751. "top-info": o.INSIDE,
  7752. "big-image": "images/nav_help_tap_inside.png"
  7753. };
  7754. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7755. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7756. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7757. this.assets[a.NAVIGATION] = {},
  7758. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7759. desktop: {
  7760. left: {
  7761. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7762. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7763. "big-image": "images/nav_help_mouse_drag_left.png",
  7764. keyboard: "images/nav_help_keyboard_left_right.png"
  7765. },
  7766. middle: {
  7767. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7768. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7769. "big-image": "images/nav_help_mouse_click.png",
  7770. keyboard: "images/nav_help_keyboard_up_down.png"
  7771. },
  7772. right: {
  7773. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7774. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7775. "big-image": "images/nav_help_mouse_zoom.png",
  7776. keyboard: "images/nav_help_zoom_keys.png"
  7777. }
  7778. },
  7779. mobile: {
  7780. left: {
  7781. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7782. "big-image": "images/nav_help_gesture_drag.png"
  7783. },
  7784. middle: {
  7785. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7786. "big-image": "images/nav_help_gesture_tap.png"
  7787. },
  7788. right: {
  7789. "top-info": o.HELP_MOBILE_3,
  7790. "big-image": "images/nav_help_gesture_pinch.png"
  7791. }
  7792. }
  7793. },
  7794. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7795. desktop: {
  7796. left: {
  7797. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7798. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7799. "big-image": "images/nav_help_mouse_drag_left.png",
  7800. keyboard: "images/nav_help_keyboard_all.png"
  7801. },
  7802. middle: {
  7803. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7804. "big-image": "images/nav_help_mouse_position_right.png"
  7805. },
  7806. right: {
  7807. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7808. "big-image": "images/nav_help_mouse_zoom.png"
  7809. }
  7810. },
  7811. mobile: {
  7812. left: {
  7813. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7814. "big-image": "images/nav_help_gesture_drag.png"
  7815. },
  7816. middle: {
  7817. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7818. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7819. },
  7820. right: {
  7821. "top-info": o.HELP_MOBILE_3,
  7822. "big-image": "images/nav_help_gesture_pinch.png"
  7823. }
  7824. }
  7825. },
  7826. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7827. desktop: {
  7828. left: {
  7829. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7830. "big-image": "images/nav_help_mouse_position_left.png"
  7831. },
  7832. middle: {
  7833. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7834. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7835. "big-image": "images/nav_help_mouse_drag_right.png",
  7836. keyboard: "images/nav_help_keyboard_left_right.png"
  7837. },
  7838. right: {
  7839. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7840. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7841. "big-image": "images/nav_help_mouse_zoom.png",
  7842. keyboard: "images/nav_help_keyboard_up_down.png"
  7843. }
  7844. },
  7845. mobile: {
  7846. left: {
  7847. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7848. "big-image": "images/nav_help_gesture_position.png"
  7849. },
  7850. middle: {
  7851. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7852. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7853. },
  7854. right: {
  7855. "top-info": o.HELP_MOBILE_3,
  7856. "big-image": "images/nav_help_gesture_pinch.png"
  7857. }
  7858. }
  7859. },
  7860. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7861. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7862. "top-info": o.HELP_DESKTOP_360_2A,
  7863. "bottom-info": o.HELP_DESKTOP_360_2B,
  7864. "big-image": "images/nav_help_click_inside.png",
  7865. keyboard: "images/nav_help_inside_key.png"
  7866. },
  7867. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7868. "top-info": o.HELP_MOBILE_360_2,
  7869. "big-image": "images/nav_help_tap_inside.png"
  7870. },
  7871. this.assets[a.MORE_HELP] = {
  7872. desktop: {
  7873. "more-help-hlr": {
  7874. "top-info": o.HELP_MORE_HLR_A,
  7875. "big-image": "images/nav_help_expand.svg",
  7876. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7877. },
  7878. "more-help-dollhouse": {
  7879. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7880. "big-image": "images/nav_help_dollhouse.svg",
  7881. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7882. },
  7883. "more-help-floors": {
  7884. "top-info": o.HELP_MORE_FLOORS_A,
  7885. "big-image": "images/nav_help_floor picker.svg",
  7886. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7887. },
  7888. "more-help-tag": {
  7889. "top-info": o.HELP_MORE_TAG_A,
  7890. "big-image": "images/nav_help_tag.svg",
  7891. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7892. },
  7893. "more-help-zoom": {
  7894. "top-info": o.HELP_MORE_ZOOM_A,
  7895. "big-image": "images/nav_help_zoom.svg",
  7896. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7897. },
  7898. "more-help-tour": {
  7899. "top-info": o.HELP_MORE_TOUR_A,
  7900. "big-image": "images/nav_help_play.png",
  7901. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7902. },
  7903. "more-help-inside": {
  7904. "top-info": o.HELP_MORE_INSIDE_A,
  7905. "big-image": "images/nav_help_inside.svg",
  7906. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7907. },
  7908. "more-help-vr": {
  7909. "top-info": o.HELP_MORE_VR_A,
  7910. "big-image": "images/nav_help_vr.svg",
  7911. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7912. },
  7913. "more-help-360": {
  7914. "top-info": o.HELP_MORE_360_A,
  7915. "big-image": "images/nav_help_360.svg",
  7916. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7917. },
  7918. "more-help-fullscreen": {
  7919. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7920. "big-image": "images/nav_help_fullscreen.svg",
  7921. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7922. }
  7923. },
  7924. mobile: {
  7925. "more-help-hlr": {
  7926. "top-info": o.HELP_MORE_HLR_A,
  7927. "big-image": "images/nav_help_expand.svg",
  7928. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7929. },
  7930. "more-help-dollhouse": {
  7931. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7932. "big-image": "images/nav_help_dollhouse.svg",
  7933. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7934. },
  7935. "more-help-floors": {
  7936. "top-info": o.HELP_MORE_FLOORS_A,
  7937. "big-image": "images/nav_help_floor picker.svg",
  7938. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7939. },
  7940. "more-help-tag": {
  7941. "top-info": o.HELP_MORE_TAG_A,
  7942. "big-image": "images/nav_help_tag.svg",
  7943. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7944. },
  7945. "more-help-tour": {
  7946. "top-info": o.HELP_MORE_TOUR_A,
  7947. "big-image": "images/nav_help_play.png",
  7948. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7949. },
  7950. "more-help-inside": {
  7951. "top-info": o.HELP_MORE_INSIDE_A,
  7952. "big-image": "images/nav_help_inside.svg",
  7953. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7954. },
  7955. "more-help-vr": {
  7956. "top-info": o.HELP_MORE_VR_A,
  7957. "big-image": "images/webvr.svg",
  7958. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7959. },
  7960. "more-help-360": {
  7961. "top-info": o.HELP_MORE_360_A,
  7962. "big-image": "images/nav_help_360.svg",
  7963. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7964. }
  7965. }
  7966. },
  7967. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7968. desktop: {
  7969. left: {
  7970. "top-info": o.ROTATE,
  7971. "big-image": "images/nav_help_mouse_drag_left.png",
  7972. keyboard: "images/nav_help_keyboard_left_right.png"
  7973. },
  7974. middle: {
  7975. "top-info": o.MOVE,
  7976. "big-image": "images/nav_help_mouse_click.png",
  7977. keyboard: "images/nav_help_keyboard_up_down.png"
  7978. },
  7979. right: {
  7980. "top-info": o.PLAY,
  7981. "big-image": "images/Desktop-help-play-button.svg",
  7982. keyboard: "images/Desktop-help-spacebar-2.svg"
  7983. }
  7984. },
  7985. mobile: {
  7986. left: {
  7987. "top-info": o.ROTATE,
  7988. "big-image": "images/nav_help_gesture_drag.png"
  7989. },
  7990. middle: {
  7991. "top-info": o.MOVE,
  7992. "big-image": "images/nav_help_gesture_tap.png"
  7993. },
  7994. right: {
  7995. "top-info": o.PLAY,
  7996. "big-image": "images/mobile-help-play-button.svg"
  7997. }
  7998. }
  7999. },
  8000. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8001. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8002. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8003. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8004. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8005. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8006. }
  8007. },
  8008. fill: function(e, t, i) {
  8009. n.call(this, e, t, i, !0)
  8010. },
  8011. clear: function(e, t, i) {
  8012. n.call(this, e, t, i, !1)
  8013. }
  8014. }
  8015. }
  8016. , {
  8017. "../enum/HelpModalSize": 27,
  8018. "../enum/HelpModalType": 28,
  8019. "../enum/Viewmode": 51,
  8020. "../localization/localize": 108,
  8021. "../util/browser": 182
  8022. }],
  8023. 76: [function(e, t, i) {
  8024. "use strict";
  8025. t.exports = Object.freeze({
  8026. OPENED: "share.open",
  8027. CLOSED: "share.closed",
  8028. LINK_CLICKED: "share.linked"
  8029. })
  8030. }
  8031. , {}],
  8032. 77: [function(e, t, i) {
  8033. "use strict";
  8034. function n(n) {
  8035. function e(e, t) {
  8036. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8037. I.emit(l.LINK_CLICKED, {
  8038. channel: n
  8039. }),
  8040. window.open(C[n], "shareWindow", i)
  8041. }
  8042. switch (n) {
  8043. case A.FACEBOOK:
  8044. e(580, 420);
  8045. break;
  8046. case A.TWITTER:
  8047. e(550, 440);
  8048. break;
  8049. case A.MAIL:
  8050. I.emit(l.LINK_CLICKED, {
  8051. channel: "email"
  8052. }),
  8053. window.open(C[n], "_blank");
  8054. break;
  8055. case A.LINKEDIN:
  8056. }
  8057. }
  8058. function r(e) {
  8059. I.emit(l.LINK_CLICKED, {
  8060. channel: "copylink"
  8061. });
  8062. var t = document.createRange();
  8063. t.selectNodeContents(v);
  8064. var i = window.getSelection();
  8065. i.removeAllRanges(),
  8066. i.addRange(t),
  8067. document.execCommand("copy"),
  8068. y.classList.remove("hidden"),
  8069. v.classList.add("highlighted")
  8070. }
  8071. function o(e) {
  8072. e && (e.stopPropagation(),
  8073. e.target === v) || (window.getSelection().removeAllRanges(),
  8074. v.classList.remove("highlighted"),
  8075. y.classList.add("hidden"))
  8076. }
  8077. var a = e("../../util/browser")
  8078. , s = e("../../localization/localize")
  8079. , l = e("./ShareEvents")
  8080. , c = e("../../util/common")
  8081. , h = e("events").EventEmitter
  8082. , u = document.getElementById("sharing")
  8083. , d = document.getElementById("share-modal")
  8084. , p = document.getElementById("share-close")
  8085. , f = document.getElementById("facebook-share")
  8086. , g = document.getElementById("twitter-share")
  8087. , m = document.getElementById("mail-share")
  8088. , v = document.getElementById("share-url-text")
  8089. , y = document.getElementById("copy-success")
  8090. , A = Object.freeze({
  8091. FACEBOOK: "facebook",
  8092. TWITTER: "twitter",
  8093. MAIL: "mail",
  8094. LINKEDIN: "linkedin"
  8095. })
  8096. , C = {};
  8097. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8098. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8099. C[A.MAIL] = "mailto:?subject=";
  8100. var I = {
  8101. init: function(e) {
  8102. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8103. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8104. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8105. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8106. u.addEventListener("click", this.toggle.bind(this)),
  8107. p.addEventListener("click", this.hide.bind(this)),
  8108. v.addEventListener("click", r),
  8109. d.addEventListener("click", o),
  8110. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8111. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8112. m.addEventListener("click", n.bind(this, A.MAIL)),
  8113. v.textContent = window.location.href + "&utm_source=4",
  8114. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8115. u.classList.remove("hidden")
  8116. },
  8117. show: function() {
  8118. this.emit(l.OPENED),
  8119. d.classList.add("fadeIn")
  8120. },
  8121. hide: function() {
  8122. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8123. document.selection && document.selection.empty(),
  8124. window.getSelection().removeAllRanges(),
  8125. o(),
  8126. d.classList.remove("fadeIn"))
  8127. },
  8128. toggle: function() {
  8129. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8130. }
  8131. };
  8132. c.extendObject(I, h.prototype),
  8133. t.exports = I
  8134. }
  8135. , {
  8136. "../../localization/localize": 108,
  8137. "../../util/browser": 182,
  8138. "../../util/common": 185,
  8139. "./ShareEvents": 76,
  8140. events: 202
  8141. }],
  8142. 78: [function(e, t, i) {
  8143. "use strict";
  8144. t.exports = Object.freeze({
  8145. OPENED: "terms.opened",
  8146. CLOSED: "terms.closed"
  8147. })
  8148. }
  8149. , {}],
  8150. 79: [function(e, t, i) {
  8151. "use strict";
  8152. var n = e("./TermsEvent")
  8153. , r = e("../../localization/localize")
  8154. , o = e("../../analytics")
  8155. , a = e("../../util/ajax")
  8156. , s = e("../../util/common")
  8157. , l = e("events").EventEmitter
  8158. , c = document.getElementById("terms-modal")
  8159. , h = {
  8160. init: function() {
  8161. $(".footer-terms").on("click", function(e) {
  8162. e.preventDefault(),
  8163. this.show()
  8164. }
  8165. .bind(this)),
  8166. $("#terms-modal .close").on("click", this.hide.bind(this))
  8167. },
  8168. show: function() {
  8169. this.emit(n.OPENED),
  8170. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8171. var t = $("#terms-text").html(e);
  8172. o.track("showcase_gui", {
  8173. gui_action: "click_terms_button",
  8174. interaction_source: "gui"
  8175. }),
  8176. t.find("a").attr("target", "_blank")
  8177. }).fail(function() {
  8178. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8179. }),
  8180. c.classList.add("fadeIn")
  8181. },
  8182. hide: function(e) {
  8183. e && e.preventDefault(),
  8184. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8185. c.classList.remove("fadeIn")
  8186. }
  8187. };
  8188. s.extendObject(h, l.prototype),
  8189. t.exports = h
  8190. }
  8191. , {
  8192. "../../analytics": 4,
  8193. "../../localization/localize": 108,
  8194. "../../util/ajax": 181,
  8195. "../../util/common": 185,
  8196. "./TermsEvent": 78,
  8197. events: 202
  8198. }],
  8199. 80: [function(e, t, i) {
  8200. "use strict";
  8201. t.exports = Object.freeze({
  8202. OPEN_INFO: "title.open.info",
  8203. CLOSE_INFO: "title.close.info",
  8204. SHOW_INFO: "title.show.info",
  8205. HIDE_INFO: "title.hide.info",
  8206. LINK_CLICKED: "title.link.click",
  8207. CONTACT_LINK_CLICKED: "title.contact.click",
  8208. ORIGIN_LINK_CLICKED: "title.origin.click"
  8209. })
  8210. }
  8211. , {}],
  8212. 81: [function(e, t, i) {
  8213. "use strict";
  8214. var o = e("../../settings");
  8215. t.exports.init = function(e, t) {
  8216. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8217. function e(e) {
  8218. t.shouldShowtags = "show" === this.value,
  8219. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8220. }
  8221. document.getElementById("tag-toggles").classList.remove("hidden"),
  8222. document.getElementById("radio-tag-show").checked = !0;
  8223. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8224. n[r].addEventListener("change", e)
  8225. }(e, t)
  8226. }
  8227. }
  8228. , {
  8229. "../../settings": 166
  8230. }],
  8231. 82: [function(S, M, e) {
  8232. (function(e) {
  8233. "use strict";
  8234. function i(e) {
  8235. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8236. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8237. _.appendChild(function(e) {
  8238. var t = document.createElement("a");
  8239. return t.id = "url",
  8240. t.target = "_blank",
  8241. t.href = e,
  8242. t.innerText = e,
  8243. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8244. t
  8245. }(e)),
  8246. b.forEach(function(e) {
  8247. e.classList.add("share-link")
  8248. }),
  8249. 0))
  8250. }
  8251. function s(e, t) {
  8252. var i = e
  8253. , n = t;
  8254. return function(e, t) {
  8255. i.push(t || n, e)
  8256. }
  8257. }
  8258. var l = S("../../util/browser")
  8259. , t = S("../../util/common")
  8260. , n = S("../../util/logger")
  8261. , r = S("../../localization/localize")
  8262. , o = S("./titleBarSettings")
  8263. , c = S("../../settings")
  8264. , a = S("./TitleEvents")
  8265. , h = S("events").EventEmitter
  8266. , u = new n(e)
  8267. , d = document.querySelector(".pinTop.left")
  8268. , p = document.getElementsByClassName("title-container")[0]
  8269. , f = document.getElementById("title-toggle").querySelector("i")
  8270. , g = document.getElementById("meta-info-wrapper")
  8271. , m = document.getElementById("meta-info")
  8272. , v = document.getElementById("meta-description")
  8273. , y = document.getElementsByClassName("contact-info")[0]
  8274. , A = document.getElementById("contact-data")
  8275. , C = document.getElementById("addressTxt")
  8276. , I = document.getElementById("tag-toggles")
  8277. , E = document.getElementById("share-origin")
  8278. , _ = document.getElementById("share-link-wrapper")
  8279. , b = [m, g, p]
  8280. , w = !1
  8281. , T = !1
  8282. , x = {
  8283. populate: function(e) {
  8284. if (function(e, t) {
  8285. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8286. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8287. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8288. document.getElementById("gui-name").classList.add("noCoBrand"),
  8289. document.getElementById("cobrandTitle").classList.add("hidden")),
  8290. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8291. !1)
  8292. }(DATA.name, e.coBrand)) {
  8293. if (function(e) {
  8294. e ? (w = !0,
  8295. v.innerHTML = e) : v.classList.add("hidden")
  8296. }(e.description),
  8297. function(e, t, i, n) {
  8298. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8299. w = !0;
  8300. var r = []
  8301. , o = s(r, "<br>");
  8302. if (e && o('<span id="contactName">' + e + "</span>"),
  8303. t) {
  8304. var a = n || t;
  8305. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8306. }
  8307. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8308. r[0] = "",
  8309. A.innerHTML = r.join("")
  8310. } else
  8311. y.classList.add("hidden")
  8312. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8313. function(e) {
  8314. if ("string" == typeof e)
  8315. try {
  8316. e = JSON.parse(e)
  8317. } catch (e) {
  8318. return u.warn("Unable to parse address data"),
  8319. C.parentElement.classList.add("hidden")
  8320. }
  8321. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8322. w = !0;
  8323. var t = []
  8324. , i = s(t, " ");
  8325. e.address_1 && i(e.address_1),
  8326. e.address_2 && i(e.address_2),
  8327. e.city && i(e.city, ", "),
  8328. e.state && i(e.state, ", "),
  8329. e.zip && i(e.zip, e.state ? " " : ", "),
  8330. t[0] = "",
  8331. C.innerText = t.join("")
  8332. } else
  8333. C.parentElement.classList.add("hidden")
  8334. }(e.address),
  8335. w) {
  8336. var t = document.createElement("br");
  8337. I.insertBefore(t, I.firstElementChild)
  8338. }
  8339. e.socialSharing && c.share.enabled && (T = i(e.url))
  8340. }
  8341. },
  8342. finishSetup: function(e) {
  8343. w = w || !!e,
  8344. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8345. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8346. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8347. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8348. }),
  8349. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8350. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8351. contact_type: e.getAttribute("id")
  8352. }))
  8353. }),
  8354. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8355. },
  8356. toggleMeta: function(e, t) {
  8357. var i = document.getElementById("model-title");
  8358. t && t.preventDefault();
  8359. var n = m.classList.contains("expand");
  8360. e && !n || (n ? (b.forEach(function(e) {
  8361. e.classList.remove("expand")
  8362. }),
  8363. this.emit(a.CLOSE_INFO),
  8364. i.classList.remove("expand")) : (b.forEach(function(e) {
  8365. e.classList.add("expand")
  8366. }),
  8367. i.classList.add("expand"),
  8368. this.emit(a.OPEN_INFO)))
  8369. },
  8370. setupToggling: function() {
  8371. g.style.height = m.offsetHeight + "px",
  8372. m.addEventListener("transitionend", function() {
  8373. g.style.height = m.offsetHeight + "px"
  8374. })
  8375. },
  8376. toggleTitle: function(e) {
  8377. e && e.preventDefault(),
  8378. d.classList.contains("closed") ? (d.classList.add("open"),
  8379. f.classList.remove("icon-dpad-right"),
  8380. f.classList.add("icon-dpad-left"),
  8381. this.emit(a.SHOW_INFO),
  8382. setTimeout(function() {
  8383. d.classList.remove("closed"),
  8384. d.classList.remove("open")
  8385. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8386. f.classList.remove("icon-dpad-left"),
  8387. f.classList.add("icon-dpad-right"),
  8388. this.emit(a.HIDE_INFO))
  8389. }
  8390. };
  8391. t.extendObject(x, h.prototype),
  8392. M.exports = x
  8393. }
  8394. ).call(this, "/js/gui/title/titleBar.js")
  8395. }
  8396. , {
  8397. "../../localization/localize": 108,
  8398. "../../settings": 166,
  8399. "../../util/browser": 182,
  8400. "../../util/common": 185,
  8401. "../../util/logger": 189,
  8402. "./TitleEvents": 80,
  8403. "./titleBarSettings": 83,
  8404. events: 202
  8405. }],
  8406. 83: [function(e, t, i) {
  8407. "use strict";
  8408. t.exports = Object.freeze({
  8409. minTooltipCharacters: 19,
  8410. removeAnimationClasses: 500
  8411. })
  8412. }
  8413. , {}],
  8414. 84: [function(e, t, i) {
  8415. "use strict";
  8416. function n() {
  8417. v.playTour(),
  8418. y && clearTimeout(y),
  8419. c(),
  8420. E.removeClass("fadeIn")
  8421. }
  8422. function r() {
  8423. A.classList.contains("playing") && (v.stopTour(),
  8424. E.addClass("fadeIn"),
  8425. setTimeout(function() {
  8426. E.removeClass("fadeIn")
  8427. }, h.tourInteraction.showPauseButton),
  8428. M || (clearTimeout(y),
  8429. y = setTimeout(s, h.tourInteraction.showModal)),
  8430. setTimeout(function() {
  8431. A.classList.remove("playing")
  8432. }, h.tourInteraction.allowNextClick))
  8433. }
  8434. function o() {
  8435. v.tourInProgress && (v.stopTour(),
  8436. v.endTourProgress(),
  8437. A.classList.remove("playing"))
  8438. }
  8439. function a() {
  8440. _.is(":visible") ? n() : r()
  8441. }
  8442. function s() {//去掉导览结束时的提示
  8443. /* if (!h.tourInteraction.disabled) {
  8444. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8445. T.addClass("fadeIn tour " + p.deviceType);
  8446. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8447. if (!h.tourInteraction.smallModal)
  8448. 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,
  8449. p.fill(x, g.TOUR_INTERACTION[e]),
  8450. T.addClass(e);
  8451. T.addClass(t)
  8452. } */
  8453. }
  8454. function l(e, t) {
  8455. if (t) {
  8456. var i = "keydown" === t.type
  8457. , n = t.which === u.SPACE || v.tourIsPlaying;
  8458. i && n || e || (M = !0),
  8459. v.atEndOfTour() && c(),
  8460. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8461. c(),
  8462. t.which !== u.SPACE && o()),
  8463. i && n && a()
  8464. }
  8465. }
  8466. function c() {
  8467. T.removeClass("fadeIn")
  8468. }
  8469. var h = (e("../util/browser"),
  8470. e("../settings"))
  8471. , u = e("../enum/Keys")
  8472. , d = e("../enum/Viewmode")
  8473. , p = (e("./helpManager"),
  8474. e("./populateModal"))
  8475. , f = e("../enum/DirectorEvents")
  8476. , g = e("../enum/HelpModalType")
  8477. , m = e("../enum/HelpModalSize")
  8478. , v = null
  8479. , y = null
  8480. , A = document.getElementById("pause-overlay")
  8481. , C = document.getElementById("player")
  8482. , I = document.getElementById("gui")
  8483. , E = $("#pause-icon").eq(0)
  8484. , _ = $("#play").eq(0)
  8485. , b = $("#playHead").eq(0)
  8486. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8487. , T = $("#interaction-modal").eq(0)
  8488. , x = $("#interaction-modal .interaction").toArray()
  8489. , S = ["touchstart", "mousedown", "pointerdown"]
  8490. , M = !1;
  8491. t.exports.init = function(e) {
  8492. v = e,
  8493. S.forEach(function(t) {
  8494. C.addEventListener(t, l.bind(this, !1), !0),
  8495. I.addEventListener(t, l.bind(this, !0), !0),
  8496. A.addEventListener(t, r, !0),
  8497. w.forEach(function(e) {
  8498. e.addEventListener(t, o, !0)
  8499. }),
  8500. $("#drawer img").on(t, o)
  8501. }),
  8502. document.addEventListener("keydown", l.bind(this, !1), !0),
  8503. v.on(f.TourStart, function() {
  8504. A.classList.add("playing")
  8505. })
  8506. }
  8507. ,
  8508. t.exports.play = n,
  8509. t.exports.pause = r,
  8510. t.exports.pauseWithoutCTA = o,
  8511. t.exports.togglePlay = a,
  8512. t.exports.stopTour = function() {
  8513. b.hasClass("playing") && (clearTimeout(y),
  8514. v.atEndOfTour() ? (A.classList.remove("playing"),
  8515. s()) : E.removeClass("fadeIn"))
  8516. }
  8517. ,
  8518. t.exports.dismissModal = c
  8519. }
  8520. , {
  8521. "../enum/DirectorEvents": 23,
  8522. "../enum/HelpModalSize": 27,
  8523. "../enum/HelpModalType": 28,
  8524. "../enum/Keys": 30,
  8525. "../enum/Viewmode": 51,
  8526. "../settings": 166,
  8527. "../util/browser": 182,
  8528. "./helpManager": 68,
  8529. "./populateModal": 75
  8530. }],
  8531. 85: [function(e, t, i) {
  8532. "use strict";
  8533. t.exports = Object.freeze({
  8534. OPENED: "vr.modal.opened",
  8535. LAUNCH: "vr.modal.launch",
  8536. CLOSED: "vr.modal.closed",
  8537. NEXT: "vr.modal.next",
  8538. PREV: "vr.modal.prev",
  8539. STORE: "vr.modal.store",
  8540. falseICECHOSEN: "vr.modal.device"
  8541. })
  8542. }
  8543. , {}],
  8544. 86: [function(e, t, i) {
  8545. "use strict";
  8546. var h = e("../../util/browser")
  8547. , u = e("../../enum/VRApps")
  8548. , n = e("../../enum/VRPlatforms")
  8549. , d = e("../../util/ajax")
  8550. , p = e("../../settings")
  8551. , r = {};
  8552. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8553. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8554. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8555. u) {
  8556. var a = u[o];
  8557. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8558. }
  8559. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8560. "https://" + s);
  8561. t.exports.init = function(e, t, o) {
  8562. function a(e, t, i, n) {
  8563. function r() {
  8564. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8565. }
  8566. 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()
  8567. }
  8568. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8569. , l = g + "/vr/dlist/?ret=" + s
  8570. , c = g + "/vr/show/?ret=" + s;
  8571. switch (e) {
  8572. case n.IOS:
  8573. !function(t, e, i, n) {
  8574. var r = a(t, e, i, n)
  8575. , o = {
  8576. responseType: "json",
  8577. data: {
  8578. branch_key: p.appConfig.branch_key,
  8579. data: {
  8580. m: e,
  8581. full_url: r,
  8582. $desktop_url: "",
  8583. $og_app_id: "331853976762864119",
  8584. $og_title: i,
  8585. $og_description: n,
  8586. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8587. $canonical_url: window.location.href
  8588. }
  8589. }
  8590. };
  8591. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8592. f[t] = e.url
  8593. }).fail(function(e) {
  8594. f[t] = e
  8595. }
  8596. .bind(this, r))
  8597. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8598. break;
  8599. default:
  8600. !function(e, t, i) {
  8601. for (var n in u) {
  8602. var r = u[n]
  8603. , o = a(r, e, t, i);
  8604. f[r] = o
  8605. }
  8606. }(t.sid, t.name, t.summary)
  8607. }
  8608. }
  8609. ,
  8610. t.exports.launch = function(e) {
  8611. var t = f[e];
  8612. window.open(t, "_blank")
  8613. }
  8614. ,
  8615. t.exports.launchStore = function(e) {
  8616. var t = r[e];
  8617. window.open(t, "_blank")
  8618. }
  8619. }
  8620. , {
  8621. "../../enum/VRApps": 46,
  8622. "../../enum/VRPlatforms": 49,
  8623. "../../settings": 166,
  8624. "../../util/ajax": 181,
  8625. "../../util/browser": 182
  8626. }],
  8627. 87: [function(e, t, i) {
  8628. "use strict";
  8629. function c(e) {
  8630. var t;
  8631. switch (e) {
  8632. case y.IOS:
  8633. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8634. case y.Android:
  8635. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8636. }
  8637. return !1
  8638. }
  8639. function h(e) {
  8640. switch (e) {
  8641. case y.Android:
  8642. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8643. x.filter(".gearvr").off().on("click", q.gear),
  8644. n(k, U, "logo-button", "same-line");
  8645. break;
  8646. case y.UnsupportedAndroid:
  8647. n("", H, "", "");
  8648. break;
  8649. case y.IOS:
  8650. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8651. n(k, "", "logo-button", "");
  8652. break;
  8653. case y.Desktop:
  8654. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8655. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8656. n(k, U, "logo-button", "same-line"),
  8657. Q.cardboard()
  8658. }
  8659. }
  8660. function u(e) {
  8661. $(".p1, .p2, .p3").hide(),
  8662. l.insertAfter(T),
  8663. w.removeClass("front-page"),
  8664. w.removeClass("details-page"),
  8665. w.removeClass("lastPage"),
  8666. x.removeClass("logo-button"),
  8667. x.removeClass("same-line"),
  8668. T.removeClass("headsetOptions"),
  8669. S.attr("src", ""),
  8670. S.filter(".second").removeClass("gear"),
  8671. S.css("display", "inline-block"),
  8672. S.off(),
  8673. M.filter(".second").css("display", ""),
  8674. O.css("display", "none"),
  8675. $(".p" + (e + 1) + _).show(),
  8676. S.filter(".third").insertBefore(M.filter(".third"))
  8677. }
  8678. function n(e, t, i, n) {
  8679. w.addClass("front-page"),
  8680. S.filter(".first").attr("src", e),
  8681. S.filter(".second").attr("src", t),
  8682. x.filter(".first").addClass(i),
  8683. x.filter(".second").addClass(i),
  8684. x.addClass(n),
  8685. ".show-desktop" === _ && T.insertAfter(l)
  8686. }
  8687. function r(e, t, i) {
  8688. T.addClass("headsetOptions"),
  8689. x.off(),
  8690. S.filter(".second").attr("src", t),
  8691. O.css("display", "block"),
  8692. M.filter(".second").css("display", "none"),
  8693. O.on("click", function() {
  8694. u(b.Title),
  8695. h(y.Desktop)
  8696. }),
  8697. e && (X.emit(C.falseICECHOSEN, {
  8698. name: v.GearVR
  8699. }),
  8700. S.filter(".first").attr("src", e),
  8701. S.filter(".second").addClass("gear"),
  8702. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8703. Q.gearvr()),
  8704. i && (X.emit(C.falseICECHOSEN, {
  8705. name: v.Cardboard
  8706. }),
  8707. S.filter(".third").attr("src", i),
  8708. S.filter(".third").show(),
  8709. S.filter(".third").insertAfter(S.filter(".second")),
  8710. S.filter(".third").addClass("link"),
  8711. S.filter(".second").addClass("link"),
  8712. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8713. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8714. Q.cardboard())
  8715. }
  8716. function d(e, t) {
  8717. switch (t) {
  8718. case y.IOS:
  8719. j = W,
  8720. Y = G;
  8721. break;
  8722. case y.Desktop:
  8723. e === b.Cardboard ? (j = N,
  8724. Y = B,
  8725. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8726. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8727. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8728. Y = "");
  8729. break;
  8730. default:
  8731. Y = e === b.Cardboard ? (j = H,
  8732. G) : (j = V,
  8733. z)
  8734. }
  8735. }
  8736. function p(e, t, i) {
  8737. w.find(".inner").addClass("details-page"),
  8738. w.addClass("details-page"),
  8739. S.filter(".first").attr("src", e),
  8740. S.filter(".second").attr("src", t),
  8741. S.filter(".third").attr("src", i)
  8742. }
  8743. function f() {
  8744. var e = 1 < g.aspectRatio() && g.isMobile();
  8745. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8746. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8747. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8748. }
  8749. var g = e("../../util/browser")
  8750. , m = e("./vrLink")
  8751. , v = e("../../enum/VRApps")
  8752. , y = e("../../enum/VRPlatforms")
  8753. , A = e("../../enum/VRPages")
  8754. , C = e("./vrEvent")
  8755. , o = (e("../../settings"),
  8756. e("../../constants"))
  8757. , I = e("../../localization/localize")
  8758. , a = e("../../util/common")
  8759. , s = e("events").EventEmitter
  8760. , E = 0
  8761. , _ = null
  8762. , b = A.standard
  8763. , w = $(".vr-popup")
  8764. , l = w.find(".vr-popup-body")
  8765. , T = w.find(".vr-images")
  8766. , x = w.find(".img-container")
  8767. , S = w.find(".vr-sm-image")
  8768. , M = x.find(".vr-img-caption")
  8769. , R = $(".vr-buttons").find(".prev-button")
  8770. , P = $(".vr-buttons").find(".next-button")
  8771. , O = T.find(".front-close")
  8772. , L = $(".vr-page")
  8773. , D = w.find("img")
  8774. , N = "images/apple-store.png"
  8775. , F = "images/badge-oculus.png"
  8776. , B = "images/badge-cardboard.png"
  8777. , V = "images/logo-samsung.png"
  8778. , k = "images/headset-cardboard.png"
  8779. , U = "images/headset-gearvr.png"
  8780. , H = "images/ico-android-robot.png"
  8781. , z = "images/ico-gearvr.png"
  8782. , G = "images/ico-vr.png"
  8783. , W = "images/apple-logo-white.svg"
  8784. , j = null
  8785. , Y = null
  8786. , q = {}
  8787. , X = {
  8788. init: function(e, t) {
  8789. function i(e) {
  8790. X.emit(C.STORE, {
  8791. type: e
  8792. }),
  8793. m.launchStore(e)
  8794. }
  8795. function n(e) {
  8796. switch (e !== b.pageCount && (u(e),
  8797. L.text(e + 1 + " / " + b.pageCount)),
  8798. e) {
  8799. case b.Title:
  8800. R.css("display", "none"),
  8801. P.text(a[e]),
  8802. h(r);
  8803. break;
  8804. case b.Cardboard:
  8805. R.css("display", "block"),
  8806. P.text(a[e]),
  8807. x.filter(".cardboard").off(),
  8808. x.filter(".gearvr").off(),
  8809. d(e, r),
  8810. p(k, j, Y);
  8811. break;
  8812. case b.Gear:
  8813. P.text(a[e]),
  8814. d(e, r),
  8815. w.addClass("lastPage"),
  8816. p(U, j, Y);
  8817. break;
  8818. case b.pageCount:
  8819. w.removeClass("fadeIn"),
  8820. X.emit(C.CLOSED)
  8821. }
  8822. D.filter("[src='']").hide()
  8823. }
  8824. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8825. _ = ".show-supported",
  8826. y.Android) : (w.addClass("unsupported"),
  8827. _ = ".show-unsupported",
  8828. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8829. _ = ".show-ios",
  8830. b = A.ios,
  8831. y.IOS) : (w.addClass("desktop"),
  8832. _ = ".show-desktop",
  8833. y.Desktop);
  8834. function o(e) {
  8835. X.emit(C.LAUNCH, {
  8836. vr_platform: r,
  8837. vr_app: e
  8838. }),
  8839. m.launch(e)
  8840. }
  8841. m.init(r, e, t),
  8842. r !== y.Desktop && w.addClass("mobile"),
  8843. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8844. q.gear = o.bind(this, v.GearVR),
  8845. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8846. f(),
  8847. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8848. $(_).show();
  8849. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8850. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8851. r === y.IOS && (a.splice(1, 1),
  8852. s.splice(1, 1)),
  8853. $("#vr").on("click", function(e) {
  8854. e.preventDefault(),
  8855. window.vrEnabled || (window.vrEnabled = !0,
  8856. this.classList.add("active"),
  8857. $("#gui div").not("#vrOff").addClass("vrHide"),
  8858. $("#vrOffImg").css({
  8859. display: "inline-block"
  8860. }))
  8861. }),
  8862. $("#vrOff").on("click", function() {
  8863. window.vrEnabled = !1,
  8864. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8865. $("#vrOffImg").css({
  8866. display: "none"
  8867. }),
  8868. $("#player canvas").css({
  8869. width: "",
  8870. height: ""
  8871. }),
  8872. $("#vr").removeClass("active")
  8873. });
  8874. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8875. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8876. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8877. $("span.modelLink").text(l),
  8878. R.on("click", function(e) {
  8879. X.emit(C.PREV),
  8880. n(--E)
  8881. }),
  8882. P.on("click", function(e) {
  8883. P.text(),
  8884. X.emit(C.NEXT, {
  8885. nextAction: s[E]
  8886. }),
  8887. n(++E)
  8888. }),
  8889. w.find(".close").on("click", X.dismiss)
  8890. },
  8891. dismiss: function() {
  8892. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8893. X.emit(C.CLOSED))
  8894. },
  8895. isDeviceSupported: c
  8896. };
  8897. a.extendObject(X, s.prototype),
  8898. $(window).resize(f);
  8899. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8900. K = M.filter(".first").find(".gearvr"),
  8901. {
  8902. cardboard: function() {
  8903. K.addClass("hidden"),
  8904. Z.removeClass("hidden")
  8905. },
  8906. gearvr: function() {
  8907. Z.addClass("hidden"),
  8908. K.removeClass("hidden")
  8909. }
  8910. });
  8911. t.exports = X
  8912. }
  8913. , {
  8914. "../../constants": 8,
  8915. "../../enum/VRApps": 46,
  8916. "../../enum/VRPages": 48,
  8917. "../../enum/VRPlatforms": 49,
  8918. "../../localization/localize": 108,
  8919. "../../settings": 166,
  8920. "../../util/browser": 182,
  8921. "../../util/common": 185,
  8922. "./vrEvent": 85,
  8923. "./vrLink": 86,
  8924. events: 202
  8925. }],
  8926. 88: [function(e, t, i) {
  8927. "use strict";
  8928. t.exports = Object.freeze({
  8929. OPENED: "webvr.modal.opened",
  8930. SHOW_TERMS: "webvr.footer.show.terms"
  8931. })
  8932. }
  8933. , {}],
  8934. 89: [function(B, V, e) {
  8935. (function(e) {
  8936. "use strict";
  8937. function a() {
  8938. function t() {
  8939. p.isPresenting || (r.info("exiting webVR"),
  8940. c("webvr_exit_app"),
  8941. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8942. window.removeEventListener("vrdisplaypresentchange", t))
  8943. }
  8944. r.info("Headset mounted"),
  8945. u.suspend();
  8946. var e = document.createElement("canvas");
  8947. for (e.getContext("webgl"),
  8948. e.className = "webvr-canvas",
  8949. document.bgColor = "#000",
  8950. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8951. document.body.removeChild(document.body.firstChild);
  8952. document.body.appendChild(e),
  8953. c("webvr_enter_app"),
  8954. p.requestPresent([{
  8955. source: e,
  8956. predistorted: !0
  8957. }]).catch(function(e) {
  8958. r.error("Failed to present: " + e),
  8959. c("webvr_exit_calibrate"),
  8960. t()
  8961. }),
  8962. d.then(function() {
  8963. window.dispatchEvent(new Event("vrapp-start"))
  8964. }),
  8965. window.addEventListener("vrdisplaypresentchange", t)
  8966. }
  8967. function s() {
  8968. c("webvr_modal_close"),
  8969. _.find(".enter-button").off("click", a),
  8970. E.fadeOut(g.guiAnimationSpeed, function() {
  8971. _.toggleClass("hidden", !1),
  8972. b.toggleClass("hidden", !0),
  8973. f.exitFullscreen()
  8974. }),
  8975. I.fadeIn(g.guiAnimationSpeed)
  8976. }
  8977. function t() {
  8978. M.toggleClass("hidden", !0),
  8979. S.toggleClass("hidden", !1)
  8980. }
  8981. function l() {
  8982. _.toggleClass("hidden"),
  8983. b.toggleClass("hidden")
  8984. }
  8985. function c(e) {
  8986. var t = f.isLandscape() ? "landscape" : "portrait";
  8987. i.trackAlways("showcase_gui", {
  8988. gui_action: e,
  8989. orientation: t
  8990. })
  8991. }
  8992. function h() {
  8993. var e = f.isLandscape();
  8994. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8995. }
  8996. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8997. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8998. 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 = {
  8999. init: function(e, t, i, n) {
  9000. function r(e) {
  9001. e.preventDefault(),
  9002. o(e.currentTarget.id)
  9003. }
  9004. function o(i) {
  9005. F[i](),
  9006. Object.keys(F).map(function(e, t) {
  9007. $("#" + e).toggleClass("tabs-underlined", e === i)
  9008. })
  9009. }
  9010. p = i,
  9011. u = t,
  9012. y.init(m.Android, e, n),
  9013. h(),
  9014. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9015. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9016. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9017. w.filter(".device-headset-side").attr("src", R),
  9018. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9019. $("#vr").on("click", function(e) {
  9020. e.preventDefault(),
  9021. c("click_webvr_button"),
  9022. E.is(":hidden") && (N.emit(A.OPENED),
  9023. I.fadeOut(g.guiAnimationSpeed),
  9024. E.fadeIn(g.guiAnimationSpeed),
  9025. function() {
  9026. if (!d) {
  9027. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9028. d = new Promise(function(e, t) {
  9029. var i = document.createElement("script");
  9030. i.type = "text/javascript",
  9031. i.src = n,
  9032. i.onload = e,
  9033. document.head.appendChild(i)
  9034. }
  9035. )
  9036. }
  9037. _.find(".enter-button").on("click", a)
  9038. }())
  9039. }),
  9040. $(".webvr-popup .close").on("click", function(e) {
  9041. e.preventDefault(),
  9042. _.hasClass("hidden") ? (c("webvr_help_close"),
  9043. l()) : s()
  9044. }),
  9045. $("#tabcardboard").on("click", r),
  9046. $("#tabdaydream").on("click", r),
  9047. $("#tabnative").on("click", r),
  9048. $(".webvr-popup .open-with-app").on("click", function(e) {
  9049. e.preventDefault(),
  9050. c("webvr_learn_more"),
  9051. o("tabnative"),
  9052. l()
  9053. }),
  9054. $(".webvr-popup .help").on("click", function(e) {
  9055. e.preventDefault(),
  9056. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9057. l()
  9058. }),
  9059. $(".webvr-popup .terms").on("click", function(e) {
  9060. e.preventDefault(),
  9061. c("webvr_click_terms"),
  9062. s(),
  9063. N.emit(A.SHOW_TERMS)
  9064. }),
  9065. T.on("click", function(e) {
  9066. e.preventDefault(),
  9067. c(D),
  9068. window.open(L, "_blank")
  9069. }),
  9070. x.on("click", function(e) {
  9071. e.preventDefault(),
  9072. c("webvr_phone_link"),
  9073. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9074. }),
  9075. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9076. e.preventDefault(),
  9077. c("webvr_cardboard_link"),
  9078. y.launch(v.CardboardAndroid)
  9079. }),
  9080. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9081. e.preventDefault(),
  9082. c("webvr_oculus_link"),
  9083. y.launch(v.GearVR)
  9084. })
  9085. }
  9086. }, F = {
  9087. tabcardboard: function() {
  9088. w.filter(".device-headset").attr("src", R),
  9089. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9090. L = "https://vr.google.com/cardboard/get-cardboard/",
  9091. D = "webvr_cardboard_link",
  9092. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9093. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9094. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9095. t()
  9096. },
  9097. tabdaydream: function() {
  9098. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9099. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9100. L = P,
  9101. D = O,
  9102. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9103. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9104. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9105. t()
  9106. },
  9107. tabnative: function() {
  9108. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9109. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9110. M.toggleClass("hidden", !1),
  9111. S.toggleClass("hidden", !0)
  9112. }
  9113. };
  9114. n.extendObject(N, o.prototype),
  9115. $(window).resize(h),
  9116. V.exports = N
  9117. }
  9118. ).call(this, "/js/gui/webvr/webVRgui.js")
  9119. }
  9120. , {
  9121. "../../analytics": 4,
  9122. "../../constants": 8,
  9123. "../../enum/VRApps": 46,
  9124. "../../enum/VRPlatforms": 49,
  9125. "../../localization/localize": 108,
  9126. "../../settings": 166,
  9127. "../../util/browser": 182,
  9128. "../../util/common": 185,
  9129. "../../util/logger": 189,
  9130. "./../gui": 65,
  9131. "./../vr/vrLink": 86,
  9132. "./WebVrEvent": 88,
  9133. events: 202
  9134. }],
  9135. 90: [function(e, t, i) {
  9136. "use strict";
  9137. function n(e, t, i, n, r) {
  9138. this.floorId = n || 0 === n ? n : -1,
  9139. this.roomId = r || "",
  9140. this.labelId = e,
  9141. this.position = (new o.Vector3).copy(t),
  9142. this.text = i
  9143. }
  9144. var o = e("three")
  9145. , r = e("../util/browser");
  9146. n.prototype.build = function() {
  9147. var e = window.document.createElement("div");
  9148. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9149. var t = window.document.createElement("div");
  9150. t.setAttribute("class", "gui-floorplan-label-text");
  9151. var i = window.document.createTextNode(this.text);
  9152. t.appendChild(i),
  9153. e.appendChild(t),
  9154. window.document.body.appendChild(e),
  9155. this.labelGui = e,
  9156. this.textBlock = t,
  9157. $(this.labelGui).hide();
  9158. var n = window.getComputedStyle(this.labelGui);
  9159. this.initialTransform = n.transform || n.webkitTransform
  9160. }
  9161. ,
  9162. t.exports = n
  9163. }
  9164. , {
  9165. "../util/browser": 182,
  9166. three: 217
  9167. }],
  9168. 91: [function(e, t, i) {
  9169. "use strict";
  9170. function n() {
  9171. this.player = null,
  9172. this.modelManager = null,
  9173. this.container = null
  9174. }
  9175. var c, o, r = e("three"), a = (e("../util/common"),
  9176. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9177. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9178. e("../util/transitions"),
  9179. e("../util/lerp"),
  9180. e("../util/browser"));
  9181. n.prototype.init = function(e, t, i) {
  9182. this.player = e,
  9183. this.modelManager = t,
  9184. this.container = i,
  9185. this.updateModel(),
  9186. this.bindEvents()
  9187. }
  9188. ,
  9189. n.prototype.bindEvents = function() {
  9190. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9191. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9192. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9193. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9194. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9195. }
  9196. ,
  9197. n.prototype.updateModel = function() {
  9198. this.model = this.modelManager.getActiveModel()
  9199. }
  9200. ,
  9201. n.prototype.handlePlayerViewChanged = function() {
  9202. this.updateLabelVisibility(),
  9203. this.updateLabelDisplay()
  9204. }
  9205. ,
  9206. n.prototype.getLabelsForFloor = function(t, i) {
  9207. return (i = i || []).length = 0,
  9208. this.model.labels.forEach(function(e) {
  9209. this.labelVisibleForFloor(e, t) && i.push(e)
  9210. }
  9211. .bind(this)),
  9212. i
  9213. }
  9214. ,
  9215. n.prototype.getLabelsForCurrentFloor = function(e) {
  9216. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9217. }
  9218. ,
  9219. n.prototype.labelVisibleForFloor = function(e, t) {
  9220. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9221. if (!this.model.showingLabels || !e.labelGui || !i)
  9222. return !1;
  9223. var n = e.floorId === this.model.floors.size() - 1;
  9224. return this.model.allFloorsVisible ? n : e.floorId === t
  9225. }
  9226. ,
  9227. n.prototype.updateLabelVisibility = function(e) {
  9228. this.model.labels.forEach(function(e) {
  9229. 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)
  9230. }
  9231. .bind(this))
  9232. }
  9233. ,
  9234. n.prototype.showAllLabels = function(t, i) {
  9235. this.model.labels.forEach(function(e) {
  9236. this.showLabel(e, t, i)
  9237. }
  9238. .bind(this))
  9239. }
  9240. ,
  9241. n.prototype.hideAllLabels = function(t, i) {
  9242. this.model.labels.forEach(function(e) {
  9243. this.hideLabel(e, t, i)
  9244. }
  9245. .bind(this))
  9246. }
  9247. ,
  9248. n.prototype.showLabel = function(e, t, i) {
  9249. this.model.showingLabels && (e.visible || (e.visible = !0,
  9250. e.labelGui.style.display = "block",
  9251. e.labelGui.style.opacity = 0,
  9252. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9253. }
  9254. ,
  9255. n.prototype.hideLabel = function(e, t, i) {
  9256. e.visible && (e.visible = !1,
  9257. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9258. }
  9259. ,
  9260. n.prototype.supportedMode = function() {
  9261. return this.player.mode === h.FLOORPLAN
  9262. }
  9263. ,
  9264. n.prototype.updateLabelDisplay = (new r.Vector3,
  9265. new r.Vector3,
  9266. o = [],
  9267. function() {
  9268. var e = this.player.getLabelScaleFactor()
  9269. , t = 1.2 * (1 - e) + .6
  9270. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9271. this.getLabelsForCurrentFloor(o);
  9272. for (var n = 0; n < o.length; n++) {
  9273. var r = o[n];
  9274. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9275. 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)
  9276. }
  9277. }
  9278. ),
  9279. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9280. new r.Vector3,
  9281. function(e, t, i, n, r) {
  9282. t.style.fontSize = 100 * r + "%";
  9283. var o = .5 * $("#player").width()
  9284. , a = .5 * $("#player").height();
  9285. c.copy(i),
  9286. c.project(this.player.camera);
  9287. var s = c.x * o + o
  9288. , l = -c.y * a + a;
  9289. s -= e.offsetWidth / 2,
  9290. l -= e.offsetHeight / 2,
  9291. e.style.left = s + "px",
  9292. e.style.top = l + "px"
  9293. }
  9294. ),
  9295. n.prototype.handleStartInside = function(e) {
  9296. this.updateLabelVisibility()
  9297. }
  9298. ,
  9299. n.prototype.handleStartOutside = function() {
  9300. this.updateLabelVisibility()
  9301. }
  9302. ,
  9303. t.exports = n
  9304. }
  9305. , {
  9306. "../enum/DirectorEvents": 23,
  9307. "../enum/ModelManagerEvents": 33,
  9308. "../enum/PlayerEvents": 40,
  9309. "../enum/Viewmode": 51,
  9310. "../enum/WarpStyle": 52,
  9311. "../settings": 166,
  9312. "../util/browser": 182,
  9313. "../util/common": 185,
  9314. "../util/lerp": 188,
  9315. "../util/transitions": 195,
  9316. three: 217
  9317. }],
  9318. 92: [function(e, t, i) {
  9319. "use strict";
  9320. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9321. if (null == this)
  9322. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9323. if ("function" != typeof e)
  9324. throw new TypeError("predicate must be a function");
  9325. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9326. if (t = i[o],
  9327. e.call(r, t, o, i))
  9328. return o;
  9329. return -1
  9330. }
  9331. ),
  9332. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9333. value: function(e) {
  9334. if (null == this)
  9335. throw new TypeError('"this" is null or not defined');
  9336. var t = Object(this)
  9337. , i = t.length >>> 0;
  9338. if ("function" != typeof e)
  9339. throw new TypeError("predicate must be a function");
  9340. for (var n = arguments[1], r = 0; r < i; ) {
  9341. var o = t[r];
  9342. if (e.call(n, o, r, t))
  9343. return o;
  9344. r++
  9345. }
  9346. }
  9347. })
  9348. }
  9349. , {}],
  9350. 93: [function(e, t, i) {
  9351. "use strict";
  9352. 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 || {};
  9353. function te() {
  9354. this.backgroundElement = document.createElement("div"),
  9355. r.extend(this.backgroundElement.style, {
  9356. backgroundColor: "rgba(0,0,0,0.8)",
  9357. top: 0,
  9358. left: 0,
  9359. display: "none",
  9360. zIndex: "1000",
  9361. opacity: 0,
  9362. WebkitTransition: "opacity 0.2s linear"
  9363. }),
  9364. n.makeFullscreen(this.backgroundElement),
  9365. this.backgroundElement.style.position = "fixed",
  9366. this.domElement = document.createElement("div"),
  9367. r.extend(this.domElement.style, {
  9368. position: "fixed",
  9369. display: "none",
  9370. zIndex: "1001",
  9371. opacity: 0,
  9372. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9373. }),
  9374. document.body.appendChild(this.backgroundElement),
  9375. document.body.appendChild(this.domElement);
  9376. var e = this;
  9377. n.bind(this.backgroundElement, "click", function() {
  9378. e.hide()
  9379. })
  9380. }
  9381. function ie(e, t, i) {
  9382. Object.defineProperty(e, t, {
  9383. get: function() {
  9384. return "RGB" === this.__state.space || re(this, t, i),
  9385. this.__state[t]
  9386. },
  9387. set: function(e) {
  9388. "RGB" !== this.__state.space && (re(this, t, i),
  9389. this.__state.space = "RGB"),
  9390. this.__state[t] = e
  9391. }
  9392. })
  9393. }
  9394. function ne(e, t) {
  9395. Object.defineProperty(e, t, {
  9396. get: function() {
  9397. return "HSV" === this.__state.space || oe(this),
  9398. this.__state[t]
  9399. },
  9400. set: function(e) {
  9401. "HSV" !== this.__state.space && (oe(this),
  9402. this.__state.space = "HSV"),
  9403. this.__state[t] = e
  9404. }
  9405. })
  9406. }
  9407. function re(e, t, i) {
  9408. if ("HEX" === e.__state.space)
  9409. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9410. else {
  9411. if ("HSV" !== e.__state.space)
  9412. throw "Corrupted color state";
  9413. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9414. }
  9415. }
  9416. function oe(e) {
  9417. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9418. l.extend(e.__state, {
  9419. s: t.s,
  9420. v: t.v
  9421. }),
  9422. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9423. }
  9424. function ae() {
  9425. if (this.__state = o.apply(this, arguments),
  9426. !1 === this.__state)
  9427. throw "Failed to interpret color arguments";
  9428. this.__state.a = this.__state.a || 1
  9429. }
  9430. function se(e) {
  9431. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9432. }
  9433. function le(e, t) {
  9434. this.initialValue = e[t],
  9435. this.domElement = document.createElement("div"),
  9436. this.object = e,
  9437. this.property = t,
  9438. this.__onChange = void 0,
  9439. this.__onFinishChange = void 0
  9440. }
  9441. (t.exports = ee).gui = ee.gui || {},
  9442. ee.utils = ee.utils || {},
  9443. ee.controllers = ee.controllers || {},
  9444. ee.dom = ee.dom || {},
  9445. ee.color = ee.color || {},
  9446. ee.utils.css = {
  9447. load: function(e, t) {
  9448. var i = (t = t || document).createElement("link");
  9449. i.type = "text/css",
  9450. i.rel = "stylesheet",
  9451. i.href = e,
  9452. t.getElementsByTagName("head")[0].appendChild(i)
  9453. },
  9454. inject: function(e, t) {
  9455. t = t || document;
  9456. var i = document.createElement("style");
  9457. i.type = "text/css",
  9458. i.innerHTML = e,
  9459. t.getElementsByTagName("head")[0].appendChild(i)
  9460. }
  9461. },
  9462. ee.utils.common = (Q = Array.prototype.forEach,
  9463. J = Array.prototype.slice,
  9464. {
  9465. BREAK: {},
  9466. extend: function(i) {
  9467. return this.each(J.call(arguments, 1), function(e) {
  9468. for (var t in e)
  9469. this.isUndefined(e[t]) || (i[t] = e[t])
  9470. }, this),
  9471. i
  9472. },
  9473. defaults: function(i) {
  9474. return this.each(J.call(arguments, 1), function(e) {
  9475. for (var t in e)
  9476. this.isUndefined(i[t]) && (i[t] = e[t])
  9477. }, this),
  9478. i
  9479. },
  9480. compose: function() {
  9481. var i = J.call(arguments);
  9482. return function() {
  9483. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9484. e = [i[t].apply(this, e)];
  9485. return e[0]
  9486. }
  9487. },
  9488. each: function(e, t, i) {
  9489. if (e)
  9490. if (Q && e.forEach && e.forEach === Q)
  9491. e.forEach(t, i);
  9492. else if (e.length === e.length + 0) {
  9493. for (var n = 0, r = e.length; n < r; n++)
  9494. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9495. return
  9496. } else
  9497. for (var n in e)
  9498. if (t.call(i, e[n], n) === this.BREAK)
  9499. return
  9500. },
  9501. defer: function(e) {
  9502. setTimeout(e, 0)
  9503. },
  9504. toArray: function(e) {
  9505. return e.toArray ? e.toArray() : J.call(e)
  9506. },
  9507. isUndefined: function(e) {
  9508. return void 0 === e
  9509. },
  9510. isNull: function(e) {
  9511. return null === e
  9512. },
  9513. isNaN: function(e) {
  9514. return e != e
  9515. },
  9516. isArray: Array.isArray || function(e) {
  9517. return e.constructor === Array
  9518. }
  9519. ,
  9520. isObject: function(e) {
  9521. return e === Object(e)
  9522. },
  9523. isNumber: function(e) {
  9524. return e === e + 0
  9525. },
  9526. isString: function(e) {
  9527. return e === e + ""
  9528. },
  9529. isBoolean: function(e) {
  9530. return !1 === e || !0 === e
  9531. },
  9532. isFunction: function(e) {
  9533. return "[object Function]" === Object.prototype.toString.call(e)
  9534. }
  9535. }),
  9536. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9537. onChange: function(e) {
  9538. return this.__onChange = e,
  9539. this
  9540. },
  9541. onFinishChange: function(e) {
  9542. return this.__onFinishChange = e,
  9543. this
  9544. },
  9545. setValue: function(e) {
  9546. return this.object[this.property] = e,
  9547. this.__onChange && this.__onChange.call(this, e),
  9548. this.updateDisplay(),
  9549. this
  9550. },
  9551. getValue: function() {
  9552. return this.object[this.property]
  9553. },
  9554. updateDisplay: function() {
  9555. return this
  9556. },
  9557. isModified: function() {
  9558. return this.initialValue !== this.getValue()
  9559. }
  9560. }),
  9561. le),
  9562. ee.dom.dom = function(c) {
  9563. function i(e) {
  9564. if ("0" === e || c.isUndefined(e))
  9565. return 0;
  9566. var t = e.match(n);
  9567. return c.isNull(t) ? 0 : parseFloat(t[1])
  9568. }
  9569. var h = {};
  9570. c.each({
  9571. HTMLEvents: ["change"],
  9572. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9573. KeyboardEvents: ["keydown"]
  9574. }, function(e, t) {
  9575. c.each(e, function(e) {
  9576. h[e] = t
  9577. })
  9578. });
  9579. var n = /(\d+(\.\d+)?)px/
  9580. , r = {
  9581. makeSelectable: function(e, t) {
  9582. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9583. return !1
  9584. }
  9585. : function() {}
  9586. ,
  9587. e.style.MozUserSelect = t ? "auto" : "none",
  9588. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9589. e.unselectable = t ? "on" : "off")
  9590. },
  9591. makeFullscreen: function(e, t, i) {
  9592. c.isUndefined(t) && (t = !0),
  9593. c.isUndefined(i) && (i = !0),
  9594. e.style.position = "absolute",
  9595. t && (e.style.left = 0,
  9596. e.style.right = 0),
  9597. i && (e.style.top = 0,
  9598. e.style.bottom = 0)
  9599. },
  9600. fakeEvent: function(e, t, i, n) {
  9601. i = i || {};
  9602. var r = h[t];
  9603. if (!r)
  9604. throw new Error("Event type " + t + " not supported.");
  9605. var o = document.createEvent(r);
  9606. switch (r) {
  9607. case "MouseEvents":
  9608. var a = i.x || i.clientX || 0
  9609. , s = i.y || i.clientY || 0;
  9610. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9611. break;
  9612. case "KeyboardEvents":
  9613. var l = o.initKeyboardEvent || o.initKeyEvent;
  9614. c.defaults(i, {
  9615. cancelable: !0,
  9616. ctrlKey: !1,
  9617. altKey: !1,
  9618. shiftKey: !1,
  9619. metaKey: !1,
  9620. keyCode: void 0,
  9621. charCode: void 0
  9622. }),
  9623. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9624. break;
  9625. default:
  9626. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9627. }
  9628. c.defaults(o, n),
  9629. e.dispatchEvent(o)
  9630. },
  9631. bind: function(e, t, i, n) {
  9632. return n = n || !1,
  9633. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9634. r
  9635. },
  9636. unbind: function(e, t, i, n) {
  9637. return n = n || !1,
  9638. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9639. r
  9640. },
  9641. addClass: function(e, t) {
  9642. if (void 0 === e.className)
  9643. e.className = t;
  9644. else if (e.className !== t) {
  9645. var i = e.className.split(/ +/);
  9646. -1 == i.indexOf(t) && (i.push(t),
  9647. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9648. }
  9649. return r
  9650. },
  9651. removeClass: function(e, t) {
  9652. if (t)
  9653. if (void 0 === e.className)
  9654. ;
  9655. else if (e.className === t)
  9656. e.removeAttribute("class");
  9657. else {
  9658. var i = e.className.split(/ +/)
  9659. , n = i.indexOf(t);
  9660. -1 != n && (i.splice(n, 1),
  9661. e.className = i.join(" "))
  9662. }
  9663. else
  9664. e.className = void 0;
  9665. return r
  9666. },
  9667. hasClass: function(e, t) {
  9668. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9669. },
  9670. getWidth: function(e) {
  9671. var t = getComputedStyle(e);
  9672. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9673. },
  9674. getHeight: function(e) {
  9675. var t = getComputedStyle(e);
  9676. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9677. },
  9678. getOffset: function(e) {
  9679. var t = {
  9680. left: 0,
  9681. top: 0
  9682. };
  9683. if (e.offsetParent)
  9684. for (; t.left += e.offsetLeft,
  9685. t.top += e.offsetTop,
  9686. e = e.offsetParent; )
  9687. ;
  9688. return t
  9689. },
  9690. isActive: function(e) {
  9691. return e === document.activeElement && (e.type || e.href)
  9692. }
  9693. };
  9694. return r
  9695. }(ee.utils.common),
  9696. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9697. X = ee.dom.dom,
  9698. Z = ee.utils.common,
  9699. (K = function(e, t, i) {
  9700. K.superclass.call(this, e, t);
  9701. var n = this;
  9702. if (this.__select = document.createElement("select"),
  9703. Z.isArray(i)) {
  9704. var r = {};
  9705. Z.each(i, function(e) {
  9706. r[e] = e
  9707. }),
  9708. i = r
  9709. }
  9710. Z.each(i, function(e, t) {
  9711. var i = document.createElement("option");
  9712. i.innerHTML = t,
  9713. i.setAttribute("value", e),
  9714. n.__select.appendChild(i)
  9715. }),
  9716. this.updateDisplay(),
  9717. X.bind(this.__select, "change", function() {
  9718. var e = this.options[this.selectedIndex].value;
  9719. n.setValue(e)
  9720. }),
  9721. this.domElement.appendChild(this.__select)
  9722. }
  9723. ).superclass = q,
  9724. Z.extend(K.prototype, q.prototype, {
  9725. setValue: function(e) {
  9726. var t = K.superclass.prototype.setValue.call(this, e);
  9727. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9728. t
  9729. },
  9730. updateDisplay: function() {
  9731. return this.__select.value = this.getValue(),
  9732. K.superclass.prototype.updateDisplay.call(this)
  9733. }
  9734. }),
  9735. K),
  9736. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9737. j = ee.utils.common,
  9738. (Y = function(e, t, i) {
  9739. Y.superclass.call(this, e, t),
  9740. i = i || {},
  9741. this.__min = i.min,
  9742. this.__max = i.max,
  9743. this.__step = i.step,
  9744. 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,
  9745. this.__precision = se(this.__impliedStep)
  9746. }
  9747. ).superclass = W,
  9748. j.extend(Y.prototype, W.prototype, {
  9749. setValue: function(e) {
  9750. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9751. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9752. Y.superclass.prototype.setValue.call(this, e)
  9753. },
  9754. min: function(e) {
  9755. return this.__min = e,
  9756. this
  9757. },
  9758. max: function(e) {
  9759. return this.__max = e,
  9760. this
  9761. },
  9762. step: function(e) {
  9763. return this.__step = e,
  9764. this.__impliedStep = e,
  9765. this.__precision = se(e),
  9766. this
  9767. }
  9768. }),
  9769. Y),
  9770. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9771. H = ee.dom.dom,
  9772. z = ee.utils.common,
  9773. (G = function(e, t, i) {
  9774. function n() {
  9775. var e = parseFloat(s.__input.value);
  9776. z.isNaN(e) || s.setValue(e)
  9777. }
  9778. function r(e) {
  9779. var t = a - e.clientY;
  9780. s.setValue(s.getValue() + t * s.__impliedStep),
  9781. a = e.clientY
  9782. }
  9783. function o() {
  9784. H.unbind(window, "mousemove", r),
  9785. H.unbind(window, "mouseup", o)
  9786. }
  9787. this.__truncationSuspended = !1,
  9788. G.superclass.call(this, e, t, i);
  9789. var a, s = this;
  9790. this.__input = document.createElement("input"),
  9791. this.__input.setAttribute("type", "text"),
  9792. H.bind(this.__input, "change", n),
  9793. H.bind(this.__input, "blur", function() {
  9794. n(),
  9795. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9796. }),
  9797. H.bind(this.__input, "mousedown", function(e) {
  9798. H.bind(window, "mousemove", r),
  9799. H.bind(window, "mouseup", o),
  9800. a = e.clientY
  9801. }),
  9802. H.bind(this.__input, "keydown", function(e) {
  9803. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9804. this.blur(),
  9805. s.__truncationSuspended = !1)
  9806. }),
  9807. this.updateDisplay(),
  9808. this.domElement.appendChild(this.__input)
  9809. }
  9810. ).superclass = U,
  9811. z.extend(G.prototype, U.prototype, {
  9812. updateDisplay: function() {
  9813. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9814. var i = Math.pow(10, t);
  9815. return Math.round(e * i) / i
  9816. }(this.getValue(), this.__precision),
  9817. G.superclass.prototype.updateDisplay.call(this)
  9818. }
  9819. }),
  9820. G),
  9821. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9822. F = ee.dom.dom,
  9823. B = ee.utils.css,
  9824. V = ee.utils.common,
  9825. (k = function(e, t, i, n, r) {
  9826. function o(e) {
  9827. e.preventDefault();
  9828. var t = F.getOffset(s.__background)
  9829. , i = F.getWidth(s.__background);
  9830. return s.setValue(function(e, t, i, n, r) {
  9831. return n + (e - t) / (i - t) * (r - n)
  9832. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9833. !1
  9834. }
  9835. function a() {
  9836. F.unbind(window, "mousemove", o),
  9837. F.unbind(window, "mouseup", a),
  9838. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9839. }
  9840. k.superclass.call(this, e, t, {
  9841. min: i,
  9842. max: n,
  9843. step: r
  9844. });
  9845. var s = this;
  9846. this.__background = document.createElement("div"),
  9847. this.__foreground = document.createElement("div"),
  9848. F.bind(this.__background, "mousedown", function(e) {
  9849. F.bind(window, "mousemove", o),
  9850. F.bind(window, "mouseup", a),
  9851. o(e)
  9852. }),
  9853. F.addClass(this.__background, "slider"),
  9854. F.addClass(this.__foreground, "slider-fg"),
  9855. this.updateDisplay(),
  9856. this.__background.appendChild(this.__foreground),
  9857. this.domElement.appendChild(this.__background)
  9858. }
  9859. ).superclass = N,
  9860. k.useDefaultStyles = function() {
  9861. 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}")
  9862. }
  9863. ,
  9864. V.extend(k.prototype, N.prototype, {
  9865. updateDisplay: function() {
  9866. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9867. return this.__foreground.style.width = 100 * e + "%",
  9868. k.superclass.prototype.updateDisplay.call(this)
  9869. }
  9870. }),
  9871. k),
  9872. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9873. O = ee.dom.dom,
  9874. L = ee.utils.common,
  9875. (D = function(e, t, i) {
  9876. D.superclass.call(this, e, t);
  9877. var n = this;
  9878. this.__button = document.createElement("div"),
  9879. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9880. O.bind(this.__button, "click", function(e) {
  9881. return e.preventDefault(),
  9882. n.fire(),
  9883. !1
  9884. }),
  9885. O.addClass(this.__button, "button"),
  9886. this.domElement.appendChild(this.__button)
  9887. }
  9888. ).superclass = P,
  9889. L.extend(D.prototype, P.prototype, {
  9890. fire: function() {
  9891. this.__onChange && this.__onChange.call(this),
  9892. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9893. this.getValue().call(this.object)
  9894. }
  9895. }),
  9896. D),
  9897. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9898. S = ee.dom.dom,
  9899. M = ee.utils.common,
  9900. (R = function(e, t) {
  9901. R.superclass.call(this, e, t);
  9902. var i = this;
  9903. this.__prev = this.getValue(),
  9904. this.__checkbox = document.createElement("input"),
  9905. this.__checkbox.setAttribute("type", "checkbox"),
  9906. S.bind(this.__checkbox, "change", function() {
  9907. i.setValue(!i.__prev)
  9908. }, !1),
  9909. this.domElement.appendChild(this.__checkbox),
  9910. this.updateDisplay()
  9911. }
  9912. ).superclass = x,
  9913. M.extend(R.prototype, x.prototype, {
  9914. setValue: function(e) {
  9915. var t = R.superclass.prototype.setValue.call(this, e);
  9916. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9917. this.__prev = this.getValue(),
  9918. t
  9919. },
  9920. updateDisplay: function() {
  9921. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9922. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9923. R.superclass.prototype.updateDisplay.call(this)
  9924. }
  9925. }),
  9926. R),
  9927. ee.color.toString = (T = ee.utils.common,
  9928. function(e) {
  9929. if (1 == e.a || T.isUndefined(e.a)) {
  9930. for (var t = e.hex.toString(16); t.length < 6; )
  9931. t = "0" + t;
  9932. return "#" + t
  9933. }
  9934. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9935. }
  9936. ),
  9937. ee.color.interpret = (I = ee.color.toString,
  9938. E = ee.utils.common,
  9939. w = [{
  9940. litmus: E.isString,
  9941. conversions: {
  9942. THREE_CHAR_HEX: {
  9943. read: function(e) {
  9944. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9945. return null !== t && {
  9946. space: "HEX",
  9947. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9948. }
  9949. },
  9950. write: I
  9951. },
  9952. SIX_CHAR_HEX: {
  9953. read: function(e) {
  9954. var t = e.match(/^#([A-F0-9]{6})$/i);
  9955. return null !== t && {
  9956. space: "HEX",
  9957. hex: parseInt("0x" + t[1].toString())
  9958. }
  9959. },
  9960. write: I
  9961. },
  9962. CSS_RGB: {
  9963. read: function(e) {
  9964. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9965. return null !== t && {
  9966. space: "RGB",
  9967. r: parseFloat(t[1]),
  9968. g: parseFloat(t[2]),
  9969. b: parseFloat(t[3])
  9970. }
  9971. },
  9972. write: I
  9973. },
  9974. CSS_RGBA: {
  9975. read: function(e) {
  9976. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9977. return null !== t && {
  9978. space: "RGB",
  9979. r: parseFloat(t[1]),
  9980. g: parseFloat(t[2]),
  9981. b: parseFloat(t[3]),
  9982. a: parseFloat(t[4])
  9983. }
  9984. },
  9985. write: I
  9986. }
  9987. }
  9988. }, {
  9989. litmus: E.isNumber,
  9990. conversions: {
  9991. HEX: {
  9992. read: function(e) {
  9993. return {
  9994. space: "HEX",
  9995. hex: e,
  9996. conversionName: "HEX"
  9997. }
  9998. },
  9999. write: function(e) {
  10000. return e.hex
  10001. }
  10002. }
  10003. }
  10004. }, {
  10005. litmus: E.isArray,
  10006. conversions: {
  10007. RGB_ARRAY: {
  10008. read: function(e) {
  10009. return 3 == e.length && {
  10010. space: "RGB",
  10011. r: e[0],
  10012. g: e[1],
  10013. b: e[2]
  10014. }
  10015. },
  10016. write: function(e) {
  10017. return [e.r, e.g, e.b]
  10018. }
  10019. },
  10020. RGBA_ARRAY: {
  10021. read: function(e) {
  10022. return 4 == e.length && {
  10023. space: "RGB",
  10024. r: e[0],
  10025. g: e[1],
  10026. b: e[2],
  10027. a: e[3]
  10028. }
  10029. },
  10030. write: function(e) {
  10031. return [e.r, e.g, e.b, e.a]
  10032. }
  10033. }
  10034. }
  10035. }, {
  10036. litmus: E.isObject,
  10037. conversions: {
  10038. RGBA_OBJ: {
  10039. read: function(e) {
  10040. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10041. space: "RGB",
  10042. r: e.r,
  10043. g: e.g,
  10044. b: e.b,
  10045. a: e.a
  10046. }
  10047. },
  10048. write: function(e) {
  10049. return {
  10050. r: e.r,
  10051. g: e.g,
  10052. b: e.b,
  10053. a: e.a
  10054. }
  10055. }
  10056. },
  10057. RGB_OBJ: {
  10058. read: function(e) {
  10059. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10060. space: "RGB",
  10061. r: e.r,
  10062. g: e.g,
  10063. b: e.b
  10064. }
  10065. },
  10066. write: function(e) {
  10067. return {
  10068. r: e.r,
  10069. g: e.g,
  10070. b: e.b
  10071. }
  10072. }
  10073. },
  10074. HSVA_OBJ: {
  10075. read: function(e) {
  10076. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10077. space: "HSV",
  10078. h: e.h,
  10079. s: e.s,
  10080. v: e.v,
  10081. a: e.a
  10082. }
  10083. },
  10084. write: function(e) {
  10085. return {
  10086. h: e.h,
  10087. s: e.s,
  10088. v: e.v,
  10089. a: e.a
  10090. }
  10091. }
  10092. },
  10093. HSV_OBJ: {
  10094. read: function(e) {
  10095. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10096. space: "HSV",
  10097. h: e.h,
  10098. s: e.s,
  10099. v: e.v
  10100. }
  10101. },
  10102. write: function(e) {
  10103. return {
  10104. h: e.h,
  10105. s: e.s,
  10106. v: e.v
  10107. }
  10108. }
  10109. }
  10110. }
  10111. }],
  10112. function() {
  10113. b = !1;
  10114. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10115. return E.each(w, function(e) {
  10116. if (e.litmus(i))
  10117. return E.each(e.conversions, function(e, t) {
  10118. if (_ = e.read(i),
  10119. !1 === b && !1 !== _)
  10120. return (b = _).conversionName = t,
  10121. _.conversion = e,
  10122. E.BREAK
  10123. }),
  10124. E.BREAK
  10125. }),
  10126. b
  10127. }
  10128. ),
  10129. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10130. function y(e, t, i, n) {
  10131. if (void 0 === t[i])
  10132. throw new Error("Object " + t + ' has no property "' + i + '"');
  10133. var r;
  10134. if (n.color)
  10135. r = new g(t,i);
  10136. else {
  10137. var o = [t, i].concat(n.factoryArgs);
  10138. r = c.apply(e, o)
  10139. }
  10140. n.before instanceof h && (n.before = n.before.__li),
  10141. C(e, r),
  10142. m.addClass(r.domElement, "c");
  10143. var a = document.createElement("span");
  10144. m.addClass(a, "property-name"),
  10145. a.innerHTML = r.property;
  10146. var s = document.createElement("div");
  10147. s.appendChild(a),
  10148. s.appendChild(r.domElement);
  10149. var l = A(e, s, n.before);
  10150. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10151. m.addClass(l, typeof r.getValue()),
  10152. function(t, i, n) {
  10153. if (n.__li = i,
  10154. n.__gui = t,
  10155. v.extend(n, {
  10156. options: function(e) {
  10157. return 1 < arguments.length ? (n.remove(),
  10158. y(t, n.object, n.property, {
  10159. before: n.__li.nextElementSibling,
  10160. factoryArgs: [v.toArray(arguments)]
  10161. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10162. y(t, n.object, n.property, {
  10163. before: n.__li.nextElementSibling,
  10164. factoryArgs: [e]
  10165. })) : void 0
  10166. },
  10167. name: function(e) {
  10168. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10169. n
  10170. },
  10171. listen: function() {
  10172. return n.__gui.listen(n),
  10173. n
  10174. },
  10175. remove: function() {
  10176. return n.__gui.remove(n),
  10177. n
  10178. }
  10179. }),
  10180. n instanceof f) {
  10181. var r = new p(n.object,n.property,{
  10182. min: n.__min,
  10183. max: n.__max,
  10184. step: n.__step
  10185. });
  10186. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10187. var t = n[e]
  10188. , i = r[e];
  10189. n[e] = r[e] = function() {
  10190. var e = Array.prototype.slice.call(arguments);
  10191. return t.apply(n, e),
  10192. i.apply(r, e)
  10193. }
  10194. }),
  10195. m.addClass(i, "has-slider"),
  10196. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10197. } else if (n instanceof p) {
  10198. var e = function(e) {
  10199. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10200. y(t, n.object, n.property, {
  10201. before: n.__li.nextElementSibling,
  10202. factoryArgs: [n.__min, n.__max, n.__step]
  10203. })) : e
  10204. };
  10205. n.min = v.compose(e, n.min),
  10206. n.max = v.compose(e, n.max)
  10207. } else
  10208. n instanceof u ? (m.bind(i, "click", function() {
  10209. m.fakeEvent(n.__checkbox, "click")
  10210. }),
  10211. m.bind(n.__checkbox, "click", function(e) {
  10212. e.stopPropagation()
  10213. })) : n instanceof d ? (m.bind(i, "click", function() {
  10214. m.fakeEvent(n.__button, "click")
  10215. }),
  10216. m.bind(i, "mouseover", function() {
  10217. m.addClass(n.__button, "hover")
  10218. }),
  10219. m.bind(i, "mouseout", function() {
  10220. m.removeClass(n.__button, "hover")
  10221. })) : n instanceof g && (m.addClass(i, "color"),
  10222. n.updateDisplay = v.compose(function(e) {
  10223. return i.style.borderLeftColor = n.__color.toString(),
  10224. e
  10225. }, n.updateDisplay),
  10226. n.updateDisplay());
  10227. n.setValue = v.compose(function(e) {
  10228. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10229. e
  10230. }, n.setValue)
  10231. }(e, l, r),
  10232. e.__controllers.push(r),
  10233. r
  10234. }
  10235. function A(e, t, i) {
  10236. var n = document.createElement("li");
  10237. return t && n.appendChild(t),
  10238. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10239. e.onResize(),
  10240. n
  10241. }
  10242. function C(e, t) {
  10243. var i = e.getRoot()
  10244. , n = i.__rememberedObjects.indexOf(t.object);
  10245. if (-1 != n) {
  10246. var r = i.__rememberedObjectIndecesToControllers[n];
  10247. if (void 0 === r && (r = {},
  10248. i.__rememberedObjectIndecesToControllers[n] = r),
  10249. r[t.property] = t,
  10250. i.load && i.load.remembered) {
  10251. var o, a = i.load.remembered;
  10252. if (a[e.preset])
  10253. o = a[e.preset];
  10254. else {
  10255. if (!a[T])
  10256. return;
  10257. o = a[T]
  10258. }
  10259. if (o[n] && void 0 !== o[n][t.property]) {
  10260. var s = o[n][t.property];
  10261. t.initialValue = s,
  10262. t.setValue(s)
  10263. }
  10264. }
  10265. }
  10266. }
  10267. function I(e, t) {
  10268. return document.location.href + "." + t
  10269. }
  10270. function l(e, t) {
  10271. e.domElement.style.width = t + "px",
  10272. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10273. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10274. }
  10275. function a(r, o) {
  10276. var a = {};
  10277. return v.each(r.__rememberedObjects, function(e, t) {
  10278. var i = {}
  10279. , n = r.__rememberedObjectIndecesToControllers[t];
  10280. v.each(n, function(e, t) {
  10281. i[t] = o ? e.initialValue : e.getValue()
  10282. }),
  10283. a[t] = i
  10284. }),
  10285. a
  10286. }
  10287. function E(e, t, i) {
  10288. var n = document.createElement("option");
  10289. n.innerHTML = t,
  10290. n.value = t,
  10291. e.__preset_select.appendChild(n),
  10292. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10293. }
  10294. function _(e, t) {
  10295. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10296. i.innerHTML = t ? i.value + "*" : i.value
  10297. }
  10298. 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");
  10299. var b, w, T = "Default", x = function() {
  10300. try {
  10301. return "localStorage"in window && null !== window.localStorage
  10302. } catch (e) {
  10303. return !1
  10304. }
  10305. }(), S = !0, s = !1, M = [], R = function(t) {
  10306. var i = this;
  10307. this.domElement = document.createElement("div"),
  10308. this.__ul = document.createElement("ul"),
  10309. this.domElement.appendChild(this.__ul),
  10310. m.addClass(this.domElement, "dg"),
  10311. this.__folders = {},
  10312. this.__controllers = [],
  10313. this.__rememberedObjects = [],
  10314. this.__rememberedObjectIndecesToControllers = [],
  10315. this.__listening = [],
  10316. t = t || {},
  10317. t = v.defaults(t, {
  10318. autoPlace: !0,
  10319. width: R.DEFAULT_WIDTH
  10320. }),
  10321. t = v.defaults(t, {
  10322. resizable: t.autoPlace,
  10323. hideable: t.autoPlace
  10324. }),
  10325. v.isUndefined(t.load) ? t.load = {
  10326. preset: T
  10327. } : t.preset && (t.load.preset = t.preset),
  10328. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10329. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10330. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10331. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10332. if (Object.defineProperties(this, {
  10333. parent: {
  10334. get: function() {
  10335. return t.parent
  10336. }
  10337. },
  10338. scrollable: {
  10339. get: function() {
  10340. return t.scrollable
  10341. }
  10342. },
  10343. autoPlace: {
  10344. get: function() {
  10345. return t.autoPlace
  10346. }
  10347. },
  10348. preset: {
  10349. get: function() {
  10350. return i.parent ? i.getRoot().preset : t.load.preset
  10351. },
  10352. set: function(e) {
  10353. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10354. function(e) {
  10355. for (var t = 0; t < e.__preset_select.length; t++)
  10356. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10357. }(this),
  10358. i.revert()
  10359. }
  10360. },
  10361. width: {
  10362. get: function() {
  10363. return t.width
  10364. },
  10365. set: function(e) {
  10366. t.width = e,
  10367. l(i, e)
  10368. }
  10369. },
  10370. name: {
  10371. get: function() {
  10372. return t.name
  10373. },
  10374. set: function(e) {
  10375. t.name = e,
  10376. a && (a.innerHTML = t.name)
  10377. }
  10378. },
  10379. closed: {
  10380. get: function() {
  10381. return t.closed
  10382. },
  10383. set: function(e) {
  10384. t.closed = e,
  10385. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10386. this.onResize(),
  10387. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10388. }
  10389. },
  10390. load: {
  10391. get: function() {
  10392. return t.load
  10393. }
  10394. },
  10395. useLocalStorage: {
  10396. get: function() {
  10397. return r
  10398. },
  10399. set: function(e) {
  10400. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10401. localStorage.setItem(I(0, "isLocal"), e))
  10402. }
  10403. }
  10404. }),
  10405. v.isUndefined(t.parent)) {
  10406. if (t.closed = !1,
  10407. m.addClass(this.domElement, R.CLASS_MAIN),
  10408. m.makeSelectable(this.domElement, !1),
  10409. x && r) {
  10410. i.useLocalStorage = !0;
  10411. var o = localStorage.getItem(I(0, "gui"));
  10412. o && (t.load = JSON.parse(o))
  10413. }
  10414. this.__closeButton = document.createElement("div"),
  10415. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10416. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10417. this.domElement.appendChild(this.__closeButton),
  10418. m.bind(this.__closeButton, "click", function() {
  10419. i.closed = !i.closed
  10420. })
  10421. } else {
  10422. void 0 === t.closed && (t.closed = !0);
  10423. var a = document.createTextNode(t.name);
  10424. m.addClass(a, "controller-name");
  10425. var s = A(i, a);
  10426. m.addClass(this.__ul, R.CLASS_CLOSED),
  10427. m.addClass(s, "title"),
  10428. m.bind(s, "click", function(e) {
  10429. return e.preventDefault(),
  10430. i.closed = !i.closed,
  10431. !1
  10432. }),
  10433. t.closed || (this.closed = !1)
  10434. }
  10435. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10436. m.addClass(w, "dg"),
  10437. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10438. document.body.appendChild(w),
  10439. S = !1),
  10440. w.appendChild(this.domElement),
  10441. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10442. this.parent || l(i, t.width)),
  10443. m.bind(window, "resize", function() {
  10444. i.onResize()
  10445. }),
  10446. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10447. i.onResize()
  10448. }),
  10449. m.bind(this.__ul, "transitionend", function() {
  10450. i.onResize()
  10451. }),
  10452. m.bind(this.__ul, "oTransitionEnd", function() {
  10453. i.onResize()
  10454. }),
  10455. this.onResize(),
  10456. t.resizable && function(t) {
  10457. function e(e) {
  10458. return e.preventDefault(),
  10459. r = e.clientX,
  10460. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10461. m.bind(window, "mousemove", i),
  10462. m.bind(window, "mouseup", n),
  10463. !1
  10464. }
  10465. function i(e) {
  10466. return e.preventDefault(),
  10467. t.width += r - e.clientX,
  10468. t.onResize(),
  10469. r = e.clientX,
  10470. !1
  10471. }
  10472. function n() {
  10473. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10474. m.unbind(window, "mousemove", i),
  10475. m.unbind(window, "mouseup", n)
  10476. }
  10477. var r;
  10478. t.__resize_handle = document.createElement("div"),
  10479. v.extend(t.__resize_handle.style, {
  10480. width: "6px",
  10481. marginLeft: "-3px",
  10482. height: "200px",
  10483. cursor: "ew-resize",
  10484. position: "absolute"
  10485. }),
  10486. m.bind(t.__resize_handle, "mousedown", e),
  10487. m.bind(t.__closeButton, "mousedown", e),
  10488. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10489. }(this),
  10490. n = function() {
  10491. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10492. }
  10493. ,
  10494. this.saveToLocalStorageIfPossible = n,
  10495. i.getRoot(),
  10496. t.parent || ((e = i.getRoot()).width += 1,
  10497. v.defer(function() {
  10498. e.width -= 1
  10499. }))
  10500. };
  10501. return R.toggleHide = function() {
  10502. s = !s,
  10503. v.each(M, function(e) {
  10504. e.domElement.style.zIndex = s ? -999 : 999,
  10505. e.domElement.style.opacity = s ? 0 : 1
  10506. })
  10507. }
  10508. ,
  10509. R.CLASS_AUTO_PLACE = "a",
  10510. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10511. R.CLASS_MAIN = "main",
  10512. R.CLASS_CONTROLLER_ROW = "cr",
  10513. R.CLASS_TOO_TALL = "taller-than-window",
  10514. R.CLASS_CLOSED = "closed",
  10515. R.CLASS_CLOSE_BUTTON = "close-button",
  10516. R.CLASS_DRAG = "drag",
  10517. R.DEFAULT_WIDTH = 245,
  10518. R.TEXT_CLOSED = "Close Controls",
  10519. R.TEXT_OPEN = "Open Controls",
  10520. m.bind(window, "keydown", function(e) {
  10521. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10522. }, !1),
  10523. v.extend(R.prototype, {
  10524. add: function(e, t) {
  10525. return y(this, e, t, {
  10526. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10527. })
  10528. },
  10529. addColor: function(e, t) {
  10530. return y(this, e, t, {
  10531. color: !0
  10532. })
  10533. },
  10534. remove: function(e) {
  10535. this.__ul.removeChild(e.__li),
  10536. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10537. var t = this;
  10538. v.defer(function() {
  10539. t.onResize()
  10540. })
  10541. },
  10542. destroy: function() {
  10543. this.autoPlace && w.removeChild(this.domElement)
  10544. },
  10545. addFolder: function(e) {
  10546. if (void 0 !== this.__folders[e])
  10547. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10548. var t = {
  10549. name: e,
  10550. parent: this
  10551. };
  10552. t.autoPlace = this.autoPlace,
  10553. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10554. t.load = this.load.folders[e]);
  10555. var i = new R(t);
  10556. this.__folders[e] = i;
  10557. var n = A(this, i.domElement);
  10558. return m.addClass(n, "folder"),
  10559. i
  10560. },
  10561. open: function() {
  10562. this.closed = !1
  10563. },
  10564. close: function() {
  10565. this.closed = !0
  10566. },
  10567. onResize: function() {
  10568. var t = this.getRoot();
  10569. if (t.scrollable) {
  10570. var e = m.getOffset(t.__ul).top
  10571. , i = 0;
  10572. v.each(t.__ul.childNodes, function(e) {
  10573. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10574. }),
  10575. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10576. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10577. t.__ul.style.height = "auto")
  10578. }
  10579. t.__resize_handle && v.defer(function() {
  10580. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10581. }),
  10582. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10583. },
  10584. remember: function() {
  10585. 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>'),
  10586. this.parent)
  10587. throw new Error("You can only call remember on a top level GUI.");
  10588. var t = this;
  10589. v.each(Array.prototype.slice.call(arguments), function(e) {
  10590. 0 == t.__rememberedObjects.length && function(i) {
  10591. var e = i.__save_row = document.createElement("li");
  10592. m.addClass(i.domElement, "has-save"),
  10593. i.__ul.insertBefore(e, i.__ul.firstChild),
  10594. m.addClass(e, "save-row");
  10595. var t = document.createElement("span");
  10596. t.innerHTML = "&nbsp;",
  10597. m.addClass(t, "button gears");
  10598. var n = document.createElement("span");
  10599. n.innerHTML = "Save",
  10600. m.addClass(n, "button"),
  10601. m.addClass(n, "save");
  10602. var r = document.createElement("span");
  10603. r.innerHTML = "New",
  10604. m.addClass(r, "button"),
  10605. m.addClass(r, "save-as");
  10606. var o = document.createElement("span");
  10607. o.innerHTML = "Revert",
  10608. m.addClass(o, "button"),
  10609. m.addClass(o, "revert");
  10610. var a = i.__preset_select = document.createElement("select");
  10611. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10612. E(i, t, t == i.preset)
  10613. }) : E(i, T, !1),
  10614. m.bind(a, "change", function() {
  10615. for (var e = 0; e < i.__preset_select.length; e++)
  10616. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10617. i.preset = this.value
  10618. }),
  10619. e.appendChild(a),
  10620. e.appendChild(t),
  10621. e.appendChild(n),
  10622. e.appendChild(r),
  10623. e.appendChild(o),
  10624. x) {
  10625. var s = document.getElementById("dg-save-locally")
  10626. , l = document.getElementById("dg-local-explain");
  10627. s.style.display = "block";
  10628. var c = document.getElementById("dg-local-storage");
  10629. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10630. var h = function() {
  10631. l.style.display = i.useLocalStorage ? "block" : "none"
  10632. };
  10633. h(),
  10634. m.bind(c, "change", function() {
  10635. i.useLocalStorage = !i.useLocalStorage,
  10636. h()
  10637. })
  10638. }
  10639. var u = document.getElementById("dg-new-constructor");
  10640. m.bind(u, "keydown", function(e) {
  10641. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10642. }),
  10643. m.bind(t, "click", function() {
  10644. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10645. b.show(),
  10646. u.focus(),
  10647. u.select()
  10648. }),
  10649. m.bind(n, "click", function() {
  10650. i.save()
  10651. }),
  10652. m.bind(r, "click", function() {
  10653. var e = prompt("Enter a new preset name.");
  10654. e && i.saveAs(e)
  10655. }),
  10656. m.bind(o, "click", function() {
  10657. i.revert()
  10658. })
  10659. }(t),
  10660. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10661. }),
  10662. this.autoPlace && l(this, this.width)
  10663. },
  10664. getRoot: function() {
  10665. for (var e = this; e.parent; )
  10666. e = e.parent;
  10667. return e
  10668. },
  10669. getSaveObject: function() {
  10670. var i = this.load;
  10671. return i.closed = this.closed,
  10672. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10673. i.remembered || (i.remembered = {}),
  10674. i.remembered[this.preset] = a(this)),
  10675. i.folders = {},
  10676. v.each(this.__folders, function(e, t) {
  10677. i.folders[t] = e.getSaveObject()
  10678. }),
  10679. i
  10680. },
  10681. save: function() {
  10682. this.load.remembered || (this.load.remembered = {}),
  10683. this.load.remembered[this.preset] = a(this),
  10684. _(this, !1),
  10685. this.saveToLocalStorageIfPossible()
  10686. },
  10687. saveAs: function(e) {
  10688. this.load.remembered || (this.load.remembered = {},
  10689. this.load.remembered[T] = a(this, !0)),
  10690. this.load.remembered[e] = a(this),
  10691. this.preset = e,
  10692. E(this, e, !0),
  10693. this.saveToLocalStorageIfPossible()
  10694. },
  10695. revert: function(t) {
  10696. v.each(this.__controllers, function(e) {
  10697. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10698. }, this),
  10699. v.each(this.__folders, function(e) {
  10700. e.revert(e)
  10701. }),
  10702. t || _(this.getRoot(), !1)
  10703. },
  10704. listen: function(e) {
  10705. var t = 0 == this.__listening.length;
  10706. this.__listening.push(e),
  10707. t && function e(t) {
  10708. 0 != t.length && r(function() {
  10709. e(t)
  10710. }),
  10711. v.each(t, function(e) {
  10712. e.updateDisplay()
  10713. })
  10714. }(this.__listening)
  10715. }
  10716. }),
  10717. R
  10718. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10719. u = ee.controllers.NumberControllerBox,
  10720. d = ee.controllers.NumberControllerSlider,
  10721. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10722. y = ee.dom.dom,
  10723. A = ee.utils.common,
  10724. (C = function(e, t) {
  10725. function i() {
  10726. n.setValue(n.__input.value)
  10727. }
  10728. C.superclass.call(this, e, t);
  10729. var n = this;
  10730. this.__input = document.createElement("input"),
  10731. this.__input.setAttribute("type", "text"),
  10732. y.bind(this.__input, "keyup", i),
  10733. y.bind(this.__input, "change", i),
  10734. y.bind(this.__input, "blur", function() {
  10735. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10736. }),
  10737. y.bind(this.__input, "keydown", function(e) {
  10738. 13 === e.keyCode && this.blur()
  10739. }),
  10740. this.updateDisplay(),
  10741. this.domElement.appendChild(this.__input)
  10742. }
  10743. ).superclass = v,
  10744. A.extend(C.prototype, v.prototype, {
  10745. updateDisplay: function() {
  10746. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10747. C.superclass.prototype.updateDisplay.call(this)
  10748. }
  10749. }),
  10750. C),
  10751. f = ee.controllers.FunctionController,
  10752. g = ee.controllers.BooleanController,
  10753. m = ee.utils.common,
  10754. function(e, t) {
  10755. var i = e[t];
  10756. 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,{
  10757. min: arguments[2],
  10758. max: arguments[3]
  10759. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10760. }
  10761. ), 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) {
  10762. function f(t, i, n, r) {
  10763. t.style.background = "",
  10764. p.each(o, function(e) {
  10765. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10766. })
  10767. }
  10768. var g = function(e, t) {
  10769. function i(e) {
  10770. a(e),
  10771. h.bind(window, "mousemove", a),
  10772. h.bind(window, "mouseup", n)
  10773. }
  10774. function n() {
  10775. h.unbind(window, "mousemove", a),
  10776. h.unbind(window, "mouseup", n)
  10777. }
  10778. function r() {
  10779. var e = d(this.value);
  10780. !1 !== e ? (l.__color.__state = e,
  10781. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10782. }
  10783. function o() {
  10784. h.unbind(window, "mousemove", s),
  10785. h.unbind(window, "mouseup", o)
  10786. }
  10787. function a(e) {
  10788. e.preventDefault();
  10789. var t = h.getWidth(l.__saturation_field)
  10790. , i = h.getOffset(l.__saturation_field)
  10791. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10792. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10793. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10794. 1 < n ? n = 1 : n < 0 && (n = 0),
  10795. l.__color.v = r,
  10796. l.__color.s = n,
  10797. l.setValue(l.__color.toOriginal()),
  10798. !1
  10799. }
  10800. function s(e) {
  10801. e.preventDefault();
  10802. var t = h.getHeight(l.__hue_field)
  10803. , i = h.getOffset(l.__hue_field)
  10804. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10805. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10806. l.__color.h = 360 * n,
  10807. l.setValue(l.__color.toOriginal()),
  10808. !1
  10809. }
  10810. g.superclass.call(this, e, t),
  10811. this.__color = new u(this.getValue()),
  10812. this.__temp = new u(0);
  10813. var l = this;
  10814. this.domElement = document.createElement("div"),
  10815. h.makeSelectable(this.domElement, !1),
  10816. this.__selector = document.createElement("div"),
  10817. this.__selector.className = "selector",
  10818. this.__saturation_field = document.createElement("div"),
  10819. this.__saturation_field.className = "saturation-field",
  10820. this.__field_knob = document.createElement("div"),
  10821. this.__field_knob.className = "field-knob",
  10822. this.__field_knob_border = "2px solid ",
  10823. this.__hue_knob = document.createElement("div"),
  10824. this.__hue_knob.className = "hue-knob",
  10825. this.__hue_field = document.createElement("div"),
  10826. this.__hue_field.className = "hue-field",
  10827. this.__input = document.createElement("input"),
  10828. this.__input.type = "text",
  10829. this.__input_textShadow = "0 1px 1px ",
  10830. h.bind(this.__input, "keydown", function(e) {
  10831. 13 === e.keyCode && r.call(this)
  10832. }),
  10833. h.bind(this.__input, "blur", r),
  10834. h.bind(this.__selector, "mousedown", function(e) {
  10835. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10836. h.removeClass(l.__selector, "drag")
  10837. })
  10838. });
  10839. var c = document.createElement("div");
  10840. p.extend(this.__selector.style, {
  10841. width: "122px",
  10842. height: "102px",
  10843. padding: "3px",
  10844. backgroundColor: "#222",
  10845. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10846. }),
  10847. p.extend(this.__field_knob.style, {
  10848. position: "absolute",
  10849. width: "12px",
  10850. height: "12px",
  10851. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10852. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10853. borderRadius: "12px",
  10854. zIndex: 1
  10855. }),
  10856. p.extend(this.__hue_knob.style, {
  10857. position: "absolute",
  10858. width: "15px",
  10859. height: "2px",
  10860. borderRight: "4px solid #fff",
  10861. zIndex: 1
  10862. }),
  10863. p.extend(this.__saturation_field.style, {
  10864. width: "100px",
  10865. height: "100px",
  10866. border: "1px solid #555",
  10867. marginRight: "3px",
  10868. display: "inline-block",
  10869. cursor: "pointer"
  10870. }),
  10871. p.extend(c.style, {
  10872. width: "100%",
  10873. height: "100%",
  10874. background: "none"
  10875. }),
  10876. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10877. p.extend(this.__hue_field.style, {
  10878. width: "15px",
  10879. height: "100px",
  10880. display: "inline-block",
  10881. border: "1px solid #555",
  10882. cursor: "ns-resize"
  10883. }),
  10884. function(e) {
  10885. e.style.background = "",
  10886. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10887. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10888. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10889. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10890. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10891. }(this.__hue_field),
  10892. p.extend(this.__input.style, {
  10893. outline: "none",
  10894. textAlign: "center",
  10895. color: "#fff",
  10896. border: 0,
  10897. fontWeight: "bold",
  10898. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10899. }),
  10900. h.bind(this.__saturation_field, "mousedown", i),
  10901. h.bind(this.__field_knob, "mousedown", i),
  10902. h.bind(this.__hue_field, "mousedown", function(e) {
  10903. s(e),
  10904. h.bind(window, "mousemove", s),
  10905. h.bind(window, "mouseup", o)
  10906. }),
  10907. this.__saturation_field.appendChild(c),
  10908. this.__selector.appendChild(this.__field_knob),
  10909. this.__selector.appendChild(this.__saturation_field),
  10910. this.__selector.appendChild(this.__hue_field),
  10911. this.__hue_field.appendChild(this.__hue_knob),
  10912. this.domElement.appendChild(this.__input),
  10913. this.domElement.appendChild(this.__selector),
  10914. this.updateDisplay()
  10915. };
  10916. g.superclass = e,
  10917. p.extend(g.prototype, e.prototype, {
  10918. updateDisplay: function() {
  10919. var t = d(this.getValue());
  10920. if (!1 !== t) {
  10921. var i = !1;
  10922. p.each(u.COMPONENTS, function(e) {
  10923. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10924. return i = !0,
  10925. {}
  10926. }, this),
  10927. i && p.extend(this.__color.__state, t)
  10928. }
  10929. p.extend(this.__temp.__state, this.__color.__state),
  10930. this.__temp.a = 1;
  10931. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10932. , n = 255 - e;
  10933. p.extend(this.__field_knob.style, {
  10934. marginLeft: 100 * this.__color.s - 7 + "px",
  10935. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10936. backgroundColor: this.__temp.toString(),
  10937. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10938. }),
  10939. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10940. this.__temp.s = 1,
  10941. this.__temp.v = 1,
  10942. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10943. p.extend(this.__input.style, {
  10944. backgroundColor: this.__input.value = this.__color.toString(),
  10945. color: "rgb(" + e + "," + e + "," + e + ")",
  10946. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10947. })
  10948. }
  10949. });
  10950. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10951. return g
  10952. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10953. a = ee.color.math = {
  10954. hsv_to_rgb: function(e, t, i) {
  10955. var n = Math.floor(e / 60) % 6
  10956. , r = e / 60 - Math.floor(e / 60)
  10957. , o = i * (1 - t)
  10958. , a = i * (1 - r * t)
  10959. , s = i * (1 - (1 - r) * t)
  10960. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10961. return {
  10962. r: 255 * l[0],
  10963. g: 255 * l[1],
  10964. b: 255 * l[2]
  10965. }
  10966. },
  10967. rgb_to_hsv: function(e, t, i) {
  10968. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10969. return 0 == o ? {
  10970. h: NaN,
  10971. s: 0,
  10972. v: 0
  10973. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10974. (n /= 6) < 0 && (n += 1),
  10975. {
  10976. h: 360 * n,
  10977. s: a / o,
  10978. v: o / 255
  10979. })
  10980. },
  10981. rgb_to_hex: function(e, t, i) {
  10982. var n = this.hex_with_component(0, 2, e);
  10983. return n = this.hex_with_component(n, 1, t),
  10984. this.hex_with_component(n, 0, i)
  10985. },
  10986. component_from_hex: function(e, t) {
  10987. return e >> 8 * t & 255
  10988. },
  10989. hex_with_component: function(e, t, i) {
  10990. return i << (c = 8 * t) | e & ~(255 << c)
  10991. }
  10992. },
  10993. s = ee.color.toString,
  10994. l = ee.utils.common,
  10995. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10996. l.extend(ae.prototype, {
  10997. toString: function() {
  10998. return s(this)
  10999. },
  11000. toOriginal: function() {
  11001. return this.__state.conversion.write(this)
  11002. }
  11003. }),
  11004. ie(ae.prototype, "r", 2),
  11005. ie(ae.prototype, "g", 1),
  11006. ie(ae.prototype, "b", 0),
  11007. ne(ae.prototype, "h"),
  11008. ne(ae.prototype, "s"),
  11009. ne(ae.prototype, "v"),
  11010. Object.defineProperty(ae.prototype, "a", {
  11011. get: function() {
  11012. return this.__state.a
  11013. },
  11014. set: function(e) {
  11015. this.__state.a = e
  11016. }
  11017. }),
  11018. Object.defineProperty(ae.prototype, "hex", {
  11019. get: function() {
  11020. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11021. this.__state.hex
  11022. },
  11023. set: function(e) {
  11024. this.__state.space = "HEX",
  11025. this.__state.hex = e
  11026. }
  11027. }),
  11028. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11029. window.setTimeout(e, 1e3 / 60)
  11030. }
  11031. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11032. r = ee.utils.common,
  11033. te.prototype.show = function() {
  11034. var e = this;
  11035. this.backgroundElement.style.display = "block",
  11036. this.domElement.style.display = "block",
  11037. this.domElement.style.opacity = 0,
  11038. this.domElement.style.webkitTransform = "scale(1.1)",
  11039. this.layout(),
  11040. r.defer(function() {
  11041. e.backgroundElement.style.opacity = 1,
  11042. e.domElement.style.opacity = 1,
  11043. e.domElement.style.webkitTransform = "scale(1)"
  11044. })
  11045. }
  11046. ,
  11047. te.prototype.hide = function() {
  11048. var e = this
  11049. , t = function() {
  11050. e.domElement.style.display = "none",
  11051. e.backgroundElement.style.display = "none",
  11052. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11053. n.unbind(e.domElement, "transitionend", t),
  11054. n.unbind(e.domElement, "oTransitionEnd", t)
  11055. };
  11056. n.bind(this.domElement, "webkitTransitionEnd", t),
  11057. n.bind(this.domElement, "transitionend", t),
  11058. n.bind(this.domElement, "oTransitionEnd", t),
  11059. this.backgroundElement.style.opacity = 0,
  11060. this.domElement.style.opacity = 0,
  11061. this.domElement.style.webkitTransform = "scale(1.1)"
  11062. }
  11063. ,
  11064. te.prototype.layout = function() {
  11065. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11066. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11067. }
  11068. ,
  11069. te), ee.dom.dom, ee.utils.common)
  11070. }
  11071. , {}],
  11072. 94: [function(e, t, i) {
  11073. (function(J) {
  11074. "use strict";
  11075. function i(e) {
  11076. function t(e, t) {
  11077. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11078. for (var a = 1; a <= e[o]; a++)
  11079. r[t[n]] = [],
  11080. r[t[n]][0] = i,
  11081. r[t[n]][1] = o,
  11082. n++,
  11083. i++;
  11084. i *= 2
  11085. }
  11086. return r
  11087. }
  11088. function _(e) {
  11089. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11090. t & 1 << i && (B |= 1 << V),
  11091. i--,
  11092. --V < 0 && (255 == B ? (b(255),
  11093. b(0)) : b(B),
  11094. V = 7,
  11095. B = 0)
  11096. }
  11097. function b(e) {
  11098. F.push(e)
  11099. }
  11100. function w(e) {
  11101. b(e >> 8 & 255),
  11102. b(255 & e)
  11103. }
  11104. function T(e, t, i, n, r) {
  11105. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11106. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11107. for (h = 0; h < 8; ++h) {
  11108. i = e[d],
  11109. n = e[d + 1],
  11110. r = e[d + 2],
  11111. o = e[d + 3],
  11112. a = e[d + 4],
  11113. s = e[d + 5],
  11114. l = e[d + 6];
  11115. var p = i + (c = e[d + 7])
  11116. , f = i - c
  11117. , g = n + l
  11118. , m = n - l
  11119. , v = r + s
  11120. , y = r - s
  11121. , A = o + a
  11122. , C = o - a
  11123. , I = p + A
  11124. , E = p - A
  11125. , _ = g + v
  11126. , b = g - v;
  11127. e[d] = I + _,
  11128. e[d + 4] = I - _;
  11129. var w = .707106781 * (b + E);
  11130. e[d + 2] = E + w,
  11131. e[d + 6] = E - w;
  11132. var T = .382683433 * ((I = C + y) - (b = m + f))
  11133. , x = .5411961 * I + T
  11134. , S = 1.306562965 * b + T
  11135. , M = .707106781 * (_ = y + m)
  11136. , R = f + M
  11137. , P = f - M;
  11138. e[d + 5] = P + x,
  11139. e[d + 3] = P - x,
  11140. e[d + 1] = R + S,
  11141. e[d + 7] = R - S,
  11142. d += 8
  11143. }
  11144. for (h = d = 0; h < 8; ++h) {
  11145. i = e[d],
  11146. n = e[d + 8],
  11147. r = e[d + 16],
  11148. o = e[d + 24],
  11149. a = e[d + 32],
  11150. s = e[d + 40],
  11151. l = e[d + 48];
  11152. var O = i + (c = e[d + 56])
  11153. , L = i - c
  11154. , D = n + l
  11155. , N = n - l
  11156. , F = r + s
  11157. , B = r - s
  11158. , V = o + a
  11159. , k = o - a
  11160. , U = O + V
  11161. , H = O - V
  11162. , z = D + F
  11163. , G = D - F;
  11164. e[d] = U + z,
  11165. e[d + 32] = U - z;
  11166. var W = .707106781 * (G + H);
  11167. e[d + 16] = H + W,
  11168. e[d + 48] = H - W;
  11169. var j = .382683433 * ((U = k + B) - (G = N + L))
  11170. , Y = .5411961 * U + j
  11171. , q = 1.306562965 * G + j
  11172. , X = .707106781 * (z = B + N)
  11173. , Z = L + X
  11174. , K = L - X;
  11175. e[d + 40] = K + Y,
  11176. e[d + 24] = K - Y,
  11177. e[d + 8] = Z + q,
  11178. e[d + 56] = Z - q,
  11179. d++
  11180. }
  11181. for (h = 0; h < 64; ++h)
  11182. u = e[h] * t[h],
  11183. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11184. return Q
  11185. }(e, t), c = 0; c < 64; ++c)
  11186. A[C[c]] = l[c];
  11187. var h = A[0] - i;
  11188. i = A[0],
  11189. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11190. _(v[o]));
  11191. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11192. ;
  11193. if (0 == u)
  11194. return _(a),
  11195. i;
  11196. for (var d, p = 1; p <= u; ) {
  11197. for (var f = p; 0 == A[p] && p <= u; ++p)
  11198. ;
  11199. var g = p - f;
  11200. if (16 <= g) {
  11201. d = g >> 4;
  11202. for (var m = 1; m <= d; ++m)
  11203. _(s);
  11204. g &= 15
  11205. }
  11206. o = 32767 + A[p],
  11207. _(r[(g << 4) + y[o]]),
  11208. _(v[o]),
  11209. p++
  11210. }
  11211. return 63 != u && _(a),
  11212. i
  11213. }
  11214. function x(e) {
  11215. if (e <= 0 && (e = 1),
  11216. 100 < e && (e = 100),
  11217. i != e) {
  11218. (function(e) {
  11219. 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++) {
  11220. var n = u((t[i] * e + 50) / 100);
  11221. n < 1 ? n = 1 : 255 < n && (n = 255),
  11222. O[C[i]] = n
  11223. }
  11224. 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++) {
  11225. var a = u((r[o] * e + 50) / 100);
  11226. a < 1 ? a = 1 : 255 < a && (a = 255),
  11227. L[C[o]] = a
  11228. }
  11229. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11230. for (var h = 0; h < 8; h++)
  11231. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11232. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11233. l++
  11234. }
  11235. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11236. i = e
  11237. }
  11238. }
  11239. var S, M, R, P, i, u = (Math.round,
  11240. 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];
  11241. this.encode = function(e, t) {
  11242. var i = ((new Date).getTime(),
  11243. t.quality);
  11244. i && x(i),
  11245. F = new Array,
  11246. B = 0,
  11247. V = 7,
  11248. w(65496),
  11249. w(65504),
  11250. w(16),
  11251. b(74),
  11252. b(70),
  11253. b(73),
  11254. b(70),
  11255. b(0),
  11256. b(1),
  11257. b(1),
  11258. b(0),
  11259. w(1),
  11260. w(1),
  11261. b(0),
  11262. b(0),
  11263. function() {
  11264. w(65499),
  11265. w(132),
  11266. b(0);
  11267. for (var e = 0; e < 64; e++)
  11268. b(O[e]);
  11269. b(1);
  11270. for (var t = 0; t < 64; t++)
  11271. b(L[t])
  11272. }(),
  11273. function(e, t) {
  11274. w(65472),
  11275. w(17),
  11276. b(8),
  11277. w(t),
  11278. w(e),
  11279. b(3),
  11280. b(1),
  11281. b(17),
  11282. b(0),
  11283. b(2),
  11284. b(17),
  11285. b(1),
  11286. b(3),
  11287. b(17),
  11288. b(1)
  11289. }(e.width, e.height),
  11290. function() {
  11291. w(65476),
  11292. w(418),
  11293. b(0);
  11294. for (var e = 0; e < 16; e++)
  11295. b(G[e + 1]);
  11296. for (var t = 0; t <= 11; t++)
  11297. b(W[t]);
  11298. b(16);
  11299. for (var i = 0; i < 16; i++)
  11300. b(j[i + 1]);
  11301. for (var n = 0; n <= 161; n++)
  11302. b(Y[n]);
  11303. b(1);
  11304. for (var r = 0; r < 16; r++)
  11305. b(q[r + 1]);
  11306. for (var o = 0; o <= 11; o++)
  11307. b(X[o]);
  11308. b(17);
  11309. for (var a = 0; a < 16; a++)
  11310. b(Z[a + 1]);
  11311. for (var s = 0; s <= 161; s++)
  11312. b(K[s])
  11313. }(),
  11314. w(65498),
  11315. w(12),
  11316. b(3),
  11317. b(1),
  11318. b(0),
  11319. b(2),
  11320. b(17),
  11321. b(3),
  11322. b(17),
  11323. b(0),
  11324. b(63),
  11325. b(0);
  11326. var n = 0
  11327. , r = 0
  11328. , o = 0;
  11329. B = 0,
  11330. V = 7,
  11331. this.encode.displayName = "_encode_";
  11332. 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; ) {
  11333. for (a = 0; a < A; ) {
  11334. for (u = h = A * C + a,
  11335. d = -1,
  11336. f = p = 0; f < 64; f++)
  11337. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11338. v <= C + p && (u -= A * (C + 1 + p - v)),
  11339. A <= a + d && (u -= a + d - A + 4),
  11340. s = g[u++],
  11341. l = g[u++],
  11342. c = g[u++],
  11343. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11344. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11345. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11346. n = T(k, D, n, S, R),
  11347. r = T(U, N, r, M, P),
  11348. o = T(H, N, o, M, P),
  11349. a += 32
  11350. }
  11351. C += I
  11352. }
  11353. if (0 <= V) {
  11354. var E = [];
  11355. E[1] = V + 1,
  11356. E[0] = (1 << V + 1) - 1,
  11357. _(E)
  11358. }
  11359. return w(65497),
  11360. new J(F)
  11361. }
  11362. ,
  11363. (new Date).getTime(),
  11364. e = e || 50,
  11365. function() {
  11366. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11367. n[t] = e(t)
  11368. }(),
  11369. S = t(G, W),
  11370. M = t(q, X),
  11371. R = t(j, Y),
  11372. P = t(Z, K),
  11373. function() {
  11374. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11375. for (var n = e; n < t; n++)
  11376. y[32767 + n] = i,
  11377. v[32767 + n] = [],
  11378. v[32767 + n][1] = i,
  11379. v[32767 + n][0] = n;
  11380. for (var r = -(t - 1); r <= -e; r++)
  11381. y[32767 + r] = i,
  11382. v[32767 + r] = [],
  11383. v[32767 + r][1] = i,
  11384. v[32767 + r][0] = t - 1 + r;
  11385. e <<= 1,
  11386. t <<= 1
  11387. }
  11388. }(),
  11389. function() {
  11390. for (var e = 0; e < 256; e++)
  11391. z[e] = 19595 * e,
  11392. z[e + 256 >> 0] = 38470 * e,
  11393. z[e + 512 >> 0] = 7471 * e + 32768,
  11394. z[e + 768 >> 0] = -11059 * e,
  11395. z[e + 1024 >> 0] = -21709 * e,
  11396. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11397. z[e + 1536 >> 0] = -27439 * e,
  11398. z[e + 1792 >> 0] = -5329 * e
  11399. }(),
  11400. x(e),
  11401. (new Date).getTime()
  11402. }
  11403. t.exports.encode = function(e, t) {
  11404. return (t = t || {}).quality = t.quality || 50,
  11405. {
  11406. data: new i(t.quality).encode(e, t),
  11407. width: e.width,
  11408. height: e.height
  11409. }
  11410. }
  11411. }
  11412. ).call(this, e("buffer").Buffer)
  11413. }
  11414. , {
  11415. buffer: 198
  11416. }],
  11417. 95: [function(e, t, i) {
  11418. "use strict";
  11419. !function() {
  11420. if ("performance"in window == 0 && (window.performance = {}),
  11421. Date.now = Date.now || function() {
  11422. return (new Date).getTime()
  11423. }
  11424. ,
  11425. "now"in window.performance == 0) {
  11426. var e = Date.now();
  11427. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11428. window.performance.now = function() {
  11429. return Date.now() - e
  11430. }
  11431. }
  11432. }()
  11433. }
  11434. , {}],
  11435. 96: [function(e, t, i) {
  11436. "use strict";
  11437. var a = e("three");
  11438. a.EffectComposer = function(e, t) {
  11439. if (this.renderer = e,
  11440. void 0 === t) {
  11441. var i = {
  11442. minFilter: a.LinearFilter,
  11443. magFilter: a.LinearFilter,
  11444. format: a.RGBAFormat,
  11445. stencilBuffer: !1
  11446. }
  11447. , n = e.getSize();
  11448. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11449. }
  11450. this.renderTarget1 = t,
  11451. this.renderTarget2 = t.clone(),
  11452. this.writeBuffer = this.renderTarget1,
  11453. this.readBuffer = this.renderTarget2,
  11454. this.passes = [],
  11455. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11456. this.copyPass = new a.ShaderPass(a.CopyShader)
  11457. }
  11458. ,
  11459. a.EffectComposer.prototype = {
  11460. swapBuffers: function() {
  11461. var e = this.readBuffer;
  11462. this.readBuffer = this.writeBuffer,
  11463. this.writeBuffer = e
  11464. },
  11465. addPass: function(e) {
  11466. this.passes.push(e)
  11467. },
  11468. insertPass: function(e, t) {
  11469. this.passes.splice(t, 0, e)
  11470. },
  11471. render: function(e) {
  11472. this.writeBuffer = this.renderTarget1,
  11473. this.readBuffer = this.renderTarget2;
  11474. var t, i, n = !1, r = this.passes.length;
  11475. for (i = 0; i < r; i++)
  11476. if ((t = this.passes[i]).enabled) {
  11477. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11478. t.needsSwap) {
  11479. if (n) {
  11480. var o = this.renderer.context;
  11481. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11482. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11483. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11484. }
  11485. this.swapBuffers()
  11486. }
  11487. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11488. }
  11489. },
  11490. reset: function(e) {
  11491. if (void 0 === e) {
  11492. var t = this.renderer.getSize();
  11493. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11494. }
  11495. this.renderTarget1.dispose(),
  11496. this.renderTarget2.dispose(),
  11497. this.renderTarget1 = e,
  11498. this.renderTarget2 = e.clone(),
  11499. this.writeBuffer = this.renderTarget1,
  11500. this.readBuffer = this.renderTarget2
  11501. },
  11502. setSize: function(e, t) {
  11503. this.renderTarget1.setSize(e, t),
  11504. this.renderTarget2.setSize(e, t)
  11505. }
  11506. }
  11507. }
  11508. , {
  11509. three: 217
  11510. }],
  11511. 97: [function(e, t, i) {
  11512. "use strict";
  11513. var n = e("three");
  11514. n.MaskPass = function(e, t) {
  11515. this.scene = e,
  11516. this.camera = t,
  11517. this.enabled = !0,
  11518. this.clear = !0,
  11519. this.needsSwap = !1,
  11520. this.inverse = !1
  11521. }
  11522. ,
  11523. n.MaskPass.prototype = {
  11524. render: function(e, t, i, n) {
  11525. var r, o, a = e.context;
  11526. a.colorMask(!1, !1, !1, !1),
  11527. a.depthMask(!1),
  11528. o = this.inverse ? (r = 0,
  11529. 1) : (r = 1,
  11530. 0),
  11531. a.enable(a.STENCIL_TEST),
  11532. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11533. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11534. a.clearStencil(o),
  11535. e.render(this.scene, this.camera, i, this.clear),
  11536. e.render(this.scene, this.camera, t, this.clear),
  11537. a.colorMask(!0, !0, !0, !0),
  11538. a.depthMask(!0),
  11539. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11540. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11541. }
  11542. },
  11543. n.ClearMaskPass = function() {
  11544. this.enabled = !0
  11545. }
  11546. ,
  11547. n.ClearMaskPass.prototype = {
  11548. render: function(e, t, i, n) {
  11549. var r = e.context;
  11550. r.disable(r.STENCIL_TEST)
  11551. }
  11552. }
  11553. }
  11554. , {
  11555. three: 217
  11556. }],
  11557. 98: [function(e, t, i) {
  11558. "use strict";
  11559. var o = e("three");
  11560. o.RenderPass = function(e, t, i, n, r) {
  11561. this.scene = e,
  11562. this.camera = t,
  11563. this.overrideMaterial = i,
  11564. this.clearColor = n,
  11565. this.clearAlpha = void 0 !== r ? r : 1,
  11566. this.oldClearColor = new o.Color,
  11567. this.oldClearAlpha = 1,
  11568. this.enabled = !0,
  11569. this.clear = !0,
  11570. this.needsSwap = !1
  11571. }
  11572. ,
  11573. o.RenderPass.prototype = {
  11574. render: function(e, t, i, n) {
  11575. this.scene.overrideMaterial = this.overrideMaterial,
  11576. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11577. this.oldClearAlpha = e.getClearAlpha(),
  11578. e.setClearColor(this.clearColor, this.clearAlpha)),
  11579. e.render(this.scene, this.camera, i, this.clear),
  11580. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11581. this.scene.overrideMaterial = null
  11582. }
  11583. }
  11584. }
  11585. , {
  11586. three: 217
  11587. }],
  11588. 99: [function(e, t, i) {
  11589. "use strict";
  11590. var n = e("three");
  11591. n.ShaderPass = function(e, t) {
  11592. this.textureID = void 0 !== t ? t : "tDiffuse",
  11593. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11594. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11595. this.material = new n.ShaderMaterial({
  11596. defines: e.defines || {},
  11597. uniforms: this.uniforms,
  11598. vertexShader: e.vertexShader,
  11599. fragmentShader: e.fragmentShader
  11600. })),
  11601. this.renderToScreen = !1,
  11602. this.enabled = !0,
  11603. this.needsSwap = !0,
  11604. this.clear = !1,
  11605. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11606. this.scene = new n.Scene,
  11607. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11608. this.scene.add(this.quad)
  11609. }
  11610. ,
  11611. n.ShaderPass.prototype = {
  11612. render: function(e, t, i, n) {
  11613. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11614. this.quad.material = this.material,
  11615. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11616. }
  11617. }
  11618. }
  11619. , {
  11620. three: 217
  11621. }],
  11622. 100: [function(e, t, i) {
  11623. "use strict";
  11624. e("three").CopyShader = {
  11625. uniforms: {
  11626. tDiffuse: {
  11627. type: "t",
  11628. value: null
  11629. },
  11630. opacity: {
  11631. type: "f",
  11632. value: 1
  11633. }
  11634. },
  11635. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11636. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11637. }
  11638. }
  11639. , {
  11640. three: 217
  11641. }],
  11642. 101: [function(e, t, i) {
  11643. "use strict";
  11644. e("three").HorizontalBlurShader = {
  11645. uniforms: {
  11646. tDiffuse: {
  11647. type: "t",
  11648. value: null
  11649. },
  11650. h: {
  11651. type: "f",
  11652. value: 1 / 512
  11653. }
  11654. },
  11655. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11656. 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")
  11657. }
  11658. }
  11659. , {
  11660. three: 217
  11661. }],
  11662. 102: [function(e, t, i) {
  11663. "use strict";
  11664. e("three").VerticalBlurShader = {
  11665. uniforms: {
  11666. tDiffuse: {
  11667. type: "t",
  11668. value: null
  11669. },
  11670. v: {
  11671. type: "f",
  11672. value: 1 / 512
  11673. }
  11674. },
  11675. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11676. 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")
  11677. }
  11678. }
  11679. , {
  11680. three: 217
  11681. }],
  11682. 103: [function(e, t, i) {
  11683. "use strict";
  11684. var z = e("three");
  11685. !function() {
  11686. if ("performance"in window == 0 && (window.performance = {}),
  11687. "now"in window.performance == 0) {
  11688. var e = Date.now();
  11689. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11690. window.performance.now = function() {
  11691. return Date.now() - e
  11692. }
  11693. }
  11694. }(),
  11695. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11696. var t, i = this.extensions, n = this.context;
  11697. if (e === z.RepeatWrapping)
  11698. return n.REPEAT;
  11699. if (e === z.ClampToEdgeWrapping)
  11700. return n.CLAMP_TO_EDGE;
  11701. if (e === z.MirroredRepeatWrapping)
  11702. return n.MIRRORED_REPEAT;
  11703. if (e === z.NearestFilter)
  11704. return n.NEAREST;
  11705. if (e === z.NearestMipMapNearestFilter)
  11706. return n.NEAREST_MIPMAP_NEAREST;
  11707. if (e === z.NearestMipMapLinearFilter)
  11708. return n.NEAREST_MIPMAP_LINEAR;
  11709. if (e === z.LinearFilter)
  11710. return n.LINEAR;
  11711. if (e === z.LinearMipMapNearestFilter)
  11712. return n.LINEAR_MIPMAP_NEAREST;
  11713. if (e === z.LinearMipMapLinearFilter)
  11714. return n.LINEAR_MIPMAP_LINEAR;
  11715. if (e === z.UnsignedByteType)
  11716. return n.UNSIGNED_BYTE;
  11717. if (e === z.UnsignedShort4444Type)
  11718. return n.UNSIGNED_SHORT_4_4_4_4;
  11719. if (e === z.UnsignedShort5551Type)
  11720. return n.UNSIGNED_SHORT_5_5_5_1;
  11721. if (e === z.UnsignedShort565Type)
  11722. return n.UNSIGNED_SHORT_5_6_5;
  11723. if (e === z.ByteType)
  11724. return n.BYTE;
  11725. if (e === z.ShortType)
  11726. return n.SHORT;
  11727. if (e === z.UnsignedShortType)
  11728. return n.UNSIGNED_SHORT;
  11729. if (e === z.IntType)
  11730. return n.INT;
  11731. if (e === z.UnsignedIntType)
  11732. return n.UNSIGNED_INT;
  11733. if (e === z.FloatType)
  11734. return n.FLOAT;
  11735. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11736. return t.HALF_FLOAT_OES;
  11737. if (e === z.AlphaFormat)
  11738. return n.ALPHA;
  11739. if (e === z.RGBFormat)
  11740. return n.RGB;
  11741. if (e === z.RGBAFormat)
  11742. return n.RGBA;
  11743. if (e === z.LuminanceFormat)
  11744. return n.LUMINANCE;
  11745. if (e === z.LuminanceAlphaFormat)
  11746. return n.LUMINANCE_ALPHA;
  11747. if (e === z.AddEquation)
  11748. return n.FUNC_ADD;
  11749. if (e === z.SubtractEquation)
  11750. return n.FUNC_SUBTRACT;
  11751. if (e === z.ReverseSubtractEquation)
  11752. return n.FUNC_REVERSE_SUBTRACT;
  11753. if (e === z.ZeroFactor)
  11754. return n.ZERO;
  11755. if (e === z.OneFactor)
  11756. return n.ONE;
  11757. if (e === z.SrcColorFactor)
  11758. return n.SRC_COLOR;
  11759. if (e === z.OneMinusSrcColorFactor)
  11760. return n.ONE_MINUS_SRC_COLOR;
  11761. if (e === z.SrcAlphaFactor)
  11762. return n.SRC_ALPHA;
  11763. if (e === z.OneMinusSrcAlphaFactor)
  11764. return n.ONE_MINUS_SRC_ALPHA;
  11765. if (e === z.DstAlphaFactor)
  11766. return n.DST_ALPHA;
  11767. if (e === z.OneMinusDstAlphaFactor)
  11768. return n.ONE_MINUS_DST_ALPHA;
  11769. if (e === z.DstColorFactor)
  11770. return n.DST_COLOR;
  11771. if (e === z.OneMinusDstColorFactor)
  11772. return n.ONE_MINUS_DST_COLOR;
  11773. if (e === z.SrcAlphaSaturateFactor)
  11774. return n.SRC_ALPHA_SATURATE;
  11775. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11776. if (e === z.RGB_S3TC_DXT1_Format)
  11777. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11778. if (e === z.RGBA_S3TC_DXT1_Format)
  11779. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11780. if (e === z.RGBA_S3TC_DXT3_Format)
  11781. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11782. if (e === z.RGBA_S3TC_DXT5_Format)
  11783. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11784. }
  11785. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11786. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11787. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11788. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11789. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11790. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11791. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11792. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11793. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11794. }
  11795. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11796. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11797. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11798. if (e === z.MinEquation)
  11799. return t.MIN_EXT;
  11800. if (e === z.MaxEquation)
  11801. return t.MAX_EXT
  11802. }
  11803. return 0
  11804. }
  11805. ,
  11806. z.WebGLState = function(l, i, c) {
  11807. var n = this
  11808. , r = new z.Vector4
  11809. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11810. , o = new Uint8Array(e)
  11811. , a = new Uint8Array(e)
  11812. , s = new Uint8Array(e)
  11813. , t = {}
  11814. , h = null
  11815. , u = null
  11816. , d = null
  11817. , p = null
  11818. , f = null
  11819. , g = null
  11820. , m = null
  11821. , v = null
  11822. , y = !1
  11823. , A = null
  11824. , C = null
  11825. , I = null
  11826. , E = null
  11827. , _ = null
  11828. , b = null
  11829. , w = null
  11830. , T = null
  11831. , x = null
  11832. , S = null
  11833. , M = null
  11834. , R = null
  11835. , P = null
  11836. , O = null
  11837. , L = null
  11838. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11839. , N = void 0
  11840. , F = {}
  11841. , B = new z.Vector4
  11842. , V = null
  11843. , k = null
  11844. , U = new z.Vector4
  11845. , H = new z.Vector4;
  11846. this.init = function() {
  11847. this.clearColor(0, 0, 0, 1),
  11848. this.clearDepth(1),
  11849. this.clearStencil(0),
  11850. this.enable(l.DEPTH_TEST),
  11851. l.depthFunc(l.LEQUAL),
  11852. l.frontFace(l.CCW),
  11853. l.cullFace(l.BACK),
  11854. this.enable(l.CULL_FACE),
  11855. this.enable(l.BLEND),
  11856. l.blendEquation(l.FUNC_ADD),
  11857. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11858. }
  11859. ,
  11860. this.initAttributes = function() {
  11861. for (var e = 0, t = o.length; e < t; e++)
  11862. o[e] = 0
  11863. }
  11864. ,
  11865. this.enableAttribute = function(e) {
  11866. o[e] = 1,
  11867. 0 === a[e] && (l.enableVertexAttribArray(e),
  11868. a[e] = 1),
  11869. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11870. s[e] = 0)
  11871. }
  11872. ,
  11873. this.enableAttributeAndDivisor = function(e, t, i) {
  11874. o[e] = 1,
  11875. 0 === a[e] && (l.enableVertexAttribArray(e),
  11876. a[e] = 1),
  11877. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11878. s[e] = t)
  11879. }
  11880. ,
  11881. this.disableUnusedAttributes = function() {
  11882. for (var e = 0, t = a.length; e < t; e++)
  11883. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11884. a[e] = 0)
  11885. }
  11886. ,
  11887. this.enable = function(e) {
  11888. !0 !== t[e] && (l.enable(e),
  11889. t[e] = !0)
  11890. }
  11891. ,
  11892. this.disable = function(e) {
  11893. !1 !== t[e] && (l.disable(e),
  11894. t[e] = !1)
  11895. }
  11896. ,
  11897. this.getCompressedTextureFormats = function() {
  11898. if (null === h && (h = [],
  11899. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11900. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11901. h.push(e[t]);
  11902. return h
  11903. }
  11904. ,
  11905. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11906. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11907. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11908. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11909. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11910. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11911. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11912. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11913. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11914. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11915. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11916. u = e,
  11917. y = s),
  11918. e === z.CustomBlending ? (r = r || t,
  11919. o = o || i,
  11920. a = a || n,
  11921. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11922. d = t,
  11923. g = r),
  11924. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11925. p = i,
  11926. f = n,
  11927. m = o,
  11928. v = a)) : v = m = g = f = p = d = null
  11929. }
  11930. ,
  11931. this.setDepthFunc = function(e) {
  11932. if (A !== e) {
  11933. if (e)
  11934. switch (e) {
  11935. case z.NeverDepth:
  11936. l.depthFunc(l.NEVER);
  11937. break;
  11938. case z.AlwaysDepth:
  11939. l.depthFunc(l.ALWAYS);
  11940. break;
  11941. case z.LessDepth:
  11942. l.depthFunc(l.LESS);
  11943. break;
  11944. case z.LessEqualDepth:
  11945. l.depthFunc(l.LEQUAL);
  11946. break;
  11947. case z.EqualDepth:
  11948. l.depthFunc(l.EQUAL);
  11949. break;
  11950. case z.GreaterEqualDepth:
  11951. l.depthFunc(l.GEQUAL);
  11952. break;
  11953. case z.GreaterDepth:
  11954. l.depthFunc(l.GREATER);
  11955. break;
  11956. case z.NotEqualDepth:
  11957. l.depthFunc(l.NOTEQUAL);
  11958. break;
  11959. default:
  11960. l.depthFunc(l.LEQUAL)
  11961. }
  11962. else
  11963. l.depthFunc(l.LEQUAL);
  11964. A = e
  11965. }
  11966. }
  11967. ,
  11968. this.setDepthTest = function(e) {
  11969. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11970. }
  11971. ,
  11972. this.setDepthWrite = function(e) {
  11973. C !== e && (l.depthMask(e),
  11974. C = e)
  11975. }
  11976. ,
  11977. this.setColorWrite = function(e) {
  11978. I !== e && (l.colorMask(e, e, e, e),
  11979. I = e)
  11980. }
  11981. ,
  11982. this.setStencilFunc = function(e, t, i) {
  11983. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11984. _ = e,
  11985. b = t,
  11986. w = i)
  11987. }
  11988. ,
  11989. this.setStencilOp = function(e, t, i) {
  11990. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11991. T = e,
  11992. x = t,
  11993. S = i)
  11994. }
  11995. ,
  11996. this.setStencilTest = function(e) {
  11997. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11998. }
  11999. ,
  12000. this.setStencilWrite = function(e) {
  12001. E !== e && (l.stencilMask(e),
  12002. E = e)
  12003. }
  12004. ,
  12005. this.setFlipSided = function(e) {
  12006. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12007. M = e)
  12008. }
  12009. ,
  12010. this.setLineWidth = function(e) {
  12011. e !== R && (l.lineWidth(e),
  12012. R = e)
  12013. }
  12014. ,
  12015. this.setPolygonOffset = function(e, t, i) {
  12016. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12017. !e || P === t && O === i || (l.polygonOffset(t, i),
  12018. P = t,
  12019. O = i)
  12020. }
  12021. ,
  12022. this.getScissorTest = function() {
  12023. return L
  12024. }
  12025. ,
  12026. this.setScissorTest = function(e) {
  12027. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12028. }
  12029. ,
  12030. this.activeTexture = function(e) {
  12031. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12032. N !== e && (l.activeTexture(e),
  12033. N = e)
  12034. }
  12035. ,
  12036. this.bindTexture = function(e, t) {
  12037. void 0 === N && n.activeTexture();
  12038. var i = F[N];
  12039. void 0 === i && (i = {
  12040. type: void 0,
  12041. texture: void 0
  12042. },
  12043. F[N] = i),
  12044. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12045. i.type = e,
  12046. i.texture = t)
  12047. }
  12048. ,
  12049. this.compressedTexImage2D = function() {
  12050. try {
  12051. l.compressedTexImage2D.apply(l, arguments)
  12052. } catch (e) {
  12053. console.error(e)
  12054. }
  12055. }
  12056. ,
  12057. this.texImage2D = function() {
  12058. try {
  12059. l.texImage2D.apply(l, arguments)
  12060. } catch (e) {
  12061. console.error(e)
  12062. }
  12063. }
  12064. ,
  12065. this.clearColor = function(e, t, i, n) {
  12066. r.set(e, t, i, n),
  12067. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12068. B.copy(r))
  12069. }
  12070. ,
  12071. this.clearDepth = function(e) {
  12072. V !== e && (l.clearDepth(e),
  12073. V = e)
  12074. }
  12075. ,
  12076. this.clearStencil = function(e) {
  12077. k !== e && (l.clearStencil(e),
  12078. k = e)
  12079. }
  12080. ,
  12081. this.scissor = function(e) {
  12082. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12083. U.copy(e))
  12084. }
  12085. ,
  12086. this.viewport = function(e) {
  12087. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12088. H.copy(e))
  12089. }
  12090. ,
  12091. this.reset = function() {
  12092. for (var e = 0; e < a.length; e++)
  12093. 1 === a[e] && (l.disableVertexAttribArray(e),
  12094. a[e] = 0);
  12095. t = {},
  12096. N = void 0,
  12097. F = {},
  12098. M = E = C = I = u = h = null
  12099. }
  12100. }
  12101. }
  12102. , {
  12103. three: 217
  12104. }],
  12105. 104: [function(a, h, e) {
  12106. (function(i, e) {
  12107. "use strict";
  12108. function t(e) {
  12109. this.urls = e;
  12110. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12111. this.builder = n.loadProto(t),
  12112. this.decoder = this.builder.build("binary_mesh")
  12113. }
  12114. var s = a("three")
  12115. , n = a("protobufjs")
  12116. , r = a("../util/logger")
  12117. , o = (a("../util/common"),
  12118. a("../util/ajax"))
  12119. , l = a("../objects/Chunk")
  12120. , c = new r(e);
  12121. t.prototype = {
  12122. constructor: t,
  12123. load: function(t, i, n, r) {
  12124. return c.time("download"),
  12125. o.get(t, {
  12126. responseType: "arraybuffer"
  12127. }).done(function(e) {
  12128. c.timeEnd("download"),
  12129. this.parse(e, t, i, n, r)
  12130. }
  12131. .bind(this)).fail(r)
  12132. },
  12133. parse: function(e, t, i, n, r) {
  12134. var o = this.readProtobuf(e);
  12135. if (!o)
  12136. return r();
  12137. try {
  12138. c.time("convert to webgl"),
  12139. this.convertProtobufToSceneObject(o, t, i, n, r),
  12140. c.timeEnd("convert to webgl")
  12141. } catch (e) {
  12142. return c.error("failed parsing .dam"),
  12143. c.error(e.message),
  12144. r()
  12145. }
  12146. },
  12147. readProtobuf: function(e) {
  12148. var t;
  12149. try {
  12150. c.time("parse proto"),
  12151. t = this.decoder.decode(e),
  12152. c.timeEnd("parse proto")
  12153. } catch (e) {
  12154. return c.error("failed parsing proto for .dam"),
  12155. c.error(e.message),
  12156. null
  12157. }
  12158. return t
  12159. },
  12160. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12161. if (0 === e.chunk.length)
  12162. return c.warn("No chunks in damfile..."),
  12163. t([]);
  12164. var o = new s.Matrix4;
  12165. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12166. var a = e.chunk.map(function(e) {
  12167. var t = new s.BufferGeometry;
  12168. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12169. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12170. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12171. t.applyMatrix(o),
  12172. t.computeBoundingBox(),
  12173. new l({
  12174. geometry: t,
  12175. textureName: e.material_name,
  12176. name: e.chunk_name,
  12177. meshUrl: i
  12178. })
  12179. });
  12180. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12181. r())
  12182. }
  12183. },
  12184. h.exports = t
  12185. }
  12186. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12187. }
  12188. , {
  12189. "../objects/Chunk": 144,
  12190. "../util/ajax": 181,
  12191. "../util/common": 185,
  12192. "../util/logger": 189,
  12193. buffer: 198,
  12194. protobufjs: 214,
  12195. three: 217
  12196. }],
  12197. 105: [function(n, r, e) {
  12198. (function(e) {
  12199. "use strict";
  12200. var t = (n("three"),
  12201. n("../settings"),
  12202. n("../util/browser"),
  12203. n("./DamLoader"))
  12204. , i = n("../util/logger")
  12205. , u = (n("../ab"),
  12206. new i(e));
  12207. r.exports = {
  12208. getLoaders: function() {
  12209. return [["_50k", ".dam", t], ["", ".dam", t]]
  12210. },
  12211. load: function(e, t, i, n, r, o) {
  12212. var a = this.getLoaders()[o = o || 0];
  12213. if (a) {
  12214. var s = a[0]
  12215. , l = a[1]
  12216. , c = new a[2](t)
  12217. , h = t.get(e + s + l);
  12218. h ? (u.debug("Trying " + s + l),
  12219. c.load(h, i, n, function() {
  12220. this.load(e, t, i, n, r, ++o)
  12221. }
  12222. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12223. this.load(e, t, i, n, r, ++o))
  12224. } else
  12225. r && r("No suitable model file found...")
  12226. }
  12227. }
  12228. }
  12229. ).call(this, "/js/loaders/ModelLoader.js")
  12230. }
  12231. , {
  12232. "../ab": 3,
  12233. "../settings": 166,
  12234. "../util/browser": 182,
  12235. "../util/logger": 189,
  12236. "./DamLoader": 104,
  12237. three: 217
  12238. }],
  12239. 106: [function(i, n, e) {
  12240. (function(e) {
  12241. "use strict";
  12242. var l = i("../util/common")
  12243. , c = i("../util/texture")
  12244. , h = i("../util/browser")
  12245. , t = i("../util/logger")
  12246. , u = i("../settings")
  12247. , d = new t(e);
  12248. n.exports = {
  12249. load: function(i, n) {
  12250. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12251. return $.when();
  12252. var r = l.countUnique(i.chunks.map(function(e) {
  12253. return e.textureName
  12254. }))
  12255. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12256. , t = "_50k" == e ? "high" : "low";
  12257. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12258. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12259. t = "low"));
  12260. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12261. , a = $.Deferred()
  12262. , s = 0;
  12263. return i.chunks.forEach(function(e) {
  12264. if (!e.material.map && e.textureName) {
  12265. var t = i.urls.get(o + e.textureName);
  12266. e.setTextureMap(c.load(t, function(e, t) {
  12267. e || (n.push(t),
  12268. s++,
  12269. a.notify(s, r),
  12270. s === r && a.resolve())
  12271. }
  12272. .bind(this, c.isLoaded(t))))
  12273. }
  12274. }),
  12275. a.promise()
  12276. }
  12277. }
  12278. }
  12279. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12280. }
  12281. , {
  12282. "../settings": 166,
  12283. "../util/browser": 182,
  12284. "../util/common": 185,
  12285. "../util/logger": 189,
  12286. "../util/texture": 194
  12287. }],
  12288. 107: [function(s, l, e) {
  12289. (function(n, e) {
  12290. "use strict";
  12291. function t(e) {
  12292. this.model = e,
  12293. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12294. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12295. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12296. , i = r.loadProto(t);
  12297. this.decoder = i.build("VisionModeldata")
  12298. }
  12299. var r = s("protobufjs")
  12300. , i = s("../util/ajax")
  12301. , o = (s("../util/common"),
  12302. s("../util/math"))
  12303. , a = new (s("../util/logger"))(e);
  12304. t.prototype.load = function() {
  12305. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12306. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12307. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12308. $.when([]))
  12309. }
  12310. ,
  12311. t.prototype.loadVisionModelData = function() {
  12312. return i.get(this.modelDataPath, {
  12313. responseType: "arraybuffer"
  12314. }).then(function(e) {
  12315. var t;
  12316. try {
  12317. t = this.decoder.decode(e)
  12318. } catch (e) {
  12319. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12320. this.loadSweepLocationsCSV()
  12321. }
  12322. var i = t.sweepLocations.map(function(e) {
  12323. return {
  12324. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12325. position: {
  12326. x: e.pose.translation.x,
  12327. y: e.pose.translation.y,
  12328. z: e.pose.translation.z
  12329. },
  12330. quaternion: {
  12331. x: e.pose.rotation.x,
  12332. y: e.pose.rotation.y,
  12333. z: e.pose.rotation.z,
  12334. w: e.pose.rotation.w
  12335. },
  12336. puck: {
  12337. x: e.puck.x,
  12338. y: e.puck.y,
  12339. z: e.puck.z
  12340. },
  12341. floor: e.group,
  12342. neighbours: e.visibles,
  12343. alignmentType: e.alignment_type
  12344. }
  12345. }).map(function(e) {
  12346. return e.position = o.convertVisionVector(e.position),
  12347. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12348. e.puck = o.convertVisionVector(e.puck),
  12349. e
  12350. });
  12351. return i.forEach(function(e) {
  12352. if(e.neighbours.find(a=>a==-1)){
  12353. console.log('%c neighbours 存在-1 ' +e.uuid ,"color:#f00")
  12354. }
  12355. e.neighbours = e.neighbours.filter(e=>i[e])
  12356. e.neighbours = e.neighbours.map(function(e) {
  12357. return i[e].uuid
  12358. })
  12359. }),
  12360. i
  12361. }
  12362. .bind(this), function() {
  12363. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12364. this.loadSweepLocationsCSV()
  12365. }
  12366. .bind(this))
  12367. }
  12368. ,
  12369. t.prototype.loadSweepLocationsCSV = function() {
  12370. return i.get(this.sweepLocationsPath).then(function(e) {
  12371. return e.split("\n").map(function(e) {
  12372. return e.split(", ")
  12373. }).filter(function(e) {
  12374. return 1 < e.length
  12375. }).map(function(e) {
  12376. return {
  12377. uuid: e[0],
  12378. position: {
  12379. x: parseFloat(e[1]),
  12380. y: parseFloat(e[2]),
  12381. z: parseFloat(e[3])
  12382. },
  12383. quaternion: {
  12384. x: parseFloat(e[4]),
  12385. y: parseFloat(e[5]),
  12386. z: parseFloat(e[6]),
  12387. w: parseFloat(e[7])
  12388. }
  12389. }
  12390. }).map(function(e) {
  12391. return e.position = o.convertVisionVector(e.position),
  12392. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12393. e
  12394. })
  12395. }).fail(function() {
  12396. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12397. })
  12398. }
  12399. ,
  12400. l.exports = t
  12401. }
  12402. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12403. }
  12404. , {
  12405. "../util/ajax": 181,
  12406. "../util/common": 185,
  12407. "../util/logger": 189,
  12408. "../util/math": 190,
  12409. buffer: 198,
  12410. protobufjs: 214
  12411. }],
  12412. 108: [function(s, l, e) {
  12413. (function(e) {
  12414. "use strict";
  12415. function t() {
  12416. this.locale = null
  12417. }
  12418. var i = s("../settings")
  12419. , n = s("../util/common")
  12420. , r = s("../util/logger")
  12421. , o = s("../enum/Locale")
  12422. , a = new r(e);
  12423. t.prototype.init = function() {
  12424. var e;
  12425. switch (i.languageTag) {
  12426. case null:
  12427. case "en":
  12428. case o.EN_US:
  12429. this.locale = o.EN_US,
  12430. e = s("./strings-en-US");
  12431. break;
  12432. case "es":
  12433. case o.ES_MX:
  12434. this.locale = o.ES_MX,
  12435. e = s("./strings-es-MX");
  12436. break;
  12437. case "fr":
  12438. case o.FR_FR:
  12439. this.locale = o.FR_FR,
  12440. e = s("./strings-fr-FR");
  12441. break;
  12442. case "de":
  12443. case o.DE_DE:
  12444. this.locale = o.DE_DE,
  12445. e = s("./strings-de-DE");
  12446. break;
  12447. case "ru":
  12448. case o.RU_RU:
  12449. this.locale = o.RU_RU,
  12450. e = s("./strings-ru-RU");
  12451. break;
  12452. case "cn":
  12453. case o.CN_CN:
  12454. this.locale = o.CN_CN,
  12455. e = s("./strings-cn-CN");
  12456. break;
  12457. case "jp":
  12458. case o.JP_JP:
  12459. this.locale = o.JP_JP,
  12460. e = s("./strings-jp-JP");
  12461. break;
  12462. default:
  12463. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12464. this.locale = o.EN_US,
  12465. e = s("./strings-en-US")
  12466. }
  12467. a.info("Using locale '" + this.locale + "'"),
  12468. n.extendObject(this, e)
  12469. }
  12470. ,
  12471. t.prototype.localizeGUI = function() {
  12472. var e = document.querySelector("#gui-parent");
  12473. this.localizeTree(e),
  12474. this.localizeLoadingText()
  12475. }
  12476. ,
  12477. t.prototype.localizeLoadingText = function() {
  12478. document.querySelector("#help-dialog").classList.add(this.locale),
  12479. document.querySelector("#interaction-modal").classList.add(this.locale),
  12480. document.querySelector("#gui").classList.add(this.locale)
  12481. }
  12482. ,
  12483. t.prototype.localizeTree = function(e) {
  12484. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12485. if (e.nodeType === Node.TEXT_NODE)
  12486. (t = e.data.match(n)) && (i = t[1],
  12487. e.data = this.localizeText(i) || i);
  12488. else if (e.nodeType === Node.ELEMENT_NODE) {
  12489. var r = e.getAttribute("title");
  12490. r && ((t = r.match(n)) && (i = t[1],
  12491. e.setAttribute("title", this.localizeText(i) || i)))
  12492. }
  12493. for (e = e.firstChild; e; )
  12494. this.localizeTree(e),
  12495. e = e.nextSibling
  12496. }
  12497. ,
  12498. t.prototype.localizeText = function(e) {
  12499. var t = this[e];
  12500. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12501. t = s("./strings-en-US")[e]),
  12502. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12503. t
  12504. }
  12505. ,
  12506. l.exports = new t
  12507. }
  12508. ).call(this, "/js/localization/localize.js")
  12509. }
  12510. , {
  12511. "../enum/Locale": 31,
  12512. "../settings": 166,
  12513. "../util/common": 185,
  12514. "../util/logger": 189,
  12515. "./strings-cn-CN": 109,
  12516. "./strings-de-DE": 110,
  12517. "./strings-en-US": 111,
  12518. "./strings-es-MX": 112,
  12519. "./strings-fr-FR": 113,
  12520. "./strings-jp-JP": 114,
  12521. "./strings-ru-RU": 115
  12522. }],
  12523. 109: [function(e, t, i) {
  12524. "use strict";
  12525. t.exports = {
  12526. PAGE_TITLE: "",
  12527. LOADING: "正在加载",
  12528. PRESENTED_BY_CAPS: "呈现者:",
  12529. POWERED_BY: "技术支持:",
  12530. POWERED_BY_CAPS: "技术支持:",
  12531. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12532. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12533. PRESENTED_BY: "呈现者:",
  12534. MORE: "更多 ",
  12535. LESS: "更少 ",
  12536. TAG_CONTENT: "tag™ 内容",
  12537. SHOW: "显示",
  12538. HIDE: "隐藏",
  12539. DOLLHOUSE: "场景屋",
  12540. FLOOR_PLAN: "楼层平面图",
  12541. OPEN_HIGHLIGHTS: "打开精彩片段",
  12542. CLOSE_HIGHLIGHTS: "关闭",
  12543. PREVIOUS: "上一个",
  12544. PLAY: "播放",
  12545. PAUSE: "暂停",
  12546. NEXT: "下一个",
  12547. EXPLORE_3D_SPACE: "探索 3D 空间",
  12548. VIEW_DOLLHOUSE: "观看场景屋",
  12549. SOCIAL_SHARING: "分享这个空间",
  12550. VIEW_IN_VR: "以 VR 观看",
  12551. VIEW_FULLSCREEN: "全屏观看",
  12552. EXIT_FULLSCREEN: " 退出全屏",
  12553. ZOOM_IN: "放大",
  12554. ZOOM_OUT: "缩小",
  12555. FLOOR_NAME: "楼层",
  12556. FLOOR_ALL: "ALL",
  12557. FLOOR_Lang: ["Floor", ""],
  12558. TERMS: "条款",
  12559. PORT_TERMS: "port 条款",
  12560. TERMS_OF_USE: "使用条款",
  12561. CLOSE_TERMS: "关闭",
  12562. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12563. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12564. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12565. WEBVR_ENTER_WEBVR: "进入 VR",
  12566. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12567. WEBVR_LEARN_MORE: "了解更多",
  12568. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12569. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12570. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12571. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12572. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12573. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12574. VR_LEARN_MORE_CAPS: "了解更多",
  12575. VR_PREVIOUS_CAPS: "上一个’,",
  12576. VR_NEXT_CAPS: "下一个",
  12577. VR_GOT_IT_CAPS: "明白了",
  12578. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12579. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12580. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12581. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12582. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12583. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12584. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12585. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12586. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12587. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12588. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12589. VR_APP: "port VR 应用程序",
  12590. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12591. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12592. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12593. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12594. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12595. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12596. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12597. VR_ANDROID_DVICES: "Android 设备",
  12598. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12599. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12600. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12601. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12602. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12603. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12604. VR_DOWNLOAD_HERE: "在此下载",
  12605. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12606. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12607. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12608. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12609. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12610. SHARE_TO: "分享到",
  12611. SHARE_LINK: "直接链接",
  12612. SHARE_EXPLORE: "探索",
  12613. SHARE_AT: "在",
  12614. SHARE_WITH: "使用",
  12615. SHARE_3D: "以 3D",
  12616. SHARE_COPIED: "已复制!",
  12617. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12618. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12619. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12620. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12621. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12622. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12623. ERROR_GENERIC_ACTIONS_3: " 或",
  12624. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12625. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12626. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12627. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12628. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12629. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12630. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12631. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12632. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12633. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12634. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12635. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12636. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12637. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12638. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12639. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12640. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12641. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12642. LINK_TO_LOCATION: "地点链接",
  12643. MENU_COPY: "复制",
  12644. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12645. ROTATE: "旋转",
  12646. MOVE: "移动",
  12647. INSIDE: "内部",
  12648. ZOOM: "缩放",
  12649. HELP: "小帮手",
  12650. HELP_NAVIGATION_TAB: "导航",
  12651. HELP_MORE_HELP_TAB: "更多帮助",
  12652. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12653. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12654. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12655. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12656. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12657. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12658. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12659. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12660. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12661. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12662. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12663. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12664. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12665. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12666. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12667. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12668. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12669. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12670. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12671. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12672. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12673. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12674. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12675. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12676. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12677. HELP_MORE_HLR_A: "精彩片段集锦",
  12678. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12679. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12680. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12681. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12682. HELP_MORE_FLOORS_A: "楼层选择器",
  12683. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12684. HELP_MORE_TAG_A: "tag™ 贴文",
  12685. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12686. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12687. HELP_MORE_ZOOM_A: "缩放控件",
  12688. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12689. HELP_MORE_TOUR_A: "导览控件",
  12690. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12691. HELP_MORE_INSIDE_A: "内部视图",
  12692. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12693. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12694. HELP_MORE_VR_A: "VR 模式",
  12695. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12696. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12697. HELP_MORE_360_A: "360° 视图",
  12698. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12699. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12700. HELP_MORE_FULLSCREEN_A: "全屏",
  12701. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12702. CLOSE: "关闭"
  12703. }
  12704. }
  12705. , {}],
  12706. 110: [function(e, t, i) {
  12707. "use strict";
  12708. t.exports = {
  12709. PAGE_TITLE: "",
  12710. LOADING: "Lädt",
  12711. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12712. POWERED_BY: "Angetrieben von",
  12713. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12714. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12715. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12716. PRESENTED_BY: "Präsentiert von ",
  12717. MORE: "Mehr ",
  12718. LESS: "Weniger ",
  12719. TAG_CONTENT: "tag™ Inhalt",
  12720. SHOW: "Anzeigen",
  12721. HIDE: "Verbergen",
  12722. DOLLHOUSE: "Puppenhaus",
  12723. FLOOR_PLAN: "Grundriss",
  12724. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12725. CLOSE_HIGHLIGHTS: "Schließen",
  12726. PREVIOUS: "Vorheriges",
  12727. PLAY: "Abspielen",
  12728. PAUSE: "Pausieren",
  12729. NEXT: "Nächstes",
  12730. EXPLORE_3D_SPACE: "Innenraum betreten",
  12731. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12732. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12733. VIEW_IN_VR: "In VR ansehen",
  12734. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12735. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12736. ZOOM_IN: "Vergrößern",
  12737. ZOOM_OUT: "Verkleinern",
  12738. FLOOR_NAME: "Etage ",
  12739. FLOOR_ALL: "Alle",
  12740. TERMS: "Bedingungen",
  12741. PORT_TERMS: "port Bedingungen",
  12742. TERMS_OF_USE: "Nutzungsbedingungen",
  12743. TERMS_TEXT_FILE: "terms-de-DE.html",
  12744. CLOSE_TERMS: "Schließen",
  12745. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12746. HELP: "Hilfe",
  12747. HELP_NAVIGATION_TAB: "Navigation",
  12748. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12749. CLOSE: "Schließen",
  12750. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12751. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12752. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12753. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12754. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12755. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12756. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12757. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12758. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12759. 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.",
  12760. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12761. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12762. 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.",
  12763. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12764. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12765. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12766. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12767. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12768. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12769. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12770. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12771. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12772. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12773. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12774. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12775. HELP_MORE_HLR_A: "Liste das Highlight",
  12776. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12777. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12778. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12779. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12780. HELP_MORE_FLOORS_A: "Etage auswählen",
  12781. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12782. HELP_MORE_TAG_A: "tag™ Posts",
  12783. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12784. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12785. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12786. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12787. HELP_MORE_TOUR_A: "Tour Steuerung",
  12788. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12789. HELP_MORE_INSIDE_A: "Innenansicht",
  12790. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12791. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12792. HELP_MORE_VR_A: "VR Modus",
  12793. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12794. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12795. HELP_MORE_360_A: "360° Views Ansicht ",
  12796. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12797. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12798. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12799. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12800. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12801. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12802. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12803. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12804. WEBVR_LEARN_MORE: "Mehr Infos",
  12805. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12806. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12807. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12808. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12809. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12810. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12811. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12812. VR_APP: "port VR App",
  12813. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12814. 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",
  12815. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12816. VR_APP_FOR_ANDROID: "port VR app für Android",
  12817. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12818. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12819. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12820. VR_PREVIOUS_CAPS: "ZURÜCK",
  12821. VR_NEXT_CAPS: "WEITER",
  12822. VR_GOT_IT_CAPS: "VERSTANDEN",
  12823. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12824. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12825. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12826. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12827. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12828. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12829. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12830. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12831. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12832. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12833. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12834. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12835. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12836. VR_ANDROID_DVICES: "Android Geräte",
  12837. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12838. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12839. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12840. VR_DOWNLOAD_HERE: "Hier runterladen",
  12841. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12842. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12843. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12844. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12845. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12846. SHARE_TO: "Teilen auf",
  12847. SHARE_LINK: "Direkter Link",
  12848. SHARE_EXPLORE: "Umsehen",
  12849. SHARE_AT: "auf",
  12850. SHARE_WITH: "mit",
  12851. SHARE_3D: "in 3D",
  12852. SHARE_COPIED: "Kopiert!",
  12853. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12854. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12855. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12856. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12857. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12858. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12859. ERROR_GENERIC_ACTIONS_3: " oder ",
  12860. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12861. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12862. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12863. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12864. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12865. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12866. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12867. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12868. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12869. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12870. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12871. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12872. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12873. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12874. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12875. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12876. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12877. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12878. LINK_TO_LOCATION: "Link zu",
  12879. MENU_COPY: "Kopieren",
  12880. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12881. ROTATE: "Drehen",
  12882. INSIDE: "Drinnen",
  12883. MOVE: "Bewegen",
  12884. ZOOM: "Vergrößern"
  12885. }
  12886. }
  12887. , {}],
  12888. 111: [function(e, t, i) {
  12889. "use strict";
  12890. t.exports = {
  12891. PAGE_TITLE: "",
  12892. LOADING: "Loading",
  12893. PRESENTED_BY_CAPS: "PRESENTED BY",
  12894. POWERED_BY: "powered by ",
  12895. POWERED_BY_CAPS: "POWERED BY",
  12896. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12897. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12898. PRESENTED_BY: "Presented by ",
  12899. MORE: "More ",
  12900. LESS: "Less ",
  12901. TAG_CONTENT: "tag™ Content",
  12902. SHOW: "Show",
  12903. HIDE: "Hide",
  12904. DOLLHOUSE: "Dollhouse",
  12905. FLOOR_PLAN: "Floor plan",
  12906. OPEN_HIGHLIGHTS: "Open Highlights",
  12907. CLOSE_HIGHLIGHTS: "Close",
  12908. PREVIOUS: "Previous",
  12909. PLAY: "Play",
  12910. PAUSE: "Pause",
  12911. NEXT: "Next",
  12912. EXPLORE_3D_SPACE: "Explore 3D Space",
  12913. VIEW_DOLLHOUSE: "View dollhouse",
  12914. SOCIAL_SHARING: "Share this Space",
  12915. VIEW_IN_VR: "View in VR",
  12916. VIEW_FULLSCREEN: "全屏",
  12917. EXIT_FULLSCREEN: "退出全屏",
  12918. ZOOM_IN: "Zoom in",
  12919. ZOOM_OUT: "Zoom out",
  12920. FLOOR_NAME: "Floor ",
  12921. FLOOR_ALL: "全部",
  12922. TERMS: "Terms",
  12923. PORT_TERMS: "port terms",
  12924. TERMS_OF_USE: "Terms of Use",
  12925. TERMS_TEXT_FILE: "terms-en-US.html",
  12926. CLOSE_TERMS: "Close",
  12927. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12928. HELP: "Help",
  12929. HELP_NAVIGATION_TAB: "Navigation",
  12930. HELP_MORE_HELP_TAB: "More Help",
  12931. CLOSE: "Close",
  12932. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12933. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12934. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12935. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12936. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12937. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12938. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12939. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12940. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12941. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12942. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12943. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12944. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12945. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12946. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12947. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12948. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12949. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12950. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12951. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12952. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12953. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12954. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12955. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12956. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12957. HELP_MORE_HLR_A: "Highlight Reel",
  12958. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12959. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12960. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12961. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12962. HELP_MORE_FLOORS_A: "Floor Selector",
  12963. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12964. HELP_MORE_TAG_A: "tag™ Posts",
  12965. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12966. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12967. HELP_MORE_ZOOM_A: "Zoom Controls",
  12968. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12969. HELP_MORE_TOUR_A: "Tour Controls",
  12970. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12971. HELP_MORE_INSIDE_A: "Inside View",
  12972. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12973. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12974. HELP_MORE_VR_A: "VR Mode",
  12975. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12976. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12977. HELP_MORE_360_A: "360° Views",
  12978. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12979. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12980. HELP_MORE_FULLSCREEN_A: "Full screen",
  12981. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12982. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12983. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12984. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12985. WEBVR_ENTER_WEBVR: "ENTER VR",
  12986. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12987. WEBVR_LEARN_MORE: "Learn more",
  12988. WEBVR_VIEW_SPACE: "View Space in VR",
  12989. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12990. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12991. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12992. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12993. VR_PREVIOUS_CAPS: "PREVIOUS",
  12994. VR_NEXT_CAPS: "NEXT",
  12995. VR_GOT_IT_CAPS: "GOT IT",
  12996. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12997. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12998. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12999. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13000. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13001. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13002. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13003. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13004. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13005. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13006. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13007. VR_APP: "port VR App",
  13008. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13009. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13010. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13011. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13012. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13013. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13014. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13015. VR_ANDROID_DVICES: "Android Devices",
  13016. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13017. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13018. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13019. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13020. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13021. VR_APP_OPEN: "Open with the port VR app instead",
  13022. VR_DOWNLOAD_HERE: "Download here",
  13023. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13024. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13025. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13026. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13027. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13028. SHARE_TO: "Share to",
  13029. SHARE_LINK: "Direct Link",
  13030. SHARE_EXPLORE: "Explore ",
  13031. SHARE_AT: "at",
  13032. SHARE_WITH: "with",
  13033. SHARE_3D: " in 3D",
  13034. SHARE_COPIED: "Copied!",
  13035. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13036. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13037. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13038. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13039. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13040. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13041. ERROR_GENERIC_ACTIONS_3: " or ",
  13042. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13043. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13044. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13045. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13046. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13047. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13048. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13049. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13050. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13051. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13052. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13053. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13054. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13055. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13056. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13057. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13058. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13059. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13060. LINK_TO_LOCATION: "Link to location",
  13061. MENU_COPY: "Copy",
  13062. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13063. ROTATE: "Rotate",
  13064. INSIDE: "Inside",
  13065. MOVE: "Move",
  13066. ZOOM: "Zoom"
  13067. }
  13068. }
  13069. , {}],
  13070. 112: [function(e, t, i) {
  13071. "use strict";
  13072. t.exports = {
  13073. PAGE_TITLE: "",
  13074. LOADING: "Cargando",
  13075. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13076. POWERED_BY: "potenciando por ",
  13077. POWERED_BY_CAPS: "POTENCIADO POR ",
  13078. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13079. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13080. PRESENTED_BY: "Presentado por ",
  13081. MORE: "Más ",
  13082. LESS: "Menos ",
  13083. TAG_CONTENT: "Contenido de tag™",
  13084. SHOW: "Mostrar",
  13085. HIDE: "Ocultar",
  13086. DOLLHOUSE: "Dollhouse",
  13087. FLOOR_PLAN: "Planos",
  13088. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13089. CLOSE_HIGHLIGHTS: "Cerrar",
  13090. PREVIOUS: "Anterior",
  13091. PLAY: "Play",
  13092. PAUSE: "Pausa",
  13093. NEXT: "Siguiente",
  13094. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13095. VIEW_DOLLHOUSE: "Ver dollhouse",
  13096. SOCIAL_SHARING: "Compartir este espacio",
  13097. VIEW_IN_VR: "Ver en realidad virtual",
  13098. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13099. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13100. ZOOM_IN: "Acercar",
  13101. ZOOM_OUT: "Alejar",
  13102. FLOOR_NAME: "Piso ",
  13103. FLOOR_ALL: "Todas",
  13104. TERMS: "Condiciones",
  13105. PORT_TERMS: "port términos de uso",
  13106. TERMS_OF_USE: "Términos de uso",
  13107. TERMS_TEXT_FILE: "terms-es-MX.html",
  13108. CLOSE_TERMS: "Cerrar",
  13109. 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.",
  13110. HELP: "Ayuda",
  13111. HELP_NAVIGATION_TAB: "Navegación",
  13112. HELP_MORE_HELP_TAB: "Más Ayuda",
  13113. CLOSE: "Cerrar",
  13114. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13115. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13116. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13117. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13118. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13119. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13120. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13121. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13122. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13123. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13124. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13125. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13126. 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.",
  13127. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13128. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13129. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13130. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13131. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13132. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13133. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13134. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13135. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13136. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13137. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13138. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13139. HELP_MORE_HLR_A: "Galería destacada",
  13140. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13141. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13142. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13143. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13144. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13145. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13146. HELP_MORE_TAG_A: "tag™ Posts",
  13147. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13148. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13149. HELP_MORE_ZOOM_A: "Controles de zoom",
  13150. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13151. HELP_MORE_TOUR_A: "Controles de recorrido",
  13152. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13153. HELP_MORE_INSIDE_A: "Vista interior",
  13154. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13155. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13156. HELP_MORE_VR_A: "Modo de realidad virtual",
  13157. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13158. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13159. HELP_MORE_360_A: "360° Views",
  13160. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13161. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13162. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13163. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13164. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13165. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13166. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13167. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13168. WEBVR_LEARN_MORE: "Más información",
  13169. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13170. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13171. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13172. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13173. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13174. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13175. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13176. VR_APP: "port VR App",
  13177. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13178. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13179. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13180. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13181. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13182. VR_PREVIOUS_CAPS: "ANTERIOR",
  13183. VR_NEXT_CAPS: "SIGUIENTE",
  13184. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13185. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13186. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13187. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13188. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13189. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13190. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13191. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13192. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13193. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13194. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13195. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13196. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13197. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13198. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13199. VR_ANDROID_DVICES: "Dispositivos Android",
  13200. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13201. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13202. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13203. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13204. VR_DOWNLOAD_HERE: "Descargar aquí",
  13205. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13206. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13207. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13208. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13209. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13210. SHARE_TO: "Compartir en",
  13211. SHARE_LINK: "Enlace directo",
  13212. SHARE_EXPLORE: "Explorar ",
  13213. SHARE_AT: "en",
  13214. SHARE_WITH: "con",
  13215. SHARE_3D: " en 3D",
  13216. SHARE_COPIED: "¡Copiado!",
  13217. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13218. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13219. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13220. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13221. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13222. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13223. ERROR_GENERIC_ACTIONS_3: " o ",
  13224. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13225. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13226. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13227. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13228. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13229. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13230. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13231. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13232. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13233. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13234. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13235. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13236. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13237. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13238. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13239. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13240. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13241. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13242. LINK_TO_LOCATION: "Enlace a la ubicación",
  13243. MENU_COPY: "Copiar",
  13244. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13245. ROTATE: "Girar",
  13246. INSIDE: "Interior",
  13247. MOVE: "Moverse",
  13248. ZOOM: "Acercar o alejar"
  13249. }
  13250. }
  13251. , {}],
  13252. 113: [function(e, t, i) {
  13253. "use strict";
  13254. t.exports = {
  13255. PAGE_TITLE: "",
  13256. LOADING: "Chargement",
  13257. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13258. POWERED_BY: "alimenté par ",
  13259. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13260. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13261. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13262. PRESENTED_BY: "Présenté par ",
  13263. MORE: "Plus ",
  13264. LESS: "Moins ",
  13265. TAG_CONTENT: "Contenu tag™",
  13266. SHOW: "Montrer",
  13267. HIDE: "Cacher",
  13268. DOLLHOUSE: "Dollhouse",
  13269. FLOOR_PLAN: "Plan de sol",
  13270. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13271. CLOSE_HIGHLIGHTS: "Fermer",
  13272. PREVIOUS: "Précédent",
  13273. PLAY: "Lecture",
  13274. PAUSE: "Pause",
  13275. NEXT: "Suivant",
  13276. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13277. VIEW_DOLLHOUSE: "Voir dollhouse",
  13278. SOCIAL_SHARING: "Partager cet espace",
  13279. VIEW_IN_VR: "Voir en VR",
  13280. VIEW_FULLSCREEN: "Plein écran",
  13281. EXIT_FULLSCREEN: "Fermer plein écran",
  13282. ZOOM_IN: "Zoom avant",
  13283. ZOOM_OUT: "Zoom arrière",
  13284. FLOOR_NAME: "Étage ",
  13285. FLOOR_ALL: "Tous",
  13286. TERMS: "Mentions légales",
  13287. PORT_TERMS: "port mentions légales",
  13288. TERMS_OF_USE: "Conditions d'utilisation",
  13289. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13290. CLOSE_TERMS: "Fermer",
  13291. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13292. HELP: "Aide",
  13293. HELP_NAVIGATION_TAB: "Navigation",
  13294. HELP_MORE_HELP_TAB: "Aide",
  13295. CLOSE: "Fermer",
  13296. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13297. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13298. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13299. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13300. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13301. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13302. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13303. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13304. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13305. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13306. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13307. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13308. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13309. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13310. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13311. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13312. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13313. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13314. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13315. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13316. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13317. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13318. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13319. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13320. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13321. HELP_MORE_HLR_A: "Carrousel",
  13322. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13323. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13324. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13325. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13326. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13327. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13328. HELP_MORE_TAG_A: "tag™ Posts",
  13329. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13330. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13331. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13332. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13333. HELP_MORE_TOUR_A: "Commandes de la visite",
  13334. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13335. HELP_MORE_INSIDE_A: "Vue intérieure",
  13336. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13337. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13338. HELP_MORE_VR_A: "Mode RV",
  13339. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13340. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13341. HELP_MORE_360_A: "Vues 360°",
  13342. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13343. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13344. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13345. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13346. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13347. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13348. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13349. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13350. WEBVR_LEARN_MORE: "En savoir plus",
  13351. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13352. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13353. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13354. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13355. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13356. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13357. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13358. VR_NEXT_CAPS: "SUIVANT",
  13359. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13360. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13361. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13362. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13363. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13364. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13365. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13366. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13367. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13368. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13369. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13370. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13371. VR_APP: "port VR App",
  13372. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13373. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13374. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13375. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13376. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13377. 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",
  13378. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13379. VR_ANDROID_DVICES: "Appareils Android",
  13380. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13381. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13382. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13383. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13384. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13385. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13386. VR_DOWNLOAD_HERE: "Télécharger ici",
  13387. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13388. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13389. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13390. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13391. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13392. SHARE_TO: "Partager sur",
  13393. SHARE_LINK: "Lien direct",
  13394. SHARE_EXPLORE: "Explorer ",
  13395. SHARE_AT: "à",
  13396. SHARE_WITH: "avec",
  13397. SHARE_3D: " en 3D",
  13398. SHARE_COPIED: "Copié!",
  13399. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13400. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13401. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13402. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13403. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13404. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13405. ERROR_GENERIC_ACTIONS_3: " ou ",
  13406. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13407. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13408. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13409. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13410. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13411. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13412. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13413. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13414. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13415. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13416. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13417. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13418. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13419. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13420. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13421. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13422. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13423. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13424. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13425. MENU_COPY: "Copie",
  13426. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13427. ROTATE: "Faire pivoter",
  13428. INSIDE: "Intérieure",
  13429. MOVE: "Se déplacer",
  13430. ZOOM: "Zoom"
  13431. }
  13432. }
  13433. , {}],
  13434. 114: [function(e, t, i) {
  13435. "use strict";
  13436. t.exports = {
  13437. PAGE_TITLE: "",
  13438. LOADING: "読み込み中",
  13439. PRESENTED_BY_CAPS: "PRESENTED BY",
  13440. POWERED_BY: "powered by",
  13441. POWERED_BY_CAPS: "POWERED BY",
  13442. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13443. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13444. PRESENTED_BY: "Presented by ",
  13445. MORE: "全て表示 ",
  13446. LESS: "閉じる ",
  13447. TAG_CONTENT: "tag™コンテンツ ",
  13448. SHOW: "表示",
  13449. HIDE: "非表示",
  13450. DOLLHOUSE: "ドールハウス",
  13451. FLOOR_PLAN: "フロアプラン",
  13452. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13453. CLOSE_HIGHLIGHTS: "閉じる",
  13454. PREVIOUS: "前へ",
  13455. PLAY: "再生",
  13456. PAUSE: "一時停止",
  13457. NEXT: "次へ",
  13458. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13459. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13460. SOCIAL_SHARING: "このSpaceを共有する",
  13461. VIEW_IN_VR: "VRで表示",
  13462. VIEW_FULLSCREEN: "フルスクリーン表示",
  13463. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13464. ZOOM_IN: "ズームイン",
  13465. ZOOM_OUT: "ズームアウト",
  13466. FLOOR_NAME: "フロア ",
  13467. FLOOR_ALL: "すべて",
  13468. TERMS: "規約",
  13469. PORT_TERMS: "port規約",
  13470. TERMS_OF_USE: "利用規約",
  13471. CLOSE_TERMS: "閉じる",
  13472. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13473. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13474. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13475. WEBVR_ENTER_WEBVR: "VRに入る",
  13476. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13477. WEBVR_LEARN_MORE: "もっと詳しく",
  13478. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13479. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13480. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13481. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13482. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13483. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13484. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13485. VR_PREVIOUS_CAPS: "前へ",
  13486. VR_NEXT_CAPS: "次へ",
  13487. VR_GOT_IT_CAPS: "了解",
  13488. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13489. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13490. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13491. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13492. VR_WHAT_YOU_NEED: "必要なもの",
  13493. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13494. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13495. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13496. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13497. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13498. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13499. VR_APP: "port VRアプリ",
  13500. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13501. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13502. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13503. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13504. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13505. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13506. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13507. VR_ANDROID_DVICES: "Androidデバイス",
  13508. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13509. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13510. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13511. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13512. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13513. VR_APP_OPEN: "port VRアプリで開く",
  13514. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13515. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13516. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13517. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13518. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13519. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13520. SHARE_TO: "共有先",
  13521. SHARE_LINK: "ダイレクトリンク",
  13522. SHARE_EXPLORE: "探索",
  13523. SHARE_AT: "場所",
  13524. SHARE_WITH: "使用アプリ",
  13525. SHARE_3D: "3Dで",
  13526. SHARE_COPIED: "コピーされました!",
  13527. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13528. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13529. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13530. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13531. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13532. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13533. ERROR_GENERIC_ACTIONS_3: "または",
  13534. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13535. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13536. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13537. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13538. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13539. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13540. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13541. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13542. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13543. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13544. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13545. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13546. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13547. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13548. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13549. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13550. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13551. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13552. LINK_TO_LOCATION: "ロケーションへのリンク",
  13553. MENU_COPY: "コピー",
  13554. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13555. ROTATE: "回転",
  13556. MOVE: "移動",
  13557. INSIDE: "内側",
  13558. ZOOM: "ズーム",
  13559. HELP: "ヘルプ",
  13560. HELP_NAVIGATION_TAB: "ナビゲーション",
  13561. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13562. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13563. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13564. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13565. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13566. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13567. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13568. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13569. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13570. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13571. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13572. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13573. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13574. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13575. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13576. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13577. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13578. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13579. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13580. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13581. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13582. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13583. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13584. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13585. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13586. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13587. HELP_MORE_HLR_A: "ハイライト",
  13588. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13589. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13590. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13591. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13592. HELP_MORE_FLOORS_A: "フロアセレクター",
  13593. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13594. HELP_MORE_TAG_A: "tag™ Posts",
  13595. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13596. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13597. HELP_MORE_ZOOM_A: "ズームコントロール",
  13598. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13599. HELP_MORE_TOUR_A: "ツアーコントロール",
  13600. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13601. HELP_MORE_INSIDE_A: "内側ビュー",
  13602. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13603. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13604. HELP_MORE_VR_A: "VRモード",
  13605. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13606. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13607. HELP_MORE_360_A: "360° Views",
  13608. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13609. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13610. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13611. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13612. CLOSE: "閉じる"
  13613. }
  13614. }
  13615. , {}],
  13616. 115: [function(e, t, i) {
  13617. "use strict";
  13618. t.exports = {
  13619. PAGE_TITLE: "",
  13620. LOADING: "Загрузка",
  13621. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13622. POWERED_BY: "разработано на платформе ",
  13623. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13624. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13625. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13626. PRESENTED_BY: "Представлено ",
  13627. MORE: "Больше ",
  13628. LESS: "Меньше ",
  13629. TAG_CONTENT: "tag™ Контент",
  13630. SHOW: "Показать",
  13631. HIDE: "Скрыть",
  13632. DOLLHOUSE: "Dollhouse",
  13633. FLOOR_PLAN: "Планировка",
  13634. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13635. CLOSE_HIGHLIGHTS: "Закрыть",
  13636. PREVIOUS: "Предыдущий",
  13637. PLAY: "Воспроизвести",
  13638. PAUSE: "Пауза",
  13639. NEXT: "Следующий",
  13640. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13641. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13642. SOCIAL_SHARING: "Поделиться этой моделью",
  13643. VIEW_IN_VR: "Посмотреть в VR",
  13644. VIEW_FULLSCREEN: "Полный экран",
  13645. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13646. ZOOM_IN: "Увеличить",
  13647. ZOOM_OUT: "Уменьшить",
  13648. FLOOR_NAME: "Этаж ",
  13649. FLOOR_ALL: "Все",
  13650. TERMS: "Условия",
  13651. PORT_TERMS: "Правила пользования",
  13652. TERMS_OF_USE: "Условия использования",
  13653. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13654. CLOSE_TERMS: "Закрыть",
  13655. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13656. HELP: "Помощь",
  13657. HELP_NAVIGATION_TAB: "Навигация",
  13658. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13659. CLOSE: "Закрыть",
  13660. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13661. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13662. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13663. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13664. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13665. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13666. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13667. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13668. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13669. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13670. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13671. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13672. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13673. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13674. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13675. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13676. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13677. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13678. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13679. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13680. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13681. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13682. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13683. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13684. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13685. HELP_MORE_HLR_A: "Фотоколлаж",
  13686. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13687. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13688. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13689. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13690. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13691. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13692. HELP_MORE_TAG_A: "tag™ Posts",
  13693. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13694. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13695. HELP_MORE_ZOOM_A: "Масштаб",
  13696. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13697. HELP_MORE_TOUR_A: "Управление Туром",
  13698. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13699. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13700. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13701. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13702. HELP_MORE_VR_A: "Режим VR",
  13703. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13704. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13705. HELP_MORE_360_A: "360° Views",
  13706. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13707. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13708. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13709. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13710. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13711. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13712. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13713. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13714. WEBVR_LEARN_MORE: "Узнать больше",
  13715. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13716. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13717. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13718. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13719. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13720. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13721. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13722. VR_APP: "port VR App",
  13723. VR_APP_OPEN: "Или открыть через приложение port VR",
  13724. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13725. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13726. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13727. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13728. VR_VIEW_SPACE: "Запустить модель в VR",
  13729. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13730. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13731. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13732. VR_GOT_IT_CAPS: "ЯСНО",
  13733. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13734. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13735. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13736. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13737. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13738. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13739. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13740. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13741. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13742. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13743. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13744. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13745. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13746. VR_ANDROID_DVICES: "Android устройства",
  13747. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13748. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13749. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13750. VR_DOWNLOAD_HERE: "Скачать здесь",
  13751. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13752. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13753. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13754. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13755. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13756. SHARE_TO: "Поделиться",
  13757. SHARE_LINK: "Прямая ссылка",
  13758. SHARE_EXPLORE: "просмотреть",
  13759. SHARE_AT: "на",
  13760. SHARE_WITH: "с",
  13761. SHARE_3D: "в 3D",
  13762. SHARE_COPIED: "Скопировано!",
  13763. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13764. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13765. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13766. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13767. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13768. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13769. ERROR_GENERIC_ACTIONS_3: " или ",
  13770. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13771. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13772. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13773. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13774. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13775. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13776. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13777. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13778. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13779. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13780. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13781. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13782. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13783. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13784. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13785. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13786. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13787. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13788. LINK_TO_LOCATION: "Ссылка на местоположение",
  13789. MENU_COPY: "Копировать",
  13790. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13791. ROTATE: "Вращать",
  13792. MOVE: "Передвигаться",
  13793. INSIDE: "Вид изнутри",
  13794. ZOOM: "Масштаб"
  13795. }
  13796. }
  13797. , {}],
  13798. 116: [function(r, e, t) {
  13799. (function(i) {
  13800. "use strict";
  13801. function re(e) {
  13802. console.log("e1:" + e),
  13803. e = Math.round(.4 * e * 100),
  13804. console.log("e2:" + e);
  13805. var t = $(".progressbar");
  13806. t.find(".bar").css("width", e + "%"),
  13807. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13808. t.find(".perc").text(e + "%")
  13809. }
  13810. $("#gui-loading").fadeIn(200),
  13811. re(.1);
  13812. var e = g_version ? "modeldata.js" : "someData.json";
  13813. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13814. dataType: "json"
  13815. }).done(function(e) {
  13816. var t = matcher(e);
  13817. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13818. t.user = {
  13819. is_authenticated: !1,
  13820. 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"]
  13821. }
  13822. try{//处理一下导览数据
  13823. t.model.images = t.model.images.filter(e=>{
  13824. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13825. if(e.locations)e.locations = e.locations.filter(e=>e)
  13826. if(e.locations && e.locations.length == 0)return;
  13827. return e
  13828. })
  13829. }catch(e){console.log(e) }
  13830. window.editTool = new EditTools()
  13831. t.hotIconScale = parseFloat(t.hotIconScale || 1)
  13832. window.DATA = t
  13833. t.model.summary = t.summary
  13834. t.model.name = t.name
  13835. for(let i in t){
  13836. t[i] == "false" && (t[i] = false)
  13837. }
  13838. re(.7),
  13839. function() {
  13840. function y(e) {
  13841. t.update(e)
  13842. }
  13843. function A(e, t) {
  13844. ne.error(t),
  13845. n.error(t),
  13846. N.report(e, "error-" + t)
  13847. }
  13848. function C(e, t, i) {
  13849. try {
  13850. e.start(t)
  13851. } catch (e) {
  13852. throw ne.warn(e.message),
  13853. function(e) {
  13854. var t = O.details();
  13855. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13856. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13857. N.report(e, "error-webgl-generic"))
  13858. }(i.sid),
  13859. e
  13860. }
  13861. }
  13862. function I(e) {
  13863. e.stopPropagation(),
  13864. e.preventDefault()
  13865. }
  13866. window.DATA.hoticon && (g_HotImage = {
  13867. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13868. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13869. });
  13870. if (window.DATA.backgroundMusic) {
  13871. if(window.isLocal){
  13872. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  13873. }else{
  13874. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  13875. }
  13876. $("#volume").show();
  13877. }else if (g_version === "one"){
  13878. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  13879. $("#volume").show();
  13880. }
  13881. //隐藏公司logo
  13882. window.DATA.loadlogo && showLogo();
  13883. r("./lib/three75-shim"),
  13884. r("./lib/array-polyfill"),
  13885. r("./lib/performance-polyfill"),
  13886. r("./lib/shaders/CopyShader.js"),
  13887. r("./lib/shaders/HorizontalBlurShader.js"),
  13888. r("./lib/shaders/VerticalBlurShader.js"),
  13889. r("./lib/postprocessing/EffectComposer.js"),
  13890. r("./lib/postprocessing/RenderPass.js"),
  13891. r("./lib/postprocessing/MaskPass.js"),
  13892. r("./lib/postprocessing/ShaderPass.js"),
  13893. window.Promise || (window.Promise = r("promise-polyfill"));
  13894. var E = r("three")
  13895. , _ = r("three")
  13896. , b = (r("./util/sentry"),
  13897. r("./player"))
  13898. , w = r("./director")
  13899. , T = r("./controls/CameraControls")
  13900. , x = r("./model/ModelManager")
  13901. , S = r("./DisplayController")
  13902. , M = r("./label/LabelDisplayController")
  13903. , R = r("./enum/Viewmode")
  13904. , e = r("./util/logger")
  13905. , P = r("./showcase")
  13906. , O = r("./util/browser")
  13907. , L = r("./settings")
  13908. , D = r("./gui/gui")
  13909. , n = r("./gui/error")
  13910. , N = r("./analytics")
  13911. , F = r("./util/transitions")
  13912. , B = r("./effects")
  13913. , V = r("./objects/Skybox")
  13914. , k = (r("./util/common"),
  13915. r("./util/PanoramaCollection"),
  13916. r("./util/math"),
  13917. r("./util/showcase"))
  13918. , U = r("./util/camera")
  13919. , H = (r("./objects/Panorama"),
  13920. r("./cameras/PanoramaCamera"),
  13921. r("./preloaders"))
  13922. , z = r("events").EventEmitter
  13923. , G = r("./featureflags")
  13924. , W = (r("./util/lerp"),
  13925. r("./util/ajax"),
  13926. r("./ab"))
  13927. , j = r("./sdk/automation.js")
  13928. , Y = r("./scene/SceneRenderer")
  13929. , q = r("./scene/QuickstartManager")
  13930. , X = r("./tile/QualityManager.js")
  13931. , Z = r("./localization/localize")
  13932. , K = r("./tag/tagManager")
  13933. , Q = r("./tile/TileDownloader")
  13934. , J = r("./tile/PanoRenderer")
  13935. , ee = (r("./enum/PanoSizeClass"),
  13936. r("./enum/PanoramaEvents"),
  13937. r("./enum/SceneRendererEvents"))
  13938. , t = r("./gui/memoryUsage")
  13939. , te = r("./enum/RenderLayers")
  13940. , ie = r("./TimingData")
  13941. , ne = new e(i);
  13942. e.level = L.logLevel,
  13943. e.consoleEnabled = L.console,
  13944. function() {
  13945. var e = window.number//k.getModelIDFromQueryString();
  13946. if (!e)
  13947. return A(null, "loading-failed");
  13948. var t = k.parseSidUrl(e)
  13949. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13950. , n = {
  13951. panoElementsToLoad: 6,
  13952. modelElementsToLoad: 0,
  13953. totalElementsLoaded: 0,
  13954. totalElementsToLoad: 0,
  13955. totalPercentageLoaded: 0,
  13956. progressCallback: null
  13957. }
  13958. , r = document.getElementById("player")
  13959. , o = L.quickstart.enabled
  13960. , a = null
  13961. , s = null
  13962. , l = null
  13963. , c = null
  13964. , h = null
  13965. , u = null
  13966. , d = null
  13967. , p = null
  13968. , f = null
  13969. , g = null
  13970. , m = null
  13971. , v = new ie;
  13972. !function(e) {
  13973. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13974. z.defaultMaxListeners = 1e3,
  13975. function(e) {
  13976. e.addEventListener("dragenter", I, !1),
  13977. e.addEventListener("dragover", I, !1)
  13978. }(e),
  13979. O.valueFromHash("title", !0) || $(document).ready(function() {
  13980. $(".model-title").hide()
  13981. })
  13982. }(r),
  13983. function(e) {
  13984. return G.loadFeatureFlags(e).done(function(e) {
  13985. G.updateDependentSettings(e, L)
  13986. })
  13987. }({
  13988. urlBase: t.urlBase
  13989. }).then(function() {
  13990. return Z.init(),
  13991. function(e, t) {
  13992. var i = P.getModel({
  13993. url: t,
  13994. floors: O.valueFromHash("f", !0),
  13995. autoload: !1
  13996. });
  13997. return $.when(i, y).then(null, function(e) {
  13998. return this
  13999. })
  14000. }(0, e)
  14001. }).then(function(e) {
  14002. return re(.9),
  14003. function(e, t, i, n, r) {
  14004. ne.info("Model data loaded"),
  14005. ne.debug("UUID: " + e.data.job.uuid),
  14006. W.init(G.getFlags()),
  14007. i && N.initKeen({
  14008. token: i,
  14009. appId: n
  14010. }),
  14011. N.initSegment({
  14012. model: e.sid,
  14013. version: "2.25.6-0-gd87e5b1",
  14014. startSource: r.startSource,
  14015. token: t,
  14016. autoplay: r.autoplay,
  14017. quickstart: r.quickstart
  14018. })
  14019. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14020. startSource: i,
  14021. autoplay: L.autoplay,
  14022. quickstart: o
  14023. }),
  14024. g.urls.init()
  14025. }).then(function() {
  14026. return g.loadPanos()
  14027. }).then(function() {
  14028. s = U.getStartCameraOptions(g, g.panos);
  14029. //初始画面
  14030. window.DATA.camera_start && window.DATA.camera_start.thumbImg && function(e) {
  14031. $("<img/>").attr("src", e).on("load", function() {
  14032. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14033. $(this).remove()
  14034. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14035. })
  14036. }(window.DATA.camera_start.thumbImg);
  14037. {//初始化导览时间
  14038. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14039. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14040. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14041. /* if(DATA.tourWalkSpeed!=void 0){
  14042. let r = 100 / DATA.tourWalkSpeed;
  14043. window._settings.warp.flytimeDistanceMultiplier = settings.flytimeDistanceMultiplier * r
  14044. window._settings.warp.flyTime = settings.flyTime * r
  14045. }else{
  14046. window._settings.warp.flyTime = settings.flyTime
  14047. } */
  14048. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14049. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14050. }
  14051. }
  14052. d = function(e) {
  14053. var t = new E.PerspectiveCamera;
  14054. t.layers.enable(te.PANOMARKERS),
  14055. t.layers.enable(te.RETICULE),
  14056. t.layers.enable(te.TAG);
  14057. var o = new E.Scene
  14058. , i = new E.AmbientLight(16777215);
  14059. return o.add(i),
  14060. o.skybox = new V,
  14061. o.add(o.skybox),
  14062. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14063. side: E.DoubleSide
  14064. })),
  14065. o.plane.position.y = 0,
  14066. o.plane.rotateX(-Math.PI / 2),
  14067. o.plane.material.visible = !1,
  14068. o.add(o.plane),
  14069. o.updateMatrixWorld(),
  14070. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14071. if (e.metadata && e.metadata.camera_position) {
  14072. var t = e.metadata.camera_position
  14073. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14074. i.position = t.clone(),
  14075. o.add(i);
  14076. var n = e.metadata.camera_quaternion
  14077. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14078. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14079. }
  14080. }),
  14081. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14082. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14083. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14084. new Y(o,t,B)
  14085. }(g),
  14086. m = function(e, t) {
  14087. var i = e ? 1 : 1e3
  14088. , n = W.tilegen || W.imgopt ? 6 : 2;
  14089. n = O.valueFromHash("tileconc", n);
  14090. var r = new X
  14091. , o = new Q({
  14092. concurrentDownloads: n
  14093. })
  14094. , a = new J
  14095. , s = new x
  14096. , l = new w
  14097. , c = new b(t)
  14098. , h = new T
  14099. , u = new S(i)
  14100. , d = new M
  14101. , p = new K;
  14102. return {
  14103. qualityManager: r,
  14104. panoRenderer: a,
  14105. tileDownloader: o,
  14106. player: c,
  14107. director: l,
  14108. modelManager: s,
  14109. tagManager: p,
  14110. displayController: u,
  14111. labelDisplayController: d,
  14112. controls: h
  14113. }
  14114. }(o, s.mode),
  14115. l = m.controls,
  14116. c = m.player,
  14117. h = m.director,
  14118. u = m.tagManager,
  14119. p = m.tileDownloader,
  14120. f = m.qualityManager,
  14121. m.panoRenderer,
  14122. function(e, t, i, n) {
  14123. var r = i.controls
  14124. , o = i.qualityManager
  14125. , a = i.panoRenderer
  14126. , s = i.tileDownloader
  14127. , l = i.modelManager;
  14128. r.init(n, l),
  14129. j.init(i.director, r, i.player, l, t),
  14130. o.init(l),
  14131. s.init(o),
  14132. a.init(t, s, o),
  14133. l.init(s, a, o),
  14134. l.addModel(e),
  14135. t.addComponent(F)
  14136. }(g, d, m, r),
  14137. c.director = h,
  14138. g.supportsTiles && p.start(),
  14139. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14140. o = !1);
  14141. var e = null;
  14142. if (o) {
  14143. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14144. var t = l.controls[R.PANORAMA];
  14145. a = new q(f,d.scene,d.camera,t,r),
  14146. C(d, r, g),
  14147. e = a.load(s).then(function() {
  14148. d.addComponent(a),
  14149. d.once(ee.AfterRender, function() {
  14150. ne.warn("First render after quickstart load finished.")
  14151. })
  14152. })
  14153. }
  14154. return window.flyToFirst = function() {
  14155. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14156. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14157. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14158. c.flyToPano({
  14159. pano: e,
  14160. lookAtPoint: i
  14161. })
  14162. }
  14163. ,
  14164. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14165. }).then(function() {
  14166. return function(e, t, i, n, r) {
  14167. return r.progressCallback = t,
  14168. N.sessionStart(),
  14169. e.load(n).progress(function(e, t) {
  14170. e.modelElementsToLoad = t[1],
  14171. function(e) {
  14172. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14173. }(e),
  14174. function(e) {
  14175. e.totalElementsLoaded++,
  14176. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14177. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14178. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14179. console.log("pro:" + e.totalPercentageLoaded),
  14180. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14181. }(e)
  14182. }
  14183. .bind(this, r))
  14184. }(g, D.onProgress, 0, !o, n)
  14185. }).then(function() {
  14186. s.quickstart = o,
  14187. function(e, t, i, n) {
  14188. var r = i.qualityManager
  14189. , o = i.panoRenderer
  14190. , a = i.tileDownloader
  14191. , s = i.modelManager
  14192. , l = i.player
  14193. , c = i.director
  14194. , h = i.tagManager
  14195. , u = i.displayController
  14196. , d = i.labelDisplayController
  14197. , p = i.controls;
  14198. t.scene.add(e),
  14199. t.qualityManager = r;
  14200. var f = {
  14201. camera: t.camera,
  14202. director: c,
  14203. modelManager: s,
  14204. tileDownloader: a,
  14205. panoRenderer: o,
  14206. qualityManager: r,
  14207. tagManager: h,
  14208. container: n,
  14209. controls: p
  14210. };
  14211. l.init(f),
  14212. l.setScene(t.scene),
  14213. h.init(s, l),
  14214. c.init(l, s),
  14215. u.init(c, l, s, h, n),
  14216. d.init(l, s, n),
  14217. B.bindEvents(l),
  14218. t.addComponent(h),
  14219. t.addComponent(l),
  14220. t.addComponent(o),
  14221. l.sceneRenderer = t
  14222. }(g, d, m, r),
  14223. d.started || C(d, r, g),
  14224. N.modelLoaded(g, c, l, L.autoplay),
  14225. function(e, t, i, n) {
  14226. return ne.info("Starting player in " + i.mode),
  14227. N.report(t.sid, "started-playing", n, i.quickstart),
  14228. e.start(i)
  14229. }(c, g, s, L.autoplay).done(function() {
  14230. h.autoTour()
  14231. }),
  14232. g.supportsTiles || new H(g,c).start();
  14233. o && (d.removeComponent(a),
  14234. a.destroy(),
  14235. s.pano.enter()),
  14236. D.init(g, h, c, l, d, s, N.getSessionId()),
  14237. D.endLoading(g, h, u),
  14238. d.once(ee.AfterRender, function() {
  14239. v.setAppReadyTime();
  14240. var e = v.calcFullLoadingTime();
  14241. ne.warn("Total load time: " + e / 1e3),
  14242. N.loadComplete(e),
  14243. ne.warn("First render after model load finished.");
  14244. editTool.loadDone('data', window.DATA)
  14245. }),
  14246. d.on(ee.MemoryUsageUpdated, y)
  14247. }).fail(A.bind(this, e))
  14248. }()
  14249. }()
  14250. }).fail(e=>{
  14251. alert("缺少someData文件,请检查场景码是否正确。")
  14252. })
  14253. }
  14254. ).call(this, "/js/main.js")
  14255. }
  14256. , {
  14257. "./DisplayController": 1,
  14258. "./TimingData": 2,
  14259. "./ab": 3,
  14260. "./analytics": 4,
  14261. "./cameras/PanoramaCamera": 7,
  14262. "./controls/CameraControls": 9,
  14263. "./director": 15,
  14264. "./effects": 16,
  14265. "./enum/PanoSizeClass": 36,
  14266. "./enum/PanoramaEvents": 37,
  14267. "./enum/RenderLayers": 41,
  14268. "./enum/SceneRendererEvents": 43,
  14269. "./enum/Viewmode": 51,
  14270. "./featureflags": 59,
  14271. "./gui/error": 64,
  14272. "./gui/gui": 65,
  14273. "./gui/memoryUsage": 73,
  14274. "./label/LabelDisplayController": 91,
  14275. "./lib/array-polyfill": 92,
  14276. "./lib/performance-polyfill": 95,
  14277. "./lib/postprocessing/EffectComposer.js": 96,
  14278. "./lib/postprocessing/MaskPass.js": 97,
  14279. "./lib/postprocessing/RenderPass.js": 98,
  14280. "./lib/postprocessing/ShaderPass.js": 99,
  14281. "./lib/shaders/CopyShader.js": 100,
  14282. "./lib/shaders/HorizontalBlurShader.js": 101,
  14283. "./lib/shaders/VerticalBlurShader.js": 102,
  14284. "./lib/three75-shim": 103,
  14285. "./localization/localize": 108,
  14286. "./tag/tagManager": 124,
  14287. "./model/ModelManager": 140,
  14288. "./objects/Panorama": 148,
  14289. "./objects/Skybox": 152,
  14290. "./player": 155,
  14291. "./preloaders": 156,
  14292. "./scene/QuickstartManager": 157,
  14293. "./scene/SceneRenderer": 158,
  14294. "./sdk/automation.js": 164,
  14295. "./settings": 166,
  14296. "./showcase": 168,
  14297. "./tile/PanoRenderer": 169,
  14298. "./tile/QualityManager.js": 170,
  14299. "./tile/TileDownloader": 171,
  14300. "./util/PanoramaCollection": 178,
  14301. "./util/ajax": 181,
  14302. "./util/browser": 182,
  14303. "./util/camera": 183,
  14304. "./util/common": 185,
  14305. "./util/lerp": 188,
  14306. "./util/logger": 189,
  14307. "./util/math": 190,
  14308. "./util/sentry": 192,
  14309. "./util/showcase": 193,
  14310. "./util/transitions": 195,
  14311. events: 202,
  14312. "promise-polyfill": 213,
  14313. three: 217
  14314. }],
  14315. 117: [function(e, t, i) {
  14316. "use strict";
  14317. function n(e) {
  14318. e = e || {},
  14319. r.RawShaderMaterial.call(this, a.extendObject({
  14320. fragmentShader: o.cube.fragmentShader,
  14321. vertexShader: o.cube.vertexShader,
  14322. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14323. name: "CubemapMaterial"
  14324. }, e))
  14325. }
  14326. var r = e("three")
  14327. , o = e("../shaders")
  14328. , a = e("../util/common");
  14329. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14330. t.exports = n
  14331. }
  14332. , {
  14333. "../shaders": 167,
  14334. "../util/common": 185,
  14335. three: 217
  14336. }],
  14337. 118: [function(e, t, i) {
  14338. "use strict";
  14339. function n(e) {
  14340. e = e || {},
  14341. r.RawShaderMaterial.call(this, a.extendObject({
  14342. fragmentShader: o.model.fragmentShader,
  14343. vertexShader: o.model.vertexShader,
  14344. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14345. name: "ModelTextureMaterial"
  14346. }, e))
  14347. }
  14348. var r = e("three")
  14349. , o = e("../shaders")
  14350. , a = e("../util/common");
  14351. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14352. i && (this.uniforms.progress.value = 0),
  14353. e.ensureSkyboxReadyForRender(),
  14354. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14355. this.uniforms.pano0Position.value.copy(e.position),
  14356. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14357. t.ensureSkyboxReadyForRender(),
  14358. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14359. this.uniforms.pano1Position.value.copy(t.position),
  14360. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14361. }
  14362. ,
  14363. t.exports = n
  14364. }
  14365. , {
  14366. "../shaders": 167,
  14367. "../util/common": 185,
  14368. three: 217
  14369. }],
  14370. 119: [function(m, v, e) {
  14371. (function(e) {
  14372. "use strict";
  14373. function t(e, t, i, n) {
  14374. this.div = null,
  14375. this.body = null,
  14376. this.label = e,
  14377. this.description = t,
  14378. this.parsedDescription = [],
  14379. this.media = i || {
  14380. type: null
  14381. },
  14382. this.loadingSpinner = null,
  14383. this.parser = new r({
  14384. supportLinks: !c.valueFromHash("mls"),
  14385. keepLinkLabels: !0
  14386. }),
  14387. this.state = g.CLOSED,
  14388. this.orientation = "",
  14389. this.initialTransform = "",
  14390. this.hovering = !1,
  14391. this.openTransition = null,
  14392. this.closeTransition = null,
  14393. this.openPromise = null,
  14394. this.closePromise = null,
  14395. this.animationTransition = null,
  14396. this.animationScale = 0
  14397. }
  14398. var r = m("../Parser/DescriptionParser")
  14399. , i = m("../Media/Link")
  14400. , n = m("../Media/Image")
  14401. , o = m("../Media/EmbedlyPlayer")
  14402. , a = m("../Media/EmbedlyEmbed")
  14403. , s = m("../../util/transitions")
  14404. , l = m("../../util/lerp")
  14405. , c = m("../../util/browser")
  14406. , b = m("./BillboardEvent")
  14407. , w = m("../Media/MediaEvent")
  14408. , h = m("../Parser/DescriptionChunkType")
  14409. , u = m("events").EventEmitter
  14410. , d = m("./billboardSettings")
  14411. , T = m("./overlaySettings")
  14412. , p = new (m("../../util/logger"))(e)
  14413. , f = document.getElementById("tag-billboards");
  14414. f.addEventListener("touchend", function(e) {
  14415. f.style.pointerEvents = "none"
  14416. }),
  14417. f.addEventListener("touchcancel", function(e) {
  14418. f.style.pointerEvents = "none"
  14419. });
  14420. var g = {
  14421. CLOSED: "closed",
  14422. OPENING: "opening",
  14423. OPEN: "open",
  14424. CLOSING: "closing",
  14425. ACTIVE: "active"
  14426. };
  14427. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14428. this.parsedDescription = this.parser.parse(this.description);
  14429. var t = document.createElement("div");
  14430. t.className = "tag-container has-hotzone",
  14431. this.div = t,
  14432. this.body = document.createElement("div"),
  14433. this.body.className = "tag-body";
  14434. var i = document.createElement("div");
  14435. i.classList.add("tag-content");
  14436. var n = document.createElement("div");
  14437. n.classList.add("tag-text-content");
  14438. var r = document.createElement("div");
  14439. r.className = "tag-label",
  14440. r.textContent = this.label,
  14441. n.appendChild(r);
  14442. var o = document.createElement("div");
  14443. o.className = "tag-desc",
  14444. n.appendChild(o),
  14445. i.appendChild(n),
  14446. this.body.appendChild(i),
  14447. this.appendDescriptionElements(this.parsedDescription, o),
  14448. this.appendMedia(),
  14449. t.appendChild(this.body),
  14450. f.appendChild(t),
  14451. this.bindEvents(t, this.body)
  14452. }
  14453. ,
  14454. t.prototype.bindEvents = function(i, e) {
  14455. function t(n) {
  14456. return function(e) {
  14457. if (!this.div.classList.contains("overlay")) {
  14458. var t, i = document.getElementById("player");
  14459. try {
  14460. t = new MouseEvent(n,e)
  14461. } catch (i) {
  14462. (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)
  14463. }
  14464. i.dispatchEvent(t)
  14465. }
  14466. }
  14467. }
  14468. e.addEventListener("mousedown", function(e) {
  14469. e.stopPropagation()
  14470. }),
  14471. e.addEventListener("mouseup", function(e) {
  14472. e.stopPropagation()
  14473. }),
  14474. i.addEventListener("touchstart", function(e) {
  14475. f.style.pointerEvents = "auto"
  14476. }),
  14477. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14478. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14479. e.addEventListener("mouseover", function(e) {
  14480. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14481. }
  14482. .bind(this)),
  14483. i.addEventListener("mouseenter", function(e) {
  14484. this.state !== g.CLOSING && (this.hovering = !0,
  14485. this.emit(b.ENTER))
  14486. }
  14487. .bind(this)),
  14488. i.addEventListener("mouseleave", function(e) {
  14489. this.hovering = !1,
  14490. this.emit(b.LEAVE)
  14491. }
  14492. .bind(this)),
  14493. i.addEventListener("gesturestart", function(e) {
  14494. e.preventDefault()
  14495. });
  14496. var n = i.querySelector(".tag-text-content")
  14497. , r = 0;
  14498. n.addEventListener("touchstart", function(e) {
  14499. r = e.changedTouches[0].clientY
  14500. }),
  14501. n.addEventListener("touchmove", function(t) {
  14502. function e(e) {
  14503. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14504. }
  14505. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14506. }),
  14507. i.addEventListener("touchmove", function(e) {
  14508. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14509. })
  14510. }
  14511. ,
  14512. t.prototype.appendDescriptionElements = function(e, i) {
  14513. 0 < e.length && this.div.classList.add("has-text"),
  14514. e.forEach(function(e, t) {
  14515. switch (e.type) {
  14516. case h.TEXT:
  14517. i.appendChild(this.createTextElement(e.text));
  14518. break;
  14519. case h.LINK:
  14520. i.appendChild(this.createLinkElement(e.link))
  14521. }
  14522. }
  14523. .bind(this))
  14524. }
  14525. ,
  14526. t.prototype.appendLoadingSpinner = function() {
  14527. this.loadingSpinner = document.createElement("div"),
  14528. this.loadingSpinner.classList.add("loading-spinner");
  14529. var e = document.createElement("div");
  14530. e.classList.add("gui-spinner-icon"),
  14531. this.loadingSpinner.appendChild(e),
  14532. this.body.appendChild(this.loadingSpinner)
  14533. }
  14534. ,
  14535. t.prototype.onMediaLoadFinished = function() {
  14536. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14537. this.applyOrientation(this.orientation),
  14538. this.loadingSpinner = null)
  14539. }
  14540. ,
  14541. t.prototype.appendMedia = function() {
  14542. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14543. this.appendLoadingSpinner();
  14544. var e = document.createElement("div");
  14545. e.classList.add("tag-media-content");
  14546. var t = document.createElement("i");
  14547. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14548. t.classList.add(e)
  14549. }),
  14550. this.body.appendChild(t),
  14551. this.body.appendChild(e),
  14552. this.media.type) {
  14553. case h.IMAGE:
  14554. e.appendChild(this.createImageElement(this.media, this.body));
  14555. break;
  14556. case h.VIDEO:
  14557. e.appendChild(this.createVideoElement(this.media, this.body));
  14558. break;
  14559. case h.RICH:
  14560. e.appendChild(this.createEmbedElement(this.media, this.body))
  14561. }
  14562. }
  14563. }
  14564. ,
  14565. t.prototype.createTextElement = function(e) {
  14566. var t = document.createElement("span");
  14567. return t.textContent = e,
  14568. t
  14569. }
  14570. ,
  14571. t.prototype.createLinkElement = function(e) {
  14572. var t = new i(e);
  14573. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14574. t.createDomElement()
  14575. }
  14576. ,
  14577. t.prototype.createImageElement = function(t, C) {
  14578. function e() {
  14579. function e() {
  14580. p || (E.classList.remove("view-image"),
  14581. a.classList.add("overlay"),
  14582. t(),
  14583. window.addEventListener("resize", A),
  14584. a.addEventListener("click", i),
  14585. c.addEventListener("click", r),
  14586. o.addEventListener("click", n),
  14587. p = !0,
  14588. _.emit(w.IMAGE_OPENED))
  14589. }
  14590. function t() {
  14591. C.classList.add("show-info"),
  14592. s.classList.remove("collapsible"),
  14593. s.style.height = "";
  14594. var e = parseFloat(getComputedStyle(v).lineHeight)
  14595. , t = g + e
  14596. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14597. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14598. , r = n
  14599. , o = r * I.aspect;
  14600. i < o && (r = (o = i) / I.aspect),
  14601. n < r && (o = (r = n) * I.aspect),
  14602. o += m,
  14603. r += m + t,
  14604. C.style.width = o + "px",
  14605. C.style.height = r + "px",
  14606. l.style.paddingTop = e + m + "px",
  14607. 0 < _.description.length && (s.classList.add("collapsible"),
  14608. s.style.height = s.clientHeight + 12 + "px",
  14609. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14610. }
  14611. function i(e) {
  14612. e.target === a && n()
  14613. }
  14614. function n() {
  14615. p && (p = !1,
  14616. E.classList.add("view-image"),
  14617. a.classList.remove("overlay"),
  14618. s.style.height = "",
  14619. l.style.paddingTop = "",
  14620. C.style.width = "",
  14621. C.style.height = "",
  14622. window.removeEventListener("resize", A),
  14623. a.removeEventListener("click", i),
  14624. c.removeEventListener("click", r),
  14625. o.removeEventListener("click", n),
  14626. _.emit(w.IMAGE_CLOSED),
  14627. _.close(!0))
  14628. }
  14629. function r(e) {
  14630. C.classList.toggle("show-info")
  14631. }
  14632. var a = _.div
  14633. , s = a.getElementsByClassName("tag-content")[0]
  14634. , l = a.getElementsByClassName("tag-media-content")[0]
  14635. , o = C.getElementsByClassName("close")[0]
  14636. , c = s.getElementsByClassName("tag-label")[0];
  14637. a.classList.add("has-image"),
  14638. E.classList.add("view-image"),
  14639. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14640. _.applyOrientation(_.orientation);
  14641. 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,
  14642. function() {
  14643. clearInterval(h),
  14644. clearTimeout(u),
  14645. h = setInterval(function() {
  14646. var e = a.clientHeight;
  14647. d !== e && (t(),
  14648. d = e)
  14649. }, 100),
  14650. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14651. }
  14652. );
  14653. I.on(w.IMAGE_OPENING, e),
  14654. _.on(b.ACTIVATE, e),
  14655. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14656. _.on(b.CLOSING, n)
  14657. }
  14658. var I = new n
  14659. , E = I.createDomElement();
  14660. this.once(b.OPENED, function() {
  14661. I.load(t.src).then(e).catch(function(e) {
  14662. p.warn("Failed to load image:", t.src),
  14663. p.warn("with error:", e)
  14664. }).then(this.onMediaLoadFinished.bind(this))
  14665. });
  14666. var _ = this;
  14667. return E
  14668. }
  14669. ,
  14670. t.prototype.createVideoElement = function(t, e) {
  14671. var i = new o({
  14672. autoPlay: !0,
  14673. autoResume: !0,
  14674. startMuted: !1,
  14675. loop: !1
  14676. })
  14677. , n = i.createDomElement();
  14678. return this.once(b.OPENED, function() {
  14679. i.load(t.src).then(function() {
  14680. this.div.classList.add("has-video"),
  14681. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14682. i.play()),
  14683. this.on(b.OPENING, i.show.bind(i)),
  14684. this.on(b.OPENED, i.play.bind(i)),
  14685. this.on(b.CLOSING, i.pause.bind(i)),
  14686. this.on(b.CLOSED, i.hide.bind(i))
  14687. }
  14688. .bind(this)).catch(function(e) {
  14689. p.warn("Failed to embed video:", t.src),
  14690. p.warn("with error:", e)
  14691. }).then(this.onMediaLoadFinished.bind(this))
  14692. }
  14693. .bind(this)),
  14694. n
  14695. }
  14696. ,
  14697. t.prototype.createEmbedElement = function(t, e) {
  14698. var i = new a
  14699. , n = i.createDomElement();
  14700. return this.once(b.OPENED, function() {
  14701. i.load(t.src).then(function() {
  14702. this.div.classList.add("has-embed"),
  14703. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14704. this.applyOrientation(this.orientation),
  14705. this.on(b.OPENING, i.show.bind(i)),
  14706. this.on(b.CLOSED, i.hide.bind(i))
  14707. }
  14708. .bind(this)).catch(function(e) {
  14709. p.warn("Failed to embed:", t.src),
  14710. p.warn("with error:", e)
  14711. }).then(this.onMediaLoadFinished.bind(this))
  14712. }
  14713. .bind(this)),
  14714. n
  14715. }
  14716. ,
  14717. t.prototype.open = function(e) {
  14718. return this.openPromise = $.Deferred(),
  14719. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14720. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14721. this.state !== g.OPEN && (this.emit(b.OPENING),
  14722. e && this.emit(b.ACTIVATING),
  14723. this.state = g.OPENING,
  14724. this.animateOpen(function() {
  14725. e && this.setActiveState(),
  14726. this.openPromise.resolve()
  14727. }
  14728. .bind(this)))
  14729. }
  14730. .bind(this), d.animation.openDelay),
  14731. s.cancel(this.closeTransition),
  14732. this.closePromise && this.closePromise.reject(),
  14733. this.closeTransition = void 0,
  14734. this.openPromise.promise())
  14735. }
  14736. ,
  14737. t.prototype.close = function(e) {
  14738. return this.closePromise = $.Deferred(),
  14739. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14740. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14741. this.state = g.CLOSING,
  14742. this.animateClose())
  14743. }
  14744. .bind(this), d.animation.closeDelay)),
  14745. s.cancel(this.openTransition),
  14746. this.openPromise && this.openPromise.reject(),
  14747. this.openTransition = void 0,
  14748. this.closePromise.resolve(),
  14749. this.closePromise.promise())
  14750. }
  14751. ,
  14752. t.prototype.setActiveState = function() {
  14753. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14754. this.emit(b.ACTIVATE),
  14755. this.div.classList.remove("has-hotzone"))
  14756. }
  14757. ,
  14758. t.prototype.animateOpen = function(e) {
  14759. if (this.state === g.OPENING) {
  14760. if (s.cancel(this.animationTransition),
  14761. c.detectSamsungNative())
  14762. return this.boardOrientation = null,
  14763. this.div.style.visibility = "visible",
  14764. this.emit(b.OPENED),
  14765. this.state = g.OPEN,
  14766. void (e && e());
  14767. this.div.style.webkitTransform = "scale(0)",
  14768. this.div.style.transform = "scale(0)",
  14769. this.div.style.visibility = "visible",
  14770. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14771. this.emit(b.OPENED),
  14772. this.state = g.OPEN,
  14773. e && e()
  14774. }
  14775. .bind(this))
  14776. }
  14777. }
  14778. ,
  14779. t.prototype.animateClose = function(e) {
  14780. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14781. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14782. this.emit(b.CLOSED),
  14783. this.state = g.CLOSED,
  14784. this.div.style.visibility = "hidden",
  14785. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14786. e && e()
  14787. }
  14788. .bind(this)))
  14789. }
  14790. ,
  14791. t.prototype.needsUpdate = function() {
  14792. return this.state !== g.CLOSED
  14793. }
  14794. ,
  14795. t.prototype.update = function(e, t) {
  14796. if (this.needsUpdate()) {
  14797. var i = (this.updateOrientation(e),
  14798. this.calcScale(t))
  14799. , n = {
  14800. x: (e.x + 1) * $("#player").width() / 2,
  14801. y: (e.y + 1) * $("#player").height() / 2
  14802. };
  14803. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14804. this.div.style.webkitTransform = this.div.screenTransform,
  14805. this.div.style.transform = this.div.screenTransform
  14806. }
  14807. }
  14808. ,
  14809. t.prototype.getDimensions = function() {
  14810. return this.div.getBoundingClientRect()
  14811. }
  14812. ,
  14813. t.prototype.calcScale = function(e) {
  14814. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14815. }
  14816. ,
  14817. t.prototype.updateOrientation = function(e) {
  14818. if (this.state !== g.ACTIVE) {
  14819. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14820. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14821. , n = "";
  14822. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14823. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14824. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14825. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14826. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14827. }
  14828. }
  14829. ,
  14830. t.prototype.applyOrientation = function(e) {
  14831. this.div.style.transform = this.div.style.webkitTransform = "",
  14832. this.div.classList.remove("tag-container-" + this.orientation),
  14833. this.div.classList.add("tag-container-" + e);
  14834. var t = window.getComputedStyle(this.div);
  14835. this.initialTransform = t.transform || t.webkitTransform,
  14836. "none" === this.initialTransform && (this.initialTransform = "");
  14837. var i = t.transform.slice(7, -1).split(",")
  14838. , n = -i[4]
  14839. , r = -i[5];
  14840. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14841. this.div.style.transformOrigin = n + "px " + r + "px",
  14842. this.orientation = e
  14843. }
  14844. ,
  14845. v.exports = t
  14846. }
  14847. ).call(this, "/js/tag/Billboard/Billboard.js")
  14848. }
  14849. , {
  14850. "../../util/browser": 182,
  14851. "../../util/lerp": 188,
  14852. "../../util/logger": 189,
  14853. "../../util/transitions": 195,
  14854. "../Media/EmbedlyEmbed": 125,
  14855. "../Media/EmbedlyPlayer": 126,
  14856. "../Media/Image": 128,
  14857. "../Media/Link": 129,
  14858. "../Media/MediaEvent": 131,
  14859. "../Parser/DescriptionChunkType": 133,
  14860. "../Parser/DescriptionParser": 134,
  14861. "./BillboardEvent": 120,
  14862. "./billboardSettings": 121,
  14863. "./overlaySettings": 122,
  14864. events: 202
  14865. }],
  14866. 120: [function(e, t, i) {
  14867. "use strict";
  14868. t.exports = Object.freeze({
  14869. ENTER: "billboard.enter",
  14870. LEAVE: "billboard.leave",
  14871. OPENING: "billboard.opening",
  14872. OPENED: "billboard.open",
  14873. CLOSING: "billboard.closing",
  14874. CLOSED: "billboard.closed",
  14875. ACTIVATING: "billboard.activating",
  14876. ACTIVATE: "billboard.activate"
  14877. })
  14878. }
  14879. , {}],
  14880. 121: [function(e, t, i) {
  14881. "use strict";
  14882. t.exports = Object.freeze({
  14883. animation: Object.freeze({
  14884. hoverOnClosing: !1,
  14885. openDelay: 100,
  14886. closeDelay: 50,
  14887. openDuration: 200,
  14888. closeDuration: 100
  14889. }),
  14890. boardToDiscRatio: 1.2
  14891. })
  14892. }
  14893. , {}],
  14894. 122: [function(e, t, i) {
  14895. "use strict";
  14896. t.exports = Object.freeze({
  14897. boundaryWidth: 30,
  14898. boundaryHeight: 0
  14899. })
  14900. }
  14901. , {}],
  14902. 123: [function(M, R, e) {
  14903. (function(e) {
  14904. "use strict";
  14905. function d(e, t, i) {
  14906. var n = i.version || "0";
  14907. "0" !== n && w.info("tag defined using version " + n),
  14908. this.model = e,
  14909. this.sid = t,
  14910. this.color = (new f.Color).set(i.color || o.tagDefault),
  14911. this.hoverColor = o._darken(this.color, .2),
  14912. this.floor = null,
  14913. this.floorIndex = i.floor,
  14914. this.mode = m.PANORAMA,
  14915. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14916. this.obj3d = null,
  14917. this.disc = null,
  14918. this.materials = {
  14919. disc: null,
  14920. pole: null
  14921. },
  14922. this.position = (new f.Vector3).copy(i.position),
  14923. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  14924. this.discWorldPosition = null,
  14925. this.discScale = .05,
  14926. this.poleEnabled = i.stem.enabled,
  14927. this.billboard = new r(i.label,i.description,i.media,this),
  14928. this.visibleTransition = null,
  14929. this.hoveringDisc = !1
  14930. }
  14931. 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"),
  14932. 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);
  14933. d.prototype = Object.create(b.prototype),
  14934. d.raycaster = new f.Raycaster,
  14935. d.prototype.bindEvents = function() {
  14936. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  14937. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  14938. }
  14939. ,
  14940. d.prototype.build = function() {
  14941. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  14942. this.floor && (this.billboard.build(this.model.sid),
  14943. this.obj3d = this.buildObject3D(),
  14944. this.floor.add(this.obj3d)),
  14945. this
  14946. }
  14947. ,
  14948. d.prototype.buildObject3D = function() {
  14949. var e = new f.Object3D;
  14950. e.position.copy(this.position);
  14951. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  14952. t.bg.value = x,
  14953. t.mask.value = T,
  14954. t.color.value.copy(this.color),
  14955. this.materials.disc = new f.RawShaderMaterial({
  14956. transparent: !0,
  14957. vertexShader: A.tagDisc.vertexShader,
  14958. fragmentShader: A.tagDisc.fragmentShader,
  14959. uniforms: t
  14960. }),
  14961. this.disc = new f.Mesh(S,this.materials.disc),
  14962. this.disc.layers.set(a.TAG),
  14963. this.disc.position.copy(this.discPosition),
  14964. this.disc.renderOrder = s.tagDisc;
  14965. var i = (this.disc.tag = this).buildPole();
  14966. return i.layers.set(a.TAG),
  14967. i.renderOrder = s.tagStem,
  14968. e.add(i),
  14969. e.layers.set(a.TAG),
  14970. e.add(this.disc)
  14971. }
  14972. ,
  14973. d.prototype.buildPole = function() {
  14974. var e = new f.BufferGeometry
  14975. , t = new Float32Array(6);
  14976. return t[0] = t[1] = t[2] = 0,
  14977. t[3] = this.discPosition.x,
  14978. t[4] = this.discPosition.y,
  14979. t[5] = this.discPosition.z,
  14980. e.addAttribute("position", new f.BufferAttribute(t,3)),
  14981. this.materials.pole = new f.LineBasicMaterial({
  14982. linewidth: g.tags.pole.width,
  14983. color: g.tags.pole.color,
  14984. opacity: 0,
  14985. visible: this.poleEnabled,
  14986. transparent: !0,
  14987. depthWrite: !1
  14988. }),
  14989. new f.Line(e,this.materials.pole)
  14990. }
  14991. ,
  14992. d.prototype.setFreeState = function(e) {
  14993. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  14994. this.materials.disc.uniforms.color.value = this.color
  14995. }
  14996. .bind(this))
  14997. }
  14998. ,
  14999. d.prototype.setHoverState = function(e) {
  15000. this.billboard.open(e),
  15001. this.materials.disc.uniforms.color.value = this.hoverColor
  15002. }
  15003. ,
  15004. d.prototype.hide = function(e, t) {
  15005. var i = $.Deferred();
  15006. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15007. return i.resolve().promise();
  15008. e = e || 0,
  15009. t = t || 0,
  15010. C.cancel(this.visibleTransition);
  15011. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15012. return this.visibleTransition = C.start((n = this,
  15013. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15014. o = I.property(n.materials.pole, "opacity", 0),
  15015. function(e) {
  15016. r(e),
  15017. n.materials.pole && o(e)
  15018. }
  15019. ), s * a, function() {
  15020. i.resolve()
  15021. }, l, E[g.warp.blendEasing]),
  15022. i.promise()
  15023. }
  15024. ,
  15025. d.prototype.show = function(e, t) {
  15026. var i = $.Deferred();
  15027. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15028. return i.resolve().promise();
  15029. e = e || 0,
  15030. t = t || 0,
  15031. C.cancel(this.visibleTransition);
  15032. 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;
  15033. return this.visibleTransition = C.start((n = this,
  15034. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15035. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15036. function(e) {
  15037. r(e),
  15038. n.materials.pole && o(e)
  15039. }
  15040. ), s * a, function() {
  15041. i.resolve()
  15042. }, l, E[g.warp.blendEasing]),
  15043. i.promise()
  15044. }
  15045. ,
  15046. d.prototype.closestPanoTowardTag = function(e, t) {
  15047. var i = []
  15048. , n = []
  15049. , r = this.disc.getWorldPosition();
  15050. if (e === m.PANORAMA) {
  15051. var o = t.position.clone().sub(r).normalize();
  15052. i.push(y.filters.isPanoAligned()),
  15053. i.push(y.filters.inPanoDirection(r, o, .5)),
  15054. i.push(y.filters.isNeighbourPanoTo(t)),
  15055. n.push(y.scoreFunctions.direction(r, o))
  15056. }
  15057. var a = new f.Vector3;
  15058. i.push(function(e) {
  15059. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15060. }, function(e) {
  15061. a.copy(r).sub(e.position);
  15062. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15063. , i = g.tags.navigate.tiltTolerance;
  15064. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15065. }),
  15066. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15067. var s = this.model.panos.sortByScore(i, n);
  15068. if (g.tags.navigate.lineOfSight) {
  15069. for (var l = 0; l < s.length; l++) {
  15070. var c = s[l].pano
  15071. , h = c.position.distanceTo(r);
  15072. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15073. return null;
  15074. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15075. var u = d.raycaster.intersectObjects(this.model.colliders);
  15076. if (0 === u.length || u[0].distance > h)
  15077. return c
  15078. }
  15079. return null
  15080. }
  15081. return 0 < s.length && s[0].pano
  15082. }
  15083. ,
  15084. d.prototype.examine = function(i) {
  15085. if(!player.currentPano)return;
  15086. var e = i.mode
  15087. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15088. , t = this.disc.getWorldPosition();
  15089. this.billboard.setActiveState();
  15090. var r = function() {
  15091. var e = this.billboard.getDimensions()
  15092. , t = new f.Vector3;
  15093. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15094. t.unproject(i.camera),
  15095. i.flyToPano({
  15096. pano: n,
  15097. lookAtPoint: t
  15098. })
  15099. }
  15100. .bind(this);
  15101. if (e === m.PANORAMA)
  15102. if (n !== i.currentPano) {
  15103. var o = {
  15104. pano: n,
  15105. lookAtPoint: t,
  15106. duration: null,
  15107. maxDistanceOverride: null,
  15108. skipWarpingCheck: !1
  15109. };
  15110. i.flyToPano(o, r)
  15111. } else
  15112. setTimeout(function() {
  15113. this.billboard.open().then(function() {
  15114. r()
  15115. })
  15116. }
  15117. .bind(this), 0);
  15118. else {
  15119. var a = {
  15120. pano: n
  15121. };
  15122. if (t) {
  15123. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15124. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15125. }
  15126. a.callback = r,
  15127. a.duration = 1500,
  15128. a.mode = m.PANORAMA,
  15129. i.flyToNewMode(a)
  15130. }
  15131. }
  15132. ,
  15133. d.prototype.update = (n = new f.Vector3,
  15134. function(e, t) {
  15135. this.discWorldPosition = this.disc.getWorldPosition(),
  15136. this.updateDisc(e, t),
  15137. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15138. n.z < 1 && (n.y *= -1,
  15139. this.billboard.update(n, this.getDiscRadius(n, t))))
  15140. }
  15141. ),
  15142. d.prototype.updateDisc = (l = new f.Vector3,
  15143. c = new f.Vector3,
  15144. h = new f.Vector3,
  15145. u = new f.Vector3,
  15146. p = new f.Vector3,
  15147. function(e, t) {
  15148. var i = g.tags.visibility
  15149. , n = g.tags.disc.scale
  15150. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15151. 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)),
  15152. this.obj3d.visible) {
  15153. this.disc.quaternion.copy(t.quaternion);
  15154. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15155. l.copy(this.discWorldPosition).project(t),
  15156. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15157. h.set(o / 2, 0, 0).add(c),
  15158. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15159. p.copy(u).unproject(t);
  15160. var a = p.distanceTo(this.discWorldPosition)
  15161. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15162. this.discScale = a * s,
  15163. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15164. }
  15165. }
  15166. ),
  15167. d.prototype.getDiscRadius = (i = new f.Vector3,
  15168. function(e, t) {
  15169. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15170. Math.abs(e.x - i.x) * $("#player").width()
  15171. }
  15172. ),
  15173. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15174. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15175. }
  15176. ,
  15177. d.prototype.offScreen = function(e, t) {
  15178. var i = e.getWorldPosition().project(t);
  15179. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15180. }
  15181. ,
  15182. d.viewportScale = function() {
  15183. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15184. d.viewportHeight = $("#player").height(),
  15185. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15186. d.currentViewportScale
  15187. }
  15188. ,
  15189. R.exports = d
  15190. }
  15191. ).call(this, "/js/tag/tag.js")
  15192. }
  15193. , {
  15194. "../enum/Colors": 19,
  15195. "../enum/RenderLayers": 41,
  15196. "../enum/RenderOrder": 42,
  15197. "../enum/Viewmode": 51,
  15198. "../objects/Panorama": 148,
  15199. "../settings": 166,
  15200. "../shaders": 167,
  15201. "../util/common": 185,
  15202. "../util/easing": 186,
  15203. "../util/lerp": 188,
  15204. "../util/logger": 189,
  15205. "../util/math": 190,
  15206. "../util/texture": 194,
  15207. "../util/transitions": 195,
  15208. "./Billboard/Billboard": 119,
  15209. "./Billboard/BillboardEvent": 120,
  15210. events: 202,
  15211. three: 217
  15212. }],
  15213. 124: [function(M, R, e) {
  15214. (function(e) {
  15215. "use strict";
  15216. function t() {
  15217. this.tagState = T.IDLE,
  15218. this.intersectTag = null,
  15219. this.hoveredTag = null,
  15220. this.activeTag = null,
  15221. this.tagDiscs = [],
  15222. this.raycaster = new i.Raycaster,
  15223. this.modelManager = null,
  15224. this.player = null,
  15225. this.totaltags = 0,
  15226. this.navigatingViaTag = !1,
  15227. this.enabled = !1
  15228. }
  15229. 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"),
  15230. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15231. r.extend(t, x),
  15232. t.prototype.init = function(e, t) {
  15233. this.modelManager = e,
  15234. this.player = t,
  15235. this.updateModel(),
  15236. this.bindEvents()
  15237. }
  15238. ,
  15239. t.prototype.update = function(e) {
  15240. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15241. }
  15242. ,
  15243. t.prototype.updateTags = function(e, t, i, n) {
  15244. for (var r in this.model.tags)
  15245. this.model.tags[r].update(e, t, i, n)
  15246. }
  15247. ,
  15248. t.prototype.updateModel = function() {
  15249. this.model = this.modelManager.getActiveModel(),
  15250. this.gettagsFromModel(),
  15251. this.totaltags = Object.keys(this.model.tags).length
  15252. }
  15253. ,
  15254. t.prototype.gettagsFromModel = function() {
  15255. for (var e in this.tagDiscs = [],
  15256. this.model.tags) {
  15257. var t = this.model.tags[e].disc;
  15258. t && this.tagDiscs.push(t)
  15259. }
  15260. }
  15261. ,
  15262. t.prototype.bindEvents = function() {
  15263. function e() {
  15264. Object.keys(this.model.tags).forEach(function(e) {
  15265. var t = this.model.tags[e];
  15266. t.bindEvents(),
  15267. t.billboard.on(y.LINK_CLICK, function(e) {
  15268. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15269. }
  15270. .bind(this)),
  15271. t.billboard.on(y.IMAGE_OPENED, function() {
  15272. this.tagState = T.EXAMINE,
  15273. this.emit(y.IMAGE_OPENED)
  15274. }
  15275. .bind(this)),
  15276. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15277. }
  15278. .bind(this))
  15279. }
  15280. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15281. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15282. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15283. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15284. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15285. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15286. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15287. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15288. e.call(this)
  15289. }
  15290. ,
  15291. t.prototype.navigateViaLink = function(e) {
  15292. var t = a.deserialize(e);
  15293. if (t)
  15294. if (t.mode === C.PANORAMA) {
  15295. try {
  15296. this.player.model.panos.get(t.panoId)
  15297. } catch (e) {
  15298. return void S.warn("Unable to find panorama location", t.panoId)
  15299. }
  15300. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15301. } else {
  15302. var i = {
  15303. cameraMode: t.mode,
  15304. position: t.position,
  15305. quaternion: t.quaternion,
  15306. scanId: t.panoId,
  15307. orthoZoom: t.zoom,
  15308. floorVisibility: t.floorVisibility,
  15309. thumbUrl: null,
  15310. name: null
  15311. };
  15312. this.player.flyToNewMode({
  15313. mode: t.mode,
  15314. duration: m.warp.outsideTime,
  15315. warpDest: new g(i),
  15316. force: !0
  15317. })
  15318. }
  15319. }
  15320. ,
  15321. t.prototype.handleWarpStart = function(e, t, i, n) {
  15322. this.dismissExaminedTag(),
  15323. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15324. e && (i = E.END),
  15325. this.hideShowTagsForBlackoutStyle(i, n))
  15326. }
  15327. ,
  15328. t.prototype.handleWarpInterruption = function(e, t, i) {
  15329. null != i || (i = m.warp.teleportTime),
  15330. this.hideShowTagsForBlackoutStyle(t, i)
  15331. }
  15332. ,
  15333. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15334. var i = 0
  15335. , n = 0
  15336. , r = t / 2;
  15337. switch (null != e || (e = E.MIDDLE),
  15338. e) {
  15339. case E.END:
  15340. this.hideAlltags(r);
  15341. break;
  15342. case E.BEGINNING:
  15343. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15344. break;
  15345. case E.NONE:
  15346. break;
  15347. case E.MIDDLE:
  15348. n = i = r,
  15349. this.hideAlltags(n),
  15350. setTimeout(function() {
  15351. this.showAlltags(i)
  15352. }
  15353. .bind(this), n);
  15354. break;
  15355. case E.FADEIN:
  15356. setTimeout(function() {
  15357. this.showAlltags(r)
  15358. }
  15359. .bind(this), r)
  15360. }
  15361. }
  15362. ,
  15363. t.prototype.onPlayerModeChanging = function(e, t) {
  15364. t !== C.PANORAMA && this.dismissExaminedTag(),
  15365. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15366. var i = t !== C.OUTDOOR;
  15367. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15368. }
  15369. ,
  15370. t.prototype.onPanoChange = function(e, t) {
  15371. var i = this.navigatingViaTag;
  15372. if (this.navigatingViaTag = !1,
  15373. !i) {
  15374. this.dismissExaminedTag();
  15375. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15376. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15377. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15378. }
  15379. }
  15380. ,
  15381. t.prototype.onPlayerReady = function(e, t, i) {
  15382. this.startAlltags(e, t ? i : null)
  15383. }
  15384. ,
  15385. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15386. this.updateClosestTags(e)
  15387. }
  15388. ,
  15389. t.prototype.dismissExaminedTag = function() {
  15390. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15391. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15392. this.hoveredTag = null)
  15393. }
  15394. ,
  15395. t.prototype.startAlltags = function(e, t) {
  15396. this.model.shouldShowtags = m.tags.enabled,
  15397. this.enabled = !0,
  15398. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15399. t && setTimeout(function() {
  15400. this.activateTag(this.model.getTagBySid(t))
  15401. }
  15402. .bind(this), m.tags.startup.fadeInDuration / 2))
  15403. }
  15404. ,
  15405. t.prototype.showAlltags = function(e, t, i) {
  15406. function n() {
  15407. ++o === this.totaltags && (this.model.tagsShown = !0,
  15408. r.resolve())
  15409. }
  15410. var r = $.Deferred();
  15411. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15412. return r.resolve().promise();
  15413. var o = 0;
  15414. for (var a in this.model.tags) {
  15415. this.model.tags[a].show(e, t).done(n.bind(this))
  15416. }
  15417. return r.promise()
  15418. }
  15419. ,
  15420. t.prototype.hideAlltags = function(e, t) {
  15421. function i() {
  15422. ++r === this.totaltags && (this.model.tagsShown = !1,
  15423. n.resolve())
  15424. }
  15425. var n = $.Deferred()
  15426. , r = 0;
  15427. for (var o in this.model.tags) {
  15428. var a = this.model.tags[o];
  15429. a.hide(e, t).done(i.bind(this)),
  15430. a === this.activeTag && this.dismissActiveTag()
  15431. }
  15432. return n.promise()
  15433. }
  15434. ,
  15435. t.prototype.enableHovering = function() {
  15436. this.enabled = !0
  15437. }
  15438. ,
  15439. t.prototype.disableHovering = function() {
  15440. this.enabled = !1
  15441. }
  15442. ,
  15443. t.prototype.activateTag = function(e, t) {
  15444. t = t || T.EXAMINE,
  15445. this.activeTag = e,
  15446. this.activeTag.hoveringDisc = !0,
  15447. this.activeTag.setHoverState(t === T.EXAMINE),
  15448. this.tagState = t,
  15449. this.emit(b.TagActivated, e)
  15450. }
  15451. ,
  15452. t.prototype.dismissActiveTag = function() {
  15453. this.activeTag.hoveringDisc = !1,
  15454. this.activeTag.setFreeState(!0);
  15455. var e = this.activeTag;
  15456. this.activeTag = null,
  15457. this.tagState = T.IDLE,
  15458. this.emit(b.TagDismissed, e)
  15459. }
  15460. ,
  15461. t.prototype.clickedOnTag = function(e) {
  15462. var t = function() {
  15463. this.navigatingViaTag = !0,
  15464. this.activeTag.examine(this.player),
  15465. this.emit(b.TagNavigation, this.activeTag)
  15466. }
  15467. .bind(this);
  15468. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15469. this.activeTag = this.intersectTag,
  15470. t(),
  15471. !0) : (this.dismissActiveTag(),
  15472. !1)
  15473. }
  15474. ,
  15475. t.prototype.intersecttag = (s = new i.Vector3,
  15476. l = new i.Vector3,
  15477. c = new i.Vector3,
  15478. function(e, t, i) {
  15479. if (!this.enabled)
  15480. return null;
  15481. var n = null
  15482. , r = this.tagDiscs.filter(function(e) {
  15483. return e.parent.visible
  15484. });
  15485. if (0 < r.length) {
  15486. var o = this.model.floors.reduce(function(e, t) {
  15487. return t.hidden ? e : e.concat(t.collider.children)
  15488. }, r);
  15489. s.set(e.x, e.y, -1).unproject(i),
  15490. l.set(e.x, e.y, 1).unproject(i),
  15491. c.copy(l).sub(s).normalize(),
  15492. this.raycaster.set(s, c);
  15493. var a = this.raycaster.intersectObjects(o);
  15494. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15495. }
  15496. return this.intersectTag = n,
  15497. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15498. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15499. this.hoveredTag = n
  15500. }
  15501. .bind(this)),
  15502. n.billboard.on(v.LEAVE, function() {
  15503. this.hoveredTag = null
  15504. }
  15505. .bind(this))),
  15506. this.activateTag(n, T.BROWSE))),
  15507. n
  15508. }
  15509. ),
  15510. t.prototype.rankedtagInDirection = (h = [],
  15511. u = [],
  15512. d = new i.Vector3,
  15513. p = new i.Vector3,
  15514. f = new i.Vector3,
  15515. function(e, t, i, n) {
  15516. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15517. var a = this.closesttags[o];
  15518. p.copy(a.position),
  15519. p.add(a.discPosition),
  15520. d.copy(t),
  15521. d.sub(p).negate(),
  15522. d.normalize();
  15523. var s = d.dot(n);
  15524. if (0 <= s && (f.copy(p),
  15525. f.project(i),
  15526. this.intersecttag(f, !1, i))) {
  15527. if (r >= h.length)
  15528. for (var l = 0; l < 64; l++)
  15529. h.push({
  15530. tag: a,
  15531. dot: s
  15532. });
  15533. var c = h[r];
  15534. c.tag = a,
  15535. c.dot = s,
  15536. c.position = math.projectPositionToCanvas(p, i),
  15537. u.push(c),
  15538. r++
  15539. }
  15540. }
  15541. return u.sort(function(e, t) {
  15542. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15543. }),
  15544. e < u.length ? u[e].tag : null
  15545. }
  15546. ),
  15547. t.prototype.updateClosestTags = (o = new i.Vector3,
  15548. function(e) {
  15549. this.closesttags || (this.closesttags = []),
  15550. this.closesttags.length = 0;
  15551. var t = this.model.tags;
  15552. if (t)
  15553. for (var i in t)
  15554. if (t.hasOwnProperty(i)) {
  15555. var n = t[i]
  15556. , r = n.position;
  15557. o.copy(e),
  15558. o.sub(r).negate(),
  15559. o.lengthSq() < 30 && this.closesttags.push(n)
  15560. }
  15561. }
  15562. ),
  15563. R.exports = t
  15564. }
  15565. ).call(this, "/js/tag/tagManager.js")
  15566. }
  15567. , {
  15568. "../controls/serializer": 14,
  15569. "../enum/BlackoutStyle": 18,
  15570. "../enum/tagEvents": 32,
  15571. "../enum/ModelManagerEvents": 33,
  15572. "../enum/PlayerEvents": 40,
  15573. "../enum/TagStates": 44,
  15574. "../enum/Viewmode": 51,
  15575. "../enum/WarpStyle": 52,
  15576. "../objects/Snapshot": 153,
  15577. "../settings": 166,
  15578. "../util/common": 185,
  15579. "../util/lerp": 188,
  15580. "../util/logger": 189,
  15581. "./Billboard/BillboardEvent": 120,
  15582. "./Media/LinkType": 130,
  15583. "./Media/MediaEvent": 131,
  15584. events: 202,
  15585. three: 217
  15586. }],
  15587. 125: [function(r, o, e) {
  15588. (function(e) {
  15589. "use strict";
  15590. function t() {
  15591. this.embedWrapper = null,
  15592. this.embedElement = null
  15593. }
  15594. var i = r("../../util/ajax")
  15595. , a = r("./mediaSettings")
  15596. , n = r("../../settings")
  15597. , s = new (r("../../util/logger"))(e);
  15598. t.prototype.createDomElement = function() {
  15599. return this.embedWrapper = document.createElement("div"),
  15600. this.embedWrapper.classList.add("tag-embed"),
  15601. this.embedWrapper.classList.add("hidden"),
  15602. this.embedWrapper
  15603. }
  15604. ,
  15605. t.prototype.load = function(e) {
  15606. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15607. return new Promise(function(r, o) {
  15608. i.get(t).then(function(e) {
  15609. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15610. this.embedWrapper.innerHTML = e.html;
  15611. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15612. if (this.embedWrapper.style.width = t + "px",
  15613. e.height) {
  15614. var i = e.height / e.width;
  15615. this.embedWrapper.style.height = t * i + "px"
  15616. }
  15617. this.embedElement = this.embedWrapper.firstChild;
  15618. var n = [];
  15619. try {
  15620. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15621. } catch (e) {
  15622. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15623. }
  15624. n.forEach(function(e) {
  15625. e.setAttribute("target", "_blank")
  15626. }),
  15627. this.embedElement.classList.add("hidden"),
  15628. this.embedWrapper.classList.remove("hidden"),
  15629. r()
  15630. } else
  15631. o("Not a valid embed")
  15632. }
  15633. .bind(this), function(e) {
  15634. o(e.response)
  15635. })
  15636. }
  15637. .bind(this))
  15638. }
  15639. ,
  15640. t.prototype.show = function() {
  15641. this.embedElement && this.embedElement.classList.remove("hidden")
  15642. }
  15643. ,
  15644. t.prototype.hide = function() {
  15645. this.embedElement && this.embedElement.classList.add("hidden")
  15646. }
  15647. ,
  15648. o.exports = t
  15649. }
  15650. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15651. }
  15652. , {
  15653. "../../settings": 166,
  15654. "../../util/ajax": 181,
  15655. "../../util/logger": 189,
  15656. "./mediaSettings": 132
  15657. }],
  15658. 126: [function(a, s, e) {
  15659. (function(e) {
  15660. "use strict";
  15661. function t(e) {
  15662. r.call(this),
  15663. this.options = e,
  15664. this.playerControls = null,
  15665. this.state = o.NOT_READY
  15666. }
  15667. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15668. Object.freeze({
  15669. NOT_READY: "player.not.ready",
  15670. CUED: "player.cued",
  15671. PLAYING: "player.playing",
  15672. PAUSED: "player.paused"
  15673. }));
  15674. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15675. return this.embedWrapper = document.createElement("div"),
  15676. this.embedWrapper.classList.add("tag-video"),
  15677. this.embedWrapper.classList.add("hidden"),
  15678. this.embedWrapper
  15679. }
  15680. ,
  15681. t.prototype.load = function(e) {
  15682. var t = function() {
  15683. function e(e) {
  15684. this.playerState = e
  15685. }
  15686. this.playerControls = new playerjs.Player(this.embedElement),
  15687. this.playerControls.on("ready", function(e) {
  15688. this.playerState = o.CUED,
  15689. this.options.startMuted && this.playerControls.mute()
  15690. }
  15691. .bind(this)),
  15692. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15693. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15694. this.playerControls.on("ended", function(e) {
  15695. this.playerControls.setCurrentTime(0),
  15696. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15697. }
  15698. .bind(this))
  15699. }
  15700. .bind(this);
  15701. return r.prototype.load.call(this, e).then(t.bind(this))
  15702. }
  15703. ,
  15704. t.prototype.play = (i = n.isMobile(),
  15705. function() {
  15706. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15707. }
  15708. ),
  15709. t.prototype.pause = function() {
  15710. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15711. }
  15712. ,
  15713. s.exports = t
  15714. }
  15715. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15716. }
  15717. , {
  15718. "../../util/browser": 182,
  15719. "../../util/logger": 189,
  15720. "./EmbedlyEmbed": 125
  15721. }],
  15722. 127: [function(t, i, e) {
  15723. (function(e) {
  15724. "use strict";
  15725. var r = t("../../util/ajax")
  15726. , o = new (t("./mediaSettings"),
  15727. t("../../util/logger"))(e)
  15728. , a = Promise.resolve();
  15729. i.exports.enqueue = function(i) {
  15730. function n() {}
  15731. return a = new Promise(function(e, t) {
  15732. a.catch(n).then(function() {
  15733. (o.debug("requesting file from embedly:", i.href),
  15734. r.get(i.href, {
  15735. responseType: i.responseType
  15736. }).then(function(e) {
  15737. return o.debug("requesting file finished:", i.href),
  15738. e
  15739. })).then(e, t)
  15740. })
  15741. }
  15742. )
  15743. }
  15744. }
  15745. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15746. }
  15747. , {
  15748. "../../util/ajax": 181,
  15749. "../../util/logger": 189,
  15750. "./mediaSettings": 132
  15751. }],
  15752. 128: [function(s, l, e) {
  15753. (function(e) {
  15754. "use strict";
  15755. function t() {
  15756. this.imageWrapper = null,
  15757. this.width = 0,
  15758. this.height = 0,
  15759. this.aspect = 1
  15760. }
  15761. var i = s("./MediaEvent")
  15762. , n = s("./EmbedlyQueue")
  15763. , r = s("events").EventEmitter
  15764. , o = s("../../util/logger")
  15765. , a = s("../../settings");
  15766. new o(e),
  15767. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15768. return this.imageWrapper = document.createElement("div"),
  15769. this.imageWrapper.classList.add("tag-image"),
  15770. this.imageWrapper.classList.add("hidden"),
  15771. this.imageWrapper.addEventListener("click", function(e) {
  15772. e.stopPropagation(),
  15773. this.emit(i.IMAGE_OPENING),
  15774. this.imageWrapper.style.pointerEvents = "none"
  15775. }
  15776. .bind(this)),
  15777. this.imageWrapper
  15778. }
  15779. ,
  15780. t.prototype.onClosed = function() {
  15781. this.imageWrapper.style.pointerEvents = "auto"
  15782. }
  15783. ,
  15784. t.prototype.load = function(e) {
  15785. var t = Math.max(window.screen.height, window.screen.width)
  15786. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15787. return new Promise(function(o, e) {
  15788. n.enqueue({
  15789. href: i,
  15790. responseType: "arraybuffer"
  15791. }).then(function(e) {
  15792. var t = new Uint8Array(e)
  15793. , i = new Blob([t])
  15794. , n = new window.Image;
  15795. n.addEventListener("load", function(e) {
  15796. var t = e.target;
  15797. this.width = t.naturalWidth,
  15798. this.height = t.naturalHeight,
  15799. this.aspect = this.width / this.height;
  15800. var i = e.target.src;
  15801. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15802. this.imageWrapper.style.width = this.width + "px",
  15803. this.imageWrapper.style.height = this.height + "px",
  15804. this.imageWrapper.classList.remove("hidden"),
  15805. o()
  15806. }
  15807. .bind(this));
  15808. var r = URL.createObjectURL(i);
  15809. n.src = r
  15810. }
  15811. .bind(this), e)
  15812. }
  15813. .bind(this))
  15814. }
  15815. ,
  15816. l.exports = t
  15817. }
  15818. ).call(this, "/js/tag/Media/Image.js")
  15819. }
  15820. , {
  15821. "../../settings": 166,
  15822. "../../util/logger": 189,
  15823. "./EmbedlyQueue": 127,
  15824. "./MediaEvent": 131,
  15825. events: 202
  15826. }],
  15827. 129: [function(e, t, i) {
  15828. "use strict";
  15829. function n(e) {
  15830. this.label = e.label,
  15831. this.href = e.url,
  15832. this.type = this.updateLinkForType(),
  15833. this.domElement = null,
  15834. this.id = c++
  15835. }
  15836. var r = e("./LinkType")
  15837. , o = e("./MediaEvent")
  15838. , a = e("../../util/browser")
  15839. , s = e("../../analytics")
  15840. , l = e("events").EventEmitter
  15841. , c = 0;
  15842. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15843. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15844. 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,
  15845. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15846. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15847. r.MODEL) : r.EXT_LINK
  15848. }
  15849. ;
  15850. var h = {};
  15851. n.prototype.createDomElement = function() {
  15852. if (this.domElement = document.createElement("a"),
  15853. this.domElement.classList.add("tag-link"),
  15854. this.domElement.textContent = this.label,
  15855. this.type === r.EXT_LINK) {
  15856. this.domElement.textContent += " ";
  15857. var e = document.createElement("i");
  15858. e.classList.add("icon-ext-link"),
  15859. e.title = "Link to external web site",
  15860. this.domElement.appendChild(e)
  15861. }
  15862. return this.domElement.addEventListener("click", function(e) {
  15863. switch (e.stopPropagation(),
  15864. h[this.id] = !0,
  15865. s.trackAlways("click_tag_link", {
  15866. link_type: this.type,
  15867. link_count: c,
  15868. links_clicked: Object.keys(h).length
  15869. }),
  15870. this.type) {
  15871. case r.MODEL:
  15872. window.location.replace(this.href);
  15873. break;
  15874. case r.EXT_LINK:
  15875. window.open(this.href, "_blank")
  15876. }
  15877. this.emit(o.LINK_CLICK, {
  15878. type: this.type,
  15879. url: this.href
  15880. })
  15881. }
  15882. .bind(this)),
  15883. this.domElement
  15884. }
  15885. ,
  15886. t.exports = n
  15887. }
  15888. , {
  15889. "../../analytics": 4,
  15890. "../../util/browser": 182,
  15891. "./LinkType": 130,
  15892. "./MediaEvent": 131,
  15893. events: 202
  15894. }],
  15895. 130: [function(e, t, i) {
  15896. "use strict";
  15897. t.exports = {
  15898. NAVIGATION: "navigation",
  15899. MODEL: "model",
  15900. EXT_LINK: "ext-link"
  15901. }
  15902. }
  15903. , {}],
  15904. 131: [function(e, t, i) {
  15905. "use strict";
  15906. t.exports = Object.freeze({
  15907. LINK_CLICK: "mtmedia.link",
  15908. IMAGE_LOADED: "mtmedia.image.loaded",
  15909. IMAGE_OPENING: "mtmedia.image.opening",
  15910. IMAGE_OPENED: "mtmedia.image.opened",
  15911. IMAGE_CLOSING: "mtmedia.image.closing",
  15912. IMAGE_CLOSED: "mtmedia.image.closed",
  15913. VIDEO_START: "mtmedia.video.start",
  15914. VIDEO_PAUSE: "mtmedia.video.pause",
  15915. VIDEO_ENDED: "mtmedia.video.end"
  15916. })
  15917. }
  15918. , {}],
  15919. 132: [function(e, t, i) {
  15920. "use strict";
  15921. t.exports = Object.freeze({
  15922. maxEmbedWidth: 350,
  15923. defaultAspectRatio: .75
  15924. })
  15925. }
  15926. , {}],
  15927. 133: [function(e, t, i) {
  15928. "use strict";
  15929. t.exports = Object.freeze({
  15930. TEXT: "text",
  15931. LINK: "link",
  15932. IMAGE: "photo",
  15933. VIDEO: "video",
  15934. RICH: "rich"
  15935. })
  15936. }
  15937. , {}],
  15938. 134: [function(e, t, i) {
  15939. "use strict";
  15940. function n(e) {
  15941. this.capabilities = {
  15942. links: {
  15943. enable: e.supportLinks,
  15944. keepLabels: e.keepLinkLabels
  15945. }
  15946. }
  15947. }
  15948. var r = e("./DescriptionChunkType");
  15949. n.prototype.parse = function(e, i) {
  15950. var n = [];
  15951. return e.split("[").map(function(e, t) {
  15952. return 0 === t ? e : "[" + e
  15953. }).forEach(function(e) {
  15954. var t = this.findMarkdown(e);
  15955. if (t) {
  15956. if (-1 !== t.url.indexOf("javascript:"))
  15957. return;
  15958. this.addLinkChunk(n, t, i),
  15959. this.addTextChunk(n, e.slice(t.markdown.length))
  15960. } else
  15961. this.addTextChunk(n, e)
  15962. }
  15963. .bind(this)),
  15964. n
  15965. }
  15966. ,
  15967. n.prototype.findMarkdown = function(e) {
  15968. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  15969. if (t) {
  15970. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  15971. 0 !== n); )
  15972. r++;
  15973. var o = i.length - r;
  15974. return {
  15975. markdown: t[0].substring(0, t[0].length - o),
  15976. label: t[1],
  15977. url: t[2].substring(0, r)
  15978. }
  15979. }
  15980. }
  15981. ,
  15982. n.prototype.addTextChunk = function(e, t) {
  15983. 0 !== t.length && e.push({
  15984. type: r.TEXT,
  15985. text: t
  15986. })
  15987. }
  15988. ,
  15989. n.prototype.addLinkChunk = function(e, t) {
  15990. if (this.capabilities.links.enable) {
  15991. var i = {
  15992. label: t.label,
  15993. url: t.url
  15994. };
  15995. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  15996. e.push({
  15997. type: r.LINK,
  15998. link: i
  15999. })
  16000. } else
  16001. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16002. }
  16003. ,
  16004. t.exports = n
  16005. }
  16006. , {
  16007. "./DescriptionChunkType": 133
  16008. }],
  16009. 135: [function(t, r, e) {
  16010. (function(e) {
  16011. "use strict";
  16012. var i = new (t("../util/logger"))(e)
  16013. , n = {
  16014. parseIdsFromChunkName: function(e, t) {
  16015. t.floorId = n.parseFloor(e),
  16016. t.roomId = n.parseRoom(e)
  16017. },
  16018. parseFloor: function(e) {
  16019. var t = e.match(/_group([0-9]+)/);
  16020. if (!t)
  16021. return 0;
  16022. try {
  16023. return parseInt(t[1], 10)
  16024. } catch (e) {
  16025. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16026. 0
  16027. }
  16028. },
  16029. parseRoom: function(e) {
  16030. var t = e.match(/_sub([0-9]+)/);
  16031. if (!t)
  16032. return -1;
  16033. try {
  16034. return parseInt(t[1], 10)
  16035. } catch (e) {
  16036. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16037. 0
  16038. }
  16039. }
  16040. };
  16041. r.exports = n
  16042. }
  16043. ).call(this, "/js/model/Chunks.js")
  16044. }
  16045. , {
  16046. "../util/logger": 189
  16047. }],
  16048. 136: [function(a, c, e) {
  16049. (function(e) {
  16050. "use strict";
  16051. function t(e) {
  16052. r.call(this),
  16053. this.model = e,
  16054. this.exploded = !1
  16055. }
  16056. var i = a("../objects/Floor")
  16057. , n = (a("../settings"),
  16058. a("../util/logger"))
  16059. , s = a("../util/transitions")
  16060. , r = a("../util/IndexedCollection")
  16061. , o = a("../util/common")
  16062. , l = a("../util/easing");
  16063. new n(e),
  16064. o.inherit(t, r),
  16065. t.prototype.add = function(e) {
  16066. r.prototype.add.call(this, e),
  16067. this.model.add(e)
  16068. }
  16069. ,
  16070. t.prototype.getIndex = function(e) {
  16071. return e.floorIndex
  16072. }
  16073. ,
  16074. t.prototype.build = function() {
  16075. this.list.forEach(function(e) {
  16076. e.build()
  16077. })
  16078. }
  16079. ,
  16080. t.prototype.size = function() {
  16081. return this.length
  16082. }
  16083. ,
  16084. t.prototype.sort = function() {
  16085. r.prototype.sort.call(this, function(e, t) {
  16086. return e.floorIndex - t.floorIndex
  16087. })
  16088. }
  16089. ,
  16090. t.prototype.nextFloor = function(e, t) {
  16091. return this.index[e.floorIndex + t] || null
  16092. }
  16093. ,
  16094. t.prototype.getFloorAtPoint = function(e) {
  16095. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16096. var r = this.list[n]
  16097. , o = r.distanceToPoint(e);
  16098. (!t || o < i) && (i = o,
  16099. t = r)
  16100. }
  16101. return t
  16102. }
  16103. ,
  16104. t.prototype.getOrMakeFloor = function(e) {
  16105. var t = this.index[e];
  16106. return t || (t = new i(this.model,e),
  16107. this.add(t)),
  16108. t
  16109. }
  16110. ,
  16111. t.prototype.hide = function() {
  16112. this.list.forEach(function(e) {
  16113. e.hide()
  16114. })
  16115. }
  16116. ,
  16117. t.prototype.show = function() {
  16118. this.list.forEach(function(e) {
  16119. e.show()
  16120. })
  16121. }
  16122. ,
  16123. t.prototype.names = function() {
  16124. return this.list.reduce(function(e, t) {
  16125. return e.concat(t.name)
  16126. }, [])
  16127. }
  16128. ,
  16129. t.prototype.toggleExplodeHorizontal = function() {
  16130. function i(e, t) {
  16131. a.copy(e.position),
  16132. e.position.x = r[e.floorIndex] * t,
  16133. e.position.y = 1 * e.floorIndex * t,
  16134. a.sub(e.position).multiplyScalar(-1),
  16135. e.panos.forEach(function(e) {
  16136. e.translate(a)
  16137. })
  16138. }
  16139. var n, r = [], o = 0;
  16140. this.list.forEach(function(e, t, i) {
  16141. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16142. o += n,
  16143. r[t] = o
  16144. }),
  16145. r = r.map(function(e) {
  16146. return e - o / 2
  16147. });
  16148. var a = this.list[0].position.clone();
  16149. this.exploded ? this.list.forEach(function(t) {
  16150. s.start(function(e) {
  16151. i(t, 1 - e)
  16152. }, 1500, null, 0, l.easeOutExpo)
  16153. }) : this.list.forEach(function(t) {
  16154. s.start(function(e) {
  16155. i(t, e)
  16156. }, 1500, null, 0, l.easeOutExpo)
  16157. }),
  16158. this.exploded = !this.exploded
  16159. }
  16160. ,
  16161. t.prototype.toggleExplodeVertical = function() {
  16162. function i(e, t) {
  16163. var i = i.copy(e.position);
  16164. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16165. i.sub(e.position).multiplyScalar(-1),
  16166. e.panos.forEach(function(e) {
  16167. e.translate(i)
  16168. })
  16169. }
  16170. var n = this.model.size;
  16171. this.list[0].position.clone(),
  16172. this.exploded ? this.list.forEach(function(t) {
  16173. s.start(function(e) {
  16174. i(t, 1 - e)
  16175. }, 1500, null, 0, l.easeOutExpo)
  16176. }) : this.list.forEach(function(t) {
  16177. s.start(function(e) {
  16178. i(t, e)
  16179. }, 1500, null, 0, l.easeOutExpo)
  16180. }),
  16181. this.exploded = !this.exploded
  16182. }
  16183. ,
  16184. c.exports = t
  16185. }
  16186. ).call(this, "/js/model/FloorCollection.js")
  16187. }
  16188. , {
  16189. "../objects/Floor": 146,
  16190. "../settings": 166,
  16191. "../util/IndexedCollection": 175,
  16192. "../util/common": 185,
  16193. "../util/easing": 186,
  16194. "../util/logger": 189,
  16195. "../util/transitions": 195
  16196. }],
  16197. 137: [function(r, o, e) {
  16198. (function(e) {
  16199. "use strict";
  16200. function h() {
  16201. n.call(this)
  16202. }
  16203. var u = r("../settings")
  16204. , t = r("../util/logger")
  16205. , d = r("../enum/Viewmode")
  16206. , p = r("../objects/Snapshot")
  16207. , i = (r("../util/math"),
  16208. r("../util/common"))
  16209. , n = r("../util/IndexedCollection")
  16210. , l = new t(e);
  16211. i.inherit(h, n),
  16212. h.prototype.getImage = function(e) {
  16213. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16214. }
  16215. ,
  16216. h.prototype.filterByModesAndReel = function(e, t) {
  16217. for (var i = [], n = 0; n < t.length; n += 1) {
  16218. var r = t[n]
  16219. , o = this.index[r.sid];
  16220. o && i.push(o)
  16221. }
  16222. var a = e[d.DOLLHOUSE]
  16223. , s = e[d.FLOORPLAN];
  16224. (i = i.filter(function(e) {
  16225. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16226. return !0;
  16227. var t;
  16228. try {
  16229. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16230. } catch (e) {
  16231. return l.debug(e.message),
  16232. !1
  16233. }
  16234. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16235. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16236. this.list = i,
  16237. this.reIndex()
  16238. }
  16239. ,
  16240. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16241. if (0 === this.list.length)
  16242. return [];
  16243. var locations = [];
  16244. var deal = (n, container)=>{
  16245. var r = n.thumbnail_signed_src,
  16246. o = n.name || "";
  16247. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16248. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16249. var a = panos.get(n.metadata.scan_id);
  16250. if (a && !a.isAligned()) return
  16251. }
  16252. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16253. if (s === d.MESH) return
  16254. if(window.isLocal)var src = manage.dealURL(r)
  16255. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16256. var l = {
  16257. cameraMode: s,
  16258. position: n.metadata.camera_position,
  16259. quaternion: n.metadata.camera_quaternion,
  16260. zoom: n.metadata.zoom,
  16261. panoId: n.metadata.scan_id,
  16262. orthoZoom: n.metadata.ortho_zoom,
  16263. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16264. thumbUrl: src,
  16265. name: h.filterImageName(o),
  16266. sid: n.sid
  16267. }
  16268. var item = new p(l);
  16269. item.momentTour = n.momentTour
  16270. item.dontRot = n.dontRot
  16271. item.rotTime = n.rotTime
  16272. container.push(item)
  16273. return item
  16274. }
  16275. }
  16276. this.list.forEach(image=>{
  16277. if(image.images){
  16278. var folder = $.extend({}, image )
  16279. folder.heroLocations = [];
  16280. image.images.list.forEach(child=>{
  16281. deal(child, folder.heroLocations);
  16282. })
  16283. folder.musicInfo = folder.musicInfo || {}
  16284. locations.push(folder)
  16285. delete folder.images;
  16286. delete folder.locations;
  16287. }else{
  16288. var item = deal(image, locations);
  16289. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16290. }
  16291. })
  16292. return locations
  16293. }
  16294. ,
  16295. h.prototype.getIndex = function(e) {
  16296. return e.sid
  16297. }
  16298. ,
  16299. h.filterImageName = function(e) {
  16300. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16301. }
  16302. ,
  16303. o.exports = h
  16304. }
  16305. ).call(this, "/js/model/ImageCollection.js")
  16306. }
  16307. , {
  16308. "../enum/Viewmode": 51,
  16309. "../objects/Snapshot": 153,
  16310. "../settings": 166,
  16311. "../util/IndexedCollection": 175,
  16312. "../util/common": 185,
  16313. "../util/logger": 189,
  16314. "../util/math": 190
  16315. }],
  16316. 138: [function(h, u, e) {
  16317. (function(e) {
  16318. "use strict";
  16319. function n() {
  16320. c.call(this)
  16321. }
  16322. var r = h("../label/Label")
  16323. , i = h("../settings")
  16324. , t = h("../util/logger")
  16325. , o = h("../util/math")
  16326. , a = h("../util/ajax")
  16327. , s = h("./RoomCollection")
  16328. , l = h("../util/common")
  16329. , c = h("../util/IndexedCollection");
  16330. new t(e),
  16331. l.inherit(n, c),
  16332. n.prototype.getIndex = function(e) {
  16333. return e.labelId
  16334. }
  16335. ,
  16336. n.prototype.associateWithRooms = function(e) {
  16337. this.forEach(function(t) {
  16338. e.forEach(function(e) {
  16339. e.roomId === t.roomId && (t.room = e)
  16340. })
  16341. })
  16342. }
  16343. ,
  16344. n.prototype.createFromLabelData = function(e) {
  16345. e.forEach(function(e) {
  16346. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16347. t = s.generateRoomId(e.floorId, t);
  16348. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16349. i.position = o.convertWorkshopVector(i.position),
  16350. this.add(i),
  16351. i.build()
  16352. }
  16353. .bind(this))
  16354. }
  16355. ,
  16356. n.prototype.load = function(e, t) {
  16357. return a.get(e, {
  16358. responseType: "json",
  16359. auth: t ? i.authorizationHeader : null
  16360. }).done(function(e) {
  16361. var t = [];
  16362. for (var i in e) {
  16363. var n = e[i];
  16364. t.push(n)
  16365. }
  16366. this.createFromLabelData(t)
  16367. }
  16368. .bind(this))
  16369. }
  16370. ,
  16371. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16372. var t = -1;
  16373. if (e) {
  16374. if(typeof e == 'number'){
  16375. t = parseInt(e)
  16376. }else{
  16377. var i = e.split("_");
  16378. t = parseInt(i[0])
  16379. }
  16380. }
  16381. return t
  16382. }
  16383. ,
  16384. u.exports = n
  16385. }
  16386. ).call(this, "/js/model/LabelCollection.js")
  16387. }
  16388. , {
  16389. "../label/Label": 90,
  16390. "../settings": 166,
  16391. "../util/IndexedCollection": 175,
  16392. "../util/ajax": 181,
  16393. "../util/common": 185,
  16394. "../util/logger": 189,
  16395. "../util/math": 190,
  16396. "./RoomCollection": 141
  16397. }],
  16398. 139: [function(P, O, e) {
  16399. (function(e) {
  16400. "use strict";
  16401. function t(e, t) {
  16402. o.Object3D.call(this),
  16403. this.sid = window.number;//t.sid,
  16404. this.data = t,
  16405. this.options = e,
  16406. this.urls = new i(e.urlFiles),
  16407. this.isPublic = void 0 !== t.is_public && t.is_public,
  16408. //创建heroLocations
  16409. this.images = new E(this),
  16410. this.images.extend(t.images),
  16411. this.images.forEach((info)=>{
  16412. if(info.locations){
  16413. info.images = new E(this);
  16414. info.images.extend(info.locations)
  16415. }
  16416. })
  16417. this.heroLocations = []
  16418. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16419. this.outdoorPanoLocations = [],
  16420. this.floors = new c(this),
  16421. this.floorsEnabled = void 0 === e.floors || e.floors,
  16422. this.changingFloor = !1,
  16423. this.chunks = [],
  16424. this.panos = new g,
  16425. this.colliders = [],
  16426. this.loadPanosPromise = null,
  16427. this.loadMeshTexturesPromise = null,
  16428. this.auxDataPromise = null,
  16429. this.meshTexturesLoaded = !1,
  16430. this.meshTextures = [],
  16431. this.tags = {},
  16432. this.tagsShown = !1,
  16433. this.shouldShowtags = !1,
  16434. this.has360Views = !1,
  16435. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16436. this.supportedModes = {},
  16437. this.supportedModes[s.PANORAMA] = !0,
  16438. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16439. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16440. this.supportedModes[s.TRANSITIONING] = !0,
  16441. this.supportsTiles = this.configureTiling(),
  16442. this.supportsVR = window.DATA.supportsVR || false//!0,
  16443. this.mode = s.DOLLHOUSE,
  16444. this.size = null,
  16445. this.center = null,
  16446. this.boundingBox = new o.Box3,
  16447. this.currentFloor = null,
  16448. this.allFloorsVisible = !0,
  16449. this.projectedPano0 = null,
  16450. this.projectedPano1 = null,
  16451. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16452. this.addFloor(new r(this,t,e.trim()))
  16453. }
  16454. .bind(this)),
  16455. this.waitQueue = [],
  16456. this.on("load", function(e) {
  16457. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16458. return !e.isLoadedCallback()
  16459. }),
  16460. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16461. }
  16462. .bind(this)),
  16463. this.setupCustomProperties(),
  16464. this.hots = {}
  16465. }
  16466. var o = P("three")
  16467. , a = P("../util/ajax")
  16468. , i = P("../util/ModelUrls")
  16469. , n = P("../objects/BoundingTextureSkybox")
  16470. , s = P("../enum/Viewmode")
  16471. , l = P("../enum/RenderOrder")
  16472. , r = (P("../enum/AlignmentType"),
  16473. P("../objects/Floor"))
  16474. , c = P("./FloorCollection")
  16475. , h = P("../objects/Chunk")
  16476. , u = (P("../objects/Room"),
  16477. P("../objects/Snapshot"),
  16478. P("../label/Label"),
  16479. P("../util/math"),
  16480. P("../settings"))
  16481. , d = P("../shaders")
  16482. , p = P("../util/logger")
  16483. , f = (P("../tag/tag"),
  16484. P("../tag/tagManager"),
  16485. P("../objects/Panorama"))
  16486. , g = P("../util/PanoramaCollection")
  16487. , m = P("../loaders/ModelLoader")
  16488. , v = P("../loaders/ModelTextureLoader")
  16489. , y = P("../loaders/SweepDataLoader")
  16490. , A = P("../util/transitions")
  16491. , C = (P("../util/easing"),
  16492. P("../util/lerp"),
  16493. P("../util/common"))
  16494. , I = (P("../util/texture"),
  16495. P("./../util/browser"))
  16496. , E = P("./ImageCollection")
  16497. , _ = P("./RoomCollection")
  16498. , b = P("./LabelCollection")
  16499. , w = P("./Chunks")
  16500. , T = P("./../util/showcase")
  16501. , x = P("../exception/BasicException")
  16502. , S = (P("../constants"),
  16503. P("events").EventEmitter)
  16504. // , M = P("hot")
  16505. , R = new p(e);
  16506. t.prototype = Object.create(o.Object3D.prototype),
  16507. C.extend(t, S),
  16508. t.prototype.setupCustomProperties = function() {
  16509. var t = u.modelAlpha;
  16510. Object.defineProperty(this, "alpha", {
  16511. get: function() {
  16512. return t
  16513. },
  16514. set: function(e) {
  16515. t = e,
  16516. this.chunks.forEach(function(e) {
  16517. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16518. })
  16519. }
  16520. })
  16521. }
  16522. ,
  16523. t.prototype.configureTiling = function() {
  16524. var e = function() {
  16525. try {
  16526. var e = document.createElement("canvas")
  16527. , t = e.getContext("webgl");
  16528. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16529. } catch (e) {
  16530. return 0
  16531. }
  16532. }();
  16533. if (e < 2048)
  16534. return !1;
  16535. R.warn("Max cube texture size: " + e);
  16536. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16537. var i = u.tiling.tilingFlagNames[t];
  16538. if ("1" === I.valueFromHash(i, null))
  16539. return !0;
  16540. if ("0" === I.valueFromHash(i, null))
  16541. return !1
  16542. }
  16543. return !!T.modelDataPromisesTiles(this.data)
  16544. }
  16545. ,
  16546. t.prototype.toggleAlpha = function() {
  16547. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16548. }
  16549. ,
  16550. t.prototype.load = function(e) {
  16551. var t = this.urls.init().then(function() {
  16552. return $.when(this.loadPanos(), this.loadMesh())
  16553. }
  16554. .bind(this));
  16555. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16556. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16557. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16558. }
  16559. ,
  16560. t.prototype.loadMesh = function() {
  16561. var n = $.Deferred()
  16562. , r = this;
  16563. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16564. if (0 === e.length) {
  16565. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16566. r.supportedModes[s.DOLLHOUSE] = !1,
  16567. r.supportedModes[s.FLOORPLAN] = !1;
  16568. var i = new h({
  16569. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16570. });
  16571. i.material.visible = !1,
  16572. i.rotateX(-Math.PI / 2),
  16573. i.geometry.computeBoundingBox(),
  16574. e = [i]
  16575. }
  16576. e.forEach(function(e) {
  16577. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16578. r.addChunk(t, e)
  16579. }),
  16580. r.floors.sort(),
  16581. n.resolve(r)
  16582. }, function(e, t) {
  16583. n.notify(e, t)
  16584. }, function(e) {
  16585. R.error(e),
  16586. n.reject("loading-failed")
  16587. }),
  16588. n.promise()
  16589. }
  16590. ,
  16591. t.prototype.loadMeshTextures = function() {
  16592. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16593. this.meshTexturesLoaded = !0
  16594. }
  16595. .bind(this))),
  16596. this.loadTexturesPromise
  16597. }
  16598. ,
  16599. t.prototype.loadhots = function() {
  16600. initHot(this)
  16601. var r = $.Deferred()
  16602. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16603. return a.get(e, {
  16604. responseType: "json",
  16605. auth: this.isPublic ? null : u.authorizationHeader
  16606. }).done(function(e) {
  16607. window.data2 = e;
  16608. editTool.loadDone('data2', e)
  16609. if(!e){
  16610. console.error("data2 is null")
  16611. }else{
  16612. g_data2 = hotMatcher(e)
  16613. this.hotsCount = 0;
  16614. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16615. //window.hotData = {}
  16616. /* if(e.hots){
  16617. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16618. sids.forEach((sid)=>{
  16619. this.hotsCount++,
  16620. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16621. //e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16622. //this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16623. window.hotData[sid] = e.hots[sid];
  16624. })
  16625. }*/
  16626. if(e.hots){
  16627. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16628. sids.forEach((sid)=>{
  16629. e.hots[sid].sid = sid
  16630. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  16631. })
  16632. }
  16633. if(e.overlays){
  16634. e.overlays.forEach((info)=>{
  16635. new Hot(info, 'byOverlay')
  16636. })
  16637. }
  16638. Hot.createHotList();
  16639. /* if(e.multiOverlays){
  16640. e.multiOverlays.forEach((info)=>{
  16641. new Hot(info)
  16642. })
  16643. }) */
  16644. Hot.startLoad()
  16645. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16646. }
  16647. r.resolve()
  16648. }
  16649. .bind(this)).fail(function() {
  16650. console.log("没有热点"),
  16651. editTool.loadDone('data2', null)
  16652. r.resolve()
  16653. }),
  16654. r
  16655. }
  16656. ,
  16657. t.prototype.loadPanos = function() {
  16658. if (this.loadPanosPromise)
  16659. return this.loadPanosPromise;
  16660. var e = new y(this);
  16661. return this.loadPanosPromise = e.load().then(function(e) {
  16662. window.panoListOriData = e.map(a=>a.uuid) //包括!enabled的点
  16663. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16664. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16665. else console.log(e.uuid)
  16666. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16667. }
  16668. .bind(this))),
  16669. this.panos.extend(e.map(function(e) {
  16670. return new f(this,e.uuid,e,this.supportsTiles)
  16671. }
  16672. .bind(this))),
  16673. this.panos.forEach(function(i) {
  16674. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16675. var t = this.panos.get(e);
  16676. t && this.panos.setNeighbour(i, t, !0)
  16677. }
  16678. .bind(this)),
  16679. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16680. }
  16681. .bind(this)),
  16682. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16683. this.supportedModes[s.PANORAMA] = !1),
  16684. $.when(this)
  16685. }
  16686. .bind(this)),
  16687. this.loadPanosPromise
  16688. }
  16689. ,
  16690. t.prototype.loadHighlightReel = function() {
  16691. var t = $.Deferred()
  16692. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16693. return a.get(e, {
  16694. responseType: "json",
  16695. auth: this.isPublic ? null : u.authorizationHeader
  16696. }).done(function(e) {
  16697. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16698. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16699. t.resolve()
  16700. }
  16701. .bind(this)).fail(function() {
  16702. R.warn("Getting highlight reel failed, no highlights available"),
  16703. t.resolve()
  16704. }),
  16705. t
  16706. }
  16707. ,
  16708. t.prototype.waitForLoad = function(e, t) {
  16709. t() || (this.waitQueue.push({
  16710. object: e,
  16711. isLoadedCallback: t
  16712. }),
  16713. 1 === this.waitQueue.length && this.emit("waiting"))
  16714. }
  16715. ,
  16716. t.prototype.hide = function() {
  16717. this.floors.hide()
  16718. }
  16719. ,
  16720. t.prototype.show = function() {
  16721. this.floors.show()
  16722. }
  16723. ,
  16724. t.prototype.floorNames = function() {
  16725. return this.floors.names()
  16726. }
  16727. ,
  16728. t.prototype.warpDestFloors = function(e, t) {
  16729. if (e && this.floors.length === e.length) {
  16730. var i = e.findIndex(function(e) {
  16731. return e
  16732. }
  16733. .bind(this));
  16734. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16735. } else
  16736. this.toggleAllFloors(!0)
  16737. }
  16738. ,
  16739. t.prototype.setFloor = function(e, t, i) {
  16740. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16741. this.allFloorsVisible = !1,
  16742. this._setFloor(e, t, i)
  16743. }
  16744. ,
  16745. t.prototype.toggleAllFloors = function(e) {
  16746. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16747. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16748. this._setFloor(this.currentFloor)
  16749. }
  16750. ,
  16751. t.prototype._setFloor = function(e, t, i) {
  16752. var n;
  16753. if (t = t || this.mode,
  16754. this.emit("floor.changed", e, t, this.currentFloor),
  16755. this.currentFloor = e,
  16756. t === s.PANORAMA) {
  16757. if (this.show(),
  16758. this.shouldShowtags && this.tagsShown)
  16759. for (n in this.tags)
  16760. this.tags[n].show(u.showFloorDuration)
  16761. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16762. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16763. }
  16764. .bind(this)),
  16765. this.shouldShowtags && this.tagsShown))
  16766. for (n in this.tags) {
  16767. var r = this.tags[n];
  16768. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16769. }
  16770. var o = this
  16771. , a = e;
  16772. A.start(function() {}, u.showFloorDelay, function() {
  16773. o.floors.forEach(function(t) {
  16774. t.chunks.forEach(function(e) {
  16775. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16776. })
  16777. })
  16778. }
  16779. .bind(this))
  16780. }
  16781. ,
  16782. t.prototype.toggleExplode = function() {
  16783. this.floors.toggleExplodeHorizontal()
  16784. }
  16785. ,
  16786. t.prototype.toggleExplodeUp = function() {
  16787. this.floors.toggleExplodeVertical()
  16788. }
  16789. ,
  16790. t.prototype.nextFloor = function(e) {
  16791. return this.floors.nextFloor(this.currentFloor, e)
  16792. }
  16793. ,
  16794. t.prototype.addFloor = function(e) {
  16795. this.floors.add(e)
  16796. }
  16797. ,
  16798. t.prototype.getFloorAtPoint = function(e) {
  16799. return this.floors.getFloorAtPoint(e)
  16800. }
  16801. ,
  16802. t.prototype.getTagBySid = function(e) {
  16803. return this.tags[e]
  16804. }
  16805. ,
  16806. t.prototype.addChunk = function(e, t) {
  16807. this.floors.getOrMakeFloor(e).addChunk(t),
  16808. this.chunks.push(t)
  16809. }
  16810. ,
  16811. t.prototype.setMode = function(t) {
  16812. if (!this.supportedModes[t])
  16813. throw new x("Mode not supported for this model: " + t);
  16814. this.mode = t
  16815. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  16816. this.chunks.forEach(function(e) {
  16817. e.setMode(t)
  16818. })
  16819. }
  16820. ,
  16821. t.prototype.build = function() {
  16822. this.heroLocations = this.images.getHeroLocations(this.panos);
  16823. var e = function() {
  16824. 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()
  16825. }
  16826. .bind(this)();
  16827. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16828. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16829. }
  16830. .bind(this)) || e,
  16831. null === this.heroImage && R.warn("No hero image defined."),
  16832. this.currentFloor = this.floors.last(),
  16833. this.floors.build(),
  16834. this.colliders = this.floors.reduce(function(e, t) {
  16835. return e.concat(t.collider.children)
  16836. }, []),
  16837. this.panos.forEach(function(e) {
  16838. e.build1(),
  16839. e.on("enter", function() {
  16840. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16841. }
  16842. .bind(this))
  16843. }
  16844. .bind(this)),
  16845. this.panos.forEach(function(e) {
  16846. e.build2()
  16847. }),
  16848. this.floors.forEach(function(e) {
  16849. this.boundingBox.union(e.boundingBox)
  16850. }
  16851. .bind(this)),
  16852. this.size = this.boundingBox.size(),
  16853. this.center = this.boundingBox.center(),
  16854. this.floors.forEach(function(e) {
  16855. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16856. }
  16857. .bind(this)),
  16858. this.panos.populate_path_graph(),
  16859. this.skybox = new n(this.boundingBox),
  16860. this.skybox.matrixWorldNeedsUpdate = !0,
  16861. this.add(this.skybox),
  16862. setTimeout(function() {
  16863. //this.hotsCount && this.shineHots()
  16864. Hot.beginShineHot()
  16865. }
  16866. .bind(this), 1300),
  16867. this.tags)
  16868. this.tags[t].build();
  16869. //add-----
  16870. console.log('计算visiblePanos开始,可能需要一段时间')
  16871. for(let i in this.hots){
  16872. this.hots[i].setVisiblePanos(this.hots[i].info.visiblePanos);
  16873. }
  16874. console.log('计算visiblePanos完毕')
  16875. //---------
  16876. return R.debug("Done building model"),
  16877. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16878. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16879. this.buildRooms(),
  16880. this.labels.associateWithRooms(this.rooms),
  16881. $.when(this)
  16882. }
  16883. ,
  16884. t.prototype.loadLabels = function() {
  16885. this.labels = new b(this);
  16886. var e = $.Deferred();
  16887. window.DATA.showingLabels ? this.showingLabels = true : '';
  16888. if (!this.showingLabels)
  16889. return e.resolve();
  16890. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16891. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16892. R.warn("Getting labels failed, not displaying labels."),
  16893. e.resolve()
  16894. }),
  16895. e
  16896. }
  16897. ,
  16898. t.prototype.buildRooms = function() {
  16899. this.rooms = new _(this),
  16900. this.rooms.createFromChunks(this.chunks),
  16901. this.rooms.calcRoomBoundaries()
  16902. }
  16903. ,
  16904. t.prototype.updateProjectedPanos = function() {
  16905. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16906. }
  16907. ,
  16908. t.prototype.setProjectedPanos = function(t, i, n) {
  16909. null != n || (n = !0),
  16910. n = !!n,
  16911. this.projectedPano0 = t,
  16912. this.projectedPano1 = i,
  16913. this.skybox.material.setProjectedPanos(t, i, n),
  16914. this.chunks.forEach(function(e) {
  16915. e.materialInside.setProjectedPanos(t, i, n)
  16916. })
  16917. }
  16918. ,
  16919. t.prototype.setSide = function(t) {
  16920. this.floors.forEach(function(e) {
  16921. e.collider.material.side = t
  16922. })
  16923. }
  16924. ,
  16925. t.prototype.heroCount = function() {
  16926. return this.heroLocations ? this.heroLocations.length : 0
  16927. }
  16928. ,
  16929. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  16930. if (e[0] < 0)
  16931. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  16932. null;
  16933. if (this.heroCount() < 1)
  16934. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  16935. null;
  16936. var t = this.heroLocations[e[0]];
  16937. if(t.heroLocations && e[1]!=void 0){
  16938. t = t.heroLocations[e[1]];
  16939. }
  16940. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  16941. null) : t
  16942. }
  16943. ,
  16944. t.prototype.findPanoramicHero = function() {
  16945. for (var e in this.heroLocations)
  16946. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  16947. return this.heroLocations[e];
  16948. return null
  16949. }
  16950. ,
  16951. t.prototype.listImagePanos = function() {
  16952. var i = []
  16953. , n = this;
  16954. return this.images.forEach(function(e) {
  16955. if (e.metadata && e.metadata.scan_id) {
  16956. var t = n.panos.get(e.metadata.scan_id);
  16957. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  16958. }
  16959. }),
  16960. i
  16961. }
  16962. ,
  16963. t.prototype.fadePanoMarkers = function(e, t) {
  16964. this.panos.fadeMarkerOpacity(e, t)
  16965. }
  16966. ,
  16967. t.prototype.setSweepVisibility = function(t) {
  16968. this.panos.forEach(function(e) {
  16969. e.marker && (e.marker.visible = t)
  16970. })
  16971. }
  16972. ,
  16973. t.prototype.outsideAllowed = function() {
  16974. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  16975. }
  16976. ,
  16977. O.exports = t
  16978. }
  16979. ).call(this, "/js/model/Model.js")
  16980. }
  16981. , {
  16982. "../constants": 8,
  16983. "../enum/AlignmentType": 17,
  16984. "../enum/RenderOrder": 42,
  16985. "../enum/Viewmode": 51,
  16986. "../exception/BasicException": 55,
  16987. "../label/Label": 90,
  16988. "../loaders/ModelLoader": 105,
  16989. "../loaders/ModelTextureLoader": 106,
  16990. "../loaders/SweepDataLoader": 107,
  16991. "../tag/tag": 123,
  16992. "../tag/tagManager": 124,
  16993. "../objects/BoundingTextureSkybox": 143,
  16994. "../objects/Chunk": 144,
  16995. "../objects/Floor": 146,
  16996. "../objects/Panorama": 148,
  16997. "../objects/Room": 150,
  16998. "../objects/Snapshot": 153,
  16999. "../settings": 166,
  17000. "../shaders": 167,
  17001. "../util/ModelUrls": 177,
  17002. "../util/PanoramaCollection": 178,
  17003. "../util/ajax": 181,
  17004. "../util/common": 185,
  17005. "../util/easing": 186,
  17006. "../util/lerp": 188,
  17007. "../util/logger": 189,
  17008. "../util/math": 190,
  17009. "../util/texture": 194,
  17010. "../util/transitions": 195,
  17011. "./../util/browser": 182,
  17012. "./../util/showcase": 193,
  17013. "./Chunks": 135,
  17014. "./FloorCollection": 136,
  17015. "./ImageCollection": 137,
  17016. "./LabelCollection": 138,
  17017. "./RoomCollection": 141,
  17018. events: 202,
  17019. three: 217,
  17020. //hot: "hot"
  17021. }],
  17022. 140: [function(e, t, i) {
  17023. "use strict";
  17024. function n() {
  17025. this.modelMap = {},
  17026. this.activeModel = null,
  17027. this.modelCount = 0,
  17028. this.tileDownloader = null,
  17029. this.panoRenderer = null
  17030. }
  17031. var r = (e("three"),
  17032. e("../util/common"))
  17033. , o = e("../exception/BasicException")
  17034. , a = e("../enum/ModelManagerEvents")
  17035. , s = e("../enum/PanoRendererEvents")
  17036. , l = e("events").EventEmitter;
  17037. n.prototype.init = function(e, t, i) {
  17038. this.tileDownloader = e,
  17039. this.panoRenderer = t,
  17040. this.qualityManager = i,
  17041. this.bindEvents()
  17042. }
  17043. ,
  17044. n.prototype.bindEvents = function() {
  17045. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17046. }
  17047. ,
  17048. n.prototype.onTileRendered = function(e, t, i, n) {}
  17049. ,
  17050. n.prototype.addModel = function(e) {
  17051. this.modelMap[e.sid] = e,
  17052. 0 === this.modelCount && this.activateModel(e.sid),
  17053. this.modelCount++,
  17054. this.emit(a.ModelAdded)
  17055. }
  17056. ,
  17057. n.prototype.getModel = function(e) {
  17058. return this.modelMap[e]
  17059. }
  17060. ,
  17061. n.prototype.activateModel = function(e) {
  17062. var t = this.modelMap[e];
  17063. if (!t)
  17064. throw new o("Tried to activate invalid model!");
  17065. var i = this.activeModel;
  17066. this.activeModel = t,
  17067. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17068. this.tileDownloader.setUrls(t.urls),
  17069. t.panos.forEach(function(e) {
  17070. e.attachToPanoRenderer(this.panoRenderer),
  17071. e.tileDownloader = this.tileDownloader,
  17072. e.qualityManager = this.qualityManager
  17073. }
  17074. .bind(this)),
  17075. this.emit(a.ActiveModelChanged, {
  17076. oldModel: i,
  17077. model: t
  17078. })
  17079. }
  17080. ,
  17081. n.prototype.getActiveModel = function() {
  17082. return this.activeModel
  17083. }
  17084. ,
  17085. r.extend(n, l),
  17086. t.exports = n
  17087. }
  17088. , {
  17089. "../enum/ModelManagerEvents": 33,
  17090. "../enum/PanoRendererEvents": 35,
  17091. "../exception/BasicException": 55,
  17092. "../util/common": 185,
  17093. events: 202,
  17094. three: 217
  17095. }],
  17096. 141: [function(r, l, e) {
  17097. (function(e) {
  17098. "use strict";
  17099. function o() {
  17100. n.call(this)
  17101. }
  17102. var a = r("../objects/Room")
  17103. , t = (r("../settings"),
  17104. r("../util/logger"))
  17105. , i = (r("../util/transitions"),
  17106. r("../util/easing"),
  17107. r("../util/common"))
  17108. , n = r("../util/IndexedCollection")
  17109. , s = r("./Chunks");
  17110. new t(e),
  17111. i.inherit(o, n),
  17112. o.prototype.getIndex = function(e) {
  17113. return e.roomId
  17114. }
  17115. ,
  17116. o.prototype.calcRoomBoundaries = function() {
  17117. this.forEach(function(e) {
  17118. e.calcBoundaries()
  17119. })
  17120. }
  17121. ,
  17122. o.prototype.createFromChunks = function(e) {
  17123. var n = {
  17124. floorId: -1,
  17125. roomId: -1
  17126. }
  17127. , r = {};
  17128. e.forEach(function(e) {
  17129. s.parseIdsFromChunkName(e.name, n);
  17130. var t = r[n.roomId];
  17131. if (!t) {
  17132. var i = o.generateRoomId(n.floorId, n.roomId);
  17133. t = new a(n.floorId,i),
  17134. this.add(t),
  17135. r[n.roomId] = t
  17136. }
  17137. t.addChunk(e)
  17138. }
  17139. .bind(this)),
  17140. this.calcRoomBoundaries()
  17141. }
  17142. ,
  17143. o.generateRoomId = function(e, t) {
  17144. return e + "_" + t
  17145. }
  17146. ,
  17147. l.exports = o
  17148. }
  17149. ).call(this, "/js/model/RoomCollection.js")
  17150. }
  17151. , {
  17152. "../objects/Room": 150,
  17153. "../settings": 166,
  17154. "../util/IndexedCollection": 175,
  17155. "../util/common": 185,
  17156. "../util/easing": 186,
  17157. "../util/logger": 189,
  17158. "../util/transitions": 195,
  17159. "./Chunks": 135
  17160. }],
  17161. 142: [function(e, t, i) {
  17162. "use strict";
  17163. function n(e, t, i) {
  17164. var n = (e = e.clone().expandByScalar(0.01)).size()
  17165. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17166. r.boundingBox = e,
  17167. o.Mesh.call(this, r, t),
  17168. this.position.copy(e.center()),
  17169. this.frustumCulled = !1,
  17170. i && this.add(new o.WireframeHelper(this))
  17171. }
  17172. var o = e("three");
  17173. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17174. t.exports = n
  17175. }
  17176. , {
  17177. three: 217
  17178. }],
  17179. 143: [function(l, c, e) {
  17180. (function(e) {
  17181. "use strict";
  17182. function t(e) {
  17183. s.time("Computing a nice bounding cubemap");
  17184. var t = new r({
  17185. side: i.BackSide,
  17186. transparent: !0
  17187. });
  17188. t.uniforms.modelAlpha.value = 0,
  17189. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17190. this.renderOrder = a.boundingSkybox,
  17191. n.call(this, e, t),
  17192. s.timeEnd("Computing a nice bounding cubemap")
  17193. }
  17194. var i = l("three")
  17195. , n = (l("../enum/Viewmode"),
  17196. l("../shaders"),
  17197. l("./BoundingMesh"))
  17198. , r = l("../materials/ModelTextureMaterial")
  17199. , o = l("../settings")
  17200. , a = l("../enum/RenderOrder")
  17201. , s = new (l("../util/logger"))(e);
  17202. (t.prototype = Object.create(n.prototype)).constructor = t,
  17203. c.exports = t
  17204. }
  17205. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17206. }
  17207. , {
  17208. "../enum/RenderOrder": 42,
  17209. "../enum/Viewmode": 51,
  17210. "../materials/ModelTextureMaterial": 118,
  17211. "../settings": 166,
  17212. "../shaders": 167,
  17213. "../util/logger": 189,
  17214. "./BoundingMesh": 142,
  17215. three: 217
  17216. }],
  17217. 144: [function(e, t, i) {
  17218. "use strict";
  17219. function n(e) {
  17220. this.materialInside = new s({
  17221. side: r.DoubleSide
  17222. });
  17223. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17224. this.materialOutside = new r.RawShaderMaterial({
  17225. fragmentShader: o.modelOutside.fragmentShader,
  17226. vertexShader: o.modelOutside.vertexShader,
  17227. uniforms: t,
  17228. side: r.FrontSide,
  17229. name: "chunkOut"
  17230. }),
  17231. r.Mesh.call(this, e.geometry, this.materialInside),
  17232. this.name = e.name || "",
  17233. this.textureName = e.textureName,
  17234. this.meshUrl = e.meshUrl
  17235. }
  17236. var r = e("three")
  17237. , o = e("../shaders")
  17238. , a = e("../enum/Viewmode")
  17239. , s = e("../materials/ModelTextureMaterial");
  17240. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17241. this.materialInside.uniforms.map.value = e,
  17242. this.materialOutside.uniforms.map.value = e
  17243. }
  17244. ,
  17245. n.prototype.setMode = function(e) {
  17246. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17247. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17248. t.transparent = this.material.transparent,
  17249. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17250. this.material = t
  17251. }
  17252. ,
  17253. t.exports = n
  17254. }
  17255. , {
  17256. "../enum/Viewmode": 51,
  17257. "../materials/ModelTextureMaterial": 118,
  17258. "../shaders": 167,
  17259. three: 217
  17260. }],
  17261. 145: [function(e, t, i) {
  17262. "use strict";
  17263. function n(e) {
  17264. this.chunksize = e || 10,
  17265. this.chunks = {},
  17266. this.boundingBoxes = {},
  17267. this.children = [],
  17268. this.offset = new m.Vector3(0,.5,0),
  17269. this.material = new m.MeshBasicMaterial({
  17270. color: 16777215 * Math.random(),
  17271. side: m.DoubleSide
  17272. })
  17273. }
  17274. var m = e("three");
  17275. e("../enum/Viewmode"),
  17276. n.prototype.add = function(e) {
  17277. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17278. u ? (t = u.position.array,
  17279. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17280. e.faces);
  17281. var d = new m.Vector3;
  17282. if (i)
  17283. for (n = 0,
  17284. r = i.length; n < r; n += 3) {
  17285. var p = 3 * i[n]
  17286. , f = 3 * i[n + 1]
  17287. , g = 3 * i[n + 2];
  17288. o = (t[p] + t[f] + t[g]) / 3,
  17289. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17290. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17291. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17292. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17293. this.boundingBoxes[l] = new m.Box3),
  17294. 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]),
  17295. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17296. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17297. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17298. }
  17299. else
  17300. for (n = 0,
  17301. r = t.length; n < r; n += 9)
  17302. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17303. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17304. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17305. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17306. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17307. this.boundingBoxes[l] = new m.Box3),
  17308. 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]),
  17309. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17310. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17311. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17312. }
  17313. ,
  17314. n.prototype.build = function() {
  17315. var e = new m.Object3D;
  17316. for (var t in e.material = this.material,
  17317. this.chunks) {
  17318. var i = this.chunks[t]
  17319. , n = new m.BufferGeometry;
  17320. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17321. n.boundingBox = this.boundingBoxes[t];
  17322. var r = new m.Mesh(n,this.material);
  17323. r.material.visible = !1,
  17324. e.add(r),
  17325. this.chunks[t] = []
  17326. }
  17327. return e
  17328. }
  17329. ,
  17330. t.exports = n
  17331. }
  17332. , {
  17333. "../enum/Viewmode": 51,
  17334. three: 217
  17335. }],
  17336. 146: [function(e, t, i) {
  17337. "use strict";
  17338. var n = e("three")
  17339. , r = e("../settings")
  17340. , o = e("../util/common")
  17341. , a = e("../util/lerp")
  17342. , s = e("./ChunkedCollider")
  17343. , l = e("../util/transitions")
  17344. , c = e("../util/easing")
  17345. , h = (e("../objects/Panorama"),
  17346. e("../enum/RenderOrder"));
  17347. e("../localization/localize");
  17348. function u(e, t, i) {
  17349. n.Object3D.call(this),
  17350. this.model = e,
  17351. this.floorIndex = t,
  17352. this.lang = r.languageTag,
  17353. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17354. this.panos = [],
  17355. this.chunks = [],
  17356. this.colliderBuilder = new s(3),
  17357. this.collider = null,
  17358. this.center = null,
  17359. this.boundingBox = new n.Box3,
  17360. this.size = null,
  17361. this.hidden = !1,
  17362. this.conservativeBoundingBox = new n.Box3,
  17363. this.debugColor = 16777215 * Math.random(),
  17364. this.transition = null
  17365. }
  17366. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17367. this.model.setFloor(this, e)
  17368. }
  17369. ,
  17370. u.prototype.hide = function(e) {
  17371. if (!this.hidden || this.transition) {
  17372. this.chunks.forEach(function(e) {
  17373. e.material.transparent = !0
  17374. }),
  17375. l.cancel(this.transition);
  17376. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17377. , i = e ? 0 : r.hideFloorDelay / t;
  17378. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17379. this.hidden = !0
  17380. }
  17381. .bind(this), i, c.easeInOutQuad)
  17382. }
  17383. }
  17384. ,
  17385. u.prototype.show = function(e) {
  17386. if (this.hidden || this.transition) {
  17387. this.hidden = !1,
  17388. l.cancel(this.transition);
  17389. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17390. , i = e ? 0 : r.showFloorDelay / t;
  17391. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17392. this.hidden || this.chunks.forEach(function(e) {
  17393. e.material.transparent = !1
  17394. })
  17395. }
  17396. .bind(this), i, c.easeInOutQuad)
  17397. }
  17398. }
  17399. ,
  17400. u.prototype.toggle = function(e, t) {
  17401. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17402. }
  17403. ,
  17404. u.prototype.containsPoint = function(t) {
  17405. return this.collider.children.some(function(e) {
  17406. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17407. e.geometry.boundingBox.containsPoint(t)
  17408. })
  17409. }
  17410. ,
  17411. u.prototype.distanceToPoint = function(i) {
  17412. var n = null
  17413. , r = 1 / 0;
  17414. return this.collider.children.forEach(function(e) {
  17415. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17416. var t = e.geometry.boundingBox.distanceToPoint(i);
  17417. (!n || t < r) && (r = t,
  17418. n = e)
  17419. }),
  17420. r
  17421. }
  17422. ,
  17423. u.prototype.addChunk = function(e) {
  17424. e.renderOrder = h.ghostFloor,
  17425. this.add(e),
  17426. this.chunks.push(e),
  17427. this.boundingBox.union(e.geometry.boundingBox),
  17428. this.size = this.boundingBox.size(),
  17429. this.colliderBuilder.add(e.geometry)
  17430. }
  17431. ,
  17432. u.prototype.addPano = function(e) {
  17433. this.panos.push(e),
  17434. this.add(e.skyboxMesh),
  17435. e.marker && this.add(e.marker);
  17436. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  17437. var t = new n.Vector3(1,1,1)
  17438. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17439. this.boundingBox.union(i)
  17440. }
  17441. }
  17442. ,
  17443. u.prototype.build = function() {
  17444. this.collider = this.colliderBuilder.build(!0),
  17445. this.add(this.collider),
  17446. this.center = this.boundingBox.center(),
  17447. this.conservativeBoundingBox.copy(this.boundingBox),
  17448. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17449. return e.geometry.boundingBox.min.y
  17450. }), 5),
  17451. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17452. return e.geometry.boundingBox.max.y
  17453. }), 5),
  17454. this.colliderBuilder = null
  17455. }
  17456. ,
  17457. u.prototype.toShortString = function() {
  17458. return o.nth(this.floorIndex + 1)
  17459. }
  17460. ,
  17461. u.prototype.toString = function() {
  17462. return this.name
  17463. }
  17464. ,
  17465. t.exports = u
  17466. }
  17467. , {
  17468. "../enum/RenderOrder": 42,
  17469. "../localization/localize": 108,
  17470. "./strings-cn-CN": 109,
  17471. "../objects/Panorama": 148,
  17472. "../settings": 166,
  17473. "../util/common": 185,
  17474. "../util/easing": 186,
  17475. "../util/lerp": 188,
  17476. "../util/transitions": 195,
  17477. "./ChunkedCollider": 145,
  17478. three: 217
  17479. }],
  17480. 147: [function(e, t, i) {
  17481. "use strict";
  17482. function n(e) {
  17483. this.player = e,
  17484. this.obj3d = null,
  17485. this.UP = new u.Vector3(0,1,0)
  17486. }
  17487. var u = e("three")
  17488. , d = e("../settings");
  17489. n.prototype.prefs = {
  17490. linewidth: 3,
  17491. height: .07,
  17492. opacity: .45,
  17493. endScale: .05
  17494. },
  17495. n.prototype.discard = function() {
  17496. if (this.obj3d) {
  17497. var e = this.obj3d.parent;
  17498. e && e.remove(this.obj3d)
  17499. }
  17500. this.obj3d = null
  17501. }
  17502. ,
  17503. n.prototype.draw = function() {
  17504. if (this.discard(),
  17505. d.showNeighbors) {
  17506. var e = this.player.currentPano.floor;
  17507. this.obj3d = new u.Object3D;
  17508. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17509. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17510. i.y += this.prefs.height;
  17511. var n = .1525
  17512. , r = new u.Matrix4;
  17513. for (var o in t)
  17514. if (t[o]) {
  17515. var a = this.player.model.panos.get(o)
  17516. , s = (a.position.clone().sub(this.player.model.position),
  17517. a.position.clone().sub(a.floorPosition))
  17518. , l = a.floorPosition.clone().sub(this.player.model.position);
  17519. l.y += this.prefs.height;
  17520. var c = new u.Geometry;
  17521. 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)),
  17522. 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)),
  17523. r.identity().setPosition(s),
  17524. c.applyMatrix(r),
  17525. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17526. 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)),
  17527. r.lookAt(l, i, this.UP).setPosition(l),
  17528. c.applyMatrix(r),
  17529. c.vertices.push(l, i);
  17530. var h = new u.Line(c,new u.LineBasicMaterial({
  17531. color: a.debugColor.getHex(),
  17532. transparent: !0,
  17533. opacity: this.prefs.opacity,
  17534. depthWrite: !1,
  17535. name: "sLine" + o,
  17536. linewidth: this.prefs.linewidth
  17537. }));
  17538. this.obj3d.add(h)
  17539. }
  17540. e.add(this.obj3d)
  17541. }
  17542. }
  17543. ,
  17544. n.prototype.update = function() {
  17545. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17546. }
  17547. ,
  17548. t.exports = n
  17549. }
  17550. , {
  17551. "../settings": 166,
  17552. three: 217
  17553. }],
  17554. 148: [function(S, M, e) {
  17555. (function(e) {
  17556. "use strict";
  17557. function r(e, t, i, n) {
  17558. this.model = e,
  17559. this.id = t,
  17560. this.alignmentType = i.alignmentType || c.ALIGNED,
  17561. this.neighbourUUIDs = i.neighbours,
  17562. this.neighbourPanos = null,
  17563. this.floor = null,
  17564. this.floorIndex = i.floor,
  17565. this.failedLoadingAt = 0,
  17566. this.maxLoadRetries = 4,
  17567. this.origin = i.position.clone(),
  17568. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17569. this.quaternion = i.quaternion.clone(),
  17570. this.skyboxMesh = new s.Mesh(E),
  17571. this.skyboxMesh.position.copy(this.position),
  17572. this.skyboxMesh.quaternion.copy(this.quaternion),
  17573. this.skyboxMesh.name = "skybox",
  17574. this.skyboxMesh.visible = !1,
  17575. this.skyboxMesh.updateMatrix(),
  17576. this.skyboxMesh.updateMatrixWorld(),
  17577. this.marker = null,
  17578. this.showFloorMarker = this.showFloorMarker = !window.DATA.hideFloorMarker,
  17579. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17580. map: b,
  17581. side: s.DoubleSide,
  17582. opacity: 0,
  17583. transparent: !0,
  17584. depthWrite: !1
  17585. })),
  17586. this.marker.visible = this.showFloorMarker,
  17587. this.marker.renderOrder = l.panoMarker,
  17588. this.marker.name = "marker",
  17589. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17590. this.marker.updateMatrixWorld(),
  17591. a.colorMarkerOnLoad && this.on("load", function() {
  17592. this.marker.material.color.set(65280)
  17593. })),
  17594. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17595. this.floorPosition = i.puck ? i.puck.clone() : null,
  17596. this.tiled = n,
  17597. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17598. this.solidSkybox.flipY = !1,
  17599. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17600. this.solidSkybox.magFilter = s.LinearFilter,
  17601. this.solidSkybox.generateMipmaps = !1)),
  17602. this.zoomed = !1,
  17603. this.panoRenderer = null,
  17604. this.qualityManager = null,
  17605. this.tileDownloader = null,
  17606. this.tiledPanoRenderTarget = null,
  17607. this.minimumTiledPanoLoaded = !1,
  17608. this.highestPartialTileRenderOpCompleted = 0,
  17609. this.highestFullTileRenderOpCompleted = 0,
  17610. this.shouldRedrawOnBaseLoaded = !1,
  17611. this.lockUntilRenderingComplete = !1,
  17612. a.colorMarkerOnLoad && this.on("load", function() {
  17613. this.marker.material.color.set(65280)
  17614. }),
  17615. (e = new s.TextureLoader).setCrossOrigin(!0);
  17616. var r = e.load("images/texture.jpg");
  17617. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17618. color: 16777215,
  17619. transparent: !0,
  17620. opacity: .75,
  17621. map: r
  17622. })),
  17623. this.vrMarker.boluoType = "vr",
  17624. this.vrMarker.position.z = 1,
  17625. this.vrMarker.enabled = !0,
  17626. this.vrMarker.visible = !1,
  17627. window.vrMarkers = window.vrMarkers || [],
  17628. window.vrMarkers.push(this.vrMarker),
  17629. this.marker && this.marker.add(this.vrMarker),
  17630. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17631. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17632. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17633. this.adjustAngleEnable) {
  17634. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17635. this.skyboxMesh.quaternion.multiply(i);
  17636. var o = new s.Quaternion;
  17637. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17638. this.skyboxMesh.quaternion.multiply(o),
  17639. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17640. this.skyboxMesh.quaternion.multiply(n),
  17641. this.skyboxMesh.updateMatrix(),
  17642. this.skyboxMesh.updateMatrixWorld(),
  17643. this.model.updateProjectedPanos()
  17644. }
  17645. }
  17646. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17647. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17648. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17649. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17650. S("../enum/GLCubeFaces"),
  17651. 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");
  17652. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17653. function() {
  17654. this.setZoomed(!1),
  17655. this.emit("enter", {
  17656. oldPano: t,
  17657. newPano: this
  17658. }),
  17659. t = this
  17660. }
  17661. ),
  17662. r.prototype.exit = function() {
  17663. this.tiled ? (this.clearWaitDeferreds(),
  17664. this.minimumTiledPanoLoaded = !1,
  17665. this.tiledPanoRenderTarget = null,
  17666. this.setZoomed(!1),
  17667. this.panoRenderer.deactivateTiledPano(this),
  17668. this.highestPartialTileRenderOpCompleted = 0,
  17669. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17670. this.solidSkybox.loaded = !1,
  17671. this.solidSkybox.version = 0),
  17672. this.emit("exit")
  17673. }
  17674. ,
  17675. r.prototype.hoverOn = function(e) {
  17676. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17677. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17678. }
  17679. ,
  17680. r.prototype.hoverOff = function(e) {
  17681. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17682. }
  17683. ,
  17684. r.prototype.build1 = function() {
  17685. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position), //改
  17686. this.floor.addPano(this)
  17687. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17688. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17689. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17690. this.neighbourUUIDs = this.neighbourUUIDs || [] //add
  17691. }
  17692. ,
  17693. r.prototype.build2 = function() {
  17694. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17695. this.height = this.position.distanceTo(this.floorPosition),
  17696. this.placeMarker()
  17697. }
  17698. ,
  17699. r.prototype.interpolateFloorPosition = function() {
  17700. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17701. return !!e.floorPosition
  17702. }).sort(function(e, t) {
  17703. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17704. }
  17705. .bind(this))
  17706. , t = this.position.clone();
  17707. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17708. t
  17709. }
  17710. ,
  17711. r.prototype.raycastFloorPosition = function() {
  17712. I.warn("Performance warning: Raycasting to find floor position");
  17713. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17714. return e.length ? e[0].point : null
  17715. }
  17716. ,
  17717. 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)],
  17718. function() {
  17719. I.warn("Performance warning: Raycasting to find floor index");
  17720. for (var e = 0; e < i.length; e++) {
  17721. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17722. if (t.length)
  17723. return t[0].object.parent.parent
  17724. }
  17725. return null
  17726. }
  17727. ),
  17728. r.prototype.placeMarker = function() {
  17729. this.marker && (this.marker.position.copy(this.floorPosition),
  17730. this.marker.position.y += .05,
  17731. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17732. }
  17733. ,
  17734. r.prototype.translate = function(e) {
  17735. this.position.add(e),
  17736. this.floorPosition.add(e)
  17737. }
  17738. ,
  17739. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17740. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17741. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17742. }
  17743. ,
  17744. r.prototype.attachToPanoRenderer = function(e) {
  17745. this.panoRenderer = e,
  17746. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17747. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17748. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17749. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17750. }
  17751. ;
  17752. var w, T, x = {};
  17753. r.prototype.getWaitDeferred = function(e) {
  17754. var t = x[this.id];
  17755. t || (t = {},
  17756. x[this.id] = t);
  17757. var i = t[e];
  17758. return i || (i = {
  17759. deferred: $.Deferred(),
  17760. active: !1
  17761. },
  17762. t[e] = i),
  17763. i
  17764. }
  17765. ,
  17766. r.prototype.resetWaitDeferred = function(e) {
  17767. var t = this.getWaitDeferred(e);
  17768. t.active = !1,
  17769. t.deferred = $.Deferred()
  17770. }
  17771. ,
  17772. r.prototype.clearWaitDeferreds = function() {
  17773. var e = x[this.id];
  17774. for (var t in e || (e = {},
  17775. x[this.id] = e),
  17776. e)
  17777. if (e.hasOwnProperty(t)) {
  17778. var i = e[t];
  17779. i.active = !1,
  17780. i.deferred = $.Deferred()
  17781. }
  17782. }
  17783. ,
  17784. r.prototype.loadTiledPano = (new s.Vector3,
  17785. w = [],
  17786. T = [],
  17787. function(e, t, i, n, r, o) {
  17788. null != n || (n = !0),
  17789. null != r || (r = !0);
  17790. var a = this.getWaitDeferred(e)
  17791. , s = a.deferred
  17792. , l = null
  17793. , c = null;
  17794. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17795. c = i.vFov)),
  17796. !this.isLoaded(e)) {
  17797. if (!a.active) {
  17798. if (a.active = !0,
  17799. i) {
  17800. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17801. w[this.id + ":" + e] = {
  17802. tileCount: 0,
  17803. targetTileCount: h
  17804. },
  17805. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17806. }
  17807. T[this.id] || (T[this.id] = !0,
  17808. this.on(f.LoadComplete, function(e, t) {
  17809. var i = this.getWaitDeferred(e).deferred;
  17810. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17811. this.resetWaitDeferred(e))
  17812. }
  17813. .bind(this)),
  17814. this.on(f.LoadFailed, function(e) {
  17815. var t = this.getWaitDeferred(e).deferred;
  17816. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17817. this.resetWaitDeferred(e))
  17818. }
  17819. .bind(this)),
  17820. this.on(f.TileLoaded, function(e, t, i) {
  17821. var n = this.getWaitDeferred(e).deferred;
  17822. if (n && "pending" === n.state()) {
  17823. n.notify(e, t, i);
  17824. var r = w[this.id + ":" + e];
  17825. r && (r.tileCount++,
  17826. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17827. n.resolve(e, i),
  17828. this.resetWaitDeferred(e)))
  17829. }
  17830. }
  17831. .bind(this)))
  17832. }
  17833. this.tileDownloader.clearForceQueue(),
  17834. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17835. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17836. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17837. }
  17838. return s.promise()
  17839. }
  17840. ),
  17841. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17842. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17843. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17844. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17845. }
  17846. ,
  17847. r.prototype.onTileRendered = function(e, t, i, n) {
  17848. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17849. }
  17850. ,
  17851. r.prototype.onPanoRendered = function(e, t, i, n) {
  17852. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17853. this.updateSkyboxForZoomLevel(),
  17854. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17855. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17856. this.emit("load", t),
  17857. this.model.emit("load", this),
  17858. this.emit(f.LoadComplete, t, i))
  17859. }
  17860. ,
  17861. r.prototype.setZoomed = function(e) {
  17862. this.zoomed = e,
  17863. this.updateSkyboxForZoomLevel()
  17864. }
  17865. ,
  17866. r.prototype.ensureSkyboxReadyForRender = function() {
  17867. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17868. this.solidSkybox.loaded = !0)
  17869. }
  17870. ,
  17871. r.prototype.updateSkyboxForZoomLevel = function() {
  17872. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  17873. }
  17874. ,
  17875. r.prototype.getSkyboxTexture = function() {
  17876. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  17877. }
  17878. ,
  17879. r.prototype.onTileRenderFail = function(e, t, i) {
  17880. e === this.id && this.emit(f.LoadFailed, t)
  17881. }
  17882. ,
  17883. r.prototype.isLoaded = function(e) {
  17884. if (this.tiled) {
  17885. if (e && "string" == typeof e)
  17886. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  17887. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  17888. }
  17889. if (e && "number" == typeof e)
  17890. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  17891. return !!this.solidSkybox.high || e in this.solidSkybox
  17892. }
  17893. ,
  17894. r.prototype.loadCube = function(a) {
  17895. if (this.isLoaded(a))
  17896. return I.info("Skipping load of pano, already loaded"),
  17897. $.when();
  17898. this.emit("loading", a),
  17899. this.model.emit("loading", this);
  17900. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  17901. , e = n.filter(function(e) {
  17902. return !e
  17903. });
  17904. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  17905. a = "high",
  17906. n = p.getCubemapUrls(this.model.urls, this.id, a));
  17907. var t = 0
  17908. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  17909. return u.getImage(n[t])
  17910. }
  17911. .bind(this));
  17912. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  17913. return this.solidSkybox[a] = [e, t, i, n, r, o],
  17914. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  17915. this.solidSkybox.low = null),
  17916. this.solidSkybox.needsUpdate = !0,
  17917. this.emit("load", a),
  17918. this.model.emit("load", this),
  17919. this
  17920. }
  17921. .bind(this), function() {
  17922. I.error("Downloading cubemap for pano", this.id, "failed"),
  17923. this.failedLoadingAt = Date.now()
  17924. }
  17925. .bind(this), function() {
  17926. return $.when(++t, 6)
  17927. })
  17928. }
  17929. ,
  17930. r.raycastsSkipped = 0,
  17931. r.raycastsDone = 0,
  17932. r.prototype.findNeighourPanos = function() {
  17933. return this.model.panos.setNeighbour(this.id, this.id, !1),
  17934. this.model.panos.forEach(function(e) {
  17935. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  17936. var t = this.position.distanceTo(e.position);
  17937. if (t > a.panoramaNeighbourMaxDistance)
  17938. return this.model.panos.setNeighbour(this, e, !1),
  17939. void r.raycastsSkipped++;
  17940. var i = e.position.clone().sub(this.position).normalize()
  17941. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  17942. r.raycastsDone++,
  17943. this.model.panos.setNeighbour(this, e, 0 === n.length),
  17944. 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)))
  17945. }
  17946. }
  17947. .bind(this)),
  17948. this.model.panos.neighbourMap[this.id]
  17949. }
  17950. ,
  17951. r.prototype.worldPosition = function() {
  17952. return this.position
  17953. }
  17954. ,
  17955. r.prototype.addTextSprite = function(e, color, parent) {
  17956. this.removeTextSprite();
  17957. var ratio = 16;
  17958. var i = document.createElement("canvas")
  17959. , n = i.getContext("2d");
  17960. i.width = 1024,
  17961. i.height = i.width / ratio;
  17962. n.font = " 30px Arial",
  17963. n.fillStyle = "white";
  17964. var r = n.measureText(e).width;
  17965. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  17966. var o = new s.Texture(i);
  17967. o.needsUpdate = !0;
  17968. var a = new s.SpriteMaterial({
  17969. map: o,
  17970. color: color || 16428055,
  17971. depthTest:false
  17972. });
  17973. this.text3d = new s.Sprite(a)
  17974. if(parent){
  17975. parent.add(this.text3d)
  17976. }else{
  17977. this.text3d.position.copy(this.skyboxMesh.position)
  17978. this.floor.add(this.text3d)
  17979. }
  17980. var scale = 5
  17981. this.text3d.scale.y = scale/ratio
  17982. this.text3d.scale.x = scale
  17983. }
  17984. ,
  17985. r.prototype.removeTextSprite = function() {
  17986. this.text3d && (this.text3d.parent.remove(this.text3d),
  17987. this.text3d.material.map.dispose(),
  17988. this.text3d = null)
  17989. }
  17990. ,
  17991. r.prototype.isAligned = function() {
  17992. return this.alignmentType === c.ALIGNED
  17993. }
  17994. ,
  17995. r.filters = {
  17996. inDirection: function(t, i, n) {
  17997. return function(e) {
  17998. return e.position.clone().sub(t).normalize().dot(i) > n
  17999. }
  18000. },
  18001. inFloorDirection: function(t, i, n) {
  18002. return function(e) {
  18003. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18004. }
  18005. },
  18006. inPanoDirection: function(n, r, o) {
  18007. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18008. function(e) {
  18009. var t = e.floorPosition.clone().sub(n).normalize()
  18010. , i = e.position.clone().sub(n).normalize();
  18011. return t.dot(r) > o || i.dot(r) > o
  18012. }
  18013. },
  18014. atFloor: function(t) {
  18015. return function(e) {
  18016. return !t || e.floor === t
  18017. }
  18018. },
  18019. not: function(t) {
  18020. return function(e) {
  18021. return e !== t
  18022. }
  18023. },
  18024. notIn: function(t) {
  18025. return function(e) {
  18026. return -1 === t.indexOf(e)
  18027. }
  18028. },
  18029. isLoaded: function() {
  18030. return function(e) {
  18031. return e.isLoaded()
  18032. }
  18033. },
  18034. isNotLoaded: function() {
  18035. return function(e) {
  18036. return !e.isLoaded()
  18037. }
  18038. },
  18039. isCloseEnoughTo: function(t, i) {
  18040. return function(e) {
  18041. return t.distanceTo(e.floorPosition) < i
  18042. }
  18043. },
  18044. hasMinimumHeightDifferenceTo: function(t, i) {
  18045. return function(e) {
  18046. return Math.abs(e.position.y - t.y) > i
  18047. }
  18048. },
  18049. isNotBehindNormal: function(t, i) {
  18050. var n = new s.Vector3;
  18051. return i = i.clone(),
  18052. function(e) {
  18053. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18054. }
  18055. },
  18056. isNeighbourPanoTo: function(t) {
  18057. return function(e) {
  18058. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18059. }
  18060. },
  18061. isNeighbourOfNeighbourTo: function(n) {
  18062. return function(i) {
  18063. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18064. var t = n.model.panos.get(e);
  18065. return !!t && t.neighbourPanos[i.id]
  18066. })
  18067. }
  18068. },
  18069. isNotRecentlyFailed: function(t) {
  18070. return function(e) {
  18071. return Date.now() - e.failedLoadingAt > t
  18072. }
  18073. },
  18074. isOnVisibleFloor: function() {
  18075. return function(e) {
  18076. return !e.floor.hidden
  18077. }
  18078. },
  18079. isPanoAligned: function() {
  18080. return function(e) {
  18081. return e.isAligned()
  18082. }
  18083. }
  18084. },
  18085. r.sortFunctions = {
  18086. distanceToPoint: function(i) {
  18087. return function(e, t) {
  18088. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18089. }
  18090. },
  18091. floorDistanceToPoint: function(i) {
  18092. return function(e, t) {
  18093. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18094. }
  18095. },
  18096. choose: function(i) {
  18097. return function(e, t) {
  18098. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18099. }
  18100. }
  18101. },
  18102. r.scoreFunctions = {
  18103. distance: function(t, i) {
  18104. return i = i || a.navigation.distanceFactor,
  18105. function(e) {
  18106. return t ? t.position.distanceTo(e.position) * i : 0
  18107. }
  18108. },
  18109. distanceSquared: function(t, i) {
  18110. return i = i || a.navigation.distanceFactor,
  18111. function(e) {
  18112. return t ? t.position.distanceToSquared(e.position) * i : 0
  18113. }
  18114. },
  18115. direction: function(t, i) {
  18116. return function(e) {
  18117. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18118. }
  18119. },
  18120. angle: function(t, i) {
  18121. return function(e) {
  18122. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18123. }
  18124. },
  18125. inFieldOfView: function(t, i) {
  18126. return function(e) {
  18127. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18128. }
  18129. },
  18130. optionality: function(t) {
  18131. return function(e) {
  18132. return e.neighbourUUIDs.filter(function(e) {
  18133. return !(e in t.neighbourUUIDs) && e !== t.id
  18134. }).length * a.navigation.optionalityFactor
  18135. }
  18136. },
  18137. penalizeHeightDifferenceUnder: function(t, i) {
  18138. return function(e) {
  18139. return t.y - e.position.y < i ? -20 : 0
  18140. }
  18141. }
  18142. },
  18143. M.exports = r
  18144. }
  18145. ).call(this, "/js/objects/Panorama.js")
  18146. }
  18147. , {
  18148. "../enum/AlignmentType": 17,
  18149. "../enum/GLCubeFaces": 25,
  18150. "../enum/PanoRendererEvents": 35,
  18151. "../enum/PanoSizeClass": 36,
  18152. "../enum/PanoramaEvents": 37,
  18153. "../enum/RenderLayers": 41,
  18154. "../enum/RenderOrder": 42,
  18155. "../enum/TileDownloaderEvents": 45,
  18156. "../enum/Viewmode": 51,
  18157. "../exception/BasicException": 55,
  18158. "../scene/SceneRenderer": 158,
  18159. "../settings": 166,
  18160. "../tile/TileUtils": 174,
  18161. "../util/ajax": 181,
  18162. "../util/common": 185,
  18163. "../util/lerp": 188,
  18164. "../util/logger": 189,
  18165. "../util/panorama": 191,
  18166. "../util/texture": 194,
  18167. "../util/transitions": 195,
  18168. events: 202,
  18169. three: 217
  18170. }],
  18171. 149: [function(e, t, i) {
  18172. "use strict";
  18173. function n(e) {
  18174. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18175. t.map.value = d,
  18176. t.opacity.value = 0,
  18177. t.color.value.set(o.reticuleColor),
  18178. t.showMouseMarker = !window.DATA.hideMouseMarker;
  18179. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18180. side: r.DoubleSide,
  18181. depthWrite: !1,
  18182. depthTest: !1,
  18183. transparent: !0,
  18184. vertexShader: c.waypoint.vertexShader,
  18185. fragmentShader: c.waypoint.fragmentShader,
  18186. uniforms: t,
  18187. name: "waypoint",
  18188. opacity: 0,
  18189. visible: t.showMouseMarker
  18190. })),
  18191. this.layers.set(h.RETICULE),
  18192. this.renderOrder = u.reticule,
  18193. this.player = e,
  18194. this.direction = new r.Vector3,
  18195. this.hidden = !0,
  18196. this.mouseLastMoveTime = Date.now()
  18197. }
  18198. var r = e("three")
  18199. , o = e("../settings")
  18200. , a = e("../util/transitions")
  18201. , s = e("../util/texture")
  18202. , l = e("../util/lerp")
  18203. , c = e("../shaders")
  18204. , h = e("../enum/RenderLayers")
  18205. , u = e("../enum/RenderOrder")
  18206. , d = s.load("images/reticule-256x256.png");
  18207. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18208. this.hidden = i,
  18209. this.mouseLastMoveTime = Date.now()
  18210. }
  18211. ,
  18212. n.prototype.hide = function() {
  18213. this.hidden || (this.hidden = !0,
  18214. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18215. }
  18216. ,
  18217. n.prototype.show = function() {
  18218. this.hidden = !1,
  18219. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18220. }
  18221. ,
  18222. n.prototype.update = function() {
  18223. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18224. }
  18225. ,
  18226. n.prototype.updatePosition = function(e, t) {
  18227. if (!this.hidden) {
  18228. if (!t)
  18229. return this.hide();
  18230. var i = t.point
  18231. , n = e.distanceTo(i)
  18232. , r = 1 + .01 * n;
  18233. n < 1 && (r -= 1 - n),
  18234. this.show(),
  18235. this.scale.set(r, r, r),
  18236. this.direction = this.direction.multiplyScalar(.8),
  18237. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18238. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18239. this.lookAt(this.position.clone().add(this.direction))
  18240. }
  18241. }
  18242. ,
  18243. n.prototype.writeAstag = function() {
  18244. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18245. , t = new Date;
  18246. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18247. var i = {
  18248. enabled: !0,
  18249. version: "0",
  18250. created: t.toISOString(),
  18251. created_by: "APITest",
  18252. position: this.position.clone(),
  18253. stem: {
  18254. enabled: o.tags.pole.enabled,
  18255. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18256. },
  18257. label: "tag " + this.tagCount,
  18258. description: "Description " + e,
  18259. floor: function(e) {
  18260. if (e.currentFloor) {
  18261. var t = e.floors.indexOf(e.currentFloor);
  18262. return -1 < t ? t : void 0
  18263. }
  18264. }(this.player.model),
  18265. type: "info",
  18266. metadata: {
  18267. preferred_camera: {
  18268. mode: this.player.mode
  18269. }
  18270. }
  18271. };
  18272. console.log("--------------------------"),
  18273. console.log(JSON.stringify(i));
  18274. var n = this.player.model.addtag(e, i).build();
  18275. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18276. n.visible || n.show(o.tags.startup.fadeInDuration))
  18277. }
  18278. ,
  18279. t.exports = n
  18280. }
  18281. , {
  18282. "../enum/RenderLayers": 41,
  18283. "../enum/RenderOrder": 42,
  18284. "../settings": 166,
  18285. "../shaders": 167,
  18286. "../util/lerp": 188,
  18287. "../util/texture": 194,
  18288. "../util/transitions": 195,
  18289. three: 217
  18290. }],
  18291. 150: [function(e, t, i) {
  18292. "use strict";
  18293. function n(e, t) {
  18294. this.chunks = [],
  18295. this.floorId = e,
  18296. this.roomId = t,
  18297. this.position = new l.Vector3
  18298. }
  18299. var l = e("three");
  18300. n.prototype.addChunk = function(e) {
  18301. this.chunks.push(e)
  18302. }
  18303. ,
  18304. n.prototype.calcBoundaries = function() {
  18305. 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++) {
  18306. var a = this.chunks[o].geometry.attributes.position;
  18307. if (a)
  18308. for (var s = 0; s < a.array.length; s += 3)
  18309. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18310. t.add(e),
  18311. 0 === s ? (i.copy(e),
  18312. n.copy(e)) : (i.max(e),
  18313. n.min(e)),
  18314. r++
  18315. }
  18316. 0 < r ? (t.multiplyScalar(1 / r),
  18317. this.average = t) : this.average = null,
  18318. this.boundsMax = i,
  18319. this.boundsMin = n,
  18320. this.center = new l.Vector3,
  18321. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18322. }
  18323. ,
  18324. t.exports = n
  18325. }
  18326. , {
  18327. three: 217
  18328. }],
  18329. 151: [function(o, v, e) {
  18330. (function(e) {
  18331. "use strict";
  18332. function t(e, t, i) {
  18333. this.obj3d = null,
  18334. this.nodes = [],
  18335. this.colorHull = [],
  18336. this.shortPaths = {},
  18337. this.floorHull = null,
  18338. this.cameraHull = null,
  18339. this.floorPathDistance = 0,
  18340. this.floorCurvePoints = null,
  18341. this.floorCurveColors = null,
  18342. this.camCurvePoints = null,
  18343. this.warpDestHeroLoc = null,
  18344. this.warpDestPano = null,
  18345. this.warpPathPoints = null,
  18346. this.warpPathLengths = [0],
  18347. this.warpLength = 0,
  18348. this.closeWarpDistance = 4,
  18349. this.UP = U.UP.clone(),
  18350. this.longestStep = 0,
  18351. this.upcomingTransType = null,
  18352. this.burnsDir = 1,
  18353. this.prevNextDist = 0,
  18354. this.nextI = 0,
  18355. this.activeTransType = null,
  18356. this.lastTransType = null,
  18357. this.bunnyObj = null,
  18358. this.director = e,
  18359. this.player = t,
  18360. this.playerControls = i,
  18361. this.modelManager = t.modelManager,
  18362. this.updateModel(),
  18363. this.updateDefaultsFromModelData(),
  18364. this.bindEvents(),
  18365. this.warping = !1,
  18366. this.waitingToWarp = !1,
  18367. this.warpInterrupted = !1,
  18368. this.warpInterruptionBlackoutStyle = null,
  18369. this.warpInterruptionTravelTime = null
  18370. }
  18371. 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"),
  18372. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18373. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18374. 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"),
  18375. pathEnd: n.load("images/End.png"),
  18376. 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==")
  18377. };
  18378. t.prototype.setScene = function(e) {
  18379. this.createCpm(e),
  18380. this.createBunnyObj(e)
  18381. }
  18382. ,
  18383. t.prototype.updateModel = function() {
  18384. this.model = this.modelManager.getActiveModel()
  18385. }
  18386. ,
  18387. t.prototype.bindEvents = function() {
  18388. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18389. }
  18390. ,
  18391. t.prototype.updateDefaultsFromModelData = function() {
  18392. this.model.data
  18393. }
  18394. ,
  18395. t.prototype.pointPathDistance = function(e) {
  18396. for (var t = 0, i = 1; i < e.length; i += 1)
  18397. t += e[i - 1].distanceTo(e[i]);
  18398. return t
  18399. }
  18400. ,
  18401. t.prototype.pointPathLengths = function(e) {
  18402. for (var t = [0], i = 1; i < e.length; i += 1)
  18403. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18404. return t
  18405. }
  18406. ,
  18407. t.prototype.interpAlongPath = function(e, t, i) {
  18408. var n, r = new P.Vector3, o = t[t.length - 1];
  18409. if (i < 1) {
  18410. n = i * o;
  18411. for (var a = 1; a < t.length; a += 1)
  18412. if (t[a] > n) {
  18413. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18414. return r.copy(e[a]),
  18415. r.sub(e[a - 1]),
  18416. r.multiplyScalar(s),
  18417. r.add(e[a - 1]),
  18418. r
  18419. }
  18420. } else
  18421. r.copy(e[e.length - 1]);
  18422. return r
  18423. }
  18424. ,
  18425. t.prototype.pathHeight = function() {
  18426. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18427. }
  18428. ,
  18429. t.prototype.createBunnyObj = function(e) {
  18430. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18431. this.bunnyObj.visible = D.warp.showBunny),
  18432. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18433. e.add(this.bunnyObj)
  18434. }
  18435. ,
  18436. t.prototype.createCpm = function(e) {
  18437. if (!this.currentPanoMarker) {
  18438. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18439. t.material.uniforms.opacity.value = 0,
  18440. this.currentPanoMarker = {
  18441. mesh: t,
  18442. placed: !1
  18443. }
  18444. }
  18445. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18446. this.placeCpm(),
  18447. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18448. }
  18449. ,
  18450. t.prototype.placeCpm = function() {
  18451. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18452. var e = this.player.currentPano.floor;
  18453. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18454. e.add(this.currentPanoMarker.mesh)),
  18455. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18456. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18457. this.currentPanoMarker.placed = !0
  18458. } else
  18459. this.popOutCpm()
  18460. }
  18461. ,
  18462. t.prototype.fadeInCpm = function(e) {
  18463. 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)
  18464. }
  18465. ,
  18466. t.prototype.fadeOutCpm = function(e) {
  18467. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18468. }
  18469. ,
  18470. t.prototype.popInCpm = function() {
  18471. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18472. }
  18473. ,
  18474. t.prototype.popOutCpm = function() {
  18475. this.fadeOutCpm(2)
  18476. }
  18477. ,
  18478. t.prototype.brushPrefs = {
  18479. linewidth: 7,
  18480. strokeWidth: 15,
  18481. cvSegments: 48,
  18482. paveStep: .1,
  18483. paveWidth: .2,
  18484. lookBlendDist: 3,
  18485. maxTurn: P.Math.degToRad(2)
  18486. },
  18487. t.prototype.panoPathDistance = function(e) {
  18488. var t = this.model.panos;
  18489. if (!e || e.length < 2)
  18490. return 0;
  18491. for (var i = [], n = 0; n < e.length; n += 1)
  18492. i.push(t.get(e[n]).floorPosition);
  18493. return this.pointPathDistance(i)
  18494. }
  18495. ,
  18496. t.prototype.loadTileTexture = function(t) {
  18497. var e = n.load(t, function(e) {
  18498. e.wrapS = P.RepeatWrapping,
  18499. e.wrapT = P.RepeatWrapping,
  18500. e.needsUpdate = !0,
  18501. H.debug('path texture "' + t + '" is ready')
  18502. }, function() {
  18503. H.error('path texture "' + t + '" failed')
  18504. });
  18505. return e.mapping = P.UVMapping,
  18506. e
  18507. }
  18508. ,
  18509. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18510. return new l({
  18511. cameraMode: n,
  18512. position: e,
  18513. quaternion: t,
  18514. panoId: i,
  18515. orthoZoom: o,
  18516. floorVisibility: r,
  18517. thumbUrl: null,
  18518. name: null
  18519. })
  18520. }
  18521. ,
  18522. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18523. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18524. }
  18525. ,
  18526. t.prototype.setWarpDestination = function(e) {
  18527. this.warpDestHeroLoc = e
  18528. }
  18529. ,
  18530. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18531. var t = this.getHeroDescriptorByHeroIndex(e);
  18532. return null !== t && (this.setWarpDestination(t),
  18533. !0)
  18534. }
  18535. ,
  18536. t.prototype.setWarpDestinationByPano = function(e, t) {
  18537. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18538. }
  18539. ,
  18540. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18541. var i = this.model.panos.get(e);
  18542. if (i) {
  18543. t = t || new P.Quaternion;
  18544. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18545. return this.setWarpDestination(n),
  18546. !0
  18547. }
  18548. return !1
  18549. }
  18550. ,
  18551. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18552. var t = this.model.heroCount();
  18553. if (null !== this.warpDestHeroLoc && t < 1)
  18554. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18555. this.model.getHeroDescriptorByIndex(0);
  18556. var i = this.model.getHeroDescriptorByIndex(e);
  18557. if (i) {
  18558. var n = i.isPano() ? i.panoId : i.cameraMode;
  18559. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18560. }
  18561. return i
  18562. }
  18563. ,
  18564. t.prototype.getHeroDescriptorByPano = function(e) {
  18565. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18566. }
  18567. ,
  18568. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18569. var t = this.getHeroIndexFromPanoId(e);
  18570. return this.getHeroDescriptorByHeroIndex(t)
  18571. }
  18572. ,
  18573. t.prototype.getHeroIndexFromPanoId = function(e) {
  18574. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18575. var i = this.model.heroLocations[t]
  18576. , n = this.getHeroId(i);
  18577. if (n && n === e)
  18578. return t
  18579. }
  18580. return -1
  18581. }
  18582. ,
  18583. t.prototype.getHeroPano = function(e) {
  18584. if (null === e)
  18585. return H.warn("getHeroPano(): no destination"),
  18586. null;
  18587. var t = this.getHeroId(e)
  18588. , i = this.model.panos.get(t);
  18589. return void 0 === i && (i = null,
  18590. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18591. i
  18592. }
  18593. ,
  18594. t.prototype.getHeroId = function(e) {
  18595. return e.panoId
  18596. }
  18597. ,
  18598. t.prototype.setWarpDestPano = function() {
  18599. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18600. this.warpDestPano
  18601. }
  18602. ,
  18603. t.prototype.brushToWarpPano = function(e, t) {
  18604. if (this.discardPathObject(),
  18605. !this.setWarpDestPano())
  18606. return !1;
  18607. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18608. !this.warpDestPano)
  18609. return H.info("No brush"),
  18610. !1;
  18611. if (!this.player.currentPano)
  18612. return H.debug("No current pano, visibility undefined"),
  18613. !1;
  18614. if (!this.warpDestPano)
  18615. return H.info("No wPano, visibility undefined"),
  18616. !1;
  18617. if (!this.warpDestPano.isAligned())
  18618. return H.debug("Cannot brush to unaligned pano"),
  18619. !1;
  18620. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18621. , n = !0;
  18622. if (this.player.currentPano.id === this.warpDestPano.id)
  18623. H.debug("Already at destination pano");
  18624. else {
  18625. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18626. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18627. this.obj3d = new P.Object3D,
  18628. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18629. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18630. e = t) : (this.setPathHulls(this.nodes),
  18631. this.setFloorCurves(),
  18632. 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)))),
  18633. this.player.currentPano.floor.add(this.obj3d);
  18634. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18635. , o = e === L.STD;
  18636. if (!n && (i || o)) {
  18637. if (r) {
  18638. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18639. this.obj3d.add(a)
  18640. }
  18641. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18642. this.obj3d.add(s)
  18643. }
  18644. this.appearSlow()
  18645. }
  18646. return this.upcomingTransType = e,
  18647. !n
  18648. }
  18649. ,
  18650. t.prototype.findShortestPath = function(e, t) {
  18651. if (!e || !t)
  18652. return null;
  18653. var i = D.warp.walkExtraPanosDistance
  18654. , n = e.id + ":" + t.id + ":" + i;
  18655. if (this.shortPaths.hasOwnProperty(n))
  18656. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18657. var r = t.id + ":" + e.id + ":" + i;
  18658. if (this.shortPaths.hasOwnProperty(r))
  18659. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18660. var o = this.model.panos.aStarSearch(e, t);
  18661. return this.model.panos.includeNodesNearPath(o, i),
  18662. this.shortPaths[n] = o ? o.slice() : null,
  18663. o
  18664. }
  18665. ,
  18666. t.prototype.makePathHulls = function(e) {
  18667. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18668. r = (t = h.get(e[0])).floor.floorIndex;
  18669. for (var u = 0; u < e.length; u += 1)
  18670. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18671. s.push(i),
  18672. l.push(t.position.clone()),
  18673. n = t.floor.floorIndex,
  18674. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18675. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18676. return a > this.longestStep && (this.longestStep = a,
  18677. H.debug("path contains " + a + " meter segment")),
  18678. {
  18679. floor: s,
  18680. camera: l,
  18681. color: c
  18682. }
  18683. }
  18684. ,
  18685. t.prototype.makeFloorCurves = function(e, t, i) {
  18686. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18687. , r = this.pointPathDistance(e) - 2 * n
  18688. , o = e.slice(0)
  18689. , a = o[1].clone().sub(o[0]);
  18690. a.y = 0,
  18691. a.normalize().multiplyScalar(n),
  18692. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18693. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18694. a.normalize().multiplyScalar(n),
  18695. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18696. var s = new P.CatmullRomCurve3(o)
  18697. , l = Math.floor(r / i);
  18698. l = 4 * Math.floor(l / 4),
  18699. l = Math.max(4, l);
  18700. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18701. h = 0,
  18702. c = u[f].distanceTo(e[0]);
  18703. for (var g = 1; g < e.length; g += 1)
  18704. p.copy(u[f]).sub(e[g]),
  18705. p.y *= 4,
  18706. p.length() < c && (h = g);
  18707. d.push(t[h])
  18708. }
  18709. return {
  18710. distance: r,
  18711. points: u,
  18712. colors: d
  18713. }
  18714. }
  18715. ,
  18716. t.prototype.makeCameraCurvePoints = function(e, t) {
  18717. var i = this.pointPathDistance(e);
  18718. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18719. }
  18720. ,
  18721. t.prototype.makeCameraCurveTangents = function(e, t) {
  18722. var i = this.pointPathDistance(e)
  18723. , n = new P.CatmullRomCurve3(e)
  18724. , r = Math.max(2, Math.floor(i / t));
  18725. r = r || 5;
  18726. for (var o = [], a = 0; a <= r; a++)
  18727. o.push(n.getTangentAt(a / r));
  18728. return o
  18729. }
  18730. ,
  18731. t.prototype.setPathHulls = function(e) {
  18732. var t = this.makePathHulls(e);
  18733. this.floorHull = t.floor,
  18734. this.cameraHull = t.camera,
  18735. this.colorHull = t.color
  18736. }
  18737. ,
  18738. t.prototype.setFloorCurves = function() {
  18739. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18740. this.floorPathDistance = e.distance,
  18741. this.floorCurvePoints = e.points,
  18742. this.floorCurveColors = e.colors
  18743. }
  18744. ,
  18745. t.prototype.setCameraCurvePoints = function() {
  18746. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18747. }
  18748. ,
  18749. t.prototype.chooseWarpPath = function(e) {
  18750. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18751. if (this.player.currentPano === this.warpDestPano || !e)
  18752. return this.warpPathPoints = null,
  18753. this.warpLength = 0,
  18754. !1;
  18755. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18756. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18757. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18758. t.multiplyScalar(.15).add(r.position),
  18759. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18760. t.y = r.position.y,
  18761. i.y = this.warpDestPano.position.y,
  18762. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18763. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18764. this.setCameraCurvePoints(),
  18765. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18766. this.warpLength = 0,
  18767. this.warpPathLengths = [0];
  18768. 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) {
  18769. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18770. var h = o.length();
  18771. o.y *= D.warp.climbEffort;
  18772. var u = o.length() / h;
  18773. if (1 < c) {
  18774. o.setY(0).normalize(),
  18775. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18776. var d = Math.min(1, o.dot(a))
  18777. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18778. u = Math.max(p, u)
  18779. }
  18780. this.warpLength += h * u,
  18781. this.warpPathLengths[c] = this.warpLength
  18782. }
  18783. return !0
  18784. }
  18785. ,
  18786. t.prototype.drawPathRibbon = function(e, t) {
  18787. this.bunnyObj.visible = D.warp.showBunny;
  18788. 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) {
  18789. a.copy(e[s]),
  18790. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18791. a.normalize(),
  18792. n.crossVectors(a, U.UP),
  18793. n.multiplyScalar(i);
  18794. var l = (new P.Vector3).copy(e[s]).add(r);
  18795. l.sub(n),
  18796. o.vertices.push(l),
  18797. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18798. o.vertices.push(l)
  18799. }
  18800. var c, h, u, d = 0;
  18801. for (s = 0; s < e.length - 1; s += 1) {
  18802. var p = 2 * s
  18803. , f = d
  18804. , g = d += e[s + 1].distanceTo(e[s])
  18805. , m = t[s]
  18806. , v = t[s + 1];
  18807. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18808. o.faces.push(c),
  18809. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18810. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18811. o.faces.push(c),
  18812. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18813. }
  18814. o.computeFaceNormals(),
  18815. o.computeVertexNormals(),
  18816. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18817. u.opacity.value = 0,
  18818. u.color.value.set(D.path.color),
  18819. new P.RawShaderMaterial({
  18820. side: P.DoubleSide,
  18821. depthWrite: !1,
  18822. transparent: !0,
  18823. vertexShader: C.ribbon.vertexShader,
  18824. fragmentShader: C.ribbon.fragmentShader,
  18825. uniforms: u,
  18826. name: "ribbonT",
  18827. opacity: 0
  18828. })) : new P.MeshBasicMaterial({
  18829. color: 16777215,
  18830. side: P.DoubleSide,
  18831. name: "ribbonOut",
  18832. vertexColors: P.VertexColors
  18833. });
  18834. var y = new P.Mesh(o,h);
  18835. return y.name = "ribbon",
  18836. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18837. y
  18838. }
  18839. ,
  18840. t.prototype.drawPathPavement = function(e) {
  18841. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18842. r.copy(e[o]),
  18843. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18844. r.normalize(),
  18845. i.crossVectors(r, U.UP),
  18846. i.multiplyScalar(this.brushPrefs.paveWidth),
  18847. (t = (new P.Vector3).copy(e[o])).sub(i),
  18848. n.vertices.push(t),
  18849. n.vertices.push((new P.Vector3).copy(e[o])),
  18850. (t = (new P.Vector3).copy(e[o])).add(i),
  18851. n.vertices.push(t);
  18852. var a, s, l;
  18853. for (o = 0; o < e.length - 1; o += 1)
  18854. a = 3 * o + 1,
  18855. l = .25 + (s = .25 * o),
  18856. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18857. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18858. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18859. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18860. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18861. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18862. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18863. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18864. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18865. color: D.path.color,
  18866. side: P.DoubleSide,
  18867. transparent: !0,
  18868. depthWrite: !1,
  18869. opacity: 0,
  18870. name: "paveT",
  18871. map: I.path
  18872. }) : new P.MeshBasicMaterial({
  18873. color: D.path.color,
  18874. side: P.DoubleSide,
  18875. transparent: !0,
  18876. depthWrite: !1,
  18877. opacity: 1,
  18878. name: "paveO",
  18879. map: I.path
  18880. });
  18881. return new P.Mesh(n,c)
  18882. }
  18883. ,
  18884. t.prototype.hintPrefs = {
  18885. rad: .18,
  18886. width: .0125,
  18887. depth: .0625,
  18888. setBack: -.04,
  18889. markRad: .25,
  18890. markInnerRad: .16
  18891. },
  18892. t.prototype.makeWaypointObj = function(e, t) {
  18893. var i = new P.Geometry
  18894. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18895. , r = this.pathHeight();
  18896. 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)),
  18897. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  18898. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  18899. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  18900. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  18901. o.map.value = e,
  18902. o.opacity.value = 0,
  18903. o.color.value.set(D.path.color);
  18904. var a = {
  18905. side: P.DoubleSide,
  18906. depthWrite: !1,
  18907. transparent: !0,
  18908. vertexShader: C.waypoint.vertexShader,
  18909. fragmentShader: C.waypoint.fragmentShader,
  18910. uniforms: o,
  18911. name: "waypoint",
  18912. opacity: 0
  18913. };
  18914. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  18915. a.name = "wayPtOut");
  18916. var s = new P.RawShaderMaterial(a)
  18917. , l = new P.Mesh(i,s);
  18918. return l.name = t,
  18919. l
  18920. }
  18921. ,
  18922. t.prototype.makeStartMarker = function(e, t) {
  18923. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  18924. i.y = 0,
  18925. i.normalize();
  18926. var n = Math.acos(i.x)
  18927. , r = this.makeWaypointObj(I.pathStart, "Start");
  18928. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  18929. r.position.copy(e),
  18930. r
  18931. }
  18932. ,
  18933. t.prototype.makeEndMarker = function(e) {
  18934. var t = this.makeWaypointObj(I.pathEnd, "End")
  18935. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  18936. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  18937. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  18938. t.position.copy(e),
  18939. t
  18940. }
  18941. ,
  18942. t.prototype.pathClean = function(e) {
  18943. if (e) {
  18944. for (var t in e.children)
  18945. this.pathClean(e.children[t]);
  18946. e.geometry && e.geometry.dispose(),
  18947. e.material && e.material.dispose()
  18948. }
  18949. }
  18950. ,
  18951. t.prototype.discardPathObject = function() {
  18952. if (this.obj3d) {
  18953. var e = this.obj3d.parent;
  18954. e && e.remove(this.obj3d),
  18955. this.pathClean(this.obj3d)
  18956. }
  18957. this.obj3d = null,
  18958. this.popInCpm()
  18959. }
  18960. ,
  18961. t.prototype.discardSlow = function() {
  18962. if (this.obj3d) {
  18963. if (this.player.mode !== O.PANORAMA)
  18964. return void this.discardPathObject();
  18965. for (var e, t = 0, i = function() {
  18966. this.discardPathObject()
  18967. }
  18968. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  18969. 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]),
  18970. t += 1,
  18971. i = null);
  18972. 0 === t && this.discardPathObject(),
  18973. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  18974. }
  18975. }
  18976. ,
  18977. t.prototype.appearSlow = function() {
  18978. var e;
  18979. this.fadeOutCpm(D.path.fadeInTime);
  18980. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  18981. 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]))
  18982. }
  18983. ,
  18984. t.prototype.update = function() {
  18985. this.obj3d && this.obj3d.updateMatrixWorld()
  18986. }
  18987. ,
  18988. t.prototype.calcBurnsAmount = function(e) {
  18989. var n = P.Math.degToRad(D.warp.burnsAngle);
  18990. if (this.player.mode !== O.PANORAMA)
  18991. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  18992. var t = this.burnsDir * n;
  18993. if (this.upcomingTransType === L.BLACK)
  18994. return t;
  18995. var i = e;
  18996. if (null === i)
  18997. return H.warn("Transition request for non-highlight"),
  18998. t;
  18999. var r = this.getHeroDescriptorByHeroIndex(i);
  19000. if (null === r)
  19001. return t;
  19002. if (!r.isPano())
  19003. return t;
  19004. function o(e) {
  19005. var t = Math.acos(Math.min(1, e.dot(l)))
  19006. , i = (new P.Vector3).crossVectors(l, e);
  19007. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19008. }
  19009. var a = this.getHeroPano(r)
  19010. , s = this.playerControls.cameras[O.PANORAMA]
  19011. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19012. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19013. if (a === this.player.currentPano)
  19014. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19015. var h = this.findShortestPath(this.player.currentPano, a);
  19016. if (null == h || h.length < 1)
  19017. return H.debug("Empty path ahead..."),
  19018. t;
  19019. var u = this.makePathHulls(h)
  19020. , d = new P.CatmullRomCurve3(u.camera)
  19021. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19022. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19023. }
  19024. ,
  19025. t.prototype.waitNextStep = function(e, t, i) {
  19026. var o = null == i ? D.warp.tourStepDelay : i;
  19027. o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19028. var a = new P.Euler
  19029. , s = new P.Vector3;
  19030. H.debug("Starting wait: " + (void 0 !== t));
  19031. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19032. var l = currentLocation.dontRot || this.calcBurnsAmount(e)
  19033. , c = function() {
  19034. this.endWarpState(),
  19035. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19036. t && t()
  19037. }
  19038. .bind(this)
  19039. , n = function(e, t) {
  19040. if (this.warpInterrupted)
  19041. return c(),
  19042. !0;
  19043. var i = t || 1e3 / 60;
  19044. if (D.warp.doBurns && !currentLocation.dontRot )
  19045. if (this.player.mode === O.PANORAMA) {
  19046. var n = this.playerControls.cameras[O.PANORAMA];
  19047. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19048. var r = o == 0 ? l : i * l / o;
  19049. r = Math.sign(r) * Math.max(r, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19050. a.y += r,
  19051. s.set(0, 0, -1),
  19052. s.applyEuler(a),
  19053. s.add(n.position),
  19054. n.controls.lookAt(s),
  19055. n.controls.lookVector.copy(s),
  19056. n.lookAt(s)
  19057. } else
  19058. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19059. }
  19060. .bind(this);
  19061. this.startWarpState(),
  19062. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19063. }
  19064. ,
  19065. t.prototype.warpToNonPano = function(e) {
  19066. if (this.discardPathObject(),
  19067. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19068. var t = function() {
  19069. e && e()
  19070. }
  19071. .bind(this);
  19072. this.player.flyToNewMode({
  19073. mode: this.warpDestHeroLoc.cameraMode,
  19074. duration: D.warp.outsideTime,
  19075. warpDest: this.warpDestHeroLoc,
  19076. callback: t,
  19077. force: !0
  19078. })
  19079. } else
  19080. H.warn("no warp destination!!!"),
  19081. e && e()
  19082. }
  19083. ,
  19084. t.prototype._resetWarpShaderParams = function(e) {
  19085. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19086. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19087. }
  19088. ,
  19089. t.prototype._clearWarpShading = function() {
  19090. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19091. this._resetWarpShaderParams(e[t]),
  19092. e[t].visible = !0;
  19093. this._resetWarpShaderParams(this.model.skybox)
  19094. }
  19095. ,
  19096. t.prototype._warpStopFlying = function() {
  19097. this.activeTransType = null,
  19098. this.placeCpm()
  19099. }
  19100. ,
  19101. t.prototype._wrapupTravelOnlyBits = function() {
  19102. this._warpStopFlying(),
  19103. this.warpPathPoints && (this.player.currentPano.exit(),
  19104. this.warpDestPano.enter(),
  19105. this.player.currentPano = this.warpDestPano),
  19106. this.player.spider.draw(),
  19107. this.placeCpm()
  19108. }
  19109. ,
  19110. t.prototype._wrapupTravel = function(e) {
  19111. this._wrapupTravelOnlyBits(),
  19112. this.warpCameraAim(e)
  19113. }
  19114. ,
  19115. t.prototype._wrapupWarpShading = function(e) {
  19116. this._clearWarpShading(),
  19117. this._wrapupTravel(e)
  19118. }
  19119. ,
  19120. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19121. t !== z.END && this._clearWarpShading(),
  19122. this._wrapupTravelOnlyBits(),
  19123. this.upcomingTransType = null,
  19124. e && e()
  19125. }
  19126. ,
  19127. t.prototype._warpCameraAim = function(e, t) {
  19128. var i = this.warpDestHeroLoc.quaternion
  19129. , n = this.playerControls.cameras[O.PANORAMA]
  19130. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19131. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19132. , a = P.Math.radToDeg(Math.acos(o))
  19133. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19134. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19135. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19136. c.y = N.constrainedTurn(c.y),
  19137. this.burnsDir = Math.sign(c.y);
  19138. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19139. , u = new P.Vector3
  19140. , d = function(e, t) {
  19141. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19142. h.y = l.y + e * c.y,
  19143. h.z = l.z + e * c.z,
  19144. u.set(0, 0, -1),
  19145. u.applyEuler(h),
  19146. u.add(n.position),
  19147. n.controls.lookAt(u),
  19148. n.controls.lookVector.copy(u),
  19149. void n.lookAt(u))
  19150. }
  19151. .bind(this);
  19152. /* return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
  19153. , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19154. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19155. )
  19156. : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19157. void (t && t())) */
  19158. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  19159. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  19160. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing])
  19161. : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
  19162. void (t && t()))
  19163. }
  19164. ,
  19165. t.prototype._warpBendAim = function(e, t, i, n) {
  19166. var r = n || 0
  19167. , o = this.playerControls.cameras[O.PANORAMA]
  19168. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19169. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19170. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19171. l.y = N.constrainedTurn(l.y);
  19172. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19173. l.x = c * Math.sign(l.x),
  19174. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19175. this.burnsDir = Math.sign(l.y),
  19176. c *= Math.sign(l.y),
  19177. l.y = c;
  19178. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19179. , u = new P.Vector3
  19180. , d = function(e, t) {
  19181. if (e < .5)
  19182. h.x = s.x + e * l.x,
  19183. h.y = s.y + e * l.y,
  19184. h.z = s.z + e * l.z;
  19185. else {
  19186. var i = (1 - e) * D.warp.softBendEnd;
  19187. h.x = a.x - i * l.x,
  19188. h.y = a.y - i * l.y,
  19189. h.z = a.z - i * l.z
  19190. }
  19191. u.set(0, 0, -1),
  19192. u.applyEuler(h),
  19193. u.add(o.position),
  19194. o.controls.lookAt(u),
  19195. o.controls.lookVector.copy(u),
  19196. o.lookAt(u)
  19197. }
  19198. .bind(this);
  19199. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19200. }
  19201. ,
  19202. t.prototype._warpStepCameraAim = function(e, t, i) {
  19203. var n = this.playerControls.cameras[O.PANORAMA]
  19204. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19205. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19206. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19207. a.y = N.constrainedTurn(a.y),
  19208. this.burnsDir = Math.sign(a.y);
  19209. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19210. , l = new P.Vector3
  19211. , c = function(e, t) {
  19212. e < .5 ? s.copy(o) : s.copy(r),
  19213. l.set(0, 0, -1),
  19214. l.applyEuler(s),
  19215. l.add(n.position),
  19216. n.controls.lookAt(l),
  19217. n.controls.lookVector.copy(l),
  19218. n.lookAt(l)
  19219. }
  19220. .bind(this);
  19221. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19222. }
  19223. ,
  19224. t.prototype.setBurnsDir = function() {
  19225. var e = this.playerControls.cameras[O.PANORAMA]
  19226. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19227. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19228. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19229. n.y = N.constrainedTurn(n.y),
  19230. this.burnsDir = Math.sign(n.y)
  19231. }
  19232. ,
  19233. t.prototype.stepWarpPath = function(firstPos, e ) {
  19234. var i = this.playerControls.cameras[O.PANORAMA];
  19235. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  19236. if (!n){
  19237. return i.position.copy(this.warpDestPano.position),
  19238. !0;
  19239. }
  19240. /* if (!this.warpPathPoints)
  19241. return i.position.copy(this.warpDestPano.position),
  19242. !0;
  19243. var n = this.warpPathPoints[0] */
  19244. var r = this.warpDestPano.position;
  19245. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  19246. var o = new P.Vector3;
  19247. 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),
  19248. i.position.copy(o)
  19249. } else
  19250. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19251. }
  19252. ,
  19253. t.prototype.interruptAndFastForward = function(e, t) {
  19254. this.warping && (this.warpInterrupted = !0,
  19255. this.warpInterruptionBlackoutStyle = e,
  19256. this.warpInterruptionTravelTime = t,
  19257. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19258. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19259. }
  19260. ,
  19261. t.prototype.warpCameraAim = function(e) {
  19262. var t = D.warp.minWarpTime;
  19263. if (this.upcomingTransType === L.BLACK)
  19264. t = D.warp.teleportTime;
  19265. else {
  19266. var i = this.playerControls.cameras[O.PANORAMA]
  19267. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19268. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19269. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19270. o.y = N.constrainedTurn(o.y);
  19271. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19272. t = Math.max(t, a)
  19273. }
  19274. var s = function() {
  19275. this._warpStopFlying(),
  19276. this.discardSlow(),
  19277. e && e()
  19278. }
  19279. .bind(this);
  19280. this._warpCameraAim(t, s)
  19281. }
  19282. ,
  19283. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19284. this.model.skybox.material.uniforms.blackout.value = n;
  19285. var r = F.uniform(this.model.skybox, "progress", 1)
  19286. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19287. , a = !1
  19288. , s = function() {
  19289. if (this.warpInterrupted)
  19290. return a = !0
  19291. }
  19292. .bind(this)
  19293. , l = function(e, t) {
  19294. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19295. }
  19296. .bind(this)
  19297. , c = function(e, t) {
  19298. return i && a ? (o(0),
  19299. !0) : void o(e, t)
  19300. }
  19301. .bind(this);
  19302. V.start(s, e, null, t, null, "safeHaltWatch"),
  19303. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19304. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19305. }
  19306. ,
  19307. t.prototype.warpTravel_STD = function(e) {
  19308. 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),
  19309. 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;
  19310. t += this.warpLength * D.warp.timePerMeter,
  19311. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19312. function n(e) {
  19313. var t = i;
  19314. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19315. }
  19316. var y = !1
  19317. , r = this.warpDestHeroLoc.quaternion
  19318. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19319. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19320. , a = A.dot(o)
  19321. , C = P.Math.radToDeg(Math.acos(a))
  19322. , s = function() {
  19323. return m.lookAt(g, l, U.UP),
  19324. u.setFromRotationMatrix(m, D.warp.eOrder),
  19325. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19326. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19327. N.constrainedTurn(v.y)
  19328. }
  19329. .bind(this)
  19330. , I = function(e, t) {
  19331. if (this.warpInterrupted)
  19332. return y = !0
  19333. }
  19334. .bind(this)
  19335. , E = function(e, t) {
  19336. return y || !this.warpPathPoints ? (k.blur(0),
  19337. !0) : void k.blur(e)
  19338. }
  19339. .bind(this)
  19340. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19341. , b = function(e, t) {
  19342. return y || !this.warpPathPoints ? (_(0),
  19343. !0) : void _(e, t)
  19344. }
  19345. .bind(this)
  19346. , w = function(e, t) {
  19347. if (!this.warpPathPoints)
  19348. return h.position.copy(this.warpDestPano.position),
  19349. !0;
  19350. if (y)
  19351. return !0;
  19352. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19353. h.position.copy(i),
  19354. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19355. }
  19356. .bind(this)
  19357. , T = function(e, t) {
  19358. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19359. !0)
  19360. }
  19361. .bind(this)
  19362. , x = function(e, t) {
  19363. if (y)
  19364. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19365. !0;
  19366. if (!this.warpPathPoints)
  19367. return !0;
  19368. var i = this.warpLength * e
  19369. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19370. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19371. D.warp.matchCam && (n *= 1 - r),
  19372. m.lookAt(g, l, U.UP),
  19373. u.setFromRotationMatrix(m, D.warp.eOrder),
  19374. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19375. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19376. v.y = N.constrainedTurn(v.y),
  19377. u.x = p.x + n * v.x,
  19378. u.y = p.y + n * v.y,
  19379. u.z = p.z + n * v.z,
  19380. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19381. v.y = N.constrainedTurn(v.y);
  19382. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19383. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19384. f.x = f.x + v.x * D.warp.turnFriction,
  19385. f.y = f.y + v.y * D.warp.turnFriction,
  19386. f.z = f.z + v.z * D.warp.turnFriction,
  19387. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19388. var a = l.clone().sub(g).normalize();
  19389. if (C < D.warp.maxAimRotation && 0 < r) {
  19390. var s = 1 - r;
  19391. a.x = a.x * s + r * A.x,
  19392. a.y = a.y * s + r * A.y,
  19393. a.z = a.z * s + r * A.z,
  19394. a.normalize()
  19395. }
  19396. this.bunnyObj.position.copy(h.position).add(a),
  19397. d.set(0, 0, -1).applyEuler(f).normalize(),
  19398. d.multiplyScalar(8),
  19399. d.add(h.position),
  19400. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19401. h.controls.lookVector.copy(d),
  19402. h.lookAt(d))
  19403. }
  19404. .bind(this)
  19405. , S = function() {
  19406. y ? (this.discardSlow(),
  19407. this.upcomingTransType = L.BLACK,
  19408. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19409. }
  19410. .bind(this);
  19411. T(0);
  19412. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19413. , R = M / (t += M);
  19414. this.warpCommonParameters(t, R, !0, z.NONE),
  19415. V.start(I, t, null, 0, null, "_haltWatcher"),
  19416. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19417. V.start(E, t, null, R, n, "blurring")),
  19418. V.start(b, t, null, R, n, "modelAlpha"),
  19419. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19420. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19421. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19422. }
  19423. ,
  19424. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19425. var r = e || 0;
  19426. null != t || (t = D.warp.teleportTime),
  19427. this.warpCommonParameters(t, r, !1, i),
  19428. this.model.chunks.forEach(function(e) {
  19429. e.material.uniforms.blackout.value = i
  19430. }),
  19431. this._warpBendAim(null, t, null, r);
  19432. //add
  19433. var done = ()=>{
  19434. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  19435. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  19436. //Overlay.updateVisibles([this.player.currentPano])
  19437. }
  19438. var o = function() {
  19439. this.wrapupWarpShadingOnly(n, i)
  19440. done()
  19441. }
  19442. .bind(this);
  19443. var firstPos = this.player.position.clone()//add
  19444. V.start(this.stepWarpPath.bind(this, firstPos), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19445. }
  19446. ,
  19447. t.prototype.flightStepWalk = (a = new P.Vector3,
  19448. s = new P.Vector3,
  19449. function(e, t, i) {
  19450. if (this.warpInterrupted)
  19451. i && i();
  19452. else if (this.activeTransType !== L.WALK)
  19453. this._clearWarpShading(),
  19454. this._warpStopFlying(),
  19455. this.player.spider.draw(),
  19456. this.placeCpm(),
  19457. i && i();
  19458. else if (this.player.currentPano !== e) {
  19459. var n = {
  19460. pano: e,
  19461. lookAtPoint: t,
  19462. duration: null,
  19463. maxDistanceOverride: D.warp.walkMaxDist,
  19464. skipWarpingCheck: !1,
  19465. constantMoveSpeed: !0
  19466. };
  19467. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  19468. n.zoomLevel = this.warpDestHeroLoc.zoom
  19469. }
  19470. n.duration = function(e, t) {
  19471. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19472. s.copy(U.FORWARD),
  19473. this.player.getDirection(s),
  19474. a.copy(t).sub(e.position).normalize();
  19475. var n = a.dot(s)
  19476. , r = Math.acos(n)
  19477. , o = r / i;
  19478. .001 < o && (i *= o / .001, //-----这是什么????
  19479. r < 1 && (i *= 1.2))
  19480. return i / DATA.tourWalkSpeed * 100
  19481. }
  19482. .call(this, e, t),
  19483. this.player.nonInterruptingFlyToPano(n, i)
  19484. } else
  19485. i && i()
  19486. }
  19487. ),
  19488. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19489. return this.flightStepWalk.bind(this, e, t, i)
  19490. }
  19491. ,
  19492. t.prototype.warpTravel_WALK = (f = [],
  19493. function(e) {
  19494. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19495. var o = this.nodes[r]
  19496. , a = t.get(o);
  19497. this.nodes.length,
  19498. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19499. i && n || (f.push(o),
  19500. i = a)
  19501. }
  19502. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19503. var s = f.length
  19504. , l = t.get(f[s - 1])
  19505. , c = new Array(s + 1);
  19506. c[c.length - 1] = function() {
  19507. e && e()
  19508. }
  19509. .bind(this);
  19510. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19511. var d = f[h];
  19512. l = t.get(d);
  19513. var p = new P.Vector3;
  19514. this.getLookAtForWalkingTourNode(f, h, p),
  19515. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19516. h--
  19517. }
  19518. c[0]()
  19519. }
  19520. ),
  19521. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19522. h = new P.Vector3,
  19523. u = new P.Vector3,
  19524. d = new P.Vector3,
  19525. p = new P.Vector3,
  19526. function(e, t, i) {
  19527. var n = e.length;
  19528. if (n <= t)
  19529. return !1;
  19530. var r = 1
  19531. , o = 1;
  19532. h.set(0, 0, 0),
  19533. p.set(0, 0, 0);
  19534. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19535. if (a = this.player.model.panos.get(e[s]),
  19536. this.getOrientationForWalkingTourNode(e, s, u),
  19537. s === t && c.copy(u),
  19538. d.copy(u),
  19539. t < s) {
  19540. var l = d.dot(c) < .65;
  19541. r *= l ? .2 : .75,
  19542. o *= l ? .2 : .4
  19543. }
  19544. u.multiplyScalar(r),
  19545. h.add(u),
  19546. p.lerp(a.position, o)
  19547. }
  19548. return h.normalize(),
  19549. i.copy(p),
  19550. i.add(h),
  19551. !0
  19552. }
  19553. ),
  19554. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19555. var n = e.length;
  19556. if (n <= t)
  19557. return !1;
  19558. if (t === n - 1)
  19559. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19560. else {
  19561. var r = this.player.model.panos.get(e[t])
  19562. , o = this.player.model.panos.get(e[t + 1]);
  19563. i.copy(o.position).sub(r.position)
  19564. }
  19565. return i.normalize(),
  19566. !0
  19567. }
  19568. ,
  19569. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19570. if (this.activeTransType = this.upcomingTransType,
  19571. this.lastTransType = this.activeTransType,
  19572. this.upcomingTransType = null,
  19573. e)
  19574. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19575. this._clearWarpShading(),
  19576. this._warpStopFlying(),
  19577. this.player.spider.draw(),
  19578. this.placeCpm(),
  19579. n && n()
  19580. }
  19581. .bind(this)) : this.warpTravel_STD(n);
  19582. else {
  19583. var r = function() {
  19584. this._wrapupTravel(n)
  19585. }
  19586. .bind(this)
  19587. , o = {
  19588. pano: this.warpDestPano,
  19589. lookAtPoint: null,
  19590. duration: null,
  19591. maxDistanceOverride: null,
  19592. skipWarpingCheck: !1
  19593. };
  19594. this.player.flyToPano(o, r)
  19595. }
  19596. }
  19597. ,
  19598. t.prototype.startWarpState = function() {
  19599. this.warping = !0,
  19600. this.warpInterrupted = !1,
  19601. this.warpInterruptionBlackoutStyle = null,
  19602. this.warpInterruptionTravelTime = null
  19603. }
  19604. ,
  19605. t.prototype.endWarpState = function() {
  19606. this.warping = !1
  19607. }
  19608. ,
  19609. t.prototype.warpToPano = function(e, t, i, n) {
  19610. if (this.warping)
  19611. H.warn("Cannot warp when already warping");
  19612. else {
  19613. if (this.upcomingTransType = e,
  19614. this.activeTransType = null,
  19615. !this.setWarpDestPano())
  19616. return this.upcomingTransType = null,
  19617. void this.warpToNonPano(n);
  19618. if (this.player.mode !== O.PANORAMA)
  19619. return this.upcomingTransType = null,
  19620. this.discardSlow(),
  19621. void this.player.flyToNewMode({
  19622. mode: O.PANORAMA,
  19623. pano: this.warpDestPano,
  19624. duration: D.warp.outsideTime,
  19625. warpDest: this.warpDestHeroLoc,
  19626. callback: n,
  19627. force: !0
  19628. });
  19629. if (!this.warpDestPano)
  19630. return H.warn("no warp destination, callback dropped"),
  19631. void (this.upcomingTransType = null);
  19632. 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)
  19633. , o = this.chooseWarpPath(r);
  19634. if (o && this.upcomingTransType !== L.WALK) {
  19635. var a = function() {
  19636. this.waitingToWarp = !1,
  19637. this.warpToPano(e, t, i, n)
  19638. }
  19639. .bind(this);
  19640. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19641. return void (this.waitingToWarp = !0)
  19642. }
  19643. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19644. this.player.currentPano = this.warpDestPano,
  19645. this.placeCpm(),
  19646. this.fadeOutCpm(D.path.fadeOutTime),
  19647. this.player.spider.draw()),
  19648. H.debug("Warping to pano ", this.warpDestPano.position),
  19649. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19650. this.startWarpState();
  19651. var s = function() {
  19652. this.endWarpState(),
  19653. n && n()
  19654. }
  19655. .bind(this);
  19656. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19657. }
  19658. }
  19659. ,
  19660. v.exports = t
  19661. }
  19662. ).call(this, "/js/objects/ShowPath.js")
  19663. }
  19664. , {
  19665. "../constants": 8,
  19666. "../effects": 16,
  19667. "../enum/BlackoutStyle": 18,
  19668. "../enum/ModelManagerEvents": 33,
  19669. "../enum/PlayerEvents": 40,
  19670. "../enum/RenderOrder": 42,
  19671. "../enum/Vectors": 50,
  19672. "../enum/Viewmode": 51,
  19673. "../enum/WarpStyle": 52,
  19674. "../gui/gui": 65,
  19675. "../model/ModelManager": 140,
  19676. "../objects/Snapshot": 153,
  19677. "../settings": 166,
  19678. "../shaders": 167,
  19679. "../util/easing": 186,
  19680. "../util/lerp": 188,
  19681. "../util/logger": 189,
  19682. "../util/math": 190,
  19683. "../util/texture": 194,
  19684. "../util/transitions": 195,
  19685. three: 217
  19686. }],
  19687. 152: [function(e, t, i) {
  19688. "use strict";
  19689. function n() {
  19690. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19691. , t = new r.RawShaderMaterial({
  19692. fragmentShader: o.skysphere.fragmentShader,
  19693. vertexShader: o.skysphere.vertexShader,
  19694. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19695. side: r.BackSide,
  19696. name: "skysphere"
  19697. });
  19698. t.uniforms.radius.value = e.parameters.radius,
  19699. r.Mesh.call(this, e, t)
  19700. }
  19701. var r = e("three")
  19702. , o = e("../shaders")
  19703. , a = e("../settings");
  19704. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19705. t.exports = n
  19706. }
  19707. , {
  19708. "../settings": 166,
  19709. "../shaders": 167,
  19710. three: 217
  19711. }],
  19712. 153: [function(r, o, e) {
  19713. (function(e) {
  19714. "use strict";
  19715. function t(e) {
  19716. n.call(this, e),
  19717. this.sid = e.sid,
  19718. this.panoId = e.panoId,
  19719. this.orthoZoom = e.orthoZoom,
  19720. this.floorVisibility = e.floorVisibility,
  19721. this.thumbUrl = e.thumbUrl,
  19722. this.name = e.name,
  19723. this.zoom = e.zoom
  19724. }
  19725. var i = (r("three"),
  19726. r("../util/logger"))
  19727. , n = (r("../settings"),
  19728. r("../enum/Viewmode"),
  19729. r("../util/common"),
  19730. r("../util/transitions"),
  19731. r("../util/lerp"),
  19732. r("../util/ajax"),
  19733. r("../util/texture"),
  19734. r("./View"));
  19735. r("events").EventEmitter,
  19736. new i(e),
  19737. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19738. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19739. }
  19740. ,
  19741. o.exports = t
  19742. }
  19743. ).call(this, "/js/objects/Snapshot.js")
  19744. }
  19745. , {
  19746. "../enum/Viewmode": 51,
  19747. "../settings": 166,
  19748. "../util/ajax": 181,
  19749. "../util/common": 185,
  19750. "../util/lerp": 188,
  19751. "../util/logger": 189,
  19752. "../util/texture": 194,
  19753. "../util/transitions": 195,
  19754. "./View": 154,
  19755. events: 202,
  19756. three: 217
  19757. }],
  19758. 154: [function(o, a, e) {
  19759. (function(e) {
  19760. "use strict";
  19761. function t(e) {
  19762. e = e || {},
  19763. this.position = new i.Vector3,
  19764. this.quaternion = new i.Quaternion,
  19765. this.update(e)
  19766. }
  19767. var i = o("three")
  19768. , n = o("../util/logger")
  19769. , r = (o("../settings"),
  19770. o("../enum/Viewmode"),
  19771. o("../util/common"),
  19772. o("../util/transitions"),
  19773. o("../util/lerp"),
  19774. o("../util/ajax"),
  19775. o("../util/texture"),
  19776. o("events").EventEmitter);
  19777. new n(e),
  19778. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19779. return !!this.cameraMode
  19780. }
  19781. ,
  19782. t.prototype.update = function(e) {
  19783. return this.cameraMode = e.cameraMode || this.cameraMode,
  19784. this.pano = e.pano || this.pano,
  19785. e.position && this.position.copy(e.position),
  19786. e.quaternion && this.quaternion.copy(e.quaternion),
  19787. this
  19788. }
  19789. ,
  19790. a.exports = t
  19791. }
  19792. ).call(this, "/js/objects/View.js")
  19793. }
  19794. , {
  19795. "../enum/Viewmode": 51,
  19796. "../settings": 166,
  19797. "../util/ajax": 181,
  19798. "../util/common": 185,
  19799. "../util/lerp": 188,
  19800. "../util/logger": 189,
  19801. "../util/texture": 194,
  19802. "../util/transitions": 195,
  19803. events: 202,
  19804. three: 217
  19805. }],
  19806. 155: [function(J, ee, e) {
  19807. (function(e) {
  19808. "use strict";
  19809. function t(e) {
  19810. this.currentPano = null,
  19811. this.nextPano = null,
  19812. this.camera = null,
  19813. this.paused = !1,
  19814. this.flying = !1,
  19815. this.sceneIntersectionPlane = null,
  19816. this.target = new B.Vector3,
  19817. this.mouse = new B.Vector3(1.1,1.1,.5),
  19818. this.mouseAtMouseDown = new B.Vector2,
  19819. this.mouseCouldBeClickToMove = !1,
  19820. this.mouseLastMoveTime = Date.now(),
  19821. this.mouseDown = !1,
  19822. this.mouseDownTimer = null,
  19823. this.couldBeLongTap = !1,
  19824. this.containsMouse = !0,
  19825. this.isTouchEvent = !1,
  19826. this.isPanoHover = !1,
  19827. this.reticule = new n(this),
  19828. this.panoMarkers = [],
  19829. this.spider = new s(this),
  19830. this.quaternion = new B.Quaternion,
  19831. this.position = new B.Vector3(15,10,15),
  19832. this.previousState = null,
  19833. this.lastInsideView = new o,
  19834. this.last360View = new o,
  19835. this.raycaster = new B.Raycaster,
  19836. this.intersect = null,
  19837. this.lastChangeTime = Date.now(),
  19838. this.history = new h,
  19839. this.cameraControls = null,
  19840. this.path = null,
  19841. this.model = null,
  19842. this.domElement = null,
  19843. this.cachedPanoCandidates = null,
  19844. this.basePanoSize = 0,
  19845. this.standardPanoSize = 0,
  19846. this.highPanoSize = 0,
  19847. this.ultraHighPanoSize = 0,
  19848. this.zoomLevel = 1,
  19849. this.zooming = 0,
  19850. this.zoomSpeed = .5,
  19851. this.scrollZoomSpeed = .06,
  19852. this.zoomSpeedAdjust = .05,
  19853. this.defaultZoomIncrement = .2,
  19854. this.baseFov = k.insideFOV,
  19855. this.zoomFov = this.baseFov,
  19856. this.zoomEnabled = !0,
  19857. this.preRenderingEnabled = !1,
  19858. this.setupCustomProperties(e),
  19859. this.zoomStats = new v,
  19860. this.modeTran = 'dollhouse-panorama'
  19861. this.currentCursor = '';
  19862. window.player = this
  19863. }
  19864. var B = J("three")
  19865. , i = J("./util/logger")
  19866. , n = J("./objects/Reticule")
  19867. , a = J("./objects/Panorama")
  19868. , r = J("./objects/ShowPath")
  19869. , o = J("./objects/View")
  19870. , s = (J("./objects/Snapshot"),
  19871. J("./objects/NSpider"))
  19872. , V = J("./enum/Viewmode")
  19873. , T = (J("./enum/TagStates"),
  19874. J("./enum/Vectors"))
  19875. , l = J("./enum/Keys")
  19876. , k = (J("./enum/AlignmentType"),
  19877. J("./settings"))
  19878. , x = J("./util/common")
  19879. , U = (J("./util/browser"),
  19880. J("./util/math"))
  19881. , H = J("./util/lerp")
  19882. , z = J("./util/easing")
  19883. , G = J("./util/transitions")
  19884. , c = J("events").EventEmitter
  19885. , h = (J("./shaders"),
  19886. J("./util/history"))
  19887. , S = (J("./util/camera"),
  19888. J("./model/ModelManager"),
  19889. J("./enum/PathDiscardMode"))
  19890. , M = J("./enum/PathDisplayMode")
  19891. , W = J("./enum/PlayerEvents")
  19892. , u = J("./enum/ControlEvents")
  19893. , d = J("./enum/ModelManagerEvents")
  19894. , R = J("./enum/WarpStyle")
  19895. , P = J("./enum/BlackoutStyle")
  19896. , p = J("./exception/BasicException")
  19897. , f = J("./enum/PanoSizeClass")
  19898. , g = (J("./tile/TileDownloader"),
  19899. J("./tile/TilePrioritizer"))
  19900. , m = (J("./enum/PanoramaEvents"),
  19901. J("./enum/ZoomEvents"))
  19902. , v = J("./util/ZoomStats")
  19903. , y = J("./constants")
  19904. , j = J("./util/common")
  19905. , A = J("./util/cameraLight")
  19906. //, C = J("hot")
  19907. , Y = new i(e)
  19908. , q = Object.freeze({
  19909. FlyToPano: G.getUniqueId(),
  19910. FlyToNewMode: G.getUniqueId(),
  19911. FlyToSameMode: G.getUniqueId(),
  19912. FlyToViewFloor: G.getUniqueId(),
  19913. LookTransition: G.getUniqueId(),
  19914. ZoomTransition: G.getUniqueId()
  19915. });
  19916. function I(e) {
  19917. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  19918. o[r] = n.charCodeAt(r);
  19919. return new Blob([o],{
  19920. type: i
  19921. })
  19922. }
  19923. (t.prototype = Object.create(c.prototype)).init = function(e) {
  19924. this.modelManager = e.modelManager,
  19925. this.tileDownloader = e.tileDownloader,
  19926. this.panoRenderer = e.panoRenderer,
  19927. this.qualityManager = e.qualityManager,
  19928. this.domElement = e.container,
  19929. this.camera = e.camera,
  19930. this.tagManager = e.tagManager,
  19931. this.cameraControls = e.controls,
  19932. this.path = new r(e.director,this,e.controls),
  19933. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  19934. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  19935. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  19936. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  19937. this.tileDownloader.processPriorityQueue = !1,
  19938. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  19939. this.bindEvents(e.container),
  19940. this.updateModel()
  19941. }
  19942. ,
  19943. t.prototype.screenShot = function(i) {
  19944. if (!this.flying && !this.flyingToTag) {
  19945. var n = this.sceneRenderer;
  19946. n.updateScreenSize(i)
  19947. this.model.panos.forEach(e=>{
  19948. if(e.marker){
  19949. e.marker.forceHide = e.marker.visible
  19950. e.marker.visible = !1;
  19951. }
  19952. })
  19953. /* for (var e in this.model.hots)
  19954. this.model.hots[e].mesh.visible = !1; */
  19955. player.model.hotGroup.visible = false
  19956. this.reticule.visible = !1,
  19957. this.reticule.forceUnvisible = !0,
  19958. this.path.currentPanoMarker.mesh.visible = !1,
  19959. setTimeout(function() {
  19960. n.renderer.clear(!0, !0, !0),
  19961. n.renderer.render(n.scene, n.camera);
  19962. var e = n.renderer.domElement.toDataURL(i.type, .9);
  19963. i.f && i.f(e)
  19964. n.updateScreenSize({
  19965. resize: !0
  19966. })
  19967. this.reticule.visible = !0
  19968. player.model.hotGroup.visible = true
  19969. this.model.panos.forEach(e=>{
  19970. e.marker && (e.marker.visible = e.marker.forceHide);
  19971. })
  19972. this.path.currentPanoMarker.mesh.visible = !0,
  19973. n.renderer.render(n.scene, n.camera)
  19974. }
  19975. .bind(this), 30)
  19976. }
  19977. }
  19978. ;
  19979. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  19980. t.prototype.getWrapShot = function() {
  19981. var i = this.getSnapAngleInfo()
  19982. , n = ",{\r\t" + i
  19983. , r = arguments[0];
  19984. this.screenShot({
  19985. width: g_snapShotWidth,
  19986. height: g_snapShotHeight,
  19987. type: "image/jpeg",
  19988. f: function(e) {
  19989. if (r && r.__callback)
  19990. return r.__callback(e, i);
  19991. var t = new Image;
  19992. t.src = e,
  19993. t.onload = function() {
  19994. var e = function(r, i) {
  19995. function n(e, t) {
  19996. var i = o || r
  19997. , n = document.createElement("canvas");
  19998. n.width = i.width,
  19999. n.height = i.height,
  20000. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20001. o = Q(e, n, t)
  20002. }
  20003. function e() {
  20004. var e = o || r
  20005. , t = I(e.src);
  20006. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20007. t = I(e.src)),
  20008. (o = o || new Image).base64Src = e.src,
  20009. o.src = window.URL.createObjectURL(t)
  20010. }
  20011. var o, t = Math.max(r.width, r.height);
  20012. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20013. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20014. e())),
  20015. o || r
  20016. }(this, {
  20017. maxSize: g_snapShotWidth,
  20018. oldType: "jpeg"
  20019. });
  20020. e.src.replace(function(e) {
  20021. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20022. }("image/jpeg"), "image/octet-stream");
  20023. var t = "snap" + (new Date).getTime();
  20024. !function(e, t) {
  20025. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20026. i.href = e,
  20027. i.download = t;
  20028. var n = document.createEvent("MouseEvents");
  20029. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20030. i.dispatchEvent(n)
  20031. }(e.src, t + ".jpg"),
  20032. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20033. n += '\r\t"sid":"' + t + '",',
  20034. n += '\r\t"name":"' + t + '"\r}',
  20035. logData(n)
  20036. }
  20037. }
  20038. })
  20039. }
  20040. /* ,
  20041. t.prototype.getSnapAngleInfo = function() {
  20042. var e = {}
  20043. , t = '"metadata":{'
  20044. , i = this.camera.quaternion.clone();
  20045. switch (this.mode) {
  20046. case "panorama":
  20047. e.scan_id = this.currentPano.id,
  20048. t += '"scan_id":"' + this.currentPano.id + '",';
  20049. break;
  20050. case "floorplan":
  20051. e.camera_mode = 1,
  20052. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20053. t += '"camera_mode":1,',
  20054. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20055. break;
  20056. case "dollhouse":
  20057. e.camera_mode = 2,
  20058. t += '"camera_mode":2,'
  20059. }
  20060. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20061. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20062. n.x *= -1,
  20063. n.w *= -1,
  20064. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20065. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20066. e.zoom = this.zoomLevel,
  20067. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20068. }
  20069. , */
  20070. t.prototype.getSnapAngleInfo = function(){
  20071. var info = {};
  20072. var str = '"metadata":{';
  20073. var q = this.camera.quaternion.clone();
  20074. switch (this.mode) {
  20075. case "panorama":
  20076. info.scan_id = this.currentPano.id;
  20077. str += ('"scan_id":"'+this.currentPano.id+'",');
  20078. break;
  20079. case "floorplan":
  20080. info.camera_mode = 1;
  20081. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20082. q.multiply(this.camera.quaternion);
  20083. str += ('"camera_mode":1,');
  20084. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20085. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20086. break;
  20087. case "dollhouse":
  20088. info.camera_mode = 2;
  20089. str += ('"camera_mode":2,');
  20090. break;
  20091. }
  20092. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20093. //console.log(info.camera_position)
  20094. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20095. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20096. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20097. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20098. out.x *= -1;
  20099. out.w *= -1;
  20100. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20101. }else{
  20102. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20103. } */
  20104. info.zoom = this.zoomLevel;
  20105. //console.log(info.camera_quaternion)
  20106. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20107. // fyz 扩展编辑页面, 加上导览点缩放值
  20108. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20109. console.log(str)
  20110. return str;
  20111. }
  20112. //------end
  20113. ,
  20114. t.prototype.setupCustomProperties = function(e) {
  20115. var i = e || V.PANORAMA;
  20116. Object.defineProperty(this, "mode", {
  20117. get: function() {
  20118. return i
  20119. },
  20120. set: function(e) {
  20121. var t = i;
  20122. i = e,
  20123. this.onModeUpdated(t, i)
  20124. }
  20125. })
  20126. }
  20127. ,
  20128. t.prototype.isInMode = function() {
  20129. for (var e = 0; e < arguments.length; e++)
  20130. if (this.mode === arguments[e])
  20131. return !0;
  20132. return !1
  20133. }
  20134. ,
  20135. t.prototype.isOutsideMode = function(e) {
  20136. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20137. }
  20138. ,
  20139. t.prototype.is360View = function(e, t) {
  20140. return e === V.PANORAMA && t && !t.isAligned()
  20141. }
  20142. ,
  20143. t.prototype.setScene = function(e) {
  20144. this.sceneIntersectionPlane = e.plane,
  20145. this.path.setScene(e),
  20146. this.moveReticuleToScene(e)
  20147. }
  20148. ,
  20149. t.prototype.moveReticuleToScene = function(e) {
  20150. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20151. e.add(this.reticule)
  20152. }
  20153. ,
  20154. t.prototype.updateModel = function() {
  20155. function n(e) {
  20156. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20157. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20158. , n = t.position.y + (e - i.target.y)
  20159. , r = k.showFloorDuration + k.showFloorDelay;
  20160. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20161. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20162. }
  20163. this.model = this.modelManager.getActiveModel(),
  20164. this.model.on("floor.changed", function(e, t, i) {
  20165. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20166. }
  20167. .bind(this)),
  20168. this.model.on("allfloors.toggled", function(e, t) {
  20169. if (this.mode === V.DOLLHOUSE) {
  20170. var i = e ? this.model.center.y : i = t.center.y;
  20171. n.call(this, i)
  20172. }
  20173. }
  20174. .bind(this)),
  20175. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20176. var t = this;
  20177. this.model.panos.list.forEach(function(e) {
  20178. e.vrMarker.addEventListener("click", function() {
  20179. t.flyToPano({
  20180. pano: e
  20181. })
  20182. })
  20183. })
  20184. }
  20185. ,
  20186. t.prototype.updateModelDependentData = function() {
  20187. this.cameraControls.setModelForControls(this.model),
  20188. this.getPanoMarkersFromModel(this.model)
  20189. }
  20190. ,
  20191. t.prototype.onModelChanged = function() {
  20192. this.updateModel(),
  20193. this.updateModelDependentData()
  20194. }
  20195. ,
  20196. t.prototype.getPanoMarkersFromModel = function(e) {
  20197. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20198. return t.marker ? e.concat(t.marker) : e
  20199. }, [])
  20200. }
  20201. ,
  20202. t.prototype.handleControlMove = function(e) {
  20203. this.emit(W.Move, e)
  20204. }
  20205. ,
  20206. t.prototype.handleControlInputStart = function(e) {
  20207. this.emit(W.InputStart, e)
  20208. }
  20209. ,
  20210. t.prototype.onModeUpdated = function(e, t) {
  20211. this.cameraControls.activateControls(t),
  20212. this.emit(W.ModeChanged, e, t)
  20213. }
  20214. ,
  20215. t.prototype.isWarping = function() {
  20216. return this.path.warping
  20217. }
  20218. ,
  20219. t.prototype.isWaitingToWarp = function() {
  20220. return this.path.waitingToWarp
  20221. }
  20222. ,
  20223. t.prototype.getLabelScaleFactor = function() {
  20224. if (this.isOutsideMode()) {
  20225. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20226. }
  20227. return .5
  20228. }
  20229. ,
  20230. t.prototype.bindEvents = function(e) {
  20231. e !== document && e.setAttribute("tabindex", -1),
  20232. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20233. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20234. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20235. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20236. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20237. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20238. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20239. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20240. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20241. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20242. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20243. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20244. document.addEventListener("pointerup", ()=>{//add
  20245. window.transformControls && transformControls.onPointerUp()
  20246. }),
  20247. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20248. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20249. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20250. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20251. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20252. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20253. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20254. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20255. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20256. window.getSeft && getSeft(this)
  20257. }
  20258. ,
  20259. t.prototype.onMouseDown = function(e) {
  20260. e.currentTarget !== document && e.currentTarget.focus(),
  20261. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20262. this.updateIntersect())
  20263. }
  20264. ,
  20265. t.prototype.onMouseMove = function(e) {
  20266. this.isTouchEvent = !1,
  20267. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20268. }
  20269. ,
  20270. t.prototype.onMouseOver = function(e) {
  20271. this.containsMouse = !0,
  20272. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20273. }
  20274. ,
  20275. t.prototype.onMouseOut = function(e) {
  20276. this.containsMouse = !1
  20277. }
  20278. ,
  20279. t.prototype.onMouseUp = function(e) {
  20280. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20281. }
  20282. ,
  20283. t.prototype.onTouchStart = function(e) {
  20284. if (e.currentTarget !== document && e.currentTarget.focus(),
  20285. !this.mouseDown) {
  20286. this.couldBeLongTap = !0;
  20287. var t = x.average(e.changedTouches, "clientX")
  20288. , i = x.average(e.changedTouches, "clientY");
  20289. this.handleInputStart.call(this, t, i, !0),
  20290. this.mouseDownTimer = setTimeout(function() {
  20291. this.updateIntersect(),
  20292. this.handleInputEnd.call(this, t, i, !0)
  20293. }
  20294. .bind(this), k.input.longTapThreshold)
  20295. }
  20296. }
  20297. ,
  20298. t.prototype.onTouchMove = function(e) {
  20299. var t = x.average(e.changedTouches, "clientX")
  20300. , i = x.average(e.changedTouches, "clientY");
  20301. this.handleInputMove.call(this, t, i, !0)
  20302. }
  20303. ,
  20304. t.prototype.onTouchEnd = function(e) {
  20305. if (clearTimeout(this.mouseDownTimer),
  20306. this.mouseDown) {
  20307. this.couldBeLongTap = !1,
  20308. this.updateIntersect();
  20309. var t = x.average(e.changedTouches, "clientX")
  20310. , i = x.average(e.changedTouches, "clientY");
  20311. this.handleInputEnd.call(this, t, i, !0)
  20312. }
  20313. }
  20314. ,
  20315. t.prototype.onPointerDown = function(e) {
  20316. return e.currentTarget !== document && e.currentTarget.focus(),
  20317. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20318. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20319. void (this.mouseDownTimer = setTimeout(function() {
  20320. this.updateIntersect(),
  20321. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20322. }
  20323. .bind(this), k.input.longTapThreshold)))
  20324. }
  20325. ,
  20326. t.prototype.onPointerMove = function(e) {
  20327. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20328. }
  20329. ,
  20330. t.prototype.onPointerUp = function(e) {
  20331. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20332. this.couldBeLongTap = !1,
  20333. this.updateIntersect(),
  20334. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20335. }
  20336. ,
  20337. t.prototype.onPointerOut = function(e) {
  20338. this.mouseDown = !1
  20339. }
  20340. ,
  20341. t.prototype.onPointerCancel = function(e) {
  20342. this.mouseDown = !1
  20343. }
  20344. ,
  20345. t.prototype.onKeyDown = function(e) {
  20346. var t = function() {
  20347. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20348. }
  20349. .bind(this)
  20350. , i = e.which;
  20351. switch (i) {
  20352. case l.F:
  20353. t(),
  20354. this.changeFloor(-1);
  20355. break;
  20356. case l.R:
  20357. t(),
  20358. this.changeFloor(1)
  20359. }
  20360. if (this.mode === V.PANORAMA)
  20361. switch (i) {
  20362. case l.UPARROW:
  20363. case l.W:
  20364. this.flyLocalDirection(T.FORWARD.clone());
  20365. break;
  20366. case l.DOWNARROW:
  20367. case l.S:
  20368. this.flyLocalDirection(T.BACK.clone());
  20369. break;
  20370. case l.A:
  20371. this.flyLocalDirection(T.LEFT.clone());
  20372. break;
  20373. case l.D:
  20374. this.flyLocalDirection(T.RIGHT.clone())
  20375. }
  20376. }
  20377. ,
  20378. t.prototype.handleScrollPinchZoom = function(e) {
  20379. var t = e
  20380. , i = this.zoomLevel;
  20381. this.zoomBy(t),
  20382. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20383. }
  20384. ,
  20385. t.prototype.handleControlPinch = function(e) {
  20386. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20387. }
  20388. ,
  20389. t.prototype.handleControlScroll = function(e) {
  20390. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20391. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20392. }
  20393. ,
  20394. t.prototype.handleInputStart = function(e, t, i) {
  20395. var n = this.handelPadding(e, t);
  20396. e = n.x,
  20397. t = n.y,
  20398. this.isTouchEvent = i,
  20399. U.convertScreenPositionToNDC(e, t, this.mouse),
  20400. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20401. this.mouseCouldBeClickToMove = !0,
  20402. this.mouseDown = !0
  20403. //this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20404. this.mouseCouldBeClickToMove && editTool.hotpoint.addHot()
  20405. window.transformControls && transformControls.onPointerDown()
  20406. }
  20407. ,
  20408. t.prototype.handelPadding = function(e, t) {
  20409. return this.pad || (this.pad = {
  20410. x: dom.getOffset("left", $("#player")[0]),
  20411. y: dom.getOffset("top", $("#player")[0])
  20412. }),
  20413. {
  20414. x: e - this.pad.x,
  20415. y: t - this.pad.y
  20416. }
  20417. }
  20418. ,
  20419. t.prototype.handleInputMove = function(e, t, i) {
  20420. var n = this.handelPadding(e, t);
  20421. e = n.x,
  20422. t = n.y,
  20423. this.isTouchEvent = i,
  20424. U.convertScreenPositionToNDC(e, t, this.mouse);
  20425. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20426. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20427. this.couldBeLongTap = !1,
  20428. clearTimeout(this.mouseDownTimer)),
  20429. this.mouseLastMoveTime = Date.now(),
  20430. this.reticule.move(e, t, i)
  20431. window.transformControls && transformControls.onPointerMove()
  20432. }
  20433. ,
  20434. t.prototype.handleInputEnd = function(e, t, i) {
  20435. if (this.isTouchEvent = i,
  20436. this.mouseDown = !1,
  20437. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20438. !i && this.couldBeLongTap)
  20439. return !0;
  20440. if (this.handleLongTap())
  20441. return !0;
  20442. window.transformControls && transformControls.onPointerUp()
  20443. if (this.mouseCouldBeClickToMove) {
  20444. if (this.flying)
  20445. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20446. !0;
  20447. //add----
  20448. if (this.checkHotClick())
  20449. return !0;
  20450. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20451. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20452. return;
  20453. }
  20454. if (window.VisiSet && VisiSet.setTagVisible ) {
  20455. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20456. return;
  20457. }
  20458. if (window.VisiSet && VisiSet.setPanoLog ) {
  20459. this.intersect && this.intersect.object.visible && VisiSet.dealPanoLogClick( this.intersect.object);
  20460. return;
  20461. }
  20462. if(this.hoveringPlane){
  20463. this.clickOverlay(this.hoveringPlane)
  20464. return;
  20465. }
  20466. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20467. return EditOverlay.addPlane({intersect:this.intersect});
  20468. }
  20469. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20470. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20471. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20472. } */
  20473. //----------
  20474. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20475. this.history.invalidate(),
  20476. this.intersect)
  20477. return this.flyToPanoClosestToMouse();
  20478. if (this.mode === V.PANORAMA) {
  20479. var n = this.closestPanoInDirection(this.getMouseDirection());
  20480. return n ? this.flyToPano({
  20481. pano: n
  20482. }) : this.bump(this.getMouseDirection())
  20483. }
  20484. }
  20485. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20486. }
  20487. ,
  20488. t.prototype.handleLongTap = function() {
  20489. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20490. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20491. !0
  20492. }
  20493. ,
  20494. t.prototype.checktagClick = function() {
  20495. if (this.tagManager.intersectTag) {
  20496. var e = this.isTouchEvent
  20497. , t = this.tagManager.clickedOnTag(e, this);
  20498. return e || t || G.cancelById(q.LookTransition),
  20499. !0
  20500. }
  20501. if (this.tagManager.activeTag)
  20502. return this.tagManager.dismissActiveTag(),
  20503. !1
  20504. }
  20505. ,
  20506. t.prototype.rankedtagInDirection = function(e, t) {
  20507. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20508. }
  20509. ,
  20510. t.prototype.start = function(e) {
  20511. $(".toolLeft").removeClass("unable");
  20512. $(".toolTop").removeClass("unable");
  20513. //-------------------
  20514. window.initTransformCtl(B)
  20515. //this.model.loadOverlays()
  20516. //window.EditOverlay && window.EditOverlay.init(B);
  20517. window.VisiSet && VisiSet.init()
  20518. //-------------------
  20519. var t = e.mode
  20520. , i = e.pano
  20521. , n = e.position
  20522. , r = e.quaternion
  20523. , o = e.tag
  20524. , a = e.quickstart
  20525. , s = $.Deferred();
  20526. this.updateModelDependentData(),
  20527. this.updateFromControls(),
  20528. this.findDefaultViews();
  20529. var l = this.is360View(t, i);
  20530. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20531. s.done(function(e) {
  20532. this.emit(W.Ready, l, e, o)
  20533. }
  20534. .bind(this)),
  20535. s.promise()
  20536. }
  20537. ,
  20538. t.prototype.startOutside = function(e, t) {
  20539. var i = e.mode
  20540. , n = e.pano
  20541. , r = e.position
  20542. , o = e.quaternion
  20543. , a = e.zoom
  20544. , s = e.floorVisibility
  20545. , l = e.tag;
  20546. this.emit(W.StartOutside, k[i].transitionTime),
  20547. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20548. G.cancelById(q.FlyToViewFloor),
  20549. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20550. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20551. }
  20552. ,
  20553. t.prototype.startInside = function(e, t, i, n, r) {
  20554. r = r || $.Deferred();
  20555. var o = (this.currentPano = e) && !e.isAligned();
  20556. if (t = o ? e.position : t || e.position,
  20557. i = i || e.quaternion,
  20558. e) {
  20559. var a = this.startInside.bind(this, e, t, i, n, r);
  20560. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20561. return
  20562. }
  20563. //add
  20564. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20565. //this.updateHotVisible()
  20566. //EditOverlay.updatePano()
  20567. editTool.hotpoint.updatePano()
  20568. Hot.updateVisibles([this.currentPano])
  20569. return this.mode = V.PANORAMA,
  20570. e.floor.enter(this.mode),
  20571. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20572. this.switchCameraMode(this.mode, i),
  20573. this.emit(W.StartInside, o),
  20574. r.resolve(!0),
  20575. r
  20576. }
  20577. ,
  20578. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20579. if (r = r || $.Deferred(),
  20580. this.dollhouseMode(),
  20581. !i)
  20582. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20583. r.resolve(!1),
  20584. r;
  20585. e = e || i.position;
  20586. var o = n || this.cameraControls.activeControl.camera.quaternion
  20587. , a = i.position;
  20588. return this.fitDollhouse(a, e, o),
  20589. setTimeout(function(e) {
  20590. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20591. var t = {
  20592. mode: V.PANORAMA,
  20593. pano: i,
  20594. quaternion: n,
  20595. callback: function() {
  20596. this.emit(W.FlyinFinished),
  20597. r.resolve(!0)
  20598. }
  20599. .bind(this)
  20600. };
  20601. this.flyToNewMode(t)
  20602. }
  20603. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20604. r
  20605. }
  20606. ,
  20607. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20608. K = {},
  20609. function(t, e, i, n, r, o, a, s, l, c) {
  20610. if (function() {
  20611. for (var e in Z)
  20612. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20613. return !0;
  20614. return !1
  20615. }())
  20616. return !0;
  20617. var h = function(e, t, i) {
  20618. j.delayOneFrame(function() {
  20619. Z[e] = !1,
  20620. r && r(t, i)
  20621. }
  20622. .bind(this))
  20623. }
  20624. .bind(this, t.id)
  20625. , u = function(e, t) {
  20626. j.delayOneFrame(function() {
  20627. Z[e] = !1,
  20628. o && o(t)
  20629. }
  20630. .bind(this))
  20631. }
  20632. .bind(this, t.id);
  20633. try {
  20634. return null != s || (s = !0),
  20635. 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),
  20636. Z[t.id] && (K[t.id] = performance.now()),
  20637. Z[t.id]
  20638. } catch (e) {
  20639. throw Z[t.id] = !1,
  20640. K[t.id] = performance.now() - 5e3,
  20641. e
  20642. }
  20643. }
  20644. ),
  20645. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20646. if (!e)
  20647. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20648. return r && this.model.waitForLoad(e, function() {
  20649. return e.isLoaded(i)
  20650. }),
  20651. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20652. !0)
  20653. }
  20654. ,
  20655. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20656. function(e, t, i, n, r, o, a, s) {
  20657. if (!e)
  20658. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20659. return X.copy(T.FORWARD),
  20660. this.getDirection(X),
  20661. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20662. return e.isLoaded(t)
  20663. }),
  20664. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20665. i && i(e, t)
  20666. }
  20667. .bind(this)).fail(function(e) {
  20668. n && n(e)
  20669. }
  20670. .bind(this)).progress(function(e, t, i) {
  20671. r && r(e, t, i)
  20672. }
  20673. .bind(this)),
  20674. !0)
  20675. }
  20676. ),
  20677. t.prototype.switchCameraMode = function(e, t) {
  20678. var i = this.cameraControls.controls[e]
  20679. , n = i.camera;
  20680. switch (e) {
  20681. case V.PANORAMA:
  20682. n.position.copy(this.currentPano.position);
  20683. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20684. i.lookAt(r.add(n.position));
  20685. break;
  20686. case V.DOLLHOUSE:
  20687. var o = this.position.clone();
  20688. 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),
  20689. n.position.copy(o),
  20690. i.target.copy(this.target.clone().setY(this.model.center.y));
  20691. break;
  20692. //for多楼层 且 让模型刚好适应屏幕
  20693. /* var box = this.model.boundingBox.clone();
  20694. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20695. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20696. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20697. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20698. console.log(boxSize.x,distance, boxSize.length() / 2)
  20699. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20700. if(this.mode === V.PANORAMA){
  20701. i.target.copy(this.model.center);
  20702. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20703. }else{
  20704. i.target.copy(this.target.clone().setY(this.model.center.y))
  20705. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20706. }
  20707. vec.multiplyScalar(distance )
  20708. n.position.copy(i.target.clone().add(vec)) */
  20709. break
  20710. case V.FLOORPLAN:
  20711. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20712. i.target.copy(this.model.center).setY(0),
  20713. i.zoomToContain(this.model.size),
  20714. i.rotateToView(this.model.size, this.getDirection())
  20715. }
  20716. i.update(0)
  20717. }
  20718. ,
  20719. t.prototype.update = (new B.Vector3,
  20720. N = {},
  20721. F = [],
  20722. function(e) {
  20723. this.updatePersistentZooming(e),
  20724. this.updateFromControls(e),
  20725. this.getCurrentNodePanos(F)
  20726. if(this.hasChanged(N)){
  20727. this.lastChangeTime = Date.now(),
  20728. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20729. this.emit(W.ViewChanged)
  20730. //add:
  20731. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) VisiSet.updateFootIconSize();
  20732. this.intersectHot && this.intersectHot.showTitle()
  20733. editTool.hotpoint.showTitileSpots && editTool.hotpoint.showTitileSpots.forEach(e=>e.showTitle())
  20734. for(var i in this.model.hots){
  20735. this.model.hots[i].update(this)
  20736. }
  20737. /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
  20738. overlay.update()
  20739. }) */
  20740. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20741. }
  20742. this.model.supportsTiles && (this.updateTileDownloader(F),
  20743. this.updatePanoRenderer(F)),
  20744. this.updatePreRendering(F),
  20745. this.reticule.update(),
  20746. this.path.update(),
  20747. this.spider.update(),
  20748. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20749. this.updateControlLocks(),
  20750. this.model.supportsTiles && this.updateZoomPano()
  20751. }
  20752. ),
  20753. t.prototype.updatePersistentZooming = function(e) {
  20754. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20755. }
  20756. ,
  20757. t.prototype.updateControlLocks = function() {
  20758. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20759. }
  20760. ,
  20761. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20762. function(e) {
  20763. var t = this.nextPano || this.currentPano;
  20764. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20765. this.getDirection(D),
  20766. this.panoRenderer.updateDirection(D))
  20767. }
  20768. ),
  20769. t.prototype.cleanupInactivePanos = (O = [],
  20770. L = [],
  20771. function() {
  20772. O.length = 0,
  20773. O.push(this.currentPano),
  20774. this.nextPano && O.push(this.nextPano);
  20775. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20776. L.push(this.panoRenderer.activePanos[e]);
  20777. for (var t = 0; t < L.length; t++) {
  20778. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20779. i.id === O[r].id && (n = !1);
  20780. n && i.exit()
  20781. }
  20782. }
  20783. ),
  20784. t.prototype.updatePreRendering = (w = {},
  20785. function(e) {
  20786. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20787. var t = this.nextPano || this.currentPano;
  20788. if (t && e && 1 < e.length) {
  20789. var i = e.findIndex(function(e) {
  20790. if (e.id === t.id)
  20791. return !0
  20792. });
  20793. if (0 <= i && i + 1 < e.length) {
  20794. var n = e[i + 1];
  20795. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20796. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20797. window.setTimeout(function(e) {
  20798. w[e.id] = !1
  20799. }
  20800. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20801. }
  20802. .bind(this, n), k.tiling.panoPreRenderDelay),
  20803. w[n.id] = !0)
  20804. }
  20805. }
  20806. }
  20807. }
  20808. ),
  20809. t.prototype.enablePreRendering = function() {
  20810. this.preRenderingEnabled = !0
  20811. }
  20812. ,
  20813. t.prototype.disablePreRendering = function() {
  20814. this.preRenderingEnabled = !1,
  20815. this.cleanupInactivePanos()
  20816. }
  20817. ,
  20818. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20819. function(e) {
  20820. var t = this.nextPano || this.currentPano;
  20821. t && (b.copy(T.FORWARD),
  20822. this.getDirection(b),
  20823. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20824. this.tileDownloader.processPriorityQueue = !0)
  20825. }
  20826. ),
  20827. t.prototype.updateFromControls = function(e) {
  20828. null != e || (e = 0),
  20829. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20830. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20831. this.position.copy(this.cameraControls.activeControl.camera.position),
  20832. this.target.copy(this.cameraControls.activeControl.target),
  20833. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20834. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20835. this.camera.position.copy(this.position),
  20836. this.camera.quaternion.copy(this.quaternion),
  20837. this.camera.updateMatrix(),
  20838. this.camera.updateMatrixWorld()
  20839. }
  20840. ,
  20841. t.prototype.hasChanged = function(e) {
  20842. if (!this.previousState)
  20843. return this.previousState = {
  20844. allFloorsVisible: this.model.allFloorsVisible,
  20845. position: this.position.clone(),
  20846. quaternion: this.quaternion.clone(),
  20847. mouse: this.mouse.clone(),
  20848. labelScaleFactor: this.getLabelScaleFactor(),
  20849. currentFloor: this.model.currentFloor,
  20850. projectionMatrix: this.camera.projectionMatrix.clone(),
  20851. worldMatrix: this.camera.matrixWorld.clone(),
  20852. mode: this.mode,
  20853. modelPosition: this.model.position.clone(),
  20854. modelCenter: this.model.center.clone(),
  20855. zoomLevel: this.zoomLevel
  20856. },
  20857. !0;
  20858. 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;
  20859. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  20860. e.moved = !this.position.equals(this.previousState.position),
  20861. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  20862. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  20863. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  20864. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  20865. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  20866. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  20867. e.modeChanged = this.mode !== this.previousState.mode,
  20868. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  20869. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  20870. e.nextPanoActive = null !== this.nextPano,
  20871. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  20872. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  20873. this.previousState.position.copy(this.position),
  20874. this.previousState.quaternion.copy(this.quaternion),
  20875. this.previousState.mouse.copy(this.mouse),
  20876. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  20877. this.previousState.currentFloor = this.model.currentFloor,
  20878. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  20879. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  20880. this.previousState.mode = this.mode,
  20881. this.previousState.modelPosition.copy(this.model.position),
  20882. this.previousState.modelCenter.copy(this.model.center),
  20883. this.previousState.zoomLevel = this.zoomLevel,
  20884. !t
  20885. }
  20886. ,
  20887. t.prototype.updateIntersect = function() {
  20888. var e = this.flying || this.isWarping()
  20889. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  20890. , i = G.getById(q.LookTransition);
  20891. e || t || this.isTouchEvent || i.length && i[0].running;
  20892. {//clear:
  20893. if(this.intersectHot) this.intersectHot.hideTitle()
  20894. this.intersectHot = null
  20895. $("#player").css("cursor", "")
  20896. $(".toolRight .spotList ul li").removeClass("active")
  20897. }
  20898. var deal = ()=>{
  20899. if(this.intersect && this.intersect.object.visible ){
  20900. if("hotSprite" == this.intersect.object.type){
  20901. this.intersectHot = this.intersect.object
  20902. while(!(this.intersectHot instanceof Hot)){
  20903. this.intersectHot = this.intersectHot.parent
  20904. }
  20905. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  20906. this.intersectHot.showTitle()
  20907. }
  20908. }
  20909. }
  20910. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)) {
  20911. this.intersect = this.getMouseIntersect(null, this.model.hotGroup.children.concat(VisiSet.footIcons||[]) );
  20912. deal()
  20913. if(this.intersect){
  20914. $("#player").css("cursor", "pointer");
  20915. }
  20916. if(this.intersectHot){
  20917. this.intersect = null
  20918. }
  20919. return
  20920. }else if (g_HotStatus) {//加热点
  20921. this.intersect = this.getMouseIntersect(null, this.model.colliders.concat(this.model.skybox));
  20922. if(this.intersect){
  20923. $("#player").css("cursor", "cell")
  20924. }else{
  20925. $("#player").css("cursor", "not-allowed")
  20926. }
  20927. return;
  20928. }else{
  20929. if(this.model.hotGroup){
  20930. if(editTool.atPanel == 'hotpoint'){
  20931. var hots = this.model.hotGroup.children
  20932. }else{
  20933. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  20934. }
  20935. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  20936. if(this.intersect){
  20937. deal()
  20938. this.intersectHot && $("#player").css("cursor", "pointer");
  20939. }
  20940. }
  20941. }
  20942. this.intersect = this.getMouseIntersect(),
  20943. this.intersect && this.updateClosestPano(this.intersect),
  20944. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  20945. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  20946. }
  20947. ,
  20948. t.prototype.checkHotClick = function() {
  20949. if (this.intersectHot){
  20950. if (window.VisiSet && VisiSet.setTagVisible ) {
  20951. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  20952. return;
  20953. }else if(editTool.atPanel == 'hotpoint'){
  20954. if(editTool.hotpoint.editSpot && this.intersectHot != editTool.hotpoint.editSpot){
  20955. var sure = confirm("是否保存当前热点?")
  20956. if(sure){
  20957. editTool.hotpoint.saveHot().then(()=>{
  20958. editTool.hotpoint.editHot(this.intersectHot)
  20959. })
  20960. }else{
  20961. editTool.hotpoint.editHot(this.intersectHot)
  20962. }
  20963. }else{
  20964. editTool.hotpoint.editHot(this.intersectHot)
  20965. }
  20966. }else{
  20967. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  20968. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  20969. }
  20970. this.intersectHot.examine()
  20971. }
  20972. return !0
  20973. }
  20974. }
  20975. ,
  20976. t.prototype.getMouseDirection = function(e) {
  20977. e = e || this.mouse;
  20978. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20979. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  20980. }
  20981. ,
  20982. t.prototype.hoverOverlay = function(mesh){
  20983. if(!mesh){
  20984. this.hoveringPlane = null;
  20985. $("#player").css("cursor",this.currentCursor || "" );
  20986. }else{
  20987. var overlay = mesh.parent;
  20988. $("#player").css("cursor","pointer");
  20989. this.hoveringPlane = overlay;
  20990. return true;
  20991. }
  20992. },
  20993. t.prototype.clickOverlay = function(overlay){
  20994. if(this.openOverlay && !overlay)return;
  20995. var plane = overlay.plane;
  20996. if(overlay.texType == "video"){
  20997. overlay.switchPlay(!!overlay.pausedByUser)
  20998. }
  20999. if(window.EditOverlay && EditOverlay.editing){
  21000. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane){
  21001. var sure = confirm("是否保存当前展览?")
  21002. if(sure){
  21003. $("#overlayProp button.submit").click()
  21004. }else{
  21005. EditOverlay.closeOverlayPanel('cancel')
  21006. }
  21007. }
  21008. EditOverlay.beginEdit(overlay);
  21009. return;
  21010. }
  21011. },
  21012. t.prototype.getMouseIntersect = function(e, t1) {
  21013. e = e || this.mouse.clone()
  21014. var t = t1 || this.model.floors.reduce(function(e, t) {
  21015. return t.hidden ? e : e.concat(t.collider.children)
  21016. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21017. t = t.slice(0)
  21018. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21019. this.raycaster.set(i, this.getMouseDirection(e));
  21020. var n = this.raycaster.intersectObjects(t , true );//add true
  21021. var o = n[0];
  21022. if(o){
  21023. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21024. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21025. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21026. o.horizontal = .8 < o.normal.y);
  21027. return o
  21028. }
  21029. }
  21030. ,
  21031. t.prototype.updateClosestPano = function(e) {
  21032. var t = [a.filters.isPanoAligned()];
  21033. if (this.mode === V.PANORAMA) {
  21034. if (!this.currentPano)
  21035. return;
  21036. t.push(a.filters.not(this.currentPano)),
  21037. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21038. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21039. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21040. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21041. } else{
  21042. t.push((pano)=>{ // add
  21043. return this.checkHasNeighbor(pano)
  21044. })
  21045. t.push(a.filters.isOnVisibleFloor()),
  21046. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21047. }
  21048. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21049. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21050. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21051. this.closestPano = i) : this.isPanoHover = !1
  21052. }
  21053. ,
  21054. t.prototype.dollhouseMode = function(e, t) {
  21055. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21056. this.mode = V.DOLLHOUSE,
  21057. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21058. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21059. , n = new B.Vector3(15,10,15);
  21060. if (e && t) {
  21061. var r = T.FORWARD.clone().applyQuaternion(t)
  21062. , o = this.model.center.clone().sub(e).dot(r);
  21063. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21064. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21065. }
  21066. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21067. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21068. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21069. this.updateFromControls(),
  21070. this.model.alpha = 1,
  21071. this.model.skybox.material.uniforms.opacity.value = 0
  21072. }
  21073. ,
  21074. t.prototype.insideMode = function(e, t) {
  21075. var i = $.Deferred()
  21076. , n = t || null;
  21077. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21078. var r = [a.filters.isPanoAligned()];
  21079. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21080. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21081. this.flyToNewMode({
  21082. mode: V.PANORAMA,
  21083. pano: e,
  21084. callback: n
  21085. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21086. } else {
  21087. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21088. i.reject(o)
  21089. }
  21090. return i.promise()
  21091. }
  21092. ,
  21093. t.prototype.fitDollhouse = function(e, t, i) {
  21094. var maxY = this.model.boundingBox.max.y;//add
  21095. var n = T.FORWARD.clone().applyQuaternion(i);
  21096. i = n.clone().add(e);
  21097. this.cameraControls.activeControl.target.copy(i),
  21098. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21099. }
  21100. ,
  21101. t.prototype.floorplanMode = function(e, t, i) {
  21102. this.mode = V.FLOORPLAN;
  21103. var n = this.cameraControls.controls[V.FLOORPLAN];
  21104. n.reset();
  21105. var r = e || this.model.center;
  21106. if (n.target.copy(r).setY(0),
  21107. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21108. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21109. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21110. t) {
  21111. var o = T.LEFT.clone().applyQuaternion(t);
  21112. n.rotateLeft(-Math.atan2(o.x, o.z))
  21113. } else
  21114. n.rotateToView(this.model.size, this.getDirection());
  21115. n.update(0)
  21116. }
  21117. ,
  21118. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21119. return e.skipWarpingCheck = !0,
  21120. this.flyToPano(e, t)
  21121. }
  21122. ,
  21123. t.prototype.updateMarkerVisi = function() {//加
  21124. if(this.mode != "panorama")return;
  21125. this.model.panos.list.forEach((pano)=>{
  21126. if(!pano.marker)return;
  21127. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21128. })
  21129. }
  21130. ,
  21131. /* t.prototype.updateHotVisible = function(pano){
  21132. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setPanoLog))return
  21133. var hots = this.model.hots;
  21134. pano = pano || this.currentPano;
  21135. for (var index in hots){
  21136. var visible;
  21137. if(this.mode != "panorama"){
  21138. visible = true;
  21139. }else{
  21140. //hots[index].mesh.material.depthTest = false;
  21141. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21142. }
  21143. hots[index].mesh.visible = visible;
  21144. }
  21145. }
  21146. */
  21147. t.prototype.flyToPano = function(e, t) {
  21148. var i, n = e.pano, aim = e.lookAtPoint, aimQua = e.quaternion,//ADD
  21149. o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride,
  21150. l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null
  21151. if (aim){
  21152. var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
  21153. aimQua = (new B.Quaternion).setFromRotationMatrix(m)
  21154. }
  21155. else aimQua = aimQua
  21156. var zoomLevel = e.zoomLevel || 1 //add
  21157. if(this.flying) return t && t(e)
  21158. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21159. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21160. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21161. t && t(),
  21162. !1;
  21163. this.updateLastView()
  21164. if (this.mode !== V.PANORAMA)
  21165. return void this.flyToNewMode({
  21166. mode: V.PANORAMA,
  21167. pano: n,
  21168. duration: o,
  21169. quaternion: aimQua,
  21170. callback: t
  21171. });
  21172. if (!n || (h = x.deepExtend(e), u = function() {
  21173. j.delayOneFrame(function() {
  21174. this.flyToPano(h, t)
  21175. }.bind(this))
  21176. }.bind(this),
  21177. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21178. var d = function(e) {
  21179. t && t(e)
  21180. }
  21181. .bind(this);
  21182. this.currentPano || (this.currentPano = n,
  21183. this.path.placeCpm(),
  21184. this.path.fadeOutCpm(k.path.fadeOutTime),
  21185. this.spider.draw());
  21186. var p = o;
  21187. if ("number" != typeof o) {
  21188. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21189. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21190. }
  21191. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21192. zoomLevel !== this.zoomLevel)
  21193. switch (k.zoom.transitionStyle) {
  21194. case 1:
  21195. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? p / 2 : p); //改
  21196. break;
  21197. case 2:
  21198. return h = x.deepExtend(e),
  21199. u = this.flyToPano.bind(this, h, t),
  21200. void this.smoothZoomFovTo(null, zoomLevel, k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21201. }
  21202. if (aimQua) {
  21203. G.cancelById(q.LookTransition),
  21204. p *= k.transition.aimSlowFactor;
  21205. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21206. , y = g.clone()
  21207. , A = new B.Vector3;
  21208. if (n === this.currentPano) {
  21209. var C = T.FORWARD.clone().applyQuaternion(g)
  21210. , I = T.FORWARD.clone().applyQuaternion(aimQua)
  21211. , E = C.angleTo(I);
  21212. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21213. void G.start(function(e) {
  21214. y.copy(g),
  21215. H.quaternion(y, aimQua)(e),
  21216. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21217. this.cameraControls.activeControl.lookAt(A)
  21218. }
  21219. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21220. }
  21221. }
  21222. if (n === this.currentPano )
  21223. return void d();
  21224. this.flying = !0;
  21225. var _ = this.position.clone()
  21226. , b = this.currentPano;
  21227. Y.debug("Flying to pano ", n.position);
  21228. this.emit(W.PanoChosen, this.currentPano, n);
  21229. this.emit(W.FlyingStarted, n.position, _, n, b);
  21230. //this.updateHotVisible(n); //更新热点显示
  21231. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21232. Hot.updateVisibles([this.currentPano, n])
  21233. aimQua && G.start(function(e) {
  21234. y.copy(g),
  21235. H.quaternion(y, aimQua)(e),
  21236. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21237. this.cameraControls.activeControl.lookAt(A)
  21238. }
  21239. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21240. var w = c ? null : z[k.transition.movementEasing];
  21241. this.nextPano = n;
  21242. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21243. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21244. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21245. this.flying = !1,
  21246. this.currentPano !== n && this.currentPano.exit(),
  21247. n.enter(),
  21248. this.currentPano = n,
  21249. this.nextPano = null,
  21250. this.path.placeCpm(),
  21251. this.path.fadeOutCpm(k.path.fadeOutTime),
  21252. this.spider.draw(),
  21253. this.emit(W.FlyingEnded, n.position, _, n, b),
  21254. this.updateMarkerVisi();//add
  21255. d(e)
  21256. if(this.mode == "panorama" ){
  21257. //EditOverlay.updatePano()
  21258. editTool.hotpoint.updatePano()
  21259. Hot.updateVisibles([this.currentPano])
  21260. }
  21261. }
  21262. .bind(this), 0, w, "camFly", q.FlyToPano)
  21263. }
  21264. }
  21265. ,
  21266. window._transitionPosId = 9999
  21267. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21268. G.cancelById(_transitionPosId)
  21269. var begin = function(object, pos, qua, scale){
  21270. if(pos){
  21271. if(!same(object.position, pos, 0.01)){
  21272. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21273. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21274. }
  21275. if(qua && !same(object.quaternion, qua, 1e-6)){
  21276. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21277. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21278. }
  21279. if(scale && !same(object.scale, scale, 0.001)){
  21280. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21281. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21282. }
  21283. }
  21284. }
  21285. var same = function(vec1, vec2, diff){
  21286. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21287. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21288. return s
  21289. }
  21290. var sid = o.pano != void 0 ? o.pano.id : "outside";
  21291. /* this.model.hotGroup.children.forEach(overlay=>{
  21292. var panoData = overlay.transformAtPanos[sid]
  21293. var useCustom = !panoData
  21294. //if(overlay.usingTransformData || !useCustom){
  21295. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21296. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21297. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21298. overlay.getScaleBySize(panoData.width , panoData.height)
  21299. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21300. begin(overlay, pos, qua, scale )
  21301. //}
  21302. overlay.usingTransformData = !useCustom
  21303. }) */
  21304. for(let i in this.model.hots){//是否判断visible?
  21305. var hot = this.model.hots[i];
  21306. var panoData = hot.info.transformAtPanos[sid];
  21307. var useCustom = !panoData
  21308. //if(hot.usingTransformData || !useCustom){
  21309. var pos = useCustom ? hot.info.position : panoData.pos;
  21310. //var qua = hot.isSprite ? null : (useCustom ? hot.quaternion : panoData.qua);
  21311. begin(hot, pos/* , qua */ )
  21312. //}
  21313. //hot.usingTransformData = !useCustom;
  21314. }
  21315. }
  21316. window._tranOutsideFocus = 4399
  21317. t.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  21318. console.log("focusPoint")
  21319. if(this.mode == "floorplan"){
  21320. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  21321. var control = player.cameraControls.controls.floorplan;
  21322. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  21323. var currentScale = control.absoluteScale;
  21324. var currentTarget = control.target.clone()
  21325. G.cancelById(window._tranOutsideFocus, true);
  21326. G.start(function(progress){
  21327. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  21328. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21329. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  21330. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21331. }else if(player.mode == "dollhouse"){
  21332. var control = player.cameraControls.controls.dollhouse;
  21333. var radius = o.radius || 8;
  21334. var currentTarget = control.target.clone()
  21335. var dir = control.offset.clone().normalize()
  21336. var currentRadius = control.offset.length();
  21337. G.cancelById(window._tranOutsideFocus, true);
  21338. G.start(function(progress){
  21339. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  21340. let radius_ = radius*progress+currentRadius*(1-progress)
  21341. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  21342. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, z[k.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  21343. }else if(this.mode == 'panorama'){
  21344. this.flyToPano({
  21345. lookAtPoint: o.aim.clone() ,
  21346. pano: this.currentPano,
  21347. aimDuration: o.dur || 600
  21348. })
  21349. }
  21350. }
  21351. t.prototype.fastForwardActivePanoFlight = function(e) {
  21352. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21353. G.adjustSpeed(q.FlyToPano, e),
  21354. G.adjustSpeed(q.LookTransition, e)
  21355. }
  21356. ,
  21357. t.prototype.flyToPanoClosestToMouse = function() {
  21358. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21359. this.intersect && this.updateClosestPano(this.intersect)),
  21360. this.closestPano)
  21361. return this.flyToPano({
  21362. pano: this.closestPano
  21363. });
  21364. var e = this.getMouseDirection();
  21365. this.flyDirection(e) || this.flyToPano({
  21366. pano: this.currentPano
  21367. })
  21368. }
  21369. ,
  21370. t.prototype.flyLocalDirection = function(e) {
  21371. var t = this.getDirection(e)
  21372. , i = 1 === e.z ? .4 : .75
  21373. , n = 1 === Math.abs(e.x);
  21374. return this.flyDirection(t, i, n)
  21375. }
  21376. ,
  21377. t.prototype.flyDirection = function(e, t, i) {
  21378. Hot.closePopup();//xzw add
  21379. var n = $.Deferred();
  21380. this.history.invalidate();
  21381. var r = this.closestPanoInDirection(e, t, i);
  21382. return r ? this.flyToPano({
  21383. pano: r
  21384. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21385. n.resolve(!1)),
  21386. n.promise()
  21387. }
  21388. ,
  21389. t.prototype.closestPanoInDirection = function(e, t, i) {
  21390. return this.rankedPanoInDirection(0, e, t, i)
  21391. }
  21392. ,
  21393. t.prototype.rankedPanoInDirection = (_ = {
  21394. pano: null,
  21395. candidates: []
  21396. },
  21397. function(e, t, i, n) {
  21398. e = e || 0,
  21399. i = void 0 !== i ? i : .75;
  21400. var r = n ? "angle" : "direction";
  21401. 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)], _),
  21402. this.cachedPanoCandidates = _.candidates,
  21403. _.pano
  21404. }
  21405. ),
  21406. t.prototype.bump = function(e) {
  21407. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21408. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21409. if (.5 < Math.abs(a))
  21410. t = function() {
  21411. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21412. }
  21413. .bind(this),
  21414. i = function() {
  21415. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21416. }
  21417. .bind(this);
  21418. else {
  21419. var s = this.camera.position.clone()
  21420. , l = e.clone();
  21421. this.raycaster.set(s, l);
  21422. var c = this.model.floors.reduce(function(e, t) {
  21423. return e.concat(t.collider.children)
  21424. }, [])
  21425. , h = this.raycaster.intersectObjects(c)
  21426. , u = 0 < h.length ? h[0].distance / 25 : .04
  21427. , d = s.clone().add(l.multiplyScalar(u));
  21428. t = function() {
  21429. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21430. }
  21431. .bind(this),
  21432. i = function() {
  21433. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21434. }
  21435. .bind(this)
  21436. }
  21437. n = function() {
  21438. this.flying = !1
  21439. }
  21440. .bind(this),
  21441. this.flying = !0,
  21442. t()
  21443. }
  21444. }
  21445. ,
  21446. t.prototype.changeFloor = function(e) {
  21447. if (!this.is360View(this.mode, this.currentPano))
  21448. if (this.mode === V.PANORAMA) {
  21449. var t = this.history.reversePano(e);
  21450. t && t.isAligned() ? this.flyToPano({
  21451. pano: t
  21452. }) : this.changeFloorByScore(e)
  21453. } else
  21454. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21455. }
  21456. ,
  21457. t.prototype.changeFloorByScore = (E = {
  21458. pano: null,
  21459. candidates: []
  21460. },
  21461. function(e) {
  21462. var t = this.model.nextFloor(e);
  21463. 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),
  21464. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21465. this.history.push(e, this.currentPano),
  21466. this.flyToPano({
  21467. pano: E.pano
  21468. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21469. }
  21470. ),
  21471. t.prototype.gotoFloor = function(e) {
  21472. var t = e - this.model.currentFloor.floorIndex;
  21473. this.changeFloor(t)
  21474. }
  21475. ,
  21476. t.prototype.getDirection = function(e) {
  21477. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21478. }
  21479. ,
  21480. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21481. if (r = r || $.Deferred(),
  21482. this.mode === V.TRANSITIONING)
  21483. return Y.warn("should not be transitioning here"),
  21484. n && n(!1),
  21485. r.reject().promise();
  21486. var o = i || !1
  21487. , a = i ? i.position : this.position
  21488. , s = this.position.clone()
  21489. , l = this.currentPano;
  21490. if (Y.debug("New pose in mode " + this.mode),
  21491. !e || (retryCallback = function() {
  21492. j.delayOneFrame(function() {
  21493. this.flyToSameMode(e, t, i, n, r)
  21494. }
  21495. .bind(this))
  21496. }
  21497. .bind(this),
  21498. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21499. var c = function() {
  21500. this.emit(W.FlyingEnded, a, s, e, l),
  21501. n && n(!0)
  21502. }
  21503. .bind(this)
  21504. , h = k[this.mode]
  21505. , u = void 0 !== t ? t : h.transitionTime
  21506. , d = new B.Vector3
  21507. , p = new B.Vector3;
  21508. if (this.emit(W.FlyingStarted, a, s, e, l),
  21509. this.mode === V.PANORAMA)
  21510. Y.warn("we should not be here for panorama views");
  21511. else if (this.mode === V.DOLLHOUSE)
  21512. if (o) {
  21513. var f = new B.Vector3(0,1,0);
  21514. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21515. this.model.warpDestFloors(i.floorVisibility),
  21516. p.copy(i.position);
  21517. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21518. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21519. , v = 3;
  21520. m.length ? (d.copy(m[0].point),
  21521. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21522. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21523. var y = (new B.Matrix4).lookAt(p, d, f)
  21524. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21525. , C = d.distanceTo(p)
  21526. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21527. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21528. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21529. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21530. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21531. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21532. this.path.burnsDir = Math.sign(b.y);
  21533. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21534. , T = new B.Vector3;
  21535. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21536. G.start(function(e, t) {
  21537. w.x = E.x + e * b.x,
  21538. w.y = E.y + e * b.y,
  21539. w.z = E.z + e * b.z;
  21540. var i = _ + e * (C - _);
  21541. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21542. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21543. }
  21544. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21545. G.start(function(e, t) {
  21546. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21547. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21548. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21549. }
  21550. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21551. } else
  21552. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21553. else if (this.path.placeCpm(),
  21554. this.path.fadeInCpm(k.path.fadeInTime),
  21555. i) {
  21556. this.model.warpDestFloors(i.floorVisibility);
  21557. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21558. , S = this.cameraControls.controls[V.FLOORPLAN]
  21559. , M = S.target.clone()
  21560. , R = i.position.clone().sub(M)
  21561. , P = x.position.clone().sub(S.target).length()
  21562. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21563. , L = Math.atan2(S.offset.x, S.offset.z)
  21564. , D = Math.atan2(O.x, O.z)
  21565. , N = S.absoluteScale
  21566. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21567. G.start(function(e, t) {
  21568. S.target.copy(R).multiplyScalar(e).add(M);
  21569. var i = L + (D - L) * e;
  21570. S.offset.x = P * Math.sin(i),
  21571. S.offset.z = P * Math.cos(i),
  21572. x.position.copy(S.target).add(S.offset),
  21573. S.absoluteScale = N + e * (F - N),
  21574. S.update(),
  21575. this.quaternion.copy(x.quaternion),
  21576. this.position.copy(x.position),
  21577. this.target.copy(S.target),
  21578. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21579. }
  21580. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21581. } else
  21582. Y.info("flyToSameMode() funny floorplan view? skipping");
  21583. return G.setTimeout(function(e) {
  21584. this.mode = e,
  21585. c(),
  21586. r.resolve(!0)
  21587. }
  21588. .bind(this, this.mode), u, q.FlyToSameMode),
  21589. this.mode = V.TRANSITIONING,
  21590. r.promise()
  21591. }
  21592. }
  21593. ,
  21594. t.prototype.flyToNewMode = function(e, t) {
  21595. Hot.closePopup();//xzw add
  21596. var i = (e = e || {}).mode
  21597. , n = e.pano
  21598. , r = e.duration
  21599. , o = e.warpDest
  21600. , a = e.callback
  21601. , s = e.force
  21602. , l = e.quaternion;
  21603. if (t = t || $.Deferred(),
  21604. this.isWarping())
  21605. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21606. a && a(!1),
  21607. t.reject("Cannot change mode during tour transition").promise();
  21608. if (this.mode === V.TRANSITIONING)
  21609. return a && a(!1),
  21610. t.reject("Cannot change mode during mode transition").promise();
  21611. if (i === this.mode)
  21612. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21613. t.promise()) : (a && a(!1),
  21614. t.reject("Already in " + i + " mode").promise());
  21615. var c = o || !1;
  21616. Y.debug("Switching mode to " + i);
  21617. var h = function() {
  21618. j.delayOneFrame(function() {
  21619. this.flyToNewMode(e, t)
  21620. }
  21621. .bind(this))
  21622. }
  21623. .bind(this);
  21624. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21625. return t.promise();
  21626. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21627. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21628. this.model.waitForLoad(this.model, function() {
  21629. return this.model.meshTexturesLoaded
  21630. }
  21631. .bind(this)),
  21632. this.model.loadMeshTextures().done(h),
  21633. t.promise();
  21634. this.history.invalidate(),
  21635. this.updateLastView();
  21636. var u = this.mode
  21637. , d = this.cameraControls.cameras[i];
  21638. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21639. var p = void 0 !== r ? r : e.transitionTime;
  21640. this.emit(W.ModeChanging, u, i, n),
  21641. n && (this.currentPano = n),
  21642. this.switchCameraMode(i, l),
  21643. G.cancelById(q.LookTransition);
  21644. var f = (new B.Vector3).copy(this.position);
  21645. this.modeTran = this.mode + "-" + i;
  21646. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
  21647. VisiSet.finishSetPanoVisible()
  21648. VisiSet.finishSetTagVisible()
  21649. VisiSet.finishSetPanoLog()
  21650. }
  21651. if(editTool.atPanel == "screen"){
  21652. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21653. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21654. }
  21655. if(i == "panorama"){
  21656. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21657. }else{
  21658. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21659. }
  21660. if (i === V.PANORAMA)
  21661. this.emit(W.PanoChosen, n, n),
  21662. setTimeout(function() {
  21663. n.floor.enter(i)
  21664. }
  21665. .bind(this), p / 2),
  21666. this.path.fadeOutCpm(k.path.fadeOutTime);
  21667. else if (i === V.DOLLHOUSE) {
  21668. if (c && (this.model.stayPut = !0),
  21669. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21670. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21671. this.path.placeCpm(),
  21672. this.path.fadeInCpm(k.path.fadeInTime),
  21673. c) {
  21674. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21675. f.set(15, 10, 15);
  21676. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21677. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21678. v.length ? (g.copy(v[0].point),
  21679. f.copy(o.position),
  21680. 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),
  21681. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21682. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21683. f.add(this.model.position),
  21684. d.position.copy(f),
  21685. this.cameraControls.controls[V.DOLLHOUSE].update()
  21686. }
  21687. } else if (this.path.placeCpm(),
  21688. this.path.fadeInCpm(k.path.fadeInTime),
  21689. o) {
  21690. this.model.warpDestFloors(o.floorVisibility);
  21691. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21692. , A = this.cameraControls.controls[V.FLOORPLAN]
  21693. , C = y.position.clone().sub(A.target)
  21694. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21695. , E = Math.atan2(I.x, I.z);
  21696. A.target.copy(o.position);
  21697. var _ = C.length();
  21698. A.offset.x = _ * Math.sin(E),
  21699. A.offset.y = 0,
  21700. A.offset.z = _ * Math.cos(E),
  21701. y.position.copy(A.target).add(A.offset),
  21702. A.target.clone().sub(d.position),
  21703. d.quaternion.copy(o.quaternion),
  21704. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21705. A.absoluteScale = A.currentScale,
  21706. A.update()
  21707. } else
  21708. this.model.currentFloor.enter(i);
  21709. var b = this.currentPano
  21710. , w = this.position.clone();
  21711. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21712. this.flying = !0,
  21713. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21714. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21715. d.controls.update()),
  21716. e.blackoutStyle = P.FADEIN,
  21717. p = k.show360Views.transitionTime,
  21718. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21719. this.mode = i,
  21720. this.path && this.path.popOutCpm(),
  21721. e.blackoutStyle = P.END,
  21722. p = k.show360Views.transitionTime,
  21723. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21724. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21725. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21726. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21727. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21728. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21729. G.setTimeout(function() {
  21730. this.flying = !1,
  21731. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21732. this.currentPano.enter(),
  21733. this.path.placeCpm(),
  21734. this.path.fadeOutCpm(k.path.fadeOutTime),
  21735. this.spider.draw()),
  21736. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21737. this.mode = i,
  21738. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21739. if (this.afterCModeFuc) {
  21740. //手动加的函数
  21741. var cf = this.afterCModeFuc;
  21742. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21743. cf();
  21744. }
  21745. this.updateMarkerVisi();//add
  21746. //(this.mode == u.PANORAMA) && this.updateHotVisible()//add
  21747. if(this.mode == "panorama" ){
  21748. //EditOverlay.updatePano()
  21749. editTool.hotpoint.updatePano()
  21750. }
  21751. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21752. if(this.mode == V.PANORAMA){
  21753. Hot.updateVisibles([this.currentPano])
  21754. }else{
  21755. Hot.updateVisibles(true)
  21756. this.model.hotGroup.children.forEach(overlay=>{
  21757. if(overlay.animateInfo){
  21758. GifTexDeal.start(overlay.animation)
  21759. }
  21760. })
  21761. }
  21762. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21763. t.resolve())
  21764. }
  21765. .bind(this), p, q.FlyToNewMode),
  21766. this.mode = V.TRANSITIONING,
  21767. //EditOverlay.updatePano(),//add
  21768. editTool.hotpoint.updatePano(),//add
  21769. //u == "panorama" && this.updateHotVisible(),
  21770. t.promise()
  21771. }
  21772. ,
  21773. t.prototype.fade360View = function(e, t, i) {
  21774. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21775. $(this.domElement).fadeOut(.5 * e, function() {
  21776. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21777. this.model.alpha = i.modelAlpha,
  21778. this.position.copy(t.position),
  21779. this.quaternion.copy(t.quaternion),
  21780. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21781. $(this.domElement).fadeIn(.5 * e)
  21782. }
  21783. .bind(this))
  21784. }
  21785. ,
  21786. t.prototype.findDefaultViews = function() {
  21787. this.findDefaultView(this.lastInsideView, !0),
  21788. this.findDefaultView(this.last360View, !1)
  21789. }
  21790. ,
  21791. t.prototype.findDefaultView = function(e, i) {
  21792. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21793. if (e.cameraMode !== V.PANORAMA)
  21794. return !1;
  21795. var t = r.get(e.panoId);
  21796. return t && t.isAligned() === i
  21797. });
  21798. 0 <= o ? (t = r.get(n[o].panoId),
  21799. e.update({
  21800. cameraMode: V.PANORAMA,
  21801. pano: t,
  21802. position: n[o].position,
  21803. quaternion: n[o].quaternion
  21804. })) : 0 <= (o = r.list.findIndex(function(e) {
  21805. return e.isAligned() === i
  21806. })) ? (t = r.list[o],
  21807. e.update({
  21808. cameraMode: V.PANORAMA,
  21809. pano: t,
  21810. position: t.position
  21811. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21812. }
  21813. ,
  21814. t.prototype.updateLastView = function() {
  21815. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21816. pano: this.currentPano,
  21817. position: this.position,
  21818. quaternion: this.quaternion
  21819. })
  21820. }
  21821. ,
  21822. t.prototype.goToLastView = function(e, t) {
  21823. var i = $.Deferred()
  21824. , n = i.resolve.bind(i)
  21825. , r = i.reject.bind(i)
  21826. , o = e ? this.lastInsideView : this.last360View;
  21827. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21828. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21829. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21830. mode: o.cameraMode,
  21831. pano: o.pano,
  21832. quaternion: o.quaternion,
  21833. callback: t
  21834. }).done(n).fail(r),
  21835. i.promise()
  21836. }
  21837. ,
  21838. t.prototype.fadeToView = function(e, t, i, n) {
  21839. var r = $.Deferred()
  21840. , o = r.resolve.bind(r)
  21841. , a = r.reject.bind(r);
  21842. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21843. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21844. a("Cannot go to illegal view"),
  21845. r.promise();
  21846. var s = (k[t.cameraMode],
  21847. function() {
  21848. $(this.domElement).fadeIn(.5 * i),
  21849. n && n(),
  21850. o()
  21851. }
  21852. .bind(this))
  21853. , l = e ? P.FADEIN : P.END;
  21854. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21855. $(this.domElement).fadeOut(.5 * i, function() {
  21856. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21857. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21858. pano: t.pano,
  21859. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21860. duration: 0
  21861. }, s) : this.flyToNewMode({
  21862. mode: t.cameraMode,
  21863. quaternion: t.quaternion,
  21864. duration: 0,
  21865. callback: s
  21866. })
  21867. }
  21868. .bind(this)),
  21869. r.promise()
  21870. }
  21871. ,
  21872. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21873. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21874. this.flying)
  21875. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21876. o && o(),
  21877. !1;
  21878. null != e || (e = M.Show),
  21879. this.history.invalidate(),
  21880. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21881. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21882. return this.emit(W.WarpStarted, a, i, n, r),
  21883. n = n || P.MIDDLE,
  21884. this.path.warpToPano(i, n, r, function() {
  21885. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21886. this.emit(W.WarpEnded, i),
  21887. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21888. o && o()
  21889. }
  21890. .bind(this)),
  21891. e === M.Hide && this.path.discardPathObject(),
  21892. !0
  21893. }
  21894. ,
  21895. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21896. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21897. s && s(),
  21898. !1)
  21899. }
  21900. ,
  21901. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21902. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21903. a && a(),
  21904. !1)
  21905. }
  21906. ,
  21907. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21908. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21909. }
  21910. ,
  21911. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21912. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21913. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21914. t && t(),
  21915. !1)
  21916. }
  21917. ,
  21918. t.prototype.aimTourCamera = function(e, t, i, n) {
  21919. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21920. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21921. }
  21922. ,
  21923. t.prototype.showPathToHeroLocation = function(e) {
  21924. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  21925. }
  21926. ,
  21927. t.prototype.tourInterlude = function(e, t) {
  21928. this.history.invalidate(),
  21929. this.path.discardSlow();
  21930. var defaultRotTime = DATA.tourRotTime * 1000
  21931. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  21932. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  21933. var rotTime
  21934. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  21935. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  21936. var hasMusic = currentLocation && currentLocation.musicInfo.music
  21937. if(hasMusic){
  21938. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  21939. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  21940. rotTime = currentLocation.musicInfo.time - current
  21941. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  21942. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  21943. }
  21944. }else{
  21945. rotTime = defaultRotTime
  21946. }
  21947. rotTime = Math.max(0, rotTime)
  21948. console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : ''))
  21949. }else{
  21950. rotTime = currentLocation.rotTime * 1000
  21951. console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
  21952. }
  21953. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  21954. t && t()
  21955. }
  21956. .bind(this), rotTime)
  21957. }
  21958. ,
  21959. t.prototype.stopInterlude = function() {
  21960. this.interruptAndFastForward(null, 0)
  21961. }
  21962. ,
  21963. t.prototype.interruptAndFastForward = function(e, t) {
  21964. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  21965. this.flying && this.emit(W.FlyingInterrupted),
  21966. this.path.interruptAndFastForward(e, t)
  21967. }
  21968. ,
  21969. t.prototype.setSize = function(e, t) {
  21970. var i = e / t;
  21971. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  21972. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  21973. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  21974. this.cameraControls.cameras) {
  21975. var o = this.cameraControls.cameras[r];
  21976. o.fov = this.baseFov * (1 / this.zoomLevel),
  21977. o.updateAspect(i)
  21978. }
  21979. }
  21980. ,
  21981. t.prototype.toJSON = function() {
  21982. var e = {};
  21983. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  21984. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  21985. return e.hidden ? 0 : 1
  21986. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  21987. e
  21988. }
  21989. ,
  21990. t.prototype.getCurrentNodePanos = function(e) {
  21991. if (this.model.panos.map,
  21992. e.length = 0,
  21993. this.path.nodes)
  21994. for (var t = 0; t < this.path.nodes.length; t++) {
  21995. var i = this.path.nodes[t];
  21996. e.push(this.model.panos.get(i))
  21997. }
  21998. }
  21999. ,
  22000. t.prototype.zoomIncrementally = function(e) {
  22001. var t = this.zoomLevel;
  22002. this.zoomTo(this.zoomLevel + e),
  22003. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22004. }
  22005. ,
  22006. t.prototype.zoomInIncrementally = function(e) {
  22007. e = e || this.defaultZoomIncrement,
  22008. this.zoomIncrementally(e)
  22009. }
  22010. ,
  22011. t.prototype.zoomOutIncrementally = function(e) {
  22012. e = e || -this.defaultZoomIncrement,
  22013. this.zoomIncrementally(e)
  22014. }
  22015. ,
  22016. t.prototype.zoomBy = function(e) {
  22017. this.zoomTo(this.zoomLevel * e)
  22018. }
  22019. ,
  22020. t.prototype.zoomIn = function() {
  22021. this.zoomBy(1 + this.zoomSpeed)
  22022. }
  22023. ,
  22024. t.prototype.zoomOut = function() {
  22025. this.zoomBy(1 - this.zoomSpeed)
  22026. }
  22027. ,
  22028. t.prototype.zoomTo = function(e, t) {
  22029. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22030. e > k.zoom.max && (e = k.zoom.max),
  22031. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22032. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22033. e === k.zoom.min && this.emit(m.ZoomMin)),
  22034. this.cameraControls.activeControl)) {
  22035. var i = this.cameraControls.activeControl.camera;
  22036. this.zoomLevel = e,
  22037. i.fov = this.baseFov * (1 / this.zoomLevel),
  22038. i.updateProjectionMatrix(),
  22039. this.zoomFov = i.fov
  22040. }
  22041. }
  22042. ,
  22043. t.prototype.increaseZoomSpeed = function() {
  22044. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22045. }
  22046. ,
  22047. t.prototype.decreaseZoomSpeed = function() {
  22048. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22049. }
  22050. ,
  22051. t.prototype.clampZoomSpeed = function(e) {
  22052. return e < 0 ? 0 : e
  22053. }
  22054. ,
  22055. t.prototype.activatePersistentZooming = function(e) {
  22056. this.zooming = e ? 1 : -1
  22057. }
  22058. ,
  22059. t.prototype.deactivatePersistentZooming = function() {
  22060. this.zooming = 0
  22061. }
  22062. ,
  22063. t.prototype.zoomDefault = function() {
  22064. this.zoomTo(1, !0)
  22065. }
  22066. window.fovTranId = 333;//add
  22067. t.prototype.smoothZoomToDefault = function(e, t) {
  22068. G.cancelById(window.fovTranId)
  22069. var i, n = this.zoomLevel, r = function(e) {
  22070. 1 < e && (e = 1),
  22071. i = n * (1 - e) + e,
  22072. this.zoomTo(i, !0)
  22073. }
  22074. .bind(this), o = function() {
  22075. this.zoomDefault(),
  22076. t && window.setTimeout(t, 50)
  22077. }
  22078. .bind(this);
  22079. G.start(r, e, o, null, 0, z[k.transition.blendEasing], null, window.fovTranId)
  22080. }
  22081. ,
  22082. t.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  22083. G.cancelById(window.fovTranId)
  22084. var i,
  22085. n = this.zoomLevel,
  22086. aimLevel = zoomLevel || this.baseFov / fov
  22087. if (n == aimLevel) return
  22088. var fun = function (e) {
  22089. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  22090. }.bind(this)
  22091. G.start(fun, dur, callback, null, 0, z[k.transition.easeInCubic], null, window.fovTranId)
  22092. }
  22093. ,
  22094. t.prototype.updateZoomPano = function() {
  22095. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22096. var e = this.currentPano;
  22097. if (e) {
  22098. var t = this.zoomLevel > k.zoom.activationThreshold
  22099. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22100. t);
  22101. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22102. this.panoRenderer.setZoomingActive(i, e, !0);
  22103. var n = function(e, t) {
  22104. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22105. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22106. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22107. e.setZoomed(t)
  22108. }
  22109. .bind(this);
  22110. i && !e.zoomed ? (n(e, !0),
  22111. this.panoRenderer.enableUltraHighQualityMode(function() {
  22112. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22113. i && n(e, !0)
  22114. }
  22115. .bind(this))) : !t && e.zoomed && n(e, !1)
  22116. }
  22117. }
  22118. },
  22119. //--------
  22120. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22121. var f2;
  22122. if (this.mode == mode) {
  22123. f1 && f1()
  22124. } else {
  22125. f2 = f1;
  22126. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22127. this.afterCModeFuc = function() {
  22128. this.afterCModeFuc = f2
  22129. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22130. }.bind(this)
  22131. } else {
  22132. this.afterCModeFuc = f2;//飞入后执行
  22133. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22134. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22135. }catch(e){}
  22136. }
  22137. }
  22138. }
  22139. ,
  22140. t.prototype.checkHasNeighbor = function(pano){//add
  22141. for(var i in pano.neighbourPanos ){
  22142. if(i == pano.id)continue;
  22143. if(pano.neighbourPanos[i]){
  22144. return true;
  22145. }
  22146. }
  22147. }
  22148. ,
  22149. ee.exports = t
  22150. }
  22151. ).call(this, "/js/player.js")
  22152. }
  22153. , {
  22154. "./constants": 8,
  22155. "./enum/AlignmentType": 17,
  22156. "./enum/BlackoutStyle": 18,
  22157. "./enum/ControlEvents": 21,
  22158. "./enum/Keys": 30,
  22159. "./enum/ModelManagerEvents": 33,
  22160. "./enum/PanoSizeClass": 36,
  22161. "./enum/PanoramaEvents": 37,
  22162. "./enum/PathDiscardMode": 38,
  22163. "./enum/PathDisplayMode": 39,
  22164. "./enum/PlayerEvents": 40,
  22165. "./enum/TagStates": 44,
  22166. "./enum/Vectors": 50,
  22167. "./enum/Viewmode": 51,
  22168. "./enum/WarpStyle": 52,
  22169. "./enum/ZoomEvents": 53,
  22170. "./exception/BasicException": 55,
  22171. "./model/ModelManager": 140,
  22172. "./objects/NSpider": 147,
  22173. "./objects/Panorama": 148,
  22174. "./objects/Reticule": 149,
  22175. "./objects/ShowPath": 151,
  22176. "./objects/Snapshot": 153,
  22177. "./objects/View": 154,
  22178. "./settings": 166,
  22179. "./shaders": 167,
  22180. "./tile/TileDownloader": 171,
  22181. "./tile/TilePrioritizer": 172,
  22182. "./util/ZoomStats": 179,
  22183. "./util/browser": 182,
  22184. "./util/camera": 183,
  22185. "./util/cameraLight": 184,
  22186. "./util/common": 185,
  22187. "./util/easing": 186,
  22188. "./util/history": 187,
  22189. "./util/lerp": 188,
  22190. "./util/logger": 189,
  22191. "./util/math": 190,
  22192. "./util/transitions": 195,
  22193. // hot: "hot",
  22194. scaleImg: "scaleImg",
  22195. events: 202,
  22196. three: 217
  22197. }],
  22198. scaleImg: [function(e, t) {
  22199. var i = t;
  22200. (function() {
  22201. function e(e, t, i, n) {
  22202. function r() {
  22203. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22204. U.height = p,
  22205. H = U.getContext("2d")
  22206. }
  22207. function o(e) {
  22208. if (e) {
  22209. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22210. for (t = 0; t < ie; t += 4)
  22211. n[t] = e[t] * ne | 0,
  22212. n[t + 1] = e[t + 1] * ne | 0,
  22213. n[t + 2] = e[t + 2] * ne | 0,
  22214. n[t + 3] = e[t + 3] * ne | 0;
  22215. return delete e,
  22216. i
  22217. }
  22218. return H.getImageData(0, 0, d, p)
  22219. }
  22220. function a(e, t, i, n, r) {
  22221. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22222. }
  22223. var s, l;
  22224. if (t || (t = e.input,
  22225. i = e.output,
  22226. n = e.inputRemovable,
  22227. e.scale && (e = e.scale)),
  22228. t.src)
  22229. if (s = document.createElement("canvas"),
  22230. null != t.naturalWidth)
  22231. s.width = t.naturalWidth,
  22232. s.height = t.naturalHeight;
  22233. else if (null != t.runtimeStyle) {
  22234. var c = t.runtimeStyle
  22235. , h = c.width
  22236. , u = c.height;
  22237. c.width = "auto",
  22238. c.height = "auto",
  22239. s.width = t.width,
  22240. s.height = t.height,
  22241. c.width = h,
  22242. c.height = u
  22243. } else {
  22244. h = t.width,
  22245. u = t.height;
  22246. t.removeAttribute && (t.removeAttribute("width"),
  22247. t.removeAttribute("height")),
  22248. s.width = t.width,
  22249. s.height = t.height,
  22250. t.width = h,
  22251. t.height = u
  22252. }
  22253. else
  22254. s = t;
  22255. l = s.getContext("2d"),
  22256. t.src && l.drawImage(t, 0, 0);
  22257. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22258. if (!f || !g)
  22259. return !1;
  22260. (t.src || n) && s.clearRect(0, 0, f, g),
  22261. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22262. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22263. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22264. e * g + .5 | 0);
  22265. 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;
  22266. if (1 < re || 1 < oe)
  22267. for (r(),
  22268. G = (z = o()).data,
  22269. C = 0; C < p; C++)
  22270. for (V = (y = C / oe) - (w = 0 | y),
  22271. j = w * $,
  22272. W = w < 1 ? j : j - $,
  22273. w < g - 2 ? (Y = j + $,
  22274. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22275. A = 0; A < d; A++,
  22276. te += 4)
  22277. Z = (b = 0 | (v = A / re)) << 2,
  22278. b < f - 2 ? (K = Z + 4,
  22279. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22280. 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,
  22281. ++Z,
  22282. ++K,
  22283. ++Q,
  22284. 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,
  22285. ++Z,
  22286. ++K,
  22287. ++Q,
  22288. 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,
  22289. ++Z,
  22290. ++K,
  22291. ++Q,
  22292. 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,
  22293. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22294. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22295. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22296. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22297. else {
  22298. if (le.Float32Array)
  22299. L = new Float32Array(ie);
  22300. else
  22301. for (L = [],
  22302. te = 0; te < ie; ++te)
  22303. L[te] = 0;
  22304. for (y = 0; y < g; y++)
  22305. for (I = (_ = 0 | (C = y * oe)) * J,
  22306. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22307. R = C + oe - _ - 1),
  22308. v = 0; v < f; v++,
  22309. ee += 4)
  22310. switch (A = v * re,
  22311. E = 0 | A,
  22312. te = I + (E << 2),
  22313. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22314. P && (x = 1 + E - A,
  22315. S = A + re - E - 1),
  22316. D = m[ee],
  22317. F = m[ee + 1],
  22318. B = m[ee + 2],
  22319. N = m[ee + 3],
  22320. P + O) {
  22321. case 0:
  22322. L[te] += D * ae,
  22323. L[te + 1] += F * ae,
  22324. L[te + 2] += B * ae,
  22325. L[te + 3] += N * ae;
  22326. break;
  22327. case 1:
  22328. T = x * oe,
  22329. L[te] += D * T,
  22330. L[te + 1] += F * T,
  22331. L[te + 2] += B * T,
  22332. L[te + 3] += N * T,
  22333. T = S * oe,
  22334. L[te + 4] += D * T,
  22335. L[te + 5] += F * T,
  22336. L[te + 6] += B * T,
  22337. L[te + 7] += N * T;
  22338. break;
  22339. case 2:
  22340. T = re * M,
  22341. L[te] += D * T,
  22342. L[te + 1] += F * T,
  22343. L[te + 2] += B * T,
  22344. L[te + 3] += N * T,
  22345. T = re * R,
  22346. L[te += J] += D * T,
  22347. L[te + 1] += F * T,
  22348. L[te + 2] += B * T,
  22349. L[te + 3] += N * T;
  22350. break;
  22351. default:
  22352. T = x * M,
  22353. L[te] += D * T,
  22354. L[te + 1] += F * T,
  22355. L[te + 2] += B * T,
  22356. L[te + 3] += N * T,
  22357. T = S * M,
  22358. L[te + 4] += D * T,
  22359. L[te + 5] += F * T,
  22360. L[te + 6] += B * T,
  22361. L[te + 7] += N * T,
  22362. T = x * R,
  22363. L[te += J] += D * T,
  22364. L[te + 1] += F * T,
  22365. L[te + 2] += B * T,
  22366. L[te + 3] += N * T,
  22367. T = S * R,
  22368. L[te + 4] += D * T,
  22369. L[te + 5] += F * T,
  22370. L[te + 6] += B * T,
  22371. L[te + 7] += N * T
  22372. }
  22373. delete m,
  22374. r(),
  22375. z = o(L)
  22376. }
  22377. if (H.putImageData(z, 0, 0),
  22378. "string" == typeof i) {
  22379. var se;
  22380. if ("png" === i || "jpeg" === i)
  22381. return (se = n && t.src ? t : new Image).width = d,
  22382. se.height = p,
  22383. se.src = U.toDataURL("image/" + i, .85),
  22384. se;
  22385. if ("png-src" === i || "jpeg-src" === i)
  22386. return U.toDataURL("image/" + i.split("-")[0], .85)
  22387. }
  22388. return U
  22389. }
  22390. var le = this;
  22391. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22392. exports.scale = e) : c = e
  22393. }
  22394. ).call(this),
  22395. i.exports = c
  22396. }
  22397. , {}],
  22398. 156: [function(i, n, e) {
  22399. (function(e) {
  22400. "use strict";
  22401. function t(e, t) {
  22402. this.model = e,
  22403. this.panos = e.panos,
  22404. this.player = t,
  22405. this.imagePanos = this.listImagePanos(),
  22406. this.retryMinimumTime = 1e4
  22407. }
  22408. var r = (i("three"),
  22409. i("./enum/Viewmode"))
  22410. , o = (i("./settings"),
  22411. i("./objects/Panorama"))
  22412. , a = new (i("./util/logger"))(e);
  22413. t.prototype.start = function() {
  22414. this.loadNextPano(function(e) {
  22415. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22416. setTimeout(function() {
  22417. this.start()
  22418. }
  22419. .bind(this), 1e3))
  22420. }
  22421. .bind(this))
  22422. }
  22423. ,
  22424. t.prototype.validLoadTarget = function(e) {
  22425. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22426. }
  22427. ,
  22428. t.prototype.listImagePanos = function() {
  22429. var i = []
  22430. , n = this;
  22431. return this.model.images.forEach(function(e) {
  22432. if (e.metadata && e.metadata.scan_id) {
  22433. var t = n.model.panos.get(e.metadata.scan_id);
  22434. t && !t.isLoaded("high") && i.push(t)
  22435. }
  22436. }),
  22437. i
  22438. }
  22439. ,
  22440. t.prototype.nextNotLoadedImage = function() {
  22441. for (; 0 < this.imagePanos.length; ) {
  22442. var e = this.imagePanos[0];
  22443. if (!e.isLoaded("high"))
  22444. return e;
  22445. this.imagePanos.shift()
  22446. }
  22447. return null
  22448. }
  22449. ,
  22450. t.prototype.loadNextPano = function(e) {
  22451. var t, i, n = this.model.waitQueue.filter(function(e) {
  22452. return e.object instanceof o
  22453. });
  22454. 0 < n.length ? (t = n[0].object,
  22455. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22456. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22457. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22458. t = this.imagePanos[0],
  22459. 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),
  22460. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22461. a.debug("Preloading " + i + "-res pano " + t.id),
  22462. t.loadCube(i).done(e).fail(function() {
  22463. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22464. e()
  22465. })) : e && e(null)
  22466. }
  22467. ,
  22468. n.exports = t
  22469. }
  22470. ).call(this, "/js/preloaders.js")
  22471. }
  22472. , {
  22473. "./enum/Viewmode": 51,
  22474. "./objects/Panorama": 148,
  22475. "./settings": 166,
  22476. "./util/logger": 189,
  22477. three: 217
  22478. }],
  22479. 157: [function(a, s, e) {
  22480. (function(e) {
  22481. "use strict";
  22482. function t(e, t, i, n, r) {
  22483. this.qualityManager = e,
  22484. this.scene = t,
  22485. this.camera = i,
  22486. this.container = r,
  22487. this.controls = n,
  22488. this.controls.enabled = !0,
  22489. this.controls.locked = !0,
  22490. this.quickstartCamera = n.camera,
  22491. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22492. this.skybox = null
  22493. }
  22494. var i = a("three")
  22495. , n = a("../util/logger")
  22496. , o = a("../constants")
  22497. , h = (a("../util/transitions"),
  22498. a("../util/lerp"),
  22499. a("../util/easing"),
  22500. a("../enum/Vectors"))
  22501. , u = a("../enum/PanoSizeClass")
  22502. , r = (a("../materials/ModelTextureMaterial"),
  22503. a("../materials/CubemapMaterial"))
  22504. , d = (a("../cameras/PanoramaCamera"),
  22505. a("../controls/PanoramaControls"),
  22506. a("../tile/TileUtils"),
  22507. a("../util/camera"),
  22508. a("../util/cameraLight"))
  22509. , p = (a("../util/browser"),
  22510. a("../settings"),
  22511. a("../gui/helpManager"),
  22512. new n(e));
  22513. t.prototype.load = function(e) {
  22514. e.pano.shouldRedrawOnBaseLoaded = !0;
  22515. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22516. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22517. var a = this.qualityManager.getPanoSize(u.BASE)
  22518. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22519. if (e.pano.tiled) {
  22520. p.warn("Loading startPano, TILED", e.pano.id);
  22521. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22522. , c = this.quickstartCamera.fov;
  22523. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22524. t = e.pano.loadTiledPano(s, r, {
  22525. hFov: l,
  22526. vFov: c
  22527. }, !1, !1, !0),
  22528. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22529. } else
  22530. p.warn("Loading startPano", e.pano.id),
  22531. t = e.pano.loadCube("high");
  22532. return $.when(t).then(function() {
  22533. n.init(e.pano, e.quaternion),
  22534. e.pano.tiled ? i.done(function() {
  22535. e.pano.lockUntilRenderingComplete = !1,
  22536. this.controls.locked = !1
  22537. }
  22538. .bind(this)) : this.controls.locked = !1
  22539. }
  22540. .bind(this))
  22541. }
  22542. ,
  22543. t.prototype.init = function(e, t) {
  22544. p.info("Quickstart done loading, adding scene objects"),
  22545. e.lockUntilRenderingComplete = !0,
  22546. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22547. side: i.BackSide
  22548. })),
  22549. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22550. this.skybox.quaternion.copy(e.quaternion),
  22551. this.scene.add(this.skybox),
  22552. $(this.container).show()
  22553. }
  22554. ,
  22555. t.prototype.update = function(e) {
  22556. this.controls.update(e),
  22557. this.camera.copy(this.quickstartCamera)
  22558. }
  22559. ,
  22560. t.prototype.setSize = function(e, t) {
  22561. this.quickstartCamera.updateAspect(e / t)
  22562. }
  22563. ,
  22564. t.prototype.destroy = function() {
  22565. this.scene.remove(this.skybox)
  22566. }
  22567. ,
  22568. s.exports = t
  22569. }
  22570. ).call(this, "/js/scene/QuickstartManager.js")
  22571. }
  22572. , {
  22573. "../cameras/PanoramaCamera": 7,
  22574. "../constants": 8,
  22575. "../controls/PanoramaControls": 13,
  22576. "../enum/PanoSizeClass": 36,
  22577. "../enum/Vectors": 50,
  22578. "../gui/helpManager": 68,
  22579. "../materials/CubemapMaterial": 117,
  22580. "../materials/ModelTextureMaterial": 118,
  22581. "../settings": 166,
  22582. "../tile/TileUtils": 174,
  22583. "../util/browser": 182,
  22584. "../util/camera": 183,
  22585. "../util/cameraLight": 184,
  22586. "../util/easing": 186,
  22587. "../util/lerp": 188,
  22588. "../util/logger": 189,
  22589. "../util/transitions": 195,
  22590. three: 217
  22591. }],
  22592. 158: [function(e, t, i) {
  22593. "use strict";
  22594. function h(e, t, i) {
  22595. this.scene = e,
  22596. this.camera = t,
  22597. this.renderer = null,
  22598. this.effects = i,
  22599. this.animateCallback = null,
  22600. this.composer = null,
  22601. this.qualityManager = null,
  22602. e.renderWidth = 0,
  22603. e.renderHeight = 0,
  22604. this.updateClock = new M.Clock,
  22605. this.components = [],
  22606. this.updateListeners = [],
  22607. this.resizeListeners = [],
  22608. this.forceUpdateSize = !1,
  22609. this.started = !1,
  22610. this.textures = {},
  22611. this.suspendedObjects = []
  22612. }
  22613. 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;
  22614. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22615. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22616. this.components.push(e),
  22617. e.update && this.updateListeners.push(e),
  22618. e.setSize && (this.resizeListeners.push(e),
  22619. this.forceUpdateSize = !0)
  22620. }
  22621. ,
  22622. h.prototype.removeComponent = function(t) {
  22623. function e(e) {
  22624. return e !== t
  22625. }
  22626. this.components = this.components.filter(e),
  22627. this.updateListeners = this.updateListeners.filter(e),
  22628. this.resizeListeners = this.resizeListeners.filter(e)
  22629. }
  22630. ,
  22631. h.prototype.start = function(e) {
  22632. if (this.started)
  22633. throw new l("Can't start SceneRenderer, already started");
  22634. this.createContext(e),
  22635. //u.isMobile() && this.boluoVrInit(),
  22636. this.initComposer(),
  22637. this.started = !0,
  22638. (b = b.bind(this))()
  22639. }
  22640. ,
  22641. h.prototype.createContext = function(e) {
  22642. try {
  22643. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22644. this.renderer.autoClear = !0,
  22645. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22646. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22647. this.emit(r.ContextCreated)
  22648. } catch (e) {
  22649. throw new c("Unable to create a WebGL rendering context")
  22650. }
  22651. d.profiling.enabled && this.overrideTextures(),
  22652. e.appendChild(this.renderer.domElement)
  22653. }
  22654. ,
  22655. h.prototype.overrideTextures = function() {
  22656. var d = this.renderer.context
  22657. , t = 0
  22658. , i = d.createTexture;
  22659. d.createTexture = function() {
  22660. var e = i.call(d);
  22661. return e.id = t++,
  22662. this.textures[e.id] = e
  22663. }
  22664. .bind(this);
  22665. var p = d.texImage2D;
  22666. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22667. var c, h = this.getTextureTypeFromTarget(d, e);
  22668. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22669. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22670. s = r,
  22671. n = (l = o).naturalWidth,
  22672. r = l.naturalHeight,
  22673. p.call(d, e, t, i, a, s, l));
  22674. var u = this.textures[c.id];
  22675. u.width = h === f.TextureCube ? 6 * n : n,
  22676. u.height = r
  22677. }
  22678. .bind(this);
  22679. var n = d.deleteTexture;
  22680. d.deleteTexture = function(e) {
  22681. delete this.textures[e.id],
  22682. n.call(d, e)
  22683. }
  22684. .bind(this)
  22685. }
  22686. ,
  22687. h.prototype.updateTextureMemory = (n = null,
  22688. function() {
  22689. var e = 0;
  22690. for (var t in this.textures) {
  22691. var i = this.textures[t];
  22692. i.width && i.height && (e += i.width * i.height * 4)
  22693. }
  22694. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22695. n = e
  22696. }
  22697. ),
  22698. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22699. switch (t) {
  22700. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22701. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22702. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22703. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22704. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22705. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22706. return f.TextureCube;
  22707. case e.TEXTURE_2D:
  22708. return f.Texture2D;
  22709. default:
  22710. return null
  22711. }
  22712. }
  22713. ,
  22714. h.prototype.initComposer = function() {
  22715. this.composer = new M.EffectComposer(this.renderer),
  22716. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22717. this.composer.addPass(this.effects.hblurPass),
  22718. this.composer.addPass(this.effects.vblurPass)
  22719. }
  22720. ,
  22721. h.prototype.setSize = function(e, t, i) {
  22722. this.renderWidth = e,
  22723. this.renderHeight = t,
  22724. this.effects.aspect = e / t,
  22725. this.renderer.setSize(e, t, !1, i),
  22726. this.composer.setSize(e, t);
  22727. for (var n = 0; n < this.resizeListeners.length; n++)
  22728. this.resizeListeners[n].setSize(e, t)
  22729. }
  22730. ,
  22731. h.prototype.render = function() {
  22732. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22733. }
  22734. ,
  22735. h.prototype.boluoVrInit = function() {
  22736. console.log("boluoVrInit"),
  22737. this.isHuawei5X = u.detectHUAWEI5X(),
  22738. this.oldRenderer = this.renderer,
  22739. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22740. window.panoCamera = this.camera;
  22741. var i = this;
  22742. window._vrEnabled = !1,
  22743. Object.defineProperty(window, "vrEnabled", {
  22744. get: function() {
  22745. return window._vrEnabled
  22746. },
  22747. set: function(e) {
  22748. (e = !!e) ? (i.renderer = i.newRenderer,
  22749. window.vrMarkers.forEach(function(e) {
  22750. e.visible = !0
  22751. })) : (i.renderer = i.oldRenderer,
  22752. window.vrMarkers.forEach(function(e) {
  22753. e.visible = !1
  22754. })),
  22755. i.cursor.visible = e,
  22756. i.setSize($("#player").width(), $("#player").height()),
  22757. window._vrEnabled = e,
  22758. setTimeout(function() {
  22759. console.log(player.cameraControls.activeControl.camera.fov)
  22760. }, 500)
  22761. }
  22762. }),
  22763. this.createCursor(.5, !1, 1, 16777215, 0);
  22764. var e = {
  22765. setSize: function(e, t) {
  22766. i.camera.aspect = e / t
  22767. }
  22768. };
  22769. this.resizeListeners.push(e),
  22770. this.vrLoadingInit()
  22771. }
  22772. ,
  22773. h.prototype.vrLoadingInit = function() {
  22774. var e = new (e = function(camera) {
  22775. var t = this
  22776. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22777. , i = new M.MeshBasicMaterial({
  22778. color: 4967932,
  22779. side: M.DoubleSide
  22780. })
  22781. , n = new M.Mesh(e,i);
  22782. (this.mesh = n).position.z = -2,
  22783. n.scale.set(.08, .08, .08),
  22784. n.visible = !1,
  22785. //window.player.camera.add(n),
  22786. camera.add(n),
  22787. t.enabled = !1,
  22788. this.update = function(e) {
  22789. 1 == t.enabled && (n.rotation.z += 15 * e)
  22790. }
  22791. }
  22792. )(this.camera);
  22793. window.Loading = e,
  22794. this.updateListeners.push(e)
  22795. }
  22796. ,
  22797. h.prototype.createCursor = function(e, t, i, n, r) {
  22798. var o, a = new M.SpriteMaterial({
  22799. opacity: i,
  22800. color: n,
  22801. transparent: t,
  22802. map: this.boluoGetTexture("images/cursor.png"),
  22803. needsUpdate: !0,
  22804. side: M.DoubleSide
  22805. });
  22806. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22807. a.map.repeat = new M.Vector2(1 / 17,1),
  22808. a.depthTest = !1,
  22809. a.blending = M.AdditiveBlending,
  22810. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22811. o.position.z = -2,
  22812. o.visible = !1,
  22813. o.name = "cursor",
  22814. this.camera.add(o),
  22815. this.scene.add(this.camera),
  22816. this.cursor = o;
  22817. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22818. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22819. this.updateListeners.push(s)
  22820. }
  22821. ,
  22822. h.prototype.CursorAnimation = function(e, t, o) {
  22823. this.cursor = t,
  22824. this.raycaster = new M.Raycaster,
  22825. this.targetEventObj = {},
  22826. this.type = 1,
  22827. this.tweenFlag = !0;
  22828. var s = this;
  22829. this.target = o,
  22830. console.log(o.uuid),
  22831. this.euler = new M.Euler,
  22832. this.q0 = new M.Quaternion,
  22833. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22834. this.zee = new M.Vector3(0,0,1),
  22835. this.alpha = -1e3,
  22836. this.beta = -1e3,
  22837. this.gamma = -1e3,
  22838. this.orient = M.Math.degToRad(window.orientation || 0),
  22839. window.addEventListener("orientationchange", function() {
  22840. s.orient = M.Math.degToRad(window.orientation || 0)
  22841. }),
  22842. window.addEventListener("deviceorientation", function(e) {
  22843. var t = M.Math.degToRad(e.alpha)
  22844. , i = M.Math.degToRad(e.beta)
  22845. , n = M.Math.degToRad(e.gamma);
  22846. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22847. -1e3 === s.beta && (s.beta = i),
  22848. -1e3 === s.gamma && (s.gamma = n),
  22849. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22850. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22851. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22852. s.beta = i,
  22853. s.gamma = n),
  22854. h.vrDebug) {
  22855. $("#info-device-orientation").css("display", "block");
  22856. var r = "";
  22857. r += "alpha=(" + s.alpha + ")<BR/>",
  22858. r += "beta=(" + s.beta + ")<BR/>",
  22859. r += "gamma=" + s.gamma + "<BR/>",
  22860. document.getElementById("info-device-orientation").innerHTML = r
  22861. }
  22862. }),
  22863. this.setObjectQuaternion = function(e, t, i, n, r) {
  22864. s.euler.set(i, t, -n, "YXZ"),
  22865. e.setFromEuler(s.euler),
  22866. e.multiply(s.q1),
  22867. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22868. o.updateMatrixWorld()
  22869. }
  22870. ,
  22871. parent !== window && window.addEventListener("message", function(e) {
  22872. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22873. o && o.alpha && o.beta && o.gamma && (t = a,
  22874. i = M.Math.degToRad(o.alpha),
  22875. n = M.Math.degToRad(o.beta),
  22876. r = M.Math.degToRad(o.gamma),
  22877. t ? (-1e3 === s.alpha && (s.alpha = i),
  22878. -1e3 === s.beta && (s.beta = n),
  22879. -1e3 === s.gamma && (s.gamma = r),
  22880. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22881. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22882. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22883. s.beta = n,
  22884. s.gamma = r))
  22885. }),
  22886. this.update = function(e) {
  22887. TWEEN.update(),
  22888. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22889. this.triggerTargetEvent())
  22890. }
  22891. ,
  22892. this.triggerTargetEvent = function() {
  22893. var e = this.choseObj()
  22894. , t = e ? e.object : void 0;
  22895. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22896. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22897. t && t.enabled && this.startAnimate(function() {
  22898. this.clickCallback(t)
  22899. }
  22900. .bind(this))) : this.type,
  22901. this.targetEventObj.lastObj = t)
  22902. }
  22903. ,
  22904. this.choseObj = function() {
  22905. this.raycaster.setFromCamera({
  22906. x: 0,
  22907. y: 0
  22908. }, o);
  22909. var e = (this.raycaster.ray,
  22910. window.vrMarkers)
  22911. , t = this.raycaster.intersectObjects(e);
  22912. if (0 < t.length)
  22913. return t[0]
  22914. }
  22915. ,
  22916. this.clickCallback = function(e) {
  22917. this.runTHREEAction(e, "onclick")
  22918. }
  22919. ,
  22920. this.runTHREEAction = function(e, t) {
  22921. switch (t) {
  22922. case "onclick":
  22923. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22924. e()
  22925. });
  22926. break;
  22927. case "onhover":
  22928. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22929. e()
  22930. });
  22931. break;
  22932. case "onout":
  22933. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22934. e()
  22935. })
  22936. }
  22937. }
  22938. ,
  22939. this.startAnimate = function(e) {
  22940. this.tweenFlag && this.initAnimation(e)
  22941. }
  22942. ,
  22943. this.initAnimation = function(e) {
  22944. var t = this
  22945. , i = this.cursor.material.map.offset;
  22946. t.tweenFlag = !1,
  22947. this.cursorAnimate = new TWEEN.Tween(i).to({
  22948. x: 1
  22949. }, 1e3).onStart(function() {
  22950. t.tweenFlag = !1
  22951. }).onStop(function() {
  22952. t.tweenFlag = !0,
  22953. this.x = 0,
  22954. i.x = 0
  22955. }).onUpdate(function() {}).onComplete(function() {
  22956. e(),
  22957. i.x = 0,
  22958. setTimeout(function() {
  22959. t.tweenFlag = !0
  22960. }, 1500)
  22961. }),
  22962. this.cursorAnimate.easing(function(e) {
  22963. return Math.floor(17 * e) / 17
  22964. }),
  22965. this.cursorAnimate.start()
  22966. }
  22967. ,
  22968. this.autoCursorPosition = function(e) {
  22969. this.cursor.scale.set(.3, .3, .3)
  22970. }
  22971. }
  22972. ,
  22973. h.prototype.vrRenderer = function(a, i, e) {
  22974. var s = new i.vrCamera(e);
  22975. s.bananaAspect = .8,
  22976. this.width,
  22977. this.height;
  22978. i = this;
  22979. this.setSize = function(e, t) {
  22980. a.setSize.call(this, e, t),
  22981. i.width = e,
  22982. i.height = t
  22983. }
  22984. ,
  22985. this.render = function(e, t, i, n) {
  22986. var r, o;
  22987. if (window.cameraQua = t.quaternion.clone(),
  22988. t.__RESS__SKIP__STEREO__)
  22989. return a.render(e, t, i, n);
  22990. if ("PerspectiveCamera" === t.type)
  22991. r = s.cameraL,
  22992. o = s.cameraR,
  22993. e.updateMatrixWorld(),
  22994. null === t.parent && t.updateMatrixWorld(),
  22995. s.vrCameraUpdate(t);
  22996. else {
  22997. if ("OrthographicCamera" !== t.type)
  22998. return DEBUG && console.error("Unsupported renderer: ", t.type);
  22999. r = o = t
  23000. }
  23001. a.setScissorTest(!0),
  23002. a.setScissor(0, 0, this.width / 2, this.height),
  23003. a.setViewport(0, 0, this.width / 2, this.height),
  23004. a.render.call(this, e, r, i, n),
  23005. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23006. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23007. a.render.call(this, e, o, i, n),
  23008. a.setScissorTest(!1)
  23009. }
  23010. ,
  23011. this.__proto__ = {
  23012. __proto__: a
  23013. }
  23014. }
  23015. ,
  23016. h.prototype.vrCamera = function(e) {
  23017. this.type = "StereoCamera",
  23018. this._aspect = 1,
  23019. this._overlap = .064,
  23020. this.cameraL = new M.PerspectiveCamera,
  23021. this.cameraL.layers.enable(1),
  23022. this.cameraL.matrixAutoUpdate = !1,
  23023. this.cameraR = new M.PerspectiveCamera,
  23024. this.cameraR.layers.enable(2),
  23025. this.cameraR.matrixAutoUpdate = !1,
  23026. this.eyeRight = new M.Matrix4,
  23027. this.eyeLeft = new M.Matrix4,
  23028. this.vrCameraNeedsUpdate = !0,
  23029. window.vrCameraL = this.cameraL,
  23030. Object.defineProperty(this, "bananaAspect", {
  23031. get: function() {
  23032. return this._aspect
  23033. },
  23034. set: function(e) {
  23035. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23036. this._aspect = e
  23037. }
  23038. }),
  23039. Object.defineProperty(this, "overlap", {
  23040. get: function() {
  23041. return this._overlap
  23042. },
  23043. set: function(e) {
  23044. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23045. this._overlap = e
  23046. }
  23047. }),
  23048. this.vrCameraUpdate = function(e) {
  23049. if (this.vrCameraNeedsUpdate = !0,
  23050. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23051. this.vrCameraNeedsUpdate) {
  23052. this.vrCameraNeedsUpdate = !1,
  23053. console.debug("vrCameraUpdate"),
  23054. this.bananaFocus = e.focus,
  23055. this.bananaFov = e.fov,
  23056. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23057. this.bananaNear = e.near,
  23058. this.bananaFar = e.far,
  23059. console.debug(e.aspect),
  23060. this.bananaFocus = 10;
  23061. 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);
  23062. this.eyeLeft.elements[12] = -r,
  23063. this.eyeRight.elements[12] = r,
  23064. t = -a * this.bananaReal_aspect + o,
  23065. i = a * this.bananaReal_aspect + o,
  23066. n.elements[0] = 2 * this.bananaNear / (i - t),
  23067. n.elements[8] = (i + t) / (i - t),
  23068. this.cameraL.projectionMatrix.copy(n),
  23069. t = -a * this.bananaReal_aspect - o,
  23070. i = a * this.bananaReal_aspect - o,
  23071. n.elements[0] = 2 * this.bananaNear / (i - t),
  23072. n.elements[8] = (i + t) / (i - t),
  23073. this.cameraR.projectionMatrix.copy(n)
  23074. }
  23075. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23076. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23077. }
  23078. }
  23079. ,
  23080. h.prototype.boluoGetTexture = function(e) {
  23081. var t = new M.TextureLoader;
  23082. return t.crossOrigin = "anonymous",
  23083. t.load(e)
  23084. }
  23085. ,
  23086. h.prototype.updateScreenSize = function(e) {
  23087. var t, i, n, r = !1;
  23088. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23089. n = e.height,
  23090. r = !0,
  23091. t = 1) : (i = $("#player").width(),
  23092. n = $("#player").height(),
  23093. e && e.resize && (o = this.renderWidth,
  23094. a = this.renderHeight),
  23095. i === o && n === a && !this.forceUpdateSize || (o = i,
  23096. a = n,
  23097. r = !0,
  23098. t = window.devicePixelRatio)),
  23099. r && (this.setSize(i, n, t),
  23100. this.forceUpdateSize = !1)
  23101. }
  23102. ,
  23103. h.prototype.updateComponents = function() {
  23104. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23105. this.updateListeners[t].update(e)
  23106. }
  23107. ,
  23108. h.prototype.suspend = function() {
  23109. this.started = !1,
  23110. this.suspendedObjects = this.scene.children.map(function(e) {
  23111. return this.scene.remove(e),
  23112. e
  23113. }
  23114. .bind(this)),
  23115. this.render()
  23116. }
  23117. ,
  23118. h.prototype.resume = function() {
  23119. this.suspendedObjects.forEach(function(e) {
  23120. this.scene.add(e)
  23121. }
  23122. .bind(this)),
  23123. this.suspendedObjects = [],
  23124. this.started = !0,
  23125. b()
  23126. }
  23127. ;
  23128. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23129. this.started && (window.requestAnimationFrame(b),
  23130. this.updateScreenSize(),
  23131. this.updateComponents(),
  23132. this.updateTextureMemory(),
  23133. this.render(),
  23134. this.emit(r.AfterRender))
  23135. };
  23136. h.prototype.getImageData = (E = document.createElement("canvas"),
  23137. _ = E.getContext("2d"),
  23138. function(e, t, i) {
  23139. return E.width === t && E.height === i || (E.width = t,
  23140. E.height = i),
  23141. _.drawImage(e, 0, 0, t, i),
  23142. _.getImageData(0, 0, t, i)
  23143. }
  23144. ),
  23145. h.prototype.initSizedTexture2D = function(e, t, i) {
  23146. var n = this.renderer
  23147. , r = n.context
  23148. , o = n.state
  23149. , a = new M.Texture(null);
  23150. !(a.flipY = !1) !== i && (i = !1),
  23151. a.generateMipmaps = i;
  23152. var s = n.paramThreeToGL(a.format)
  23153. , l = n.paramThreeToGL(a.type)
  23154. , c = n.properties.get(a)
  23155. , h = r.createTexture();
  23156. o.bindTexture(r.TEXTURE_2D, h),
  23157. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23158. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23159. a.wrapS = t,
  23160. a.wrapT = t;
  23161. var u = n.paramThreeToGL(t);
  23162. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23163. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23164. i ? (a.magFilter = M.LinearFilter,
  23165. a.minFilter = M.LinearMipMapLinearFilter,
  23166. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23167. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23168. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23169. a.minFilter = M.LinearFilter,
  23170. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23171. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23172. o.bindTexture(r.TEXTURE_2D, null),
  23173. c.__webglTexture = h,
  23174. a
  23175. }
  23176. ,
  23177. h.prototype.initSizedCubeMap = function(e, t) {
  23178. var i = this.renderer
  23179. , n = i.context
  23180. , r = i.state
  23181. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23182. o.flipY = !1,
  23183. o.generateMipmaps = t;
  23184. var a = i.paramThreeToGL(o.format)
  23185. , s = i.paramThreeToGL(o.type)
  23186. , l = i.properties.get(o)
  23187. , c = n.createTexture();
  23188. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23189. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23190. for (var h = 0; h < 6; h++)
  23191. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23192. return t ? (o.magFilter = M.LinearFilter,
  23193. o.minFilter = M.LinearMipMapLinearFilter,
  23194. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23195. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23196. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23197. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23198. o.minFilter = M.LinearFilter,
  23199. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23200. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23201. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23202. l.__image__webglTextureCube = c,
  23203. o
  23204. }
  23205. ,
  23206. h.prototype.deallocateCubeTexture = function(e) {
  23207. var t = this.renderer
  23208. , i = t.context
  23209. , n = t.properties.get(e);
  23210. i.deleteTexture(n.__image__webglTextureCube)
  23211. }
  23212. ,
  23213. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23214. var a = this.renderer
  23215. , s = a.context
  23216. , l = a.state
  23217. , c = a.properties.get(t);
  23218. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23219. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23220. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23221. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23222. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23223. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23224. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23225. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23226. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23227. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23228. l.bindTexture(s.TEXTURE_2D, null)
  23229. }
  23230. ,
  23231. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23232. var s = this.renderer
  23233. , l = s.context
  23234. , c = s.state
  23235. , h = s.properties.get(t);
  23236. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23237. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23238. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23239. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23240. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23241. }
  23242. ,
  23243. h.prototype.rebuildMipMaps2D = function(e) {
  23244. var t = this.renderer
  23245. , i = t.context
  23246. , n = t.state;
  23247. t.properties.get(e),
  23248. i.generateMipmap(i.TEXTURE_2D),
  23249. n.bindTexture(i.TEXTURE_2D, null)
  23250. }
  23251. ,
  23252. h.prototype.rebuildMipMaps3D = function(e) {
  23253. var t = this.renderer
  23254. , i = t.context
  23255. , n = t.state
  23256. , r = t.properties.get(e);
  23257. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23258. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23259. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23260. }
  23261. ,
  23262. h.prototype.renderToCubeMap = (P = !1,
  23263. F = N = D = L = O = null,
  23264. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23265. this.renderer.context,
  23266. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23267. (O = new M.Scene).add(L),
  23268. D = new M.ShaderMaterial({
  23269. uniforms: {
  23270. tDiffuse: {
  23271. type: "t",
  23272. value: null
  23273. },
  23274. alpha: {
  23275. type: "f",
  23276. value: 1
  23277. }
  23278. },
  23279. vertexShader: R.basicTextured.vertexShader,
  23280. fragmentShader: R.basicTextured.fragmentShader,
  23281. depthWrite: !1,
  23282. depthTest: !1,
  23283. side: M.DoubleSide
  23284. }),
  23285. N = new M.PlaneBufferGeometry(1,1),
  23286. (F = new M.Mesh(N,D)).position.z = 0,
  23287. O.add(F),
  23288. P = !0);
  23289. var m = N.getAttribute("uv");
  23290. m.setDynamic(!0),
  23291. m.needsUpdate = !0;
  23292. var v = m.array
  23293. , y = r / i
  23294. , A = o / n
  23295. , C = a / i
  23296. , I = s / n;
  23297. v[0] = y,
  23298. v[1] = A + I,
  23299. v[2] = y + C,
  23300. v[3] = A + I,
  23301. v[4] = y,
  23302. v[5] = A,
  23303. v[6] = y + C,
  23304. v[7] = A;
  23305. var E = N.getAttribute("position");
  23306. E.setDynamic(!0),
  23307. E.needsUpdate = !0;
  23308. var _ = E.array
  23309. , b = l / t.width - .5
  23310. , w = c / t.height - .5
  23311. , T = h / t.width
  23312. , x = u / t.height;
  23313. _[0] = b,
  23314. _[1] = w + x,
  23315. _[3] = b + T,
  23316. _[4] = w + x,
  23317. _[6] = b,
  23318. _[7] = w,
  23319. _[9] = b + T,
  23320. _[10] = w,
  23321. this.renderer.properties.get(e),
  23322. D.uniforms.tDiffuse.value = e,
  23323. D.blending = p || M.NoBlending,
  23324. D.transparent = !!f,
  23325. null != g || (g = 1),
  23326. D.uniforms.alpha.value = g,
  23327. D.needUpdate = !0,
  23328. t.activeCubeFace = d,
  23329. t.viewport.set(0, 0, t.width, t.height);
  23330. var S = this.renderer.autoClear;
  23331. this.renderer.autoClear = !1,
  23332. this.renderer.render(O, L, t, !1),
  23333. this.renderer.autoClear = S
  23334. }
  23335. ),
  23336. h.prototype.copyCubeMap = (g = !1,
  23337. C = A = y = v = m = null,
  23338. I = new M.Euler,
  23339. new M.Vector3,
  23340. function(e, t, i, n, r, o, a, s, l) {
  23341. this.renderer,
  23342. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23343. (m = new M.Scene).add(v),
  23344. y = new M.ShaderMaterial({
  23345. uniforms: {
  23346. tDiffuse: {
  23347. type: "t",
  23348. value: null
  23349. },
  23350. alpha: {
  23351. type: "f",
  23352. value: 1
  23353. }
  23354. },
  23355. vertexShader: R.copyCubeMap.vertexShader,
  23356. fragmentShader: R.copyCubeMap.fragmentShader,
  23357. depthWrite: !1,
  23358. depthTest: !1,
  23359. side: M.DoubleSide
  23360. }),
  23361. A = new M.BoxGeometry(2,2,2),
  23362. C = new M.Mesh(A,y),
  23363. m.add(C),
  23364. g = !0);
  23365. for (var c = 0; c < 6; c++)
  23366. h.getCubeOrientationForCubeFace(c, I),
  23367. C.rotation.copy(I),
  23368. C.matrixWorldNeedsUpdate = !0,
  23369. C.updateMatrixWorld(),
  23370. y.uniforms.tDiffuse.value = e,
  23371. y.blending = a || M.NoBlending,
  23372. y.transparent = !!s,
  23373. null != l || (l = 1),
  23374. y.uniforms.alpha.value = l,
  23375. y.needUpdate = !0,
  23376. t.activeCubeFace = c,
  23377. t.viewport.set(0, 0, r, o),
  23378. this.renderer.render(m, v, t, !1)
  23379. }
  23380. ),
  23381. h.getLookAtForCubeFace = function(e, t) {
  23382. switch (e) {
  23383. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23384. t.set(1, 0, 0);
  23385. break;
  23386. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23387. t.set(-1, 0, 0);
  23388. break;
  23389. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23390. t.set(0, 1, 0);
  23391. break;
  23392. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23393. t.set(0, -1, 0);
  23394. break;
  23395. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23396. t.set(0, 0, 1);
  23397. break;
  23398. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23399. t.set(0, 0, -1)
  23400. }
  23401. }
  23402. ,
  23403. h.getCubeOrientationForCubeFace = function(e, t) {
  23404. switch (e) {
  23405. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23406. t.set(0, -Math.PI / 2, 0);
  23407. break;
  23408. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23409. t.set(0, Math.PI / 2, 0);
  23410. break;
  23411. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23412. t.set(Math.PI / 2, Math.PI, 0);
  23413. break;
  23414. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23415. t.set(-Math.PI / 2, Math.PI, 0);
  23416. break;
  23417. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23418. t.set(0, -Math.PI, 0);
  23419. break;
  23420. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23421. t.set(0, 0, 0)
  23422. }
  23423. }
  23424. ,
  23425. t.exports = h
  23426. }
  23427. , {
  23428. "../enum/GLCubeFaces": 25,
  23429. "../enum/GLTextureType": 26,
  23430. "../enum/SceneRendererEvents": 43,
  23431. "../exception/BasicException": 55,
  23432. "../exception/RendererCreationException": 57,
  23433. "../settings": 166,
  23434. "../shaders": 167,
  23435. "../util/browser": 182,
  23436. events: 202,
  23437. three: 217
  23438. }],
  23439. 159: [function(e, t, i) {
  23440. "use strict";
  23441. function n(e) {
  23442. this.messenger = new a(e),
  23443. this.clientKey = null
  23444. }
  23445. var o = e("../util/ajax")
  23446. , r = e("./PostMessageType")
  23447. , a = e("./postmessage")
  23448. , s = e("./VersionInfo")
  23449. , l = e("events").EventEmitter
  23450. , c = window.location.origin + "/api/v1/user/";
  23451. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23452. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23453. }
  23454. ,
  23455. n.prototype.waitForConnection = function() {
  23456. return new Promise(function(t, i) {
  23457. this.messenger.on(r.CONNECT, function(e) {
  23458. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23459. }
  23460. .bind(this))
  23461. }
  23462. .bind(this))
  23463. }
  23464. ,
  23465. n.prototype.onConnectionReceived = function(i) {
  23466. return this.messenger.setTarget(i.source, i.origin),
  23467. this.verifyConnection(i).then(function(e, t) {
  23468. this.messenger.send({
  23469. type: r.ACCEPT,
  23470. toId: i.fromId,
  23471. warning: t
  23472. }),
  23473. this.clientKey = e,
  23474. this.messenger.removeAllListeners(r.CONNECT),
  23475. this.bindEvents()
  23476. }
  23477. .bind(this), function(e) {
  23478. this.messenger.send({
  23479. type: r.REJECT,
  23480. toId: i.fromId,
  23481. reason: e
  23482. }),
  23483. this.messenger.setTarget()
  23484. }
  23485. .bind(this))
  23486. }
  23487. ,
  23488. n.prototype.verifyConnection = function(r) {
  23489. return new Promise(function(e, t) {
  23490. var i;
  23491. if (s.isDeprecated(r.sdkVersion))
  23492. i = "这个版本正在被弃用";
  23493. else if (!s.isSupported(r.sdkVersion))
  23494. return t("不支持此版本的SDK");
  23495. var n = {
  23496. cache: !1,
  23497. headers: {
  23498. "X-port-Application-Key": r.applicationKey,
  23499. "X-port-Referrer": r.origin
  23500. }
  23501. };
  23502. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23503. }
  23504. )
  23505. }
  23506. ,
  23507. n.prototype.onMessageReceived = function(t) {
  23508. if (this.validateClientApplicationKey(t.applicationKey)) {
  23509. var i = this;
  23510. t.onDone = function(e) {
  23511. e.toId = t.fromId,
  23512. e.uid = t.uid,
  23513. e.type = r.RESPONSE,
  23514. i.messenger.send(e)
  23515. }
  23516. ,
  23517. this.emit(r.ACTION, t)
  23518. }
  23519. }
  23520. ,
  23521. n.prototype.validateClientApplicationKey = function(e) {
  23522. return this.clientKey === e
  23523. }
  23524. ,
  23525. n.prototype.sendEvent = function(e, t) {
  23526. this.messenger.send({
  23527. type: r.EVENT,
  23528. eventType: e,
  23529. eventData: t
  23530. })
  23531. }
  23532. ,
  23533. t.exports = n
  23534. }
  23535. , {
  23536. "../util/ajax": 181,
  23537. "./PostMessageType": 160,
  23538. "./VersionInfo": 163,
  23539. "./postmessage": 165,
  23540. events: 202
  23541. }],
  23542. 160: [function(e, t, i) {
  23543. "use strict";
  23544. t.exports = Object.freeze({
  23545. CONNECT: "postmessage.connect",
  23546. ACCEPT: "postmessage.accept",
  23547. REJECT: "postmessage.reject",
  23548. ACTION: "postmessage.action",
  23549. RESPONSE: "postmessage.response",
  23550. EVENT: "postmessage.event"
  23551. })
  23552. }
  23553. , {}],
  23554. 161: [function(e, t, i) {
  23555. "use strict";
  23556. t.exports = Object.freeze({
  23557. MOVE: "sdk.move",
  23558. ENTER_PANO: "sdk.enterpano",
  23559. MODEL_LOADED: "sdk.modelloaded"
  23560. })
  23561. }
  23562. , {}],
  23563. 162: [function(e, t, i) {
  23564. "use strict";
  23565. t.exports = Object.freeze({
  23566. FLY: "transition.fly",
  23567. FADEOUT: "transition.fade",
  23568. INSTANT: "transition.instant"
  23569. })
  23570. }
  23571. , {}],
  23572. 163: [function(e, t, i) {
  23573. "use strict";
  23574. t.exports = {
  23575. current: "1.0",
  23576. supported: ["1.0"],
  23577. deprecated: [],
  23578. isSupported: function(e) {
  23579. return -1 !== this.supported.indexOf(e)
  23580. },
  23581. isDeprecated: function(e) {
  23582. return -1 !== this.deprecated.indexOf(e)
  23583. },
  23584. isValid: function(e) {
  23585. return this.isSupported(e) || this.isDeprecated(e)
  23586. }
  23587. }
  23588. }
  23589. , {}],
  23590. 164: [function(q, X, e) {
  23591. (function(e) {
  23592. "use strict";
  23593. function r(e, t, i) {
  23594. e = e && e.toLowerCase().trim();
  23595. var n = new C.UP.clone
  23596. , r = Math.PI / 3
  23597. , o = Math.PI / 2;
  23598. switch (e) {
  23599. case "left":
  23600. i.copy(t),
  23601. i.applyAxisAngle(n, o);
  23602. break;
  23603. case "right":
  23604. i.copy(t),
  23605. i.applyAxisAngle(n, -o);
  23606. break;
  23607. case "forwardleft":
  23608. i.copy(t),
  23609. i.applyAxisAngle(n, r);
  23610. break;
  23611. case "forwardright":
  23612. i.copy(t),
  23613. i.applyAxisAngle(n, -r);
  23614. break;
  23615. case "forward":
  23616. default:
  23617. i.copy(t)
  23618. }
  23619. return i
  23620. }
  23621. function o(e, t) {
  23622. if (e) {
  23623. var i = {
  23624. pano: e,
  23625. lookAtPoint: null,
  23626. duration: null,
  23627. maxDistanceOverride: null,
  23628. skipWarpingCheck: !1
  23629. };
  23630. this.player.flyToPano(i, function() {
  23631. t && t({
  23632. success: !0,
  23633. message: "Transition complete."
  23634. })
  23635. })
  23636. } else
  23637. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23638. t && t({
  23639. success: !1,
  23640. error: "Unable to find pano."
  23641. })
  23642. }
  23643. function a(e, t) {
  23644. t.copy(C.FORWARD),
  23645. e.getDirection(t)
  23646. }
  23647. function c(i) {
  23648. return {
  23649. panos: i.panos.list.map(function(e) {
  23650. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23651. return {
  23652. uuid: e.id,
  23653. aligned: e.alignmentType === g.ALIGNED,
  23654. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23655. position: function(e) {
  23656. return e.alignmentType !== g.ALIGNED ? null : {
  23657. x: e.position.x,
  23658. y: e.position.y,
  23659. z: e.position.z
  23660. }
  23661. }(e),
  23662. rotation: function(e) {
  23663. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23664. return {
  23665. x: h.Math.radToDeg(t._x),
  23666. y: h.Math.radToDeg(t._y),
  23667. z: h.Math.radToDeg(t._z)
  23668. }
  23669. }(e),
  23670. thumbnail: t
  23671. }
  23672. })
  23673. }
  23674. }
  23675. 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"),
  23676. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23677. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23678. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23679. N.angle = 0,
  23680. N.angleTravelled = 0,
  23681. N.playerDirection = new h.Vector3,
  23682. N.lastFacingDirection = new h.Vector3,
  23683. N.onDone = null,
  23684. N.player = null,
  23685. N.start = function(e, t, i, n) {
  23686. N.active = !0,
  23687. e && t && (t = 0),
  23688. N.angle = e || t,
  23689. N.xAngle = e,
  23690. N.yAngle = t,
  23691. N.angleTravelled = 0,
  23692. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23693. i.getDirection(N.playerDirection),
  23694. N.lastFacingDirection.copy(N.playerDirection),
  23695. N.projectVectors(),
  23696. N.onDone = n,
  23697. N.player = i,
  23698. N()
  23699. }
  23700. ,
  23701. N.projectVectors = function() {
  23702. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23703. N.lastFacingDirection.projectOnPlane(C.UP))
  23704. }
  23705. ,
  23706. N), P = (i = new h.Vector3,
  23707. function(e) {
  23708. e ? (i.copy(e.position),
  23709. i.add(e.discPosition),
  23710. s.projectPositionToCanvas(i, this.player.camera, i),
  23711. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23712. }
  23713. ), O = (l = new h.Vector3,
  23714. function(e) {
  23715. var t = this.player.getDirection();
  23716. l.copy(t);
  23717. var i = l.y;
  23718. l.y = 0,
  23719. l.normalize();
  23720. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23721. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23722. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23723. 0;
  23724. this.player.mode === I.DOLLHOUSE && (n = -n);
  23725. var r = function() {
  23726. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23727. }
  23728. .call(this) - .1
  23729. , o = function() {
  23730. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23731. }
  23732. .call(this) + .1
  23733. , a = n + e;
  23734. r < a ? a = r : a < o && (a = o);
  23735. var s = a - n;
  23736. return 0 < e && s < .01 && (s = 0),
  23737. e < 0 && -.01 < s && (s = 0),
  23738. s
  23739. }
  23740. ), L = (t = new h.Euler,
  23741. function(e) {
  23742. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23743. {
  23744. position: {
  23745. x: e.position.x,
  23746. y: e.position.y,
  23747. z: e.position.z
  23748. },
  23749. rotation: {
  23750. x: h.Math.radToDeg(t.x),
  23751. y: h.Math.radToDeg(t.y),
  23752. z: 0
  23753. },
  23754. pano: e.currentPano ? e.currentPano.id : null,
  23755. mode: e.mode
  23756. }
  23757. }
  23758. ), D = null;
  23759. function N() {
  23760. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23761. N.player.getDirection(N.playerDirection),
  23762. N.projectVectors();
  23763. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23764. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23765. N.onDone && (0,
  23766. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23767. window.setTimeout(N, 4))
  23768. }
  23769. X.exports = {
  23770. init: function(e, t, i, n, r) {
  23771. Y.init(e, t, i, r),
  23772. D = new Promise(function(e, t) {
  23773. i.on(_.Ready, function() {
  23774. e()
  23775. })
  23776. }
  23777. .bind(this));
  23778. var o = new u(window)
  23779. , a = o.waitForConnection();
  23780. a.then(function(e) {
  23781. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23782. });
  23783. var s, l = (s = Date.now(),
  23784. function() {
  23785. if (!(Date.now() - s < 100)) {
  23786. var e = L(i);
  23787. o.sendEvent(b.MOVE, {
  23788. state: e
  23789. }),
  23790. s = Date.now()
  23791. }
  23792. }
  23793. );
  23794. i.on(_.Move, l),
  23795. i.on(_.ViewChanged, l),
  23796. n.on(p.ActiveModelChanged, function(e) {
  23797. function t(e) {
  23798. var t, i = e.newPano.id;
  23799. e.oldPano && (t = e.oldPano.id),
  23800. i !== t && o.sendEvent(b.ENTER_PANO, {
  23801. oldPano: t,
  23802. newPano: i
  23803. })
  23804. }
  23805. var i = e.model
  23806. , n = e.oldModel;
  23807. Y.model = i,
  23808. a.then(function() {
  23809. o.sendEvent(b.MODEL_LOADED, {
  23810. metadata: c(i)
  23811. })
  23812. }),
  23813. n && n.panos.forEach(function(e) {
  23814. e.removeEventListener("enter", t)
  23815. }),
  23816. i.panos.forEach(function(e) {
  23817. e.on("enter", t)
  23818. })
  23819. })
  23820. }
  23821. };
  23822. var F, B, V, k, U, H, z, G, W, j, Y = {
  23823. director: null,
  23824. player: null,
  23825. controls: null,
  23826. sceneRenderer: null,
  23827. model: null,
  23828. init: function(e, t, i, n) {
  23829. this.director = e,
  23830. this.player = i,
  23831. this.controls = t,
  23832. this.sceneRenderer = n
  23833. },
  23834. handleToObject: {},
  23835. objectToHandle: {},
  23836. handleCount: 0,
  23837. onMessageReceive: function(e) {
  23838. if (e) {
  23839. var t = e.targetFunction
  23840. , i = e.params
  23841. , n = e.onDone;
  23842. t && this[t] && this[t](i, n)
  23843. }
  23844. },
  23845. waitForInit: function(e, t) {
  23846. D.then(t.bind({
  23847. success: !0,
  23848. message: "Init complete."
  23849. }))
  23850. },
  23851. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23852. j = new h.Quaternion,
  23853. function(e, t) {
  23854. var i = e.pano
  23855. , n = e.rotation
  23856. , r = e.transition;
  23857. if (!this.model)
  23858. return t({
  23859. success: !1,
  23860. error: "The model has not been loaded yet"
  23861. });
  23862. var o = this.model.panos.get(i);
  23863. if (!o)
  23864. return t({
  23865. success: !1,
  23866. error: i + " does not exist in this model"
  23867. });
  23868. if (!n)
  23869. return t({
  23870. sucess: !1,
  23871. erorr: n + " is not a valid rotation"
  23872. });
  23873. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23874. console.log(n.z);
  23875. var a = {
  23876. success: !0,
  23877. message: i
  23878. };
  23879. if (r === v.FADEOUT)
  23880. j.setFromEuler(W),
  23881. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23882. else {
  23883. var s, l;
  23884. r === v.INSTANT && (l = s = 0);
  23885. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23886. this.player.flyToPano({
  23887. pano: o,
  23888. lookAtPoint: c,
  23889. duration: s,
  23890. aimDuration: l
  23891. }, t.bind(this, a))
  23892. }
  23893. }
  23894. ),
  23895. moveInDirection: function(e, t) {
  23896. var i = e.direction;
  23897. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23898. void (t && t({
  23899. success: !1,
  23900. error: "Invalid direction."
  23901. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23902. t(e ? {
  23903. success: !0,
  23904. message: "moved " + i
  23905. } : {
  23906. success: !1,
  23907. error: "Cannot move in direction: " + i
  23908. })
  23909. })
  23910. },
  23911. getPose: function(e, t) {
  23912. return this.player.camera.position,
  23913. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23914. t({
  23915. success: !0,
  23916. message: L(this.player)
  23917. })
  23918. },
  23919. takeScreenShot: (z = new h.PerspectiveCamera,
  23920. G = new h.WebGLRenderTarget,
  23921. function(e, t) {
  23922. if (!e.resolution)
  23923. return t({
  23924. success: !1,
  23925. error: "An invalid resolution was specified"
  23926. });
  23927. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23928. var i = this.sceneRenderer.renderer.getSize();
  23929. e.resolution.width = i.width,
  23930. e.resolution.height = i.height
  23931. }
  23932. z.layers.set(T.DEFAULT),
  23933. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23934. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23935. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23936. var n = e.resolution.width
  23937. , r = e.resolution.height
  23938. , o = n / r;
  23939. z.position.copy(this.sceneRenderer.camera.position),
  23940. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23941. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23942. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  23943. G.setSize(n, r),
  23944. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  23945. var a = new Uint8Array(n * r * 4);
  23946. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  23947. var s = S.encode({
  23948. data: a,
  23949. width: n,
  23950. height: r,
  23951. heading: 180,
  23952. pitch: 0
  23953. }, {
  23954. quality: 75,
  23955. flipY: !0
  23956. });
  23957. t({
  23958. success: !0,
  23959. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  23960. })
  23961. }
  23962. ),
  23963. findRankedPano: (U = new h.Vector3,
  23964. H = new h.Vector3,
  23965. function(e, t) {
  23966. a(this.player, H),
  23967. r(t, H, U);
  23968. var i = this.player.rankedPanoInDirection(e, U);
  23969. if (i) {
  23970. var n = this.objectToHandle[i.id];
  23971. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  23972. this.handleToObject[n] = i),
  23973. n
  23974. }
  23975. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23976. -1
  23977. }
  23978. ),
  23979. findRankedtag: (V = new h.Vector3,
  23980. k = new h.Vector3,
  23981. function(e, t) {
  23982. a(this.player, k),
  23983. r(t, k, V);
  23984. var i = this.player.rankedtagInDirection(e, V);
  23985. if (i) {
  23986. var n = this.objectToHandle[i.sid];
  23987. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  23988. this.handleToObject[n] = i),
  23989. n
  23990. }
  23991. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23992. -1
  23993. }
  23994. ),
  23995. clickNearesttag: function(e) {
  23996. this.clickRankedtag(0, e)
  23997. },
  23998. clickRankedtag: function(e, t) {
  23999. var i = function(e, t) {
  24000. var i = this.findRankedtag(e, t);
  24001. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24002. null)
  24003. }
  24004. .call(this, e, t);
  24005. i && P.call(this, i)
  24006. },
  24007. clickNearestPano: function(e, t) {
  24008. this.clickRankedPano(0, e, t)
  24009. },
  24010. clickRankedPano: function(e, t, i) {
  24011. var n = function(e, t) {
  24012. var i = this.findRankedPano(e, t);
  24013. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24014. null)
  24015. }
  24016. .call(this, e, t);
  24017. n ? o.call(this, n, i) : i(null)
  24018. },
  24019. clickPano: function(e, t) {
  24020. var i = this.handleTable[e];
  24021. i ? o.call(this, i, t) : t(null)
  24022. },
  24023. rotateDirection: function(e, t) {
  24024. var i = e.direction
  24025. , n = e.angle;
  24026. if (!R.active) {
  24027. var r = 0
  24028. , o = 0
  24029. , a = 0
  24030. , s = 0;
  24031. if (!n || isNaN(n))
  24032. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24033. void (t && t({
  24034. success: !1,
  24035. error: "Invalid rotation angle."
  24036. }));
  24037. if (this.player.mode === I.TRANSITIONING)
  24038. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24039. void (t && t({
  24040. success: !1,
  24041. error: "Cannot rotate while transitioning"
  24042. }));
  24043. if (i === m.RIGHT || i === m.LEFT)
  24044. i === m.RIGHT && (n = -n),
  24045. r = 0 < n ? -1 : 1,
  24046. a = n;
  24047. else {
  24048. if (i !== m.UP && i !== m.DOWN)
  24049. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24050. void (t && t({
  24051. success: !1,
  24052. error: "Invalid direction for rotation."
  24053. }));
  24054. if (this.player.mode === I.FLOORPLAN)
  24055. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24056. void (t && t({
  24057. success: !1,
  24058. error: "Cannot rotate " + i + " in floorplan mode"
  24059. }));
  24060. if (i === m.DOWN && (n = -n),
  24061. 0 === (n = O.call(this, n)))
  24062. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24063. void (t && t({
  24064. success: !1,
  24065. error: "Already at maximum rotation in direction: " + i
  24066. }));
  24067. o = 0 < n ? 1 : -1,
  24068. s = n
  24069. }
  24070. var l = n;
  24071. n = h.Math.degToRad(n),
  24072. a = h.Math.degToRad(a),
  24073. s = h.Math.degToRad(s);
  24074. var c = this.controls.activeControl;
  24075. c.startRotating(r, o),
  24076. R.start(a, s, this.player, function() {
  24077. c.stopRotating(!0),
  24078. t && t({
  24079. success: !0,
  24080. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24081. })
  24082. })
  24083. }
  24084. },
  24085. rotate: (F = new h.Vector3,
  24086. B = new h.Vector3,
  24087. function(e, t) {
  24088. var i = e.xAngle
  24089. , n = e.yAngle;
  24090. if (!R.active) {
  24091. if (i = i || 0,
  24092. n = n || 0,
  24093. isNaN(i) || isNaN(n))
  24094. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24095. void (t && t({
  24096. success: !1,
  24097. error: "Invalid rotation angle."
  24098. }));
  24099. if (this.player.mode === I.TRANSITIONING)
  24100. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24101. void (t && t({
  24102. success: !1,
  24103. error: "Cannot rotate while transitioning"
  24104. }));
  24105. Math.abs(i) < .01 && (i = 0),
  24106. Math.abs(n) < .01 && (n = 0);
  24107. var r = n;
  24108. n = O.call(this, n);
  24109. var o = 0 < r ? "UP" : "DOWN";
  24110. if (!(i = -i) && r && !n)
  24111. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24112. void (t && t({
  24113. success: !1,
  24114. error: "Already at maximum rotation in direction: " + o
  24115. }));
  24116. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24117. var a = n;
  24118. n = h.Math.degToRad(n),
  24119. i = h.Math.degToRad(i),
  24120. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24121. this.player.getDirection(F),
  24122. B.copy(F).applyAxisAngle(C.UP, i),
  24123. B.applyAxisAngle(C.RIGHT, n);
  24124. var s = (F.angleTo(B),
  24125. 0 < i ? -1 : i < 0 ? 1 : 0)
  24126. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24127. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24128. var c = this.controls.activeControl;
  24129. c.startRotating(s, l),
  24130. R.start(i, n, this.player, function() {
  24131. c.stopRotating(!0),
  24132. t && t({
  24133. success: !0,
  24134. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24135. })
  24136. })
  24137. }
  24138. }
  24139. ),
  24140. panCamera: function(e, i) {
  24141. function t(e) {
  24142. switch (r.removeAllListeners(w.AutoPanComplete),
  24143. r.removeAllListeners(w.AutoPanInterrupt),
  24144. r.removeAllListeners(w.AutoPanClamped),
  24145. e) {
  24146. case w.AutoPanInterrupt:
  24147. i({
  24148. success: !0,
  24149. message: "Camera panning interrupted."
  24150. });
  24151. break;
  24152. case w.AutoPanClamped:
  24153. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24154. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24155. return void i({
  24156. success: !1,
  24157. error: "Already at edge of current model bounds."
  24158. });
  24159. var t = "The view point is outside the bounds for the current model. ";
  24160. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24161. console.warn(t)
  24162. }
  24163. case w.AutoPanComplete:
  24164. i({
  24165. success: !0,
  24166. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24167. })
  24168. }
  24169. }
  24170. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24171. return i({
  24172. success: !1,
  24173. error: "Camera panning is not available in the current mode: " + this.player.mode
  24174. });
  24175. var n = e.position
  24176. , r = this.player.control;
  24177. r.setAutoPanPosition(n.x, n.z),
  24178. r.autoPan = !0;
  24179. var o = function(e, t) {
  24180. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24181. };
  24182. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24183. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24184. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24185. },
  24186. click: function(e, t) {
  24187. var i = e.x
  24188. , n = e.y;
  24189. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24190. n = n / 100 * $("#player").height()),
  24191. this.player.handleInputStart(i, n),
  24192. this.player.updateIntersect(),
  24193. this.player.handleInputEnd(i, n)
  24194. },
  24195. mouseOver: function(e, t) {
  24196. var i = e.x
  24197. , n = e.y;
  24198. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24199. n = n / 100 * $("#player").height()),
  24200. this.player.handleInputMove(i, n),
  24201. this.player.updateIntersect()
  24202. },
  24203. moveToMode: function(e, t) {
  24204. function i(e) {
  24205. t(e ? {
  24206. success: !1,
  24207. error: "Failed to load new mode: " + e
  24208. } : {
  24209. success: !0,
  24210. message: "Moved to new mode: " + n
  24211. })
  24212. }
  24213. var n = e.mode;
  24214. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24215. i()
  24216. }, function(e) {
  24217. i(e)
  24218. }) : t({
  24219. success: !1,
  24220. error: "Invalid mode selection"
  24221. })
  24222. }
  24223. }
  24224. }
  24225. ).call(this, "/js/sdk/automation.js")
  24226. }
  24227. , {
  24228. "../constants": 8,
  24229. "../enum/AlignmentType": 17,
  24230. "../enum/ControlEvents": 21,
  24231. "../enum/Direction": 22,
  24232. "../enum/GLCubeFaces": 25,
  24233. "../enum/Keys": 30,
  24234. "../enum/ModelManagerEvents": 33,
  24235. "../enum/PlayerEvents": 40,
  24236. "../enum/RenderLayers": 41,
  24237. "../enum/Vectors": 50,
  24238. "../enum/Viewmode": 51,
  24239. "../enum/WarpStyle": 52,
  24240. "../lib/jpeg_encoder": 94,
  24241. "../sdk/SdkEvents": 161,
  24242. "../settings": 166,
  24243. "../util/common": 185,
  24244. "../util/logger": 189,
  24245. "../util/math": 190,
  24246. "../util/panorama": 191,
  24247. "./ApiHost": 159,
  24248. "./PostMessageType": 160,
  24249. "./TransitionStyles": 162,
  24250. three: 217
  24251. }],
  24252. 165: [function(e, t, i) {
  24253. "use strict";
  24254. function n(e) {
  24255. this.sourceWindow = e,
  24256. this.targetWindow = null,
  24257. this.targetOrigin = null,
  24258. this.id = Math.floor(1e5 * Math.random()),
  24259. this.bindEvents()
  24260. }
  24261. var r = e("./PostMessageType")
  24262. , o = e("events").EventEmitter;
  24263. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24264. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24265. }
  24266. ,
  24267. n.prototype.setTarget = function(e, t) {
  24268. this.targetWindow = e,
  24269. this.targetOrigin = t
  24270. }
  24271. ,
  24272. n.prototype.onPostmessageReceived = function(e) {
  24273. var t = e.origin || e.originalEvent.origin
  24274. , i = e.source;
  24275. switch (e.data.type) {
  24276. case r.CONNECT:
  24277. break;
  24278. case r.RESPONSE:
  24279. if (this.id !== e.data.toId)
  24280. return;
  24281. default:
  24282. if (!this.validateMessageOrigin(t))
  24283. return
  24284. }
  24285. var n = e.data;
  24286. n.source = i,
  24287. n.origin = t,
  24288. n.timestamp = Date.now(),
  24289. this.emit(e.data.type, n)
  24290. }
  24291. ,
  24292. n.prototype.validateMessageOrigin = function(e) {
  24293. return "*" === this.targetOrigin || e === this.targetOrigin
  24294. }
  24295. ,
  24296. n.prototype.send = function(e) {
  24297. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24298. this.targetWindow.postMessage(e, this.targetOrigin))
  24299. }
  24300. ,
  24301. t.exports = n
  24302. }
  24303. , {
  24304. "./PostMessageType": 160,
  24305. events: 202
  24306. }],
  24307. 166: [function(e, t, i) {
  24308. "use strict";
  24309. var n = e("three")
  24310. , r = e("./util/browser")
  24311. , o = e("./enum/Viewmode")
  24312. , a = e("./enum/VROption")
  24313. , s = e("./enum/Colors")
  24314. , l = e("./enum/WarpStyle")
  24315. , c = e("./util/easing")
  24316. , h = e("./util/common")
  24317. , u = e("./util/showcase")
  24318. , d = e("./constants")
  24319. , p = {
  24320. debug: !1,
  24321. version: "2.25.6-0-gd87e5b1",
  24322. languageTag: r.valueFromHash("lang", null),
  24323. pageTitle: "四维虚拟漫游",
  24324. authorizationHeader: u.getAuthorizationHeader(),
  24325. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24326. logLevel: r.valueFromHash("log", 2),
  24327. skyboxRadius: 2500,
  24328. modelBoundsPadding: 5,
  24329. showNeighbors: !1,
  24330. brand: r.valueFromHash("brand", !0),
  24331. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24332. startHighlights: r.valueFromHash("hl", -1),
  24333. specialEdition: r.valueFromHash("bn", 0),
  24334. useWheel: r.valueFromHash("wh", !0),
  24335. crossOrigin: "anonymous",
  24336. fancierTransition: !1,
  24337. wireframe: !1,
  24338. skyboxWireframe: !1,
  24339. modelAlpha: 1,
  24340. highlightPanoSelection: !1,
  24341. showSweeps: !0,
  24342. showSkyboxes: !1,
  24343. showMesh: !0,
  24344. showFloors: !1,
  24345. showFloorDuration: 300,
  24346. showFloorDelay: 300,
  24347. hideFloorDuration: 300,
  24348. hideFloorDelay: 0,
  24349. reticuleOpacityTransitionTime: 250,
  24350. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue,
  24351. markerOpacityTransitionTime: 500,
  24352. guiAnimationSpeed: 250,
  24353. highlightAnimationDuration: 500,
  24354. modelComponentLoadSpinnerDelay: 150,
  24355. captureErrors: !1,
  24356. maxMobileTextures: 6,
  24357. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24358. startupFlyinDelay: 3e3,
  24359. dollhouseDefault: {
  24360. minDistance: 1,//15, //编辑页面给近一些
  24361. maxDistance: 50,
  24362. minPolarAngle: n.Math.degToRad(10),
  24363. maxPolarAngle: n.Math.degToRad(90)
  24364. },
  24365. hideReticuleTimeout: 1e3,
  24366. analytics: {
  24367. inactivityThreshold: 30,
  24368. sessionTrackingRate: .15,
  24369. maxTrackedErrors: 20,
  24370. sessionDurationPingFrequency: 10,
  24371. sessionDurationTimeout: 15
  24372. },
  24373. flydown: {
  24374. movementEasing: "easeInOutQuad",
  24375. movementDelay: .001,
  24376. rotationEasing: "easeInOutQuad",
  24377. rotationDelay: .5,
  24378. modelTextureDelay: .75,
  24379. skyboxDelay: .75
  24380. },
  24381. transition: {
  24382. flySpeed: .001,
  24383. flyTime: 750,
  24384. flytimeMaxDistanceThreshold: 5,
  24385. flytimeDistanceMultiplier: 150,
  24386. aimTime: 1500,
  24387. aimSlowFactor: 1.5,
  24388. blur: .8,
  24389. movementEasing: "easeInOutQuad",
  24390. blendEasing: "easeInOutQuad",
  24391. fastForwardFactor: 4
  24392. },
  24393. show360Views: {
  24394. enabled: !0,
  24395. transitionTime: 1e3
  24396. },
  24397. quickstart: {
  24398. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24399. animation: 1400,
  24400. showTextDelay: 500,
  24401. fadeOutDelay: 3e3,
  24402. fovChange: 10
  24403. },
  24404. appConfig: {
  24405. webvr_version: null,
  24406. segment_key: null,
  24407. embedly_key: null,
  24408. branch_key: null,
  24409. keen_write_key: null,
  24410. keen_project_id: null
  24411. },
  24412. vr: {
  24413. enabled: !0,
  24414. allowWebVR: !1,
  24415. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24416. },
  24417. share: {
  24418. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24419. },
  24420. input: {
  24421. longTapThreshold: 200,
  24422. moveToleranceNDC: .08,
  24423. touchMoveThreshold: 25
  24424. },
  24425. help: {
  24426. modalStayDuration: 600
  24427. },
  24428. immersive: {
  24429. timeToShowAgain: 1250,
  24430. uiStayDuration: 600
  24431. },
  24432. tourInteraction: {
  24433. disabled: "0" === r.valueFromHash("tourcta", null),
  24434. showPauseButton: 1e3,
  24435. showModal: 1500,
  24436. allowNextClick: 200,
  24437. largeModal: "1" === r.valueFromHash("tourcta", null),
  24438. smallModal: "2" === r.valueFromHash("tourcta", null)
  24439. },
  24440. labels: {
  24441. enabled: !1,
  24442. hideUntilStart: !0,
  24443. fadeInDuration: 250,
  24444. fadeInDelay: 250,
  24445. fadeOutDuration: 250,
  24446. fadeOutDelay: 0,
  24447. zoomHideThreshhold: {
  24448. mobile: r.isSmallScreen() ? .45 : .6,
  24449. desktop: 2
  24450. },
  24451. zoomTruncateThreshhold: {
  24452. mobile: r.isSmallScreen() ? .35 : .45,
  24453. desktop: .85
  24454. },
  24455. minLengthForTruncate: 16,
  24456. truncateLength: 12,
  24457. truncateSuffix: "..."
  24458. },
  24459. tags: {
  24460. enabled: r.valueFromHash("mt", 1),
  24461. startup: {
  24462. hideUntilStart: !0,
  24463. fadeInDuration: 500,
  24464. fadeInDelay: 100
  24465. },
  24466. visibility: {
  24467. anyDistance: !0,
  24468. visibleDistance: 8,
  24469. cameraClearance: .1,
  24470. alphaTestLevel: .05,
  24471. hideViaFloor: !0,
  24472. hideOffScreenDisc: !1,
  24473. hideOffScreenObject: !1
  24474. },
  24475. disc: {
  24476. opacity: 1,
  24477. disabledOpacity: .5,
  24478. scale: {
  24479. nearBound: 1.5,
  24480. farBound: 4.8,
  24481. linkFarBound: !1,
  24482. linkPercent: 40,
  24483. maxSize: 80,
  24484. minSize: 40,
  24485. baseViewportSize: 800,
  24486. responsiveness: 100
  24487. }
  24488. },
  24489. pole: {
  24490. enabled: !0,
  24491. height: .5,
  24492. width: 2,
  24493. opacity: .5,
  24494. color: "white"
  24495. },
  24496. navigate: {
  24497. nearestPano: !0,
  24498. lineOfSight: !0,
  24499. reactivate: !0,
  24500. aimAt: "disc",
  24501. tiltTolerance: 25,
  24502. rotateSpeedFactor: .6
  24503. }
  24504. },
  24505. path: {
  24506. color: window.DATA.floorMarkerColor || s.newBlue,
  24507. colorUp: s._desat(s.newBlue, .5),
  24508. colorDown: s._darken(s.newBlue, .35),
  24509. opacity: .5,
  24510. style: "ribbon",
  24511. height: .025,
  24512. ribbonWidth: .24,
  24513. outsideHeight: .5,
  24514. waypointRadius: .5,
  24515. waypointIndoorRadius: .24,
  24516. waypointPulse: 1e3,
  24517. typ: l.BLACK,
  24518. meshFree: r.valueFromHash("mf", 1),
  24519. mapGuides: r.valueFromHash("guides", !0),
  24520. fadeInTime: 400,
  24521. fadeOutTime: 300
  24522. },
  24523. warp: {
  24524. nearPanoDist: .1,
  24525. matchCam: !1,
  24526. blur: .33,
  24527. fastTime: 1500,
  24528. teleportTime: 1500,//瞬间过渡的时间
  24529. flytimeDistanceMultiplier:150,//add
  24530. flyTime:750,//add
  24531. outsideTime: 2e3,
  24532. lookAheadMax: .3,
  24533. lookAheadDist: 2.5,
  24534. softPushDist: .37,
  24535. softPushEnd: .3,
  24536. softBendAngle: 8,
  24537. softBendTilt: 4,
  24538. softBendEnd: .3,
  24539. doBurns: !0,
  24540. burnsAngle: 8,
  24541. minBurnsAngle: 35,
  24542. minDownAngle: -35,
  24543. maxTurnPerSec: 280,
  24544. maxAimPerSec: 35,
  24545. minRotation: 12,
  24546. maxAimRotation: 33.2,
  24547. turnFriction: .2,
  24548. flySpeed: .01,
  24549. minWarpTime: 1200,
  24550. warpInterruptionRedirectTime: 500,
  24551. tourStepDelay: r.valueFromHash("st", 0),
  24552. walkDelay: 0,
  24553. walkMaxDist: 50,
  24554. walkMinDist: .8,
  24555. walkSlideShowThreshhold: 3e3,
  24556. walkExtraPanosDistance: .4,
  24557. timePerMeter: 1200,
  24558. motionLeadTime: 5e3,
  24559. movementEasing: "easeInOutQuad",
  24560. blendEasing: "easeInOutQuad",
  24561. showBunny: !1,
  24562. loop: r.valueFromHash("lp", !1),
  24563. auto: r.valueFromHash("ts", -1),
  24564. eOrder: "YXZ",
  24565. stepFactor: .25,
  24566. brakeStrength: 2,
  24567. minBrakeAngle: .1,
  24568. maxBrakeAngle: 1.8,
  24569. climbEffort: 4
  24570. },
  24571. rotationFriction: .05,
  24572. rotationAccelerationInside: 4.5,
  24573. rotationAccelerationOutside: .15,
  24574. rotationAfterMoveMultiplier: 40,
  24575. rotationAfterMoveHistoryCount: 5,
  24576. panFriction: .09,
  24577. panAccelerationOutside: 60,
  24578. onload: r.valueFromHash("onload", o.PANORAMA),
  24579. zoomNearLimit: .1,
  24580. zoomFarLimit: 50,
  24581. navigation: {
  24582. panoScores: !1,
  24583. mouseDirection: !0,
  24584. filterStrictness: .75,
  24585. angleFactor: -30,
  24586. directionFactor: 10,
  24587. distanceFactor: -1,
  24588. optionalityFactor: 3
  24589. },
  24590. sdkInit: !1,
  24591. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24592. console: r.valueFromHash("console", !1),
  24593. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24594. panoramaNeighbourMaxDistance: 5,
  24595. panoFloorClickRadius: .35,
  24596. showScreenshotLocations: !1,
  24597. showAxis: !1,
  24598. showNeighbourRaycasts: !1,
  24599. colorMarkerOnLoad: !1,
  24600. colorMarkerByFloor: !1,
  24601. tiling: {
  24602. panoPreRenderRepeatDelay: 2500,
  24603. panoPreRenderDelay: 500,
  24604. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24605. tilingFlagNames: ["usetiles", "tiles"],
  24606. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24607. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24608. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24609. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24610. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24611. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24612. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24613. customCompression: r.valueFromHash("tilecustcomp", 0),
  24614. mobileHighQualityOverride: 1,
  24615. allowUltraHighResolution: !0
  24616. },
  24617. zoom: {
  24618. enabled: !0,
  24619. forceOff: r.valueFromHash("nozoom", 0),
  24620. overridemax: r.valueFromHash("maxzoom", null),
  24621. overridemin: r.valueFromHash("minzoom", null),
  24622. max: d.highQualityMaxZoom,
  24623. min: 1,
  24624. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24625. activationThreshold: 1.1,
  24626. restoreTime: 500
  24627. },
  24628. profiling: {
  24629. enabled: r.valueFromHash("mem", !1)
  24630. }
  24631. };
  24632. (p = h.deepExtend(p, d, {
  24633. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24634. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24635. panorama: {
  24636. transitionTime: 1e3,
  24637. modelAlpha: 0,
  24638. modelAlphaDelay: p.flydown.modelTextureDelay,
  24639. modelAlphaLength: 1,
  24640. skyboxOpacity: 1,
  24641. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24642. skyboxOpacityLength: .9,
  24643. fovLength: 1,
  24644. fovDelay: 0,
  24645. cameraMatrixDuration: .8,
  24646. cameraMatrixDelay: 0,
  24647. cameraMatrixEase: c.easeInCubic,
  24648. reticuleOpacity: 1,
  24649. markerOpacity: .3,
  24650. markerOpacityOnHover: 1
  24651. },
  24652. dollhouse: {
  24653. transitionTime: 1e3,
  24654. modelAlpha: 1,
  24655. modelAlphaDelay: 0,
  24656. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24657. skyboxOpacity: 0,
  24658. skyboxOpacityDelay: 0,
  24659. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24660. fovLength: 1,
  24661. fovDelay: 0,
  24662. cameraMatrixDuration: .8,
  24663. cameraMatrixDelay: .3,
  24664. cameraMatrixEase: c.easeInCubic,
  24665. reticuleOpacity: 1,
  24666. markerOpacity: 0,
  24667. markerOpacityOnHover: 0
  24668. },
  24669. floorplan: {
  24670. transitionTime: 1e3,
  24671. modelAlpha: 1,
  24672. modelAlphaDelay: 0,
  24673. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24674. skyboxOpacity: 0,
  24675. skyboxOpacityDelay: 0,
  24676. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24677. fovLength: 1,
  24678. fovDelay: 0,
  24679. cameraMatrixDuration: .5,
  24680. cameraMatrixDelay: 0,
  24681. cameraMatrixEase: c.easeOutCubic,
  24682. reticuleOpacity: 1,
  24683. markerOpacity: 0,
  24684. markerOpacityOnHover: 0,
  24685. cameraHeight: 50
  24686. },
  24687. transitioning: {
  24688. reticuleOpacity: 0,
  24689. markerOpacity: .3,
  24690. markerOpacityOnHover: 1
  24691. },
  24692. "floorplan-dollhouse": {
  24693. rotationDelay: 0,
  24694. rotationDuration: 1
  24695. },
  24696. "floorplan-panorama": {
  24697. rotationDelay: .5,
  24698. rotationDuration: 1
  24699. },
  24700. "dollhouse-panorama": {
  24701. rotationDelay: .5,
  24702. rotationDuration: 1
  24703. },
  24704. "dollhouse-floorplan": {
  24705. rotationDelay: 0,
  24706. rotationDuration: 1,
  24707. cameraMatrixDuration: 1.05,
  24708. cameraMatrixDelay: .5
  24709. },
  24710. "panorama-dollhouse": {
  24711. rotationDelay: 0,
  24712. rotationDuration: .5
  24713. },
  24714. "panorama-floorplan": {
  24715. transitionTime: 1500,
  24716. rotationDelay: 0,
  24717. rotationDuration: .5
  24718. }
  24719. })).path.meshFree && (p.path.typ = l.WALK),
  24720. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24721. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24722. window._settings = t.exports = p
  24723. }
  24724. , {
  24725. "./constants": 8,
  24726. "./enum/Colors": 19,
  24727. "./enum/VROption": 47,
  24728. "./enum/Viewmode": 51,
  24729. "./enum/WarpStyle": 52,
  24730. "./util/browser": 182,
  24731. "./util/common": 185,
  24732. "./util/easing": 186,
  24733. "./util/showcase": 193,
  24734. three: 217
  24735. }],
  24736. 167: [function(e, t, i) {
  24737. "use strict";
  24738. var n = e("three")
  24739. , r = e("./settings")
  24740. , 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"
  24741. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24742. t.exports = {
  24743. basicTextured: {
  24744. uniforms: {
  24745. tDiffuse: {
  24746. type: "t",
  24747. value: null
  24748. },
  24749. alpha: {
  24750. type: "f",
  24751. value: 1
  24752. }
  24753. },
  24754. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24755. 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}"
  24756. },
  24757. copyCubeMap: {
  24758. uniforms: {
  24759. tDiffuse: {
  24760. type: "t",
  24761. value: null
  24762. },
  24763. alpha: {
  24764. type: "f",
  24765. value: 1
  24766. }
  24767. },
  24768. 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}",
  24769. 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}"
  24770. },
  24771. cube: {
  24772. uniforms: {
  24773. map: {
  24774. type: "t",
  24775. value: null
  24776. },
  24777. opacity: {
  24778. type: "f",
  24779. value: 1
  24780. }
  24781. },
  24782. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24783. 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"
  24784. },
  24785. model: {
  24786. uniforms: {
  24787. map: {
  24788. type: "t",
  24789. value: null
  24790. },
  24791. modelAlpha: {
  24792. type: "f",
  24793. value: r.modelAlpha
  24794. },
  24795. opacity: {
  24796. type: "f",
  24797. value: 1
  24798. },
  24799. progress: {
  24800. type: "f",
  24801. value: 0
  24802. },
  24803. blackout: {
  24804. type: "i",
  24805. value: 0
  24806. },
  24807. pano0Map: {
  24808. type: "t",
  24809. value: null
  24810. },
  24811. pano0Position: {
  24812. type: "v3",
  24813. value: new n.Vector3
  24814. },
  24815. pano0Matrix: {
  24816. type: "m4",
  24817. value: new n.Matrix4
  24818. },
  24819. pano1Map: {
  24820. type: "t",
  24821. value: null
  24822. },
  24823. pano1Position: {
  24824. type: "v3",
  24825. value: new n.Vector3
  24826. },
  24827. pano1Matrix: {
  24828. type: "m4",
  24829. value: new n.Matrix4
  24830. }
  24831. },
  24832. 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",
  24833. 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"
  24834. },
  24835. hot: {
  24836. uniforms: {
  24837. color: {
  24838. type: "c",
  24839. value: new n.Color(16720384)
  24840. },
  24841. opac: {
  24842. type: "f",
  24843. value: 0
  24844. },
  24845. texture1: {
  24846. type: "t",
  24847. value: null
  24848. },
  24849. texture2: {
  24850. type: "t",
  24851. value: null
  24852. }
  24853. },
  24854. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24855. 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"
  24856. },
  24857. modelOutside: {
  24858. uniforms: {
  24859. map: {
  24860. type: "t",
  24861. value: null
  24862. },
  24863. opacity: {
  24864. type: "f",
  24865. value: 1
  24866. }
  24867. },
  24868. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24869. 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"
  24870. },
  24871. ribbon: {
  24872. uniforms: {
  24873. map: {
  24874. type: "t",
  24875. value: null
  24876. },
  24877. opacity: {
  24878. type: "f",
  24879. value: 1
  24880. },
  24881. color: {
  24882. type: "c",
  24883. value: new n.Color(r.path.color)
  24884. }
  24885. },
  24886. 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",
  24887. 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"
  24888. },
  24889. waypoint: {
  24890. uniforms: {
  24891. map: {
  24892. type: "t",
  24893. value: null
  24894. },
  24895. opacity: {
  24896. type: "f",
  24897. value: 1
  24898. },
  24899. pulse: {
  24900. type: "f",
  24901. value: 1
  24902. },
  24903. nearFade: {
  24904. type: "v2",
  24905. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24906. },
  24907. color: {
  24908. type: "c",
  24909. value: new n.Color(r.reticuleColor)
  24910. }
  24911. },
  24912. 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",
  24913. 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"
  24914. },
  24915. modelDebug: {
  24916. uniforms: {
  24917. map: {
  24918. type: "t",
  24919. value: null
  24920. },
  24921. modelAlpha: {
  24922. type: "f",
  24923. value: r.modelAlpha
  24924. },
  24925. depthmapRatio: {
  24926. type: "f",
  24927. value: 0
  24928. },
  24929. opacity: {
  24930. type: "f",
  24931. value: 1
  24932. },
  24933. progress: {
  24934. type: "f",
  24935. value: 0
  24936. },
  24937. considerOcclusion: {
  24938. type: "i",
  24939. value: r.fancierTransition
  24940. },
  24941. highlightPanoSelection: {
  24942. type: "i",
  24943. value: 0
  24944. },
  24945. useThirdPano: {
  24946. type: "i",
  24947. value: r.useThirdPano
  24948. },
  24949. pano0Map: {
  24950. type: "t",
  24951. value: null
  24952. },
  24953. pano0Depth: {
  24954. type: "t",
  24955. value: null
  24956. },
  24957. pano0Position: {
  24958. type: "v3",
  24959. value: new n.Vector3
  24960. },
  24961. pano0Matrix: {
  24962. type: "m4",
  24963. value: new n.Matrix4
  24964. },
  24965. pano0Weight: {
  24966. type: "f",
  24967. value: r.transition.pano0Weight
  24968. },
  24969. pano1Map: {
  24970. type: "t",
  24971. value: null
  24972. },
  24973. pano1Depth: {
  24974. type: "t",
  24975. value: null
  24976. },
  24977. pano1Position: {
  24978. type: "v3",
  24979. value: new n.Vector3
  24980. },
  24981. pano1Matrix: {
  24982. type: "m4",
  24983. value: new n.Matrix4
  24984. },
  24985. pano1Weight: {
  24986. type: "f",
  24987. value: r.transition.pano1Weight
  24988. },
  24989. pano2Map: {
  24990. type: "t",
  24991. value: null
  24992. },
  24993. pano2Depth: {
  24994. type: "t",
  24995. value: null
  24996. },
  24997. pano2Position: {
  24998. type: "v3",
  24999. value: new n.Vector3
  25000. },
  25001. pano2Matrix: {
  25002. type: "m4",
  25003. value: new n.Matrix4
  25004. },
  25005. pano2Weight: {
  25006. type: "f",
  25007. value: r.transition.pano2Weight
  25008. }
  25009. },
  25010. 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",
  25011. 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"
  25012. },
  25013. customDepth: {
  25014. uniforms: {
  25015. panoPosition: {
  25016. type: "v3",
  25017. value: new n.Vector3
  25018. }
  25019. },
  25020. 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",
  25021. 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"
  25022. },
  25023. skysphere: {
  25024. uniforms: {
  25025. radius: {
  25026. type: "f",
  25027. value: 0
  25028. }
  25029. },
  25030. 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",
  25031. 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"
  25032. },
  25033. tagDisc: {
  25034. uniforms: {
  25035. opacity: {
  25036. type: "f",
  25037. value: 0
  25038. },
  25039. color: {
  25040. type: "c",
  25041. value: new n.Color
  25042. },
  25043. bg: {
  25044. type: "t",
  25045. value: null
  25046. },
  25047. mask: {
  25048. type: "t",
  25049. value: null
  25050. }
  25051. },
  25052. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25053. 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"
  25054. }
  25055. }
  25056. window.shaders = t.exports;
  25057. }
  25058. , {
  25059. "./settings": 166,
  25060. three: 217
  25061. }],
  25062. 168: [function(E, _, e) {
  25063. (function(e) {
  25064. "use strict";
  25065. var t = E("three")
  25066. , i = (E("url"),
  25067. E("./util/ajax"))
  25068. , n = E("./settings")
  25069. , r = E("./util/logger")
  25070. , o = E("./util/math")
  25071. , a = E("./util/showcase")
  25072. , s = E("./objects/Panorama")
  25073. , l = new r(e)
  25074. , c = E("./model/Model")
  25075. , h = E("./shaders")
  25076. , u = E("./util/transitions")
  25077. , d = E("./objects/Chunk")
  25078. , p = E("./objects/Reticule")
  25079. , f = E("./objects/Skybox")
  25080. , g = E("./objects/Floor")
  25081. , m = E("./cameras/DollhouseCamera")
  25082. , v = E("./cameras/FloorplanCamera")
  25083. , y = E("./cameras/PanoramaCamera")
  25084. , A = E("./controls/DollhouseControls")
  25085. , C = E("./controls/FloorplanControls")
  25086. , I = E("./controls/PanoramaControls");
  25087. t.ImageUtils.crossOrigin = n.crossOrigin,
  25088. _.exports = {
  25089. shaders: h,
  25090. transitions: u,
  25091. Model: c,
  25092. Chunk: d,
  25093. Floor: g,
  25094. Skybox: f,
  25095. Reticule: p,
  25096. Panorama: s,
  25097. DollhouseCamera: m,
  25098. FloorplanCamera: v,
  25099. PanoramaCamera: y,
  25100. DollhouseControls: A,
  25101. FloorplanControls: C,
  25102. PanoramaControls: I,
  25103. getModel: function(e) {
  25104. if (!e.url)
  25105. throw 'getModel(): missing parameter "url"';
  25106. e.autoload = void 0 === e.autoload || e.autoload;
  25107. var t = a.parseSidUrl(e.url);
  25108. e.urlBase = t.urlBase,
  25109. e.urlModel = t.urlModel,
  25110. e.urlFiles = t.urlFiles;
  25111. var i = this._getPlatformError();
  25112. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25113. this._loadModel().then(this._buildModel.bind(this)))
  25114. },
  25115. _getPlatformError: function() {
  25116. 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"
  25117. },
  25118. _loadModel: function() {
  25119. return i.get(this.options.urlModel, {
  25120. responseType: "json",
  25121. prefetchFrom: "model",
  25122. auth: a.getAuthorizationHeader()
  25123. }).then(null, function() {
  25124. return l.warn("Model loading failed at initial metadata load"),
  25125. "loading-failed"
  25126. })
  25127. },
  25128. _buildModel: function(e) {
  25129. e = a.normalizeModeldata(e, o);
  25130. var t = new c(this.options,e);
  25131. return this.options.autoload ? t.load(!0) : $.when(t)
  25132. }
  25133. }
  25134. }
  25135. ).call(this, "/js/showcase.js")
  25136. }
  25137. , {
  25138. "./cameras/DollhouseCamera": 5,
  25139. "./cameras/FloorplanCamera": 6,
  25140. "./cameras/PanoramaCamera": 7,
  25141. "./controls/DollhouseControls": 10,
  25142. "./controls/FloorplanControls": 11,
  25143. "./controls/PanoramaControls": 13,
  25144. "./model/Model": 139,
  25145. "./objects/Chunk": 144,
  25146. "./objects/Floor": 146,
  25147. "./objects/Panorama": 148,
  25148. "./objects/Reticule": 149,
  25149. "./objects/Skybox": 152,
  25150. "./settings": 166,
  25151. "./shaders": 167,
  25152. "./util/ajax": 181,
  25153. "./util/logger": 189,
  25154. "./util/math": 190,
  25155. "./util/showcase": 193,
  25156. "./util/transitions": 195,
  25157. three: 217,
  25158. url: 208
  25159. }],
  25160. 169: [function(e, t, i) {
  25161. "use strict";
  25162. function l(e) {
  25163. var t = {
  25164. renderTarget: null,
  25165. inUse: !1,
  25166. size: -1,
  25167. pano: null
  25168. };
  25169. return t.inUse = !0,
  25170. t.size = e,
  25171. function(e) {
  25172. O.push(e)
  25173. }(t),
  25174. t
  25175. }
  25176. function c(e) {
  25177. for (var t = 0; t < O.length; t++) {
  25178. var i = O[t];
  25179. if (i.renderTarget === e)
  25180. return !(i.inUse = !1)
  25181. }
  25182. return !1
  25183. }
  25184. function n() {
  25185. this.tileDirectory = {},
  25186. this.activeRenderTargetDescriptors = {},
  25187. this.activePanos = [],
  25188. this.panoLODDescriptors = {},
  25189. this.panoDescriptors = {},
  25190. this.tileTrees = {},
  25191. this.sceneRenderer = null,
  25192. this.tileDownloader = null,
  25193. this.forceQueue = [],
  25194. this.uploadQueues = {},
  25195. this.uploadInterval = null,
  25196. this.uploadIntervalCancelled = !1,
  25197. this.usingTileOverlay = !1,
  25198. this.overlayTilesLoaded = !1,
  25199. this.overlayTileBase = null,
  25200. this.overlayTilesBasic = {},
  25201. this.overlayTilesEnhanced = {},
  25202. this.zoomRenderTarget = null,
  25203. this.zoomPano = null,
  25204. this.zoomingActive = !1,
  25205. this.zoomPanoId = null,
  25206. this.zoomPanoRenderingDisabled = !1,
  25207. this.direction = new _.Vector3,
  25208. this.initTime = -1,
  25209. this.maxBaseUploadsPerFrame = R,
  25210. this.maxNonBaseUploadsPerFrame = M
  25211. }
  25212. 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"),
  25213. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25214. e("../objects/Panorama"),
  25215. e("./TileTree")), y = (e("./TileDownloader"),
  25216. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25217. e("../util/browser"),
  25218. 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 = {
  25219. Base: 0,
  25220. Remaining: 1
  25221. }, O = [];
  25222. function L(e) {
  25223. var t = e.shift();
  25224. return t.uploadQueued = !1,
  25225. t
  25226. }
  25227. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25228. this.sceneRenderer = e,
  25229. this.tileDownloader = t,
  25230. this.qualityManager = i,
  25231. this.bindEvents(),
  25232. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25233. this.initTime = performance.now()
  25234. }
  25235. ,
  25236. n.prototype.getActivePanoTextures = function(e) {
  25237. e = e || [];
  25238. for (var t = 0; t < O.length; t++) {
  25239. var i = O[t];
  25240. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25241. }
  25242. }
  25243. ,
  25244. n.prototype.hasQueuedTiles = function() {
  25245. var e = this.peekNextFromUploadQueue();
  25246. return null != e
  25247. }
  25248. ,
  25249. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25250. return this.activeRenderTargetDescriptors[e]
  25251. }
  25252. ,
  25253. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25254. this.activeRenderTargetDescriptors[e] = t
  25255. }
  25256. ,
  25257. n.prototype.loadOverlayTiles = function() {
  25258. if (0 !== d.tiling.overlayStyle) {
  25259. var n = 0
  25260. , e = function(e, t, i) {
  25261. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25262. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25263. ++n === r.length && (this.overlayTilesLoaded = !0)
  25264. }
  25265. .bind(this)
  25266. , 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)]];
  25267. r.forEach(function(e) {
  25268. this.tileDownloader.loadImage(e[0], 0, e[1])
  25269. }
  25270. .bind(this)),
  25271. this.usingTileOverlay = !0
  25272. } else
  25273. this.usingTileOverlay = !1
  25274. }
  25275. ,
  25276. n.prototype.bindEvents = function() {
  25277. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25278. }
  25279. ,
  25280. n.prototype.setupZoomRenderTarget = function() {
  25281. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25282. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25283. return;
  25284. var e = this.zoomRenderTarget;
  25285. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25286. e) {
  25287. var t = e.width
  25288. , i = this.zoomRenderTarget.width;
  25289. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25290. e.texture.dispose(),
  25291. e.texture.loaded = !1,
  25292. e.texture.version = 0,
  25293. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25294. e.texture = null
  25295. }
  25296. this.zoomPanoRenderingDisabled = !1
  25297. } else
  25298. this.zoomPanoRenderingDisabled = !0
  25299. }
  25300. ,
  25301. n.prototype.enableUltraHighQualityMode = function(t) {
  25302. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25303. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25304. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25305. e && (this.qualityManager.enableUltraHighQualityMode(),
  25306. this.setupZoomRenderTarget(),
  25307. t())
  25308. }
  25309. .bind(this))
  25310. }
  25311. }
  25312. ,
  25313. n.prototype.activateTiledPano = function(e, t, i) {
  25314. i && this.clearAllQueuedUploads();
  25315. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25316. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25317. this.linkAllTilesAndNodes(e);
  25318. var r = this.getActiveRenderTargetDescriptor(e.id)
  25319. , o = t;
  25320. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25321. !r || o !== r.size) {
  25322. if (r && c(r.renderTarget),
  25323. !(r = function(e) {
  25324. for (var t = 0; t < O.length; t++) {
  25325. var i = O[t];
  25326. if (!i.inUse && i.size === e)
  25327. return i.inUse = !0,
  25328. i
  25329. }
  25330. return null
  25331. }(o))) {
  25332. var a = this.initTiledPano(o, !1);
  25333. (r = l(a.width)).renderTarget = a
  25334. }
  25335. r.pano = e,
  25336. this.resetPanoDescriptor(e.id),
  25337. this.resetPanoLODDescriptors(e.id),
  25338. this.resetRenderStatus(e.id, !0, !0)
  25339. }
  25340. this.setActiveRenderTargetDescriptor(e.id, r);
  25341. var s = i ? 0 : 1;
  25342. return this.updateActivePanos(e, s),
  25343. r.renderTarget
  25344. }
  25345. ,
  25346. n.prototype.deactivateTiledPano = function(e) {
  25347. var t = this.getActiveRenderTargetDescriptor(e.id);
  25348. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25349. this.setActiveRenderTargetDescriptor(e.id, null);
  25350. var i = this.getUploadQueueForPano(e.id);
  25351. this.clearUploadQueue(i),
  25352. this.updateActivePanos()
  25353. }
  25354. ,
  25355. n.prototype.updateActivePanos = (s = [],
  25356. function(e, t) {
  25357. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25358. e && s.length === t && s.push(e);
  25359. var n = this.activePanos[i]
  25360. , r = this.getActiveRenderTargetDescriptor(n.id);
  25361. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25362. }
  25363. e && t >= s.length && s.push(e),
  25364. this.activePanos.length = 0,
  25365. this.activePanos.push.apply(this.activePanos, s)
  25366. }
  25367. ),
  25368. n.prototype.getActivePanoCount = function() {
  25369. return this.activePanos.length
  25370. }
  25371. ,
  25372. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25373. var i = null;
  25374. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25375. for (var n = function(e, t, i, n) {
  25376. o && (t.tile.zoomUploaded = !1),
  25377. r && (t.tile.uploaded = !1)
  25378. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25379. this.getTileTree(e, a).breadthFirst({
  25380. callback: n.bind(this, a),
  25381. minLevel: i
  25382. })
  25383. }
  25384. }
  25385. ,
  25386. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25387. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25388. t.tile.zoomUploaded = t.tile.uploaded,
  25389. t.zoomCovered = t.covered
  25390. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25391. this.getTileTree(e, n).breadthFirst({
  25392. callback: i.bind(this, n),
  25393. maxLevel: t
  25394. })
  25395. }
  25396. }
  25397. ,
  25398. n.prototype.renderPanoTiles = (h = [],
  25399. function(e, t, i, n) {
  25400. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25401. t = t || this.direction || m.FORWARD;
  25402. var r = this.getActiveRenderTargetDescriptor(e);
  25403. if (!this.isRenderTargetDescriptorValid(r))
  25404. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25405. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25406. var a = this.getTileTree(e, o);
  25407. h.length = 0,
  25408. a.breadthFirst({
  25409. saveVisited: h
  25410. });
  25411. for (var s = 0; s < h.length; s++) {
  25412. var l = h[s];
  25413. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25414. }
  25415. }
  25416. this.updateDirection(t)
  25417. }
  25418. ),
  25419. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25420. return e && e.renderTarget
  25421. }
  25422. ,
  25423. n.prototype.isPanoActive = function(e) {
  25424. var t = this.getActiveRenderTargetDescriptor(e);
  25425. return this.isRenderTargetDescriptorValid(t)
  25426. }
  25427. ,
  25428. n.prototype.isPanoZoomed = function(e) {
  25429. return this.zoomingActive && this.zoomPanoId === e
  25430. }
  25431. ,
  25432. n.prototype.initTileTree = function(e, t, i) {
  25433. var n = this.tileTrees[e];
  25434. n || (n = [],
  25435. this.tileTrees[e] = n);
  25436. var r = n[t];
  25437. if (!r) {
  25438. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25439. r = new v(A.TILE_SIZE,o),
  25440. n[t] = r
  25441. }
  25442. }
  25443. ,
  25444. n.prototype.getTileTree = function(e, t) {
  25445. var i = this.tileTrees[e];
  25446. if (!i)
  25447. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25448. var n = i[t];
  25449. if (!n)
  25450. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25451. return n
  25452. }
  25453. ,
  25454. n.prototype.initTiledPano = function(e, t) {
  25455. var i = this.sceneRenderer.renderer
  25456. , n = (i.context,
  25457. new _.WebGLRenderTargetCube(e,e,{
  25458. stencilBuffer: !1
  25459. }))
  25460. , r = new _.CubeTexture([]);
  25461. (n.texture = r).image = [null, null, null, null, null, null],
  25462. r.flipY = !0,
  25463. t ? (r.generateMipmaps = !0,
  25464. r.magFilter = _.LinearFilter,
  25465. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25466. r.magFilter = _.LinearFilter,
  25467. r.minFilter = _.LinearFilter),
  25468. r.format = _.RGBAFormat,
  25469. i.setRenderTarget(n),
  25470. i.setRenderTarget(null);
  25471. var o = i.properties.get(r);
  25472. return o.__image__webglTextureCube = o.__webglTexture,
  25473. n
  25474. }
  25475. ,
  25476. n.prototype.getUploadQueueForPano = function(e) {
  25477. var t = this.uploadQueues[e];
  25478. return t || (t = [],
  25479. this.uploadQueues[e] = t),
  25480. t
  25481. }
  25482. ,
  25483. n.prototype.isTileUploaded = function(e) {
  25484. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25485. }
  25486. ,
  25487. n.prototype.setUploaded = function(e, t) {
  25488. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25489. }
  25490. ,
  25491. n.prototype.queueTileUpload = function(e, t, i) {
  25492. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25493. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25494. var r = this.getUploadQueueForPano(e.panoId);
  25495. 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),
  25496. e.uploadQueued = !0,
  25497. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25498. }
  25499. }
  25500. ,
  25501. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25502. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25503. }
  25504. ,
  25505. n.prototype.getTopUploadQueue = function() {
  25506. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25507. for (var n = 0; n < this.activePanos.length; n++)
  25508. if (e = this.activePanos[n],
  25509. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25510. switch (i) {
  25511. case P.Base:
  25512. if (0 === t[0].level)
  25513. return t;
  25514. break;
  25515. case P.Remaining:
  25516. return t
  25517. }
  25518. return null
  25519. }
  25520. ,
  25521. n.prototype.getNextFromUploadQueue = function() {
  25522. if (0 < this.forceQueue.length)
  25523. return L(this.forceQueue);
  25524. var e = this.getTopUploadQueue();
  25525. return e && 0 < e.length ? L(e) : null
  25526. }
  25527. ,
  25528. n.prototype.peekNextFromUploadQueue = function() {
  25529. if (0 < this.forceQueue.length)
  25530. return this.forceQueue[0];
  25531. var e = this.getTopUploadQueue();
  25532. return e && 0 < e.length ? e[0] : null
  25533. }
  25534. ,
  25535. n.prototype.clearAllQueuedUploads = function() {
  25536. this.clearAllUploadQueues(null, 0)
  25537. }
  25538. ,
  25539. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25540. this.clearAllUploadQueues(e, 0)
  25541. }
  25542. ,
  25543. n.prototype.clearAllUploadQueues = function(e, t) {
  25544. if (e)
  25545. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25546. this.clearUploadQueue(this.forceQueue, t, e);
  25547. else {
  25548. for (var i = 0; i < this.activePanos.length; i++) {
  25549. var n = this.activePanos[i];
  25550. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25551. }
  25552. this.clearUploadQueue(this.forceQueue, t)
  25553. }
  25554. }
  25555. ,
  25556. n.prototype.clearUploadQueue = function(e, t, i) {
  25557. null != t || (t = 0);
  25558. for (var n = 0; n < e.length; ) {
  25559. var r = e[n];
  25560. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25561. e.splice(n, 1)) : n++
  25562. }
  25563. }
  25564. ,
  25565. n.prototype.refreshUploadInterval = (a = null,
  25566. function(e) {
  25567. this.uploadIntervalCancelled || (a = a || function() {
  25568. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25569. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25570. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25571. }
  25572. .bind(this),
  25573. null != e || (e = x),
  25574. T || (e = S),
  25575. this.uploadInterval = window.setTimeout(a, e),
  25576. this.uploadIntervalDelay = e)
  25577. }
  25578. ),
  25579. n.prototype.update = (r = performance.now(),
  25580. o = 0,
  25581. function() {
  25582. this.uploadIntervalCancelled = !0,
  25583. window.clearTimeout(this.uploadInterval),
  25584. this.uploadInterval = null;
  25585. var e = performance.now() - r;
  25586. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25587. r = performance.now()),
  25588. o++
  25589. }
  25590. ),
  25591. n.prototype.updateUploadQueue = function(e, t) {
  25592. e = e || 1;
  25593. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25594. var r = this.getNextFromUploadQueue();
  25595. if (!r)
  25596. break;
  25597. if (0 !== r.level ? i++ : n++,
  25598. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25599. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25600. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25601. }
  25602. }
  25603. }
  25604. ,
  25605. n.prototype.updateDirection = function(e) {
  25606. if (e = e || this.direction) {
  25607. this.direction = e;
  25608. for (var t = 0; t < this.activePanos.length; t++) {
  25609. var i = this.activePanos[t]
  25610. , n = this.getUploadQueueForPano(i.id);
  25611. y.sortPanoTiles(n, i, this.direction)
  25612. }
  25613. }
  25614. }
  25615. ,
  25616. n.prototype.uploadTile = (I = {},
  25617. new _.Vector4,
  25618. E = d.tiling.overlayStyle,
  25619. function(e, t) {
  25620. var i = e.panoId
  25621. , n = e.image
  25622. , r = e.tileSize
  25623. , o = e.panoSize
  25624. , a = e.tileIndex
  25625. , s = (e.faceTileIndex,
  25626. e.totalTiles)
  25627. , l = (e.face,
  25628. e.tileX)
  25629. , c = e.tileY
  25630. , h = !0
  25631. , u = !1
  25632. , d = (this.getPanoDescriptor(i),
  25633. this.getPanoLODDescriptor(i, o))
  25634. , p = this.getActiveRenderTargetDescriptor(i)
  25635. , f = p.renderTarget
  25636. , g = p.size;
  25637. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25638. g = this.qualityManager.getMaxZoomPanoSize()),
  25639. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25640. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25641. this.isTileUploaded(e) && (u = h = !1)),
  25642. h) {
  25643. var m = r / o * g
  25644. , v = l * r / o * g
  25645. , y = c * r / o * g;
  25646. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25647. var A = I[r];
  25648. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25649. 1 === E || 2 === E) {
  25650. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25651. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25652. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25653. } else
  25654. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25655. d.uploadCount++,
  25656. this.emit(b.TileRenderSuccess, i, o, a, s),
  25657. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25658. this.setUploaded(e, !0),
  25659. this.addCoverageForNode(e.node)
  25660. } else
  25661. this.setUploaded(e, !1);
  25662. return e.uploadAttempted || (d.uploadAttempts++,
  25663. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25664. e.uploadAttempted = !0,
  25665. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25666. u
  25667. }
  25668. ),
  25669. n.prototype.linkTileAndNode = function(e, t) {
  25670. (t.tile = e).node = t
  25671. }
  25672. ,
  25673. n.prototype.linkAllTilesAndNodes = function(a) {
  25674. for (var e = function(e, t, i, n, r) {
  25675. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25676. this.linkTileAndNode(o, i)
  25677. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25678. var i = this.getTileTree(a.id, t);
  25679. i.breadthFirst({
  25680. callback: e.bind(this, i, t)
  25681. })
  25682. }
  25683. }
  25684. ,
  25685. n.prototype.anyUploaded = function(e) {
  25686. if (!e)
  25687. return !1;
  25688. if (e.tile && this.isTileUploaded(e.tile))
  25689. return !0;
  25690. if (e.children)
  25691. for (var t = 0; t < e.children.length; t++) {
  25692. var i = e.children[t];
  25693. if (this.anyUploaded(i))
  25694. return !0
  25695. }
  25696. return !1
  25697. }
  25698. ,
  25699. n.prototype.setNodeCovered = function(e, t) {
  25700. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25701. }
  25702. ,
  25703. n.prototype.isNodeCovered = function(e) {
  25704. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25705. }
  25706. ,
  25707. n.prototype.addCoverageForNode = function(e) {
  25708. if (this.setNodeCovered(e, !0),
  25709. e.parent && e.covered) {
  25710. var t = e.parent;
  25711. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25712. }
  25713. }
  25714. ,
  25715. n.prototype.calcFullCoverage = function(e) {
  25716. var t = !1;
  25717. if (e.children)
  25718. for (var i = 0; i < e.children.length; i++) {
  25719. var n = e.children[i];
  25720. t = t || this.calcFullCoverage(n)
  25721. }
  25722. e.covered = e.tile.uploaded || t
  25723. }
  25724. ,
  25725. n.prototype.nodeSubcovered = function(e) {
  25726. if (!e.children)
  25727. return !1;
  25728. for (var t = 0; t < e.children.length; t++)
  25729. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25730. return !1;
  25731. return !0
  25732. }
  25733. ,
  25734. n.prototype.resetPanoDescriptor = function(e) {
  25735. this.getPanoDescriptor(e)
  25736. }
  25737. ,
  25738. n.prototype.getPanoDescriptor = function(e) {
  25739. var t = this.panoDescriptors[e];
  25740. return t || (t = {},
  25741. this.panoDescriptors[e] = t),
  25742. t
  25743. }
  25744. ,
  25745. n.prototype.resetPanoLODDescriptors = function(e) {
  25746. var t = this.getPanoLODDescriptors(e);
  25747. for (var i in t)
  25748. if (t.hasOwnProperty(i)) {
  25749. var n = t[i];
  25750. n.uploadCount = 0,
  25751. n.uploadAttempts = 0
  25752. }
  25753. }
  25754. ,
  25755. n.prototype.getPanoLODDescriptor = function(e, t) {
  25756. var i = this.getPanoLODDescriptors(e)
  25757. , n = i[t];
  25758. return n || (n = {
  25759. uploadCount: 0,
  25760. uploadAttempts: 0
  25761. },
  25762. i[t] = n),
  25763. n
  25764. }
  25765. ,
  25766. n.prototype.getPanoLODDescriptors = function(e) {
  25767. var t = this.panoLODDescriptors[e];
  25768. return t || (t = {},
  25769. this.panoLODDescriptors[e] = t),
  25770. t
  25771. }
  25772. ,
  25773. n.prototype.onTileDownloaded = function(e) {
  25774. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25775. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25776. if (i.downloaded = !0,
  25777. i.image = e.image,
  25778. i.panoSize = e.panoSize,
  25779. i.tileX = e.tileX,
  25780. i.tileY = e.tileY,
  25781. i.totalTiles = e.totalTiles,
  25782. i.tileIndex = e.tileIndex,
  25783. i.faceTileIndex = e.faceTileIndex,
  25784. i.face = e.face,
  25785. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25786. i.panoId = e.panoId,
  25787. i.tileSize = e.tileSize,
  25788. i.direction = (new _.Vector3).copy(e.direction),
  25789. i.node = null,
  25790. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25791. this.isPanoActive(i.panoId)) {
  25792. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25793. this.linkTileAndNode(i, n),
  25794. this.queueTileUpload(i, !0)
  25795. }
  25796. }
  25797. ,
  25798. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25799. var r = this.tileDirectory[e];
  25800. r || (r = {},
  25801. this.tileDirectory[e] = r);
  25802. var o = 16384 * t + 1024 * i + n
  25803. , a = r[o];
  25804. return a || (a = {
  25805. downloaded: !1,
  25806. uploaded: !1,
  25807. zoomUploaded: !1
  25808. },
  25809. r[o] = a),
  25810. a._key = e + ":" + t + ":" + i + ":" + n,
  25811. a._tileKey = o,
  25812. a
  25813. }
  25814. ,
  25815. n.prototype.setZoomingActive = function(e, t, i) {
  25816. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25817. this.zoomPanoId = t.id,
  25818. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25819. }
  25820. ,
  25821. n.prototype.updateZoomedPanoFromBase = function(e) {
  25822. if (!this.zoomPanoRenderingDisabled) {
  25823. var t = this.getActiveRenderTargetDescriptor(e.id);
  25824. if (t && t.renderTarget) {
  25825. var i = this.qualityManager.getMaxZoomPanoSize()
  25826. , n = t.renderTarget
  25827. , r = t.size;
  25828. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25829. this.copyBaseRenderStatusToZoomed(e.id)
  25830. }
  25831. }
  25832. }
  25833. ,
  25834. t.exports = n
  25835. }
  25836. , {
  25837. "../enum/GLCubeFaces": 25,
  25838. "../enum/PanoRendererEvents": 35,
  25839. "../enum/PanoSizeClass": 36,
  25840. "../enum/SceneRendererEvents": 43,
  25841. "../enum/TileDownloaderEvents": 45,
  25842. "../enum/Vectors": 50,
  25843. "../exception/BasicException": 55,
  25844. "../objects/Panorama": 148,
  25845. "../settings": 166,
  25846. "../util/browser": 182,
  25847. "../util/panorama": 191,
  25848. "./TileDownloader": 171,
  25849. "./TilePrioritizer": 172,
  25850. "./TileTree": 173,
  25851. "./TileUtils": 174,
  25852. events: 202,
  25853. three: 217
  25854. }],
  25855. 170: [function(e, t, i) {
  25856. "use strict";
  25857. function n(e, t, i) {
  25858. this.maxNavPanoSize = -1,
  25859. this.maxZoomPanoSize = -1,
  25860. this.devicePixelDensity = e,
  25861. this.deviceScreenSize = t,
  25862. this.clientBandwidth = i,
  25863. this.panoSizeClassMap = {},
  25864. this.useHighResolutionPanos = !0,
  25865. this.useUltraHighResolutionPanos = !1,
  25866. this.modelHasUltraHighPanos = !1
  25867. }
  25868. var r = e("../enum/PanoSizeClass")
  25869. , o = e("../settings")
  25870. , a = e("../util/browser")
  25871. , s = e("../constants")
  25872. , l = e("../util/showcase")
  25873. , c = e("../enum/ModelManagerEvents");
  25874. n.prototype.init = function(e) {
  25875. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25876. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25877. this.highSize = this.getPanoSize(r.HIGH),
  25878. this.standardSize = this.getPanoSize(r.STANDARD),
  25879. this.baseSize = this.getPanoSize(r.BASE),
  25880. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25881. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25882. this.updateMaximums(),
  25883. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25884. }
  25885. ,
  25886. n.prototype.updateFromModel = function(e) {
  25887. this.updateHighResolutionSettings(e),
  25888. this.updateUltraHighResolutionSettings(e)
  25889. }
  25890. ,
  25891. n.prototype.updateHighResolutionSettings = function(e) {
  25892. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25893. this.updateMaximums()
  25894. }
  25895. ,
  25896. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25897. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25898. this.updateMaximums()
  25899. }
  25900. ,
  25901. n.prototype.enableUltraHighQualityMode = function() {
  25902. this.modelHasUltraHighPanos = !0,
  25903. this.updateUltraHighResolutionSettings(null)
  25904. }
  25905. ,
  25906. n.prototype.ultraHighQualityModeEnabled = function() {
  25907. return this.modelHasUltraHighPanos
  25908. }
  25909. ,
  25910. n.prototype.onModelChanged = function(e) {
  25911. this.updateFromModel(e.model),
  25912. this.updateMaximums()
  25913. }
  25914. ,
  25915. n.prototype.updateMaximums = function() {
  25916. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25917. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25918. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25919. }
  25920. ,
  25921. n.prototype.buildPanoSizeClassMap = function() {
  25922. this.panoSizeClassMap[r.BASE] = 512,
  25923. this.panoSizeClassMap[r.STANDARD] = 1024,
  25924. this.panoSizeClassMap[r.HIGH] = 2048,
  25925. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25926. }
  25927. ,
  25928. n.prototype.getPanoSize = function(e) {
  25929. return this.panoSizeClassMap[e]
  25930. }
  25931. ,
  25932. n.prototype.getMaxPossiblePanoSize = function() {
  25933. return this.getPanoSize(r.ULTRAHIGH)
  25934. }
  25935. ,
  25936. n.prototype.getMaxPanoSize = function() {
  25937. return this.maxZoomPanoSize
  25938. }
  25939. ,
  25940. n.prototype.getMaxNavPanoSize = function() {
  25941. return this.maxNavPanoSize
  25942. }
  25943. ,
  25944. n.prototype.getMaxZoomPanoSize = function() {
  25945. return this.maxZoomPanoSize
  25946. }
  25947. ,
  25948. n.prototype.detectMaxNavPanoSizeClass = function() {
  25949. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25950. }
  25951. ,
  25952. n.prototype.detectMaxNavPanoSize = function() {
  25953. var e = this.detectMaxNavPanoSizeClass();
  25954. return this.getPanoSize(e)
  25955. }
  25956. ,
  25957. n.prototype.detectMaxZoomPanoSize = function() {
  25958. 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)
  25959. }
  25960. ,
  25961. t.exports = n
  25962. }
  25963. , {
  25964. "../constants": 8,
  25965. "../enum/ModelManagerEvents": 33,
  25966. "../enum/PanoSizeClass": 36,
  25967. "../settings": 166,
  25968. "../util/browser": 182,
  25969. "../util/showcase": 193
  25970. }],
  25971. 171: [function(A, C, e) {
  25972. (function(e) {
  25973. "use strict";
  25974. function i(e) {
  25975. this.panos = null,
  25976. this.retryMinimumTime = 1e4,
  25977. this.urls = null,
  25978. this.panoLoadCallbacks = {},
  25979. this.downloadDescriptors = {},
  25980. this.priorityQueue = [],
  25981. this.forceQueue = [],
  25982. this.activeDownloads = [],
  25983. this.qualityManager = null,
  25984. this.tilePrioritizer = null,
  25985. this.refreshInterval = null,
  25986. this.processPriorityQueue = !1,
  25987. this.concurrentDownloads = e.concurrentDownloads || 1,
  25988. this.downloadTestResults = {}
  25989. }
  25990. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  25991. A("../settings")), r = (A("../objects/Panorama"),
  25992. A("../util/logger")), o = (A("../enum/Vectors"),
  25993. A("../enum/PanoSizeClass"),
  25994. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  25995. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  25996. Object.freeze({
  25997. Testing: 1,
  25998. Success: 2,
  25999. Fail: 3
  26000. }));
  26001. i.prototype = Object.create(l.prototype),
  26002. i.IDLE_REFRESH_DELAY = 500,
  26003. i.ACTIVE_REFRESH_DELAY = 16,
  26004. i.DOWNLOAD_RETRIES = 4,
  26005. i.prototype.init = function(e) {
  26006. this.qualityManager = e
  26007. }
  26008. ,
  26009. i.prototype.setUrls = function(e) {
  26010. this.urls = e
  26011. }
  26012. ,
  26013. i.prototype.setPanoData = function(e, t, i) {
  26014. this.panos = e,
  26015. this.imagePanos = t,
  26016. this.panoGroupId = i
  26017. }
  26018. ,
  26019. i.prototype.start = function() {
  26020. this.refreshUpdateInterval(0)
  26021. }
  26022. ,
  26023. i.prototype.stop = function() {
  26024. window.cancel(this.refreshInterval)
  26025. }
  26026. ,
  26027. i.prototype.refreshUpdateInterval = function(e) {
  26028. e = e || 0,
  26029. this.refreshInterval = window.setTimeout(function() {
  26030. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26031. }
  26032. .bind(this), e)
  26033. }
  26034. ,
  26035. i.prototype.update = function() {
  26036. var e = 0 < this.forceQueue.length;
  26037. return this.processQueueForDownloading(this.forceQueue),
  26038. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26039. 0 < this.priorityQueue.length && (e = !0),
  26040. this.processQueueForDownloading(this.priorityQueue)),
  26041. e
  26042. }
  26043. ,
  26044. i.prototype.forceQueueTilesForPano = (p = [],
  26045. f = [],
  26046. function(e, t, i, n, r, o) {
  26047. p.length = 0;
  26048. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26049. var l = a[s];
  26050. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26051. }
  26052. if (i && 0 < p.length) {
  26053. g.sortPanoTiles(p, e, i),
  26054. f.length = 0,
  26055. m.matchingTilesInDirection(e, t, i, n, r, f);
  26056. for (var c = 0, h = function(e) {
  26057. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26058. }; c < p.length; ) {
  26059. var u = p[c];
  26060. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26061. }
  26062. }
  26063. for (var d = 0; d < p.length; d++)
  26064. this.forceQueue.push(p[d]);
  26065. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26066. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26067. o && this.processQueueForDownloading(this.forceQueue, !0)
  26068. }
  26069. ),
  26070. i.prototype.clearForceQueue = function() {
  26071. this.clearQueue(this.forceQueue)
  26072. }
  26073. ,
  26074. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26075. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26076. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26077. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26078. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26079. }
  26080. ,
  26081. i.prototype.clearQueue = function(e) {
  26082. this.setStatusForAllDescriptors(e, v.None),
  26083. e.length = 0
  26084. }
  26085. ,
  26086. i.prototype.clearFromQueue = function(e, t, i) {
  26087. for (var n = 0; n < e.length; n++) {
  26088. var r = e[n];
  26089. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26090. }
  26091. }
  26092. ,
  26093. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26094. for (var i = 0; i < e.length; i++) {
  26095. var n = e[i];
  26096. n && (n.status = t)
  26097. }
  26098. }
  26099. ,
  26100. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26101. for (var i = 0; i < e.length; i++) {
  26102. var n = e[i];
  26103. n && (n.status !== t ? n.status = t : e[i] = null)
  26104. }
  26105. }
  26106. ,
  26107. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26108. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26109. , n = i[t];
  26110. return n || (n = this.buildDownloadDescriptorArray(t),
  26111. i[t] = n,
  26112. this.initTileDownloadDescriptors(n, e, t)),
  26113. n
  26114. }
  26115. ,
  26116. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26117. var t = this.downloadDescriptors[e.id];
  26118. return t || (t = {},
  26119. this.downloadDescriptors[e.id] = t),
  26120. t
  26121. }
  26122. ,
  26123. i.prototype.processQueueForDownloading = function(e, t) {
  26124. if (this.cleanupActiveDownloads(),
  26125. this.activeDownloads.length < this.concurrentDownloads || t)
  26126. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26127. var r = e.shift();
  26128. r && (this.startDownload(r),
  26129. n++)
  26130. }
  26131. }
  26132. ,
  26133. i.prototype.testDownload = function(t, e, i) {
  26134. var n = this.downloadTestResults[t];
  26135. if (n)
  26136. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26137. else {
  26138. this.downloadTestResults[t] = y.Testing;
  26139. var r = this.panos.list[0]
  26140. , o = this.getTileUrl(r.id, t, e, 0)
  26141. , a = function(e) {
  26142. this.downloadTestResults[t] = y.Success,
  26143. i(!0)
  26144. }
  26145. .bind(this)
  26146. , s = function() {
  26147. this.downloadTestResults[t] = y.Fail,
  26148. i(!1)
  26149. }
  26150. .bind(this);
  26151. this.loadImage(o, 0, a, s)
  26152. }
  26153. }
  26154. ,
  26155. i.prototype.startDownload = function(e) {
  26156. e.status = v.Downloading;
  26157. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26158. this.activeDownloads.push(e),
  26159. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26160. }
  26161. ,
  26162. i.prototype.downloadFailed = function(e, t) {}
  26163. ,
  26164. i.prototype.downloadComplete = function(e, t) {
  26165. if (e.panoGroupId === this.panoGroupId) {
  26166. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26167. e.status = v.Downloaded,
  26168. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26169. var n = {
  26170. panoId: e.pano.id,
  26171. image: t,
  26172. tileSize: e.tileSize,
  26173. panoSize: e.panoSize,
  26174. tileIndex: e.tileIndex,
  26175. faceTileIndex: e.faceTileIndex,
  26176. totalTiles: e.totalTiles,
  26177. face: e.face,
  26178. tileX: e.tileX,
  26179. tileY: e.tileY,
  26180. direction: e.direction
  26181. };
  26182. e.image = t,
  26183. this.emit(o.TileDownloadSuccess, n),
  26184. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26185. panoId: e.pano.id,
  26186. tileSize: e.tileSize,
  26187. panoSize: e.panoSize
  26188. },
  26189. this.emit(o.PanoDownloadComplete, n),
  26190. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26191. }
  26192. }
  26193. ,
  26194. i.prototype.cleanupActiveDownloads = (n = [],
  26195. function() {
  26196. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26197. var t = this.activeDownloads[e];
  26198. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26199. }
  26200. this.activeDownloads.length = 0,
  26201. this.activeDownloads.push.apply(this.activeDownloads, n)
  26202. }
  26203. ),
  26204. i.prototype.isPanoDownloaded = function(e, t) {
  26205. var i = this.getTileDownloadDescriptors(e, t);
  26206. if (i.length <= 0)
  26207. return !1;
  26208. for (var n = 0; n < i.length; n++) {
  26209. if (i[n].status !== v.Downloaded)
  26210. return !1
  26211. }
  26212. return !0
  26213. }
  26214. ,
  26215. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26216. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26217. this.panoLoadCallbacks[o] = {
  26218. onLoad: i,
  26219. onFail: n,
  26220. onProgress: r
  26221. }
  26222. }
  26223. ,
  26224. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26225. var i = e.id + ":" + t;
  26226. return this.panoLoadCallbacks[i]
  26227. }
  26228. ,
  26229. i.prototype.buildDownloadDescriptorArray = function(e) {
  26230. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26231. var r = this.buildDownloadDescriptor();
  26232. i.push(r)
  26233. }
  26234. return i
  26235. }
  26236. ,
  26237. i.prototype.buildDownloadDescriptor = function() {
  26238. return {
  26239. panoGroupId: null,
  26240. pano: null,
  26241. panoSize: -1,
  26242. tileSize: -1,
  26243. tileIndex: -1,
  26244. totalTiles: -1,
  26245. faceTileIndex: -1,
  26246. status: v.None,
  26247. url: null,
  26248. image: null,
  26249. direction: new t.Vector3,
  26250. face: -1,
  26251. cubeFace: -1,
  26252. tileX: -1,
  26253. tileY: -1
  26254. }
  26255. }
  26256. ,
  26257. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26258. for (var n = 0; n < e.length; n++) {
  26259. var r = e[n];
  26260. this.initTileDownloadDescriptor(r, t, i, n)
  26261. }
  26262. }
  26263. ,
  26264. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26265. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26266. e.face = m.getFaceForTile(i, n),
  26267. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26268. e.panoGroupId = this.panoGroupId,
  26269. e.pano = t,
  26270. e.panoSize = i,
  26271. e.tileSize = r,
  26272. e.tileIndex = n,
  26273. e.totalTiles = m.getTileCountForSize(i),
  26274. e.status = v.None,
  26275. e.image = null,
  26276. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26277. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26278. }
  26279. ,
  26280. i.prototype.getTileUrl = (c = {
  26281. 256: "256",
  26282. 512: "512",
  26283. 1024: "1k",
  26284. 2048: "2k",
  26285. 4096: "4k"
  26286. },
  26287. h = {
  26288. face: -1,
  26289. faceTileIndex: -1,
  26290. tileX: -1,
  26291. tileY: -1
  26292. },
  26293. function(e, t, i, n) {
  26294. m.getTileLocation(t, n, h);
  26295. var r = Math.floor(t / i)
  26296. , o = r * r
  26297. , a = Math.floor(n / o)
  26298. , s = "";
  26299. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26300. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26301. return d.changeIfTileGenerating(l)
  26302. }
  26303. ),
  26304. i.prototype.loadImage = function(e, t, i, n) {
  26305. s.getImage(e, t).then(function(e) {
  26306. i(e)
  26307. }).fail(n)
  26308. }
  26309. ,
  26310. C.exports = i
  26311. }
  26312. ).call(this, "/js/tile/TileDownloader.js")
  26313. }
  26314. , {
  26315. "../ab": 3,
  26316. "../enum/DownloadStatus": 24,
  26317. "../enum/GLCubeFaces": 25,
  26318. "../enum/PanoSizeClass": 36,
  26319. "../enum/TileDownloaderEvents": 45,
  26320. "../enum/Vectors": 50,
  26321. "../enum/Viewmode": 51,
  26322. "../objects/Panorama": 148,
  26323. "../settings": 166,
  26324. "../util/ajax": 181,
  26325. "../util/logger": 189,
  26326. "../util/panorama": 191,
  26327. "./TilePrioritizer": 172,
  26328. "./TileUtils": 174,
  26329. events: 202,
  26330. three: 217
  26331. }],
  26332. 172: [function(n, C, e) {
  26333. (function(e) {
  26334. "use strict";
  26335. function h(e, t, i, n, r) {
  26336. this.qualityManager = e,
  26337. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26338. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26339. this.baseSize = t,
  26340. this.standardSize = i,
  26341. this.highSize = n,
  26342. this.ultraHighSize = r,
  26343. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26344. }
  26345. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26346. n("../settings"),
  26347. n("../settings"),
  26348. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26349. n("../enum/PanoSizeClass"),
  26350. n("../enum/ModelManagerEvents"),
  26351. n("../enum/GLCubeFaces"),
  26352. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26353. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26354. new t(e),
  26355. Object.freeze({
  26356. None: 0,
  26357. DirectionalFOV: 1
  26358. }));
  26359. h.PriorityCriteria = function(e, t, i, n, r) {
  26360. this.pano = e,
  26361. this.cameraPosition = (new o.Vector3).copy(t),
  26362. this.cameraDir = (new o.Vector3).copy(i),
  26363. this.panoSpaceDir = (new o.Vector3).copy(n),
  26364. this.upcomingPanos = r,
  26365. this.copy = function(e) {
  26366. this.pano = e.pano,
  26367. this.cameraPosition.copy(e.cameraPosition),
  26368. this.cameraDir.copy(e.cameraDir),
  26369. this.panoSpaceDir.copy(e.panoSpaceDir),
  26370. this.upcomingPanos = r
  26371. }
  26372. ,
  26373. this.zoomingActive = !1
  26374. }
  26375. ,
  26376. h.DIRECTIONAL_FOV = 180,
  26377. h.DIRECTIONAL_FOV_NARROW = 120,
  26378. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26379. h.MAX_SCORED_PANOS_TOADD = 2,
  26380. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26381. h.DIRECTION_SCORE_STRICTNESS = .75,
  26382. h.appendQueue = function(e, t) {
  26383. if (e && t)
  26384. for (var i = 0; i < t.length; i++)
  26385. e.push(t[i])
  26386. }
  26387. ,
  26388. h.prototype.updateCriteria = function(e, t, i, n) {
  26389. this.priorityCriteria.pano = e,
  26390. this.priorityCriteria.cameraPosition.copy(t),
  26391. this.priorityCriteria.cameraDir.copy(i),
  26392. this.priorityCriteria.upcomingPanos = n,
  26393. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26394. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26395. }
  26396. ,
  26397. h.prototype.filterAndPrioritize = (u = [],
  26398. p = [],
  26399. f = [],
  26400. function(e, t, i) {
  26401. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26402. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26403. var n = this.baseSize
  26404. , r = this.standardSize
  26405. , o = this.highSize
  26406. , a = this.ultraHighSize;
  26407. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26408. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26409. f.length = 0,
  26410. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26411. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26412. h.appendQueue(e, f),
  26413. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26414. f.length = 0,
  26415. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26416. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26417. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26418. h.appendQueue(e, f),
  26419. f.length = 0,
  26420. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26421. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26422. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26423. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26424. h.appendQueue(e, f),
  26425. this.queueTilesForPanos(e, u, i, n)
  26426. }
  26427. ),
  26428. h.prototype.canDownloadSize = function(e) {
  26429. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26430. }
  26431. ,
  26432. h.prototype.populateNeighborPanos = function(e, t, i) {
  26433. (i = i || []).length = 0;
  26434. var n = t.getNeighbours(e);
  26435. for (var r in n)
  26436. if (n.hasOwnProperty(r)) {
  26437. var o = t.get(r);
  26438. i.push(o)
  26439. }
  26440. return i
  26441. }
  26442. ,
  26443. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26444. (i = i || []).length = 0;
  26445. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26446. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26447. , s = t.sortByScore(o, a);
  26448. if (s)
  26449. for (var l = 0; l < s.length && l < r; l++) {
  26450. var c = s[l].pano;
  26451. i.push(c)
  26452. }
  26453. return i
  26454. }
  26455. ,
  26456. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26457. for (var o = 0, a = 0; a < t.length; a++) {
  26458. var s = t[a];
  26459. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26460. r && r <= o)
  26461. break
  26462. }
  26463. return o
  26464. }
  26465. ,
  26466. h.prototype.queueTilesForPano = (r = {
  26467. filter: a.None
  26468. },
  26469. function(e, t, i, n) {
  26470. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26471. }
  26472. ),
  26473. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26474. function(e, t, i, n, r, o, a, s) {
  26475. for (var l = 0, c = 0; c < i.length; c++) {
  26476. var h = i[c];
  26477. d.copy(h.position),
  26478. d.sub(r),
  26479. d.normalize();
  26480. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26481. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26482. s && s <= l))
  26483. break
  26484. }
  26485. return l
  26486. }
  26487. ),
  26488. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26489. for (var l = 0, c = 0; c < i.length; c++) {
  26490. var h = i[c];
  26491. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26492. s && s <= l)
  26493. break
  26494. }
  26495. return l
  26496. }
  26497. ,
  26498. h.prototype.queueTilesInDirectionForPano = (s = {
  26499. filter: a.DirectionalFOV,
  26500. direction: new o.Vector3,
  26501. fov: 60
  26502. },
  26503. l = new o.Vector3,
  26504. function(e, t, i, n, r, o, a) {
  26505. return l.copy(o),
  26506. m.getRelativeDirection(i.quaternion, l),
  26507. s.direction.copy(l),
  26508. s.fov = a,
  26509. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26510. }
  26511. ),
  26512. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26513. function(e, t, i, n, r) {
  26514. var o = t.getTileDownloadDescriptors(i, n);
  26515. c.length = 0,
  26516. this.filterTileDownloadDescriptors(i, o, c, r);
  26517. for (var a = 0, s = 0; s < c.length; s++) {
  26518. var l = c[s];
  26519. l && (e.push(l),
  26520. a++)
  26521. }
  26522. return a
  26523. }
  26524. ),
  26525. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26526. function(e, t, i, n) {
  26527. var r, o;
  26528. switch (n.filter) {
  26529. case a.DirectionalFOV:
  26530. for (r = 0; r < t.length; r++)
  26531. o = t[r],
  26532. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26533. break;
  26534. default:
  26535. for (r = 0; r < t.length; r++)
  26536. o = t[r],
  26537. i.push(o)
  26538. }
  26539. for (r = 0; r < i.length; r++)
  26540. o = i[r],
  26541. this.canIncludeDescriptor(o) || (i[r] = null)
  26542. }
  26543. ),
  26544. h.prototype.canIncludeDescriptor = function(e) {
  26545. return e.status !== i.Downloading && e.status !== i.Downloaded
  26546. }
  26547. ,
  26548. h.prototype.canIncludePano = function(e, t) {
  26549. return !e.isLoaded(t)
  26550. }
  26551. ,
  26552. h.getFOVDotThreshold = function(e) {
  26553. return Math.cos(o.Math.degToRad(e / 2))
  26554. }
  26555. ;
  26556. var y = (A._panoSpaceDir = new o.Vector3,
  26557. A._fovThreshold = -1,
  26558. A._fovThresholdNarrow = -1,
  26559. A);
  26560. function A(e, t) {
  26561. var i = A._panoSpaceDir
  26562. , n = A._fovThreshold
  26563. , r = A._fovThresholdNarrow
  26564. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26565. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26566. return e._dot = o,
  26567. t._dot = a,
  26568. 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)
  26569. }
  26570. h.sortPanoTiles = function(e, t, i) {
  26571. y._panoSpaceDir.copy(i),
  26572. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26573. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26574. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26575. e.sort(y)
  26576. }
  26577. ,
  26578. h.insertSortedPanoTile = function(e, t, i, n) {
  26579. y._panoSpaceDir.copy(n),
  26580. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26581. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26582. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26583. for (var r = -1, o = 0; o < e.length; o++) {
  26584. if (y(t, e[o]) <= 0) {
  26585. r = o;
  26586. break
  26587. }
  26588. }
  26589. if (-1 === r)
  26590. e[e.length] = t;
  26591. else {
  26592. for (var a = e.length; r < a; a--)
  26593. e[a] = e[a - 1];
  26594. e[r] = t
  26595. }
  26596. }
  26597. ,
  26598. h.prototype.setZoomingActive = function(e) {
  26599. e !== this.zoomingActive && (this.zoomingActive = e)
  26600. }
  26601. ,
  26602. C.exports = h
  26603. }
  26604. ).call(this, "/js/tile/TilePrioritizer.js")
  26605. }
  26606. , {
  26607. "../enum/DownloadStatus": 24,
  26608. "../enum/GLCubeFaces": 25,
  26609. "../enum/ModelManagerEvents": 33,
  26610. "../enum/PanoSizeClass": 36,
  26611. "../enum/Vectors": 50,
  26612. "../enum/Viewmode": 51,
  26613. "../objects/Panorama": 148,
  26614. "../settings": 166,
  26615. "../util/browser": 182,
  26616. "../util/logger": 189,
  26617. "../util/math": 190,
  26618. "./TileUtils": 174,
  26619. events: 202,
  26620. three: 217
  26621. }],
  26622. 173: [function(e, t, i) {
  26623. "use strict";
  26624. function f(e, t) {
  26625. this.levels = t,
  26626. this.tileSize = e,
  26627. this.root = null,
  26628. this.allNodes = [],
  26629. function(e) {
  26630. e.root = function e(t, i, n) {
  26631. if (n > t.levels)
  26632. return null;
  26633. var r = new a(t,i);
  26634. t.allNodes.push(r);
  26635. for (var o = 0; o < s; o++)
  26636. r.children[o] = e(t, r, n + 1);
  26637. return r
  26638. }(e, null, 0)
  26639. }(this)
  26640. }
  26641. function a(e, t) {
  26642. this.tree = e,
  26643. this.parent = t,
  26644. this.children = [],
  26645. this.id = ++n
  26646. }
  26647. var g = (e("three"),
  26648. e("./TileUtils"),
  26649. e("../objects/Panorama"),
  26650. e("../util/panorama"),
  26651. e("events").EventEmitter,
  26652. 2)
  26653. , s = g * g;
  26654. f.TraversalType = Object.freeze({
  26655. PreOrder: 0,
  26656. PostOrder: 1
  26657. });
  26658. var n = 0;
  26659. f.getLevelCountForSize = function(e, t) {
  26660. var i = 0;
  26661. for (t < e && (t = e); !((t /= g) < e); )
  26662. i++;
  26663. return i
  26664. }
  26665. ,
  26666. f.getSizeForLevel = function(e, t) {
  26667. return Math.pow(g, t) * e
  26668. }
  26669. ,
  26670. f.prototype.getSubNode = function(e, t, i) {
  26671. (!t || e < this.tileSize) && (t = 0),
  26672. (!i || e < this.tileSize) && (i = 0),
  26673. e < this.tileSize && (e = this.tileSize);
  26674. var n = f.getLevelCountForSize(this.tileSize, e);
  26675. return function e(t, i, n, r, o) {
  26676. if (!t)
  26677. return null;
  26678. if (0 === n)
  26679. return t;
  26680. if (!t.children || 0 === t.children.length)
  26681. return null;
  26682. var a = Math.pow(g, n) / g
  26683. , s = r % a
  26684. , l = o % a
  26685. , c = Math.floor(o / a)
  26686. , h = Math.floor(r / a)
  26687. , u = c * g + h;
  26688. return e(t.children[u], i + 1, n - 1, s, l)
  26689. }(this.root, 0, n, t, i)
  26690. }
  26691. ,
  26692. f.prototype.breadthFirst = function(e) {
  26693. var t = !!(e = e || {}).nullLevelEnd
  26694. , i = e.maxLevel
  26695. , n = e.minLevel
  26696. , r = e.callback
  26697. , o = e.saveVisited
  26698. , a = []
  26699. , s = {}
  26700. , l = 0;
  26701. for (a.push(this.root),
  26702. a.push(s); 0 < a.length && !(i && i < l); ) {
  26703. var c = a.shift();
  26704. if (c === s)
  26705. (!n || n <= l) && (r && t && r(null),
  26706. o && t && o.push(null)),
  26707. 0 < a.length && a.push(s),
  26708. l++,
  26709. 0;
  26710. else {
  26711. if (c.children)
  26712. for (var h = 0; h < c.children.length; h++) {
  26713. c.children[h] && a.push(c.children[h])
  26714. }
  26715. var u = this.getFaceIndexFromNode(c);
  26716. (!n || n <= l) && (r && r(c, l, u),
  26717. o && o.push(c)),
  26718. 0
  26719. }
  26720. }
  26721. }
  26722. ,
  26723. f.prototype.getFaceIndexFromNode = function(e) {
  26724. if (!e)
  26725. return -1;
  26726. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26727. var o = i.parent;
  26728. if (!o)
  26729. break;
  26730. for (var a = -1, s = 0; s < o.children.length; s++)
  26731. o.children[s] === i && (a = s);
  26732. n = a % g * t + n,
  26733. r = Math.floor(a / g) * t + r,
  26734. t *= g,
  26735. i = o
  26736. }
  26737. return r * t + n
  26738. }
  26739. ,
  26740. f.prototype.depthFirst = function(e, t, i) {
  26741. !function e(t, i, n, r, o, a, s, l) {
  26742. if (t) {
  26743. s = s || f.TraversalType.PreOrder;
  26744. var c = r * g + n;
  26745. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26746. a && a.push(t)),
  26747. t.children && 0 !== t.children.length) {
  26748. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26749. for (var p = 0; p < g; p++)
  26750. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26751. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26752. a && a.push(t))
  26753. }
  26754. }
  26755. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26756. }
  26757. ,
  26758. t.exports = f
  26759. }
  26760. , {
  26761. "../objects/Panorama": 148,
  26762. "../util/panorama": 191,
  26763. "./TileUtils": 174,
  26764. events: 202,
  26765. three: 217
  26766. }],
  26767. 174: [function(e, t, i) {
  26768. "use strict";
  26769. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26770. b.TILE_SIZE = 512,
  26771. b.FACES_PER_PANO = 6,
  26772. b.LocationOnTile = {
  26773. Center: 0,
  26774. UpperLeft: 1,
  26775. UpperRight: 2,
  26776. LowerRight: 3,
  26777. LowerLeft: 4
  26778. },
  26779. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26780. var l = e / t
  26781. , c = t / e * 2
  26782. , h = c / 2
  26783. , u = n / l * 2 - 1 + h
  26784. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26785. switch (o = o || b.LocationOnTile.Center) {
  26786. case b.LocationOnTile.UpperLeft:
  26787. u -= h,
  26788. d += h,
  26789. u += a * c;
  26790. break;
  26791. case b.LocationOnTile.UpperRight:
  26792. u += h,
  26793. d += h,
  26794. d -= a * c;
  26795. break;
  26796. case b.LocationOnTile.LowerRight:
  26797. u += h,
  26798. d -= h,
  26799. u -= a * c;
  26800. break;
  26801. case b.LocationOnTile.LowerLeft:
  26802. u -= h,
  26803. d -= h,
  26804. d += a * c;
  26805. break;
  26806. case b.LocationOnTile.Center:
  26807. }
  26808. switch (i) {
  26809. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26810. _.setVector(s, -1, d, -u);
  26811. break;
  26812. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26813. _.setVector(s, 1, d, u);
  26814. break;
  26815. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26816. _.setVector(s, -u, 1, -d);
  26817. break;
  26818. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26819. _.setVector(s, -u, -1, d);
  26820. break;
  26821. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26822. _.setVector(s, -u, d, 1);
  26823. break;
  26824. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26825. _.setVector(s, u, d, -1)
  26826. }
  26827. _.normalize(s)
  26828. }
  26829. ,
  26830. b.getFaceForTile = function(e, t) {
  26831. var i = b.TILE_SIZE;
  26832. e < b.TILE_SIZE && (i = e);
  26833. var n = Math.floor(e / i)
  26834. , r = n * n;
  26835. return Math.floor(t / r)
  26836. }
  26837. ,
  26838. b.getTileLocation = function(e, t, i) {
  26839. var n = b.TILE_SIZE;
  26840. e < b.TILE_SIZE && (n = e);
  26841. var r = b.getFaceForTile(e, t)
  26842. , o = Math.floor(e / n)
  26843. , a = t - r * (o * o);
  26844. i.tileX = a % o,
  26845. i.tileY = Math.floor(a / o),
  26846. i.face = r,
  26847. i.faceTileIndex = a
  26848. }
  26849. ,
  26850. b.getTileCountForSize = function(e) {
  26851. if (e <= b.TILE_SIZE)
  26852. return b.FACES_PER_PANO;
  26853. var t = Math.floor(e / b.TILE_SIZE);
  26854. return t * t * b.FACES_PER_PANO
  26855. }
  26856. ,
  26857. b.getRelativeDirection = (r = new _.Matrix4,
  26858. o = new _.Quaternion,
  26859. function(e, t) {
  26860. o.copy(e),
  26861. o.inverse(),
  26862. r.makeRotationFromQuaternion(o),
  26863. r.applyToVector3(t),
  26864. _.normalize(t)
  26865. }
  26866. ),
  26867. b.matchingTilesInDirection = (c = new _.Vector3,
  26868. h = new _.Vector3(0,0,-1),
  26869. u = new _.Quaternion,
  26870. l = {
  26871. face: -1,
  26872. faceTileIndex: -1,
  26873. tileX: -1,
  26874. tileY: -1
  26875. },
  26876. d = function(e, t, i) {
  26877. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26878. b.getTileLocation(e, o, l),
  26879. t && !t(l) || (r++,
  26880. i && (a = l,
  26881. i.push({
  26882. face: a.face,
  26883. faceTileIndex: a.faceTileIndex,
  26884. tileX: a.tileX,
  26885. tileY: a.tileY
  26886. })));
  26887. var a;
  26888. return r
  26889. }
  26890. ,
  26891. function(e, t, i, n, r, o) {
  26892. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26893. if (b.getTileCountForSize(t),
  26894. !n && !r)
  26895. return d(t, null, o);
  26896. var s = !!r;
  26897. return r = r || n,
  26898. r = Math.max(0, Math.min(r, 360)),
  26899. n = Math.max(0, Math.min(n, 360)),
  26900. _.copyVector(i, c),
  26901. b.getRelativeDirection(e.quaternion, c),
  26902. s ? (u.setFromUnitVectors(c, h),
  26903. d(t, function(e) {
  26904. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26905. }, o)) : d(t, function(e) {
  26906. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26907. }, o)
  26908. }
  26909. ),
  26910. b.isTileWithinFrustum = (E = new _.Vector3,
  26911. function(e, t, i, n, r, o, a, s) {
  26912. 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++)
  26913. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26914. _.applyQuaternionToVector(o, E),
  26915. -1e-5 <= E.z)
  26916. ;
  26917. else {
  26918. var A = -1 / E.z
  26919. , C = E.x * A
  26920. , I = E.y * A;
  26921. l < I ? p++ : I < c && f++,
  26922. h < C ? g++ : C < u && m++,
  26923. v++
  26924. }
  26925. return f !== v && p !== v && g !== v && m !== v
  26926. }
  26927. ),
  26928. b.isTileWithinFOV = (p = new _.Vector3,
  26929. f = new _.Vector3(0,1,0),
  26930. g = new _.Vector3(1,0,0),
  26931. function(e, t, i, n, r, o, a) {
  26932. var s = b.mapFaceToCubemapFace(i);
  26933. if (_.cross(o, f, g),
  26934. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26935. b.isWithinFOV(p, o, a, null))
  26936. return !0;
  26937. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26938. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26939. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26940. b.isWithinFOV(p, o, a, null))
  26941. return !0;
  26942. h += l
  26943. }
  26944. return !1
  26945. }
  26946. ),
  26947. b.isWithinFOV = (a = new _.Vector3,
  26948. s = new _.Vector3,
  26949. function(e, t, i, n) {
  26950. if (_.copyVector(e, s),
  26951. n) {
  26952. _.copyVector(n, a),
  26953. _.normalize(a);
  26954. var r = _.dot(a, e);
  26955. a.x *= r,
  26956. a.y *= r,
  26957. a.z *= r,
  26958. _.subVector(s, a)
  26959. }
  26960. var o = i / 2 * _.RADIANS_PER_DEGREE;
  26961. return Math.cos(o) <= _.dot(s, t)
  26962. }
  26963. ),
  26964. b.mapFaceToCubemapFace = (n = {
  26965. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26966. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26967. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26968. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26969. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26970. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26971. },
  26972. function(e) {
  26973. return n[e]
  26974. }
  26975. ),
  26976. t.exports = b
  26977. }
  26978. , {
  26979. "../enum/GLCubeFaces": 25,
  26980. "../util/MathLight": 176
  26981. }],
  26982. 175: [function(i, n, e) {
  26983. (function(e) {
  26984. "use strict";
  26985. function t() {
  26986. this.list = [],
  26987. this.index = {},
  26988. Object.defineProperty(this, "length", {
  26989. get: function() {
  26990. return this.list.length
  26991. }
  26992. })
  26993. }
  26994. new (i("./common"),
  26995. i("./logger"))(e),
  26996. t.prototype.forEach = function(e) {
  26997. this.list.forEach(e)
  26998. }
  26999. ,
  27000. t.prototype.add = function(e) {
  27001. this.list.push(e),
  27002. this.index[this.getIndex(e)] = e
  27003. }
  27004. ,
  27005. t.prototype.getIndex = function(e) {
  27006. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27007. }
  27008. ,
  27009. t.prototype.extend = function(e) {
  27010. for (var t = 0; t < e.length; t++)
  27011. this.add(e[t])
  27012. }
  27013. ,
  27014. t.prototype.get = function(e) {
  27015. return this.index[e]
  27016. }
  27017. ,
  27018. t.prototype.first = function() {
  27019. return this.list[0]
  27020. }
  27021. ,
  27022. t.prototype.last = function() {
  27023. return this.list[this.list.length - 1]
  27024. }
  27025. ,
  27026. t.prototype.reIndex = function() {
  27027. this.index = {};
  27028. var t = this;
  27029. this.forEach(function(e) {
  27030. t.index[t.getIndex(e)] = e
  27031. })
  27032. }
  27033. ,
  27034. t.prototype.filter = function(e) {
  27035. var t = this.list.filter(e);
  27036. return this.reIndex(),
  27037. t
  27038. }
  27039. ,
  27040. t.prototype.reduce = function(e, t) {
  27041. return this.list.reduce(e, t)
  27042. }
  27043. ,
  27044. t.prototype.sort = function(e) {
  27045. return this.list.sort(e)
  27046. }
  27047. ,
  27048. t.prototype.indexOf = function(e) {
  27049. for (var t = 0; t < this.list.length; ++t)
  27050. if (this.list[t] === e)
  27051. return t;
  27052. return -1
  27053. }
  27054. ,
  27055. n.exports = t
  27056. }
  27057. ).call(this, "/js/util/IndexedCollection.js")
  27058. }
  27059. , {
  27060. "./common": 185,
  27061. "./logger": 189
  27062. }],
  27063. 176: [function(e, t, i) {
  27064. "use strict";
  27065. e("../constants");
  27066. var n, r, o = {};
  27067. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27068. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27069. o.Vector3 = function(e, t, i) {
  27070. this.x = e || 0,
  27071. this.y = t || 0,
  27072. this.z = i || 0
  27073. }
  27074. ,
  27075. o.Matrix4 = function() {
  27076. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27077. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27078. }
  27079. ,
  27080. o.Matrix4.prototype = {
  27081. identity: function() {
  27082. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27083. this
  27084. },
  27085. copy: function(e) {
  27086. return this.elements.set(e.elements),
  27087. this
  27088. },
  27089. applyToVector3: function(e) {
  27090. var t = e.x
  27091. , i = e.y
  27092. , n = e.z
  27093. , r = this.elements;
  27094. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27095. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27096. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27097. this
  27098. },
  27099. getInverse: function(e, t) {
  27100. var i = this.elements
  27101. , n = e.elements
  27102. , r = n[0]
  27103. , o = n[1]
  27104. , a = n[2]
  27105. , s = n[3]
  27106. , l = n[4]
  27107. , c = n[5]
  27108. , h = n[6]
  27109. , u = n[7]
  27110. , d = n[8]
  27111. , p = n[9]
  27112. , f = n[10]
  27113. , g = n[11]
  27114. , m = n[12]
  27115. , v = n[13]
  27116. , y = n[14]
  27117. , A = n[15]
  27118. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27119. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27120. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27121. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27122. , b = r * C + o * I + a * E + s * _;
  27123. if (0 == b) {
  27124. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27125. if (t)
  27126. throw new Error(w);
  27127. return console.warn(w),
  27128. this.identity()
  27129. }
  27130. var T = 1 / b;
  27131. return i[0] = C * T,
  27132. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27133. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27134. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27135. i[4] = I * T,
  27136. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27137. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27138. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27139. i[8] = E * T,
  27140. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27141. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27142. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27143. i[12] = _ * T,
  27144. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27145. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27146. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27147. this
  27148. },
  27149. makeRotationFromQuaternion: function(e) {
  27150. var t = this.elements
  27151. , i = e.x
  27152. , n = e.y
  27153. , r = e.z
  27154. , o = e.w
  27155. , a = i + i
  27156. , s = n + n
  27157. , l = r + r
  27158. , c = i * a
  27159. , h = i * s
  27160. , u = i * l
  27161. , d = n * s
  27162. , p = n * l
  27163. , f = r * l
  27164. , g = o * a
  27165. , m = o * s
  27166. , v = o * l;
  27167. return t[0] = 1 - (d + f),
  27168. t[4] = h - v,
  27169. t[8] = u + m,
  27170. t[1] = h + v,
  27171. t[5] = 1 - (c + f),
  27172. t[9] = p - g,
  27173. t[2] = u - m,
  27174. t[6] = p + g,
  27175. t[10] = 1 - (c + d),
  27176. t[3] = 0,
  27177. t[7] = 0,
  27178. t[11] = 0,
  27179. t[12] = 0,
  27180. t[13] = 0,
  27181. t[14] = 0,
  27182. t[15] = 1,
  27183. this
  27184. }
  27185. },
  27186. o.Quaternion = function(e, t, i, n) {
  27187. this._x = e || 0,
  27188. this._y = t || 0,
  27189. this._z = i || 0,
  27190. this._w = void 0 !== n ? n : 1
  27191. }
  27192. ,
  27193. o.Quaternion.prototype = {
  27194. get x() {
  27195. return this._x
  27196. },
  27197. set x(e) {
  27198. this._x = e
  27199. },
  27200. get y() {
  27201. return this._y
  27202. },
  27203. set y(e) {
  27204. this._y = e
  27205. },
  27206. get z() {
  27207. return this._z
  27208. },
  27209. set z(e) {
  27210. this._z = e
  27211. },
  27212. get w() {
  27213. return this._w
  27214. },
  27215. set w(e) {
  27216. this._w = e
  27217. },
  27218. copy: function(e) {
  27219. this._x = e.x,
  27220. this._y = e.y,
  27221. this._z = e.z,
  27222. this._w = e.w
  27223. },
  27224. inverse: function() {
  27225. return this.conjugate().normalize()
  27226. },
  27227. conjugate: function() {
  27228. return this._x *= -1,
  27229. this._y *= -1,
  27230. this._z *= -1,
  27231. this
  27232. },
  27233. length: function() {
  27234. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27235. },
  27236. normalize: function() {
  27237. var e = this.length();
  27238. return 0 === e ? (this._x = 0,
  27239. this._y = 0,
  27240. this._z = 0,
  27241. this._w = 1) : (e = 1 / e,
  27242. this._x = this._x * e,
  27243. this._y = this._y * e,
  27244. this._z = this._z * e,
  27245. this._w = this._w * e),
  27246. this
  27247. },
  27248. setFromAxisAngle: function(e, t) {
  27249. var i = t / 2
  27250. , n = Math.sin(i);
  27251. return this._x = e.x * n,
  27252. this._y = e.y * n,
  27253. this._z = e.z * n,
  27254. this._w = Math.cos(i),
  27255. this
  27256. },
  27257. setFromUnitVectors: function(e, t) {
  27258. return void 0 === n && (n = new o.Vector3),
  27259. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27260. 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),
  27261. this._x = n.x,
  27262. this._y = n.y,
  27263. this._z = n.z,
  27264. this._w = r,
  27265. this.normalize()
  27266. },
  27267. multiply: function(e) {
  27268. return this.multiplyQuaternions(this, e)
  27269. },
  27270. premultiply: function(e) {
  27271. return this.multiplyQuaternions(e, this)
  27272. },
  27273. multiplyQuaternions: function(e, t) {
  27274. var i = e._x
  27275. , n = e._y
  27276. , r = e._z
  27277. , o = e._w
  27278. , a = t._x
  27279. , s = t._y
  27280. , l = t._z
  27281. , c = t._w;
  27282. return this._x = i * c + o * a + n * l - r * s,
  27283. this._y = n * c + o * s + r * a - i * l,
  27284. this._z = r * c + o * l + i * s - n * a,
  27285. this._w = o * c - i * a - n * s - r * l,
  27286. this
  27287. }
  27288. },
  27289. o.convertWorkshopVector = function(e) {
  27290. return new o.Vector3(-e.x,e.y,e.z)
  27291. }
  27292. ,
  27293. o.convertWorkshopQuaternion = function(e) {
  27294. 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))
  27295. }
  27296. ,
  27297. o.convertWorkshopOrthoZoom = function(e) {
  27298. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27299. }
  27300. ,
  27301. o.convertWorkshopPanoramaQuaternion = function(e) {
  27302. 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))
  27303. }
  27304. ,
  27305. o.normalize = function(e) {
  27306. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27307. , i = Math.sqrt(t);
  27308. e.x /= i,
  27309. e.y /= i,
  27310. e.z /= i
  27311. }
  27312. ,
  27313. o.dot = function(e, t) {
  27314. return e.x * t.x + e.y * t.y + e.z * t.z
  27315. }
  27316. ,
  27317. o.cross = function(e, t, i) {
  27318. var n = e.x
  27319. , r = e.y
  27320. , o = e.z;
  27321. i.x = r * t.z - o * t.y,
  27322. i.y = o * t.x - n * t.z,
  27323. i.z = n * t.y - r * t.x
  27324. }
  27325. ,
  27326. o.setVector = function(e, t, i, n) {
  27327. e.x = t,
  27328. e.y = i,
  27329. e.z = n
  27330. }
  27331. ,
  27332. o.copyVector = function(e, t) {
  27333. t.x = e.x,
  27334. t.y = e.y,
  27335. t.z = e.z
  27336. }
  27337. ,
  27338. o.addVector = function(e, t) {
  27339. e.x += t.x,
  27340. e.y += t.y,
  27341. e.z += t.z
  27342. }
  27343. ,
  27344. o.subVector = function(e, t) {
  27345. e.x -= t.x,
  27346. e.y -= t.y,
  27347. e.z -= t.z
  27348. }
  27349. ,
  27350. o.applyQuaternionToVector = function(e, t) {
  27351. var i = t.x
  27352. , n = t.y
  27353. , r = t.z
  27354. , o = e.x
  27355. , a = e.y
  27356. , s = e.z
  27357. , l = e.w
  27358. , c = l * i + a * r - s * n
  27359. , h = l * n + s * i - o * r
  27360. , u = l * r + o * n - a * i
  27361. , d = -o * i - a * n - s * r;
  27362. t.x = c * l + d * -o + h * -s - u * -a,
  27363. t.y = h * l + d * -a + u * -o - c * -s,
  27364. t.z = u * l + d * -s + c * -a - h * -o
  27365. }
  27366. ,
  27367. o.angleBetweenVectors = function(e, t) {
  27368. return Math.acos(o.dot(e, t))
  27369. }
  27370. ,
  27371. t.exports = o
  27372. }
  27373. , {
  27374. "../constants": 8
  27375. }],
  27376. 177: [function(c, h, e) {
  27377. (function(e) {
  27378. "use strict";
  27379. function t(e) {
  27380. this.cache = null,
  27381. this.expires = 0
  27382. }
  27383. function i() {
  27384. this.baseUrl = null,
  27385. this.cache = null,
  27386. this.expires = 0
  27387. }
  27388. function n() {
  27389. this.baseUrl = null,
  27390. this.expires = 0
  27391. }
  27392. function r(e) {
  27393. this.initialLoadingPromise = null,
  27394. this.endpoint = e + "?type=3",
  27395. this.urlContainer = null,
  27396. this.authorizationHeader = s.getAuthorizationHeader(),
  27397. this.containerClasses = [n, i, t]
  27398. }
  27399. c("./ajax");
  27400. var o = c("./logger")
  27401. , a = c("../constants")
  27402. , s = c("./showcase")
  27403. , l = (c("../ab"),
  27404. new o(e));
  27405. t.prototype = {
  27406. version: 1,
  27407. validate: function(e) {
  27408. return "catalog.json"in e && 0 < Object.keys(e).length
  27409. },
  27410. update: function(e) {
  27411. return this.cache = e,
  27412. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27413. $.when()
  27414. },
  27415. get: function(e) {
  27416. return this.cache[e]
  27417. }
  27418. },
  27419. i.prototype = {
  27420. version: 2,
  27421. validate: function(e) {
  27422. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27423. },
  27424. update: function(e) {
  27425. return this.baseUrl = e["base.url"],
  27426. this.cache = e,
  27427. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27428. $.when()
  27429. },
  27430. get: function(e) {
  27431. var t = this.cache[e];
  27432. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27433. }
  27434. },
  27435. n.prototype = {
  27436. version: 3,
  27437. validate: function(e) {
  27438. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27439. },
  27440. update: function(e) {
  27441. return this.baseUrl = e.templates[0],
  27442. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27443. $.when()
  27444. },
  27445. get: function(e) {
  27446. return this.baseUrl.replace("{{filename}}", e)
  27447. }
  27448. },
  27449. r.prototype = {
  27450. init: function() {
  27451. return this.initialLoadingPromise || (setInterval(function() {
  27452. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27453. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27454. this.refresh().done(function() {
  27455. l.debug("Refreshed")
  27456. }).fail(function() {
  27457. l.error("Failed url refresh, urls might go stale soon")
  27458. }))
  27459. }
  27460. .bind(this), a.signedUrlCheckInterval),
  27461. this.initialLoadingPromise = this.refresh()),
  27462. this.initialLoadingPromise
  27463. },
  27464. refresh: function(e) {
  27465. return {},
  27466. $.Deferred().resolve()
  27467. },
  27468. get: function(e) {
  27469. return window.DATA.files.templates[0].replace("{{filename}}", e)
  27470. }
  27471. },
  27472. h.exports = r
  27473. }
  27474. ).call(this, "/js/util/ModelUrls.js")
  27475. }
  27476. , {
  27477. "../ab": 3,
  27478. "../constants": 8,
  27479. "./ajax": 181,
  27480. "./logger": 189,
  27481. "./showcase": 193
  27482. }],
  27483. 178: [function(l, c, e) {
  27484. (function(e) {
  27485. "use strict";
  27486. function t() {
  27487. i.call(this),
  27488. this.neighbourMap = {},
  27489. this.map = null
  27490. }
  27491. 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"),
  27492. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27493. n.inherit(t, i),
  27494. t.prototype.getIndex = function(e) {
  27495. return e.id
  27496. }
  27497. ,
  27498. t.prototype.find = function(e, t) {
  27499. var i = n.filterAll(this.list, e);
  27500. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27501. i = n.stableSort(i, e)
  27502. }),
  27503. i[0])
  27504. }
  27505. ,
  27506. t.prototype.sortByScore = function(e, t) {
  27507. var i = n.filterAll(this.list, e);
  27508. return 0 === i.length ? null : i = i.map(function(i) {
  27509. return {
  27510. pano: i,
  27511. score: t.reduce(function(e, t) {
  27512. return e + t(i)
  27513. }, 0)
  27514. }
  27515. }).sort(function(e, t) {
  27516. return t.score - e.score
  27517. })
  27518. }
  27519. ,
  27520. t.prototype.lowestByScore = function(e, t, i) {
  27521. return this.findRankedByScore(0, e, t, i)
  27522. }
  27523. ,
  27524. t.prototype.findRankedByScore = function(e, t, i, n) {
  27525. n && (n.candidates = null,
  27526. n.pano = null),
  27527. e = e || 0;
  27528. var r = this.sortByScore(t, i);
  27529. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27530. n.pano = r[e].pano),
  27531. r[e].pano)
  27532. }
  27533. ,
  27534. t.prototype.showPanoScores = function(e) {
  27535. this.list.forEach(function(e) {
  27536. e.removeTextSprite()
  27537. });
  27538. var t = 6344768;
  27539. e.forEach(function(e) {
  27540. e.pano.addTextSprite(e.score.toFixed(2), t),
  27541. t = 16428055
  27542. })
  27543. }
  27544. ,
  27545. t.prototype.isNeighbour = function(e, t) {
  27546. return this.neighbourMap[e.id][t.id]
  27547. }
  27548. ,
  27549. t.prototype.getNeighbours = function(e) {
  27550. return this.neighbourMap[e.id]
  27551. }
  27552. ,
  27553. t.prototype.setNeighbour = function(e, t, i) {
  27554. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27555. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27556. this.neighbourMap[e.id][e.id] = !0,
  27557. this.neighbourMap[t.id][t.id] = !0,
  27558. this.neighbourMap[e.id][t.id] = i,
  27559. this.neighbourMap[t.id][e.id] = i,
  27560. this.neighbourMap[e.id]
  27561. }
  27562. ,
  27563. t.prototype.findClosest = function(e, t) {
  27564. var i = [r.filters.isPanoAligned()];
  27565. return t && i.push(r.filters.inDirection(e, t, .75)),
  27566. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27567. }
  27568. ,
  27569. t.prototype.dualNeighbors = function(e, t) {
  27570. var i, n = [];
  27571. for (i in this.neighbourMap[e.id])
  27572. this.neighbourMap[t.id][i] && n.push(i);
  27573. return n
  27574. }
  27575. ,
  27576. t.prototype.populate_path_graph = function() {
  27577. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27578. for (e = 0; e < this.list.length; e += 1) {
  27579. for (t in s = !(a = {}),
  27580. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27581. if (i[t]) {
  27582. o = this.index[t],
  27583. u.copy(r.floorPosition),
  27584. u.sub(o.floorPosition);
  27585. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27586. , p = (Math.abs(u.y),
  27587. Math.max(d, .01),
  27588. Math.max(0, Math.abs(u.y) - .2));
  27589. n = 0 < p ? (1,
  27590. p = Math.pow(4 * p, 2),
  27591. d = Math.pow(d, 2),
  27592. Math.sqrt(p * p + d * d)) : (1,
  27593. u.length()),
  27594. a[o.id] = n,
  27595. s = !0
  27596. }
  27597. s ? c[r.id] = a : h += 1
  27598. }
  27599. this.map = c,
  27600. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27601. }
  27602. ,
  27603. t.prototype.aStarSearch = function(e, t) {
  27604. var i = Date.now()
  27605. , n = new o({
  27606. start: e,
  27607. isEnd: function(e) {
  27608. return e === t
  27609. },
  27610. neighbor: function(e) {
  27611. var t = e.neighbourPanos || e.findNeighourPanos()
  27612. , i = [];
  27613. for (var n in t)
  27614. t[n] && i.push(this.index[n]); //add: t[n] &&
  27615. return i
  27616. }
  27617. .bind(this),
  27618. distance: function(e, t) {
  27619. return this.map[e.id][t.id]
  27620. }
  27621. .bind(this),
  27622. heuristic: function(e, t) {
  27623. return 1
  27624. }
  27625. .bind(this),
  27626. hash: function(e) {
  27627. return e.id
  27628. },
  27629. timeout: 5e3
  27630. });
  27631. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27632. "success" !== n.status)
  27633. return T.debug("Did not find A* path from " + e + " to " + t),
  27634. null;
  27635. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27636. var r = [];
  27637. return n.path.forEach(function(e) {
  27638. r.push(e.id)
  27639. }),
  27640. r
  27641. }
  27642. ,
  27643. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27644. g = new w.Vector3,
  27645. m = new w.Vector3,
  27646. v = new w.Vector3,
  27647. y = new w.Vector3,
  27648. A = new w.Vector3,
  27649. C = new w.Vector3,
  27650. I = new w.Vector3,
  27651. E = [],
  27652. _ = new w.Vector3,
  27653. b = new w.Vector3,
  27654. function(e, t) {
  27655. if (e)
  27656. for (var i = function(e, t, i) {
  27657. return y.copy(t).sub(e),
  27658. y.dot(i)
  27659. }, n = function(e, t) {
  27660. return i(_, e.position, m) - i(_, t.position, m)
  27661. }, r = 0; r < e.length - 1; ) {
  27662. var o = e[r]
  27663. , a = e[r + 1]
  27664. , s = this.index[o]
  27665. , l = this.index[a];
  27666. _.copy(s.position),
  27667. b.copy(l.position),
  27668. E.length = 0,
  27669. f.copy(b).sub(_),
  27670. m.copy(f).normalize();
  27671. for (var c = 0; c < this.list.length; c++) {
  27672. var h = this.list[c];
  27673. y.copy(h.position).sub(_);
  27674. var u = y.dot(m);
  27675. 0 < u && (C.copy(m),
  27676. C.multiplyScalar(u),
  27677. A.copy(y),
  27678. A.sub(C),
  27679. A.length() < t && (g.copy(f).negate(),
  27680. v.copy(g).normalize(),
  27681. I.copy(h.position).sub(b),
  27682. 0 < I.dot(v) && E.push(h)))
  27683. }
  27684. if (0 < E.length) {
  27685. E.sort(n);
  27686. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27687. e[d] = e[d - E.length];
  27688. for (var p = 0; p < E.length; p++)
  27689. e[p + r + 1] = E[p].id
  27690. }
  27691. r += E.length + 1
  27692. }
  27693. }
  27694. ),
  27695. t.prototype.fadeMarkerOpacity = function(e, t) {
  27696. var i = void 0 === e ? a.panorama.markerOpacity : e
  27697. , n = this.list.findIndex(function(e) {
  27698. return e.marker
  27699. });
  27700. if (!(n < 0)) {
  27701. var r = this.list[n].marker.material.opacity;
  27702. if (r !== e) {
  27703. var o = i - r;
  27704. s.trigger({
  27705. func: function(e, t) {
  27706. var i = r + e * o;
  27707. this.forEach(function(e) {
  27708. e.marker && (e.marker.material.opacity = i)
  27709. })
  27710. }
  27711. .bind(this),
  27712. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27713. name: "_fpm"
  27714. })
  27715. }
  27716. }
  27717. }
  27718. ,
  27719. c.exports = t
  27720. }
  27721. ).call(this, "/js/util/PanoramaCollection.js")
  27722. }
  27723. , {
  27724. "../objects/Panorama": 148,
  27725. "../settings": 166,
  27726. "./IndexedCollection": 175,
  27727. "./aStar": 180,
  27728. "./common": 185,
  27729. "./logger": 189,
  27730. "./transitions": 195,
  27731. three: 217
  27732. }],
  27733. 179: [function(e, t, i) {
  27734. "use strict";
  27735. function n() {
  27736. this.actionSequence = [],
  27737. this.actionSequenceInProgress = !1
  27738. }
  27739. function r(e, t, i, n) {
  27740. c.trackAlways("zoom_" + e, {
  27741. from: t,
  27742. to: i,
  27743. pano: n
  27744. })
  27745. }
  27746. var o, a, s, l, c = e("../analytics");
  27747. n.prototype.reset = function(e) {
  27748. this.actionSequenceInProgress = !1,
  27749. this.actionSequence.length = 0
  27750. }
  27751. ,
  27752. n.prototype.addZoomAction = (a = o = null,
  27753. s = !1,
  27754. l = function() {
  27755. if (o = null,
  27756. 0 < this.actionSequence.length) {
  27757. var e = this.actionSequence[0].start
  27758. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27759. 1 === e ? function(e, t) {
  27760. r("initial", 1, e, t)
  27761. }(t, a) : function(e, t, i) {
  27762. r("followup", e, t, i)
  27763. }(e, t, a)
  27764. }
  27765. this.reset()
  27766. }
  27767. ,
  27768. function(e, t, i) {
  27769. if (e !== t) {
  27770. s || (l = l.bind(this),
  27771. s = !0),
  27772. o && (window.clearTimeout(o),
  27773. o = null),
  27774. i === a && this.actionSequenceInProgress || (this.reset(),
  27775. a = i),
  27776. this.actionSequenceInProgress = !0;
  27777. var n = {
  27778. start: e,
  27779. end: t
  27780. };
  27781. this.actionSequence.push(n),
  27782. o = window.setTimeout(l, 150)
  27783. }
  27784. }
  27785. ),
  27786. t.exports = n
  27787. }
  27788. , {
  27789. "../analytics": 4
  27790. }],
  27791. 180: [function(e, t, i) {
  27792. "use strict";
  27793. function g(e) {
  27794. if (void 0 === e.parent)
  27795. return [e.data];
  27796. var t = g(e.parent);
  27797. return t.push(e.data),
  27798. t
  27799. }
  27800. function m(e) {
  27801. return e.toString()
  27802. }
  27803. function v(e, t) {
  27804. return e.f - t.f
  27805. }
  27806. var y = e("Set")
  27807. , A = e("heap")
  27808. , C = e("dict");
  27809. t.exports = function(e) {
  27810. void 0 === e.timeout && (e.timeout = 1 / 0);
  27811. var t = e.hash || m
  27812. , i = {
  27813. data: e.start,
  27814. g: 0,
  27815. h: e.heuristic(e.start)
  27816. }
  27817. , n = i;
  27818. i.f = i.h;
  27819. var r = new y
  27820. , o = new A(v)
  27821. , a = C();
  27822. o.push(i),
  27823. a.set(t(i.data), i);
  27824. for (var s = new Date; o.size(); ) {
  27825. if (new Date - s > e.timeout)
  27826. return {
  27827. status: "timeout",
  27828. cost: n.g,
  27829. path: g(n)
  27830. };
  27831. var l = o.pop();
  27832. if (a.delete(t(l.data)),
  27833. e.isEnd(l.data))
  27834. return {
  27835. status: "success",
  27836. cost: l.g,
  27837. path: g(l)
  27838. };
  27839. r.add(t(l.data));
  27840. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27841. var u = c[h];
  27842. if (!r.contains(t(u))) {
  27843. var d = l.g + e.distance(l.data, u)
  27844. , p = a.get(t(u))
  27845. , f = !1;
  27846. if (void 0 === p)
  27847. p = {
  27848. data: u
  27849. },
  27850. a.set(t(u), p);
  27851. else {
  27852. if (p.g < d)
  27853. continue;
  27854. f = !0
  27855. }
  27856. p.parent = l,
  27857. p.g = d,
  27858. p.h = e.heuristic(u),
  27859. p.f = d + p.h,
  27860. p.h < n.h && (n = p),
  27861. f ? o.heapify() : o.push(p)
  27862. }
  27863. }
  27864. }
  27865. return {
  27866. status: "noPath",
  27867. cost: n.g,
  27868. path: g(n)
  27869. }
  27870. }
  27871. }
  27872. , {
  27873. Set: 196,
  27874. dict: 210,
  27875. heap: 211
  27876. }],
  27877. 181: [function(i, n, e) {
  27878. (function(e) {
  27879. "use strict";
  27880. function s(e, t, i) {
  27881. function n() {
  27882. l.warn("Retrying ", t),
  27883. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27884. }
  27885. var r = function(e, t, i) {
  27886. var n = new XMLHttpRequest;
  27887. if (i && "withCredentials"in n)
  27888. n.open(e, t, i);
  27889. else if ("undefined" != typeof XDomainRequest)
  27890. (n = new XDomainRequest).open(e, t);
  27891. else {
  27892. if (i)
  27893. throw "Browser does not support CORS!";
  27894. n.open(e, t)
  27895. }
  27896. return n
  27897. }(e, t, !1);
  27898. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27899. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27900. i.responseType)
  27901. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27902. r.responseType = i.responseType;
  27903. else {
  27904. if ("image/jpeg" !== i.responseType)
  27905. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27906. r.responseType = "arraybuffer"
  27907. }
  27908. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27909. i.auth && r.setRequestHeader("Authorization", i.auth),
  27910. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27911. r.setRequestHeader("Content-Type", "application/json")),
  27912. "object" == typeof i.headers)
  27913. for (var o in i.headers)
  27914. r.setRequestHeader(o, i.headers[o]);
  27915. var a = $.Deferred();
  27916. return r.onreadystatechange = function(e) {
  27917. if (4 === this.readyState)
  27918. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27919. i.retries++,
  27920. setTimeout(n, 1e3);
  27921. else if (200 === this.status) {
  27922. var t = function(e, t) {
  27923. var i = e.response;
  27924. if ("json" === t && "object" != typeof i)
  27925. try {
  27926. i = JSON.parse(e.responseText)
  27927. } catch (e) {
  27928. return void a.reject({
  27929. error: "Failed parsing JSON"
  27930. })
  27931. }
  27932. else if ("image/jpeg" === t) {
  27933. var n = new Uint8Array(e.response)
  27934. , r = new Blob([n],{
  27935. type: "image/jpeg"
  27936. })
  27937. , o = URL.createObjectURL(r);
  27938. (i = new Image).src = o,
  27939. i.crossOrigin = "Anonymous",
  27940. i.onload = function() {
  27941. URL.revokeObjectURL(o)
  27942. }
  27943. }
  27944. return i
  27945. }(this, i.responseType);
  27946. a.resolve(t)
  27947. } else
  27948. a.reject(this)
  27949. }
  27950. ,
  27951. r.onprogress = function(e) {
  27952. a.notify(e)
  27953. }
  27954. ,
  27955. r.send(i.data),
  27956. a.promise()
  27957. }
  27958. function o(e, t) {
  27959. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  27960. return t.headers && function(t) {
  27961. return Object.keys(t).sort().map(function(e) {
  27962. return {
  27963. key: e,
  27964. value: t[e]
  27965. }
  27966. })
  27967. }(t.headers).forEach(function(e) {
  27968. i += "__" + e.key + ":" + e.value
  27969. }),
  27970. i
  27971. }
  27972. var t = i("./logger")
  27973. , a = i("../ab")
  27974. , l = new t(e);
  27975. window.URL = window.URL || window.webkitURL,
  27976. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27977. window.DATA = window.DATA || {},
  27978. n.exports = {
  27979. get: function(e, t) {
  27980. var i, n = void 0 === (t = t || {}).cache || t.cache;
  27981. if (n) {
  27982. var r = function(e, t) {
  27983. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  27984. }(e, t);
  27985. if (r)
  27986. return r
  27987. }
  27988. return i = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : s("GET", e, t),
  27989. n && function(e, t, i) {
  27990. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  27991. }(e, t, i),
  27992. i
  27993. },
  27994. post: function(e, t) {
  27995. return s("POST", e, t)
  27996. },
  27997. patch: function(e, t) {
  27998. return s("PATCH", e, t)
  27999. },
  28000. getImage: function(e, t) {
  28001. function i() {
  28002. l.warn("Retrying ", e),
  28003. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28004. }
  28005. var n = $.Deferred()
  28006. , r = new Image
  28007. , o = this;
  28008. return e = a.changeIfImageOptimzing(e),
  28009. null != t || (t = 3),
  28010. r.onerror = function() {
  28011. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28012. }
  28013. ,
  28014. r.onload = function() {
  28015. n.resolve(r)
  28016. }
  28017. ,
  28018. r.crossOrigin = "anonymous",
  28019. r.src = e,
  28020. n
  28021. }
  28022. }
  28023. }
  28024. ).call(this, "/js/util/ajax.js")
  28025. }
  28026. , {
  28027. "../ab": 3,
  28028. "./logger": 189
  28029. }],
  28030. 182: [function(e, t, i) {
  28031. "use strict";
  28032. function n(e, t) {
  28033. var i = window.navigator.userAgent.match(e);
  28034. return i = i ? i[1].split(t) : [],
  28035. {
  28036. major: parseInt(i[0]) || 0,
  28037. minor: parseInt(i[1]) || 0,
  28038. patch: parseInt(i[2]) || 0
  28039. }
  28040. }
  28041. var r = e("../exception/DeviceMismatchException");
  28042. window.browser = t.exports = {
  28043. isFullscreen: function() {
  28044. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28045. },
  28046. supportsFullscreen: function() {
  28047. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28048. },
  28049. isPointerLocked: function() {
  28050. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28051. },
  28052. requestFullscreen: function(e, t) {
  28053. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28054. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28055. },
  28056. requestPointerLock: function() {
  28057. var e;
  28058. if (document.fullscreenElement)
  28059. e = document.fullscreenElement();
  28060. else if (document.mozFullscreenElement)
  28061. e = document.mozFullscreenElement();
  28062. else if (document.mozFullScreenElement)
  28063. e = document.mozFullScreenElement();
  28064. else {
  28065. if (!document.webkitFullscreenElement)
  28066. return;
  28067. e = document.webkitFullscreenElement()
  28068. }
  28069. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28070. e.requestPointerLock(),
  28071. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28072. },
  28073. exitPointerLock: function() {
  28074. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28075. document.exitPointerLock()
  28076. },
  28077. exitFullscreen: function() {
  28078. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28079. },
  28080. details: function() {
  28081. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28082. return e ? {
  28083. name: e[1],
  28084. version: parseInt(e[2]),
  28085. platform: navigator.platform
  28086. } : {}
  28087. },
  28088. is: function(e) {
  28089. return this.details() && this.details().name === e
  28090. },
  28091. inIframe: function() {
  28092. return window.parent !== window
  28093. },
  28094. aspectRatio: function() {
  28095. var e = $("#player").width() / $("#player").height();
  28096. return isFinite(e) ? e : 0
  28097. },
  28098. userAgent: function() {
  28099. return window.navigator.userAgent
  28100. },
  28101. isMobile: function() {
  28102. var e = navigator.userAgent || navigator.vendor || window.opera;
  28103. 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))
  28104. },
  28105. isLandscape: function() {
  28106. return this.isMobile && 1 < this.aspectRatio()
  28107. },
  28108. isSmallScreen: function() {
  28109. return screen.width / window.devicePixelRatio < 240
  28110. },
  28111. detectIE: function() {
  28112. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28113. },
  28114. detectSafari: function() {
  28115. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28116. },
  28117. detectFirefox: function() {
  28118. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28119. },
  28120. detectChrome: function() {
  28121. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28122. },
  28123. detectOpera: function() {
  28124. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28125. },
  28126. detectIOS: function() {
  28127. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28128. },
  28129. detectIPad: function() {
  28130. var e = window.navigator.userAgent;
  28131. return /iPad/.test(e)
  28132. },
  28133. detectIPod: function() {
  28134. var e = window.navigator.userAgent;
  28135. return /iPod/.test(e)
  28136. },
  28137. detectIPhone: function() {
  28138. var e = window.navigator.userAgent;
  28139. return /iPhone/.test(e)
  28140. },
  28141. detectAndroid: function() {
  28142. return -1 !== window.navigator.userAgent.indexOf("Android")
  28143. },
  28144. detectAndroidMobile: function() {
  28145. var e = window.navigator.userAgent;
  28146. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28147. },
  28148. detectSamsungNative: function() {
  28149. var e = window.navigator.userAgent;
  28150. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28151. },
  28152. detectSamsungS6: function() {
  28153. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28154. },
  28155. detectHUAWEI5X: function() {
  28156. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28157. },
  28158. detectWebVR: function() {
  28159. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28160. },
  28161. getVRDisplay: function() {
  28162. var t = $.Deferred();
  28163. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28164. 1 <= e.length && t.resolve(e[0]),
  28165. t.reject(null)
  28166. }),
  28167. t) : t.reject(null)
  28168. },
  28169. iosVersion: function() {
  28170. if (!this.detectIOS())
  28171. throw new r("Did not detect an iDevice");
  28172. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28173. },
  28174. androidVersion: function() {
  28175. if (!this.detectAndroid())
  28176. throw new r("Did not detect an Android based device");
  28177. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28178. },
  28179. valueFromCookie: function(e, t) {
  28180. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28181. if (!i)
  28182. return t;
  28183. var n = i[1];
  28184. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28185. },
  28186. valueFromHash: function(e, t) {
  28187. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28188. if (!i)
  28189. return t;
  28190. var n = i[1];
  28191. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28192. }
  28193. }
  28194. }
  28195. , {
  28196. "../exception/DeviceMismatchException": 56
  28197. }],
  28198. 183: [function(i, n, e) {
  28199. (function(e) {
  28200. "use strict";
  28201. var o = i("../controls/serializer")
  28202. , a = i("../util/math")
  28203. , s = i("./browser")
  28204. , l = i("../enum/Viewmode")
  28205. , t = i("../util/logger")
  28206. , c = i("three")
  28207. , h = new t(e);
  28208. n.exports = {
  28209. getStartCameraOptions: function(e, t) {
  28210. var i = function(e) {
  28211. var t = s.valueFromHash("start", "")
  28212. , i = {};
  28213. if ("" !== t) {
  28214. h.debug("Start override found in parameters, trying to parse..."),
  28215. i = function(e) {
  28216. return o.deserialize(e)
  28217. }(t) || {};
  28218. var n = s.valueFromHash("tag", null);
  28219. n && (i.tag = n),
  28220. i.panoId && (i.pano = e.get(i.panoId))
  28221. }
  28222. return i
  28223. }(t);
  28224. if (0 < Object.keys(i).length)
  28225. return i;
  28226. if (e.heroImage)
  28227. i = function(e, t) {
  28228. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28229. return {};
  28230. var i = {}
  28231. , n = e.heroImage.metadata;
  28232. h.debug("Using start position from thumbnail image"),
  28233. i.position = n.camera_position,
  28234. i.quaternion = n.camera_quaternion;
  28235. try {
  28236. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28237. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28238. } catch (e) {
  28239. h.debug(e.message)
  28240. }
  28241. return i
  28242. }(e, t);
  28243. else if (window.DATA.camera_start) {
  28244. var n = window.DATA.camera_start;
  28245. try {
  28246. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28247. i.position = (new c.Vector3).fromArray(n.camera.position),
  28248. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28249. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28250. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28251. h.debug("Using camera_start"),
  28252. h.debug("Modeldata pano: ", i.pano.quaternion),
  28253. h.debug("Camera start pano: ", n.pano.quaternion)),
  28254. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28255. } catch (e) {
  28256. h.warn(e.message)
  28257. if(i.mode == "panorama" && !i.pano){
  28258. i.pano = t.list[0]
  28259. }
  28260. }
  28261. }
  28262. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28263. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28264. i.pano = t.findClosest(i.position) ,
  28265. i.quaternion = i.pano.quaternion),
  28266. 0 === Object.keys(i).length) {
  28267. var r = t.list[0];
  28268. r && (i.mode = l.PANORAMA,
  28269. i.pano = r,
  28270. i.position = r.position,
  28271. i.quaternion = r.quaternion,
  28272. h.info("Starting at 1st pano " + r.id))
  28273. }
  28274. return i.mode = i.mode || l.DOLLHOUSE,
  28275. i
  28276. }
  28277. }
  28278. }
  28279. ).call(this, "/js/util/camera.js")
  28280. }
  28281. , {
  28282. "../controls/serializer": 14,
  28283. "../enum/Viewmode": 51,
  28284. "../util/logger": 189,
  28285. "../util/math": 190,
  28286. "./browser": 182,
  28287. three: 217
  28288. }],
  28289. 184: [function(e, t, i) {
  28290. "use strict";
  28291. function r(e, t, i) {
  28292. var n = t
  28293. , r = i;
  28294. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28295. }
  28296. function o(e, t, i) {
  28297. var n = t
  28298. , r = i;
  28299. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28300. }
  28301. var a = e("./MathLight");
  28302. t.exports = {
  28303. clampVFOV: function(e, t, i, n) {
  28304. return t < r(e, i, n) ? o(t, i, n) : e
  28305. },
  28306. getHFOVForCamera: function(e, t, i) {
  28307. return r(e.fov, t, i)
  28308. },
  28309. getHFOVFromVFOV: r,
  28310. getVFOVFromHFOV: o
  28311. }
  28312. window.MathLight = t.exports
  28313. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  28314. var prec = Math.pow(10, - (precision || 4));
  28315. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  28316. if(e1.w){
  28317. return s1 && Math.abs(e1.w - e2.w) < prec
  28318. }else return s1
  28319. }
  28320. }
  28321. , {
  28322. "./MathLight": 176
  28323. }],
  28324. 185: [function(e, t, i) {
  28325. "use strict";
  28326. var a = e("three");
  28327. t.exports = {
  28328. delayOneFrame: function(e) {
  28329. window.setTimeout(e, 1)
  28330. },
  28331. normalizeUrl: function(e) {
  28332. return e.replace("https://", "http://")
  28333. },
  28334. domainFromUrl: function(e) {
  28335. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28336. return t ? t[3] : e
  28337. },
  28338. average: function(e, t) {
  28339. if (0 === e.length)
  28340. return null;
  28341. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28342. i += t ? e[r][t] : e[r],
  28343. n++
  28344. }
  28345. return i / n
  28346. },
  28347. countUnique: function(e) {
  28348. for (var t = {}, i = 0; i < e.length; i++)
  28349. t[e[i]] = 1 + (t[e[i]] || 0);
  28350. return Object.keys(t).length
  28351. },
  28352. averageVectors: function(e, t) {
  28353. var i = new a.Vector3;
  28354. if (0 === e.length)
  28355. return i;
  28356. for (var n = 0, r = 0; r < e.length; r++) {
  28357. var o = t ? e[r][t] : e[r];
  28358. i.add(o),
  28359. n++
  28360. }
  28361. return i.divideScalar(n)
  28362. },
  28363. equalLists: function(e, t) {
  28364. if (e.length !== t.length)
  28365. return !1;
  28366. for (var i = 0; i < e.length; i++)
  28367. if (e[i] !== t[i])
  28368. return !1;
  28369. return !0
  28370. },
  28371. lowerMedian: function(e, t) {
  28372. return 0 === e.length ? null : (t = t || 2,
  28373. e.sort(function(e, t) {
  28374. return e - t
  28375. }),
  28376. e[Math.floor(e.length / t)])
  28377. },
  28378. stableSort: function(e, n) {
  28379. return e.map(function(e, t) {
  28380. return {
  28381. value: e,
  28382. index: t
  28383. }
  28384. }).sort(function(e, t) {
  28385. var i = n(e.value, t.value);
  28386. return 0 !== i ? i : e.index - t.index
  28387. }).map(function(e) {
  28388. return e.value
  28389. })
  28390. },
  28391. filterAll: function(e, i) {
  28392. return e.filter(function(t) {
  28393. return i.every(function(e) {
  28394. return e(t)
  28395. })
  28396. })
  28397. },
  28398. formatDate: function(e) {
  28399. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28400. },
  28401. formatDatetime: function(e) {
  28402. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28403. },
  28404. randomString: function(e) {
  28405. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28406. t += i.charAt(Math.floor(Math.random() * i.length));
  28407. return t
  28408. },
  28409. uint8ToBase64: function(e, t) {
  28410. t && "number" == typeof t || (t = 8192);
  28411. for (var i = [], n = 0; n < e.length; n += t)
  28412. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28413. return btoa(i.join(""))
  28414. },
  28415. uuid4: function e(t) {
  28416. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28417. },
  28418. nth: function(e) {
  28419. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28420. },
  28421. extendObject: function(t, i) {
  28422. return Object.keys(i).forEach(function(e) {
  28423. t[e] = i[e]
  28424. }),
  28425. t
  28426. },
  28427. deepExtend: function e(t) {
  28428. t = t || {};
  28429. for (var i = 1; i < arguments.length; i++) {
  28430. var n = arguments[i];
  28431. if (n)
  28432. for (var r in n)
  28433. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28434. }
  28435. return t
  28436. },
  28437. inherit: function(e, t) {
  28438. e.prototype = Object.create(t.prototype),
  28439. e.prototype.constructor = e
  28440. },
  28441. extend: function(e, t) {
  28442. for (var i in t.prototype)
  28443. e.prototype[i] = t.prototype[i]
  28444. },
  28445. getVisiblePano : function(positions = [], panos, options={}){//add
  28446. var visiblePanos = [];
  28447. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  28448. panos.forEach((pano)=>{
  28449. if(!pano.isAligned())return;
  28450. var A = pano.position.clone();
  28451. var posB = options.posAtPanos[pano.id] || positions;
  28452. var posLength = posB.length
  28453. for(let i=0;i<posLength;i++){
  28454. var B = posB[i];
  28455. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  28456. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  28457. if (!o || !o.length){ //只要有一点可见,就算整体可见
  28458. visiblePanos.push(pano.id);
  28459. break;
  28460. }
  28461. }
  28462. })
  28463. return visiblePanos
  28464. }
  28465. ,
  28466. sortByScore : function(list, request, rank) {
  28467. var i = this.filterAll(list, request);
  28468. return 0 === i.length ? null : i = i.map(function(e) {
  28469. return {
  28470. item: e,
  28471. score: rank.reduce(function(t, i) {
  28472. return t + i(e);
  28473. }, 0)
  28474. };
  28475. }).sort(function(e, t) {
  28476. return t.score - e.score;
  28477. });
  28478. }
  28479. ,
  28480. getFileNameFromUrl:function(url){
  28481. return url.split('/').pop();
  28482. }
  28483. },
  28484. Math.sign = function(e) {
  28485. return e < 0 ? -1 : 1
  28486. }
  28487. window.common = t.exports
  28488. }
  28489. , {
  28490. three: 217
  28491. }],
  28492. 186: [function(e, t, i) {
  28493. "use strict";
  28494. var r = {
  28495. linearTween: function(e, t, i, n) {
  28496. return i * e / n + t
  28497. },
  28498. easeInQuad: function(e, t, i, n) {
  28499. return i * (e /= n) * e + t
  28500. },
  28501. easeOutQuad: function(e, t, i, n) {
  28502. return -i * (e /= n) * (e - 2) + t
  28503. },
  28504. easeInOutQuad: function(e, t, i, n) {
  28505. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28506. },
  28507. easeInCubic: function(e, t, i, n) {
  28508. return i * (e /= n) * e * e + t
  28509. },
  28510. easeOutCubic: function(e, t, i, n) {
  28511. return e /= n,
  28512. i * (--e * e * e + 1) + t
  28513. },
  28514. easeInOutCubic: function(e, t, i, n) {
  28515. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28516. },
  28517. easeInQuart: function(e, t, i, n) {
  28518. return i * (e /= n) * e * e * e + t
  28519. },
  28520. easeOutQuart: function(e, t, i, n) {
  28521. return e /= n,
  28522. -i * (--e * e * e * e - 1) + t
  28523. },
  28524. easeInOutQuart: function(e, t, i, n) {
  28525. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28526. },
  28527. easeInQuint: function(e, t, i, n) {
  28528. return i * (e /= n) * e * e * e * e + t
  28529. },
  28530. easeOutQuint: function(e, t, i, n) {
  28531. return e /= n,
  28532. i * (--e * e * e * e * e + 1) + t
  28533. },
  28534. easeInOutQuint: function(e, t, i, n) {
  28535. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28536. },
  28537. easeInSine: function(e, t, i, n) {
  28538. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28539. },
  28540. easeOutSine: function(e, t, i, n) {
  28541. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28542. },
  28543. easeInOutSine: function(e, t, i, n) {
  28544. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28545. },
  28546. easeInExpo: function(e, t, i, n) {
  28547. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28548. },
  28549. easeOutExpo: function(e, t, i, n) {
  28550. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28551. },
  28552. easeInOutExpo: function(e, t, i, n) {
  28553. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28554. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28555. },
  28556. easeInCirc: function(e, t, i, n) {
  28557. return e /= n,
  28558. -i * (Math.sqrt(1 - e * e) - 1) + t
  28559. },
  28560. easeOutCirc: function(e, t, i, n) {
  28561. return e /= n,
  28562. e--,
  28563. i * Math.sqrt(1 - e * e) + t
  28564. },
  28565. easeInOutCirc: function(e, t, i, n) {
  28566. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28567. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28568. },
  28569. easeInElastic: function(e, t, i, n) {
  28570. var r = 1.70158
  28571. , o = 0
  28572. , a = i;
  28573. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28574. r = a < Math.abs(i) ? (a = i,
  28575. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28576. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28577. },
  28578. easeOutElastic: function(e, t, i, n) {
  28579. var r = 1.70158
  28580. , o = 0
  28581. , a = i;
  28582. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28583. r = a < Math.abs(i) ? (a = i,
  28584. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28585. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28586. },
  28587. easeInOutElastic: function(e, t, i, n) {
  28588. var r = 1.70158
  28589. , o = 0
  28590. , a = i;
  28591. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28592. r = a < Math.abs(i) ? (a = i,
  28593. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28594. 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)
  28595. },
  28596. easeInBack: function(e, t, i, n, r) {
  28597. return void 0 === r && (r = 1.70158),
  28598. i * (e /= n) * e * ((r + 1) * e - r) + t
  28599. },
  28600. easeOutBack: function(e, t, i, n, r) {
  28601. return void 0 === r && (r = 1.70158),
  28602. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28603. },
  28604. easeInOutBack: function(e, t, i, n, r) {
  28605. return void 0 === r && (r = 1.70158),
  28606. (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
  28607. },
  28608. easeOutBounce: function(e, t, i, n) {
  28609. 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
  28610. },
  28611. easeInBounce: function(e, t, i, n) {
  28612. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28613. },
  28614. easeInOutBounce: function(e, t, i, n) {
  28615. 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
  28616. }
  28617. };
  28618. window.easing = t.exports = r
  28619. }
  28620. , {}],
  28621. 187: [function(e, t, i) {
  28622. "use strict";
  28623. function n() {
  28624. this.events = [],
  28625. this.valid = !1
  28626. }
  28627. var r = e("../enum/Joystick");
  28628. n.prototype.push = function(e, t) {
  28629. this.events.push({
  28630. direction: e,
  28631. pano: t
  28632. }),
  28633. this.valid = !0
  28634. }
  28635. ,
  28636. n.prototype.pop = function(e) {
  28637. var t = this.events.pop();
  28638. return this.events.length < 1 && (this.valid = !1),
  28639. t
  28640. }
  28641. ,
  28642. n.prototype.peek = function() {
  28643. return this.events.length ? this.events[this.events.length - 1] : {
  28644. direction: null,
  28645. pano: null
  28646. }
  28647. }
  28648. ,
  28649. n.prototype.invalidate = function() {
  28650. this.events = [],
  28651. this.valid = !1
  28652. }
  28653. ,
  28654. n.prototype.reversePano = function(e) {
  28655. if (!this.valid)
  28656. return null;
  28657. var t = this.peek();
  28658. return r.opposite(e) === t.direction ? (this.pop(),
  28659. t.pano) : null
  28660. }
  28661. ,
  28662. t.exports = n
  28663. }
  28664. , {
  28665. "../enum/Joystick": 29
  28666. }],
  28667. 188: [function(e, t, i) {
  28668. "use strict";
  28669. t.exports = {
  28670. vector: function(t, i) {
  28671. var n = t.clone();
  28672. return i = i.clone(),
  28673. function(e) {
  28674. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28675. }
  28676. },
  28677. quaternion: function(t, i) {
  28678. var n = t.clone();
  28679. return function(e) {
  28680. t.copy(n).slerp(i, e)
  28681. }
  28682. },
  28683. property: function(t, i, n, r) {
  28684. var o = t[i];
  28685. return function(e) {
  28686. t[i] = o * (1 - e) + n * e,
  28687. r && r(t[i])
  28688. }
  28689. },
  28690. uniform: function(t, i, n) {
  28691. var r = t.material.uniforms[i].value;
  28692. return function(e) {
  28693. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28694. }
  28695. },
  28696. matrix4: function(o, a) {
  28697. var s = o.clone();
  28698. return function(e) {
  28699. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28700. t[r] = i[r] * (1 - e) + n[r] * e
  28701. }
  28702. },
  28703. allUniforms: function(e, t, i) {
  28704. var n = e.map(function(e) {
  28705. return this.uniform(e, t, i)
  28706. }
  28707. .bind(this));
  28708. return function(t) {
  28709. n.forEach(function(e) {
  28710. e(t)
  28711. })
  28712. }
  28713. }
  28714. }
  28715. }
  28716. , {}],
  28717. 189: [function(e, t, i) {
  28718. "use strict";
  28719. function h(n) {
  28720. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28721. if (h.consoleEnabled) {
  28722. var l = function(e) {
  28723. $("#debug-console").append("<p>" + e + "</p>"),
  28724. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28725. };
  28726. e = function(e) {
  28727. l(Array.prototype.slice.call(arguments).join(" "))
  28728. }
  28729. ,
  28730. t = function(e) {
  28731. l(Array.prototype.slice.call(arguments).join(" "))
  28732. }
  28733. ,
  28734. i = function(e) {
  28735. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28736. }
  28737. ,
  28738. r = function(e) {
  28739. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28740. }
  28741. } else
  28742. console.log ? (e = console.log,
  28743. t = console.info ? console.info : console.log,
  28744. i = console.warn ? console.warn : console.log,
  28745. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28746. ;
  28747. function c(e) {
  28748. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28749. }
  28750. return {
  28751. debug: function() {
  28752. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28753. },
  28754. info: function() {
  28755. h.level >= h.levels.info && t.apply(console, c(arguments))
  28756. },
  28757. warn: function() {
  28758. (function(e, t) {
  28759. if (u) {
  28760. var i = Array.prototype.slice.call(e).join(" ");
  28761. u.captureMessage(i, {
  28762. level: t,
  28763. path: n,
  28764. timestamp: h.timestamp()
  28765. })
  28766. }
  28767. }
  28768. )(arguments, "warn"),
  28769. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28770. },
  28771. error: function() {
  28772. (function(e, t) {
  28773. if (u) {
  28774. var i = Array.prototype.slice.call(e).join(" ");
  28775. u.captureException(new Error(i), {
  28776. level: t,
  28777. path: n,
  28778. timestamp: h.timestamp()
  28779. })
  28780. }
  28781. }
  28782. )(arguments, "error"),
  28783. h.level >= h.levels.error && r.apply(console, c(arguments))
  28784. },
  28785. v3str: function(e, t) {
  28786. var i = void 0 === t ? 2 : t;
  28787. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28788. },
  28789. eulstr: function(e, t) {
  28790. var i = void 0 === t ? 2 : t;
  28791. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28792. },
  28793. time: function(e) {
  28794. h.level >= h.levels.debug && (s[e] = Date.now())
  28795. },
  28796. timeEnd: function(e) {
  28797. if (h.level >= h.levels.debug) {
  28798. var t = s[e];
  28799. if (!t)
  28800. return;
  28801. var i = (Date.now() - t) / 1e3;
  28802. this.debug(e, i + "s")
  28803. }
  28804. }
  28805. }
  28806. }
  28807. var u = window.Raven;
  28808. h.timestamp = function() {
  28809. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28810. }
  28811. ,
  28812. h.level = (h.levels = {
  28813. debug: 3,
  28814. info: 2,
  28815. warn: 1,
  28816. error: 0
  28817. }).info,
  28818. t.exports = h
  28819. }
  28820. , {}],
  28821. 190: [function(e, t, i) {
  28822. "use strict";
  28823. var o = e("three")
  28824. , r = e("../enum/GLCubeFaces");
  28825. e("../constants");
  28826. t.exports = {
  28827. convertVisionVector: function(e) {
  28828. return new o.Vector3(e.x,e.z,-e.y)
  28829. },
  28830. convertVisionQuaternion: function(e) {
  28831. 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)))
  28832. },
  28833. convertWorkshopVector: function(e) {
  28834. return new o.Vector3(-e.x,e.y,e.z)
  28835. },
  28836. convertWorkshopQuaternion: function(e) {
  28837. 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))
  28838. },
  28839. convertWorkshopPanoramaQuaternion: function(e) {
  28840. 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)))
  28841. },
  28842. convertWorkshopOrthoZoom: function(e) {
  28843. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28844. },
  28845. toPrecision: function(e, t) {
  28846. function i(e, t) {
  28847. var i = Math.pow(10, t);
  28848. return Math.round(e * i) / i
  28849. }
  28850. if (e instanceof Array) {
  28851. for (var n = 0; n < e.length; n++)
  28852. e[n] = i(e[n], t);
  28853. return e
  28854. }
  28855. return i(e, t)
  28856. },
  28857. isEmptyQuaternion: function(e) {
  28858. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28859. },
  28860. projectPositionToCanvas: function(e, t, i) {
  28861. (i = i || new o.Vector3).copy(e);
  28862. var n = .5 * $("#player").width()
  28863. , r = .5 * $("#player").height();
  28864. return i.project(t),
  28865. i.x = i.x * n + n,
  28866. i.y = -i.y * r + r,
  28867. i
  28868. },
  28869. convertScreenPositionToNDC: function(e, t, i) {
  28870. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28871. i.y = -t / $("#player").height() * 2 + 1,
  28872. i
  28873. },
  28874. constrainedTurn: function(e) {
  28875. var t = e % (2 * Math.PI);
  28876. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28877. },
  28878. getFOVDotThreshold: function(e) {
  28879. return Math.cos(o.Math.degToRad(e / 2))
  28880. },
  28881. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28882. switch (e) {
  28883. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28884. i.set(1, t.y, t.x);
  28885. break;
  28886. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28887. i.set(-1, t.y, -t.x);
  28888. break;
  28889. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28890. i.set(-t.x, 1, -t.y);
  28891. break;
  28892. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28893. i.set(-t.x, -1, t.y);
  28894. break;
  28895. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28896. i.set(-t.x, t.y, 1);
  28897. break;
  28898. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28899. i.set(t.x, t.y, -1)
  28900. }
  28901. n && i.normalize()
  28902. },
  28903. //add:
  28904. getPos2d : function(point, camera, dom){
  28905. var camera = camera ;
  28906. var dom = dom;
  28907. 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);
  28908. var x,y;
  28909. x = (pos.x + 1) / 2 * dom.clientWidth;
  28910. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  28911. var inSight = x <= dom.clientWidth && x >= 0
  28912. && y <= dom.clientHeight && y >= 0
  28913. return {
  28914. pos: new THREE.Vector2(x,y),
  28915. vector: pos,
  28916. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  28917. inSight : inSight //在屏幕范围内可见
  28918. };
  28919. },
  28920. getDirByLonLat: function(lon, lat) {
  28921. var dir = new THREE.Vector3();
  28922. var phi = THREE.Math.degToRad(90 - lat);
  28923. var theta = THREE.Math.degToRad(lon);
  28924. dir.x = Math.sin(phi) * Math.cos(theta);
  28925. dir.y = Math.cos(phi);
  28926. dir.z = Math.sin(phi) * Math.sin(theta);
  28927. return dir.negate();
  28928. }
  28929. }
  28930. window.math = t.exports
  28931. }
  28932. , {
  28933. "../constants": 8,
  28934. "../enum/GLCubeFaces": 25,
  28935. three: 217
  28936. }],
  28937. 191: [function(e, t, i) {
  28938. "use strict";
  28939. function o(e) {
  28940. return r[e]
  28941. }
  28942. var n = e("../enum/GLCubeFaces")
  28943. , a = [0, 1, 2, 3, 4, 5]
  28944. , r = {
  28945. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28946. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28947. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28948. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28949. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28950. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28951. };
  28952. t.exports = {
  28953. mapFaceToCubemapFace: o,
  28954. getCubemapUrls: function(i, n, r) {
  28955. return a.map(function(e, t) {
  28956. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28957. }
  28958. .bind(this))
  28959. }
  28960. }
  28961. }
  28962. , {
  28963. "../enum/GLCubeFaces": 25
  28964. }],
  28965. 192: [function(e, t, i) {
  28966. "use strict";
  28967. t.exports = {
  28968. captureErrors: function(e, t, i) {
  28969. if ("Raven"in window) {
  28970. Raven.config(e, t).install(),
  28971. i && Raven.setTagsContext(i);
  28972. var n = console.warn
  28973. , r = console.error;
  28974. console.warn = function() {
  28975. var e = Array.prototype.slice.call(arguments);
  28976. Raven.captureMessage(e.join(" "), {
  28977. level: "warning"
  28978. }),
  28979. n.apply(console, e)
  28980. }
  28981. ,
  28982. console.error = function() {
  28983. var e = Array.prototype.slice.call(arguments);
  28984. Raven.captureException(new Error(e.join(" ")), {
  28985. level: "error"
  28986. }),
  28987. r.apply(console, e)
  28988. }
  28989. } else
  28990. console.error("Raven not found, not capturing errors.")
  28991. }
  28992. }
  28993. }
  28994. , {}],
  28995. 193: [function(c, h, e) {
  28996. (function(e) {
  28997. "use strict";
  28998. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28999. getAuthorizationHeader: function() {
  29000. var e = n.valueFromHash("auth");
  29001. if (e)
  29002. return e.replace(",", " ");
  29003. var t = n.valueFromCookie("token");
  29004. return t ? "Token " + t : null
  29005. },
  29006. parseSidUrl: function(e) {
  29007. var t, i;
  29008. if (t = g_Prefix,
  29009. (e = e || "").match(/^https?/)) {
  29010. o.parse(e);
  29011. t = g_Prefix,
  29012. i = e
  29013. } else
  29014. i = (t = g_Prefix) + "data/" + e;
  29015. return {
  29016. urlBase: t,
  29017. urlModel: i,
  29018. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29019. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29020. }
  29021. },
  29022. getModelIDFromQueryString: function() {
  29023. return n.valueFromHash("model") || n.valueFromHash("m")
  29024. },
  29025. /* normalizeModeldata: function(e, i) {
  29026. e = JSON.parse(JSON.stringify(e));
  29027. var n = null;
  29028. if (e.images.forEach(function(t) {
  29029. if (t.metadata) {
  29030. if ("string" == typeof t.metadata)
  29031. try {
  29032. t.metadata = JSON.parse(t.metadata)
  29033. } catch (e) {
  29034. s.warn("Unable to parse image metadata"),
  29035. t.metadata = null
  29036. }
  29037. else
  29038. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29039. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29040. 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)),
  29041. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29042. t.metadata.zoom = t.metadata.zoom || 1),
  29043. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29044. }
  29045. }),
  29046. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29047. var t = {};
  29048. t.pano = {
  29049. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29050. position: i.convertWorkshopVector(n.scan_position),
  29051. uuid: n.scan_id
  29052. },
  29053. t.camera = {
  29054. quaternion: n.camera_quaternion,
  29055. position: n.camera_position
  29056. },
  29057. e.startPano = t
  29058. }
  29059. return e
  29060. }, */
  29061. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29062. e = JSON.parse(JSON.stringify(e));
  29063. var i = null;
  29064. var deal = function(n) {
  29065. if(!n.metadata) return;
  29066. if ("string" == typeof n.metadata)
  29067. try {
  29068. n.metadata = JSON.parse(n.metadata)
  29069. } catch (e) {
  29070. s.warn("Unable to parse image metadata"),
  29071. n.metadata = null
  29072. }
  29073. else{
  29074. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29075. }
  29076. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29077. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29078. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29079. }else{
  29080. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29081. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29082. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29083. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29084. }
  29085. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29086. }
  29087. //改
  29088. e.images.forEach(info=>{
  29089. if(info.locations){
  29090. info.locations.forEach(a=>deal(a))
  29091. }else{
  29092. deal(info)
  29093. }
  29094. })
  29095. //icon初始视角的:
  29096. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29097. var n = {};
  29098. n.pano = {
  29099. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29100. position: t.convertWorkshopVector(i.scan_position),
  29101. uuid: i.scan_id
  29102. },
  29103. n.camera = {
  29104. quaternion: i.camera_quaternion,
  29105. position: i.camera_position
  29106. },
  29107. e.startPano = n
  29108. }
  29109. return e
  29110. },
  29111. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29112. function(e) {
  29113. if (!e)
  29114. throw new Error("Vision version is required");
  29115. var t = i.exec(e);
  29116. if (null === t)
  29117. throw new Error("String is not a vision version: " + e);
  29118. return parseInt(t[1])
  29119. }
  29120. ),
  29121. modelDataPromisesTiles: function(e) {
  29122. var t = e.vision_version || window.DATA.vision_version;
  29123. if (t)
  29124. try {
  29125. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29126. } catch (e) {
  29127. s.warn("Invalid vision version: " + t)
  29128. }
  29129. return !1
  29130. }
  29131. };
  29132. h.exports = l
  29133. }
  29134. ).call(this, "/js/util/showcase.js")
  29135. }
  29136. , {
  29137. "../constants": 8,
  29138. "./browser": 182,
  29139. "./logger": 189,
  29140. three: 217,
  29141. url: 208
  29142. }],
  29143. 194: [function(e, t, i) {
  29144. "use strict";
  29145. var r = e("../util/ajax")
  29146. , o = e("three")
  29147. , a = e("../settings")
  29148. , s = {};
  29149. t.exports = {
  29150. load: function(e, t, i) {
  29151. var n = s[e];
  29152. return n ? t && setTimeout(function() {
  29153. t(n)
  29154. }, 1) : (n = new o.Texture,
  29155. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29156. n.magFilter = o.LinearFilter,
  29157. n.generateMipmaps = !1),
  29158. n.sourceFile = e,
  29159. s[e] = n,
  29160. r.getImage(e).then(function(e) {
  29161. n.image = e,
  29162. n.needsUpdate = !0,
  29163. t && t(n)
  29164. }).fail(i)),
  29165. n
  29166. },
  29167. loadBase64: function(e, t) {
  29168. t = t || "png";
  29169. var i = new o.Texture;
  29170. return i.image = document.createElement("img"),
  29171. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29172. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29173. i.magFilter = o.LinearFilter,
  29174. i.generateMipmaps = !1),
  29175. i.needsUpdate = !0,
  29176. i
  29177. },
  29178. isLoaded: function(e) {
  29179. return !!s[e]
  29180. }
  29181. }
  29182. window.Texture = t.exports
  29183. }
  29184. , {
  29185. "../settings": 166,
  29186. "../util/ajax": 181,
  29187. three: 217
  29188. }],
  29189. 195: [function(e, t, i) {
  29190. "use strict";
  29191. var l = e("./easing");
  29192. window.transitions = t.exports = {
  29193. globalDone: null,
  29194. funcs: [],
  29195. counter: 0,
  29196. uniqueID: 0,
  29197. start: function(e, t, i, n, r, o, a) {
  29198. return n = n || 0,
  29199. this.funcs.push({
  29200. func: e,
  29201. current: -n * Math.abs(t),
  29202. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29203. done: i,
  29204. easing: r || l.linearTween,
  29205. cycling: t < 0,
  29206. running: !0,
  29207. debug: n < 0,
  29208. name: o || "T" + this.counter,
  29209. id: void 0 === a ? this.counter : a,
  29210. paused: !1
  29211. }),
  29212. e(0, 16),
  29213. this.counter += 1,
  29214. e
  29215. },
  29216. trigger: function(e) {
  29217. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29218. , i = e.func || function() {}
  29219. , n = void 0 === e.duration ? 0 : e.duration;
  29220. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29221. var r = e.done || null
  29222. , o = e.easing || l.linearTween
  29223. , a = e.name || "R" + this.counter
  29224. , s = void 0 === e.id ? this.counter : e.id;
  29225. return this.start(i, n, r, t, o, a, s)
  29226. },
  29227. setTimeout: function(e, t, i) {
  29228. var n = void 0 === i ? this.counter : i;
  29229. return this.trigger({
  29230. done: e,
  29231. duration: void 0 === t ? 0 : t,
  29232. name: "O" + this.counter,
  29233. id: n
  29234. })
  29235. },
  29236. pause: function() {
  29237. this.paused = !0
  29238. },
  29239. resume: function() {
  29240. this.paused = !1
  29241. },
  29242. update: function(n) {
  29243. this.funcs.forEach(function(e) {
  29244. if (!(e.paused || (e.current += 1e3 * n,
  29245. e.current < 0)))
  29246. if (e.current >= e.duration && !e.cycling) {
  29247. var t = e.easing(1, 0, 1, 1);
  29248. e.func(t, 1e3 * n),
  29249. e.done && e.done(),
  29250. e.running = !1
  29251. } else {
  29252. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29253. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29254. e.running = !1)
  29255. }
  29256. });
  29257. var e = this.funcs.length;
  29258. this.funcs = this.funcs.filter(function(e) {
  29259. return e.running
  29260. });
  29261. var t = this.funcs.length;
  29262. if (0 < e && 0 === t && this.globalDone) {
  29263. var i = this.globalDone;
  29264. this.globalDone = null,
  29265. i()
  29266. }
  29267. },
  29268. adjustSpeed: function(e, t) {
  29269. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29270. var r = i[n];
  29271. r.duration /= t,
  29272. r.current /= t
  29273. }
  29274. },
  29275. getById: function(t) {
  29276. return this.funcs.filter(function(e) {
  29277. return t === e.id
  29278. })
  29279. },
  29280. get: function(e) {
  29281. for (var t = 0; t < this.funcs.length; t += 1)
  29282. if (this.funcs[t].func === e)
  29283. return this.funcs[t];
  29284. return null
  29285. },
  29286. isRunning: function(e) {
  29287. var t = this.get(e);
  29288. return null !== t && t.running
  29289. },
  29290. countActive: function() {
  29291. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29292. e += this.funcs[t].running;
  29293. return e
  29294. },
  29295. listActive: function() {
  29296. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29297. this.funcs[t].running && e.push(this.funcs[t].name);
  29298. return e
  29299. },
  29300. done: function(e) {
  29301. this.globalDone = e
  29302. },
  29303. cancelById: function(e) {
  29304. var t = void 0 === e ? 0 : e;
  29305. this.funcs = this.funcs.filter(function(e) {
  29306. return e.id !== t
  29307. })
  29308. },
  29309. cancel: function(t) {
  29310. this.funcs = this.funcs.filter(function(e) {
  29311. return e.func !== t
  29312. })
  29313. },
  29314. getUniqueId: function() {
  29315. return this.uniqueID -= 1,
  29316. this.uniqueID
  29317. }
  29318. }
  29319. }
  29320. , {
  29321. "./easing": 186
  29322. }],
  29323. 196: [function(e, t, i) {
  29324. function n(e) {
  29325. if (this.set = {},
  29326. this.infContains = function() {
  29327. return !0
  29328. }
  29329. ,
  29330. "object" == typeof e)
  29331. if (e instanceof Array)
  29332. for (var t = 0; t < e.length; t++)
  29333. this.set[e[t]] = !0;
  29334. else
  29335. this.set = e;
  29336. else if ("function" == typeof e)
  29337. this.infContains = e;
  29338. else if (void 0 !== e)
  29339. throw new Error("set must be either an array or an object.")
  29340. }
  29341. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29342. return !!this.set[e]
  29343. }
  29344. ,
  29345. n.prototype.add = function(e) {
  29346. if (1 == arguments.length)
  29347. this.set[e] = !0;
  29348. else
  29349. for (var t = 0; t < arguments.length; t++)
  29350. this.set[arguments[t]] = !0
  29351. }
  29352. ,
  29353. n.prototype.addAll = function(e) {
  29354. if ("object" != typeof e && !(e instanceof Array))
  29355. throw new Error("arr must be an array.");
  29356. for (var t = 0; t < e.length; t++)
  29357. this.add(e[t])
  29358. }
  29359. ,
  29360. n.prototype.delete = n.prototype.remove = function(e) {
  29361. if (1 == arguments.length)
  29362. delete this.set[e];
  29363. else
  29364. for (var t = 0; t < arguments.length; t++)
  29365. delete this.set[arguments[t]]
  29366. }
  29367. ,
  29368. n.prototype.clear = function() {
  29369. this.set = {}
  29370. }
  29371. ,
  29372. n.prototype.size = function() {
  29373. return Object.keys(this.set).length
  29374. }
  29375. ,
  29376. n.prototype.toString = function() {
  29377. return "{" + Object.keys(this.set).toString() + "}"
  29378. }
  29379. ,
  29380. n.prototype["*values"] = n.prototype.toArray = function() {
  29381. return void 0 === this.set ? [] : Object.keys(this.set)
  29382. }
  29383. }
  29384. , {}],
  29385. 197: [function(e, t, i) {}
  29386. , {}],
  29387. 198: [function(N, e, F) {
  29388. (function(e) {
  29389. "use strict";
  29390. function i() {
  29391. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29392. }
  29393. function o(e, t) {
  29394. if (i() < t)
  29395. throw new RangeError("Invalid typed array length");
  29396. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29397. e.length = t),
  29398. e
  29399. }
  29400. function u(e, t, i) {
  29401. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29402. return new u(e,t,i);
  29403. if ("number" != typeof e)
  29404. return n(this, e, t, i);
  29405. if ("string" == typeof t)
  29406. throw new Error("If encoding is specified then the first argument must be a string");
  29407. return a(this, e)
  29408. }
  29409. function n(e, t, i, n) {
  29410. if ("number" == typeof t)
  29411. throw new TypeError('"value" argument must not be a number');
  29412. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29413. if (t.byteLength,
  29414. i < 0 || t.byteLength < i)
  29415. throw new RangeError("'offset' is out of bounds");
  29416. if (t.byteLength < i + (n || 0))
  29417. throw new RangeError("'length' is out of bounds");
  29418. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29419. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29420. e
  29421. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29422. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29423. !u.isEncoding(i))
  29424. throw new TypeError('"encoding" must be a valid string encoding');
  29425. var n = 0 | c(t, i)
  29426. , r = (e = o(e, n)).write(t, i);
  29427. return r !== n && (e = e.slice(0, r)),
  29428. e
  29429. }(e, t, i) : function(e, t) {
  29430. if (u.isBuffer(t)) {
  29431. var i = 0 | l(t.length);
  29432. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29433. e
  29434. }
  29435. if (t) {
  29436. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29437. return "number" != typeof t.length || function(e) {
  29438. return e != e
  29439. }(t.length) ? o(e, 0) : s(e, t);
  29440. if ("Buffer" === t.type && L(t.data))
  29441. return s(e, t.data)
  29442. }
  29443. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29444. }(e, t)
  29445. }
  29446. function r(e) {
  29447. if ("number" != typeof e)
  29448. throw new TypeError('"size" argument must be a number');
  29449. if (e < 0)
  29450. throw new RangeError('"size" argument must not be negative')
  29451. }
  29452. function a(e, t) {
  29453. if (r(t),
  29454. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29455. !u.TYPED_ARRAY_SUPPORT)
  29456. for (var i = 0; i < t; ++i)
  29457. e[i] = 0;
  29458. return e
  29459. }
  29460. function s(e, t) {
  29461. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29462. e = o(e, i);
  29463. for (var n = 0; n < i; n += 1)
  29464. e[n] = 255 & t[n];
  29465. return e
  29466. }
  29467. function l(e) {
  29468. if (e >= i())
  29469. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29470. return 0 | e
  29471. }
  29472. function c(e, t) {
  29473. if (u.isBuffer(e))
  29474. return e.length;
  29475. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29476. return e.byteLength;
  29477. "string" != typeof e && (e = "" + e);
  29478. var i = e.length;
  29479. if (0 === i)
  29480. return 0;
  29481. for (var n = !1; ; )
  29482. switch (t) {
  29483. case "ascii":
  29484. case "latin1":
  29485. case "binary":
  29486. return i;
  29487. case "utf8":
  29488. case "utf-8":
  29489. case void 0:
  29490. return S(e).length;
  29491. case "ucs2":
  29492. case "ucs-2":
  29493. case "utf16le":
  29494. case "utf-16le":
  29495. return 2 * i;
  29496. case "hex":
  29497. return i >>> 1;
  29498. case "base64":
  29499. return M(e).length;
  29500. default:
  29501. if (n)
  29502. return S(e).length;
  29503. t = ("" + t).toLowerCase(),
  29504. n = !0
  29505. }
  29506. }
  29507. function h(e, t, i) {
  29508. var n = e[t];
  29509. e[t] = e[i],
  29510. e[i] = n
  29511. }
  29512. function d(e, t, i, n, r) {
  29513. if (0 === e.length)
  29514. return -1;
  29515. if ("string" == typeof i ? (n = i,
  29516. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29517. i = +i,
  29518. isNaN(i) && (i = r ? 0 : e.length - 1),
  29519. i < 0 && (i = e.length + i),
  29520. i >= e.length) {
  29521. if (r)
  29522. return -1;
  29523. i = e.length - 1
  29524. } else if (i < 0) {
  29525. if (!r)
  29526. return -1;
  29527. i = 0
  29528. }
  29529. if ("string" == typeof t && (t = u.from(t, n)),
  29530. u.isBuffer(t))
  29531. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29532. if ("number" == typeof t)
  29533. return t &= 255,
  29534. 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);
  29535. throw new TypeError("val must be string, number or Buffer")
  29536. }
  29537. function p(e, t, i, n, r) {
  29538. function o(e, t) {
  29539. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29540. }
  29541. var a, s = 1, l = e.length, c = t.length;
  29542. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29543. if (e.length < 2 || t.length < 2)
  29544. return -1;
  29545. l /= s = 2,
  29546. c /= 2,
  29547. i /= 2
  29548. }
  29549. if (r) {
  29550. var h = -1;
  29551. for (a = i; a < l; a++)
  29552. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29553. if (-1 === h && (h = a),
  29554. a - h + 1 === c)
  29555. return h * s
  29556. } else
  29557. -1 !== h && (a -= a - h),
  29558. h = -1
  29559. } else
  29560. for (l < i + c && (i = l - c),
  29561. a = i; 0 <= a; a--) {
  29562. for (var u = !0, d = 0; d < c; d++)
  29563. if (o(e, a + d) !== o(t, d)) {
  29564. u = !1;
  29565. break
  29566. }
  29567. if (u)
  29568. return a
  29569. }
  29570. return -1
  29571. }
  29572. function g(e, t, i, n) {
  29573. i = Number(i) || 0;
  29574. var r = e.length - i;
  29575. n ? r < (n = Number(n)) && (n = r) : n = r;
  29576. var o = t.length;
  29577. if (o % 2 != 0)
  29578. throw new TypeError("Invalid hex string");
  29579. o / 2 < n && (n = o / 2);
  29580. for (var a = 0; a < n; ++a) {
  29581. var s = parseInt(t.substr(2 * a, 2), 16);
  29582. if (isNaN(s))
  29583. return a;
  29584. e[i + a] = s
  29585. }
  29586. return a
  29587. }
  29588. function m(e, t, i, n) {
  29589. return R(function(e) {
  29590. for (var t = [], i = 0; i < e.length; ++i)
  29591. t.push(255 & e.charCodeAt(i));
  29592. return t
  29593. }(t), e, i, n)
  29594. }
  29595. function f(e, t, i) {
  29596. i = Math.min(e.length, i);
  29597. for (var n = [], r = t; r < i; ) {
  29598. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29599. if (r + u <= i)
  29600. switch (u) {
  29601. case 1:
  29602. c < 128 && (h = c);
  29603. break;
  29604. case 2:
  29605. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29606. break;
  29607. case 3:
  29608. o = e[r + 1],
  29609. a = e[r + 2],
  29610. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29611. break;
  29612. case 4:
  29613. o = e[r + 1],
  29614. a = e[r + 2],
  29615. s = e[r + 3],
  29616. 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))
  29617. }
  29618. null === h ? (h = 65533,
  29619. u = 1) : 65535 < h && (h -= 65536,
  29620. n.push(h >>> 10 & 1023 | 55296),
  29621. h = 56320 | 1023 & h),
  29622. n.push(h),
  29623. r += u
  29624. }
  29625. return function(e) {
  29626. var t = e.length;
  29627. if (t <= D)
  29628. return String.fromCharCode.apply(String, e);
  29629. for (var i = "", n = 0; n < t; )
  29630. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29631. return i
  29632. }(n)
  29633. }
  29634. function v(e, t, i) {
  29635. var n = "";
  29636. i = Math.min(e.length, i);
  29637. for (var r = t; r < i; ++r)
  29638. n += String.fromCharCode(127 & e[r]);
  29639. return n
  29640. }
  29641. function y(e, t, i) {
  29642. var n = "";
  29643. i = Math.min(e.length, i);
  29644. for (var r = t; r < i; ++r)
  29645. n += String.fromCharCode(e[r]);
  29646. return n
  29647. }
  29648. function A(e, t, i) {
  29649. var n, r = e.length;
  29650. (!t || t < 0) && (t = 0),
  29651. (!i || i < 0 || r < i) && (i = r);
  29652. for (var o = "", a = t; a < i; ++a)
  29653. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29654. return o
  29655. }
  29656. function C(e, t, i) {
  29657. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29658. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29659. return r
  29660. }
  29661. function I(e, t, i) {
  29662. if (e % 1 != 0 || e < 0)
  29663. throw new RangeError("offset is not uint");
  29664. if (i < e + t)
  29665. throw new RangeError("Trying to access beyond buffer length")
  29666. }
  29667. function E(e, t, i, n, r, o) {
  29668. if (!u.isBuffer(e))
  29669. throw new TypeError('"buffer" argument must be a Buffer instance');
  29670. if (r < t || t < o)
  29671. throw new RangeError('"value" argument is out of bounds');
  29672. if (i + n > e.length)
  29673. throw new RangeError("Index out of range")
  29674. }
  29675. function _(e, t, i, n) {
  29676. t < 0 && (t = 65535 + t + 1);
  29677. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29678. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29679. }
  29680. function b(e, t, i, n) {
  29681. t < 0 && (t = 4294967295 + t + 1);
  29682. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29683. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29684. }
  29685. function w(e, t, i, n) {
  29686. if (i + n > e.length)
  29687. throw new RangeError("Index out of range");
  29688. if (i < 0)
  29689. throw new RangeError("Index out of range")
  29690. }
  29691. function T(e, t, i, n, r) {
  29692. return r || w(e, 0, i, 4),
  29693. O.write(e, t, i, n, 23, 4),
  29694. i + 4
  29695. }
  29696. function x(e, t, i, n, r) {
  29697. return r || w(e, 0, i, 8),
  29698. O.write(e, t, i, n, 52, 8),
  29699. i + 8
  29700. }
  29701. function S(e, t) {
  29702. t = t || 1 / 0;
  29703. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29704. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29705. if (!r) {
  29706. if (56319 < i) {
  29707. -1 < (t -= 3) && o.push(239, 191, 189);
  29708. continue
  29709. }
  29710. if (a + 1 === n) {
  29711. -1 < (t -= 3) && o.push(239, 191, 189);
  29712. continue
  29713. }
  29714. r = i;
  29715. continue
  29716. }
  29717. if (i < 56320) {
  29718. -1 < (t -= 3) && o.push(239, 191, 189),
  29719. r = i;
  29720. continue
  29721. }
  29722. i = 65536 + (r - 55296 << 10 | i - 56320)
  29723. } else
  29724. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29725. if (r = null,
  29726. i < 128) {
  29727. if ((t -= 1) < 0)
  29728. break;
  29729. o.push(i)
  29730. } else if (i < 2048) {
  29731. if ((t -= 2) < 0)
  29732. break;
  29733. o.push(i >> 6 | 192, 63 & i | 128)
  29734. } else if (i < 65536) {
  29735. if ((t -= 3) < 0)
  29736. break;
  29737. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29738. } else {
  29739. if (!(i < 1114112))
  29740. throw new Error("Invalid code point");
  29741. if ((t -= 4) < 0)
  29742. break;
  29743. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29744. }
  29745. }
  29746. return o
  29747. }
  29748. function M(e) {
  29749. return P.toByteArray(function(e) {
  29750. if ((e = function(e) {
  29751. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29752. }(e).replace(t, "")).length < 2)
  29753. return "";
  29754. for (; e.length % 4 != 0; )
  29755. e += "=";
  29756. return e
  29757. }(e))
  29758. }
  29759. function R(e, t, i, n) {
  29760. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29761. t[r + i] = e[r];
  29762. return r
  29763. }
  29764. var P = N("base64-js")
  29765. , O = N("ieee754")
  29766. , L = N("isarray");
  29767. F.Buffer = u,
  29768. F.SlowBuffer = function(e) {
  29769. return +e != e && (e = 0),
  29770. u.alloc(+e)
  29771. }
  29772. ,
  29773. F.INSPECT_MAX_BYTES = 50,
  29774. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29775. try {
  29776. var e = new Uint8Array(1);
  29777. return e.__proto__ = {
  29778. __proto__: Uint8Array.prototype,
  29779. foo: function() {
  29780. return 42
  29781. }
  29782. },
  29783. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29784. } catch (e) {
  29785. return !1
  29786. }
  29787. }(),
  29788. F.kMaxLength = i(),
  29789. u.poolSize = 8192,
  29790. u._augment = function(e) {
  29791. return e.__proto__ = u.prototype,
  29792. e
  29793. }
  29794. ,
  29795. u.from = function(e, t, i) {
  29796. return n(null, e, t, i)
  29797. }
  29798. ,
  29799. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29800. u.__proto__ = Uint8Array,
  29801. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29802. value: null,
  29803. configurable: !0
  29804. })),
  29805. u.alloc = function(e, t, i) {
  29806. return function(e, t, i, n) {
  29807. return r(t),
  29808. 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)
  29809. }(null, e, t, i)
  29810. }
  29811. ,
  29812. u.allocUnsafe = function(e) {
  29813. return a(null, e)
  29814. }
  29815. ,
  29816. u.allocUnsafeSlow = function(e) {
  29817. return a(null, e)
  29818. }
  29819. ,
  29820. u.isBuffer = function(e) {
  29821. return !(null == e || !e._isBuffer)
  29822. }
  29823. ,
  29824. u.compare = function(e, t) {
  29825. if (!u.isBuffer(e) || !u.isBuffer(t))
  29826. throw new TypeError("Arguments must be Buffers");
  29827. if (e === t)
  29828. return 0;
  29829. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29830. if (e[r] !== t[r]) {
  29831. i = e[r],
  29832. n = t[r];
  29833. break
  29834. }
  29835. return i < n ? -1 : n < i ? 1 : 0
  29836. }
  29837. ,
  29838. u.isEncoding = function(e) {
  29839. switch (String(e).toLowerCase()) {
  29840. case "hex":
  29841. case "utf8":
  29842. case "utf-8":
  29843. case "ascii":
  29844. case "latin1":
  29845. case "binary":
  29846. case "base64":
  29847. case "ucs2":
  29848. case "ucs-2":
  29849. case "utf16le":
  29850. case "utf-16le":
  29851. return !0;
  29852. default:
  29853. return !1
  29854. }
  29855. }
  29856. ,
  29857. u.concat = function(e, t) {
  29858. if (!L(e))
  29859. throw new TypeError('"list" argument must be an Array of Buffers');
  29860. if (0 === e.length)
  29861. return u.alloc(0);
  29862. var i;
  29863. if (void 0 === t)
  29864. for (i = t = 0; i < e.length; ++i)
  29865. t += e[i].length;
  29866. var n = u.allocUnsafe(t)
  29867. , r = 0;
  29868. for (i = 0; i < e.length; ++i) {
  29869. var o = e[i];
  29870. if (!u.isBuffer(o))
  29871. throw new TypeError('"list" argument must be an Array of Buffers');
  29872. o.copy(n, r),
  29873. r += o.length
  29874. }
  29875. return n
  29876. }
  29877. ,
  29878. u.byteLength = c,
  29879. u.prototype._isBuffer = !0,
  29880. u.prototype.swap16 = function() {
  29881. var e = this.length;
  29882. if (e % 2 != 0)
  29883. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29884. for (var t = 0; t < e; t += 2)
  29885. h(this, t, t + 1);
  29886. return this
  29887. }
  29888. ,
  29889. u.prototype.swap32 = function() {
  29890. var e = this.length;
  29891. if (e % 4 != 0)
  29892. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29893. for (var t = 0; t < e; t += 4)
  29894. h(this, t, t + 3),
  29895. h(this, t + 1, t + 2);
  29896. return this
  29897. }
  29898. ,
  29899. u.prototype.swap64 = function() {
  29900. var e = this.length;
  29901. if (e % 8 != 0)
  29902. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29903. for (var t = 0; t < e; t += 8)
  29904. h(this, t, t + 7),
  29905. h(this, t + 1, t + 6),
  29906. h(this, t + 2, t + 5),
  29907. h(this, t + 3, t + 4);
  29908. return this
  29909. }
  29910. ,
  29911. u.prototype.toString = function() {
  29912. var e = 0 | this.length;
  29913. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29914. var n, r, o, a = !1;
  29915. if ((void 0 === t || t < 0) && (t = 0),
  29916. t > this.length)
  29917. return "";
  29918. if ((void 0 === i || i > this.length) && (i = this.length),
  29919. i <= 0)
  29920. return "";
  29921. if ((i >>>= 0) <= (t >>>= 0))
  29922. return "";
  29923. for (e = e || "utf8"; ; )
  29924. switch (e) {
  29925. case "hex":
  29926. return A(this, t, i);
  29927. case "utf8":
  29928. case "utf-8":
  29929. return f(this, t, i);
  29930. case "ascii":
  29931. return v(this, t, i);
  29932. case "latin1":
  29933. case "binary":
  29934. return y(this, t, i);
  29935. case "base64":
  29936. return n = this,
  29937. o = i,
  29938. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29939. case "ucs2":
  29940. case "ucs-2":
  29941. case "utf16le":
  29942. case "utf-16le":
  29943. return C(this, t, i);
  29944. default:
  29945. if (a)
  29946. throw new TypeError("Unknown encoding: " + e);
  29947. e = (e + "").toLowerCase(),
  29948. a = !0
  29949. }
  29950. }
  29951. .apply(this, arguments)
  29952. }
  29953. ,
  29954. u.prototype.equals = function(e) {
  29955. if (!u.isBuffer(e))
  29956. throw new TypeError("Argument must be a Buffer");
  29957. return this === e || 0 === u.compare(this, e)
  29958. }
  29959. ,
  29960. u.prototype.inspect = function() {
  29961. var e = ""
  29962. , t = F.INSPECT_MAX_BYTES;
  29963. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29964. this.length > t && (e += " ... ")),
  29965. "<Buffer " + e + ">"
  29966. }
  29967. ,
  29968. u.prototype.compare = function(e, t, i, n, r) {
  29969. if (!u.isBuffer(e))
  29970. throw new TypeError("Argument must be a Buffer");
  29971. if (void 0 === t && (t = 0),
  29972. void 0 === i && (i = e ? e.length : 0),
  29973. void 0 === n && (n = 0),
  29974. void 0 === r && (r = this.length),
  29975. t < 0 || i > e.length || n < 0 || r > this.length)
  29976. throw new RangeError("out of range index");
  29977. if (r <= n && i <= t)
  29978. return 0;
  29979. if (r <= n)
  29980. return -1;
  29981. if (i <= t)
  29982. return 1;
  29983. if (this === e)
  29984. return 0;
  29985. 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)
  29986. if (l[h] !== c[h]) {
  29987. o = l[h],
  29988. a = c[h];
  29989. break
  29990. }
  29991. return o < a ? -1 : a < o ? 1 : 0
  29992. }
  29993. ,
  29994. u.prototype.includes = function(e, t, i) {
  29995. return -1 !== this.indexOf(e, t, i)
  29996. }
  29997. ,
  29998. u.prototype.indexOf = function(e, t, i) {
  29999. return d(this, e, t, i, !0)
  30000. }
  30001. ,
  30002. u.prototype.lastIndexOf = function(e, t, i) {
  30003. return d(this, e, t, i, !1)
  30004. }
  30005. ,
  30006. u.prototype.write = function(e, t, i, n) {
  30007. if (void 0 === t)
  30008. n = "utf8",
  30009. i = this.length,
  30010. t = 0;
  30011. else if (void 0 === i && "string" == typeof t)
  30012. n = t,
  30013. i = this.length,
  30014. t = 0;
  30015. else {
  30016. if (!isFinite(t))
  30017. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30018. t |= 0,
  30019. isFinite(i) ? (i |= 0,
  30020. void 0 === n && (n = "utf8")) : (n = i,
  30021. i = void 0)
  30022. }
  30023. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30024. if ((void 0 === i || p < i) && (i = p),
  30025. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30026. throw new RangeError("Attempt to write outside buffer bounds");
  30027. n = n || "utf8";
  30028. for (var f = !1; ; )
  30029. switch (n) {
  30030. case "hex":
  30031. return g(this, e, t, i);
  30032. case "utf8":
  30033. case "utf-8":
  30034. return u = t,
  30035. d = i,
  30036. R(S(e, (h = this).length - u), h, u, d);
  30037. case "ascii":
  30038. return m(this, e, t, i);
  30039. case "latin1":
  30040. case "binary":
  30041. return m(this, e, t, i);
  30042. case "base64":
  30043. return s = this,
  30044. l = t,
  30045. c = i,
  30046. R(M(e), s, l, c);
  30047. case "ucs2":
  30048. case "ucs-2":
  30049. case "utf16le":
  30050. case "utf-16le":
  30051. return o = t,
  30052. a = i,
  30053. R(function(e, t) {
  30054. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30055. i = e.charCodeAt(a),
  30056. n = i >> 8,
  30057. r = i % 256,
  30058. o.push(r),
  30059. o.push(n);
  30060. return o
  30061. }(e, (r = this).length - o), r, o, a);
  30062. default:
  30063. if (f)
  30064. throw new TypeError("Unknown encoding: " + n);
  30065. n = ("" + n).toLowerCase(),
  30066. f = !0
  30067. }
  30068. }
  30069. ,
  30070. u.prototype.toJSON = function() {
  30071. return {
  30072. type: "Buffer",
  30073. data: Array.prototype.slice.call(this._arr || this, 0)
  30074. }
  30075. }
  30076. ;
  30077. var D = 4096;
  30078. u.prototype.slice = function(e, t) {
  30079. var i, n = this.length;
  30080. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30081. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30082. t < e && (t = e),
  30083. u.TYPED_ARRAY_SUPPORT)
  30084. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30085. else {
  30086. var r = t - e;
  30087. i = new u(r,void 0);
  30088. for (var o = 0; o < r; ++o)
  30089. i[o] = this[o + e]
  30090. }
  30091. return i
  30092. }
  30093. ,
  30094. u.prototype.readUIntLE = function(e, t, i) {
  30095. e |= 0,
  30096. t |= 0,
  30097. i || I(e, t, this.length);
  30098. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30099. n += this[e + o] * r;
  30100. return n
  30101. }
  30102. ,
  30103. u.prototype.readUIntBE = function(e, t, i) {
  30104. e |= 0,
  30105. t |= 0,
  30106. i || I(e, t, this.length);
  30107. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30108. n += this[e + --t] * r;
  30109. return n
  30110. }
  30111. ,
  30112. u.prototype.readUInt8 = function(e, t) {
  30113. return t || I(e, 1, this.length),
  30114. this[e]
  30115. }
  30116. ,
  30117. u.prototype.readUInt16LE = function(e, t) {
  30118. return t || I(e, 2, this.length),
  30119. this[e] | this[e + 1] << 8
  30120. }
  30121. ,
  30122. u.prototype.readUInt16BE = function(e, t) {
  30123. return t || I(e, 2, this.length),
  30124. this[e] << 8 | this[e + 1]
  30125. }
  30126. ,
  30127. u.prototype.readUInt32LE = function(e, t) {
  30128. return t || I(e, 4, this.length),
  30129. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30130. }
  30131. ,
  30132. u.prototype.readUInt32BE = function(e, t) {
  30133. return t || I(e, 4, this.length),
  30134. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30135. }
  30136. ,
  30137. u.prototype.readIntLE = function(e, t, i) {
  30138. e |= 0,
  30139. t |= 0,
  30140. i || I(e, t, this.length);
  30141. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30142. n += this[e + o] * r;
  30143. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30144. n
  30145. }
  30146. ,
  30147. u.prototype.readIntBE = function(e, t, i) {
  30148. e |= 0,
  30149. t |= 0,
  30150. i || I(e, t, this.length);
  30151. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30152. o += this[e + --n] * r;
  30153. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30154. o
  30155. }
  30156. ,
  30157. u.prototype.readInt8 = function(e, t) {
  30158. return t || I(e, 1, this.length),
  30159. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30160. }
  30161. ,
  30162. u.prototype.readInt16LE = function(e, t) {
  30163. t || I(e, 2, this.length);
  30164. var i = this[e] | this[e + 1] << 8;
  30165. return 32768 & i ? 4294901760 | i : i
  30166. }
  30167. ,
  30168. u.prototype.readInt16BE = function(e, t) {
  30169. t || I(e, 2, this.length);
  30170. var i = this[e + 1] | this[e] << 8;
  30171. return 32768 & i ? 4294901760 | i : i
  30172. }
  30173. ,
  30174. u.prototype.readInt32LE = function(e, t) {
  30175. return t || I(e, 4, this.length),
  30176. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30177. }
  30178. ,
  30179. u.prototype.readInt32BE = function(e, t) {
  30180. return t || I(e, 4, this.length),
  30181. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30182. }
  30183. ,
  30184. u.prototype.readFloatLE = function(e, t) {
  30185. return t || I(e, 4, this.length),
  30186. O.read(this, e, !0, 23, 4)
  30187. }
  30188. ,
  30189. u.prototype.readFloatBE = function(e, t) {
  30190. return t || I(e, 4, this.length),
  30191. O.read(this, e, !1, 23, 4)
  30192. }
  30193. ,
  30194. u.prototype.readDoubleLE = function(e, t) {
  30195. return t || I(e, 8, this.length),
  30196. O.read(this, e, !0, 52, 8)
  30197. }
  30198. ,
  30199. u.prototype.readDoubleBE = function(e, t) {
  30200. return t || I(e, 8, this.length),
  30201. O.read(this, e, !1, 52, 8)
  30202. }
  30203. ,
  30204. u.prototype.writeUIntLE = function(e, t, i, n) {
  30205. e = +e,
  30206. t |= 0,
  30207. i |= 0,
  30208. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30209. var r = 1
  30210. , o = 0;
  30211. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30212. this[t + o] = e / r & 255;
  30213. return t + i
  30214. }
  30215. ,
  30216. u.prototype.writeUIntBE = function(e, t, i, n) {
  30217. e = +e,
  30218. t |= 0,
  30219. i |= 0,
  30220. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30221. var r = i - 1
  30222. , o = 1;
  30223. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30224. this[t + r] = e / o & 255;
  30225. return t + i
  30226. }
  30227. ,
  30228. u.prototype.writeUInt8 = function(e, t, i) {
  30229. return e = +e,
  30230. t |= 0,
  30231. i || E(this, e, t, 1, 255, 0),
  30232. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30233. this[t] = 255 & e,
  30234. t + 1
  30235. }
  30236. ,
  30237. u.prototype.writeUInt16LE = function(e, t, i) {
  30238. return e = +e,
  30239. t |= 0,
  30240. i || E(this, e, t, 2, 65535, 0),
  30241. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30242. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30243. t + 2
  30244. }
  30245. ,
  30246. u.prototype.writeUInt16BE = function(e, t, i) {
  30247. return e = +e,
  30248. t |= 0,
  30249. i || E(this, e, t, 2, 65535, 0),
  30250. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30251. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30252. t + 2
  30253. }
  30254. ,
  30255. u.prototype.writeUInt32LE = function(e, t, i) {
  30256. return e = +e,
  30257. t |= 0,
  30258. i || E(this, e, t, 4, 4294967295, 0),
  30259. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30260. this[t + 2] = e >>> 16,
  30261. this[t + 1] = e >>> 8,
  30262. this[t] = 255 & e) : b(this, e, t, !0),
  30263. t + 4
  30264. }
  30265. ,
  30266. u.prototype.writeUInt32BE = function(e, t, i) {
  30267. return e = +e,
  30268. t |= 0,
  30269. i || E(this, e, t, 4, 4294967295, 0),
  30270. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30271. this[t + 1] = e >>> 16,
  30272. this[t + 2] = e >>> 8,
  30273. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30274. t + 4
  30275. }
  30276. ,
  30277. u.prototype.writeIntLE = function(e, t, i, n) {
  30278. if (e = +e,
  30279. t |= 0,
  30280. !n) {
  30281. var r = Math.pow(2, 8 * i - 1);
  30282. E(this, e, t, i, r - 1, -r)
  30283. }
  30284. var o = 0
  30285. , a = 1
  30286. , s = 0;
  30287. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30288. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30289. this[t + o] = (e / a >> 0) - s & 255;
  30290. return t + i
  30291. }
  30292. ,
  30293. u.prototype.writeIntBE = function(e, t, i, n) {
  30294. if (e = +e,
  30295. t |= 0,
  30296. !n) {
  30297. var r = Math.pow(2, 8 * i - 1);
  30298. E(this, e, t, i, r - 1, -r)
  30299. }
  30300. var o = i - 1
  30301. , a = 1
  30302. , s = 0;
  30303. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30304. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30305. this[t + o] = (e / a >> 0) - s & 255;
  30306. return t + i
  30307. }
  30308. ,
  30309. u.prototype.writeInt8 = function(e, t, i) {
  30310. return e = +e,
  30311. t |= 0,
  30312. i || E(this, e, t, 1, 127, -128),
  30313. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30314. e < 0 && (e = 255 + e + 1),
  30315. this[t] = 255 & e,
  30316. t + 1
  30317. }
  30318. ,
  30319. u.prototype.writeInt16LE = function(e, t, i) {
  30320. return e = +e,
  30321. t |= 0,
  30322. i || E(this, e, t, 2, 32767, -32768),
  30323. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30324. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30325. t + 2
  30326. }
  30327. ,
  30328. u.prototype.writeInt16BE = function(e, t, i) {
  30329. return e = +e,
  30330. t |= 0,
  30331. i || E(this, e, t, 2, 32767, -32768),
  30332. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30333. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30334. t + 2
  30335. }
  30336. ,
  30337. u.prototype.writeInt32LE = function(e, t, i) {
  30338. return e = +e,
  30339. t |= 0,
  30340. i || E(this, e, t, 4, 2147483647, -2147483648),
  30341. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30342. this[t + 1] = e >>> 8,
  30343. this[t + 2] = e >>> 16,
  30344. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30345. t + 4
  30346. }
  30347. ,
  30348. u.prototype.writeInt32BE = function(e, t, i) {
  30349. return e = +e,
  30350. t |= 0,
  30351. i || E(this, e, t, 4, 2147483647, -2147483648),
  30352. e < 0 && (e = 4294967295 + e + 1),
  30353. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30354. this[t + 1] = e >>> 16,
  30355. this[t + 2] = e >>> 8,
  30356. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30357. t + 4
  30358. }
  30359. ,
  30360. u.prototype.writeFloatLE = function(e, t, i) {
  30361. return T(this, e, t, !0, i)
  30362. }
  30363. ,
  30364. u.prototype.writeFloatBE = function(e, t, i) {
  30365. return T(this, e, t, !1, i)
  30366. }
  30367. ,
  30368. u.prototype.writeDoubleLE = function(e, t, i) {
  30369. return x(this, e, t, !0, i)
  30370. }
  30371. ,
  30372. u.prototype.writeDoubleBE = function(e, t, i) {
  30373. return x(this, e, t, !1, i)
  30374. }
  30375. ,
  30376. u.prototype.copy = function(e, t, i, n) {
  30377. if (i = i || 0,
  30378. n || 0 === n || (n = this.length),
  30379. t >= e.length && (t = e.length),
  30380. t = t || 0,
  30381. 0 < n && n < i && (n = i),
  30382. n === i)
  30383. return 0;
  30384. if (0 === e.length || 0 === this.length)
  30385. return 0;
  30386. if (t < 0)
  30387. throw new RangeError("targetStart out of bounds");
  30388. if (i < 0 || i >= this.length)
  30389. throw new RangeError("sourceStart out of bounds");
  30390. if (n < 0)
  30391. throw new RangeError("sourceEnd out of bounds");
  30392. n > this.length && (n = this.length),
  30393. e.length - t < n - i && (n = e.length - t + i);
  30394. var r, o = n - i;
  30395. if (this === e && i < t && t < n)
  30396. for (r = o - 1; 0 <= r; --r)
  30397. e[r + t] = this[r + i];
  30398. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30399. for (r = 0; r < o; ++r)
  30400. e[r + t] = this[r + i];
  30401. else
  30402. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30403. return o
  30404. }
  30405. ,
  30406. u.prototype.fill = function(e, t, i, n) {
  30407. if ("string" == typeof e) {
  30408. if ("string" == typeof t ? (n = t,
  30409. t = 0,
  30410. i = this.length) : "string" == typeof i && (n = i,
  30411. i = this.length),
  30412. 1 === e.length) {
  30413. var r = e.charCodeAt(0);
  30414. r < 256 && (e = r)
  30415. }
  30416. if (void 0 !== n && "string" != typeof n)
  30417. throw new TypeError("encoding must be a string");
  30418. if ("string" == typeof n && !u.isEncoding(n))
  30419. throw new TypeError("Unknown encoding: " + n)
  30420. } else
  30421. "number" == typeof e && (e &= 255);
  30422. if (t < 0 || this.length < t || this.length < i)
  30423. throw new RangeError("Out of range index");
  30424. if (i <= t)
  30425. return this;
  30426. var o;
  30427. if (t >>>= 0,
  30428. i = void 0 === i ? this.length : i >>> 0,
  30429. "number" == typeof (e = e || 0))
  30430. for (o = t; o < i; ++o)
  30431. this[o] = e;
  30432. else {
  30433. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30434. , s = a.length;
  30435. for (o = 0; o < i - t; ++o)
  30436. this[o + t] = a[o % s]
  30437. }
  30438. return this
  30439. }
  30440. ;
  30441. var t = /[^+\/0-9A-Za-z-_]/g
  30442. }
  30443. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30444. }
  30445. , {
  30446. "base64-js": 199,
  30447. ieee754: 200,
  30448. isarray: 201
  30449. }],
  30450. 199: [function(e, t, i) {
  30451. "use strict";
  30452. function l(e) {
  30453. var t = e.length;
  30454. if (0 < t % 4)
  30455. throw new Error("Invalid string. Length must be a multiple of 4");
  30456. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30457. }
  30458. function c(e, t, i) {
  30459. for (var n, r = [], o = t; o < i; o += 3)
  30460. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30461. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30462. var a;
  30463. return r.join("")
  30464. }
  30465. i.byteLength = function(e) {
  30466. return 3 * e.length / 4 - l(e)
  30467. }
  30468. ,
  30469. i.toByteArray = function(e) {
  30470. var t, i, n, r, o, a = e.length;
  30471. r = l(e),
  30472. o = new d(3 * a / 4 - r),
  30473. i = 0 < r ? a - 4 : a;
  30474. var s = 0;
  30475. for (t = 0; t < i; t += 4,
  30476. 3)
  30477. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30478. o[s++] = n >> 16 & 255,
  30479. o[s++] = n >> 8 & 255,
  30480. o[s++] = 255 & n;
  30481. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30482. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30483. o[s++] = n >> 8 & 255,
  30484. o[s++] = 255 & n),
  30485. o
  30486. }
  30487. ,
  30488. i.fromByteArray = function(e) {
  30489. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30490. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30491. return 1 == n ? (t = e[i - 1],
  30492. r += h[t >> 2],
  30493. r += h[t << 4 & 63],
  30494. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30495. r += h[t >> 10],
  30496. r += h[t >> 4 & 63],
  30497. r += h[t << 2 & 63],
  30498. r += "="),
  30499. o.push(r),
  30500. o.join("")
  30501. }
  30502. ;
  30503. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30504. h[r] = n[r],
  30505. u[n.charCodeAt(r)] = r;
  30506. u["-".charCodeAt(0)] = 62,
  30507. u["_".charCodeAt(0)] = 63
  30508. }
  30509. , {}],
  30510. 200: [function(e, t, i) {
  30511. i.read = function(e, t, i, n, r) {
  30512. 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];
  30513. for (u += d,
  30514. o = p & (1 << -h) - 1,
  30515. p >>= -h,
  30516. h += s; 0 < h; o = 256 * o + e[t + u],
  30517. u += d,
  30518. h -= 8)
  30519. ;
  30520. for (a = o & (1 << -h) - 1,
  30521. o >>= -h,
  30522. h += n; 0 < h; a = 256 * a + e[t + u],
  30523. u += d,
  30524. h -= 8)
  30525. ;
  30526. if (0 === o)
  30527. o = 1 - c;
  30528. else {
  30529. if (o === l)
  30530. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30531. a += Math.pow(2, n),
  30532. o -= c
  30533. }
  30534. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30535. }
  30536. ,
  30537. i.write = function(e, t, i, n, r, o) {
  30538. 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;
  30539. for (t = Math.abs(t),
  30540. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30541. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30542. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30543. l *= 2),
  30544. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30545. l /= 2),
  30546. h <= a + u ? (s = 0,
  30547. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30548. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30549. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30550. p += f,
  30551. s /= 256,
  30552. r -= 8)
  30553. ;
  30554. for (a = a << r | s,
  30555. c += r; 0 < c; e[i + p] = 255 & a,
  30556. p += f,
  30557. a /= 256,
  30558. c -= 8)
  30559. ;
  30560. e[i + p - f] |= 128 * g
  30561. }
  30562. }
  30563. , {}],
  30564. 201: [function(e, t, i) {
  30565. var n = {}.toString;
  30566. t.exports = Array.isArray || function(e) {
  30567. return "[object Array]" == n.call(e)
  30568. }
  30569. }
  30570. , {}],
  30571. 202: [function(e, t, i) {
  30572. function n() {
  30573. this._events = this._events || {},
  30574. this._maxListeners = this._maxListeners || void 0
  30575. }
  30576. function l(e) {
  30577. return "function" == typeof e
  30578. }
  30579. function c(e) {
  30580. return "object" == typeof e && null !== e
  30581. }
  30582. function h(e) {
  30583. return void 0 === e
  30584. }
  30585. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30586. n.prototype._maxListeners = void 0,
  30587. n.defaultMaxListeners = 10,
  30588. n.prototype.setMaxListeners = function(e) {
  30589. if (!function(e) {
  30590. return "number" == typeof e
  30591. }(e) || e < 0 || isNaN(e))
  30592. throw TypeError("n must be a positive number");
  30593. return this._maxListeners = e,
  30594. this
  30595. }
  30596. ,
  30597. n.prototype.emit = function(e) {
  30598. var t, i, n, r, o, a;
  30599. if (this._events || (this._events = {}),
  30600. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30601. if ((t = arguments[1])instanceof Error)
  30602. throw t;
  30603. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30604. throw s.context = t,
  30605. s
  30606. }
  30607. if (h(i = this._events[e]))
  30608. return !1;
  30609. if (l(i))
  30610. switch (arguments.length) {
  30611. case 1:
  30612. i.call(this);
  30613. break;
  30614. case 2:
  30615. i.call(this, arguments[1]);
  30616. break;
  30617. case 3:
  30618. i.call(this, arguments[1], arguments[2]);
  30619. break;
  30620. default:
  30621. r = Array.prototype.slice.call(arguments, 1),
  30622. i.apply(this, r)
  30623. }
  30624. else if (c(i))
  30625. for (r = Array.prototype.slice.call(arguments, 1),
  30626. n = (a = i.slice()).length,
  30627. o = 0; o < n; o++)
  30628. a[o].apply(this, r);
  30629. return !0
  30630. }
  30631. ,
  30632. n.prototype.on = n.prototype.addListener = function(e, t) {
  30633. var i;
  30634. if (!l(t))
  30635. throw TypeError("listener must be a function");
  30636. return this._events || (this._events = {}),
  30637. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30638. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30639. 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,
  30640. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30641. "function" == typeof console.trace && console.trace())),
  30642. this
  30643. }
  30644. ,
  30645. n.prototype.once = function(e, t) {
  30646. function i() {
  30647. this.removeListener(e, i),
  30648. n || (n = !0,
  30649. t.apply(this, arguments))
  30650. }
  30651. if (!l(t))
  30652. throw TypeError("listener must be a function");
  30653. var n = !1;
  30654. return i.listener = t,
  30655. this.on(e, i),
  30656. this
  30657. }
  30658. ,
  30659. n.prototype.removeListener = function(e, t) {
  30660. var i, n, r, o;
  30661. if (!l(t))
  30662. throw TypeError("listener must be a function");
  30663. if (!this._events || !this._events[e])
  30664. return this;
  30665. if (r = (i = this._events[e]).length,
  30666. n = -1,
  30667. i === t || l(i.listener) && i.listener === t)
  30668. delete this._events[e],
  30669. this._events.removeListener && this.emit("removeListener", e, t);
  30670. else if (c(i)) {
  30671. for (o = r; 0 < o--; )
  30672. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30673. n = o;
  30674. break
  30675. }
  30676. if (n < 0)
  30677. return this;
  30678. 1 === i.length ? (i.length = 0,
  30679. delete this._events[e]) : i.splice(n, 1),
  30680. this._events.removeListener && this.emit("removeListener", e, t)
  30681. }
  30682. return this
  30683. }
  30684. ,
  30685. n.prototype.removeAllListeners = function(e) {
  30686. var t, i;
  30687. if (!this._events)
  30688. return this;
  30689. if (!this._events.removeListener)
  30690. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30691. this;
  30692. if (0 === arguments.length) {
  30693. for (t in this._events)
  30694. "removeListener" !== t && this.removeAllListeners(t);
  30695. return this.removeAllListeners("removeListener"),
  30696. this._events = {},
  30697. this
  30698. }
  30699. if (l(i = this._events[e]))
  30700. this.removeListener(e, i);
  30701. else if (i)
  30702. for (; i.length; )
  30703. this.removeListener(e, i[i.length - 1]);
  30704. return delete this._events[e],
  30705. this
  30706. }
  30707. ,
  30708. n.prototype.listeners = function(e) {
  30709. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30710. }
  30711. ,
  30712. n.prototype.listenerCount = function(e) {
  30713. if (this._events) {
  30714. var t = this._events[e];
  30715. if (l(t))
  30716. return 1;
  30717. if (t)
  30718. return t.length
  30719. }
  30720. return 0
  30721. }
  30722. ,
  30723. n.listenerCount = function(e, t) {
  30724. return e.listenerCount(t)
  30725. }
  30726. }
  30727. , {}],
  30728. 203: [function(e, t, i) {
  30729. function n() {
  30730. throw new Error("setTimeout has not been defined")
  30731. }
  30732. function r() {
  30733. throw new Error("clearTimeout has not been defined")
  30734. }
  30735. function o(t) {
  30736. if (h === setTimeout)
  30737. return setTimeout(t, 0);
  30738. if ((h === n || !h) && setTimeout)
  30739. return h = setTimeout,
  30740. setTimeout(t, 0);
  30741. try {
  30742. return h(t, 0)
  30743. } catch (e) {
  30744. try {
  30745. return h.call(null, t, 0)
  30746. } catch (e) {
  30747. return h.call(this, t, 0)
  30748. }
  30749. }
  30750. }
  30751. function a() {
  30752. g && p && (g = !1,
  30753. p.length ? f = p.concat(f) : m = -1,
  30754. f.length && s())
  30755. }
  30756. function s() {
  30757. if (!g) {
  30758. var e = o(a);
  30759. g = !0;
  30760. for (var t = f.length; t; ) {
  30761. for (p = f,
  30762. f = []; ++m < t; )
  30763. p && p[m].run();
  30764. m = -1,
  30765. t = f.length
  30766. }
  30767. p = null,
  30768. g = !1,
  30769. function(t) {
  30770. if (u === clearTimeout)
  30771. return clearTimeout(t);
  30772. if ((u === r || !u) && clearTimeout)
  30773. return u = clearTimeout,
  30774. clearTimeout(t);
  30775. try {
  30776. u(t)
  30777. } catch (e) {
  30778. try {
  30779. return u.call(null, t)
  30780. } catch (e) {
  30781. return u.call(this, t)
  30782. }
  30783. }
  30784. }(e)
  30785. }
  30786. }
  30787. function l(e, t) {
  30788. this.fun = e,
  30789. this.array = t
  30790. }
  30791. function c() {}
  30792. var h, u, d = t.exports = {};
  30793. !function() {
  30794. try {
  30795. h = "function" == typeof setTimeout ? setTimeout : n
  30796. } catch (e) {
  30797. h = n
  30798. }
  30799. try {
  30800. u = "function" == typeof clearTimeout ? clearTimeout : r
  30801. } catch (e) {
  30802. u = r
  30803. }
  30804. }();
  30805. var p, f = [], g = !1, m = -1;
  30806. d.nextTick = function(e) {
  30807. var t = new Array(arguments.length - 1);
  30808. if (1 < arguments.length)
  30809. for (var i = 1; i < arguments.length; i++)
  30810. t[i - 1] = arguments[i];
  30811. f.push(new l(e,t)),
  30812. 1 !== f.length || g || o(s)
  30813. }
  30814. ,
  30815. l.prototype.run = function() {
  30816. this.fun.apply(null, this.array)
  30817. }
  30818. ,
  30819. d.title = "browser",
  30820. d.browser = !0,
  30821. d.env = {},
  30822. d.argv = [],
  30823. d.version = "",
  30824. d.versions = {},
  30825. d.on = c,
  30826. d.addListener = c,
  30827. d.once = c,
  30828. d.off = c,
  30829. d.removeListener = c,
  30830. d.removeAllListeners = c,
  30831. d.emit = c,
  30832. d.binding = function(e) {
  30833. throw new Error("process.binding is not supported")
  30834. }
  30835. ,
  30836. d.cwd = function() {
  30837. return "/"
  30838. }
  30839. ,
  30840. d.chdir = function(e) {
  30841. throw new Error("process.chdir is not supported")
  30842. }
  30843. ,
  30844. d.umask = function() {
  30845. return 0
  30846. }
  30847. }
  30848. , {}],
  30849. 204: [function(e, O, L) {
  30850. (function(P) {
  30851. !function(e) {
  30852. function v(e) {
  30853. throw new RangeError(g[e])
  30854. }
  30855. function r(e, t) {
  30856. for (var i = e.length, n = []; i--; )
  30857. n[i] = t(e[i]);
  30858. return n
  30859. }
  30860. function t(e, t) {
  30861. var i = e.split("@")
  30862. , n = "";
  30863. return 1 < i.length && (n = i[0] + "@",
  30864. e = i[1]),
  30865. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30866. }
  30867. function y(e) {
  30868. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30869. 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),
  30870. r--) : n.push(t);
  30871. return n
  30872. }
  30873. function A(e) {
  30874. return r(e, function(e) {
  30875. var t = "";
  30876. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30877. e = 56320 | 1023 & e),
  30878. t + R(e)
  30879. }).join("")
  30880. }
  30881. function C(e, t) {
  30882. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30883. }
  30884. function I(e, t, i) {
  30885. var n = 0;
  30886. for (e = i ? M(e / u) : e >> 1,
  30887. e += M(e / t); m * w >> 1 < e; n += _)
  30888. e = M(e / m);
  30889. return M(n + (m + 1) * e / (e + h))
  30890. }
  30891. function i(e) {
  30892. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30893. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30894. n = 0; n < i; ++n)
  30895. 128 <= e.charCodeAt(n) && v("not-basic"),
  30896. d.push(e.charCodeAt(n));
  30897. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30898. for (o = f,
  30899. a = 1,
  30900. s = _; p <= r && v("invalid-input"),
  30901. u = e.charCodeAt(r++),
  30902. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30903. f += l * a,
  30904. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30905. a > M(E / (h = _ - c)) && v("overflow"),
  30906. a *= h;
  30907. m = I(f - o, t = d.length + 1, 0 == o),
  30908. M(f / t) > E - g && v("overflow"),
  30909. g += M(f / t),
  30910. f %= t,
  30911. d.splice(f++, 0, g)
  30912. }
  30913. return A(d)
  30914. }
  30915. function n(e) {
  30916. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30917. for (d = (e = y(e)).length,
  30918. t = x,
  30919. o = T,
  30920. a = i = 0; a < d; ++a)
  30921. (u = e[a]) < 128 && m.push(R(u));
  30922. for (n = r = m.length,
  30923. r && m.push(S); n < d; ) {
  30924. for (s = E,
  30925. a = 0; a < d; ++a)
  30926. t <= (u = e[a]) && u < s && (s = u);
  30927. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30928. i += (s - t) * p,
  30929. t = s,
  30930. a = 0; a < d; ++a)
  30931. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30932. u == t) {
  30933. for (l = i,
  30934. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30935. g = l - h,
  30936. f = _ - h,
  30937. m.push(R(C(h + g % f, 0))),
  30938. l = M(g / f);
  30939. m.push(R(C(l, 0))),
  30940. o = I(i, p, n == r),
  30941. i = 0,
  30942. ++n
  30943. }
  30944. ++i,
  30945. ++t
  30946. }
  30947. return m.join("")
  30948. }
  30949. var o = "object" == typeof L && L && !L.nodeType && L
  30950. , a = "object" == typeof O && O && !O.nodeType && O
  30951. , s = "object" == typeof P && P;
  30952. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30953. 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 = {
  30954. overflow: "Overflow: input needs wider integers to process",
  30955. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30956. "invalid-input": "Invalid input"
  30957. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30958. if (l = {
  30959. version: "1.4.1",
  30960. ucs2: {
  30961. decode: y,
  30962. encode: A
  30963. },
  30964. decode: i,
  30965. encode: n,
  30966. toASCII: function(e) {
  30967. return t(e, function(e) {
  30968. return p.test(e) ? "xn--" + n(e) : e
  30969. })
  30970. },
  30971. toUnicode: function(e) {
  30972. return t(e, function(e) {
  30973. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30974. })
  30975. }
  30976. },
  30977. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30978. define("punycode", function() {
  30979. return l
  30980. });
  30981. else if (o && a)
  30982. if (O.exports == o)
  30983. a.exports = l;
  30984. else
  30985. for (c in l)
  30986. l.hasOwnProperty(c) && (o[c] = l[c]);
  30987. else
  30988. e.punycode = l
  30989. }(this)
  30990. }
  30991. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30992. }
  30993. , {}],
  30994. 205: [function(e, t, i) {
  30995. "use strict";
  30996. t.exports = function(e, t, i, n) {
  30997. t = t || "&",
  30998. i = i || "=";
  30999. var r = {};
  31000. if ("string" != typeof e || 0 === e.length)
  31001. return r;
  31002. var o = /\+/g;
  31003. e = e.split(t);
  31004. var a = 1e3;
  31005. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31006. var s, l, c = e.length;
  31007. 0 < a && a < c && (c = a);
  31008. for (var h = 0; h < c; ++h) {
  31009. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31010. d = 0 <= m ? (u = g.substr(0, m),
  31011. g.substr(m + 1)) : (u = g,
  31012. ""),
  31013. p = decodeURIComponent(u),
  31014. f = decodeURIComponent(d),
  31015. s = r,
  31016. l = p,
  31017. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31018. }
  31019. return r
  31020. }
  31021. ;
  31022. var v = Array.isArray || function(e) {
  31023. return "[object Array]" === Object.prototype.toString.call(e)
  31024. }
  31025. }
  31026. , {}],
  31027. 206: [function(e, t, i) {
  31028. "use strict";
  31029. function o(e, t) {
  31030. if (e.map)
  31031. return e.map(t);
  31032. for (var i = [], n = 0; n < e.length; n++)
  31033. i.push(t(e[n], n));
  31034. return i
  31035. }
  31036. function a(e) {
  31037. switch (typeof e) {
  31038. case "string":
  31039. return e;
  31040. case "boolean":
  31041. return e ? "true" : "false";
  31042. case "number":
  31043. return isFinite(e) ? e : "";
  31044. default:
  31045. return ""
  31046. }
  31047. }
  31048. t.exports = function(i, n, r, e) {
  31049. return n = n || "&",
  31050. r = r || "=",
  31051. null === i && (i = void 0),
  31052. "object" == typeof i ? o(l(i), function(e) {
  31053. var t = encodeURIComponent(a(e)) + r;
  31054. return s(i[e]) ? o(i[e], function(e) {
  31055. return t + encodeURIComponent(a(e))
  31056. }).join(n) : t + encodeURIComponent(a(i[e]))
  31057. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31058. }
  31059. ;
  31060. var s = Array.isArray || function(e) {
  31061. return "[object Array]" === Object.prototype.toString.call(e)
  31062. }
  31063. , l = Object.keys || function(e) {
  31064. var t = [];
  31065. for (var i in e)
  31066. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31067. return t
  31068. }
  31069. }
  31070. , {}],
  31071. 207: [function(e, t, i) {
  31072. "use strict";
  31073. i.decode = i.parse = e("./decode"),
  31074. i.encode = i.stringify = e("./encode")
  31075. }
  31076. , {
  31077. "./decode": 205,
  31078. "./encode": 206
  31079. }],
  31080. 208: [function(e, t, i) {
  31081. "use strict";
  31082. function x() {
  31083. this.protocol = null,
  31084. this.slashes = null,
  31085. this.auth = null,
  31086. this.host = null,
  31087. this.port = null,
  31088. this.hostname = null,
  31089. this.hash = null,
  31090. this.search = null,
  31091. this.query = null,
  31092. this.pathname = null,
  31093. this.path = null,
  31094. this.href = null
  31095. }
  31096. function n(e, t, i) {
  31097. if (e && D.isObject(e) && e instanceof x)
  31098. return e;
  31099. var n = new x;
  31100. return n.parse(e, t, i),
  31101. n
  31102. }
  31103. var L = e("punycode")
  31104. , D = e("./util");
  31105. i.parse = n,
  31106. i.resolve = function(e, t) {
  31107. return n(e, !1, !0).resolve(t)
  31108. }
  31109. ,
  31110. i.resolveObject = function(e, t) {
  31111. return e ? n(e, !1, !0).resolveObject(t) : t
  31112. }
  31113. ,
  31114. i.format = function(e) {
  31115. return D.isString(e) && (e = n(e)),
  31116. e instanceof x ? e.format() : x.prototype.format.call(e)
  31117. }
  31118. ,
  31119. i.Url = x;
  31120. var N = /^([a-z0-9.+-]+:)/i
  31121. , r = /:[0-9]*$/
  31122. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31123. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31124. , B = ["'"].concat(o)
  31125. , V = ["%", "/", "?", ";", "#"].concat(B)
  31126. , k = ["/", "?", "#"]
  31127. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31128. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31129. , z = {
  31130. javascript: !0,
  31131. "javascript:": !0
  31132. }
  31133. , G = {
  31134. javascript: !0,
  31135. "javascript:": !0
  31136. }
  31137. , W = {
  31138. http: !0,
  31139. https: !0,
  31140. ftp: !0,
  31141. gopher: !0,
  31142. file: !0,
  31143. "http:": !0,
  31144. "https:": !0,
  31145. "ftp:": !0,
  31146. "gopher:": !0,
  31147. "file:": !0
  31148. }
  31149. , j = e("querystring");
  31150. x.prototype.parse = function(e, t, i) {
  31151. if (!D.isString(e))
  31152. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31153. var n = e.indexOf("?")
  31154. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31155. , o = e.split(r);
  31156. o[0] = o[0].replace(/\\/g, "/");
  31157. var a = e = o.join(r);
  31158. if (a = a.trim(),
  31159. !i && 1 === e.split("#").length) {
  31160. var s = F.exec(a);
  31161. if (s)
  31162. return this.path = a,
  31163. this.href = a,
  31164. this.pathname = s[1],
  31165. s[2] ? (this.search = s[2],
  31166. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31167. this.query = {}),
  31168. this
  31169. }
  31170. var l = N.exec(a);
  31171. if (l) {
  31172. var c = (l = l[0]).toLowerCase();
  31173. this.protocol = c,
  31174. a = a.substr(l.length)
  31175. }
  31176. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31177. var h = "//" === a.substr(0, 2);
  31178. !h || l && G[l] || (a = a.substr(2),
  31179. this.slashes = !0)
  31180. }
  31181. if (!G[l] && (h || l && !W[l])) {
  31182. for (var u = -1, d = 0; d < k.length; d++) {
  31183. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31184. }
  31185. var p, f;
  31186. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31187. a = a.slice(f + 1),
  31188. this.auth = decodeURIComponent(p)),
  31189. u = -1;
  31190. for (d = 0; d < V.length; d++) {
  31191. var g;
  31192. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31193. }
  31194. -1 === u && (u = a.length),
  31195. this.host = a.slice(0, u),
  31196. a = a.slice(u),
  31197. this.parseHost(),
  31198. this.hostname = this.hostname || "";
  31199. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31200. if (!m)
  31201. for (var v = this.hostname.split(/\./), y = (d = 0,
  31202. v.length); d < y; d++) {
  31203. var A = v[d];
  31204. if (A && !A.match(U)) {
  31205. for (var C = "", I = 0, E = A.length; I < E; I++)
  31206. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31207. if (!C.match(U)) {
  31208. var _ = v.slice(0, d)
  31209. , b = v.slice(d + 1)
  31210. , w = A.match(H);
  31211. w && (_.push(w[1]),
  31212. b.unshift(w[2])),
  31213. b.length && (a = "/" + b.join(".") + a),
  31214. this.hostname = _.join(".");
  31215. break
  31216. }
  31217. }
  31218. }
  31219. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31220. m || (this.hostname = L.toASCII(this.hostname));
  31221. var T = this.port ? ":" + this.port : ""
  31222. , x = this.hostname || "";
  31223. this.host = x + T,
  31224. this.href += this.host,
  31225. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31226. "/" !== a[0] && (a = "/" + a))
  31227. }
  31228. if (!z[c])
  31229. for (d = 0,
  31230. y = B.length; d < y; d++) {
  31231. var S = B[d];
  31232. if (-1 !== a.indexOf(S)) {
  31233. var M = encodeURIComponent(S);
  31234. M === S && (M = escape(S)),
  31235. a = a.split(S).join(M)
  31236. }
  31237. }
  31238. var R = a.indexOf("#");
  31239. -1 !== R && (this.hash = a.substr(R),
  31240. a = a.slice(0, R));
  31241. var P = a.indexOf("?");
  31242. if (-1 !== P ? (this.search = a.substr(P),
  31243. this.query = a.substr(P + 1),
  31244. t && (this.query = j.parse(this.query)),
  31245. a = a.slice(0, P)) : t && (this.search = "",
  31246. this.query = {}),
  31247. a && (this.pathname = a),
  31248. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31249. this.pathname || this.search) {
  31250. T = this.pathname || "";
  31251. var O = this.search || "";
  31252. this.path = T + O
  31253. }
  31254. return this.href = this.format(),
  31255. this
  31256. }
  31257. ,
  31258. x.prototype.format = function() {
  31259. var e = this.auth || "";
  31260. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31261. e += "@");
  31262. var t = this.protocol || ""
  31263. , i = this.pathname || ""
  31264. , n = this.hash || ""
  31265. , r = !1
  31266. , o = "";
  31267. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31268. this.port && (r += ":" + this.port)),
  31269. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31270. var a = this.search || o && "?" + o || "";
  31271. return t && ":" !== t.substr(-1) && (t += ":"),
  31272. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31273. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31274. n && "#" !== n.charAt(0) && (n = "#" + n),
  31275. a && "?" !== a.charAt(0) && (a = "?" + a),
  31276. t + r + (i = i.replace(/[?#]/g, function(e) {
  31277. return encodeURIComponent(e)
  31278. })) + (a = a.replace("#", "%23")) + n
  31279. }
  31280. ,
  31281. x.prototype.resolve = function(e) {
  31282. return this.resolveObject(n(e, !1, !0)).format()
  31283. }
  31284. ,
  31285. x.prototype.resolveObject = function(e) {
  31286. if (D.isString(e)) {
  31287. var t = new x;
  31288. t.parse(e, !1, !0),
  31289. e = t
  31290. }
  31291. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31292. var o = n[r];
  31293. i[o] = this[o]
  31294. }
  31295. if (i.hash = e.hash,
  31296. "" === e.href)
  31297. return i.href = i.format(),
  31298. i;
  31299. if (e.slashes && !e.protocol) {
  31300. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31301. var l = a[s];
  31302. "protocol" !== l && (i[l] = e[l])
  31303. }
  31304. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31305. i.href = i.format(),
  31306. i
  31307. }
  31308. if (e.protocol && e.protocol !== i.protocol) {
  31309. if (!W[e.protocol]) {
  31310. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31311. var u = c[h];
  31312. i[u] = e[u]
  31313. }
  31314. return i.href = i.format(),
  31315. i
  31316. }
  31317. if (i.protocol = e.protocol,
  31318. e.host || G[e.protocol])
  31319. i.pathname = e.pathname;
  31320. else {
  31321. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31322. ;
  31323. e.host || (e.host = ""),
  31324. e.hostname || (e.hostname = ""),
  31325. "" !== d[0] && d.unshift(""),
  31326. d.length < 2 && d.unshift(""),
  31327. i.pathname = d.join("/")
  31328. }
  31329. if (i.search = e.search,
  31330. i.query = e.query,
  31331. i.host = e.host || "",
  31332. i.auth = e.auth,
  31333. i.hostname = e.hostname || e.host,
  31334. i.port = e.port,
  31335. i.pathname || i.search) {
  31336. var p = i.pathname || ""
  31337. , f = i.search || "";
  31338. i.path = p + f
  31339. }
  31340. return i.slashes = i.slashes || e.slashes,
  31341. i.href = i.format(),
  31342. i
  31343. }
  31344. var g = i.pathname && "/" === i.pathname.charAt(0)
  31345. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31346. , v = m || g || i.host && e.pathname
  31347. , y = v
  31348. , A = i.pathname && i.pathname.split("/") || []
  31349. , C = (d = e.pathname && e.pathname.split("/") || [],
  31350. i.protocol && !W[i.protocol]);
  31351. if (C && (i.hostname = "",
  31352. i.port = null,
  31353. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31354. i.host = "",
  31355. e.protocol && (e.hostname = null,
  31356. e.port = null,
  31357. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31358. e.host = null),
  31359. v = v && ("" === d[0] || "" === A[0])),
  31360. m)
  31361. i.host = e.host || "" === e.host ? e.host : i.host,
  31362. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31363. i.search = e.search,
  31364. i.query = e.query,
  31365. A = d;
  31366. else if (d.length)
  31367. (A = A || []).pop(),
  31368. A = A.concat(d),
  31369. i.search = e.search,
  31370. i.query = e.query;
  31371. else if (!D.isNullOrUndefined(e.search)) {
  31372. if (C)
  31373. i.hostname = i.host = A.shift(),
  31374. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31375. i.host = i.hostname = w.shift());
  31376. return i.search = e.search,
  31377. i.query = e.query,
  31378. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31379. i.href = i.format(),
  31380. i
  31381. }
  31382. if (!A.length)
  31383. return i.pathname = null,
  31384. i.search ? i.path = "/" + i.search : i.path = null,
  31385. i.href = i.format(),
  31386. i;
  31387. 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--)
  31388. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31389. _++) : _ && (A.splice(b, 1),
  31390. _--);
  31391. if (!v && !y)
  31392. for (; _--; )
  31393. A.unshift("..");
  31394. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31395. E && "/" !== A.join("/").substr(-1) && A.push("");
  31396. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31397. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31398. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31399. i.host = i.hostname = w.shift()));
  31400. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31401. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31402. i.path = null),
  31403. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31404. i.auth = e.auth || i.auth,
  31405. i.slashes = i.slashes || e.slashes,
  31406. i.href = i.format(),
  31407. i
  31408. }
  31409. ,
  31410. x.prototype.parseHost = function() {
  31411. var e = this.host
  31412. , t = r.exec(e);
  31413. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31414. e = e.substr(0, e.length - t.length)),
  31415. e && (this.hostname = e)
  31416. }
  31417. }
  31418. , {
  31419. "./util": 209,
  31420. punycode: 204,
  31421. querystring: 207
  31422. }],
  31423. 209: [function(e, t, i) {
  31424. "use strict";
  31425. t.exports = {
  31426. isString: function(e) {
  31427. return "string" == typeof e
  31428. },
  31429. isObject: function(e) {
  31430. return "object" == typeof e && null !== e
  31431. },
  31432. isNull: function(e) {
  31433. return null === e
  31434. },
  31435. isNullOrUndefined: function(e) {
  31436. return null == e
  31437. }
  31438. }
  31439. }
  31440. , {}],
  31441. 210: [function(e, t, i) {
  31442. "use strict";
  31443. function r(e) {
  31444. return c + e
  31445. }
  31446. function s(e) {
  31447. if ("string" != typeof e)
  31448. throw new TypeError("key must be a string.")
  31449. }
  31450. var l = Object.prototype.hasOwnProperty
  31451. , c = "~";
  31452. t.exports = function(t) {
  31453. var o = Object.create(null)
  31454. , n = 0
  31455. , a = {};
  31456. return function(e, t) {
  31457. for (var i in t)
  31458. Object.defineProperty(e, i, {
  31459. value: t[i],
  31460. configurable: !0,
  31461. writable: !0
  31462. })
  31463. }(a, {
  31464. get: function(e, t) {
  31465. s(e);
  31466. var i = r(e);
  31467. return i in o ? o[i] : t
  31468. },
  31469. set: function(e, t) {
  31470. s(e);
  31471. var i = r(e);
  31472. return i in o || ++n,
  31473. o[i] = t
  31474. },
  31475. has: function(e) {
  31476. return s(e),
  31477. r(e)in o
  31478. },
  31479. delete: function(e) {
  31480. s(e);
  31481. var t = r(e);
  31482. return t in o && (--n,
  31483. delete o[t],
  31484. !0)
  31485. },
  31486. clear: function() {
  31487. o = Object.create(null),
  31488. n = 0
  31489. },
  31490. forEach: function(e, t) {
  31491. if ("function" != typeof e)
  31492. throw new TypeError("`callback` must be a function");
  31493. for (var i in o)
  31494. if (l.call(o, i)) {
  31495. var n = i.substring(c.length)
  31496. , r = o[i];
  31497. e.call(t, r, n, a)
  31498. }
  31499. }
  31500. }),
  31501. Object.defineProperty(a, "size", {
  31502. get: function() {
  31503. return n
  31504. },
  31505. configurable: !0
  31506. }),
  31507. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31508. a.set(e, t[e])
  31509. }),
  31510. a
  31511. }
  31512. }
  31513. , {}],
  31514. 211: [function(e, t, i) {
  31515. t.exports = e("./lib/heap")
  31516. }
  31517. , {
  31518. "./lib/heap": 212
  31519. }],
  31520. 212: [function(e, y, A) {
  31521. (function() {
  31522. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31523. function v(e) {
  31524. this.cmp = null != e ? e : d,
  31525. this.nodes = []
  31526. }
  31527. l = Math.floor,
  31528. m = Math.min,
  31529. d = function(e, t) {
  31530. return e < t ? -1 : t < e ? 1 : 0
  31531. }
  31532. ,
  31533. g = function(e, t, i, n, r) {
  31534. var o;
  31535. if (null == i && (i = 0),
  31536. null == r && (r = d),
  31537. i < 0)
  31538. throw new Error("lo must be non-negative");
  31539. for (null == n && (n = e.length); i < n; )
  31540. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31541. return [].splice.apply(e, [i, i - i].concat(t)),
  31542. t
  31543. }
  31544. ,
  31545. t = function(e, t, i) {
  31546. return null == i && (i = d),
  31547. e.push(t),
  31548. h(e, 0, e.length - 1, i)
  31549. }
  31550. ,
  31551. f = function(e, t) {
  31552. var i, n;
  31553. return null == t && (t = d),
  31554. i = e.pop(),
  31555. e.length ? (n = e[0],
  31556. e[0] = i,
  31557. u(e, 0, t)) : n = i,
  31558. n
  31559. }
  31560. ,
  31561. i = function(e, t, i) {
  31562. var n;
  31563. return null == i && (i = d),
  31564. n = e[0],
  31565. e[0] = t,
  31566. u(e, 0, i),
  31567. n
  31568. }
  31569. ,
  31570. c = function(e, t, i) {
  31571. var n;
  31572. return null == i && (i = d),
  31573. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31574. e[0] = n[1],
  31575. u(e, 0, i)),
  31576. t
  31577. }
  31578. ,
  31579. p = function(i, e) {
  31580. var t, n, r, o, a, s;
  31581. for (null == e && (e = d),
  31582. a = [],
  31583. n = 0,
  31584. r = (o = function() {
  31585. s = [];
  31586. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31587. s.push(e);
  31588. return s
  31589. }
  31590. .apply(this).reverse()).length; n < r; n++)
  31591. t = o[n],
  31592. a.push(u(i, t, e));
  31593. return a
  31594. }
  31595. ,
  31596. o = function(e, t, i) {
  31597. var n;
  31598. if (null == i && (i = d),
  31599. -1 !== (n = e.indexOf(t)))
  31600. return h(e, 0, n, i),
  31601. u(e, n, i)
  31602. }
  31603. ,
  31604. n = function(e, t, i) {
  31605. var n, r, o, a, s;
  31606. if (null == i && (i = d),
  31607. !(r = e.slice(0, t)).length)
  31608. return r;
  31609. for (p(r, i),
  31610. o = 0,
  31611. a = (s = e.slice(t)).length; o < a; o++)
  31612. n = s[o],
  31613. c(r, n, i);
  31614. return r.sort(i).reverse()
  31615. }
  31616. ,
  31617. r = function(e, t, i) {
  31618. var n, r, o, a, s, l, c, h, u;
  31619. if (null == i && (i = d),
  31620. 10 * t <= e.length) {
  31621. if (!(o = e.slice(0, t).sort(i)).length)
  31622. return o;
  31623. for (r = o[o.length - 1],
  31624. a = 0,
  31625. l = (c = e.slice(t)).length; a < l; a++)
  31626. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31627. o.pop(),
  31628. r = o[o.length - 1]);
  31629. return o
  31630. }
  31631. for (p(e, i),
  31632. u = [],
  31633. s = 0,
  31634. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31635. u.push(f(e, i));
  31636. return u
  31637. }
  31638. ,
  31639. h = function(e, t, i, n) {
  31640. var r, o, a;
  31641. for (null == n && (n = d),
  31642. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31643. e[i] = o,
  31644. i = a;
  31645. return e[i] = r
  31646. }
  31647. ,
  31648. u = function(e, t, i) {
  31649. var n, r, o, a, s;
  31650. for (null == i && (i = d),
  31651. r = e.length,
  31652. o = e[s = t],
  31653. n = 2 * t + 1; n < r; )
  31654. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31655. e[t] = e[n],
  31656. n = 2 * (t = n) + 1;
  31657. return e[t] = o,
  31658. h(e, s, t, i)
  31659. }
  31660. ,
  31661. v.push = t,
  31662. v.pop = f,
  31663. v.replace = i,
  31664. v.pushpop = c,
  31665. v.heapify = p,
  31666. v.updateItem = o,
  31667. v.nlargest = n,
  31668. v.nsmallest = r,
  31669. v.prototype.push = function(e) {
  31670. return t(this.nodes, e, this.cmp)
  31671. }
  31672. ,
  31673. v.prototype.pop = function() {
  31674. return f(this.nodes, this.cmp)
  31675. }
  31676. ,
  31677. v.prototype.peek = function() {
  31678. return this.nodes[0]
  31679. }
  31680. ,
  31681. v.prototype.contains = function(e) {
  31682. return -1 !== this.nodes.indexOf(e)
  31683. }
  31684. ,
  31685. v.prototype.replace = function(e) {
  31686. return i(this.nodes, e, this.cmp)
  31687. }
  31688. ,
  31689. v.prototype.pushpop = function(e) {
  31690. return c(this.nodes, e, this.cmp)
  31691. }
  31692. ,
  31693. v.prototype.heapify = function() {
  31694. return p(this.nodes, this.cmp)
  31695. }
  31696. ,
  31697. v.prototype.updateItem = function(e) {
  31698. return o(this.nodes, e, this.cmp)
  31699. }
  31700. ,
  31701. v.prototype.clear = function() {
  31702. return this.nodes = []
  31703. }
  31704. ,
  31705. v.prototype.empty = function() {
  31706. return 0 === this.nodes.length
  31707. }
  31708. ,
  31709. v.prototype.size = function() {
  31710. return this.nodes.length
  31711. }
  31712. ,
  31713. v.prototype.clone = function() {
  31714. var e;
  31715. return (e = new v).nodes = this.nodes.slice(0),
  31716. e
  31717. }
  31718. ,
  31719. v.prototype.toArray = function() {
  31720. return this.nodes.slice(0)
  31721. }
  31722. ,
  31723. v.prototype.insert = v.prototype.push,
  31724. v.prototype.top = v.prototype.peek,
  31725. v.prototype.front = v.prototype.peek,
  31726. v.prototype.has = v.prototype.contains,
  31727. v.prototype.copy = v.prototype.clone,
  31728. e = v,
  31729. a = this,
  31730. s = function() {
  31731. return e
  31732. }
  31733. ,
  31734. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31735. }
  31736. ).call(this)
  31737. }
  31738. , {}],
  31739. 213: [function(e, t, i) {
  31740. function n() {}
  31741. function o(e) {
  31742. if ("object" != typeof this)
  31743. throw new TypeError("Promises must be constructed via new");
  31744. if ("function" != typeof e)
  31745. throw new TypeError("not a function");
  31746. this._state = 0,
  31747. this._handled = !1,
  31748. this._value = void 0,
  31749. this._deferreds = [],
  31750. h(e, this)
  31751. }
  31752. function r(i, n) {
  31753. for (; 3 === i._state; )
  31754. i = i._value;
  31755. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31756. void o._immediateFn(function() {
  31757. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31758. if (null !== e) {
  31759. var t;
  31760. try {
  31761. t = e(i._value)
  31762. } catch (e) {
  31763. return void s(n.promise, e)
  31764. }
  31765. a(n.promise, t)
  31766. } else
  31767. (1 === i._state ? a : s)(n.promise, i._value)
  31768. }))
  31769. }
  31770. function a(e, t) {
  31771. try {
  31772. if (t === e)
  31773. throw new TypeError("A promise cannot be resolved with itself.");
  31774. if (t && ("object" == typeof t || "function" == typeof t)) {
  31775. var i = t.then;
  31776. if (t instanceof o)
  31777. return e._state = 3,
  31778. e._value = t,
  31779. void l(e);
  31780. if ("function" == typeof i)
  31781. return void h(function(e, t) {
  31782. return function() {
  31783. e.apply(t, arguments)
  31784. }
  31785. }(i, t), e)
  31786. }
  31787. e._state = 1,
  31788. e._value = t,
  31789. l(e)
  31790. } catch (t) {
  31791. s(e, t)
  31792. }
  31793. }
  31794. function s(e, t) {
  31795. e._state = 2,
  31796. e._value = t,
  31797. l(e)
  31798. }
  31799. function l(e) {
  31800. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31801. e._handled || o._unhandledRejectionFn(e._value)
  31802. });
  31803. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31804. r(e, e._deferreds[t]);
  31805. e._deferreds = null
  31806. }
  31807. function c(e, t, i) {
  31808. this.onFulfilled = "function" == typeof e ? e : null,
  31809. this.onRejected = "function" == typeof t ? t : null,
  31810. this.promise = i
  31811. }
  31812. function h(e, t) {
  31813. var i = !1;
  31814. try {
  31815. e(function(e) {
  31816. i || (i = !0,
  31817. a(t, e))
  31818. }, function(e) {
  31819. i || (i = !0,
  31820. s(t, e))
  31821. })
  31822. } catch (e) {
  31823. if (i)
  31824. return;
  31825. i = !0,
  31826. s(t, e)
  31827. }
  31828. }
  31829. var u, d;
  31830. u = this,
  31831. d = setTimeout,
  31832. o.prototype.catch = function(e) {
  31833. return this.then(null, e)
  31834. }
  31835. ,
  31836. o.prototype.then = function(e, t) {
  31837. var i = new this.constructor(n);
  31838. return r(this, new c(e,t,i)),
  31839. i
  31840. }
  31841. ,
  31842. o.all = function(e) {
  31843. var s = Array.prototype.slice.call(e);
  31844. return new o(function(n, r) {
  31845. function o(t, e) {
  31846. try {
  31847. if (e && ("object" == typeof e || "function" == typeof e)) {
  31848. var i = e.then;
  31849. if ("function" == typeof i)
  31850. return void i.call(e, function(e) {
  31851. o(t, e)
  31852. }, r)
  31853. }
  31854. s[t] = e,
  31855. 0 == --a && n(s)
  31856. } catch (e) {
  31857. r(e)
  31858. }
  31859. }
  31860. if (0 === s.length)
  31861. return n([]);
  31862. for (var a = s.length, e = 0; e < s.length; e++)
  31863. o(e, s[e])
  31864. }
  31865. )
  31866. }
  31867. ,
  31868. o.resolve = function(t) {
  31869. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31870. e(t)
  31871. }
  31872. )
  31873. }
  31874. ,
  31875. o.reject = function(i) {
  31876. return new o(function(e, t) {
  31877. t(i)
  31878. }
  31879. )
  31880. }
  31881. ,
  31882. o.race = function(r) {
  31883. return new o(function(e, t) {
  31884. for (var i = 0, n = r.length; i < n; i++)
  31885. r[i].then(e, t)
  31886. }
  31887. )
  31888. }
  31889. ,
  31890. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31891. setImmediate(e)
  31892. }
  31893. || function(e) {
  31894. d(e, 0)
  31895. }
  31896. ,
  31897. o._unhandledRejectionFn = function(e) {
  31898. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31899. }
  31900. ,
  31901. o._setImmediateFn = function(e) {
  31902. o._immediateFn = e
  31903. }
  31904. ,
  31905. o._setUnhandledRejectionFn = function(e) {
  31906. o._unhandledRejectionFn = e
  31907. }
  31908. ,
  31909. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31910. }
  31911. , {}],
  31912. 214: [function(p, i, e) {
  31913. (function(d) {
  31914. var e, t;
  31915. e = this,
  31916. t = function(I, e) {
  31917. "use strict";
  31918. var a, t, u, i, s, n, r, o = {};
  31919. return o.ByteBuffer = I,
  31920. o.Long = I.Long || null,
  31921. o.VERSION = "5.0.1",
  31922. o.WIRE_TYPES = {},
  31923. o.WIRE_TYPES.VARINT = 0,
  31924. o.WIRE_TYPES.BITS64 = 1,
  31925. o.WIRE_TYPES.LDELIM = 2,
  31926. o.WIRE_TYPES.STARTGROUP = 3,
  31927. o.WIRE_TYPES.ENDGROUP = 4,
  31928. o.WIRE_TYPES.BITS32 = 5,
  31929. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31930. o.TYPES = {
  31931. int32: {
  31932. name: "int32",
  31933. wireType: o.WIRE_TYPES.VARINT,
  31934. defaultValue: 0
  31935. },
  31936. uint32: {
  31937. name: "uint32",
  31938. wireType: o.WIRE_TYPES.VARINT,
  31939. defaultValue: 0
  31940. },
  31941. sint32: {
  31942. name: "sint32",
  31943. wireType: o.WIRE_TYPES.VARINT,
  31944. defaultValue: 0
  31945. },
  31946. int64: {
  31947. name: "int64",
  31948. wireType: o.WIRE_TYPES.VARINT,
  31949. defaultValue: o.Long ? o.Long.ZERO : void 0
  31950. },
  31951. uint64: {
  31952. name: "uint64",
  31953. wireType: o.WIRE_TYPES.VARINT,
  31954. defaultValue: o.Long ? o.Long.UZERO : void 0
  31955. },
  31956. sint64: {
  31957. name: "sint64",
  31958. wireType: o.WIRE_TYPES.VARINT,
  31959. defaultValue: o.Long ? o.Long.ZERO : void 0
  31960. },
  31961. bool: {
  31962. name: "bool",
  31963. wireType: o.WIRE_TYPES.VARINT,
  31964. defaultValue: !1
  31965. },
  31966. double: {
  31967. name: "double",
  31968. wireType: o.WIRE_TYPES.BITS64,
  31969. defaultValue: 0
  31970. },
  31971. string: {
  31972. name: "string",
  31973. wireType: o.WIRE_TYPES.LDELIM,
  31974. defaultValue: ""
  31975. },
  31976. bytes: {
  31977. name: "bytes",
  31978. wireType: o.WIRE_TYPES.LDELIM,
  31979. defaultValue: null
  31980. },
  31981. fixed32: {
  31982. name: "fixed32",
  31983. wireType: o.WIRE_TYPES.BITS32,
  31984. defaultValue: 0
  31985. },
  31986. sfixed32: {
  31987. name: "sfixed32",
  31988. wireType: o.WIRE_TYPES.BITS32,
  31989. defaultValue: 0
  31990. },
  31991. fixed64: {
  31992. name: "fixed64",
  31993. wireType: o.WIRE_TYPES.BITS64,
  31994. defaultValue: o.Long ? o.Long.UZERO : void 0
  31995. },
  31996. sfixed64: {
  31997. name: "sfixed64",
  31998. wireType: o.WIRE_TYPES.BITS64,
  31999. defaultValue: o.Long ? o.Long.ZERO : void 0
  32000. },
  32001. float: {
  32002. name: "float",
  32003. wireType: o.WIRE_TYPES.BITS32,
  32004. defaultValue: 0
  32005. },
  32006. enum: {
  32007. name: "enum",
  32008. wireType: o.WIRE_TYPES.VARINT,
  32009. defaultValue: 0
  32010. },
  32011. message: {
  32012. name: "message",
  32013. wireType: o.WIRE_TYPES.LDELIM,
  32014. defaultValue: null
  32015. },
  32016. group: {
  32017. name: "group",
  32018. wireType: o.WIRE_TYPES.STARTGROUP,
  32019. defaultValue: null
  32020. }
  32021. },
  32022. 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],
  32023. o.ID_MIN = 1,
  32024. o.ID_MAX = 536870911,
  32025. o.convertFieldsToCamelCase = !1,
  32026. o.populateAccessors = !0,
  32027. o.populateDefaults = !0,
  32028. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32029. r.XHR = function() {
  32030. for (var e = [function() {
  32031. return new XMLHttpRequest
  32032. }
  32033. , function() {
  32034. return new ActiveXObject("Msxml2.XMLHTTP")
  32035. }
  32036. , function() {
  32037. return new ActiveXObject("Msxml3.XMLHTTP")
  32038. }
  32039. , function() {
  32040. return new ActiveXObject("Microsoft.XMLHTTP")
  32041. }
  32042. ], t = null, i = 0; i < e.length; i++) {
  32043. try {
  32044. t = e[i]()
  32045. } catch (e) {
  32046. continue
  32047. }
  32048. break
  32049. }
  32050. if (!t)
  32051. throw Error("XMLHttpRequest is not supported");
  32052. return t
  32053. }
  32054. ,
  32055. r.fetch = function(e, i) {
  32056. if (i && "function" != typeof i && (i = null),
  32057. r.IS_NODE) {
  32058. var t = p("fs");
  32059. if (i)
  32060. t.readFile(e, function(e, t) {
  32061. i(e ? null : "" + t)
  32062. });
  32063. else
  32064. try {
  32065. return t.readFileSync(e)
  32066. } catch (e) {
  32067. return null
  32068. }
  32069. } else {
  32070. var n = r.XHR();
  32071. if (n.open("GET", e, !!i),
  32072. n.setRequestHeader("Accept", "text/plain"),
  32073. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32074. !i)
  32075. return n.send(null),
  32076. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32077. if (n.onreadystatechange = function() {
  32078. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32079. }
  32080. ,
  32081. 4 == n.readyState)
  32082. return;
  32083. n.send(null)
  32084. }
  32085. }
  32086. ,
  32087. r.toCamelCase = function(e) {
  32088. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32089. return t.toUpperCase()
  32090. })
  32091. }
  32092. ,
  32093. r),
  32094. o.Lang = {
  32095. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32096. RULE: /^(?:required|optional|repeated|map)$/,
  32097. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32098. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32099. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32100. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32101. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32102. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32103. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32104. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32105. NUMBER_OCT: /^0[0-7]+$/,
  32106. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32107. BOOL: /^(?:true|false)$/i,
  32108. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32109. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32110. WHITESPACE: /\s/,
  32111. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32112. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32113. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32114. },
  32115. o.DotProto = function(r, a) {
  32116. function s(e, t) {
  32117. var i = -1
  32118. , n = 1;
  32119. if ("-" == e.charAt(0) && (n = -1,
  32120. e = e.substring(1)),
  32121. a.NUMBER_DEC.test(e))
  32122. i = parseInt(e);
  32123. else if (a.NUMBER_HEX.test(e))
  32124. i = parseInt(e.substring(2), 16);
  32125. else {
  32126. if (!a.NUMBER_OCT.test(e))
  32127. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32128. i = parseInt(e.substring(1), 8)
  32129. }
  32130. if (i = n * i | 0,
  32131. !t && i < 0)
  32132. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32133. return i
  32134. }
  32135. function o(e) {
  32136. var t = 1;
  32137. if ("-" == e.charAt(0) && (t = -1,
  32138. e = e.substring(1)),
  32139. a.NUMBER_DEC.test(e))
  32140. return t * parseInt(e, 10);
  32141. if (a.NUMBER_HEX.test(e))
  32142. return t * parseInt(e.substring(2), 16);
  32143. if (a.NUMBER_OCT.test(e))
  32144. return t * parseInt(e.substring(1), 8);
  32145. if ("inf" === e)
  32146. return t * (1 / 0);
  32147. if ("nan" === e)
  32148. return NaN;
  32149. if (a.NUMBER_FLT.test(e))
  32150. return t * parseFloat(e);
  32151. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32152. }
  32153. function n(e, t, i) {
  32154. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32155. e[t].push(i))
  32156. }
  32157. function t(e) {
  32158. this.source = e + "",
  32159. this.index = 0,
  32160. this.line = 1,
  32161. this.stack = [],
  32162. this._stringOpen = null
  32163. }
  32164. var e = {}
  32165. , i = t.prototype;
  32166. i._readString = function() {
  32167. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32168. e.lastIndex = this.index - 1;
  32169. var t = e.exec(this.source);
  32170. if (!t)
  32171. throw Error("unterminated string");
  32172. return this.index = e.lastIndex,
  32173. this.stack.push(this._stringOpen),
  32174. this._stringOpen = null,
  32175. t[1]
  32176. }
  32177. ,
  32178. i.next = function() {
  32179. if (0 < this.stack.length)
  32180. return this.stack.shift();
  32181. if (this.index >= this.source.length)
  32182. return null;
  32183. if (null !== this._stringOpen)
  32184. return this._readString();
  32185. var e, t, i;
  32186. do {
  32187. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32188. if ("\n" === i && ++this.line,
  32189. ++this.index === this.source.length)
  32190. return null;
  32191. if ("/" === this.source.charAt(this.index))
  32192. if (++this.index,
  32193. "/" === this.source.charAt(this.index)) {
  32194. for (; "\n" !== this.source.charAt(++this.index); )
  32195. if (this.index == this.source.length)
  32196. return null;
  32197. ++this.index,
  32198. ++this.line,
  32199. e = !0
  32200. } else {
  32201. if ("*" !== (i = this.source.charAt(this.index)))
  32202. return "/";
  32203. do {
  32204. if ("\n" === i && ++this.line,
  32205. ++this.index === this.source.length)
  32206. return null;
  32207. t = i,
  32208. i = this.source.charAt(this.index)
  32209. } while ("*" !== t || "/" !== i);++this.index,
  32210. e = !0
  32211. }
  32212. } while (e);if (this.index === this.source.length)
  32213. return null;
  32214. var n = this.index;
  32215. if (a.DELIM.lastIndex = 0,
  32216. !a.DELIM.test(this.source.charAt(n++)))
  32217. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32218. ++n;
  32219. var r = this.source.substring(this.index, this.index = n);
  32220. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32221. r
  32222. }
  32223. ,
  32224. i.peek = function() {
  32225. if (0 === this.stack.length) {
  32226. var e = this.next();
  32227. if (null === e)
  32228. return null;
  32229. this.stack.push(e)
  32230. }
  32231. return this.stack[0]
  32232. }
  32233. ,
  32234. i.skip = function(e) {
  32235. var t = this.next();
  32236. if (t !== e)
  32237. throw Error("illegal '" + t + "', '" + e + "' expected")
  32238. }
  32239. ,
  32240. i.omit = function(e) {
  32241. return this.peek() === e && (this.next(),
  32242. !0)
  32243. }
  32244. ,
  32245. i.toString = function() {
  32246. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32247. }
  32248. ,
  32249. e.Tokenizer = t;
  32250. function l(e) {
  32251. this.tn = new t(e),
  32252. this.proto3 = !1
  32253. }
  32254. var c = l.prototype;
  32255. return c.parse = function() {
  32256. var e, t, i = {
  32257. name: "[ROOT]",
  32258. package: null,
  32259. messages: [],
  32260. enums: [],
  32261. imports: [],
  32262. options: {},
  32263. services: []
  32264. }, n = !0;
  32265. try {
  32266. for (; e = this.tn.next(); )
  32267. switch (e) {
  32268. case "package":
  32269. if (!n || null !== i.package)
  32270. throw Error("unexpected 'package'");
  32271. if (e = this.tn.next(),
  32272. !a.TYPEREF.test(e))
  32273. throw Error("illegal package name: " + e);
  32274. this.tn.skip(";"),
  32275. i.package = e;
  32276. break;
  32277. case "import":
  32278. if (!n)
  32279. throw Error("unexpected 'import'");
  32280. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32281. e = this._readString(),
  32282. this.tn.skip(";"),
  32283. t || i.imports.push(e);
  32284. break;
  32285. case "syntax":
  32286. if (!n)
  32287. throw Error("unexpected 'syntax'");
  32288. this.tn.skip("="),
  32289. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32290. this.tn.skip(";");
  32291. break;
  32292. case "message":
  32293. this._parseMessage(i, null),
  32294. n = !1;
  32295. break;
  32296. case "enum":
  32297. this._parseEnum(i),
  32298. n = !1;
  32299. break;
  32300. case "option":
  32301. this._parseOption(i);
  32302. break;
  32303. case "service":
  32304. this._parseService(i);
  32305. break;
  32306. case "extend":
  32307. this._parseExtend(i);
  32308. break;
  32309. default:
  32310. throw Error("unexpected '" + e + "'")
  32311. }
  32312. } catch (e) {
  32313. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32314. e
  32315. }
  32316. return delete i.name,
  32317. i
  32318. }
  32319. ,
  32320. l.parse = function(e) {
  32321. return new l(e).parse()
  32322. }
  32323. ,
  32324. c._readString = function() {
  32325. var e, t, i = "";
  32326. do {
  32327. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32328. throw Error("illegal string delimiter: " + t);
  32329. i += this.tn.next(),
  32330. this.tn.skip(t),
  32331. e = this.tn.peek()
  32332. } while ('"' === e || '"' === e);return i
  32333. }
  32334. ,
  32335. c._readValue = function(e) {
  32336. var t = this.tn.peek();
  32337. if ('"' === t || "'" === t)
  32338. return this._readString();
  32339. if (this.tn.next(),
  32340. a.NUMBER.test(t))
  32341. return o(t);
  32342. if (a.BOOL.test(t))
  32343. return "true" === t.toLowerCase();
  32344. if (e && a.TYPEREF.test(t))
  32345. return t;
  32346. throw Error("illegal value: " + t)
  32347. }
  32348. ,
  32349. c._parseOption = function(e, t) {
  32350. var i = this.tn.next()
  32351. , n = !1;
  32352. if ("(" === i && (n = !0,
  32353. i = this.tn.next()),
  32354. !a.TYPEREF.test(i))
  32355. throw Error("illegal option name: " + i);
  32356. var r = i;
  32357. n && (this.tn.skip(")"),
  32358. r = "(" + r + ")",
  32359. i = this.tn.peek(),
  32360. a.FQTYPEREF.test(i) && (r += i,
  32361. this.tn.next())),
  32362. this.tn.skip("="),
  32363. this._parseOptionValue(e, r),
  32364. t || this.tn.skip(";")
  32365. }
  32366. ,
  32367. c._parseOptionValue = function(e, t) {
  32368. var i = this.tn.peek();
  32369. if ("{" !== i)
  32370. n(e.options, t, this._readValue(!0));
  32371. else
  32372. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32373. if (!a.NAME.test(i))
  32374. throw Error("illegal option name: " + t + "." + i);
  32375. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32376. }
  32377. }
  32378. ,
  32379. c._parseService = function(e) {
  32380. var t = this.tn.next();
  32381. if (!a.NAME.test(t))
  32382. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32383. var i = {
  32384. name: t,
  32385. rpc: {},
  32386. options: {}
  32387. };
  32388. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32389. if ("option" === t)
  32390. this._parseOption(i);
  32391. else {
  32392. if ("rpc" !== t)
  32393. throw Error("illegal service token: " + t);
  32394. this._parseServiceRPC(i)
  32395. }
  32396. this.tn.omit(";"),
  32397. e.services.push(i)
  32398. }
  32399. ,
  32400. c._parseServiceRPC = function(e) {
  32401. var t = this.tn.next();
  32402. if (!a.NAME.test(t))
  32403. throw Error("illegal rpc service method name: " + t);
  32404. var i = t
  32405. , n = {
  32406. request: null,
  32407. response: null,
  32408. request_stream: !1,
  32409. response_stream: !1,
  32410. options: {}
  32411. };
  32412. if (this.tn.skip("("),
  32413. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32414. t = this.tn.next()),
  32415. !a.TYPEREF.test(t))
  32416. throw Error("illegal rpc service request type: " + t);
  32417. if (n.request = t,
  32418. this.tn.skip(")"),
  32419. "returns" !== (t = this.tn.next()).toLowerCase())
  32420. throw Error("illegal rpc service request type delimiter: " + t);
  32421. if (this.tn.skip("("),
  32422. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32423. t = this.tn.next()),
  32424. n.response = t,
  32425. this.tn.skip(")"),
  32426. "{" === (t = this.tn.peek())) {
  32427. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32428. if ("option" !== t)
  32429. throw Error("illegal rpc service token: " + t);
  32430. this._parseOption(n)
  32431. }
  32432. this.tn.omit(";")
  32433. } else
  32434. this.tn.skip(";");
  32435. void 0 === e.rpc && (e.rpc = {}),
  32436. e.rpc[i] = n
  32437. }
  32438. ,
  32439. c._parseMessage = function(e, t) {
  32440. var i = !!t
  32441. , n = this.tn.next()
  32442. , r = {
  32443. name: "",
  32444. fields: [],
  32445. enums: [],
  32446. messages: [],
  32447. options: {},
  32448. services: [],
  32449. oneofs: {}
  32450. };
  32451. if (!a.NAME.test(n))
  32452. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32453. for (r.name = n,
  32454. i && (this.tn.skip("="),
  32455. t.id = s(this.tn.next()),
  32456. r.isGroup = !0),
  32457. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32458. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32459. if (a.RULE.test(n))
  32460. this._parseMessageField(r, n);
  32461. else if ("oneof" === n)
  32462. this._parseMessageOneOf(r);
  32463. else if ("enum" === n)
  32464. this._parseEnum(r);
  32465. else if ("message" === n)
  32466. this._parseMessage(r);
  32467. else if ("option" === n)
  32468. this._parseOption(r);
  32469. else if ("service" === n)
  32470. this._parseService(r);
  32471. else if ("extensions" === n)
  32472. r.extensions = this._parseExtensionRanges();
  32473. else if ("reserved" === n)
  32474. this._parseIgnored();
  32475. else if ("extend" === n)
  32476. this._parseExtend(r);
  32477. else {
  32478. if (!a.TYPEREF.test(n))
  32479. throw Error("illegal message token: " + n);
  32480. if (!this.proto3)
  32481. throw Error("illegal field rule: " + n);
  32482. this._parseMessageField(r, "optional", n)
  32483. }
  32484. return this.tn.omit(";"),
  32485. e.messages.push(r),
  32486. r
  32487. }
  32488. ,
  32489. c._parseIgnored = function() {
  32490. for (; ";" !== this.tn.peek(); )
  32491. this.tn.next();
  32492. this.tn.skip(";")
  32493. }
  32494. ,
  32495. c._parseMessageField = function(e, t, i) {
  32496. if (!a.RULE.test(t))
  32497. throw Error("illegal message field rule: " + t);
  32498. var n, r = {
  32499. rule: t,
  32500. type: "",
  32501. name: "",
  32502. options: {},
  32503. id: 0
  32504. };
  32505. if ("map" === t) {
  32506. if (i)
  32507. throw Error("illegal type: " + i);
  32508. if (this.tn.skip("<"),
  32509. n = this.tn.next(),
  32510. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32511. throw Error("illegal message field type: " + n);
  32512. if (r.keytype = n,
  32513. this.tn.skip(","),
  32514. n = this.tn.next(),
  32515. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32516. throw Error("illegal message field: " + n);
  32517. if (r.type = n,
  32518. this.tn.skip(">"),
  32519. n = this.tn.next(),
  32520. !a.NAME.test(n))
  32521. throw Error("illegal message field name: " + n);
  32522. r.name = n,
  32523. this.tn.skip("="),
  32524. r.id = s(this.tn.next()),
  32525. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32526. this.tn.skip(";")
  32527. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32528. var o = this._parseMessage(e, r);
  32529. if (!/^[A-Z]/.test(o.name))
  32530. throw Error("illegal group name: " + o.name);
  32531. r.type = o.name,
  32532. r.name = o.name.toLowerCase(),
  32533. this.tn.omit(";")
  32534. } else {
  32535. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32536. throw Error("illegal message field type: " + i);
  32537. if (r.type = i,
  32538. n = this.tn.next(),
  32539. !a.NAME.test(n))
  32540. throw Error("illegal message field name: " + n);
  32541. r.name = n,
  32542. this.tn.skip("="),
  32543. r.id = s(this.tn.next()),
  32544. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32545. this.tn.skip(";")
  32546. }
  32547. return e.fields.push(r),
  32548. r
  32549. }
  32550. ,
  32551. c._parseMessageOneOf = function(e) {
  32552. var t = this.tn.next();
  32553. if (!a.NAME.test(t))
  32554. throw Error("illegal oneof name: " + t);
  32555. var i, n = t, r = [];
  32556. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32557. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32558. r.push(i.id);
  32559. this.tn.omit(";"),
  32560. e.oneofs[n] = r
  32561. }
  32562. ,
  32563. c._parseFieldOptions = function(e) {
  32564. this.tn.skip("[");
  32565. for (var t = !0; "]" !== this.tn.peek(); )
  32566. t || this.tn.skip(","),
  32567. this._parseOption(e, !0),
  32568. t = !1;
  32569. this.tn.next()
  32570. }
  32571. ,
  32572. c._parseEnum = function(e) {
  32573. var t = {
  32574. name: "",
  32575. values: [],
  32576. options: {}
  32577. }
  32578. , i = this.tn.next();
  32579. if (!a.NAME.test(i))
  32580. throw Error("illegal name: " + i);
  32581. for (t.name = i,
  32582. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32583. if ("option" === i)
  32584. this._parseOption(t);
  32585. else {
  32586. if (!a.NAME.test(i))
  32587. throw Error("illegal name: " + i);
  32588. this.tn.skip("=");
  32589. var n = {
  32590. name: i,
  32591. id: s(this.tn.next(), !0)
  32592. };
  32593. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32594. options: {}
  32595. }),
  32596. this.tn.skip(";"),
  32597. t.values.push(n)
  32598. }
  32599. this.tn.omit(";"),
  32600. e.enums.push(t)
  32601. }
  32602. ,
  32603. c._parseExtensionRanges = function() {
  32604. var e, t, i, n = [];
  32605. do {
  32606. for (t = []; ; ) {
  32607. switch (e = this.tn.next()) {
  32608. case "min":
  32609. i = r.ID_MIN;
  32610. break;
  32611. case "max":
  32612. i = r.ID_MAX;
  32613. break;
  32614. default:
  32615. i = o(e)
  32616. }
  32617. if (t.push(i),
  32618. 2 === t.length)
  32619. break;
  32620. if ("to" !== this.tn.peek()) {
  32621. t.push(i);
  32622. break
  32623. }
  32624. this.tn.next()
  32625. }
  32626. n.push(t)
  32627. } while (this.tn.omit(","));return this.tn.skip(";"),
  32628. n
  32629. }
  32630. ,
  32631. c._parseExtend = function(e) {
  32632. var t = this.tn.next();
  32633. if (!a.TYPEREF.test(t))
  32634. throw Error("illegal extend reference: " + t);
  32635. var i = {
  32636. ref: t,
  32637. fields: []
  32638. };
  32639. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32640. if (a.RULE.test(t))
  32641. this._parseMessageField(i, t);
  32642. else {
  32643. if (!a.TYPEREF.test(t))
  32644. throw Error("illegal extend token: " + t);
  32645. if (!this.proto3)
  32646. throw Error("illegal field rule: " + t);
  32647. this._parseMessageField(i, "optional", t)
  32648. }
  32649. return this.tn.omit(";"),
  32650. e.messages.push(i),
  32651. i
  32652. }
  32653. ,
  32654. c.toString = function() {
  32655. return "Parser at line " + this.tn.line
  32656. }
  32657. ,
  32658. e.Parser = l,
  32659. e
  32660. }(o, o.Lang),
  32661. o.Reflect = function(g) {
  32662. function a(e, t) {
  32663. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32664. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32665. if ("string" == typeof e)
  32666. return g.Long.fromString(e, t || !1, 10);
  32667. if ("number" == typeof e)
  32668. return g.Long.fromNumber(e, t || !1);
  32669. throw Error("not convertible to Long")
  32670. }
  32671. function m(e, t) {
  32672. var i = t.readVarint32()
  32673. , n = 7 & i
  32674. , r = i >>> 3;
  32675. switch (n) {
  32676. case g.WIRE_TYPES.VARINT:
  32677. for (; 128 == (128 & (i = t.readUint8())); )
  32678. ;
  32679. break;
  32680. case g.WIRE_TYPES.BITS64:
  32681. t.offset += 8;
  32682. break;
  32683. case g.WIRE_TYPES.LDELIM:
  32684. i = t.readVarint32(),
  32685. t.offset += i;
  32686. break;
  32687. case g.WIRE_TYPES.STARTGROUP:
  32688. m(r, t);
  32689. break;
  32690. case g.WIRE_TYPES.ENDGROUP:
  32691. if (r === e)
  32692. return !1;
  32693. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32694. case g.WIRE_TYPES.BITS32:
  32695. t.offset += 4;
  32696. break;
  32697. default:
  32698. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32699. }
  32700. return !0
  32701. }
  32702. function h(e, t, i) {
  32703. this.builder = e,
  32704. this.parent = t,
  32705. this.name = i,
  32706. this.className
  32707. }
  32708. var s = {}
  32709. , e = h.prototype;
  32710. e.fqn = function() {
  32711. for (var e = this.name, t = this; null != (t = t.parent); )
  32712. e = t.name + "." + e;
  32713. return e
  32714. }
  32715. ,
  32716. e.toString = function(e) {
  32717. return (e ? this.className + " " : "") + this.fqn()
  32718. }
  32719. ,
  32720. e.build = function() {
  32721. throw Error(this.toString(!0) + " cannot be built directly")
  32722. }
  32723. ,
  32724. s.T = h;
  32725. function l(e, t, i, n, r) {
  32726. h.call(this, e, t, i),
  32727. this.className = "Namespace",
  32728. this.children = [],
  32729. this.options = n || {},
  32730. this.syntax = r || "proto2"
  32731. }
  32732. var t = l.prototype = Object.create(h.prototype);
  32733. t.getChildren = function(e) {
  32734. if (null == (e = e || null))
  32735. return this.children.slice();
  32736. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32737. this.children[i]instanceof e && t.push(this.children[i]);
  32738. return t
  32739. }
  32740. ,
  32741. t.addChild = function(e) {
  32742. var t;
  32743. if (t = this.getChild(e.name))
  32744. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32745. t.name = t.originalName;
  32746. else {
  32747. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32748. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32749. e.name = e.originalName
  32750. }
  32751. this.children.push(e)
  32752. }
  32753. ,
  32754. t.getChild = function(e) {
  32755. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32756. if (this.children[i][t] === e)
  32757. return this.children[i];
  32758. return null
  32759. }
  32760. ,
  32761. t.resolve = function(e, t) {
  32762. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32763. if ("" === n[o]) {
  32764. for (; null !== r.parent; )
  32765. r = r.parent;
  32766. o++
  32767. }
  32768. do {
  32769. do {
  32770. if (!(r instanceof s.Namespace)) {
  32771. r = null;
  32772. break
  32773. }
  32774. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32775. r = null;
  32776. break
  32777. }
  32778. r = i,
  32779. o++
  32780. } while (o < n.length);if (null != r)
  32781. break;
  32782. if (null !== this.parent)
  32783. return this.parent.resolve(e, t)
  32784. } while (null != r);return r
  32785. }
  32786. ,
  32787. t.qn = function(e) {
  32788. for (var t = [], i = e; t.unshift(i.name),
  32789. null !== (i = i.parent); )
  32790. ;
  32791. for (var n = 1; n <= t.length; n++) {
  32792. var r = t.slice(t.length - n);
  32793. if (e === this.resolve(r, e instanceof s.Namespace))
  32794. return r.join(".")
  32795. }
  32796. return e.fqn()
  32797. }
  32798. ,
  32799. t.build = function() {
  32800. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32801. (e = i[n])instanceof l && (t[e.name] = e.build());
  32802. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32803. value: this.buildOpt()
  32804. }),
  32805. t
  32806. }
  32807. ,
  32808. t.buildOpt = function() {
  32809. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32810. var r = t[i]
  32811. , o = this.options[t[i]];
  32812. e[r] = o
  32813. }
  32814. return e
  32815. }
  32816. ,
  32817. t.getOption = function(e) {
  32818. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32819. }
  32820. ,
  32821. s.Namespace = l;
  32822. function u(e, t, i, n) {
  32823. if (this.type = e,
  32824. this.resolvedType = t,
  32825. this.isMapKey = i,
  32826. this.syntax = n,
  32827. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32828. throw Error("Invalid map key type: " + e.name)
  32829. }
  32830. var i = u.prototype;
  32831. u.defaultFieldValue = function(e) {
  32832. if ("string" == typeof e && (e = g.TYPES[e]),
  32833. void 0 === e.defaultValue)
  32834. throw Error("default value for type " + e.name + " is not supported");
  32835. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32836. }
  32837. ,
  32838. i.verifyValue = function(t) {
  32839. function i(e, t) {
  32840. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32841. }
  32842. var n = this;
  32843. switch (this.type) {
  32844. case g.TYPES.int32:
  32845. case g.TYPES.sint32:
  32846. case g.TYPES.sfixed32:
  32847. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32848. 4294967295 < t ? 0 | t : t;
  32849. case g.TYPES.uint32:
  32850. case g.TYPES.fixed32:
  32851. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32852. t < 0 ? t >>> 0 : t;
  32853. case g.TYPES.int64:
  32854. case g.TYPES.sint64:
  32855. case g.TYPES.sfixed64:
  32856. if (g.Long)
  32857. try {
  32858. return a(t, !1)
  32859. } catch (e) {
  32860. i(typeof t, e.message)
  32861. }
  32862. else
  32863. i(typeof t, "requires Long.js");
  32864. case g.TYPES.uint64:
  32865. case g.TYPES.fixed64:
  32866. if (g.Long)
  32867. try {
  32868. return a(t, !0)
  32869. } catch (e) {
  32870. i(typeof t, e.message)
  32871. }
  32872. else
  32873. i(typeof t, "requires Long.js");
  32874. case g.TYPES.bool:
  32875. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32876. t;
  32877. case g.TYPES.float:
  32878. case g.TYPES.double:
  32879. return "number" != typeof t && i(typeof t, "not a number"),
  32880. t;
  32881. case g.TYPES.string:
  32882. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32883. "" + t;
  32884. case g.TYPES.bytes:
  32885. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32886. case g.TYPES.enum:
  32887. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32888. for (o = 0; o < e.length; o++) {
  32889. if (e[o].name == t)
  32890. return e[o].id;
  32891. if (e[o].id == t)
  32892. return e[o].id
  32893. }
  32894. if ("proto3" === this.syntax)
  32895. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32896. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32897. t;
  32898. i(t, "not a valid enum value");
  32899. case g.TYPES.group:
  32900. case g.TYPES.message:
  32901. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32902. t instanceof this.resolvedType.clazz)
  32903. return t;
  32904. if (t instanceof g.Builder.Message) {
  32905. var r = {};
  32906. for (var o in t)
  32907. t.hasOwnProperty(o) && (r[o] = t[o]);
  32908. t = r
  32909. }
  32910. return new this.resolvedType.clazz(t)
  32911. }
  32912. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32913. }
  32914. ,
  32915. i.calculateLength = function(e, t) {
  32916. if (null === t)
  32917. return 0;
  32918. var i;
  32919. switch (this.type) {
  32920. case g.TYPES.int32:
  32921. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32922. case g.TYPES.uint32:
  32923. return I.calculateVarint32(t);
  32924. case g.TYPES.sint32:
  32925. return I.calculateVarint32(I.zigZagEncode32(t));
  32926. case g.TYPES.fixed32:
  32927. case g.TYPES.sfixed32:
  32928. case g.TYPES.float:
  32929. return 4;
  32930. case g.TYPES.int64:
  32931. case g.TYPES.uint64:
  32932. return I.calculateVarint64(t);
  32933. case g.TYPES.sint64:
  32934. return I.calculateVarint64(I.zigZagEncode64(t));
  32935. case g.TYPES.fixed64:
  32936. case g.TYPES.sfixed64:
  32937. return 8;
  32938. case g.TYPES.bool:
  32939. return 1;
  32940. case g.TYPES.enum:
  32941. return I.calculateVarint32(t);
  32942. case g.TYPES.double:
  32943. return 8;
  32944. case g.TYPES.string:
  32945. return i = I.calculateUTF8Bytes(t),
  32946. I.calculateVarint32(i) + i;
  32947. case g.TYPES.bytes:
  32948. if (t.remaining() < 0)
  32949. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32950. return I.calculateVarint32(t.remaining()) + t.remaining();
  32951. case g.TYPES.message:
  32952. return i = this.resolvedType.calculate(t),
  32953. I.calculateVarint32(i) + i;
  32954. case g.TYPES.group:
  32955. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32956. }
  32957. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32958. }
  32959. ,
  32960. i.encodeValue = function(e, t, i) {
  32961. if (null === t)
  32962. return i;
  32963. switch (this.type) {
  32964. case g.TYPES.int32:
  32965. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32966. break;
  32967. case g.TYPES.uint32:
  32968. i.writeVarint32(t);
  32969. break;
  32970. case g.TYPES.sint32:
  32971. i.writeVarint32ZigZag(t);
  32972. break;
  32973. case g.TYPES.fixed32:
  32974. i.writeUint32(t);
  32975. break;
  32976. case g.TYPES.sfixed32:
  32977. i.writeInt32(t);
  32978. break;
  32979. case g.TYPES.int64:
  32980. case g.TYPES.uint64:
  32981. i.writeVarint64(t);
  32982. break;
  32983. case g.TYPES.sint64:
  32984. i.writeVarint64ZigZag(t);
  32985. break;
  32986. case g.TYPES.fixed64:
  32987. i.writeUint64(t);
  32988. break;
  32989. case g.TYPES.sfixed64:
  32990. i.writeInt64(t);
  32991. break;
  32992. case g.TYPES.bool:
  32993. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32994. break;
  32995. case g.TYPES.enum:
  32996. i.writeVarint32(t);
  32997. break;
  32998. case g.TYPES.float:
  32999. i.writeFloat32(t);
  33000. break;
  33001. case g.TYPES.double:
  33002. i.writeFloat64(t);
  33003. break;
  33004. case g.TYPES.string:
  33005. i.writeVString(t);
  33006. break;
  33007. case g.TYPES.bytes:
  33008. if (t.remaining() < 0)
  33009. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33010. var n = t.offset;
  33011. i.writeVarint32(t.remaining()),
  33012. i.append(t),
  33013. t.offset = n;
  33014. break;
  33015. case g.TYPES.message:
  33016. var r = (new I).LE();
  33017. this.resolvedType.encode(t, r),
  33018. i.writeVarint32(r.offset),
  33019. i.append(r.flip());
  33020. break;
  33021. case g.TYPES.group:
  33022. this.resolvedType.encode(t, i),
  33023. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33024. break;
  33025. default:
  33026. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33027. }
  33028. return i
  33029. }
  33030. ,
  33031. i.decode = function(e, t, i) {
  33032. if (t != this.type.wireType)
  33033. throw Error("Unexpected wire type for element");
  33034. var n, r;
  33035. switch (this.type) {
  33036. case g.TYPES.int32:
  33037. return 0 | e.readVarint32();
  33038. case g.TYPES.uint32:
  33039. return e.readVarint32() >>> 0;
  33040. case g.TYPES.sint32:
  33041. return 0 | e.readVarint32ZigZag();
  33042. case g.TYPES.fixed32:
  33043. return e.readUint32() >>> 0;
  33044. case g.TYPES.sfixed32:
  33045. return 0 | e.readInt32();
  33046. case g.TYPES.int64:
  33047. return e.readVarint64();
  33048. case g.TYPES.uint64:
  33049. return e.readVarint64().toUnsigned();
  33050. case g.TYPES.sint64:
  33051. return e.readVarint64ZigZag();
  33052. case g.TYPES.fixed64:
  33053. return e.readUint64();
  33054. case g.TYPES.sfixed64:
  33055. return e.readInt64();
  33056. case g.TYPES.bool:
  33057. return !!e.readVarint32();
  33058. case g.TYPES.enum:
  33059. return e.readVarint32();
  33060. case g.TYPES.float:
  33061. return e.readFloat();
  33062. case g.TYPES.double:
  33063. return e.readDouble();
  33064. case g.TYPES.string:
  33065. return e.readVString();
  33066. case g.TYPES.bytes:
  33067. if (r = e.readVarint32(),
  33068. e.remaining() < r)
  33069. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33070. return (n = e.clone()).limit = n.offset + r,
  33071. e.offset += r,
  33072. n;
  33073. case g.TYPES.message:
  33074. return r = e.readVarint32(),
  33075. this.resolvedType.decode(e, r);
  33076. case g.TYPES.group:
  33077. return this.resolvedType.decode(e, -1, i)
  33078. }
  33079. throw Error("[INTERNAL] Illegal decode type")
  33080. }
  33081. ,
  33082. i.valueFromString = function(e) {
  33083. if (!this.isMapKey)
  33084. throw Error("valueFromString() called on non-map-key element");
  33085. switch (this.type) {
  33086. case g.TYPES.int32:
  33087. case g.TYPES.sint32:
  33088. case g.TYPES.sfixed32:
  33089. case g.TYPES.uint32:
  33090. case g.TYPES.fixed32:
  33091. return this.verifyValue(parseInt(e));
  33092. case g.TYPES.int64:
  33093. case g.TYPES.sint64:
  33094. case g.TYPES.sfixed64:
  33095. case g.TYPES.uint64:
  33096. case g.TYPES.fixed64:
  33097. return this.verifyValue(e);
  33098. case g.TYPES.bool:
  33099. return "true" === e;
  33100. case g.TYPES.string:
  33101. return this.verifyValue(e);
  33102. case g.TYPES.bytes:
  33103. return I.fromBinary(e)
  33104. }
  33105. }
  33106. ,
  33107. i.valueToString = function(e) {
  33108. if (!this.isMapKey)
  33109. throw Error("valueToString() called on non-map-key element");
  33110. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33111. }
  33112. ,
  33113. s.Element = u;
  33114. var d = function(e, t, i, n, r, o) {
  33115. l.call(this, e, t, i, n, o),
  33116. this.className = "Message",
  33117. this.extensions = void 0,
  33118. this.clazz = null,
  33119. this.isGroup = !!r,
  33120. this._fields = null,
  33121. this._fieldsById = null,
  33122. this._fieldsByName = null
  33123. }
  33124. , n = d.prototype = Object.create(l.prototype);
  33125. n.build = function(e) {
  33126. if (this.clazz && !e)
  33127. return this.clazz;
  33128. var t = function(u, a) {
  33129. function d(e, i, n, r) {
  33130. if (null === e || "object" != typeof e) {
  33131. if (r && r instanceof u.Reflect.Enum) {
  33132. var t = u.Reflect.Enum.getName(r.object, e);
  33133. if (null !== t)
  33134. return t
  33135. }
  33136. return e
  33137. }
  33138. if (I.isByteBuffer(e))
  33139. return i ? e.toBase64() : e.toBuffer();
  33140. if (u.Long.isLong(e))
  33141. return n ? e.toString() : u.Long.fromValue(e);
  33142. var o;
  33143. if (Array.isArray(e))
  33144. return o = [],
  33145. e.forEach(function(e, t) {
  33146. o[t] = d(e, i, n, r)
  33147. }),
  33148. o;
  33149. if (o = {},
  33150. e instanceof u.Map) {
  33151. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33152. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33153. return o
  33154. }
  33155. var l = e.$type
  33156. , c = void 0;
  33157. for (var h in e)
  33158. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33159. return o
  33160. }
  33161. var s = a.getChildren(u.Reflect.Message.Field)
  33162. , l = a.getChildren(u.Reflect.Message.OneOf)
  33163. , c = function(e, t) {
  33164. u.Builder.Message.call(this);
  33165. for (var i = 0, n = l.length; i < n; ++i)
  33166. this[l[i].name] = null;
  33167. for (i = 0,
  33168. n = s.length; i < n; ++i) {
  33169. var r = s[i];
  33170. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33171. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33172. }
  33173. var o;
  33174. if (0 < arguments.length)
  33175. 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)
  33176. for (i = 0,
  33177. n = arguments.length; i < n; ++i)
  33178. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33179. else
  33180. this.$set(e)
  33181. }
  33182. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33183. o.add = function(e, t, i) {
  33184. var n = a._fieldsByName[e];
  33185. if (!i) {
  33186. if (!n)
  33187. throw Error(this + "#" + e + " is undefined");
  33188. if (!(n instanceof u.Reflect.Message.Field))
  33189. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33190. if (!n.repeated)
  33191. throw Error(this + "#" + e + " is not a repeated field");
  33192. t = n.verifyValue(t, !0)
  33193. }
  33194. return null === this[e] && (this[e] = []),
  33195. this[e].push(t),
  33196. this
  33197. }
  33198. ,
  33199. o.$add = o.add,
  33200. o.set = function(e, t, i) {
  33201. if (e && "object" == typeof e) {
  33202. for (var n in i = t,
  33203. e)
  33204. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33205. return this
  33206. }
  33207. var r = a._fieldsByName[e];
  33208. if (i)
  33209. this[e] = t;
  33210. else {
  33211. if (!r)
  33212. throw Error(this + "#" + e + " is not a field: undefined");
  33213. if (!(r instanceof u.Reflect.Message.Field))
  33214. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33215. this[r.name] = t = r.verifyValue(t)
  33216. }
  33217. if (r && r.oneof) {
  33218. var o = this[r.oneof.name];
  33219. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33220. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33221. }
  33222. return this
  33223. }
  33224. ,
  33225. o.$set = o.set,
  33226. o.get = function(e, t) {
  33227. if (t)
  33228. return this[e];
  33229. var i = a._fieldsByName[e];
  33230. if (!(i && i instanceof u.Reflect.Message.Field))
  33231. throw Error(this + "#" + e + " is not a field: undefined");
  33232. if (!(i instanceof u.Reflect.Message.Field))
  33233. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33234. return this[i.name]
  33235. }
  33236. ,
  33237. o.$get = o.get;
  33238. for (var e = 0; e < s.length; e++) {
  33239. var t = s[e];
  33240. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33241. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33242. return e.toUpperCase().replace("_", "")
  33243. });
  33244. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33245. function t(e, t) {
  33246. return this[i.name] = t ? e : i.verifyValue(e),
  33247. this
  33248. }
  33249. function n() {
  33250. return this[i.name]
  33251. }
  33252. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33253. return "_" + e
  33254. });
  33255. null === a.getChild("set" + e) && (o["set" + e] = t),
  33256. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33257. null === a.getChild("get" + e) && (o["get" + e] = n),
  33258. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33259. }(t)
  33260. }
  33261. return o.encode = function(t, e) {
  33262. "boolean" == typeof t && (e = t,
  33263. t = void 0);
  33264. var i = !1;
  33265. t || (t = new I,
  33266. i = !0);
  33267. var n = t.littleEndian;
  33268. try {
  33269. return a.encode(this, t.LE(), e),
  33270. (i ? t.flip() : t).LE(n)
  33271. } catch (e) {
  33272. throw t.LE(n),
  33273. e
  33274. }
  33275. }
  33276. ,
  33277. c.encode = function(e, t, i) {
  33278. return new c(e).encode(t, i)
  33279. }
  33280. ,
  33281. o.calculate = function() {
  33282. return a.calculate(this)
  33283. }
  33284. ,
  33285. o.encodeDelimited = function(e, t) {
  33286. var i = !1;
  33287. e || (e = new I,
  33288. i = !0);
  33289. var n = (new I).LE();
  33290. return a.encode(this, n, t).flip(),
  33291. e.writeVarint32(n.remaining()),
  33292. e.append(n),
  33293. i ? e.flip() : e
  33294. }
  33295. ,
  33296. o.encodeAB = function() {
  33297. try {
  33298. return this.encode().toArrayBuffer()
  33299. } catch (e) {
  33300. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33301. e
  33302. }
  33303. }
  33304. ,
  33305. o.toArrayBuffer = o.encodeAB,
  33306. o.encodeNB = function() {
  33307. try {
  33308. return this.encode().toBuffer()
  33309. } catch (e) {
  33310. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33311. e
  33312. }
  33313. }
  33314. ,
  33315. o.toBuffer = o.encodeNB,
  33316. o.encode64 = function() {
  33317. try {
  33318. return this.encode().toBase64()
  33319. } catch (e) {
  33320. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33321. e
  33322. }
  33323. }
  33324. ,
  33325. o.toBase64 = o.encode64,
  33326. o.encodeHex = function() {
  33327. try {
  33328. return this.encode().toHex()
  33329. } catch (e) {
  33330. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33331. e
  33332. }
  33333. }
  33334. ,
  33335. o.toHex = o.encodeHex,
  33336. o.toRaw = function(e, t) {
  33337. return d(this, !!e, !!t, this.$type)
  33338. }
  33339. ,
  33340. o.encodeJSON = function() {
  33341. return JSON.stringify(d(this, !0, !0, this.$type))
  33342. }
  33343. ,
  33344. c.decode = function(t, e, i) {
  33345. "string" == typeof e && (i = e,
  33346. e = -1),
  33347. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33348. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33349. try {
  33350. var r = a.decode(t.LE());
  33351. return t.LE(n),
  33352. r
  33353. } catch (e) {
  33354. throw t.LE(n),
  33355. e
  33356. }
  33357. }
  33358. ,
  33359. c.decodeDelimited = function(t, e) {
  33360. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33361. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33362. return null;
  33363. var i = t.offset
  33364. , n = t.readVarint32();
  33365. if (t.remaining() < n)
  33366. return t.offset = i,
  33367. null;
  33368. try {
  33369. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33370. return t.offset += n,
  33371. r
  33372. } catch (e) {
  33373. throw t.offset += n,
  33374. e
  33375. }
  33376. }
  33377. ,
  33378. c.decode64 = function(e) {
  33379. return c.decode(e, "base64")
  33380. }
  33381. ,
  33382. c.decodeHex = function(e) {
  33383. return c.decode(e, "hex")
  33384. }
  33385. ,
  33386. c.decodeJSON = function(e) {
  33387. return new c(JSON.parse(e))
  33388. }
  33389. ,
  33390. o.toString = function() {
  33391. return a.toString()
  33392. }
  33393. ,
  33394. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33395. value: a.buildOpt()
  33396. }),
  33397. Object.defineProperty(o, "$options", {
  33398. value: c.$options
  33399. }),
  33400. Object.defineProperty(c, "$type", {
  33401. value: a
  33402. }),
  33403. Object.defineProperty(o, "$type", {
  33404. value: a
  33405. })),
  33406. c
  33407. }(g, this);
  33408. this._fields = [],
  33409. this._fieldsById = {},
  33410. this._fieldsByName = {};
  33411. for (var i, n = 0, r = this.children.length; n < r; n++)
  33412. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33413. if (t.hasOwnProperty(i.name))
  33414. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33415. t[i.name] = i.build()
  33416. } else if (i instanceof d.Field)
  33417. i.build(),
  33418. this._fields.push(i),
  33419. this._fieldsById[i.id] = i,
  33420. this._fieldsByName[i.name] = i;
  33421. else if (!(i instanceof d.OneOf || i instanceof v))
  33422. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33423. return this.clazz = t
  33424. }
  33425. ,
  33426. n.encode = function(e, t, i) {
  33427. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33428. r = e[(n = this._fields[a]).name],
  33429. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33430. if (null === o)
  33431. return t;
  33432. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33433. throw l.encoded = t,
  33434. l
  33435. }
  33436. ,
  33437. n.calculate = function(e) {
  33438. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33439. if (i = e[(t = this._fields[r]).name],
  33440. t.required && null === i)
  33441. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33442. n += t.calculate(i, e)
  33443. }
  33444. return n
  33445. }
  33446. ,
  33447. n.decode = function(e, t, i) {
  33448. t = "number" == typeof t ? t : -1;
  33449. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33450. if (o = (n = e.readVarint32()) >>> 3,
  33451. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33452. if (o !== i)
  33453. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33454. break
  33455. }
  33456. if (a = this._fieldsById[o]) {
  33457. if (a.repeated && !a.options.packed)
  33458. l[a.name].push(a.decode(r, e));
  33459. else if (a.map) {
  33460. var c = a.decode(r, e);
  33461. l[a.name].set(c[0], c[1])
  33462. } else if (l[a.name] = a.decode(r, e),
  33463. a.oneof) {
  33464. var h = l[a.oneof.name];
  33465. null !== h && h !== a.name && (l[h] = null),
  33466. l[a.oneof.name] = a.name
  33467. }
  33468. } else
  33469. switch (r) {
  33470. case g.WIRE_TYPES.VARINT:
  33471. e.readVarint32();
  33472. break;
  33473. case g.WIRE_TYPES.BITS32:
  33474. e.offset += 4;
  33475. break;
  33476. case g.WIRE_TYPES.BITS64:
  33477. e.offset += 8;
  33478. break;
  33479. case g.WIRE_TYPES.LDELIM:
  33480. var u = e.readVarint32();
  33481. e.offset += u;
  33482. break;
  33483. case g.WIRE_TYPES.STARTGROUP:
  33484. for (; m(o, e); )
  33485. ;
  33486. break;
  33487. default:
  33488. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33489. }
  33490. }
  33491. for (var d = 0, p = this._fields.length; d < p; ++d)
  33492. if (null === l[(a = this._fields[d]).name])
  33493. if ("proto3" === this.syntax)
  33494. l[a.name] = a.defaultValue;
  33495. else {
  33496. if (a.required) {
  33497. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33498. throw f.decoded = l,
  33499. f
  33500. }
  33501. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33502. }
  33503. return l
  33504. }
  33505. ,
  33506. s.Message = d;
  33507. function c(e, t, i, n, r, o, a, s, l, c) {
  33508. h.call(this, e, t, o),
  33509. this.className = "Message.Field",
  33510. this.required = "required" === i,
  33511. this.repeated = "repeated" === i,
  33512. this.map = "map" === i,
  33513. this.keyType = n || null,
  33514. this.type = r,
  33515. this.resolvedType = null,
  33516. this.id = a,
  33517. this.options = s || {},
  33518. this.defaultValue = null,
  33519. this.oneof = l || null,
  33520. this.syntax = c || "proto2",
  33521. this.originalName = this.name,
  33522. this.element = null,
  33523. this.keyElement = null,
  33524. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33525. }
  33526. var r = c.prototype = Object.create(h.prototype);
  33527. r.build = function() {
  33528. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33529. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33530. "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)
  33531. }
  33532. ,
  33533. r.verifyValue = function(e, t) {
  33534. function i(e, t) {
  33535. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33536. }
  33537. t = t || !1;
  33538. var n, r = this;
  33539. if (null === e)
  33540. return this.required && i(typeof e, "required"),
  33541. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33542. null;
  33543. if (!this.repeated || t)
  33544. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33545. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33546. this.element.verifyValue(e));
  33547. Array.isArray(e) || (e = [e]);
  33548. var o = [];
  33549. for (n = 0; n < e.length; n++)
  33550. o.push(this.element.verifyValue(e[n]));
  33551. return o
  33552. }
  33553. ,
  33554. r.hasWirePresence = function(e, t) {
  33555. if ("proto3" !== this.syntax)
  33556. return null !== e;
  33557. if (this.oneof && t[this.oneof.name] === this.name)
  33558. return !0;
  33559. switch (this.type) {
  33560. case g.TYPES.int32:
  33561. case g.TYPES.sint32:
  33562. case g.TYPES.sfixed32:
  33563. case g.TYPES.uint32:
  33564. case g.TYPES.fixed32:
  33565. return 0 !== e;
  33566. case g.TYPES.int64:
  33567. case g.TYPES.sint64:
  33568. case g.TYPES.sfixed64:
  33569. case g.TYPES.uint64:
  33570. case g.TYPES.fixed64:
  33571. return 0 !== e.low || 0 !== e.high;
  33572. case g.TYPES.bool:
  33573. return e;
  33574. case g.TYPES.float:
  33575. case g.TYPES.double:
  33576. return 0 !== e;
  33577. case g.TYPES.string:
  33578. return 0 < e.length;
  33579. case g.TYPES.bytes:
  33580. return 0 < e.remaining();
  33581. case g.TYPES.enum:
  33582. return 0 !== e;
  33583. case g.TYPES.message:
  33584. return null !== e;
  33585. default:
  33586. return !0
  33587. }
  33588. }
  33589. ,
  33590. r.encode = function(t, r, e) {
  33591. if (null === this.type || "object" != typeof this.type)
  33592. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33593. if (null === t || this.repeated && 0 == t.length)
  33594. return r;
  33595. try {
  33596. var i;
  33597. if (this.repeated)
  33598. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33599. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33600. r.ensureCapacity(r.offset += 1);
  33601. var n = r.offset;
  33602. for (i = 0; i < t.length; i++)
  33603. this.element.encodeValue(this.id, t[i], r);
  33604. var o = r.offset - n
  33605. , a = I.calculateVarint32(o);
  33606. if (1 < a) {
  33607. var s = r.slice(n, r.offset);
  33608. n += a - 1,
  33609. r.offset = n,
  33610. r.append(s)
  33611. }
  33612. r.writeVarint32(o, n - a)
  33613. } else
  33614. for (i = 0; i < t.length; i++)
  33615. r.writeVarint32(this.id << 3 | this.type.wireType),
  33616. this.element.encodeValue(this.id, t[i], r);
  33617. else
  33618. this.map ? t.forEach(function(e, t, i) {
  33619. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33620. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33621. r.writeVarint32(n),
  33622. r.writeVarint32(8 | this.keyType.wireType),
  33623. this.keyElement.encodeValue(1, t, r),
  33624. r.writeVarint32(16 | this.type.wireType),
  33625. this.element.encodeValue(2, e, r)
  33626. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33627. this.element.encodeValue(this.id, t, r))
  33628. } catch (e) {
  33629. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33630. }
  33631. return r
  33632. }
  33633. ,
  33634. r.calculate = function(t, e) {
  33635. if (t = this.verifyValue(t),
  33636. null === this.type || "object" != typeof this.type)
  33637. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33638. if (null === t || this.repeated && 0 == t.length)
  33639. return 0;
  33640. var r = 0;
  33641. try {
  33642. var i, n;
  33643. if (this.repeated)
  33644. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33645. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33646. i = n = 0; i < t.length; i++)
  33647. n += this.element.calculateLength(this.id, t[i]);
  33648. r += I.calculateVarint32(n),
  33649. r += n
  33650. } else
  33651. for (i = 0; i < t.length; i++)
  33652. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33653. r += this.element.calculateLength(this.id, t[i]);
  33654. else
  33655. this.map ? t.forEach(function(e, t, i) {
  33656. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33657. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33658. r += I.calculateVarint32(n),
  33659. r += n
  33660. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33661. r += this.element.calculateLength(this.id, t))
  33662. } catch (e) {
  33663. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33664. }
  33665. return r
  33666. }
  33667. ,
  33668. r.decode = function(e, t, i) {
  33669. var n, r;
  33670. 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))
  33671. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33672. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33673. r = t.readVarint32(),
  33674. r = t.offset + r;
  33675. for (var o = []; t.offset < r; )
  33676. o.push(this.decode(this.type.wireType, t, !0));
  33677. return o
  33678. }
  33679. if (this.map) {
  33680. var a = u.defaultFieldValue(this.keyType);
  33681. if (n = u.defaultFieldValue(this.type),
  33682. r = t.readVarint32(),
  33683. t.remaining() < r)
  33684. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33685. var s = t.clone();
  33686. for (s.limit = s.offset + r,
  33687. t.offset += r; 0 < s.remaining(); ) {
  33688. var l = s.readVarint32();
  33689. e = 7 & l;
  33690. var c = l >>> 3;
  33691. if (1 == c)
  33692. a = this.keyElement.decode(s, e, c);
  33693. else {
  33694. if (2 != c)
  33695. throw Error("Unexpected tag in map field key/value submessage");
  33696. n = this.element.decode(s, e, c)
  33697. }
  33698. }
  33699. return [a, n]
  33700. }
  33701. return this.element.decode(t, e, this.id)
  33702. }
  33703. ,
  33704. s.Message.Field = c;
  33705. function o(e, t, i, n, r, o, a) {
  33706. c.call(this, e, t, i, null, n, r, o, a),
  33707. this.extension
  33708. }
  33709. o.prototype = Object.create(c.prototype),
  33710. s.Message.ExtensionField = o;
  33711. s.Message.OneOf = function(e, t, i) {
  33712. h.call(this, e, t, i),
  33713. this.fields = []
  33714. }
  33715. ;
  33716. var p = function(e, t, i, n, r) {
  33717. l.call(this, e, t, i, n, r),
  33718. this.className = "Enum",
  33719. this.object = null
  33720. };
  33721. p.getName = function(e, t) {
  33722. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33723. if (e[i = n[r]] === t)
  33724. return i;
  33725. return null
  33726. }
  33727. ,
  33728. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33729. if (this.object && !e)
  33730. return this.object;
  33731. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33732. t[i[n].name] = i[n].id;
  33733. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33734. value: this.buildOpt(),
  33735. enumerable: !1
  33736. }),
  33737. this.object = t
  33738. }
  33739. ,
  33740. s.Enum = p;
  33741. function f(e, t, i, n) {
  33742. h.call(this, e, t, i),
  33743. this.className = "Enum.Value",
  33744. this.id = n
  33745. }
  33746. f.prototype = Object.create(h.prototype),
  33747. s.Enum.Value = f;
  33748. var v = function(e, t, i, n) {
  33749. h.call(this, e, t, i),
  33750. this.field = n
  33751. };
  33752. v.prototype = Object.create(h.prototype),
  33753. s.Extension = v;
  33754. var y = function(e, t, i, n) {
  33755. l.call(this, e, t, i, n),
  33756. this.className = "Service",
  33757. this.clazz = null
  33758. };
  33759. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33760. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33761. for (var o = function(e) {
  33762. t.Builder.Service.call(this),
  33763. this.rpcImpl = e || function(e, t, i) {
  33764. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33765. }
  33766. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33767. !function(n) {
  33768. e[n.name] = function(e, i) {
  33769. try {
  33770. try {
  33771. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33772. } catch (e) {
  33773. if (!(e instanceof TypeError))
  33774. throw e
  33775. }
  33776. if (null === e || "object" != typeof e)
  33777. throw Error("Illegal arguments");
  33778. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33779. this.rpcImpl(n.fqn(), e, function(e, t) {
  33780. if (!e) {
  33781. null === t && (t = "");
  33782. try {
  33783. t = n.resolvedResponseType.clazz.decode(t)
  33784. } catch (e) {}
  33785. 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))
  33786. }
  33787. i(e)
  33788. })
  33789. } catch (e) {
  33790. setTimeout(i.bind(this, e), 0)
  33791. }
  33792. }
  33793. ,
  33794. o[n.name] = function(e, t, i) {
  33795. new o(e)[n.name](t, i)
  33796. }
  33797. ,
  33798. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33799. value: n.buildOpt()
  33800. }),
  33801. Object.defineProperty(e[n.name], "$options", {
  33802. value: o[n.name].$options
  33803. }))
  33804. }(i[n]);
  33805. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33806. value: r.buildOpt()
  33807. }),
  33808. Object.defineProperty(e, "$options", {
  33809. value: o.$options
  33810. }),
  33811. Object.defineProperty(o, "$type", {
  33812. value: r
  33813. }),
  33814. Object.defineProperty(e, "$type", {
  33815. value: r
  33816. })),
  33817. o
  33818. }(g, this)
  33819. }
  33820. ,
  33821. s.Service = y;
  33822. function A(e, t, i, n) {
  33823. h.call(this, e, t, i),
  33824. this.className = "Service.Method",
  33825. this.options = n || {}
  33826. }
  33827. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33828. s.Service.Method = A;
  33829. function C(e, t, i, n, r, o, a, s) {
  33830. A.call(this, e, t, i, s),
  33831. this.className = "Service.RPCMethod",
  33832. this.requestName = n,
  33833. this.responseName = r,
  33834. this.requestStream = o,
  33835. this.responseStream = a,
  33836. this.resolvedRequestType = null,
  33837. this.resolvedResponseType = null
  33838. }
  33839. return C.prototype = Object.create(A.prototype),
  33840. s.Service.RPCMethod = C,
  33841. s
  33842. }(o),
  33843. o.Builder = (i = (u = o).Lang,
  33844. s = o.Reflect,
  33845. n = h.prototype,
  33846. h.isMessage = function(e) {
  33847. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33848. }
  33849. ,
  33850. h.isMessageField = function(e) {
  33851. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33852. }
  33853. ,
  33854. h.isEnum = function(e) {
  33855. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33856. }
  33857. ,
  33858. h.isService = function(e) {
  33859. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33860. }
  33861. ,
  33862. h.isExtend = function(e) {
  33863. return "string" == typeof e.ref
  33864. }
  33865. ,
  33866. n.reset = function() {
  33867. return this.ptr = this.ns,
  33868. this
  33869. }
  33870. ,
  33871. n.define = function(e) {
  33872. if ("string" != typeof e || !i.TYPEREF.test(e))
  33873. throw Error("illegal namespace: " + e);
  33874. return e.split(".").forEach(function(e) {
  33875. var t = this.ptr.getChild(e);
  33876. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33877. this.ptr = t
  33878. }, this),
  33879. this
  33880. }
  33881. ,
  33882. n.create = function(e) {
  33883. if (!e)
  33884. return this;
  33885. if (Array.isArray(e)) {
  33886. if (0 === e.length)
  33887. return this;
  33888. e = e.slice()
  33889. } else
  33890. e = [e];
  33891. for (var t = [e]; 0 < t.length; ) {
  33892. if (e = t.pop(),
  33893. !Array.isArray(e))
  33894. throw Error("not a valid namespace: " + JSON.stringify(e));
  33895. for (; 0 < e.length; ) {
  33896. var i = e.shift();
  33897. if (h.isMessage(i)) {
  33898. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33899. , n = {};
  33900. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33901. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33902. }, this),
  33903. i.fields && i.fields.forEach(function(e) {
  33904. if (null !== o.getChild(0 | e.id))
  33905. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33906. if (e.options && "object" != typeof e.options)
  33907. throw Error("illegal field options in " + o.name + "#" + e.name);
  33908. var t = null;
  33909. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33910. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33911. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33912. t && t.fields.push(e),
  33913. o.addChild(e)
  33914. }, this);
  33915. var r = [];
  33916. if (i.enums && i.enums.forEach(function(e) {
  33917. r.push(e)
  33918. }),
  33919. i.messages && i.messages.forEach(function(e) {
  33920. r.push(e)
  33921. }),
  33922. i.services && i.services.forEach(function(e) {
  33923. r.push(e)
  33924. }),
  33925. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33926. this.ptr.addChild(o),
  33927. 0 < r.length) {
  33928. t.push(e),
  33929. e = r,
  33930. r = null,
  33931. this.ptr = o,
  33932. o = null;
  33933. continue
  33934. }
  33935. r = null
  33936. } else if (h.isEnum(i))
  33937. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33938. i.values.forEach(function(e) {
  33939. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33940. }, this),
  33941. this.ptr.addChild(o);
  33942. else if (h.isService(i))
  33943. o = new s.Service(this,this.ptr,i.name,i.options),
  33944. Object.keys(i.rpc).forEach(function(e) {
  33945. var t = i.rpc[e];
  33946. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33947. }, this),
  33948. this.ptr.addChild(o);
  33949. else {
  33950. if (!h.isExtend(i))
  33951. throw Error("not a valid definition: " + JSON.stringify(i));
  33952. if (o = this.ptr.resolve(i.ref, !0))
  33953. i.fields.forEach(function(t) {
  33954. if (null !== o.getChild(0 | t.id))
  33955. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33956. if (o.extensions) {
  33957. var i = !1;
  33958. if (o.extensions.forEach(function(e) {
  33959. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33960. }),
  33961. !i)
  33962. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33963. }
  33964. var e = t.name;
  33965. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33966. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33967. , r = new s.Extension(this,this.ptr,t.name,n);
  33968. n.extension = r,
  33969. this.ptr.addChild(r),
  33970. o.addChild(n)
  33971. }, this);
  33972. else if (!/\.?google\.protobuf\./.test(i.ref))
  33973. throw Error("extended message " + i.ref + " is not defined")
  33974. }
  33975. o = i = null
  33976. }
  33977. e = null,
  33978. this.ptr = this.ptr.parent
  33979. }
  33980. return this.resolved = !1,
  33981. this.result = null,
  33982. this
  33983. }
  33984. ,
  33985. n.import = function(t, e) {
  33986. var i = "/";
  33987. if ("string" == typeof e) {
  33988. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33989. !0 === this.files[e])
  33990. return this.reset();
  33991. this.files[e] = !0
  33992. } else if ("object" == typeof e) {
  33993. var n = e.root;
  33994. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33995. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33996. var r = n + i + e.file;
  33997. if (!0 === this.files[r])
  33998. return this.reset();
  33999. this.files[r] = !0
  34000. }
  34001. if (t.imports && 0 < t.imports.length) {
  34002. var o, a = !1;
  34003. "object" == typeof e ? (this.importRoot = e.root,
  34004. a = !0,
  34005. o = this.importRoot,
  34006. e = e.file,
  34007. (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(/\\[^\\]*$/, ""),
  34008. i = "\\") : o = "." : o = null;
  34009. for (var s = 0; s < t.imports.length; s++)
  34010. if ("string" == typeof t.imports[s]) {
  34011. if (!o)
  34012. throw Error("cannot determine import root");
  34013. var l = t.imports[s];
  34014. if ("google/protobuf/descriptor.proto" === l)
  34015. continue;
  34016. if (l = o + i + l,
  34017. !0 === this.files[l])
  34018. continue;
  34019. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34020. var c = u.Util.fetch(l);
  34021. if (null === c)
  34022. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34023. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34024. } else
  34025. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34026. return t + "_import" + s + "." + i
  34027. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34028. a && (this.importRoot = null)
  34029. }
  34030. t.package && this.define(t.package),
  34031. t.syntax && function t(i) {
  34032. i.messages && i.messages.forEach(function(e) {
  34033. e.syntax = i.syntax,
  34034. t(e)
  34035. }),
  34036. i.enums && i.enums.forEach(function(e) {
  34037. e.syntax = i.syntax
  34038. })
  34039. }(t);
  34040. var h = this.ptr;
  34041. return t.options && Object.keys(t.options).forEach(function(e) {
  34042. h.options[e] = t.options[e]
  34043. }),
  34044. t.messages && (this.create(t.messages),
  34045. this.ptr = h),
  34046. t.enums && (this.create(t.enums),
  34047. this.ptr = h),
  34048. t.services && (this.create(t.services),
  34049. this.ptr = h),
  34050. t.extends && this.create(t.extends),
  34051. this.reset()
  34052. }
  34053. ,
  34054. n.resolveAll = function() {
  34055. var e;
  34056. if (null == this.ptr || "object" == typeof this.ptr.type)
  34057. return this;
  34058. if (this.ptr instanceof s.Namespace)
  34059. this.ptr.children.forEach(function(e) {
  34060. this.ptr = e,
  34061. this.resolveAll()
  34062. }, this);
  34063. else if (this.ptr instanceof s.Message.Field) {
  34064. if (i.TYPE.test(this.ptr.type))
  34065. this.ptr.type = u.TYPES[this.ptr.type];
  34066. else {
  34067. if (!i.TYPEREF.test(this.ptr.type))
  34068. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34069. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34070. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34071. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34072. if (this.ptr.type = u.TYPES.enum,
  34073. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34074. throw Error("proto3 message cannot reference proto2 enum")
  34075. } else {
  34076. if (!(e instanceof s.Message))
  34077. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34078. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34079. }
  34080. }
  34081. if (this.ptr.map) {
  34082. if (!i.TYPE.test(this.ptr.keyType))
  34083. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34084. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34085. }
  34086. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34087. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34088. throw Error("illegal service type in " + this.ptr.toString(!0));
  34089. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34090. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34091. if (this.ptr.resolvedRequestType = e,
  34092. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34093. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34094. this.ptr.resolvedResponseType = e
  34095. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34096. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34097. return this.reset()
  34098. }
  34099. ,
  34100. n.build = function(e) {
  34101. if (this.reset(),
  34102. this.resolved || (this.resolveAll(),
  34103. this.resolved = !0,
  34104. this.result = null),
  34105. null === this.result && (this.result = this.ns.build()),
  34106. !e)
  34107. return this.result;
  34108. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34109. if (!i[t[n]]) {
  34110. i = null;
  34111. break
  34112. }
  34113. i = i[t[n]]
  34114. }
  34115. return i
  34116. }
  34117. ,
  34118. n.lookup = function(e, t) {
  34119. return e ? this.ns.resolve(e, t) : this.ns
  34120. }
  34121. ,
  34122. n.toString = function() {
  34123. return "Builder"
  34124. }
  34125. ,
  34126. h.Message = function() {}
  34127. ,
  34128. h.Enum = function() {}
  34129. ,
  34130. h.Service = function() {}
  34131. ,
  34132. h),
  34133. o.Map = (a = o.Reflect,
  34134. (t = c.prototype).clear = function() {
  34135. this.map = {}
  34136. }
  34137. ,
  34138. t.delete = function(e) {
  34139. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34140. , i = t in this.map;
  34141. return delete this.map[t],
  34142. i
  34143. }
  34144. ,
  34145. t.entries = function() {
  34146. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34147. t.push([(e = this.map[i[n]]).key, e.value]);
  34148. return l(t)
  34149. }
  34150. ,
  34151. t.keys = function() {
  34152. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34153. e.push(this.map[t[i]].key);
  34154. return l(e)
  34155. }
  34156. ,
  34157. t.values = function() {
  34158. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34159. e.push(this.map[t[i]].value);
  34160. return l(e)
  34161. }
  34162. ,
  34163. t.forEach = function(e, t) {
  34164. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34165. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34166. }
  34167. ,
  34168. t.set = function(e, t) {
  34169. var i = this.keyElem.verifyValue(e)
  34170. , n = this.valueElem.verifyValue(t);
  34171. return this.map[this.keyElem.valueToString(i)] = {
  34172. key: i,
  34173. value: n
  34174. },
  34175. this
  34176. }
  34177. ,
  34178. t.get = function(e) {
  34179. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34180. if (t in this.map)
  34181. return this.map[t].value
  34182. }
  34183. ,
  34184. t.has = function(e) {
  34185. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34186. }
  34187. ,
  34188. c),
  34189. o.loadProto = function(e, t, i) {
  34190. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34191. t = void 0),
  34192. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34193. }
  34194. ,
  34195. o.protoFromString = o.loadProto,
  34196. o.loadProtoFile = function(t, i, n) {
  34197. if (i && "object" == typeof i ? (n = i,
  34198. i = null) : i && "function" == typeof i || (i = null),
  34199. i)
  34200. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34201. if (null !== e)
  34202. try {
  34203. i(null, o.loadProto(e, n, t))
  34204. } catch (e) {
  34205. i(e)
  34206. }
  34207. else
  34208. i(Error("Failed to fetch file"))
  34209. });
  34210. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34211. return null === e ? null : o.loadProto(e, n, t)
  34212. }
  34213. ,
  34214. o.protoFromFile = o.loadProtoFile,
  34215. o.newBuilder = function(e) {
  34216. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34217. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34218. new o.Builder(e)
  34219. }
  34220. ,
  34221. o.loadJson = function(e, t, i) {
  34222. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34223. t = null),
  34224. t && "object" == typeof t || (t = o.newBuilder()),
  34225. "string" == typeof e && (e = JSON.parse(e)),
  34226. t.import(e, i),
  34227. t.resolveAll(),
  34228. t
  34229. }
  34230. ,
  34231. o.loadJsonFile = function(t, i, n) {
  34232. if (i && "object" == typeof i ? (n = i,
  34233. i = null) : i && "function" == typeof i || (i = null),
  34234. i)
  34235. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34236. if (null !== e)
  34237. try {
  34238. i(null, o.loadJson(JSON.parse(e), n, t))
  34239. } catch (e) {
  34240. i(e)
  34241. }
  34242. else
  34243. i(Error("Failed to fetch file"))
  34244. });
  34245. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34246. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34247. }
  34248. ,
  34249. o;
  34250. function l(e) {
  34251. var t = 0;
  34252. return {
  34253. next: function() {
  34254. return t < e.length ? {
  34255. done: !1,
  34256. value: e[t++]
  34257. } : {
  34258. done: !0
  34259. }
  34260. }
  34261. }
  34262. }
  34263. function c(e, t) {
  34264. if (!e.map)
  34265. throw Error("field is not a map");
  34266. if (this.field = e,
  34267. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34268. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34269. this.map = {},
  34270. Object.defineProperty(this, "size", {
  34271. get: function() {
  34272. return Object.keys(this.map).length
  34273. }
  34274. }),
  34275. t)
  34276. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34277. var r = this.keyElem.valueFromString(i[n])
  34278. , o = this.valueElem.verifyValue(t[i[n]]);
  34279. this.map[this.keyElem.valueToString(r)] = {
  34280. key: r,
  34281. value: o
  34282. }
  34283. }
  34284. }
  34285. function h(e) {
  34286. this.ns = new s.Namespace(this,null,""),
  34287. this.ptr = this.ns,
  34288. this.resolved = !1,
  34289. this.result = null,
  34290. this.files = {},
  34291. this.importRoot = null,
  34292. this.options = e || {}
  34293. }
  34294. }
  34295. ,
  34296. "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)
  34297. }
  34298. ).call(this, p("_process"))
  34299. }
  34300. , {
  34301. _process: 203,
  34302. bytebuffer: 215,
  34303. fs: 197,
  34304. path: 197
  34305. }],
  34306. 215: [function(t, e, i) {
  34307. var n, r;
  34308. n = this,
  34309. r = function(l) {
  34310. "use strict";
  34311. function s(e) {
  34312. var t = 0;
  34313. return function() {
  34314. return t < e.length ? e.charCodeAt(t++) : null
  34315. }
  34316. }
  34317. function c() {
  34318. var e = []
  34319. , t = [];
  34320. return function() {
  34321. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34322. e.length = 0),
  34323. void Array.prototype.push.apply(e, arguments))
  34324. }
  34325. }
  34326. function n(e, t, i, n, r) {
  34327. 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];
  34328. for (u += d,
  34329. o = p & (1 << -h) - 1,
  34330. p >>= -h,
  34331. h += s; 0 < h; o = 256 * o + e[t + u],
  34332. u += d,
  34333. h -= 8)
  34334. ;
  34335. for (a = o & (1 << -h) - 1,
  34336. o >>= -h,
  34337. h += n; 0 < h; a = 256 * a + e[t + u],
  34338. u += d,
  34339. h -= 8)
  34340. ;
  34341. if (0 === o)
  34342. o = 1 - c;
  34343. else {
  34344. if (o === l)
  34345. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34346. a += Math.pow(2, n),
  34347. o -= c
  34348. }
  34349. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34350. }
  34351. function r(e, t, i, n, r, o) {
  34352. 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;
  34353. for (t = Math.abs(t),
  34354. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34355. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34356. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34357. l *= 2),
  34358. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34359. l /= 2),
  34360. h <= a + u ? (s = 0,
  34361. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34362. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34363. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34364. p += f,
  34365. s /= 256,
  34366. r -= 8)
  34367. ;
  34368. for (a = a << r | s,
  34369. c += r; 0 < c; e[i + p] = 255 & a,
  34370. p += f,
  34371. a /= 256,
  34372. c -= 8)
  34373. ;
  34374. e[i + p - f] |= 128 * g
  34375. }
  34376. var f = function(e, t, i) {
  34377. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34378. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34379. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34380. !i) {
  34381. if ((e |= 0) < 0)
  34382. throw RangeError("Illegal capacity");
  34383. t = !!t,
  34384. i = !!i
  34385. }
  34386. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34387. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34388. this.offset = 0,
  34389. this.markedOffset = -1,
  34390. this.limit = e,
  34391. this.littleEndian = t,
  34392. this.noAssert = i
  34393. };
  34394. f.VERSION = "5.0.1",
  34395. f.LITTLE_ENDIAN = !0,
  34396. f.BIG_ENDIAN = !1,
  34397. f.DEFAULT_CAPACITY = 16,
  34398. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34399. f.DEFAULT_NOASSERT = !1,
  34400. f.Long = l || null;
  34401. var a = f.prototype;
  34402. a.__isByteBuffer__,
  34403. Object.defineProperty(a, "__isByteBuffer__", {
  34404. value: !0,
  34405. enumerable: !1,
  34406. configurable: !1
  34407. });
  34408. var o = new ArrayBuffer(0)
  34409. , i = String.fromCharCode;
  34410. f.accessor = function() {
  34411. return Uint8Array
  34412. }
  34413. ,
  34414. f.allocate = function(e, t, i) {
  34415. return new f(e,t,i)
  34416. }
  34417. ,
  34418. f.concat = function(e, t, i, n) {
  34419. "boolean" != typeof t && "string" == typeof t || (n = i,
  34420. i = t,
  34421. t = void 0);
  34422. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34423. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34424. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34425. if (0 === o)
  34426. return new f(0,i,n);
  34427. var l, c = new f(o,i,n);
  34428. for (a = 0; a < s; )
  34429. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34430. c.offset += r);
  34431. return c.limit = c.offset,
  34432. c.offset = 0,
  34433. c
  34434. }
  34435. ,
  34436. f.isByteBuffer = function(e) {
  34437. return !0 === (e && e.__isByteBuffer__)
  34438. }
  34439. ,
  34440. f.type = function() {
  34441. return ArrayBuffer
  34442. }
  34443. ,
  34444. f.wrap = function(e, t, i, n) {
  34445. if ("string" != typeof t && (n = i,
  34446. i = t,
  34447. t = void 0),
  34448. "string" == typeof e)
  34449. switch (void 0 === t && (t = "utf8"),
  34450. t) {
  34451. case "base64":
  34452. return f.fromBase64(e, i);
  34453. case "hex":
  34454. return f.fromHex(e, i);
  34455. case "binary":
  34456. return f.fromBinary(e, i);
  34457. case "utf8":
  34458. return f.fromUTF8(e, i);
  34459. case "debug":
  34460. return f.fromDebug(e, i);
  34461. default:
  34462. throw Error("Unsupported encoding: " + t)
  34463. }
  34464. if (null === e || "object" != typeof e)
  34465. throw TypeError("Illegal buffer");
  34466. var r;
  34467. if (f.isByteBuffer(e))
  34468. return (r = a.clone.call(e)).markedOffset = -1,
  34469. r;
  34470. if (e instanceof Uint8Array)
  34471. r = new f(0,i,n),
  34472. 0 < e.length && (r.buffer = e.buffer,
  34473. r.offset = e.byteOffset,
  34474. r.limit = e.byteOffset + e.byteLength,
  34475. r.view = new Uint8Array(e.buffer));
  34476. else if (e instanceof ArrayBuffer)
  34477. r = new f(0,i,n),
  34478. 0 < e.byteLength && (r.buffer = e,
  34479. r.offset = 0,
  34480. r.limit = e.byteLength,
  34481. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34482. else {
  34483. if ("[object Array]" !== Object.prototype.toString.call(e))
  34484. throw TypeError("Illegal buffer");
  34485. (r = new f(e.length,i,n)).limit = e.length;
  34486. for (var o = 0; o < e.length; ++o)
  34487. r.view[o] = e[o]
  34488. }
  34489. return r
  34490. }
  34491. ,
  34492. a.writeBitSet = function(e, t) {
  34493. var i = void 0 === t;
  34494. if (i && (t = this.offset),
  34495. !this.noAssert) {
  34496. if (!(e instanceof Array))
  34497. throw TypeError("Illegal BitSet: Not an array");
  34498. if ("number" != typeof t || t % 1 != 0)
  34499. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34500. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34501. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34502. }
  34503. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34504. for (t += this.writeVarint32(o, t); a--; )
  34505. 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,
  34506. this.writeByte(n, t++);
  34507. if (s < o) {
  34508. var l = 0;
  34509. for (n = 0; s < o; )
  34510. n |= (1 & !!e[s++]) << l++;
  34511. this.writeByte(n, t++)
  34512. }
  34513. return i ? (this.offset = t,
  34514. this) : t - r
  34515. }
  34516. ,
  34517. a.readBitSet = function(e) {
  34518. var t = void 0 === e;
  34519. t && (e = this.offset);
  34520. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34521. for (e += n.length; o--; )
  34522. i = this.readByte(e++),
  34523. s[a++] = !!(1 & i),
  34524. s[a++] = !!(2 & i),
  34525. s[a++] = !!(4 & i),
  34526. s[a++] = !!(8 & i),
  34527. s[a++] = !!(16 & i),
  34528. s[a++] = !!(32 & i),
  34529. s[a++] = !!(64 & i),
  34530. s[a++] = !!(128 & i);
  34531. if (a < r) {
  34532. var l = 0;
  34533. for (i = this.readByte(e++); a < r; )
  34534. s[a++] = !!(i >> l++ & 1)
  34535. }
  34536. return t && (this.offset = e),
  34537. s
  34538. }
  34539. ,
  34540. a.readBytes = function(e, t) {
  34541. var i = void 0 === t;
  34542. if (i && (t = this.offset),
  34543. !this.noAssert) {
  34544. if ("number" != typeof t || t % 1 != 0)
  34545. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34546. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34547. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34548. }
  34549. var n = this.slice(t, t + e);
  34550. return i && (this.offset += e),
  34551. n
  34552. }
  34553. ,
  34554. a.writeBytes = a.append,
  34555. a.writeInt8 = function(e, t) {
  34556. var i = void 0 === t;
  34557. if (i && (t = this.offset),
  34558. !this.noAssert) {
  34559. if ("number" != typeof e || e % 1 != 0)
  34560. throw TypeError("Illegal value: " + e + " (not an integer)");
  34561. if (e |= 0,
  34562. "number" != typeof t || t % 1 != 0)
  34563. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34564. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34565. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34566. }
  34567. t += 1;
  34568. var n = this.buffer.byteLength;
  34569. return n < t && this.resize((n *= 2) > t ? n : t),
  34570. t -= 1,
  34571. this.view[t] = e,
  34572. i && (this.offset += 1),
  34573. this
  34574. }
  34575. ,
  34576. a.writeByte = a.writeInt8,
  34577. a.readInt8 = function(e) {
  34578. var t = void 0 === e;
  34579. if (t && (e = this.offset),
  34580. !this.noAssert) {
  34581. if ("number" != typeof e || e % 1 != 0)
  34582. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34583. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34584. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34585. }
  34586. var i = this.view[e];
  34587. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34588. t && (this.offset += 1),
  34589. i
  34590. }
  34591. ,
  34592. a.readByte = a.readInt8,
  34593. a.writeUint8 = function(e, t) {
  34594. var i = void 0 === t;
  34595. if (i && (t = this.offset),
  34596. !this.noAssert) {
  34597. if ("number" != typeof e || e % 1 != 0)
  34598. throw TypeError("Illegal value: " + e + " (not an integer)");
  34599. if (e >>>= 0,
  34600. "number" != typeof t || t % 1 != 0)
  34601. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34602. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34603. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34604. }
  34605. t += 1;
  34606. var n = this.buffer.byteLength;
  34607. return n < t && this.resize((n *= 2) > t ? n : t),
  34608. t -= 1,
  34609. this.view[t] = e,
  34610. i && (this.offset += 1),
  34611. this
  34612. }
  34613. ,
  34614. a.writeUInt8 = a.writeUint8,
  34615. a.readUint8 = function(e) {
  34616. var t = void 0 === e;
  34617. if (t && (e = this.offset),
  34618. !this.noAssert) {
  34619. if ("number" != typeof e || e % 1 != 0)
  34620. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34621. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34622. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34623. }
  34624. var i = this.view[e];
  34625. return t && (this.offset += 1),
  34626. i
  34627. }
  34628. ,
  34629. a.readUInt8 = a.readUint8,
  34630. a.writeInt16 = function(e, t) {
  34631. var i = void 0 === t;
  34632. if (i && (t = this.offset),
  34633. !this.noAssert) {
  34634. if ("number" != typeof e || e % 1 != 0)
  34635. throw TypeError("Illegal value: " + e + " (not an integer)");
  34636. if (e |= 0,
  34637. "number" != typeof t || t % 1 != 0)
  34638. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34639. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34640. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34641. }
  34642. t += 2;
  34643. var n = this.buffer.byteLength;
  34644. return n < t && this.resize((n *= 2) > t ? n : t),
  34645. t -= 2,
  34646. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34647. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34648. this.view[t + 1] = 255 & e),
  34649. i && (this.offset += 2),
  34650. this
  34651. }
  34652. ,
  34653. a.writeShort = a.writeInt16,
  34654. a.readInt16 = function(e) {
  34655. var t = void 0 === e;
  34656. if (t && (e = this.offset),
  34657. !this.noAssert) {
  34658. if ("number" != typeof e || e % 1 != 0)
  34659. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34660. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34661. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34662. }
  34663. var i = 0;
  34664. return this.littleEndian ? (i = this.view[e],
  34665. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34666. i |= this.view[e + 1]),
  34667. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34668. t && (this.offset += 2),
  34669. i
  34670. }
  34671. ,
  34672. a.readShort = a.readInt16,
  34673. a.writeUint16 = function(e, t) {
  34674. var i = void 0 === t;
  34675. if (i && (t = this.offset),
  34676. !this.noAssert) {
  34677. if ("number" != typeof e || e % 1 != 0)
  34678. throw TypeError("Illegal value: " + e + " (not an integer)");
  34679. if (e >>>= 0,
  34680. "number" != typeof t || t % 1 != 0)
  34681. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34682. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34683. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34684. }
  34685. t += 2;
  34686. var n = this.buffer.byteLength;
  34687. return n < t && this.resize((n *= 2) > t ? n : t),
  34688. t -= 2,
  34689. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34690. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34691. this.view[t + 1] = 255 & e),
  34692. i && (this.offset += 2),
  34693. this
  34694. }
  34695. ,
  34696. a.writeUInt16 = a.writeUint16,
  34697. a.readUint16 = function(e) {
  34698. var t = void 0 === e;
  34699. if (t && (e = this.offset),
  34700. !this.noAssert) {
  34701. if ("number" != typeof e || e % 1 != 0)
  34702. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34703. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34704. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34705. }
  34706. var i = 0;
  34707. return this.littleEndian ? (i = this.view[e],
  34708. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34709. i |= this.view[e + 1]),
  34710. t && (this.offset += 2),
  34711. i
  34712. }
  34713. ,
  34714. a.readUInt16 = a.readUint16,
  34715. a.writeInt32 = function(e, t) {
  34716. var i = void 0 === t;
  34717. if (i && (t = this.offset),
  34718. !this.noAssert) {
  34719. if ("number" != typeof e || e % 1 != 0)
  34720. throw TypeError("Illegal value: " + e + " (not an integer)");
  34721. if (e |= 0,
  34722. "number" != typeof t || t % 1 != 0)
  34723. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34724. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34725. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34726. }
  34727. t += 4;
  34728. var n = this.buffer.byteLength;
  34729. return n < t && this.resize((n *= 2) > t ? n : t),
  34730. t -= 4,
  34731. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34732. this.view[t + 2] = e >>> 16 & 255,
  34733. this.view[t + 1] = e >>> 8 & 255,
  34734. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34735. this.view[t + 1] = e >>> 16 & 255,
  34736. this.view[t + 2] = e >>> 8 & 255,
  34737. this.view[t + 3] = 255 & e),
  34738. i && (this.offset += 4),
  34739. this
  34740. }
  34741. ,
  34742. a.writeInt = a.writeInt32,
  34743. a.readInt32 = function(e) {
  34744. var t = void 0 === e;
  34745. if (t && (e = this.offset),
  34746. !this.noAssert) {
  34747. if ("number" != typeof e || e % 1 != 0)
  34748. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34749. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34750. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34751. }
  34752. var i = 0;
  34753. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34754. i |= this.view[e + 1] << 8,
  34755. i |= this.view[e],
  34756. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34757. i |= this.view[e + 2] << 8,
  34758. i |= this.view[e + 3],
  34759. i += this.view[e] << 24 >>> 0),
  34760. i |= 0,
  34761. t && (this.offset += 4),
  34762. i
  34763. }
  34764. ,
  34765. a.readInt = a.readInt32,
  34766. a.writeUint32 = function(e, t) {
  34767. var i = void 0 === t;
  34768. if (i && (t = this.offset),
  34769. !this.noAssert) {
  34770. if ("number" != typeof e || e % 1 != 0)
  34771. throw TypeError("Illegal value: " + e + " (not an integer)");
  34772. if (e >>>= 0,
  34773. "number" != typeof t || t % 1 != 0)
  34774. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34775. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34776. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34777. }
  34778. t += 4;
  34779. var n = this.buffer.byteLength;
  34780. return n < t && this.resize((n *= 2) > t ? n : t),
  34781. t -= 4,
  34782. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34783. this.view[t + 2] = e >>> 16 & 255,
  34784. this.view[t + 1] = e >>> 8 & 255,
  34785. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34786. this.view[t + 1] = e >>> 16 & 255,
  34787. this.view[t + 2] = e >>> 8 & 255,
  34788. this.view[t + 3] = 255 & e),
  34789. i && (this.offset += 4),
  34790. this
  34791. }
  34792. ,
  34793. a.writeUInt32 = a.writeUint32,
  34794. a.readUint32 = function(e) {
  34795. var t = void 0 === e;
  34796. if (t && (e = this.offset),
  34797. !this.noAssert) {
  34798. if ("number" != typeof e || e % 1 != 0)
  34799. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34800. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34801. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34802. }
  34803. var i = 0;
  34804. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34805. i |= this.view[e + 1] << 8,
  34806. i |= this.view[e],
  34807. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34808. i |= this.view[e + 2] << 8,
  34809. i |= this.view[e + 3],
  34810. i += this.view[e] << 24 >>> 0),
  34811. t && (this.offset += 4),
  34812. i
  34813. }
  34814. ,
  34815. a.readUInt32 = a.readUint32,
  34816. l && (a.writeInt64 = function(e, t) {
  34817. var i = void 0 === t;
  34818. if (i && (t = this.offset),
  34819. !this.noAssert) {
  34820. if ("number" == typeof e)
  34821. e = l.fromNumber(e);
  34822. else if ("string" == typeof e)
  34823. e = l.fromString(e);
  34824. else if (!(e && e instanceof l))
  34825. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34826. if ("number" != typeof t || t % 1 != 0)
  34827. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34828. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34829. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34830. }
  34831. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34832. t += 8;
  34833. var n = this.buffer.byteLength;
  34834. n < t && this.resize((n *= 2) > t ? n : t),
  34835. t -= 8;
  34836. var r = e.low
  34837. , o = e.high;
  34838. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34839. this.view[t + 2] = r >>> 16 & 255,
  34840. this.view[t + 1] = r >>> 8 & 255,
  34841. this.view[t] = 255 & r,
  34842. t += 4,
  34843. this.view[t + 3] = o >>> 24 & 255,
  34844. this.view[t + 2] = o >>> 16 & 255,
  34845. this.view[t + 1] = o >>> 8 & 255,
  34846. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34847. this.view[t + 1] = o >>> 16 & 255,
  34848. this.view[t + 2] = o >>> 8 & 255,
  34849. this.view[t + 3] = 255 & o,
  34850. t += 4,
  34851. this.view[t] = r >>> 24 & 255,
  34852. this.view[t + 1] = r >>> 16 & 255,
  34853. this.view[t + 2] = r >>> 8 & 255,
  34854. this.view[t + 3] = 255 & r),
  34855. i && (this.offset += 8),
  34856. this
  34857. }
  34858. ,
  34859. a.writeLong = a.writeInt64,
  34860. a.readInt64 = function(e) {
  34861. var t = void 0 === e;
  34862. if (t && (e = this.offset),
  34863. !this.noAssert) {
  34864. if ("number" != typeof e || e % 1 != 0)
  34865. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34866. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34867. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34868. }
  34869. var i = 0
  34870. , n = 0;
  34871. this.littleEndian ? (i = this.view[e + 2] << 16,
  34872. i |= this.view[e + 1] << 8,
  34873. i |= this.view[e],
  34874. i += this.view[e + 3] << 24 >>> 0,
  34875. e += 4,
  34876. n = this.view[e + 2] << 16,
  34877. n |= this.view[e + 1] << 8,
  34878. n |= this.view[e],
  34879. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34880. n |= this.view[e + 2] << 8,
  34881. n |= this.view[e + 3],
  34882. n += this.view[e] << 24 >>> 0,
  34883. e += 4,
  34884. i = this.view[e + 1] << 16,
  34885. i |= this.view[e + 2] << 8,
  34886. i |= this.view[e + 3],
  34887. i += this.view[e] << 24 >>> 0);
  34888. var r = new l(i,n,!1);
  34889. return t && (this.offset += 8),
  34890. r
  34891. }
  34892. ,
  34893. a.readLong = a.readInt64,
  34894. a.writeUint64 = function(e, t) {
  34895. var i = void 0 === t;
  34896. if (i && (t = this.offset),
  34897. !this.noAssert) {
  34898. if ("number" == typeof e)
  34899. e = l.fromNumber(e);
  34900. else if ("string" == typeof e)
  34901. e = l.fromString(e);
  34902. else if (!(e && e instanceof l))
  34903. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34904. if ("number" != typeof t || t % 1 != 0)
  34905. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34906. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34907. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34908. }
  34909. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34910. t += 8;
  34911. var n = this.buffer.byteLength;
  34912. n < t && this.resize((n *= 2) > t ? n : t),
  34913. t -= 8;
  34914. var r = e.low
  34915. , o = e.high;
  34916. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34917. this.view[t + 2] = r >>> 16 & 255,
  34918. this.view[t + 1] = r >>> 8 & 255,
  34919. this.view[t] = 255 & r,
  34920. t += 4,
  34921. this.view[t + 3] = o >>> 24 & 255,
  34922. this.view[t + 2] = o >>> 16 & 255,
  34923. this.view[t + 1] = o >>> 8 & 255,
  34924. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34925. this.view[t + 1] = o >>> 16 & 255,
  34926. this.view[t + 2] = o >>> 8 & 255,
  34927. this.view[t + 3] = 255 & o,
  34928. t += 4,
  34929. this.view[t] = r >>> 24 & 255,
  34930. this.view[t + 1] = r >>> 16 & 255,
  34931. this.view[t + 2] = r >>> 8 & 255,
  34932. this.view[t + 3] = 255 & r),
  34933. i && (this.offset += 8),
  34934. this
  34935. }
  34936. ,
  34937. a.writeUInt64 = a.writeUint64,
  34938. a.readUint64 = function(e) {
  34939. var t = void 0 === e;
  34940. if (t && (e = this.offset),
  34941. !this.noAssert) {
  34942. if ("number" != typeof e || e % 1 != 0)
  34943. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34944. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34945. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34946. }
  34947. var i = 0
  34948. , n = 0;
  34949. this.littleEndian ? (i = this.view[e + 2] << 16,
  34950. i |= this.view[e + 1] << 8,
  34951. i |= this.view[e],
  34952. i += this.view[e + 3] << 24 >>> 0,
  34953. e += 4,
  34954. n = this.view[e + 2] << 16,
  34955. n |= this.view[e + 1] << 8,
  34956. n |= this.view[e],
  34957. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34958. n |= this.view[e + 2] << 8,
  34959. n |= this.view[e + 3],
  34960. n += this.view[e] << 24 >>> 0,
  34961. e += 4,
  34962. i = this.view[e + 1] << 16,
  34963. i |= this.view[e + 2] << 8,
  34964. i |= this.view[e + 3],
  34965. i += this.view[e] << 24 >>> 0);
  34966. var r = new l(i,n,!0);
  34967. return t && (this.offset += 8),
  34968. r
  34969. }
  34970. ,
  34971. a.readUInt64 = a.readUint64),
  34972. a.writeFloat32 = function(e, t) {
  34973. var i = void 0 === t;
  34974. if (i && (t = this.offset),
  34975. !this.noAssert) {
  34976. if ("number" != typeof e)
  34977. throw TypeError("Illegal value: " + e + " (not a number)");
  34978. if ("number" != typeof t || t % 1 != 0)
  34979. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34980. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34981. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34982. }
  34983. t += 4;
  34984. var n = this.buffer.byteLength;
  34985. return n < t && this.resize((n *= 2) > t ? n : t),
  34986. t -= 4,
  34987. r(this.view, e, t, this.littleEndian, 23, 4),
  34988. i && (this.offset += 4),
  34989. this
  34990. }
  34991. ,
  34992. a.writeFloat = a.writeFloat32,
  34993. a.readFloat32 = function(e) {
  34994. var t = void 0 === e;
  34995. if (t && (e = this.offset),
  34996. !this.noAssert) {
  34997. if ("number" != typeof e || e % 1 != 0)
  34998. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34999. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35000. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35001. }
  35002. var i = n(this.view, e, this.littleEndian, 23, 4);
  35003. return t && (this.offset += 4),
  35004. i
  35005. }
  35006. ,
  35007. a.readFloat = a.readFloat32,
  35008. a.writeFloat64 = function(e, t) {
  35009. var i = void 0 === t;
  35010. if (i && (t = this.offset),
  35011. !this.noAssert) {
  35012. if ("number" != typeof e)
  35013. throw TypeError("Illegal value: " + e + " (not a number)");
  35014. if ("number" != typeof t || t % 1 != 0)
  35015. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35016. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35017. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35018. }
  35019. t += 8;
  35020. var n = this.buffer.byteLength;
  35021. return n < t && this.resize((n *= 2) > t ? n : t),
  35022. t -= 8,
  35023. r(this.view, e, t, this.littleEndian, 52, 8),
  35024. i && (this.offset += 8),
  35025. this
  35026. }
  35027. ,
  35028. a.writeDouble = a.writeFloat64,
  35029. a.readFloat64 = function(e) {
  35030. var t = void 0 === e;
  35031. if (t && (e = this.offset),
  35032. !this.noAssert) {
  35033. if ("number" != typeof e || e % 1 != 0)
  35034. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35035. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35036. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35037. }
  35038. var i = n(this.view, e, this.littleEndian, 52, 8);
  35039. return t && (this.offset += 8),
  35040. i
  35041. }
  35042. ,
  35043. a.readDouble = a.readFloat64,
  35044. f.MAX_VARINT32_BYTES = 5,
  35045. f.calculateVarint32 = function(e) {
  35046. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35047. }
  35048. ,
  35049. f.zigZagEncode32 = function(e) {
  35050. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35051. }
  35052. ,
  35053. f.zigZagDecode32 = function(e) {
  35054. return e >>> 1 ^ -(1 & e) | 0
  35055. }
  35056. ,
  35057. a.writeVarint32 = function(e, t) {
  35058. var i = void 0 === t;
  35059. if (i && (t = this.offset),
  35060. !this.noAssert) {
  35061. if ("number" != typeof e || e % 1 != 0)
  35062. throw TypeError("Illegal value: " + e + " (not an integer)");
  35063. if (e |= 0,
  35064. "number" != typeof t || t % 1 != 0)
  35065. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35066. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35067. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35068. }
  35069. var n, r = f.calculateVarint32(e);
  35070. t += r;
  35071. var o = this.buffer.byteLength;
  35072. for (o < t && this.resize((o *= 2) > t ? o : t),
  35073. t -= r,
  35074. e >>>= 0; 128 <= e; )
  35075. n = 127 & e | 128,
  35076. this.view[t++] = n,
  35077. e >>>= 7;
  35078. return this.view[t++] = e,
  35079. i ? (this.offset = t,
  35080. this) : r
  35081. }
  35082. ,
  35083. a.writeVarint32ZigZag = function(e, t) {
  35084. return this.writeVarint32(f.zigZagEncode32(e), t)
  35085. }
  35086. ,
  35087. a.readVarint32 = function(e) {
  35088. var t = void 0 === e;
  35089. if (t && (e = this.offset),
  35090. !this.noAssert) {
  35091. if ("number" != typeof e || e % 1 != 0)
  35092. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35093. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35094. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35095. }
  35096. var i, n = 0, r = 0;
  35097. do {
  35098. if (!this.noAssert && e > this.limit) {
  35099. var o = Error("Truncated");
  35100. throw o.truncated = !0,
  35101. o
  35102. }
  35103. i = this.view[e++],
  35104. n < 5 && (r |= (127 & i) << 7 * n),
  35105. ++n
  35106. } while (0 != (128 & i));return r |= 0,
  35107. t ? (this.offset = e,
  35108. r) : {
  35109. value: r,
  35110. length: n
  35111. }
  35112. }
  35113. ,
  35114. a.readVarint32ZigZag = function(e) {
  35115. var t = this.readVarint32(e);
  35116. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35117. t
  35118. }
  35119. ,
  35120. l && (f.MAX_VARINT64_BYTES = 10,
  35121. f.calculateVarint64 = function(e) {
  35122. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35123. var t = e.toInt() >>> 0
  35124. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35125. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35126. 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
  35127. }
  35128. ,
  35129. f.zigZagEncode64 = function(e) {
  35130. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35131. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35132. }
  35133. ,
  35134. f.zigZagDecode64 = function(e) {
  35135. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35136. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35137. }
  35138. ,
  35139. a.writeVarint64 = function(e, t) {
  35140. var i = void 0 === t;
  35141. if (i && (t = this.offset),
  35142. !this.noAssert) {
  35143. if ("number" == typeof e)
  35144. e = l.fromNumber(e);
  35145. else if ("string" == typeof e)
  35146. e = l.fromString(e);
  35147. else if (!(e && e instanceof l))
  35148. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35149. if ("number" != typeof t || t % 1 != 0)
  35150. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35151. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35152. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35153. }
  35154. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35155. var n = f.calculateVarint64(e)
  35156. , r = e.toInt() >>> 0
  35157. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35158. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35159. t += n;
  35160. var s = this.buffer.byteLength;
  35161. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35162. t -= n,
  35163. n) {
  35164. case 10:
  35165. this.view[t + 9] = a >>> 7 & 1;
  35166. case 9:
  35167. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35168. case 8:
  35169. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35170. case 7:
  35171. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35172. case 6:
  35173. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35174. case 5:
  35175. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35176. case 4:
  35177. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35178. case 3:
  35179. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35180. case 2:
  35181. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35182. case 1:
  35183. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35184. }
  35185. return i ? (this.offset += n,
  35186. this) : n
  35187. }
  35188. ,
  35189. a.writeVarint64ZigZag = function(e, t) {
  35190. return this.writeVarint64(f.zigZagEncode64(e), t)
  35191. }
  35192. ,
  35193. a.readVarint64 = function(e) {
  35194. var t = void 0 === e;
  35195. if (t && (e = this.offset),
  35196. !this.noAssert) {
  35197. if ("number" != typeof e || e % 1 != 0)
  35198. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35199. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35200. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35201. }
  35202. var i = e
  35203. , n = 0
  35204. , r = 0
  35205. , o = 0
  35206. , a = 0;
  35207. if (n = 127 & (a = this.view[e++]),
  35208. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35209. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35210. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35211. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35212. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35213. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35214. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35215. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35216. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35217. 128 & a || this.noAssert && void 0 === a))))))))))
  35218. throw Error("Buffer overrun");
  35219. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35220. return t ? (this.offset = e,
  35221. s) : {
  35222. value: s,
  35223. length: e - i
  35224. }
  35225. }
  35226. ,
  35227. a.readVarint64ZigZag = function(e) {
  35228. var t = this.readVarint64(e);
  35229. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35230. t
  35231. }
  35232. ),
  35233. a.writeCString = function(e, t) {
  35234. var i = void 0 === t;
  35235. i && (t = this.offset);
  35236. var n, r = e.length;
  35237. if (!this.noAssert) {
  35238. if ("string" != typeof e)
  35239. throw TypeError("Illegal str: Not a string");
  35240. for (n = 0; n < r; ++n)
  35241. if (0 === e.charCodeAt(n))
  35242. throw RangeError("Illegal str: Contains NULL-characters");
  35243. if ("number" != typeof t || t % 1 != 0)
  35244. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35245. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35246. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35247. }
  35248. r = d.calculateUTF16asUTF8(s(e))[1],
  35249. t += r + 1;
  35250. var o = this.buffer.byteLength;
  35251. return o < t && this.resize((o *= 2) > t ? o : t),
  35252. t -= r + 1,
  35253. d.encodeUTF16toUTF8(s(e), function(e) {
  35254. this.view[t++] = e
  35255. }
  35256. .bind(this)),
  35257. this.view[t++] = 0,
  35258. i ? (this.offset = t,
  35259. this) : r
  35260. }
  35261. ,
  35262. a.readCString = 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, n = e, r = -1;
  35272. return d.decodeUTF8toUTF16(function() {
  35273. if (0 === r)
  35274. return null;
  35275. if (e >= this.limit)
  35276. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35277. return 0 === (r = this.view[e++]) ? null : r
  35278. }
  35279. .bind(this), i = c(), !0),
  35280. t ? (this.offset = e,
  35281. i()) : {
  35282. string: i(),
  35283. length: e - n
  35284. }
  35285. }
  35286. ,
  35287. a.writeIString = function(e, t) {
  35288. var i = void 0 === t;
  35289. if (i && (t = this.offset),
  35290. !this.noAssert) {
  35291. if ("string" != typeof e)
  35292. throw TypeError("Illegal str: Not a string");
  35293. if ("number" != typeof t || t % 1 != 0)
  35294. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35295. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35296. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35297. }
  35298. var n, r = t;
  35299. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35300. t += 4 + n;
  35301. var o = this.buffer.byteLength;
  35302. if (o < t && this.resize((o *= 2) > t ? o : t),
  35303. t -= 4 + n,
  35304. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35305. this.view[t + 2] = n >>> 16 & 255,
  35306. this.view[t + 1] = n >>> 8 & 255,
  35307. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35308. this.view[t + 1] = n >>> 16 & 255,
  35309. this.view[t + 2] = n >>> 8 & 255,
  35310. this.view[t + 3] = 255 & n),
  35311. t += 4,
  35312. d.encodeUTF16toUTF8(s(e), function(e) {
  35313. this.view[t++] = e
  35314. }
  35315. .bind(this)),
  35316. t !== r + 4 + n)
  35317. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35318. return i ? (this.offset = t,
  35319. this) : t - r
  35320. }
  35321. ,
  35322. a.readIString = function(e) {
  35323. var t = void 0 === e;
  35324. if (t && (e = this.offset),
  35325. !this.noAssert) {
  35326. if ("number" != typeof e || e % 1 != 0)
  35327. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35328. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35329. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35330. }
  35331. var i = e
  35332. , n = this.readUint32(e)
  35333. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35334. return e += r.length,
  35335. t ? (this.offset = e,
  35336. r.string) : {
  35337. string: r.string,
  35338. length: e - i
  35339. }
  35340. }
  35341. ,
  35342. f.METRICS_CHARS = "c",
  35343. f.METRICS_BYTES = "b",
  35344. a.writeUTF8String = function(e, t) {
  35345. var i = void 0 === t;
  35346. if (i && (t = this.offset),
  35347. !this.noAssert) {
  35348. if ("number" != typeof t || t % 1 != 0)
  35349. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35350. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35351. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35352. }
  35353. var n, r = t;
  35354. n = d.calculateUTF16asUTF8(s(e))[1],
  35355. t += n;
  35356. var o = this.buffer.byteLength;
  35357. return o < t && this.resize((o *= 2) > t ? o : t),
  35358. t -= n,
  35359. d.encodeUTF16toUTF8(s(e), function(e) {
  35360. this.view[t++] = e
  35361. }
  35362. .bind(this)),
  35363. i ? (this.offset = t,
  35364. this) : t - r
  35365. }
  35366. ,
  35367. a.writeString = a.writeUTF8String,
  35368. f.calculateUTF8Chars = function(e) {
  35369. return d.calculateUTF16asUTF8(s(e))[0]
  35370. }
  35371. ,
  35372. f.calculateUTF8Bytes = function(e) {
  35373. return d.calculateUTF16asUTF8(s(e))[1]
  35374. }
  35375. ,
  35376. f.calculateString = f.calculateUTF8Bytes,
  35377. a.readUTF8String = function(e, t, i) {
  35378. "number" == typeof t && (i = t,
  35379. t = void 0);
  35380. var n = void 0 === i;
  35381. if (n && (i = this.offset),
  35382. void 0 === t && (t = f.METRICS_CHARS),
  35383. !this.noAssert) {
  35384. if ("number" != typeof e || e % 1 != 0)
  35385. throw TypeError("Illegal length: " + e + " (not an integer)");
  35386. if (e |= 0,
  35387. "number" != typeof i || i % 1 != 0)
  35388. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35389. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35390. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35391. }
  35392. var r, o = 0, a = i;
  35393. if (t === f.METRICS_CHARS) {
  35394. if (r = c(),
  35395. d.decodeUTF8(function() {
  35396. return o < e && i < this.limit ? this.view[i++] : null
  35397. }
  35398. .bind(this), function(e) {
  35399. ++o,
  35400. d.UTF8toUTF16(e, r)
  35401. }),
  35402. o !== e)
  35403. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35404. return n ? (this.offset = i,
  35405. r()) : {
  35406. string: r(),
  35407. length: i - a
  35408. }
  35409. }
  35410. if (t !== f.METRICS_BYTES)
  35411. throw TypeError("Unsupported metrics: " + t);
  35412. if (!this.noAssert) {
  35413. if ("number" != typeof i || i % 1 != 0)
  35414. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35415. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35416. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35417. }
  35418. var s = i + e;
  35419. if (d.decodeUTF8toUTF16(function() {
  35420. return i < s ? this.view[i++] : null
  35421. }
  35422. .bind(this), r = c(), this.noAssert),
  35423. i !== s)
  35424. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35425. return n ? (this.offset = i,
  35426. r()) : {
  35427. string: r(),
  35428. length: i - a
  35429. }
  35430. }
  35431. ,
  35432. a.readString = a.readUTF8String,
  35433. a.writeVString = function(e, t) {
  35434. var i = void 0 === t;
  35435. if (i && (t = this.offset),
  35436. !this.noAssert) {
  35437. if ("string" != typeof e)
  35438. throw TypeError("Illegal str: Not a string");
  35439. if ("number" != typeof t || t % 1 != 0)
  35440. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35441. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35442. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35443. }
  35444. var n, r, o = t;
  35445. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35446. r = f.calculateVarint32(n),
  35447. t += r + n;
  35448. var a = this.buffer.byteLength;
  35449. if (a < t && this.resize((a *= 2) > t ? a : t),
  35450. t -= r + n,
  35451. t += this.writeVarint32(n, t),
  35452. d.encodeUTF16toUTF8(s(e), function(e) {
  35453. this.view[t++] = e
  35454. }
  35455. .bind(this)),
  35456. t !== o + n + r)
  35457. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35458. return i ? (this.offset = t,
  35459. this) : t - o
  35460. }
  35461. ,
  35462. a.readVString = function(e) {
  35463. var t = void 0 === e;
  35464. if (t && (e = this.offset),
  35465. !this.noAssert) {
  35466. if ("number" != typeof e || e % 1 != 0)
  35467. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35468. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35469. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35470. }
  35471. var i = e
  35472. , n = this.readVarint32(e)
  35473. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35474. return e += r.length,
  35475. t ? (this.offset = e,
  35476. r.string) : {
  35477. string: r.string,
  35478. length: e - i
  35479. }
  35480. }
  35481. ,
  35482. a.append = function(e, t, i) {
  35483. "number" != typeof t && "string" == typeof t || (i = t,
  35484. t = void 0);
  35485. var n = void 0 === i;
  35486. if (n && (i = this.offset),
  35487. !this.noAssert) {
  35488. if ("number" != typeof i || i % 1 != 0)
  35489. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35490. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35491. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35492. }
  35493. e instanceof f || (e = f.wrap(e, t));
  35494. var r = e.limit - e.offset;
  35495. if (r <= 0)
  35496. return this;
  35497. i += r;
  35498. var o = this.buffer.byteLength;
  35499. return o < i && this.resize((o *= 2) > i ? o : i),
  35500. i -= r,
  35501. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35502. e.offset += r,
  35503. n && (this.offset += r),
  35504. this
  35505. }
  35506. ,
  35507. a.appendTo = function(e, t) {
  35508. return e.append(this, t),
  35509. this
  35510. }
  35511. ,
  35512. a.assert = function(e) {
  35513. return this.noAssert = !e,
  35514. this
  35515. }
  35516. ,
  35517. a.capacity = function() {
  35518. return this.buffer.byteLength
  35519. }
  35520. ,
  35521. a.clear = function() {
  35522. return this.offset = 0,
  35523. this.limit = this.buffer.byteLength,
  35524. this.markedOffset = -1,
  35525. this
  35526. }
  35527. ,
  35528. a.clone = function(e) {
  35529. var t = new f(0,this.littleEndian,this.noAssert);
  35530. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35531. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35532. t.view = this.view),
  35533. t.offset = this.offset,
  35534. t.markedOffset = this.markedOffset,
  35535. t.limit = this.limit,
  35536. t
  35537. }
  35538. ,
  35539. a.compact = function(e, t) {
  35540. if (void 0 === e && (e = this.offset),
  35541. void 0 === t && (t = this.limit),
  35542. !this.noAssert) {
  35543. if ("number" != typeof e || e % 1 != 0)
  35544. throw TypeError("Illegal begin: Not an integer");
  35545. if (e >>>= 0,
  35546. "number" != typeof t || t % 1 != 0)
  35547. throw TypeError("Illegal end: Not an integer");
  35548. if (t >>>= 0,
  35549. e < 0 || t < e || t > this.buffer.byteLength)
  35550. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35551. }
  35552. if (0 === e && t === this.buffer.byteLength)
  35553. return this;
  35554. var i = t - e;
  35555. if (0 == i)
  35556. return this.buffer = o,
  35557. this.view = null,
  35558. 0 <= this.markedOffset && (this.markedOffset -= e),
  35559. this.offset = 0,
  35560. this.limit = 0,
  35561. this;
  35562. var n = new ArrayBuffer(i)
  35563. , r = new Uint8Array(n);
  35564. return r.set(this.view.subarray(e, t)),
  35565. this.buffer = n,
  35566. this.view = r,
  35567. 0 <= this.markedOffset && (this.markedOffset -= e),
  35568. this.offset = 0,
  35569. this.limit = i,
  35570. this
  35571. }
  35572. ,
  35573. a.copy = function(e, t) {
  35574. if (void 0 === e && (e = this.offset),
  35575. void 0 === t && (t = this.limit),
  35576. !this.noAssert) {
  35577. if ("number" != typeof e || e % 1 != 0)
  35578. throw TypeError("Illegal begin: Not an integer");
  35579. if (e >>>= 0,
  35580. "number" != typeof t || t % 1 != 0)
  35581. throw TypeError("Illegal end: Not an integer");
  35582. if (t >>>= 0,
  35583. e < 0 || t < e || t > this.buffer.byteLength)
  35584. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35585. }
  35586. if (e === t)
  35587. return new f(0,this.littleEndian,this.noAssert);
  35588. var i = t - e
  35589. , n = new f(i,this.littleEndian,this.noAssert);
  35590. return n.offset = 0,
  35591. n.limit = i,
  35592. 0 <= n.markedOffset && (n.markedOffset -= e),
  35593. this.copyTo(n, 0, e, t),
  35594. n
  35595. }
  35596. ,
  35597. a.copyTo = function(e, t, i, n) {
  35598. var r, o;
  35599. if (!this.noAssert && !f.isByteBuffer(e))
  35600. throw TypeError("Illegal target: Not a ByteBuffer");
  35601. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35602. i = (r = void 0 === i) ? this.offset : 0 | i,
  35603. n = void 0 === n ? this.limit : 0 | n,
  35604. t < 0 || t > e.buffer.byteLength)
  35605. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35606. if (i < 0 || n > this.buffer.byteLength)
  35607. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35608. var a = n - i;
  35609. return 0 == a ? e : (e.ensureCapacity(t + a),
  35610. e.view.set(this.view.subarray(i, n), t),
  35611. r && (this.offset += a),
  35612. o && (e.offset += a),
  35613. this)
  35614. }
  35615. ,
  35616. a.ensureCapacity = function(e) {
  35617. var t = this.buffer.byteLength;
  35618. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35619. }
  35620. ,
  35621. a.fill = function(e, t, i) {
  35622. var n = void 0 === t;
  35623. if (n && (t = this.offset),
  35624. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35625. void 0 === t && (t = this.offset),
  35626. void 0 === i && (i = this.limit),
  35627. !this.noAssert) {
  35628. if ("number" != typeof e || e % 1 != 0)
  35629. throw TypeError("Illegal value: " + e + " (not an integer)");
  35630. if (e |= 0,
  35631. "number" != typeof t || t % 1 != 0)
  35632. throw TypeError("Illegal begin: Not an integer");
  35633. if (t >>>= 0,
  35634. "number" != typeof i || i % 1 != 0)
  35635. throw TypeError("Illegal end: Not an integer");
  35636. if (i >>>= 0,
  35637. t < 0 || i < t || i > this.buffer.byteLength)
  35638. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35639. }
  35640. if (i <= t)
  35641. return this;
  35642. for (; t < i; )
  35643. this.view[t++] = e;
  35644. return n && (this.offset = t),
  35645. this
  35646. }
  35647. ,
  35648. a.flip = function() {
  35649. return this.limit = this.offset,
  35650. this.offset = 0,
  35651. this
  35652. }
  35653. ,
  35654. a.mark = function(e) {
  35655. if (e = void 0 === e ? this.offset : e,
  35656. !this.noAssert) {
  35657. if ("number" != typeof e || e % 1 != 0)
  35658. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35659. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35660. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35661. }
  35662. return this.markedOffset = e,
  35663. this
  35664. }
  35665. ,
  35666. a.order = function(e) {
  35667. if (!this.noAssert && "boolean" != typeof e)
  35668. throw TypeError("Illegal littleEndian: Not a boolean");
  35669. return this.littleEndian = !!e,
  35670. this
  35671. }
  35672. ,
  35673. a.LE = function(e) {
  35674. return this.littleEndian = void 0 === e || !!e,
  35675. this
  35676. }
  35677. ,
  35678. a.BE = function(e) {
  35679. return this.littleEndian = void 0 !== e && !e,
  35680. this
  35681. }
  35682. ,
  35683. a.prepend = function(e, t, i) {
  35684. "number" != typeof t && "string" == typeof t || (i = t,
  35685. t = void 0);
  35686. var n = void 0 === i;
  35687. if (n && (i = this.offset),
  35688. !this.noAssert) {
  35689. if ("number" != typeof i || i % 1 != 0)
  35690. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35691. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35692. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35693. }
  35694. e instanceof f || (e = f.wrap(e, t));
  35695. var r = e.limit - e.offset;
  35696. if (r <= 0)
  35697. return this;
  35698. var o = r - i;
  35699. if (0 < o) {
  35700. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35701. , s = new Uint8Array(a);
  35702. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35703. this.buffer = a,
  35704. this.view = s,
  35705. this.offset += o,
  35706. 0 <= this.markedOffset && (this.markedOffset += o),
  35707. this.limit += o,
  35708. i += o
  35709. } else
  35710. new Uint8Array(this.buffer);
  35711. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35712. e.offset = e.limit,
  35713. n && (this.offset -= r),
  35714. this
  35715. }
  35716. ,
  35717. a.prependTo = function(e, t) {
  35718. return e.prepend(this, t),
  35719. this
  35720. }
  35721. ,
  35722. a.printDebug = function(e) {
  35723. "function" != typeof e && (e = console.log.bind(console)),
  35724. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35725. }
  35726. ,
  35727. a.remaining = function() {
  35728. return this.limit - this.offset
  35729. }
  35730. ,
  35731. a.reset = function() {
  35732. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35733. this.markedOffset = -1) : this.offset = 0,
  35734. this
  35735. }
  35736. ,
  35737. a.resize = function(e) {
  35738. if (!this.noAssert) {
  35739. if ("number" != typeof e || e % 1 != 0)
  35740. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35741. if ((e |= 0) < 0)
  35742. throw RangeError("Illegal capacity: 0 <= " + e)
  35743. }
  35744. if (this.buffer.byteLength < e) {
  35745. var t = new ArrayBuffer(e)
  35746. , i = new Uint8Array(t);
  35747. i.set(this.view),
  35748. this.buffer = t,
  35749. this.view = i
  35750. }
  35751. return this
  35752. }
  35753. ,
  35754. a.reverse = function(e, t) {
  35755. if (void 0 === e && (e = this.offset),
  35756. void 0 === t && (t = this.limit),
  35757. !this.noAssert) {
  35758. if ("number" != typeof e || e % 1 != 0)
  35759. throw TypeError("Illegal begin: Not an integer");
  35760. if (e >>>= 0,
  35761. "number" != typeof t || t % 1 != 0)
  35762. throw TypeError("Illegal end: Not an integer");
  35763. if (t >>>= 0,
  35764. e < 0 || t < e || t > this.buffer.byteLength)
  35765. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35766. }
  35767. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35768. this
  35769. }
  35770. ,
  35771. a.skip = function(e) {
  35772. if (!this.noAssert) {
  35773. if ("number" != typeof e || e % 1 != 0)
  35774. throw TypeError("Illegal length: " + e + " (not an integer)");
  35775. e |= 0
  35776. }
  35777. var t = this.offset + e;
  35778. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35779. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35780. return this.offset = t,
  35781. this
  35782. }
  35783. ,
  35784. a.slice = function(e, t) {
  35785. if (void 0 === e && (e = this.offset),
  35786. void 0 === t && (t = this.limit),
  35787. !this.noAssert) {
  35788. if ("number" != typeof e || e % 1 != 0)
  35789. throw TypeError("Illegal begin: Not an integer");
  35790. if (e >>>= 0,
  35791. "number" != typeof t || t % 1 != 0)
  35792. throw TypeError("Illegal end: Not an integer");
  35793. if (t >>>= 0,
  35794. e < 0 || t < e || t > this.buffer.byteLength)
  35795. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35796. }
  35797. var i = this.clone();
  35798. return i.offset = e,
  35799. i.limit = t,
  35800. i
  35801. }
  35802. ,
  35803. a.toBuffer = function(e) {
  35804. var t = this.offset
  35805. , i = this.limit;
  35806. if (!this.noAssert) {
  35807. if ("number" != typeof t || t % 1 != 0)
  35808. throw TypeError("Illegal offset: Not an integer");
  35809. if (t >>>= 0,
  35810. "number" != typeof i || i % 1 != 0)
  35811. throw TypeError("Illegal limit: Not an integer");
  35812. if (i >>>= 0,
  35813. t < 0 || i < t || i > this.buffer.byteLength)
  35814. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35815. }
  35816. if (!e && 0 === t && i === this.buffer.byteLength)
  35817. return this.buffer;
  35818. if (t === i)
  35819. return o;
  35820. var n = new ArrayBuffer(i - t);
  35821. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35822. n
  35823. }
  35824. ,
  35825. a.toArrayBuffer = a.toBuffer,
  35826. a.toString = function(e, t, i) {
  35827. if (void 0 === e)
  35828. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35829. switch ("number" == typeof e && (i = t = e = "utf8"),
  35830. e) {
  35831. case "utf8":
  35832. return this.toUTF8(t, i);
  35833. case "base64":
  35834. return this.toBase64(t, i);
  35835. case "hex":
  35836. return this.toHex(t, i);
  35837. case "binary":
  35838. return this.toBinary(t, i);
  35839. case "debug":
  35840. return this.toDebug();
  35841. case "columns":
  35842. return this.toColumns();
  35843. default:
  35844. throw Error("Unsupported encoding: " + e)
  35845. }
  35846. }
  35847. ;
  35848. var h = function() {
  35849. 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)
  35850. a[r[t]] = t;
  35851. return e.encode = function(e, t) {
  35852. for (var i, n; null !== (i = e()); )
  35853. t(r[i >> 2 & 63]),
  35854. n = (3 & i) << 4,
  35855. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35856. n = (15 & i) << 2,
  35857. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35858. t(r[63 & i])) : (t(r[63 & n]),
  35859. t(61))) : (t(r[63 & n]),
  35860. t(61),
  35861. t(61))
  35862. }
  35863. ,
  35864. e.decode = function(e, t) {
  35865. function i(e) {
  35866. throw Error("Illegal character code: " + e)
  35867. }
  35868. for (var n, r, o; null !== (n = e()); )
  35869. if (void 0 === (r = a[n]) && i(n),
  35870. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35871. t(r << 2 >>> 0 | (48 & o) >> 4),
  35872. null !== (n = e()))) {
  35873. if (void 0 === (r = a[n])) {
  35874. if (61 === n)
  35875. break;
  35876. i(n)
  35877. }
  35878. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35879. null !== (n = e())) {
  35880. if (void 0 === (o = a[n])) {
  35881. if (61 === n)
  35882. break;
  35883. i(n)
  35884. }
  35885. t((3 & r) << 6 >>> 0 | o)
  35886. }
  35887. }
  35888. }
  35889. ,
  35890. e.test = function(e) {
  35891. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35892. }
  35893. ,
  35894. e
  35895. }();
  35896. a.toBase64 = function(e, t) {
  35897. if (void 0 === e && (e = this.offset),
  35898. void 0 === t && (t = this.limit),
  35899. t |= 0,
  35900. (e |= 0) < 0 || t > this.capacity || t < e)
  35901. throw RangeError("begin, end");
  35902. var i;
  35903. return h.encode(function() {
  35904. return e < t ? this.view[e++] : null
  35905. }
  35906. .bind(this), i = c()),
  35907. i()
  35908. }
  35909. ,
  35910. f.fromBase64 = function(e, t) {
  35911. if ("string" != typeof e)
  35912. throw TypeError("str");
  35913. var i = new f(e.length / 4 * 3,t)
  35914. , n = 0;
  35915. return h.decode(s(e), function(e) {
  35916. i.view[n++] = e
  35917. }),
  35918. i.limit = n,
  35919. i
  35920. }
  35921. ,
  35922. f.btoa = function(e) {
  35923. return f.fromBinary(e).toBase64()
  35924. }
  35925. ,
  35926. f.atob = function(e) {
  35927. return f.fromBase64(e).toBinary()
  35928. }
  35929. ,
  35930. a.toBinary = function(e, t) {
  35931. if (void 0 === e && (e = this.offset),
  35932. void 0 === t && (t = this.limit),
  35933. t |= 0,
  35934. (e |= 0) < 0 || t > this.capacity() || t < e)
  35935. throw RangeError("begin, end");
  35936. if (e === t)
  35937. return "";
  35938. for (var i = [], n = []; e < t; )
  35939. i.push(this.view[e++]),
  35940. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35941. i = []);
  35942. return n.join("") + String.fromCharCode.apply(String, i)
  35943. }
  35944. ,
  35945. f.fromBinary = function(e, t) {
  35946. if ("string" != typeof e)
  35947. throw TypeError("str");
  35948. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35949. if (255 < (i = e.charCodeAt(n)))
  35950. throw RangeError("illegal char code: " + i);
  35951. o.view[n++] = i
  35952. }
  35953. return o.limit = r,
  35954. o
  35955. }
  35956. ,
  35957. a.toDebug = function(e) {
  35958. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35959. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35960. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35961. ++i,
  35962. e && 0 < i && i % 16 == 0 && i !== n) {
  35963. for (; r.length < 51; )
  35964. r += " ";
  35965. a += r + o + "\n",
  35966. r = o = ""
  35967. }
  35968. 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 ? " " : ""
  35969. }
  35970. if (e && " " !== r) {
  35971. for (; r.length < 51; )
  35972. r += " ";
  35973. a += r + o + "\n"
  35974. }
  35975. return e ? a : r
  35976. }
  35977. ,
  35978. f.fromDebug = function(e, t, i) {
  35979. 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; ) {
  35980. switch (n = e.charAt(s++)) {
  35981. case "!":
  35982. if (!i) {
  35983. if (h || u || d) {
  35984. p = !0;
  35985. break
  35986. }
  35987. h = u = d = !0
  35988. }
  35989. a.offset = a.markedOffset = a.limit = l,
  35990. c = !1;
  35991. break;
  35992. case "|":
  35993. if (!i) {
  35994. if (h || d) {
  35995. p = !0;
  35996. break
  35997. }
  35998. h = d = !0
  35999. }
  36000. a.offset = a.limit = l,
  36001. c = !1;
  36002. break;
  36003. case "[":
  36004. if (!i) {
  36005. if (h || u) {
  36006. p = !0;
  36007. break
  36008. }
  36009. h = u = !0
  36010. }
  36011. a.offset = a.markedOffset = l,
  36012. c = !1;
  36013. break;
  36014. case "<":
  36015. if (!i) {
  36016. if (h) {
  36017. p = !0;
  36018. break
  36019. }
  36020. h = !0
  36021. }
  36022. a.offset = l,
  36023. c = !1;
  36024. break;
  36025. case "]":
  36026. if (!i) {
  36027. if (d || u) {
  36028. p = !0;
  36029. break
  36030. }
  36031. d = u = !0
  36032. }
  36033. a.limit = a.markedOffset = l,
  36034. c = !1;
  36035. break;
  36036. case ">":
  36037. if (!i) {
  36038. if (d) {
  36039. p = !0;
  36040. break
  36041. }
  36042. d = !0
  36043. }
  36044. a.limit = l,
  36045. c = !1;
  36046. break;
  36047. case "'":
  36048. if (!i) {
  36049. if (u) {
  36050. p = !0;
  36051. break
  36052. }
  36053. u = !0
  36054. }
  36055. a.markedOffset = l,
  36056. c = !1;
  36057. break;
  36058. case " ":
  36059. c = !1;
  36060. break;
  36061. default:
  36062. if (!i && c) {
  36063. p = !0;
  36064. break
  36065. }
  36066. if (r = parseInt(n + e.charAt(s++), 16),
  36067. !i && (isNaN(r) || r < 0 || 255 < r))
  36068. throw TypeError("Illegal str: Not a debug encoded string");
  36069. a.view[l++] = r,
  36070. c = !0
  36071. }
  36072. if (p)
  36073. throw TypeError("Illegal str: Invalid symbol at " + s)
  36074. }
  36075. if (!i) {
  36076. if (!h || !d)
  36077. throw TypeError("Illegal str: Missing offset or limit");
  36078. if (l < a.buffer.byteLength)
  36079. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36080. }
  36081. return a
  36082. }
  36083. ,
  36084. a.toHex = function(e, t) {
  36085. if (e = void 0 === e ? this.offset : e,
  36086. t = void 0 === t ? this.limit : t,
  36087. !this.noAssert) {
  36088. if ("number" != typeof e || e % 1 != 0)
  36089. throw TypeError("Illegal begin: Not an integer");
  36090. if (e >>>= 0,
  36091. "number" != typeof t || t % 1 != 0)
  36092. throw TypeError("Illegal end: Not an integer");
  36093. if (t >>>= 0,
  36094. e < 0 || t < e || t > this.buffer.byteLength)
  36095. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36096. }
  36097. for (var i, n = new Array(t - e); e < t; )
  36098. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36099. return n.join("")
  36100. }
  36101. ,
  36102. f.fromHex = function(e, t, i) {
  36103. if (!i) {
  36104. if ("string" != typeof e)
  36105. throw TypeError("Illegal str: Not a string");
  36106. if (e.length % 2 != 0)
  36107. throw TypeError("Illegal str: Length not a multiple of 2")
  36108. }
  36109. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36110. if (n = parseInt(e.substring(a, a + 2), 16),
  36111. !i && (!isFinite(n) || n < 0 || 255 < n))
  36112. throw TypeError("Illegal str: Contains non-hex characters");
  36113. o.view[s++] = n
  36114. }
  36115. return o.limit = s,
  36116. o
  36117. }
  36118. ;
  36119. var u, d = u = {
  36120. MAX_CODEPOINT: 1114111,
  36121. encodeUTF8: function(e, t) {
  36122. var i = null;
  36123. for ("number" == typeof e && (i = e,
  36124. e = function() {
  36125. return null
  36126. }
  36127. ); null !== i || null !== (i = e()); )
  36128. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36129. t(i >> 12 & 63 | 128)),
  36130. t(i >> 6 & 63 | 128)),
  36131. t(63 & i | 128)),
  36132. i = null
  36133. },
  36134. decodeUTF8: function(e, t) {
  36135. for (var i, n, r, o, a = function(e) {
  36136. e = e.slice(0, e.indexOf(null));
  36137. var t = Error(e.toString());
  36138. throw t.name = "TruncatedError",
  36139. t.bytes = e,
  36140. t
  36141. }; null !== (i = e()); )
  36142. if (0 == (128 & i))
  36143. t(i);
  36144. else if (192 == (224 & i))
  36145. null === (n = e()) && a([i, n]),
  36146. t((31 & i) << 6 | 63 & n);
  36147. else if (224 == (240 & i))
  36148. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36149. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36150. else {
  36151. if (240 != (248 & i))
  36152. throw RangeError("Illegal starting byte: " + i);
  36153. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36154. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36155. }
  36156. },
  36157. UTF16toUTF8: function(e, t) {
  36158. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36159. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36160. n = null) : t(i);
  36161. null !== n && t(n)
  36162. },
  36163. UTF8toUTF16: function(e, t) {
  36164. var i = null;
  36165. for ("number" == typeof e && (i = e,
  36166. e = function() {
  36167. return null
  36168. }
  36169. ); null !== i || null !== (i = e()); )
  36170. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36171. t(i % 1024 + 56320)),
  36172. i = null
  36173. },
  36174. encodeUTF16toUTF8: function(e, t) {
  36175. u.UTF16toUTF8(e, function(e) {
  36176. u.encodeUTF8(e, t)
  36177. })
  36178. },
  36179. decodeUTF8toUTF16: function(e, t) {
  36180. u.decodeUTF8(e, function(e) {
  36181. u.UTF8toUTF16(e, t)
  36182. })
  36183. },
  36184. calculateCodePoint: function(e) {
  36185. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36186. },
  36187. calculateUTF8: function(e) {
  36188. for (var t, i = 0; null !== (t = e()); )
  36189. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36190. return i
  36191. },
  36192. calculateUTF16asUTF8: function(e) {
  36193. var t = 0
  36194. , i = 0;
  36195. return u.UTF16toUTF8(e, function(e) {
  36196. ++t,
  36197. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36198. }),
  36199. [t, i]
  36200. }
  36201. };
  36202. return a.toUTF8 = function(t, i) {
  36203. if (void 0 === t && (t = this.offset),
  36204. void 0 === i && (i = this.limit),
  36205. !this.noAssert) {
  36206. if ("number" != typeof t || t % 1 != 0)
  36207. throw TypeError("Illegal begin: Not an integer");
  36208. if (t >>>= 0,
  36209. "number" != typeof i || i % 1 != 0)
  36210. throw TypeError("Illegal end: Not an integer");
  36211. if (i >>>= 0,
  36212. t < 0 || i < t || i > this.buffer.byteLength)
  36213. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36214. }
  36215. var e;
  36216. try {
  36217. d.decodeUTF8toUTF16(function() {
  36218. return t < i ? this.view[t++] : null
  36219. }
  36220. .bind(this), e = c())
  36221. } catch (e) {
  36222. if (t !== i)
  36223. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36224. }
  36225. return e()
  36226. }
  36227. ,
  36228. f.fromUTF8 = function(e, t, i) {
  36229. if (!i && "string" != typeof e)
  36230. throw TypeError("Illegal str: Not a string");
  36231. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36232. , r = 0;
  36233. return d.encodeUTF16toUTF8(s(e), function(e) {
  36234. n.view[r++] = e
  36235. }),
  36236. n.limit = r,
  36237. n
  36238. }
  36239. ,
  36240. f
  36241. }
  36242. ,
  36243. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36244. var e;
  36245. try {
  36246. e = t("long")
  36247. } catch (e) {}
  36248. return r(e)
  36249. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36250. }
  36251. , {
  36252. long: 216
  36253. }],
  36254. 216: [function(e, t, i) {
  36255. var n, r;
  36256. n = this,
  36257. r = function() {
  36258. "use strict";
  36259. function n(e, t, i) {
  36260. this.low = 0 | e,
  36261. this.high = 0 | t,
  36262. this.unsigned = !!i
  36263. }
  36264. function p(e) {
  36265. return !0 === (e && e.__isLong__)
  36266. }
  36267. function e(e, t) {
  36268. var i, n, r;
  36269. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36270. r && (a[e] = i),
  36271. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36272. r && (o[e] = i),
  36273. i)
  36274. }
  36275. function f(e, t) {
  36276. if (isNaN(e) || !isFinite(e))
  36277. return t ? l : y;
  36278. if (t) {
  36279. if (e < 0)
  36280. return l;
  36281. if (r <= e)
  36282. return I
  36283. } else {
  36284. if (e <= -s)
  36285. return E;
  36286. if (s <= e + 1)
  36287. return C
  36288. }
  36289. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36290. }
  36291. function g(e, t, i) {
  36292. return new n(e,t,i)
  36293. }
  36294. function h(e, t, i) {
  36295. if (0 === e.length)
  36296. throw Error("empty string");
  36297. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36298. return y;
  36299. if (t = "number" == typeof t ? (i = t,
  36300. !1) : !!t,
  36301. (i = i || 10) < 2 || 36 < i)
  36302. throw RangeError("radix");
  36303. var n;
  36304. if (0 < (n = e.indexOf("-")))
  36305. throw Error("interior hyphen");
  36306. if (0 === n)
  36307. return h(e.substring(1), t, i).neg();
  36308. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36309. var s = Math.min(8, e.length - a)
  36310. , l = parseInt(e.substring(a, a + s), i);
  36311. if (s < 8) {
  36312. var c = f(u(i, s));
  36313. o = o.mul(c).add(f(l))
  36314. } else
  36315. o = (o = o.mul(r)).add(f(l))
  36316. }
  36317. return o.unsigned = t,
  36318. o
  36319. }
  36320. function m(e) {
  36321. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36322. }
  36323. Object.defineProperty(n.prototype, "__isLong__", {
  36324. value: !0,
  36325. enumerable: !1,
  36326. configurable: !1
  36327. }),
  36328. n.isLong = p;
  36329. var o = {}
  36330. , a = {};
  36331. n.fromInt = e,
  36332. n.fromNumber = f,
  36333. n.fromBits = g;
  36334. var u = Math.pow;
  36335. n.fromString = h,
  36336. n.fromValue = m;
  36337. var i = 4294967296
  36338. , r = 0x10000000000000000
  36339. , s = r / 2
  36340. , v = e(1 << 24)
  36341. , y = e(0);
  36342. n.ZERO = y;
  36343. var l = e(0, !0);
  36344. n.UZERO = l;
  36345. var c = e(1);
  36346. n.ONE = c;
  36347. var d = e(1, !0);
  36348. n.UONE = d;
  36349. var A = e(-1);
  36350. n.NEG_ONE = A;
  36351. var C = g(-1, 2147483647, !1);
  36352. n.MAX_VALUE = C;
  36353. var I = g(-1, -1, !0);
  36354. n.MAX_UNSIGNED_VALUE = I;
  36355. var E = g(0, -2147483648, !1);
  36356. n.MIN_VALUE = E;
  36357. var t = n.prototype;
  36358. return t.toInt = function() {
  36359. return this.unsigned ? this.low >>> 0 : this.low
  36360. }
  36361. ,
  36362. t.toNumber = function() {
  36363. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36364. }
  36365. ,
  36366. t.toString = function(e) {
  36367. if ((e = e || 10) < 2 || 36 < e)
  36368. throw RangeError("radix");
  36369. if (this.isZero())
  36370. return "0";
  36371. if (this.isNegative()) {
  36372. if (this.eq(E)) {
  36373. var t = f(e)
  36374. , i = this.div(t)
  36375. , n = i.mul(t).sub(this);
  36376. return i.toString(e) + n.toInt().toString(e)
  36377. }
  36378. return "-" + this.neg().toString(e)
  36379. }
  36380. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36381. var s = o.div(r)
  36382. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36383. if ((o = s).isZero())
  36384. return l + a;
  36385. for (; l.length < 6; )
  36386. l = "0" + l;
  36387. a = "" + l + a
  36388. }
  36389. }
  36390. ,
  36391. t.getHighBits = function() {
  36392. return this.high
  36393. }
  36394. ,
  36395. t.getHighBitsUnsigned = function() {
  36396. return this.high >>> 0
  36397. }
  36398. ,
  36399. t.getLowBits = function() {
  36400. return this.low
  36401. }
  36402. ,
  36403. t.getLowBitsUnsigned = function() {
  36404. return this.low >>> 0
  36405. }
  36406. ,
  36407. t.getNumBitsAbs = function() {
  36408. if (this.isNegative())
  36409. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36410. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36411. ;
  36412. return 0 != this.high ? t + 33 : t + 1
  36413. }
  36414. ,
  36415. t.isZero = function() {
  36416. return 0 === this.high && 0 === this.low
  36417. }
  36418. ,
  36419. t.isNegative = function() {
  36420. return !this.unsigned && this.high < 0
  36421. }
  36422. ,
  36423. t.isPositive = function() {
  36424. return this.unsigned || 0 <= this.high
  36425. }
  36426. ,
  36427. t.isOdd = function() {
  36428. return 1 == (1 & this.low)
  36429. }
  36430. ,
  36431. t.isEven = function() {
  36432. return 0 == (1 & this.low)
  36433. }
  36434. ,
  36435. t.equals = function(e) {
  36436. return p(e) || (e = m(e)),
  36437. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36438. }
  36439. ,
  36440. t.eq = t.equals,
  36441. t.notEquals = function(e) {
  36442. return !this.eq(e)
  36443. }
  36444. ,
  36445. t.neq = t.notEquals,
  36446. t.lessThan = function(e) {
  36447. return this.comp(e) < 0
  36448. }
  36449. ,
  36450. t.lt = t.lessThan,
  36451. t.lessThanOrEqual = function(e) {
  36452. return this.comp(e) <= 0
  36453. }
  36454. ,
  36455. t.lte = t.lessThanOrEqual,
  36456. t.greaterThan = function(e) {
  36457. return 0 < this.comp(e)
  36458. }
  36459. ,
  36460. t.gt = t.greaterThan,
  36461. t.greaterThanOrEqual = function(e) {
  36462. return 0 <= this.comp(e)
  36463. }
  36464. ,
  36465. t.gte = t.greaterThanOrEqual,
  36466. t.compare = function(e) {
  36467. if (p(e) || (e = m(e)),
  36468. this.eq(e))
  36469. return 0;
  36470. var t = this.isNegative()
  36471. , i = e.isNegative();
  36472. 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
  36473. }
  36474. ,
  36475. t.comp = t.compare,
  36476. t.negate = function() {
  36477. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36478. }
  36479. ,
  36480. t.neg = t.negate,
  36481. t.add = function(e) {
  36482. p(e) || (e = m(e));
  36483. var t = this.high >>> 16
  36484. , i = 65535 & this.high
  36485. , n = this.low >>> 16
  36486. , r = 65535 & this.low
  36487. , o = e.high >>> 16
  36488. , a = 65535 & e.high
  36489. , s = e.low >>> 16
  36490. , l = 0
  36491. , c = 0
  36492. , h = 0
  36493. , u = 0;
  36494. return h += (u += r + (65535 & e.low)) >>> 16,
  36495. c += (h += n + s) >>> 16,
  36496. l += (c += i + a) >>> 16,
  36497. l += t + o,
  36498. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36499. }
  36500. ,
  36501. t.subtract = function(e) {
  36502. return p(e) || (e = m(e)),
  36503. this.add(e.neg())
  36504. }
  36505. ,
  36506. t.sub = t.subtract,
  36507. t.multiply = function(e) {
  36508. if (this.isZero())
  36509. return y;
  36510. if (p(e) || (e = m(e)),
  36511. e.isZero())
  36512. return y;
  36513. if (this.eq(E))
  36514. return e.isOdd() ? E : y;
  36515. if (e.eq(E))
  36516. return this.isOdd() ? E : y;
  36517. if (this.isNegative())
  36518. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36519. if (e.isNegative())
  36520. return this.mul(e.neg()).neg();
  36521. if (this.lt(v) && e.lt(v))
  36522. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36523. var t = this.high >>> 16
  36524. , i = 65535 & this.high
  36525. , n = this.low >>> 16
  36526. , r = 65535 & this.low
  36527. , o = e.high >>> 16
  36528. , a = 65535 & e.high
  36529. , s = e.low >>> 16
  36530. , l = 65535 & e.low
  36531. , c = 0
  36532. , h = 0
  36533. , u = 0
  36534. , d = 0;
  36535. return u += (d += r * l) >>> 16,
  36536. h += (u += n * l) >>> 16,
  36537. u &= 65535,
  36538. h += (u += r * s) >>> 16,
  36539. c += (h += i * l) >>> 16,
  36540. h &= 65535,
  36541. c += (h += n * s) >>> 16,
  36542. h &= 65535,
  36543. c += (h += r * a) >>> 16,
  36544. c += t * l + i * s + n * a + r * o,
  36545. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36546. }
  36547. ,
  36548. t.mul = t.multiply,
  36549. t.divide = function(e) {
  36550. if (p(e) || (e = m(e)),
  36551. e.isZero())
  36552. throw Error("division by zero");
  36553. if (this.isZero())
  36554. return this.unsigned ? l : y;
  36555. var t, i, n;
  36556. if (this.unsigned) {
  36557. if (e.unsigned || (e = e.toUnsigned()),
  36558. e.gt(this))
  36559. return l;
  36560. if (e.gt(this.shru(1)))
  36561. return d;
  36562. n = l
  36563. } else {
  36564. if (this.eq(E))
  36565. 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)),
  36566. n = t.add(i.div(e)));
  36567. if (e.eq(E))
  36568. return this.unsigned ? l : y;
  36569. if (this.isNegative())
  36570. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36571. if (e.isNegative())
  36572. return this.div(e.neg()).neg();
  36573. n = y
  36574. }
  36575. for (i = this; i.gte(e); ) {
  36576. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36577. 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); )
  36578. s = (a = f(t -= o, this.unsigned)).mul(e);
  36579. a.isZero() && (a = c),
  36580. n = n.add(a),
  36581. i = i.sub(s)
  36582. }
  36583. return n
  36584. }
  36585. ,
  36586. t.div = t.divide,
  36587. t.modulo = function(e) {
  36588. return p(e) || (e = m(e)),
  36589. this.sub(this.div(e).mul(e))
  36590. }
  36591. ,
  36592. t.mod = t.modulo,
  36593. t.not = function() {
  36594. return g(~this.low, ~this.high, this.unsigned)
  36595. }
  36596. ,
  36597. t.and = function(e) {
  36598. return p(e) || (e = m(e)),
  36599. g(this.low & e.low, this.high & e.high, this.unsigned)
  36600. }
  36601. ,
  36602. t.or = function(e) {
  36603. return p(e) || (e = m(e)),
  36604. g(this.low | e.low, this.high | e.high, this.unsigned)
  36605. }
  36606. ,
  36607. t.xor = function(e) {
  36608. return p(e) || (e = m(e)),
  36609. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36610. }
  36611. ,
  36612. t.shiftLeft = function(e) {
  36613. return p(e) && (e = e.toInt()),
  36614. 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)
  36615. }
  36616. ,
  36617. t.shl = t.shiftLeft,
  36618. t.shiftRight = function(e) {
  36619. return p(e) && (e = e.toInt()),
  36620. 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)
  36621. }
  36622. ,
  36623. t.shr = t.shiftRight,
  36624. t.shiftRightUnsigned = function(e) {
  36625. if (p(e) && (e = e.toInt()),
  36626. 0 === (e &= 63))
  36627. return this;
  36628. var t = this.high;
  36629. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36630. }
  36631. ,
  36632. t.shru = t.shiftRightUnsigned,
  36633. t.toSigned = function() {
  36634. return this.unsigned ? g(this.low, this.high, !1) : this
  36635. }
  36636. ,
  36637. t.toUnsigned = function() {
  36638. return this.unsigned ? this : g(this.low, this.high, !0)
  36639. }
  36640. ,
  36641. t.toBytes = function(e) {
  36642. return e ? this.toBytesLE() : this.toBytesBE()
  36643. }
  36644. ,
  36645. t.toBytesLE = function() {
  36646. var e = this.high
  36647. , t = this.low;
  36648. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36649. }
  36650. ,
  36651. t.toBytesBE = function() {
  36652. var e = this.high
  36653. , t = this.low;
  36654. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36655. }
  36656. ,
  36657. n
  36658. }
  36659. ,
  36660. "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()
  36661. }
  36662. , {}],
  36663. 217: [function(e, t, i) {
  36664. 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 = {
  36665. REVISION: "75"
  36666. };
  36667. function Ii(e, t) {
  36668. return e.distance - t.distance
  36669. }
  36670. function Ei(e, t, i, n) {
  36671. if (!1 !== e.visible && (e.raycast(t, i),
  36672. !0 === n))
  36673. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36674. Ei(r[o], t, i, !0)
  36675. }
  36676. function _i(e, t, i) {
  36677. return i < 0 && (i += 1),
  36678. 1 < i && (i -= 1),
  36679. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36680. }
  36681. function bi(e, t, i, n, r, o, a) {
  36682. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36683. r.multiplyScalar(Vt.x),
  36684. o.multiplyScalar(Vt.y),
  36685. a.multiplyScalar(Vt.z),
  36686. r.add(o).add(a),
  36687. r.clone()
  36688. }
  36689. function wi(e, t, i, n, r, o, a) {
  36690. var s = e.material;
  36691. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36692. return null;
  36693. Ut.copy(a),
  36694. Ut.applyMatrix4(e.matrixWorld);
  36695. var l = t.ray.origin.distanceTo(Ut);
  36696. return l < t.near || l > t.far ? null : {
  36697. distance: l,
  36698. point: Ut.clone(),
  36699. object: e
  36700. }
  36701. }
  36702. function Ti(e, t, i, n, r, o, a, s) {
  36703. Mt.fromArray(n, 3 * o),
  36704. Rt.fromArray(n, 3 * a),
  36705. Pt.fromArray(n, 3 * s);
  36706. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36707. return l && (r && (Nt.fromArray(r, 2 * o),
  36708. Ft.fromArray(r, 2 * a),
  36709. Bt.fromArray(r, 2 * s),
  36710. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36711. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36712. l.faceIndex = o),
  36713. l
  36714. }
  36715. function xi() {}
  36716. function Si(e, t, i, n, r, o) {
  36717. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36718. if (s = e[o[t]].x,
  36719. l = e[o[t]].y,
  36720. c = e[o[i]].x,
  36721. h = e[o[i]].y,
  36722. u = e[o[n]].x,
  36723. d = e[o[n]].y,
  36724. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36725. return !1;
  36726. for (g = u - c,
  36727. m = d - h,
  36728. v = s - u,
  36729. y = l - d,
  36730. A = c - s,
  36731. C = h - l,
  36732. a = 0; a < r; a++)
  36733. if (p = e[o[a]].x,
  36734. f = e[o[a]].y,
  36735. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36736. E = v * (f - d) - y * (p - u),
  36737. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36738. return !1;
  36739. return !0
  36740. }
  36741. function Mi(e) {
  36742. switch (e) {
  36743. case Ci.LinearEncoding:
  36744. return ["Linear", "( value )"];
  36745. case Ci.sRGBEncoding:
  36746. return ["sRGB", "( value )"];
  36747. case Ci.RGBEEncoding:
  36748. return ["RGBE", "( value )"];
  36749. case Ci.RGBM7Encoding:
  36750. return ["RGBM", "( value, 7.0 )"];
  36751. case Ci.RGBM16Encoding:
  36752. return ["RGBM", "( value, 16.0 )"];
  36753. case Ci.RGBDEncoding:
  36754. return ["RGBD", "( value, 256.0 )"];
  36755. case Ci.GammaEncoding:
  36756. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36757. default:
  36758. throw new Error("unsupported encoding: " + e)
  36759. }
  36760. }
  36761. function Ri(e, t) {
  36762. var i = Mi(t);
  36763. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36764. }
  36765. function Pi(e) {
  36766. return "" !== e
  36767. }
  36768. function Oi(e, t) {
  36769. 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)
  36770. }
  36771. function Li(e) {
  36772. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36773. var i = Ci.ShaderChunk[t];
  36774. if (void 0 === i)
  36775. throw new Error("Can not resolve #include <" + t + ">");
  36776. return Li(i)
  36777. })
  36778. }
  36779. function Di(e) {
  36780. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36781. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36782. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36783. return r
  36784. })
  36785. }
  36786. function Ni(e, t, i, n) {
  36787. gi.set(t, i, n).unproject(mi);
  36788. var r = fi[e];
  36789. if (void 0 !== r)
  36790. for (var o = 0, a = r.length; o < a; o++)
  36791. pi.vertices[r[o]].copy(gi)
  36792. }
  36793. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36794. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36795. void 0 === Math.sign && (Math.sign = function(e) {
  36796. return e < 0 ? -1 : 0 < e ? 1 : +e
  36797. }
  36798. ),
  36799. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36800. get: function() {
  36801. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36802. }
  36803. }),
  36804. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36805. writable: !0,
  36806. configurable: !0,
  36807. value: function(e) {
  36808. "use strict";
  36809. if (null == e)
  36810. throw new TypeError("Cannot convert first argument to object");
  36811. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36812. var r = arguments[i];
  36813. if (null != r) {
  36814. r = Object(r);
  36815. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36816. var l = o[a]
  36817. , c = Object.getOwnPropertyDescriptor(r, l);
  36818. void 0 !== c && c.enumerable && (t[l] = r[l])
  36819. }
  36820. }
  36821. }
  36822. return t
  36823. }
  36824. }),
  36825. Ci.MOUSE = {
  36826. LEFT: 0,
  36827. MIDDLE: 1,
  36828. RIGHT: 2
  36829. },
  36830. Ci.CullFaceNone = 0,
  36831. Ci.CullFaceBack = 1,
  36832. Ci.CullFaceFront = 2,
  36833. Ci.CullFaceFrontBack = 3,
  36834. Ci.FrontFaceDirectionCW = 0,
  36835. Ci.FrontFaceDirectionCCW = 1,
  36836. Ci.BasicShadowMap = 0,
  36837. Ci.PCFShadowMap = 1,
  36838. Ci.PCFSoftShadowMap = 2,
  36839. Ci.FrontSide = 0,
  36840. Ci.BackSide = 1,
  36841. Ci.DoubleSide = 2,
  36842. Ci.FlatShading = 1,
  36843. Ci.SmoothShading = 2,
  36844. Ci.NoColors = 0,
  36845. Ci.FaceColors = 1,
  36846. Ci.VertexColors = 2,
  36847. Ci.NoBlending = 0,
  36848. Ci.NormalBlending = 1,
  36849. Ci.AdditiveBlending = 2,
  36850. Ci.SubtractiveBlending = 3,
  36851. Ci.MultiplyBlending = 4,
  36852. Ci.CustomBlending = 5,
  36853. Ci.AddEquation = 100,
  36854. Ci.SubtractEquation = 101,
  36855. Ci.ReverseSubtractEquation = 102,
  36856. Ci.MinEquation = 103,
  36857. Ci.MaxEquation = 104,
  36858. Ci.ZeroFactor = 200,
  36859. Ci.OneFactor = 201,
  36860. Ci.SrcColorFactor = 202,
  36861. Ci.OneMinusSrcColorFactor = 203,
  36862. Ci.SrcAlphaFactor = 204,
  36863. Ci.OneMinusSrcAlphaFactor = 205,
  36864. Ci.DstAlphaFactor = 206,
  36865. Ci.OneMinusDstAlphaFactor = 207,
  36866. Ci.DstColorFactor = 208,
  36867. Ci.OneMinusDstColorFactor = 209,
  36868. Ci.SrcAlphaSaturateFactor = 210,
  36869. Ci.NeverDepth = 0,
  36870. Ci.AlwaysDepth = 1,
  36871. Ci.LessDepth = 2,
  36872. Ci.LessEqualDepth = 3,
  36873. Ci.EqualDepth = 4,
  36874. Ci.GreaterEqualDepth = 5,
  36875. Ci.GreaterDepth = 6,
  36876. Ci.NotEqualDepth = 7,
  36877. Ci.MultiplyOperation = 0,
  36878. Ci.MixOperation = 1,
  36879. Ci.AddOperation = 2,
  36880. Ci.NoToneMapping = 0,
  36881. Ci.LinearToneMapping = 1,
  36882. Ci.ReinhardToneMapping = 2,
  36883. Ci.Uncharted2ToneMapping = 3,
  36884. Ci.CineonToneMapping = 4,
  36885. Ci.UVMapping = 300,
  36886. Ci.CubeReflectionMapping = 301,
  36887. Ci.CubeRefractionMapping = 302,
  36888. Ci.EquirectangularReflectionMapping = 303,
  36889. Ci.EquirectangularRefractionMapping = 304,
  36890. Ci.SphericalReflectionMapping = 305,
  36891. Ci.CubeUVReflectionMapping = 306,
  36892. Ci.CubeUVRefractionMapping = 307,
  36893. Ci.RepeatWrapping = 1e3,
  36894. Ci.ClampToEdgeWrapping = 1001,
  36895. Ci.MirroredRepeatWrapping = 1002,
  36896. Ci.NearestFilter = 1003,
  36897. Ci.NearestMipMapNearestFilter = 1004,
  36898. Ci.NearestMipMapLinearFilter = 1005,
  36899. Ci.LinearFilter = 1006,
  36900. Ci.LinearMipMapNearestFilter = 1007,
  36901. Ci.LinearMipMapLinearFilter = 1008,
  36902. Ci.UnsignedByteType = 1009,
  36903. Ci.ByteType = 1010,
  36904. Ci.ShortType = 1011,
  36905. Ci.UnsignedShortType = 1012,
  36906. Ci.IntType = 1013,
  36907. Ci.UnsignedIntType = 1014,
  36908. Ci.FloatType = 1015,
  36909. Ci.HalfFloatType = 1025,
  36910. Ci.UnsignedShort4444Type = 1016,
  36911. Ci.UnsignedShort5551Type = 1017,
  36912. Ci.UnsignedShort565Type = 1018,
  36913. Ci.AlphaFormat = 1019,
  36914. Ci.RGBFormat = 1020,
  36915. Ci.RGBAFormat = 1021,
  36916. Ci.LuminanceFormat = 1022,
  36917. Ci.LuminanceAlphaFormat = 1023,
  36918. Ci.RGBEFormat = Ci.RGBAFormat,
  36919. Ci.RGB_S3TC_DXT1_Format = 2001,
  36920. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36921. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36922. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36923. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36924. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36925. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36926. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36927. Ci.RGB_ETC1_Format = 2151,
  36928. Ci.LoopOnce = 2200,
  36929. Ci.LoopRepeat = 2201,
  36930. Ci.LoopPingPong = 2202,
  36931. Ci.InterpolateDiscrete = 2300,
  36932. Ci.InterpolateLinear = 2301,
  36933. Ci.InterpolateSmooth = 2302,
  36934. Ci.ZeroCurvatureEnding = 2400,
  36935. Ci.ZeroSlopeEnding = 2401,
  36936. Ci.WrapAroundEnding = 2402,
  36937. Ci.TrianglesDrawMode = 0,
  36938. Ci.TriangleStripDrawMode = 1,
  36939. Ci.TriangleFanDrawMode = 2,
  36940. Ci.LinearEncoding = 3e3,
  36941. Ci.sRGBEncoding = 3001,
  36942. Ci.GammaEncoding = 3007,
  36943. Ci.RGBEEncoding = 3002,
  36944. Ci.LogLuvEncoding = 3003,
  36945. Ci.RGBM7Encoding = 3004,
  36946. Ci.RGBM16Encoding = 3005,
  36947. Ci.RGBDEncoding = 3006,
  36948. Ci.Color = function(e) {
  36949. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36950. }
  36951. ,
  36952. Ci.Color.prototype = {
  36953. constructor: Ci.Color,
  36954. r: 1,
  36955. g: 1,
  36956. b: 1,
  36957. set: function(e) {
  36958. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36959. this
  36960. },
  36961. setScalar: function(e) {
  36962. this.r = e,
  36963. this.g = e,
  36964. this.b = e
  36965. },
  36966. setHex: function(e) {
  36967. return e = Math.floor(e),
  36968. this.r = (e >> 16 & 255) / 255,
  36969. this.g = (e >> 8 & 255) / 255,
  36970. this.b = (255 & e) / 255,
  36971. this
  36972. },
  36973. setRGB: function(e, t, i) {
  36974. return this.r = e,
  36975. this.g = t,
  36976. this.b = i,
  36977. this
  36978. },
  36979. setHSL: function(e, t, i) {
  36980. if (e = Ci.Math.euclideanModulo(e, 1),
  36981. t = Ci.Math.clamp(t, 0, 1),
  36982. i = Ci.Math.clamp(i, 0, 1),
  36983. 0 === t)
  36984. this.r = this.g = this.b = i;
  36985. else {
  36986. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36987. , r = 2 * i - n;
  36988. this.r = _i(r, n, e + 1 / 3),
  36989. this.g = _i(r, n, e),
  36990. this.b = _i(r, n, e - 1 / 3)
  36991. }
  36992. return this
  36993. },
  36994. setStyle: function(t) {
  36995. function e(e) {
  36996. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36997. }
  36998. var i;
  36999. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37000. var n, r = i[1], o = i[2];
  37001. switch (r) {
  37002. case "rgb":
  37003. case "rgba":
  37004. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37005. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37006. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37007. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37008. e(n[5]),
  37009. this;
  37010. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37011. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37012. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37013. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37014. e(n[5]),
  37015. this;
  37016. break;
  37017. case "hsl":
  37018. case "hsla":
  37019. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37020. var a = parseFloat(n[1]) / 360
  37021. , s = parseInt(n[2], 10) / 100
  37022. , l = parseInt(n[3], 10) / 100;
  37023. return e(n[5]),
  37024. this.setHSL(a, s, l)
  37025. }
  37026. }
  37027. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37028. var c, h = (c = i[1]).length;
  37029. if (3 === h)
  37030. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37031. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37032. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37033. this;
  37034. if (6 === h)
  37035. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37036. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37037. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37038. this
  37039. }
  37040. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37041. return this
  37042. },
  37043. clone: function() {
  37044. return new this.constructor(this.r,this.g,this.b)
  37045. },
  37046. copy: function(e) {
  37047. return this.r = e.r,
  37048. this.g = e.g,
  37049. this.b = e.b,
  37050. this
  37051. },
  37052. copyGammaToLinear: function(e, t) {
  37053. return void 0 === t && (t = 2),
  37054. this.r = Math.pow(e.r, t),
  37055. this.g = Math.pow(e.g, t),
  37056. this.b = Math.pow(e.b, t),
  37057. this
  37058. },
  37059. copyLinearToGamma: function(e, t) {
  37060. void 0 === t && (t = 2);
  37061. var i = 0 < t ? 1 / t : 1;
  37062. return this.r = Math.pow(e.r, i),
  37063. this.g = Math.pow(e.g, i),
  37064. this.b = Math.pow(e.b, i),
  37065. this
  37066. },
  37067. convertGammaToLinear: function() {
  37068. var e = this.r
  37069. , t = this.g
  37070. , i = this.b;
  37071. return this.r = e * e,
  37072. this.g = t * t,
  37073. this.b = i * i,
  37074. this
  37075. },
  37076. convertLinearToGamma: function() {
  37077. return this.r = Math.sqrt(this.r),
  37078. this.g = Math.sqrt(this.g),
  37079. this.b = Math.sqrt(this.b),
  37080. this
  37081. },
  37082. getHex: function() {
  37083. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37084. },
  37085. getHexString: function() {
  37086. return ("000000" + this.getHex().toString(16)).slice(-6)
  37087. },
  37088. getHSL: function(e) {
  37089. var t, i, n = e || {
  37090. h: 0,
  37091. s: 0,
  37092. l: 0
  37093. }, 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;
  37094. if (l === s)
  37095. i = t = 0;
  37096. else {
  37097. var h = s - l;
  37098. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37099. s) {
  37100. case r:
  37101. t = (o - a) / h + (o < a ? 6 : 0);
  37102. break;
  37103. case o:
  37104. t = (a - r) / h + 2;
  37105. break;
  37106. case a:
  37107. t = (r - o) / h + 4
  37108. }
  37109. t /= 6
  37110. }
  37111. return n.h = t,
  37112. n.s = i,
  37113. n.l = c,
  37114. n
  37115. },
  37116. getStyle: function() {
  37117. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37118. },
  37119. offsetHSL: function(e, t, i) {
  37120. var n = this.getHSL();
  37121. return n.h += e,
  37122. n.s += t,
  37123. n.l += i,
  37124. this.setHSL(n.h, n.s, n.l),
  37125. this
  37126. },
  37127. add: function(e) {
  37128. return this.r += e.r,
  37129. this.g += e.g,
  37130. this.b += e.b,
  37131. this
  37132. },
  37133. addColors: function(e, t) {
  37134. return this.r = e.r + t.r,
  37135. this.g = e.g + t.g,
  37136. this.b = e.b + t.b,
  37137. this
  37138. },
  37139. addScalar: function(e) {
  37140. return this.r += e,
  37141. this.g += e,
  37142. this.b += e,
  37143. this
  37144. },
  37145. multiply: function(e) {
  37146. return this.r *= e.r,
  37147. this.g *= e.g,
  37148. this.b *= e.b,
  37149. this
  37150. },
  37151. multiplyScalar: function(e) {
  37152. return this.r *= e,
  37153. this.g *= e,
  37154. this.b *= e,
  37155. this
  37156. },
  37157. lerp: function(e, t) {
  37158. return this.r += (e.r - this.r) * t,
  37159. this.g += (e.g - this.g) * t,
  37160. this.b += (e.b - this.b) * t,
  37161. this
  37162. },
  37163. equals: function(e) {
  37164. return e.r === this.r && e.g === this.g && e.b === this.b
  37165. },
  37166. fromArray: function(e, t) {
  37167. return void 0 === t && (t = 0),
  37168. this.r = e[t],
  37169. this.g = e[t + 1],
  37170. this.b = e[t + 2],
  37171. this
  37172. },
  37173. toArray: function(e, t) {
  37174. return void 0 === e && (e = []),
  37175. void 0 === t && (t = 0),
  37176. e[t] = this.r,
  37177. e[t + 1] = this.g,
  37178. e[t + 2] = this.b,
  37179. e
  37180. }
  37181. },
  37182. Ci.ColorKeywords = {
  37183. aliceblue: 15792383,
  37184. antiquewhite: 16444375,
  37185. aqua: 65535,
  37186. aquamarine: 8388564,
  37187. azure: 15794175,
  37188. beige: 16119260,
  37189. bisque: 16770244,
  37190. black: 0,
  37191. blanchedalmond: 16772045,
  37192. blue: 255,
  37193. blueviolet: 9055202,
  37194. brown: 10824234,
  37195. burlywood: 14596231,
  37196. cadetblue: 6266528,
  37197. chartreuse: 8388352,
  37198. chocolate: 13789470,
  37199. coral: 16744272,
  37200. cornflowerblue: 6591981,
  37201. cornsilk: 16775388,
  37202. crimson: 14423100,
  37203. cyan: 65535,
  37204. darkblue: 139,
  37205. darkcyan: 35723,
  37206. darkgoldenrod: 12092939,
  37207. darkgray: 11119017,
  37208. darkgreen: 25600,
  37209. darkgrey: 11119017,
  37210. darkkhaki: 12433259,
  37211. darkmagenta: 9109643,
  37212. darkolivegreen: 5597999,
  37213. darkorange: 16747520,
  37214. darkorchid: 10040012,
  37215. darkred: 9109504,
  37216. darksalmon: 15308410,
  37217. darkseagreen: 9419919,
  37218. darkslateblue: 4734347,
  37219. darkslategray: 3100495,
  37220. darkslategrey: 3100495,
  37221. darkturquoise: 52945,
  37222. darkviolet: 9699539,
  37223. deeppink: 16716947,
  37224. deepskyblue: 49151,
  37225. dimgray: 6908265,
  37226. dimgrey: 6908265,
  37227. dodgerblue: 2003199,
  37228. firebrick: 11674146,
  37229. floralwhite: 16775920,
  37230. forestgreen: 2263842,
  37231. fuchsia: 16711935,
  37232. gainsboro: 14474460,
  37233. ghostwhite: 16316671,
  37234. gold: 16766720,
  37235. goldenrod: 14329120,
  37236. gray: 8421504,
  37237. green: 32768,
  37238. greenyellow: 11403055,
  37239. grey: 8421504,
  37240. honeydew: 15794160,
  37241. hotpink: 16738740,
  37242. indianred: 13458524,
  37243. indigo: 4915330,
  37244. ivory: 16777200,
  37245. khaki: 15787660,
  37246. lavender: 15132410,
  37247. lavenderblush: 16773365,
  37248. lawngreen: 8190976,
  37249. lemonchiffon: 16775885,
  37250. lightblue: 11393254,
  37251. lightcoral: 15761536,
  37252. lightcyan: 14745599,
  37253. lightgoldenrodyellow: 16448210,
  37254. lightgray: 13882323,
  37255. lightgreen: 9498256,
  37256. lightgrey: 13882323,
  37257. lightpink: 16758465,
  37258. lightsalmon: 16752762,
  37259. lightseagreen: 2142890,
  37260. lightskyblue: 8900346,
  37261. lightslategray: 7833753,
  37262. lightslategrey: 7833753,
  37263. lightsteelblue: 11584734,
  37264. lightyellow: 16777184,
  37265. lime: 65280,
  37266. limegreen: 3329330,
  37267. linen: 16445670,
  37268. magenta: 16711935,
  37269. maroon: 8388608,
  37270. mediumaquamarine: 6737322,
  37271. mediumblue: 205,
  37272. mediumorchid: 12211667,
  37273. mediumpurple: 9662683,
  37274. mediumseagreen: 3978097,
  37275. mediumslateblue: 8087790,
  37276. mediumspringgreen: 64154,
  37277. mediumturquoise: 4772300,
  37278. mediumvioletred: 13047173,
  37279. midnightblue: 1644912,
  37280. mintcream: 16121850,
  37281. mistyrose: 16770273,
  37282. moccasin: 16770229,
  37283. navajowhite: 16768685,
  37284. navy: 128,
  37285. oldlace: 16643558,
  37286. olive: 8421376,
  37287. olivedrab: 7048739,
  37288. orange: 16753920,
  37289. orangered: 16729344,
  37290. orchid: 14315734,
  37291. palegoldenrod: 15657130,
  37292. palegreen: 10025880,
  37293. paleturquoise: 11529966,
  37294. palevioletred: 14381203,
  37295. papayawhip: 16773077,
  37296. peachpuff: 16767673,
  37297. peru: 13468991,
  37298. pink: 16761035,
  37299. plum: 14524637,
  37300. powderblue: 11591910,
  37301. purple: 8388736,
  37302. red: 16711680,
  37303. rosybrown: 12357519,
  37304. royalblue: 4286945,
  37305. saddlebrown: 9127187,
  37306. salmon: 16416882,
  37307. sandybrown: 16032864,
  37308. seagreen: 3050327,
  37309. seashell: 16774638,
  37310. sienna: 10506797,
  37311. silver: 12632256,
  37312. skyblue: 8900331,
  37313. slateblue: 6970061,
  37314. slategray: 7372944,
  37315. slategrey: 7372944,
  37316. snow: 16775930,
  37317. springgreen: 65407,
  37318. steelblue: 4620980,
  37319. tan: 13808780,
  37320. teal: 32896,
  37321. thistle: 14204888,
  37322. tomato: 16737095,
  37323. turquoise: 4251856,
  37324. violet: 15631086,
  37325. wheat: 16113331,
  37326. white: 16777215,
  37327. whitesmoke: 16119285,
  37328. yellow: 16776960,
  37329. yellowgreen: 10145074
  37330. },
  37331. Ci.Quaternion = function(e, t, i, n) {
  37332. this._x = e || 0,
  37333. this._y = t || 0,
  37334. this._z = i || 0,
  37335. this._w = void 0 !== n ? n : 1
  37336. }
  37337. ,
  37338. Ci.Quaternion.prototype = {
  37339. constructor: Ci.Quaternion,
  37340. get x() {
  37341. return this._x
  37342. },
  37343. set x(e) {
  37344. this._x = e,
  37345. this.onChangeCallback()
  37346. },
  37347. get y() {
  37348. return this._y
  37349. },
  37350. set y(e) {
  37351. this._y = e,
  37352. this.onChangeCallback()
  37353. },
  37354. get z() {
  37355. return this._z
  37356. },
  37357. set z(e) {
  37358. this._z = e,
  37359. this.onChangeCallback()
  37360. },
  37361. get w() {
  37362. return this._w
  37363. },
  37364. set w(e) {
  37365. this._w = e,
  37366. this.onChangeCallback()
  37367. },
  37368. set: function(e, t, i, n) {
  37369. return this._x = e,
  37370. this._y = t,
  37371. this._z = i,
  37372. this._w = n,
  37373. this.onChangeCallback(),
  37374. this
  37375. },
  37376. clone: function() {
  37377. return new this.constructor(this._x,this._y,this._z,this._w)
  37378. },
  37379. toObject:function(){//add
  37380. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37381. },
  37382. copy: function(e) {
  37383. return this._x = e.x,
  37384. this._y = e.y,
  37385. this._z = e.z,
  37386. this._w = e.w,
  37387. this.onChangeCallback(),
  37388. this
  37389. },
  37390. setFromEuler: function(e, t) {
  37391. if (e instanceof Ci.Euler == 0)
  37392. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37393. var i = Math.cos(e._x / 2)
  37394. , n = Math.cos(e._y / 2)
  37395. , r = Math.cos(e._z / 2)
  37396. , o = Math.sin(e._x / 2)
  37397. , a = Math.sin(e._y / 2)
  37398. , s = Math.sin(e._z / 2)
  37399. , l = e.order;
  37400. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37401. this._y = i * a * r - o * n * s,
  37402. this._z = i * n * s + o * a * r,
  37403. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37404. this._y = i * a * r - o * n * s,
  37405. this._z = i * n * s - o * a * r,
  37406. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37407. this._y = i * a * r + o * n * s,
  37408. this._z = i * n * s + o * a * r,
  37409. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37410. this._y = i * a * r + o * n * s,
  37411. this._z = i * n * s - o * a * r,
  37412. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37413. this._y = i * a * r + o * n * s,
  37414. this._z = i * n * s - o * a * r,
  37415. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37416. this._y = i * a * r - o * n * s,
  37417. this._z = i * n * s + o * a * r,
  37418. this._w = i * n * r + o * a * s),
  37419. !1 !== t && this.onChangeCallback(),
  37420. this
  37421. },
  37422. setFromAxisAngle: function(e, t) {
  37423. var i = t / 2
  37424. , n = Math.sin(i);
  37425. return this._x = e.x * n,
  37426. this._y = e.y * n,
  37427. this._z = e.z * n,
  37428. this._w = Math.cos(i),
  37429. this.onChangeCallback(),
  37430. this
  37431. },
  37432. setFromRotationMatrix: function(e) {
  37433. 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;
  37434. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37435. this._w = .25 / t,
  37436. this._x = (h - l) * t,
  37437. this._y = (o - c) * t,
  37438. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37439. this._w = (h - l) / t,
  37440. this._x = .25 * t,
  37441. this._y = (r + a) / t,
  37442. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37443. this._w = (o - c) / t,
  37444. this._x = (r + a) / t,
  37445. this._y = .25 * t,
  37446. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37447. this._w = (a - r) / t,
  37448. this._x = (o + c) / t,
  37449. this._y = (l + h) / t,
  37450. this._z = .25 * t),
  37451. this.onChangeCallback(),
  37452. this
  37453. },
  37454. setFromUnitVectors: function(e, t) {
  37455. return void 0 === Be && (Be = new Ci.Vector3),
  37456. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37457. 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),
  37458. this._x = Be.x,
  37459. this._y = Be.y,
  37460. this._z = Be.z,
  37461. this._w = Ve,
  37462. this.normalize(),
  37463. this
  37464. },
  37465. inverse: function() {
  37466. return this.conjugate().normalize(),
  37467. this
  37468. },
  37469. conjugate: function() {
  37470. return this._x *= -1,
  37471. this._y *= -1,
  37472. this._z *= -1,
  37473. this.onChangeCallback(),
  37474. this
  37475. },
  37476. dot: function(e) {
  37477. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37478. },
  37479. lengthSq: function() {
  37480. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37481. },
  37482. length: function() {
  37483. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37484. },
  37485. normalize: function() {
  37486. var e = this.length();
  37487. return 0 === e ? (this._x = 0,
  37488. this._y = 0,
  37489. this._z = 0,
  37490. this._w = 1) : (e = 1 / e,
  37491. this._x = this._x * e,
  37492. this._y = this._y * e,
  37493. this._z = this._z * e,
  37494. this._w = this._w * e),
  37495. this.onChangeCallback(),
  37496. this
  37497. },
  37498. multiply: function(e, t) {
  37499. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37500. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37501. },
  37502. multiplyQuaternions: function(e, t) {
  37503. var i = e._x
  37504. , n = e._y
  37505. , r = e._z
  37506. , o = e._w
  37507. , a = t._x
  37508. , s = t._y
  37509. , l = t._z
  37510. , c = t._w;
  37511. return this._x = i * c + o * a + n * l - r * s,
  37512. this._y = n * c + o * s + r * a - i * l,
  37513. this._z = r * c + o * l + i * s - n * a,
  37514. this._w = o * c - i * a - n * s - r * l,
  37515. this.onChangeCallback(),
  37516. this
  37517. },
  37518. slerp: function(e, t) {
  37519. if (0 === t)
  37520. return this;
  37521. if (1 === t)
  37522. return this.copy(e);
  37523. var i = this._x
  37524. , n = this._y
  37525. , r = this._z
  37526. , o = this._w
  37527. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37528. if (a < 0 ? (this._w = -e._w,
  37529. this._x = -e._x,
  37530. this._y = -e._y,
  37531. this._z = -e._z,
  37532. a = -a) : this.copy(e),
  37533. 1 <= a)
  37534. return this._w = o,
  37535. this._x = i,
  37536. this._y = n,
  37537. this._z = r,
  37538. this;
  37539. var s = Math.sqrt(1 - a * a);
  37540. if (Math.abs(s) < .001)
  37541. return this._w = .5 * (o + this._w),
  37542. this._x = .5 * (i + this._x),
  37543. this._y = .5 * (n + this._y),
  37544. this._z = .5 * (r + this._z),
  37545. this;
  37546. var l = Math.atan2(s, a)
  37547. , c = Math.sin((1 - t) * l) / s
  37548. , h = Math.sin(t * l) / s;
  37549. return this._w = o * c + this._w * h,
  37550. this._x = i * c + this._x * h,
  37551. this._y = n * c + this._y * h,
  37552. this._z = r * c + this._z * h,
  37553. this.onChangeCallback(),
  37554. this
  37555. },
  37556. equals: function(e) {
  37557. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37558. },
  37559. fromArray: function(e, t) {
  37560. return void 0 === t && (t = 0),
  37561. this._x = e[t],
  37562. this._y = e[t + 1],
  37563. this._z = e[t + 2],
  37564. this._w = e[t + 3],
  37565. this.onChangeCallback(),
  37566. this
  37567. },
  37568. toArray: function(e, t) {
  37569. return void 0 === e && (e = []),
  37570. void 0 === t && (t = 0),
  37571. e[t] = this._x,
  37572. e[t + 1] = this._y,
  37573. e[t + 2] = this._z,
  37574. e[t + 3] = this._w,
  37575. e
  37576. },
  37577. onChange: function(e) {
  37578. return this.onChangeCallback = e,
  37579. this
  37580. },
  37581. onChangeCallback: function() {}
  37582. },
  37583. Object.assign(Ci.Quaternion, {
  37584. slerp: function(e, t, i, n) {
  37585. return i.copy(e).slerp(t, n)
  37586. },
  37587. slerpFlat: function(e, t, i, n, r, o, a) {
  37588. var s = i[n + 0]
  37589. , l = i[n + 1]
  37590. , c = i[n + 2]
  37591. , h = i[n + 3]
  37592. , u = r[o + 0]
  37593. , d = r[o + 1]
  37594. , p = r[o + 2]
  37595. , f = r[o + 3];
  37596. if (h !== f || s !== u || l !== d || c !== p) {
  37597. var g = 1 - a
  37598. , m = s * u + l * d + c * p + h * f
  37599. , v = 0 <= m ? 1 : -1
  37600. , y = 1 - m * m;
  37601. if (y > Number.EPSILON) {
  37602. var A = Math.sqrt(y)
  37603. , C = Math.atan2(A, m * v);
  37604. g = Math.sin(g * C) / A,
  37605. a = Math.sin(a * C) / A
  37606. }
  37607. var I = a * v;
  37608. if (s = s * g + u * I,
  37609. l = l * g + d * I,
  37610. c = c * g + p * I,
  37611. h = h * g + f * I,
  37612. g === 1 - a) {
  37613. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37614. s *= E,
  37615. l *= E,
  37616. c *= E,
  37617. h *= E
  37618. }
  37619. }
  37620. e[t] = s,
  37621. e[t + 1] = l,
  37622. e[t + 2] = c,
  37623. e[t + 3] = h
  37624. }
  37625. }),
  37626. Ci.Vector2 = function(e, t) {
  37627. this.x = e || 0,
  37628. this.y = t || 0
  37629. }
  37630. ,
  37631. Ci.Vector2.prototype = {
  37632. constructor: Ci.Vector2,
  37633. get width() {
  37634. return this.x
  37635. },
  37636. set width(e) {
  37637. this.x = e
  37638. },
  37639. get height() {
  37640. return this.y
  37641. },
  37642. set height(e) {
  37643. this.y = e
  37644. },
  37645. set: function(e, t) {
  37646. return this.x = e,
  37647. this.y = t,
  37648. this
  37649. },
  37650. setScalar: function(e) {
  37651. return this.x = e,
  37652. this.y = e,
  37653. this
  37654. },
  37655. setX: function(e) {
  37656. return this.x = e,
  37657. this
  37658. },
  37659. setY: function(e) {
  37660. return this.y = e,
  37661. this
  37662. },
  37663. setComponent: function(e, t) {
  37664. switch (e) {
  37665. case 0:
  37666. this.x = t;
  37667. break;
  37668. case 1:
  37669. this.y = t;
  37670. break;
  37671. default:
  37672. throw new Error("index is out of range: " + e)
  37673. }
  37674. },
  37675. getComponent: function(e) {
  37676. switch (e) {
  37677. case 0:
  37678. return this.x;
  37679. case 1:
  37680. return this.y;
  37681. default:
  37682. throw new Error("index is out of range: " + e)
  37683. }
  37684. },
  37685. clone: function() {
  37686. return new this.constructor(this.x,this.y)
  37687. },
  37688. copy: function(e) {
  37689. return this.x = e.x,
  37690. this.y = e.y,
  37691. this
  37692. },
  37693. add: function(e, t) {
  37694. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37695. this.addVectors(e, t)) : (this.x += e.x,
  37696. this.y += e.y,
  37697. this)
  37698. },
  37699. addScalar: function(e) {
  37700. return this.x += e,
  37701. this.y += e,
  37702. this
  37703. },
  37704. addVectors: function(e, t) {
  37705. return this.x = e.x + t.x,
  37706. this.y = e.y + t.y,
  37707. this
  37708. },
  37709. addScaledVector: function(e, t) {
  37710. return this.x += e.x * t,
  37711. this.y += e.y * t,
  37712. this
  37713. },
  37714. sub: function(e, t) {
  37715. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37716. this.subVectors(e, t)) : (this.x -= e.x,
  37717. this.y -= e.y,
  37718. this)
  37719. },
  37720. subScalar: function(e) {
  37721. return this.x -= e,
  37722. this.y -= e,
  37723. this
  37724. },
  37725. subVectors: function(e, t) {
  37726. return this.x = e.x - t.x,
  37727. this.y = e.y - t.y,
  37728. this
  37729. },
  37730. multiply: function(e) {
  37731. return this.x *= e.x,
  37732. this.y *= e.y,
  37733. this
  37734. },
  37735. multiplyScalar: function(e) {
  37736. return isFinite(e) ? (this.x *= e,
  37737. this.y *= e) : (this.x = 0,
  37738. this.y = 0),
  37739. this
  37740. },
  37741. divide: function(e) {
  37742. return this.x /= e.x,
  37743. this.y /= e.y,
  37744. this
  37745. },
  37746. divideScalar: function(e) {
  37747. return this.multiplyScalar(1 / e)
  37748. },
  37749. min: function(e) {
  37750. return this.x = Math.min(this.x, e.x),
  37751. this.y = Math.min(this.y, e.y),
  37752. this
  37753. },
  37754. max: function(e) {
  37755. return this.x = Math.max(this.x, e.x),
  37756. this.y = Math.max(this.y, e.y),
  37757. this
  37758. },
  37759. clamp: function(e, t) {
  37760. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37761. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37762. this
  37763. },
  37764. clampScalar: function(e, t) {
  37765. return void 0 === Ne && (Ne = new Ci.Vector2,
  37766. Fe = new Ci.Vector2),
  37767. Ne.set(e, e),
  37768. Fe.set(t, t),
  37769. this.clamp(Ne, Fe)
  37770. },
  37771. clampLength: function(e, t) {
  37772. var i = this.length();
  37773. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37774. this
  37775. },
  37776. floor: function() {
  37777. return this.x = Math.floor(this.x),
  37778. this.y = Math.floor(this.y),
  37779. this
  37780. },
  37781. ceil: function() {
  37782. return this.x = Math.ceil(this.x),
  37783. this.y = Math.ceil(this.y),
  37784. this
  37785. },
  37786. round: function() {
  37787. return this.x = Math.round(this.x),
  37788. this.y = Math.round(this.y),
  37789. this
  37790. },
  37791. roundToZero: function() {
  37792. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37793. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37794. this
  37795. },
  37796. negate: function() {
  37797. return this.x = -this.x,
  37798. this.y = -this.y,
  37799. this
  37800. },
  37801. dot: function(e) {
  37802. return this.x * e.x + this.y * e.y
  37803. },
  37804. lengthSq: function() {
  37805. return this.x * this.x + this.y * this.y
  37806. },
  37807. length: function() {
  37808. return Math.sqrt(this.x * this.x + this.y * this.y)
  37809. },
  37810. lengthManhattan: function() {
  37811. return Math.abs(this.x) + Math.abs(this.y)
  37812. },
  37813. normalize: function() {
  37814. return this.divideScalar(this.length())
  37815. },
  37816. angle: function() {
  37817. var e = Math.atan2(this.y, this.x);
  37818. return e < 0 && (e += 2 * Math.PI),
  37819. e
  37820. },
  37821. distanceTo: function(e) {
  37822. return Math.sqrt(this.distanceToSquared(e))
  37823. },
  37824. distanceToSquared: function(e) {
  37825. var t = this.x - e.x
  37826. , i = this.y - e.y;
  37827. return t * t + i * i
  37828. },
  37829. setLength: function(e) {
  37830. return this.multiplyScalar(e / this.length())
  37831. },
  37832. lerp: function(e, t) {
  37833. return this.x += (e.x - this.x) * t,
  37834. this.y += (e.y - this.y) * t,
  37835. this
  37836. },
  37837. lerpVectors: function(e, t, i) {
  37838. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37839. this
  37840. },
  37841. equals: function(e) {
  37842. return e.x === this.x && e.y === this.y
  37843. },
  37844. fromArray: function(e, t) {
  37845. return void 0 === t && (t = 0),
  37846. this.x = e[t],
  37847. this.y = e[t + 1],
  37848. this
  37849. },
  37850. toArray: function(e, t) {
  37851. return void 0 === e && (e = []),
  37852. void 0 === t && (t = 0),
  37853. e[t] = this.x,
  37854. e[t + 1] = this.y,
  37855. e
  37856. },
  37857. fromAttribute: function(e, t, i) {
  37858. return void 0 === i && (i = 0),
  37859. t = t * e.itemSize + i,
  37860. this.x = e.array[t],
  37861. this.y = e.array[t + 1],
  37862. this
  37863. },
  37864. rotateAround: function(e, t) {
  37865. var i = Math.cos(t)
  37866. , n = Math.sin(t)
  37867. , r = this.x - e.x
  37868. , o = this.y - e.y;
  37869. return this.x = r * i - o * n + e.x,
  37870. this.y = r * n + o * i + e.y,
  37871. this
  37872. }
  37873. },
  37874. Ci.Vector3 = function(e, t, i) {
  37875. this.x = e || 0,
  37876. this.y = t || 0,
  37877. this.z = i || 0
  37878. }
  37879. ,
  37880. Ci.Vector3.prototype = {
  37881. constructor: Ci.Vector3,
  37882. set: function(e, t, i) {
  37883. return this.x = e,
  37884. this.y = t,
  37885. this.z = i,
  37886. this
  37887. },
  37888. setScalar: function(e) {
  37889. return this.x = e,
  37890. this.y = e,
  37891. this.z = e,
  37892. this
  37893. },
  37894. setX: function(e) {
  37895. return this.x = e,
  37896. this
  37897. },
  37898. setY: function(e) {
  37899. return this.y = e,
  37900. this
  37901. },
  37902. setZ: function(e) {
  37903. return this.z = e,
  37904. this
  37905. },
  37906. setComponent: function(e, t) {
  37907. switch (e) {
  37908. case 0:
  37909. this.x = t;
  37910. break;
  37911. case 1:
  37912. this.y = t;
  37913. break;
  37914. case 2:
  37915. this.z = t;
  37916. break;
  37917. default:
  37918. throw new Error("index is out of range: " + e)
  37919. }
  37920. },
  37921. getComponent: function(e) {
  37922. switch (e) {
  37923. case 0:
  37924. return this.x;
  37925. case 1:
  37926. return this.y;
  37927. case 2:
  37928. return this.z;
  37929. default:
  37930. throw new Error("index is out of range: " + e)
  37931. }
  37932. },
  37933. clone: function() {
  37934. return new this.constructor(this.x,this.y,this.z)
  37935. },
  37936. copy: function(e) {
  37937. return this.x = e.x,
  37938. this.y = e.y,
  37939. this.z = e.z,
  37940. this
  37941. },
  37942. add: function(e, t) {
  37943. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37944. this.addVectors(e, t)) : (this.x += e.x,
  37945. this.y += e.y,
  37946. this.z += e.z,
  37947. this)
  37948. },
  37949. addScalar: function(e) {
  37950. return this.x += e,
  37951. this.y += e,
  37952. this.z += e,
  37953. this
  37954. },
  37955. addVectors: function(e, t) {
  37956. return this.x = e.x + t.x,
  37957. this.y = e.y + t.y,
  37958. this.z = e.z + t.z,
  37959. this
  37960. },
  37961. addScaledVector: function(e, t) {
  37962. return this.x += e.x * t,
  37963. this.y += e.y * t,
  37964. this.z += e.z * t,
  37965. this
  37966. },
  37967. sub: function(e, t) {
  37968. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37969. this.subVectors(e, t)) : (this.x -= e.x,
  37970. this.y -= e.y,
  37971. this.z -= e.z,
  37972. this)
  37973. },
  37974. subScalar: function(e) {
  37975. return this.x -= e,
  37976. this.y -= e,
  37977. this.z -= e,
  37978. this
  37979. },
  37980. subVectors: function(e, t) {
  37981. return this.x = e.x - t.x,
  37982. this.y = e.y - t.y,
  37983. this.z = e.z - t.z,
  37984. this
  37985. },
  37986. multiply: function(e, t) {
  37987. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37988. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37989. this.y *= e.y,
  37990. this.z *= e.z,
  37991. this)
  37992. },
  37993. multiplyScalar: function(e) {
  37994. return isFinite(e) ? (this.x *= e,
  37995. this.y *= e,
  37996. this.z *= e) : (this.x = 0,
  37997. this.y = 0,
  37998. this.z = 0),
  37999. this
  38000. },
  38001. multiplyVectors: function(e, t) {
  38002. return this.x = e.x * t.x,
  38003. this.y = e.y * t.y,
  38004. this.z = e.z * t.z,
  38005. this
  38006. },
  38007. applyEuler: function(e) {
  38008. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38009. void 0 === De && (De = new Ci.Quaternion),
  38010. this.applyQuaternion(De.setFromEuler(e)),
  38011. this
  38012. },
  38013. applyAxisAngle: function(e, t) {
  38014. return void 0 === Le && (Le = new Ci.Quaternion),
  38015. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38016. this
  38017. },
  38018. applyMatrix3: function(e) {
  38019. var t = this.x
  38020. , i = this.y
  38021. , n = this.z
  38022. , r = e.elements;
  38023. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38024. this.y = r[1] * t + r[4] * i + r[7] * n,
  38025. this.z = r[2] * t + r[5] * i + r[8] * n,
  38026. this
  38027. },
  38028. applyMatrix4: function(e) {
  38029. var t = this.x
  38030. , i = this.y
  38031. , n = this.z
  38032. , r = e.elements;
  38033. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38034. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38035. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38036. this
  38037. },
  38038. applyProjection: function(e) {
  38039. var t = this.x
  38040. , i = this.y
  38041. , n = this.z
  38042. , r = e.elements
  38043. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38044. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38045. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38046. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38047. this
  38048. },
  38049. applyQuaternion: function(e) {
  38050. var t = this.x
  38051. , i = this.y
  38052. , n = this.z
  38053. , r = e.x
  38054. , o = e.y
  38055. , a = e.z
  38056. , s = e.w
  38057. , l = s * t + o * n - a * i
  38058. , c = s * i + a * t - r * n
  38059. , h = s * n + r * i - o * t
  38060. , u = -r * t - o * i - a * n;
  38061. return this.x = l * s + u * -r + c * -a - h * -o,
  38062. this.y = c * s + u * -o + h * -r - l * -a,
  38063. this.z = h * s + u * -a + l * -o - c * -r,
  38064. this
  38065. },
  38066. project: function(e) {
  38067. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38068. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38069. this.applyProjection(Oe)
  38070. },
  38071. unproject: function(e) {
  38072. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38073. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38074. this.applyProjection(Pe)
  38075. },
  38076. transformDirection: function(e) {
  38077. var t = this.x
  38078. , i = this.y
  38079. , n = this.z
  38080. , r = e.elements;
  38081. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38082. this.y = r[1] * t + r[5] * i + r[9] * n,
  38083. this.z = r[2] * t + r[6] * i + r[10] * n,
  38084. this.normalize(),
  38085. this
  38086. },
  38087. divide: function(e) {
  38088. return this.x /= e.x,
  38089. this.y /= e.y,
  38090. this.z /= e.z,
  38091. this
  38092. },
  38093. divideScalar: function(e) {
  38094. return this.multiplyScalar(1 / e)
  38095. },
  38096. min: function(e) {
  38097. return this.x = Math.min(this.x, e.x),
  38098. this.y = Math.min(this.y, e.y),
  38099. this.z = Math.min(this.z, e.z),
  38100. this
  38101. },
  38102. max: function(e) {
  38103. return this.x = Math.max(this.x, e.x),
  38104. this.y = Math.max(this.y, e.y),
  38105. this.z = Math.max(this.z, e.z),
  38106. this
  38107. },
  38108. clamp: function(e, t) {
  38109. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38110. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38111. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38112. this
  38113. },
  38114. clampScalar: function(e, t) {
  38115. return void 0 === Me && (Me = new Ci.Vector3,
  38116. Re = new Ci.Vector3),
  38117. Me.set(e, e, e),
  38118. Re.set(t, t, t),
  38119. this.clamp(Me, Re)
  38120. },
  38121. clampLength: function(e, t) {
  38122. var i = this.length();
  38123. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38124. this
  38125. },
  38126. floor: function() {
  38127. return this.x = Math.floor(this.x),
  38128. this.y = Math.floor(this.y),
  38129. this.z = Math.floor(this.z),
  38130. this
  38131. },
  38132. ceil: function() {
  38133. return this.x = Math.ceil(this.x),
  38134. this.y = Math.ceil(this.y),
  38135. this.z = Math.ceil(this.z),
  38136. this
  38137. },
  38138. round: function() {
  38139. return this.x = Math.round(this.x),
  38140. this.y = Math.round(this.y),
  38141. this.z = Math.round(this.z),
  38142. this
  38143. },
  38144. roundToZero: function() {
  38145. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38146. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38147. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38148. this
  38149. },
  38150. negate: function() {
  38151. return this.x = -this.x,
  38152. this.y = -this.y,
  38153. this.z = -this.z,
  38154. this
  38155. },
  38156. dot: function(e) {
  38157. return this.x * e.x + this.y * e.y + this.z * e.z
  38158. },
  38159. lengthSq: function() {
  38160. return this.x * this.x + this.y * this.y + this.z * this.z
  38161. },
  38162. length: function() {
  38163. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38164. },
  38165. lengthManhattan: function() {
  38166. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38167. },
  38168. normalize: function() {
  38169. return this.divideScalar(this.length())
  38170. },
  38171. setLength: function(e) {
  38172. return this.multiplyScalar(e / this.length())
  38173. },
  38174. lerp: function(e, t) {
  38175. return this.x += (e.x - this.x) * t,
  38176. this.y += (e.y - this.y) * t,
  38177. this.z += (e.z - this.z) * t,
  38178. this
  38179. },
  38180. lerpVectors: function(e, t, i) {
  38181. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38182. this
  38183. },
  38184. cross: function(e, t) {
  38185. if (void 0 !== t)
  38186. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38187. this.crossVectors(e, t);
  38188. var i = this.x
  38189. , n = this.y
  38190. , r = this.z;
  38191. return this.x = n * e.z - r * e.y,
  38192. this.y = r * e.x - i * e.z,
  38193. this.z = i * e.y - n * e.x,
  38194. this
  38195. },
  38196. crossVectors: function(e, t) {
  38197. var i = e.x
  38198. , n = e.y
  38199. , r = e.z
  38200. , o = t.x
  38201. , a = t.y
  38202. , s = t.z;
  38203. return this.x = n * s - r * a,
  38204. this.y = r * o - i * s,
  38205. this.z = i * a - n * o,
  38206. this
  38207. },
  38208. projectOnVector: function(e) {
  38209. return void 0 === xe && (xe = new Ci.Vector3),
  38210. xe.copy(e).normalize(),
  38211. Se = this.dot(xe),
  38212. this.copy(xe).multiplyScalar(Se)
  38213. },
  38214. projectOnPlane: function(e) {
  38215. return void 0 === Te && (Te = new Ci.Vector3),
  38216. Te.copy(this).projectOnVector(e),
  38217. this.sub(Te)
  38218. },
  38219. reflect: function(e) {
  38220. return void 0 === we && (we = new Ci.Vector3),
  38221. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38222. },
  38223. angleTo: function(e) {
  38224. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38225. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38226. },
  38227. distanceTo: function(e) {
  38228. return Math.sqrt(this.distanceToSquared(e))
  38229. },
  38230. distanceToSquared: function(e) {
  38231. var t = this.x - e.x
  38232. , i = this.y - e.y
  38233. , n = this.z - e.z;
  38234. return t * t + i * i + n * n
  38235. },
  38236. setFromSpherical: function(e) {
  38237. var t = Math.sin(e.phi) * e.radius;
  38238. return this.x = t * Math.sin(e.theta),
  38239. this.y = Math.cos(e.phi) * e.radius,
  38240. this.z = t * Math.cos(e.theta),
  38241. this
  38242. },
  38243. setFromMatrixPosition: function(e) {
  38244. return this.setFromMatrixColumn(e, 3)
  38245. },
  38246. setFromMatrixScale: function(e) {
  38247. var t = this.setFromMatrixColumn(e, 0).length()
  38248. , i = this.setFromMatrixColumn(e, 1).length()
  38249. , n = this.setFromMatrixColumn(e, 2).length();
  38250. return this.x = t,
  38251. this.y = i,
  38252. this.z = n,
  38253. this
  38254. },
  38255. setFromMatrixColumn: function(e, t) {
  38256. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38257. t = e = t),
  38258. this.fromArray(e.elements, 4 * t)
  38259. },
  38260. equals: function(e) {
  38261. return e.x === this.x && e.y === this.y && e.z === this.z
  38262. },
  38263. fromArray: function(e, t) {
  38264. return void 0 === t && (t = 0),
  38265. this.x = e[t],
  38266. this.y = e[t + 1],
  38267. this.z = e[t + 2],
  38268. this
  38269. },
  38270. toArray: function(e, t) {
  38271. return void 0 === e && (e = []),
  38272. void 0 === t && (t = 0),
  38273. e[t] = this.x,
  38274. e[t + 1] = this.y,
  38275. e[t + 2] = this.z,
  38276. e
  38277. },
  38278. fromAttribute: function(e, t, i) {
  38279. return void 0 === i && (i = 0),
  38280. t = t * e.itemSize + i,
  38281. this.x = e.array[t],
  38282. this.y = e.array[t + 1],
  38283. this.z = e.array[t + 2],
  38284. this
  38285. }
  38286. },
  38287. Ci.Vector4 = function(e, t, i, n) {
  38288. this.x = e || 0,
  38289. this.y = t || 0,
  38290. this.z = i || 0,
  38291. this.w = void 0 !== n ? n : 1
  38292. }
  38293. ,
  38294. Ci.Vector4.prototype = {
  38295. constructor: Ci.Vector4,
  38296. set: function(e, t, i, n) {
  38297. return this.x = e,
  38298. this.y = t,
  38299. this.z = i,
  38300. this.w = n,
  38301. this
  38302. },
  38303. setScalar: function(e) {
  38304. return this.x = e,
  38305. this.y = e,
  38306. this.z = e,
  38307. this.w = e,
  38308. this
  38309. },
  38310. setX: function(e) {
  38311. return this.x = e,
  38312. this
  38313. },
  38314. setY: function(e) {
  38315. return this.y = e,
  38316. this
  38317. },
  38318. setZ: function(e) {
  38319. return this.z = e,
  38320. this
  38321. },
  38322. setW: function(e) {
  38323. return this.w = e,
  38324. this
  38325. },
  38326. setComponent: function(e, t) {
  38327. switch (e) {
  38328. case 0:
  38329. this.x = t;
  38330. break;
  38331. case 1:
  38332. this.y = t;
  38333. break;
  38334. case 2:
  38335. this.z = t;
  38336. break;
  38337. case 3:
  38338. this.w = t;
  38339. break;
  38340. default:
  38341. throw new Error("index is out of range: " + e)
  38342. }
  38343. },
  38344. getComponent: function(e) {
  38345. switch (e) {
  38346. case 0:
  38347. return this.x;
  38348. case 1:
  38349. return this.y;
  38350. case 2:
  38351. return this.z;
  38352. case 3:
  38353. return this.w;
  38354. default:
  38355. throw new Error("index is out of range: " + e)
  38356. }
  38357. },
  38358. clone: function() {
  38359. return new this.constructor(this.x,this.y,this.z,this.w)
  38360. },
  38361. copy: function(e) {
  38362. return this.x = e.x,
  38363. this.y = e.y,
  38364. this.z = e.z,
  38365. this.w = void 0 !== e.w ? e.w : 1,
  38366. this
  38367. },
  38368. add: function(e, t) {
  38369. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38370. this.addVectors(e, t)) : (this.x += e.x,
  38371. this.y += e.y,
  38372. this.z += e.z,
  38373. this.w += e.w,
  38374. this)
  38375. },
  38376. addScalar: function(e) {
  38377. return this.x += e,
  38378. this.y += e,
  38379. this.z += e,
  38380. this.w += e,
  38381. this
  38382. },
  38383. addVectors: function(e, t) {
  38384. return this.x = e.x + t.x,
  38385. this.y = e.y + t.y,
  38386. this.z = e.z + t.z,
  38387. this.w = e.w + t.w,
  38388. this
  38389. },
  38390. addScaledVector: function(e, t) {
  38391. return this.x += e.x * t,
  38392. this.y += e.y * t,
  38393. this.z += e.z * t,
  38394. this.w += e.w * t,
  38395. this
  38396. },
  38397. sub: function(e, t) {
  38398. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38399. this.subVectors(e, t)) : (this.x -= e.x,
  38400. this.y -= e.y,
  38401. this.z -= e.z,
  38402. this.w -= e.w,
  38403. this)
  38404. },
  38405. subScalar: function(e) {
  38406. return this.x -= e,
  38407. this.y -= e,
  38408. this.z -= e,
  38409. this.w -= e,
  38410. this
  38411. },
  38412. subVectors: function(e, t) {
  38413. return this.x = e.x - t.x,
  38414. this.y = e.y - t.y,
  38415. this.z = e.z - t.z,
  38416. this.w = e.w - t.w,
  38417. this
  38418. },
  38419. multiplyScalar: function(e) {
  38420. return isFinite(e) ? (this.x *= e,
  38421. this.y *= e,
  38422. this.z *= e,
  38423. this.w *= e) : (this.x = 0,
  38424. this.y = 0,
  38425. this.z = 0,
  38426. this.w = 0),
  38427. this
  38428. },
  38429. applyMatrix4: function(e) {
  38430. var t = this.x
  38431. , i = this.y
  38432. , n = this.z
  38433. , r = this.w
  38434. , o = e.elements;
  38435. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38436. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38437. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38438. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38439. this
  38440. },
  38441. divideScalar: function(e) {
  38442. return this.multiplyScalar(1 / e)
  38443. },
  38444. setAxisAngleFromQuaternion: function(e) {
  38445. this.w = 2 * Math.acos(e.w);
  38446. var t = Math.sqrt(1 - e.w * e.w);
  38447. return t < 1e-4 ? (this.x = 1,
  38448. this.y = 0,
  38449. this.z = 0) : (this.x = e.x / t,
  38450. this.y = e.y / t,
  38451. this.z = e.z / t),
  38452. this
  38453. },
  38454. setAxisAngleFromRotationMatrix: function(e) {
  38455. 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];
  38456. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38457. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38458. return this.set(1, 0, 0, 0),
  38459. this;
  38460. t = Math.PI;
  38461. var g = (a + 1) / 2
  38462. , m = (h + 1) / 2
  38463. , v = (f + 1) / 2
  38464. , y = (s + c) / 4
  38465. , A = (l + d) / 4
  38466. , C = (u + p) / 4;
  38467. return m < g && v < g ? r = g < .01 ? (i = 0,
  38468. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38469. A / i) : v < m ? r = m < .01 ? (n = 0,
  38470. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38471. C / n) : v < .01 ? (n = i = .707106781,
  38472. r = 0) : (i = A / (r = Math.sqrt(v)),
  38473. n = C / r),
  38474. this.set(i, n, r, t),
  38475. this
  38476. }
  38477. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38478. return Math.abs(I) < .001 && (I = 1),
  38479. this.x = (p - u) / I,
  38480. this.y = (l - d) / I,
  38481. this.z = (c - s) / I,
  38482. this.w = Math.acos((a + h + f - 1) / 2),
  38483. this
  38484. },
  38485. min: function(e) {
  38486. return this.x = Math.min(this.x, e.x),
  38487. this.y = Math.min(this.y, e.y),
  38488. this.z = Math.min(this.z, e.z),
  38489. this.w = Math.min(this.w, e.w),
  38490. this
  38491. },
  38492. max: function(e) {
  38493. return this.x = Math.max(this.x, e.x),
  38494. this.y = Math.max(this.y, e.y),
  38495. this.z = Math.max(this.z, e.z),
  38496. this.w = Math.max(this.w, e.w),
  38497. this
  38498. },
  38499. clamp: function(e, t) {
  38500. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38501. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38502. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38503. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38504. this
  38505. },
  38506. clampScalar: function(e, t) {
  38507. return void 0 === _e && (_e = new Ci.Vector4,
  38508. be = new Ci.Vector4),
  38509. _e.set(e, e, e, e),
  38510. be.set(t, t, t, t),
  38511. this.clamp(_e, be)
  38512. },
  38513. floor: function() {
  38514. return this.x = Math.floor(this.x),
  38515. this.y = Math.floor(this.y),
  38516. this.z = Math.floor(this.z),
  38517. this.w = Math.floor(this.w),
  38518. this
  38519. },
  38520. ceil: function() {
  38521. return this.x = Math.ceil(this.x),
  38522. this.y = Math.ceil(this.y),
  38523. this.z = Math.ceil(this.z),
  38524. this.w = Math.ceil(this.w),
  38525. this
  38526. },
  38527. round: function() {
  38528. return this.x = Math.round(this.x),
  38529. this.y = Math.round(this.y),
  38530. this.z = Math.round(this.z),
  38531. this.w = Math.round(this.w),
  38532. this
  38533. },
  38534. roundToZero: function() {
  38535. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38536. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38537. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38538. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38539. this
  38540. },
  38541. negate: function() {
  38542. return this.x = -this.x,
  38543. this.y = -this.y,
  38544. this.z = -this.z,
  38545. this.w = -this.w,
  38546. this
  38547. },
  38548. dot: function(e) {
  38549. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38550. },
  38551. lengthSq: function() {
  38552. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38553. },
  38554. length: function() {
  38555. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38556. },
  38557. lengthManhattan: function() {
  38558. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38559. },
  38560. normalize: function() {
  38561. return this.divideScalar(this.length())
  38562. },
  38563. setLength: function(e) {
  38564. return this.multiplyScalar(e / this.length())
  38565. },
  38566. lerp: function(e, t) {
  38567. return this.x += (e.x - this.x) * t,
  38568. this.y += (e.y - this.y) * t,
  38569. this.z += (e.z - this.z) * t,
  38570. this.w += (e.w - this.w) * t,
  38571. this
  38572. },
  38573. lerpVectors: function(e, t, i) {
  38574. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38575. this
  38576. },
  38577. equals: function(e) {
  38578. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38579. },
  38580. fromArray: function(e, t) {
  38581. return void 0 === t && (t = 0),
  38582. this.x = e[t],
  38583. this.y = e[t + 1],
  38584. this.z = e[t + 2],
  38585. this.w = e[t + 3],
  38586. this
  38587. },
  38588. toArray: function(e, t) {
  38589. return void 0 === e && (e = []),
  38590. void 0 === t && (t = 0),
  38591. e[t] = this.x,
  38592. e[t + 1] = this.y,
  38593. e[t + 2] = this.z,
  38594. e[t + 3] = this.w,
  38595. e
  38596. },
  38597. fromAttribute: function(e, t, i) {
  38598. return void 0 === i && (i = 0),
  38599. t = t * e.itemSize + i,
  38600. this.x = e.array[t],
  38601. this.y = e.array[t + 1],
  38602. this.z = e.array[t + 2],
  38603. this.w = e.array[t + 3],
  38604. this
  38605. }
  38606. },
  38607. Ci.Euler = function(e, t, i, n) {
  38608. this._x = e || 0,
  38609. this._y = t || 0,
  38610. this._z = i || 0,
  38611. this._order = n || Ci.Euler.DefaultOrder
  38612. }
  38613. ,
  38614. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38615. Ci.Euler.DefaultOrder = "XYZ",
  38616. Ci.Euler.prototype = {
  38617. constructor: Ci.Euler,
  38618. get x() {
  38619. return this._x
  38620. },
  38621. set x(e) {
  38622. this._x = e,
  38623. this.onChangeCallback()
  38624. },
  38625. get y() {
  38626. return this._y
  38627. },
  38628. set y(e) {
  38629. this._y = e,
  38630. this.onChangeCallback()
  38631. },
  38632. get z() {
  38633. return this._z
  38634. },
  38635. set z(e) {
  38636. this._z = e,
  38637. this.onChangeCallback()
  38638. },
  38639. get order() {
  38640. return this._order
  38641. },
  38642. set order(e) {
  38643. this._order = e,
  38644. this.onChangeCallback()
  38645. },
  38646. set: function(e, t, i, n) {
  38647. return this._x = e,
  38648. this._y = t,
  38649. this._z = i,
  38650. this._order = n || this._order,
  38651. this.onChangeCallback(),
  38652. this
  38653. },
  38654. clone: function() {
  38655. return new this.constructor(this._x,this._y,this._z,this._order)
  38656. },
  38657. copy: function(e) {
  38658. return this._x = e._x,
  38659. this._y = e._y,
  38660. this._z = e._z,
  38661. this._order = e._order,
  38662. this.onChangeCallback(),
  38663. this
  38664. },
  38665. toObject: function() {//xzw
  38666. return {x:this.x,y:this.y,z:this.z}
  38667. },
  38668. setFromRotationMatrix: function(e, t, i) {
  38669. var n = Ci.Math.clamp
  38670. , r = e.elements
  38671. , o = r[0]
  38672. , a = r[4]
  38673. , s = r[8]
  38674. , l = r[1]
  38675. , c = r[5]
  38676. , h = r[9]
  38677. , u = r[2]
  38678. , d = r[6]
  38679. , p = r[10];
  38680. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38681. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38682. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38683. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38684. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38685. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38686. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38687. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38688. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38689. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38690. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38691. this._z = Math.atan2(l, o)) : (this._x = 0,
  38692. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38693. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38694. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38695. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38696. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38697. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38698. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38699. this._order = t,
  38700. !1 !== i && this.onChangeCallback(),
  38701. this
  38702. },
  38703. setFromQuaternion: function(e, t, i) {
  38704. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38705. Ee.makeRotationFromQuaternion(e),
  38706. this.setFromRotationMatrix(Ee, t, i),
  38707. this
  38708. },
  38709. setFromVector3: function(e, t) {
  38710. return this.set(e.x, e.y, e.z, t || this._order)
  38711. },
  38712. reorder: (Ie = new Ci.Quaternion,
  38713. function(e) {
  38714. Ie.setFromEuler(this),
  38715. this.setFromQuaternion(Ie, e)
  38716. }
  38717. ),
  38718. equals: function(e) {
  38719. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38720. },
  38721. fromArray: function(e) {
  38722. return this._x = e[0],
  38723. this._y = e[1],
  38724. this._z = e[2],
  38725. void 0 !== e[3] && (this._order = e[3]),
  38726. this.onChangeCallback(),
  38727. this
  38728. },
  38729. toArray: function(e, t) {
  38730. return void 0 === e && (e = []),
  38731. void 0 === t && (t = 0),
  38732. e[t] = this._x,
  38733. e[t + 1] = this._y,
  38734. e[t + 2] = this._z,
  38735. e[t + 3] = this._order,
  38736. e
  38737. },
  38738. toVector3: function(e) {
  38739. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38740. },
  38741. onChange: function(e) {
  38742. return this.onChangeCallback = e,
  38743. this
  38744. },
  38745. onChangeCallback: function() {}
  38746. },
  38747. Ci.Line3 = function(e, t) {
  38748. this.start = void 0 !== e ? e : new Ci.Vector3,
  38749. this.end = void 0 !== t ? t : new Ci.Vector3
  38750. }
  38751. ,
  38752. Ci.Line3.prototype = {
  38753. constructor: Ci.Line3,
  38754. set: function(e, t) {
  38755. return this.start.copy(e),
  38756. this.end.copy(t),
  38757. this
  38758. },
  38759. clone: function() {
  38760. return (new this.constructor).copy(this)
  38761. },
  38762. copy: function(e) {
  38763. return this.start.copy(e.start),
  38764. this.end.copy(e.end),
  38765. this
  38766. },
  38767. center: function(e) {
  38768. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38769. },
  38770. delta: function(e) {
  38771. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38772. },
  38773. distanceSq: function() {
  38774. return this.start.distanceToSquared(this.end)
  38775. },
  38776. distance: function() {
  38777. return this.start.distanceTo(this.end)
  38778. },
  38779. at: function(e, t) {
  38780. var i = t || new Ci.Vector3;
  38781. return this.delta(i).multiplyScalar(e).add(this.start)
  38782. },
  38783. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38784. Ce = new Ci.Vector3,
  38785. function(e, t) {
  38786. Ae.subVectors(e, this.start),
  38787. Ce.subVectors(this.end, this.start);
  38788. var i = Ce.dot(Ce)
  38789. , n = Ce.dot(Ae) / i;
  38790. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38791. n
  38792. }
  38793. ),
  38794. closestPointToPoint: function(e, t, i) {
  38795. var n = this.closestPointToPointParameter(e, t)
  38796. , r = i || new Ci.Vector3;
  38797. return this.delta(r).multiplyScalar(n).add(this.start)
  38798. },
  38799. applyMatrix4: function(e) {
  38800. return this.start.applyMatrix4(e),
  38801. this.end.applyMatrix4(e),
  38802. this
  38803. },
  38804. equals: function(e) {
  38805. return e.start.equals(this.start) && e.end.equals(this.end)
  38806. }
  38807. },
  38808. Ci.Box2 = function(e, t) {
  38809. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38810. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38811. }
  38812. ,
  38813. Ci.Box2.prototype = {
  38814. constructor: Ci.Box2,
  38815. set: function(e, t) {
  38816. return this.min.copy(e),
  38817. this.max.copy(t),
  38818. this
  38819. },
  38820. setFromPoints: function(e) {
  38821. this.makeEmpty();
  38822. for (var t = 0, i = e.length; t < i; t++)
  38823. this.expandByPoint(e[t]);
  38824. return this
  38825. },
  38826. setFromCenterAndSize: (ye = new Ci.Vector2,
  38827. function(e, t) {
  38828. var i = ye.copy(t).multiplyScalar(.5);
  38829. return this.min.copy(e).sub(i),
  38830. this.max.copy(e).add(i),
  38831. this
  38832. }
  38833. ),
  38834. clone: function() {
  38835. return (new this.constructor).copy(this)
  38836. },
  38837. copy: function(e) {
  38838. return this.min.copy(e.min),
  38839. this.max.copy(e.max),
  38840. this
  38841. },
  38842. makeEmpty: function() {
  38843. return this.min.x = this.min.y = 1 / 0,
  38844. this.max.x = this.max.y = -1 / 0,
  38845. this
  38846. },
  38847. isEmpty: function() {
  38848. return this.max.x < this.min.x || this.max.y < this.min.y
  38849. },
  38850. center: function(e) {
  38851. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38852. },
  38853. size: function(e) {
  38854. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38855. },
  38856. expandByPoint: function(e) {
  38857. return this.min.min(e),
  38858. this.max.max(e),
  38859. this
  38860. },
  38861. expandByVector: function(e) {
  38862. return this.min.sub(e),
  38863. this.max.add(e),
  38864. this
  38865. },
  38866. expandByScalar: function(e) {
  38867. return this.min.addScalar(-e),
  38868. this.max.addScalar(e),
  38869. this
  38870. },
  38871. containsPoint: function(e) {
  38872. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38873. },
  38874. containsBox: function(e) {
  38875. 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
  38876. },
  38877. getParameter: function(e, t) {
  38878. 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))
  38879. },
  38880. intersectsBox: function(e) {
  38881. 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)
  38882. },
  38883. clampPoint: function(e, t) {
  38884. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38885. },
  38886. distanceToPoint: (ve = new Ci.Vector2,
  38887. function(e) {
  38888. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38889. }
  38890. ),
  38891. intersect: function(e) {
  38892. return this.min.max(e.min),
  38893. this.max.min(e.max),
  38894. this
  38895. },
  38896. union: function(e) {
  38897. return this.min.min(e.min),
  38898. this.max.max(e.max),
  38899. this
  38900. },
  38901. translate: function(e) {
  38902. return this.min.add(e),
  38903. this.max.add(e),
  38904. this
  38905. },
  38906. equals: function(e) {
  38907. return e.min.equals(this.min) && e.max.equals(this.max)
  38908. }
  38909. },
  38910. Ci.Box3 = function(e, t) {
  38911. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38912. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38913. }
  38914. ,
  38915. Ci.Box3.prototype = {
  38916. constructor: Ci.Box3,
  38917. set: function(e, t) {
  38918. return this.min.copy(e),
  38919. this.max.copy(t),
  38920. this
  38921. },
  38922. setFromArray: function(e) {
  38923. this.makeEmpty();
  38924. 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) {
  38925. var c = e[s]
  38926. , h = e[s + 1]
  38927. , u = e[s + 2];
  38928. c < t && (t = c),
  38929. h < i && (i = h),
  38930. u < n && (n = u),
  38931. r < c && (r = c),
  38932. o < h && (o = h),
  38933. a < u && (a = u)
  38934. }
  38935. this.min.set(t, i, n),
  38936. this.max.set(r, o, a)
  38937. },
  38938. setFromPoints: function(e) {
  38939. this.makeEmpty();
  38940. for (var t = 0, i = e.length; t < i; t++)
  38941. this.expandByPoint(e[t]);
  38942. return this
  38943. },
  38944. setFromCenterAndSize: (me = new Ci.Vector3,
  38945. function(e, t) {
  38946. var i = me.copy(t).multiplyScalar(.5);
  38947. return this.min.copy(e).sub(i),
  38948. this.max.copy(e).add(i),
  38949. this
  38950. }
  38951. ),
  38952. setFromObject: function(e) {
  38953. void 0 === ge && (ge = new Ci.Box3);
  38954. var i = this;
  38955. return this.makeEmpty(),
  38956. e.updateMatrixWorld(!0),
  38957. e.traverse(function(e) {
  38958. var t = e.geometry;
  38959. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38960. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38961. ge.applyMatrix4(e.matrixWorld),
  38962. i.union(ge)))
  38963. }),
  38964. this
  38965. },
  38966. clone: function() {
  38967. return (new this.constructor).copy(this)
  38968. },
  38969. copy: function(e) {
  38970. return this.min.copy(e.min),
  38971. this.max.copy(e.max),
  38972. this
  38973. },
  38974. makeEmpty: function() {
  38975. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38976. this.max.x = this.max.y = this.max.z = -1 / 0,
  38977. this
  38978. },
  38979. isEmpty: function() {
  38980. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38981. },
  38982. center: function(e) {
  38983. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38984. },
  38985. size: function(e) {
  38986. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38987. },
  38988. expandByPoint: function(e) {
  38989. return this.min.min(e),
  38990. this.max.max(e),
  38991. this
  38992. },
  38993. expandByVector: function(e) {
  38994. return this.min.sub(e),
  38995. this.max.add(e),
  38996. this
  38997. },
  38998. expandByScalar: function(e) {
  38999. return this.min.addScalar(-e),
  39000. this.max.addScalar(e),
  39001. this
  39002. },
  39003. containsPoint: function(e) {
  39004. 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)
  39005. },
  39006. containsBox: function(e) {
  39007. 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
  39008. },
  39009. getParameter: function(e, t) {
  39010. 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))
  39011. },
  39012. intersectsBox: function(e) {
  39013. 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)
  39014. },
  39015. intersectsSphere: function(e) {
  39016. return void 0 === fe && (fe = new Ci.Vector3),
  39017. this.clampPoint(e.center, fe),
  39018. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39019. },
  39020. intersectsPlane: function(e) {
  39021. var t, i;
  39022. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39023. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39024. e.normal.x * this.min.x),
  39025. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39026. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39027. i += e.normal.y * this.min.y),
  39028. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39029. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39030. i += e.normal.z * this.min.z),
  39031. t <= e.constant && i >= e.constant
  39032. },
  39033. clampPoint: function(e, t) {
  39034. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39035. },
  39036. distanceToPoint: (pe = new Ci.Vector3,
  39037. function(e) {
  39038. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39039. }
  39040. ),
  39041. getBoundingSphere: (de = new Ci.Vector3,
  39042. function(e) {
  39043. var t = e || new Ci.Sphere;
  39044. return t.center = this.center(),
  39045. t.radius = .5 * this.size(de).length(),
  39046. t
  39047. }
  39048. ),
  39049. intersect: function(e) {
  39050. return this.min.max(e.min),
  39051. this.max.min(e.max),
  39052. this
  39053. },
  39054. union: function(e) {
  39055. return this.min.min(e.min),
  39056. this.max.max(e.max),
  39057. this
  39058. },
  39059. 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],
  39060. function(e) {
  39061. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39062. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39063. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39064. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39065. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39066. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39067. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39068. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39069. this.makeEmpty(),
  39070. this.setFromPoints(ue),
  39071. this
  39072. }
  39073. ),
  39074. translate: function(e) {
  39075. return this.min.add(e),
  39076. this.max.add(e),
  39077. this
  39078. },
  39079. equals: function(e) {
  39080. return e.min.equals(this.min) && e.max.equals(this.max)
  39081. }
  39082. },
  39083. Ci.Matrix3 = function() {
  39084. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39085. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39086. }
  39087. ,
  39088. Ci.Matrix3.prototype = {
  39089. constructor: Ci.Matrix3,
  39090. set: function(e, t, i, n, r, o, a, s, l) {
  39091. var c = this.elements;
  39092. return c[0] = e,
  39093. c[1] = n,
  39094. c[2] = a,
  39095. c[3] = t,
  39096. c[4] = r,
  39097. c[5] = s,
  39098. c[6] = i,
  39099. c[7] = o,
  39100. c[8] = l,
  39101. this
  39102. },
  39103. identity: function() {
  39104. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39105. this
  39106. },
  39107. clone: function() {
  39108. return (new this.constructor).fromArray(this.elements)
  39109. },
  39110. copy: function(e) {
  39111. var t = e.elements;
  39112. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39113. this
  39114. },
  39115. setFromMatrix4: function(e) {
  39116. var t = e.elements;
  39117. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39118. this
  39119. },
  39120. applyToVector3Array: function(e, t, i) {
  39121. void 0 === he && (he = new Ci.Vector3),
  39122. void 0 === t && (t = 0),
  39123. void 0 === i && (i = e.length);
  39124. for (var n = 0, r = t; n < i; n += 3,
  39125. r += 3)
  39126. he.fromArray(e, r),
  39127. he.applyMatrix3(this),
  39128. he.toArray(e, r);
  39129. return e
  39130. },
  39131. applyToBuffer: function(e, t, i) {
  39132. void 0 === ce && (ce = new Ci.Vector3),
  39133. void 0 === t && (t = 0),
  39134. void 0 === i && (i = e.length / e.itemSize);
  39135. for (var n = 0, r = t; n < i; n++,
  39136. r++)
  39137. ce.x = e.getX(r),
  39138. ce.y = e.getY(r),
  39139. ce.z = e.getZ(r),
  39140. ce.applyMatrix3(this),
  39141. e.setXYZ(ce.x, ce.y, ce.z);
  39142. return e
  39143. },
  39144. multiplyScalar: function(e) {
  39145. var t = this.elements;
  39146. return t[0] *= e,
  39147. t[3] *= e,
  39148. t[6] *= e,
  39149. t[1] *= e,
  39150. t[4] *= e,
  39151. t[7] *= e,
  39152. t[2] *= e,
  39153. t[5] *= e,
  39154. t[8] *= e,
  39155. this
  39156. },
  39157. determinant: function() {
  39158. var e = this.elements
  39159. , t = e[0]
  39160. , i = e[1]
  39161. , n = e[2]
  39162. , r = e[3]
  39163. , o = e[4]
  39164. , a = e[5]
  39165. , s = e[6]
  39166. , l = e[7]
  39167. , c = e[8];
  39168. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39169. },
  39170. getInverse: function(e, t) {
  39171. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39172. var i = e.elements
  39173. , n = this.elements
  39174. , r = i[0]
  39175. , o = i[1]
  39176. , a = i[2]
  39177. , s = i[3]
  39178. , l = i[4]
  39179. , c = i[5]
  39180. , h = i[6]
  39181. , u = i[7]
  39182. , d = i[8]
  39183. , p = d * l - c * u
  39184. , f = c * h - d * s
  39185. , g = u * s - l * h
  39186. , m = r * p + o * f + a * g;
  39187. if (0 != m)
  39188. return n[0] = p,
  39189. n[1] = a * u - d * o,
  39190. n[2] = c * o - a * l,
  39191. n[3] = f,
  39192. n[4] = d * r - a * h,
  39193. n[5] = a * s - c * r,
  39194. n[6] = g,
  39195. n[7] = o * h - u * r,
  39196. n[8] = l * r - o * s,
  39197. this.multiplyScalar(1 / m);
  39198. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39199. if (t)
  39200. throw new Error(v);
  39201. return this.identity()/* console.warn(v), *///许钟文删 boxHelper报的
  39202. },
  39203. transpose: function() {
  39204. var e, t = this.elements;
  39205. return e = t[1],
  39206. t[1] = t[3],
  39207. t[3] = e,
  39208. e = t[2],
  39209. t[2] = t[6],
  39210. t[6] = e,
  39211. e = t[5],
  39212. t[5] = t[7],
  39213. t[7] = e,
  39214. this
  39215. },
  39216. flattenToArrayOffset: function(e, t) {
  39217. var i = this.elements;
  39218. return e[t] = i[0],
  39219. e[t + 1] = i[1],
  39220. e[t + 2] = i[2],
  39221. e[t + 3] = i[3],
  39222. e[t + 4] = i[4],
  39223. e[t + 5] = i[5],
  39224. e[t + 6] = i[6],
  39225. e[t + 7] = i[7],
  39226. e[t + 8] = i[8],
  39227. e
  39228. },
  39229. getNormalMatrix: function(e) {
  39230. return this.setFromMatrix4(e).getInverse(this).transpose()
  39231. },
  39232. transposeIntoArray: function(e) {
  39233. var t = this.elements;
  39234. return e[0] = t[0],
  39235. e[1] = t[3],
  39236. e[2] = t[6],
  39237. e[3] = t[1],
  39238. e[4] = t[4],
  39239. e[5] = t[7],
  39240. e[6] = t[2],
  39241. e[7] = t[5],
  39242. e[8] = t[8],
  39243. this
  39244. },
  39245. fromArray: function(e) {
  39246. return this.elements.set(e),
  39247. this
  39248. },
  39249. toArray: function() {
  39250. var e = this.elements;
  39251. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39252. }
  39253. },
  39254. Ci.Matrix4 = function() {
  39255. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39256. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39257. }
  39258. ,
  39259. Ci.Matrix4.prototype = {
  39260. constructor: Ci.Matrix4,
  39261. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39262. var m = this.elements;
  39263. return m[0] = e,
  39264. m[4] = t,
  39265. m[8] = i,
  39266. m[12] = n,
  39267. m[1] = r,
  39268. m[5] = o,
  39269. m[9] = a,
  39270. m[13] = s,
  39271. m[2] = l,
  39272. m[6] = c,
  39273. m[10] = h,
  39274. m[14] = u,
  39275. m[3] = d,
  39276. m[7] = p,
  39277. m[11] = f,
  39278. m[15] = g,
  39279. this
  39280. },
  39281. identity: function() {
  39282. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39283. this
  39284. },
  39285. clone: function() {
  39286. return (new Ci.Matrix4).fromArray(this.elements)
  39287. },
  39288. copy: function(e) {
  39289. return this.elements.set(e.elements),
  39290. this
  39291. },
  39292. copyPosition: function(e) {
  39293. var t = this.elements
  39294. , i = e.elements;
  39295. return t[12] = i[12],
  39296. t[13] = i[13],
  39297. t[14] = i[14],
  39298. this
  39299. },
  39300. extractBasis: function(e, t, i) {
  39301. return e.setFromMatrixColumn(this, 0),
  39302. t.setFromMatrixColumn(this, 1),
  39303. i.setFromMatrixColumn(this, 2),
  39304. this
  39305. },
  39306. makeBasis: function(e, t, i) {
  39307. 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),
  39308. this
  39309. },
  39310. extractRotation: function(e) {
  39311. void 0 === le && (le = new Ci.Vector3);
  39312. var t = this.elements
  39313. , i = e.elements
  39314. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39315. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39316. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39317. return t[0] = i[0] * n,
  39318. t[1] = i[1] * n,
  39319. t[2] = i[2] * n,
  39320. t[4] = i[4] * r,
  39321. t[5] = i[5] * r,
  39322. t[6] = i[6] * r,
  39323. t[8] = i[8] * o,
  39324. t[9] = i[9] * o,
  39325. t[10] = i[10] * o,
  39326. this
  39327. },
  39328. makeRotationFromEuler: function(e) {
  39329. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39330. var t = this.elements
  39331. , i = e.x
  39332. , n = e.y
  39333. , r = e.z
  39334. , o = Math.cos(i)
  39335. , a = Math.sin(i)
  39336. , s = Math.cos(n)
  39337. , l = Math.sin(n)
  39338. , c = Math.cos(r)
  39339. , h = Math.sin(r);
  39340. if ("XYZ" === e.order) {
  39341. var u = o * c
  39342. , d = o * h
  39343. , p = a * c
  39344. , f = a * h;
  39345. t[0] = s * c,
  39346. t[4] = -s * h,
  39347. t[8] = l,
  39348. t[1] = d + p * l,
  39349. t[5] = u - f * l,
  39350. t[9] = -a * s,
  39351. t[2] = f - u * l,
  39352. t[6] = p + d * l,
  39353. t[10] = o * s
  39354. } else if ("YXZ" === e.order) {
  39355. var g = s * c
  39356. , m = s * h
  39357. , v = l * c
  39358. , y = l * h;
  39359. t[0] = g + y * a,
  39360. t[4] = v * a - m,
  39361. t[8] = o * l,
  39362. t[1] = o * h,
  39363. t[5] = o * c,
  39364. t[9] = -a,
  39365. t[2] = m * a - v,
  39366. t[6] = y + g * a,
  39367. t[10] = o * s
  39368. } else if ("ZXY" === e.order) {
  39369. g = s * c,
  39370. m = s * h,
  39371. v = l * c,
  39372. y = l * h;
  39373. t[0] = g - y * a,
  39374. t[4] = -o * h,
  39375. t[8] = v + m * a,
  39376. t[1] = m + v * a,
  39377. t[5] = o * c,
  39378. t[9] = y - g * a,
  39379. t[2] = -o * l,
  39380. t[6] = a,
  39381. t[10] = o * s
  39382. } else if ("ZYX" === e.order) {
  39383. u = o * c,
  39384. d = o * h,
  39385. p = a * c,
  39386. f = a * h;
  39387. t[0] = s * c,
  39388. t[4] = p * l - d,
  39389. t[8] = u * l + f,
  39390. t[1] = s * h,
  39391. t[5] = f * l + u,
  39392. t[9] = d * l - p,
  39393. t[2] = -l,
  39394. t[6] = a * s,
  39395. t[10] = o * s
  39396. } else if ("YZX" === e.order) {
  39397. var A = o * s
  39398. , C = o * l
  39399. , I = a * s
  39400. , E = a * l;
  39401. t[0] = s * c,
  39402. t[4] = E - A * h,
  39403. t[8] = I * h + C,
  39404. t[1] = h,
  39405. t[5] = o * c,
  39406. t[9] = -a * c,
  39407. t[2] = -l * c,
  39408. t[6] = C * h + I,
  39409. t[10] = A - E * h
  39410. } else if ("XZY" === e.order) {
  39411. A = o * s,
  39412. C = o * l,
  39413. I = a * s,
  39414. E = a * l;
  39415. t[0] = s * c,
  39416. t[4] = -h,
  39417. t[8] = l * c,
  39418. t[1] = A * h + E,
  39419. t[5] = o * c,
  39420. t[9] = C * h - I,
  39421. t[2] = I * h - C,
  39422. t[6] = a * c,
  39423. t[10] = E * h + A
  39424. }
  39425. return t[3] = 0,
  39426. t[7] = 0,
  39427. t[11] = 0,
  39428. t[12] = 0,
  39429. t[13] = 0,
  39430. t[14] = 0,
  39431. t[15] = 1,
  39432. this
  39433. },
  39434. makeRotationFromQuaternion: function(e) {
  39435. var t = this.elements
  39436. , i = e.x
  39437. , n = e.y
  39438. , r = e.z
  39439. , o = e.w
  39440. , a = i + i
  39441. , s = n + n
  39442. , l = r + r
  39443. , c = i * a
  39444. , h = i * s
  39445. , u = i * l
  39446. , d = n * s
  39447. , p = n * l
  39448. , f = r * l
  39449. , g = o * a
  39450. , m = o * s
  39451. , v = o * l;
  39452. return t[0] = 1 - (d + f),
  39453. t[4] = h - v,
  39454. t[8] = u + m,
  39455. t[1] = h + v,
  39456. t[5] = 1 - (c + f),
  39457. t[9] = p - g,
  39458. t[2] = u - m,
  39459. t[6] = p + g,
  39460. t[10] = 1 - (c + d),
  39461. t[3] = 0,
  39462. t[7] = 0,
  39463. t[11] = 0,
  39464. t[12] = 0,
  39465. t[13] = 0,
  39466. t[14] = 0,
  39467. t[15] = 1,
  39468. this
  39469. },
  39470. lookAt: function(e, t, i) {
  39471. void 0 === oe && (oe = new Ci.Vector3),
  39472. void 0 === ae && (ae = new Ci.Vector3),
  39473. void 0 === se && (se = new Ci.Vector3);
  39474. var n = this.elements;
  39475. return se.subVectors(e, t).normalize(),
  39476. 0 === se.lengthSq() && (se.z = 1),
  39477. oe.crossVectors(i, se).normalize(),
  39478. 0 === oe.lengthSq() && (se.x += 1e-4,
  39479. oe.crossVectors(i, se).normalize()),
  39480. ae.crossVectors(se, oe),
  39481. n[0] = oe.x,
  39482. n[4] = ae.x,
  39483. n[8] = se.x,
  39484. n[1] = oe.y,
  39485. n[5] = ae.y,
  39486. n[9] = se.y,
  39487. n[2] = oe.z,
  39488. n[6] = ae.z,
  39489. n[10] = se.z,
  39490. this
  39491. },
  39492. multiply: function(e, t) {
  39493. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39494. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39495. },
  39496. multiplyMatrices: function(e, t) {
  39497. var i = e.elements
  39498. , n = t.elements
  39499. , r = this.elements
  39500. , o = i[0]
  39501. , a = i[4]
  39502. , s = i[8]
  39503. , l = i[12]
  39504. , c = i[1]
  39505. , h = i[5]
  39506. , u = i[9]
  39507. , d = i[13]
  39508. , p = i[2]
  39509. , f = i[6]
  39510. , g = i[10]
  39511. , m = i[14]
  39512. , v = i[3]
  39513. , y = i[7]
  39514. , A = i[11]
  39515. , C = i[15]
  39516. , I = n[0]
  39517. , E = n[4]
  39518. , _ = n[8]
  39519. , b = n[12]
  39520. , w = n[1]
  39521. , T = n[5]
  39522. , x = n[9]
  39523. , S = n[13]
  39524. , M = n[2]
  39525. , R = n[6]
  39526. , P = n[10]
  39527. , O = n[14]
  39528. , L = n[3]
  39529. , D = n[7]
  39530. , N = n[11]
  39531. , F = n[15];
  39532. return r[0] = o * I + a * w + s * M + l * L,
  39533. r[4] = o * E + a * T + s * R + l * D,
  39534. r[8] = o * _ + a * x + s * P + l * N,
  39535. r[12] = o * b + a * S + s * O + l * F,
  39536. r[1] = c * I + h * w + u * M + d * L,
  39537. r[5] = c * E + h * T + u * R + d * D,
  39538. r[9] = c * _ + h * x + u * P + d * N,
  39539. r[13] = c * b + h * S + u * O + d * F,
  39540. r[2] = p * I + f * w + g * M + m * L,
  39541. r[6] = p * E + f * T + g * R + m * D,
  39542. r[10] = p * _ + f * x + g * P + m * N,
  39543. r[14] = p * b + f * S + g * O + m * F,
  39544. r[3] = v * I + y * w + A * M + C * L,
  39545. r[7] = v * E + y * T + A * R + C * D,
  39546. r[11] = v * _ + y * x + A * P + C * N,
  39547. r[15] = v * b + y * S + A * O + C * F,
  39548. this
  39549. },
  39550. multiplyToArray: function(e, t, i) {
  39551. var n = this.elements;
  39552. return this.multiplyMatrices(e, t),
  39553. i[0] = n[0],
  39554. i[1] = n[1],
  39555. i[2] = n[2],
  39556. i[3] = n[3],
  39557. i[4] = n[4],
  39558. i[5] = n[5],
  39559. i[6] = n[6],
  39560. i[7] = n[7],
  39561. i[8] = n[8],
  39562. i[9] = n[9],
  39563. i[10] = n[10],
  39564. i[11] = n[11],
  39565. i[12] = n[12],
  39566. i[13] = n[13],
  39567. i[14] = n[14],
  39568. i[15] = n[15],
  39569. this
  39570. },
  39571. multiplyScalar: function(e) {
  39572. var t = this.elements;
  39573. return t[0] *= e,
  39574. t[4] *= e,
  39575. t[8] *= e,
  39576. t[12] *= e,
  39577. t[1] *= e,
  39578. t[5] *= e,
  39579. t[9] *= e,
  39580. t[13] *= e,
  39581. t[2] *= e,
  39582. t[6] *= e,
  39583. t[10] *= e,
  39584. t[14] *= e,
  39585. t[3] *= e,
  39586. t[7] *= e,
  39587. t[11] *= e,
  39588. t[15] *= e,
  39589. this
  39590. },
  39591. applyToVector3Array: function(e, t, i) {
  39592. void 0 === re && (re = new Ci.Vector3),
  39593. void 0 === t && (t = 0),
  39594. void 0 === i && (i = e.length);
  39595. for (var n = 0, r = t; n < i; n += 3,
  39596. r += 3)
  39597. re.fromArray(e, r),
  39598. re.applyMatrix4(this),
  39599. re.toArray(e, r);
  39600. return e
  39601. },
  39602. applyToBuffer: function(e, t, i) {
  39603. void 0 === ne && (ne = new Ci.Vector3),
  39604. void 0 === t && (t = 0),
  39605. void 0 === i && (i = e.length / e.itemSize);
  39606. for (var n = 0, r = t; n < i; n++,
  39607. r++)
  39608. ne.x = e.getX(r),
  39609. ne.y = e.getY(r),
  39610. ne.z = e.getZ(r),
  39611. ne.applyMatrix4(this),
  39612. e.setXYZ(ne.x, ne.y, ne.z);
  39613. return e
  39614. },
  39615. determinant: function() {
  39616. var e = this.elements
  39617. , t = e[0]
  39618. , i = e[4]
  39619. , n = e[8]
  39620. , r = e[12]
  39621. , o = e[1]
  39622. , a = e[5]
  39623. , s = e[9]
  39624. , l = e[13]
  39625. , c = e[2]
  39626. , h = e[6]
  39627. , u = e[10]
  39628. , d = e[14];
  39629. 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)
  39630. },
  39631. transpose: function() {
  39632. var e, t = this.elements;
  39633. return e = t[1],
  39634. t[1] = t[4],
  39635. t[4] = e,
  39636. e = t[2],
  39637. t[2] = t[8],
  39638. t[8] = e,
  39639. e = t[6],
  39640. t[6] = t[9],
  39641. t[9] = e,
  39642. e = t[3],
  39643. t[3] = t[12],
  39644. t[12] = e,
  39645. e = t[7],
  39646. t[7] = t[13],
  39647. t[13] = e,
  39648. e = t[11],
  39649. t[11] = t[14],
  39650. t[14] = e,
  39651. this
  39652. },
  39653. flattenToArrayOffset: function(e, t) {
  39654. var i = this.elements;
  39655. return e[t] = i[0],
  39656. e[t + 1] = i[1],
  39657. e[t + 2] = i[2],
  39658. e[t + 3] = i[3],
  39659. e[t + 4] = i[4],
  39660. e[t + 5] = i[5],
  39661. e[t + 6] = i[6],
  39662. e[t + 7] = i[7],
  39663. e[t + 8] = i[8],
  39664. e[t + 9] = i[9],
  39665. e[t + 10] = i[10],
  39666. e[t + 11] = i[11],
  39667. e[t + 12] = i[12],
  39668. e[t + 13] = i[13],
  39669. e[t + 14] = i[14],
  39670. e[t + 15] = i[15],
  39671. e
  39672. },
  39673. getPosition: function() {
  39674. return void 0 === ie && (ie = new Ci.Vector3),
  39675. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39676. ie.setFromMatrixColumn(this, 3)
  39677. },
  39678. setPosition: function(e) {
  39679. var t = this.elements;
  39680. return t[12] = e.x,
  39681. t[13] = e.y,
  39682. t[14] = e.z,
  39683. this
  39684. },
  39685. getInverse: function(e, t) {
  39686. var i = this.elements
  39687. , n = e.elements
  39688. , r = n[0]
  39689. , o = n[1]
  39690. , a = n[2]
  39691. , s = n[3]
  39692. , l = n[4]
  39693. , c = n[5]
  39694. , h = n[6]
  39695. , u = n[7]
  39696. , d = n[8]
  39697. , p = n[9]
  39698. , f = n[10]
  39699. , g = n[11]
  39700. , m = n[12]
  39701. , v = n[13]
  39702. , y = n[14]
  39703. , A = n[15]
  39704. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39705. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39706. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39707. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39708. , b = r * C + o * I + a * E + s * _;
  39709. if (0 != b)
  39710. return i[0] = C,
  39711. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39712. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39713. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39714. i[4] = I,
  39715. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39716. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39717. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39718. i[8] = E,
  39719. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39720. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39721. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39722. i[12] = _,
  39723. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39724. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39725. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39726. this.multiplyScalar(1 / b);
  39727. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39728. if (t)
  39729. throw new Error(w);
  39730. return console.warn(w),
  39731. this.identity()
  39732. },
  39733. scale: function(e) {
  39734. var t = this.elements
  39735. , i = e.x
  39736. , n = e.y
  39737. , r = e.z;
  39738. return t[0] *= i,
  39739. t[4] *= n,
  39740. t[8] *= r,
  39741. t[1] *= i,
  39742. t[5] *= n,
  39743. t[9] *= r,
  39744. t[2] *= i,
  39745. t[6] *= n,
  39746. t[10] *= r,
  39747. t[3] *= i,
  39748. t[7] *= n,
  39749. t[11] *= r,
  39750. this
  39751. },
  39752. getMaxScaleOnAxis: function() {
  39753. var e = this.elements
  39754. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39755. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39756. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39757. return Math.sqrt(Math.max(t, i, n))
  39758. },
  39759. makeTranslation: function(e, t, i) {
  39760. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39761. this
  39762. },
  39763. makeRotationX: function(e) {
  39764. var t = Math.cos(e)
  39765. , i = Math.sin(e);
  39766. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39767. this
  39768. },
  39769. makeRotationY: function(e) {
  39770. var t = Math.cos(e)
  39771. , i = Math.sin(e);
  39772. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39773. this
  39774. },
  39775. makeRotationZ: function(e) {
  39776. var t = Math.cos(e)
  39777. , i = Math.sin(e);
  39778. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39779. this
  39780. },
  39781. makeRotationAxis: function(e, t) {
  39782. var i = Math.cos(t)
  39783. , n = Math.sin(t)
  39784. , r = 1 - i
  39785. , o = e.x
  39786. , a = e.y
  39787. , s = e.z
  39788. , l = r * o
  39789. , c = r * a;
  39790. 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),
  39791. this
  39792. },
  39793. makeScale: function(e, t, i) {
  39794. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39795. this
  39796. },
  39797. compose: function(e, t, i) {
  39798. return this.makeRotationFromQuaternion(t),
  39799. this.scale(i),
  39800. this.setPosition(e),
  39801. this
  39802. },
  39803. decompose: function(e, t, i) {
  39804. void 0 === ee && (ee = new Ci.Vector3),
  39805. void 0 === te && (te = new Ci.Matrix4);
  39806. var n = this.elements
  39807. , r = ee.set(n[0], n[1], n[2]).length()
  39808. , o = ee.set(n[4], n[5], n[6]).length()
  39809. , a = ee.set(n[8], n[9], n[10]).length();
  39810. this.determinant() < 0 && (r = -r),
  39811. e.x = n[12],
  39812. e.y = n[13],
  39813. e.z = n[14],
  39814. te.elements.set(this.elements);
  39815. var s = 1 / r
  39816. , l = 1 / o
  39817. , c = 1 / a;
  39818. return te.elements[0] *= s,
  39819. te.elements[1] *= s,
  39820. te.elements[2] *= s,
  39821. te.elements[4] *= l,
  39822. te.elements[5] *= l,
  39823. te.elements[6] *= l,
  39824. te.elements[8] *= c,
  39825. te.elements[9] *= c,
  39826. te.elements[10] *= c,
  39827. t.setFromRotationMatrix(te),
  39828. i.x = r,
  39829. i.y = o,
  39830. i.z = a,
  39831. this
  39832. },
  39833. makeFrustum: function(e, t, i, n, r, o) {
  39834. var a = this.elements
  39835. , s = 2 * r / (t - e)
  39836. , l = 2 * r / (n - i)
  39837. , c = (t + e) / (t - e)
  39838. , h = (n + i) / (n - i)
  39839. , u = -(o + r) / (o - r)
  39840. , d = -2 * o * r / (o - r);
  39841. return a[0] = s,
  39842. a[4] = 0,
  39843. a[8] = c,
  39844. a[12] = 0,
  39845. a[1] = 0,
  39846. a[5] = l,
  39847. a[9] = h,
  39848. a[13] = 0,
  39849. a[2] = 0,
  39850. a[6] = 0,
  39851. a[10] = u,
  39852. a[14] = d,
  39853. a[3] = 0,
  39854. a[7] = 0,
  39855. a[11] = -1,
  39856. a[15] = 0,
  39857. this
  39858. },
  39859. makePerspective: function(e, t, i, n) {
  39860. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39861. , o = -r
  39862. , a = o * t
  39863. , s = r * t;
  39864. return this.makeFrustum(a, s, o, r, i, n)
  39865. },
  39866. makeOrthographic: function(e, t, i, n, r, o) {
  39867. var a = this.elements
  39868. , s = 1 / (t - e)
  39869. , l = 1 / (i - n)
  39870. , c = 1 / (o - r)
  39871. , h = (t + e) * s
  39872. , u = (i + n) * l
  39873. , d = (o + r) * c;
  39874. return a[0] = 2 * s,
  39875. a[4] = 0,
  39876. a[8] = 0,
  39877. a[12] = -h,
  39878. a[1] = 0,
  39879. a[5] = 2 * l,
  39880. a[9] = 0,
  39881. a[13] = -u,
  39882. a[2] = 0,
  39883. a[6] = 0,
  39884. a[10] = -2 * c,
  39885. a[14] = -d,
  39886. a[3] = 0,
  39887. a[7] = 0,
  39888. a[11] = 0,
  39889. a[15] = 1,
  39890. this
  39891. },
  39892. equals: function(e) {
  39893. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39894. if (t[n] !== i[n])
  39895. return !1;
  39896. return !0
  39897. },
  39898. fromArray: function(e) {
  39899. return this.elements.set(e),
  39900. this
  39901. },
  39902. toArray: function() {
  39903. var e = this.elements;
  39904. 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]]
  39905. }
  39906. },
  39907. Ci.Ray = function(e, t) {
  39908. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39909. this.direction = void 0 !== t ? t : new Ci.Vector3
  39910. }
  39911. ,
  39912. Ci.Ray.prototype = {
  39913. constructor: Ci.Ray,
  39914. set: function(e, t) {
  39915. return this.origin.copy(e),
  39916. this.direction.copy(t),
  39917. this
  39918. },
  39919. clone: function() {
  39920. return (new this.constructor).copy(this)
  39921. },
  39922. copy: function(e) {
  39923. return this.origin.copy(e.origin),
  39924. this.direction.copy(e.direction),
  39925. this
  39926. },
  39927. at: function(e, t) {
  39928. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39929. },
  39930. lookAt: function(e) {
  39931. this.direction.copy(e).sub(this.origin).normalize()
  39932. },
  39933. recast: ($ = new Ci.Vector3,
  39934. function(e) {
  39935. return this.origin.copy(this.at(e, $)),
  39936. this
  39937. }
  39938. ),
  39939. closestPointToPoint: function(e, t) {
  39940. var i = t || new Ci.Vector3;
  39941. i.subVectors(e, this.origin);
  39942. var n = i.dot(this.direction);
  39943. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39944. },
  39945. distanceToPoint: function(e) {
  39946. return Math.sqrt(this.distanceSqToPoint(e))
  39947. },
  39948. distanceSqToPoint: (J = new Ci.Vector3,
  39949. function(e) {
  39950. var t = J.subVectors(e, this.origin).dot(this.direction);
  39951. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39952. J.distanceToSquared(e))
  39953. }
  39954. ),
  39955. distanceSqToSegment: (Z = new Ci.Vector3,
  39956. K = new Ci.Vector3,
  39957. Q = new Ci.Vector3,
  39958. function(e, t, i, n) {
  39959. Z.copy(e).add(t).multiplyScalar(.5),
  39960. K.copy(t).sub(e).normalize(),
  39961. Q.copy(this.origin).sub(Z);
  39962. 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);
  39963. if (0 < p)
  39964. if (o = c * h - u,
  39965. s = l * p,
  39966. 0 <= (r = c * u - h))
  39967. if (-s <= o)
  39968. if (o <= s) {
  39969. var f = 1 / p;
  39970. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39971. } else
  39972. o = l,
  39973. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39974. else
  39975. o = -l,
  39976. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39977. else
  39978. 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,
  39979. (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;
  39980. else
  39981. o = 0 < c ? -l : l,
  39982. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39983. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39984. n && n.copy(K).multiplyScalar(o).add(Z),
  39985. a
  39986. }
  39987. ),
  39988. intersectSphere: (X = new Ci.Vector3,
  39989. function(e, t) {
  39990. X.subVectors(e.center, this.origin);
  39991. var i = X.dot(this.direction)
  39992. , n = X.dot(X) - i * i
  39993. , r = e.radius * e.radius;
  39994. if (r < n)
  39995. return null;
  39996. var o = Math.sqrt(r - n)
  39997. , a = i - o
  39998. , s = i + o;
  39999. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40000. }
  40001. ),
  40002. intersectsSphere: function(e) {
  40003. return this.distanceToPoint(e.center) <= e.radius
  40004. },
  40005. distanceToPlane: function(e) {
  40006. var t = e.normal.dot(this.direction);
  40007. if (0 === t)
  40008. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40009. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40010. return 0 <= i ? i : null
  40011. },
  40012. intersectPlane: function(e, t) {
  40013. var i = this.distanceToPlane(e);
  40014. return null === i ? null : this.at(i, t)
  40015. },
  40016. intersectsPlane: function(e) {
  40017. var t = e.distanceToPoint(this.origin);
  40018. return 0 === t || e.normal.dot(this.direction) * t < 0
  40019. },
  40020. intersectBox: function(e, t) {
  40021. 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;
  40022. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40023. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40024. (e.min.x - u.x) * l),
  40025. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40026. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40027. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40028. (o < n || n != n) && (n = o),
  40029. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40030. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40031. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40032. (s < n || n != n) && (n = s),
  40033. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40034. },
  40035. intersectsBox: (q = new Ci.Vector3,
  40036. function(e) {
  40037. return null !== this.intersectBox(e, q)
  40038. }
  40039. ),
  40040. intersectTriangle: (G = new Ci.Vector3,
  40041. W = new Ci.Vector3,
  40042. j = new Ci.Vector3,
  40043. Y = new Ci.Vector3,
  40044. function(e, t, i, n, r) {
  40045. W.subVectors(t, e),
  40046. j.subVectors(i, e),
  40047. Y.crossVectors(W, j);
  40048. var o, a = this.direction.dot(Y);
  40049. if (0 < a) {
  40050. if (n)
  40051. return null;
  40052. o = 1
  40053. } else {
  40054. if (!(a < 0))
  40055. return null;
  40056. o = -1,
  40057. a = -a
  40058. }
  40059. G.subVectors(this.origin, e);
  40060. var s = o * this.direction.dot(j.crossVectors(G, j));
  40061. if (s < 0)
  40062. return null;
  40063. var l = o * this.direction.dot(W.cross(G));
  40064. if (l < 0)
  40065. return null;
  40066. if (a < s + l)
  40067. return null;
  40068. var c = -o * G.dot(Y);
  40069. return c < 0 ? null : this.at(c / a, r)
  40070. }
  40071. ),
  40072. applyMatrix4: function(e) {
  40073. return this.direction.add(this.origin).applyMatrix4(e),
  40074. this.origin.applyMatrix4(e),
  40075. this.direction.sub(this.origin),
  40076. this.direction.normalize(),
  40077. this
  40078. },
  40079. equals: function(e) {
  40080. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40081. }
  40082. },
  40083. Ci.Sphere = function(e, t) {
  40084. this.center = void 0 !== e ? e : new Ci.Vector3,
  40085. this.radius = void 0 !== t ? t : 0
  40086. }
  40087. ,
  40088. Ci.Sphere.prototype = {
  40089. constructor: Ci.Sphere,
  40090. set: function(e, t) {
  40091. return this.center.copy(e),
  40092. this.radius = t,
  40093. this
  40094. },
  40095. setFromPoints: (z = new Ci.Box3,
  40096. function(e, t) {
  40097. var i = this.center;
  40098. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40099. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40100. n = Math.max(n, i.distanceToSquared(e[r]));
  40101. return this.radius = Math.sqrt(n),
  40102. this
  40103. }
  40104. ),
  40105. clone: function() {
  40106. return (new this.constructor).copy(this)
  40107. },
  40108. copy: function(e) {
  40109. return this.center.copy(e.center),
  40110. this.radius = e.radius,
  40111. this
  40112. },
  40113. empty: function() {
  40114. return this.radius <= 0
  40115. },
  40116. containsPoint: function(e) {
  40117. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40118. },
  40119. distanceToPoint: function(e) {
  40120. return e.distanceTo(this.center) - this.radius
  40121. },
  40122. intersectsSphere: function(e) {
  40123. var t = this.radius + e.radius;
  40124. return e.center.distanceToSquared(this.center) <= t * t
  40125. },
  40126. intersectsBox: function(e) {
  40127. return e.intersectsSphere(this)
  40128. },
  40129. intersectsPlane: function(e) {
  40130. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40131. },
  40132. clampPoint: function(e, t) {
  40133. var i = this.center.distanceToSquared(e)
  40134. , n = t || new Ci.Vector3;
  40135. return n.copy(e),
  40136. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40137. n.multiplyScalar(this.radius).add(this.center)),
  40138. n
  40139. },
  40140. getBoundingBox: function(e) {
  40141. var t = e || new Ci.Box3;
  40142. return t.set(this.center, this.center),
  40143. t.expandByScalar(this.radius),
  40144. t
  40145. },
  40146. applyMatrix4: function(e) {
  40147. return this.center.applyMatrix4(e),
  40148. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40149. this
  40150. },
  40151. translate: function(e) {
  40152. return this.center.add(e),
  40153. this
  40154. },
  40155. equals: function(e) {
  40156. return e.center.equals(this.center) && e.radius === this.radius
  40157. }
  40158. },
  40159. Ci.Frustum = function(e, t, i, n, r, o) {
  40160. 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]
  40161. }
  40162. ,
  40163. Ci.Frustum.prototype = {
  40164. constructor: Ci.Frustum,
  40165. set: function(e, t, i, n, r, o) {
  40166. var a = this.planes;
  40167. return a[0].copy(e),
  40168. a[1].copy(t),
  40169. a[2].copy(i),
  40170. a[3].copy(n),
  40171. a[4].copy(r),
  40172. a[5].copy(o),
  40173. this
  40174. },
  40175. clone: function() {
  40176. return (new this.constructor).copy(this)
  40177. },
  40178. copy: function(e) {
  40179. for (var t = this.planes, i = 0; i < 6; i++)
  40180. t[i].copy(e.planes[i]);
  40181. return this
  40182. },
  40183. setFromMatrix: function(e) {
  40184. var t = this.planes
  40185. , i = e.elements
  40186. , n = i[0]
  40187. , r = i[1]
  40188. , o = i[2]
  40189. , a = i[3]
  40190. , s = i[4]
  40191. , l = i[5]
  40192. , c = i[6]
  40193. , h = i[7]
  40194. , u = i[8]
  40195. , d = i[9]
  40196. , p = i[10]
  40197. , f = i[11]
  40198. , g = i[12]
  40199. , m = i[13]
  40200. , v = i[14]
  40201. , y = i[15];
  40202. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40203. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40204. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40205. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40206. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40207. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40208. this
  40209. },
  40210. intersectsObject: (H = new Ci.Sphere,
  40211. function(e) {
  40212. var t = e.geometry;
  40213. return null === t.boundingSphere && t.computeBoundingSphere(),
  40214. H.copy(t.boundingSphere),
  40215. H.applyMatrix4(e.matrixWorld),
  40216. this.intersectsSphere(H)
  40217. }
  40218. ),
  40219. intersectsSphere: function(e) {
  40220. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40221. if (t[r].distanceToPoint(i) < n)
  40222. return !1
  40223. }
  40224. return !0
  40225. },
  40226. intersectsBox: (k = new Ci.Vector3,
  40227. U = new Ci.Vector3,
  40228. function(e) {
  40229. for (var t = this.planes, i = 0; i < 6; i++) {
  40230. var n = t[i];
  40231. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40232. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40233. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40234. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40235. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40236. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40237. var r = n.distanceToPoint(k)
  40238. , o = n.distanceToPoint(U);
  40239. if (r < 0 && o < 0)
  40240. return !1
  40241. }
  40242. return !0
  40243. }
  40244. ),
  40245. containsPoint: function(e) {
  40246. for (var t = this.planes, i = 0; i < 6; i++)
  40247. if (t[i].distanceToPoint(e) < 0)
  40248. return !1;
  40249. return !0
  40250. }
  40251. },
  40252. Ci.Plane = function(e, t) {
  40253. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40254. this.constant = void 0 !== t ? t : 0
  40255. }
  40256. ,
  40257. Ci.Plane.prototype = {
  40258. constructor: Ci.Plane,
  40259. set: function(e, t) {
  40260. return this.normal.copy(e),
  40261. this.constant = t,
  40262. this
  40263. },
  40264. setComponents: function(e, t, i, n) {
  40265. return this.normal.set(e, t, i),
  40266. this.constant = n,
  40267. this
  40268. },
  40269. setFromNormalAndCoplanarPoint: function(e, t) {
  40270. return this.normal.copy(e),
  40271. this.constant = -t.dot(this.normal),
  40272. this
  40273. },
  40274. setFromCoplanarPoints: (B = new Ci.Vector3,
  40275. V = new Ci.Vector3,
  40276. function(e, t, i) {
  40277. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40278. return this.setFromNormalAndCoplanarPoint(n, e),
  40279. this
  40280. }
  40281. ),
  40282. clone: function() {
  40283. return (new this.constructor).copy(this)
  40284. },
  40285. copy: function(e) {
  40286. return this.normal.copy(e.normal),
  40287. this.constant = e.constant,
  40288. this
  40289. },
  40290. normalize: function() {
  40291. var e = 1 / this.normal.length();
  40292. return this.normal.multiplyScalar(e),
  40293. this.constant *= e,
  40294. this
  40295. },
  40296. negate: function() {
  40297. return this.constant *= -1,
  40298. this.normal.negate(),
  40299. this
  40300. },
  40301. distanceToPoint: function(e) {
  40302. return this.normal.dot(e) + this.constant
  40303. },
  40304. distanceToSphere: function(e) {
  40305. return this.distanceToPoint(e.center) - e.radius
  40306. },
  40307. projectPoint: function(e, t) {
  40308. return this.orthoPoint(e, t).sub(e).negate()
  40309. },
  40310. orthoPoint: function(e, t) {
  40311. var i = this.distanceToPoint(e);
  40312. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40313. },
  40314. intersectLine: (F = new Ci.Vector3,
  40315. function(e, t) {
  40316. var i = t || new Ci.Vector3
  40317. , n = e.delta(F)
  40318. , r = this.normal.dot(n);
  40319. if (0 !== r) {
  40320. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40321. if (!(o < 0 || 1 < o))
  40322. return i.copy(n).multiplyScalar(o).add(e.start)
  40323. } else if (0 === this.distanceToPoint(e.start))
  40324. return i.copy(e.start)
  40325. }
  40326. ),
  40327. intersectsLine: function(e) {
  40328. var t = this.distanceToPoint(e.start)
  40329. , i = this.distanceToPoint(e.end);
  40330. return t < 0 && 0 < i || i < 0 && 0 < t
  40331. },
  40332. intersectsBox: function(e) {
  40333. return e.intersectsPlane(this)
  40334. },
  40335. intersectsSphere: function(e) {
  40336. return e.intersectsPlane(this)
  40337. },
  40338. coplanarPoint: function(e) {
  40339. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40340. },
  40341. applyMatrix4: (L = new Ci.Vector3,
  40342. D = new Ci.Vector3,
  40343. N = new Ci.Matrix3,
  40344. function(e, t) {
  40345. var i = t || N.getNormalMatrix(e)
  40346. , n = L.copy(this.normal).applyMatrix3(i)
  40347. , r = this.coplanarPoint(D);
  40348. return r.applyMatrix4(e),
  40349. this.setFromNormalAndCoplanarPoint(n, r),
  40350. this
  40351. }
  40352. ),
  40353. translate: function(e) {
  40354. return this.constant = this.constant - e.dot(this.normal),
  40355. this
  40356. },
  40357. equals: function(e) {
  40358. return e.normal.equals(this.normal) && e.constant === this.constant
  40359. }
  40360. },
  40361. Ci.Spherical = function(e, t, i) {
  40362. return this.radius = void 0 !== e ? e : 1,
  40363. this.phi = void 0 !== t ? t : 0,
  40364. this.theta = void 0 !== i ? i : 0,
  40365. this
  40366. }
  40367. ,
  40368. Ci.Spherical.prototype = {
  40369. constructor: Ci.Spherical,
  40370. set: function(e, t, i) {
  40371. this.radius = e,
  40372. this.phi = t,
  40373. this.theta = i
  40374. },
  40375. clone: function() {
  40376. return (new this.constructor).copy(this)
  40377. },
  40378. copy: function(e) {
  40379. return this.radius.copy(e.radius),
  40380. this.phi.copy(e.phi),
  40381. this.theta.copy(e.theta),
  40382. this
  40383. },
  40384. makeSafe: function() {
  40385. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40386. },
  40387. setFromVector3: function(e) {
  40388. return this.radius = e.length(),
  40389. 0 === this.radius ? (this.theta = 0,
  40390. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40391. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40392. this
  40393. }
  40394. },
  40395. Ci.Math = {
  40396. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40397. P = new Array(36),
  40398. O = 0,
  40399. function() {
  40400. for (var e = 0; e < 36; e++)
  40401. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40402. M = 15 & O,
  40403. O >>= 4,
  40404. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40405. return P.join("")
  40406. }
  40407. ),
  40408. clamp: function(e, t, i) {
  40409. return Math.max(t, Math.min(i, e))
  40410. },
  40411. euclideanModulo: function(e, t) {
  40412. return (e % t + t) % t
  40413. },
  40414. mapLinear: function(e, t, i, n, r) {
  40415. return n + (e - t) * (r - n) / (i - t)
  40416. },
  40417. smoothstep: function(e, t, i) {
  40418. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40419. },
  40420. smootherstep: function(e, t, i) {
  40421. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40422. },
  40423. random16: function() {
  40424. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40425. Math.random()
  40426. },
  40427. randInt: function(e, t) {
  40428. return e + Math.floor(Math.random() * (t - e + 1))
  40429. },
  40430. randFloat: function(e, t) {
  40431. return e + Math.random() * (t - e)
  40432. },
  40433. randFloatSpread: function(e) {
  40434. return e * (.5 - Math.random())
  40435. },
  40436. degToRad: (S = Math.PI / 180,
  40437. function(e) {
  40438. return e * S
  40439. }
  40440. ),
  40441. radToDeg: (x = 180 / Math.PI,
  40442. function(e) {
  40443. return e * x
  40444. }
  40445. ),
  40446. isPowerOfTwo: function(e) {
  40447. return 0 == (e & e - 1) && 0 !== e
  40448. },
  40449. nearestPowerOfTwo: function(e) {
  40450. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40451. },
  40452. nextPowerOfTwo: function(e) {
  40453. return e--,
  40454. e |= e >> 1,
  40455. e |= e >> 2,
  40456. e |= e >> 4,
  40457. e |= e >> 8,
  40458. e |= e >> 16,
  40459. ++e
  40460. }
  40461. },
  40462. Ci.Spline = function(e) {
  40463. function t(e, t, i, n, r, o, a) {
  40464. var s = .5 * (i - e)
  40465. , l = .5 * (n - t);
  40466. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40467. }
  40468. this.points = e;
  40469. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40470. x: 0,
  40471. y: 0,
  40472. z: 0
  40473. };
  40474. this.initFromArray = function(e) {
  40475. this.points = [];
  40476. for (var t = 0; t < e.length; t++)
  40477. this.points[t] = {
  40478. x: e[t][0],
  40479. y: e[t][1],
  40480. z: e[t][2]
  40481. }
  40482. }
  40483. ,
  40484. this.getPoint = function(e) {
  40485. return i = (this.points.length - 1) * e,
  40486. n = Math.floor(i),
  40487. r = i - n,
  40488. u[0] = 0 === n ? n : n - 1,
  40489. u[1] = n,
  40490. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40491. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40492. s = this.points[u[0]],
  40493. l = this.points[u[1]],
  40494. c = this.points[u[2]],
  40495. h = this.points[u[3]],
  40496. a = r * (o = r * r),
  40497. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40498. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40499. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40500. d
  40501. }
  40502. ,
  40503. this.getControlPointsArray = function() {
  40504. var e, t, i = this.points.length, n = [];
  40505. for (e = 0; e < i; e++)
  40506. t = this.points[e],
  40507. n[e] = [t.x, t.y, t.z];
  40508. return n
  40509. }
  40510. ,
  40511. this.getLength = function(e) {
  40512. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40513. for (h[0] = 0,
  40514. e = e || 100,
  40515. n = this.points.length * e,
  40516. l.copy(this.points[0]),
  40517. t = 1; t < n; t++)
  40518. i = t / n,
  40519. r = this.getPoint(i),
  40520. c.copy(r),
  40521. u += c.distanceTo(l),
  40522. l.copy(r),
  40523. o = (this.points.length - 1) * i,
  40524. (a = Math.floor(o)) !== s && (h[a] = u,
  40525. s = a);
  40526. return h[h.length] = u,
  40527. {
  40528. chunks: h,
  40529. total: u
  40530. }
  40531. }
  40532. ,
  40533. this.reparametrizeByArcLength = function(e) {
  40534. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40535. for (c.push(h.copy(this.points[0]).clone()),
  40536. t = 1; t < this.points.length; t++) {
  40537. for (a = u.chunks[t] - u.chunks[t - 1],
  40538. s = Math.ceil(e * a / u.total),
  40539. r = (t - 1) / (this.points.length - 1),
  40540. o = t / (this.points.length - 1),
  40541. i = 1; i < s - 1; i++)
  40542. n = r + i * (1 / s) * (o - r),
  40543. l = this.getPoint(n),
  40544. c.push(h.copy(l).clone());
  40545. c.push(h.copy(this.points[t]).clone())
  40546. }
  40547. this.points = c
  40548. }
  40549. }
  40550. ,
  40551. Ci.Triangle = function(e, t, i) {
  40552. this.a = void 0 !== e ? e : new Ci.Vector3,
  40553. this.b = void 0 !== t ? t : new Ci.Vector3,
  40554. this.c = void 0 !== i ? i : new Ci.Vector3
  40555. }
  40556. ,
  40557. Ci.Triangle.normal = (T = new Ci.Vector3,
  40558. function(e, t, i, n) {
  40559. var r = n || new Ci.Vector3;
  40560. r.subVectors(i, t),
  40561. T.subVectors(e, t),
  40562. r.cross(T);
  40563. var o = r.lengthSq();
  40564. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40565. }
  40566. ),
  40567. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40568. b = new Ci.Vector3,
  40569. w = new Ci.Vector3,
  40570. function(e, t, i, n, r) {
  40571. _.subVectors(n, t),
  40572. b.subVectors(i, t),
  40573. w.subVectors(e, t);
  40574. var o = _.dot(_)
  40575. , a = _.dot(b)
  40576. , s = _.dot(w)
  40577. , l = b.dot(b)
  40578. , c = b.dot(w)
  40579. , h = o * l - a * a
  40580. , u = r || new Ci.Vector3;
  40581. if (0 == h)
  40582. return u.set(-2, -1, -1);
  40583. var d = 1 / h
  40584. , p = (l * s - a * c) * d
  40585. , f = (o * c - a * s) * d;
  40586. return u.set(1 - p - f, f, p)
  40587. }
  40588. ),
  40589. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40590. function(e, t, i, n) {
  40591. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40592. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40593. }
  40594. ),
  40595. Ci.Triangle.prototype = {
  40596. constructor: Ci.Triangle,
  40597. set: function(e, t, i) {
  40598. return this.a.copy(e),
  40599. this.b.copy(t),
  40600. this.c.copy(i),
  40601. this
  40602. },
  40603. setFromPointsAndIndices: function(e, t, i, n) {
  40604. return this.a.copy(e[t]),
  40605. this.b.copy(e[i]),
  40606. this.c.copy(e[n]),
  40607. this
  40608. },
  40609. clone: function() {
  40610. return (new this.constructor).copy(this)
  40611. },
  40612. copy: function(e) {
  40613. return this.a.copy(e.a),
  40614. this.b.copy(e.b),
  40615. this.c.copy(e.c),
  40616. this
  40617. },
  40618. area: (C = new Ci.Vector3,
  40619. I = new Ci.Vector3,
  40620. function() {
  40621. return C.subVectors(this.c, this.b),
  40622. I.subVectors(this.a, this.b),
  40623. .5 * C.cross(I).length()
  40624. }
  40625. ),
  40626. midpoint: function(e) {
  40627. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40628. },
  40629. normal: function(e) {
  40630. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40631. },
  40632. plane: function(e) {
  40633. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40634. },
  40635. barycoordFromPoint: function(e, t) {
  40636. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40637. },
  40638. containsPoint: function(e) {
  40639. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40640. },
  40641. equals: function(e) {
  40642. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40643. }
  40644. },
  40645. Ci.Interpolant = function(e, t, i, n) {
  40646. this.parameterPositions = e,
  40647. this._cachedIndex = 0,
  40648. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40649. this.sampleValues = t,
  40650. this.valueSize = i
  40651. }
  40652. ,
  40653. Ci.Interpolant.prototype = {
  40654. constructor: Ci.Interpolant,
  40655. evaluate: function(e) {
  40656. var t = this.parameterPositions
  40657. , i = this._cachedIndex
  40658. , n = t[i]
  40659. , r = t[i - 1];
  40660. e: {
  40661. t: {
  40662. var o;
  40663. i: {
  40664. n: if (!(e < n)) {
  40665. for (var a = i + 2; ; ) {
  40666. if (void 0 === n) {
  40667. if (e < r)
  40668. break n;
  40669. return i = t.length,
  40670. this._cachedIndex = i,
  40671. this.afterEnd_(i - 1, e, r)
  40672. }
  40673. if (i === a)
  40674. break;
  40675. if (r = n,
  40676. e < (n = t[++i]))
  40677. break t
  40678. }
  40679. o = t.length;
  40680. break i
  40681. }
  40682. if (r <= e)
  40683. break e;
  40684. var s = t[1];
  40685. e < s && (i = 2,
  40686. r = s);
  40687. for (a = i - 2; ; ) {
  40688. if (void 0 === r)
  40689. return this._cachedIndex = 0,
  40690. this.beforeStart_(0, e, n);
  40691. if (i === a)
  40692. break;
  40693. if (n = r,
  40694. (r = t[--i - 1]) <= e)
  40695. break t
  40696. }
  40697. o = i,
  40698. i = 0
  40699. }
  40700. for (; i < o; ) {
  40701. var l = i + o >>> 1;
  40702. e < t[l] ? o = l : i = 1 + l
  40703. }
  40704. if (n = t[i],
  40705. void 0 === (r = t[i - 1]))
  40706. return this._cachedIndex = 0,
  40707. this.beforeStart_(0, e, n);
  40708. if (void 0 === n)
  40709. return i = t.length,
  40710. this._cachedIndex = i,
  40711. this.afterEnd_(i - 1, r, e)
  40712. }
  40713. this._cachedIndex = i,
  40714. this.intervalChanged_(i, r, n)
  40715. }
  40716. return this.interpolate_(i, r, e, n)
  40717. },
  40718. settings: null,
  40719. DefaultSettings_: {},
  40720. getSettings_: function() {
  40721. return this.settings || this.DefaultSettings_
  40722. },
  40723. copySampleValue_: function(e) {
  40724. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40725. t[o] = i[r + o];
  40726. return t
  40727. },
  40728. interpolate_: function(e, t, i, n) {
  40729. throw new Error("call to abstract method")
  40730. },
  40731. intervalChanged_: function(e, t, i) {}
  40732. },
  40733. Object.assign(Ci.Interpolant.prototype, {
  40734. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40735. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40736. }),
  40737. Ci.CubicInterpolant = function(e, t, i, n) {
  40738. Ci.Interpolant.call(this, e, t, i, n),
  40739. this._weightPrev = -0,
  40740. this._offsetPrev = -0,
  40741. this._weightNext = -0,
  40742. this._offsetNext = -0
  40743. }
  40744. ,
  40745. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40746. constructor: Ci.CubicInterpolant,
  40747. DefaultSettings_: {
  40748. endingStart: Ci.ZeroCurvatureEnding,
  40749. endingEnd: Ci.ZeroCurvatureEnding
  40750. },
  40751. intervalChanged_: function(e, t, i) {
  40752. var n = this.parameterPositions
  40753. , r = e - 2
  40754. , o = e + 1
  40755. , a = n[r]
  40756. , s = n[o];
  40757. if (void 0 === a)
  40758. switch (this.getSettings_().endingStart) {
  40759. case Ci.ZeroSlopeEnding:
  40760. r = e,
  40761. a = 2 * t - i;
  40762. break;
  40763. case Ci.WrapAroundEnding:
  40764. a = t + n[r = n.length - 2] - n[r + 1];
  40765. break;
  40766. default:
  40767. r = e,
  40768. a = i
  40769. }
  40770. if (void 0 === s)
  40771. switch (this.getSettings_().endingEnd) {
  40772. case Ci.ZeroSlopeEnding:
  40773. o = e,
  40774. s = 2 * i - t;
  40775. break;
  40776. case Ci.WrapAroundEnding:
  40777. s = i + n[o = 1] - n[0];
  40778. break;
  40779. default:
  40780. o = e - 1,
  40781. s = t
  40782. }
  40783. var l = .5 * (i - t)
  40784. , c = this.valueSize;
  40785. this._weightPrev = l / (t - a),
  40786. this._weightNext = l / (s - i),
  40787. this._offsetPrev = r * c,
  40788. this._offsetNext = o * c
  40789. },
  40790. interpolate_: function(e, t, i, n) {
  40791. 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)
  40792. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40793. return r
  40794. }
  40795. }),
  40796. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40797. Ci.Interpolant.call(this, e, t, i, n)
  40798. }
  40799. ,
  40800. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40801. constructor: Ci.DiscreteInterpolant,
  40802. interpolate_: function(e, t, i, n) {
  40803. return this.copySampleValue_(e - 1)
  40804. }
  40805. }),
  40806. Ci.LinearInterpolant = function(e, t, i, n) {
  40807. Ci.Interpolant.call(this, e, t, i, n)
  40808. }
  40809. ,
  40810. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40811. constructor: Ci.LinearInterpolant,
  40812. interpolate_: function(e, t, i, n) {
  40813. 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)
  40814. r[u] = o[l + u] * h + o[s + u] * c;
  40815. return r
  40816. }
  40817. }),
  40818. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40819. Ci.Interpolant.call(this, e, t, i, n)
  40820. }
  40821. ,
  40822. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40823. constructor: Ci.QuaternionLinearInterpolant,
  40824. interpolate_: function(e, t, i, n) {
  40825. 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)
  40826. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40827. return r
  40828. }
  40829. }),
  40830. Ci.Clock = function(e) {
  40831. this.autoStart = void 0 === e || e,
  40832. this.startTime = 0,
  40833. this.oldTime = 0,
  40834. this.elapsedTime = 0,
  40835. this.running = !1
  40836. }
  40837. ,
  40838. Ci.Clock.prototype = {
  40839. constructor: Ci.Clock,
  40840. start: function() {
  40841. this.startTime = performance.now(),
  40842. this.oldTime = this.startTime,
  40843. this.running = !0
  40844. },
  40845. stop: function() {
  40846. this.getElapsedTime(),
  40847. this.running = !1
  40848. },
  40849. getElapsedTime: function() {
  40850. return this.getDelta(),
  40851. this.elapsedTime
  40852. },
  40853. getDelta: function() {
  40854. var e = 0;
  40855. if (this.autoStart && !this.running && this.start(),
  40856. this.running) {
  40857. var t = performance.now();
  40858. e = .001 * (t - this.oldTime),
  40859. this.oldTime = t,
  40860. this.elapsedTime += e
  40861. }
  40862. return e
  40863. }
  40864. },
  40865. Ci.EventDispatcher = function() {}
  40866. ,
  40867. Ci.EventDispatcher.prototype = {
  40868. constructor: Ci.EventDispatcher,
  40869. apply: function(e) {
  40870. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40871. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40872. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40873. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40874. },
  40875. addEventListener: function(e, t) {
  40876. void 0 === this._listeners && (this._listeners = {});
  40877. var i = this._listeners;
  40878. void 0 === i[e] && (i[e] = []),
  40879. -1 === i[e].indexOf(t) && i[e].push(t)
  40880. },
  40881. hasEventListener: function(e, t) {
  40882. if (void 0 === this._listeners)
  40883. return !1;
  40884. var i = this._listeners;
  40885. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40886. },
  40887. removeEventListener: function(e, t) {
  40888. if (void 0 !== this._listeners) {
  40889. var i = this._listeners[e];
  40890. if (void 0 !== i) {
  40891. var n = i.indexOf(t);
  40892. -1 !== n && i.splice(n, 1)
  40893. }
  40894. }
  40895. },
  40896. dispatchEvent: function(e) {
  40897. if (void 0 !== this._listeners) {
  40898. var t = this._listeners[e.type];
  40899. if (void 0 !== t) {
  40900. e.target = this;
  40901. for (var i = [], n = t.length, r = 0; r < n; r++)
  40902. i[r] = t[r];
  40903. for (r = 0; r < n; r++)
  40904. i[r].call(this, e)
  40905. }
  40906. }
  40907. }
  40908. },
  40909. Ci.Layers = function() {
  40910. this.mask = 1
  40911. }
  40912. ,
  40913. Ci.Layers.prototype = {
  40914. constructor: Ci.Layers,
  40915. set: function(e) {
  40916. this.mask = 1 << e
  40917. },
  40918. enable: function(e) {
  40919. this.mask |= 1 << e
  40920. },
  40921. toggle: function(e) {
  40922. this.mask ^= 1 << e
  40923. },
  40924. disable: function(e) {
  40925. this.mask &= ~(1 << e)
  40926. },
  40927. test: function(e) {
  40928. return 0 != (this.mask & e.mask)
  40929. }
  40930. },
  40931. (A = Ci).Raycaster = function(e, t, i, n) {
  40932. this.ray = new A.Ray(e,t),
  40933. this.near = i || 0,
  40934. this.far = n || 1 / 0,
  40935. this.params = {
  40936. Mesh: {},
  40937. Line: {},
  40938. LOD: {},
  40939. Points: {
  40940. threshold: 1
  40941. },
  40942. Sprite: {}
  40943. },
  40944. Object.defineProperties(this.params, {
  40945. PointCloud: {
  40946. get: function() {
  40947. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40948. this.Points
  40949. }
  40950. }
  40951. })
  40952. }
  40953. ,
  40954. A.Raycaster.prototype = {
  40955. constructor: A.Raycaster,
  40956. linePrecision: 1,
  40957. set: function(e, t) {
  40958. this.ray.set(e, t)
  40959. },
  40960. setFromCamera: function(e, t) {
  40961. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40962. 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),
  40963. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40964. },
  40965. intersectObject: function(e, t) {
  40966. var i = [];
  40967. return Ei(e, this, i, t),
  40968. i.sort(Ii),
  40969. i
  40970. },
  40971. intersectObjects: function(e, t) {
  40972. var i = [];
  40973. if (!1 === Array.isArray(e))
  40974. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40975. i;
  40976. for (var n = 0, r = e.length; n < r; n++)
  40977. Ei(e[n], this, i, t);
  40978. return i.sort(Ii),
  40979. i
  40980. }
  40981. },
  40982. Ci.Object3D = function() {
  40983. Object.defineProperty(this, "id", {
  40984. value: Ci.Object3DIdCount++
  40985. }),
  40986. this.uuid = Ci.Math.generateUUID(),
  40987. this.name = "",
  40988. this.type = "Object3D",
  40989. this.parent = null,
  40990. this.children = [],
  40991. this.up = Ci.Object3D.DefaultUp.clone();
  40992. var e = new Ci.Vector3
  40993. , t = new Ci.Euler
  40994. , i = new Ci.Quaternion
  40995. , n = new Ci.Vector3(1,1,1);
  40996. t.onChange(function() {
  40997. i.setFromEuler(t, !1)
  40998. }),
  40999. i.onChange(function() {
  41000. t.setFromQuaternion(i, void 0, !1)
  41001. }),
  41002. Object.defineProperties(this, {
  41003. position: {
  41004. enumerable: !0,
  41005. value: e
  41006. },
  41007. rotation: {
  41008. enumerable: !0,
  41009. value: t
  41010. },
  41011. quaternion: {
  41012. enumerable: !0,
  41013. value: i
  41014. },
  41015. scale: {
  41016. enumerable: !0,
  41017. value: n
  41018. },
  41019. modelViewMatrix: {
  41020. value: new Ci.Matrix4
  41021. },
  41022. normalMatrix: {
  41023. value: new Ci.Matrix3
  41024. }
  41025. }),
  41026. this.rotationAutoUpdate = !0,
  41027. this.matrix = new Ci.Matrix4,
  41028. this.matrixWorld = new Ci.Matrix4,
  41029. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41030. this.matrixWorldNeedsUpdate = !1,
  41031. this.layers = new Ci.Layers,
  41032. this.visible = !0,
  41033. this.castShadow = !1,
  41034. this.receiveShadow = !1,
  41035. this.frustumCulled = !0,
  41036. this.renderOrder = 0,
  41037. this.userData = {}
  41038. }
  41039. ,
  41040. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41041. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41042. Ci.Object3D.prototype = {
  41043. constructor: Ci.Object3D,
  41044. applyMatrix: function(e) {
  41045. this.matrix.multiplyMatrices(e, this.matrix),
  41046. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41047. },
  41048. setRotationFromAxisAngle: function(e, t) {
  41049. this.quaternion.setFromAxisAngle(e, t)
  41050. },
  41051. setRotationFromEuler: function(e) {
  41052. this.quaternion.setFromEuler(e, !0)
  41053. },
  41054. setRotationFromMatrix: function(e) {
  41055. this.quaternion.setFromRotationMatrix(e)
  41056. },
  41057. setRotationFromQuaternion: function(e) {
  41058. this.quaternion.copy(e)
  41059. },
  41060. rotateOnAxis: (y = new Ci.Quaternion,
  41061. function(e, t) {
  41062. return y.setFromAxisAngle(e, t),
  41063. this.quaternion.multiply(y),
  41064. this
  41065. }
  41066. ),
  41067. rotateX: (v = new Ci.Vector3(1,0,0),
  41068. function(e) {
  41069. return this.rotateOnAxis(v, e)
  41070. }
  41071. ),
  41072. rotateY: (m = new Ci.Vector3(0,1,0),
  41073. function(e) {
  41074. return this.rotateOnAxis(m, e)
  41075. }
  41076. ),
  41077. rotateZ: (g = new Ci.Vector3(0,0,1),
  41078. function(e) {
  41079. return this.rotateOnAxis(g, e)
  41080. }
  41081. ),
  41082. translateOnAxis: (f = new Ci.Vector3,
  41083. function(e, t) {
  41084. return f.copy(e).applyQuaternion(this.quaternion),
  41085. this.position.add(f.multiplyScalar(t)),
  41086. this
  41087. }
  41088. ),
  41089. translateX: (p = new Ci.Vector3(1,0,0),
  41090. function(e) {
  41091. return this.translateOnAxis(p, e)
  41092. }
  41093. ),
  41094. translateY: (d = new Ci.Vector3(0,1,0),
  41095. function(e) {
  41096. return this.translateOnAxis(d, e)
  41097. }
  41098. ),
  41099. translateZ: (u = new Ci.Vector3(0,0,1),
  41100. function(e) {
  41101. return this.translateOnAxis(u, e)
  41102. }
  41103. ),
  41104. localToWorld: function(e) {
  41105. return e.applyMatrix4(this.matrixWorld)
  41106. },
  41107. worldToLocal: (h = new Ci.Matrix4,
  41108. function(e) {
  41109. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41110. }
  41111. ),
  41112. lookAt: (c = new Ci.Matrix4,
  41113. function(e) {
  41114. c.lookAt(e, this.position, this.up),
  41115. this.quaternion.setFromRotationMatrix(c)
  41116. }
  41117. ),
  41118. add: function(e) {
  41119. if (1 < arguments.length) {
  41120. for (var t = 0; t < arguments.length; t++)
  41121. this.add(arguments[t]);
  41122. return this
  41123. }
  41124. 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),
  41125. e.parent = this,
  41126. e.dispatchEvent({
  41127. type: "added"
  41128. }),
  41129. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41130. this
  41131. },
  41132. remove: function(e) {
  41133. if (1 < arguments.length)
  41134. for (var t = 0; t < arguments.length; t++)
  41135. this.remove(arguments[t]);
  41136. var i = this.children.indexOf(e);
  41137. -1 !== i && (e.parent = null,
  41138. e.dispatchEvent({
  41139. type: "removed"
  41140. }),
  41141. this.children.splice(i, 1))
  41142. },
  41143. getObjectById: function(e) {
  41144. return this.getObjectByProperty("id", e)
  41145. },
  41146. getObjectByName: function(e) {
  41147. return this.getObjectByProperty("name", e)
  41148. },
  41149. getObjectByProperty: function(e, t) {
  41150. if (this[e] === t)
  41151. return this;
  41152. for (var i = 0, n = this.children.length; i < n; i++) {
  41153. var r = this.children[i].getObjectByProperty(e, t);
  41154. if (void 0 !== r)
  41155. return r
  41156. }
  41157. },
  41158. getWorldPosition: function(e) {
  41159. var t = e || new Ci.Vector3;
  41160. return this.updateMatrixWorld(!0),
  41161. t.setFromMatrixPosition(this.matrixWorld)
  41162. },
  41163. getWorldQuaternion: (s = new Ci.Vector3,
  41164. l = new Ci.Vector3,
  41165. function(e) {
  41166. var t = e || new Ci.Quaternion;
  41167. return this.updateMatrixWorld(!0),
  41168. this.matrixWorld.decompose(s, t, l),
  41169. t
  41170. }
  41171. ),
  41172. getWorldRotation: (a = new Ci.Quaternion,
  41173. function(e) {
  41174. var t = e || new Ci.Euler;
  41175. return this.getWorldQuaternion(a),
  41176. t.setFromQuaternion(a, this.rotation.order, !1)
  41177. }
  41178. ),
  41179. getWorldScale: (r = new Ci.Vector3,
  41180. o = new Ci.Quaternion,
  41181. function(e) {
  41182. var t = e || new Ci.Vector3;
  41183. return this.updateMatrixWorld(!0),
  41184. this.matrixWorld.decompose(r, o, t),
  41185. t
  41186. }
  41187. ),
  41188. getWorldDirection: (n = new Ci.Quaternion,
  41189. function(e) {
  41190. var t = e || new Ci.Vector3;
  41191. return this.getWorldQuaternion(n),
  41192. t.set(0, 0, 1).applyQuaternion(n)
  41193. }
  41194. ),
  41195. raycast: function() {},
  41196. traverse: function(e) {
  41197. e(this);
  41198. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41199. t[i].traverse(e)
  41200. },
  41201. traverseVisible: function(e) {
  41202. if (!1 !== this.visible) {
  41203. e(this);
  41204. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41205. t[i].traverseVisible(e)
  41206. }
  41207. },
  41208. traverseAncestors: function(e) {
  41209. var t = this.parent;
  41210. null !== t && (e(t),
  41211. t.traverseAncestors(e))
  41212. },
  41213. updateMatrix: function() {
  41214. this.matrix.compose(this.position, this.quaternion, this.scale),
  41215. this.matrixWorldNeedsUpdate = !0
  41216. },
  41217. updateMatrixWorld: function(e) {
  41218. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41219. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41220. e = !(this.matrixWorldNeedsUpdate = !1));
  41221. for (var t = 0, i = this.children.length; t < i; t++)
  41222. this.children[t].updateMatrixWorld(e)
  41223. },
  41224. toJSON: function(e) {
  41225. function t(e) {
  41226. var t = [];
  41227. for (var i in e) {
  41228. var n = e[i];
  41229. delete n.metadata,
  41230. t.push(n)
  41231. }
  41232. return t
  41233. }
  41234. var i = void 0 === e
  41235. , n = {};
  41236. i && (e = {
  41237. geometries: {},
  41238. materials: {},
  41239. textures: {},
  41240. images: {}
  41241. },
  41242. n.metadata = {
  41243. version: 4.4,
  41244. type: "Object",
  41245. generator: "Object3D.toJSON"
  41246. });
  41247. var r = {};
  41248. if (r.uuid = this.uuid,
  41249. r.type = this.type,
  41250. "" !== this.name && (r.name = this.name),
  41251. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41252. !0 === this.castShadow && (r.castShadow = !0),
  41253. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41254. !1 === this.visible && (r.visible = !1),
  41255. r.matrix = this.matrix.toArray(),
  41256. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41257. r.geometry = this.geometry.uuid),
  41258. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41259. r.material = this.material.uuid),
  41260. 0 < this.children.length) {
  41261. r.children = [];
  41262. for (var o = 0; o < this.children.length; o++)
  41263. r.children.push(this.children[o].toJSON(e).object)
  41264. }
  41265. if (i) {
  41266. var a = t(e.geometries)
  41267. , s = t(e.materials)
  41268. , l = t(e.textures)
  41269. , c = t(e.images);
  41270. 0 < a.length && (n.geometries = a),
  41271. 0 < s.length && (n.materials = s),
  41272. 0 < l.length && (n.textures = l),
  41273. 0 < c.length && (n.images = c)
  41274. }
  41275. return n.object = r,
  41276. n
  41277. },
  41278. clone: function(e) {
  41279. return (new this.constructor).copy(this, e)
  41280. },
  41281. copy: function(e, t) {
  41282. if (void 0 === t && (t = !0),
  41283. this.name = e.name,
  41284. this.up.copy(e.up),
  41285. this.position.copy(e.position),
  41286. this.quaternion.copy(e.quaternion),
  41287. this.scale.copy(e.scale),
  41288. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41289. this.matrix.copy(e.matrix),
  41290. this.matrixWorld.copy(e.matrixWorld),
  41291. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41292. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41293. this.visible = e.visible,
  41294. this.castShadow = e.castShadow,
  41295. this.receiveShadow = e.receiveShadow,
  41296. this.frustumCulled = e.frustumCulled,
  41297. this.renderOrder = e.renderOrder,
  41298. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41299. !0 === t)
  41300. for (var i = 0; i < e.children.length; i++) {
  41301. var n = e.children[i];
  41302. this.add(n.clone())
  41303. }
  41304. return this
  41305. }
  41306. },
  41307. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41308. Ci.Object3DIdCount = 0,
  41309. Ci.Face3 = function(e, t, i, n, r, o) {
  41310. this.a = e,
  41311. this.b = t,
  41312. this.c = i,
  41313. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41314. this.vertexNormals = Array.isArray(n) ? n : [],
  41315. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41316. this.vertexColors = Array.isArray(r) ? r : [],
  41317. this.materialIndex = void 0 !== o ? o : 0
  41318. }
  41319. ,
  41320. Ci.Face3.prototype = {
  41321. constructor: Ci.Face3,
  41322. clone: function() {
  41323. return (new this.constructor).copy(this)
  41324. },
  41325. copy: function(e) {
  41326. this.a = e.a,
  41327. this.b = e.b,
  41328. this.c = e.c,
  41329. this.normal.copy(e.normal),
  41330. this.color.copy(e.color),
  41331. this.materialIndex = e.materialIndex;
  41332. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41333. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41334. for (t = 0,
  41335. i = e.vertexColors.length; t < i; t++)
  41336. this.vertexColors[t] = e.vertexColors[t].clone();
  41337. return this
  41338. }
  41339. },
  41340. Ci.BufferAttribute = function(e, t) {
  41341. this.uuid = Ci.Math.generateUUID(),
  41342. this.array = e,
  41343. this.itemSize = t,
  41344. this.dynamic = !1,
  41345. this.updateRange = {
  41346. offset: 0,
  41347. count: -1
  41348. },
  41349. this.version = 0
  41350. }
  41351. ,
  41352. Ci.BufferAttribute.prototype = {
  41353. constructor: Ci.BufferAttribute,
  41354. get count() {
  41355. return this.array.length / this.itemSize
  41356. },
  41357. set needsUpdate(e) {
  41358. !0 === e && this.version++
  41359. },
  41360. setDynamic: function(e) {
  41361. return this.dynamic = e,
  41362. this
  41363. },
  41364. copy: function(e) {
  41365. return this.array = new e.array.constructor(e.array),
  41366. this.itemSize = e.itemSize,
  41367. this.dynamic = e.dynamic,
  41368. this
  41369. },
  41370. copyAt: function(e, t, i) {
  41371. e *= this.itemSize,
  41372. i *= t.itemSize;
  41373. for (var n = 0, r = this.itemSize; n < r; n++)
  41374. this.array[e + n] = t.array[i + n];
  41375. return this
  41376. },
  41377. copyArray: function(e) {
  41378. return this.array.set(e),
  41379. this
  41380. },
  41381. copyColorsArray: function(e) {
  41382. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41383. var o = e[n];
  41384. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41385. o = new Ci.Color),
  41386. t[i++] = o.r,
  41387. t[i++] = o.g,
  41388. t[i++] = o.b
  41389. }
  41390. return this
  41391. },
  41392. copyIndicesArray: function(e) {
  41393. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41394. var o = e[n];
  41395. t[i++] = o.a,
  41396. t[i++] = o.b,
  41397. t[i++] = o.c
  41398. }
  41399. return this
  41400. },
  41401. copyVector2sArray: function(e) {
  41402. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41403. var o = e[n];
  41404. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41405. o = new Ci.Vector2),
  41406. t[i++] = o.x,
  41407. t[i++] = o.y
  41408. }
  41409. return this
  41410. },
  41411. copyVector3sArray: function(e) {
  41412. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41413. var o = e[n];
  41414. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41415. o = new Ci.Vector3),
  41416. t[i++] = o.x,
  41417. t[i++] = o.y,
  41418. t[i++] = o.z
  41419. }
  41420. return this
  41421. },
  41422. copyVector4sArray: function(e) {
  41423. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41424. var o = e[n];
  41425. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41426. o = new Ci.Vector4),
  41427. t[i++] = o.x,
  41428. t[i++] = o.y,
  41429. t[i++] = o.z,
  41430. t[i++] = o.w
  41431. }
  41432. return this
  41433. },
  41434. set: function(e, t) {
  41435. return void 0 === t && (t = 0),
  41436. this.array.set(e, t),
  41437. this
  41438. },
  41439. getX: function(e) {
  41440. return this.array[e * this.itemSize]
  41441. },
  41442. setX: function(e, t) {
  41443. return this.array[e * this.itemSize] = t,
  41444. this
  41445. },
  41446. getY: function(e) {
  41447. return this.array[e * this.itemSize + 1]
  41448. },
  41449. setY: function(e, t) {
  41450. return this.array[e * this.itemSize + 1] = t,
  41451. this
  41452. },
  41453. getZ: function(e) {
  41454. return this.array[e * this.itemSize + 2]
  41455. },
  41456. setZ: function(e, t) {
  41457. return this.array[e * this.itemSize + 2] = t,
  41458. this
  41459. },
  41460. getW: function(e) {
  41461. return this.array[e * this.itemSize + 3]
  41462. },
  41463. setW: function(e, t) {
  41464. return this.array[e * this.itemSize + 3] = t,
  41465. this
  41466. },
  41467. setXY: function(e, t, i) {
  41468. return e *= this.itemSize,
  41469. this.array[e + 0] = t,
  41470. this.array[e + 1] = i,
  41471. this
  41472. },
  41473. setXYZ: function(e, t, i, n) {
  41474. return e *= this.itemSize,
  41475. this.array[e + 0] = t,
  41476. this.array[e + 1] = i,
  41477. this.array[e + 2] = n,
  41478. this
  41479. },
  41480. setXYZW: function(e, t, i, n, r) {
  41481. return e *= this.itemSize,
  41482. this.array[e + 0] = t,
  41483. this.array[e + 1] = i,
  41484. this.array[e + 2] = n,
  41485. this.array[e + 3] = r,
  41486. this
  41487. },
  41488. clone: function() {
  41489. return (new this.constructor).copy(this)
  41490. }
  41491. },
  41492. Ci.Int8Attribute = function(e, t) {
  41493. return new Ci.BufferAttribute(new Int8Array(e),t)
  41494. }
  41495. ,
  41496. Ci.Uint8Attribute = function(e, t) {
  41497. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41498. }
  41499. ,
  41500. Ci.Uint8ClampedAttribute = function(e, t) {
  41501. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41502. }
  41503. ,
  41504. Ci.Int16Attribute = function(e, t) {
  41505. return new Ci.BufferAttribute(new Int16Array(e),t)
  41506. }
  41507. ,
  41508. Ci.Uint16Attribute = function(e, t) {
  41509. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41510. }
  41511. ,
  41512. Ci.Int32Attribute = function(e, t) {
  41513. return new Ci.BufferAttribute(new Int32Array(e),t)
  41514. }
  41515. ,
  41516. Ci.Uint32Attribute = function(e, t) {
  41517. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41518. }
  41519. ,
  41520. Ci.Float32Attribute = function(e, t) {
  41521. return new Ci.BufferAttribute(new Float32Array(e),t)
  41522. }
  41523. ,
  41524. Ci.Float64Attribute = function(e, t) {
  41525. return new Ci.BufferAttribute(new Float64Array(e),t)
  41526. }
  41527. ,
  41528. Ci.DynamicBufferAttribute = function(e, t) {
  41529. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41530. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41531. }
  41532. ,
  41533. Ci.InstancedBufferAttribute = function(e, t, i) {
  41534. Ci.BufferAttribute.call(this, e, t),
  41535. this.meshPerAttribute = i || 1
  41536. }
  41537. ,
  41538. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41539. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41540. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41541. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41542. this.meshPerAttribute = e.meshPerAttribute,
  41543. this
  41544. }
  41545. ,
  41546. Ci.InterleavedBuffer = function(e, t) {
  41547. this.uuid = Ci.Math.generateUUID(),
  41548. this.array = e,
  41549. this.stride = t,
  41550. this.dynamic = !1,
  41551. this.updateRange = {
  41552. offset: 0,
  41553. count: -1
  41554. },
  41555. this.version = 0
  41556. }
  41557. ,
  41558. Ci.InterleavedBuffer.prototype = {
  41559. constructor: Ci.InterleavedBuffer,
  41560. get length() {
  41561. return this.array.length
  41562. },
  41563. get count() {
  41564. return this.array.length / this.stride
  41565. },
  41566. set needsUpdate(e) {
  41567. !0 === e && this.version++
  41568. },
  41569. setDynamic: function(e) {
  41570. return this.dynamic = e,
  41571. this
  41572. },
  41573. copy: function(e) {
  41574. return this.array = new e.array.constructor(e.array),
  41575. this.stride = e.stride,
  41576. this.dynamic = e.dynamic,
  41577. this
  41578. },
  41579. copyAt: function(e, t, i) {
  41580. e *= this.stride,
  41581. i *= t.stride;
  41582. for (var n = 0, r = this.stride; n < r; n++)
  41583. this.array[e + n] = t.array[i + n];
  41584. return this
  41585. },
  41586. set: function(e, t) {
  41587. return void 0 === t && (t = 0),
  41588. this.array.set(e, t),
  41589. this
  41590. },
  41591. clone: function() {
  41592. return (new this.constructor).copy(this)
  41593. }
  41594. },
  41595. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41596. Ci.InterleavedBuffer.call(this, e, t),
  41597. this.meshPerAttribute = i || 1
  41598. }
  41599. ,
  41600. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41601. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41602. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41603. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41604. this.meshPerAttribute = e.meshPerAttribute,
  41605. this
  41606. }
  41607. ,
  41608. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41609. this.uuid = Ci.Math.generateUUID(),
  41610. this.data = e,
  41611. this.itemSize = t,
  41612. this.offset = i
  41613. }
  41614. ,
  41615. Ci.InterleavedBufferAttribute.prototype = {
  41616. constructor: Ci.InterleavedBufferAttribute,
  41617. get length() {
  41618. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41619. this.array.length
  41620. },
  41621. get count() {
  41622. return this.data.count
  41623. },
  41624. setX: function(e, t) {
  41625. return this.data.array[e * this.data.stride + this.offset] = t,
  41626. this
  41627. },
  41628. setY: function(e, t) {
  41629. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41630. this
  41631. },
  41632. setZ: function(e, t) {
  41633. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41634. this
  41635. },
  41636. setW: function(e, t) {
  41637. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41638. this
  41639. },
  41640. getX: function(e) {
  41641. return this.data.array[e * this.data.stride + this.offset]
  41642. },
  41643. getY: function(e) {
  41644. return this.data.array[e * this.data.stride + this.offset + 1]
  41645. },
  41646. getZ: function(e) {
  41647. return this.data.array[e * this.data.stride + this.offset + 2]
  41648. },
  41649. getW: function(e) {
  41650. return this.data.array[e * this.data.stride + this.offset + 3]
  41651. },
  41652. setXY: function(e, t, i) {
  41653. return e = e * this.data.stride + this.offset,
  41654. this.data.array[e + 0] = t,
  41655. this.data.array[e + 1] = i,
  41656. this
  41657. },
  41658. setXYZ: function(e, t, i, n) {
  41659. return e = e * this.data.stride + this.offset,
  41660. this.data.array[e + 0] = t,
  41661. this.data.array[e + 1] = i,
  41662. this.data.array[e + 2] = n,
  41663. this
  41664. },
  41665. setXYZW: function(e, t, i, n, r) {
  41666. return e = e * this.data.stride + this.offset,
  41667. this.data.array[e + 0] = t,
  41668. this.data.array[e + 1] = i,
  41669. this.data.array[e + 2] = n,
  41670. this.data.array[e + 3] = r,
  41671. this
  41672. }
  41673. },
  41674. Ci.Geometry = function() {
  41675. Object.defineProperty(this, "id", {
  41676. value: Ci.GeometryIdCount++
  41677. }),
  41678. this.uuid = Ci.Math.generateUUID(),
  41679. this.name = "",
  41680. this.type = "Geometry",
  41681. this.vertices = [],
  41682. this.colors = [],
  41683. this.faces = [],
  41684. this.faceVertexUvs = [[]],
  41685. this.morphTargets = [],
  41686. this.morphNormals = [],
  41687. this.skinWeights = [],
  41688. this.skinIndices = [],
  41689. this.lineDistances = [],
  41690. this.boundingBox = null,
  41691. this.boundingSphere = null,
  41692. this.verticesNeedUpdate = !1,
  41693. this.elementsNeedUpdate = !1,
  41694. this.uvsNeedUpdate = !1,
  41695. this.normalsNeedUpdate = !1,
  41696. this.colorsNeedUpdate = !1,
  41697. this.lineDistancesNeedUpdate = !1,
  41698. this.groupsNeedUpdate = !1
  41699. }
  41700. ,
  41701. Ci.Geometry.prototype = {
  41702. constructor: Ci.Geometry,
  41703. applyMatrix: function(e) {
  41704. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41705. this.vertices[i].applyMatrix4(e)
  41706. }
  41707. for (i = 0,
  41708. n = this.faces.length; i < n; i++) {
  41709. var r = this.faces[i];
  41710. r.normal.applyMatrix3(t).normalize();
  41711. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41712. r.vertexNormals[o].applyMatrix3(t).normalize()
  41713. }
  41714. return null !== this.boundingBox && this.computeBoundingBox(),
  41715. null !== this.boundingSphere && this.computeBoundingSphere(),
  41716. this.verticesNeedUpdate = !0,
  41717. this.normalsNeedUpdate = !0,
  41718. this
  41719. },
  41720. rotateX: function(e) {
  41721. return void 0 === mt && (mt = new Ci.Matrix4),
  41722. mt.makeRotationX(e),
  41723. this.applyMatrix(mt),
  41724. this
  41725. },
  41726. rotateY: function(e) {
  41727. return void 0 === gt && (gt = new Ci.Matrix4),
  41728. gt.makeRotationY(e),
  41729. this.applyMatrix(gt),
  41730. this
  41731. },
  41732. rotateZ: function(e) {
  41733. return void 0 === ft && (ft = new Ci.Matrix4),
  41734. ft.makeRotationZ(e),
  41735. this.applyMatrix(ft),
  41736. this
  41737. },
  41738. translate: function(e, t, i) {
  41739. return void 0 === pt && (pt = new Ci.Matrix4),
  41740. pt.makeTranslation(e, t, i),
  41741. this.applyMatrix(pt),
  41742. this
  41743. },
  41744. scale: function(e, t, i) {
  41745. return void 0 === dt && (dt = new Ci.Matrix4),
  41746. dt.makeScale(e, t, i),
  41747. this.applyMatrix(dt),
  41748. this
  41749. },
  41750. lookAt: function(e) {
  41751. void 0 === ut && (ut = new Ci.Object3D),
  41752. ut.lookAt(e),
  41753. ut.updateMatrix(),
  41754. this.applyMatrix(ut.matrix)
  41755. },
  41756. fromBufferGeometry: function(e) {
  41757. function t(e, t, i, n) {
  41758. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41759. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41760. , a = new Ci.Face3(e,t,i,r,o,n);
  41761. s.faces.push(a),
  41762. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41763. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41764. }
  41765. var s = this
  41766. , i = null !== e.index ? e.index.array : void 0
  41767. , n = e.attributes
  41768. , r = n.position.array
  41769. , l = void 0 !== n.normal ? n.normal.array : void 0
  41770. , c = void 0 !== n.color ? n.color.array : void 0
  41771. , h = void 0 !== n.uv ? n.uv.array : void 0
  41772. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41773. void 0 !== u && (this.faceVertexUvs[1] = []);
  41774. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41775. a += 2)
  41776. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41777. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41778. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41779. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41780. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41781. if (void 0 !== i) {
  41782. var g = e.groups;
  41783. if (0 < g.length)
  41784. for (o = 0; o < g.length; o++)
  41785. for (var m = g[o], v = m.start, y = (a = v,
  41786. v + m.count); a < y; a += 3)
  41787. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41788. else
  41789. for (o = 0; o < i.length; o += 3)
  41790. t(i[o], i[o + 1], i[o + 2])
  41791. } else
  41792. for (o = 0; o < r.length / 3; o += 3)
  41793. t(o, o + 1, o + 2);
  41794. return this.computeFaceNormals(),
  41795. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41796. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41797. this
  41798. },
  41799. center: function() {
  41800. this.computeBoundingBox();
  41801. var e = this.boundingBox.center().negate();
  41802. return this.translate(e.x, e.y, e.z),
  41803. e
  41804. },
  41805. normalize: function() {
  41806. this.computeBoundingSphere();
  41807. var e = this.boundingSphere.center
  41808. , t = this.boundingSphere.radius
  41809. , i = 0 === t ? 1 : 1 / t
  41810. , n = new Ci.Matrix4;
  41811. 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),
  41812. this.applyMatrix(n),
  41813. this
  41814. },
  41815. computeFaceNormals: function() {
  41816. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41817. var r = this.faces[i]
  41818. , o = this.vertices[r.a]
  41819. , a = this.vertices[r.b]
  41820. , s = this.vertices[r.c];
  41821. e.subVectors(s, a),
  41822. t.subVectors(o, a),
  41823. e.cross(t),
  41824. e.normalize(),
  41825. r.normal.copy(e)
  41826. }
  41827. },
  41828. computeVertexNormals: function(e) {
  41829. var t, i, n, r, o, a;
  41830. for (void 0 === e && (e = !0),
  41831. a = new Array(this.vertices.length),
  41832. t = 0,
  41833. i = this.vertices.length; t < i; t++)
  41834. a[t] = new Ci.Vector3;
  41835. if (e) {
  41836. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41837. for (n = 0,
  41838. r = this.faces.length; n < r; n++)
  41839. o = this.faces[n],
  41840. s = this.vertices[o.a],
  41841. l = this.vertices[o.b],
  41842. c = this.vertices[o.c],
  41843. h.subVectors(c, l),
  41844. u.subVectors(s, l),
  41845. h.cross(u),
  41846. a[o.a].add(h),
  41847. a[o.b].add(h),
  41848. a[o.c].add(h)
  41849. } else
  41850. for (n = 0,
  41851. r = this.faces.length; n < r; n++)
  41852. a[(o = this.faces[n]).a].add(o.normal),
  41853. a[o.b].add(o.normal),
  41854. a[o.c].add(o.normal);
  41855. for (t = 0,
  41856. i = this.vertices.length; t < i; t++)
  41857. a[t].normalize();
  41858. for (n = 0,
  41859. r = this.faces.length; n < r; n++) {
  41860. var d = (o = this.faces[n]).vertexNormals;
  41861. 3 === d.length ? (d[0].copy(a[o.a]),
  41862. d[1].copy(a[o.b]),
  41863. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41864. d[1] = a[o.b].clone(),
  41865. d[2] = a[o.c].clone())
  41866. }
  41867. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41868. },
  41869. computeMorphNormals: function() {
  41870. var e, t, i, n, r;
  41871. for (i = 0,
  41872. n = this.faces.length; i < n; i++)
  41873. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41874. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41875. e = 0,
  41876. t = r.vertexNormals.length; e < t; e++)
  41877. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41878. var o = new Ci.Geometry;
  41879. for (o.faces = this.faces,
  41880. e = 0,
  41881. t = this.morphTargets.length; e < t; e++) {
  41882. if (!this.morphNormals[e]) {
  41883. this.morphNormals[e] = {},
  41884. this.morphNormals[e].faceNormals = [],
  41885. this.morphNormals[e].vertexNormals = [];
  41886. var a = this.morphNormals[e].faceNormals
  41887. , s = this.morphNormals[e].vertexNormals;
  41888. for (i = 0,
  41889. n = this.faces.length; i < n; i++)
  41890. l = new Ci.Vector3,
  41891. c = {
  41892. a: new Ci.Vector3,
  41893. b: new Ci.Vector3,
  41894. c: new Ci.Vector3
  41895. },
  41896. a.push(l),
  41897. s.push(c)
  41898. }
  41899. var l, c, h = this.morphNormals[e];
  41900. for (o.vertices = this.morphTargets[e].vertices,
  41901. o.computeFaceNormals(),
  41902. o.computeVertexNormals(),
  41903. i = 0,
  41904. n = this.faces.length; i < n; i++)
  41905. r = this.faces[i],
  41906. l = h.faceNormals[i],
  41907. c = h.vertexNormals[i],
  41908. l.copy(r.normal),
  41909. c.a.copy(r.vertexNormals[0]),
  41910. c.b.copy(r.vertexNormals[1]),
  41911. c.c.copy(r.vertexNormals[2])
  41912. }
  41913. for (i = 0,
  41914. n = this.faces.length; i < n; i++)
  41915. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41916. r.vertexNormals = r.__originalVertexNormals
  41917. },
  41918. computeTangents: function() {
  41919. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41920. },
  41921. computeLineDistances: function() {
  41922. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41923. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41924. this.lineDistances[i] = e
  41925. },
  41926. computeBoundingBox: function() {
  41927. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41928. this.boundingBox.setFromPoints(this.vertices)
  41929. },
  41930. computeBoundingSphere: function() {
  41931. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41932. this.boundingSphere.setFromPoints(this.vertices)
  41933. },
  41934. merge: function(e, t, i) {
  41935. if (e instanceof Ci.Geometry != 0) {
  41936. 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];
  41937. void 0 === i && (i = 0),
  41938. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41939. for (var u = 0, d = a.length; u < d; u++) {
  41940. var p = a[u].clone();
  41941. void 0 !== t && p.applyMatrix4(t),
  41942. o.push(p)
  41943. }
  41944. for (u = 0,
  41945. d = l.length; u < d; u++) {
  41946. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41947. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41948. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41949. for (var C = 0, I = y.length; C < I; C++)
  41950. g = y[C].clone(),
  41951. void 0 !== n && g.applyMatrix3(n).normalize(),
  41952. f.vertexNormals.push(g);
  41953. f.color.copy(v.color);
  41954. for (C = 0,
  41955. I = A.length; C < I; C++)
  41956. m = A[C],
  41957. f.vertexColors.push(m.clone());
  41958. f.materialIndex = v.materialIndex + i,
  41959. s.push(f)
  41960. }
  41961. for (u = 0,
  41962. d = h.length; u < d; u++) {
  41963. var E = h[u]
  41964. , _ = [];
  41965. if (void 0 !== E) {
  41966. for (C = 0,
  41967. I = E.length; C < I; C++)
  41968. _.push(E[C].clone());
  41969. c.push(_)
  41970. }
  41971. }
  41972. } else
  41973. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41974. },
  41975. mergeMesh: function(e) {
  41976. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41977. void this.merge(e.geometry, e.matrix))
  41978. },
  41979. mergeVertices: function() {
  41980. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41981. for (i = 0,
  41982. n = this.vertices.length; i < n; i++)
  41983. e = this.vertices[i],
  41984. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41985. c.push(this.vertices[i]),
  41986. h[i] = c.length - 1) : h[i] = h[l[t]];
  41987. var d = [];
  41988. for (i = 0,
  41989. n = this.faces.length; i < n; i++) {
  41990. (r = this.faces[i]).a = h[r.a],
  41991. r.b = h[r.b],
  41992. r.c = h[r.c],
  41993. o = [r.a, r.b, r.c];
  41994. for (var p = 0; p < 3; p++)
  41995. if (o[p] === o[(p + 1) % 3]) {
  41996. p,
  41997. d.push(i);
  41998. break
  41999. }
  42000. }
  42001. for (i = d.length - 1; 0 <= i; i--) {
  42002. var f = d[i];
  42003. for (this.faces.splice(f, 1),
  42004. a = 0,
  42005. s = this.faceVertexUvs.length; a < s; a++)
  42006. this.faceVertexUvs[a].splice(f, 1)
  42007. }
  42008. var g = this.vertices.length - c.length;
  42009. return this.vertices = c,
  42010. g
  42011. },
  42012. sortFacesByMaterialIndex: function() {
  42013. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42014. e[i]._id = i;
  42015. e.sort(function(e, t) {
  42016. return e.materialIndex - t.materialIndex
  42017. });
  42018. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42019. o && o.length === t && (n = []),
  42020. a && a.length === t && (r = []);
  42021. for (i = 0; i < t; i++) {
  42022. var s = e[i]._id;
  42023. n && n.push(o[s]),
  42024. r && r.push(a[s])
  42025. }
  42026. n && (this.faceVertexUvs[0] = n),
  42027. r && (this.faceVertexUvs[1] = r)
  42028. },
  42029. toJSON: function() {
  42030. function e(e, t, i) {
  42031. return i ? e | 1 << t : e & ~(1 << t)
  42032. }
  42033. function t(e) {
  42034. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42035. return void 0 !== d[t] || (d[t] = u.length / 3,
  42036. u.push(e.x, e.y, e.z)),
  42037. d[t]
  42038. }
  42039. function i(e) {
  42040. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42041. return void 0 !== f[t] || (f[t] = p.length,
  42042. p.push(e.getHex())),
  42043. f[t]
  42044. }
  42045. function n(e) {
  42046. var t = e.x.toString() + e.y.toString();
  42047. return void 0 !== m[t] || (m[t] = g.length / 2,
  42048. g.push(e.x, e.y)),
  42049. m[t]
  42050. }
  42051. var r = {
  42052. metadata: {
  42053. version: 4.4,
  42054. type: "Geometry",
  42055. generator: "Geometry.toJSON"
  42056. }
  42057. };
  42058. if (r.uuid = this.uuid,
  42059. r.type = this.type,
  42060. "" !== this.name && (r.name = this.name),
  42061. void 0 !== this.parameters) {
  42062. var o = this.parameters;
  42063. for (var a in o)
  42064. void 0 !== o[a] && (r[a] = o[a]);
  42065. return r
  42066. }
  42067. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42068. var c = this.vertices[l];
  42069. s.push(c.x, c.y, c.z)
  42070. }
  42071. var h = []
  42072. , u = []
  42073. , d = {}
  42074. , p = []
  42075. , f = {}
  42076. , g = []
  42077. , m = {};
  42078. for (l = 0; l < this.faces.length; l++) {
  42079. var v = this.faces[l]
  42080. , y = void 0 !== this.faceVertexUvs[0][l]
  42081. , A = 0 < v.normal.length()
  42082. , C = 0 < v.vertexNormals.length
  42083. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42084. , E = 0 < v.vertexColors.length
  42085. , _ = 0;
  42086. 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),
  42087. h.push(_),
  42088. h.push(v.a, v.b, v.c),
  42089. h.push(v.materialIndex),
  42090. y) {
  42091. var b = this.faceVertexUvs[0][l];
  42092. h.push(n(b[0]), n(b[1]), n(b[2]))
  42093. }
  42094. if (A && h.push(t(v.normal)),
  42095. C) {
  42096. var w = v.vertexNormals;
  42097. h.push(t(w[0]), t(w[1]), t(w[2]))
  42098. }
  42099. if (I && h.push(i(v.color)),
  42100. E) {
  42101. var T = v.vertexColors;
  42102. h.push(i(T[0]), i(T[1]), i(T[2]))
  42103. }
  42104. }
  42105. return r.data = {},
  42106. r.data.vertices = s,
  42107. r.data.normals = u,
  42108. 0 < p.length && (r.data.colors = p),
  42109. 0 < g.length && (r.data.uvs = [g]),
  42110. r.data.faces = h,
  42111. r
  42112. },
  42113. clone: function() {
  42114. return (new Ci.Geometry).copy(this)
  42115. },
  42116. copy: function(e) {
  42117. this.vertices = [],
  42118. this.faces = [],
  42119. this.faceVertexUvs = [[]];
  42120. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42121. this.vertices.push(t[i].clone());
  42122. var r = e.faces;
  42123. for (i = 0,
  42124. n = r.length; i < n; i++)
  42125. this.faces.push(r[i].clone());
  42126. for (i = 0,
  42127. n = e.faceVertexUvs.length; i < n; i++) {
  42128. var o = e.faceVertexUvs[i];
  42129. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42130. for (var a = 0, s = o.length; a < s; a++) {
  42131. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42132. var d = l[h];
  42133. c.push(d.clone())
  42134. }
  42135. this.faceVertexUvs[i].push(c)
  42136. }
  42137. }
  42138. return this
  42139. },
  42140. dispose: function() {
  42141. this.dispatchEvent({
  42142. type: "dispose"
  42143. })
  42144. }
  42145. },
  42146. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42147. Ci.GeometryIdCount = 0,
  42148. Ci.DirectGeometry = function() {
  42149. Object.defineProperty(this, "id", {
  42150. value: Ci.GeometryIdCount++
  42151. }),
  42152. this.uuid = Ci.Math.generateUUID(),
  42153. this.name = "",
  42154. this.type = "DirectGeometry",
  42155. this.indices = [],
  42156. this.vertices = [],
  42157. this.normals = [],
  42158. this.colors = [],
  42159. this.uvs = [],
  42160. this.uvs2 = [],
  42161. this.groups = [],
  42162. this.morphTargets = {},
  42163. this.skinWeights = [],
  42164. this.skinIndices = [],
  42165. this.boundingBox = null,
  42166. this.boundingSphere = null,
  42167. this.verticesNeedUpdate = !1,
  42168. this.normalsNeedUpdate = !1,
  42169. this.colorsNeedUpdate = !1,
  42170. this.uvsNeedUpdate = !1,
  42171. this.groupsNeedUpdate = !1
  42172. }
  42173. ,
  42174. Ci.DirectGeometry.prototype = {
  42175. constructor: Ci.DirectGeometry,
  42176. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42177. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42178. computeFaceNormals: function() {
  42179. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42180. },
  42181. computeVertexNormals: function() {
  42182. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42183. },
  42184. computeGroups: function(e) {
  42185. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42186. var a = r[o];
  42187. a.materialIndex !== i && (i = a.materialIndex,
  42188. void 0 !== t && (t.count = 3 * o - t.start,
  42189. n.push(t)),
  42190. t = {
  42191. start: 3 * o,
  42192. materialIndex: i
  42193. })
  42194. }
  42195. void 0 !== t && (t.count = 3 * o - t.start,
  42196. n.push(t)),
  42197. this.groups = n
  42198. },
  42199. fromGeometry: function(e) {
  42200. 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;
  42201. if (0 < l) {
  42202. t = [];
  42203. for (var c = 0; c < l; c++)
  42204. t[c] = [];
  42205. this.morphTargets.position = t
  42206. }
  42207. var h, u = e.morphNormals, d = u.length;
  42208. if (0 < d) {
  42209. h = [];
  42210. for (c = 0; c < d; c++)
  42211. h[c] = [];
  42212. this.morphTargets.normal = h
  42213. }
  42214. var p = e.skinIndices
  42215. , f = e.skinWeights
  42216. , g = p.length === n.length
  42217. , m = f.length === n.length;
  42218. for (c = 0; c < i.length; c++) {
  42219. var v = i[c];
  42220. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42221. var y = v.vertexNormals;
  42222. if (3 === y.length)
  42223. this.normals.push(y[0], y[1], y[2]);
  42224. else {
  42225. var A = v.normal;
  42226. this.normals.push(A, A, A)
  42227. }
  42228. var C, I = v.vertexColors;
  42229. if (3 === I.length)
  42230. this.colors.push(I[0], I[1], I[2]);
  42231. else {
  42232. var E = v.color;
  42233. this.colors.push(E, E, E)
  42234. }
  42235. if (!0 === o)
  42236. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42237. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42238. if (!0 === a)
  42239. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42240. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42241. for (var _ = 0; _ < l; _++) {
  42242. var b = s[_].vertices;
  42243. t[_].push(b[v.a], b[v.b], b[v.c])
  42244. }
  42245. for (_ = 0; _ < d; _++) {
  42246. var w = u[_].vertexNormals[c];
  42247. h[_].push(w.a, w.b, w.c)
  42248. }
  42249. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42250. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42251. }
  42252. return this.computeGroups(e),
  42253. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42254. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42255. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42256. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42257. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42258. this
  42259. },
  42260. dispose: function() {
  42261. this.dispatchEvent({
  42262. type: "dispose"
  42263. })
  42264. }
  42265. },
  42266. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42267. Ci.BufferGeometry = function() {
  42268. Object.defineProperty(this, "id", {
  42269. value: Ci.GeometryIdCount++
  42270. }),
  42271. this.uuid = Ci.Math.generateUUID(),
  42272. this.name = "",
  42273. this.type = "BufferGeometry",
  42274. this.index = null,
  42275. this.attributes = {},
  42276. this.morphAttributes = {},
  42277. this.groups = [],
  42278. this.boundingBox = null,
  42279. this.boundingSphere = null,
  42280. this.drawRange = {
  42281. start: 0,
  42282. count: 1 / 0
  42283. }
  42284. }
  42285. ,
  42286. Ci.BufferGeometry.prototype = {
  42287. constructor: Ci.BufferGeometry,
  42288. getIndex: function() {
  42289. return this.index
  42290. },
  42291. setIndex: function(e) {
  42292. this.index = e
  42293. },
  42294. addAttribute: function(e, t) {
  42295. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42296. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42297. void this.setIndex(t)) : (this.attributes[e] = t,
  42298. this)
  42299. },
  42300. getAttribute: function(e) {
  42301. return this.attributes[e]
  42302. },
  42303. removeAttribute: function(e) {
  42304. return delete this.attributes[e],
  42305. this
  42306. },
  42307. addGroup: function(e, t, i) {
  42308. this.groups.push({
  42309. start: e,
  42310. count: t,
  42311. materialIndex: void 0 !== i ? i : 0
  42312. })
  42313. },
  42314. clearGroups: function() {
  42315. this.groups = []
  42316. },
  42317. setDrawRange: function(e, t) {
  42318. this.drawRange.start = e,
  42319. this.drawRange.count = t
  42320. },
  42321. applyMatrix: function(e) {
  42322. var t = this.attributes.position;
  42323. void 0 !== t && (e.applyToVector3Array(t.array),
  42324. t.needsUpdate = !0);
  42325. var i = this.attributes.normal;
  42326. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42327. i.needsUpdate = !0);
  42328. return null !== this.boundingBox && this.computeBoundingBox(),
  42329. null !== this.boundingSphere && this.computeBoundingSphere(),
  42330. this
  42331. },
  42332. rotateX: function(e) {
  42333. return void 0 === ht && (ht = new Ci.Matrix4),
  42334. ht.makeRotationX(e),
  42335. this.applyMatrix(ht),
  42336. this
  42337. },
  42338. rotateY: function(e) {
  42339. return void 0 === ct && (ct = new Ci.Matrix4),
  42340. ct.makeRotationY(e),
  42341. this.applyMatrix(ct),
  42342. this
  42343. },
  42344. rotateZ: function(e) {
  42345. return void 0 === lt && (lt = new Ci.Matrix4),
  42346. lt.makeRotationZ(e),
  42347. this.applyMatrix(lt),
  42348. this
  42349. },
  42350. translate: function(e, t, i) {
  42351. return void 0 === st && (st = new Ci.Matrix4),
  42352. st.makeTranslation(e, t, i),
  42353. this.applyMatrix(st),
  42354. this
  42355. },
  42356. scale: function(e, t, i) {
  42357. return void 0 === at && (at = new Ci.Matrix4),
  42358. at.makeScale(e, t, i),
  42359. this.applyMatrix(at),
  42360. this
  42361. },
  42362. lookAt: function(e) {
  42363. void 0 === ot && (ot = new Ci.Object3D),
  42364. ot.lookAt(e),
  42365. ot.updateMatrix(),
  42366. this.applyMatrix(ot.matrix)
  42367. },
  42368. center: function() {
  42369. this.computeBoundingBox();
  42370. var e = this.boundingBox.center().negate();
  42371. return this.translate(e.x, e.y, e.z),
  42372. e
  42373. },
  42374. setFromObject: function(e) {
  42375. var t = e.geometry;
  42376. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42377. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42378. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42379. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42380. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42381. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42382. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42383. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42384. }
  42385. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42386. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42387. } else
  42388. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42389. return this
  42390. },
  42391. updateFromObject: function(e) {
  42392. var t, i = e.geometry;
  42393. if (e instanceof Ci.Mesh) {
  42394. var n = i.__directGeometry;
  42395. if (void 0 === n)
  42396. return this.fromGeometry(i);
  42397. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42398. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42399. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42400. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42401. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42402. i.verticesNeedUpdate = !1,
  42403. i.normalsNeedUpdate = !1,
  42404. i.colorsNeedUpdate = !1,
  42405. i.uvsNeedUpdate = !1,
  42406. i.groupsNeedUpdate = !1,
  42407. i = n
  42408. }
  42409. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42410. t.needsUpdate = !0),
  42411. i.verticesNeedUpdate = !1);
  42412. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42413. t.needsUpdate = !0),
  42414. i.normalsNeedUpdate = !1);
  42415. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42416. t.needsUpdate = !0),
  42417. i.colorsNeedUpdate = !1);
  42418. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42419. t.needsUpdate = !0),
  42420. i.uvsNeedUpdate = !1);
  42421. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42422. t.needsUpdate = !0),
  42423. i.lineDistancesNeedUpdate = !1);
  42424. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42425. this.groups = i.groups,
  42426. i.groupsNeedUpdate = !1),
  42427. this
  42428. },
  42429. fromGeometry: function(e) {
  42430. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42431. this.fromDirectGeometry(e.__directGeometry)
  42432. },
  42433. fromDirectGeometry: function(e) {
  42434. var t = new Float32Array(3 * e.vertices.length);
  42435. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42436. 0 < e.normals.length) {
  42437. var i = new Float32Array(3 * e.normals.length);
  42438. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42439. }
  42440. if (0 < e.colors.length) {
  42441. var n = new Float32Array(3 * e.colors.length);
  42442. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42443. }
  42444. if (0 < e.uvs.length) {
  42445. var r = new Float32Array(2 * e.uvs.length);
  42446. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42447. }
  42448. if (0 < e.uvs2.length) {
  42449. var o = new Float32Array(2 * e.uvs2.length);
  42450. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42451. }
  42452. if (0 < e.indices.length) {
  42453. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42454. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42455. }
  42456. for (var s in this.groups = e.groups,
  42457. e.morphTargets) {
  42458. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42459. var d = c[h]
  42460. , p = new Ci.Float32Attribute(3 * d.length,3);
  42461. l.push(p.copyVector3sArray(d))
  42462. }
  42463. this.morphAttributes[s] = l
  42464. }
  42465. if (0 < e.skinIndices.length) {
  42466. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42467. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42468. }
  42469. if (0 < e.skinWeights.length) {
  42470. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42471. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42472. }
  42473. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42474. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42475. this
  42476. },
  42477. computeBoundingBox: (new Ci.Vector3,
  42478. function() {
  42479. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42480. var e = this.attributes.position.array;
  42481. e && this.boundingBox.setFromArray(e),
  42482. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42483. this.boundingBox.max.set(0, 0, 0)),
  42484. (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)
  42485. }
  42486. ),
  42487. computeBoundingSphere: (nt = new Ci.Box3,
  42488. rt = new Ci.Vector3,
  42489. function() {
  42490. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42491. var e = this.attributes.position.array;
  42492. if (e) {
  42493. var t = this.boundingSphere.center;
  42494. nt.setFromArray(e),
  42495. nt.center(t);
  42496. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42497. rt.fromArray(e, n),
  42498. i = Math.max(i, t.distanceToSquared(rt));
  42499. this.boundingSphere.radius = Math.sqrt(i),
  42500. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42501. }
  42502. }
  42503. ),
  42504. computeFaceNormals: function() {},
  42505. computeVertexNormals: function() {
  42506. var e = this.index
  42507. , t = this.attributes
  42508. , i = this.groups;
  42509. if (t.position) {
  42510. var n = t.position.array;
  42511. if (void 0 === t.normal)
  42512. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42513. else
  42514. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42515. r[o] = 0;
  42516. 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;
  42517. if (e) {
  42518. var m = e.array;
  42519. 0 === i.length && this.addGroup(0, m.length);
  42520. for (var v = 0, y = i.length; v < y; ++v) {
  42521. var A = i[v]
  42522. , C = A.start;
  42523. for (o = C,
  42524. a = C + A.count; o < a; o += 3)
  42525. s = 3 * m[o + 0],
  42526. l = 3 * m[o + 1],
  42527. c = 3 * m[o + 2],
  42528. u.fromArray(n, s),
  42529. d.fromArray(n, l),
  42530. p.fromArray(n, c),
  42531. f.subVectors(p, d),
  42532. g.subVectors(u, d),
  42533. f.cross(g),
  42534. h[s] += f.x,
  42535. h[1 + s] += f.y,
  42536. h[2 + s] += f.z,
  42537. h[l] += f.x,
  42538. h[1 + l] += f.y,
  42539. h[2 + l] += f.z,
  42540. h[c] += f.x,
  42541. h[1 + c] += f.y,
  42542. h[2 + c] += f.z
  42543. }
  42544. } else
  42545. for (o = 0,
  42546. a = n.length; o < a; o += 9)
  42547. u.fromArray(n, o),
  42548. d.fromArray(n, o + 3),
  42549. p.fromArray(n, o + 6),
  42550. f.subVectors(p, d),
  42551. g.subVectors(u, d),
  42552. f.cross(g),
  42553. h[o] = f.x,
  42554. h[o + 1] = f.y,
  42555. h[o + 2] = f.z,
  42556. h[o + 3] = f.x,
  42557. h[o + 4] = f.y,
  42558. h[o + 5] = f.z,
  42559. h[o + 6] = f.x,
  42560. h[o + 7] = f.y,
  42561. h[o + 8] = f.z;
  42562. this.normalizeNormals(),
  42563. t.normal.needsUpdate = !0
  42564. }
  42565. },
  42566. merge: function(e, t) {
  42567. if (e instanceof Ci.BufferGeometry != 0) {
  42568. void 0 === t && (t = 0);
  42569. var i = this.attributes;
  42570. for (var n in i)
  42571. if (void 0 !== e.attributes[n])
  42572. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42573. l++)
  42574. r[l] = a[s];
  42575. return this
  42576. }
  42577. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42578. },
  42579. normalizeNormals: function() {
  42580. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42581. e = r[o],
  42582. t = r[o + 1],
  42583. i = r[o + 2],
  42584. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42585. r[o] *= n,
  42586. r[o + 1] *= n,
  42587. r[o + 2] *= n
  42588. },
  42589. toNonIndexed: function() {
  42590. if (null === this.index)
  42591. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42592. this;
  42593. var e = new Ci.BufferGeometry
  42594. , t = this.index.array
  42595. , i = this.attributes;
  42596. for (var n in i) {
  42597. 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++) {
  42598. l = t[h] * a;
  42599. for (var d = 0; d < a; d++)
  42600. s[c++] = o[l++]
  42601. }
  42602. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42603. }
  42604. return e
  42605. },
  42606. toJSON: function() {
  42607. var e = {
  42608. metadata: {
  42609. version: 4.4,
  42610. type: "BufferGeometry",
  42611. generator: "BufferGeometry.toJSON"
  42612. }
  42613. };
  42614. if (e.uuid = this.uuid,
  42615. e.type = this.type,
  42616. "" !== this.name && (e.name = this.name),
  42617. void 0 !== this.parameters) {
  42618. var t = this.parameters;
  42619. for (var i in t)
  42620. void 0 !== t[i] && (e[i] = t[i]);
  42621. return e
  42622. }
  42623. e.data = {
  42624. attributes: {}
  42625. };
  42626. var n = this.index;
  42627. if (null !== n) {
  42628. var r = Array.prototype.slice.call(n.array);
  42629. e.data.index = {
  42630. type: n.array.constructor.name,
  42631. array: r
  42632. }
  42633. }
  42634. var o = this.attributes;
  42635. for (var i in o) {
  42636. var a = o[i];
  42637. r = Array.prototype.slice.call(a.array);
  42638. e.data.attributes[i] = {
  42639. itemSize: a.itemSize,
  42640. type: a.array.constructor.name,
  42641. array: r
  42642. }
  42643. }
  42644. var s = this.groups;
  42645. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42646. var l = this.boundingSphere;
  42647. return null !== l && (e.data.boundingSphere = {
  42648. center: l.center.toArray(),
  42649. radius: l.radius
  42650. }),
  42651. e
  42652. },
  42653. clone: function() {
  42654. return (new Ci.BufferGeometry).copy(this)
  42655. },
  42656. copy: function(e) {
  42657. var t = e.index;
  42658. null !== t && this.setIndex(t.clone());
  42659. var i = e.attributes;
  42660. for (var n in i) {
  42661. var r = i[n];
  42662. this.addAttribute(n, r.clone())
  42663. }
  42664. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42665. var l = o[a];
  42666. this.addGroup(l.start, l.count)
  42667. }
  42668. return this
  42669. },
  42670. dispose: function() {
  42671. this.dispatchEvent({
  42672. type: "dispose"
  42673. })
  42674. }
  42675. },
  42676. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42677. Ci.BufferGeometry.MaxIndex = 65535,
  42678. Ci.InstancedBufferGeometry = function() {
  42679. Ci.BufferGeometry.call(this),
  42680. this.type = "InstancedBufferGeometry",
  42681. this.maxInstancedCount = void 0
  42682. }
  42683. ,
  42684. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42685. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42686. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42687. this.groups.push({
  42688. start: e,
  42689. count: t,
  42690. instances: i
  42691. })
  42692. }
  42693. ,
  42694. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42695. var t = e.index;
  42696. null !== t && this.setIndex(t.clone());
  42697. var i = e.attributes;
  42698. for (var n in i) {
  42699. var r = i[n];
  42700. this.addAttribute(n, r.clone())
  42701. }
  42702. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42703. var l = o[a];
  42704. this.addGroup(l.start, l.count, l.instances)
  42705. }
  42706. return this
  42707. }
  42708. ,
  42709. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42710. Ci.Uniform = function(e, t) {
  42711. this.type = e,
  42712. this.value = t,
  42713. this.dynamic = !1
  42714. }
  42715. ,
  42716. Ci.Uniform.prototype = {
  42717. constructor: Ci.Uniform,
  42718. onUpdate: function(e) {
  42719. return this.dynamic = !0,
  42720. this.onUpdateCallback = e,
  42721. this
  42722. }
  42723. },
  42724. Ci.AnimationClip = function(e, t, i) {
  42725. this.name = e || Ci.Math.generateUUID(),
  42726. this.tracks = i,
  42727. this.duration = void 0 !== t ? t : -1,
  42728. this.duration < 0 && this.resetDuration(),
  42729. this.trim(),
  42730. this.optimize()
  42731. }
  42732. ,
  42733. Ci.AnimationClip.prototype = {
  42734. constructor: Ci.AnimationClip,
  42735. resetDuration: function() {
  42736. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42737. var n = this.tracks[t];
  42738. e = Math.max(e, n.times[n.times.length - 1])
  42739. }
  42740. this.duration = e
  42741. },
  42742. trim: function() {
  42743. for (var e = 0; e < this.tracks.length; e++)
  42744. this.tracks[e].trim(0, this.duration);
  42745. return this
  42746. },
  42747. optimize: function() {
  42748. for (var e = 0; e < this.tracks.length; e++)
  42749. this.tracks[e].optimize();
  42750. return this
  42751. }
  42752. },
  42753. Object.assign(Ci.AnimationClip, {
  42754. parse: function(e) {
  42755. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42756. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42757. return new Ci.AnimationClip(e.name,e.duration,t)
  42758. },
  42759. toJSON: function(e) {
  42760. for (var t = [], i = e.tracks, n = {
  42761. name: e.name,
  42762. duration: e.duration,
  42763. tracks: t
  42764. }, r = 0, o = i.length; r !== o; ++r)
  42765. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42766. return n
  42767. },
  42768. CreateFromMorphTargetSequence: function(e, t, i) {
  42769. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42770. var a = []
  42771. , s = [];
  42772. a.push((o + n - 1) % n, o, (o + 1) % n),
  42773. s.push(0, 1, 0);
  42774. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42775. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42776. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42777. 0 === a[0] && (a.push(n),
  42778. s.push(s[0])),
  42779. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42780. }
  42781. return new Ci.AnimationClip(e,-1,r)
  42782. },
  42783. findByName: function(e, t) {
  42784. for (var i = 0; i < e.length; i++)
  42785. if (e[i].name === t)
  42786. return e[i];
  42787. return null
  42788. },
  42789. CreateClipsFromMorphTargetSequences: function(e, t) {
  42790. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42791. var a = e[r]
  42792. , s = a.name.match(n);
  42793. if (s && 1 < s.length) {
  42794. var l = i[h = s[1]];
  42795. l || (i[h] = l = []),
  42796. l.push(a)
  42797. }
  42798. }
  42799. var c = [];
  42800. for (var h in i)
  42801. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42802. return c
  42803. },
  42804. parseAnimation: function(e, t, i) {
  42805. if (!e)
  42806. return console.error(" no animation in JSONLoader data"),
  42807. null;
  42808. function n(e, t, i, n, r) {
  42809. if (0 !== i.length) {
  42810. var o = []
  42811. , a = [];
  42812. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42813. 0 !== o.length && r.push(new e(t,o,a))
  42814. }
  42815. }
  42816. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42817. var h = l[c].keys;
  42818. if (h && 0 != h.length)
  42819. if (h[0].morphTargets) {
  42820. for (var u = {}, d = 0; d < h.length; d++)
  42821. if (h[d].morphTargets)
  42822. for (var p = 0; p < h[d].morphTargets.length; p++)
  42823. u[h[d].morphTargets[p]] = -1;
  42824. for (var f in u) {
  42825. var g = []
  42826. , m = [];
  42827. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42828. var v = h[d];
  42829. g.push(v.time),
  42830. m.push(v.morphTarget === f ? 1 : 0)
  42831. }
  42832. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42833. }
  42834. a = u.length * (s || 1)
  42835. } else {
  42836. var y = ".bones[" + t[c].name + "]";
  42837. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42838. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42839. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42840. }
  42841. }
  42842. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42843. }
  42844. }),
  42845. Ci.AnimationMixer = function(e) {
  42846. this._root = e,
  42847. this._initMemoryManager(),
  42848. this._accuIndex = 0,
  42849. this.time = 0,
  42850. this.timeScale = 1
  42851. }
  42852. ,
  42853. Ci.AnimationMixer.prototype = {
  42854. constructor: Ci.AnimationMixer,
  42855. clipAction: function(e, t) {
  42856. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42857. if (void 0 !== a) {
  42858. var s = a.actionByRoot[n];
  42859. if (void 0 !== s)
  42860. return s;
  42861. if (o = (i = a.knownActions[0])._clip,
  42862. e !== r && e !== o)
  42863. throw new Error("Different clips with the same name detected!")
  42864. }
  42865. if (null === o)
  42866. return null;
  42867. var l = new Ci.AnimationMixer._Action(this,o,t);
  42868. return this._bindAction(l, i),
  42869. this._addInactiveAction(l, r, n),
  42870. l
  42871. },
  42872. existingAction: function(e, t) {
  42873. var i = (t || this._root).uuid
  42874. , n = "string" == typeof e ? e : e.name
  42875. , r = this._actionsByClip[n];
  42876. return void 0 !== r && r.actionByRoot[i] || null
  42877. },
  42878. stopAllAction: function() {
  42879. var e = this._actions
  42880. , t = this._nActiveActions
  42881. , i = this._bindings
  42882. , n = this._nActiveBindings;
  42883. this._nActiveActions = 0;
  42884. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42885. e[r].reset();
  42886. for (r = 0; r !== n; ++r)
  42887. i[r].useCount = 0;
  42888. return this
  42889. },
  42890. update: function(e) {
  42891. e *= this.timeScale;
  42892. 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) {
  42893. var s = t[a];
  42894. s.enabled && s._update(n, e, r, o)
  42895. }
  42896. var l = this._bindings
  42897. , c = this._nActiveBindings;
  42898. for (a = 0; a !== c; ++a)
  42899. l[a].apply(o);
  42900. return this
  42901. },
  42902. getRoot: function() {
  42903. return this._root
  42904. },
  42905. uncacheClip: function(e) {
  42906. var t = this._actions
  42907. , i = e.name
  42908. , n = this._actionsByClip
  42909. , r = n[i];
  42910. if (void 0 !== r) {
  42911. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42912. var l = o[a];
  42913. this._deactivateAction(l);
  42914. var c = l._cacheIndex
  42915. , h = t[t.length - 1];
  42916. l._cacheIndex = null,
  42917. l._byClipCacheIndex = null,
  42918. t[h._cacheIndex = c] = h,
  42919. t.pop(),
  42920. this._removeInactiveBindingsForAction(l)
  42921. }
  42922. delete n[i]
  42923. }
  42924. },
  42925. uncacheRoot: function(e) {
  42926. var t = e.uuid
  42927. , i = this._actionsByClip;
  42928. for (var n in i) {
  42929. var r = i[n].actionByRoot[t];
  42930. void 0 !== r && (this._deactivateAction(r),
  42931. this._removeInactiveAction(r))
  42932. }
  42933. var o = this._bindingsByRootAndName[t];
  42934. if (void 0 !== o)
  42935. for (var a in o) {
  42936. var s = o[a];
  42937. s.restoreOriginalState(),
  42938. this._removeInactiveBinding(s)
  42939. }
  42940. },
  42941. uncacheAction: function(e, t) {
  42942. var i = this.existingAction(e, t);
  42943. null !== i && (this._deactivateAction(i),
  42944. this._removeInactiveAction(i))
  42945. }
  42946. },
  42947. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42948. Ci.AnimationMixer._Action = function(e, t, i) {
  42949. this._mixer = e,
  42950. this._clip = t,
  42951. this._localRoot = i || null;
  42952. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42953. endingStart: Ci.ZeroCurvatureEnding,
  42954. endingEnd: Ci.ZeroCurvatureEnding
  42955. }, s = 0; s !== r; ++s) {
  42956. var l = n[s].createInterpolant(null);
  42957. (o[s] = l).settings = a
  42958. }
  42959. this._interpolantSettings = a,
  42960. this._interpolants = o,
  42961. this._propertyBindings = new Array(r),
  42962. this._cacheIndex = null,
  42963. this._byClipCacheIndex = null,
  42964. this._timeScaleInterpolant = null,
  42965. this._weightInterpolant = null,
  42966. this.loop = Ci.LoopRepeat,
  42967. this._loopCount = -1,
  42968. this._startTime = null,
  42969. this.time = 0,
  42970. this.timeScale = 1,
  42971. this._effectiveTimeScale = 1,
  42972. this.weight = 1,
  42973. this._effectiveWeight = 1,
  42974. this.repetitions = 1 / 0,
  42975. this.paused = !1,
  42976. this.enabled = !0,
  42977. this.clampWhenFinished = !1,
  42978. this.zeroSlopeAtStart = !0,
  42979. this.zeroSlopeAtEnd = !0
  42980. }
  42981. ,
  42982. Ci.AnimationMixer._Action.prototype = {
  42983. constructor: Ci.AnimationMixer._Action,
  42984. play: function() {
  42985. return this._mixer._activateAction(this),
  42986. this
  42987. },
  42988. stop: function() {
  42989. return this._mixer._deactivateAction(this),
  42990. this.reset()
  42991. },
  42992. reset: function() {
  42993. return this.paused = !1,
  42994. this.enabled = !0,
  42995. this.time = 0,
  42996. this._loopCount = -1,
  42997. this._startTime = null,
  42998. this.stopFading().stopWarping()
  42999. },
  43000. isRunning: function() {
  43001. return this._startTime,
  43002. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43003. },
  43004. isScheduled: function() {
  43005. return this._mixer._isActiveAction(this)
  43006. },
  43007. startAt: function(e) {
  43008. return this._startTime = e,
  43009. this
  43010. },
  43011. setLoop: function(e, t) {
  43012. return this.loop = e,
  43013. this.repetitions = t,
  43014. this
  43015. },
  43016. setEffectiveWeight: function(e) {
  43017. return this.weight = e,
  43018. this._effectiveWeight = this.enabled ? e : 0,
  43019. this.stopFading()
  43020. },
  43021. getEffectiveWeight: function() {
  43022. return this._effectiveWeight
  43023. },
  43024. fadeIn: function(e) {
  43025. return this._scheduleFading(e, 0, 1)
  43026. },
  43027. fadeOut: function(e) {
  43028. return this._scheduleFading(e, 1, 0)
  43029. },
  43030. crossFadeFrom: function(e, t, i) {
  43031. if (this._mixer,
  43032. e.fadeOut(t),
  43033. this.fadeIn(t),
  43034. i) {
  43035. var n = this._clip.duration
  43036. , r = e._clip.duration
  43037. , o = r / n
  43038. , a = n / r;
  43039. e.warp(1, o, t),
  43040. this.warp(a, 1, t)
  43041. }
  43042. return this
  43043. },
  43044. crossFadeTo: function(e, t, i) {
  43045. return e.crossFadeFrom(this, t, i)
  43046. },
  43047. stopFading: function() {
  43048. var e = this._weightInterpolant;
  43049. return null !== e && (this._weightInterpolant = null,
  43050. this._mixer._takeBackControlInterpolant(e)),
  43051. this
  43052. },
  43053. setEffectiveTimeScale: function(e) {
  43054. return this.timeScale = e,
  43055. this._effectiveTimeScale = this.paused ? 0 : e,
  43056. this.stopWarping()
  43057. },
  43058. getEffectiveTimeScale: function() {
  43059. return this._effectiveTimeScale
  43060. },
  43061. setDuration: function(e) {
  43062. return this.timeScale = this._clip.duration / e,
  43063. this.stopWarping()
  43064. },
  43065. syncWith: function(e) {
  43066. return this.time = e.time,
  43067. this.timeScale = e.timeScale,
  43068. this.stopWarping()
  43069. },
  43070. halt: function(e) {
  43071. return this.warp(this._currentTimeScale, 0, e)
  43072. },
  43073. warp: function(e, t, i) {
  43074. var n = this._mixer
  43075. , r = n.time
  43076. , o = this._timeScaleInterpolant
  43077. , a = this.timeScale;
  43078. null === o && (o = n._lendControlInterpolant(),
  43079. this._timeScaleInterpolant = o);
  43080. var s = o.parameterPositions
  43081. , l = o.sampleValues;
  43082. return s[0] = r,
  43083. s[1] = r + i,
  43084. l[0] = e / a,
  43085. l[1] = t / a,
  43086. this
  43087. },
  43088. stopWarping: function() {
  43089. var e = this._timeScaleInterpolant;
  43090. return null !== e && (this._timeScaleInterpolant = null,
  43091. this._mixer._takeBackControlInterpolant(e)),
  43092. this
  43093. },
  43094. getMixer: function() {
  43095. return this._mixer
  43096. },
  43097. getClip: function() {
  43098. return this._clip
  43099. },
  43100. getRoot: function() {
  43101. return this._localRoot || this._mixer._root
  43102. },
  43103. _update: function(e, t, i, n) {
  43104. var r = this._startTime;
  43105. if (null !== r) {
  43106. var o = (e - r) * i;
  43107. if (o < 0 || 0 === i)
  43108. return;
  43109. this._startTime = null,
  43110. t = i * o
  43111. }
  43112. t *= this._updateTimeScale(e);
  43113. var a = this._updateTime(t)
  43114. , s = this._updateWeight(e);
  43115. if (0 < s)
  43116. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43117. l[h].evaluate(a),
  43118. c[h].accumulate(n, s)
  43119. },
  43120. _updateWeight: function(e) {
  43121. var t = 0;
  43122. if (this.enabled) {
  43123. t = this.weight;
  43124. var i = this._weightInterpolant;
  43125. if (null !== i) {
  43126. var n = i.evaluate(e)[0];
  43127. t *= n,
  43128. e > i.parameterPositions[1] && (this.stopFading(),
  43129. 0 === n && (this.enabled = !1))
  43130. }
  43131. }
  43132. return this._effectiveWeight = t
  43133. },
  43134. _updateTimeScale: function(e) {
  43135. var t = 0;
  43136. if (!this.paused) {
  43137. t = this.timeScale;
  43138. var i = this._timeScaleInterpolant;
  43139. if (null !== i)
  43140. t *= i.evaluate(e)[0],
  43141. e > i.parameterPositions[1] && (this.stopWarping(),
  43142. 0 === t ? this.pause = !0 : this.timeScale = t)
  43143. }
  43144. return this._effectiveTimeScale = t
  43145. },
  43146. _updateTime: function(e) {
  43147. var t = this.time + e;
  43148. if (0 === e)
  43149. return t;
  43150. var i = this._clip.duration
  43151. , n = this.loop
  43152. , r = this._loopCount
  43153. , o = !1;
  43154. switch (n) {
  43155. case Ci.LoopOnce:
  43156. if (-1 === r && (this.loopCount = 0,
  43157. this._setEndings(!0, !0, !1)),
  43158. i <= t)
  43159. t = i;
  43160. else {
  43161. if (!(t < 0))
  43162. break;
  43163. t = 0
  43164. }
  43165. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43166. this._mixer.dispatchEvent({
  43167. type: "finished",
  43168. action: this,
  43169. direction: e < 0 ? -1 : 1
  43170. });
  43171. break;
  43172. case Ci.LoopPingPong:
  43173. o = !0;
  43174. case Ci.LoopRepeat:
  43175. if (-1 === r && (0 < e ? (r = 0,
  43176. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43177. i <= t || t < 0) {
  43178. var a = Math.floor(t / i);
  43179. t -= i * a,
  43180. r += Math.abs(a);
  43181. var s = this.repetitions - r;
  43182. if (s < 0) {
  43183. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43184. t = 0 < e ? i : 0,
  43185. this._mixer.dispatchEvent({
  43186. type: "finished",
  43187. action: this,
  43188. direction: 0 < e ? 1 : -1
  43189. });
  43190. break
  43191. }
  43192. if (0 == s) {
  43193. var l = e < 0;
  43194. this._setEndings(l, !l, o)
  43195. } else
  43196. this._setEndings(!1, !1, o);
  43197. this._loopCount = r,
  43198. this._mixer.dispatchEvent({
  43199. type: "loop",
  43200. action: this,
  43201. loopDelta: a
  43202. })
  43203. }
  43204. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43205. return i - (this.time = t)
  43206. }
  43207. return this.time = t
  43208. },
  43209. _setEndings: function(e, t, i) {
  43210. var n = this._interpolantSettings;
  43211. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43212. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43213. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43214. },
  43215. _scheduleFading: function(e, t, i) {
  43216. var n = this._mixer
  43217. , r = n.time
  43218. , o = this._weightInterpolant;
  43219. null === o && (o = n._lendControlInterpolant(),
  43220. this._weightInterpolant = o);
  43221. var a = o.parameterPositions
  43222. , s = o.sampleValues;
  43223. return a[0] = r,
  43224. s[0] = t,
  43225. a[1] = r + e,
  43226. s[1] = i,
  43227. this
  43228. }
  43229. },
  43230. Object.assign(Ci.AnimationMixer.prototype, {
  43231. _bindAction: function(e, t) {
  43232. var i = e._localRoot || this._root
  43233. , n = e._clip.tracks
  43234. , r = n.length
  43235. , o = e._propertyBindings
  43236. , a = e._interpolants
  43237. , s = i.uuid
  43238. , l = this._bindingsByRootAndName
  43239. , c = l[s];
  43240. void 0 === c && (c = {},
  43241. l[s] = c);
  43242. for (var h = 0; h !== r; ++h) {
  43243. var u = n[h]
  43244. , d = u.name
  43245. , p = c[d];
  43246. if (void 0 !== p)
  43247. o[h] = p;
  43248. else {
  43249. if (void 0 !== (p = o[h])) {
  43250. null === p._cacheIndex && (++p.referenceCount,
  43251. this._addInactiveBinding(p, s, d));
  43252. continue
  43253. }
  43254. var f = t && t._propertyBindings[h].binding.parsedPath;
  43255. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43256. this._addInactiveBinding(p, s, d),
  43257. o[h] = p
  43258. }
  43259. a[h].resultBuffer = p.buffer
  43260. }
  43261. },
  43262. _activateAction: function(e) {
  43263. if (!this._isActiveAction(e)) {
  43264. if (null === e._cacheIndex) {
  43265. var t = (e._localRoot || this._root).uuid
  43266. , i = e._clip.name
  43267. , n = this._actionsByClip[i];
  43268. this._bindAction(e, n && n.knownActions[0]),
  43269. this._addInactiveAction(e, i, t)
  43270. }
  43271. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43272. var s = r[o];
  43273. 0 == s.useCount++ && (this._lendBinding(s),
  43274. s.saveOriginalState())
  43275. }
  43276. this._lendAction(e)
  43277. }
  43278. },
  43279. _deactivateAction: function(e) {
  43280. if (this._isActiveAction(e)) {
  43281. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43282. var r = t[i];
  43283. 0 == --r.useCount && (r.restoreOriginalState(),
  43284. this._takeBackBinding(r))
  43285. }
  43286. this._takeBackAction(e)
  43287. }
  43288. },
  43289. _initMemoryManager: function() {
  43290. this._actions = [],
  43291. this._nActiveActions = 0,
  43292. this._actionsByClip = {},
  43293. this._bindings = [],
  43294. this._nActiveBindings = 0,
  43295. this._bindingsByRootAndName = {},
  43296. this._controlInterpolants = [],
  43297. this._nActiveControlInterpolants = 0;
  43298. var e = this;
  43299. this.stats = {
  43300. actions: {
  43301. get total() {
  43302. return e._actions.length
  43303. },
  43304. get inUse() {
  43305. return e._nActiveActions
  43306. }
  43307. },
  43308. bindings: {
  43309. get total() {
  43310. return e._bindings.length
  43311. },
  43312. get inUse() {
  43313. return e._nActiveBindings
  43314. }
  43315. },
  43316. controlInterpolants: {
  43317. get total() {
  43318. return e._controlInterpolants.length
  43319. },
  43320. get inUse() {
  43321. return e._nActiveControlInterpolants
  43322. }
  43323. }
  43324. }
  43325. },
  43326. _isActiveAction: function(e) {
  43327. var t = e._cacheIndex;
  43328. return null !== t && t < this._nActiveActions
  43329. },
  43330. _addInactiveAction: function(e, t, i) {
  43331. var n = this._actions
  43332. , r = this._actionsByClip
  43333. , o = r[t];
  43334. if (void 0 === o)
  43335. o = {
  43336. knownActions: [e],
  43337. actionByRoot: {}
  43338. },
  43339. e._byClipCacheIndex = 0,
  43340. r[t] = o;
  43341. else {
  43342. var a = o.knownActions;
  43343. e._byClipCacheIndex = a.length,
  43344. a.push(e)
  43345. }
  43346. e._cacheIndex = n.length,
  43347. n.push(e),
  43348. o.actionByRoot[i] = e
  43349. },
  43350. _removeInactiveAction: function(e) {
  43351. var t = this._actions
  43352. , i = t[t.length - 1]
  43353. , n = e._cacheIndex;
  43354. t[i._cacheIndex = n] = i,
  43355. t.pop(),
  43356. e._cacheIndex = null;
  43357. var r = e._clip.name
  43358. , o = this._actionsByClip
  43359. , a = o[r]
  43360. , s = a.knownActions
  43361. , l = s[s.length - 1]
  43362. , c = e._byClipCacheIndex;
  43363. s[l._byClipCacheIndex = c] = l,
  43364. s.pop(),
  43365. e._byClipCacheIndex = null,
  43366. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43367. 0 === s.length && delete o[r],
  43368. this._removeInactiveBindingsForAction(e)
  43369. },
  43370. _removeInactiveBindingsForAction: function(e) {
  43371. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43372. var r = t[i];
  43373. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43374. }
  43375. },
  43376. _lendAction: function(e) {
  43377. var t = this._actions
  43378. , i = e._cacheIndex
  43379. , n = this._nActiveActions++
  43380. , r = t[n];
  43381. t[e._cacheIndex = n] = e,
  43382. t[r._cacheIndex = i] = r
  43383. },
  43384. _takeBackAction: function(e) {
  43385. var t = this._actions
  43386. , i = e._cacheIndex
  43387. , n = --this._nActiveActions
  43388. , r = t[n];
  43389. t[e._cacheIndex = n] = e,
  43390. t[r._cacheIndex = i] = r
  43391. },
  43392. _addInactiveBinding: function(e, t, i) {
  43393. var n = this._bindingsByRootAndName
  43394. , r = n[t]
  43395. , o = this._bindings;
  43396. void 0 === r && (r = {},
  43397. n[t] = r),
  43398. (r[i] = e)._cacheIndex = o.length,
  43399. o.push(e)
  43400. },
  43401. _removeInactiveBinding: function(e) {
  43402. var t = this._bindings
  43403. , i = e.binding
  43404. , n = i.rootNode.uuid
  43405. , r = i.path
  43406. , o = this._bindingsByRootAndName
  43407. , a = o[n]
  43408. , s = t[t.length - 1]
  43409. , l = e._cacheIndex;
  43410. t[s._cacheIndex = l] = s,
  43411. t.pop(),
  43412. delete a[r];
  43413. e: {
  43414. for (var c in a)
  43415. break e;
  43416. delete o[n]
  43417. }
  43418. },
  43419. _lendBinding: function(e) {
  43420. var t = this._bindings
  43421. , i = e._cacheIndex
  43422. , n = this._nActiveBindings++
  43423. , r = t[n];
  43424. t[e._cacheIndex = n] = e,
  43425. t[r._cacheIndex = i] = r
  43426. },
  43427. _takeBackBinding: function(e) {
  43428. var t = this._bindings
  43429. , i = e._cacheIndex
  43430. , n = --this._nActiveBindings
  43431. , r = t[n];
  43432. t[e._cacheIndex = n] = e,
  43433. t[r._cacheIndex = i] = r
  43434. },
  43435. _lendControlInterpolant: function() {
  43436. var e = this._controlInterpolants
  43437. , t = this._nActiveControlInterpolants++
  43438. , i = e[t];
  43439. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43440. i
  43441. },
  43442. _takeBackControlInterpolant: function(e) {
  43443. var t = this._controlInterpolants
  43444. , i = e.__cacheIndex
  43445. , n = --this._nActiveControlInterpolants
  43446. , r = t[n];
  43447. t[e.__cacheIndex = n] = e,
  43448. t[r.__cacheIndex = i] = r
  43449. },
  43450. _controlInterpolantsResultBuffer: new Float32Array(1)
  43451. }),
  43452. Ci.AnimationObjectGroup = function(e) {
  43453. this.uuid = Ci.Math.generateUUID(),
  43454. this._objects = Array.prototype.slice.call(arguments),
  43455. this.nCachedObjects_ = 0;
  43456. var t = {};
  43457. this._indicesByUUID = t;
  43458. for (var i = 0, n = arguments.length; i !== n; ++i)
  43459. t[arguments[i].uuid] = i;
  43460. this._paths = [],
  43461. this._parsedPaths = [],
  43462. this._bindings = [],
  43463. this._bindingsIndicesByPath = {};
  43464. var r = this;
  43465. this.stats = {
  43466. objects: {
  43467. get total() {
  43468. return r._objects.length
  43469. },
  43470. get inUse() {
  43471. return this.total - r.nCachedObjects_
  43472. }
  43473. },
  43474. get bindingsPerObject() {
  43475. return r._bindings.length
  43476. }
  43477. }
  43478. }
  43479. ,
  43480. Ci.AnimationObjectGroup.prototype = {
  43481. constructor: Ci.AnimationObjectGroup,
  43482. add: function(e) {
  43483. 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) {
  43484. var u = arguments[c]
  43485. , d = u.uuid
  43486. , p = r[d];
  43487. if (void 0 === p) {
  43488. p = i++,
  43489. r[d] = p,
  43490. t.push(u);
  43491. for (var f = 0, g = l; f !== g; ++f)
  43492. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43493. } else if (p < n) {
  43494. var m = t[p]
  43495. , v = --n
  43496. , y = t[v];
  43497. t[r[y.uuid] = p] = y,
  43498. t[r[d] = v] = u;
  43499. for (f = 0,
  43500. g = l; f !== g; ++f) {
  43501. var A = s[f]
  43502. , C = A[v]
  43503. , I = A[p];
  43504. A[p] = C,
  43505. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43506. A[v] = I
  43507. }
  43508. } else
  43509. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43510. }
  43511. this.nCachedObjects_ = n
  43512. },
  43513. remove: function(e) {
  43514. for (var t = this._objects, i = (t.length,
  43515. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43516. var l = arguments[a]
  43517. , c = l.uuid
  43518. , h = n[c];
  43519. if (void 0 !== h && i <= h) {
  43520. var u = i++
  43521. , d = t[u];
  43522. t[n[d.uuid] = h] = d,
  43523. t[n[c] = u] = l;
  43524. for (var p = 0, f = o; p !== f; ++p) {
  43525. var g = r[p]
  43526. , m = g[u]
  43527. , v = g[h];
  43528. g[h] = m,
  43529. g[u] = v
  43530. }
  43531. }
  43532. }
  43533. this.nCachedObjects_ = i
  43534. },
  43535. uncache: function(e) {
  43536. 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) {
  43537. var c = arguments[s].uuid
  43538. , h = r[c];
  43539. if (void 0 !== h)
  43540. if (delete r[c],
  43541. h < n) {
  43542. var u = --n
  43543. , d = t[u]
  43544. , p = t[y = --i];
  43545. t[r[d.uuid] = h] = d,
  43546. t[r[p.uuid] = u] = p,
  43547. t.pop();
  43548. for (var f = 0, g = a; f !== g; ++f) {
  43549. var m = (A = o[f])[u]
  43550. , v = A[y];
  43551. A[h] = m,
  43552. A[u] = v,
  43553. A.pop()
  43554. }
  43555. } else {
  43556. var y;
  43557. t[r[(p = t[y = --i]).uuid] = h] = p,
  43558. t.pop();
  43559. for (f = 0,
  43560. g = a; f !== g; ++f) {
  43561. var A;
  43562. (A = o[f])[h] = A[y],
  43563. A.pop()
  43564. }
  43565. }
  43566. }
  43567. this.nCachedObjects_ = n
  43568. },
  43569. subscribe_: function(e, t) {
  43570. var i = this._bindingsIndicesByPath
  43571. , n = i[e]
  43572. , r = this._bindings;
  43573. if (void 0 !== n)
  43574. return r[n];
  43575. var o = this._paths
  43576. , a = this._parsedPaths
  43577. , s = this._objects
  43578. , l = s.length
  43579. , c = this.nCachedObjects_
  43580. , h = new Array(l);
  43581. n = r.length,
  43582. i[e] = n,
  43583. o.push(e),
  43584. a.push(t),
  43585. r.push(h);
  43586. for (var u = c, d = s.length; u !== d; ++u) {
  43587. var p = s[u];
  43588. h[u] = new Ci.PropertyBinding(p,e,t)
  43589. }
  43590. return h
  43591. },
  43592. unsubscribe_: function(e) {
  43593. var t = this._bindingsIndicesByPath
  43594. , i = t[e];
  43595. if (void 0 !== i) {
  43596. var n = this._paths
  43597. , r = this._parsedPaths
  43598. , o = this._bindings
  43599. , a = o.length - 1
  43600. , s = o[a];
  43601. o[t[e[a]] = i] = s,
  43602. o.pop(),
  43603. r[i] = r[a],
  43604. r.pop(),
  43605. n[i] = n[a],
  43606. n.pop()
  43607. }
  43608. }
  43609. },
  43610. Ci.AnimationUtils = {
  43611. arraySlice: function(e, t, i) {
  43612. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43613. },
  43614. convertArray: function(e, t, i) {
  43615. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43616. },
  43617. isTypedArray: function(e) {
  43618. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43619. },
  43620. getKeyframeOrder: function(i) {
  43621. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43622. t[n] = n;
  43623. return t.sort(function(e, t) {
  43624. return i[e] - i[t]
  43625. }),
  43626. t
  43627. },
  43628. sortedArray: function(e, t, i) {
  43629. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43630. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43631. r[a++] = e[s + l];
  43632. return r
  43633. },
  43634. flattenJSON: function(e, t, i, n) {
  43635. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43636. o = e[r++];
  43637. if (void 0 !== o) {
  43638. var a = o[n];
  43639. if (void 0 !== a)
  43640. if (Array.isArray(a))
  43641. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43642. i.push.apply(i, a)),
  43643. void 0 !== (o = e[r++]); )
  43644. ;
  43645. else if (void 0 !== a.toArray)
  43646. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43647. a.toArray(i, i.length)),
  43648. void 0 !== (o = e[r++]); )
  43649. ;
  43650. else
  43651. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43652. i.push(a)),
  43653. void 0 !== (o = e[r++]); )
  43654. ;
  43655. }
  43656. }
  43657. },
  43658. Ci.KeyframeTrack = function(e, t, i, n) {
  43659. if (void 0 === e)
  43660. throw new Error("track name is undefined");
  43661. if (void 0 === t || 0 === t.length)
  43662. throw new Error("no keyframes in track named " + e);
  43663. this.name = e,
  43664. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43665. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43666. this.setInterpolation(n || this.DefaultInterpolation),
  43667. this.validate(),
  43668. this.optimize()
  43669. }
  43670. ,
  43671. Ci.KeyframeTrack.prototype = {
  43672. constructor: Ci.KeyframeTrack,
  43673. TimeBufferType: Float32Array,
  43674. ValueBufferType: Float32Array,
  43675. DefaultInterpolation: Ci.InterpolateLinear,
  43676. InterpolantFactoryMethodDiscrete: function(e) {
  43677. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43678. },
  43679. InterpolantFactoryMethodLinear: function(e) {
  43680. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43681. },
  43682. InterpolantFactoryMethodSmooth: function(e) {
  43683. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43684. },
  43685. setInterpolation: function(e) {
  43686. var t = void 0;
  43687. switch (e) {
  43688. case Ci.InterpolateDiscrete:
  43689. t = this.InterpolantFactoryMethodDiscrete;
  43690. break;
  43691. case Ci.InterpolateLinear:
  43692. t = this.InterpolantFactoryMethodLinear;
  43693. break;
  43694. case Ci.InterpolateSmooth:
  43695. t = this.InterpolantFactoryMethodSmooth
  43696. }
  43697. if (void 0 !== t)
  43698. this.createInterpolant = t;
  43699. else {
  43700. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43701. if (void 0 === this.createInterpolant) {
  43702. if (e === this.DefaultInterpolation)
  43703. throw new Error(i);
  43704. this.setInterpolation(this.DefaultInterpolation)
  43705. }
  43706. console.warn(i)
  43707. }
  43708. },
  43709. getInterpolation: function() {
  43710. switch (this.createInterpolant) {
  43711. case this.InterpolantFactoryMethodDiscrete:
  43712. return Ci.InterpolateDiscrete;
  43713. case this.InterpolantFactoryMethodLinear:
  43714. return Ci.InterpolateLinear;
  43715. case this.InterpolantFactoryMethodSmooth:
  43716. return Ci.InterpolateSmooth
  43717. }
  43718. },
  43719. getValueSize: function() {
  43720. return this.values.length / this.times.length
  43721. },
  43722. shift: function(e) {
  43723. if (0 !== e)
  43724. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43725. t[i] += e;
  43726. return this
  43727. },
  43728. scale: function(e) {
  43729. if (1 !== e)
  43730. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43731. t[i] *= e;
  43732. return this
  43733. },
  43734. trim: function(e, t) {
  43735. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43736. ++r;
  43737. for (; -1 !== o && i[o] > t; )
  43738. --o;
  43739. if (++o,
  43740. 0 !== r || o !== n) {
  43741. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43742. var a = this.getValueSize();
  43743. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43744. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43745. }
  43746. return this
  43747. },
  43748. validate: function() {
  43749. var e = !0
  43750. , t = this.getValueSize();
  43751. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43752. e = !1);
  43753. var i = this.times
  43754. , n = this.values
  43755. , r = i.length;
  43756. 0 === r && (console.error("track is empty", this),
  43757. e = !1);
  43758. for (var o = null, a = 0; a !== r; a++) {
  43759. var s = i[a];
  43760. if ("number" == typeof s && isNaN(s)) {
  43761. console.error("time is not a valid number", this, a, s),
  43762. e = !1;
  43763. break
  43764. }
  43765. if (null !== o && s < o) {
  43766. console.error("out of order keys", this, a, s, o),
  43767. e = !1;
  43768. break
  43769. }
  43770. o = s
  43771. }
  43772. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43773. a = 0;
  43774. for (var l = n.length; a !== l; ++a) {
  43775. var c = n[a];
  43776. if (isNaN(c)) {
  43777. console.error("value is not a valid number", this, a, c),
  43778. e = !1;
  43779. break
  43780. }
  43781. }
  43782. }
  43783. return e
  43784. },
  43785. optimize: function() {
  43786. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43787. var a = !1
  43788. , s = e[r];
  43789. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43790. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43791. var d = t[l + u];
  43792. if (d !== t[c + u] || d !== t[h + u]) {
  43793. a = !0;
  43794. break
  43795. }
  43796. }
  43797. if (a) {
  43798. if (r !== n) {
  43799. e[n] = e[r];
  43800. var p = r * i
  43801. , f = n * i;
  43802. for (u = 0; u !== i; ++u)
  43803. t[f + u] = t[p + u]
  43804. }
  43805. ++n
  43806. }
  43807. }
  43808. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43809. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43810. this
  43811. }
  43812. },
  43813. Object.assign(Ci.KeyframeTrack, {
  43814. parse: function(e) {
  43815. if (void 0 === e.type)
  43816. throw new Error("track type undefined, can not parse");
  43817. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43818. if (void 0 === e.times) {
  43819. console.warn("legacy JSON format detected, converting");
  43820. var i = []
  43821. , n = [];
  43822. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43823. e.times = i,
  43824. e.values = n
  43825. }
  43826. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43827. },
  43828. toJSON: function(e) {
  43829. var t, i = e.constructor;
  43830. if (void 0 !== i.toJSON)
  43831. t = i.toJSON(e);
  43832. else {
  43833. t = {
  43834. name: e.name,
  43835. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43836. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43837. };
  43838. var n = e.getInterpolation();
  43839. n !== e.DefaultInterpolation && (t.interpolation = n)
  43840. }
  43841. return t.type = e.ValueTypeName,
  43842. t
  43843. },
  43844. _getTrackTypeForValueTypeName: function(e) {
  43845. switch (e.toLowerCase()) {
  43846. case "scalar":
  43847. case "double":
  43848. case "float":
  43849. case "number":
  43850. case "integer":
  43851. return Ci.NumberKeyframeTrack;
  43852. case "vector":
  43853. case "vector2":
  43854. case "vector3":
  43855. case "vector4":
  43856. return Ci.VectorKeyframeTrack;
  43857. case "color":
  43858. return Ci.ColorKeyframeTrack;
  43859. case "quaternion":
  43860. return Ci.QuaternionKeyframeTrack;
  43861. case "bool":
  43862. case "boolean":
  43863. return Ci.BooleanKeyframeTrack;
  43864. case "string":
  43865. return Ci.StringKeyframeTrack
  43866. }
  43867. throw new Error("Unsupported typeName: " + e)
  43868. }
  43869. }),
  43870. Ci.PropertyBinding = function(e, t, i) {
  43871. this.path = t,
  43872. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43873. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43874. this.rootNode = e
  43875. }
  43876. ,
  43877. Ci.PropertyBinding.prototype = {
  43878. constructor: Ci.PropertyBinding,
  43879. getValue: function(e, t) {
  43880. this.bind(),
  43881. this.getValue(e, t)
  43882. },
  43883. setValue: function(e, t) {
  43884. this.bind(),
  43885. this.setValue(e, t)
  43886. },
  43887. bind: function() {
  43888. var e = this.node
  43889. , t = this.parsedPath
  43890. , i = t.objectName
  43891. , n = t.propertyName
  43892. , r = t.propertyIndex;
  43893. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43894. this.node = e),
  43895. this.getValue = this._getValue_unavailable,
  43896. this.setValue = this._setValue_unavailable,
  43897. e) {
  43898. if (i) {
  43899. var o = t.objectIndex;
  43900. switch (i) {
  43901. case "materials":
  43902. if (!e.material)
  43903. return void console.error(" can not bind to material as node does not have a material", this);
  43904. if (!e.material.materials)
  43905. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43906. e = e.material.materials;
  43907. break;
  43908. case "bones":
  43909. if (!e.skeleton)
  43910. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43911. e = e.skeleton.bones;
  43912. for (var a = 0; a < e.length; a++)
  43913. if (e[a].name === o) {
  43914. o = a;
  43915. break
  43916. }
  43917. break;
  43918. default:
  43919. if (void 0 === e[i])
  43920. return void console.error(" can not bind to objectName of node, undefined", this);
  43921. e = e[i]
  43922. }
  43923. if (void 0 !== o) {
  43924. if (void 0 === e[o])
  43925. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43926. e = e[o]
  43927. }
  43928. }
  43929. var s = e[n];
  43930. if (s) {
  43931. var l = this.Versioning.None;
  43932. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43933. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43934. this.targetObject = e);
  43935. var c = this.BindingType.Direct;
  43936. if (void 0 !== r) {
  43937. if ("morphTargetInfluences" === n) {
  43938. if (!e.geometry)
  43939. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43940. if (!e.geometry.morphTargets)
  43941. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43942. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43943. if (e.geometry.morphTargets[a].name === r) {
  43944. r = a;
  43945. break
  43946. }
  43947. }
  43948. c = this.BindingType.ArrayElement,
  43949. this.resolvedProperty = s,
  43950. this.propertyIndex = r
  43951. } else
  43952. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43953. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43954. this.resolvedProperty = s) : this.propertyName = n;
  43955. this.getValue = this.GetterByBindingType[c],
  43956. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43957. } else {
  43958. var h = t.nodeName;
  43959. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43960. }
  43961. } else
  43962. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43963. },
  43964. unbind: function() {
  43965. this.node = null,
  43966. this.getValue = this._getValue_unbound,
  43967. this.setValue = this._setValue_unbound
  43968. }
  43969. },
  43970. Object.assign(Ci.PropertyBinding.prototype, {
  43971. _getValue_unavailable: function() {},
  43972. _setValue_unavailable: function() {},
  43973. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43974. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43975. BindingType: {
  43976. Direct: 0,
  43977. EntireArray: 1,
  43978. ArrayElement: 2,
  43979. HasFromToArray: 3
  43980. },
  43981. Versioning: {
  43982. None: 0,
  43983. NeedsUpdate: 1,
  43984. MatrixWorldNeedsUpdate: 2
  43985. },
  43986. GetterByBindingType: [function(e, t) {
  43987. e[t] = this.node[this.propertyName]
  43988. }
  43989. , function(e, t) {
  43990. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43991. e[t++] = i[n]
  43992. }
  43993. , function(e, t) {
  43994. e[t] = this.resolvedProperty[this.propertyIndex]
  43995. }
  43996. , function(e, t) {
  43997. this.resolvedProperty.toArray(e, t)
  43998. }
  43999. ],
  44000. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44001. this.node[this.propertyName] = e[t]
  44002. }
  44003. , function(e, t) {
  44004. this.node[this.propertyName] = e[t],
  44005. this.targetObject.needsUpdate = !0
  44006. }
  44007. , function(e, t) {
  44008. this.node[this.propertyName] = e[t],
  44009. this.targetObject.matrixWorldNeedsUpdate = !0
  44010. }
  44011. ], [function(e, t) {
  44012. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44013. i[n] = e[t++]
  44014. }
  44015. , function(e, t) {
  44016. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44017. i[n] = e[t++];
  44018. this.targetObject.needsUpdate = !0
  44019. }
  44020. , function(e, t) {
  44021. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44022. i[n] = e[t++];
  44023. this.targetObject.matrixWorldNeedsUpdate = !0
  44024. }
  44025. ], [function(e, t) {
  44026. this.resolvedProperty[this.propertyIndex] = e[t]
  44027. }
  44028. , function(e, t) {
  44029. this.resolvedProperty[this.propertyIndex] = e[t],
  44030. this.targetObject.needsUpdate = !0
  44031. }
  44032. , function(e, t) {
  44033. this.resolvedProperty[this.propertyIndex] = e[t],
  44034. this.targetObject.matrixWorldNeedsUpdate = !0
  44035. }
  44036. ], [function(e, t) {
  44037. this.resolvedProperty.fromArray(e, t)
  44038. }
  44039. , function(e, t) {
  44040. this.resolvedProperty.fromArray(e, t),
  44041. this.targetObject.needsUpdate = !0
  44042. }
  44043. , function(e, t) {
  44044. this.resolvedProperty.fromArray(e, t),
  44045. this.targetObject.matrixWorldNeedsUpdate = !0
  44046. }
  44047. ]]
  44048. }),
  44049. Ci.PropertyBinding.Composite = function(e, t, i) {
  44050. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44051. this._targetGroup = e,
  44052. this._bindings = e.subscribe_(t, n)
  44053. }
  44054. ,
  44055. Ci.PropertyBinding.Composite.prototype = {
  44056. constructor: Ci.PropertyBinding.Composite,
  44057. getValue: function(e, t) {
  44058. this.bind();
  44059. var i = this._targetGroup.nCachedObjects_
  44060. , n = this._bindings[i];
  44061. void 0 !== n && n.getValue(e, t)
  44062. },
  44063. setValue: function(e, t) {
  44064. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44065. i[n].setValue(e, t)
  44066. },
  44067. bind: function() {
  44068. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44069. e[t].bind()
  44070. },
  44071. unbind: function() {
  44072. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44073. e[t].unbind()
  44074. }
  44075. },
  44076. Ci.PropertyBinding.create = function(e, t, i) {
  44077. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44078. }
  44079. ,
  44080. Ci.PropertyBinding.parseTrackName = function(e) {
  44081. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44082. , i = t.exec(e);
  44083. if (!i)
  44084. throw new Error("cannot parse trackName at all: " + e);
  44085. i.index === t.lastIndex && t.lastIndex++;
  44086. var n = {
  44087. nodeName: i[3],
  44088. objectName: i[5],
  44089. objectIndex: i[7],
  44090. propertyName: i[9],
  44091. propertyIndex: i[11]
  44092. };
  44093. if (null === n.propertyName || 0 === n.propertyName.length)
  44094. throw new Error("can not parse propertyName from trackName: " + e);
  44095. return n
  44096. }
  44097. ,
  44098. Ci.PropertyBinding.findNode = function(e, r) {
  44099. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44100. return e;
  44101. if (e.skeleton) {
  44102. var t = function(e) {
  44103. for (var t = 0; t < e.bones.length; t++) {
  44104. var i = e.bones[t];
  44105. if (i.name === r)
  44106. return i
  44107. }
  44108. return null
  44109. }(e.skeleton);
  44110. if (t)
  44111. return t
  44112. }
  44113. if (e.children) {
  44114. var o = function(e) {
  44115. for (var t = 0; t < e.length; t++) {
  44116. var i = e[t];
  44117. if (i.name === r || i.uuid === r)
  44118. return i;
  44119. var n = o(i.children);
  44120. if (n)
  44121. return n
  44122. }
  44123. return null
  44124. }
  44125. , i = o(e.children);
  44126. if (i)
  44127. return i
  44128. }
  44129. return null
  44130. }
  44131. ,
  44132. Ci.PropertyMixer = function(e, t, i) {
  44133. this.binding = e,
  44134. this.valueSize = i;
  44135. var n, r = Float64Array;
  44136. switch (t) {
  44137. case "quaternion":
  44138. n = this._slerp;
  44139. break;
  44140. case "string":
  44141. case "bool":
  44142. r = Array,
  44143. n = this._select;
  44144. break;
  44145. default:
  44146. n = this._lerp
  44147. }
  44148. this.buffer = new r(4 * i),
  44149. this._mixBufferRegion = n,
  44150. this.cumulativeWeight = 0,
  44151. this.useCount = 0,
  44152. this.referenceCount = 0
  44153. }
  44154. ,
  44155. Ci.PropertyMixer.prototype = {
  44156. constructor: Ci.PropertyMixer,
  44157. accumulate: function(e, t) {
  44158. var i = this.buffer
  44159. , n = this.valueSize
  44160. , r = e * n + n
  44161. , o = this.cumulativeWeight;
  44162. if (0 === o) {
  44163. for (var a = 0; a !== n; ++a)
  44164. i[r + a] = i[a];
  44165. o = t
  44166. } else {
  44167. var s = t / (o += t);
  44168. this._mixBufferRegion(i, r, 0, s, n)
  44169. }
  44170. this.cumulativeWeight = o
  44171. },
  44172. apply: function(e) {
  44173. var t = this.valueSize
  44174. , i = this.buffer
  44175. , n = e * t + t
  44176. , r = this.cumulativeWeight
  44177. , o = this.binding;
  44178. if (this.cumulativeWeight = 0,
  44179. r < 1) {
  44180. var a = 3 * t;
  44181. this._mixBufferRegion(i, n, a, 1 - r, t)
  44182. }
  44183. for (var s = t, l = t + t; s !== l; ++s)
  44184. if (i[s] !== i[s + t]) {
  44185. o.setValue(i, n);
  44186. break
  44187. }
  44188. },
  44189. saveOriginalState: function() {
  44190. var e = this.binding
  44191. , t = this.buffer
  44192. , i = this.valueSize
  44193. , n = 3 * i;
  44194. e.getValue(t, n);
  44195. for (var r = i, o = n; r !== o; ++r)
  44196. t[r] = t[n + r % i];
  44197. this.cumulativeWeight = 0
  44198. },
  44199. restoreOriginalState: function() {
  44200. var e = 3 * this.valueSize;
  44201. this.binding.setValue(this.buffer, e)
  44202. },
  44203. _select: function(e, t, i, n, r) {
  44204. if (.5 <= n)
  44205. for (var o = 0; o !== r; ++o)
  44206. e[t + o] = e[i + o]
  44207. },
  44208. _slerp: function(e, t, i, n, r) {
  44209. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44210. },
  44211. _lerp: function(e, t, i, n, r) {
  44212. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44213. var s = t + a;
  44214. e[s] = e[s] * o + e[i + a] * n
  44215. }
  44216. }
  44217. },
  44218. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44219. Ci.KeyframeTrack.call(this, e, t, i)
  44220. }
  44221. ,
  44222. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44223. constructor: Ci.BooleanKeyframeTrack,
  44224. ValueTypeName: "bool",
  44225. ValueBufferType: Array,
  44226. DefaultInterpolation: Ci.IntepolateDiscrete,
  44227. InterpolantFactoryMethodLinear: void 0,
  44228. InterpolantFactoryMethodSmooth: void 0
  44229. }),
  44230. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44231. Ci.KeyframeTrack.call(this, e, t, i, n)
  44232. }
  44233. ,
  44234. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44235. constructor: Ci.NumberKeyframeTrack,
  44236. ValueTypeName: "number"
  44237. }),
  44238. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44239. Ci.KeyframeTrack.call(this, e, t, i, n)
  44240. }
  44241. ,
  44242. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44243. constructor: Ci.QuaternionKeyframeTrack,
  44244. ValueTypeName: "quaternion",
  44245. DefaultInterpolation: Ci.InterpolateLinear,
  44246. InterpolantFactoryMethodLinear: function(e) {
  44247. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44248. },
  44249. InterpolantFactoryMethodSmooth: void 0
  44250. }),
  44251. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44252. Ci.KeyframeTrack.call(this, e, t, i, n)
  44253. }
  44254. ,
  44255. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44256. constructor: Ci.StringKeyframeTrack,
  44257. ValueTypeName: "string",
  44258. ValueBufferType: Array,
  44259. DefaultInterpolation: Ci.IntepolateDiscrete,
  44260. InterpolantFactoryMethodLinear: void 0,
  44261. InterpolantFactoryMethodSmooth: void 0
  44262. }),
  44263. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44264. Ci.KeyframeTrack.call(this, e, t, i, n)
  44265. }
  44266. ,
  44267. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44268. constructor: Ci.VectorKeyframeTrack,
  44269. ValueTypeName: "vector"
  44270. }),
  44271. Ci.Audio = function(e) {
  44272. Ci.Object3D.call(this),
  44273. this.type = "Audio",
  44274. this.context = e.context,
  44275. this.source = this.context.createBufferSource(),
  44276. this.source.onended = this.onEnded.bind(this),
  44277. this.gain = this.context.createGain(),
  44278. this.gain.connect(e.getInput()),
  44279. this.autoplay = !1,
  44280. this.startTime = 0,
  44281. this.playbackRate = 1,
  44282. this.isPlaying = !1,
  44283. this.hasPlaybackControl = !0,
  44284. this.sourceType = "empty",
  44285. this.filter = null
  44286. }
  44287. ,
  44288. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44289. Ci.Audio.prototype.constructor = Ci.Audio,
  44290. Ci.Audio.prototype.getOutput = function() {
  44291. return this.gain
  44292. }
  44293. ,
  44294. Ci.Audio.prototype.load = function(e) {
  44295. var t = new Ci.AudioBuffer(this.context);
  44296. return t.load(e),
  44297. this.setBuffer(t),
  44298. this
  44299. }
  44300. ,
  44301. Ci.Audio.prototype.setNodeSource = function(e) {
  44302. return this.hasPlaybackControl = !1,
  44303. this.sourceType = "audioNode",
  44304. this.source = e,
  44305. this.connect(),
  44306. this
  44307. }
  44308. ,
  44309. Ci.Audio.prototype.setBuffer = function(e) {
  44310. var t = this;
  44311. return e.onReady(function(e) {
  44312. t.source.buffer = e,
  44313. t.sourceType = "buffer",
  44314. t.autoplay && t.play()
  44315. }),
  44316. this
  44317. }
  44318. ,
  44319. Ci.Audio.prototype.play = function() {
  44320. if (!0 !== this.isPlaying)
  44321. if (!1 !== this.hasPlaybackControl) {
  44322. var e = this.context.createBufferSource();
  44323. e.buffer = this.source.buffer,
  44324. e.loop = this.source.loop,
  44325. e.onended = this.source.onended,
  44326. e.start(0, this.startTime),
  44327. e.playbackRate.value = this.playbackRate,
  44328. this.isPlaying = !0,
  44329. this.source = e,
  44330. this.connect()
  44331. } else
  44332. console.warn("THREE.Audio: this Audio has no playback control.");
  44333. else
  44334. console.warn("THREE.Audio: Audio is already playing.")
  44335. }
  44336. ,
  44337. Ci.Audio.prototype.pause = function() {
  44338. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44339. void (this.startTime = this.context.currentTime))
  44340. }
  44341. ,
  44342. Ci.Audio.prototype.stop = function() {
  44343. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44344. void (this.startTime = 0))
  44345. }
  44346. ,
  44347. Ci.Audio.prototype.connect = function() {
  44348. null !== this.filter ? (this.source.connect(this.filter),
  44349. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44350. }
  44351. ,
  44352. Ci.Audio.prototype.disconnect = function() {
  44353. null !== this.filter ? (this.source.disconnect(this.filter),
  44354. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44355. }
  44356. ,
  44357. Ci.Audio.prototype.getFilter = function() {
  44358. return this.filter
  44359. }
  44360. ,
  44361. Ci.Audio.prototype.setFilter = function(e) {
  44362. void 0 === e && (e = null),
  44363. !0 === this.isPlaying ? (this.disconnect(),
  44364. this.filter = e,
  44365. this.connect()) : this.filter = e
  44366. }
  44367. ,
  44368. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44369. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44370. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44371. }
  44372. ,
  44373. Ci.Audio.prototype.getPlaybackRate = function() {
  44374. return this.playbackRate
  44375. }
  44376. ,
  44377. Ci.Audio.prototype.onEnded = function() {
  44378. this.isPlaying = !1
  44379. }
  44380. ,
  44381. Ci.Audio.prototype.setLoop = function(e) {
  44382. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44383. }
  44384. ,
  44385. Ci.Audio.prototype.getLoop = function() {
  44386. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44387. !1) : this.source.loop
  44388. }
  44389. ,
  44390. Ci.Audio.prototype.setVolume = function(e) {
  44391. this.gain.gain.value = e
  44392. }
  44393. ,
  44394. Ci.Audio.prototype.getVolume = function() {
  44395. return this.gain.gain.value
  44396. }
  44397. ,
  44398. Ci.AudioAnalyser = function(e, t) {
  44399. this.analyser = e.context.createAnalyser(),
  44400. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44401. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44402. e.getOutput().connect(this.analyser)
  44403. }
  44404. ,
  44405. Ci.AudioAnalyser.prototype = {
  44406. constructor: Ci.AudioAnalyser,
  44407. getData: function() {
  44408. return this.analyser.getByteFrequencyData(this.data),
  44409. this.data
  44410. }
  44411. },
  44412. Ci.AudioBuffer = function(e) {
  44413. this.context = e,
  44414. this.ready = !1,
  44415. this.readyCallbacks = []
  44416. }
  44417. ,
  44418. Ci.AudioBuffer.prototype.load = function(e) {
  44419. var i = this
  44420. , t = new XMLHttpRequest;
  44421. return t.open("GET", e, !0),
  44422. t.responseType = "arraybuffer",
  44423. t.onload = function(e) {
  44424. i.context.decodeAudioData(this.response, function(e) {
  44425. i.buffer = e,
  44426. i.ready = !0;
  44427. for (var t = 0; t < i.readyCallbacks.length; t++)
  44428. i.readyCallbacks[t](i.buffer);
  44429. i.readyCallbacks = []
  44430. })
  44431. }
  44432. ,
  44433. t.send(),
  44434. this
  44435. }
  44436. ,
  44437. Ci.AudioBuffer.prototype.onReady = function(e) {
  44438. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44439. }
  44440. ,
  44441. Ci.PositionalAudio = function(e) {
  44442. Ci.Audio.call(this, e),
  44443. this.panner = this.context.createPanner(),
  44444. this.panner.connect(this.gain)
  44445. }
  44446. ,
  44447. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44448. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44449. Ci.PositionalAudio.prototype.getOutput = function() {
  44450. return this.panner
  44451. }
  44452. ,
  44453. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44454. this.panner.refDistance = e
  44455. }
  44456. ,
  44457. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44458. return this.panner.refDistance
  44459. }
  44460. ,
  44461. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44462. this.panner.rolloffFactor = e
  44463. }
  44464. ,
  44465. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44466. return this.panner.rolloffFactor
  44467. }
  44468. ,
  44469. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44470. this.panner.distanceModel = e
  44471. }
  44472. ,
  44473. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44474. return this.panner.distanceModel
  44475. }
  44476. ,
  44477. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44478. this.panner.maxDistance = e
  44479. }
  44480. ,
  44481. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44482. return this.panner.maxDistance
  44483. }
  44484. ,
  44485. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44486. function(e) {
  44487. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44488. it.setFromMatrixPosition(this.matrixWorld),
  44489. this.panner.setPosition(it.x, it.y, it.z)
  44490. }
  44491. ),
  44492. Ci.AudioListener = function() {
  44493. Ci.Object3D.call(this),
  44494. this.type = "AudioListener",
  44495. this.context = new (window.AudioContext || window.webkitAudioContext),
  44496. this.gain = this.context.createGain(),
  44497. this.gain.connect(this.context.destination),
  44498. this.filter = null
  44499. }
  44500. ,
  44501. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44502. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44503. Ci.AudioListener.prototype.getInput = function() {
  44504. return this.gain
  44505. }
  44506. ,
  44507. Ci.AudioListener.prototype.removeFilter = function() {
  44508. null !== this.filter && (this.gain.disconnect(this.filter),
  44509. this.filter.disconnect(this.context.destination),
  44510. this.gain.connect(this.context.destination),
  44511. this.filter = null)
  44512. }
  44513. ,
  44514. Ci.AudioListener.prototype.setFilter = function(e) {
  44515. null !== this.filter ? (this.gain.disconnect(this.filter),
  44516. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44517. this.filter = e,
  44518. this.gain.connect(this.filter),
  44519. this.filter.connect(this.context.destination)
  44520. }
  44521. ,
  44522. Ci.AudioListener.prototype.getFilter = function() {
  44523. return this.filter
  44524. }
  44525. ,
  44526. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44527. this.gain.gain.value = e
  44528. }
  44529. ,
  44530. Ci.AudioListener.prototype.getMasterVolume = function() {
  44531. return this.gain.gain.value
  44532. }
  44533. ,
  44534. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44535. $e = new Ci.Quaternion,
  44536. et = new Ci.Vector3,
  44537. tt = new Ci.Vector3,
  44538. function(e) {
  44539. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44540. var t = this.context.listener
  44541. , i = this.up;
  44542. this.matrixWorld.decompose(Je, $e, et),
  44543. tt.set(0, 0, -1).applyQuaternion($e),
  44544. t.setPosition(Je.x, Je.y, Je.z),
  44545. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44546. }
  44547. ),
  44548. Ci.Camera = function() {
  44549. Ci.Object3D.call(this),
  44550. this.type = "Camera",
  44551. this.matrixWorldInverse = new Ci.Matrix4,
  44552. this.projectionMatrix = new Ci.Matrix4
  44553. }
  44554. ,
  44555. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44556. Ci.Camera.prototype.constructor = Ci.Camera,
  44557. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44558. function(e) {
  44559. var t = e || new Ci.Vector3;
  44560. return this.getWorldQuaternion(Qe),
  44561. t.set(0, 0, -1).applyQuaternion(Qe)
  44562. }
  44563. ),
  44564. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44565. function(e) {
  44566. Ke.lookAt(this.position, e, this.up),
  44567. this.quaternion.setFromRotationMatrix(Ke)
  44568. }
  44569. ),
  44570. Ci.Camera.prototype.clone = function() {
  44571. return (new this.constructor).copy(this)
  44572. }
  44573. ,
  44574. Ci.Camera.prototype.copy = function(e) {
  44575. return Ci.Object3D.prototype.copy.call(this, e),
  44576. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44577. this.projectionMatrix.copy(e.projectionMatrix),
  44578. this
  44579. }
  44580. ,
  44581. Ci.CubeCamera = function(e, t, i) {
  44582. Ci.Object3D.call(this),
  44583. this.type = "CubeCamera";
  44584. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44585. r.up.set(0, -1, 0),
  44586. r.lookAt(new Ci.Vector3(1,0,0)),
  44587. this.add(r);
  44588. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44589. o.up.set(0, -1, 0),
  44590. o.lookAt(new Ci.Vector3(-1,0,0)),
  44591. this.add(o);
  44592. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44593. a.up.set(0, 0, 1),
  44594. a.lookAt(new Ci.Vector3(0,1,0)),
  44595. this.add(a);
  44596. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44597. s.up.set(0, 0, -1),
  44598. s.lookAt(new Ci.Vector3(0,-1,0)),
  44599. this.add(s);
  44600. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44601. l.up.set(0, -1, 0),
  44602. l.lookAt(new Ci.Vector3(0,0,1)),
  44603. this.add(l);
  44604. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44605. c.up.set(0, -1, 0),
  44606. c.lookAt(new Ci.Vector3(0,0,-1)),
  44607. this.add(c);
  44608. var n = {
  44609. format: Ci.RGBFormat,
  44610. magFilter: Ci.LinearFilter,
  44611. minFilter: Ci.LinearFilter
  44612. };
  44613. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44614. this.updateCubeMap = function(e, t) {
  44615. null === this.parent && this.updateMatrixWorld();
  44616. var i = this.renderTarget
  44617. , n = i.texture.generateMipmaps;
  44618. i.texture.generateMipmaps = !1,
  44619. i.activeCubeFace = 0,
  44620. e.render(t, r, i),
  44621. i.activeCubeFace = 1,
  44622. e.render(t, o, i),
  44623. i.activeCubeFace = 2,
  44624. e.render(t, a, i),
  44625. i.activeCubeFace = 3,
  44626. e.render(t, s, i),
  44627. i.activeCubeFace = 4,
  44628. e.render(t, l, i),
  44629. i.texture.generateMipmaps = n,
  44630. i.activeCubeFace = 5,
  44631. e.render(t, c, i),
  44632. e.setRenderTarget(null)
  44633. }
  44634. }
  44635. ,
  44636. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44637. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44638. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44639. Ci.Camera.call(this),
  44640. this.type = "OrthographicCamera",
  44641. this.zoom = 1,
  44642. this.left = e,
  44643. this.right = t,
  44644. this.top = i,
  44645. this.bottom = n,
  44646. this.near = void 0 !== r ? r : .1,
  44647. this.far = void 0 !== o ? o : 2e3,
  44648. this.updateProjectionMatrix()
  44649. }
  44650. ,
  44651. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44652. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44653. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44654. var e = (this.right - this.left) / (2 * this.zoom)
  44655. , t = (this.top - this.bottom) / (2 * this.zoom)
  44656. , i = (this.right + this.left) / 2
  44657. , n = (this.top + this.bottom) / 2;
  44658. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44659. }
  44660. ,
  44661. Ci.OrthographicCamera.prototype.copy = function(e) {
  44662. return Ci.Camera.prototype.copy.call(this, e),
  44663. this.left = e.left,
  44664. this.right = e.right,
  44665. this.top = e.top,
  44666. this.bottom = e.bottom,
  44667. this.near = e.near,
  44668. this.far = e.far,
  44669. this.zoom = e.zoom,
  44670. this
  44671. }
  44672. ,
  44673. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44674. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44675. return t.object.zoom = this.zoom,
  44676. t.object.left = this.left,
  44677. t.object.right = this.right,
  44678. t.object.top = this.top,
  44679. t.object.bottom = this.bottom,
  44680. t.object.near = this.near,
  44681. t.object.far = this.far,
  44682. t
  44683. }
  44684. ,
  44685. Ci.PerspectiveCamera = function(e, t, i, n) {
  44686. Ci.Camera.call(this),
  44687. this.type = "PerspectiveCamera",
  44688. this.focalLength = 10,
  44689. this.zoom = 1,
  44690. this.fov = void 0 !== e ? e : 50,
  44691. this.aspect = void 0 !== t ? t : 1,
  44692. this.near = void 0 !== i ? i : .1,
  44693. this.far = void 0 !== n ? n : 2e3,
  44694. this.updateProjectionMatrix()
  44695. }
  44696. ,
  44697. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44698. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44699. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44700. void 0 === t && (t = 24),
  44701. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44702. this.updateProjectionMatrix()
  44703. }
  44704. ,
  44705. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44706. this.fullWidth = e,
  44707. this.fullHeight = t,
  44708. this.x = i,
  44709. this.y = n,
  44710. this.width = r,
  44711. this.height = o,
  44712. this.updateProjectionMatrix()
  44713. }
  44714. ,
  44715. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44716. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44717. if (this.fullWidth) {
  44718. var t = this.fullWidth / this.fullHeight
  44719. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44720. , n = -i
  44721. , r = t * n
  44722. , o = t * i
  44723. , a = Math.abs(o - r)
  44724. , s = Math.abs(i - n);
  44725. 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)
  44726. } else
  44727. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44728. }
  44729. ,
  44730. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44731. return Ci.Camera.prototype.copy.call(this, e),
  44732. this.focalLength = e.focalLength,
  44733. this.zoom = e.zoom,
  44734. this.fov = e.fov,
  44735. this.aspect = e.aspect,
  44736. this.near = e.near,
  44737. this.far = e.far,
  44738. this
  44739. }
  44740. ,
  44741. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44742. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44743. return t.object.focalLength = this.focalLength,
  44744. t.object.zoom = this.zoom,
  44745. t.object.fov = this.fov,
  44746. t.object.aspect = this.aspect,
  44747. t.object.near = this.near,
  44748. t.object.far = this.far,
  44749. t
  44750. }
  44751. ,
  44752. Ci.StereoCamera = function() {
  44753. this.type = "StereoCamera",
  44754. this.aspect = 1,
  44755. this.cameraL = new Ci.PerspectiveCamera,
  44756. this.cameraL.layers.enable(1),
  44757. this.cameraL.matrixAutoUpdate = !1,
  44758. this.cameraR = new Ci.PerspectiveCamera,
  44759. this.cameraR.layers.enable(2),
  44760. this.cameraR.matrixAutoUpdate = !1
  44761. }
  44762. ,
  44763. Ci.StereoCamera.prototype = {
  44764. constructor: Ci.StereoCamera,
  44765. update: (Xe = new Ci.Matrix4,
  44766. Ze = new Ci.Matrix4,
  44767. function(e) {
  44768. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44769. Ge = e.focalLength,
  44770. We = e.fov,
  44771. je = e.aspect * this.aspect,
  44772. Ye = e.near,
  44773. qe = e.far;
  44774. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44775. Ze.elements[12] = -.032,
  44776. Xe.elements[12] = .032,
  44777. t = -o * je + r,
  44778. i = o * je + r,
  44779. n.elements[0] = 2 * Ye / (i - t),
  44780. n.elements[8] = (i + t) / (i - t),
  44781. this.cameraL.projectionMatrix.copy(n),
  44782. t = -o * je - r,
  44783. i = o * je - r,
  44784. n.elements[0] = 2 * Ye / (i - t),
  44785. n.elements[8] = (i + t) / (i - t),
  44786. this.cameraR.projectionMatrix.copy(n)
  44787. }
  44788. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44789. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44790. }
  44791. )
  44792. },
  44793. Ci.Light = function(e, t) {
  44794. Ci.Object3D.call(this),
  44795. this.type = "Light",
  44796. this.color = new Ci.Color(e),
  44797. this.intensity = void 0 !== t ? t : 1,
  44798. this.receiveShadow = void 0
  44799. }
  44800. ,
  44801. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44802. Ci.Light.prototype.constructor = Ci.Light,
  44803. Ci.Light.prototype.copy = function(e) {
  44804. return Ci.Object3D.prototype.copy.call(this, e),
  44805. this.color.copy(e.color),
  44806. this.intensity = e.intensity,
  44807. this
  44808. }
  44809. ,
  44810. Ci.Light.prototype.toJSON = function(e) {
  44811. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44812. return t.object.color = this.color.getHex(),
  44813. t.object.intensity = this.intensity,
  44814. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44815. void 0 !== this.distance && (t.object.distance = this.distance),
  44816. void 0 !== this.angle && (t.object.angle = this.angle),
  44817. void 0 !== this.decay && (t.object.decay = this.decay),
  44818. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44819. t
  44820. }
  44821. ,
  44822. Ci.LightShadow = function(e) {
  44823. this.camera = e,
  44824. this.bias = 0,
  44825. this.radius = 1,
  44826. this.mapSize = new Ci.Vector2(512,512),
  44827. this.map = null,
  44828. this.matrix = new Ci.Matrix4
  44829. }
  44830. ,
  44831. Ci.LightShadow.prototype = {
  44832. constructor: Ci.LightShadow,
  44833. copy: function(e) {
  44834. return this.camera = e.camera.clone(),
  44835. this.bias = e.bias,
  44836. this.radius = e.radius,
  44837. this.mapSize.copy(e.mapSize),
  44838. this
  44839. },
  44840. clone: function() {
  44841. return (new this.constructor).copy(this)
  44842. }
  44843. },
  44844. Ci.AmbientLight = function(e, t) {
  44845. Ci.Light.call(this, e, t),
  44846. this.type = "AmbientLight",
  44847. this.castShadow = void 0
  44848. }
  44849. ,
  44850. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44851. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44852. Ci.DirectionalLight = function(e, t) {
  44853. Ci.Light.call(this, e, t),
  44854. this.type = "DirectionalLight",
  44855. this.position.set(0, 1, 0),
  44856. this.updateMatrix(),
  44857. this.target = new Ci.Object3D,
  44858. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44859. }
  44860. ,
  44861. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44862. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44863. Ci.DirectionalLight.prototype.copy = function(e) {
  44864. return Ci.Light.prototype.copy.call(this, e),
  44865. this.target = e.target.clone(),
  44866. this.shadow = e.shadow.clone(),
  44867. this
  44868. }
  44869. ,
  44870. Ci.HemisphereLight = function(e, t, i) {
  44871. Ci.Light.call(this, e, i),
  44872. this.type = "HemisphereLight",
  44873. this.castShadow = void 0,
  44874. this.position.set(0, 1, 0),
  44875. this.updateMatrix(),
  44876. this.groundColor = new Ci.Color(t)
  44877. }
  44878. ,
  44879. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44880. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44881. Ci.HemisphereLight.prototype.copy = function(e) {
  44882. return Ci.Light.prototype.copy.call(this, e),
  44883. this.groundColor.copy(e.groundColor),
  44884. this
  44885. }
  44886. ,
  44887. Ci.PointLight = function(e, t, i, n) {
  44888. Ci.Light.call(this, e, t),
  44889. this.type = "PointLight",
  44890. this.distance = void 0 !== i ? i : 0,
  44891. this.decay = void 0 !== n ? n : 1,
  44892. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44893. }
  44894. ,
  44895. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44896. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44897. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44898. get: function() {
  44899. return 4 * this.intensity * Math.PI
  44900. },
  44901. set: function(e) {
  44902. this.intensity = e / (4 * Math.PI)
  44903. }
  44904. }),
  44905. Ci.PointLight.prototype.copy = function(e) {
  44906. return Ci.Light.prototype.copy.call(this, e),
  44907. this.distance = e.distance,
  44908. this.decay = e.decay,
  44909. this.shadow = e.shadow.clone(),
  44910. this
  44911. }
  44912. ,
  44913. Ci.SpotLight = function(e, t, i, n, r, o) {
  44914. Ci.Light.call(this, e, t),
  44915. this.type = "SpotLight",
  44916. this.position.set(0, 1, 0),
  44917. this.updateMatrix(),
  44918. this.target = new Ci.Object3D,
  44919. this.distance = void 0 !== i ? i : 0,
  44920. this.angle = void 0 !== n ? n : Math.PI / 3,
  44921. this.penumbra = void 0 !== r ? r : 0,
  44922. this.decay = void 0 !== o ? o : 1,
  44923. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44924. }
  44925. ,
  44926. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44927. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44928. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44929. get: function() {
  44930. return this.intensity * Math.PI
  44931. },
  44932. set: function(e) {
  44933. this.intensity = e / Math.PI
  44934. }
  44935. }),
  44936. Ci.SpotLight.prototype.copy = function(e) {
  44937. return Ci.Light.prototype.copy.call(this, e),
  44938. this.distance = e.distance,
  44939. this.angle = e.angle,
  44940. this.penumbra = e.penumbra,
  44941. this.decay = e.decay,
  44942. this.target = e.target.clone(),
  44943. this.shadow = e.shadow.clone(),
  44944. this
  44945. }
  44946. ,
  44947. Ci.Cache = {
  44948. enabled: !1,
  44949. files: {},
  44950. add: function(e, t) {
  44951. !1 !== this.enabled && (this.files[e] = t)
  44952. },
  44953. get: function(e) {
  44954. if (!1 !== this.enabled)
  44955. return this.files[e]
  44956. },
  44957. remove: function(e) {
  44958. delete this.files[e]
  44959. },
  44960. clear: function() {
  44961. this.files = {}
  44962. }
  44963. },
  44964. Ci.Loader = function() {
  44965. this.onLoadStart = function() {}
  44966. ,
  44967. this.onLoadProgress = function() {}
  44968. ,
  44969. this.onLoadComplete = function() {}
  44970. }
  44971. ,
  44972. Ci.Loader.prototype = {
  44973. constructor: Ci.Loader,
  44974. crossOrigin: void 0,
  44975. extractUrlBase: function(e) {
  44976. var t = e.split("/");
  44977. return 1 === t.length ? "./" : (t.pop(),
  44978. t.join("/") + "/")
  44979. },
  44980. initMaterials: function(e, t, i) {
  44981. for (var n = [], r = 0; r < e.length; ++r)
  44982. n[r] = this.createMaterial(e[r], t, i);
  44983. return n
  44984. },
  44985. createMaterial: function(e, c, h) {
  44986. function t(e, t, i, n, r) {
  44987. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44988. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44989. He.load(a)),
  44990. void 0 !== t && (o.repeat.fromArray(t),
  44991. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44992. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44993. void 0 !== i && o.offset.fromArray(i),
  44994. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44995. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44996. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44997. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44998. void 0 !== r && (o.anisotropy = r);
  44999. var l = Ci.Math.generateUUID();
  45000. return u[l] = o,
  45001. l
  45002. }
  45003. void 0 === Ue && (Ue = new Ci.Color),
  45004. void 0 === He && (He = new Ci.TextureLoader),
  45005. void 0 === ze && (ze = new Ci.MaterialLoader);
  45006. var u = {}
  45007. , i = {
  45008. uuid: Ci.Math.generateUUID(),
  45009. type: "MeshLambertMaterial"
  45010. };
  45011. for (var n in e) {
  45012. var r = e[n];
  45013. switch (n) {
  45014. case "DbgColor":
  45015. case "DbgIndex":
  45016. case "opticalDensity":
  45017. case "illumination":
  45018. break;
  45019. case "DbgName":
  45020. i.name = r;
  45021. break;
  45022. case "blending":
  45023. i.blending = Ci[r];
  45024. break;
  45025. case "colorAmbient":
  45026. case "mapAmbient":
  45027. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45028. break;
  45029. case "colorDiffuse":
  45030. i.color = Ue.fromArray(r).getHex();
  45031. break;
  45032. case "colorSpecular":
  45033. i.specular = Ue.fromArray(r).getHex();
  45034. break;
  45035. case "colorEmissive":
  45036. i.emissive = Ue.fromArray(r).getHex();
  45037. break;
  45038. case "specularCoef":
  45039. i.shininess = r;
  45040. break;
  45041. case "shading":
  45042. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45043. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45044. break;
  45045. case "mapDiffuse":
  45046. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45047. break;
  45048. case "mapDiffuseRepeat":
  45049. case "mapDiffuseOffset":
  45050. case "mapDiffuseWrap":
  45051. case "mapDiffuseAnisotropy":
  45052. break;
  45053. case "mapLight":
  45054. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45055. break;
  45056. case "mapLightRepeat":
  45057. case "mapLightOffset":
  45058. case "mapLightWrap":
  45059. case "mapLightAnisotropy":
  45060. break;
  45061. case "mapAO":
  45062. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45063. break;
  45064. case "mapAORepeat":
  45065. case "mapAOOffset":
  45066. case "mapAOWrap":
  45067. case "mapAOAnisotropy":
  45068. break;
  45069. case "mapBump":
  45070. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45071. break;
  45072. case "mapBumpScale":
  45073. i.bumpScale = r;
  45074. break;
  45075. case "mapBumpRepeat":
  45076. case "mapBumpOffset":
  45077. case "mapBumpWrap":
  45078. case "mapBumpAnisotropy":
  45079. break;
  45080. case "mapNormal":
  45081. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45082. break;
  45083. case "mapNormalFactor":
  45084. i.normalScale = [r, r];
  45085. break;
  45086. case "mapNormalRepeat":
  45087. case "mapNormalOffset":
  45088. case "mapNormalWrap":
  45089. case "mapNormalAnisotropy":
  45090. break;
  45091. case "mapSpecular":
  45092. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45093. break;
  45094. case "mapSpecularRepeat":
  45095. case "mapSpecularOffset":
  45096. case "mapSpecularWrap":
  45097. case "mapSpecularAnisotropy":
  45098. break;
  45099. case "mapAlpha":
  45100. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45101. break;
  45102. case "mapAlphaRepeat":
  45103. case "mapAlphaOffset":
  45104. case "mapAlphaWrap":
  45105. case "mapAlphaAnisotropy":
  45106. break;
  45107. case "flipSided":
  45108. i.side = Ci.BackSide;
  45109. break;
  45110. case "doubleSided":
  45111. i.side = Ci.DoubleSide;
  45112. break;
  45113. case "transparency":
  45114. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45115. i.opacity = r;
  45116. break;
  45117. case "depthTest":
  45118. case "depthWrite":
  45119. case "colorWrite":
  45120. case "opacity":
  45121. case "reflectivity":
  45122. case "transparent":
  45123. case "visible":
  45124. case "wireframe":
  45125. i[n] = r;
  45126. break;
  45127. case "vertexColors":
  45128. !0 === r && (i.vertexColors = Ci.VertexColors),
  45129. "face" === r && (i.vertexColors = Ci.FaceColors);
  45130. break;
  45131. default:
  45132. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45133. }
  45134. }
  45135. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45136. "MeshPhongMaterial" !== i.type && delete i.specular,
  45137. i.opacity < 1 && (i.transparent = !0),
  45138. ze.setTextures(u),
  45139. ze.parse(i)
  45140. }
  45141. },
  45142. Ci.Loader.Handlers = {
  45143. handlers: [],
  45144. add: function(e, t) {
  45145. this.handlers.push(e, t)
  45146. },
  45147. get: function(e) {
  45148. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45149. var r = t[i]
  45150. , o = t[i + 1];
  45151. if (r.test(e))
  45152. return o
  45153. }
  45154. return null
  45155. }
  45156. },
  45157. Ci.XHRLoader = function(e) {
  45158. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45159. }
  45160. ,
  45161. Ci.XHRLoader.prototype = {
  45162. constructor: Ci.XHRLoader,
  45163. load: function(i, n, t, r) {
  45164. void 0 !== this.path && (i = this.path + i);
  45165. var o = this
  45166. , e = Ci.Cache.get(i);
  45167. if (void 0 !== e)
  45168. return n && setTimeout(function() {
  45169. n(e)
  45170. }, 0),
  45171. e;
  45172. var a = new XMLHttpRequest;
  45173. return a.overrideMimeType("text/plain"),
  45174. a.open("GET", i, !0),
  45175. a.addEventListener("load", function(e) {
  45176. var t = e.target.response;
  45177. Ci.Cache.add(i, t),
  45178. 200 === this.status ? (n && n(t),
  45179. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45180. n && n(t),
  45181. o.manager.itemEnd(i)) : (r && r(e),
  45182. o.manager.itemError(i))
  45183. }, !1),
  45184. void 0 !== t && a.addEventListener("progress", function(e) {
  45185. t(e)
  45186. }, !1),
  45187. a.addEventListener("error", function(e) {
  45188. r && r(e),
  45189. o.manager.itemError(i)
  45190. }, !1),
  45191. void 0 !== this.responseType && (a.responseType = this.responseType),
  45192. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45193. a.send(null),
  45194. o.manager.itemStart(i),
  45195. a
  45196. },
  45197. setPath: function(e) {
  45198. this.path = e
  45199. },
  45200. setResponseType: function(e) {
  45201. this.responseType = e
  45202. },
  45203. setWithCredentials: function(e) {
  45204. this.withCredentials = e
  45205. }
  45206. },
  45207. Ci.FontLoader = function(e) {
  45208. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45209. }
  45210. ,
  45211. Ci.FontLoader.prototype = {
  45212. constructor: Ci.FontLoader,
  45213. load: function(e, t, i, n) {
  45214. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45215. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45216. }, i, n)
  45217. }
  45218. },
  45219. Ci.ImageLoader = function(e) {
  45220. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45221. }
  45222. ,
  45223. Ci.ImageLoader.prototype = {
  45224. constructor: Ci.ImageLoader,
  45225. load: function(t, i, n, r) {
  45226. void 0 !== this.path && (t = this.path + t);
  45227. var o = this
  45228. , e = Ci.Cache.get(t);
  45229. if (void 0 !== e)
  45230. return o.manager.itemStart(t),
  45231. i ? setTimeout(function() {
  45232. i(e),
  45233. o.manager.itemEnd(t)
  45234. }, 0) : o.manager.itemEnd(t),
  45235. e;
  45236. var a = document.createElement("img");
  45237. return a.addEventListener("load", function(e) {
  45238. Ci.Cache.add(t, this),
  45239. i && i(this),
  45240. o.manager.itemEnd(t)
  45241. }, !1),
  45242. void 0 !== n && a.addEventListener("progress", function(e) {
  45243. n(e)
  45244. }, !1),
  45245. a.addEventListener("error", function(e) {
  45246. r && r(e),
  45247. o.manager.itemError(t)
  45248. }, !1),
  45249. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45250. o.manager.itemStart(t),
  45251. a.src = t,
  45252. a
  45253. },
  45254. setCrossOrigin: function(e) {
  45255. this.crossOrigin = e
  45256. },
  45257. setPath: function(e) {
  45258. this.path = e
  45259. }
  45260. },
  45261. Ci.JSONLoader = function(e) {
  45262. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45263. e = void 0),
  45264. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45265. this.withCredentials = !1
  45266. }
  45267. ,
  45268. Ci.JSONLoader.prototype = {
  45269. constructor: Ci.JSONLoader,
  45270. get statusDomElement() {
  45271. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45272. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45273. this._statusDomElement
  45274. },
  45275. load: function(o, a, e, t) {
  45276. var s = this
  45277. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45278. , i = new Ci.XHRLoader(this.manager);
  45279. i.setWithCredentials(this.withCredentials),
  45280. i.load(o, function(e) {
  45281. var t = JSON.parse(e)
  45282. , i = t.metadata;
  45283. if (void 0 !== i) {
  45284. var n = i.type;
  45285. if (void 0 !== n) {
  45286. if ("object" === n.toLowerCase())
  45287. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45288. if ("scene" === n.toLowerCase())
  45289. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45290. }
  45291. }
  45292. var r = s.parse(t, l);
  45293. a(r.geometry, r.materials)
  45294. }, e, t)
  45295. },
  45296. setTexturePath: function(e) {
  45297. this.texturePath = e
  45298. },
  45299. parse: function(D, e) {
  45300. var N = new Ci.Geometry
  45301. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45302. if (function(e) {
  45303. function t(e, t) {
  45304. return e & 1 << t
  45305. }
  45306. 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;
  45307. if (void 0 !== D.uvs) {
  45308. for (i = 0; i < D.uvs.length; i++)
  45309. D.uvs[i].length && L++;
  45310. for (i = 0; i < L; i++)
  45311. N.faceVertexUvs[i] = []
  45312. }
  45313. for (o = 0,
  45314. a = R.length; o < a; )
  45315. (A = new Ci.Vector3).x = R[o++] * e,
  45316. A.y = R[o++] * e,
  45317. A.z = R[o++] * e,
  45318. N.vertices.push(A);
  45319. for (o = 0,
  45320. a = M.length; o < a; )
  45321. if (d = t(u = M[o++], 0),
  45322. p = t(u, 1),
  45323. f = t(u, 3),
  45324. g = t(u, 4),
  45325. m = t(u, 5),
  45326. v = t(u, 6),
  45327. y = t(u, 7),
  45328. d) {
  45329. if ((I = new Ci.Face3).a = M[o],
  45330. I.b = M[o + 1],
  45331. I.c = M[o + 3],
  45332. (E = new Ci.Face3).a = M[o + 1],
  45333. E.b = M[o + 2],
  45334. E.c = M[o + 3],
  45335. o += 4,
  45336. p && (h = M[o++],
  45337. I.materialIndex = h,
  45338. E.materialIndex = h),
  45339. r = N.faces.length,
  45340. f)
  45341. for (i = 0; i < L; i++)
  45342. for (w = D.uvs[i],
  45343. N.faceVertexUvs[i][r] = [],
  45344. N.faceVertexUvs[i][r + 1] = [],
  45345. n = 0; n < 4; n++)
  45346. x = w[2 * (c = M[o++])],
  45347. S = w[2 * c + 1],
  45348. T = new Ci.Vector2(x,S),
  45349. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45350. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45351. if (g && (l = 3 * M[o++],
  45352. I.normal.set(P[l++], P[l++], P[l]),
  45353. E.normal.copy(I.normal)),
  45354. m)
  45355. for (i = 0; i < 4; i++)
  45356. l = 3 * M[o++],
  45357. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45358. 2 !== i && I.vertexNormals.push(b),
  45359. 0 !== i && E.vertexNormals.push(b);
  45360. if (v && (_ = O[s = M[o++]],
  45361. I.color.setHex(_),
  45362. E.color.setHex(_)),
  45363. y)
  45364. for (i = 0; i < 4; i++)
  45365. _ = O[s = M[o++]],
  45366. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45367. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45368. N.faces.push(I),
  45369. N.faces.push(E)
  45370. } else {
  45371. if ((C = new Ci.Face3).a = M[o++],
  45372. C.b = M[o++],
  45373. C.c = M[o++],
  45374. p && (h = M[o++],
  45375. C.materialIndex = h),
  45376. r = N.faces.length,
  45377. f)
  45378. for (i = 0; i < L; i++)
  45379. for (w = D.uvs[i],
  45380. N.faceVertexUvs[i][r] = [],
  45381. n = 0; n < 3; n++)
  45382. x = w[2 * (c = M[o++])],
  45383. S = w[2 * c + 1],
  45384. T = new Ci.Vector2(x,S),
  45385. N.faceVertexUvs[i][r].push(T);
  45386. if (g && (l = 3 * M[o++],
  45387. C.normal.set(P[l++], P[l++], P[l])),
  45388. m)
  45389. for (i = 0; i < 3; i++)
  45390. l = 3 * M[o++],
  45391. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45392. C.vertexNormals.push(b);
  45393. if (v && (s = M[o++],
  45394. C.color.setHex(O[s])),
  45395. y)
  45396. for (i = 0; i < 3; i++)
  45397. s = M[o++],
  45398. C.vertexColors.push(new Ci.Color(O[s]));
  45399. N.faces.push(C)
  45400. }
  45401. }(t),
  45402. function() {
  45403. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45404. if (D.skinWeights)
  45405. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45406. var n = D.skinWeights[t]
  45407. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45408. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45409. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45410. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45411. }
  45412. if (D.skinIndices)
  45413. for (t = 0,
  45414. i = D.skinIndices.length; t < i; t += e) {
  45415. var s = D.skinIndices[t]
  45416. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45417. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45418. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45419. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45420. }
  45421. N.bones = D.bones,
  45422. 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.")
  45423. }(),
  45424. function(e) {
  45425. if (void 0 !== D.morphTargets)
  45426. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45427. N.morphTargets[t] = {},
  45428. N.morphTargets[t].name = D.morphTargets[t].name,
  45429. N.morphTargets[t].vertices = [];
  45430. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45431. var s = new Ci.Vector3;
  45432. s.x = r[o] * e,
  45433. s.y = r[o + 1] * e,
  45434. s.z = r[o + 2] * e,
  45435. n.push(s)
  45436. }
  45437. }
  45438. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45439. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45440. var l = N.faces
  45441. , c = D.morphColors[0].colors;
  45442. for (t = 0,
  45443. i = l.length; t < i; t++)
  45444. l[t].color.fromArray(c, 3 * t)
  45445. }
  45446. }(t),
  45447. function() {
  45448. var e = []
  45449. , t = [];
  45450. void 0 !== D.animation && t.push(D.animation),
  45451. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45452. for (var i = 0; i < t.length; i++) {
  45453. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45454. n && e.push(n)
  45455. }
  45456. if (N.morphTargets) {
  45457. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45458. e = e.concat(r)
  45459. }
  45460. 0 < e.length && (N.animations = e)
  45461. }(),
  45462. N.computeFaceNormals(),
  45463. N.computeBoundingSphere(),
  45464. void 0 === D.materials || 0 === D.materials.length)
  45465. return {
  45466. geometry: N
  45467. };
  45468. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45469. return {
  45470. geometry: N,
  45471. materials: i
  45472. }
  45473. }
  45474. },
  45475. Ci.LoadingManager = function(e, t, i) {
  45476. var n = this
  45477. , r = !1
  45478. , o = 0
  45479. , a = 0;
  45480. this.onStart = void 0,
  45481. this.onLoad = e,
  45482. this.onProgress = t,
  45483. this.onError = i,
  45484. this.itemStart = function(e) {
  45485. a++,
  45486. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45487. r = !0
  45488. }
  45489. ,
  45490. this.itemEnd = function(e) {
  45491. o++,
  45492. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45493. o === a && (r = !1,
  45494. void 0 !== n.onLoad && n.onLoad())
  45495. }
  45496. ,
  45497. this.itemError = function(e) {
  45498. void 0 !== n.onError && n.onError(e)
  45499. }
  45500. }
  45501. ,
  45502. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45503. Ci.BufferGeometryLoader = function(e) {
  45504. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45505. }
  45506. ,
  45507. Ci.BufferGeometryLoader.prototype = {
  45508. constructor: Ci.BufferGeometryLoader,
  45509. load: function(e, t, i, n) {
  45510. var r = this;
  45511. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45512. t(r.parse(JSON.parse(e)))
  45513. }, i, n)
  45514. },
  45515. parse: function(e) {
  45516. var t = new Ci.BufferGeometry
  45517. , i = e.data.index
  45518. , n = {
  45519. Int8Array: Int8Array,
  45520. Uint8Array: Uint8Array,
  45521. Uint8ClampedArray: Uint8ClampedArray,
  45522. Int16Array: Int16Array,
  45523. Uint16Array: Uint16Array,
  45524. Int32Array: Int32Array,
  45525. Uint32Array: Uint32Array,
  45526. Float32Array: Float32Array,
  45527. Float64Array: Float64Array
  45528. };
  45529. if (void 0 !== i) {
  45530. var r = new n[i.type](i.array);
  45531. t.setIndex(new Ci.BufferAttribute(r,1))
  45532. }
  45533. var o = e.data.attributes;
  45534. for (var a in o) {
  45535. var s = o[a];
  45536. r = new n[s.type](s.array);
  45537. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45538. }
  45539. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45540. if (void 0 !== l)
  45541. for (var c = 0, h = l.length; c !== h; ++c) {
  45542. var u = l[c];
  45543. t.addGroup(u.start, u.count, u.materialIndex)
  45544. }
  45545. var d = e.data.boundingSphere;
  45546. if (void 0 !== d) {
  45547. var p = new Ci.Vector3;
  45548. void 0 !== d.center && p.fromArray(d.center),
  45549. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45550. }
  45551. return t
  45552. }
  45553. },
  45554. Ci.MaterialLoader = function(e) {
  45555. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45556. this.textures = {}
  45557. }
  45558. ,
  45559. Ci.MaterialLoader.prototype = {
  45560. constructor: Ci.MaterialLoader,
  45561. load: function(e, t, i, n) {
  45562. var r = this;
  45563. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45564. t(r.parse(JSON.parse(e)))
  45565. }, i, n)
  45566. },
  45567. setTextures: function(e) {
  45568. this.textures = e
  45569. },
  45570. getTexture: function(e) {
  45571. var t = this.textures;
  45572. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45573. t[e]
  45574. },
  45575. parse: function(e) {
  45576. var t = new Ci[e.type];
  45577. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45578. void 0 !== e.name && (t.name = e.name),
  45579. void 0 !== e.color && t.color.setHex(e.color),
  45580. void 0 !== e.roughness && (t.roughness = e.roughness),
  45581. void 0 !== e.metalness && (t.metalness = e.metalness),
  45582. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45583. void 0 !== e.specular && t.specular.setHex(e.specular),
  45584. void 0 !== e.shininess && (t.shininess = e.shininess),
  45585. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45586. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45587. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45588. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45589. void 0 !== e.shading && (t.shading = e.shading),
  45590. void 0 !== e.blending && (t.blending = e.blending),
  45591. void 0 !== e.side && (t.side = e.side),
  45592. void 0 !== e.opacity && (t.opacity = e.opacity),
  45593. void 0 !== e.transparent && (t.transparent = e.transparent),
  45594. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45595. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45596. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45597. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45598. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45599. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45600. void 0 !== e.size && (t.size = e.size),
  45601. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45602. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45603. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45604. t.transparent = !0),
  45605. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45606. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45607. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45608. void 0 !== e.normalScale) {
  45609. var i = e.normalScale;
  45610. !1 === Array.isArray(i) && (i = [i, i]),
  45611. t.normalScale = (new Ci.Vector2).fromArray(i)
  45612. }
  45613. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45614. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45615. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45616. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45617. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45618. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45619. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45620. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45621. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45622. t.combine = Ci.MultiplyOperation),
  45623. e.reflectivity && (t.reflectivity = e.reflectivity),
  45624. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45625. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45626. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45627. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45628. void 0 !== e.materials)
  45629. for (var n = 0, r = e.materials.length; n < r; n++)
  45630. t.materials.push(this.parse(e.materials[n]));
  45631. return t
  45632. }
  45633. },
  45634. Ci.ObjectLoader = function(e) {
  45635. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45636. this.texturePath = ""
  45637. }
  45638. ,
  45639. Ci.ObjectLoader.prototype = {
  45640. constructor: Ci.ObjectLoader,
  45641. load: function(e, t, i, n) {
  45642. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45643. var r = this;
  45644. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45645. r.parse(JSON.parse(e), t)
  45646. }, i, n)
  45647. },
  45648. setTexturePath: function(e) {
  45649. this.texturePath = e
  45650. },
  45651. setCrossOrigin: function(e) {
  45652. this.crossOrigin = e
  45653. },
  45654. parse: function(e, t) {
  45655. var i = this.parseGeometries(e.geometries)
  45656. , n = this.parseImages(e.images, function() {
  45657. void 0 !== t && t(a)
  45658. })
  45659. , r = this.parseTextures(e.textures, n)
  45660. , o = this.parseMaterials(e.materials, r)
  45661. , a = this.parseObject(e.object, i, o);
  45662. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45663. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45664. a
  45665. },
  45666. parseGeometries: function(e) {
  45667. var t = {};
  45668. if (void 0 !== e)
  45669. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45670. var a, s = e[r];
  45671. switch (s.type) {
  45672. case "PlaneGeometry":
  45673. case "PlaneBufferGeometry":
  45674. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45675. break;
  45676. case "BoxGeometry":
  45677. case "BoxBufferGeometry":
  45678. case "CubeGeometry":
  45679. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45680. break;
  45681. case "CircleGeometry":
  45682. case "CircleBufferGeometry":
  45683. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45684. break;
  45685. case "CylinderGeometry":
  45686. case "CylinderBufferGeometry":
  45687. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45688. break;
  45689. case "SphereGeometry":
  45690. case "SphereBufferGeometry":
  45691. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45692. break;
  45693. case "DodecahedronGeometry":
  45694. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45695. break;
  45696. case "IcosahedronGeometry":
  45697. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45698. break;
  45699. case "OctahedronGeometry":
  45700. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45701. break;
  45702. case "TetrahedronGeometry":
  45703. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45704. break;
  45705. case "RingGeometry":
  45706. case "RingBufferGeometry":
  45707. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45708. break;
  45709. case "TorusGeometry":
  45710. case "TorusBufferGeometry":
  45711. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45712. break;
  45713. case "TorusKnotGeometry":
  45714. case "TorusKnotBufferGeometry":
  45715. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45716. break;
  45717. case "LatheGeometry":
  45718. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45719. break;
  45720. case "BufferGeometry":
  45721. a = n.parse(s);
  45722. break;
  45723. case "Geometry":
  45724. a = i.parse(s.data, this.texturePath).geometry;
  45725. break;
  45726. default:
  45727. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45728. continue
  45729. }
  45730. a.uuid = s.uuid,
  45731. void 0 !== s.name && (a.name = s.name),
  45732. t[s.uuid] = a
  45733. }
  45734. return t
  45735. },
  45736. parseMaterials: function(e, t) {
  45737. var i = {};
  45738. if (void 0 !== e) {
  45739. var n = new Ci.MaterialLoader;
  45740. n.setTextures(t);
  45741. for (var r = 0, o = e.length; r < o; r++) {
  45742. var a = n.parse(e[r]);
  45743. i[a.uuid] = a
  45744. }
  45745. }
  45746. return i
  45747. },
  45748. parseAnimations: function(e) {
  45749. for (var t = [], i = 0; i < e.length; i++) {
  45750. var n = Ci.AnimationClip.parse(e[i]);
  45751. t.push(n)
  45752. }
  45753. return t
  45754. },
  45755. parseImages: function(e, t) {
  45756. function i(e) {
  45757. return n.manager.itemStart(e),
  45758. a.load(e, function() {
  45759. n.manager.itemEnd(e)
  45760. })
  45761. }
  45762. var n = this
  45763. , r = {};
  45764. if (void 0 !== e && 0 < e.length) {
  45765. var o = new Ci.LoadingManager(t)
  45766. , a = new Ci.ImageLoader(o);
  45767. a.setCrossOrigin(this.crossOrigin);
  45768. for (var s = 0, l = e.length; s < l; s++) {
  45769. var c = e[s]
  45770. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45771. r[c.uuid] = i(h)
  45772. }
  45773. }
  45774. return r
  45775. },
  45776. parseTextures: function(e, t) {
  45777. function i(e) {
  45778. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45779. Ci[e])
  45780. }
  45781. var n = {};
  45782. if (void 0 !== e)
  45783. for (var r = 0, o = e.length; r < o; r++) {
  45784. var a = e[r];
  45785. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45786. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45787. var s = new Ci.Texture(t[a.image]);
  45788. s.needsUpdate = !0,
  45789. s.uuid = a.uuid,
  45790. void 0 !== a.name && (s.name = a.name),
  45791. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45792. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45793. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45794. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45795. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45796. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45797. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45798. s.wrapT = i(a.wrap[1])),
  45799. n[a.uuid] = s
  45800. }
  45801. return n
  45802. },
  45803. parseObject: (ke = new Ci.Matrix4,
  45804. function(e, t, i) {
  45805. function n(e) {
  45806. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45807. t[e]
  45808. }
  45809. function r(e) {
  45810. if (void 0 !== e)
  45811. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45812. i[e]
  45813. }
  45814. var o;
  45815. switch (e.type) {
  45816. case "Scene":
  45817. o = new Ci.Scene;
  45818. break;
  45819. case "PerspectiveCamera":
  45820. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45821. break;
  45822. case "OrthographicCamera":
  45823. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45824. break;
  45825. case "AmbientLight":
  45826. o = new Ci.AmbientLight(e.color,e.intensity);
  45827. break;
  45828. case "DirectionalLight":
  45829. o = new Ci.DirectionalLight(e.color,e.intensity);
  45830. break;
  45831. case "PointLight":
  45832. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45833. break;
  45834. case "SpotLight":
  45835. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45836. break;
  45837. case "HemisphereLight":
  45838. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45839. break;
  45840. case "Mesh":
  45841. var a = n(e.geometry)
  45842. , s = r(e.material);
  45843. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45844. break;
  45845. case "LOD":
  45846. o = new Ci.LOD;
  45847. break;
  45848. case "Line":
  45849. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45850. break;
  45851. case "PointCloud":
  45852. case "Points":
  45853. o = new Ci.Points(n(e.geometry),r(e.material));
  45854. break;
  45855. case "Sprite":
  45856. o = new Ci.Sprite(r(e.material));
  45857. break;
  45858. case "Group":
  45859. o = new Ci.Group;
  45860. break;
  45861. default:
  45862. o = new Ci.Object3D
  45863. }
  45864. if (o.uuid = e.uuid,
  45865. void 0 !== e.name && (o.name = e.name),
  45866. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45867. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45868. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45869. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45870. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45871. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45872. void 0 !== e.visible && (o.visible = e.visible),
  45873. void 0 !== e.userData && (o.userData = e.userData),
  45874. void 0 !== e.children)
  45875. for (var l in e.children)
  45876. o.add(this.parseObject(e.children[l], t, i));
  45877. if ("LOD" === e.type)
  45878. for (var c = e.levels, h = 0; h < c.length; h++) {
  45879. var u = c[h];
  45880. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45881. }
  45882. return o
  45883. }
  45884. )
  45885. },
  45886. Ci.TextureLoader = function(e) {
  45887. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45888. }
  45889. ,
  45890. Ci.TextureLoader.prototype = {
  45891. constructor: Ci.TextureLoader,
  45892. load: function(e, t, i, n) {
  45893. var r = new Ci.Texture
  45894. , o = new Ci.ImageLoader(this.manager);
  45895. return o.setCrossOrigin(this.crossOrigin),
  45896. o.setPath(this.path),
  45897. o.load(e, function(e) {
  45898. r.image = e,
  45899. r.needsUpdate = !0,
  45900. void 0 !== t && t(r)
  45901. }, i, n),
  45902. r
  45903. },
  45904. setCrossOrigin: function(e) {
  45905. this.crossOrigin = e
  45906. },
  45907. setPath: function(e) {
  45908. this.path = e
  45909. }
  45910. },
  45911. Ci.CubeTextureLoader = function(e) {
  45912. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45913. }
  45914. ,
  45915. Ci.CubeTextureLoader.prototype = {
  45916. constructor: Ci.CubeTextureLoader,
  45917. load: function(e, i, t, n) {
  45918. function r(t) {
  45919. a.load(e[t], function(e) {
  45920. o.images[t] = e,
  45921. 6 === ++s && (o.needsUpdate = !0,
  45922. i && i(o))
  45923. }, void 0, n)
  45924. }
  45925. var o = new Ci.CubeTexture
  45926. , a = new Ci.ImageLoader(this.manager);
  45927. a.setCrossOrigin(this.crossOrigin),
  45928. a.setPath(this.path);
  45929. for (var s = 0, l = 0; l < e.length; ++l)
  45930. r(l);
  45931. return o
  45932. },
  45933. setCrossOrigin: function(e) {
  45934. this.crossOrigin = e
  45935. },
  45936. setPath: function(e) {
  45937. this.path = e
  45938. }
  45939. },
  45940. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45941. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45942. this._parser = null
  45943. }
  45944. ,
  45945. Ci.BinaryTextureLoader.prototype = {
  45946. constructor: Ci.BinaryTextureLoader,
  45947. load: function(e, i, t, n) {
  45948. var r = this
  45949. , o = new Ci.DataTexture
  45950. , a = new Ci.XHRLoader(this.manager);
  45951. return a.setResponseType("arraybuffer"),
  45952. a.load(e, function(e) {
  45953. var t = r._parser(e);
  45954. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45955. o.image.height = t.height,
  45956. o.image.data = t.data),
  45957. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45958. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45959. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45960. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45961. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45962. void 0 !== t.format && (o.format = t.format),
  45963. void 0 !== t.type && (o.type = t.type),
  45964. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45965. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45966. o.needsUpdate = !0,
  45967. i && i(o, t))
  45968. }, t, n),
  45969. o
  45970. }
  45971. },
  45972. Ci.CompressedTextureLoader = function(e) {
  45973. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45974. this._parser = null
  45975. }
  45976. ,
  45977. Ci.CompressedTextureLoader.prototype = {
  45978. constructor: Ci.CompressedTextureLoader,
  45979. load: function(e, o, t, n) {
  45980. function i(i) {
  45981. r.load(e[i], function(e) {
  45982. var t = a._parser(e, !0);
  45983. s[i] = {
  45984. width: t.width,
  45985. height: t.height,
  45986. format: t.format,
  45987. mipmaps: t.mipmaps
  45988. },
  45989. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45990. l.format = t.format,
  45991. l.needsUpdate = !0,
  45992. o && o(l))
  45993. }, t, n)
  45994. }
  45995. var a = this
  45996. , s = []
  45997. , l = new Ci.CompressedTexture;
  45998. l.image = s;
  45999. var r = new Ci.XHRLoader(this.manager);
  46000. if (r.setPath(this.path),
  46001. r.setResponseType("arraybuffer"),
  46002. Array.isArray(e))
  46003. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46004. i(h);
  46005. else
  46006. r.load(e, function(e) {
  46007. var t = a._parser(e, !0);
  46008. if (t.isCubemap)
  46009. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46010. s[n] = {
  46011. mipmaps: []
  46012. };
  46013. for (var r = 0; r < t.mipmapCount; r++)
  46014. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46015. s[n].format = t.format,
  46016. s[n].width = t.width,
  46017. s[n].height = t.height
  46018. }
  46019. else
  46020. l.image.width = t.width,
  46021. l.image.height = t.height,
  46022. l.mipmaps = t.mipmaps;
  46023. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46024. l.format = t.format,
  46025. l.needsUpdate = !0,
  46026. o && o(l)
  46027. }, t, n);
  46028. return l
  46029. },
  46030. setPath: function(e) {
  46031. this.path = e
  46032. }
  46033. },
  46034. Ci.Material = function() {
  46035. Object.defineProperty(this, "id", {
  46036. value: Ci.MaterialIdCount++
  46037. }),
  46038. this.uuid = Ci.Math.generateUUID(),
  46039. this.name = "",
  46040. this.type = "Material",
  46041. this.side = Ci.FrontSide,
  46042. this.opacity = 1,
  46043. this.transparent = !1,
  46044. this.blending = Ci.NormalBlending,
  46045. this.blendSrc = Ci.SrcAlphaFactor,
  46046. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46047. this.blendEquation = Ci.AddEquation,
  46048. this.blendSrcAlpha = null,
  46049. this.blendDstAlpha = null,
  46050. this.blendEquationAlpha = null,
  46051. this.depthFunc = Ci.LessEqualDepth,
  46052. this.depthTest = !0,
  46053. this.depthWrite = !0,
  46054. this.colorWrite = !0,
  46055. this.precision = null,
  46056. this.polygonOffset = !1,
  46057. this.polygonOffsetFactor = 0,
  46058. this.polygonOffsetUnits = 0,
  46059. this.alphaTest = 0,
  46060. this.premultipliedAlpha = !1,
  46061. this.overdraw = 0,
  46062. this.visible = !0,
  46063. this._needsUpdate = !0
  46064. }
  46065. ,
  46066. Ci.Material.prototype = {
  46067. constructor: Ci.Material,
  46068. get needsUpdate() {
  46069. return this._needsUpdate
  46070. },
  46071. set needsUpdate(e) {
  46072. !0 === e && this.update(),
  46073. this._needsUpdate = e
  46074. },
  46075. setValues: function(e) {
  46076. if (void 0 !== e)
  46077. for (var t in e) {
  46078. var i = e[t];
  46079. if (void 0 !== i) {
  46080. var n = this[t];
  46081. 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.")
  46082. } else
  46083. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46084. }
  46085. },
  46086. toJSON: function(e) {
  46087. function t(e) {
  46088. var t = [];
  46089. for (var i in e) {
  46090. var n = e[i];
  46091. delete n.metadata,
  46092. t.push(n)
  46093. }
  46094. return t
  46095. }
  46096. var i = void 0 === e;
  46097. i && (e = {
  46098. textures: {},
  46099. images: {}
  46100. });
  46101. var n = {
  46102. metadata: {
  46103. version: 4.4,
  46104. type: "Material",
  46105. generator: "Material.toJSON"
  46106. }
  46107. };
  46108. if (n.uuid = this.uuid,
  46109. n.type = this.type,
  46110. "" !== this.name && (n.name = this.name),
  46111. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46112. .5 !== this.roughness && (n.roughness = this.roughness),
  46113. .5 !== this.metalness && (n.metalness = this.metalness),
  46114. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46115. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46116. void 0 !== this.shininess && (n.shininess = this.shininess),
  46117. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46118. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46119. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46120. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46121. n.bumpScale = this.bumpScale),
  46122. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46123. n.normalScale = this.normalScale.toArray()),
  46124. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46125. n.displacementScale = this.displacementScale,
  46126. n.displacementBias = this.displacementBias),
  46127. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46128. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46129. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46130. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46131. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46132. n.reflectivity = this.reflectivity),
  46133. void 0 !== this.size && (n.size = this.size),
  46134. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46135. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46136. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46137. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46138. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46139. this.opacity < 1 && (n.opacity = this.opacity),
  46140. !0 === this.transparent && (n.transparent = this.transparent),
  46141. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46142. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46143. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46144. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46145. i) {
  46146. var r = t(e.textures)
  46147. , o = t(e.images);
  46148. 0 < r.length && (n.textures = r),
  46149. 0 < o.length && (n.images = o)
  46150. }
  46151. return n
  46152. },
  46153. clone: function() {
  46154. return (new this.constructor).copy(this)
  46155. },
  46156. copy: function(e) {
  46157. return this.name = e.name,
  46158. this.side = e.side,
  46159. this.opacity = e.opacity,
  46160. this.transparent = e.transparent,
  46161. this.blending = e.blending,
  46162. this.blendSrc = e.blendSrc,
  46163. this.blendDst = e.blendDst,
  46164. this.blendEquation = e.blendEquation,
  46165. this.blendSrcAlpha = e.blendSrcAlpha,
  46166. this.blendDstAlpha = e.blendDstAlpha,
  46167. this.blendEquationAlpha = e.blendEquationAlpha,
  46168. this.depthFunc = e.depthFunc,
  46169. this.depthTest = e.depthTest,
  46170. this.depthWrite = e.depthWrite,
  46171. this.colorWrite = e.colorWrite,
  46172. this.precision = e.precision,
  46173. this.polygonOffset = e.polygonOffset,
  46174. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46175. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46176. this.alphaTest = e.alphaTest,
  46177. this.premultipliedAlpha = e.premultipliedAlpha,
  46178. this.overdraw = e.overdraw,
  46179. this.visible = e.visible,
  46180. this
  46181. },
  46182. update: function() {
  46183. this.dispatchEvent({
  46184. type: "update"
  46185. })
  46186. },
  46187. dispose: function() {
  46188. this.dispatchEvent({
  46189. type: "dispose"
  46190. })
  46191. }
  46192. },
  46193. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46194. Ci.MaterialIdCount = 0,
  46195. Ci.LineBasicMaterial = function(e) {
  46196. Ci.Material.call(this),
  46197. this.type = "LineBasicMaterial",
  46198. this.color = new Ci.Color(16777215),
  46199. this.linewidth = 1,
  46200. this.linecap = "round",
  46201. this.linejoin = "round",
  46202. this.blending = Ci.NormalBlending,
  46203. this.vertexColors = Ci.NoColors,
  46204. this.fog = !0,
  46205. this.setValues(e)
  46206. }
  46207. ,
  46208. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46209. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46210. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46211. return Ci.Material.prototype.copy.call(this, e),
  46212. this.color.copy(e.color),
  46213. this.linewidth = e.linewidth,
  46214. this.linecap = e.linecap,
  46215. this.linejoin = e.linejoin,
  46216. this.vertexColors = e.vertexColors,
  46217. this.fog = e.fog,
  46218. this
  46219. }
  46220. ,
  46221. Ci.LineDashedMaterial = function(e) {
  46222. Ci.Material.call(this),
  46223. this.type = "LineDashedMaterial",
  46224. this.color = new Ci.Color(16777215),
  46225. this.linewidth = 1,
  46226. this.scale = 1,
  46227. this.dashSize = 3,
  46228. this.gapSize = 1,
  46229. this.blending = Ci.NormalBlending,
  46230. this.vertexColors = Ci.NoColors,
  46231. this.fog = !0,
  46232. this.setValues(e)
  46233. }
  46234. ,
  46235. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46236. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46237. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46238. return Ci.Material.prototype.copy.call(this, e),
  46239. this.color.copy(e.color),
  46240. this.linewidth = e.linewidth,
  46241. this.scale = e.scale,
  46242. this.dashSize = e.dashSize,
  46243. this.gapSize = e.gapSize,
  46244. this.vertexColors = e.vertexColors,
  46245. this.fog = e.fog,
  46246. this
  46247. }
  46248. ,
  46249. Ci.MeshBasicMaterial = function(e) {
  46250. Ci.Material.call(this),
  46251. this.type = "MeshBasicMaterial",
  46252. this.color = new Ci.Color(16777215),
  46253. this.map = null,
  46254. this.aoMap = null,
  46255. this.aoMapIntensity = 1,
  46256. this.specularMap = null,
  46257. this.alphaMap = null,
  46258. this.envMap = null,
  46259. this.combine = Ci.MultiplyOperation,
  46260. this.reflectivity = 1,
  46261. this.refractionRatio = .98,
  46262. this.fog = !0,
  46263. this.shading = Ci.SmoothShading,
  46264. this.blending = Ci.NormalBlending,
  46265. this.wireframe = !1,
  46266. this.wireframeLinewidth = 1,
  46267. this.wireframeLinecap = "round",
  46268. this.wireframeLinejoin = "round",
  46269. this.vertexColors = Ci.NoColors,
  46270. this.skinning = !1,
  46271. this.morphTargets = !1,
  46272. this.setValues(e)
  46273. }
  46274. ,
  46275. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46276. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46277. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46278. return Ci.Material.prototype.copy.call(this, e),
  46279. this.color.copy(e.color),
  46280. this.map = e.map,
  46281. this.aoMap = e.aoMap,
  46282. this.aoMapIntensity = e.aoMapIntensity,
  46283. this.specularMap = e.specularMap,
  46284. this.alphaMap = e.alphaMap,
  46285. this.envMap = e.envMap,
  46286. this.combine = e.combine,
  46287. this.reflectivity = e.reflectivity,
  46288. this.refractionRatio = e.refractionRatio,
  46289. this.fog = e.fog,
  46290. this.shading = e.shading,
  46291. this.wireframe = e.wireframe,
  46292. this.wireframeLinewidth = e.wireframeLinewidth,
  46293. this.wireframeLinecap = e.wireframeLinecap,
  46294. this.wireframeLinejoin = e.wireframeLinejoin,
  46295. this.vertexColors = e.vertexColors,
  46296. this.skinning = e.skinning,
  46297. this.morphTargets = e.morphTargets,
  46298. this
  46299. }
  46300. ,
  46301. Ci.MeshLambertMaterial = function(e) {
  46302. Ci.Material.call(this),
  46303. this.type = "MeshLambertMaterial",
  46304. this.color = new Ci.Color(16777215),
  46305. this.map = null,
  46306. this.lightMap = null,
  46307. this.lightMapIntensity = 1,
  46308. this.aoMap = null,
  46309. this.aoMapIntensity = 1,
  46310. this.emissive = new Ci.Color(0),
  46311. this.emissiveIntensity = 1,
  46312. this.emissiveMap = null,
  46313. this.specularMap = null,
  46314. this.alphaMap = null,
  46315. this.envMap = null,
  46316. this.combine = Ci.MultiplyOperation,
  46317. this.reflectivity = 1,
  46318. this.refractionRatio = .98,
  46319. this.fog = !0,
  46320. this.blending = Ci.NormalBlending,
  46321. this.wireframe = !1,
  46322. this.wireframeLinewidth = 1,
  46323. this.wireframeLinecap = "round",
  46324. this.wireframeLinejoin = "round",
  46325. this.vertexColors = Ci.NoColors,
  46326. this.skinning = !1,
  46327. this.morphTargets = !1,
  46328. this.morphNormals = !1,
  46329. this.setValues(e)
  46330. }
  46331. ,
  46332. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46333. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46334. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46335. return Ci.Material.prototype.copy.call(this, e),
  46336. this.color.copy(e.color),
  46337. this.map = e.map,
  46338. this.lightMap = e.lightMap,
  46339. this.lightMapIntensity = e.lightMapIntensity,
  46340. this.aoMap = e.aoMap,
  46341. this.aoMapIntensity = e.aoMapIntensity,
  46342. this.emissive.copy(e.emissive),
  46343. this.emissiveMap = e.emissiveMap,
  46344. this.emissiveIntensity = e.emissiveIntensity,
  46345. this.specularMap = e.specularMap,
  46346. this.alphaMap = e.alphaMap,
  46347. this.envMap = e.envMap,
  46348. this.combine = e.combine,
  46349. this.reflectivity = e.reflectivity,
  46350. this.refractionRatio = e.refractionRatio,
  46351. this.fog = e.fog,
  46352. this.wireframe = e.wireframe,
  46353. this.wireframeLinewidth = e.wireframeLinewidth,
  46354. this.wireframeLinecap = e.wireframeLinecap,
  46355. this.wireframeLinejoin = e.wireframeLinejoin,
  46356. this.vertexColors = e.vertexColors,
  46357. this.skinning = e.skinning,
  46358. this.morphTargets = e.morphTargets,
  46359. this.morphNormals = e.morphNormals,
  46360. this
  46361. }
  46362. ,
  46363. Ci.MeshPhongMaterial = function(e) {
  46364. Ci.Material.call(this),
  46365. this.type = "MeshPhongMaterial",
  46366. this.color = new Ci.Color(16777215),
  46367. this.specular = new Ci.Color(1118481),
  46368. this.shininess = 30,
  46369. this.map = null,
  46370. this.lightMap = null,
  46371. this.lightMapIntensity = 1,
  46372. this.aoMap = null,
  46373. this.aoMapIntensity = 1,
  46374. this.emissive = new Ci.Color(0),
  46375. this.emissiveIntensity = 1,
  46376. this.emissiveMap = null,
  46377. this.bumpMap = null,
  46378. this.bumpScale = 1,
  46379. this.normalMap = null,
  46380. this.normalScale = new Ci.Vector2(1,1),
  46381. this.displacementMap = null,
  46382. this.displacementScale = 1,
  46383. this.displacementBias = 0,
  46384. this.specularMap = null,
  46385. this.alphaMap = null,
  46386. this.envMap = null,
  46387. this.combine = Ci.MultiplyOperation,
  46388. this.reflectivity = 1,
  46389. this.refractionRatio = .98,
  46390. this.fog = !0,
  46391. this.shading = Ci.SmoothShading,
  46392. this.blending = Ci.NormalBlending,
  46393. this.wireframe = !1,
  46394. this.wireframeLinewidth = 1,
  46395. this.wireframeLinecap = "round",
  46396. this.wireframeLinejoin = "round",
  46397. this.vertexColors = Ci.NoColors,
  46398. this.skinning = !1,
  46399. this.morphTargets = !1,
  46400. this.morphNormals = !1,
  46401. this.setValues(e)
  46402. }
  46403. ,
  46404. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46405. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46406. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46407. return Ci.Material.prototype.copy.call(this, e),
  46408. this.color.copy(e.color),
  46409. this.specular.copy(e.specular),
  46410. this.shininess = e.shininess,
  46411. this.map = e.map,
  46412. this.lightMap = e.lightMap,
  46413. this.lightMapIntensity = e.lightMapIntensity,
  46414. this.aoMap = e.aoMap,
  46415. this.aoMapIntensity = e.aoMapIntensity,
  46416. this.emissive.copy(e.emissive),
  46417. this.emissiveMap = e.emissiveMap,
  46418. this.emissiveIntensity = e.emissiveIntensity,
  46419. this.bumpMap = e.bumpMap,
  46420. this.bumpScale = e.bumpScale,
  46421. this.normalMap = e.normalMap,
  46422. this.normalScale.copy(e.normalScale),
  46423. this.displacementMap = e.displacementMap,
  46424. this.displacementScale = e.displacementScale,
  46425. this.displacementBias = e.displacementBias,
  46426. this.specularMap = e.specularMap,
  46427. this.alphaMap = e.alphaMap,
  46428. this.envMap = e.envMap,
  46429. this.combine = e.combine,
  46430. this.reflectivity = e.reflectivity,
  46431. this.refractionRatio = e.refractionRatio,
  46432. this.fog = e.fog,
  46433. this.shading = e.shading,
  46434. this.wireframe = e.wireframe,
  46435. this.wireframeLinewidth = e.wireframeLinewidth,
  46436. this.wireframeLinecap = e.wireframeLinecap,
  46437. this.wireframeLinejoin = e.wireframeLinejoin,
  46438. this.vertexColors = e.vertexColors,
  46439. this.skinning = e.skinning,
  46440. this.morphTargets = e.morphTargets,
  46441. this.morphNormals = e.morphNormals,
  46442. this
  46443. }
  46444. ,
  46445. Ci.MeshStandardMaterial = function(e) {
  46446. Ci.Material.call(this),
  46447. this.type = "MeshStandardMaterial",
  46448. this.color = new Ci.Color(16777215),
  46449. this.roughness = .5,
  46450. this.metalness = .5,
  46451. this.map = null,
  46452. this.lightMap = null,
  46453. this.lightMapIntensity = 1,
  46454. this.aoMap = null,
  46455. this.aoMapIntensity = 1,
  46456. this.emissive = new Ci.Color(0),
  46457. this.emissiveIntensity = 1,
  46458. this.emissiveMap = null,
  46459. this.bumpMap = null,
  46460. this.bumpScale = 1,
  46461. this.normalMap = null,
  46462. this.normalScale = new Ci.Vector2(1,1),
  46463. this.displacementMap = null,
  46464. this.displacementScale = 1,
  46465. this.displacementBias = 0,
  46466. this.roughnessMap = null,
  46467. this.metalnessMap = null,
  46468. this.alphaMap = null,
  46469. this.envMap = null,
  46470. this.envMapIntensity = 1,
  46471. this.refractionRatio = .98,
  46472. this.fog = !0,
  46473. this.shading = Ci.SmoothShading,
  46474. this.blending = Ci.NormalBlending,
  46475. this.wireframe = !1,
  46476. this.wireframeLinewidth = 1,
  46477. this.wireframeLinecap = "round",
  46478. this.wireframeLinejoin = "round",
  46479. this.vertexColors = Ci.NoColors,
  46480. this.skinning = !1,
  46481. this.morphTargets = !1,
  46482. this.morphNormals = !1,
  46483. this.setValues(e)
  46484. }
  46485. ,
  46486. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46487. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46488. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46489. return Ci.Material.prototype.copy.call(this, e),
  46490. this.color.copy(e.color),
  46491. this.roughness = e.roughness,
  46492. this.metalness = e.metalness,
  46493. this.map = e.map,
  46494. this.lightMap = e.lightMap,
  46495. this.lightMapIntensity = e.lightMapIntensity,
  46496. this.aoMap = e.aoMap,
  46497. this.aoMapIntensity = e.aoMapIntensity,
  46498. this.emissive.copy(e.emissive),
  46499. this.emissiveMap = e.emissiveMap,
  46500. this.emissiveIntensity = e.emissiveIntensity,
  46501. this.bumpMap = e.bumpMap,
  46502. this.bumpScale = e.bumpScale,
  46503. this.normalMap = e.normalMap,
  46504. this.normalScale.copy(e.normalScale),
  46505. this.displacementMap = e.displacementMap,
  46506. this.displacementScale = e.displacementScale,
  46507. this.displacementBias = e.displacementBias,
  46508. this.roughnessMap = e.roughnessMap,
  46509. this.metalnessMap = e.metalnessMap,
  46510. this.alphaMap = e.alphaMap,
  46511. this.envMap = e.envMap,
  46512. this.envMapIntensity = e.envMapIntensity,
  46513. this.refractionRatio = e.refractionRatio,
  46514. this.fog = e.fog,
  46515. this.shading = e.shading,
  46516. this.wireframe = e.wireframe,
  46517. this.wireframeLinewidth = e.wireframeLinewidth,
  46518. this.wireframeLinecap = e.wireframeLinecap,
  46519. this.wireframeLinejoin = e.wireframeLinejoin,
  46520. this.vertexColors = e.vertexColors,
  46521. this.skinning = e.skinning,
  46522. this.morphTargets = e.morphTargets,
  46523. this.morphNormals = e.morphNormals,
  46524. this
  46525. }
  46526. ,
  46527. Ci.MeshDepthMaterial = function(e) {
  46528. Ci.Material.call(this),
  46529. this.type = "MeshDepthMaterial",
  46530. this.morphTargets = !1,
  46531. this.wireframe = !1,
  46532. this.wireframeLinewidth = 1,
  46533. this.setValues(e)
  46534. }
  46535. ,
  46536. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46537. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46538. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46539. return Ci.Material.prototype.copy.call(this, e),
  46540. this.wireframe = e.wireframe,
  46541. this.wireframeLinewidth = e.wireframeLinewidth,
  46542. this
  46543. }
  46544. ,
  46545. Ci.MeshNormalMaterial = function(e) {
  46546. Ci.Material.call(this, e),
  46547. this.type = "MeshNormalMaterial",
  46548. this.wireframe = !1,
  46549. this.wireframeLinewidth = 1,
  46550. this.morphTargets = !1,
  46551. this.setValues(e)
  46552. }
  46553. ,
  46554. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46555. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46556. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46557. return Ci.Material.prototype.copy.call(this, e),
  46558. this.wireframe = e.wireframe,
  46559. this.wireframeLinewidth = e.wireframeLinewidth,
  46560. this
  46561. }
  46562. ,
  46563. Ci.MultiMaterial = function(e) {
  46564. this.uuid = Ci.Math.generateUUID(),
  46565. this.type = "MultiMaterial",
  46566. this.materials = e instanceof Array ? e : [],
  46567. this.visible = !0
  46568. }
  46569. ,
  46570. Ci.MultiMaterial.prototype = {
  46571. constructor: Ci.MultiMaterial,
  46572. toJSON: function(e) {
  46573. for (var t = {
  46574. metadata: {
  46575. version: 4.2,
  46576. type: "material",
  46577. generator: "MaterialExporter"
  46578. },
  46579. uuid: this.uuid,
  46580. type: this.type,
  46581. materials: []
  46582. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46583. var o = i[n].toJSON(e);
  46584. delete o.metadata,
  46585. t.materials.push(o)
  46586. }
  46587. return t.visible = this.visible,
  46588. t
  46589. },
  46590. clone: function() {
  46591. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46592. e.materials.push(this.materials[t].clone());
  46593. return e.visible = this.visible,
  46594. e
  46595. }
  46596. },
  46597. Ci.PointsMaterial = function(e) {
  46598. Ci.Material.call(this),
  46599. this.type = "PointsMaterial",
  46600. this.color = new Ci.Color(16777215),
  46601. this.map = null,
  46602. this.size = 1,
  46603. this.sizeAttenuation = !0,
  46604. this.blending = Ci.NormalBlending,
  46605. this.vertexColors = Ci.NoColors,
  46606. this.fog = !0,
  46607. this.setValues(e)
  46608. }
  46609. ,
  46610. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46611. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46612. Ci.PointsMaterial.prototype.copy = function(e) {
  46613. return Ci.Material.prototype.copy.call(this, e),
  46614. this.color.copy(e.color),
  46615. this.map = e.map,
  46616. this.size = e.size,
  46617. this.sizeAttenuation = e.sizeAttenuation,
  46618. this.vertexColors = e.vertexColors,
  46619. this.fog = e.fog,
  46620. this
  46621. }
  46622. ,
  46623. Ci.ShaderMaterial = function(e) {
  46624. Ci.Material.call(this),
  46625. this.type = "ShaderMaterial",
  46626. this.defines = {},
  46627. this.uniforms = {},
  46628. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46629. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46630. this.shading = Ci.SmoothShading,
  46631. this.linewidth = 1,
  46632. this.wireframe = !1,
  46633. this.wireframeLinewidth = 1,
  46634. this.fog = !1,
  46635. this.lights = !1,
  46636. this.vertexColors = Ci.NoColors,
  46637. this.skinning = !1,
  46638. this.morphTargets = !1,
  46639. this.morphNormals = !1,
  46640. this.extensions = {
  46641. derivatives: !1,
  46642. fragDepth: !1,
  46643. drawBuffers: !1,
  46644. shaderTextureLOD: !1
  46645. },
  46646. this.defaultAttributeValues = {
  46647. color: [1, 1, 1],
  46648. uv: [0, 0],
  46649. uv2: [0, 0]
  46650. },
  46651. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46652. this.setValues(e))
  46653. }
  46654. ,
  46655. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46656. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46657. Ci.ShaderMaterial.prototype.copy = function(e) {
  46658. return Ci.Material.prototype.copy.call(this, e),
  46659. this.fragmentShader = e.fragmentShader,
  46660. this.vertexShader = e.vertexShader,
  46661. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46662. this.defines = e.defines,
  46663. this.shading = e.shading,
  46664. this.wireframe = e.wireframe,
  46665. this.wireframeLinewidth = e.wireframeLinewidth,
  46666. this.fog = e.fog,
  46667. this.lights = e.lights,
  46668. this.vertexColors = e.vertexColors,
  46669. this.skinning = e.skinning,
  46670. this.morphTargets = e.morphTargets,
  46671. this.morphNormals = e.morphNormals,
  46672. this.extensions = e.extensions,
  46673. this
  46674. }
  46675. ,
  46676. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46677. var t = Ci.Material.prototype.toJSON.call(this, e);
  46678. return t.uniforms = this.uniforms,
  46679. t.vertexShader = this.vertexShader,
  46680. t.fragmentShader = this.fragmentShader,
  46681. t
  46682. }
  46683. ,
  46684. Ci.RawShaderMaterial = function(e) {
  46685. Ci.ShaderMaterial.call(this, e),
  46686. this.type = "RawShaderMaterial"
  46687. }
  46688. ,
  46689. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46690. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46691. Ci.SpriteMaterial = function(e) {
  46692. Ci.Material.call(this),
  46693. this.type = "SpriteMaterial",
  46694. this.color = new Ci.Color(16777215),
  46695. this.map = null,
  46696. this.rotation = 0,
  46697. this.fog = !1,
  46698. this.setValues(e)
  46699. }
  46700. ,
  46701. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46702. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46703. Ci.SpriteMaterial.prototype.copy = function(e) {
  46704. return Ci.Material.prototype.copy.call(this, e),
  46705. this.color.copy(e.color),
  46706. this.map = e.map,
  46707. this.rotation = e.rotation,
  46708. this.fog = e.fog,
  46709. this
  46710. }
  46711. ,
  46712. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46713. Object.defineProperty(this, "id", {
  46714. value: Ci.TextureIdCount++
  46715. }),
  46716. this.uuid = Ci.Math.generateUUID(),
  46717. this.name = "",
  46718. this.sourceFile = "",
  46719. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46720. this.mipmaps = [],
  46721. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46722. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46723. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46724. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46725. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46726. this.anisotropy = void 0 !== l ? l : 1,
  46727. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46728. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46729. this.offset = new Ci.Vector2(0,0),
  46730. this.repeat = new Ci.Vector2(1,1),
  46731. this.generateMipmaps = !0,
  46732. this.premultiplyAlpha = !1,
  46733. this.flipY = !0,
  46734. this.unpackAlignment = 4,
  46735. this.encoding = Ci.LinearEncoding,
  46736. this.version = 0,
  46737. this.onUpdate = null
  46738. }
  46739. ,
  46740. Ci.Texture.DEFAULT_IMAGE = void 0,
  46741. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46742. Ci.Texture.prototype = {
  46743. constructor: Ci.Texture,
  46744. set needsUpdate(e) {
  46745. !0 === e && this.version++
  46746. },
  46747. clone: function() {
  46748. return (new this.constructor).copy(this)
  46749. },
  46750. copy: function(e) {
  46751. return this.image = e.image,
  46752. this.mipmaps = e.mipmaps.slice(0),
  46753. this.mapping = e.mapping,
  46754. this.wrapS = e.wrapS,
  46755. this.wrapT = e.wrapT,
  46756. this.magFilter = e.magFilter,
  46757. this.minFilter = e.minFilter,
  46758. this.anisotropy = e.anisotropy,
  46759. this.format = e.format,
  46760. this.type = e.type,
  46761. this.offset.copy(e.offset),
  46762. this.repeat.copy(e.repeat),
  46763. this.generateMipmaps = e.generateMipmaps,
  46764. this.premultiplyAlpha = e.premultiplyAlpha,
  46765. this.flipY = e.flipY,
  46766. this.unpackAlignment = e.unpackAlignment,
  46767. this.encoding = e.encoding,
  46768. this
  46769. },
  46770. toJSON: function(e) {
  46771. if (void 0 !== e.textures[this.uuid])
  46772. return e.textures[this.uuid];
  46773. var t, i, n = {
  46774. metadata: {
  46775. version: 4.4,
  46776. type: "Texture",
  46777. generator: "Texture.toJSON"
  46778. },
  46779. uuid: this.uuid,
  46780. name: this.name,
  46781. mapping: this.mapping,
  46782. repeat: [this.repeat.x, this.repeat.y],
  46783. offset: [this.offset.x, this.offset.y],
  46784. wrap: [this.wrapS, this.wrapT],
  46785. minFilter: this.minFilter,
  46786. magFilter: this.magFilter,
  46787. anisotropy: this.anisotropy
  46788. };
  46789. if (void 0 !== this.image) {
  46790. var r = this.image;
  46791. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46792. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46793. uuid: r.uuid,
  46794. url: (t = r,
  46795. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46796. i.height = t.height,
  46797. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46798. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46799. }),
  46800. n.image = r.uuid
  46801. }
  46802. return e.textures[this.uuid] = n
  46803. },
  46804. dispose: function() {
  46805. this.dispatchEvent({
  46806. type: "dispose"
  46807. })
  46808. },
  46809. transformUv: function(e) {
  46810. if (this.mapping === Ci.UVMapping) {
  46811. if (e.multiply(this.repeat),
  46812. e.add(this.offset),
  46813. e.x < 0 || 1 < e.x)
  46814. switch (this.wrapS) {
  46815. case Ci.RepeatWrapping:
  46816. e.x = e.x - Math.floor(e.x);
  46817. break;
  46818. case Ci.ClampToEdgeWrapping:
  46819. e.x = e.x < 0 ? 0 : 1;
  46820. break;
  46821. case Ci.MirroredRepeatWrapping:
  46822. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46823. }
  46824. if (e.y < 0 || 1 < e.y)
  46825. switch (this.wrapT) {
  46826. case Ci.RepeatWrapping:
  46827. e.y = e.y - Math.floor(e.y);
  46828. break;
  46829. case Ci.ClampToEdgeWrapping:
  46830. e.y = e.y < 0 ? 0 : 1;
  46831. break;
  46832. case Ci.MirroredRepeatWrapping:
  46833. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46834. }
  46835. this.flipY && (e.y = 1 - e.y)
  46836. }
  46837. }
  46838. },
  46839. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46840. Ci.TextureIdCount = 0,
  46841. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46842. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46843. this.needsUpdate = !0
  46844. }
  46845. ,
  46846. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46847. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46848. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46849. e = void 0 !== e ? e : [],
  46850. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46851. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46852. this.flipY = !1
  46853. }
  46854. ,
  46855. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46856. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46857. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46858. get: function() {
  46859. return this.image
  46860. },
  46861. set: function(e) {
  46862. this.image = e
  46863. }
  46864. }),
  46865. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46866. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46867. this.image = {
  46868. width: t,
  46869. height: i
  46870. },
  46871. this.mipmaps = e,
  46872. this.flipY = !1,
  46873. this.generateMipmaps = !1
  46874. }
  46875. ,
  46876. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46877. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46878. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46879. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46880. this.image = {
  46881. data: e,
  46882. width: t,
  46883. height: i
  46884. },
  46885. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46886. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46887. this.flipY = !1,
  46888. this.generateMipmaps = !1
  46889. }
  46890. ,
  46891. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46892. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46893. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46894. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46895. this.generateMipmaps = !1;
  46896. var c = this;
  46897. !function e() {
  46898. requestAnimationFrame(e),
  46899. !t.paused && t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46900. }()
  46901. }
  46902. ,
  46903. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46904. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46905. Ci.Group = function() {
  46906. Ci.Object3D.call(this),
  46907. this.type = "Group"
  46908. }
  46909. ,
  46910. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46911. Ci.Group.prototype.constructor = Ci.Group,
  46912. Ci.Points = function(e, t) {
  46913. Ci.Object3D.call(this),
  46914. this.type = "Points",
  46915. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46916. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46917. color: 16777215 * Math.random()
  46918. })
  46919. }
  46920. ,
  46921. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46922. Ci.Points.prototype.constructor = Ci.Points,
  46923. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46924. jt = new Ci.Ray,
  46925. Yt = new Ci.Sphere,
  46926. function(o, a) {
  46927. function e(e, t) {
  46928. var i = jt.distanceSqToPoint(e);
  46929. if (i < c) {
  46930. var n = jt.closestPointToPoint(e);
  46931. n.applyMatrix4(l);
  46932. var r = o.ray.origin.distanceTo(n);
  46933. if (r < o.near || r > o.far)
  46934. return;
  46935. a.push({
  46936. distance: r,
  46937. distanceToRay: Math.sqrt(i),
  46938. point: n.clone(),
  46939. index: t,
  46940. face: null,
  46941. object: s
  46942. })
  46943. }
  46944. }
  46945. var s = this
  46946. , t = this.geometry
  46947. , l = this.matrixWorld
  46948. , i = o.params.Points.threshold;
  46949. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46950. Yt.copy(t.boundingSphere),
  46951. Yt.applyMatrix4(l),
  46952. !1 !== o.ray.intersectsSphere(Yt)) {
  46953. Wt.getInverse(l),
  46954. jt.copy(o.ray).applyMatrix4(Wt);
  46955. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46956. , c = n * n
  46957. , r = new Ci.Vector3;
  46958. if (t instanceof Ci.BufferGeometry) {
  46959. var h = t.index
  46960. , u = t.attributes.position.array;
  46961. if (null !== h)
  46962. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46963. var g = d[p];
  46964. r.fromArray(u, 3 * g),
  46965. e(r, g)
  46966. }
  46967. else {
  46968. p = 0;
  46969. for (var m = u.length / 3; p < m; p++)
  46970. r.fromArray(u, 3 * p),
  46971. e(r, p)
  46972. }
  46973. } else {
  46974. var v = t.vertices;
  46975. for (p = 0,
  46976. m = v.length; p < m; p++)
  46977. e(v[p], p)
  46978. }
  46979. }
  46980. }
  46981. ),
  46982. Ci.Points.prototype.clone = function() {
  46983. return new this.constructor(this.geometry,this.material).copy(this)
  46984. }
  46985. ,
  46986. Ci.Line = function(e, t, i) {
  46987. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46988. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46989. this.type = "Line",
  46990. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46991. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46992. color: 16777215 * Math.random()
  46993. })))
  46994. }
  46995. ,
  46996. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46997. Ci.Line.prototype.constructor = Ci.Line,
  46998. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46999. zt = new Ci.Ray,
  47000. Gt = new Ci.Sphere,
  47001. function(e, t) {
  47002. var i = e.linePrecision
  47003. , n = i * i
  47004. , r = this.geometry
  47005. , o = this.matrixWorld;
  47006. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47007. Gt.copy(r.boundingSphere),
  47008. Gt.applyMatrix4(o),
  47009. !1 !== e.ray.intersectsSphere(Gt)) {
  47010. Ht.getInverse(o),
  47011. zt.copy(e.ray).applyMatrix4(Ht);
  47012. var a = new Ci.Vector3
  47013. , s = new Ci.Vector3
  47014. , l = new Ci.Vector3
  47015. , c = new Ci.Vector3
  47016. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47017. if (r instanceof Ci.BufferGeometry) {
  47018. var u = r.index
  47019. , d = r.attributes.position.array;
  47020. if (null !== u)
  47021. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47022. var m = p[f]
  47023. , v = p[f + 1];
  47024. a.fromArray(d, 3 * m),
  47025. s.fromArray(d, 3 * v),
  47026. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47027. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47028. distance: C,
  47029. point: l.clone().applyMatrix4(this.matrixWorld),
  47030. index: f,
  47031. face: null,
  47032. faceIndex: null,
  47033. object: this
  47034. }))
  47035. }
  47036. else
  47037. for (f = 0,
  47038. g = d.length / 3 - 1; f < g; f += h)
  47039. a.fromArray(d, 3 * f),
  47040. s.fromArray(d, 3 * f + 3),
  47041. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47042. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47043. distance: C,
  47044. point: l.clone().applyMatrix4(this.matrixWorld),
  47045. index: f,
  47046. face: null,
  47047. faceIndex: null,
  47048. object: this
  47049. }))
  47050. } else if (r instanceof Ci.Geometry) {
  47051. var y = r.vertices
  47052. , A = y.length;
  47053. for (f = 0; f < A - 1; f += h) {
  47054. var C;
  47055. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47056. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47057. distance: C,
  47058. point: l.clone().applyMatrix4(this.matrixWorld),
  47059. index: f,
  47060. face: null,
  47061. faceIndex: null,
  47062. object: this
  47063. }))
  47064. }
  47065. }
  47066. }
  47067. }
  47068. ),
  47069. Ci.Line.prototype.clone = function() {
  47070. return new this.constructor(this.geometry,this.material).copy(this)
  47071. }
  47072. ,
  47073. Ci.LineStrip = 0,
  47074. Ci.LinePieces = 1,
  47075. Ci.LineSegments = function(e, t) {
  47076. Ci.Line.call(this, e, t),
  47077. this.type = "LineSegments"
  47078. }
  47079. ,
  47080. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47081. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47082. Ci.Mesh = function(e, t) {
  47083. Ci.Object3D.call(this),
  47084. this.type = "Mesh",
  47085. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47086. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47087. color: 16777215 * Math.random()
  47088. }),
  47089. this.drawMode = Ci.TrianglesDrawMode,
  47090. this.updateMorphTargets()
  47091. }
  47092. ,
  47093. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47094. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47095. Ci.Mesh.prototype.setDrawMode = function(e) {
  47096. this.drawMode = e
  47097. }
  47098. ,
  47099. Ci.Mesh.prototype.updateMorphTargets = function() {
  47100. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47101. this.morphTargetBase = -1,
  47102. this.morphTargetInfluences = [],
  47103. this.morphTargetDictionary = {};
  47104. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47105. this.morphTargetInfluences.push(0),
  47106. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47107. }
  47108. }
  47109. ,
  47110. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47111. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47112. 0)
  47113. }
  47114. ,
  47115. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47116. xt = new Ci.Ray,
  47117. St = new Ci.Sphere,
  47118. Mt = new Ci.Vector3,
  47119. Rt = new Ci.Vector3,
  47120. Pt = new Ci.Vector3,
  47121. Ot = new Ci.Vector3,
  47122. Lt = new Ci.Vector3,
  47123. Dt = new Ci.Vector3,
  47124. Nt = new Ci.Vector2,
  47125. Ft = new Ci.Vector2,
  47126. Bt = new Ci.Vector2,
  47127. Vt = new Ci.Vector3,
  47128. kt = new Ci.Vector3,
  47129. Ut = new Ci.Vector3,
  47130. function(e, t) {
  47131. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47132. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47133. St.copy(r.boundingSphere),
  47134. St.applyMatrix4(a),
  47135. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47136. xt.copy(e.ray).applyMatrix4(Tt),
  47137. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47138. if (r instanceof Ci.BufferGeometry) {
  47139. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47140. if (void 0 !== u.uv && (i = u.uv.array),
  47141. null !== h)
  47142. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47143. s = p[f],
  47144. l = p[f + 1],
  47145. c = p[f + 2],
  47146. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47147. t.push(n));
  47148. else
  47149. for (f = 0,
  47150. g = d.length; f < g; f += 9)
  47151. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47152. t.push(n))
  47153. } else if (r instanceof Ci.Geometry) {
  47154. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47155. 0 < _.length && (i = _);
  47156. for (var b = 0, w = E.length; b < w; b++) {
  47157. var T = E[b]
  47158. , x = 1 == A ? C[T.materialIndex] : o;
  47159. if (void 0 !== x) {
  47160. if (m = I[T.a],
  47161. v = I[T.b],
  47162. y = I[T.c],
  47163. !0 === x.morphTargets) {
  47164. var S = r.morphTargets
  47165. , M = this.morphTargetInfluences;
  47166. Mt.set(0, 0, 0),
  47167. Rt.set(0, 0, 0),
  47168. Pt.set(0, 0, 0);
  47169. for (var R = 0, P = S.length; R < P; R++) {
  47170. var O = M[R];
  47171. if (0 !== O) {
  47172. var L = S[R].vertices;
  47173. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47174. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47175. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47176. }
  47177. }
  47178. Mt.add(m),
  47179. Rt.add(v),
  47180. Pt.add(y),
  47181. m = Mt,
  47182. v = Rt,
  47183. y = Pt
  47184. }
  47185. if (n = wi(this, e, xt, m, v, y, kt)) {
  47186. if (i) {
  47187. var D = i[b];
  47188. Nt.copy(D[0]),
  47189. Ft.copy(D[1]),
  47190. Bt.copy(D[2]),
  47191. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47192. }
  47193. n.face = T,
  47194. n.faceIndex = b,
  47195. t.push(n)
  47196. }
  47197. }
  47198. }
  47199. }
  47200. }
  47201. ),
  47202. Ci.Mesh.prototype.clone = function() {
  47203. return new this.constructor(this.geometry,this.material).copy(this)
  47204. }
  47205. ,
  47206. Ci.Bone = function(e) {
  47207. Ci.Object3D.call(this),
  47208. this.type = "Bone",
  47209. this.skin = e
  47210. }
  47211. ,
  47212. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47213. Ci.Bone.prototype.constructor = Ci.Bone,
  47214. Ci.Bone.prototype.copy = function(e) {
  47215. return Ci.Object3D.prototype.copy.call(this, e),
  47216. this.skin = e.skin,
  47217. this
  47218. }
  47219. ,
  47220. Ci.Skeleton = function(e, t, i) {
  47221. if (this.useVertexTexture = void 0 === i || i,
  47222. this.identityMatrix = new Ci.Matrix4,
  47223. e = e || [],
  47224. this.bones = e.slice(0),
  47225. this.useVertexTexture) {
  47226. var n = Math.sqrt(4 * this.bones.length);
  47227. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47228. n = Math.max(n, 4),
  47229. this.boneTextureWidth = n,
  47230. this.boneTextureHeight = n,
  47231. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47232. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47233. } else
  47234. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47235. if (void 0 === t)
  47236. this.calculateInverses();
  47237. else if (this.bones.length === t.length)
  47238. this.boneInverses = t.slice(0);
  47239. else {
  47240. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47241. this.boneInverses = [];
  47242. for (var r = 0, o = this.bones.length; r < o; r++)
  47243. this.boneInverses.push(new Ci.Matrix4)
  47244. }
  47245. }
  47246. ,
  47247. Ci.Skeleton.prototype.calculateInverses = function() {
  47248. this.boneInverses = [];
  47249. for (var e = 0, t = this.bones.length; e < t; e++) {
  47250. var i = new Ci.Matrix4;
  47251. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47252. this.boneInverses.push(i)
  47253. }
  47254. }
  47255. ,
  47256. Ci.Skeleton.prototype.pose = function() {
  47257. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47258. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47259. for (t = 0,
  47260. i = this.bones.length; t < i; t++)
  47261. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47262. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47263. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47264. }
  47265. ,
  47266. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47267. function() {
  47268. for (var e = 0, t = this.bones.length; e < t; e++) {
  47269. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47270. wt.multiplyMatrices(i, this.boneInverses[e]),
  47271. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47272. }
  47273. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47274. }
  47275. ),
  47276. Ci.Skeleton.prototype.clone = function() {
  47277. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47278. }
  47279. ,
  47280. Ci.SkinnedMesh = function(e, t, i) {
  47281. Ci.Mesh.call(this, e, t),
  47282. this.type = "SkinnedMesh",
  47283. this.bindMode = "attached",
  47284. this.bindMatrix = new Ci.Matrix4,
  47285. this.bindMatrixInverse = new Ci.Matrix4;
  47286. var n = [];
  47287. if (this.geometry && void 0 !== this.geometry.bones) {
  47288. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47289. o = this.geometry.bones[a],
  47290. r = new Ci.Bone(this),
  47291. n.push(r),
  47292. r.name = o.name,
  47293. r.position.fromArray(o.pos),
  47294. r.quaternion.fromArray(o.rotq),
  47295. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47296. for (a = 0,
  47297. s = this.geometry.bones.length; a < s; ++a)
  47298. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47299. }
  47300. this.normalizeSkinWeights(),
  47301. this.updateMatrixWorld(!0),
  47302. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47303. }
  47304. ,
  47305. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47306. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47307. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47308. this.skeleton = e,
  47309. void 0 === t && (this.updateMatrixWorld(!0),
  47310. this.skeleton.calculateInverses(),
  47311. t = this.matrixWorld),
  47312. this.bindMatrix.copy(t),
  47313. this.bindMatrixInverse.getInverse(t)
  47314. }
  47315. ,
  47316. Ci.SkinnedMesh.prototype.pose = function() {
  47317. this.skeleton.pose()
  47318. }
  47319. ,
  47320. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47321. if (this.geometry instanceof Ci.Geometry)
  47322. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47323. var t = this.geometry.skinWeights[e];
  47324. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47325. }
  47326. else if (this.geometry instanceof Ci.BufferGeometry) {
  47327. var i = new Ci.Vector4
  47328. , n = this.geometry.attributes.skinWeight;
  47329. for (e = 0; e < n.count; e++) {
  47330. var r;
  47331. i.x = n.getX(e),
  47332. i.y = n.getY(e),
  47333. i.z = n.getZ(e),
  47334. i.w = n.getW(e),
  47335. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47336. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47337. }
  47338. }
  47339. }
  47340. ,
  47341. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47342. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47343. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47344. }
  47345. ,
  47346. Ci.SkinnedMesh.prototype.clone = function() {
  47347. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47348. }
  47349. ,
  47350. Ci.LOD = function() {
  47351. Ci.Object3D.call(this),
  47352. this.type = "LOD",
  47353. Object.defineProperties(this, {
  47354. levels: {
  47355. enumerable: !0,
  47356. value: []
  47357. },
  47358. objects: {
  47359. get: function() {
  47360. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47361. this.levels
  47362. }
  47363. }
  47364. })
  47365. }
  47366. ,
  47367. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47368. Ci.LOD.prototype.constructor = Ci.LOD,
  47369. Ci.LOD.prototype.addLevel = function(e, t) {
  47370. void 0 === t && (t = 0),
  47371. t = Math.abs(t);
  47372. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47373. ;
  47374. i.splice(n, 0, {
  47375. distance: t,
  47376. object: e
  47377. }),
  47378. this.add(e)
  47379. }
  47380. ,
  47381. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47382. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47383. ;
  47384. return t[i - 1].object
  47385. }
  47386. ,
  47387. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47388. function(e, t) {
  47389. bt.setFromMatrixPosition(this.matrixWorld);
  47390. var i = e.ray.origin.distanceTo(bt);
  47391. this.getObjectForDistance(i).raycast(e, t)
  47392. }
  47393. ),
  47394. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47395. _t = new Ci.Vector3,
  47396. function(e) {
  47397. var t = this.levels;
  47398. if (1 < t.length) {
  47399. Et.setFromMatrixPosition(e.matrixWorld),
  47400. _t.setFromMatrixPosition(this.matrixWorld);
  47401. var i = Et.distanceTo(_t);
  47402. t[0].object.visible = !0;
  47403. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47404. t[n - 1].object.visible = !1,
  47405. t[n].object.visible = !0;
  47406. for (; n < r; n++)
  47407. t[n].object.visible = !1
  47408. }
  47409. }
  47410. ),
  47411. Ci.LOD.prototype.copy = function(e) {
  47412. Ci.Object3D.prototype.copy.call(this, e, !1);
  47413. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47414. var r = t[i];
  47415. this.addLevel(r.object.clone(), r.distance)
  47416. }
  47417. return this
  47418. }
  47419. ,
  47420. Ci.LOD.prototype.toJSON = function(e) {
  47421. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47422. t.object.levels = [];
  47423. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47424. var o = i[n];
  47425. t.object.levels.push({
  47426. object: o.object.uuid,
  47427. distance: o.distance
  47428. })
  47429. }
  47430. return t
  47431. }
  47432. ,
  47433. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47434. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47435. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47436. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47437. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47438. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47439. function(e) {
  47440. Ci.Object3D.call(this),
  47441. this.type = "Sprite",
  47442. this.geometry = It,
  47443. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47444. }
  47445. ),
  47446. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47447. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47448. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47449. function(e, t) {
  47450. vt.setFromMatrixPosition(this.matrixWorld);
  47451. var i = e.ray.distanceSqToPoint(vt);
  47452. this.scale.x * this.scale.y < i || t.push({
  47453. distance: Math.sqrt(i),
  47454. point: this.position,
  47455. face: null,
  47456. object: this
  47457. })
  47458. }
  47459. ),
  47460. Ci.Sprite.prototype.clone = function() {
  47461. return new this.constructor(this.material).copy(this)
  47462. }
  47463. ,
  47464. Ci.Particle = Ci.Sprite,
  47465. Ci.LensFlare = function(e, t, i, n, r) {
  47466. Ci.Object3D.call(this),
  47467. this.lensFlares = [],
  47468. this.positionScreen = new Ci.Vector3,
  47469. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47470. }
  47471. ,
  47472. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47473. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47474. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47475. void 0 === t && (t = -1),
  47476. void 0 === i && (i = 0),
  47477. void 0 === o && (o = 1),
  47478. void 0 === r && (r = new Ci.Color(16777215)),
  47479. void 0 === n && (n = Ci.NormalBlending),
  47480. i = Math.min(i, Math.max(0, i)),
  47481. this.lensFlares.push({
  47482. texture: e,
  47483. size: t,
  47484. distance: i,
  47485. x: 0,
  47486. y: 0,
  47487. z: 0,
  47488. scale: 1,
  47489. rotation: 0,
  47490. opacity: o,
  47491. color: r,
  47492. blending: n
  47493. })
  47494. }
  47495. ,
  47496. Ci.LensFlare.prototype.updateLensFlares = function() {
  47497. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47498. for (e = 0; e < i; e++)
  47499. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47500. t.y = this.positionScreen.y + r * t.distance,
  47501. t.wantedRotation = t.x * Math.PI * .25,
  47502. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47503. }
  47504. ,
  47505. Ci.LensFlare.prototype.copy = function(e) {
  47506. Ci.Object3D.prototype.copy.call(this, e),
  47507. this.positionScreen.copy(e.positionScreen),
  47508. this.customUpdateCallback = e.customUpdateCallback;
  47509. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47510. this.lensFlares.push(e.lensFlares[t]);
  47511. return this
  47512. }
  47513. ,
  47514. Ci.Scene = function() {
  47515. Ci.Object3D.call(this),
  47516. this.type = "Scene",
  47517. this.fog = null,
  47518. this.overrideMaterial = null,
  47519. this.autoUpdate = !0
  47520. }
  47521. ,
  47522. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47523. Ci.Scene.prototype.constructor = Ci.Scene,
  47524. Ci.Scene.prototype.copy = function(e, t) {
  47525. return Ci.Object3D.prototype.copy.call(this, e, t),
  47526. null !== e.fog && (this.fog = e.fog.clone()),
  47527. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47528. this.autoUpdate = e.autoUpdate,
  47529. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47530. this
  47531. }
  47532. ,
  47533. Ci.Fog = function(e, t, i) {
  47534. this.name = "",
  47535. this.color = new Ci.Color(e),
  47536. this.near = void 0 !== t ? t : 1,
  47537. this.far = void 0 !== i ? i : 1e3
  47538. }
  47539. ,
  47540. Ci.Fog.prototype.clone = function() {
  47541. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47542. }
  47543. ,
  47544. Ci.FogExp2 = function(e, t) {
  47545. this.name = "",
  47546. this.color = new Ci.Color(e),
  47547. this.density = void 0 !== t ? t : 25e-5
  47548. }
  47549. ,
  47550. Ci.FogExp2.prototype.clone = function() {
  47551. return new Ci.FogExp2(this.color.getHex(),this.density)
  47552. }
  47553. ,
  47554. Ci.ShaderChunk = {},
  47555. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47556. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47557. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47558. 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",
  47559. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47560. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47561. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47562. 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",
  47563. 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",
  47564. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47565. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47566. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47567. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47568. 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",
  47569. 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",
  47570. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47571. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47572. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47573. 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",
  47574. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47575. 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",
  47576. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47577. 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",
  47578. 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",
  47579. 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",
  47580. 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",
  47581. 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",
  47582. 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",
  47583. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47584. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47585. 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",
  47586. 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",
  47587. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47588. 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",
  47589. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47590. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47591. 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",
  47592. 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",
  47593. 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",
  47594. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47595. 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",
  47596. 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",
  47597. 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",
  47598. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47599. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47600. 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",
  47601. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47602. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47603. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47604. 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",
  47605. 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",
  47606. 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",
  47607. 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",
  47608. 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",
  47609. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47610. 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",
  47611. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47612. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47613. 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",
  47614. 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",
  47615. 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",
  47616. 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",
  47617. 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",
  47618. 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",
  47619. 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",
  47620. 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",
  47621. 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",
  47622. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47623. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47624. 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",
  47625. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47626. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47627. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47628. 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",
  47629. 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",
  47630. 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",
  47631. 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",
  47632. Ci.UniformsUtils = {
  47633. merge: function(e) {
  47634. for (var t = {}, i = 0; i < e.length; i++) {
  47635. var n = this.clone(e[i]);
  47636. for (var r in n)
  47637. t[r] = n[r]
  47638. }
  47639. return t
  47640. },
  47641. clone: function(e) {
  47642. var t = {};
  47643. for (var i in e)
  47644. for (var n in t[i] = {},
  47645. e[i]) {
  47646. var r = e[i][n];
  47647. 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
  47648. }
  47649. return t
  47650. }
  47651. },
  47652. Ci.UniformsLib = {
  47653. common: {
  47654. diffuse: {
  47655. type: "c",
  47656. value: new Ci.Color(15658734)
  47657. },
  47658. opacity: {
  47659. type: "f",
  47660. value: 1
  47661. },
  47662. map: {
  47663. type: "t",
  47664. value: null
  47665. },
  47666. offsetRepeat: {
  47667. type: "v4",
  47668. value: new Ci.Vector4(0,0,1,1)
  47669. },
  47670. specularMap: {
  47671. type: "t",
  47672. value: null
  47673. },
  47674. alphaMap: {
  47675. type: "t",
  47676. value: null
  47677. },
  47678. envMap: {
  47679. type: "t",
  47680. value: null
  47681. },
  47682. flipEnvMap: {
  47683. type: "f",
  47684. value: -1
  47685. },
  47686. reflectivity: {
  47687. type: "f",
  47688. value: 1
  47689. },
  47690. refractionRatio: {
  47691. type: "f",
  47692. value: .98
  47693. }
  47694. },
  47695. aomap: {
  47696. aoMap: {
  47697. type: "t",
  47698. value: null
  47699. },
  47700. aoMapIntensity: {
  47701. type: "f",
  47702. value: 1
  47703. }
  47704. },
  47705. lightmap: {
  47706. lightMap: {
  47707. type: "t",
  47708. value: null
  47709. },
  47710. lightMapIntensity: {
  47711. type: "f",
  47712. value: 1
  47713. }
  47714. },
  47715. emissivemap: {
  47716. emissiveMap: {
  47717. type: "t",
  47718. value: null
  47719. }
  47720. },
  47721. bumpmap: {
  47722. bumpMap: {
  47723. type: "t",
  47724. value: null
  47725. },
  47726. bumpScale: {
  47727. type: "f",
  47728. value: 1
  47729. }
  47730. },
  47731. normalmap: {
  47732. normalMap: {
  47733. type: "t",
  47734. value: null
  47735. },
  47736. normalScale: {
  47737. type: "v2",
  47738. value: new Ci.Vector2(1,1)
  47739. }
  47740. },
  47741. displacementmap: {
  47742. displacementMap: {
  47743. type: "t",
  47744. value: null
  47745. },
  47746. displacementScale: {
  47747. type: "f",
  47748. value: 1
  47749. },
  47750. displacementBias: {
  47751. type: "f",
  47752. value: 0
  47753. }
  47754. },
  47755. roughnessmap: {
  47756. roughnessMap: {
  47757. type: "t",
  47758. value: null
  47759. }
  47760. },
  47761. metalnessmap: {
  47762. metalnessMap: {
  47763. type: "t",
  47764. value: null
  47765. }
  47766. },
  47767. fog: {
  47768. fogDensity: {
  47769. type: "f",
  47770. value: 25e-5
  47771. },
  47772. fogNear: {
  47773. type: "f",
  47774. value: 1
  47775. },
  47776. fogFar: {
  47777. type: "f",
  47778. value: 2e3
  47779. },
  47780. fogColor: {
  47781. type: "c",
  47782. value: new Ci.Color(16777215)
  47783. }
  47784. },
  47785. lights: {
  47786. ambientLightColor: {
  47787. type: "fv",
  47788. value: []
  47789. },
  47790. directionalLights: {
  47791. type: "sa",
  47792. value: [],
  47793. properties: {
  47794. direction: {
  47795. type: "v3"
  47796. },
  47797. color: {
  47798. type: "c"
  47799. },
  47800. shadow: {
  47801. type: "i"
  47802. },
  47803. shadowBias: {
  47804. type: "f"
  47805. },
  47806. shadowRadius: {
  47807. type: "f"
  47808. },
  47809. shadowMapSize: {
  47810. type: "v2"
  47811. }
  47812. }
  47813. },
  47814. directionalShadowMap: {
  47815. type: "tv",
  47816. value: []
  47817. },
  47818. directionalShadowMatrix: {
  47819. type: "m4v",
  47820. value: []
  47821. },
  47822. spotLights: {
  47823. type: "sa",
  47824. value: [],
  47825. properties: {
  47826. color: {
  47827. type: "c"
  47828. },
  47829. position: {
  47830. type: "v3"
  47831. },
  47832. direction: {
  47833. type: "v3"
  47834. },
  47835. distance: {
  47836. type: "f"
  47837. },
  47838. coneCos: {
  47839. type: "f"
  47840. },
  47841. penumbraCos: {
  47842. type: "f"
  47843. },
  47844. decay: {
  47845. type: "f"
  47846. },
  47847. shadow: {
  47848. type: "i"
  47849. },
  47850. shadowBias: {
  47851. type: "f"
  47852. },
  47853. shadowRadius: {
  47854. type: "f"
  47855. },
  47856. shadowMapSize: {
  47857. type: "v2"
  47858. }
  47859. }
  47860. },
  47861. spotShadowMap: {
  47862. type: "tv",
  47863. value: []
  47864. },
  47865. spotShadowMatrix: {
  47866. type: "m4v",
  47867. value: []
  47868. },
  47869. pointLights: {
  47870. type: "sa",
  47871. value: [],
  47872. properties: {
  47873. color: {
  47874. type: "c"
  47875. },
  47876. position: {
  47877. type: "v3"
  47878. },
  47879. decay: {
  47880. type: "f"
  47881. },
  47882. distance: {
  47883. type: "f"
  47884. },
  47885. shadow: {
  47886. type: "i"
  47887. },
  47888. shadowBias: {
  47889. type: "f"
  47890. },
  47891. shadowRadius: {
  47892. type: "f"
  47893. },
  47894. shadowMapSize: {
  47895. type: "v2"
  47896. }
  47897. }
  47898. },
  47899. pointShadowMap: {
  47900. type: "tv",
  47901. value: []
  47902. },
  47903. pointShadowMatrix: {
  47904. type: "m4v",
  47905. value: []
  47906. },
  47907. hemisphereLights: {
  47908. type: "sa",
  47909. value: [],
  47910. properties: {
  47911. direction: {
  47912. type: "v3"
  47913. },
  47914. skyColor: {
  47915. type: "c"
  47916. },
  47917. groundColor: {
  47918. type: "c"
  47919. }
  47920. }
  47921. }
  47922. },
  47923. points: {
  47924. diffuse: {
  47925. type: "c",
  47926. value: new Ci.Color(15658734)
  47927. },
  47928. opacity: {
  47929. type: "f",
  47930. value: 1
  47931. },
  47932. size: {
  47933. type: "f",
  47934. value: 1
  47935. },
  47936. scale: {
  47937. type: "f",
  47938. value: 1
  47939. },
  47940. map: {
  47941. type: "t",
  47942. value: null
  47943. },
  47944. offsetRepeat: {
  47945. type: "v4",
  47946. value: new Ci.Vector4(0,0,1,1)
  47947. }
  47948. }
  47949. },
  47950. 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",
  47951. 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",
  47952. 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",
  47953. 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",
  47954. 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",
  47955. 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",
  47956. 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",
  47957. 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",
  47958. 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",
  47959. 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",
  47960. 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",
  47961. 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",
  47962. 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",
  47963. 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",
  47964. 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",
  47965. 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",
  47966. 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",
  47967. 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",
  47968. 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",
  47969. 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",
  47970. 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",
  47971. 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",
  47972. 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",
  47973. 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",
  47974. Ci.ShaderLib = {
  47975. basic: {
  47976. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47977. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47978. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47979. },
  47980. lambert: {
  47981. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47982. emissive: {
  47983. type: "c",
  47984. value: new Ci.Color(0)
  47985. }
  47986. }]),
  47987. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47988. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47989. },
  47990. phong: {
  47991. 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, {
  47992. emissive: {
  47993. type: "c",
  47994. value: new Ci.Color(0)
  47995. },
  47996. specular: {
  47997. type: "c",
  47998. value: new Ci.Color(1118481)
  47999. },
  48000. shininess: {
  48001. type: "f",
  48002. value: 30
  48003. }
  48004. }]),
  48005. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48006. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48007. },
  48008. standard: {
  48009. 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, {
  48010. emissive: {
  48011. type: "c",
  48012. value: new Ci.Color(0)
  48013. },
  48014. roughness: {
  48015. type: "f",
  48016. value: .5
  48017. },
  48018. metalness: {
  48019. type: "f",
  48020. value: 0
  48021. },
  48022. envMapIntensity: {
  48023. type: "f",
  48024. value: 1
  48025. }
  48026. }]),
  48027. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48028. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48029. },
  48030. points: {
  48031. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48032. vertexShader: Ci.ShaderChunk.points_vert,
  48033. fragmentShader: Ci.ShaderChunk.points_frag
  48034. },
  48035. dashed: {
  48036. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48037. scale: {
  48038. type: "f",
  48039. value: 1
  48040. },
  48041. dashSize: {
  48042. type: "f",
  48043. value: 1
  48044. },
  48045. totalSize: {
  48046. type: "f",
  48047. value: 2
  48048. }
  48049. }]),
  48050. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48051. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48052. },
  48053. depth: {
  48054. uniforms: {
  48055. mNear: {
  48056. type: "f",
  48057. value: 1
  48058. },
  48059. mFar: {
  48060. type: "f",
  48061. value: 2e3
  48062. },
  48063. opacity: {
  48064. type: "f",
  48065. value: 1
  48066. }
  48067. },
  48068. vertexShader: Ci.ShaderChunk.depth_vert,
  48069. fragmentShader: Ci.ShaderChunk.depth_frag
  48070. },
  48071. normal: {
  48072. uniforms: {
  48073. opacity: {
  48074. type: "f",
  48075. value: 1
  48076. }
  48077. },
  48078. vertexShader: Ci.ShaderChunk.normal_vert,
  48079. fragmentShader: Ci.ShaderChunk.normal_frag
  48080. },
  48081. cube: {
  48082. uniforms: {
  48083. tCube: {
  48084. type: "t",
  48085. value: null
  48086. },
  48087. tFlip: {
  48088. type: "f",
  48089. value: -1
  48090. }
  48091. },
  48092. vertexShader: Ci.ShaderChunk.cube_vert,
  48093. fragmentShader: Ci.ShaderChunk.cube_frag
  48094. },
  48095. equirect: {
  48096. uniforms: {
  48097. tEquirect: {
  48098. type: "t",
  48099. value: null
  48100. },
  48101. tFlip: {
  48102. type: "f",
  48103. value: -1
  48104. }
  48105. },
  48106. vertexShader: Ci.ShaderChunk.equirect_vert,
  48107. fragmentShader: Ci.ShaderChunk.equirect_frag
  48108. },
  48109. depthRGBA: {
  48110. uniforms: {},
  48111. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48112. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48113. },
  48114. distanceRGBA: {
  48115. uniforms: {
  48116. lightPos: {
  48117. type: "v3",
  48118. value: new Ci.Vector3(0,0,0)
  48119. }
  48120. },
  48121. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48122. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48123. }
  48124. },
  48125. Ci.WebGLRenderer = function(e) {
  48126. function S() {
  48127. return null === Q ? he : 1
  48128. }
  48129. function i(e, t, i, n) {
  48130. !0 === V && (e *= n,
  48131. t *= n,
  48132. i *= n),
  48133. _e.clearColor(e, t, i, n)
  48134. }
  48135. function t() {
  48136. _e.init(),
  48137. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48138. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48139. i(ae.r, ae.g, ae.b, se)
  48140. }
  48141. function n() {
  48142. te = K = null,
  48143. ee = "",
  48144. $ = -1,
  48145. _e.reset()
  48146. }
  48147. function r(e) {
  48148. e.preventDefault(),
  48149. n(),
  48150. t(),
  48151. be.clear()
  48152. }
  48153. function f(e) {
  48154. var t = e.target;
  48155. t.removeEventListener("dispose", f),
  48156. function(e) {
  48157. var t = be.get(e);
  48158. if (e.image && t.__image__webglTextureCube)
  48159. X.deleteTexture(t.__image__webglTextureCube);
  48160. else {
  48161. if (void 0 === t.__webglInit)
  48162. return;
  48163. X.deleteTexture(t.__webglTexture)
  48164. }
  48165. be.delete(e)
  48166. }(t),
  48167. ye.textures--
  48168. }
  48169. function a(e) {
  48170. var t = e.target;
  48171. t.removeEventListener("dispose", a),
  48172. function(e) {
  48173. var t = be.get(e)
  48174. , i = be.get(e.texture);
  48175. if (e && void 0 !== i.__webglTexture) {
  48176. if (X.deleteTexture(i.__webglTexture),
  48177. e instanceof Ci.WebGLRenderTargetCube)
  48178. for (var n = 0; n < 6; n++)
  48179. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48180. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48181. else
  48182. X.deleteFramebuffer(t.__webglFramebuffer),
  48183. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48184. be.delete(e.texture),
  48185. be.delete(e)
  48186. }
  48187. }(t),
  48188. ye.textures--
  48189. }
  48190. function v(e) {
  48191. var t = e.target;
  48192. t.removeEventListener("dispose", v),
  48193. function(e) {
  48194. y(e),
  48195. be.delete(e)
  48196. }(t)
  48197. }
  48198. function y(e) {
  48199. var t = be.get(e).program;
  48200. (e.program = void 0) !== t && Te.releaseProgram(t)
  48201. }
  48202. function M(e, t) {
  48203. return Math.abs(t[0]) - Math.abs(e[0])
  48204. }
  48205. function s(e, t) {
  48206. 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
  48207. }
  48208. function l(e, t) {
  48209. 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
  48210. }
  48211. function d(e, t, i, n, r) {
  48212. var o, a;
  48213. a = i.transparent ? (o = G,
  48214. ++W) : (o = H,
  48215. ++z);
  48216. var s = o[a];
  48217. void 0 !== s ? (s.id = e.id,
  48218. s.object = e,
  48219. s.geometry = t,
  48220. s.material = i,
  48221. s.z = me.z,
  48222. s.group = r) : (s = {
  48223. id: e.id,
  48224. object: e,
  48225. geometry: t,
  48226. material: i,
  48227. z: me.z,
  48228. group: r
  48229. },
  48230. o.push(s))
  48231. }
  48232. function c(e, t, i, n) {
  48233. for (var r = 0, o = e.length; r < o; r++) {
  48234. var a = e[r]
  48235. , s = a.object
  48236. , l = a.geometry
  48237. , c = void 0 === n ? a.material : n
  48238. , h = a.group;
  48239. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48240. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48241. s instanceof Ci.ImmediateRenderObject) {
  48242. R(c);
  48243. var u = P(t, i, c, s);
  48244. ee = "",
  48245. s.render(function(e) {
  48246. Z.renderBufferImmediate(e, u, c)
  48247. })
  48248. } else
  48249. Z.renderBufferDirect(t, i, l, c, s, h)
  48250. }
  48251. }
  48252. function R(e) {
  48253. (function(e) {
  48254. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48255. _e.setFlipSided(e.side === Ci.BackSide)
  48256. }
  48257. )(e),
  48258. !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),
  48259. _e.setDepthFunc(e.depthFunc),
  48260. _e.setDepthTest(e.depthTest),
  48261. _e.setDepthWrite(e.depthWrite),
  48262. _e.setColorWrite(e.colorWrite),
  48263. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48264. }
  48265. function P(e, t, i, n) {
  48266. oe = 0;
  48267. var r = be.get(i);
  48268. void 0 === r.program && (i.needsUpdate = !0),
  48269. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48270. i.needsUpdate && (function(e, t, i) {
  48271. var n = be.get(e)
  48272. , r = Te.getParameters(e, ve, t, i)
  48273. , o = Te.getProgramCode(e, r)
  48274. , a = n.program
  48275. , s = !0;
  48276. if (void 0 === a)
  48277. e.addEventListener("dispose", v);
  48278. else if (a.code !== o)
  48279. y(e);
  48280. else {
  48281. if (void 0 !== r.shaderID)
  48282. return;
  48283. s = !1
  48284. }
  48285. if (s) {
  48286. if (r.shaderID) {
  48287. var l = Ci.ShaderLib[r.shaderID];
  48288. n.__webglShader = {
  48289. name: e.type,
  48290. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48291. vertexShader: l.vertexShader,
  48292. fragmentShader: l.fragmentShader
  48293. }
  48294. } else
  48295. n.__webglShader = {
  48296. name: e.type,
  48297. uniforms: e.uniforms,
  48298. vertexShader: e.vertexShader,
  48299. fragmentShader: e.fragmentShader
  48300. };
  48301. e.__webglShader = n.__webglShader,
  48302. a = Te.acquireProgram(e, r, o),
  48303. n.program = a,
  48304. e.program = a
  48305. }
  48306. var c = a.getAttributes();
  48307. if (e.morphTargets)
  48308. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48309. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48310. if (e.morphNormals)
  48311. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48312. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48313. n.uniformsList = [];
  48314. var u = n.__webglShader.uniforms
  48315. , d = n.program.getUniforms();
  48316. for (var p in u) {
  48317. var f = d[p];
  48318. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48319. }
  48320. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48321. u.ambientLightColor.value = ve.ambient,
  48322. u.directionalLights.value = ve.directional,
  48323. u.spotLights.value = ve.spot,
  48324. u.pointLights.value = ve.point,
  48325. u.hemisphereLights.value = ve.hemi,
  48326. u.directionalShadowMap.value = ve.directionalShadowMap,
  48327. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48328. u.spotShadowMap.value = ve.spotShadowMap,
  48329. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48330. u.pointShadowMap.value = ve.pointShadowMap,
  48331. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48332. n.hasDynamicUniforms = !1;
  48333. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48334. if (!0 === n.uniformsList[g][0].dynamic) {
  48335. n.hasDynamicUniforms = !0;
  48336. break
  48337. }
  48338. }
  48339. }(i, t, n),
  48340. i.needsUpdate = !1);
  48341. var o = !1
  48342. , a = !1
  48343. , s = !1
  48344. , l = r.program
  48345. , c = l.getUniforms()
  48346. , h = r.__webglShader.uniforms;
  48347. if (l.id !== K && (X.useProgram(l.program),
  48348. K = l.id,
  48349. s = a = o = !0),
  48350. i.id !== $ && ($ = i.id,
  48351. a = !0),
  48352. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48353. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48354. e !== te && (te = e,
  48355. s = a = !0),
  48356. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48357. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48358. (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),
  48359. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48360. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48361. i.skinning)
  48362. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48363. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48364. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48365. if (void 0 !== c.boneTexture) {
  48366. var u = A();
  48367. X.uniform1i(c.boneTexture, u),
  48368. Z.setTexture(n.skeleton.boneTexture, u)
  48369. }
  48370. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48371. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48372. } else
  48373. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48374. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48375. e.ambientLightColor.needsUpdate = t,
  48376. e.directionalLights.needsUpdate = t,
  48377. e.pointLights.needsUpdate = t,
  48378. e.spotLights.needsUpdate = t,
  48379. e.hemisphereLights.needsUpdate = t
  48380. }(h, s),
  48381. t && i.fog && function(e, t) {
  48382. e.fogColor.value = t.color,
  48383. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48384. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48385. }(h, t),
  48386. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48387. var i;
  48388. if (e.opacity.value = t.opacity,
  48389. e.diffuse.value = t.color,
  48390. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48391. e.map.value = t.map,
  48392. e.specularMap.value = t.specularMap,
  48393. e.alphaMap.value = t.alphaMap,
  48394. t.aoMap && (e.aoMap.value = t.aoMap,
  48395. e.aoMapIntensity.value = t.aoMapIntensity),
  48396. 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),
  48397. void 0 !== i) {
  48398. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48399. var n = i.offset
  48400. , r = i.repeat;
  48401. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48402. }
  48403. e.envMap.value = t.envMap,
  48404. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48405. e.reflectivity.value = t.reflectivity,
  48406. e.refractionRatio.value = t.refractionRatio
  48407. }(h, i),
  48408. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48409. function(e, t) {
  48410. e.dashSize.value = t.dashSize,
  48411. e.totalSize.value = t.dashSize + t.gapSize,
  48412. e.scale.value = t.scale
  48413. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48414. if (e.diffuse.value = t.color,
  48415. e.opacity.value = t.opacity,
  48416. e.size.value = t.size * he,
  48417. e.scale.value = O.clientHeight / 2,
  48418. e.map.value = t.map,
  48419. null !== t.map) {
  48420. var i = t.map.offset
  48421. , n = t.map.repeat;
  48422. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48423. }
  48424. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48425. t.lightMap && (e.lightMap.value = t.lightMap,
  48426. e.lightMapIntensity.value = t.lightMapIntensity),
  48427. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48428. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48429. e.specular.value = t.specular,
  48430. e.shininess.value = Math.max(t.shininess, 1e-4),
  48431. t.lightMap && (e.lightMap.value = t.lightMap,
  48432. e.lightMapIntensity.value = t.lightMapIntensity),
  48433. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48434. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48435. e.bumpScale.value = t.bumpScale),
  48436. t.normalMap && (e.normalMap.value = t.normalMap,
  48437. e.normalScale.value.copy(t.normalScale)),
  48438. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48439. e.displacementScale.value = t.displacementScale,
  48440. e.displacementBias.value = t.displacementBias)
  48441. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48442. e.roughness.value = t.roughness,
  48443. e.metalness.value = t.metalness,
  48444. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48445. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48446. t.lightMap && (e.lightMap.value = t.lightMap,
  48447. e.lightMapIntensity.value = t.lightMapIntensity),
  48448. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48449. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48450. e.bumpScale.value = t.bumpScale),
  48451. t.normalMap && (e.normalMap.value = t.normalMap,
  48452. e.normalScale.value.copy(t.normalScale)),
  48453. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48454. e.displacementScale.value = t.displacementScale,
  48455. e.displacementBias.value = t.displacementBias),
  48456. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48457. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48458. h.mFar.value = e.far,
  48459. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48460. g(r.uniformsList)),
  48461. function(e, t) {
  48462. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48463. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48464. }(c, n),
  48465. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48466. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48467. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48468. var a = e[r][0]
  48469. , s = a.onUpdateCallback;
  48470. void 0 !== s && (s.bind(a)(t, i),
  48471. n.push(e[r]))
  48472. }
  48473. g(n)
  48474. }(r.uniformsList, n, e),
  48475. l
  48476. }
  48477. function p(e, t) {
  48478. e.diffuse.value = t.color,
  48479. e.opacity.value = t.opacity
  48480. }
  48481. function A() {
  48482. var e = oe;
  48483. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48484. oe += 1,
  48485. e
  48486. }
  48487. function C(e, t, i, n) {
  48488. var r, o;
  48489. if ("1i" === t)
  48490. X.uniform1i(i, n);
  48491. else if ("1f" === t)
  48492. X.uniform1f(i, n);
  48493. else if ("2f" === t)
  48494. X.uniform2f(i, n[0], n[1]);
  48495. else if ("3f" === t)
  48496. X.uniform3f(i, n[0], n[1], n[2]);
  48497. else if ("4f" === t)
  48498. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48499. else if ("1iv" === t)
  48500. X.uniform1iv(i, n);
  48501. else if ("3iv" === t)
  48502. X.uniform3iv(i, n);
  48503. else if ("1fv" === t)
  48504. X.uniform1fv(i, n);
  48505. else if ("2fv" === t)
  48506. X.uniform2fv(i, n);
  48507. else if ("3fv" === t)
  48508. X.uniform3fv(i, n);
  48509. else if ("4fv" === t)
  48510. X.uniform4fv(i, n);
  48511. else if ("Matrix2fv" === t)
  48512. X.uniformMatrix2fv(i, !1, n);
  48513. else if ("Matrix3fv" === t)
  48514. X.uniformMatrix3fv(i, !1, n);
  48515. else if ("Matrix4fv" === t)
  48516. X.uniformMatrix4fv(i, !1, n);
  48517. else if ("i" === t)
  48518. X.uniform1i(i, n);
  48519. else if ("f" === t)
  48520. X.uniform1f(i, n);
  48521. else if ("v2" === t)
  48522. X.uniform2f(i, n.x, n.y);
  48523. else if ("v3" === t)
  48524. X.uniform3f(i, n.x, n.y, n.z);
  48525. else if ("v4" === t)
  48526. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48527. else if ("c" === t)
  48528. X.uniform3f(i, n.r, n.g, n.b);
  48529. else if ("s" === t) {
  48530. var a = e.properties;
  48531. for (var s in a) {
  48532. var l = a[s]
  48533. , c = i[s]
  48534. , h = n[s];
  48535. C(l, l.type, c, h)
  48536. }
  48537. } else if ("sa" === t) {
  48538. a = e.properties;
  48539. for (var u = 0, d = n.length; u < d; u++)
  48540. for (var s in a) {
  48541. l = a[s],
  48542. c = i[u][s],
  48543. h = n[u][s];
  48544. C(l, l.type, c, h)
  48545. }
  48546. } else if ("iv1" === t)
  48547. X.uniform1iv(i, n);
  48548. else if ("iv" === t)
  48549. X.uniform3iv(i, n);
  48550. else if ("fv1" === t)
  48551. X.uniform1fv(i, n);
  48552. else if ("fv" === t)
  48553. X.uniform3fv(i, n);
  48554. else if ("v2v" === t) {
  48555. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48556. u = 0;
  48557. for (var p = 0, f = n.length; u < f; u++,
  48558. p += 2)
  48559. e._array[p + 0] = n[u].x,
  48560. e._array[p + 1] = n[u].y;
  48561. X.uniform2fv(i, e._array)
  48562. } else if ("v3v" === t) {
  48563. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48564. u = 0;
  48565. var g = 0;
  48566. for (f = n.length; u < f; u++,
  48567. g += 3)
  48568. e._array[g + 0] = n[u].x,
  48569. e._array[g + 1] = n[u].y,
  48570. e._array[g + 2] = n[u].z;
  48571. X.uniform3fv(i, e._array)
  48572. } else if ("v4v" === t) {
  48573. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48574. u = 0;
  48575. var m = 0;
  48576. for (f = n.length; u < f; u++,
  48577. m += 4)
  48578. e._array[m + 0] = n[u].x,
  48579. e._array[m + 1] = n[u].y,
  48580. e._array[m + 2] = n[u].z,
  48581. e._array[m + 3] = n[u].w;
  48582. X.uniform4fv(i, e._array)
  48583. } else if ("m2" === t)
  48584. X.uniformMatrix2fv(i, !1, n.elements);
  48585. else if ("m3" === t)
  48586. X.uniformMatrix3fv(i, !1, n.elements);
  48587. else if ("m3v" === t) {
  48588. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48589. for (u = 0,
  48590. f = n.length; u < f; u++)
  48591. n[u].flattenToArrayOffset(e._array, 9 * u);
  48592. X.uniformMatrix3fv(i, !1, e._array)
  48593. } else if ("m4" === t)
  48594. X.uniformMatrix4fv(i, !1, n.elements);
  48595. else if ("m4v" === t) {
  48596. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48597. for (u = 0,
  48598. f = n.length; u < f; u++)
  48599. n[u].flattenToArrayOffset(e._array, 16 * u);
  48600. X.uniformMatrix4fv(i, !1, e._array)
  48601. } else if ("t" === t) {
  48602. if (r = n,
  48603. o = A(),
  48604. X.uniform1i(i, o),
  48605. !r)
  48606. return;
  48607. 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)
  48608. } else if ("tv" === t) {
  48609. void 0 === e._array && (e._array = []);
  48610. for (u = 0,
  48611. f = e.value.length; u < f; u++)
  48612. e._array[u] = A();
  48613. X.uniform1iv(i, e._array);
  48614. for (u = 0,
  48615. f = e.value.length; u < f; u++)
  48616. r = e.value[u],
  48617. o = e._array[u],
  48618. 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))
  48619. } else
  48620. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48621. }
  48622. function g(e) {
  48623. for (var t = 0, i = e.length; t < i; t++) {
  48624. var n = e[t][0];
  48625. if (!1 !== n.needsUpdate)
  48626. C(n, n.type, e[t][1], n.value)
  48627. }
  48628. }
  48629. function m(e, t, i) {
  48630. var n;
  48631. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48632. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48633. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48634. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48635. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48636. 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),
  48637. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48638. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48639. 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)),
  48640. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48641. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48642. return;
  48643. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48644. return;
  48645. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48646. be.get(t).__currentAnisotropy = t.anisotropy)
  48647. }
  48648. }
  48649. function o(e, t, i) {
  48650. void 0 === e.__webglInit && (e.__webglInit = !0,
  48651. t.addEventListener("dispose", f),
  48652. e.__webglTexture = X.createTexture(),
  48653. ye.textures++),
  48654. _e.activeTexture(X.TEXTURE0 + i),
  48655. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48656. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48657. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48658. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48659. var n = I(t.image, Ee.maxTextureSize);
  48660. !function(e) {
  48661. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48662. }(t) || !1 !== E(n) || (n = function(e) {
  48663. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48664. var t = document.createElement("canvas");
  48665. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48666. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48667. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48668. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48669. t
  48670. }
  48671. return e
  48672. }(n));
  48673. var r = E(n)
  48674. , o = x(t.format)
  48675. , a = x(t.type);
  48676. m(X.TEXTURE_2D, t, r);
  48677. var s, l = t.mipmaps;
  48678. if (t instanceof Ci.DataTexture)
  48679. if (0 < l.length && r) {
  48680. for (var c = 0, h = l.length; c < h; c++)
  48681. s = l[c],
  48682. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48683. t.generateMipmaps = !1
  48684. } else
  48685. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48686. else if (t instanceof Ci.CompressedTexture)
  48687. for (c = 0,
  48688. h = l.length; c < h; c++)
  48689. s = l[c],
  48690. 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);
  48691. else if (0 < l.length && r) {
  48692. for (c = 0,
  48693. h = l.length; c < h; c++)
  48694. s = l[c],
  48695. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48696. t.generateMipmaps = !1
  48697. } else
  48698. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48699. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48700. e.__version = t.version,
  48701. t.onUpdate && t.onUpdate(t)
  48702. }
  48703. function I(e, t) {
  48704. if (e.width > t || e.height > t) {
  48705. var i = t / Math.max(e.width, e.height)
  48706. , n = document.createElement("canvas");
  48707. return n.width = Math.floor(e.width * i),
  48708. n.height = Math.floor(e.height * i),
  48709. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48710. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48711. n
  48712. }
  48713. return e
  48714. }
  48715. function E(e) {
  48716. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48717. }
  48718. function _(e, t) {
  48719. var i = be.get(e);
  48720. if (6 === e.image.length)
  48721. if (0 < e.version && i.__version !== e.version) {
  48722. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48723. i.__image__webglTextureCube = X.createTexture(),
  48724. ye.textures++),
  48725. _e.activeTexture(X.TEXTURE0 + t),
  48726. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48727. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48728. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48729. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48730. var s = E(o[0])
  48731. , l = x(e.format)
  48732. , c = x(e.type);
  48733. m(X.TEXTURE_CUBE_MAP, e, s);
  48734. for (a = 0; a < 6; a++)
  48735. if (n)
  48736. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48737. h = u[d],
  48738. 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);
  48739. else
  48740. 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]);
  48741. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48742. i.__version = e.version,
  48743. e.onUpdate && e.onUpdate(e)
  48744. } else
  48745. _e.activeTexture(X.TEXTURE0 + t),
  48746. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48747. }
  48748. function b(e, t) {
  48749. _e.activeTexture(X.TEXTURE0 + t),
  48750. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48751. }
  48752. function h(e, t, i, n) {
  48753. var r = x(t.texture.format)
  48754. , o = x(t.texture.type);
  48755. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48756. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48757. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48758. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48759. }
  48760. function u(e, t) {
  48761. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48762. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48763. 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),
  48764. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48765. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48766. }
  48767. function w(e) {
  48768. var t = be.get(e)
  48769. , i = be.get(e.texture);
  48770. e.addEventListener("dispose", a),
  48771. i.__webglTexture = X.createTexture(),
  48772. ye.textures++;
  48773. var n = e instanceof Ci.WebGLRenderTargetCube
  48774. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48775. if (n) {
  48776. t.__webglFramebuffer = [];
  48777. for (var o = 0; o < 6; o++)
  48778. t.__webglFramebuffer[o] = X.createFramebuffer()
  48779. } else
  48780. t.__webglFramebuffer = X.createFramebuffer();
  48781. if (n) {
  48782. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48783. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48784. for (o = 0; o < 6; o++)
  48785. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48786. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48787. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48788. } else
  48789. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48790. m(X.TEXTURE_2D, e.texture, r),
  48791. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48792. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48793. _e.bindTexture(X.TEXTURE_2D, null);
  48794. e.depthBuffer && function(e) {
  48795. var t = be.get(e);
  48796. if (e instanceof Ci.WebGLRenderTargetCube) {
  48797. t.__webglDepthbuffer = [];
  48798. for (var i = 0; i < 6; i++)
  48799. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48800. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48801. u(t.__webglDepthbuffer[i], e)
  48802. } else
  48803. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48804. t.__webglDepthbuffer = X.createRenderbuffer(),
  48805. u(t.__webglDepthbuffer, e);
  48806. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48807. }(e)
  48808. }
  48809. function T(e) {
  48810. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48811. }
  48812. function x(e) {
  48813. var t;
  48814. if (e === Ci.RepeatWrapping)
  48815. return X.REPEAT;
  48816. if (e === Ci.ClampToEdgeWrapping)
  48817. return X.CLAMP_TO_EDGE;
  48818. if (e === Ci.MirroredRepeatWrapping)
  48819. return X.MIRRORED_REPEAT;
  48820. if (e === Ci.NearestFilter)
  48821. return X.NEAREST;
  48822. if (e === Ci.NearestMipMapNearestFilter)
  48823. return X.NEAREST_MIPMAP_NEAREST;
  48824. if (e === Ci.NearestMipMapLinearFilter)
  48825. return X.NEAREST_MIPMAP_LINEAR;
  48826. if (e === Ci.LinearFilter)
  48827. return X.LINEAR;
  48828. if (e === Ci.LinearMipMapNearestFilter)
  48829. return X.LINEAR_MIPMAP_NEAREST;
  48830. if (e === Ci.LinearMipMapLinearFilter)
  48831. return X.LINEAR_MIPMAP_LINEAR;
  48832. if (e === Ci.UnsignedByteType)
  48833. return X.UNSIGNED_BYTE;
  48834. if (e === Ci.UnsignedShort4444Type)
  48835. return X.UNSIGNED_SHORT_4_4_4_4;
  48836. if (e === Ci.UnsignedShort5551Type)
  48837. return X.UNSIGNED_SHORT_5_5_5_1;
  48838. if (e === Ci.UnsignedShort565Type)
  48839. return X.UNSIGNED_SHORT_5_6_5;
  48840. if (e === Ci.ByteType)
  48841. return X.BYTE;
  48842. if (e === Ci.ShortType)
  48843. return X.SHORT;
  48844. if (e === Ci.UnsignedShortType)
  48845. return X.UNSIGNED_SHORT;
  48846. if (e === Ci.IntType)
  48847. return X.INT;
  48848. if (e === Ci.UnsignedIntType)
  48849. return X.UNSIGNED_INT;
  48850. if (e === Ci.FloatType)
  48851. return X.FLOAT;
  48852. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48853. return t.HALF_FLOAT_OES;
  48854. if (e === Ci.AlphaFormat)
  48855. return X.ALPHA;
  48856. if (e === Ci.RGBFormat)
  48857. return X.RGB;
  48858. if (e === Ci.RGBAFormat)
  48859. return X.RGBA;
  48860. if (e === Ci.LuminanceFormat)
  48861. return X.LUMINANCE;
  48862. if (e === Ci.LuminanceAlphaFormat)
  48863. return X.LUMINANCE_ALPHA;
  48864. if (e === Ci.AddEquation)
  48865. return X.FUNC_ADD;
  48866. if (e === Ci.SubtractEquation)
  48867. return X.FUNC_SUBTRACT;
  48868. if (e === Ci.ReverseSubtractEquation)
  48869. return X.FUNC_REVERSE_SUBTRACT;
  48870. if (e === Ci.ZeroFactor)
  48871. return X.ZERO;
  48872. if (e === Ci.OneFactor)
  48873. return X.ONE;
  48874. if (e === Ci.SrcColorFactor)
  48875. return X.SRC_COLOR;
  48876. if (e === Ci.OneMinusSrcColorFactor)
  48877. return X.ONE_MINUS_SRC_COLOR;
  48878. if (e === Ci.SrcAlphaFactor)
  48879. return X.SRC_ALPHA;
  48880. if (e === Ci.OneMinusSrcAlphaFactor)
  48881. return X.ONE_MINUS_SRC_ALPHA;
  48882. if (e === Ci.DstAlphaFactor)
  48883. return X.DST_ALPHA;
  48884. if (e === Ci.OneMinusDstAlphaFactor)
  48885. return X.ONE_MINUS_DST_ALPHA;
  48886. if (e === Ci.DstColorFactor)
  48887. return X.DST_COLOR;
  48888. if (e === Ci.OneMinusDstColorFactor)
  48889. return X.ONE_MINUS_DST_COLOR;
  48890. if (e === Ci.SrcAlphaSaturateFactor)
  48891. return X.SRC_ALPHA_SATURATE;
  48892. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48893. if (e === Ci.RGB_S3TC_DXT1_Format)
  48894. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48895. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48896. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48897. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48898. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48899. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48900. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48901. }
  48902. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48903. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48904. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48905. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48906. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48907. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48908. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48909. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48910. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48911. }
  48912. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48913. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48914. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48915. if (e === Ci.MinEquation)
  48916. return t.MIN_EXT;
  48917. if (e === Ci.MaxEquation)
  48918. return t.MAX_EXT
  48919. }
  48920. return 0
  48921. }
  48922. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48923. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48924. , L = void 0 !== e.context ? e.context : null
  48925. , D = void 0 !== e.alpha && e.alpha
  48926. , N = void 0 === e.depth || e.depth
  48927. , F = void 0 === e.stencil || e.stencil
  48928. , B = void 0 !== e.antialias && e.antialias
  48929. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48930. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48931. , U = []
  48932. , H = []
  48933. , z = -1
  48934. , G = []
  48935. , W = -1
  48936. , j = new Float32Array(8)
  48937. , Y = []
  48938. , q = [];
  48939. this.domElement = O,
  48940. this.context = null,
  48941. this.autoClear = !0,
  48942. this.autoClearColor = !0,
  48943. this.autoClearDepth = !0,
  48944. this.autoClearStencil = !0,
  48945. this.sortObjects = !0,
  48946. this.gammaFactor = 2,
  48947. this.gammaInput = !1,
  48948. this.gammaOutput = !1,
  48949. this.physicallyCorrectLights = !1,
  48950. this.toneMapping = Ci.LinearToneMapping,
  48951. this.toneMappingExposure = 1,
  48952. this.toneMappingWhitePoint = 1,
  48953. this.maxMorphTargets = 8,
  48954. this.maxMorphNormals = 4,
  48955. this.autoScaleCubemaps = !0;
  48956. 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 = {
  48957. hash: "",
  48958. ambient: [0, 0, 0],
  48959. directional: [],
  48960. directionalShadowMap: [],
  48961. directionalShadowMatrix: [],
  48962. spot: [],
  48963. spotShadowMap: [],
  48964. spotShadowMatrix: [],
  48965. point: [],
  48966. pointShadowMap: [],
  48967. pointShadowMatrix: [],
  48968. hemi: [],
  48969. shadows: [],
  48970. shadowsPointLight: 0
  48971. }, ye = {
  48972. geometries: 0,
  48973. textures: 0
  48974. }, Ae = {
  48975. calls: 0,
  48976. vertices: 0,
  48977. faces: 0,
  48978. points: 0
  48979. };
  48980. this.info = {
  48981. render: Ae,
  48982. memory: ye,
  48983. programs: null
  48984. };
  48985. try {
  48986. var Ce = {
  48987. alpha: D,
  48988. depth: N,
  48989. stencil: F,
  48990. antialias: B,
  48991. premultipliedAlpha: V,
  48992. preserveDrawingBuffer: k
  48993. };
  48994. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48995. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48996. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48997. return {
  48998. rangeMin: 1,
  48999. rangeMax: 1,
  49000. precision: 1
  49001. }
  49002. }
  49003. ),
  49004. O.addEventListener("webglcontextlost", r, !1)
  49005. } catch (e) {
  49006. console.error("THREE.WebGLRenderer: " + e)
  49007. }
  49008. var Ie = new Ci.WebGLExtensions(X);
  49009. Ie.get("OES_texture_float"),
  49010. Ie.get("OES_texture_float_linear"),
  49011. Ie.get("OES_texture_half_float"),
  49012. Ie.get("OES_texture_half_float_linear"),
  49013. Ie.get("OES_standard_derivatives"),
  49014. Ie.get("ANGLE_instanced_arrays"),
  49015. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49016. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49017. , _e = new Ci.WebGLState(X,Ie,x)
  49018. , be = new Ci.WebGLProperties
  49019. , we = new Ci.WebGLObjects(X,be,this.info)
  49020. , Te = new Ci.WebGLPrograms(this,Ee)
  49021. , xe = new Ci.WebGLLights;
  49022. this.info.programs = Te.programs;
  49023. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49024. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49025. t(),
  49026. this.context = X,
  49027. this.capabilities = Ee,
  49028. this.extensions = Ie,
  49029. this.properties = be,
  49030. this.state = _e;
  49031. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49032. this.shadowMap = Re;
  49033. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49034. this.getContext = function() {
  49035. return X
  49036. }
  49037. ,
  49038. this.getContextAttributes = function() {
  49039. return X.getContextAttributes()
  49040. }
  49041. ,
  49042. this.forceContextLoss = function() {
  49043. Ie.get("WEBGL_lose_context").loseContext()
  49044. }
  49045. ,
  49046. this.getMaxAnisotropy = function() {
  49047. if (void 0 !== Pe)
  49048. return Pe;
  49049. var e = Ie.get("EXT_texture_filter_anisotropic");
  49050. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49051. }
  49052. ,
  49053. this.getPrecision = function() {
  49054. return Ee.precision
  49055. }
  49056. ,
  49057. this.getPixelRatio = function() {
  49058. return he
  49059. }
  49060. ,
  49061. this.setPixelRatio = function(e) {
  49062. void 0 !== e && (he = e,
  49063. this.setSize(pe.z, pe.w, !1))
  49064. }
  49065. ,
  49066. this.getSize = function() {
  49067. return {
  49068. width: le,
  49069. height: ce
  49070. }
  49071. }
  49072. ,
  49073. this.setSize = function(e, t, i, n) {
  49074. null != n && (he = n),
  49075. le = e,
  49076. ce = t,
  49077. O.width = e * he,
  49078. O.height = t * he,
  49079. !1 !== i && (O.style.width = e + "px",
  49080. O.style.height = t + "px"),
  49081. this.setViewport(0, 0, e, t)
  49082. }
  49083. ,
  49084. this.setViewport = function(e, t, i, n) {
  49085. _e.viewport(pe.set(e, t, i, n))
  49086. }
  49087. ,
  49088. this.setScissor = function(e, t, i, n) {
  49089. _e.scissor(ue.set(e, t, i, n))
  49090. }
  49091. ,
  49092. this.setScissorTest = function(e) {
  49093. _e.setScissorTest(de = e)
  49094. }
  49095. ,
  49096. this.getClearColor = function() {
  49097. return ae
  49098. }
  49099. ,
  49100. this.setClearColor = function(e, t) {
  49101. ae.set(e),
  49102. se = void 0 !== t ? t : 1,
  49103. i(ae.r, ae.g, ae.b, se)
  49104. }
  49105. ,
  49106. this.getClearAlpha = function() {
  49107. return se
  49108. }
  49109. ,
  49110. this.setClearAlpha = function(e) {
  49111. se = e,
  49112. i(ae.r, ae.g, ae.b, se)
  49113. }
  49114. ,
  49115. this.clear = function(e, t, i) {
  49116. var n = 0;
  49117. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49118. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49119. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49120. X.clear(n)
  49121. }
  49122. ,
  49123. this.clearColor = function() {
  49124. this.clear(!0, !1, !1)
  49125. }
  49126. ,
  49127. this.clearDepth = function() {
  49128. this.clear(!1, !0, !1)
  49129. }
  49130. ,
  49131. this.clearStencil = function() {
  49132. this.clear(!1, !1, !0)
  49133. }
  49134. ,
  49135. this.clearTarget = function(e, t, i, n) {
  49136. this.setRenderTarget(e),
  49137. this.clear(t, i, n)
  49138. }
  49139. ,
  49140. this.resetGLState = n,
  49141. this.dispose = function() {
  49142. O.removeEventListener("webglcontextlost", r, !1)
  49143. }
  49144. ,
  49145. this.renderBufferImmediate = function(e, t, i) {
  49146. _e.initAttributes();
  49147. var n = be.get(e);
  49148. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49149. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49150. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49151. e.hasColors && !n.color && (n.color = X.createBuffer());
  49152. var r = t.getAttributes();
  49153. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49154. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49155. _e.enableAttribute(r.position),
  49156. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49157. e.hasNormals) {
  49158. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49159. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49160. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49161. var s = e.normalArray
  49162. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49163. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49164. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49165. s[o + 0] = l,
  49166. s[o + 1] = c,
  49167. s[o + 2] = h,
  49168. s[o + 3] = l,
  49169. s[o + 4] = c,
  49170. s[o + 5] = h,
  49171. s[o + 6] = l,
  49172. s[o + 7] = c,
  49173. s[o + 8] = h
  49174. }
  49175. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49176. _e.enableAttribute(r.normal),
  49177. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49178. }
  49179. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49180. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49181. _e.enableAttribute(r.uv),
  49182. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49183. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49184. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49185. _e.enableAttribute(r.color),
  49186. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49187. _e.disableUnusedAttributes(),
  49188. X.drawArrays(X.TRIANGLES, 0, e.count),
  49189. e.count = 0
  49190. }
  49191. ,
  49192. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49193. R(n);
  49194. var a = P(e, t, n, r)
  49195. , s = !1
  49196. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49197. l !== ee && (ee = l,
  49198. s = !0);
  49199. var c = r.morphTargetInfluences;
  49200. if (void 0 !== c) {
  49201. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49202. var p = c[u];
  49203. h.push([p, u])
  49204. }
  49205. h.sort(M),
  49206. 8 < h.length && (h.length = 8);
  49207. var f = i.morphAttributes;
  49208. for (u = 0,
  49209. d = h.length; u < d; u++) {
  49210. p = h[u];
  49211. if (j[u] = p[0],
  49212. 0 !== p[0]) {
  49213. var g = p[1];
  49214. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49215. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49216. } else
  49217. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49218. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49219. }
  49220. var m = a.getUniforms();
  49221. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49222. s = !0
  49223. }
  49224. g = i.index;
  49225. var v, y = i.attributes.position;
  49226. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49227. null !== g ? (v = Me).setIndex(g) : v = Se,
  49228. s && (function(e, t, i, n) {
  49229. var r;
  49230. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49231. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49232. else {
  49233. void 0 === n && (n = 0),
  49234. _e.initAttributes();
  49235. var o = i.attributes
  49236. , a = t.getAttributes()
  49237. , s = e.defaultAttributeValues;
  49238. for (var l in a) {
  49239. var c = a[l];
  49240. if (0 <= c) {
  49241. var h = o[l];
  49242. if (void 0 !== h) {
  49243. var u = h.itemSize
  49244. , d = we.getAttributeBuffer(h);
  49245. if (h instanceof Ci.InterleavedBufferAttribute) {
  49246. var p = h.data
  49247. , f = p.stride
  49248. , g = h.offset;
  49249. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49250. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49251. X.bindBuffer(X.ARRAY_BUFFER, d),
  49252. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49253. } else
  49254. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49255. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49256. X.bindBuffer(X.ARRAY_BUFFER, d),
  49257. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49258. } else if (void 0 !== s) {
  49259. var m = s[l];
  49260. if (void 0 !== m)
  49261. switch (m.length) {
  49262. case 2:
  49263. X.vertexAttrib2fv(c, m);
  49264. break;
  49265. case 3:
  49266. X.vertexAttrib3fv(c, m);
  49267. break;
  49268. case 4:
  49269. X.vertexAttrib4fv(c, m);
  49270. break;
  49271. default:
  49272. X.vertexAttrib1fv(c, m)
  49273. }
  49274. }
  49275. }
  49276. }
  49277. _e.disableUnusedAttributes()
  49278. }
  49279. }(n, a, i),
  49280. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49281. var A = 1 / 0;
  49282. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49283. var C = i.drawRange.start
  49284. , I = i.drawRange.count
  49285. , E = null !== o ? o.start : 0
  49286. , _ = null !== o ? o.count : 1 / 0
  49287. , b = Math.max(0, C, E)
  49288. , w = Math.min(0 + A, C + I, E + _) - 1
  49289. , T = Math.max(0, w - b + 1);
  49290. if (r instanceof Ci.Mesh)
  49291. if (!0 === n.wireframe)
  49292. _e.setLineWidth(n.wireframeLinewidth * S()),
  49293. v.setMode(X.LINES);
  49294. else
  49295. switch (r.drawMode) {
  49296. case Ci.TrianglesDrawMode:
  49297. v.setMode(X.TRIANGLES);
  49298. break;
  49299. case Ci.TriangleStripDrawMode:
  49300. v.setMode(X.TRIANGLE_STRIP);
  49301. break;
  49302. case Ci.TriangleFanDrawMode:
  49303. v.setMode(X.TRIANGLE_FAN)
  49304. }
  49305. else if (r instanceof Ci.Line) {
  49306. var x = n.linewidth;
  49307. void 0 === x && (x = 1),
  49308. _e.setLineWidth(x * S()),
  49309. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49310. } else
  49311. r instanceof Ci.Points && v.setMode(X.POINTS);
  49312. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49313. }
  49314. ,
  49315. this.render = function(e, t, i, n) {
  49316. if (t instanceof Ci.Camera != 0) {
  49317. var r = e.fog;
  49318. if (ee = "",
  49319. $ = -1,
  49320. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49321. null === t.parent && t.updateMatrixWorld(),
  49322. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49323. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49324. fe.setFromMatrix(ge),
  49325. U.length = 0,
  49326. W = z = -1,
  49327. Y.length = 0,
  49328. q.length = 0,
  49329. function e(t, i) {
  49330. if (!1 !== t.visible) {
  49331. if (t.layers.test(i.layers))
  49332. if (t instanceof Ci.Light)
  49333. U.push(t);
  49334. else if (t instanceof Ci.Sprite)
  49335. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49336. else if (t instanceof Ci.LensFlare)
  49337. q.push(t);
  49338. else if (t instanceof Ci.ImmediateRenderObject)
  49339. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49340. me.applyProjection(ge)),
  49341. d(t, null, t.material, me.z, null);
  49342. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49343. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49344. var n = t.material;
  49345. if (!0 === n.visible) {
  49346. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49347. me.applyProjection(ge));
  49348. var r = we.update(t);
  49349. if (n instanceof Ci.MultiMaterial)
  49350. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49351. var c = o[s]
  49352. , h = a[c.materialIndex];
  49353. !0 === h.visible && d(t, r, h, me.z, c)
  49354. }
  49355. else
  49356. d(t, r, n, me.z, null)
  49357. }
  49358. }
  49359. var u = t.children;
  49360. for (s = 0,
  49361. l = u.length; s < l; s++)
  49362. e(u[s], i)
  49363. }
  49364. }(e, t),
  49365. H.length = z + 1,
  49366. G.length = W + 1,
  49367. !0 === Z.sortObjects && (H.sort(s),
  49368. G.sort(l)),
  49369. function(e, t) {
  49370. 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;
  49371. for (i = ve.shadowsPointLight = 0,
  49372. n = e.length; i < n; i++)
  49373. if (o = (r = e[i]).color,
  49374. a = r.intensity,
  49375. s = r.distance,
  49376. r instanceof Ci.AmbientLight)
  49377. l += o.r * a,
  49378. c += o.g * a,
  49379. h += o.b * a;
  49380. else if (r instanceof Ci.DirectionalLight) {
  49381. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49382. v.direction.setFromMatrixPosition(r.matrixWorld),
  49383. me.setFromMatrixPosition(r.target.matrixWorld),
  49384. v.direction.sub(me),
  49385. v.direction.transformDirection(u),
  49386. v.shadow = r.castShadow,
  49387. r.castShadow && (v.shadowBias = r.shadow.bias,
  49388. v.shadowRadius = r.shadow.radius,
  49389. v.shadowMapSize = r.shadow.mapSize,
  49390. ve.shadows[m++] = r),
  49391. ve.directionalShadowMap[d] = r.shadow.map,
  49392. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49393. ve.directional[d++] = v
  49394. } else if (r instanceof Ci.SpotLight) {
  49395. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49396. v.position.applyMatrix4(u),
  49397. v.color.copy(o).multiplyScalar(a),
  49398. v.distance = s,
  49399. v.direction.setFromMatrixPosition(r.matrixWorld),
  49400. me.setFromMatrixPosition(r.target.matrixWorld),
  49401. v.direction.sub(me),
  49402. v.direction.transformDirection(u),
  49403. v.coneCos = Math.cos(r.angle),
  49404. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49405. v.decay = 0 === r.distance ? 0 : r.decay,
  49406. v.shadow = r.castShadow,
  49407. r.castShadow && (v.shadowBias = r.shadow.bias,
  49408. v.shadowRadius = r.shadow.radius,
  49409. v.shadowMapSize = r.shadow.mapSize,
  49410. ve.shadows[m++] = r),
  49411. ve.spotShadowMap[f] = r.shadow.map,
  49412. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49413. ve.spot[f++] = v
  49414. } else if (r instanceof Ci.PointLight) {
  49415. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49416. v.position.applyMatrix4(u),
  49417. v.color.copy(r.color).multiplyScalar(r.intensity),
  49418. v.distance = r.distance,
  49419. v.decay = 0 === r.distance ? 0 : r.decay,
  49420. v.shadow = r.castShadow,
  49421. r.castShadow && (v.shadowBias = r.shadow.bias,
  49422. v.shadowRadius = r.shadow.radius,
  49423. v.shadowMapSize = r.shadow.mapSize,
  49424. ve.shadows[m++] = r),
  49425. ve.pointShadowMap[p] = r.shadow.map,
  49426. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49427. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49428. ve.pointShadowMatrix[p].identity().setPosition(me),
  49429. ve.point[p++] = v
  49430. } else if (r instanceof Ci.HemisphereLight) {
  49431. var v;
  49432. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49433. v.direction.transformDirection(u),
  49434. v.direction.normalize(),
  49435. v.skyColor.copy(r.color).multiplyScalar(a),
  49436. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49437. ve.hemi[g++] = v
  49438. }
  49439. ve.ambient[0] = l,
  49440. ve.ambient[1] = c,
  49441. ve.ambient[2] = h,
  49442. ve.directional.length = d,
  49443. ve.spot.length = f,
  49444. ve.point.length = p,
  49445. ve.hemi.length = g,
  49446. ve.shadows.length = m,
  49447. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49448. }(U, t),
  49449. Re.render(e, t),
  49450. Ae.calls = 0,
  49451. Ae.vertices = 0,
  49452. Ae.faces = 0,
  49453. void (Ae.points = 0) === i && (i = null),
  49454. this.setRenderTarget(i),
  49455. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49456. e.overrideMaterial) {
  49457. var o = e.overrideMaterial;
  49458. c(H, t, r, o),
  49459. c(G, t, r, o)
  49460. } else
  49461. _e.setBlending(Ci.NoBlending),
  49462. c(H, t, r),
  49463. c(G, t, r);
  49464. if (Oe.render(e, t),
  49465. Le.render(e, t, re),
  49466. i) {
  49467. var a = i.texture;
  49468. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49469. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49470. , i = be.get(e.texture).__webglTexture;
  49471. _e.bindTexture(t, i),
  49472. X.generateMipmap(t),
  49473. _e.bindTexture(t, null)
  49474. }(i)
  49475. }
  49476. _e.setDepthTest(!0),
  49477. _e.setDepthWrite(!0),
  49478. _e.setColorWrite(!0)
  49479. } else
  49480. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49481. }
  49482. ,
  49483. this.setFaceCulling = function(e, t) {
  49484. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49485. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49486. _e.enable(X.CULL_FACE))
  49487. }
  49488. ,
  49489. this.setTexture = function(e, t) {
  49490. var i = be.get(e);
  49491. if (0 < e.version && i.__version !== e.version) {
  49492. var n = e.image;
  49493. 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)
  49494. }
  49495. _e.activeTexture(X.TEXTURE0 + t),
  49496. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49497. }
  49498. ,
  49499. this.getCurrentRenderTarget = function() {
  49500. return Q
  49501. }
  49502. ,
  49503. this.setRenderTarget = function(e) {
  49504. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49505. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49506. if (e) {
  49507. var n = be.get(e);
  49508. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49509. ie.copy(e.scissor),
  49510. ne = e.scissorTest,
  49511. re.copy(e.viewport)
  49512. } else
  49513. t = null,
  49514. ie.copy(ue).multiplyScalar(he),
  49515. ne = de,
  49516. re.copy(pe).multiplyScalar(he);
  49517. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49518. J = t),
  49519. _e.scissor(ie),
  49520. _e.setScissorTest(ne),
  49521. _e.viewport(re),
  49522. i) {
  49523. var r = be.get(e.texture);
  49524. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49525. }
  49526. }
  49527. ,
  49528. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49529. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49530. var a = be.get(e).__webglFramebuffer;
  49531. if (a) {
  49532. var s = !1;
  49533. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49534. s = !0);
  49535. try {
  49536. var l = e.texture;
  49537. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49538. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49539. 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")))
  49540. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49541. 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.")
  49542. } finally {
  49543. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49544. }
  49545. }
  49546. } else
  49547. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49548. }
  49549. }
  49550. ,
  49551. Ci.WebGLRenderTarget = function(e, t, i) {
  49552. this.uuid = Ci.Math.generateUUID(),
  49553. this.width = e,
  49554. this.height = t,
  49555. this.scissor = new Ci.Vector4(0,0,e,t),
  49556. this.scissorTest = !1,
  49557. this.viewport = new Ci.Vector4(0,0,e,t),
  49558. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49559. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49560. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49561. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49562. }
  49563. ,
  49564. Ci.WebGLRenderTarget.prototype = {
  49565. constructor: Ci.WebGLRenderTarget,
  49566. setSize: function(e, t) {
  49567. this.width === e && this.height === t || (this.width = e,
  49568. this.height = t,
  49569. this.dispose()),
  49570. this.viewport.set(0, 0, e, t),
  49571. this.scissor.set(0, 0, e, t)
  49572. },
  49573. clone: function() {
  49574. return (new this.constructor).copy(this)
  49575. },
  49576. copy: function(e) {
  49577. return this.width = e.width,
  49578. this.height = e.height,
  49579. this.viewport.copy(e.viewport),
  49580. this.texture = e.texture.clone(),
  49581. this.depthBuffer = e.depthBuffer,
  49582. this.stencilBuffer = e.stencilBuffer,
  49583. this
  49584. },
  49585. dispose: function() {
  49586. this.dispatchEvent({
  49587. type: "dispose"
  49588. })
  49589. }
  49590. },
  49591. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49592. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49593. Ci.WebGLRenderTarget.call(this, e, t, i),
  49594. this.activeCubeFace = 0,
  49595. this.activeMipMapLevel = 0
  49596. }
  49597. ,
  49598. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49599. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49600. Ci.WebGLBufferRenderer = function(r, o, a) {
  49601. var s;
  49602. this.setMode = function(e) {
  49603. s = e
  49604. }
  49605. ,
  49606. this.render = function(e, t) {
  49607. r.drawArrays(s, e, t),
  49608. a.calls++,
  49609. a.vertices += t,
  49610. s === r.TRIANGLES && (a.faces += t / 3)
  49611. }
  49612. ,
  49613. this.renderInstances = function(e) {
  49614. var t = o.get("ANGLE_instanced_arrays");
  49615. if (null !== t) {
  49616. var i = e.attributes.position
  49617. , n = 0;
  49618. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49619. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49620. a.calls++,
  49621. a.vertices += n * e.maxInstancedCount,
  49622. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49623. } else
  49624. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49625. }
  49626. }
  49627. ,
  49628. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49629. var s, l, c;
  49630. this.setMode = function(e) {
  49631. s = e
  49632. }
  49633. ,
  49634. this.setIndex = function(e) {
  49635. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49636. 4) : (l = r.UNSIGNED_SHORT,
  49637. 2)
  49638. }
  49639. ,
  49640. this.render = function(e, t) {
  49641. r.drawElements(s, t, l, e * c),
  49642. a.calls++,
  49643. a.vertices += t,
  49644. s === r.TRIANGLES && (a.faces += t / 3)
  49645. }
  49646. ,
  49647. this.renderInstances = function(e, t, i) {
  49648. var n = o.get("ANGLE_instanced_arrays");
  49649. 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),
  49650. a.calls++,
  49651. a.vertices += i * e.maxInstancedCount,
  49652. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49653. }
  49654. }
  49655. ,
  49656. Ci.WebGLExtensions = function(i) {
  49657. var n = {};
  49658. this.get = function(e) {
  49659. if (void 0 !== n[e])
  49660. return n[e];
  49661. var t;
  49662. switch (e) {
  49663. case "EXT_texture_filter_anisotropic":
  49664. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49665. break;
  49666. case "WEBGL_compressed_texture_s3tc":
  49667. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49668. break;
  49669. case "WEBGL_compressed_texture_pvrtc":
  49670. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49671. break;
  49672. case "WEBGL_compressed_texture_etc1":
  49673. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49674. break;
  49675. default:
  49676. t = i.getExtension(e)
  49677. }
  49678. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49679. n[e] = t
  49680. }
  49681. }
  49682. ,
  49683. Ci.WebGLCapabilities = function(t, e, i) {
  49684. function n(e) {
  49685. if ("highp" === e) {
  49686. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49687. return "highp";
  49688. e = "mediump"
  49689. }
  49690. 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"
  49691. }
  49692. this.getMaxPrecision = n,
  49693. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49694. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49695. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49696. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49697. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49698. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49699. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49700. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49701. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49702. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49703. this.vertexTextures = 0 < this.maxVertexTextures,
  49704. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49705. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49706. var r = n(this.precision);
  49707. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49708. this.precision = r),
  49709. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49710. }
  49711. ,
  49712. Ci.WebGLGeometries = function(i, o, a) {
  49713. function s(e) {
  49714. var t = e.target
  49715. , i = c[t.id];
  49716. null !== i.index && l(i.index),
  49717. function(e) {
  49718. for (var t in e)
  49719. l(e[t])
  49720. }(i.attributes),
  49721. t.removeEventListener("dispose", s),
  49722. delete c[t.id];
  49723. var n = o.get(t);
  49724. n.wireframe && l(n.wireframe),
  49725. o.delete(t);
  49726. var r = o.get(i);
  49727. r.wireframe && l(r.wireframe),
  49728. o.delete(i),
  49729. a.memory.geometries--
  49730. }
  49731. function l(e) {
  49732. var t = function(e) {
  49733. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49734. }(e);
  49735. void 0 !== t && (i.deleteBuffer(t),
  49736. function(e) {
  49737. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49738. }(e))
  49739. }
  49740. var c = {};
  49741. this.get = function(e) {
  49742. var t, i = e.geometry;
  49743. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49744. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49745. t = i._bufferGeometry),
  49746. c[i.id] = t,
  49747. a.memory.geometries++,
  49748. t)
  49749. }
  49750. }
  49751. ,
  49752. Ci.WebGLLights = function() {
  49753. var i = {};
  49754. this.get = function(e) {
  49755. if (void 0 !== i[e.id])
  49756. return i[e.id];
  49757. var t;
  49758. switch (e.type) {
  49759. case "DirectionalLight":
  49760. t = {
  49761. direction: new Ci.Vector3,
  49762. color: new Ci.Color,
  49763. shadow: !1,
  49764. shadowBias: 0,
  49765. shadowRadius: 1,
  49766. shadowMapSize: new Ci.Vector2
  49767. };
  49768. break;
  49769. case "SpotLight":
  49770. t = {
  49771. position: new Ci.Vector3,
  49772. direction: new Ci.Vector3,
  49773. color: new Ci.Color,
  49774. distance: 0,
  49775. coneCos: 0,
  49776. penumbraCos: 0,
  49777. decay: 0,
  49778. shadow: !1,
  49779. shadowBias: 0,
  49780. shadowRadius: 1,
  49781. shadowMapSize: new Ci.Vector2
  49782. };
  49783. break;
  49784. case "PointLight":
  49785. t = {
  49786. position: new Ci.Vector3,
  49787. color: new Ci.Color,
  49788. distance: 0,
  49789. decay: 0,
  49790. shadow: !1,
  49791. shadowBias: 0,
  49792. shadowRadius: 1,
  49793. shadowMapSize: new Ci.Vector2
  49794. };
  49795. break;
  49796. case "HemisphereLight":
  49797. t = {
  49798. direction: new Ci.Vector3,
  49799. skyColor: new Ci.Color,
  49800. groundColor: new Ci.Color
  49801. }
  49802. }
  49803. return i[e.id] = t
  49804. }
  49805. }
  49806. ,
  49807. Ci.WebGLObjects = function(g, m, e) {
  49808. function v(e, t) {
  49809. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49810. , n = m.get(i);
  49811. void 0 === n.__webglBuffer ? function(e, t, i) {
  49812. e.__webglBuffer = g.createBuffer(),
  49813. g.bindBuffer(i, e.__webglBuffer);
  49814. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49815. g.bufferData(i, t.array, n),
  49816. e.version = t.version
  49817. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49818. g.bindBuffer(i, e.__webglBuffer),
  49819. !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)),
  49820. t.updateRange.count = 0),
  49821. e.version = t.version
  49822. }(n, i, t)
  49823. }
  49824. function y(e, t, i) {
  49825. if (i < t) {
  49826. var n = t;
  49827. t = i,
  49828. i = n
  49829. }
  49830. var r = e[t];
  49831. return void 0 === r ? (e[t] = [i],
  49832. !0) : -1 === r.indexOf(i) && (r.push(i),
  49833. !0)
  49834. }
  49835. var c = new Ci.WebGLGeometries(g,m,e);
  49836. this.getAttributeBuffer = function(e) {
  49837. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49838. }
  49839. ,
  49840. this.getWireframeAttribute = function(e) {
  49841. var t = m.get(e);
  49842. if (void 0 !== t.wireframe)
  49843. return t.wireframe;
  49844. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49845. if (null !== r)
  49846. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49847. var h = i[l + 0]
  49848. , u = i[l + 1]
  49849. , d = i[l + 2];
  49850. y(s, h, u) && n.push(h, u),
  49851. y(s, u, d) && n.push(u, d),
  49852. y(s, d, h) && n.push(d, h)
  49853. }
  49854. else
  49855. for (l = 0,
  49856. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49857. h = l + 0,
  49858. u = l + 1,
  49859. d = l + 2;
  49860. n.push(h, u, u, d, d, h)
  49861. }
  49862. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49863. , f = new Ci.BufferAttribute(new p(n),1);
  49864. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49865. t.wireframe = f
  49866. }
  49867. ,
  49868. this.update = function(e) {
  49869. var t = c.get(e);
  49870. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49871. var i = t.index
  49872. , n = t.attributes;
  49873. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49874. n)
  49875. v(n[r], g.ARRAY_BUFFER);
  49876. var o = t.morphAttributes;
  49877. for (var r in o)
  49878. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49879. v(a[s], g.ARRAY_BUFFER);
  49880. return t
  49881. }
  49882. }
  49883. ,
  49884. Ci.WebGLProgram = (Qt = 0,
  49885. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49886. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49887. ei = /^([\w\d_]+)\[0\]$/,
  49888. function(e, t, i, n) {
  49889. var r = e.context
  49890. , o = i.extensions
  49891. , a = i.defines
  49892. , s = i.__webglShader.vertexShader
  49893. , l = i.__webglShader.fragmentShader
  49894. , c = "SHADOWMAP_TYPE_BASIC";
  49895. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49896. var h = "ENVMAP_TYPE_CUBE"
  49897. , u = "ENVMAP_MODE_REFLECTION"
  49898. , d = "ENVMAP_BLENDING_MULTIPLY";
  49899. if (n.envMap) {
  49900. switch (i.envMap.mapping) {
  49901. case Ci.CubeReflectionMapping:
  49902. case Ci.CubeRefractionMapping:
  49903. h = "ENVMAP_TYPE_CUBE";
  49904. break;
  49905. case Ci.CubeUVReflectionMapping:
  49906. case Ci.CubeUVRefractionMapping:
  49907. h = "ENVMAP_TYPE_CUBE_UV";
  49908. break;
  49909. case Ci.EquirectangularReflectionMapping:
  49910. case Ci.EquirectangularRefractionMapping:
  49911. h = "ENVMAP_TYPE_EQUIREC";
  49912. break;
  49913. case Ci.SphericalReflectionMapping:
  49914. h = "ENVMAP_TYPE_SPHERE"
  49915. }
  49916. switch (i.envMap.mapping) {
  49917. case Ci.CubeRefractionMapping:
  49918. case Ci.EquirectangularRefractionMapping:
  49919. u = "ENVMAP_MODE_REFRACTION"
  49920. }
  49921. switch (i.combine) {
  49922. case Ci.MultiplyOperation:
  49923. d = "ENVMAP_BLENDING_MULTIPLY";
  49924. break;
  49925. case Ci.MixOperation:
  49926. d = "ENVMAP_BLENDING_MIX";
  49927. break;
  49928. case Ci.AddOperation:
  49929. d = "ENVMAP_BLENDING_ADD"
  49930. }
  49931. }
  49932. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49933. 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")
  49934. }(o, n, e.extensions), v = function(e) {
  49935. var t = [];
  49936. for (var i in e) {
  49937. var n = e[i];
  49938. !1 !== n && t.push("#define " + i + " " + n)
  49939. }
  49940. return t.join("\n")
  49941. }(a), y = r.createProgram();
  49942. 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"),
  49943. [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) {
  49944. var i;
  49945. switch (t) {
  49946. case Ci.LinearToneMapping:
  49947. i = "Linear";
  49948. break;
  49949. case Ci.ReinhardToneMapping:
  49950. i = "Reinhard";
  49951. break;
  49952. case Ci.Uncharted2ToneMapping:
  49953. i = "Uncharted2";
  49954. break;
  49955. case Ci.CineonToneMapping:
  49956. i = "OptimizedCineon";
  49957. break;
  49958. default:
  49959. throw new Error("unsupported toneMapping: " + t)
  49960. }
  49961. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49962. }("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) {
  49963. var i = Mi(t);
  49964. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49965. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49966. s = Oi(s = Li(s), n),
  49967. l = Oi(l = Li(l), n),
  49968. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49969. l = Di(l));
  49970. var A = p + s
  49971. , C = f + l
  49972. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49973. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49974. r.attachShader(y, I),
  49975. r.attachShader(y, E),
  49976. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49977. r.linkProgram(y);
  49978. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49979. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49980. 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),
  49981. M && (this.diagnostics = {
  49982. runnable: S,
  49983. material: i,
  49984. programLog: w,
  49985. vertexShader: {
  49986. log: T,
  49987. prefix: p
  49988. },
  49989. fragmentShader: {
  49990. log: x,
  49991. prefix: f
  49992. }
  49993. }),
  49994. r.deleteShader(I),
  49995. r.deleteShader(E),
  49996. this.getUniforms = function() {
  49997. return void 0 === _ && (_ = function(e, t) {
  49998. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49999. var o = e.getActiveUniform(t, r).name
  50000. , a = e.getUniformLocation(t, o)
  50001. , s = Jt.exec(o);
  50002. if (s) {
  50003. var l = s[1]
  50004. , c = s[2]
  50005. , h = i[l];
  50006. (h = h || (i[l] = {}))[c] = a
  50007. } else if (s = $t.exec(o)) {
  50008. var u = s[1]
  50009. , d = s[2]
  50010. , p = s[3]
  50011. , f = i[u]
  50012. , g = (f = f || (i[u] = []))[d];
  50013. (g = g || (f[d] = {}))[p] = a
  50014. } else
  50015. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50016. }
  50017. return i
  50018. }(r, y)),
  50019. _
  50020. }
  50021. ,
  50022. this.getAttributes = function() {
  50023. return void 0 === b && (b = function(e, t) {
  50024. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50025. var o = e.getActiveAttrib(t, r).name;
  50026. i[o] = e.getAttribLocation(t, o)
  50027. }
  50028. return i
  50029. }(r, y)),
  50030. b
  50031. }
  50032. ,
  50033. this.destroy = function() {
  50034. r.deleteProgram(y),
  50035. this.program = void 0
  50036. }
  50037. ,
  50038. Object.defineProperties(this, {
  50039. uniforms: {
  50040. get: function() {
  50041. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50042. this.getUniforms()
  50043. }
  50044. },
  50045. attributes: {
  50046. get: function() {
  50047. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50048. this.getAttributes()
  50049. }
  50050. }
  50051. }),
  50052. this.id = Qt++,
  50053. this.code = t,
  50054. this.usedTimes = 1,
  50055. this.program = y,
  50056. this.vertexShader = I,
  50057. this.fragmentShader = E,
  50058. this
  50059. }
  50060. ),
  50061. Ci.WebGLPrograms = function(s, l) {
  50062. function c(e, t) {
  50063. var i;
  50064. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50065. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50066. i
  50067. }
  50068. var h = []
  50069. , u = {
  50070. MeshDepthMaterial: "depth",
  50071. MeshNormalMaterial: "normal",
  50072. MeshBasicMaterial: "basic",
  50073. MeshLambertMaterial: "lambert",
  50074. MeshPhongMaterial: "phong",
  50075. MeshStandardMaterial: "standard",
  50076. LineBasicMaterial: "basic",
  50077. LineDashedMaterial: "dashed",
  50078. PointsMaterial: "points"
  50079. }
  50080. , 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"];
  50081. this.getParameters = function(e, t, i, n) {
  50082. var r = u[e.type]
  50083. , o = function(e) {
  50084. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50085. return 1024;
  50086. var t = l.maxVertexUniforms
  50087. , i = Math.floor((t - 20) / 4);
  50088. 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)")),
  50089. i
  50090. }(n)
  50091. , a = s.getPrecision();
  50092. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50093. {
  50094. shaderID: r,
  50095. precision: a,
  50096. supportsVertexTextures: l.vertexTextures,
  50097. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50098. map: !!e.map,
  50099. mapEncoding: c(e.map, s.gammaInput),
  50100. envMap: !!e.envMap,
  50101. envMapMode: e.envMap && e.envMap.mapping,
  50102. envMapEncoding: c(e.envMap, s.gammaInput),
  50103. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50104. lightMap: !!e.lightMap,
  50105. aoMap: !!e.aoMap,
  50106. emissiveMap: !!e.emissiveMap,
  50107. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50108. bumpMap: !!e.bumpMap,
  50109. normalMap: !!e.normalMap,
  50110. displacementMap: !!e.displacementMap,
  50111. roughnessMap: !!e.roughnessMap,
  50112. metalnessMap: !!e.metalnessMap,
  50113. specularMap: !!e.specularMap,
  50114. alphaMap: !!e.alphaMap,
  50115. combine: e.combine,
  50116. vertexColors: e.vertexColors,
  50117. fog: i,
  50118. useFog: e.fog,
  50119. fogExp: i instanceof Ci.FogExp2,
  50120. flatShading: e.shading === Ci.FlatShading,
  50121. sizeAttenuation: e.sizeAttenuation,
  50122. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50123. skinning: e.skinning,
  50124. maxBones: o,
  50125. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50126. morphTargets: e.morphTargets,
  50127. morphNormals: e.morphNormals,
  50128. maxMorphTargets: s.maxMorphTargets,
  50129. maxMorphNormals: s.maxMorphNormals,
  50130. numDirLights: t.directional.length,
  50131. numPointLights: t.point.length,
  50132. numSpotLights: t.spot.length,
  50133. numHemiLights: t.hemi.length,
  50134. pointLightShadows: t.shadowsPointLight,
  50135. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50136. shadowMapType: s.shadowMap.type,
  50137. toneMapping: s.toneMapping,
  50138. physicallyCorrectLights: s.physicallyCorrectLights,
  50139. premultipliedAlpha: e.premultipliedAlpha,
  50140. alphaTest: e.alphaTest,
  50141. doubleSided: e.side === Ci.DoubleSide,
  50142. flipSided: e.side === Ci.BackSide
  50143. }
  50144. }
  50145. ,
  50146. this.getProgramCode = function(e, t) {
  50147. var i = [];
  50148. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50149. i.push(e.vertexShader)),
  50150. void 0 !== e.defines)
  50151. for (var n in e.defines)
  50152. i.push(n),
  50153. i.push(e.defines[n]);
  50154. for (var r = 0; r < a.length; r++) {
  50155. var o = a[r];
  50156. i.push(o),
  50157. i.push(t[o])
  50158. }
  50159. return i.join()
  50160. }
  50161. ,
  50162. this.acquireProgram = function(e, t, i) {
  50163. for (var n, r = 0, o = h.length; r < o; r++) {
  50164. var a = h[r];
  50165. if (a.code === i) {
  50166. ++(n = a).usedTimes;
  50167. break
  50168. }
  50169. }
  50170. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50171. h.push(n)),
  50172. n
  50173. }
  50174. ,
  50175. this.releaseProgram = function(e) {
  50176. if (0 == --e.usedTimes) {
  50177. var t = h.indexOf(e);
  50178. h[t] = h[h.length - 1],
  50179. h.pop(),
  50180. e.destroy()
  50181. }
  50182. }
  50183. ,
  50184. this.programs = h
  50185. }
  50186. ,
  50187. Ci.WebGLProperties = function() {
  50188. var n = {};
  50189. this.get = function(e) {
  50190. var t = e.uuid
  50191. , i = n[t];
  50192. return void 0 === i && (i = {},
  50193. n[t] = i),
  50194. i
  50195. }
  50196. ,
  50197. this.delete = function(e) {
  50198. delete n[e.uuid]
  50199. }
  50200. ,
  50201. this.clear = function() {
  50202. n = {}
  50203. }
  50204. }
  50205. ,
  50206. Ci.WebGLShader = function(e, t, i) {
  50207. var n = e.createShader(t);
  50208. return e.shaderSource(n, i),
  50209. e.compileShader(n),
  50210. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50211. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50212. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50213. t[i] = i + 1 + ": " + t[i];
  50214. return t.join("\n")
  50215. }(i)),
  50216. n
  50217. }
  50218. ,
  50219. Ci.WebGLShadowMap = function(P, O, L) {
  50220. function D(e, t, i, n) {
  50221. var r = e.geometry
  50222. , o = null
  50223. , a = p
  50224. , s = e.customDepthMaterial;
  50225. if (i && (a = f,
  50226. s = e.customDistanceMaterial),
  50227. s)
  50228. o = s;
  50229. else {
  50230. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50231. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50232. , h = 0;
  50233. l && (h |= u),
  50234. c && (h |= d),
  50235. o = a[h]
  50236. }
  50237. return o.visible = t.visible,
  50238. o.wireframe = t.wireframe,
  50239. o.wireframeLinewidth = t.wireframeLinewidth,
  50240. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50241. o
  50242. }
  50243. function N(e, t, i) {
  50244. if (!1 !== e.visible) {
  50245. 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)))
  50246. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50247. G.push(e));
  50248. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50249. N(n[r], t, i)
  50250. }
  50251. }
  50252. 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) {
  50253. var a = 0 != (o & u)
  50254. , s = 0 != (o & d)
  50255. , l = new Ci.ShaderMaterial({
  50256. uniforms: i,
  50257. vertexShader: t.vertexShader,
  50258. fragmentShader: t.fragmentShader,
  50259. morphTargets: a,
  50260. skinning: s
  50261. });
  50262. p[o] = l;
  50263. var c = new Ci.ShaderMaterial({
  50264. defines: {
  50265. USE_SHADOWMAP: ""
  50266. },
  50267. uniforms: r,
  50268. vertexShader: n.vertexShader,
  50269. fragmentShader: n.fragmentShader,
  50270. morphTargets: a,
  50271. skinning: s
  50272. });
  50273. f[o] = c
  50274. }
  50275. var q = this;
  50276. this.enabled = !1,
  50277. this.autoUpdate = !0,
  50278. this.needsUpdate = !1,
  50279. this.type = Ci.PCFShadowMap,
  50280. this.cullFace = Ci.CullFaceFront,
  50281. this.render = function(e, t) {
  50282. var i, n, r = O.shadows;
  50283. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50284. B.clearColor(1, 1, 1, 1),
  50285. B.disable(F.BLEND),
  50286. B.enable(F.CULL_FACE),
  50287. F.frontFace(F.CCW),
  50288. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50289. B.setDepthTest(!0),
  50290. B.setScissorTest(!1);
  50291. for (var o = 0, a = r.length; o < a; o++) {
  50292. var s = r[o]
  50293. , l = s.shadow
  50294. , c = l.camera;
  50295. if (U.copy(l.mapSize),
  50296. s instanceof Ci.PointLight) {
  50297. i = 6,
  50298. n = !0;
  50299. var h = U.x
  50300. , u = U.y;
  50301. Y[0].set(2 * h, u, h, u),
  50302. Y[1].set(0, u, h, u),
  50303. Y[2].set(3 * h, u, h, u),
  50304. Y[3].set(h, u, h, u),
  50305. Y[4].set(3 * h, 0, h, u),
  50306. Y[5].set(h, 0, h, u),
  50307. U.x *= 4,
  50308. U.y *= 2
  50309. } else
  50310. n = !(i = 1);
  50311. if (null === l.map) {
  50312. var d = {
  50313. minFilter: Ci.NearestFilter,
  50314. magFilter: Ci.NearestFilter,
  50315. format: Ci.RGBAFormat
  50316. };
  50317. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50318. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50319. c.updateProjectionMatrix()
  50320. }
  50321. var p = l.map
  50322. , f = l.matrix;
  50323. z.setFromMatrixPosition(s.matrixWorld),
  50324. c.position.copy(z),
  50325. P.setRenderTarget(p),
  50326. P.clear();
  50327. for (var g = 0; g < i; g++) {
  50328. if (n) {
  50329. H.copy(c.position),
  50330. H.add(W[g]),
  50331. c.up.copy(j[g]),
  50332. c.lookAt(H);
  50333. var m = Y[g];
  50334. B.viewport(m)
  50335. } else
  50336. H.setFromMatrixPosition(s.target.matrixWorld),
  50337. c.lookAt(H);
  50338. c.updateMatrixWorld(),
  50339. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50340. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50341. f.multiply(c.projectionMatrix),
  50342. f.multiply(c.matrixWorldInverse),
  50343. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50344. V.setFromMatrix(k),
  50345. G.length = 0,
  50346. N(e, t, c);
  50347. for (var v = 0, y = G.length; v < y; v++) {
  50348. var A = G[v]
  50349. , C = L.update(A)
  50350. , I = A.material;
  50351. if (I instanceof Ci.MultiMaterial)
  50352. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50353. var T = E[b]
  50354. , x = _[T.materialIndex];
  50355. if (!0 === x.visible) {
  50356. var S = D(A, x, n, z);
  50357. P.renderBufferDirect(c, null, C, S, A, T)
  50358. }
  50359. }
  50360. else {
  50361. S = D(A, I, n, z);
  50362. P.renderBufferDirect(c, null, C, S, A, null)
  50363. }
  50364. }
  50365. }
  50366. }
  50367. var M = P.getClearColor()
  50368. , R = P.getClearAlpha();
  50369. P.setClearColor(M, R),
  50370. B.enable(F.BLEND),
  50371. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50372. q.needsUpdate = !1
  50373. }
  50374. }
  50375. }
  50376. ,
  50377. Ci.WebGLState = function(l, i, c) {
  50378. var n = this
  50379. , r = new Ci.Vector4
  50380. , o = new Uint8Array(16)
  50381. , a = new Uint8Array(16)
  50382. , s = new Uint8Array(16)
  50383. , t = {}
  50384. , h = null
  50385. , u = null
  50386. , d = null
  50387. , p = null
  50388. , f = null
  50389. , g = null
  50390. , m = null
  50391. , v = null
  50392. , y = !1
  50393. , A = null
  50394. , C = null
  50395. , I = null
  50396. , E = null
  50397. , _ = null
  50398. , b = null
  50399. , w = null
  50400. , T = null
  50401. , x = null
  50402. , S = null
  50403. , M = null
  50404. , R = null
  50405. , P = null
  50406. , O = null
  50407. , L = null
  50408. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50409. , N = void 0
  50410. , F = {}
  50411. , B = new Ci.Vector4
  50412. , V = null
  50413. , k = null
  50414. , U = new Ci.Vector4
  50415. , H = new Ci.Vector4
  50416. , z = l.createTexture();
  50417. l.bindTexture(l.TEXTURE_2D, z),
  50418. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50419. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50420. this.init = function() {
  50421. this.clearColor(0, 0, 0, 1),
  50422. this.clearDepth(1),
  50423. this.clearStencil(0),
  50424. this.enable(l.DEPTH_TEST),
  50425. l.depthFunc(l.LEQUAL),
  50426. l.frontFace(l.CCW),
  50427. l.cullFace(l.BACK),
  50428. this.enable(l.CULL_FACE),
  50429. this.enable(l.BLEND),
  50430. l.blendEquation(l.FUNC_ADD),
  50431. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50432. }
  50433. ,
  50434. this.initAttributes = function() {
  50435. for (var e = 0, t = o.length; e < t; e++)
  50436. o[e] = 0
  50437. }
  50438. ,
  50439. this.enableAttribute = function(e) {
  50440. o[e] = 1,
  50441. 0 === a[e] && (l.enableVertexAttribArray(e),
  50442. a[e] = 1),
  50443. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50444. s[e] = 0)
  50445. }
  50446. ,
  50447. this.enableAttributeAndDivisor = function(e, t, i) {
  50448. o[e] = 1,
  50449. 0 === a[e] && (l.enableVertexAttribArray(e),
  50450. a[e] = 1),
  50451. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50452. s[e] = t)
  50453. }
  50454. ,
  50455. this.disableUnusedAttributes = function() {
  50456. for (var e = 0, t = a.length; e < t; e++)
  50457. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50458. a[e] = 0)
  50459. }
  50460. ,
  50461. this.enable = function(e) {
  50462. !0 !== t[e] && (l.enable(e),
  50463. t[e] = !0)
  50464. }
  50465. ,
  50466. this.disable = function(e) {
  50467. !1 !== t[e] && (l.disable(e),
  50468. t[e] = !1)
  50469. }
  50470. ,
  50471. this.getCompressedTextureFormats = function() {
  50472. if (null === h && (h = [],
  50473. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50474. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50475. h.push(e[t]);
  50476. return h
  50477. }
  50478. ,
  50479. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50480. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50481. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50482. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50483. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50484. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50485. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50486. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50487. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50488. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50489. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50490. u = e,
  50491. y = s),
  50492. e === Ci.CustomBlending ? (r = r || t,
  50493. o = o || i,
  50494. a = a || n,
  50495. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50496. d = t,
  50497. g = r),
  50498. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50499. p = i,
  50500. f = n,
  50501. m = o,
  50502. v = a)) : v = m = g = f = p = d = null
  50503. }
  50504. ,
  50505. this.setDepthFunc = function(e) {
  50506. if (A !== e) {
  50507. if (e)
  50508. switch (e) {
  50509. case Ci.NeverDepth:
  50510. l.depthFunc(l.NEVER);
  50511. break;
  50512. case Ci.AlwaysDepth:
  50513. l.depthFunc(l.ALWAYS);
  50514. break;
  50515. case Ci.LessDepth:
  50516. l.depthFunc(l.LESS);
  50517. break;
  50518. case Ci.LessEqualDepth:
  50519. l.depthFunc(l.LEQUAL);
  50520. break;
  50521. case Ci.EqualDepth:
  50522. l.depthFunc(l.EQUAL);
  50523. break;
  50524. case Ci.GreaterEqualDepth:
  50525. l.depthFunc(l.GEQUAL);
  50526. break;
  50527. case Ci.GreaterDepth:
  50528. l.depthFunc(l.GREATER);
  50529. break;
  50530. case Ci.NotEqualDepth:
  50531. l.depthFunc(l.NOTEQUAL);
  50532. break;
  50533. default:
  50534. l.depthFunc(l.LEQUAL)
  50535. }
  50536. else
  50537. l.depthFunc(l.LEQUAL);
  50538. A = e
  50539. }
  50540. }
  50541. ,
  50542. this.setDepthTest = function(e) {
  50543. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50544. }
  50545. ,
  50546. this.setDepthWrite = function(e) {
  50547. C !== e && (l.depthMask(e),
  50548. C = e)
  50549. }
  50550. ,
  50551. this.setColorWrite = function(e) {
  50552. I !== e && (l.colorMask(e, e, e, e),
  50553. I = e)
  50554. }
  50555. ,
  50556. this.setStencilFunc = function(e, t, i) {
  50557. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50558. _ = e,
  50559. b = t,
  50560. w = i)
  50561. }
  50562. ,
  50563. this.setStencilOp = function(e, t, i) {
  50564. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50565. T = e,
  50566. x = t,
  50567. S = i)
  50568. }
  50569. ,
  50570. this.setStencilTest = function(e) {
  50571. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50572. }
  50573. ,
  50574. this.setStencilWrite = function(e) {
  50575. E !== e && (l.stencilMask(e),
  50576. E = e)
  50577. }
  50578. ,
  50579. this.setFlipSided = function(e) {
  50580. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50581. M = e)
  50582. }
  50583. ,
  50584. this.setLineWidth = function(e) {
  50585. e !== R && (l.lineWidth(e),
  50586. R = e)
  50587. }
  50588. ,
  50589. this.setPolygonOffset = function(e, t, i) {
  50590. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50591. !e || P === t && O === i || (l.polygonOffset(t, i),
  50592. P = t,
  50593. O = i)
  50594. }
  50595. ,
  50596. this.getScissorTest = function() {
  50597. return L
  50598. }
  50599. ,
  50600. this.setScissorTest = function(e) {
  50601. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50602. }
  50603. ,
  50604. this.activeTexture = function(e) {
  50605. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50606. N !== e && (l.activeTexture(e),
  50607. N = e)
  50608. }
  50609. ,
  50610. this.bindTexture = function(e, t) {
  50611. void 0 === N && n.activeTexture();
  50612. var i = F[N];
  50613. void 0 === i && (i = {
  50614. type: void 0,
  50615. texture: void 0
  50616. },
  50617. F[N] = i),
  50618. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50619. i.type = e,
  50620. i.texture = t)
  50621. }
  50622. ,
  50623. this.compressedTexImage2D = function() {
  50624. try {
  50625. l.compressedTexImage2D.apply(l, arguments)
  50626. } catch (e) {
  50627. console.error(e)
  50628. }
  50629. }
  50630. ,
  50631. this.texImage2D = function() {
  50632. try {
  50633. l.texImage2D.apply(l, arguments)
  50634. } catch (e) {
  50635. console.error(e)
  50636. }
  50637. }
  50638. ,
  50639. this.clearColor = function(e, t, i, n) {
  50640. r.set(e, t, i, n),
  50641. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50642. B.copy(r))
  50643. }
  50644. ,
  50645. this.clearDepth = function(e) {
  50646. V !== e && (l.clearDepth(e),
  50647. V = e)
  50648. }
  50649. ,
  50650. this.clearStencil = function(e) {
  50651. k !== e && (l.clearStencil(e),
  50652. k = e)
  50653. }
  50654. ,
  50655. this.scissor = function(e) {
  50656. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50657. U.copy(e))
  50658. }
  50659. ,
  50660. this.viewport = function(e) {
  50661. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50662. H.copy(e))
  50663. }
  50664. ,
  50665. this.reset = function() {
  50666. for (var e = 0; e < a.length; e++)
  50667. 1 === a[e] && (l.disableVertexAttribArray(e),
  50668. a[e] = 0);
  50669. t = {},
  50670. N = void 0,
  50671. F = {},
  50672. M = E = C = I = u = h = null
  50673. }
  50674. }
  50675. ,
  50676. Ci.LensFlarePlugin = function(v, y) {
  50677. function A() {
  50678. 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]);
  50679. C = S.createBuffer(),
  50680. I = S.createBuffer(),
  50681. S.bindBuffer(S.ARRAY_BUFFER, C),
  50682. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50683. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50684. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50685. T = S.createTexture(),
  50686. x = S.createTexture(),
  50687. M.bindTexture(S.TEXTURE_2D, T),
  50688. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50689. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50690. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50691. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50692. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50693. M.bindTexture(S.TEXTURE_2D, x),
  50694. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50695. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50696. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50697. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50698. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50699. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50700. 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"),
  50701. 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")
  50702. } : {
  50703. 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"),
  50704. 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")
  50705. },
  50706. E = function(e) {
  50707. var t = S.createProgram()
  50708. , i = S.createShader(S.FRAGMENT_SHADER)
  50709. , n = S.createShader(S.VERTEX_SHADER)
  50710. , r = "precision " + v.getPrecision() + " float;\n";
  50711. return S.shaderSource(i, r + e.fragmentShader),
  50712. S.shaderSource(n, r + e.vertexShader),
  50713. S.compileShader(i),
  50714. S.compileShader(n),
  50715. S.attachShader(t, i),
  50716. S.attachShader(t, n),
  50717. S.linkProgram(t),
  50718. t
  50719. }(e),
  50720. _ = {
  50721. vertex: S.getAttribLocation(E, "position"),
  50722. uv: S.getAttribLocation(E, "uv")
  50723. },
  50724. b = {
  50725. renderType: S.getUniformLocation(E, "renderType"),
  50726. map: S.getUniformLocation(E, "map"),
  50727. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50728. opacity: S.getUniformLocation(E, "opacity"),
  50729. color: S.getUniformLocation(E, "color"),
  50730. scale: S.getUniformLocation(E, "scale"),
  50731. rotation: S.getUniformLocation(E, "rotation"),
  50732. screenPosition: S.getUniformLocation(E, "screenPosition")
  50733. }
  50734. }
  50735. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50736. this.render = function(e, t, i) {
  50737. if (0 !== y.length) {
  50738. var n = new Ci.Vector3
  50739. , r = i.w / i.z
  50740. , o = .5 * i.z
  50741. , a = .5 * i.w
  50742. , s = 16 / i.w
  50743. , l = new Ci.Vector2(s * r,s)
  50744. , c = new Ci.Vector3(1,1,0)
  50745. , h = new Ci.Vector2(1,1);
  50746. void 0 === E && A(),
  50747. S.useProgram(E),
  50748. M.initAttributes(),
  50749. M.enableAttribute(_.vertex),
  50750. M.enableAttribute(_.uv),
  50751. M.disableUnusedAttributes(),
  50752. S.uniform1i(b.occlusionMap, 0),
  50753. S.uniform1i(b.map, 1),
  50754. S.bindBuffer(S.ARRAY_BUFFER, C),
  50755. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50756. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50757. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50758. M.disable(S.CULL_FACE),
  50759. M.setDepthWrite(!1);
  50760. for (var u = 0, d = y.length; u < d; u++) {
  50761. s = 16 / i.w,
  50762. l.set(s * r, s);
  50763. var p = y[u];
  50764. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50765. n.applyMatrix4(t.matrixWorldInverse),
  50766. n.applyProjection(t.projectionMatrix),
  50767. c.copy(n),
  50768. h.x = c.x * o + o,
  50769. h.y = c.y * a + a,
  50770. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50771. M.activeTexture(S.TEXTURE0),
  50772. M.bindTexture(S.TEXTURE_2D, null),
  50773. M.activeTexture(S.TEXTURE1),
  50774. M.bindTexture(S.TEXTURE_2D, T),
  50775. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50776. S.uniform1i(b.renderType, 0),
  50777. S.uniform2f(b.scale, l.x, l.y),
  50778. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50779. M.disable(S.BLEND),
  50780. M.enable(S.DEPTH_TEST),
  50781. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50782. M.activeTexture(S.TEXTURE0),
  50783. M.bindTexture(S.TEXTURE_2D, x),
  50784. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50785. S.uniform1i(b.renderType, 1),
  50786. M.disable(S.DEPTH_TEST),
  50787. M.activeTexture(S.TEXTURE1),
  50788. M.bindTexture(S.TEXTURE_2D, T),
  50789. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50790. p.positionScreen.copy(c),
  50791. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50792. S.uniform1i(b.renderType, 2),
  50793. M.enable(S.BLEND);
  50794. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50795. var m = p.lensFlares[f];
  50796. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50797. c.y = m.y,
  50798. c.z = m.z,
  50799. s = m.size * m.scale / i.w,
  50800. l.x = s * r,
  50801. l.y = s,
  50802. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50803. S.uniform2f(b.scale, l.x, l.y),
  50804. S.uniform1f(b.rotation, m.rotation),
  50805. S.uniform1f(b.opacity, m.opacity),
  50806. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50807. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50808. v.setTexture(m.texture, 1),
  50809. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50810. }
  50811. }
  50812. }
  50813. M.enable(S.CULL_FACE),
  50814. M.enable(S.DEPTH_TEST),
  50815. M.setDepthWrite(!0),
  50816. v.resetGLState()
  50817. }
  50818. }
  50819. }
  50820. ,
  50821. Ci.SpritePlugin = function(u, d) {
  50822. function p() {
  50823. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50824. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50825. g = I.createBuffer(),
  50826. m = I.createBuffer(),
  50827. I.bindBuffer(I.ARRAY_BUFFER, g),
  50828. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50829. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50830. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50831. v = function() {
  50832. var e = I.createProgram()
  50833. , t = I.createShader(I.VERTEX_SHADER)
  50834. , i = I.createShader(I.FRAGMENT_SHADER);
  50835. 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")),
  50836. 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")),
  50837. I.compileShader(t),
  50838. I.compileShader(i),
  50839. I.attachShader(e, t),
  50840. I.attachShader(e, i),
  50841. I.linkProgram(e),
  50842. e
  50843. }(),
  50844. y = {
  50845. position: I.getAttribLocation(v, "position"),
  50846. uv: I.getAttribLocation(v, "uv")
  50847. },
  50848. A = {
  50849. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50850. uvScale: I.getUniformLocation(v, "uvScale"),
  50851. rotation: I.getUniformLocation(v, "rotation"),
  50852. scale: I.getUniformLocation(v, "scale"),
  50853. color: I.getUniformLocation(v, "color"),
  50854. map: I.getUniformLocation(v, "map"),
  50855. opacity: I.getUniformLocation(v, "opacity"),
  50856. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50857. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50858. fogType: I.getUniformLocation(v, "fogType"),
  50859. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50860. fogNear: I.getUniformLocation(v, "fogNear"),
  50861. fogFar: I.getUniformLocation(v, "fogFar"),
  50862. fogColor: I.getUniformLocation(v, "fogColor"),
  50863. alphaTest: I.getUniformLocation(v, "alphaTest")
  50864. };
  50865. var i = document.createElement("canvas");
  50866. i.width = 8,
  50867. i.height = 8;
  50868. var n = i.getContext("2d");
  50869. n.fillStyle = "white",
  50870. n.fillRect(0, 0, 8, 8),
  50871. (C = new Ci.Texture(i)).needsUpdate = !0
  50872. }
  50873. function f(e, t) {
  50874. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50875. }
  50876. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50877. this.render = function(e, t) {
  50878. if (0 !== d.length) {
  50879. void 0 === v && p(),
  50880. I.useProgram(v),
  50881. E.initAttributes(),
  50882. E.enableAttribute(y.position),
  50883. E.enableAttribute(y.uv),
  50884. E.disableUnusedAttributes(),
  50885. E.disable(I.CULL_FACE),
  50886. E.enable(I.BLEND),
  50887. I.bindBuffer(I.ARRAY_BUFFER, g),
  50888. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50889. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50890. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50891. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50892. E.activeTexture(I.TEXTURE0),
  50893. I.uniform1i(A.map, 0);
  50894. var i = 0
  50895. , n = 0
  50896. , r = e.fog;
  50897. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50898. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50899. I.uniform1f(A.fogFar, r.far),
  50900. I.uniform1i(A.fogType, 1),
  50901. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50902. I.uniform1i(A.fogType, 2),
  50903. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50904. n = i = 0);
  50905. for (var o = 0, a = d.length; o < a; o++) {
  50906. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50907. l.z = -l.modelViewMatrix.elements[14]
  50908. }
  50909. d.sort(f);
  50910. var s = [];
  50911. for (o = 0,
  50912. a = d.length; o < a; o++) {
  50913. var l, c = (l = d[o]).material;
  50914. I.uniform1f(A.alphaTest, c.alphaTest),
  50915. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50916. l.matrixWorld.decompose(_, b, w),
  50917. s[0] = w.x,
  50918. s[1] = w.y;
  50919. var h = 0;
  50920. e.fog && c.fog && (h = n),
  50921. i !== h && (I.uniform1i(A.fogType, h),
  50922. i = h),
  50923. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50924. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50925. I.uniform2f(A.uvScale, 1, 1)),
  50926. I.uniform1f(A.opacity, c.opacity),
  50927. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50928. I.uniform1f(A.rotation, c.rotation),
  50929. I.uniform2fv(A.scale, s),
  50930. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50931. E.setDepthTest(c.depthTest),
  50932. E.setDepthWrite(c.depthWrite),
  50933. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50934. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50935. }
  50936. E.enable(I.CULL_FACE),
  50937. u.resetGLState()
  50938. }
  50939. }
  50940. }
  50941. ,
  50942. Object.defineProperties(Ci.Box2.prototype, {
  50943. empty: {
  50944. value: function() {
  50945. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50946. this.isEmpty()
  50947. }
  50948. },
  50949. isIntersectionBox: {
  50950. value: function(e) {
  50951. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50952. this.intersectsBox(e)
  50953. }
  50954. }
  50955. }),
  50956. Object.defineProperties(Ci.Box3.prototype, {
  50957. empty: {
  50958. value: function() {
  50959. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50960. this.isEmpty()
  50961. }
  50962. },
  50963. isIntersectionBox: {
  50964. value: function(e) {
  50965. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50966. this.intersectsBox(e)
  50967. }
  50968. },
  50969. isIntersectionSphere: {
  50970. value: function(e) {
  50971. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50972. this.intersectsSphere(e)
  50973. }
  50974. }
  50975. }),
  50976. Object.defineProperties(Ci.Matrix3.prototype, {
  50977. multiplyVector3: {
  50978. value: function(e) {
  50979. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50980. e.applyMatrix3(this)
  50981. }
  50982. },
  50983. multiplyVector3Array: {
  50984. value: function(e) {
  50985. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50986. this.applyToVector3Array(e)
  50987. }
  50988. }
  50989. }),
  50990. Object.defineProperties(Ci.Matrix4.prototype, {
  50991. extractPosition: {
  50992. value: function(e) {
  50993. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50994. this.copyPosition(e)
  50995. }
  50996. },
  50997. setRotationFromQuaternion: {
  50998. value: function(e) {
  50999. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51000. this.makeRotationFromQuaternion(e)
  51001. }
  51002. },
  51003. multiplyVector3: {
  51004. value: function(e) {
  51005. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51006. e.applyProjection(this)
  51007. }
  51008. },
  51009. multiplyVector4: {
  51010. value: function(e) {
  51011. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51012. e.applyMatrix4(this)
  51013. }
  51014. },
  51015. multiplyVector3Array: {
  51016. value: function(e) {
  51017. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51018. this.applyToVector3Array(e)
  51019. }
  51020. },
  51021. rotateAxis: {
  51022. value: function(e) {
  51023. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51024. e.transformDirection(this)
  51025. }
  51026. },
  51027. crossVector: {
  51028. value: function(e) {
  51029. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51030. e.applyMatrix4(this)
  51031. }
  51032. },
  51033. translate: {
  51034. value: function(e) {
  51035. console.error("THREE.Matrix4: .translate() has been removed.")
  51036. }
  51037. },
  51038. rotateX: {
  51039. value: function(e) {
  51040. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51041. }
  51042. },
  51043. rotateY: {
  51044. value: function(e) {
  51045. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51046. }
  51047. },
  51048. rotateZ: {
  51049. value: function(e) {
  51050. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51051. }
  51052. },
  51053. rotateByAxis: {
  51054. value: function(e, t) {
  51055. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51056. }
  51057. }
  51058. }),
  51059. Object.defineProperties(Ci.Plane.prototype, {
  51060. isIntersectionLine: {
  51061. value: function(e) {
  51062. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51063. this.intersectsLine(e)
  51064. }
  51065. }
  51066. }),
  51067. Object.defineProperties(Ci.Quaternion.prototype, {
  51068. multiplyVector3: {
  51069. value: function(e) {
  51070. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51071. e.applyQuaternion(this)
  51072. }
  51073. }
  51074. }),
  51075. Object.defineProperties(Ci.Ray.prototype, {
  51076. isIntersectionBox: {
  51077. value: function(e) {
  51078. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51079. this.intersectsBox(e)
  51080. }
  51081. },
  51082. isIntersectionPlane: {
  51083. value: function(e) {
  51084. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51085. this.intersectsPlane(e)
  51086. }
  51087. },
  51088. isIntersectionSphere: {
  51089. value: function(e) {
  51090. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51091. this.intersectsSphere(e)
  51092. }
  51093. }
  51094. }),
  51095. Object.defineProperties(Ci.Vector3.prototype, {
  51096. setEulerFromRotationMatrix: {
  51097. value: function() {
  51098. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51099. }
  51100. },
  51101. setEulerFromQuaternion: {
  51102. value: function() {
  51103. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51104. }
  51105. },
  51106. getPositionFromMatrix: {
  51107. value: function(e) {
  51108. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51109. this.setFromMatrixPosition(e)
  51110. }
  51111. },
  51112. getScaleFromMatrix: {
  51113. value: function(e) {
  51114. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51115. this.setFromMatrixScale(e)
  51116. }
  51117. },
  51118. getColumnFromMatrix: {
  51119. value: function(e, t) {
  51120. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51121. this.setFromMatrixColumn(e, t)
  51122. }
  51123. }
  51124. }),
  51125. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51126. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51127. new Ci.Face3(e,t,i,r,o,a)
  51128. }
  51129. ,
  51130. Ci.Vertex = function(e, t, i) {
  51131. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51132. new Ci.Vector3(e,t,i)
  51133. }
  51134. ,
  51135. Object.defineProperties(Ci.Object3D.prototype, {
  51136. eulerOrder: {
  51137. get: function() {
  51138. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51139. this.rotation.order
  51140. },
  51141. set: function(e) {
  51142. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51143. this.rotation.order = e
  51144. }
  51145. },
  51146. getChildByName: {
  51147. value: function(e) {
  51148. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51149. this.getObjectByName(e)
  51150. }
  51151. },
  51152. renderDepth: {
  51153. set: function(e) {
  51154. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51155. }
  51156. },
  51157. translate: {
  51158. value: function(e, t) {
  51159. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51160. this.translateOnAxis(t, e)
  51161. }
  51162. },
  51163. useQuaternion: {
  51164. get: function() {
  51165. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51166. },
  51167. set: function(e) {
  51168. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51169. }
  51170. }
  51171. }),
  51172. Object.defineProperties(Ci, {
  51173. PointCloud: {
  51174. value: function(e, t) {
  51175. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51176. new Ci.Points(e,t)
  51177. }
  51178. },
  51179. ParticleSystem: {
  51180. value: function(e, t) {
  51181. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51182. new Ci.Points(e,t)
  51183. }
  51184. }
  51185. }),
  51186. Object.defineProperties(Ci.Light.prototype, {
  51187. onlyShadow: {
  51188. set: function(e) {
  51189. console.warn("THREE.Light: .onlyShadow has been removed.")
  51190. }
  51191. },
  51192. shadowCameraFov: {
  51193. set: function(e) {
  51194. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51195. this.shadow.camera.fov = e
  51196. }
  51197. },
  51198. shadowCameraLeft: {
  51199. set: function(e) {
  51200. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51201. this.shadow.camera.left = e
  51202. }
  51203. },
  51204. shadowCameraRight: {
  51205. set: function(e) {
  51206. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51207. this.shadow.camera.right = e
  51208. }
  51209. },
  51210. shadowCameraTop: {
  51211. set: function(e) {
  51212. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51213. this.shadow.camera.top = e
  51214. }
  51215. },
  51216. shadowCameraBottom: {
  51217. set: function(e) {
  51218. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51219. this.shadow.camera.bottom = e
  51220. }
  51221. },
  51222. shadowCameraNear: {
  51223. set: function(e) {
  51224. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51225. this.shadow.camera.near = e
  51226. }
  51227. },
  51228. shadowCameraFar: {
  51229. set: function(e) {
  51230. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51231. this.shadow.camera.far = e
  51232. }
  51233. },
  51234. shadowCameraVisible: {
  51235. set: function(e) {
  51236. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51237. }
  51238. },
  51239. shadowBias: {
  51240. set: function(e) {
  51241. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51242. this.shadow.bias = e
  51243. }
  51244. },
  51245. shadowDarkness: {
  51246. set: function(e) {
  51247. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51248. }
  51249. },
  51250. shadowMapWidth: {
  51251. set: function(e) {
  51252. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51253. this.shadow.mapSize.width = e
  51254. }
  51255. },
  51256. shadowMapHeight: {
  51257. set: function(e) {
  51258. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51259. this.shadow.mapSize.height = e
  51260. }
  51261. }
  51262. }),
  51263. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51264. length: {
  51265. get: function() {
  51266. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51267. this.array.length
  51268. }
  51269. }
  51270. }),
  51271. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51272. drawcalls: {
  51273. get: function() {
  51274. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51275. this.groups
  51276. }
  51277. },
  51278. offsets: {
  51279. get: function() {
  51280. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51281. this.groups
  51282. }
  51283. },
  51284. addIndex: {
  51285. value: function(e) {
  51286. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51287. this.setIndex(e)
  51288. }
  51289. },
  51290. addDrawCall: {
  51291. value: function(e, t, i) {
  51292. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51293. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51294. this.addGroup(e, t)
  51295. }
  51296. },
  51297. clearDrawCalls: {
  51298. value: function() {
  51299. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51300. this.clearGroups()
  51301. }
  51302. },
  51303. computeTangents: {
  51304. value: function() {
  51305. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51306. }
  51307. },
  51308. computeOffsets: {
  51309. value: function() {
  51310. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51311. }
  51312. }
  51313. }),
  51314. Object.defineProperties(Ci.Material.prototype, {
  51315. wrapAround: {
  51316. get: function() {
  51317. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51318. },
  51319. set: function(e) {
  51320. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51321. }
  51322. },
  51323. wrapRGB: {
  51324. get: function() {
  51325. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51326. new Ci.Color
  51327. }
  51328. }
  51329. }),
  51330. Object.defineProperties(Ci, {
  51331. PointCloudMaterial: {
  51332. value: function(e) {
  51333. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51334. new Ci.PointsMaterial(e)
  51335. }
  51336. },
  51337. ParticleBasicMaterial: {
  51338. value: function(e) {
  51339. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51340. new Ci.PointsMaterial(e)
  51341. }
  51342. },
  51343. ParticleSystemMaterial: {
  51344. value: function(e) {
  51345. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51346. new Ci.PointsMaterial(e)
  51347. }
  51348. }
  51349. }),
  51350. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51351. metal: {
  51352. get: function() {
  51353. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51354. !1
  51355. },
  51356. set: function(e) {
  51357. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51358. }
  51359. }
  51360. }),
  51361. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51362. derivatives: {
  51363. get: function() {
  51364. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51365. this.extensions.derivatives
  51366. },
  51367. set: function(e) {
  51368. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51369. this.extensions.derivatives = e
  51370. }
  51371. }
  51372. }),
  51373. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51374. supportsFloatTextures: {
  51375. value: function() {
  51376. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51377. this.extensions.get("OES_texture_float")
  51378. }
  51379. },
  51380. supportsHalfFloatTextures: {
  51381. value: function() {
  51382. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51383. this.extensions.get("OES_texture_half_float")
  51384. }
  51385. },
  51386. supportsStandardDerivatives: {
  51387. value: function() {
  51388. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51389. this.extensions.get("OES_standard_derivatives")
  51390. }
  51391. },
  51392. supportsCompressedTextureS3TC: {
  51393. value: function() {
  51394. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51395. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51396. }
  51397. },
  51398. supportsCompressedTexturePVRTC: {
  51399. value: function() {
  51400. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51401. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51402. }
  51403. },
  51404. supportsBlendMinMax: {
  51405. value: function() {
  51406. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51407. this.extensions.get("EXT_blend_minmax")
  51408. }
  51409. },
  51410. supportsVertexTextures: {
  51411. value: function() {
  51412. return this.capabilities.vertexTextures
  51413. }
  51414. },
  51415. supportsInstancedArrays: {
  51416. value: function() {
  51417. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51418. this.extensions.get("ANGLE_instanced_arrays")
  51419. }
  51420. },
  51421. enableScissorTest: {
  51422. value: function(e) {
  51423. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51424. this.setScissorTest(e)
  51425. }
  51426. },
  51427. initMaterial: {
  51428. value: function() {
  51429. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51430. }
  51431. },
  51432. addPrePlugin: {
  51433. value: function() {
  51434. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51435. }
  51436. },
  51437. addPostPlugin: {
  51438. value: function() {
  51439. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51440. }
  51441. },
  51442. updateShadowMap: {
  51443. value: function() {
  51444. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51445. }
  51446. },
  51447. shadowMapEnabled: {
  51448. get: function() {
  51449. return this.shadowMap.enabled
  51450. },
  51451. set: function(e) {
  51452. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51453. this.shadowMap.enabled = e
  51454. }
  51455. },
  51456. shadowMapType: {
  51457. get: function() {
  51458. return this.shadowMap.type
  51459. },
  51460. set: function(e) {
  51461. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51462. this.shadowMap.type = e
  51463. }
  51464. },
  51465. shadowMapCullFace: {
  51466. get: function() {
  51467. return this.shadowMap.cullFace
  51468. },
  51469. set: function(e) {
  51470. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51471. this.shadowMap.cullFace = e
  51472. }
  51473. }
  51474. }),
  51475. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51476. wrapS: {
  51477. get: function() {
  51478. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51479. this.texture.wrapS
  51480. },
  51481. set: function(e) {
  51482. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51483. this.texture.wrapS = e
  51484. }
  51485. },
  51486. wrapT: {
  51487. get: function() {
  51488. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51489. this.texture.wrapT
  51490. },
  51491. set: function(e) {
  51492. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51493. this.texture.wrapT = e
  51494. }
  51495. },
  51496. magFilter: {
  51497. get: function() {
  51498. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51499. this.texture.magFilter
  51500. },
  51501. set: function(e) {
  51502. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51503. this.texture.magFilter = e
  51504. }
  51505. },
  51506. minFilter: {
  51507. get: function() {
  51508. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51509. this.texture.minFilter
  51510. },
  51511. set: function(e) {
  51512. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51513. this.texture.minFilter = e
  51514. }
  51515. },
  51516. anisotropy: {
  51517. get: function() {
  51518. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51519. this.texture.anisotropy
  51520. },
  51521. set: function(e) {
  51522. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51523. this.texture.anisotropy = e
  51524. }
  51525. },
  51526. offset: {
  51527. get: function() {
  51528. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51529. this.texture.offset
  51530. },
  51531. set: function(e) {
  51532. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51533. this.texture.offset = e
  51534. }
  51535. },
  51536. repeat: {
  51537. get: function() {
  51538. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51539. this.texture.repeat
  51540. },
  51541. set: function(e) {
  51542. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51543. this.texture.repeat = e
  51544. }
  51545. },
  51546. format: {
  51547. get: function() {
  51548. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51549. this.texture.format
  51550. },
  51551. set: function(e) {
  51552. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51553. this.texture.format = e
  51554. }
  51555. },
  51556. type: {
  51557. get: function() {
  51558. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51559. this.texture.type
  51560. },
  51561. set: function(e) {
  51562. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51563. this.texture.type = e
  51564. }
  51565. },
  51566. generateMipmaps: {
  51567. get: function() {
  51568. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51569. this.texture.generateMipmaps
  51570. },
  51571. set: function(e) {
  51572. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51573. this.texture.generateMipmaps = e
  51574. }
  51575. }
  51576. }),
  51577. Ci.GeometryUtils = {
  51578. merge: function(e, t, i) {
  51579. var n;
  51580. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51581. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51582. n = t.matrix,
  51583. t = t.geometry),
  51584. e.merge(t, n, i)
  51585. },
  51586. center: function(e) {
  51587. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51588. e.center()
  51589. }
  51590. },
  51591. Ci.ImageUtils = {
  51592. crossOrigin: void 0,
  51593. loadTexture: function(e, t, i, n) {
  51594. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51595. var r = new Ci.TextureLoader;
  51596. r.setCrossOrigin(this.crossOrigin);
  51597. var o = r.load(e, i, void 0, n);
  51598. return t && (o.mapping = t),
  51599. o
  51600. },
  51601. loadTextureCube: function(e, t, i, n) {
  51602. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51603. var r = new Ci.CubeTextureLoader;
  51604. r.setCrossOrigin(this.crossOrigin);
  51605. var o = r.load(e, i, void 0, n);
  51606. return t && (o.mapping = t),
  51607. o
  51608. },
  51609. loadCompressedTexture: function() {
  51610. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51611. },
  51612. loadCompressedTextureCube: function() {
  51613. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51614. }
  51615. },
  51616. Ci.Projector = function() {
  51617. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51618. this.projectVector = function(e, t) {
  51619. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51620. e.project(t)
  51621. }
  51622. ,
  51623. this.unprojectVector = function(e, t) {
  51624. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51625. e.unproject(t)
  51626. }
  51627. ,
  51628. this.pickingRay = function(e, t) {
  51629. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51630. }
  51631. }
  51632. ,
  51633. Ci.CanvasRenderer = function() {
  51634. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51635. this.domElement = document.createElement("canvas"),
  51636. this.clear = function() {}
  51637. ,
  51638. this.render = function() {}
  51639. ,
  51640. this.setClearColor = function() {}
  51641. ,
  51642. this.setSize = function() {}
  51643. }
  51644. ,
  51645. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51646. Ci.CurveUtils = {
  51647. tangentQuadraticBezier: function(e, t, i, n) {
  51648. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51649. },
  51650. tangentCubicBezier: function(e, t, i, n, r) {
  51651. 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
  51652. },
  51653. tangentSpline: function(e, t, i, n, r) {
  51654. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51655. },
  51656. interpolate: function(e, t, i, n, r) {
  51657. var o = .5 * (i - e)
  51658. , a = .5 * (n - t)
  51659. , s = r * r;
  51660. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51661. }
  51662. },
  51663. Ci.SceneUtils = {
  51664. createMultiMaterialObject: function(e, t) {
  51665. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51666. i.add(new Ci.Mesh(e,t[n]));
  51667. return i
  51668. },
  51669. detach: function(e, t, i) {
  51670. e.applyMatrix(t.matrixWorld),
  51671. t.remove(e),
  51672. i.add(e)
  51673. },
  51674. attach: function(e, t, i) {
  51675. var n = new Ci.Matrix4;
  51676. n.getInverse(i.matrixWorld),
  51677. e.applyMatrix(n),
  51678. t.remove(e),
  51679. i.add(e)
  51680. }
  51681. },
  51682. Ci.ShapeUtils = {
  51683. area: function(e) {
  51684. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51685. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51686. return .5 * i
  51687. },
  51688. triangulate: function(e, t) {
  51689. var i = e.length;
  51690. if (i < 3)
  51691. return null;
  51692. var n, r, o, a = [], s = [], l = [];
  51693. if (0 < Ci.ShapeUtils.area(e))
  51694. for (r = 0; r < i; r++)
  51695. s[r] = r;
  51696. else
  51697. for (r = 0; r < i; r++)
  51698. s[r] = i - 1 - r;
  51699. var c = i
  51700. , h = 2 * c;
  51701. for (r = c - 1; 2 < c; ) {
  51702. if (h-- <= 0)
  51703. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51704. t ? l : a;
  51705. if (c <= (n = r) && (n = 0),
  51706. c <= (r = n + 1) && (r = 0),
  51707. c <= (o = r + 1) && (o = 0),
  51708. Si(e, n, r, o, c, s)) {
  51709. var u, d, p, f, g;
  51710. for (u = s[n],
  51711. d = s[r],
  51712. p = s[o],
  51713. a.push([e[u], e[d], e[p]]),
  51714. l.push([s[n], s[r], s[o]]),
  51715. g = (f = r) + 1; g < c; f++,
  51716. g++)
  51717. s[f] = s[g];
  51718. h = 2 * --c
  51719. }
  51720. }
  51721. return t ? l : a
  51722. },
  51723. triangulateShape: function(e, t) {
  51724. function w(e, t, i) {
  51725. 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
  51726. }
  51727. function b(e, t, i, n, r) {
  51728. var o = t.x - e.x
  51729. , a = t.y - e.y
  51730. , s = n.x - i.x
  51731. , l = n.y - i.y
  51732. , c = e.x - i.x
  51733. , h = e.y - i.y
  51734. , u = a * s - o * l
  51735. , d = a * c - o * h;
  51736. if (Math.abs(u) > Number.EPSILON) {
  51737. var p;
  51738. if (0 < u) {
  51739. if (d < 0 || u < d)
  51740. return [];
  51741. if ((p = l * c - s * h) < 0 || u < p)
  51742. return []
  51743. } else {
  51744. if (0 < d || d < u)
  51745. return [];
  51746. if (0 < (p = l * c - s * h) || p < u)
  51747. return []
  51748. }
  51749. if (0 === p)
  51750. return !r || 0 != d && d != u ? [e] : [];
  51751. if (p === u)
  51752. return !r || 0 != d && d != u ? [t] : [];
  51753. if (0 == d)
  51754. return [i];
  51755. if (d == u)
  51756. return [n];
  51757. var f = p / u;
  51758. return [{
  51759. x: e.x + f * o,
  51760. y: e.y + f * a
  51761. }]
  51762. }
  51763. if (0 != d || l * c != s * h)
  51764. return [];
  51765. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51766. 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,
  51767. (m = t).x) : (v = (g = t).x,
  51768. (m = e).x),
  51769. i.x < n.x ? (I = (A = i).x,
  51770. (C = n).x) : (I = (A = n).x,
  51771. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51772. (m = t).y) : (v = (g = t).y,
  51773. (m = e).y),
  51774. i.y < n.y ? (I = (A = i).y,
  51775. (C = n).y) : (I = (A = n).y,
  51776. (C = i).y)),
  51777. 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])
  51778. }
  51779. function T(e, t, i, n) {
  51780. var r = t.x - e.x
  51781. , o = t.y - e.y
  51782. , a = i.x - e.x
  51783. , s = i.y - e.y
  51784. , l = n.x - e.x
  51785. , c = n.y - e.y
  51786. , h = r * s - o * a
  51787. , u = r * c - o * l;
  51788. if (Math.abs(h) > Number.EPSILON) {
  51789. var d = l * s - c * a;
  51790. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51791. }
  51792. return 0 < u
  51793. }
  51794. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51795. Array.prototype.push.apply(c, t[h]);
  51796. for (i = 0,
  51797. n = c.length; i < n; i++)
  51798. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51799. l[a] = i;
  51800. var d = function(e, a) {
  51801. function t(e, t) {
  51802. var i = m.length - 1
  51803. , n = e - 1;
  51804. n < 0 && (n = i);
  51805. var r = e + 1;
  51806. i < r && (r = 0);
  51807. var o = T(m[e], m[n], m[r], c[t]);
  51808. if (!o)
  51809. return !1;
  51810. var a = c.length - 1
  51811. , s = t - 1;
  51812. s < 0 && (s = a);
  51813. var l = t + 1;
  51814. return a < l && (l = 0),
  51815. !!(o = T(c[t], c[s], c[l], m[e]))
  51816. }
  51817. function i(e, t) {
  51818. var i, n;
  51819. for (i = 0; i < m.length; i++)
  51820. if (n = i + 1,
  51821. n %= m.length,
  51822. 0 < b(e, t, m[i], m[n], !0).length)
  51823. return !0;
  51824. return !1
  51825. }
  51826. function n(e, t) {
  51827. var i, n, r, o;
  51828. for (i = 0; i < v.length; i++)
  51829. for (n = a[v[i]],
  51830. r = 0; r < n.length; r++)
  51831. if (o = r + 1,
  51832. o %= n.length,
  51833. 0 < b(e, t, n[r], n[o], !0).length)
  51834. return !0;
  51835. return !1
  51836. }
  51837. 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++)
  51838. v.push(A);
  51839. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51840. if (--E < 0) {
  51841. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51842. break
  51843. }
  51844. for (o = I; o < m.length; o++) {
  51845. s = m[o],
  51846. r = -1;
  51847. for (A = 0; A < v.length; A++)
  51848. if (h = v[A],
  51849. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51850. c = a[h];
  51851. for (var _ = 0; _ < c.length; _++)
  51852. if (l = c[_],
  51853. t(o, _) && !i(s, l) && !n(s, l)) {
  51854. r = _,
  51855. v.splice(A, 1),
  51856. d = m.slice(0, o + 1),
  51857. p = m.slice(o),
  51858. f = c.slice(r),
  51859. g = c.slice(0, r + 1),
  51860. m = d.concat(f).concat(g).concat(p),
  51861. I = o;
  51862. break
  51863. }
  51864. if (0 <= r)
  51865. break;
  51866. y[u] = !0
  51867. }
  51868. if (0 <= r)
  51869. break
  51870. }
  51871. }
  51872. return m
  51873. }(e, t)
  51874. , p = Ci.ShapeUtils.triangulate(d, !1);
  51875. for (i = 0,
  51876. n = p.length; i < n; i++)
  51877. for (o = p[i],
  51878. r = 0; r < 3; r++)
  51879. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51880. return p.concat()
  51881. },
  51882. isClockWise: function(e) {
  51883. return Ci.ShapeUtils.area(e) < 0
  51884. },
  51885. b2: function(e, t, i, n) {
  51886. return function(e, t) {
  51887. var i = 1 - e;
  51888. return i * i * t
  51889. }(e, t) + function(e, t) {
  51890. return 2 * (1 - e) * e * t
  51891. }(e, i) + function(e, t) {
  51892. return e * e * t
  51893. }(e, n)
  51894. },
  51895. b3: function(e, t, i, n, r) {
  51896. return function(e, t) {
  51897. var i = 1 - e;
  51898. return i * i * i * t
  51899. }(e, t) + function(e, t) {
  51900. var i = 1 - e;
  51901. return 3 * i * i * e * t
  51902. }(e, i) + function(e, t) {
  51903. return 3 * (1 - e) * e * e * t
  51904. }(e, n) + function(e, t) {
  51905. return e * e * e * t
  51906. }(e, r)
  51907. }
  51908. },
  51909. Ci.Curve = function() {}
  51910. ,
  51911. Ci.Curve.prototype = {
  51912. constructor: Ci.Curve,
  51913. getPoint: function(e) {
  51914. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51915. null
  51916. },
  51917. getPointAt: function(e) {
  51918. var t = this.getUtoTmapping(e);
  51919. return this.getPoint(t)
  51920. },
  51921. getPoints: function(e) {
  51922. e = e || 5;
  51923. var t, i = [];
  51924. for (t = 0; t <= e; t++)
  51925. i.push(this.getPoint(t / e));
  51926. return i
  51927. },
  51928. getSpacedPoints: function(e) {
  51929. e = e || 5;
  51930. var t, i = [];
  51931. for (t = 0; t <= e; t++)
  51932. i.push(this.getPointAt(t / e));
  51933. return i
  51934. },
  51935. getLength: function() {
  51936. var e = this.getLengths();
  51937. return e[e.length - 1]
  51938. },
  51939. getLengths: function(e) {
  51940. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51941. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51942. return this.cacheArcLengths;
  51943. this.needsUpdate = !1;
  51944. var t, i, n = [], r = this.getPoint(0), o = 0;
  51945. for (n.push(0),
  51946. i = 1; i <= e; i++)
  51947. o += (t = this.getPoint(i / e)).distanceTo(r),
  51948. n.push(o),
  51949. r = t;
  51950. return this.cacheArcLengths = n
  51951. },
  51952. updateArcLengths: function() {
  51953. this.needsUpdate = !0,
  51954. this.getLengths()
  51955. },
  51956. getUtoTmapping: function(e, t) {
  51957. var i, n = this.getLengths(), r = 0, o = n.length;
  51958. i = t || e * n[o - 1];
  51959. for (var a, s = 0, l = o - 1; s <= l; )
  51960. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51961. s = r + 1;
  51962. else {
  51963. if (!(0 < a)) {
  51964. l = r;
  51965. break
  51966. }
  51967. l = r - 1
  51968. }
  51969. if (n[r = l] === i)
  51970. return r / (o - 1);
  51971. var c = n[r];
  51972. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51973. },
  51974. getTangent: function(e) {
  51975. var t = e - 1e-4
  51976. , i = e + 1e-4;
  51977. t < 0 && (t = 0),
  51978. 1 < i && (i = 1);
  51979. var n = this.getPoint(t);
  51980. return this.getPoint(i).clone().sub(n).normalize()
  51981. },
  51982. getTangentAt: function(e) {
  51983. var t = this.getUtoTmapping(e);
  51984. return this.getTangent(t)
  51985. }
  51986. },
  51987. Ci.Curve.create = function(e, t) {
  51988. return e.prototype = Object.create(Ci.Curve.prototype),
  51989. (e.prototype.constructor = e).prototype.getPoint = t,
  51990. e
  51991. }
  51992. ,
  51993. Ci.CurvePath = function() {
  51994. this.curves = [],
  51995. this.autoClose = !1
  51996. }
  51997. ,
  51998. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51999. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52000. Ci.CurvePath.prototype.add = function(e) {
  52001. this.curves.push(e)
  52002. }
  52003. ,
  52004. Ci.CurvePath.prototype.closePath = function() {
  52005. var e = this.curves[0].getPoint(0)
  52006. , t = this.curves[this.curves.length - 1].getPoint(1);
  52007. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52008. }
  52009. ,
  52010. Ci.CurvePath.prototype.getPoint = function(e) {
  52011. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52012. if (i[n] >= t) {
  52013. var r = i[n] - t
  52014. , o = this.curves[n]
  52015. , a = 1 - r / o.getLength();
  52016. return o.getPointAt(a)
  52017. }
  52018. n++
  52019. }
  52020. return null
  52021. }
  52022. ,
  52023. Ci.CurvePath.prototype.getLength = function() {
  52024. var e = this.getCurveLengths();
  52025. return e[e.length - 1]
  52026. }
  52027. ,
  52028. Ci.CurvePath.prototype.getCurveLengths = function() {
  52029. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52030. return this.cacheLengths;
  52031. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52032. t += this.curves[i].getLength(),
  52033. e.push(t);
  52034. return this.cacheLengths = e
  52035. }
  52036. ,
  52037. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52038. var t = this.getPoints(e);
  52039. return this.createGeometry(t)
  52040. }
  52041. ,
  52042. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52043. var t = this.getSpacedPoints(e);
  52044. return this.createGeometry(t)
  52045. }
  52046. ,
  52047. Ci.CurvePath.prototype.createGeometry = function(e) {
  52048. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52049. var r = e[i];
  52050. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52051. }
  52052. return t
  52053. }
  52054. ,
  52055. Ci.Font = function(e) {
  52056. this.data = e
  52057. }
  52058. ,
  52059. Ci.Font.prototype = {
  52060. constructor: Ci.Font,
  52061. generateShapes: function(e, s, b) {
  52062. function l(e, t, i) {
  52063. var n = w.glyphs[e] || w.glyphs["?"];
  52064. if (n) {
  52065. 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;
  52066. if (n.o)
  52067. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52068. switch (A[C++]) {
  52069. case "m":
  52070. r = A[C++] * t + i,
  52071. o = A[C++] * t,
  52072. g.moveTo(r, o);
  52073. break;
  52074. case "l":
  52075. r = A[C++] * t + i,
  52076. o = A[C++] * t,
  52077. g.lineTo(r, o);
  52078. break;
  52079. case "q":
  52080. if (a = A[C++] * t + i,
  52081. s = A[C++] * t,
  52082. h = A[C++] * t + i,
  52083. u = A[C++] * t,
  52084. g.quadraticCurveTo(h, u, a, s),
  52085. f = m[m.length - 1]) {
  52086. l = f.x,
  52087. c = f.y;
  52088. for (var E = 1; E <= b; E++) {
  52089. v(_ = E / b, l, h, a),
  52090. v(_, c, u, s)
  52091. }
  52092. }
  52093. break;
  52094. case "b":
  52095. if (a = A[C++] * t + i,
  52096. s = A[C++] * t,
  52097. h = A[C++] * t + i,
  52098. u = A[C++] * t,
  52099. d = A[C++] * t + i,
  52100. p = A[C++] * t,
  52101. g.bezierCurveTo(h, u, d, p, a, s),
  52102. f = m[m.length - 1]) {
  52103. l = f.x,
  52104. c = f.y;
  52105. for (E = 1; E <= b; E++) {
  52106. var _;
  52107. y(_ = E / b, l, h, d, a),
  52108. y(_, c, u, p, s)
  52109. }
  52110. }
  52111. }
  52112. }
  52113. return {
  52114. offset: n.ha * t,
  52115. path: g
  52116. }
  52117. }
  52118. }
  52119. void 0 === s && (s = 100),
  52120. void 0 === b && (b = 4);
  52121. for (var w = this.data, t = function(e) {
  52122. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52123. var a = l(t[o], i, n);
  52124. n += a.offset,
  52125. r.push(a.path)
  52126. }
  52127. return r
  52128. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52129. Array.prototype.push.apply(i, t[n].toShapes());
  52130. return i
  52131. }
  52132. },
  52133. Ci.Path = function(e) {
  52134. Ci.CurvePath.call(this),
  52135. this.actions = [],
  52136. e && this.fromPoints(e)
  52137. }
  52138. ,
  52139. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52140. Ci.Path.prototype.constructor = Ci.Path,
  52141. Ci.Path.prototype.fromPoints = function(e) {
  52142. this.moveTo(e[0].x, e[0].y);
  52143. for (var t = 1, i = e.length; t < i; t++)
  52144. this.lineTo(e[t].x, e[t].y)
  52145. }
  52146. ,
  52147. Ci.Path.prototype.moveTo = function(e, t) {
  52148. this.actions.push({
  52149. action: "moveTo",
  52150. args: [e, t]
  52151. })
  52152. }
  52153. ,
  52154. Ci.Path.prototype.lineTo = function(e, t) {
  52155. var i = this.actions[this.actions.length - 1].args
  52156. , n = i[i.length - 2]
  52157. , r = i[i.length - 1]
  52158. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52159. this.curves.push(o),
  52160. this.actions.push({
  52161. action: "lineTo",
  52162. args: [e, t]
  52163. })
  52164. }
  52165. ,
  52166. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52167. var r = this.actions[this.actions.length - 1].args
  52168. , o = r[r.length - 2]
  52169. , a = r[r.length - 1]
  52170. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52171. this.curves.push(s),
  52172. this.actions.push({
  52173. action: "quadraticCurveTo",
  52174. args: [e, t, i, n]
  52175. })
  52176. }
  52177. ,
  52178. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52179. var a = this.actions[this.actions.length - 1].args
  52180. , s = a[a.length - 2]
  52181. , l = a[a.length - 1]
  52182. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52183. this.curves.push(c),
  52184. this.actions.push({
  52185. action: "bezierCurveTo",
  52186. args: [e, t, i, n, r, o]
  52187. })
  52188. }
  52189. ,
  52190. Ci.Path.prototype.splineThru = function(e) {
  52191. var t = Array.prototype.slice.call(arguments)
  52192. , i = this.actions[this.actions.length - 1].args
  52193. , n = i[i.length - 2]
  52194. , r = i[i.length - 1]
  52195. , o = [new Ci.Vector2(n,r)];
  52196. Array.prototype.push.apply(o, e);
  52197. var a = new Ci.SplineCurve(o);
  52198. this.curves.push(a),
  52199. this.actions.push({
  52200. action: "splineThru",
  52201. args: t
  52202. })
  52203. }
  52204. ,
  52205. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52206. var a = this.actions[this.actions.length - 1].args
  52207. , s = a[a.length - 2]
  52208. , l = a[a.length - 1];
  52209. this.absarc(e + s, t + l, i, n, r, o)
  52210. }
  52211. ,
  52212. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52213. this.absellipse(e, t, i, i, n, r, o)
  52214. }
  52215. ,
  52216. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52217. var l = this.actions[this.actions.length - 1].args
  52218. , c = l[l.length - 2]
  52219. , h = l[l.length - 1];
  52220. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52221. }
  52222. ,
  52223. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52224. var l = [e, t, i, n, r, o, a, s || 0]
  52225. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52226. this.curves.push(c);
  52227. var h = c.getPoint(1);
  52228. l.push(h.x),
  52229. l.push(h.y),
  52230. this.actions.push({
  52231. action: "ellipse",
  52232. args: l
  52233. })
  52234. }
  52235. ,
  52236. Ci.Path.prototype.getSpacedPoints = function(e) {
  52237. e = e || 40;
  52238. for (var t = [], i = 0; i < e; i++)
  52239. t.push(this.getPoint(i / e));
  52240. return this.autoClose && t.push(t[0]),
  52241. t
  52242. }
  52243. ,
  52244. Ci.Path.prototype.getPoints = function(e) {
  52245. e = e || 12;
  52246. 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++) {
  52247. var v = this.actions[g]
  52248. , y = v.action
  52249. , A = v.args;
  52250. switch (y) {
  52251. case "moveTo":
  52252. case "lineTo":
  52253. f.push(new Ci.Vector2(A[0],A[1]));
  52254. break;
  52255. case "quadraticCurveTo":
  52256. t = A[2],
  52257. i = A[3],
  52258. o = A[0],
  52259. a = A[1],
  52260. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52261. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52262. c[c.length - 1]);
  52263. for (var C = 1; C <= e; C++) {
  52264. h = d(O = C / e, s, o, t),
  52265. u = d(O, l, a, i),
  52266. f.push(new Ci.Vector2(h,u))
  52267. }
  52268. break;
  52269. case "bezierCurveTo":
  52270. t = A[4],
  52271. i = A[5],
  52272. o = A[0],
  52273. a = A[1],
  52274. n = A[2],
  52275. r = A[3],
  52276. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52277. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52278. c[c.length - 1]);
  52279. for (C = 1; C <= e; C++) {
  52280. h = p(O = C / e, s, o, n, t),
  52281. u = p(O, l, a, r, i),
  52282. f.push(new Ci.Vector2(h,u))
  52283. }
  52284. break;
  52285. case "splineThru":
  52286. c = this.actions[g - 1].args;
  52287. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52288. , E = e * A[0].length;
  52289. I = I.concat(A[0]);
  52290. var _ = new Ci.SplineCurve(I);
  52291. for (C = 1; C <= E; C++)
  52292. f.push(_.getPointAt(C / E));
  52293. break;
  52294. case "arc":
  52295. var b = A[0]
  52296. , w = A[1]
  52297. , T = A[2]
  52298. , x = A[3]
  52299. , S = A[4]
  52300. , M = !!A[5]
  52301. , R = S - x
  52302. , P = 2 * e;
  52303. for (C = 1; C <= P; C++) {
  52304. var O = C / P;
  52305. M || (O = 1 - O),
  52306. L = x + O * R,
  52307. h = b + T * Math.cos(L),
  52308. u = w + T * Math.sin(L),
  52309. f.push(new Ci.Vector2(h,u))
  52310. }
  52311. break;
  52312. case "ellipse":
  52313. b = A[0],
  52314. w = A[1];
  52315. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52316. S = A[5],
  52317. M = !!A[6],
  52318. A[7]);
  52319. R = S - x,
  52320. P = 2 * e;
  52321. 0 !== V && (D = Math.cos(V),
  52322. N = Math.sin(V));
  52323. for (C = 1; C <= P; C++) {
  52324. O = C / P;
  52325. if (M || (O = 1 - O),
  52326. L = x + O * R,
  52327. h = b + F * Math.cos(L),
  52328. u = w + B * Math.sin(L),
  52329. 0 !== V) {
  52330. var k = h;
  52331. h = (k - b) * D - (u - w) * N + b,
  52332. u = (k - b) * N + (u - w) * D + w
  52333. }
  52334. f.push(new Ci.Vector2(h,u))
  52335. }
  52336. }
  52337. }
  52338. var U = f[f.length - 1];
  52339. 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),
  52340. this.autoClose && f.push(f[0]),
  52341. f
  52342. }
  52343. ,
  52344. Ci.Path.prototype.toShapes = function(e, t) {
  52345. function i(e) {
  52346. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52347. var r = e[i]
  52348. , o = new Ci.Shape;
  52349. o.actions = r.actions,
  52350. o.curves = r.curves,
  52351. t.push(o)
  52352. }
  52353. return t
  52354. }
  52355. function n(e, t) {
  52356. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52357. var a = t[r]
  52358. , s = t[o]
  52359. , l = s.x - a.x
  52360. , c = s.y - a.y;
  52361. if (Math.abs(c) > Number.EPSILON) {
  52362. if (c < 0 && (a = t[o],
  52363. l = -l,
  52364. s = t[r],
  52365. c = -c),
  52366. e.y < a.y || e.y > s.y)
  52367. continue;
  52368. if (e.y === a.y) {
  52369. if (e.x === a.x)
  52370. return !0
  52371. } else {
  52372. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52373. if (0 == h)
  52374. return !0;
  52375. if (h < 0)
  52376. continue;
  52377. n = !n
  52378. }
  52379. } else {
  52380. if (e.y !== a.y)
  52381. continue;
  52382. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52383. return !0
  52384. }
  52385. }
  52386. return n
  52387. }
  52388. var r = Ci.ShapeUtils.isClockWise
  52389. , o = function(e) {
  52390. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52391. var o = e[n]
  52392. , a = o.args
  52393. , s = o.action;
  52394. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52395. i = new Ci.Path),
  52396. i[s].apply(i, a)
  52397. }
  52398. return 0 !== i.actions.length && t.push(i),
  52399. t
  52400. }(this.actions);
  52401. if (0 === o.length)
  52402. return [];
  52403. if (!0 === t)
  52404. return i(o);
  52405. var a, s, l, c = [];
  52406. if (1 === o.length)
  52407. return s = o[0],
  52408. (l = new Ci.Shape).actions = s.actions,
  52409. l.curves = s.curves,
  52410. c.push(l),
  52411. c;
  52412. var h = !r(o[0].getPoints());
  52413. h = e ? !h : h;
  52414. var u, d = [], p = [], f = [], g = 0;
  52415. p[g] = void 0,
  52416. f[g] = [];
  52417. for (var m = 0, v = o.length; m < v; m++)
  52418. a = r(u = (s = o[m]).getPoints()),
  52419. (a = e ? !a : a) ? (!h && p[g] && g++,
  52420. p[g] = {
  52421. s: new Ci.Shape,
  52422. p: u
  52423. },
  52424. p[g].s.actions = s.actions,
  52425. p[g].s.curves = s.curves,
  52426. h && g++,
  52427. f[g] = []) : f[g].push({
  52428. h: s,
  52429. p: u[0]
  52430. });
  52431. if (!p[0])
  52432. return i(o);
  52433. if (1 < p.length) {
  52434. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52435. d[C] = [];
  52436. for (C = 0,
  52437. I = p.length; C < I; C++)
  52438. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52439. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52440. n(b.p, p[T].p) && (C !== T && A.push({
  52441. froms: C,
  52442. tos: T,
  52443. hole: _
  52444. }),
  52445. w ? (w = !1,
  52446. d[T].push(b)) : y = !0);
  52447. w && d[C].push(b)
  52448. }
  52449. 0 < A.length && (y || (f = d))
  52450. }
  52451. m = 0;
  52452. for (var x, S = p.length; m < S; m++) {
  52453. l = p[m].s,
  52454. c.push(l);
  52455. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52456. l.holes.push(x[M].h)
  52457. }
  52458. return c
  52459. }
  52460. ,
  52461. Ci.Shape = function() {
  52462. Ci.Path.apply(this, arguments),
  52463. this.holes = []
  52464. }
  52465. ,
  52466. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52467. Ci.Shape.prototype.constructor = Ci.Shape,
  52468. Ci.Shape.prototype.extrude = function(e) {
  52469. return new Ci.ExtrudeGeometry(this,e)
  52470. }
  52471. ,
  52472. Ci.Shape.prototype.makeGeometry = function(e) {
  52473. return new Ci.ShapeGeometry(this,e)
  52474. }
  52475. ,
  52476. Ci.Shape.prototype.getPointsHoles = function(e) {
  52477. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52478. t[i] = this.holes[i].getPoints(e);
  52479. return t
  52480. }
  52481. ,
  52482. Ci.Shape.prototype.extractAllPoints = function(e) {
  52483. return {
  52484. shape: this.getPoints(e),
  52485. holes: this.getPointsHoles(e)
  52486. }
  52487. }
  52488. ,
  52489. Ci.Shape.prototype.extractPoints = function(e) {
  52490. return this.extractAllPoints(e)
  52491. }
  52492. ,
  52493. Ci.LineCurve = function(e, t) {
  52494. this.v1 = e,
  52495. this.v2 = t
  52496. }
  52497. ,
  52498. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52499. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52500. Ci.LineCurve.prototype.getPoint = function(e) {
  52501. var t = this.v2.clone().sub(this.v1);
  52502. return t.multiplyScalar(e).add(this.v1),
  52503. t
  52504. }
  52505. ,
  52506. Ci.LineCurve.prototype.getPointAt = function(e) {
  52507. return this.getPoint(e)
  52508. }
  52509. ,
  52510. Ci.LineCurve.prototype.getTangent = function(e) {
  52511. return this.v2.clone().sub(this.v1).normalize()
  52512. }
  52513. ,
  52514. Ci.QuadraticBezierCurve = function(e, t, i) {
  52515. this.v0 = e,
  52516. this.v1 = t,
  52517. this.v2 = i
  52518. }
  52519. ,
  52520. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52521. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52522. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52523. var t = Ci.ShapeUtils.b2;
  52524. 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))
  52525. }
  52526. ,
  52527. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52528. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52529. 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()
  52530. }
  52531. ,
  52532. Ci.CubicBezierCurve = function(e, t, i, n) {
  52533. this.v0 = e,
  52534. this.v1 = t,
  52535. this.v2 = i,
  52536. this.v3 = n
  52537. }
  52538. ,
  52539. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52540. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52541. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52542. var t = Ci.ShapeUtils.b3;
  52543. 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))
  52544. }
  52545. ,
  52546. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52547. var t = Ci.CurveUtils.tangentCubicBezier;
  52548. 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()
  52549. }
  52550. ,
  52551. Ci.SplineCurve = function(e) {
  52552. this.points = null == e ? [] : e
  52553. }
  52554. ,
  52555. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52556. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52557. Ci.SplineCurve.prototype.getPoint = function(e) {
  52558. var t = this.points
  52559. , i = (t.length - 1) * e
  52560. , n = Math.floor(i)
  52561. , r = i - n
  52562. , o = t[0 === n ? n : n - 1]
  52563. , a = t[n]
  52564. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52565. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52566. , c = Ci.CurveUtils.interpolate;
  52567. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52568. }
  52569. ,
  52570. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52571. this.aX = e,
  52572. this.aY = t,
  52573. this.xRadius = i,
  52574. this.yRadius = n,
  52575. this.aStartAngle = r,
  52576. this.aEndAngle = o,
  52577. this.aClockwise = a,
  52578. this.aRotation = s || 0
  52579. }
  52580. ,
  52581. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52582. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52583. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52584. var t, i = this.aEndAngle - this.aStartAngle;
  52585. i < 0 && (i += 2 * Math.PI),
  52586. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52587. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52588. var n = this.aX + this.xRadius * Math.cos(t)
  52589. , r = this.aY + this.yRadius * Math.sin(t);
  52590. if (0 !== this.aRotation) {
  52591. var o = Math.cos(this.aRotation)
  52592. , a = Math.sin(this.aRotation)
  52593. , s = n
  52594. , l = r;
  52595. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52596. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52597. }
  52598. return new Ci.Vector2(n,r)
  52599. }
  52600. ,
  52601. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52602. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52603. }
  52604. ,
  52605. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52606. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52607. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52608. this.v1 = e,
  52609. this.v2 = t
  52610. }, function(e) {
  52611. var t = new Ci.Vector3;
  52612. return t.subVectors(this.v2, this.v1),
  52613. t.multiplyScalar(e),
  52614. t.add(this.v1),
  52615. t
  52616. }),
  52617. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52618. this.v0 = e,
  52619. this.v1 = t,
  52620. this.v2 = i
  52621. }, function(e) {
  52622. var t = Ci.ShapeUtils.b2;
  52623. 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))
  52624. }),
  52625. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52626. this.v0 = e,
  52627. this.v1 = t,
  52628. this.v2 = i,
  52629. this.v3 = n
  52630. }, function(e) {
  52631. var t = Ci.ShapeUtils.b3;
  52632. 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))
  52633. }),
  52634. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52635. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52636. this.points = null == e ? [] : e
  52637. }, function(e) {
  52638. var t = this.points
  52639. , i = (t.length - 1) * e
  52640. , n = Math.floor(i)
  52641. , r = i - n
  52642. , o = t[0 == n ? n : n - 1]
  52643. , a = t[n]
  52644. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52645. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52646. , c = Ci.CurveUtils.interpolate;
  52647. 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))
  52648. }),
  52649. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52650. Xt = new xi,
  52651. Zt = new xi,
  52652. Kt = new xi,
  52653. xi.prototype.init = function(e, t, i, n) {
  52654. this.c0 = e,
  52655. this.c1 = i,
  52656. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52657. this.c3 = 2 * e - 2 * t + i + n
  52658. }
  52659. ,
  52660. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52661. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52662. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52663. s *= o,
  52664. l *= o,
  52665. this.init(t, i, s, l)
  52666. }
  52667. ,
  52668. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52669. this.init(t, i, r * (i - e), r * (n - t))
  52670. }
  52671. ,
  52672. xi.prototype.calc = function(e) {
  52673. var t = e * e
  52674. , i = t * e;
  52675. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52676. }
  52677. ,
  52678. Ci.Curve.create(function(e) {
  52679. this.points = e || [],
  52680. this.closed = !1
  52681. }, function(e) {
  52682. var t, i, n, r, o, a, s, l, c = this.points;
  52683. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52684. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52685. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52686. n = 1),
  52687. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52688. qt),
  52689. a = c[i % r],
  52690. s = c[(i + 1) % r],
  52691. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52692. qt),
  52693. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52694. var h = "chordal" === this.type ? .5 : .25
  52695. , u = Math.pow(o.distanceToSquared(a), h)
  52696. , d = Math.pow(a.distanceToSquared(s), h)
  52697. , p = Math.pow(s.distanceToSquared(l), h);
  52698. d < 1e-4 && (d = 1),
  52699. u < 1e-4 && (u = d),
  52700. p < 1e-4 && (p = d),
  52701. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52702. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52703. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52704. } else if ("catmullrom" === this.type) {
  52705. var f = void 0 !== this.tension ? this.tension : .5;
  52706. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52707. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52708. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52709. }
  52710. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52711. })),
  52712. Ci.ClosedSplineCurve3 = function(e) {
  52713. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52714. Ci.CatmullRomCurve3.call(this, e),
  52715. this.type = "catmullrom",
  52716. this.closed = !0
  52717. }
  52718. ,
  52719. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52720. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52721. Ci.Geometry.call(this),
  52722. this.type = "BoxGeometry",
  52723. this.parameters = {
  52724. width: e,
  52725. height: t,
  52726. depth: i,
  52727. widthSegments: n,
  52728. heightSegments: r,
  52729. depthSegments: o
  52730. },
  52731. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52732. this.mergeVertices()
  52733. }
  52734. ,
  52735. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52736. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52737. Ci.CubeGeometry = Ci.BoxGeometry,
  52738. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52739. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52740. 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++)
  52741. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52742. var b = _ * u - p;
  52743. C[e] = b * n,
  52744. C[t] = E * r,
  52745. C[i] = g,
  52746. P[D] = C.x,
  52747. P[D + 1] = C.y,
  52748. P[D + 2] = C.z,
  52749. C[e] = 0,
  52750. C[t] = 0,
  52751. C[i] = 0 < s ? 1 : -1,
  52752. O[D] = C.x,
  52753. O[D + 1] = C.y,
  52754. O[D + 2] = C.z,
  52755. L[N] = _ / l,
  52756. L[N + 1] = 1 - I / c,
  52757. D += 3,
  52758. N += 2,
  52759. y += 1
  52760. }
  52761. for (I = 0; I < c; I++)
  52762. for (_ = 0; _ < l; _++) {
  52763. var w = B + _ + m * I
  52764. , T = B + _ + m * (I + 1)
  52765. , x = B + (_ + 1) + m * (I + 1)
  52766. , S = B + (_ + 1) + m * I;
  52767. R[F] = w,
  52768. R[F + 1] = T,
  52769. R[F + 2] = S,
  52770. R[F + 3] = T,
  52771. R[F + 4] = x,
  52772. R[F + 5] = S,
  52773. F += 6,
  52774. A += 6
  52775. }
  52776. M.addGroup(V, A, h),
  52777. V += A,
  52778. B += y
  52779. }
  52780. Ci.BufferGeometry.call(this),
  52781. this.type = "BoxBufferGeometry",
  52782. this.parameters = {
  52783. width: e,
  52784. height: t,
  52785. depth: i,
  52786. widthSegments: n,
  52787. heightSegments: r,
  52788. depthSegments: o
  52789. };
  52790. var M = this;
  52791. n = Math.floor(n) || 1,
  52792. r = Math.floor(r) || 1,
  52793. o = Math.floor(o) || 1;
  52794. var s, l, c, h, u = (h = 0,
  52795. h += (s = n) * (l = r) * 2,
  52796. h += s * (c = o) * 2,
  52797. 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;
  52798. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52799. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52800. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52801. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52802. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52803. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52804. this.setIndex(new Ci.BufferAttribute(R,1)),
  52805. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52806. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52807. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52808. }
  52809. ,
  52810. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52811. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52812. Ci.CircleGeometry = function(e, t, i, n) {
  52813. Ci.Geometry.call(this),
  52814. this.type = "CircleGeometry",
  52815. this.parameters = {
  52816. radius: e,
  52817. segments: t,
  52818. thetaStart: i,
  52819. thetaLength: n
  52820. },
  52821. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52822. }
  52823. ,
  52824. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52825. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52826. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52827. Ci.BufferGeometry.call(this),
  52828. this.type = "CircleBufferGeometry",
  52829. this.parameters = {
  52830. radius: e,
  52831. segments: t,
  52832. thetaStart: i,
  52833. thetaLength: n
  52834. },
  52835. e = e || 50,
  52836. t = void 0 !== t ? Math.max(3, t) : 8,
  52837. i = void 0 !== i ? i : 0,
  52838. n = void 0 !== n ? n : 2 * Math.PI;
  52839. var r = t + 2
  52840. , o = new Float32Array(3 * r)
  52841. , a = new Float32Array(3 * r)
  52842. , s = new Float32Array(2 * r);
  52843. a[2] = 1,
  52844. s[0] = .5,
  52845. s[1] = .5;
  52846. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52847. c += 3,
  52848. h += 2) {
  52849. var u = i + l / t * n;
  52850. o[c] = e * Math.cos(u),
  52851. o[c + 1] = e * Math.sin(u),
  52852. a[c + 2] = 1,
  52853. s[h] = (o[c] / e + 1) / 2,
  52854. s[h + 1] = (o[c + 1] / e + 1) / 2
  52855. }
  52856. var d = [];
  52857. for (c = 1; c <= t; c++)
  52858. d.push(c, c + 1, 0);
  52859. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52860. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52861. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52862. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52863. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52864. }
  52865. ,
  52866. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52867. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52868. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52869. function t(e) {
  52870. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52871. for (i = b,
  52872. t = 1; t <= m; t++)
  52873. I.setXYZ(b, 0, x * s, 0),
  52874. E.setXYZ(b, 0, s, 0),
  52875. !0 === e ? (r.x = t / m,
  52876. r.y = 0) : (r.x = (t - 1) / m,
  52877. r.y = 1),
  52878. _.setXY(b, r.x, r.y),
  52879. b++;
  52880. for (n = b,
  52881. t = 0; t <= m; t++) {
  52882. var l = t / m;
  52883. o.x = a * Math.sin(l * A + y),
  52884. o.y = x * s,
  52885. o.z = a * Math.cos(l * A + y),
  52886. I.setXYZ(b, o.x, o.y, o.z),
  52887. E.setXYZ(b, 0, s, 0),
  52888. _.setXY(b, l, !0 === e ? 1 : 0),
  52889. b++
  52890. }
  52891. for (t = 0; t < m; t++) {
  52892. var c = i + t
  52893. , h = n + t;
  52894. !0 === e ? (C.setX(w, h),
  52895. w++,
  52896. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52897. w++,
  52898. C.setX(w, h)),
  52899. w++,
  52900. C.setX(w, c),
  52901. w++
  52902. }
  52903. }
  52904. Ci.BufferGeometry.call(this),
  52905. this.type = "CylinderBufferGeometry",
  52906. this.parameters = {
  52907. radiusTop: p,
  52908. radiusBottom: f,
  52909. height: g,
  52910. radialSegments: m,
  52911. heightSegments: v,
  52912. openEnded: e,
  52913. thetaStart: y,
  52914. thetaLength: A
  52915. },
  52916. p = void 0 !== p ? p : 20,
  52917. f = void 0 !== f ? f : 20,
  52918. g = void 0 !== g ? g : 100,
  52919. m = Math.floor(m) || 8,
  52920. v = Math.floor(v) || 1,
  52921. e = void 0 !== e && e,
  52922. y = void 0 !== y ? y : 0,
  52923. A = void 0 !== A ? A : 2 * Math.PI;
  52924. var i, n, r = (n = (m + 1) * (v + 1),
  52925. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52926. n), o = (i = m * v * 2 * 3,
  52927. !1 === e && (i += 2 * m * 3),
  52928. 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;
  52929. (function() {
  52930. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52931. for (t = 0; t <= v; t++) {
  52932. var o = []
  52933. , a = t / v
  52934. , s = a * (f - p) + p;
  52935. for (e = 0; e <= m; e++) {
  52936. var l = e / m;
  52937. n.x = s * Math.sin(l * A + y),
  52938. n.y = -a * g + x,
  52939. n.z = s * Math.cos(l * A + y),
  52940. I.setXYZ(b, n.x, n.y, n.z),
  52941. i.copy(n),
  52942. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52943. i.z = Math.cos(l * A + y)),
  52944. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52945. E.setXYZ(b, i.x, i.y, i.z),
  52946. _.setXY(b, l, 1 - a),
  52947. o.push(b),
  52948. b++
  52949. }
  52950. T.push(o)
  52951. }
  52952. for (e = 0; e < m; e++)
  52953. for (t = 0; t < v; t++) {
  52954. var c = T[t][e]
  52955. , h = T[t + 1][e]
  52956. , u = T[t + 1][e + 1]
  52957. , d = T[t][e + 1];
  52958. C.setX(w, c),
  52959. w++,
  52960. C.setX(w, h),
  52961. w++,
  52962. C.setX(w, d),
  52963. w++,
  52964. C.setX(w, h),
  52965. w++,
  52966. C.setX(w, u),
  52967. w++,
  52968. C.setX(w, d),
  52969. w++
  52970. }
  52971. }
  52972. )(),
  52973. !1 === e && (0 < p && t(!0),
  52974. 0 < f && t(!1)),
  52975. this.setIndex(C),
  52976. this.addAttribute("position", I),
  52977. this.addAttribute("normal", E),
  52978. this.addAttribute("uv", _)
  52979. }
  52980. ,
  52981. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52982. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52983. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52984. Ci.Geometry.call(this),
  52985. this.type = "CylinderGeometry",
  52986. this.parameters = {
  52987. radiusTop: e,
  52988. radiusBottom: t,
  52989. height: i,
  52990. radialSegments: n,
  52991. heightSegments: r,
  52992. openEnded: o,
  52993. thetaStart: a,
  52994. thetaLength: s
  52995. },
  52996. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52997. this.mergeVertices()
  52998. }
  52999. ,
  53000. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53001. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53002. Ci.EdgesGeometry = function(e, t) {
  53003. function i(e, t) {
  53004. return e - t
  53005. }
  53006. Ci.BufferGeometry.call(this),
  53007. t = void 0 !== t ? t : 1;
  53008. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53009. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53010. n.mergeVertices(),
  53011. n.computeFaceNormals();
  53012. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53013. for (var d = c[h], p = 0; p < 3; p++) {
  53014. o[0] = d[s[p]],
  53015. o[1] = d[s[(p + 1) % 3]],
  53016. o.sort(i),
  53017. void 0 === a[g = o.toString()] ? a[g] = {
  53018. vert1: o[0],
  53019. vert2: o[1],
  53020. face1: h,
  53021. face2: void 0
  53022. } : a[g].face2 = h
  53023. }
  53024. var f = [];
  53025. for (var g in a) {
  53026. var m = a[g];
  53027. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53028. var v = l[m.vert1];
  53029. f.push(v.x),
  53030. f.push(v.y),
  53031. f.push(v.z),
  53032. v = l[m.vert2],
  53033. f.push(v.x),
  53034. f.push(v.y),
  53035. f.push(v.z)
  53036. }
  53037. }
  53038. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53039. }
  53040. ,
  53041. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53042. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53043. Ci.ExtrudeGeometry = function(e, t) {
  53044. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53045. this.type = "ExtrudeGeometry",
  53046. e = Array.isArray(e) ? e : [e],
  53047. this.addShapeList(e, t),
  53048. void this.computeFaceNormals())
  53049. }
  53050. ;
  53051. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53052. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53053. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53054. for (var i = e.length, n = 0; n < i; n++) {
  53055. var r = e[n];
  53056. this.addShape(r, t)
  53057. }
  53058. }
  53059. ,
  53060. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53061. function i(e, t, i) {
  53062. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53063. t.clone().multiplyScalar(i).add(e)
  53064. }
  53065. function n(e, t, i) {
  53066. 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;
  53067. if (Math.abs(u) > Number.EPSILON) {
  53068. var d = Math.sqrt(h)
  53069. , p = Math.sqrt(l * l + c * c)
  53070. , f = t.x - s / d
  53071. , g = t.y + a / d
  53072. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53073. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53074. if (v <= 2)
  53075. return new Ci.Vector2(n,r);
  53076. o = Math.sqrt(v / 2)
  53077. } else {
  53078. var y = !1;
  53079. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53080. o = y ? (n = -s,
  53081. r = a,
  53082. Math.sqrt(h)) : (n = a,
  53083. r = s,
  53084. Math.sqrt(h / 2))
  53085. }
  53086. return new Ci.Vector2(n / o,r / o)
  53087. }
  53088. function r(e, t) {
  53089. var i, n;
  53090. for (G = e.length; 0 <= --G; ) {
  53091. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53092. var r = 0
  53093. , o = A + 2 * m;
  53094. for (r = 0; r < o; r++) {
  53095. var a = U * r
  53096. , s = U * (r + 1);
  53097. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53098. }
  53099. }
  53100. }
  53101. function o(e, t, i) {
  53102. T.vertices.push(new Ci.Vector3(e,t,i))
  53103. }
  53104. function a(e, t, i) {
  53105. e += x,
  53106. t += x,
  53107. i += x,
  53108. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53109. var n = E.generateTopUV(T, e, t, i);
  53110. T.faceVertexUvs[0].push(n)
  53111. }
  53112. function l(e, t, i, n) {
  53113. e += x,
  53114. t += x,
  53115. i += x,
  53116. n += x,
  53117. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53118. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53119. var r = E.generateSideWallUV(T, e, t, i, n);
  53120. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53121. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53122. }
  53123. 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;
  53124. C && (s = C.getSpacedPoints(A),
  53125. v = !(I = !0),
  53126. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53127. h = new Ci.Vector3,
  53128. u = new Ci.Vector3,
  53129. d = new Ci.Vector3),
  53130. v || (g = f = m = 0);
  53131. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53132. if (P) {
  53133. for (M = M.reverse(),
  53134. b = 0,
  53135. w = R.length; b < w; b++)
  53136. _ = R[b],
  53137. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53138. P = !1
  53139. }
  53140. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53141. , L = M;
  53142. for (b = 0,
  53143. w = R.length; b < w; b++)
  53144. _ = R[b],
  53145. M = M.concat(_);
  53146. 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++,
  53147. j++,
  53148. Y++)
  53149. j === W && (j = 0),
  53150. Y === W && (Y = 0),
  53151. z[G] = n(L[G], L[j], L[Y]);
  53152. var q, X, Z = [], K = z.concat();
  53153. for (b = 0,
  53154. w = R.length; b < w; b++) {
  53155. for (_ = R[b],
  53156. q = [],
  53157. G = 0,
  53158. j = (W = _.length) - 1,
  53159. Y = G + 1; G < W; G++,
  53160. j++,
  53161. Y++)
  53162. j === W && (j = 0),
  53163. Y === W && (Y = 0),
  53164. q[G] = n(_[G], _[j], _[Y]);
  53165. Z.push(q),
  53166. K = K.concat(q)
  53167. }
  53168. for (D = 0; D < m; D++) {
  53169. for (B = f * (1 - (F = D / m)),
  53170. N = g * Math.sin(F * Math.PI / 2),
  53171. G = 0,
  53172. W = L.length; G < W; G++)
  53173. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53174. for (b = 0,
  53175. w = R.length; b < w; b++)
  53176. for (_ = R[b],
  53177. q = Z[b],
  53178. G = 0,
  53179. W = _.length; G < W; G++)
  53180. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53181. }
  53182. for (N = g,
  53183. G = 0; G < U; G++)
  53184. V = v ? i(M[G], K[G], N) : M[G],
  53185. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53186. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53187. d.copy(s[0]).add(u).add(h),
  53188. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53189. for (X = 1; X <= A; X++)
  53190. for (G = 0; G < U; G++)
  53191. V = v ? i(M[G], K[G], N) : M[G],
  53192. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53193. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53194. d.copy(s[X]).add(u).add(h),
  53195. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53196. for (D = m - 1; 0 <= D; D--) {
  53197. for (B = f * (1 - (F = D / m)),
  53198. N = g * Math.sin(F * Math.PI / 2),
  53199. G = 0,
  53200. W = L.length; G < W; G++)
  53201. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53202. for (b = 0,
  53203. w = R.length; b < w; b++)
  53204. for (_ = R[b],
  53205. q = Z[b],
  53206. G = 0,
  53207. W = _.length; G < W; G++)
  53208. V = i(_[G], q[G], N),
  53209. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53210. }
  53211. (function() {
  53212. if (v) {
  53213. var e = 0
  53214. , t = U * e;
  53215. for (G = 0; G < H; G++)
  53216. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53217. for (t = U * (e = A + 2 * m),
  53218. G = 0; G < H; G++)
  53219. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53220. } else {
  53221. for (G = 0; G < H; G++)
  53222. a((k = O[G])[2], k[1], k[0]);
  53223. for (G = 0; G < H; G++)
  53224. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53225. }
  53226. }
  53227. )(),
  53228. function() {
  53229. var e = 0;
  53230. for (r(L, e),
  53231. e += L.length,
  53232. b = 0,
  53233. w = R.length; b < w; b++)
  53234. r(_ = R[b], e),
  53235. e += _.length
  53236. }()
  53237. }
  53238. ,
  53239. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53240. generateTopUV: function(e, t, i, n) {
  53241. var r = e.vertices
  53242. , o = r[t]
  53243. , a = r[i]
  53244. , s = r[n];
  53245. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53246. },
  53247. generateSideWallUV: function(e, t, i, n, r) {
  53248. var o = e.vertices
  53249. , a = o[t]
  53250. , s = o[i]
  53251. , l = o[n]
  53252. , c = o[r];
  53253. 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)]
  53254. }
  53255. },
  53256. Ci.ShapeGeometry = function(e, t) {
  53257. Ci.Geometry.call(this),
  53258. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53259. this.addShapeList(e, t),
  53260. this.computeFaceNormals()
  53261. }
  53262. ,
  53263. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53264. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53265. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53266. for (var i = 0, n = e.length; i < n; i++)
  53267. this.addShape(e[i], t);
  53268. return this
  53269. }
  53270. ,
  53271. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53272. void 0 === t && (t = {});
  53273. 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);
  53274. if (d) {
  53275. for (h = h.reverse(),
  53276. i = 0,
  53277. n = u.length; i < n; i++)
  53278. r = u[i],
  53279. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53280. d = !1
  53281. }
  53282. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53283. for (i = 0,
  53284. n = u.length; i < n; i++)
  53285. r = u[i],
  53286. h = h.concat(r);
  53287. var f, g, m = h.length, v = p.length;
  53288. for (i = 0; i < m; i++)
  53289. f = h[i],
  53290. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53291. for (i = 0; i < v; i++) {
  53292. var y = (g = p[i])[0] + l
  53293. , A = g[1] + l
  53294. , C = g[2] + l;
  53295. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53296. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53297. }
  53298. }
  53299. ,
  53300. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53301. Ci.BufferGeometry.call(this),
  53302. this.type = "LatheBufferGeometry",
  53303. this.parameters = {
  53304. points: e,
  53305. segments: t,
  53306. phiStart: i,
  53307. phiLength: n
  53308. },
  53309. t = Math.floor(t) || 12,
  53310. i = i || 0,
  53311. n = n || 2 * Math.PI,
  53312. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53313. 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,
  53314. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53315. for (o = 0; o <= t; o++) {
  53316. var v = i + o * f * n
  53317. , y = Math.sin(v)
  53318. , A = Math.cos(v);
  53319. for (a = 0; a <= e.length - 1; a++)
  53320. g.x = e[a].x * y,
  53321. g.y = e[a].y,
  53322. g.z = e[a].x * A,
  53323. h.setXYZ(d, g.x, g.y, g.z),
  53324. m.x = o / t,
  53325. m.y = a / (e.length - 1),
  53326. u.setXY(d, m.x, m.y),
  53327. d++
  53328. }
  53329. for (o = 0; o < t; o++)
  53330. for (a = 0; a < e.length - 1; a++) {
  53331. var C = r = a + o * e.length
  53332. , I = r + e.length
  53333. , E = r + e.length + 1
  53334. , _ = r + 1;
  53335. c.setX(p, C),
  53336. p++,
  53337. c.setX(p, I),
  53338. p++,
  53339. c.setX(p, _),
  53340. p++,
  53341. c.setX(p, I),
  53342. p++,
  53343. c.setX(p, E),
  53344. p++,
  53345. c.setX(p, _),
  53346. p++
  53347. }
  53348. if (this.setIndex(c),
  53349. this.addAttribute("position", h),
  53350. this.addAttribute("uv", u),
  53351. this.computeVertexNormals(),
  53352. n === 2 * Math.PI) {
  53353. var b = this.attributes.normal.array
  53354. , w = new Ci.Vector3
  53355. , T = new Ci.Vector3
  53356. , x = new Ci.Vector3;
  53357. for (r = t * e.length * 3,
  53358. a = o = 0; o < e.length; o++,
  53359. a += 3)
  53360. w.x = b[a + 0],
  53361. w.y = b[a + 1],
  53362. w.z = b[a + 2],
  53363. T.x = b[r + a + 0],
  53364. T.y = b[r + a + 1],
  53365. T.z = b[r + a + 2],
  53366. x.addVectors(w, T).normalize(),
  53367. b[a + 0] = b[r + a + 0] = x.x,
  53368. b[a + 1] = b[r + a + 1] = x.y,
  53369. b[a + 2] = b[r + a + 2] = x.z
  53370. }
  53371. }
  53372. ,
  53373. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53374. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53375. Ci.LatheGeometry = function(e, t, i, n) {
  53376. Ci.Geometry.call(this),
  53377. this.type = "LatheGeometry",
  53378. this.parameters = {
  53379. points: e,
  53380. segments: t,
  53381. phiStart: i,
  53382. phiLength: n
  53383. },
  53384. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53385. this.mergeVertices()
  53386. }
  53387. ,
  53388. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53389. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53390. Ci.PlaneGeometry = function(e, t, i, n) {
  53391. Ci.Geometry.call(this),
  53392. this.type = "PlaneGeometry",
  53393. this.parameters = {
  53394. width: e,
  53395. height: t,
  53396. widthSegments: i,
  53397. heightSegments: n
  53398. },
  53399. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53400. }
  53401. ,
  53402. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53403. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53404. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53405. Ci.BufferGeometry.call(this),
  53406. this.type = "PlaneBufferGeometry",
  53407. this.parameters = {
  53408. width: e,
  53409. height: t,
  53410. widthSegments: i,
  53411. heightSegments: n
  53412. };
  53413. 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++)
  53414. for (var y = v * u - o, A = 0; A < l; A++) {
  53415. var C = A * h - r;
  53416. d[g] = C,
  53417. d[g + 1] = -y,
  53418. p[g + 2] = 1,
  53419. f[m] = A / a,
  53420. f[m + 1] = 1 - v / s,
  53421. g += 3,
  53422. m += 2
  53423. }
  53424. g = 0;
  53425. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53426. for (v = 0; v < s; v++)
  53427. for (A = 0; A < a; A++) {
  53428. var E = A + l * v
  53429. , _ = A + l * (v + 1)
  53430. , b = A + 1 + l * (v + 1)
  53431. , w = A + 1 + l * v;
  53432. I[g] = E,
  53433. I[g + 1] = _,
  53434. I[g + 2] = w,
  53435. I[g + 3] = _,
  53436. I[g + 4] = b,
  53437. I[g + 5] = w,
  53438. g += 6
  53439. }
  53440. this.setIndex(new Ci.BufferAttribute(I,1)),
  53441. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53442. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53443. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53444. }
  53445. ,
  53446. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53447. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53448. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53449. Ci.BufferGeometry.call(this),
  53450. this.type = "RingBufferGeometry",
  53451. this.parameters = {
  53452. innerRadius: e,
  53453. outerRadius: t,
  53454. thetaSegments: i,
  53455. phiSegments: n,
  53456. thetaStart: r,
  53457. thetaLength: o
  53458. },
  53459. e = e || 20,
  53460. t = t || 50,
  53461. r = void 0 !== r ? r : 0,
  53462. o = void 0 !== o ? o : 2 * Math.PI;
  53463. 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;
  53464. for (s = 0; s <= n; s++) {
  53465. for (l = 0; l <= i; l++)
  53466. a = r + l / i * o,
  53467. A.x = v * Math.cos(a),
  53468. A.y = v * Math.sin(a),
  53469. d.setXYZ(g, A.x, A.y, A.z),
  53470. p.setXYZ(g, 0, 0, 1),
  53471. C.x = (A.x / t + 1) / 2,
  53472. C.y = (A.y / t + 1) / 2,
  53473. f.setXY(g, C.x, C.y),
  53474. g++;
  53475. v += y
  53476. }
  53477. for (s = 0; s < n; s++) {
  53478. var I = s * (i + 1);
  53479. for (l = 0; l < i; l++) {
  53480. var E = a = l + I
  53481. , _ = a + i + 1
  53482. , b = a + i + 2
  53483. , w = a + 1;
  53484. u.setX(m, E),
  53485. m++,
  53486. u.setX(m, _),
  53487. m++,
  53488. u.setX(m, b),
  53489. m++,
  53490. u.setX(m, E),
  53491. m++,
  53492. u.setX(m, b),
  53493. m++,
  53494. u.setX(m, w),
  53495. m++
  53496. }
  53497. }
  53498. this.setIndex(u),
  53499. this.addAttribute("position", d),
  53500. this.addAttribute("normal", p),
  53501. this.addAttribute("uv", f)
  53502. }
  53503. ,
  53504. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53505. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53506. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53507. Ci.Geometry.call(this),
  53508. this.type = "RingGeometry",
  53509. this.parameters = {
  53510. innerRadius: e,
  53511. outerRadius: t,
  53512. thetaSegments: i,
  53513. phiSegments: n,
  53514. thetaStart: r,
  53515. thetaLength: o
  53516. },
  53517. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53518. }
  53519. ,
  53520. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53521. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53522. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53523. Ci.Geometry.call(this),
  53524. this.type = "SphereGeometry",
  53525. this.parameters = {
  53526. radius: e,
  53527. widthSegments: t,
  53528. heightSegments: i,
  53529. phiStart: n,
  53530. phiLength: r,
  53531. thetaStart: o,
  53532. thetaLength: a
  53533. },
  53534. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53535. }
  53536. ,
  53537. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53538. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53539. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53540. Ci.BufferGeometry.call(this),
  53541. this.type = "SphereBufferGeometry",
  53542. this.parameters = {
  53543. radius: e,
  53544. widthSegments: t,
  53545. heightSegments: i,
  53546. phiStart: n,
  53547. phiLength: r,
  53548. thetaStart: o,
  53549. thetaLength: a
  53550. },
  53551. e = e || 50,
  53552. t = Math.max(3, Math.floor(t) || 8),
  53553. i = Math.max(2, Math.floor(i) || 6),
  53554. n = void 0 !== n ? n : 0,
  53555. r = void 0 !== r ? r : 2 * Math.PI;
  53556. 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++) {
  53557. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53558. var A = y / t
  53559. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53560. , I = e * Math.cos(o + v * a)
  53561. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53562. f.set(C, I, E).normalize(),
  53563. c.setXYZ(d, C, I, E),
  53564. h.setXYZ(d, f.x, f.y, f.z),
  53565. u.setXY(d, A, 1 - v),
  53566. m.push(d),
  53567. d++
  53568. }
  53569. p.push(m)
  53570. }
  53571. var _ = [];
  53572. for (g = 0; g < i; g++)
  53573. for (y = 0; y < t; y++) {
  53574. var b = p[g][y + 1]
  53575. , w = p[g][y]
  53576. , T = p[g + 1][y]
  53577. , x = p[g + 1][y + 1];
  53578. (0 !== g || 0 < o) && _.push(b, w, x),
  53579. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53580. }
  53581. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53582. this.addAttribute("position", c),
  53583. this.addAttribute("normal", h),
  53584. this.addAttribute("uv", u),
  53585. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53586. }
  53587. ,
  53588. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53589. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53590. Ci.TextGeometry = function(e, t) {
  53591. var i = (t = t || {}).font;
  53592. if (i instanceof Ci.Font == 0)
  53593. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53594. new Ci.Geometry;
  53595. var n = i.generateShapes(e, t.size, t.curveSegments);
  53596. t.amount = void 0 !== t.height ? t.height : 50,
  53597. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53598. void 0 === t.bevelSize && (t.bevelSize = 8),
  53599. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53600. Ci.ExtrudeGeometry.call(this, n, t),
  53601. this.type = "TextGeometry"
  53602. }
  53603. ,
  53604. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53605. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53606. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53607. Ci.BufferGeometry.call(this),
  53608. this.type = "TorusBufferGeometry",
  53609. this.parameters = {
  53610. radius: e,
  53611. tube: t,
  53612. radialSegments: i,
  53613. tubularSegments: n,
  53614. arc: r
  53615. },
  53616. e = e || 100,
  53617. t = t || 40,
  53618. i = Math.floor(i) || 8,
  53619. n = Math.floor(n) || 6,
  53620. r = r || 2 * Math.PI;
  53621. 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;
  53622. for (o = 0; o <= i; o++)
  53623. for (a = 0; a <= n; a++) {
  53624. var A = a / n * r
  53625. , C = o / i * Math.PI * 2;
  53626. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53627. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53628. v.z = t * Math.sin(C),
  53629. h[p] = v.x,
  53630. h[p + 1] = v.y,
  53631. h[p + 2] = v.z,
  53632. m.x = e * Math.cos(A),
  53633. m.y = e * Math.sin(A),
  53634. y.subVectors(v, m).normalize(),
  53635. u[p] = y.x,
  53636. u[p + 1] = y.y,
  53637. u[p + 2] = y.z,
  53638. d[f] = a / n,
  53639. d[f + 1] = o / i,
  53640. p += 3,
  53641. f += 2
  53642. }
  53643. for (o = 1; o <= i; o++)
  53644. for (a = 1; a <= n; a++) {
  53645. var I = (n + 1) * o + a - 1
  53646. , E = (n + 1) * (o - 1) + a - 1
  53647. , _ = (n + 1) * (o - 1) + a
  53648. , b = (n + 1) * o + a;
  53649. c[g] = I,
  53650. c[g + 1] = E,
  53651. c[g + 2] = b,
  53652. c[g + 3] = E,
  53653. c[g + 4] = _,
  53654. c[g + 5] = b,
  53655. g += 6
  53656. }
  53657. this.setIndex(new Ci.BufferAttribute(c,1)),
  53658. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53659. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53660. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53661. }
  53662. ,
  53663. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53664. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53665. Ci.TorusGeometry = function(e, t, i, n, r) {
  53666. Ci.Geometry.call(this),
  53667. this.type = "TorusGeometry",
  53668. this.parameters = {
  53669. radius: e,
  53670. tube: t,
  53671. radialSegments: i,
  53672. tubularSegments: n,
  53673. arc: r
  53674. },
  53675. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53676. }
  53677. ,
  53678. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53679. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53680. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53681. function a(e, t, i, n, r) {
  53682. var o = Math.cos(e)
  53683. , a = Math.sin(e)
  53684. , s = i / t * e
  53685. , l = Math.cos(s);
  53686. r.x = n * (2 + l) * .5 * o,
  53687. r.y = n * (2 + l) * a * .5,
  53688. r.z = n * Math.sin(s) * .5
  53689. }
  53690. Ci.BufferGeometry.call(this),
  53691. this.type = "TorusKnotBufferGeometry",
  53692. this.parameters = {
  53693. radius: e,
  53694. tube: t,
  53695. tubularSegments: i,
  53696. radialSegments: n,
  53697. p: r,
  53698. q: o
  53699. },
  53700. e = e || 100,
  53701. t = t || 40,
  53702. i = Math.floor(i) || 64,
  53703. r = r || 2,
  53704. o = o || 3;
  53705. 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;
  53706. for (s = 0; s <= i; ++s) {
  53707. var w = s / i * r * Math.PI * 2;
  53708. for (a(w, r, o, e, C),
  53709. a(.01 + w, r, o, e, I),
  53710. _.subVectors(I, C),
  53711. b.addVectors(I, C),
  53712. E.crossVectors(_, b),
  53713. b.crossVectors(E, _),
  53714. E.normalize(),
  53715. b.normalize(),
  53716. l = 0; l <= n; ++l) {
  53717. var T = l / n * Math.PI * 2
  53718. , x = -t * Math.cos(T)
  53719. , S = t * Math.sin(T);
  53720. v.x = C.x + (x * b.x + S * E.x),
  53721. v.y = C.y + (x * b.y + S * E.y),
  53722. v.z = C.z + (x * b.z + S * E.z),
  53723. d.setXYZ(g, v.x, v.y, v.z),
  53724. y.subVectors(v, C).normalize(),
  53725. p.setXYZ(g, y.x, y.y, y.z),
  53726. A.x = s / i,
  53727. A.y = l / n,
  53728. f.setXY(g, A.x, A.y),
  53729. g++
  53730. }
  53731. }
  53732. for (l = 1; l <= i; l++)
  53733. for (s = 1; s <= n; s++) {
  53734. var M = (n + 1) * (l - 1) + (s - 1)
  53735. , R = (n + 1) * l + (s - 1)
  53736. , P = (n + 1) * l + s
  53737. , O = (n + 1) * (l - 1) + s;
  53738. u.setX(m, M),
  53739. m++,
  53740. u.setX(m, R),
  53741. m++,
  53742. u.setX(m, O),
  53743. m++,
  53744. u.setX(m, R),
  53745. m++,
  53746. u.setX(m, P),
  53747. m++,
  53748. u.setX(m, O),
  53749. m++
  53750. }
  53751. this.setIndex(u),
  53752. this.addAttribute("position", d),
  53753. this.addAttribute("normal", p),
  53754. this.addAttribute("uv", f)
  53755. }
  53756. ,
  53757. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53758. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53759. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53760. Ci.Geometry.call(this),
  53761. this.type = "TorusKnotGeometry",
  53762. this.parameters = {
  53763. radius: e,
  53764. tube: t,
  53765. tubularSegments: i,
  53766. radialSegments: n,
  53767. p: r,
  53768. q: o
  53769. },
  53770. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53771. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53772. this.mergeVertices()
  53773. }
  53774. ,
  53775. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53776. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53777. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53778. Ci.Geometry.call(this),
  53779. this.type = "TubeGeometry",
  53780. this.parameters = {
  53781. path: e,
  53782. segments: t,
  53783. radius: i,
  53784. radialSegments: n,
  53785. closed: r,
  53786. taper: o
  53787. },
  53788. t = t || 64,
  53789. i = i || 1,
  53790. n = n || 8,
  53791. r = r || !1,
  53792. o = o || Ci.TubeGeometry.NoTaper;
  53793. 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;
  53794. for (this.tangents = D,
  53795. this.normals = N,
  53796. this.binormals = F,
  53797. f = 0; f < P; f++)
  53798. for (M[f] = [],
  53799. l = f / (P - 1),
  53800. p = e.getPointAt(l),
  53801. D[f],
  53802. a = N[f],
  53803. s = F[f],
  53804. h = i * o(l),
  53805. g = 0; g < n; g++)
  53806. c = g / n * 2 * Math.PI,
  53807. u = -h * Math.cos(c),
  53808. d = h * Math.sin(c),
  53809. O.copy(p),
  53810. O.x += u * a.x + d * s.x,
  53811. O.y += u * a.y + d * s.y,
  53812. O.z += u * a.z + d * s.z,
  53813. M[f][g] = (T = O.x,
  53814. x = O.y,
  53815. S = O.z,
  53816. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53817. for (f = 0; f < t; f++)
  53818. for (g = 0; g < n; g++)
  53819. m = r ? (f + 1) % t : f + 1,
  53820. v = (g + 1) % n,
  53821. y = M[f][g],
  53822. A = M[m][g],
  53823. C = M[m][v],
  53824. I = M[f][v],
  53825. E = new Ci.Vector2(f / t,g / n),
  53826. _ = new Ci.Vector2((f + 1) / t,g / n),
  53827. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53828. w = new Ci.Vector2(f / t,(g + 1) / n),
  53829. this.faces.push(new Ci.Face3(y,A,I)),
  53830. this.faceVertexUvs[0].push([E, _, w]),
  53831. this.faces.push(new Ci.Face3(A,C,I)),
  53832. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53833. this.computeFaceNormals(),
  53834. this.computeVertexNormals()
  53835. }
  53836. ,
  53837. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53838. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53839. Ci.TubeGeometry.NoTaper = function(e) {
  53840. return 1
  53841. }
  53842. ,
  53843. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53844. return Math.sin(Math.PI * e)
  53845. }
  53846. ,
  53847. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53848. 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;
  53849. for (this.tangents = u,
  53850. this.normals = d,
  53851. this.binormals = p,
  53852. l = 0; l < m; l++)
  53853. c = l / (m - 1),
  53854. u[l] = e.getTangentAt(c),
  53855. u[l].normalize();
  53856. for (d[0] = new Ci.Vector3,
  53857. p[0] = new Ci.Vector3,
  53858. r = Number.MAX_VALUE,
  53859. o = Math.abs(u[0].x),
  53860. a = Math.abs(u[0].y),
  53861. s = Math.abs(u[0].z),
  53862. o <= r && (r = o,
  53863. h.set(1, 0, 0)),
  53864. a <= r && (r = a,
  53865. h.set(0, 1, 0)),
  53866. s <= r && h.set(0, 0, 1),
  53867. f.crossVectors(u[0], h).normalize(),
  53868. d[0].crossVectors(u[0], f),
  53869. p[0].crossVectors(u[0], d[0]),
  53870. l = 1; l < m; l++)
  53871. d[l] = d[l - 1].clone(),
  53872. p[l] = p[l - 1].clone(),
  53873. f.crossVectors(u[l - 1], u[l]),
  53874. f.length() > Number.EPSILON && (f.normalize(),
  53875. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53876. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53877. p[l].crossVectors(u[l], d[l]);
  53878. if (i)
  53879. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53880. n /= m - 1,
  53881. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53882. l = 1; l < m; l++)
  53883. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53884. p[l].crossVectors(u[l], d[l])
  53885. }
  53886. ,
  53887. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53888. function f(e) {
  53889. var t = e.normalize().clone();
  53890. t.index = m.vertices.push(t) - 1;
  53891. var i = a(e) / 2 / Math.PI + .5
  53892. , n = function(e) {
  53893. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53894. }(e) / Math.PI + .5;
  53895. return t.uv = new Ci.Vector2(i,1 - n),
  53896. t
  53897. }
  53898. function g(e, t, i, n) {
  53899. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53900. m.faces.push(r),
  53901. y.copy(e).add(t).add(i).divideScalar(3);
  53902. var o = a(y);
  53903. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53904. }
  53905. function r(e, t) {
  53906. 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++) {
  53907. a[l] = [];
  53908. 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++)
  53909. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53910. }
  53911. for (l = 0; l < i; l++)
  53912. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53913. var p = Math.floor(d / 2);
  53914. 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)
  53915. }
  53916. }
  53917. function a(e) {
  53918. return Math.atan2(e.z, -e.x)
  53919. }
  53920. function s(e, t, i) {
  53921. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53922. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53923. e.clone()
  53924. }
  53925. Ci.Geometry.call(this),
  53926. this.type = "PolyhedronGeometry",
  53927. this.parameters = {
  53928. vertices: e,
  53929. indices: t,
  53930. radius: i,
  53931. detail: n
  53932. },
  53933. i = i || 1,
  53934. n = n || 0;
  53935. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53936. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53937. var c = this.vertices
  53938. , h = []
  53939. , u = (o = 0,
  53940. 0);
  53941. for (l = t.length; o < l; o += 3,
  53942. u++) {
  53943. var d = c[t[o]]
  53944. , p = c[t[o + 1]]
  53945. , v = c[t[o + 2]];
  53946. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53947. }
  53948. var y = new Ci.Vector3;
  53949. for (o = 0,
  53950. l = h.length; o < l; o++)
  53951. r(h[o], n);
  53952. for (o = 0,
  53953. l = this.faceVertexUvs[0].length; o < l; o++) {
  53954. var A = this.faceVertexUvs[0][o]
  53955. , C = A[0].x
  53956. , I = A[1].x
  53957. , E = A[2].x
  53958. , _ = Math.max(C, I, E)
  53959. , b = Math.min(C, I, E);
  53960. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53961. I < .2 && (A[1].x += 1),
  53962. E < .2 && (A[2].x += 1))
  53963. }
  53964. for (o = 0,
  53965. l = this.vertices.length; o < l; o++)
  53966. this.vertices[o].multiplyScalar(i);
  53967. this.mergeVertices(),
  53968. this.computeFaceNormals(),
  53969. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53970. }
  53971. ,
  53972. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53973. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53974. Ci.DodecahedronGeometry = function(e, t) {
  53975. var i = (1 + Math.sqrt(5)) / 2
  53976. , n = 1 / i
  53977. , 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];
  53978. 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),
  53979. this.type = "DodecahedronGeometry",
  53980. this.parameters = {
  53981. radius: e,
  53982. detail: t
  53983. }
  53984. }
  53985. ,
  53986. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53987. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53988. Ci.IcosahedronGeometry = function(e, t) {
  53989. var i = (1 + Math.sqrt(5)) / 2
  53990. , 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];
  53991. 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),
  53992. this.type = "IcosahedronGeometry",
  53993. this.parameters = {
  53994. radius: e,
  53995. detail: t
  53996. }
  53997. }
  53998. ,
  53999. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54000. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54001. Ci.OctahedronGeometry = function(e, t) {
  54002. 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),
  54003. this.type = "OctahedronGeometry",
  54004. this.parameters = {
  54005. radius: e,
  54006. detail: t
  54007. }
  54008. }
  54009. ,
  54010. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54011. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54012. Ci.TetrahedronGeometry = function(e, t) {
  54013. 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),
  54014. this.type = "TetrahedronGeometry",
  54015. this.parameters = {
  54016. radius: e,
  54017. detail: t
  54018. }
  54019. }
  54020. ,
  54021. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54022. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54023. Ci.ParametricGeometry = function(e, t, i) {
  54024. Ci.Geometry.call(this),
  54025. this.type = "ParametricGeometry",
  54026. this.parameters = {
  54027. func: e,
  54028. slices: t,
  54029. stacks: i
  54030. };
  54031. 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;
  54032. for (n = 0; n <= i; n++)
  54033. for (a = n / i,
  54034. r = 0; r <= t; r++)
  54035. o = e(r / t, a),
  54036. g.push(o);
  54037. for (n = 0; n < i; n++)
  54038. for (r = 0; r < t; r++)
  54039. l = (s = n * y + r) + 1,
  54040. c = (n + 1) * y + r + 1,
  54041. h = (n + 1) * y + r,
  54042. u = new Ci.Vector2(r / t,n / i),
  54043. d = new Ci.Vector2((r + 1) / t,n / i),
  54044. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54045. f = new Ci.Vector2(r / t,(n + 1) / i),
  54046. m.push(new Ci.Face3(s,l,h)),
  54047. v.push([u, d, f]),
  54048. m.push(new Ci.Face3(l,c,h)),
  54049. v.push([d.clone(), p, f.clone()]);
  54050. this.computeFaceNormals(),
  54051. this.computeVertexNormals()
  54052. }
  54053. ,
  54054. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54055. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54056. Ci.WireframeGeometry = function(e) {
  54057. function t(e, t) {
  54058. return e - t
  54059. }
  54060. Ci.BufferGeometry.call(this);
  54061. var i = [0, 0]
  54062. , n = {}
  54063. , r = ["a", "b", "c"];
  54064. if (e instanceof Ci.Geometry) {
  54065. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54066. for (var u = a[c], d = 0; d < 3; d++) {
  54067. i[0] = u[r[d]],
  54068. i[1] = u[r[(d + 1) % 3]],
  54069. i.sort(t),
  54070. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54071. l[2 * s + 1] = i[1],
  54072. n[E] = !0,
  54073. s++)
  54074. }
  54075. var p = new Float32Array(2 * s * 3);
  54076. for (c = 0,
  54077. h = s; c < h; c++)
  54078. for (d = 0; d < 2; d++) {
  54079. var f = o[l[2 * c + d]];
  54080. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54081. p[_ + 1] = f.y,
  54082. p[_ + 2] = f.z
  54083. }
  54084. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54085. } else if (e instanceof Ci.BufferGeometry)
  54086. if (null !== e.index) {
  54087. var g = e.index.array
  54088. , m = (o = e.attributes.position,
  54089. e.groups);
  54090. s = 0;
  54091. 0 === m.length && e.addGroup(0, g.length);
  54092. l = new Uint32Array(2 * g.length);
  54093. for (var v = 0, y = m.length; v < y; ++v)
  54094. for (var A = m[v], C = A.start, I = (c = C,
  54095. C + A.count); c < I; c += 3)
  54096. for (d = 0; d < 3; d++) {
  54097. var E;
  54098. i[0] = g[c + d],
  54099. i[1] = g[c + (d + 1) % 3],
  54100. i.sort(t),
  54101. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54102. l[2 * s + 1] = i[1],
  54103. n[E] = !0,
  54104. s++)
  54105. }
  54106. for (p = new Float32Array(2 * s * 3),
  54107. c = 0,
  54108. h = s; c < h; c++)
  54109. for (d = 0; d < 2; d++) {
  54110. var _ = 6 * c + 3 * d
  54111. , b = l[2 * c + d];
  54112. p[_ + 0] = o.getX(b),
  54113. p[_ + 1] = o.getY(b),
  54114. p[_ + 2] = o.getZ(b)
  54115. }
  54116. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54117. } else {
  54118. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54119. for (p = new Float32Array(2 * s * 3),
  54120. c = 0,
  54121. h = w; c < h; c++)
  54122. for (d = 0; d < 3; d++) {
  54123. var T = 9 * c + 3 * d;
  54124. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54125. p[_ + 1] = o[1 + T],
  54126. p[_ + 2] = o[2 + T];
  54127. b = 9 * c + (d + 1) % 3 * 3;
  54128. p[_ + 3] = o[b],
  54129. p[_ + 4] = o[b + 1],
  54130. p[_ + 5] = o[b + 2]
  54131. }
  54132. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54133. }
  54134. }
  54135. ,
  54136. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54137. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54138. Ci.AxisHelper = function(e) {
  54139. e = e || 1;
  54140. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54141. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54142. , n = new Ci.BufferGeometry;
  54143. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54144. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54145. var r = new Ci.LineBasicMaterial({
  54146. vertexColors: Ci.VertexColors
  54147. });
  54148. Ci.LineSegments.call(this, n, r)
  54149. }
  54150. ,
  54151. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54152. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54153. Ci.ArrowHelper = function() {
  54154. var a = new Ci.Geometry;
  54155. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54156. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54157. return s.translate(0, -.5, 0),
  54158. function(e, t, i, n, r, o) {
  54159. Ci.Object3D.call(this),
  54160. void 0 === n && (n = 16776960),
  54161. void 0 === i && (i = 1),
  54162. void 0 === r && (r = .2 * i),
  54163. void 0 === o && (o = .2 * r),
  54164. this.position.copy(t),
  54165. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54166. color: n
  54167. })),
  54168. this.line.matrixAutoUpdate = !1,
  54169. this.add(this.line),
  54170. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54171. color: n
  54172. })),
  54173. this.cone.matrixAutoUpdate = !1,
  54174. this.add(this.cone),
  54175. this.setDirection(e),
  54176. this.setLength(i, r, o)
  54177. }
  54178. }(),
  54179. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54180. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54181. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54182. function(e) {
  54183. .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(),
  54184. yi = Math.acos(e.y),
  54185. this.quaternion.setFromAxisAngle(Ai, yi))
  54186. }
  54187. ),
  54188. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54189. void 0 === t && (t = .2 * e),
  54190. void 0 === i && (i = .2 * t),
  54191. this.line.scale.set(1, Math.max(0, e - t), 1),
  54192. this.line.updateMatrix(),
  54193. this.cone.scale.set(i, t, i),
  54194. this.cone.position.y = e,
  54195. this.cone.updateMatrix()
  54196. }
  54197. ,
  54198. Ci.ArrowHelper.prototype.setColor = function(e) {
  54199. this.line.material.color.set(e),
  54200. this.cone.material.color.set(e)
  54201. }
  54202. ,
  54203. Ci.BoxHelper = function(e) {
  54204. 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])
  54205. , i = new Float32Array(24)
  54206. , n = new Ci.BufferGeometry;
  54207. n.setIndex(new Ci.BufferAttribute(t,1)),
  54208. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54209. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54210. color: 16776960
  54211. })),
  54212. void 0 !== e && this.update(e)
  54213. }
  54214. ,
  54215. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54216. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54217. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54218. function(e) {
  54219. if (vi.setFromObject(e),
  54220. !vi.isEmpty()) {
  54221. var t = vi.min
  54222. , i = vi.max
  54223. , n = this.geometry.attributes.position
  54224. , r = n.array;
  54225. r[0] = i.x,
  54226. r[1] = i.y,
  54227. r[2] = i.z,
  54228. r[3] = t.x,
  54229. r[4] = i.y,
  54230. r[5] = i.z,
  54231. r[6] = t.x,
  54232. r[7] = t.y,
  54233. r[8] = i.z,
  54234. r[9] = i.x,
  54235. r[10] = t.y,
  54236. r[11] = i.z,
  54237. r[12] = i.x,
  54238. r[13] = i.y,
  54239. r[14] = t.z,
  54240. r[15] = t.x,
  54241. r[16] = i.y,
  54242. r[17] = t.z,
  54243. r[18] = t.x,
  54244. r[19] = t.y,
  54245. r[20] = t.z,
  54246. r[21] = i.x,
  54247. r[22] = t.y,
  54248. r[23] = t.z,
  54249. n.needsUpdate = !0,
  54250. this.geometry.computeBoundingSphere()
  54251. }
  54252. }
  54253. ),
  54254. Ci.BoundingBoxHelper = function(e, t) {
  54255. var i = void 0 !== t ? t : 8947848;
  54256. this.object = e,
  54257. this.box = new Ci.Box3,
  54258. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54259. color: i,
  54260. wireframe: !0
  54261. }))
  54262. }
  54263. ,
  54264. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54265. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54266. Ci.BoundingBoxHelper.prototype.update = function() {
  54267. this.box.setFromObject(this.object),
  54268. this.box.size(this.scale),
  54269. this.box.center(this.position)
  54270. }
  54271. ,
  54272. Ci.CameraHelper = function(e) {
  54273. function t(e, t, i) {
  54274. n(e, i),
  54275. n(t, i)
  54276. }
  54277. function n(e, t) {
  54278. i.vertices.push(new Ci.Vector3),
  54279. i.colors.push(new Ci.Color(t)),
  54280. void 0 === o[e] && (o[e] = []),
  54281. o[e].push(i.vertices.length - 1)
  54282. }
  54283. var i = new Ci.Geometry
  54284. , r = new Ci.LineBasicMaterial({
  54285. color: 16777215,
  54286. vertexColors: Ci.FaceColors
  54287. })
  54288. , o = {}
  54289. , a = 16755200
  54290. , s = 16711680
  54291. , l = 3355443;
  54292. t("n1", "n2", a),
  54293. t("n2", "n4", a),
  54294. t("n4", "n3", a),
  54295. t("n3", "n1", a),
  54296. t("f1", "f2", a),
  54297. t("f2", "f4", a),
  54298. t("f4", "f3", a),
  54299. t("f3", "f1", a),
  54300. t("n1", "f1", a),
  54301. t("n2", "f2", a),
  54302. t("n3", "f3", a),
  54303. t("n4", "f4", a),
  54304. t("p", "n1", s),
  54305. t("p", "n2", s),
  54306. t("p", "n3", s),
  54307. t("p", "n4", s),
  54308. t("u1", "u2", 43775),
  54309. t("u2", "u3", 43775),
  54310. t("u3", "u1", 43775),
  54311. t("c", "t", 16777215),
  54312. t("p", "c", l),
  54313. t("cn1", "cn2", l),
  54314. t("cn3", "cn4", l),
  54315. t("cf1", "cf2", l),
  54316. t("cf3", "cf4", l),
  54317. Ci.LineSegments.call(this, i, r),
  54318. this.camera = e,
  54319. this.camera.updateProjectionMatrix(),
  54320. this.matrix = e.matrixWorld,
  54321. this.matrixAutoUpdate = !1,
  54322. this.pointMap = o,
  54323. this.update()
  54324. }
  54325. ,
  54326. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54327. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54328. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54329. mi = new Ci.Camera,
  54330. function() {
  54331. pi = this.geometry,
  54332. fi = this.pointMap,
  54333. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54334. Ni("c", 0, 0, -1),
  54335. Ni("t", 0, 0, 1),
  54336. Ni("n1", -1, -1, -1),
  54337. Ni("n2", 1, -1, -1),
  54338. Ni("n3", -1, 1, -1),
  54339. Ni("n4", 1, 1, -1),
  54340. Ni("f1", -1, -1, 1),
  54341. Ni("f2", 1, -1, 1),
  54342. Ni("f3", -1, 1, 1),
  54343. Ni("f4", 1, 1, 1),
  54344. Ni("u1", .7, 1.1, -1),
  54345. Ni("u2", -.7, 1.1, -1),
  54346. Ni("u3", 0, 2, -1),
  54347. Ni("cf1", -1, 0, 1),
  54348. Ni("cf2", 1, 0, 1),
  54349. Ni("cf3", 0, -1, 1),
  54350. Ni("cf4", 0, 1, 1),
  54351. Ni("cn1", -1, 0, -1),
  54352. Ni("cn2", 1, 0, -1),
  54353. Ni("cn3", 0, -1, -1),
  54354. Ni("cn4", 0, 1, -1),
  54355. pi.verticesNeedUpdate = !0
  54356. }
  54357. ),
  54358. Ci.DirectionalLightHelper = function(e, t) {
  54359. Ci.Object3D.call(this),
  54360. this.light = e,
  54361. this.light.updateMatrixWorld(),
  54362. this.matrix = e.matrixWorld,
  54363. this.matrixAutoUpdate = !1,
  54364. t = t || 1;
  54365. var i = new Ci.Geometry;
  54366. 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));
  54367. var n = new Ci.LineBasicMaterial({
  54368. fog: !1
  54369. });
  54370. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54371. this.lightPlane = new Ci.Line(i,n),
  54372. this.add(this.lightPlane),
  54373. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54374. (n = new Ci.LineBasicMaterial({
  54375. fog: !1
  54376. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54377. this.targetLine = new Ci.Line(i,n),
  54378. this.add(this.targetLine),
  54379. this.update()
  54380. }
  54381. ,
  54382. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54383. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54384. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54385. this.lightPlane.geometry.dispose(),
  54386. this.lightPlane.material.dispose(),
  54387. this.targetLine.geometry.dispose(),
  54388. this.targetLine.material.dispose()
  54389. }
  54390. ,
  54391. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54392. ui = new Ci.Vector3,
  54393. di = new Ci.Vector3,
  54394. function() {
  54395. hi.setFromMatrixPosition(this.light.matrixWorld),
  54396. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54397. di.subVectors(ui, hi),
  54398. this.lightPlane.lookAt(di),
  54399. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54400. this.targetLine.geometry.vertices[1].copy(di),
  54401. this.targetLine.geometry.verticesNeedUpdate = !0,
  54402. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54403. }
  54404. ),
  54405. Ci.EdgesHelper = function(e, t, i) {
  54406. var n = void 0 !== t ? t : 16777215;
  54407. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54408. color: n
  54409. })),
  54410. this.matrix = e.matrixWorld,
  54411. this.matrixAutoUpdate = !1
  54412. }
  54413. ,
  54414. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54415. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54416. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54417. this.object = e,
  54418. this.size = void 0 !== t ? t : 1;
  54419. var r = void 0 !== i ? i : 16776960
  54420. , o = void 0 !== n ? n : 1
  54421. , a = 0
  54422. , s = this.object.geometry;
  54423. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54424. var l = new Ci.BufferGeometry
  54425. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54426. l.addAttribute("position", c),
  54427. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54428. color: r,
  54429. linewidth: o
  54430. })),
  54431. this.matrixAutoUpdate = !1,
  54432. this.update()
  54433. }
  54434. ,
  54435. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54436. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54437. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54438. li = new Ci.Vector3,
  54439. ci = new Ci.Matrix3,
  54440. function() {
  54441. this.object.updateMatrixWorld(!0),
  54442. ci.getNormalMatrix(this.object.matrixWorld);
  54443. 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++) {
  54444. var l = r[a]
  54445. , c = l.normal;
  54446. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54447. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54448. t.setXYZ(o, si.x, si.y, si.z),
  54449. o += 1,
  54450. t.setXYZ(o, li.x, li.y, li.z),
  54451. o += 1
  54452. }
  54453. return t.needsUpdate = !0,
  54454. this
  54455. }
  54456. ),
  54457. Ci.GridHelper = function(e, t) {
  54458. var i = new Ci.Geometry
  54459. , n = new Ci.LineBasicMaterial({
  54460. vertexColors: Ci.VertexColors
  54461. });
  54462. this.color1 = new Ci.Color(4473924),
  54463. this.color2 = new Ci.Color(8947848);
  54464. for (var r = -e; r <= e; r += t) {
  54465. 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));
  54466. var o = 0 === r ? this.color1 : this.color2;
  54467. i.colors.push(o, o, o, o)
  54468. }
  54469. Ci.LineSegments.call(this, i, n)
  54470. }
  54471. ,
  54472. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54473. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54474. Ci.GridHelper.prototype.setColors = function(e, t) {
  54475. this.color1.set(e),
  54476. this.color2.set(t),
  54477. this.geometry.colorsNeedUpdate = !0
  54478. }
  54479. ,
  54480. Ci.HemisphereLightHelper = function(e, t) {
  54481. Ci.Object3D.call(this),
  54482. this.light = e,
  54483. this.light.updateMatrixWorld(),
  54484. this.matrix = e.matrixWorld,
  54485. this.matrixAutoUpdate = !1,
  54486. this.colors = [new Ci.Color, new Ci.Color];
  54487. var i = new Ci.SphereGeometry(t,4,2);
  54488. i.rotateX(-Math.PI / 2);
  54489. for (var n = 0; n < 8; n++)
  54490. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54491. var r = new Ci.MeshBasicMaterial({
  54492. vertexColors: Ci.FaceColors,
  54493. wireframe: !0
  54494. });
  54495. this.lightSphere = new Ci.Mesh(i,r),
  54496. this.add(this.lightSphere),
  54497. this.update()
  54498. }
  54499. ,
  54500. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54501. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54502. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54503. this.lightSphere.geometry.dispose(),
  54504. this.lightSphere.material.dispose()
  54505. }
  54506. ,
  54507. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54508. function() {
  54509. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54510. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54511. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54512. this.lightSphere.geometry.colorsNeedUpdate = !0
  54513. }
  54514. ),
  54515. Ci.PointLightHelper = function(e, t) {
  54516. this.light = e,
  54517. this.light.updateMatrixWorld();
  54518. var i = new Ci.SphereGeometry(t,4,2)
  54519. , n = new Ci.MeshBasicMaterial({
  54520. wireframe: !0,
  54521. fog: !1
  54522. });
  54523. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54524. Ci.Mesh.call(this, i, n),
  54525. this.matrix = this.light.matrixWorld,
  54526. this.matrixAutoUpdate = !1
  54527. }
  54528. ,
  54529. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54530. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54531. Ci.PointLightHelper.prototype.dispose = function() {
  54532. this.geometry.dispose(),
  54533. this.material.dispose()
  54534. }
  54535. ,
  54536. Ci.PointLightHelper.prototype.update = function() {
  54537. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54538. }
  54539. ,
  54540. Ci.SkeletonHelper = function(e) {
  54541. this.bones = this.getBoneList(e);
  54542. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54543. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54544. t.vertices.push(new Ci.Vector3),
  54545. t.colors.push(new Ci.Color(0,0,1)),
  54546. t.colors.push(new Ci.Color(0,1,0)))
  54547. }
  54548. t.dynamic = !0;
  54549. var n = new Ci.LineBasicMaterial({
  54550. vertexColors: Ci.VertexColors,
  54551. depthTest: !1,
  54552. depthWrite: !1,
  54553. transparent: !0
  54554. });
  54555. Ci.LineSegments.call(this, t, n),
  54556. this.root = e,
  54557. this.matrix = e.matrixWorld,
  54558. this.matrixAutoUpdate = !1,
  54559. this.update()
  54560. }
  54561. ,
  54562. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54563. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54564. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54565. var t = [];
  54566. e instanceof Ci.Bone && t.push(e);
  54567. for (var i = 0; i < e.children.length; i++)
  54568. t.push.apply(t, this.getBoneList(e.children[i]));
  54569. return t
  54570. }
  54571. ,
  54572. Ci.SkeletonHelper.prototype.update = function() {
  54573. 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++) {
  54574. var o = this.bones[r];
  54575. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54576. e.vertices[n].setFromMatrixPosition(i),
  54577. i.multiplyMatrices(t, o.parent.matrixWorld),
  54578. e.vertices[n + 1].setFromMatrixPosition(i),
  54579. n += 2)
  54580. }
  54581. e.verticesNeedUpdate = !0,
  54582. e.computeBoundingSphere()
  54583. }
  54584. ,
  54585. Ci.SpotLightHelper = function(e) {
  54586. Ci.Object3D.call(this),
  54587. this.light = e,
  54588. this.light.updateMatrixWorld(),
  54589. this.matrix = e.matrixWorld,
  54590. this.matrixAutoUpdate = !1;
  54591. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54592. t.translate(0, -.5, 0),
  54593. t.rotateX(-Math.PI / 2);
  54594. var i = new Ci.MeshBasicMaterial({
  54595. wireframe: !0,
  54596. fog: !1
  54597. });
  54598. this.cone = new Ci.Mesh(t,i),
  54599. this.add(this.cone),
  54600. this.update()
  54601. }
  54602. ,
  54603. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54604. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54605. Ci.SpotLightHelper.prototype.dispose = function() {
  54606. this.cone.geometry.dispose(),
  54607. this.cone.material.dispose()
  54608. }
  54609. ,
  54610. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54611. oi = new Ci.Vector3,
  54612. function() {
  54613. var e = this.light.distance ? this.light.distance : 1e4
  54614. , t = e * Math.tan(this.light.angle);
  54615. this.cone.scale.set(t, t, e),
  54616. ri.setFromMatrixPosition(this.light.matrixWorld),
  54617. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54618. this.cone.lookAt(oi.sub(ri)),
  54619. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54620. }
  54621. ),
  54622. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54623. this.object = e,
  54624. this.size = void 0 !== t ? t : 1;
  54625. var r = void 0 !== i ? i : 16711680
  54626. , o = void 0 !== n ? n : 1
  54627. , a = 0
  54628. , s = this.object.geometry;
  54629. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54630. var l = new Ci.BufferGeometry
  54631. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54632. l.addAttribute("position", c),
  54633. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54634. color: r,
  54635. linewidth: o
  54636. })),
  54637. this.matrixAutoUpdate = !1,
  54638. this.update()
  54639. }
  54640. ,
  54641. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54642. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54643. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54644. ii = new Ci.Vector3,
  54645. ni = new Ci.Matrix3,
  54646. function() {
  54647. var e = ["a", "b", "c"];
  54648. this.object.updateMatrixWorld(!0),
  54649. ni.getNormalMatrix(this.object.matrixWorld);
  54650. var t = this.object.matrixWorld
  54651. , i = this.geometry.attributes.position
  54652. , n = this.object.geometry;
  54653. if (n instanceof Ci.Geometry)
  54654. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54655. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54656. var d = r[c[e[h]]]
  54657. , p = c.vertexNormals[h];
  54658. ti.copy(d).applyMatrix4(t),
  54659. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54660. i.setXYZ(a, ti.x, ti.y, ti.z),
  54661. a += 1,
  54662. i.setXYZ(a, ii.x, ii.y, ii.z),
  54663. a += 1
  54664. }
  54665. else if (n instanceof Ci.BufferGeometry) {
  54666. var f = n.attributes.position
  54667. , g = n.attributes.normal;
  54668. for (h = a = 0,
  54669. u = f.count; h < u; h++)
  54670. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54671. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54672. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54673. i.setXYZ(a, ti.x, ti.y, ti.z),
  54674. a += 1,
  54675. i.setXYZ(a, ii.x, ii.y, ii.z),
  54676. a += 1
  54677. }
  54678. return i.needsUpdate = !0,
  54679. this
  54680. }
  54681. ),
  54682. Ci.WireframeHelper = function(e, t) {
  54683. var i = void 0 !== t ? t : 16777215;
  54684. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54685. color: i
  54686. })),
  54687. this.matrix = e.matrixWorld,
  54688. this.matrixAutoUpdate = !1
  54689. }
  54690. ,
  54691. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54692. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54693. Ci.ImmediateRenderObject = function(e) {
  54694. Ci.Object3D.call(this),
  54695. this.material = e,
  54696. this.render = function(e) {}
  54697. }
  54698. ,
  54699. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54700. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54701. Ci.MorphBlendMesh = function(e, t) {
  54702. Ci.Mesh.call(this, e, t),
  54703. this.animationsMap = {},
  54704. this.animationsList = [];
  54705. var i = this.geometry.morphTargets.length
  54706. , n = i - 1
  54707. , r = i / 1;
  54708. this.createAnimation("__default", 0, n, r),
  54709. this.setAnimationWeight("__default", 1)
  54710. }
  54711. ,
  54712. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54713. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54714. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54715. var r = {
  54716. start: t,
  54717. end: i,
  54718. length: i - t + 1,
  54719. fps: n,
  54720. duration: (i - t) / n,
  54721. lastFrame: 0,
  54722. currentFrame: 0,
  54723. active: !1,
  54724. time: 0,
  54725. direction: 1,
  54726. weight: 1,
  54727. directionBackwards: !1,
  54728. mirroredLoop: !1
  54729. };
  54730. this.animationsMap[e] = r,
  54731. this.animationsList.push(r)
  54732. }
  54733. ,
  54734. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54735. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54736. var s = r.morphTargets[o].name.match(i);
  54737. if (s && 1 < s.length)
  54738. n[l = s[1]] || (n[l] = {
  54739. start: 1 / 0,
  54740. end: -1 / 0
  54741. }),
  54742. o < (c = n[l]).start && (c.start = o),
  54743. o > c.end && (c.end = o),
  54744. t = t || l
  54745. }
  54746. for (var l in n) {
  54747. var c = n[l];
  54748. this.createAnimation(l, c.start, c.end, e)
  54749. }
  54750. this.firstAnimation = t
  54751. }
  54752. ,
  54753. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54754. var t = this.animationsMap[e];
  54755. t && (t.direction = 1,
  54756. t.directionBackwards = !1)
  54757. }
  54758. ,
  54759. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54760. var t = this.animationsMap[e];
  54761. t && (t.direction = -1,
  54762. t.directionBackwards = !0)
  54763. }
  54764. ,
  54765. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54766. var i = this.animationsMap[e];
  54767. i && (i.fps = t,
  54768. i.duration = (i.end - i.start) / i.fps)
  54769. }
  54770. ,
  54771. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54772. var i = this.animationsMap[e];
  54773. i && (i.duration = t,
  54774. i.fps = (i.end - i.start) / i.duration)
  54775. }
  54776. ,
  54777. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54778. var i = this.animationsMap[e];
  54779. i && (i.weight = t)
  54780. }
  54781. ,
  54782. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54783. var i = this.animationsMap[e];
  54784. i && (i.time = t)
  54785. }
  54786. ,
  54787. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54788. var t = 0
  54789. , i = this.animationsMap[e];
  54790. return i && (t = i.time),
  54791. t
  54792. }
  54793. ,
  54794. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54795. var t = -1
  54796. , i = this.animationsMap[e];
  54797. return i && (t = i.duration),
  54798. t
  54799. }
  54800. ,
  54801. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54802. var t = this.animationsMap[e];
  54803. t ? (t.time = 0,
  54804. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54805. }
  54806. ,
  54807. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54808. var t = this.animationsMap[e];
  54809. t && (t.active = !1)
  54810. }
  54811. ,
  54812. Ci.MorphBlendMesh.prototype.update = function(e) {
  54813. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54814. var n = this.animationsList[t];
  54815. if (n.active) {
  54816. var r = n.duration / n.length;
  54817. n.time += n.direction * e,
  54818. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54819. n.time > n.duration && (n.time = n.duration,
  54820. n.directionBackwards = !0),
  54821. n.time < 0 && (n.time = 0,
  54822. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54823. n.time < 0 && (n.time += n.duration));
  54824. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54825. , a = n.weight;
  54826. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54827. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54828. this.morphTargetInfluences[o] = 0,
  54829. n.lastFrame = n.currentFrame,
  54830. n.currentFrame = o);
  54831. var s = n.time % r / r;
  54832. n.directionBackwards && (s = 1 - s),
  54833. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54834. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54835. }
  54836. }
  54837. }
  54838. ,
  54839. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54840. i.THREE = Ci) : this.THREE = Ci
  54841. window.THREE = Ci
  54842. getObjLoader()
  54843. }
  54844. , {}]
  54845. }, {}, [116]);